Skip to content

Commit

Permalink
net: Remove typedef net::URLRequestJob URLRequestJob;
Browse files Browse the repository at this point in the history
BUG=64263
TEST=compiled locally, trybots

Review URL: http://codereview.chromium.org/5607004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68935 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
tfarina@chromium.org committed Dec 11, 2010
1 parent 3f45597 commit 9acd869
Show file tree
Hide file tree
Showing 76 changed files with 231 additions and 220 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ bool ViewAppCacheInternalsJobFactory::IsSupportedURL(const GURL& url) {
}

// static.
URLRequestJob* ViewAppCacheInternalsJobFactory::CreateJobForRequest(
net::URLRequestJob* ViewAppCacheInternalsJobFactory::CreateJobForRequest(
net::URLRequest* request) {
URLRequestContext* context = request->context();
ChromeURLRequestContext* chrome_request_context =
Expand Down
11 changes: 6 additions & 5 deletions chrome/browser/automation/url_request_automation_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ URLRequestAutomationJob::URLRequestAutomationJob(
int request_id,
AutomationResourceMessageFilter* filter,
bool is_pending)
: URLRequestJob(request),
: net::URLRequestJob(request),
id_(0),
tab_(tab),
message_filter_(filter),
Expand Down Expand Up @@ -90,8 +90,9 @@ bool URLRequestAutomationJob::EnsureProtocolFactoryRegistered() {
return true;
}

URLRequestJob* URLRequestAutomationJob::Factory(net::URLRequest* request,
const std::string& scheme) {
net::URLRequestJob* URLRequestAutomationJob::Factory(
net::URLRequest* request,
const std::string& scheme) {
bool scheme_is_http = request->url().SchemeIs("http");
bool scheme_is_https = request->url().SchemeIs("https");

Expand Down Expand Up @@ -127,7 +128,7 @@ URLRequestJob* URLRequestAutomationJob::Factory(net::URLRequest* request,
return NULL;
}

// URLRequestJob Implementation.
// net::URLRequestJob Implementation.
void URLRequestAutomationJob::Start() {
if (!is_pending()) {
// Start reading asynchronously so that all error reporting and data
Expand All @@ -152,7 +153,7 @@ void URLRequestAutomationJob::Kill() {
}
}
DisconnectFromMessageFilter();
URLRequestJob::Kill();
net::URLRequestJob::Kill();
}

bool URLRequestAutomationJob::ReadRawData(
Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/automation/url_request_automation_job.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Message;
struct AutomationURLResponse;
}

// URLRequestJob implementation that loads the resources using
// net::URLRequestJob implementation that loads the resources using
// automation.
class URLRequestAutomationJob : public net::URLRequestJob {
public:
Expand All @@ -37,7 +37,7 @@ class URLRequestAutomationJob : public net::URLRequestJob {

static net::URLRequest::ProtocolFactory Factory;

// URLRequestJob methods.
// net::URLRequestJob methods.
virtual void Start();
virtual void Kill();
virtual bool GetMimeType(std::string* mime_type) const;
Expand Down Expand Up @@ -73,7 +73,7 @@ class URLRequestAutomationJob : public net::URLRequestJob {
AutomationResourceMessageFilter* new_filter);

protected:
// Protected URLRequestJob override.
// Protected net::URLRequestJob override.
virtual bool ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read);

void StartAsync();
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/chrome_plugin_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ using base::TimeDelta;
class PluginRequestInterceptor
: public PluginHelper, public net::URLRequest::Interceptor {
public:
static URLRequestJob* UninterceptedProtocolHandler(
static net::URLRequestJob* UninterceptedProtocolHandler(
net::URLRequest* request, const std::string& scheme) {
// This will get called if a plugin failed to intercept a request for a
// protocol it has registered. In that case, we return NULL and the request
Expand Down Expand Up @@ -97,7 +97,7 @@ class PluginRequestInterceptor
}

// net::URLRequest::Interceptor
virtual URLRequestJob* MaybeIntercept(net::URLRequest* request) {
virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request) {
// TODO(darin): This DCHECK fails in the unit tests because our interceptor
// is being persisted across unit tests. As a result, each time we get
// poked on a different thread, but never from more than one thread at a
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/chromeos/gview_request_interceptor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ GViewRequestInterceptor::~GViewRequestInterceptor() {
net::URLRequest::UnregisterRequestInterceptor(this);
}

URLRequestJob* GViewRequestInterceptor::MaybeIntercept(
net::URLRequestJob* GViewRequestInterceptor::MaybeIntercept(
net::URLRequest* request) {
// Don't attempt to intercept here as we want to wait until the mime
// type is fully determined.
return NULL;
}

URLRequestJob* GViewRequestInterceptor::MaybeInterceptResponse(
net::URLRequestJob* GViewRequestInterceptor::MaybeInterceptResponse(
net::URLRequest* request) {
// Do not intercept this request if it is a download.
if (request->load_flags() & net::LOAD_IS_DOWNLOAD) {
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/chromeos/gview_request_interceptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class GViewRequestInterceptor : public net::URLRequest::Interceptor {
virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request);

// Determines if the requested document can be viewed by the Google
// Document Viewer. If it can, returns a URLRequestJob that
// Document Viewer. If it can, returns a net::URLRequestJob that
// redirects the browser to the view URL.
virtual net::URLRequestJob* MaybeInterceptResponse(net::URLRequest* request);

Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/chromeos/gview_request_interceptor_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class GViewURLRequestTestJob : public URLRequestTestJob {
// created -- the first is for the viewable document URL, and the
// second is for the rediected URL. In order to test the
// interceptor, the mime type of the first request must be one of
// the supported viewable mime types. So when the URLRequestJob
// the supported viewable mime types. So when the net::URLRequestJob
// is a request for one of the test URLs that point to viewable
// content, return an appropraite mime type. Otherwise, return
// "text/html".
Expand Down Expand Up @@ -60,8 +60,8 @@ class GViewRequestInterceptorTest : public testing::Test {
message_loop_.RunAllPending();
}

static URLRequestJob* Factory(net::URLRequest* request,
const std::string& scheme) {
static net::URLRequestJob* Factory(net::URLRequest* request,
const std::string& scheme) {
return new GViewURLRequestTestJob(request);
}

Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/chromeos/login/account_screen_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ static void QuitUIMessageLoop() {
static bool inspector_called = false; // had to use global flag as
// InspectorHook() doesn't have context.

static URLRequestJob* InspectorHook(net::URLRequest* request,
const std::string& scheme) {
static net::URLRequestJob* InspectorHook(net::URLRequest* request,
const std::string& scheme) {
VLOG(1) << "Intercepted: " << request->url() << ", scheme: " << scheme;

// Expect that the parameters are the same as new_account.html gave us.
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/chromeos/login/registration_screen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ void RegistrationScreen::CloseScreen(ScreenObserver::ExitCodes code) {
}

// static
URLRequestJob* RegistrationScreen::Factory(net::URLRequest* request,
const std::string& scheme) {
net::URLRequestJob* RegistrationScreen::Factory(net::URLRequest* request,
const std::string& scheme) {
VLOG(1) << "Handling url: " << request->url().spec().c_str();
return new URLRequestAboutJob(request);
}
Expand Down
16 changes: 8 additions & 8 deletions chrome/browser/dom_ui/chrome_url_data_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
#include "net/url_request/url_request_file_job.h"
#include "net/url_request/url_request_job.h"

// URLRequestChromeJob is a URLRequestJob that manages running chrome-internal
// resource requests asynchronously.
// URLRequestChromeJob is a net::URLRequestJob that manages running
// chrome-internal resource requests asynchronously.
// It hands off URL requests to ChromeURLDataManager, which asynchronously
// calls back once the data is available.
class URLRequestChromeJob : public net::URLRequestJob {
public:
explicit URLRequestChromeJob(net::URLRequest* request);

// URLRequestJob implementation.
// net::URLRequestJob implementation.
virtual void Start();
virtual void Kill();
virtual bool ReadRawData(net::IOBuffer* buf, int buf_size, int *bytes_read);
Expand All @@ -60,7 +60,7 @@ class URLRequestChromeJob : public net::URLRequestJob {
virtual ~URLRequestChromeJob();

// Helper for Start(), to let us start asynchronously.
// (This pattern is shared by most URLRequestJob implementations.)
// (This pattern is shared by most net::URLRequestJob implementations.)
void StartAsync();

// Do the actual copy from data_ (the data we're serving) into |buf|.
Expand All @@ -82,7 +82,7 @@ class URLRequestChromeJob : public net::URLRequestJob {
DISALLOW_COPY_AND_ASSIGN(URLRequestChromeJob);
};

// URLRequestChromeFileJob is a URLRequestJob that acts like a file:// URL
// URLRequestChromeFileJob is a net::URLRequestJob that acts like a file:// URL
class URLRequestChromeFileJob : public URLRequestFileJob {
public:
URLRequestChromeFileJob(net::URLRequest* request, const FilePath& path);
Expand Down Expand Up @@ -322,8 +322,8 @@ void ChromeURLDataManager::DataSource::SetFontAndTextDirection(
base::i18n::IsRTL() ? "rtl" : "ltr");
}

URLRequestJob* ChromeURLDataManager::Factory(net::URLRequest* request,
const std::string& scheme) {
net::URLRequestJob* ChromeURLDataManager::Factory(net::URLRequest* request,
const std::string& scheme) {
// Try first with a file handler
FilePath path;
if (ChromeURLDataManager::URLToFilePath(request->url(), &path))
Expand All @@ -346,7 +346,7 @@ URLRequestJob* ChromeURLDataManager::Factory(net::URLRequest* request,
}

URLRequestChromeJob::URLRequestChromeJob(net::URLRequest* request)
: URLRequestJob(request),
: net::URLRequestJob(request),
data_offset_(0),
pending_buf_size_(0) {
}
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/dom_ui/mediaplayer_ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ void MediaPlayer::PopupMediaPlayer(Browser* creator) {
mediaplayer_browser_->window()->Show();
}

URLRequestJob* MediaPlayer::MaybeIntercept(net::URLRequest* request) {
net::URLRequestJob* MediaPlayer::MaybeIntercept(net::URLRequest* request) {
// Don't attempt to intercept here as we want to wait until the mime
// type is fully determined.
return NULL;
Expand All @@ -557,7 +557,7 @@ static const char* const supported_mime_type_list[] = {
"audio/mp3"
};

URLRequestJob* MediaPlayer::MaybeInterceptResponse(
net::URLRequestJob* MediaPlayer::MaybeInterceptResponse(
net::URLRequest* request) {
// Do not intercept this request if it is a download.
if (request->load_flags() & net::LOAD_IS_DOWNLOAD) {
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/dom_ui/mediaplayer_ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class MediaPlayer : public NotificationObserver,
virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request);

// Determines if the requested document can be viewed by the
// MediaPlayer. If it can, returns a URLRequestJob that
// MediaPlayer. If it can, returns a net::URLRequestJob that
// redirects the browser to the view URL.
// Implementation of net::URLRequest::Interceptor.
virtual net::URLRequestJob* MaybeInterceptResponse(net::URLRequest* request);
Expand Down
3 changes: 2 additions & 1 deletion chrome/browser/extensions/autoupdate_interceptor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ AutoUpdateInterceptor::~AutoUpdateInterceptor() {
net::URLRequest::UnregisterRequestInterceptor(this);
}

URLRequestJob* AutoUpdateInterceptor::MaybeIntercept(net::URLRequest* request) {
net::URLRequestJob* AutoUpdateInterceptor::MaybeIntercept(
net::URLRequest* request) {
EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (request->url().scheme() != "http" ||
request->url().host() != "localhost") {
Expand Down
10 changes: 6 additions & 4 deletions chrome/browser/extensions/extension_protocols.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,9 @@ bool AllowExtensionResourceLoad(net::URLRequest* request,

// Factory registered with net::URLRequest to create URLRequestJobs for
// extension:// URLs.
static URLRequestJob* CreateExtensionURLRequestJob(net::URLRequest* request,
const std::string& scheme) {
static net::URLRequestJob* CreateExtensionURLRequestJob(
net::URLRequest* request,
const std::string& scheme) {
ChromeURLRequestContext* context =
static_cast<ChromeURLRequestContext*>(request->context());

Expand Down Expand Up @@ -203,8 +204,9 @@ static URLRequestJob* CreateExtensionURLRequestJob(net::URLRequest* request,

// Factory registered with net::URLRequest to create URLRequestJobs for
// chrome-user-script:/ URLs.
static URLRequestJob* CreateUserScriptURLRequestJob(net::URLRequest* request,
const std::string& scheme) {
static net::URLRequestJob* CreateUserScriptURLRequestJob(
net::URLRequest* request,
const std::string& scheme) {
ChromeURLRequestContext* context =
static_cast<ChromeURLRequestContext*>(request->context());

Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/extensions/user_script_listener_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ ResourceDispatcherHostRequestInfo* CreateRequestInfo(int request_id) {
0, false, false, false, -1, -1);
}

// A simple test URLRequestJob. We don't care what it does, only that whether it
// starts and finishes.
// A simple test net::URLRequestJob. We don't care what it does, only that
// whether it starts and finishes.
class SimpleTestJob : public URLRequestTestJob {
public:
explicit SimpleTestJob(net::URLRequest* request)
Expand Down Expand Up @@ -136,7 +136,7 @@ class UserScriptListenerTest
}

// net::URLRequest::Interceptor
virtual URLRequestJob* MaybeIntercept(net::URLRequest* request) {
virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request) {
return new SimpleTestJob(request);
}

Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/net/blob_url_request_job_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

namespace {

URLRequestJob* BlobURLRequestJobFactory(net::URLRequest* request,
const std::string& scheme) {
net::URLRequestJob* BlobURLRequestJobFactory(net::URLRequest* request,
const std::string& scheme) {
scoped_refptr<webkit_blob::BlobData> data;
ResourceDispatcherHostRequestInfo* info =
ResourceDispatcherHost::InfoForRequest(request);
Expand Down
10 changes: 5 additions & 5 deletions chrome/browser/net/metadata_url_request.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ class MetadataRequestHandler : public net::URLRequestJob {
public:
explicit MetadataRequestHandler(net::URLRequest* request);

static URLRequestJob* Factory(net::URLRequest* request,
const std::string& scheme);
static net::URLRequestJob* Factory(net::URLRequest* request,
const std::string& scheme);

// URLRequestJob implementation.
// net::URLRequestJob implementation.
virtual void Start();
virtual void Kill();
virtual bool ReadRawData(net::IOBuffer* buf, int buf_size, int *bytes_read);
Expand All @@ -41,15 +41,15 @@ class MetadataRequestHandler : public net::URLRequestJob {
};

MetadataRequestHandler::MetadataRequestHandler(net::URLRequest* request)
: URLRequestJob(request),
: net::URLRequestJob(request),
data_offset_(0) {
parsed = false;
}

MetadataRequestHandler::~MetadataRequestHandler() {
}

URLRequestJob* MetadataRequestHandler::Factory(net::URLRequest* request,
net::URLRequestJob* MetadataRequestHandler::Factory(net::URLRequest* request,
const std::string& scheme) {
return new MetadataRequestHandler(request);
}
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/net/url_request_failed_dns_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const char URLRequestFailedDnsJob::kTestUrl[] =
"http://url.handled.by.fake.dns/";

URLRequestFailedDnsJob::URLRequestFailedDnsJob(net::URLRequest* request)
: URLRequestJob(request),
: net::URLRequestJob(request),
ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) {}

URLRequestFailedDnsJob::~URLRequestFailedDnsJob() {}
Expand All @@ -35,7 +35,7 @@ void URLRequestFailedDnsJob::AddUrlHandler() {
}

/*static */
URLRequestJob* URLRequestFailedDnsJob::Factory(net::URLRequest* request,
net::URLRequestJob* URLRequestFailedDnsJob::Factory(net::URLRequest* request,
const std::string& scheme) {
return new URLRequestFailedDnsJob(request);
}
Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/net/url_request_mock_http_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ static const FilePath::CharType kMockHeaderFileSuffix[] =
FilePath URLRequestMockHTTPJob::base_path_;

/* static */
URLRequestJob* URLRequestMockHTTPJob::Factory(net::URLRequest* request,
const std::string& scheme) {
net::URLRequestJob* URLRequestMockHTTPJob::Factory(net::URLRequest* request,
const std::string& scheme) {
return new URLRequestMockHTTPJob(request,
GetOnDiskPath(base_path_, request, scheme));
}
Expand Down Expand Up @@ -82,7 +82,7 @@ bool URLRequestMockHTTPJob::IsRedirectResponse(GURL* location,
int* http_status_code) {
// Override the URLRequestFileJob implementation to invoke the default one
// based on HttpResponseInfo.
return URLRequestJob::IsRedirectResponse(location, http_status_code);
return net::URLRequestJob::IsRedirectResponse(location, http_status_code);
}

// Private const version.
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/net/url_request_mock_http_job.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// A URLRequestJob class that pulls the content and http headers from disk.
// A net::URLRequestJob class that pulls the content and http headers from disk.

#ifndef CHROME_BROWSER_NET_URL_REQUEST_MOCK_HTTP_JOB_H_
#define CHROME_BROWSER_NET_URL_REQUEST_MOCK_HTTP_JOB_H_
Expand Down
Loading

0 comments on commit 9acd869

Please sign in to comment.