diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-30 21:34:02 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-30 21:34:02 +0000 |
commit | 6981d96328621a75557dbf843c5aab83bf4f55a3 (patch) | |
tree | 8a95daea7aad9b8bce1ced62fda4068ed296125a /chrome | |
parent | d4e04a67c7f529bc8137c2dc5618e5a8c2123a13 (diff) | |
download | chromium_src-6981d96328621a75557dbf843c5aab83bf4f55a3.zip chromium_src-6981d96328621a75557dbf843c5aab83bf4f55a3.tar.gz chromium_src-6981d96328621a75557dbf843c5aab83bf4f55a3.tar.bz2 |
net: Remove typedef net::URLRequest URLRequest;
BUG=64263
TEST=compiled locally, trybots
Review URL: http://codereview.chromium.org/5384002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67762 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
99 files changed, 466 insertions, 446 deletions
diff --git a/chrome/browser/appcache/view_appcache_internals_job_factory.cc b/chrome/browser/appcache/view_appcache_internals_job_factory.cc index 6bd384d..685be40 100644 --- a/chrome/browser/appcache/view_appcache_internals_job_factory.cc +++ b/chrome/browser/appcache/view_appcache_internals_job_factory.cc @@ -19,11 +19,10 @@ bool ViewAppCacheInternalsJobFactory::IsSupportedURL(const GURL& url) { // static. URLRequestJob* ViewAppCacheInternalsJobFactory::CreateJobForRequest( - URLRequest* request) { + net::URLRequest* request) { URLRequestContext* context = request->context(); ChromeURLRequestContext* chrome_request_context = reinterpret_cast<ChromeURLRequestContext*>(context); return new appcache::ViewAppCacheInternalsJob( request, chrome_request_context->appcache_service()); } - diff --git a/chrome/browser/autocomplete/autocomplete.cc b/chrome/browser/autocomplete/autocomplete.cc index 01d36fa..66a91a6 100644 --- a/chrome/browser/autocomplete/autocomplete.cc +++ b/chrome/browser/autocomplete/autocomplete.cc @@ -148,13 +148,13 @@ AutocompleteInput::Type AutocompleteInput::Parse( if (parts->scheme.is_nonempty() && (parsed_scheme != L"http") && (parsed_scheme != L"https")) { // See if we know how to handle the URL internally. - if (URLRequest::IsHandledProtocol(WideToASCII(parsed_scheme))) + if (net::URLRequest::IsHandledProtocol(WideToASCII(parsed_scheme))) return URL; // There are also some schemes that we convert to other things before they // reach the renderer or else the renderer handles internally without - // reaching the URLRequest logic. We thus won't catch these above, but we - // should still claim to handle them. + // reaching the net::URLRequest logic. We thus won't catch these above, but + // we should still claim to handle them. if (LowerCaseEqualsASCII(parsed_scheme, chrome::kViewSourceScheme) || LowerCaseEqualsASCII(parsed_scheme, chrome::kJavaScriptScheme) || LowerCaseEqualsASCII(parsed_scheme, chrome::kDataScheme)) diff --git a/chrome/browser/automation/url_request_automation_job.cc b/chrome/browser/automation/url_request_automation_job.cc index 1b73b68..cd3e484 100644 --- a/chrome/browser/automation/url_request_automation_job.cc +++ b/chrome/browser/automation/url_request_automation_job.cc @@ -39,13 +39,17 @@ static const char* const kFilteredHeaderStrings[] = { int URLRequestAutomationJob::instance_count_ = 0; bool URLRequestAutomationJob::is_protocol_factory_registered_ = false; -URLRequest::ProtocolFactory* URLRequestAutomationJob::old_http_factory_ +net::URLRequest::ProtocolFactory* URLRequestAutomationJob::old_http_factory_ = NULL; -URLRequest::ProtocolFactory* URLRequestAutomationJob::old_https_factory_ +net::URLRequest::ProtocolFactory* URLRequestAutomationJob::old_https_factory_ = NULL; -URLRequestAutomationJob::URLRequestAutomationJob(URLRequest* request, int tab, - int request_id, AutomationResourceMessageFilter* filter, bool is_pending) +URLRequestAutomationJob::URLRequestAutomationJob( + net::URLRequest* request, + int tab, + int request_id, + AutomationResourceMessageFilter* filter, + bool is_pending) : URLRequestJob(request), id_(0), tab_(tab), @@ -73,18 +77,18 @@ bool URLRequestAutomationJob::EnsureProtocolFactoryRegistered() { if (!is_protocol_factory_registered_) { old_http_factory_ = - URLRequest::RegisterProtocolFactory("http", - &URLRequestAutomationJob::Factory); + net::URLRequest::RegisterProtocolFactory( + "http", &URLRequestAutomationJob::Factory); old_https_factory_ = - URLRequest::RegisterProtocolFactory("https", - &URLRequestAutomationJob::Factory); + net::URLRequest::RegisterProtocolFactory( + "https", &URLRequestAutomationJob::Factory); is_protocol_factory_registered_ = true; } return true; } -URLRequestJob* URLRequestAutomationJob::Factory(URLRequest* request, +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"); diff --git a/chrome/browser/automation/url_request_automation_job.h b/chrome/browser/automation/url_request_automation_job.h index 06401d7..d19c14c 100644 --- a/chrome/browser/automation/url_request_automation_job.h +++ b/chrome/browser/automation/url_request_automation_job.h @@ -27,14 +27,14 @@ struct AutomationURLResponse; // automation. class URLRequestAutomationJob : public net::URLRequestJob { public: - URLRequestAutomationJob(URLRequest* request, int tab, int request_id, + URLRequestAutomationJob(net::URLRequest* request, int tab, int request_id, AutomationResourceMessageFilter* filter, bool is_pending); // Register our factory for HTTP/HTTPs requests. static bool EnsureProtocolFactoryRegistered(); - static URLRequest::ProtocolFactory Factory; + static net::URLRequest::ProtocolFactory Factory; // URLRequestJob methods. virtual void Start(); @@ -110,8 +110,8 @@ class URLRequestAutomationJob : public net::URLRequestJob { static bool is_protocol_factory_registered_; // The previous HTTP/HTTPs protocol factories. We pass unhandled // requests off to these factories - static URLRequest::ProtocolFactory* old_http_factory_; - static URLRequest::ProtocolFactory* old_https_factory_; + static net::URLRequest::ProtocolFactory* old_http_factory_; + static net::URLRequest::ProtocolFactory* old_https_factory_; // Set to true if the job is waiting for the external host to connect to the // automation channel, which will be used for routing the network requests to diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index 0d3ddb3..b86e260 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -1076,8 +1076,8 @@ int BrowserMain(const MainFunctionParams& parameters) { if (parsed_command_line.HasSwitch(switches::kImport) || parsed_command_line.HasSwitch(switches::kImportFromFile)) { // We use different BrowserProcess when importing so no GoogleURLTracker is - // instantiated (as it makes a URLRequest and we don't have an IO thread, - // see bug #1292702). + // instantiated (as it makes a net::URLRequest and we don't have an IO + // thread, see bug #1292702). browser_process.reset(new FirstRunBrowserProcess(parsed_command_line)); is_first_run = false; } else { @@ -1321,7 +1321,7 @@ int BrowserMain(const MainFunctionParams& parameters) { // Allow access to file:// on ChromeOS for tests. if (parsed_command_line.HasSwitch(switches::kAllowFileAccess)) { - URLRequest::AllowFileAccess(); + net::URLRequest::AllowFileAccess(); } // There are two use cases for kLoginUser: diff --git a/chrome/browser/child_process_security_policy.cc b/chrome/browser/child_process_security_policy.cc index 0aed464..941058d 100644 --- a/chrome/browser/child_process_security_policy.cc +++ b/chrome/browser/child_process_security_policy.cc @@ -350,7 +350,7 @@ bool ChildProcessSecurityPolicy::CanRequestURL( return false; } - if (!URLRequest::IsHandledURL(url)) + if (!net::URLRequest::IsHandledURL(url)) return true; // This URL request is destined for ShellExecute. { diff --git a/chrome/browser/child_process_security_policy_unittest.cc b/chrome/browser/child_process_security_policy_unittest.cc index 26f794f..cc31188 100644 --- a/chrome/browser/child_process_security_policy_unittest.cc +++ b/chrome/browser/child_process_security_policy_unittest.cc @@ -18,11 +18,11 @@ class ChildProcessSecurityPolicyTest : public testing::Test { // testing::Test virtual void SetUp() { // In the real world, "chrome:" is a handled scheme. - URLRequest::RegisterProtocolFactory(chrome::kChromeUIScheme, - &URLRequestTestJob::Factory); + net::URLRequest::RegisterProtocolFactory(chrome::kChromeUIScheme, + &URLRequestTestJob::Factory); } virtual void TearDown() { - URLRequest::RegisterProtocolFactory(chrome::kChromeUIScheme, NULL); + net::URLRequest::RegisterProtocolFactory(chrome::kChromeUIScheme, NULL); } }; @@ -133,7 +133,7 @@ TEST_F(ChildProcessSecurityPolicyTest, RegisterWebSafeSchemeTest) { EXPECT_TRUE(p->CanRequestURL(kRendererID, GURL("asdf:rockers"))); // Once we register a ProtocolFactory for "asdf", we default to deny. - URLRequest::RegisterProtocolFactory("asdf", &URLRequestTestJob::Factory); + net::URLRequest::RegisterProtocolFactory("asdf", &URLRequestTestJob::Factory); EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("asdf:rockers"))); // We can allow new schemes by adding them to the whitelist. @@ -141,7 +141,7 @@ TEST_F(ChildProcessSecurityPolicyTest, RegisterWebSafeSchemeTest) { EXPECT_TRUE(p->CanRequestURL(kRendererID, GURL("asdf:rockers"))); // Cleanup. - URLRequest::RegisterProtocolFactory("asdf", NULL); + net::URLRequest::RegisterProtocolFactory("asdf", NULL); EXPECT_TRUE(p->CanRequestURL(kRendererID, GURL("asdf:rockers"))); p->Remove(kRendererID); diff --git a/chrome/browser/chrome_plugin_host.cc b/chrome/browser/chrome_plugin_host.cc index a044306..1f74ca4 100644 --- a/chrome/browser/chrome_plugin_host.cc +++ b/chrome/browser/chrome_plugin_host.cc @@ -54,10 +54,10 @@ using base::TimeDelta; // intercept the request. // NOTE: All methods must be called on the IO thread. class PluginRequestInterceptor - : public PluginHelper, public URLRequest::Interceptor { + : public PluginHelper, public net::URLRequest::Interceptor { public: static URLRequestJob* UninterceptedProtocolHandler( - URLRequest* request, const std::string& scheme) { + 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 // will result in an error. @@ -66,17 +66,17 @@ class PluginRequestInterceptor explicit PluginRequestInterceptor(ChromePluginLib* plugin) : PluginHelper(plugin) { - URLRequest::RegisterRequestInterceptor(this); + net::URLRequest::RegisterRequestInterceptor(this); } virtual ~PluginRequestInterceptor() { - URLRequest::UnregisterRequestInterceptor(this); + net::URLRequest::UnregisterRequestInterceptor(this); // Unregister our protocols. for (HandledProtocolList::iterator it = registered_protocols_.begin(); it != registered_protocols_.end(); ++it) { - URLRequest::ProtocolFactory* factory = - URLRequest::RegisterProtocolFactory(*it, NULL); + net::URLRequest::ProtocolFactory* factory = + net::URLRequest::RegisterProtocolFactory(*it, NULL); DCHECK(factory == UninterceptedProtocolHandler); } } @@ -87,17 +87,17 @@ class PluginRequestInterceptor std::string lower_scheme = StringToLowerASCII(scheme); handled_protocols_.insert(lower_scheme); - // Only add a protocol factory if the URLRequest doesn't already handle + // Only add a protocol factory if the net::URLRequest doesn't already handle // it. If we fail to intercept, the request will be treated as an error. - if (!URLRequest::IsHandledProtocol(lower_scheme)) { + if (!net::URLRequest::IsHandledProtocol(lower_scheme)) { registered_protocols_.insert(lower_scheme); - URLRequest::RegisterProtocolFactory(lower_scheme, + net::URLRequest::RegisterProtocolFactory(lower_scheme, &UninterceptedProtocolHandler); } } - // URLRequest::Interceptor - virtual URLRequestJob* MaybeIntercept(URLRequest* request) { + // net::URLRequest::Interceptor + virtual 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 @@ -143,9 +143,10 @@ class PluginRequestInterceptor }; // This class manages a network request made by the plugin, also acting as -// the URLRequest delegate. +// the net::URLRequest delegate. // NOTE: All methods must be called on the IO thread. -class PluginRequestHandler : public PluginHelper, public URLRequest::Delegate { +class PluginRequestHandler : public PluginHelper, + public net::URLRequest::Delegate { public: static PluginRequestHandler* FromCPRequest(CPRequest* request) { return ScopableCPRequest::GetData<PluginRequestHandler*>(request); @@ -162,15 +163,15 @@ class PluginRequestHandler : public PluginHelper, public URLRequest::Delegate { context = Profile::GetDefaultRequestContext()->GetURLRequestContext(); GURL gurl(cprequest_->url); - request_.reset(new URLRequest(gurl, this)); + request_.reset(new net::URLRequest(gurl, this)); request_->set_context(context); request_->set_method(cprequest_->method); request_->set_load_flags(PluginResponseUtils::CPLoadFlagsToNetFlags(0)); } - URLRequest* request() { return request_.get(); } + net::URLRequest* request() { return request_.get(); } - // Wraper of URLRequest::Read() + // Wraper of net::URLRequest::Read() bool Read(char* dest, int dest_size, int *bytes_read) { CHECK(!my_buffer_.get()); // We'll use our own buffer until the read actually completes. @@ -189,14 +190,14 @@ class PluginRequestHandler : public PluginHelper, public URLRequest::Delegate { return false; } - // URLRequest::Delegate - virtual void OnReceivedRedirect(URLRequest* request, const GURL& new_url, + // net::URLRequest::Delegate + virtual void OnReceivedRedirect(net::URLRequest* request, const GURL& new_url, bool* defer_redirect) { plugin_->functions().response_funcs->received_redirect( cprequest_.get(), new_url.spec().c_str()); } - virtual void OnResponseStarted(URLRequest* request) { + virtual void OnResponseStarted(net::URLRequest* request) { // TODO(mpcomplete): better error codes CPError result = request_->status().is_success() ? CPERR_SUCCESS : CPERR_FAILURE; @@ -204,7 +205,7 @@ class PluginRequestHandler : public PluginHelper, public URLRequest::Delegate { cprequest_.get(), result); } - virtual void OnReadCompleted(URLRequest* request, int bytes_read) { + virtual void OnReadCompleted(net::URLRequest* request, int bytes_read) { CHECK(my_buffer_.get()); CHECK(user_buffer_); if (bytes_read > 0) { @@ -220,7 +221,7 @@ class PluginRequestHandler : public PluginHelper, public URLRequest::Delegate { private: scoped_ptr<ScopableCPRequest> cprequest_; - scoped_ptr<URLRequest> request_; + scoped_ptr<net::URLRequest> request_; scoped_refptr<net::IOBuffer> my_buffer_; char* user_buffer_; }; diff --git a/chrome/browser/chrome_plugin_unittest.cc b/chrome/browser/chrome_plugin_unittest.cc index a7eee5b..0107a04 100644 --- a/chrome/browser/chrome_plugin_unittest.cc +++ b/chrome/browser/chrome_plugin_unittest.cc @@ -42,7 +42,8 @@ class TestURLRequestContextGetter : public URLRequestContextGetter { scoped_refptr<URLRequestContext> context_; }; -class ChromePluginTest : public testing::Test, public URLRequest::Delegate { +class ChromePluginTest : public testing::Test, + public net::URLRequest::Delegate { public: ChromePluginTest() : io_thread_(BrowserThread::IO, &message_loop_), @@ -62,17 +63,18 @@ class ChromePluginTest : public testing::Test, public URLRequest::Delegate { // is NULL, the request is expected to fail. void RunTest(const GURL& url, const TestResponsePayload* expected_payload); - // URLRequest::Delegate implementations - virtual void OnResponseStarted(URLRequest* request); - virtual void OnReadCompleted(URLRequest* request, int bytes_read); + // net::URLRequest::Delegate implementations + virtual void OnResponseStarted(net::URLRequest* request); + virtual void OnReadCompleted(net::URLRequest* request, int bytes_read); - // Helper called when the URLRequest is done. + // Helper called when the net::URLRequest is done. void OnURLRequestComplete(); // testing::Test virtual void SetUp() { LoadPlugin(); - URLRequest::RegisterProtocolFactory("test", &URLRequestTestJob::Factory); + net::URLRequest::RegisterProtocolFactory("test", + &URLRequestTestJob::Factory); // We need to setup a default request context in order to issue HTTP // requests. @@ -81,7 +83,7 @@ class ChromePluginTest : public testing::Test, public URLRequest::Delegate { } virtual void TearDown() { UnloadPlugin(); - URLRequest::RegisterProtocolFactory("test", NULL); + net::URLRequest::RegisterProtocolFactory("test", NULL); Profile::set_default_request_context(NULL); @@ -96,9 +98,9 @@ class ChromePluginTest : public testing::Test, public URLRequest::Delegate { MessageLoopForIO message_loop_; BrowserThread io_thread_; - // Note: we use URLRequest (instead of URLFetcher) because this allows the - // request to be intercepted. - scoped_ptr<URLRequest> request_; + // Note: we use net::URLRequest (instead of URLFetcher) because this allows + // the request to be intercepted. + scoped_ptr<net::URLRequest> request_; scoped_refptr<net::IOBuffer> response_buffer_; std::string response_data_; @@ -166,14 +168,14 @@ void ChromePluginTest::RunTest(const GURL& url, expected_payload_ = expected_payload; response_data_.clear(); - request_.reset(new URLRequest(url, this)); + request_.reset(new net::URLRequest(url, this)); request_->set_context(new TestURLRequestContext()); request_->Start(); MessageLoop::current()->Run(); } -void ChromePluginTest::OnResponseStarted(URLRequest* request) { +void ChromePluginTest::OnResponseStarted(net::URLRequest* request) { DCHECK(request == request_); int bytes_read = 0; @@ -182,7 +184,8 @@ void ChromePluginTest::OnResponseStarted(URLRequest* request) { OnReadCompleted(request_.get(), bytes_read); } -void ChromePluginTest::OnReadCompleted(URLRequest* request, int bytes_read) { +void ChromePluginTest::OnReadCompleted(net::URLRequest* request, + int bytes_read) { DCHECK(request == request_); do { diff --git a/chrome/browser/chromeos/gview_request_interceptor.cc b/chrome/browser/chromeos/gview_request_interceptor.cc index 1d2b9cc..c2e0e4b 100644 --- a/chrome/browser/chromeos/gview_request_interceptor.cc +++ b/chrome/browser/chromeos/gview_request_interceptor.cc @@ -33,24 +33,25 @@ static const char* const supported_mime_type_list[] = { static const char* const kGViewUrlPrefix = "http://docs.google.com/gview?url="; GViewRequestInterceptor::GViewRequestInterceptor() { - URLRequest::RegisterRequestInterceptor(this); + net::URLRequest::RegisterRequestInterceptor(this); for (size_t i = 0; i < arraysize(supported_mime_type_list); ++i) { supported_mime_types_.insert(supported_mime_type_list[i]); } } GViewRequestInterceptor::~GViewRequestInterceptor() { - URLRequest::UnregisterRequestInterceptor(this); + net::URLRequest::UnregisterRequestInterceptor(this); } -URLRequestJob* GViewRequestInterceptor::MaybeIntercept(URLRequest* request) { +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( - URLRequest* request) { + net::URLRequest* request) { // Do not intercept this request if it is a download. if (request->load_flags() & net::LOAD_IS_DOWNLOAD) { return NULL; @@ -79,7 +80,8 @@ URLRequestJob* GViewRequestInterceptor::MaybeInterceptResponse( return NULL; } -URLRequest::Interceptor* GViewRequestInterceptor::GetGViewRequestInterceptor() { +net::URLRequest::Interceptor* +GViewRequestInterceptor::GetGViewRequestInterceptor() { return Singleton<GViewRequestInterceptor>::get(); } diff --git a/chrome/browser/chromeos/gview_request_interceptor.h b/chrome/browser/chromeos/gview_request_interceptor.h index 0e698fb..7642d1d 100644 --- a/chrome/browser/chromeos/gview_request_interceptor.h +++ b/chrome/browser/chromeos/gview_request_interceptor.h @@ -18,7 +18,7 @@ namespace chromeos { // document types (such as PDF) and redirect the request to the Google // Document Viewer, including the document's original URL as a // parameter. -class GViewRequestInterceptor : public URLRequest::Interceptor { +class GViewRequestInterceptor : public net::URLRequest::Interceptor { public: GViewRequestInterceptor(); virtual ~GViewRequestInterceptor(); @@ -33,7 +33,7 @@ class GViewRequestInterceptor : public URLRequest::Interceptor { virtual net::URLRequestJob* MaybeInterceptResponse(net::URLRequest* request); // Singleton accessor. - static URLRequest::Interceptor* GetGViewRequestInterceptor(); + static net::URLRequest::Interceptor* GetGViewRequestInterceptor(); private: // The list of supported mime types. diff --git a/chrome/browser/chromeos/gview_request_interceptor_unittest.cc b/chrome/browser/chromeos/gview_request_interceptor_unittest.cc index 7ba3b5d..1f3b7be 100644 --- a/chrome/browser/chromeos/gview_request_interceptor_unittest.cc +++ b/chrome/browser/chromeos/gview_request_interceptor_unittest.cc @@ -19,7 +19,7 @@ namespace chromeos { class GViewURLRequestTestJob : public URLRequestTestJob { public: - explicit GViewURLRequestTestJob(URLRequest* request) + explicit GViewURLRequestTestJob(net::URLRequest* request) : URLRequestTestJob(request, true) { } @@ -49,18 +49,18 @@ class GViewURLRequestTestJob : public URLRequestTestJob { class GViewRequestInterceptorTest : public testing::Test { public: virtual void SetUp() { - URLRequest::RegisterProtocolFactory("http", + net::URLRequest::RegisterProtocolFactory("http", &GViewRequestInterceptorTest::Factory); interceptor_ = GViewRequestInterceptor::GetGViewRequestInterceptor(); ASSERT_TRUE(PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf_path_)); } virtual void TearDown() { - URLRequest::RegisterProtocolFactory("http", NULL); + net::URLRequest::RegisterProtocolFactory("http", NULL); message_loop_.RunAllPending(); } - static URLRequestJob* Factory(URLRequest* request, + static URLRequestJob* Factory(net::URLRequest* request, const std::string& scheme) { return new GViewURLRequestTestJob(request); } @@ -101,12 +101,12 @@ class GViewRequestInterceptorTest : public testing::Test { protected: MessageLoopForIO message_loop_; TestDelegate test_delegate_; - URLRequest::Interceptor* interceptor_; + net::URLRequest::Interceptor* interceptor_; FilePath pdf_path_; }; TEST_F(GViewRequestInterceptorTest, DoNotInterceptHtml) { - URLRequest request(GURL("http://foo.com/index.html"), &test_delegate_); + net::URLRequest request(GURL("http://foo.com/index.html"), &test_delegate_); request.Start(); MessageLoop::current()->Run(); EXPECT_EQ(0, test_delegate_.received_redirect_count()); @@ -114,7 +114,7 @@ TEST_F(GViewRequestInterceptorTest, DoNotInterceptHtml) { } TEST_F(GViewRequestInterceptorTest, DoNotInterceptDownload) { - URLRequest request(GURL("http://foo.com/file.pdf"), &test_delegate_); + net::URLRequest request(GURL("http://foo.com/file.pdf"), &test_delegate_); request.set_load_flags(net::LOAD_IS_DOWNLOAD); request.Start(); MessageLoop::current()->Run(); @@ -132,7 +132,7 @@ TEST_F(GViewRequestInterceptorTest, DoNotInterceptPdfWhenEnabled) { EXPECT_TRUE(pdf_plugin_enabled); } - URLRequest request(GURL("http://foo.com/file.pdf"), &test_delegate_); + net::URLRequest request(GURL("http://foo.com/file.pdf"), &test_delegate_); request.Start(); MessageLoop::current()->Run(); EXPECT_EQ(0, test_delegate_.received_redirect_count()); @@ -149,7 +149,7 @@ TEST_F(GViewRequestInterceptorTest, InterceptPdfWhenDisabled) { EXPECT_TRUE(pdf_plugin_disabled); } - URLRequest request(GURL("http://foo.com/file.pdf"), &test_delegate_); + net::URLRequest request(GURL("http://foo.com/file.pdf"), &test_delegate_); request.Start(); MessageLoop::current()->Run(); EXPECT_EQ(1, test_delegate_.received_redirect_count()); @@ -162,7 +162,7 @@ TEST_F(GViewRequestInterceptorTest, InterceptPdfWithNoPlugin) { bool enabled; SetPDFPluginLoadedState(false, &enabled); - URLRequest request(GURL("http://foo.com/file.pdf"), &test_delegate_); + net::URLRequest request(GURL("http://foo.com/file.pdf"), &test_delegate_); request.Start(); MessageLoop::current()->Run(); EXPECT_EQ(1, test_delegate_.received_redirect_count()); @@ -171,7 +171,7 @@ TEST_F(GViewRequestInterceptorTest, InterceptPdfWithNoPlugin) { } TEST_F(GViewRequestInterceptorTest, InterceptPowerpoint) { - URLRequest request(GURL("http://foo.com/file.ppt"), &test_delegate_); + net::URLRequest request(GURL("http://foo.com/file.ppt"), &test_delegate_); request.Start(); MessageLoop::current()->Run(); EXPECT_EQ(1, test_delegate_.received_redirect_count()); diff --git a/chrome/browser/chromeos/login/account_screen_browsertest.cc b/chrome/browser/chromeos/login/account_screen_browsertest.cc index 0954013..1e8840d 100644 --- a/chrome/browser/chromeos/login/account_screen_browsertest.cc +++ b/chrome/browser/chromeos/login/account_screen_browsertest.cc @@ -62,7 +62,7 @@ static void QuitUIMessageLoop() { static bool inspector_called = false; // had to use global flag as // InspectorHook() doesn't have context. -static URLRequestJob* InspectorHook(URLRequest* request, +static URLRequestJob* InspectorHook(net::URLRequest* request, const std::string& scheme) { VLOG(1) << "Intercepted: " << request->url() << ", scheme: " << scheme; diff --git a/chrome/browser/chromeos/login/registration_screen.cc b/chrome/browser/chromeos/login/registration_screen.cc index 6676d97..8ac0d3e 100644 --- a/chrome/browser/chromeos/login/registration_screen.cc +++ b/chrome/browser/chromeos/login/registration_screen.cc @@ -142,7 +142,7 @@ void RegistrationScreen::CloseScreen(ScreenObserver::ExitCodes code) { } // static -URLRequestJob* RegistrationScreen::Factory(URLRequest* request, +URLRequestJob* RegistrationScreen::Factory(net::URLRequest* request, const std::string& scheme) { VLOG(1) << "Handling url: " << request->url().spec().c_str(); return new URLRequestAboutJob(request); diff --git a/chrome/browser/debugger/devtools_http_protocol_handler.cc b/chrome/browser/debugger/devtools_http_protocol_handler.cc index 5327008..8c1bea9 100644 --- a/chrome/browser/debugger/devtools_http_protocol_handler.cc +++ b/chrome/browser/debugger/devtools_http_protocol_handler.cc @@ -108,7 +108,8 @@ void DevToolsHttpProtocolHandler::OnHttpRequest( } // Proxy static files from chrome://devtools/*. - URLRequest* request = new URLRequest(GURL("chrome:/" + info.path), this); + net::URLRequest* request = new net::URLRequest( + GURL("chrome:/" + info.path), this); Bind(request, socket); request->set_context( Profile::GetDefaultRequestContext()->GetURLRequestContext()); @@ -144,9 +145,9 @@ void DevToolsHttpProtocolHandler::OnClose(HttpListenSocket* socket) { SocketToRequestsMap::iterator it = socket_to_requests_io_.find(socket); if (it != socket_to_requests_io_.end()) { // Dispose delegating socket. - for (std::set<URLRequest*>::iterator it2 = it->second.begin(); + for (std::set<net::URLRequest*>::iterator it2 = it->second.begin(); it2 != it->second.end(); ++it2) { - URLRequest* request = *it2; + net::URLRequest* request = *it2; request->Cancel(); request_to_socket_io_.erase(request); request_to_buffer_io_.erase(request); @@ -273,7 +274,7 @@ void DevToolsHttpProtocolHandler::OnCloseUI(HttpListenSocket* socket) { socket_to_client_host_ui_.erase(socket); } -void DevToolsHttpProtocolHandler::OnResponseStarted(URLRequest* request) { +void DevToolsHttpProtocolHandler::OnResponseStarted(net::URLRequest* request) { RequestToSocketMap::iterator it = request_to_socket_io_.find(request); if (it == request_to_socket_io_.end()) return; @@ -307,7 +308,7 @@ void DevToolsHttpProtocolHandler::OnResponseStarted(URLRequest* request) { OnReadCompleted(request, bytes_read); } -void DevToolsHttpProtocolHandler::OnReadCompleted(URLRequest* request, +void DevToolsHttpProtocolHandler::OnReadCompleted(net::URLRequest* request, int bytes_read) { RequestToSocketMap::iterator it = request_to_socket_io_.find(request); if (it == request_to_socket_io_.end()) @@ -341,21 +342,21 @@ void DevToolsHttpProtocolHandler::Teardown() { server_ = NULL; } -void DevToolsHttpProtocolHandler::Bind(URLRequest* request, +void DevToolsHttpProtocolHandler::Bind(net::URLRequest* request, HttpListenSocket* socket) { request_to_socket_io_[request] = socket; SocketToRequestsMap::iterator it = socket_to_requests_io_.find(socket); if (it == socket_to_requests_io_.end()) { - std::pair<HttpListenSocket*, std::set<URLRequest*> > value( + std::pair<HttpListenSocket*, std::set<net::URLRequest*> > value( socket, - std::set<URLRequest*>()); + std::set<net::URLRequest*>()); it = socket_to_requests_io_.insert(value).first; } it->second.insert(request); request_to_buffer_io_[request] = new net::IOBuffer(kBufferSize); } -void DevToolsHttpProtocolHandler::RequestCompleted(URLRequest* request) { +void DevToolsHttpProtocolHandler::RequestCompleted(net::URLRequest* request) { RequestToSocketMap::iterator it = request_to_socket_io_.find(request); if (it == request_to_socket_io_.end()) return; diff --git a/chrome/browser/debugger/devtools_http_protocol_handler.h b/chrome/browser/debugger/devtools_http_protocol_handler.h index 332fbaa..5be89d2 100644 --- a/chrome/browser/debugger/devtools_http_protocol_handler.h +++ b/chrome/browser/debugger/devtools_http_protocol_handler.h @@ -19,7 +19,7 @@ class TabContents; class DevToolsHttpProtocolHandler : public HttpListenSocket::Delegate, - public URLRequest::Delegate, + public net::URLRequest::Delegate, public base::RefCountedThreadSafe<DevToolsHttpProtocolHandler> { public: explicit DevToolsHttpProtocolHandler(int port); @@ -51,14 +51,14 @@ class DevToolsHttpProtocolHandler const std::string& data); virtual void OnCloseUI(HttpListenSocket* socket); - // URLRequest::Delegate implementation. - virtual void OnResponseStarted(URLRequest* request); - virtual void OnReadCompleted(URLRequest* request, int bytes_read); + // net::URLRequest::Delegate implementation. + virtual void OnResponseStarted(net::URLRequest* request); + virtual void OnReadCompleted(net::URLRequest* request, int bytes_read); void Init(); void Teardown(); - void Bind(URLRequest* request, HttpListenSocket* socket); - void RequestCompleted(URLRequest* request); + void Bind(net::URLRequest* request, HttpListenSocket* socket); + void RequestCompleted(net::URLRequest* request); void Send200(HttpListenSocket* socket, const std::string& data, @@ -73,13 +73,13 @@ class DevToolsHttpProtocolHandler int port_; scoped_refptr<HttpListenSocket> server_; - typedef std::map<URLRequest*, HttpListenSocket*> + typedef std::map<net::URLRequest*, HttpListenSocket*> RequestToSocketMap; RequestToSocketMap request_to_socket_io_; - typedef std::map<HttpListenSocket*, std::set<URLRequest*> > + typedef std::map<HttpListenSocket*, std::set<net::URLRequest*> > SocketToRequestsMap; SocketToRequestsMap socket_to_requests_io_; - typedef std::map<URLRequest*, scoped_refptr<net::IOBuffer> > + typedef std::map<net::URLRequest*, scoped_refptr<net::IOBuffer> > BuffersMap; BuffersMap request_to_buffer_io_; typedef std::map<HttpListenSocket*, DevToolsClientHost*> diff --git a/chrome/browser/debugger/devtools_netlog_observer.cc b/chrome/browser/debugger/devtools_netlog_observer.cc index 35368a1..c5d49f1 100644 --- a/chrome/browser/debugger/devtools_netlog_observer.cc +++ b/chrome/browser/debugger/devtools_netlog_observer.cc @@ -126,7 +126,7 @@ DevToolsNetLogObserver* DevToolsNetLogObserver::GetInstance() { } // static -void DevToolsNetLogObserver::PopulateResponseInfo(URLRequest* request, +void DevToolsNetLogObserver::PopulateResponseInfo(net::URLRequest* request, ResourceResponse* response) { if (!(request->load_flags() & net::LOAD_REPORT_RAW_HEADERS)) return; diff --git a/chrome/browser/dom_ui/chrome_url_data_manager.cc b/chrome/browser/dom_ui/chrome_url_data_manager.cc index 11f0d88..15f6b85 100644 --- a/chrome/browser/dom_ui/chrome_url_data_manager.cc +++ b/chrome/browser/dom_ui/chrome_url_data_manager.cc @@ -41,7 +41,7 @@ // calls back once the data is available. class URLRequestChromeJob : public net::URLRequestJob { public: - explicit URLRequestChromeJob(URLRequest* request); + explicit URLRequestChromeJob(net::URLRequest* request); // URLRequestJob implementation. virtual void Start(); @@ -86,7 +86,7 @@ class URLRequestChromeJob : public net::URLRequestJob { // URLRequestChromeFileJob is a URLRequestJob that acts like a file:// URL class URLRequestChromeFileJob : public URLRequestFileJob { public: - URLRequestChromeFileJob(URLRequest* request, const FilePath& path); + URLRequestChromeFileJob(net::URLRequest* request, const FilePath& path); private: virtual ~URLRequestChromeFileJob(); @@ -102,10 +102,10 @@ void RegisterURLRequestChromeJob() { } SharedResourcesDataSource::Register(); - URLRequest::RegisterProtocolFactory(chrome::kChromeDevToolsScheme, - &ChromeURLDataManager::Factory); - URLRequest::RegisterProtocolFactory(chrome::kChromeUIScheme, - &ChromeURLDataManager::Factory); + net::URLRequest::RegisterProtocolFactory(chrome::kChromeDevToolsScheme, + &ChromeURLDataManager::Factory); + net::URLRequest::RegisterProtocolFactory(chrome::kChromeUIScheme, + &ChromeURLDataManager::Factory); } void UnregisterURLRequestChromeJob() { @@ -264,7 +264,7 @@ void ChromeURLDataManager::RemoveRequest(URLRequestChromeJob* job) { void ChromeURLDataManager::DataAvailable( RequestID request_id, scoped_refptr<RefCountedMemory> bytes) { - // Forward this data on to the pending URLRequest, if it exists. + // Forward this data on to the pending net::URLRequest, if it exists. PendingRequestMap::iterator i = pending_requests_.find(request_id); if (i != pending_requests_.end()) { // We acquire a reference to the job so that it doesn't disappear under the @@ -318,7 +318,7 @@ void ChromeURLDataManager::DataSource::SetFontAndTextDirection( base::i18n::IsRTL() ? "rtl" : "ltr"); } -URLRequestJob* ChromeURLDataManager::Factory(URLRequest* request, +URLRequestJob* ChromeURLDataManager::Factory(net::URLRequest* request, const std::string& scheme) { // Try first with a file handler FilePath path; @@ -341,7 +341,7 @@ URLRequestJob* ChromeURLDataManager::Factory(URLRequest* request, return new URLRequestChromeJob(request); } -URLRequestChromeJob::URLRequestChromeJob(URLRequest* request) +URLRequestChromeJob::URLRequestChromeJob(net::URLRequest* request) : URLRequestJob(request), data_offset_(0), pending_buf_size_(0) { @@ -427,7 +427,7 @@ void URLRequestChromeJob::StartAsync() { } } -URLRequestChromeFileJob::URLRequestChromeFileJob(URLRequest* request, +URLRequestChromeFileJob::URLRequestChromeFileJob(net::URLRequest* request, const FilePath& path) : URLRequestFileJob(request, path) { } diff --git a/chrome/browser/dom_ui/mediaplayer_ui.cc b/chrome/browser/dom_ui/mediaplayer_ui.cc index 79d656f..65cacdf 100644 --- a/chrome/browser/dom_ui/mediaplayer_ui.cc +++ b/chrome/browser/dom_ui/mediaplayer_ui.cc @@ -538,7 +538,7 @@ void MediaPlayer::PopupMediaPlayer(Browser* creator) { mediaplayer_browser_->window()->Show(); } -URLRequestJob* MediaPlayer::MaybeIntercept(URLRequest* request) { +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; @@ -553,7 +553,7 @@ static const char* const supported_mime_type_list[] = { }; URLRequestJob* MediaPlayer::MaybeInterceptResponse( - URLRequest* request) { + net::URLRequest* request) { // Do not intercept this request if it is a download. if (request->load_flags() & net::LOAD_IS_DOWNLOAD) { return NULL; diff --git a/chrome/browser/dom_ui/mediaplayer_ui.h b/chrome/browser/dom_ui/mediaplayer_ui.h index 5c5b4bc..8a34d7c 100644 --- a/chrome/browser/dom_ui/mediaplayer_ui.h +++ b/chrome/browser/dom_ui/mediaplayer_ui.h @@ -24,7 +24,7 @@ class MediaplayerHandler; class Browser; class MediaPlayer : public NotificationObserver, - public URLRequest::Interceptor { + public net::URLRequest::Interceptor { public: ~MediaPlayer(); @@ -74,13 +74,13 @@ class MediaPlayer : public NotificationObserver, // Always returns NULL because we don't want to attempt a redirect // before seeing the detected mime type of the request. - // Implementation of URLRequest::Interceptor. + // Implementation of net::URLRequest::Interceptor. 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 // redirects the browser to the view URL. - // Implementation of URLRequest::Interceptor. + // Implementation of net::URLRequest::Interceptor. virtual net::URLRequestJob* MaybeInterceptResponse(net::URLRequest* request); // Used to detect when the mediaplayer is closed. diff --git a/chrome/browser/download/save_package.h b/chrome/browser/download/save_package.h index e7080a8..ddfc172 100644 --- a/chrome/browser/download/save_package.h +++ b/chrome/browser/download/save_package.h @@ -256,7 +256,7 @@ class SavePackage : public base::RefCountedThreadSafe<SavePackage>, SavedItemMap saved_success_items_; // The request context which provides application-specific context for - // URLRequest instances. + // net::URLRequest instances. scoped_refptr<URLRequestContextGetter> request_context_getter_; // Non-owning pointer for handling file writing on the file thread. diff --git a/chrome/browser/extensions/autoupdate_interceptor.cc b/chrome/browser/extensions/autoupdate_interceptor.cc index ef0091f..b50000c 100644 --- a/chrome/browser/extensions/autoupdate_interceptor.cc +++ b/chrome/browser/extensions/autoupdate_interceptor.cc @@ -15,7 +15,7 @@ // code relies on. class AutoUpdateTestRequestJob : public URLRequestTestJob { public: - AutoUpdateTestRequestJob(URLRequest* request, + AutoUpdateTestRequestJob(net::URLRequest* request, const std::string& response_data) : URLRequestTestJob( request, URLRequestTestJob::test_headers(), response_data, true) {} virtual int GetResponseCode() const { return 200; } @@ -26,15 +26,14 @@ class AutoUpdateTestRequestJob : public URLRequestTestJob { AutoUpdateInterceptor::AutoUpdateInterceptor() { - URLRequest::RegisterRequestInterceptor(this); + net::URLRequest::RegisterRequestInterceptor(this); } AutoUpdateInterceptor::~AutoUpdateInterceptor() { - URLRequest::UnregisterRequestInterceptor(this); + net::URLRequest::UnregisterRequestInterceptor(this); } - -URLRequestJob* AutoUpdateInterceptor::MaybeIntercept(URLRequest* request) { +URLRequestJob* AutoUpdateInterceptor::MaybeIntercept(net::URLRequest* request) { EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); if (request->url().scheme() != "http" || request->url().host() != "localhost") { diff --git a/chrome/browser/extensions/autoupdate_interceptor.h b/chrome/browser/extensions/autoupdate_interceptor.h index 219941a..a2e0891 100644 --- a/chrome/browser/extensions/autoupdate_interceptor.h +++ b/chrome/browser/extensions/autoupdate_interceptor.h @@ -15,7 +15,7 @@ // This url request interceptor lets us respond to localhost http request urls // with the contents of files on disk for use in tests. class AutoUpdateInterceptor - : public URLRequest::Interceptor, + : public net::URLRequest::Interceptor, public base::RefCountedThreadSafe<AutoUpdateInterceptor> { public: AutoUpdateInterceptor(); diff --git a/chrome/browser/extensions/extension_protocols.cc b/chrome/browser/extensions/extension_protocols.cc index edf937b..cc20413 100644 --- a/chrome/browser/extensions/extension_protocols.cc +++ b/chrome/browser/extensions/extension_protocols.cc @@ -34,7 +34,7 @@ namespace { class URLRequestResourceBundleJob : public URLRequestSimpleJob { public: - explicit URLRequestResourceBundleJob(URLRequest* request, + explicit URLRequestResourceBundleJob(net::URLRequest* request, const FilePath& filename, int resource_id) : URLRequestSimpleJob(request), filename_(filename), @@ -67,7 +67,7 @@ class URLRequestResourceBundleJob : public URLRequestSimpleJob { }; // Returns true if an chrome-extension:// resource should be allowed to load. -bool AllowExtensionResourceLoad(URLRequest* request, +bool AllowExtensionResourceLoad(net::URLRequest* request, ChromeURLRequestContext* context, const std::string& scheme) { const ResourceDispatcherHostRequestInfo* info = @@ -142,9 +142,9 @@ bool AllowExtensionResourceLoad(URLRequest* request, } // namespace -// Factory registered with URLRequest to create URLRequestJobs for extension:// -// URLs. -static URLRequestJob* CreateExtensionURLRequestJob(URLRequest* request, +// Factory registered with net::URLRequest to create URLRequestJobs for +// extension:// URLs. +static URLRequestJob* CreateExtensionURLRequestJob(net::URLRequest* request, const std::string& scheme) { ChromeURLRequestContext* context = static_cast<ChromeURLRequestContext*>(request->context()); @@ -201,9 +201,9 @@ static URLRequestJob* CreateExtensionURLRequestJob(URLRequest* request, return new URLRequestFileJob(request, resource_file_path); } -// Factory registered with URLRequest to create URLRequestJobs for +// Factory registered with net::URLRequest to create URLRequestJobs for // chrome-user-script:/ URLs. -static URLRequestJob* CreateUserScriptURLRequestJob(URLRequest* request, +static URLRequestJob* CreateUserScriptURLRequestJob(net::URLRequest* request, const std::string& scheme) { ChromeURLRequestContext* context = static_cast<ChromeURLRequestContext*>(request->context()); @@ -218,8 +218,8 @@ static URLRequestJob* CreateUserScriptURLRequestJob(URLRequest* request, } void RegisterExtensionProtocols() { - URLRequest::RegisterProtocolFactory(chrome::kExtensionScheme, - &CreateExtensionURLRequestJob); - URLRequest::RegisterProtocolFactory(chrome::kUserScriptScheme, - &CreateUserScriptURLRequestJob); + net::URLRequest::RegisterProtocolFactory(chrome::kExtensionScheme, + &CreateExtensionURLRequestJob); + net::URLRequest::RegisterProtocolFactory(chrome::kUserScriptScheme, + &CreateUserScriptURLRequestJob); } diff --git a/chrome/browser/extensions/user_script_listener.cc b/chrome/browser/extensions/user_script_listener.cc index c553b1f..574e9d5 100644 --- a/chrome/browser/extensions/user_script_listener.cc +++ b/chrome/browser/extensions/user_script_listener.cc @@ -34,7 +34,7 @@ void UserScriptListener::ShutdownMainThread() { } bool UserScriptListener::ShouldDelayRequest( - URLRequest* request, + net::URLRequest* request, const ResourceDispatcherHostRequestInfo& request_info, const GlobalRequestID& request_id) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); diff --git a/chrome/browser/extensions/user_script_listener_unittest.cc b/chrome/browser/extensions/user_script_listener_unittest.cc index ec13f9f..9658f41 100644 --- a/chrome/browser/extensions/user_script_listener_unittest.cc +++ b/chrome/browser/extensions/user_script_listener_unittest.cc @@ -97,7 +97,7 @@ ResourceDispatcherHostRequestInfo* CreateRequestInfo(int request_id) { // starts and finishes. class SimpleTestJob : public URLRequestTestJob { public: - explicit SimpleTestJob(URLRequest* request) + explicit SimpleTestJob(net::URLRequest* request) : URLRequestTestJob(request, test_headers(), kTestData, true) {} private: ~SimpleTestJob() {} @@ -105,14 +105,14 @@ class SimpleTestJob : public URLRequestTestJob { class UserScriptListenerTest : public ExtensionsServiceTestBase, - public URLRequest::Interceptor { + public net::URLRequest::Interceptor { public: UserScriptListenerTest() { - URLRequest::RegisterRequestInterceptor(this); + net::URLRequest::RegisterRequestInterceptor(this); } ~UserScriptListenerTest() { - URLRequest::UnregisterRequestInterceptor(this); + net::URLRequest::UnregisterRequestInterceptor(this); } virtual void SetUp() { @@ -135,13 +135,13 @@ class UserScriptListenerTest MessageLoop::current()->RunAllPending(); } - // URLRequest::Interceptor - virtual URLRequestJob* MaybeIntercept(URLRequest* request) { + // net::URLRequest::Interceptor + virtual URLRequestJob* MaybeIntercept(net::URLRequest* request) { return new SimpleTestJob(request); } protected: - TestURLRequest* StartTestRequest(URLRequest::Delegate* delegate, + TestURLRequest* StartTestRequest(net::URLRequest::Delegate* delegate, const std::string& url) { TestURLRequest* request = new TestURLRequest(GURL(url), delegate); scoped_ptr<ResourceDispatcherHostRequestInfo> rdh_info( diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc index 1067bf8..94d3126 100644 --- a/chrome/browser/io_thread.cc +++ b/chrome/browser/io_thread.cc @@ -343,7 +343,7 @@ void IOThread::Init() { void IOThread::CleanUp() { // Step 1: Kill all things that might be holding onto - // URLRequest/URLRequestContexts. + // net::URLRequest/URLRequestContexts. #if defined(USE_NSS) net::ShutdownOCSP(); @@ -437,12 +437,12 @@ void IOThread::CleanUpAfterMessageLoopDestruction() { // anything else can reference it. BrowserProcessSubThread::CleanUpAfterMessageLoopDestruction(); - // URLRequest instances must NOT outlive the IO thread. + // net::URLRequest instances must NOT outlive the IO thread. // // To allow for URLRequests to be deleted from // MessageLoop::DestructionObserver this check has to happen after CleanUp // (which runs before DestructionObservers). - base::debug::LeakTracker<URLRequest>::CheckForLeaks(); + base::debug::LeakTracker<net::URLRequest>::CheckForLeaks(); } // static diff --git a/chrome/browser/login_prompt.cc b/chrome/browser/login_prompt.cc index 69e0f20..47346c0 100644 --- a/chrome/browser/login_prompt.cc +++ b/chrome/browser/login_prompt.cc @@ -30,9 +30,10 @@ using webkit_glue::PasswordForm; class LoginHandlerImpl; -// Helper to remove the ref from an URLRequest to the LoginHandler. -// Should only be called from the IO thread, since it accesses an URLRequest. -void ResetLoginHandlerForRequest(URLRequest* request) { +// Helper to remove the ref from an net::URLRequest to the LoginHandler. +// Should only be called from the IO thread, since it accesses an +// net::URLRequest. +void ResetLoginHandlerForRequest(net::URLRequest* request) { ResourceDispatcherHostRequestInfo* info = ResourceDispatcherHost::InfoForRequest(request); if (!info) @@ -69,7 +70,7 @@ std::string GetSignonRealm(const GURL& url, // LoginHandler LoginHandler::LoginHandler(net::AuthChallengeInfo* auth_info, - URLRequest* request) + net::URLRequest* request) : handled_auth_(false), dialog_(NULL), auth_info_(auth_info), @@ -351,7 +352,7 @@ void LoginHandler::CloseContentsDeferred() { // This task is run on the UI thread and creates a constrained window with // a LoginView to prompt the user. The response will be sent to LoginHandler, -// which then routes it to the URLRequest on the I/O thread. +// which then routes it to the net::URLRequest on the I/O thread. class LoginDialogTask : public Task { public: LoginDialogTask(const GURL& request_url, @@ -426,7 +427,7 @@ class LoginDialogTask : public Task { handler_->SetPasswordForm(dialog_form); } - // The url from the URLRequest initiating the auth challenge. + // The url from the net::URLRequest initiating the auth challenge. GURL request_url_; // Info about who/where/what is asking for authentication. @@ -443,7 +444,7 @@ class LoginDialogTask : public Task { // Public API LoginHandler* CreateLoginPrompt(net::AuthChallengeInfo* auth_info, - URLRequest* request) { + net::URLRequest* request) { LoginHandler* handler = LoginHandler::Create(auth_info, request); BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, new LoginDialogTask( diff --git a/chrome/browser/login_prompt.h b/chrome/browser/login_prompt.h index db7b081..089e6b9 100644 --- a/chrome/browser/login_prompt.h +++ b/chrome/browser/login_prompt.h @@ -24,8 +24,8 @@ class ConstrainedWindow; class GURL; // This is the base implementation for the OS-specific classes that route -// authentication info to the URLRequest that needs it. These functions must -// be implemented in a thread safe manner. +// authentication info to the net::URLRequest that needs it. These functions +// must be implemented in a thread safe manner. class LoginHandler : public base::RefCountedThreadSafe<LoginHandler>, public LoginModelObserver, public NotificationObserver { @@ -138,7 +138,7 @@ class LoginHandler : public base::RefCountedThreadSafe<LoginHandler>, // This should only be accessed on the UI loop. PasswordManager* password_manager_; - // Cached from the URLRequest, in case it goes NULL on us. + // Cached from the net::URLRequest, in case it goes NULL on us. int render_process_host_id_; int tab_contents_id_; @@ -192,18 +192,19 @@ class AuthSuppliedLoginNotificationDetails : public LoginNotificationDetails { // Prompts the user for their username and password. This is designed to // be called on the background (I/O) thread, in response to -// URLRequest::Delegate::OnAuthRequired. The prompt will be created +// net::URLRequest::Delegate::OnAuthRequired. The prompt will be created // on the main UI thread via a call to UI loop's InvokeLater, and will send the -// credentials back to the URLRequest on the calling thread. +// credentials back to the net::URLRequest on the calling thread. // A LoginHandler object (which lives on the calling thread) is returned, // which can be used to set or cancel authentication programmatically. The // caller must invoke OnRequestCancelled() on this LoginHandler before -// destroying the URLRequest. +// destroying the net::URLRequest. LoginHandler* CreateLoginPrompt(net::AuthChallengeInfo* auth_info, net::URLRequest* request); -// Helper to remove the ref from an URLRequest to the LoginHandler. -// Should only be called from the IO thread, since it accesses an URLRequest. +// Helper to remove the ref from an net::URLRequest to the LoginHandler. +// Should only be called from the IO thread, since it accesses an +// net::URLRequest. void ResetLoginHandlerForRequest(net::URLRequest* request); // Get the signon_realm under which the identity should be saved. diff --git a/chrome/browser/login_prompt_gtk.cc b/chrome/browser/login_prompt_gtk.cc index 6752925..dfee0ef 100644 --- a/chrome/browser/login_prompt_gtk.cc +++ b/chrome/browser/login_prompt_gtk.cc @@ -30,13 +30,13 @@ using webkit_glue::PasswordForm; // LoginHandlerGtk // This class simply forwards the authentication from the LoginView (on -// the UI thread) to the URLRequest (on the I/O thread). +// the UI thread) to the net::URLRequest (on the I/O thread). // This class uses ref counting to ensure that it lives until all InvokeLaters // have been called. class LoginHandlerGtk : public LoginHandler, public ConstrainedWindowGtkDelegate { public: - LoginHandlerGtk(net::AuthChallengeInfo* auth_info, URLRequest* request) + LoginHandlerGtk(net::AuthChallengeInfo* auth_info, net::URLRequest* request) : LoginHandler(auth_info, request), username_entry_(NULL), password_entry_(NULL), @@ -194,6 +194,6 @@ void LoginHandlerGtk::OnPromptHierarchyChanged(GtkWidget* sender, // static LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info, - URLRequest* request) { + net::URLRequest* request) { return new LoginHandlerGtk(auth_info, request); } diff --git a/chrome/browser/login_prompt_mac.mm b/chrome/browser/login_prompt_mac.mm index dcc2d1b..95b9f75 100644 --- a/chrome/browser/login_prompt_mac.mm +++ b/chrome/browser/login_prompt_mac.mm @@ -29,13 +29,13 @@ using webkit_glue::PasswordForm; // LoginHandlerMac // This class simply forwards the authentication from the LoginView (on -// the UI thread) to the URLRequest (on the I/O thread). +// the UI thread) to the net::URLRequest (on the I/O thread). // This class uses ref counting to ensure that it lives until all InvokeLaters // have been called. class LoginHandlerMac : public LoginHandler, public ConstrainedWindowMacDelegateCustomSheet { public: - LoginHandlerMac(net::AuthChallengeInfo* auth_info, URLRequest* request) + LoginHandlerMac(net::AuthChallengeInfo* auth_info, net::URLRequest* request) : LoginHandler(auth_info, request), sheet_controller_(nil) { } @@ -117,7 +117,7 @@ class LoginHandlerMac : public LoginHandler, // static LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info, - URLRequest* request) { + net::URLRequest* request) { return new LoginHandlerMac(auth_info, request); } diff --git a/chrome/browser/login_prompt_win.cc b/chrome/browser/login_prompt_win.cc index 703dbbb..c99c75d 100644 --- a/chrome/browser/login_prompt_win.cc +++ b/chrome/browser/login_prompt_win.cc @@ -26,13 +26,13 @@ using webkit_glue::PasswordForm; // LoginHandlerWin // This class simply forwards the authentication from the LoginView (on -// the UI thread) to the URLRequest (on the I/O thread). +// the UI thread) to the net::URLRequest (on the I/O thread). // This class uses ref counting to ensure that it lives until all InvokeLaters // have been called. class LoginHandlerWin : public LoginHandler, public ConstrainedDialogDelegate { public: - LoginHandlerWin(net::AuthChallengeInfo* auth_info, URLRequest* request) + LoginHandlerWin(net::AuthChallengeInfo* auth_info, net::URLRequest* request) : LoginHandler(auth_info, request) { } @@ -142,6 +142,6 @@ class LoginHandlerWin : public LoginHandler, // static LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info, - URLRequest* request) { + net::URLRequest* request) { return new LoginHandlerWin(auth_info, request); } diff --git a/chrome/browser/net/blob_url_request_job_factory.cc b/chrome/browser/net/blob_url_request_job_factory.cc index d2e9bff..798c21b 100644 --- a/chrome/browser/net/blob_url_request_job_factory.cc +++ b/chrome/browser/net/blob_url_request_job_factory.cc @@ -15,7 +15,7 @@ namespace { -URLRequestJob* BlobURLRequestJobFactory(URLRequest* request, +URLRequestJob* BlobURLRequestJobFactory(net::URLRequest* request, const std::string& scheme) { scoped_refptr<webkit_blob::BlobData> data; ResourceDispatcherHostRequestInfo* info = @@ -37,6 +37,6 @@ URLRequestJob* BlobURLRequestJobFactory(URLRequest* request, } void RegisterBlobURLRequestJobFactory() { - URLRequest::RegisterProtocolFactory(chrome::kBlobScheme, + net::URLRequest::RegisterProtocolFactory(chrome::kBlobScheme, &BlobURLRequestJobFactory); } diff --git a/chrome/browser/net/chrome_dns_cert_provenance_checker.cc b/chrome/browser/net/chrome_dns_cert_provenance_checker.cc index e9bcf2f..fe0ca9d 100644 --- a/chrome/browser/net/chrome_dns_cert_provenance_checker.cc +++ b/chrome/browser/net/chrome_dns_cert_provenance_checker.cc @@ -48,7 +48,7 @@ class ChromeDnsCertProvenanceChecker : const std::vector<std::string>& der_certs) { const std::string report = BuildEncryptedReport(hostname, der_certs); - URLRequest* url_request(new URLRequest(upload_url_, &delegate_)); + net::URLRequest* url_request(new net::URLRequest(upload_url_, &delegate_)); url_request->set_context(url_req_context_); url_request->set_method("POST"); url_request->AppendBytesToUpload(report.data(), report.size()); @@ -61,8 +61,8 @@ class ChromeDnsCertProvenanceChecker : } private: - void RequestComplete(URLRequest* request) { - std::set<URLRequest*>::iterator i = inflight_requests_.find(request); + void RequestComplete(net::URLRequest* request) { + std::set<net::URLRequest*>::iterator i = inflight_requests_.find(request); DCHECK(i != inflight_requests_.end()); delete *i; inflight_requests_.erase(i); @@ -71,14 +71,14 @@ class ChromeDnsCertProvenanceChecker : // URLRequestDelegate is the delegate for the upload. Since this is a // fire-and-forget operation, we don't care if there are any errors in the // upload. - class URLRequestDelegate : public URLRequest::Delegate { + class URLRequestDelegate : public net::URLRequest::Delegate { public: explicit URLRequestDelegate(ChromeDnsCertProvenanceChecker* checker) : checker_(checker) { } // Delegate implementation - void OnResponseStarted(URLRequest* request) { + void OnResponseStarted(net::URLRequest* request) { const URLRequestStatus& status(request->status()); if (!status.is_success()) { LOG(WARNING) << "Certificate upload failed" @@ -91,7 +91,7 @@ class ChromeDnsCertProvenanceChecker : checker_->RequestComplete(request); } - void OnReadCompleted(URLRequest* request, int bytes_read) { + void OnReadCompleted(net::URLRequest* request, int bytes_read) { NOTREACHED(); } @@ -103,7 +103,7 @@ class ChromeDnsCertProvenanceChecker : ChromeURLRequestContext* const url_req_context_; const GURL upload_url_; URLRequestDelegate delegate_; - std::set<URLRequest*> inflight_requests_; + std::set<net::URLRequest*> inflight_requests_; }; } // namespace diff --git a/chrome/browser/net/connect_interceptor.cc b/chrome/browser/net/connect_interceptor.cc index 893039b..3809da2 100644 --- a/chrome/browser/net/connect_interceptor.cc +++ b/chrome/browser/net/connect_interceptor.cc @@ -10,11 +10,11 @@ namespace chrome_browser_net { ConnectInterceptor::ConnectInterceptor() { - URLRequest::RegisterRequestInterceptor(this); + net::URLRequest::RegisterRequestInterceptor(this); } ConnectInterceptor::~ConnectInterceptor() { - URLRequest::UnregisterRequestInterceptor(this); + net::URLRequest::UnregisterRequestInterceptor(this); } net::URLRequestJob* ConnectInterceptor::MaybeIntercept( diff --git a/chrome/browser/net/connect_interceptor.h b/chrome/browser/net/connect_interceptor.h index ee4422b..b0b15f1 100644 --- a/chrome/browser/net/connect_interceptor.h +++ b/chrome/browser/net/connect_interceptor.h @@ -13,7 +13,7 @@ namespace chrome_browser_net { //------------------------------------------------------------------------------ // An interceptor to monitor URLRequests so that we can do speculative DNS // resolution and/or speculative TCP preconnections. -class ConnectInterceptor : public URLRequest::Interceptor { +class ConnectInterceptor : public net::URLRequest::Interceptor { public: // Construction includes registration as an URL. ConnectInterceptor(); @@ -21,7 +21,7 @@ class ConnectInterceptor : public URLRequest::Interceptor { virtual ~ConnectInterceptor(); protected: - // URLRequest::Interceptor overrides + // Overridden from net::URLRequest::Interceptor: // Learn about referrers, and optionally preconnect based on history. virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request); virtual net::URLRequestJob* MaybeInterceptResponse(net::URLRequest* request); diff --git a/chrome/browser/net/connection_tester.cc b/chrome/browser/net/connection_tester.cc index 35a9a71..7b34aea 100644 --- a/chrome/browser/net/connection_tester.cc +++ b/chrome/browser/net/connection_tester.cc @@ -223,7 +223,7 @@ class ExperimentURLRequestContext : public URLRequestContext { // TestRunner is a helper class for running an individual experiment. It can // be deleted any time after it is started, and this will abort the request. -class ConnectionTester::TestRunner : public URLRequest::Delegate { +class ConnectionTester::TestRunner : public net::URLRequest::Delegate { public: // |tester| must remain alive throughout the TestRunner's lifetime. // |tester| will be notified of completion. @@ -233,9 +233,9 @@ class ConnectionTester::TestRunner : public URLRequest::Delegate { // it is done. void Run(const Experiment& experiment); - // URLRequest::Delegate implementation. - virtual void OnResponseStarted(URLRequest* request); - virtual void OnReadCompleted(URLRequest* request, int bytes_read); + // Overridden from net::URLRequest::Delegate: + virtual void OnResponseStarted(net::URLRequest* request); + virtual void OnReadCompleted(net::URLRequest* request, int bytes_read); // TODO(eroman): handle cases requiring authentication. private: @@ -244,18 +244,18 @@ class ConnectionTester::TestRunner : public URLRequest::Delegate { // Starts reading the response's body (and keeps reading until an error or // end of stream). - void ReadBody(URLRequest* request); + void ReadBody(net::URLRequest* request); // Called when the request has completed (for both success and failure). - void OnResponseCompleted(URLRequest* request); + void OnResponseCompleted(net::URLRequest* request); ConnectionTester* tester_; - scoped_ptr<URLRequest> request_; + scoped_ptr<net::URLRequest> request_; DISALLOW_COPY_AND_ASSIGN(TestRunner); }; -void ConnectionTester::TestRunner::OnResponseStarted(URLRequest* request) { +void ConnectionTester::TestRunner::OnResponseStarted(net::URLRequest* request) { if (!request->status().is_success()) { OnResponseCompleted(request); return; @@ -265,7 +265,7 @@ void ConnectionTester::TestRunner::OnResponseStarted(URLRequest* request) { ReadBody(request); } -void ConnectionTester::TestRunner::OnReadCompleted(URLRequest* request, +void ConnectionTester::TestRunner::OnReadCompleted(net::URLRequest* request, int bytes_read) { if (bytes_read <= 0) { OnResponseCompleted(request); @@ -276,7 +276,7 @@ void ConnectionTester::TestRunner::OnReadCompleted(URLRequest* request, ReadBody(request); } -void ConnectionTester::TestRunner::ReadBody(URLRequest* request) { +void ConnectionTester::TestRunner::ReadBody(net::URLRequest* request) { // Read the response body |kReadBufferSize| bytes at a time. scoped_refptr<net::IOBuffer> unused_buffer( new net::IOBuffer(kReadBufferSize)); @@ -289,7 +289,8 @@ void ConnectionTester::TestRunner::ReadBody(URLRequest* request) { } } -void ConnectionTester::TestRunner::OnResponseCompleted(URLRequest* request) { +void ConnectionTester::TestRunner::OnResponseCompleted( + net::URLRequest* request) { int result = net::OK; if (!request->status().is_success()) { DCHECK_NE(net::ERR_IO_PENDING, request->status().os_error()); @@ -310,7 +311,7 @@ void ConnectionTester::TestRunner::Run(const Experiment& experiment) { } // Fetch a request using the experimental context. - request_.reset(new URLRequest(experiment.url, this)); + request_.reset(new net::URLRequest(experiment.url, this)); request_->set_context(context); request_->Start(); } diff --git a/chrome/browser/net/load_timing_observer.cc b/chrome/browser/net/load_timing_observer.cc index d93ccf8..f5b27d5 100644 --- a/chrome/browser/net/load_timing_observer.cc +++ b/chrome/browser/net/load_timing_observer.cc @@ -82,7 +82,7 @@ void LoadTimingObserver::OnAddEntry(net::NetLog::EventType type, } // static -void LoadTimingObserver::PopulateTimingInfo(URLRequest* request, +void LoadTimingObserver::PopulateTimingInfo(net::URLRequest* request, ResourceResponse* response) { if (!(request->load_flags() & net::LOAD_ENABLE_LOAD_TIMING)) return; diff --git a/chrome/browser/net/load_timing_observer_unittest.cc b/chrome/browser/net/load_timing_observer_unittest.cc index 8ded133..98c50be 100644 --- a/chrome/browser/net/load_timing_observer_unittest.cc +++ b/chrome/browser/net/load_timing_observer_unittest.cc @@ -81,7 +81,7 @@ void AddEndSocketEntries(LoadTimingObserver& observer, uint32 id) { } // namespace -// Test that URLRequest with no load timing flag is not processed. +// Test that net::URLRequest with no load timing flag is not processed. TEST(LoadTimingObserverTest, NoLoadTimingEnabled) { LoadTimingObserver observer; diff --git a/chrome/browser/net/metadata_url_request.cc b/chrome/browser/net/metadata_url_request.cc index dacfc5d..0f69d6d 100644 --- a/chrome/browser/net/metadata_url_request.cc +++ b/chrome/browser/net/metadata_url_request.cc @@ -19,9 +19,10 @@ namespace { class MetadataRequestHandler : public net::URLRequestJob { public: - explicit MetadataRequestHandler(URLRequest* request); + explicit MetadataRequestHandler(net::URLRequest* request); - static URLRequestJob* Factory(URLRequest* request, const std::string& scheme); + static URLRequestJob* Factory(net::URLRequest* request, + const std::string& scheme); // URLRequestJob implementation. virtual void Start(); @@ -39,7 +40,7 @@ class MetadataRequestHandler : public net::URLRequestJob { DISALLOW_COPY_AND_ASSIGN(MetadataRequestHandler); }; -MetadataRequestHandler::MetadataRequestHandler(URLRequest* request) +MetadataRequestHandler::MetadataRequestHandler(net::URLRequest* request) : URLRequestJob(request), data_offset_(0) { parsed = false; @@ -48,7 +49,7 @@ MetadataRequestHandler::MetadataRequestHandler(URLRequest* request) MetadataRequestHandler::~MetadataRequestHandler() { } -URLRequestJob* MetadataRequestHandler::Factory(URLRequest* request, +URLRequestJob* MetadataRequestHandler::Factory(net::URLRequest* request, const std::string& scheme) { return new MetadataRequestHandler(request); } @@ -125,7 +126,7 @@ void MetadataRequestHandler::StartAsync() { void RegisterMetadataURLRequestHandler() { #if defined(OS_CHROMEOS) - URLRequest::RegisterProtocolFactory(chrome::kMetadataScheme, - &MetadataRequestHandler::Factory); + net::URLRequest::RegisterProtocolFactory(chrome::kMetadataScheme, + &MetadataRequestHandler::Factory); #endif } diff --git a/chrome/browser/net/passive_log_collector.h b/chrome/browser/net/passive_log_collector.h index 5d46fb3..164aa66 100644 --- a/chrome/browser/net/passive_log_collector.h +++ b/chrome/browser/net/passive_log_collector.h @@ -237,7 +237,7 @@ class PassiveLogCollector : public ChromeNetLog::Observer { DISALLOW_COPY_AND_ASSIGN(SocketTracker); }; - // Specialization of SourceTracker for handling URLRequest/SocketStream. + // Specialization of SourceTracker for handling net::URLRequest/SocketStream. class RequestTracker : public SourceTracker { public: static const size_t kMaxNumSources; diff --git a/chrome/browser/net/prerender_interceptor.cc b/chrome/browser/net/prerender_interceptor.cc index c1e5698..6e082f7 100644 --- a/chrome/browser/net/prerender_interceptor.cc +++ b/chrome/browser/net/prerender_interceptor.cc @@ -21,17 +21,17 @@ PrerenderInterceptor::PrerenderInterceptor() : ALLOW_THIS_IN_INITIALIZER_LIST( callback_(NewCallback(this, &PrerenderInterceptor::PrerenderDispatch))) { - URLRequest::RegisterRequestInterceptor(this); + net::URLRequest::RegisterRequestInterceptor(this); } PrerenderInterceptor::PrerenderInterceptor( PrerenderInterceptorCallback* callback) - : callback_(callback) { - URLRequest::RegisterRequestInterceptor(this); + : callback_(callback) { + net::URLRequest::RegisterRequestInterceptor(this); } PrerenderInterceptor::~PrerenderInterceptor() { - URLRequest::UnregisterRequestInterceptor(this); + net::URLRequest::UnregisterRequestInterceptor(this); } net::URLRequestJob* PrerenderInterceptor::MaybeIntercept( diff --git a/chrome/browser/net/prerender_interceptor.h b/chrome/browser/net/prerender_interceptor.h index 02cdbff..18f3eec 100644 --- a/chrome/browser/net/prerender_interceptor.h +++ b/chrome/browser/net/prerender_interceptor.h @@ -18,12 +18,12 @@ namespace chrome_browser_net { // The PrerenderInterceptor watches prefetch requests, and when // they are for type text/html, notifies the prerendering // system about the fetch so it may consider the URL. -class PrerenderInterceptor : public URLRequest::Interceptor { +class PrerenderInterceptor : public net::URLRequest::Interceptor { public: PrerenderInterceptor(); virtual ~PrerenderInterceptor(); - // URLRequest::Interceptor overrides. We only care about + // net::URLRequest::Interceptor overrides. We only care about // MaybeInterceptResponse, but must capture MaybeIntercept since // it is pure virtual. virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request); diff --git a/chrome/browser/net/prerender_interceptor_unittest.cc b/chrome/browser/net/prerender_interceptor_unittest.cc index 55e5a31..761978d 100644 --- a/chrome/browser/net/prerender_interceptor_unittest.cc +++ b/chrome/browser/net/prerender_interceptor_unittest.cc @@ -30,7 +30,7 @@ class PrerenderInterceptorTest : public testing::Test { net::TestServer test_server_; GURL gurl_; GURL last_intercepted_gurl_; - scoped_ptr<URLRequest> req_; + scoped_ptr<net::URLRequest> req_; private: void SetLastInterceptedGurl(const GURL& url); diff --git a/chrome/browser/net/url_request_failed_dns_job.cc b/chrome/browser/net/url_request_failed_dns_job.cc index e436204..b97a6b1 100644 --- a/chrome/browser/net/url_request_failed_dns_job.cc +++ b/chrome/browser/net/url_request_failed_dns_job.cc @@ -26,7 +26,7 @@ void URLRequestFailedDnsJob::AddUrlHandler() { } /*static */ -URLRequestJob* URLRequestFailedDnsJob::Factory(URLRequest* request, +URLRequestJob* URLRequestFailedDnsJob::Factory(net::URLRequest* request, const std::string& scheme) { return new URLRequestFailedDnsJob(request); } diff --git a/chrome/browser/net/url_request_mock_http_job.cc b/chrome/browser/net/url_request_mock_http_job.cc index 4029605..22fe5bf 100644 --- a/chrome/browser/net/url_request_mock_http_job.cc +++ b/chrome/browser/net/url_request_mock_http_job.cc @@ -21,7 +21,7 @@ static const FilePath::CharType kMockHeaderFileSuffix[] = FilePath URLRequestMockHTTPJob::base_path_; /* static */ -URLRequestJob* URLRequestMockHTTPJob::Factory(URLRequest* request, +URLRequestJob* URLRequestMockHTTPJob::Factory(net::URLRequest* request, const std::string& scheme) { return new URLRequestMockHTTPJob(request, GetOnDiskPath(base_path_, request, scheme)); @@ -56,7 +56,7 @@ GURL URLRequestMockHTTPJob::GetMockViewSourceUrl(const FilePath& path) { /* static */ FilePath URLRequestMockHTTPJob::GetOnDiskPath(const FilePath& base_path, - URLRequest* request, + net::URLRequest* request, const std::string& scheme) { std::string file_url("file:///"); file_url += WideToUTF8(base_path.ToWStringHack()); @@ -68,7 +68,7 @@ FilePath URLRequestMockHTTPJob::GetOnDiskPath(const FilePath& base_path, return file_path; } -URLRequestMockHTTPJob::URLRequestMockHTTPJob(URLRequest* request, +URLRequestMockHTTPJob::URLRequestMockHTTPJob(net::URLRequest* request, const FilePath& file_path) : URLRequestFileJob(request, file_path) { } diff --git a/chrome/browser/net/url_request_mock_http_job.h b/chrome/browser/net/url_request_mock_http_job.h index 35a251c..d2c0e0b 100644 --- a/chrome/browser/net/url_request_mock_http_job.h +++ b/chrome/browser/net/url_request_mock_http_job.h @@ -16,14 +16,14 @@ class FilePath; class URLRequestMockHTTPJob : public URLRequestFileJob { public: - URLRequestMockHTTPJob(URLRequest* request, const FilePath& file_path); + URLRequestMockHTTPJob(net::URLRequest* request, const FilePath& file_path); virtual bool GetMimeType(std::string* mime_type) const; virtual bool GetCharset(std::string* charset); virtual void GetResponseInfo(net::HttpResponseInfo* info); virtual bool IsRedirectResponse(GURL* location, int* http_status_code); - static URLRequest::ProtocolFactory Factory; + static net::URLRequest::ProtocolFactory Factory; // Adds the testing URLs to the URLRequestFilter. static void AddUrlHandler(const FilePath& base_path); @@ -39,7 +39,7 @@ class URLRequestMockHTTPJob : public URLRequestFileJob { virtual ~URLRequestMockHTTPJob() { } static FilePath GetOnDiskPath(const FilePath& base_path, - URLRequest* request, + net::URLRequest* request, const std::string& scheme); private: diff --git a/chrome/browser/net/url_request_mock_link_doctor_job.cc b/chrome/browser/net/url_request_mock_link_doctor_job.cc index e34baa9..66d7e3f 100644 --- a/chrome/browser/net/url_request_mock_link_doctor_job.cc +++ b/chrome/browser/net/url_request_mock_link_doctor_job.cc @@ -22,7 +22,7 @@ FilePath GetMockFilePath() { } // namespace /* static */ -URLRequestJob* URLRequestMockLinkDoctorJob::Factory(URLRequest* request, +URLRequestJob* URLRequestMockLinkDoctorJob::Factory(net::URLRequest* request, const std::string& scheme) { return new URLRequestMockLinkDoctorJob(request); } @@ -35,6 +35,7 @@ void URLRequestMockLinkDoctorJob::AddUrlHandler() { URLRequestMockLinkDoctorJob::Factory); } -URLRequestMockLinkDoctorJob::URLRequestMockLinkDoctorJob(URLRequest* request) +URLRequestMockLinkDoctorJob::URLRequestMockLinkDoctorJob( + net::URLRequest* request) : URLRequestMockHTTPJob(request, GetMockFilePath()) { } diff --git a/chrome/browser/net/url_request_mock_link_doctor_job.h b/chrome/browser/net/url_request_mock_link_doctor_job.h index 4af4fe7..19a02f4 100644 --- a/chrome/browser/net/url_request_mock_link_doctor_job.h +++ b/chrome/browser/net/url_request_mock_link_doctor_job.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 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. // @@ -12,9 +12,9 @@ class URLRequestMockLinkDoctorJob : public URLRequestMockHTTPJob { public: - explicit URLRequestMockLinkDoctorJob(URLRequest* request); + explicit URLRequestMockLinkDoctorJob(net::URLRequest* request); - static URLRequest::ProtocolFactory Factory; + static net::URLRequest::ProtocolFactory Factory; // Adds the testing URLs to the URLRequestFilter. static void AddUrlHandler(); diff --git a/chrome/browser/net/url_request_mock_net_error_job.cc b/chrome/browser/net/url_request_mock_net_error_job.cc index f4aa330..51094d6 100644 --- a/chrome/browser/net/url_request_mock_net_error_job.cc +++ b/chrome/browser/net/url_request_mock_net_error_job.cc @@ -57,7 +57,7 @@ void URLRequestMockNetErrorJob::RemoveMockedURL(const GURL& url) { } // static -URLRequestJob* URLRequestMockNetErrorJob::Factory(URLRequest* request, +URLRequestJob* URLRequestMockNetErrorJob::Factory(net::URLRequest* request, const std::string& scheme) { GURL url = request->url(); @@ -80,7 +80,7 @@ URLRequestJob* URLRequestMockNetErrorJob::Factory(URLRequest* request, file_path); } -URLRequestMockNetErrorJob::URLRequestMockNetErrorJob(URLRequest* request, +URLRequestMockNetErrorJob::URLRequestMockNetErrorJob(net::URLRequest* request, const std::vector<int>& errors, net::X509Certificate* cert, const FilePath& file_path) : URLRequestMockHTTPJob(request, file_path), diff --git a/chrome/browser/net/url_request_mock_net_error_job.h b/chrome/browser/net/url_request_mock_net_error_job.h index 059272f..3416bd9 100644 --- a/chrome/browser/net/url_request_mock_net_error_job.h +++ b/chrome/browser/net/url_request_mock_net_error_job.h @@ -14,7 +14,7 @@ class URLRequestMockNetErrorJob : public URLRequestMockHTTPJob { public: - URLRequestMockNetErrorJob(URLRequest* request, + URLRequestMockNetErrorJob(net::URLRequest* request, const std::vector<int>& errors, net::X509Certificate* ssl_cert, const FilePath& file_path); @@ -39,7 +39,7 @@ class URLRequestMockNetErrorJob : public URLRequestMockHTTPJob { private: ~URLRequestMockNetErrorJob(); - static URLRequest::ProtocolFactory Factory; + static net::URLRequest::ProtocolFactory Factory; void StartAsync(); diff --git a/chrome/browser/net/url_request_mock_util.cc b/chrome/browser/net/url_request_mock_util.cc index b3ac398..ce32af3 100644 --- a/chrome/browser/net/url_request_mock_util.cc +++ b/chrome/browser/net/url_request_mock_util.cc @@ -20,8 +20,8 @@ namespace chrome_browser_net { void SetUrlRequestMocksEnabled(bool enabled) { - // Since this involves changing the URLRequest ProtocolFactory, we need to - // run on the IO thread. + // Since this involves changing the net::URLRequest ProtocolFactory, we need + // to run on the IO thread. DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); if (enabled) { diff --git a/chrome/browser/net/url_request_slow_download_job.cc b/chrome/browser/net/url_request_slow_download_job.cc index 138a57c..a9cae93 100644 --- a/chrome/browser/net/url_request_slow_download_job.cc +++ b/chrome/browser/net/url_request_slow_download_job.cc @@ -42,7 +42,7 @@ void URLRequestSlowDownloadJob::AddUrlHandler() { } /*static */ -URLRequestJob* URLRequestSlowDownloadJob::Factory(URLRequest* request, +URLRequestJob* URLRequestSlowDownloadJob::Factory(net::URLRequest* request, const std::string& scheme) { URLRequestSlowDownloadJob* job = new URLRequestSlowDownloadJob(request); if (request->url().spec() != kFinishDownloadUrl) @@ -60,7 +60,7 @@ void URLRequestSlowDownloadJob::FinishPendingRequests() { kPendingRequests.clear(); } -URLRequestSlowDownloadJob::URLRequestSlowDownloadJob(URLRequest* request) +URLRequestSlowDownloadJob::URLRequestSlowDownloadJob(net::URLRequest* request) : URLRequestJob(request), first_download_size_remaining_(kFirstDownloadSize), should_finish_download_(false), diff --git a/chrome/browser/net/url_request_slow_http_job.cc b/chrome/browser/net/url_request_slow_http_job.cc index a8205f0..12065ab 100644 --- a/chrome/browser/net/url_request_slow_http_job.cc +++ b/chrome/browser/net/url_request_slow_http_job.cc @@ -19,7 +19,7 @@ const int URLRequestSlowHTTPJob::kDelayMs = 1000; using base::TimeDelta; /* static */ -URLRequestJob* URLRequestSlowHTTPJob::Factory(URLRequest* request, +URLRequestJob* URLRequestSlowHTTPJob::Factory(net::URLRequest* request, const std::string& scheme) { return new URLRequestSlowHTTPJob(request, GetOnDiskPath(base_path_, request, scheme)); @@ -44,7 +44,7 @@ GURL URLRequestSlowHTTPJob::GetMockUrl(const FilePath& path) { return GURL(url); } -URLRequestSlowHTTPJob::URLRequestSlowHTTPJob(URLRequest* request, +URLRequestSlowHTTPJob::URLRequestSlowHTTPJob(net::URLRequest* request, const FilePath& file_path) : URLRequestMockHTTPJob(request, file_path) { } diff --git a/chrome/browser/net/url_request_slow_http_job.h b/chrome/browser/net/url_request_slow_http_job.h index fab7a01..e58f8df 100644 --- a/chrome/browser/net/url_request_slow_http_job.h +++ b/chrome/browser/net/url_request_slow_http_job.h @@ -13,11 +13,11 @@ class URLRequestSlowHTTPJob : public URLRequestMockHTTPJob { public: - URLRequestSlowHTTPJob(URLRequest* request, const FilePath& file_path); + URLRequestSlowHTTPJob(net::URLRequest* request, const FilePath& file_path); static const int kDelayMs; - static URLRequest::ProtocolFactory Factory; + static net::URLRequest::ProtocolFactory Factory; // Adds the testing URLs to the URLRequestFilter. static void AddUrlHandler(const FilePath& base_path); diff --git a/chrome/browser/net/url_request_tracking.cc b/chrome/browser/net/url_request_tracking.cc index 60ad7d2..a931856 100644 --- a/chrome/browser/net/url_request_tracking.cc +++ b/chrome/browser/net/url_request_tracking.cc @@ -13,7 +13,7 @@ namespace { // PID. const void* kOriginProcessUniqueIDKey = 0; -class UniqueIDData : public URLRequest::UserData { +class UniqueIDData : public net::URLRequest::UserData { public: explicit UniqueIDData(int id) : id_(id) {} virtual ~UniqueIDData() {} @@ -31,12 +31,12 @@ class UniqueIDData : public URLRequest::UserData { namespace chrome_browser_net { -void SetOriginProcessUniqueIDForRequest(int id, URLRequest* request) { +void SetOriginProcessUniqueIDForRequest(int id, net::URLRequest* request) { // The request will take ownership. request->SetUserData(&kOriginProcessUniqueIDKey, new UniqueIDData(id)); } -int GetOriginProcessUniqueIDForRequest(const URLRequest* request) { +int GetOriginProcessUniqueIDForRequest(const net::URLRequest* request) { const UniqueIDData* data = static_cast<const UniqueIDData*>( request->GetUserData(&kOriginProcessUniqueIDKey)); if (!data) diff --git a/chrome/browser/net/view_blob_internals_job_factory.cc b/chrome/browser/net/view_blob_internals_job_factory.cc index 847d70d..4fdbefc 100644 --- a/chrome/browser/net/view_blob_internals_job_factory.cc +++ b/chrome/browser/net/view_blob_internals_job_factory.cc @@ -19,11 +19,10 @@ bool ViewBlobInternalsJobFactory::IsSupportedURL(const GURL& url) { // static. URLRequestJob* ViewBlobInternalsJobFactory::CreateJobForRequest( - URLRequest* request) { + net::URLRequest* request) { webkit_blob::BlobStorageController* blob_storage_controller = static_cast<ChromeURLRequestContext*>(request->context())-> blob_storage_context()->controller(); return new webkit_blob::ViewBlobInternalsJob( request, blob_storage_controller); } - diff --git a/chrome/browser/net/view_http_cache_job_factory.cc b/chrome/browser/net/view_http_cache_job_factory.cc index 8e14a11..8703877 100644 --- a/chrome/browser/net/view_http_cache_job_factory.cc +++ b/chrome/browser/net/view_http_cache_job_factory.cc @@ -18,7 +18,7 @@ namespace { // A job subclass that dumps an HTTP cache entry. class ViewHttpCacheJob : public net::URLRequestJob { public: - explicit ViewHttpCacheJob(URLRequest* request) + explicit ViewHttpCacheJob(net::URLRequest* request) : URLRequestJob(request), data_offset_(0), cancel_(false), busy_(false), ALLOW_THIS_IN_INITIALIZER_LIST( callback_(this, &ViewHttpCacheJob::OnIOComplete)) {} @@ -124,6 +124,6 @@ bool ViewHttpCacheJobFactory::IsSupportedURL(const GURL& url) { // Static. URLRequestJob* ViewHttpCacheJobFactory::CreateJobForRequest( - URLRequest* request) { + net::URLRequest* request) { return new ViewHttpCacheJob(request); } diff --git a/chrome/browser/plugin_download_helper.cc b/chrome/browser/plugin_download_helper.cc index 5f17725..0d85e27 100644 --- a/chrome/browser/plugin_download_helper.cc +++ b/chrome/browser/plugin_download_helper.cc @@ -35,7 +35,7 @@ PluginDownloadUrlHelper::~PluginDownloadUrlHelper() { void PluginDownloadUrlHelper::InitiateDownload( URLRequestContext* request_context) { - download_file_request_ = new URLRequest(GURL(download_url_), this); + download_file_request_ = new net::URLRequest(GURL(download_url_), this); chrome_browser_net::SetOriginProcessUniqueIDForRequest( download_source_child_unique_id_, download_file_request_); download_file_request_->set_context(request_context); @@ -43,21 +43,21 @@ void PluginDownloadUrlHelper::InitiateDownload( } void PluginDownloadUrlHelper::OnAuthRequired( - URLRequest* request, + net::URLRequest* request, net::AuthChallengeInfo* auth_info) { - URLRequest::Delegate::OnAuthRequired(request, auth_info); + net::URLRequest::Delegate::OnAuthRequired(request, auth_info); DownloadCompletedHelper(false); } void PluginDownloadUrlHelper::OnSSLCertificateError( - URLRequest* request, + net::URLRequest* request, int cert_error, net::X509Certificate* cert) { - URLRequest::Delegate::OnSSLCertificateError(request, cert_error, cert); + net::URLRequest::Delegate::OnSSLCertificateError(request, cert_error, cert); DownloadCompletedHelper(false); } -void PluginDownloadUrlHelper::OnResponseStarted(URLRequest* request) { +void PluginDownloadUrlHelper::OnResponseStarted(net::URLRequest* request) { if (!download_file_->IsOpen()) { // This is safe because once the temp file has been safely created, an // attacker can't drop a symlink etc into place. @@ -91,7 +91,7 @@ void PluginDownloadUrlHelper::OnResponseStarted(URLRequest* request) { } } -void PluginDownloadUrlHelper::OnReadCompleted(URLRequest* request, +void PluginDownloadUrlHelper::OnReadCompleted(net::URLRequest* request, int bytes_read) { DCHECK(download_file_->IsOpen()); @@ -129,7 +129,7 @@ void PluginDownloadUrlHelper::OnReadCompleted(URLRequest* request, } } -void PluginDownloadUrlHelper::OnDownloadCompleted(URLRequest* request) { +void PluginDownloadUrlHelper::OnDownloadCompleted(net::URLRequest* request) { bool success = true; if (!request->status().is_success()) { success = false; diff --git a/chrome/browser/plugin_download_helper.h b/chrome/browser/plugin_download_helper.h index 5d1a243..cccf3f0 100644 --- a/chrome/browser/plugin_download_helper.h +++ b/chrome/browser/plugin_download_helper.h @@ -18,7 +18,7 @@ // The PluginDownloadUrlHelper is used to handle one download URL request // from the plugin. Each download request is handled by a new instance // of this class. -class PluginDownloadUrlHelper : public URLRequest::Delegate { +class PluginDownloadUrlHelper : public net::URLRequest::Delegate { static const int kDownloadFileBufferSize = 32768; public: // The delegate receives notification about the status of downloads @@ -38,27 +38,27 @@ class PluginDownloadUrlHelper : public URLRequest::Delegate { void InitiateDownload(URLRequestContext* request_context); - // URLRequest::Delegate - virtual void OnAuthRequired(URLRequest* request, + // net::URLRequest::Delegate + virtual void OnAuthRequired(net::URLRequest* request, net::AuthChallengeInfo* auth_info); - virtual void OnSSLCertificateError(URLRequest* request, + virtual void OnSSLCertificateError(net::URLRequest* request, int cert_error, net::X509Certificate* cert); - virtual void OnResponseStarted(URLRequest* request); - virtual void OnReadCompleted(URLRequest* request, int bytes_read); + virtual void OnResponseStarted(net::URLRequest* request); + virtual void OnReadCompleted(net::URLRequest* request, int bytes_read); - void OnDownloadCompleted(URLRequest* request); + void OnDownloadCompleted(net::URLRequest* request); protected: void DownloadCompletedHelper(bool success); // The download file request initiated by the plugin. - URLRequest* download_file_request_; + net::URLRequest* download_file_request_; // Handle to the downloaded file. scoped_ptr<net::FileStream> download_file_; // The full path of the downloaded file. FilePath download_file_path_; - // The buffer passed off to URLRequest::Read. + // The buffer passed off to net::URLRequest::Read. scoped_refptr<net::IOBuffer> download_file_buffer_; // TODO(port): this comment doesn't describe the situation on Posix. // The window handle for sending the WM_COPYDATA notification, diff --git a/chrome/browser/policy/device_management_service_browsertest.cc b/chrome/browser/policy/device_management_service_browsertest.cc index 6c07e9e..2a2b0e1 100644 --- a/chrome/browser/policy/device_management_service_browsertest.cc +++ b/chrome/browser/policy/device_management_service_browsertest.cc @@ -43,22 +43,22 @@ const char kServiceResponseUnregister[] = #define PROTO_STRING(name) (std::string(name, arraysize(name) - 1)) // Interceptor implementation that returns test data back to the service. -class CannedResponseInterceptor : public URLRequest::Interceptor { +class CannedResponseInterceptor : public net::URLRequest::Interceptor { public: CannedResponseInterceptor(const GURL& service_url, const std::string& response_data) : service_url_(service_url), response_data_(response_data) { - URLRequest::RegisterRequestInterceptor(this); + net::URLRequest::RegisterRequestInterceptor(this); } virtual ~CannedResponseInterceptor() { - URLRequest::UnregisterRequestInterceptor(this); + net::URLRequest::UnregisterRequestInterceptor(this); } private: - // URLRequest::Interceptor overrides. - virtual URLRequestJob* MaybeIntercept(URLRequest* request) { + // net::URLRequest::Interceptor overrides. + virtual URLRequestJob* MaybeIntercept(net::URLRequest* request) { if (request->url().GetOrigin() == service_url_.GetOrigin() && request->url().path() == service_url_.path()) { return new URLRequestTestJob(request, diff --git a/chrome/browser/printing/print_dialog_cloud_uitest.cc b/chrome/browser/printing/print_dialog_cloud_uitest.cc index 3b57961..e13c792 100644 --- a/chrome/browser/printing/print_dialog_cloud_uitest.cc +++ b/chrome/browser/printing/print_dialog_cloud_uitest.cc @@ -55,7 +55,7 @@ class TestData { // whether it starts and finishes. class SimpleTestJob : public URLRequestTestJob { public: - explicit SimpleTestJob(URLRequest* request) + explicit SimpleTestJob(net::URLRequest* request) : URLRequestTestJob(request, test_headers(), Singleton<TestData>()->GetTestData(), true) {} @@ -128,13 +128,13 @@ class PrintDialogCloudTest : public InProcessBrowserTest { } // Must be static for handing into AddHostnameHandler. - static URLRequest::ProtocolFactory Factory; + static net::URLRequest::ProtocolFactory Factory; class AutoQuitDelegate : public TestDelegate { public: AutoQuitDelegate() {} - virtual void OnResponseCompleted(URLRequest* request) { + virtual void OnResponseCompleted(net::URLRequest* request) { BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, new MessageLoop::QuitTask()); } @@ -196,7 +196,7 @@ class PrintDialogCloudTest : public InProcessBrowserTest { AutoQuitDelegate delegate_; }; -URLRequestJob* PrintDialogCloudTest::Factory(URLRequest* request, +URLRequestJob* PrintDialogCloudTest::Factory(net::URLRequest* request, const std::string& scheme) { if (Singleton<TestController>()->use_delegate()) request->set_delegate(Singleton<TestController>()->delegate()); diff --git a/chrome/browser/renderer_host/async_resource_handler.cc b/chrome/browser/renderer_host/async_resource_handler.cc index 70dfc74..3458f7c 100644 --- a/chrome/browser/renderer_host/async_resource_handler.cc +++ b/chrome/browser/renderer_host/async_resource_handler.cc @@ -102,7 +102,7 @@ bool AsyncResourceHandler::OnRequestRedirected(int request_id, ResourceResponse* response, bool* defer) { *defer = true; - URLRequest* request = rdh_->GetURLRequest( + net::URLRequest* request = rdh_->GetURLRequest( GlobalRequestID(process_id_, request_id)); LoadTimingObserver::PopulateTimingInfo(request, response); DevToolsNetLogObserver::PopulateResponseInfo(request, response); @@ -117,7 +117,7 @@ bool AsyncResourceHandler::OnResponseStarted(int request_id, // renderer will be able to set these precisely at the time the // request commits, avoiding the possibility of e.g. zooming the old content // or of having to layout the new content twice. - URLRequest* request = rdh_->GetURLRequest( + net::URLRequest* request = rdh_->GetURLRequest( GlobalRequestID(process_id_, request_id)); LoadTimingObserver::PopulateTimingInfo(request, response); diff --git a/chrome/browser/renderer_host/buffered_resource_handler.cc b/chrome/browser/renderer_host/buffered_resource_handler.cc index 0a141b0..82ca861 100644 --- a/chrome/browser/renderer_host/buffered_resource_handler.cc +++ b/chrome/browser/renderer_host/buffered_resource_handler.cc @@ -52,7 +52,7 @@ void RecordSnifferMetrics(bool sniffing_blocked, BufferedResourceHandler::BufferedResourceHandler(ResourceHandler* handler, ResourceDispatcherHost* host, - URLRequest* request) + net::URLRequest* request) : real_handler_(handler), host_(host), request_(request), diff --git a/chrome/browser/renderer_host/cross_site_resource_handler.cc b/chrome/browser/renderer_host/cross_site_resource_handler.cc index ddab0e7..2e21515 100644 --- a/chrome/browser/renderer_host/cross_site_resource_handler.cc +++ b/chrome/browser/renderer_host/cross_site_resource_handler.cc @@ -59,7 +59,7 @@ bool CrossSiteResourceHandler::OnResponseStarted(int request_id, // Look up the request and associated info. GlobalRequestID global_id(render_process_host_id_, request_id); - URLRequest* request = rdh_->GetURLRequest(global_id); + net::URLRequest* request = rdh_->GetURLRequest(global_id); if (!request) { DLOG(WARNING) << "Request wasn't found"; return false; @@ -141,7 +141,7 @@ void CrossSiteResourceHandler::ResumeResponse() { // Find the request for this response. GlobalRequestID global_id(render_process_host_id_, request_id_); - URLRequest* request = rdh_->GetURLRequest(global_id); + net::URLRequest* request = rdh_->GetURLRequest(global_id); if (!request) { DLOG(WARNING) << "Resuming a request that wasn't found"; return; @@ -189,7 +189,7 @@ void CrossSiteResourceHandler::StartCrossSiteTransition( // Store this handler on the ExtraRequestInfo, so that RDH can call our // ResumeResponse method when the close ACK is received. - URLRequest* request = rdh_->GetURLRequest(global_id); + net::URLRequest* request = rdh_->GetURLRequest(global_id); if (!request) { DLOG(WARNING) << "Cross site response for a request that wasn't found"; return; diff --git a/chrome/browser/renderer_host/download_resource_handler.cc b/chrome/browser/renderer_host/download_resource_handler.cc index 83d64f8..5de9750 100644 --- a/chrome/browser/renderer_host/download_resource_handler.cc +++ b/chrome/browser/renderer_host/download_resource_handler.cc @@ -26,7 +26,7 @@ DownloadResourceHandler::DownloadResourceHandler( int request_id, const GURL& url, DownloadFileManager* download_file_manager, - URLRequest* request, + net::URLRequest* request, bool save_as, const DownloadSaveInfo& save_info) : download_id_(-1), diff --git a/chrome/browser/renderer_host/download_throttling_resource_handler.cc b/chrome/browser/renderer_host/download_throttling_resource_handler.cc index 3c0e32b..833c8a1 100644 --- a/chrome/browser/renderer_host/download_throttling_resource_handler.cc +++ b/chrome/browser/renderer_host/download_throttling_resource_handler.cc @@ -13,7 +13,7 @@ DownloadThrottlingResourceHandler::DownloadThrottlingResourceHandler( ResourceDispatcherHost* host, - URLRequest* request, + net::URLRequest* request, const GURL& url, int render_process_host_id, int render_view_id, diff --git a/chrome/browser/renderer_host/global_request_id.h b/chrome/browser/renderer_host/global_request_id.h index eb9520b..cb87c39 100644 --- a/chrome/browser/renderer_host/global_request_id.h +++ b/chrome/browser/renderer_host/global_request_id.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 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. @@ -6,7 +6,7 @@ #define CHROME_BROWSER_RENDERER_HOST_GLOBAL_REQUEST_ID_H_ #pragma once -// Uniquely identifies a URLRequest. +// Uniquely identifies a net::URLRequest. struct GlobalRequestID { GlobalRequestID() : child_id(-1), request_id(-1) { } diff --git a/chrome/browser/renderer_host/offline_resource_handler.cc b/chrome/browser/renderer_host/offline_resource_handler.cc index ba94bee..362f411 100644 --- a/chrome/browser/renderer_host/offline_resource_handler.cc +++ b/chrome/browser/renderer_host/offline_resource_handler.cc @@ -23,7 +23,7 @@ OfflineResourceHandler::OfflineResourceHandler( int host_id, int route_id, ResourceDispatcherHost* rdh, - URLRequest* request) + net::URLRequest* request) : next_handler_(handler), process_host_id_(host_id), render_view_id_(route_id), diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.cc b/chrome/browser/renderer_host/resource_dispatcher_host.cc index eb7e94f..64e5a5930 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host.cc +++ b/chrome/browser/renderer_host/resource_dispatcher_host.cc @@ -157,7 +157,7 @@ bool ShouldServiceRequest(ChildProcessInfo::ProcessType process_type, return true; } -void PopulateResourceResponse(URLRequest* request, +void PopulateResourceResponse(net::URLRequest* request, bool replace_extension_localization_templates, ResourceResponse* response) { response->response_head.status = request->status(); @@ -246,7 +246,7 @@ void ResourceDispatcherHost::Shutdown() { } void ResourceDispatcherHost::SetRequestInfo( - URLRequest* request, + net::URLRequest* request, ResourceDispatcherHostRequestInfo* info) { request->SetUserData(NULL, info); } @@ -285,7 +285,7 @@ bool ResourceDispatcherHost::HandleExternalProtocol(int request_id, const GURL& url, ResourceType::Type type, ResourceHandler* handler) { - if (!ResourceType::IsFrame(type) || URLRequest::IsHandledURL(url)) + if (!ResourceType::IsFrame(type) || net::URLRequest::IsHandledURL(url)) return false; BrowserThread::PostTask( @@ -430,7 +430,7 @@ void ResourceDispatcherHost::BeginRequest( } // Construct the request. - URLRequest* request = new URLRequest(request_data.url, this); + net::URLRequest* request = new net::URLRequest(request_data.url, this); request->set_method(request_data.method); request->set_first_party_for_cookies(request_data.first_party_for_cookies); request->set_referrer(CommandLine::ForCurrentProcess()->HasSwitch( @@ -707,7 +707,7 @@ void ResourceDispatcherHost::BeginDownload( // Ensure the Chrome plugins are loaded, as they may intercept network // requests. Does nothing if they are already loaded. PluginService::GetInstance()->LoadChromePlugins(this); - URLRequest* request = new URLRequest(url, this); + net::URLRequest* request = new net::URLRequest(url, this); request_id_--; @@ -727,7 +727,7 @@ void ResourceDispatcherHost::BeginDownload( ResourceType::MAIN_FRAME); } - if (!URLRequest::IsHandledURL(url)) { + if (!net::URLRequest::IsHandledURL(url)) { VLOG(1) << "Download request for unsupported protocol: " << url.possibly_invalid_spec(); return; @@ -768,7 +768,7 @@ void ResourceDispatcherHost::BeginSaveFile(const GURL& url, save_file_manager_.get())); request_id_--; - bool known_proto = URLRequest::IsHandledURL(url); + bool known_proto = net::URLRequest::IsHandledURL(url); if (!known_proto) { // Since any URLs which have non-standard scheme have been filtered // by save manager(see GURL::SchemeIsStandard). This situation @@ -777,7 +777,7 @@ void ResourceDispatcherHost::BeginSaveFile(const GURL& url, return; } - URLRequest* request = new URLRequest(url, this); + net::URLRequest* request = new net::URLRequest(url, this); request->set_method("GET"); request->set_referrer(CommandLine::ForCurrentProcess()->HasSwitch( switches::kNoReferrers) ? std::string() : referrer.spec()); @@ -826,7 +826,7 @@ void ResourceDispatcherHost::StartDeferredRequest(int process_unique_id, // TODO(eroman): are there other considerations for paused or blocked // requests? - URLRequest* request = i->second; + net::URLRequest* request = i->second; InsertIntoResourceQueue(request, *InfoForRequest(request)); } @@ -927,11 +927,12 @@ void ResourceDispatcherHost::CancelRequestsForRoute(int child_id, // Although every matching request was in pending_requests_ when we built // matching_requests, it is normal for a matching request to be not found // in pending_requests_ after we have removed some matching requests from - // pending_requests_. For example, deleting a URLRequest that has + // pending_requests_. For example, deleting a net::URLRequest that has // exclusive (write) access to an HTTP cache entry may unblock another - // URLRequest that needs exclusive access to the same cache entry, and - // that URLRequest may complete and remove itself from pending_requests_. - // So we need to check that iter is not equal to pending_requests_.end(). + // net::URLRequest that needs exclusive access to the same cache entry, and + // that net::URLRequest may complete and remove itself from + // pending_requests_. So we need to check that iter is not equal to + // pending_requests_.end(). if (iter != pending_requests_.end()) RemovePendingRequest(iter); } @@ -996,9 +997,9 @@ void ResourceDispatcherHost::RemovePendingRequest( update_load_states_timer_.Stop(); } -// URLRequest::Delegate ------------------------------------------------------- +// net::URLRequest::Delegate --------------------------------------------------- -void ResourceDispatcherHost::OnReceivedRedirect(URLRequest* request, +void ResourceDispatcherHost::OnReceivedRedirect(net::URLRequest* request, const GURL& new_url, bool* defer_redirect) { VLOG(1) << "OnReceivedRedirect: " << request->url().spec(); @@ -1037,13 +1038,13 @@ void ResourceDispatcherHost::OnReceivedRedirect(URLRequest* request, } void ResourceDispatcherHost::OnAuthRequired( - URLRequest* request, + net::URLRequest* request, net::AuthChallengeInfo* auth_info) { // Create a login dialog on the UI thread to get authentication data, // or pull from cache and continue on the IO thread. // TODO(mpcomplete): We should block the parent tab while waiting for // authentication. - // That would also solve the problem of the URLRequest being cancelled + // That would also solve the problem of the net::URLRequest being cancelled // before we receive authentication. ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); DCHECK(!info->login_handler()) << @@ -1052,7 +1053,7 @@ void ResourceDispatcherHost::OnAuthRequired( } void ResourceDispatcherHost::OnCertificateRequested( - URLRequest* request, + net::URLRequest* request, net::SSLCertRequestInfo* cert_request_info) { DCHECK(request); @@ -1071,14 +1072,14 @@ void ResourceDispatcherHost::OnCertificateRequested( } void ResourceDispatcherHost::OnSSLCertificateError( - URLRequest* request, + net::URLRequest* request, int cert_error, net::X509Certificate* cert) { DCHECK(request); SSLManager::OnSSLCertificateError(this, request, cert_error, cert); } -void ResourceDispatcherHost::OnSetCookie(URLRequest* request, +void ResourceDispatcherHost::OnSetCookie(net::URLRequest* request, const std::string& cookie_line, const net::CookieOptions& options, bool blocked_by_policy) { @@ -1094,7 +1095,7 @@ void ResourceDispatcherHost::OnSetCookie(URLRequest* request, request->url(), cookie_line, options, blocked_by_policy); } -void ResourceDispatcherHost::OnResponseStarted(URLRequest* request) { +void ResourceDispatcherHost::OnResponseStarted(net::URLRequest* request) { VLOG(1) << "OnResponseStarted: " << request->url().spec(); ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); if (PauseRequestIfNeeded(info)) { @@ -1125,7 +1126,7 @@ void ResourceDispatcherHost::OnResponseStarted(URLRequest* request) { } } -bool ResourceDispatcherHost::CompleteResponseStarted(URLRequest* request) { +bool ResourceDispatcherHost::CompleteResponseStarted(net::URLRequest* request) { ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); scoped_refptr<ResourceResponse> response(new ResourceResponse); @@ -1169,7 +1170,7 @@ void ResourceDispatcherHost::CancelRequest(int child_id, CancelRequestInternal(i->second, from_renderer); } -void ResourceDispatcherHost::CancelRequestInternal(URLRequest* request, +void ResourceDispatcherHost::CancelRequestInternal(net::URLRequest* request, bool from_renderer) { VLOG(1) << "CancelRequest: " << request->url().spec(); @@ -1218,7 +1219,7 @@ int ResourceDispatcherHost::IncrementOutstandingRequestsMemoryCost( // static int ResourceDispatcherHost::CalculateApproximateMemoryCost( - URLRequest* request) { + net::URLRequest* request) { // The following fields should be a minor size contribution (experimentally // on the order of 100). However since they are variable length, it could // in theory be a sizeable contribution. @@ -1253,7 +1254,7 @@ int ResourceDispatcherHost::CalculateApproximateMemoryCost( return kAvgBytesPerOutstandingRequest + strings_cost + upload_cost; } -void ResourceDispatcherHost::BeginRequestInternal(URLRequest* request) { +void ResourceDispatcherHost::BeginRequestInternal(net::URLRequest* request) { DCHECK(!request->is_pending()); ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); @@ -1265,7 +1266,7 @@ void ResourceDispatcherHost::BeginRequestInternal(URLRequest* request) { // If enqueing/starting this request will exceed our per-process memory // bound, abort it right away. if (memory_cost > max_outstanding_requests_cost_per_process_) { - // We call "SimulateError()" as a way of setting the URLRequest's + // We call "SimulateError()" as a way of setting the net::URLRequest's // status -- it has no effect beyond this, since the request hasn't started. request->SimulateError(net::ERR_INSUFFICIENT_RESOURCES); @@ -1288,7 +1289,7 @@ void ResourceDispatcherHost::BeginRequestInternal(URLRequest* request) { GlobalRequestID global_id(info->child_id(), info->request_id()); pending_requests_[global_id] = request; - // Give the resource handlers an opportunity to delay the URLRequest from + // Give the resource handlers an opportunity to delay the net::URLRequest from // being started. // // There are three cases: @@ -1313,7 +1314,7 @@ void ResourceDispatcherHost::BeginRequestInternal(URLRequest* request) { } void ResourceDispatcherHost::InsertIntoResourceQueue( - URLRequest* request, + net::URLRequest* request, const ResourceDispatcherHostRequestInfo& request_info) { resource_queue_.AddRequest(request, request_info); @@ -1337,7 +1338,7 @@ void ResourceDispatcherHost::ResumeRequest(const GlobalRequestID& request_id) { if (i == pending_requests_.end()) // The request may have been destroyed return; - URLRequest* request = i->second; + net::URLRequest* request = i->second; ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); if (!info->is_paused()) return; @@ -1357,7 +1358,7 @@ void ResourceDispatcherHost::ResumeRequest(const GlobalRequestID& request_id) { } } -void ResourceDispatcherHost::StartReading(URLRequest* request) { +void ResourceDispatcherHost::StartReading(net::URLRequest* request) { // Start reading. int bytes_read = 0; if (Read(request, &bytes_read)) { @@ -1369,7 +1370,7 @@ void ResourceDispatcherHost::StartReading(URLRequest* request) { } } -bool ResourceDispatcherHost::Read(URLRequest* request, int* bytes_read) { +bool ResourceDispatcherHost::Read(net::URLRequest* request, int* bytes_read) { ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); DCHECK(!info->is_paused()); @@ -1387,7 +1388,7 @@ bool ResourceDispatcherHost::Read(URLRequest* request, int* bytes_read) { return request->Read(buf, buf_size, bytes_read); } -void ResourceDispatcherHost::OnReadCompleted(URLRequest* request, +void ResourceDispatcherHost::OnReadCompleted(net::URLRequest* request, int bytes_read) { DCHECK(request); VLOG(1) << "OnReadCompleted: " << request->url().spec(); @@ -1440,7 +1441,7 @@ void ResourceDispatcherHost::OnReadCompleted(URLRequest* request, OnResponseCompleted(request); } -bool ResourceDispatcherHost::CompleteRead(URLRequest* request, +bool ResourceDispatcherHost::CompleteRead(net::URLRequest* request, int* bytes_read) { if (!request || !request->status().is_success()) { NOTREACHED(); @@ -1457,7 +1458,7 @@ bool ResourceDispatcherHost::CompleteRead(URLRequest* request, return *bytes_read != 0; } -void ResourceDispatcherHost::OnResponseCompleted(URLRequest* request) { +void ResourceDispatcherHost::OnResponseCompleted(net::URLRequest* request) { VLOG(1) << "OnResponseCompleted: " << request->url().spec(); ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); @@ -1494,16 +1495,16 @@ void ResourceDispatcherHost::OnResponseCompleted(URLRequest* request) { // static ResourceDispatcherHostRequestInfo* ResourceDispatcherHost::InfoForRequest( - URLRequest* request) { + net::URLRequest* request) { // Avoid writing this function twice by casting the cosnt version. - const URLRequest* const_request = request; + const net::URLRequest* const_request = request; return const_cast<ResourceDispatcherHostRequestInfo*>( InfoForRequest(const_request)); } // static const ResourceDispatcherHostRequestInfo* ResourceDispatcherHost::InfoForRequest( - const URLRequest* request) { + const net::URLRequest* request) { const ResourceDispatcherHostRequestInfo* info = static_cast<const ResourceDispatcherHostRequestInfo*>( request->GetUserData(NULL)); @@ -1512,9 +1513,10 @@ const ResourceDispatcherHostRequestInfo* ResourceDispatcherHost::InfoForRequest( } // static -bool ResourceDispatcherHost::RenderViewForRequest(const URLRequest* request, - int* render_process_host_id, - int* render_view_host_id) { +bool ResourceDispatcherHost::RenderViewForRequest( + const net::URLRequest* request, + int* render_process_host_id, + int* render_view_host_id) { const ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); if (!info) { *render_process_host_id = -1; @@ -1553,7 +1555,7 @@ void ResourceDispatcherHost::RemoveObserver(Observer* obs) { observer_list_.RemoveObserver(obs); } -URLRequest* ResourceDispatcherHost::GetURLRequest( +net::URLRequest* ResourceDispatcherHost::GetURLRequest( const GlobalRequestID& request_id) const { // This should be running in the IO loop. DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); @@ -1565,7 +1567,7 @@ URLRequest* ResourceDispatcherHost::GetURLRequest( return i->second; } -static int GetCertID(URLRequest* request, int child_id) { +static int GetCertID(net::URLRequest* request, int child_id) { if (request->ssl_info().cert) { return CertStore::GetSharedInstance()->StoreCert(request->ssl_info().cert, child_id); @@ -1582,7 +1584,7 @@ static int GetCertID(URLRequest* request, int child_id) { return 0; } -void ResourceDispatcherHost::NotifyResponseStarted(URLRequest* request, +void ResourceDispatcherHost::NotifyResponseStarted(net::URLRequest* request, int child_id) { // Notify the observers on the IO thread. FOR_EACH_OBSERVER(Observer, observer_list_, OnRequestStarted(this, request)); @@ -1598,14 +1600,14 @@ void ResourceDispatcherHost::NotifyResponseStarted(URLRequest* request, ResourceRequestDetails(request, GetCertID(request, child_id))); } -void ResourceDispatcherHost::NotifyResponseCompleted(URLRequest* request, +void ResourceDispatcherHost::NotifyResponseCompleted(net::URLRequest* request, int child_id) { // Notify the observers on the IO thread. FOR_EACH_OBSERVER(Observer, observer_list_, OnResponseCompleted(this, request)); } -void ResourceDispatcherHost::NotifyReceivedRedirect(URLRequest* request, +void ResourceDispatcherHost::NotifyReceivedRedirect(net::URLRequest* request, int child_id, const GURL& new_url) { // Notify the observers on the IO thread. @@ -1687,7 +1689,7 @@ void ResourceDispatcherHost::UpdateLoadStates() { // in each View (good chance it's zero). std::map<std::pair<int, int>, uint64> largest_upload_size; for (i = pending_requests_.begin(); i != pending_requests_.end(); ++i) { - URLRequest* request = i->second; + net::URLRequest* request = i->second; ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); uint64 upload_size = info->upload_size(); if (request->GetLoadState() != net::LOAD_STATE_SENDING_REQUEST) @@ -1698,7 +1700,7 @@ void ResourceDispatcherHost::UpdateLoadStates() { } for (i = pending_requests_.begin(); i != pending_requests_.end(); ++i) { - URLRequest* request = i->second; + net::URLRequest* request = i->second; net::LoadState load_state = request->GetLoadState(); ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); @@ -1747,7 +1749,7 @@ void ResourceDispatcherHost::UpdateLoadStates() { // Returns true iff an upload progress message should be sent to the UI thread. bool ResourceDispatcherHost::MaybeUpdateUploadProgress( ResourceDispatcherHostRequestInfo *info, - URLRequest *request) { + net::URLRequest *request) { if (!info->upload_size() || info->waiting_for_upload_progress_ack()) return false; @@ -1818,7 +1820,7 @@ void ResourceDispatcherHost::ProcessBlockedRequestsForRoute( req_iter != requests->end(); ++req_iter) { // Remove the memory credit that we added when pushing the request onto // the blocked list. - URLRequest* request = *req_iter; + net::URLRequest* request = *req_iter; ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); IncrementOutstandingRequestsMemoryCost(-1 * info->memory_cost(), info->child_id()); @@ -1831,7 +1833,7 @@ void ResourceDispatcherHost::ProcessBlockedRequestsForRoute( delete requests; } -bool ResourceDispatcherHost::IsValidRequest(URLRequest* request) { +bool ResourceDispatcherHost::IsValidRequest(net::URLRequest* request) { if (!request) return false; ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.h b/chrome/browser/renderer_host/resource_dispatcher_host.h index 7fc27b8..840d2db 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host.h +++ b/chrome/browser/renderer_host/resource_dispatcher_host.h @@ -51,7 +51,7 @@ namespace webkit_blob { class DeletableFileReference; } -class ResourceDispatcherHost : public URLRequest::Delegate { +class ResourceDispatcherHost : public net::URLRequest::Delegate { public: // Implemented by the client of ResourceDispatcherHost to receive messages in // response to a resource load. The messages are intended to be forwarded to @@ -83,12 +83,12 @@ class ResourceDispatcherHost : public URLRequest::Delegate { public: virtual ~Observer() {} virtual void OnRequestStarted(ResourceDispatcherHost* resource_dispatcher, - URLRequest* request) = 0; + net::URLRequest* request) = 0; virtual void OnResponseCompleted( ResourceDispatcherHost* resource_dispatcher, - URLRequest* request) = 0; + net::URLRequest* request) = 0; virtual void OnReceivedRedirect(ResourceDispatcherHost* resource_dispatcher, - URLRequest* request, + net::URLRequest* request, const GURL& new_url) = 0; }; @@ -202,37 +202,38 @@ class ResourceDispatcherHost : public URLRequest::Delegate { // acts like CancelRequestsForProcess when route_id is -1. void CancelRequestsForRoute(int process_unique_id, int route_id); - // URLRequest::Delegate - virtual void OnReceivedRedirect(URLRequest* request, + // net::URLRequest::Delegate + virtual void OnReceivedRedirect(net::URLRequest* request, const GURL& new_url, bool* defer_redirect); - virtual void OnAuthRequired(URLRequest* request, + virtual void OnAuthRequired(net::URLRequest* request, net::AuthChallengeInfo* auth_info); virtual void OnCertificateRequested( - URLRequest* request, + net::URLRequest* request, net::SSLCertRequestInfo* cert_request_info); - virtual void OnSSLCertificateError(URLRequest* request, + virtual void OnSSLCertificateError(net::URLRequest* request, int cert_error, net::X509Certificate* cert); - virtual void OnSetCookie(URLRequest* request, + virtual void OnSetCookie(net::URLRequest* request, const std::string& cookie_line, const net::CookieOptions& options, bool blocked_by_policy); - virtual void OnResponseStarted(URLRequest* request); - virtual void OnReadCompleted(URLRequest* request, int bytes_read); - void OnResponseCompleted(URLRequest* request); + virtual void OnResponseStarted(net::URLRequest* request); + virtual void OnReadCompleted(net::URLRequest* request, int bytes_read); + void OnResponseCompleted(net::URLRequest* request); // Helper functions to get our extra data out of a request. The given request // must have been one we created so that it has the proper extra data pointer. - static ResourceDispatcherHostRequestInfo* InfoForRequest(URLRequest* request); + static ResourceDispatcherHostRequestInfo* InfoForRequest( + net::URLRequest* request); static const ResourceDispatcherHostRequestInfo* InfoForRequest( - const URLRequest* request); + const net::URLRequest* request); // Extracts the render view/process host's identifiers from the given request // and places them in the given out params (both required). If there are no // such IDs associated with the request (such as non-page-related requests), // this function will return false and both out params will be -1. - static bool RenderViewForRequest(const URLRequest* request, + static bool RenderViewForRequest(const net::URLRequest* request, int* render_process_host_id, int* render_view_host_id); @@ -244,11 +245,11 @@ class ResourceDispatcherHost : public URLRequest::Delegate { // Removes an observer. void RemoveObserver(Observer* obs); - // Retrieves a URLRequest. Must be called from the IO thread. - URLRequest* GetURLRequest(const GlobalRequestID& request_id) const; + // Retrieves a net::URLRequest. Must be called from the IO thread. + net::URLRequest* GetURLRequest(const GlobalRequestID& request_id) const; // Notifies our observers that a request has been cancelled. - void NotifyResponseCompleted(URLRequest* request, int process_unique_id); + void NotifyResponseCompleted(net::URLRequest* request, int process_unique_id); void RemovePendingRequest(int process_unique_id, int request_id); @@ -304,7 +305,7 @@ class ResourceDispatcherHost : public URLRequest::Delegate { // Associates the given info with the given request. The info will then be // owned by the request. - void SetRequestInfo(URLRequest* request, + void SetRequestInfo(net::URLRequest* request, ResourceDispatcherHostRequestInfo* info); // A shutdown helper that runs on the IO thread. @@ -317,36 +318,36 @@ class ResourceDispatcherHost : public URLRequest::Delegate { void ResumeRequest(const GlobalRequestID& request_id); // Internal function to start reading for the first time. - void StartReading(URLRequest* request); + void StartReading(net::URLRequest* request); // Reads data from the response using our internal buffer as async IO. // Returns true if data is available immediately, false otherwise. If the // return value is false, we will receive a OnReadComplete() callback later. - bool Read(URLRequest* request, int* bytes_read); + bool Read(net::URLRequest* request, int* bytes_read); // Internal function to finish an async IO which has completed. Returns // true if there is more data to read (e.g. we haven't read EOF yet and // no errors have occurred). - bool CompleteRead(URLRequest*, int* bytes_read); + bool CompleteRead(net::URLRequest*, int* bytes_read); // Internal function to finish handling the ResponseStarted message. Returns // true on success. - bool CompleteResponseStarted(URLRequest* request); + bool CompleteResponseStarted(net::URLRequest* request); // Helper function for regular and download requests. - void BeginRequestInternal(URLRequest* request); + void BeginRequestInternal(net::URLRequest* request); // Helper function that cancels |request|. - void CancelRequestInternal(URLRequest* request, bool from_renderer); + void CancelRequestInternal(net::URLRequest* request, bool from_renderer); // Helper function that inserts |request| into the resource queue. void InsertIntoResourceQueue( - URLRequest* request, + net::URLRequest* request, const ResourceDispatcherHostRequestInfo& request_info); // Updates the "cost" of outstanding requests for |process_unique_id|. // The "cost" approximates how many bytes are consumed by all the in-memory - // data structures supporting this request (URLRequest object, + // data structures supporting this request (net::URLRequest object, // HttpNetworkTransaction, etc...). // The value of |cost| is added to the running total, and the resulting // sum is returned. @@ -354,7 +355,7 @@ class ResourceDispatcherHost : public URLRequest::Delegate { int process_unique_id); // Estimate how much heap space |request| will consume to run. - static int CalculateApproximateMemoryCost(URLRequest* request); + static int CalculateApproximateMemoryCost(net::URLRequest* request); // The list of all requests that we have pending. This list is not really // optimized, and assumes that we have relatively few requests pending at once @@ -363,7 +364,7 @@ class ResourceDispatcherHost : public URLRequest::Delegate { // It may be enhanced in the future to provide some kind of prioritization // mechanism. We should also consider a hashtable or binary tree if it turns // out we have a lot of things here. - typedef std::map<GlobalRequestID, URLRequest*> PendingRequestList; + typedef std::map<GlobalRequestID, net::URLRequest*> PendingRequestList; // Deletes the pending request identified by the iterator passed in. // This function will invalidate the iterator passed in. Callers should @@ -371,10 +372,10 @@ class ResourceDispatcherHost : public URLRequest::Delegate { void RemovePendingRequest(const PendingRequestList::iterator& iter); // Notify our observers that we started receiving a response for a request. - void NotifyResponseStarted(URLRequest* request, int process_unique_id); + void NotifyResponseStarted(net::URLRequest* request, int process_unique_id); // Notify our observers that a request has been redirected. - void NotifyReceivedRedirect(URLRequest* request, + void NotifyReceivedRedirect(net::URLRequest* request, int process_unique_id, const GURL& new_url); @@ -393,7 +394,7 @@ class ResourceDispatcherHost : public URLRequest::Delegate { // Checks the upload state and sends an update if one is necessary. bool MaybeUpdateUploadProgress(ResourceDispatcherHostRequestInfo *info, - URLRequest *request); + net::URLRequest *request); // Resumes or cancels (if |cancel_requests| is true) any blocked requests. void ProcessBlockedRequestsForRoute(int process_unique_id, @@ -430,7 +431,7 @@ class ResourceDispatcherHost : public URLRequest::Delegate { ResourceHandler* handler, int child_id, int route_id, bool download); // Returns true if |request| is in |pending_requests_|. - bool IsValidRequest(URLRequest* request); + bool IsValidRequest(net::URLRequest* request); // Returns true if the message passed in is a resource related message. static bool IsResourceDispatcherHostMessage(const IPC::Message&); @@ -500,7 +501,7 @@ class ResourceDispatcherHost : public URLRequest::Delegate { // True if the resource dispatcher host has been shut down. bool is_shutdown_; - typedef std::vector<URLRequest*> BlockedRequestsList; + typedef std::vector<net::URLRequest*> BlockedRequestsList; typedef std::pair<int, int> ProcessRouteIDs; typedef std::map<ProcessRouteIDs, BlockedRequestsList*> BlockedRequestMap; BlockedRequestMap blocked_requests_map_; diff --git a/chrome/browser/renderer_host/resource_dispatcher_host_request_info.h b/chrome/browser/renderer_host/resource_dispatcher_host_request_info.h index 9d5e386..032c4bd 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host_request_info.h +++ b/chrome/browser/renderer_host/resource_dispatcher_host_request_info.h @@ -27,7 +27,7 @@ class BlobData; // Holds the data ResourceDispatcherHost associates with each request. // Retrieve this data by calling ResourceDispatcherHost::InfoForRequest. -class ResourceDispatcherHostRequestInfo : public URLRequest::UserData { +class ResourceDispatcherHostRequestInfo : public net::URLRequest::UserData { public: // This will take a reference to the handler. ResourceDispatcherHostRequestInfo( diff --git a/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc b/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc index 209bce3..4ca79ac 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc +++ b/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc @@ -184,15 +184,16 @@ class ResourceDispatcherHostTest : public testing::Test, DCHECK(!test_fixture_); test_fixture_ = this; ChildProcessSecurityPolicy::GetInstance()->Add(0); - URLRequest::RegisterProtocolFactory("test", - &ResourceDispatcherHostTest::Factory); + net::URLRequest::RegisterProtocolFactory( + "test", + &ResourceDispatcherHostTest::Factory); EnsureTestSchemeIsAllowed(); } virtual void TearDown() { - URLRequest::RegisterProtocolFactory("test", NULL); + net::URLRequest::RegisterProtocolFactory("test", NULL); if (!scheme_.empty()) - URLRequest::RegisterProtocolFactory(scheme_, old_factory_); + net::URLRequest::RegisterProtocolFactory(scheme_, old_factory_); DCHECK(test_fixture_ == this); test_fixture_ = NULL; @@ -250,12 +251,12 @@ class ResourceDispatcherHostTest : public testing::Test, DCHECK(scheme_.empty()); DCHECK(!old_factory_); scheme_ = scheme; - old_factory_ = URLRequest::RegisterProtocolFactory( - scheme_, &ResourceDispatcherHostTest::Factory); + old_factory_ = net::URLRequest::RegisterProtocolFactory( + scheme_, &ResourceDispatcherHostTest::Factory); } // Our own URLRequestJob factory. - static URLRequestJob* Factory(URLRequest* request, + static URLRequestJob* Factory(net::URLRequest* request, const std::string& scheme) { if (test_fixture_->response_headers_.empty()) { return new URLRequestTestJob(request); @@ -273,7 +274,7 @@ class ResourceDispatcherHostTest : public testing::Test, std::string response_headers_; std::string response_data_; std::string scheme_; - URLRequest::ProtocolFactory* old_factory_; + net::URLRequest::ProtocolFactory* old_factory_; ResourceType::Type resource_type_; static ResourceDispatcherHostTest* test_fixture_; }; @@ -651,7 +652,7 @@ TEST_F(ResourceDispatcherHostTest, TestBlockedRequestsDontLeak) { // Test the private helper method "CalculateApproximateMemoryCost()". TEST_F(ResourceDispatcherHostTest, CalculateApproximateMemoryCost) { - URLRequest req(GURL("http://www.google.com"), NULL); + net::URLRequest req(GURL("http://www.google.com"), NULL); EXPECT_EQ(4427, ResourceDispatcherHost::CalculateApproximateMemoryCost(&req)); // Add 9 bytes of referrer. diff --git a/chrome/browser/renderer_host/resource_handler.h b/chrome/browser/renderer_host/resource_handler.h index 56f70bd..bc05b17 100644 --- a/chrome/browser/renderer_host/resource_handler.h +++ b/chrome/browser/renderer_host/resource_handler.h @@ -48,11 +48,11 @@ class ResourceHandler virtual bool OnResponseStarted(int request_id, ResourceResponse* response) = 0; - // Called before the URLRequest for |request_id| (whose url is |url|) is to be - // started. If the handler returns false, then the request is cancelled. + // Called before the net::URLRequest for |request_id| (whose url is |url|) is + // to be started. If the handler returns false, then the request is cancelled. // Otherwise if the return value is true, the ResourceHandler can delay the // request from starting by setting |*defer = true|. A deferred request will - // not have called URLRequest::Start(), and will not resume until someone + // not have called net::URLRequest::Start(), and will not resume until someone // calls ResourceDispatcherHost::StartDeferredRequest(). virtual bool OnWillStart(int request_id, const GURL& url, bool* defer) = 0; @@ -77,7 +77,7 @@ class ResourceHandler const std::string& security_info) = 0; // Signals that the request is closed (i.e. finished successfully, cancelled). - // This is a signal that the associated URLRequest isn't valid anymore. + // This is a signal that the associated net::URLRequest isn't valid anymore. virtual void OnRequestClosed() = 0; // This notification is synthesized by the RedirectToFileResourceHandler diff --git a/chrome/browser/renderer_host/resource_queue.cc b/chrome/browser/renderer_host/resource_queue.cc index 668f6e6..66d02a1 100644 --- a/chrome/browser/renderer_host/resource_queue.cc +++ b/chrome/browser/renderer_host/resource_queue.cc @@ -37,7 +37,7 @@ void ResourceQueue::Shutdown() { } void ResourceQueue::AddRequest( - URLRequest* request, + net::URLRequest* request, const ResourceDispatcherHostRequestInfo& request_info) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DCHECK(!shutdown_); @@ -84,7 +84,7 @@ void ResourceQueue::StartDelayedRequest(ResourceQueueDelegate* delegate, interested_delegates_.erase(request_id); if (ContainsKey(requests_, request_id)) { - URLRequest* request = requests_[request_id]; + net::URLRequest* request = requests_[request_id]; // The request shouldn't have started (SUCCESS is the initial state). DCHECK_EQ(URLRequestStatus::SUCCESS, request->status().status()); request->Start(); diff --git a/chrome/browser/renderer_host/resource_queue.h b/chrome/browser/renderer_host/resource_queue.h index d6ce412..e3e5e2f 100644 --- a/chrome/browser/renderer_host/resource_queue.h +++ b/chrome/browser/renderer_host/resource_queue.h @@ -18,7 +18,7 @@ class URLRequest; class ResourceDispatcherHostRequestInfo; struct GlobalRequestID; -// Makes decisions about delaying or not each URLRequest in the queue. +// Makes decisions about delaying or not each net::URLRequest in the queue. // All methods are called on the IO thread. class ResourceQueueDelegate { public: @@ -65,8 +65,8 @@ class ResourceQueue { void AddRequest(net::URLRequest* request, const ResourceDispatcherHostRequestInfo& request_info); - // Tells the queue that the URLRequest object associated with |request_id| - // is no longer valid. + // Tells the queue that the net::URLRequest object associated with + // |request_id| is no longer valid. void RemoveRequest(const GlobalRequestID& request_id); // A delegate should call StartDelayedRequest when it wants to allow the @@ -83,8 +83,8 @@ class ResourceQueue { // initialized. DelegateSet delegates_; - // Stores URLRequest objects associated with each GlobalRequestID. This helps - // decoupling the queue from ResourceDispatcherHost. + // Stores net::URLRequest objects associated with each GlobalRequestID. This + // helps decoupling the queue from ResourceDispatcherHost. RequestMap requests_; // Maps a GlobalRequestID to the set of delegates that want to prevent the diff --git a/chrome/browser/renderer_host/resource_queue_unittest.cc b/chrome/browser/renderer_host/resource_queue_unittest.cc index 30ebc2f..983ea0c 100644 --- a/chrome/browser/renderer_host/resource_queue_unittest.cc +++ b/chrome/browser/renderer_host/resource_queue_unittest.cc @@ -100,7 +100,7 @@ class NeverDelayingDelegate : public ResourceQueueDelegate { } virtual bool ShouldDelayRequest( - URLRequest* request, + net::URLRequest* request, const ResourceDispatcherHostRequestInfo& request_info, const GlobalRequestID& request_id) { return false; @@ -120,7 +120,7 @@ class AlwaysDelayingDelegate : public ResourceQueueDelegate { } virtual bool ShouldDelayRequest( - URLRequest* request, + net::URLRequest* request, const ResourceDispatcherHostRequestInfo& request_info, const GlobalRequestID& request_id) { delayed_requests_.push_back(request_id); @@ -151,7 +151,8 @@ class AlwaysDelayingDelegate : public ResourceQueueDelegate { DISALLOW_COPY_AND_ASSIGN(AlwaysDelayingDelegate); }; -class ResourceQueueTest : public testing::Test, public URLRequest::Delegate { +class ResourceQueueTest : public testing::Test, + public net::URLRequest::Delegate { public: ResourceQueueTest() : response_started_count_(0), @@ -160,14 +161,14 @@ class ResourceQueueTest : public testing::Test, public URLRequest::Delegate { io_thread_(BrowserThread::IO, &message_loop_) { } - virtual void OnResponseStarted(URLRequest* request) { + virtual void OnResponseStarted(net::URLRequest* request) { response_started_count_++; // We're not going to do anything more with the request. Cancel it now // to avoid leaking URLRequestJob. request->Cancel(); } - virtual void OnReadCompleted(URLRequest* request, int bytes_read) { + virtual void OnReadCompleted(net::URLRequest* request, int bytes_read) { } protected: @@ -192,7 +193,7 @@ TEST_F(ResourceQueueTest, NeverDelayingDelegate) { NeverDelayingDelegate delegate; InitializeQueue(&queue, &delegate); - URLRequest request(GURL(kTestUrl), this); + net::URLRequest request(GURL(kTestUrl), this); scoped_ptr<ResourceDispatcherHostRequestInfo> request_info(GetRequestInfo(0)); EXPECT_EQ(0, response_started_count_); queue.AddRequest(&request, *request_info.get()); @@ -208,7 +209,7 @@ TEST_F(ResourceQueueTest, AlwaysDelayingDelegate) { AlwaysDelayingDelegate delegate(&queue); InitializeQueue(&queue, &delegate); - URLRequest request(GURL(kTestUrl), this); + net::URLRequest request(GURL(kTestUrl), this); scoped_ptr<ResourceDispatcherHostRequestInfo> request_info(GetRequestInfo(0)); EXPECT_EQ(0, response_started_count_); queue.AddRequest(&request, *request_info.get()); @@ -227,7 +228,7 @@ TEST_F(ResourceQueueTest, AlwaysDelayingDelegateAfterShutdown) { AlwaysDelayingDelegate delegate(&queue); InitializeQueue(&queue, &delegate); - URLRequest request(GURL(kTestUrl), this); + net::URLRequest request(GURL(kTestUrl), this); scoped_ptr<ResourceDispatcherHostRequestInfo> request_info(GetRequestInfo(0)); EXPECT_EQ(0, response_started_count_); queue.AddRequest(&request, *request_info.get()); @@ -248,7 +249,7 @@ TEST_F(ResourceQueueTest, TwoDelegates) { NeverDelayingDelegate never_delaying_delegate; InitializeQueue(&queue, &always_delaying_delegate, &never_delaying_delegate); - URLRequest request(GURL(kTestUrl), this); + net::URLRequest request(GURL(kTestUrl), this); scoped_ptr<ResourceDispatcherHostRequestInfo> request_info(GetRequestInfo(0)); EXPECT_EQ(0, response_started_count_); queue.AddRequest(&request, *request_info.get()); @@ -267,7 +268,7 @@ TEST_F(ResourceQueueTest, RemoveRequest) { AlwaysDelayingDelegate delegate(&queue); InitializeQueue(&queue, &delegate); - URLRequest request(GURL(kTestUrl), this); + net::URLRequest request(GURL(kTestUrl), this); scoped_ptr<ResourceDispatcherHostRequestInfo> request_info(GetRequestInfo(0)); GlobalRequestID request_id(request_info->child_id(), request_info->request_id()); diff --git a/chrome/browser/renderer_host/resource_request_details.cc b/chrome/browser/renderer_host/resource_request_details.cc index 20a255d..6facdd6 100644 --- a/chrome/browser/renderer_host/resource_request_details.cc +++ b/chrome/browser/renderer_host/resource_request_details.cc @@ -4,8 +4,7 @@ #include "chrome/browser/renderer_host/resource_request_details.h" - -ResourceRequestDetails::ResourceRequestDetails(const URLRequest* request, +ResourceRequestDetails::ResourceRequestDetails(const net::URLRequest* request, int cert_id) : url_(request->url()), original_url_(request->original_url()), @@ -44,7 +43,7 @@ ResourceRequestDetails::ResourceRequestDetails(const URLRequest* request, ResourceRequestDetails::~ResourceRequestDetails() {} -ResourceRedirectDetails::ResourceRedirectDetails(const URLRequest* request, +ResourceRedirectDetails::ResourceRedirectDetails(const net::URLRequest* request, int cert_id, const GURL& new_url) : ResourceRequestDetails(request, cert_id), diff --git a/chrome/browser/renderer_host/resource_request_details.h b/chrome/browser/renderer_host/resource_request_details.h index bdb87bf..0d05804 100644 --- a/chrome/browser/renderer_host/resource_request_details.h +++ b/chrome/browser/renderer_host/resource_request_details.h @@ -4,7 +4,7 @@ // The ResourceRequestDetails object contains additional details about a // resource request. It copies many of the publicly accessible member variables -// of URLRequest, but exists on the UI thread. +// of net::URLRequest, but exists on the UI thread. #ifndef CHROME_BROWSER_RENDERER_HOST_RESOURCE_REQUEST_DETAILS_H_ #define CHROME_BROWSER_RENDERER_HOST_RESOURCE_REQUEST_DETAILS_H_ diff --git a/chrome/browser/renderer_host/safe_browsing_resource_handler.cc b/chrome/browser/renderer_host/safe_browsing_resource_handler.cc index 3222ecc..6a03764 100644 --- a/chrome/browser/renderer_host/safe_browsing_resource_handler.cc +++ b/chrome/browser/renderer_host/safe_browsing_resource_handler.cc @@ -177,7 +177,7 @@ void SafeBrowsingResourceHandler::StartDisplayingBlockingPage( // Grab the original url of this request as well. GURL original_url; - URLRequest* request = rdh_->GetURLRequest( + net::URLRequest* request = rdh_->GetURLRequest( GlobalRequestID(render_process_host_id_, deferred_request_id_)); if (request) original_url = request->original_url(); diff --git a/chrome/browser/renderer_host/sync_resource_handler.cc b/chrome/browser/renderer_host/sync_resource_handler.cc index db5ec9a..6743e861 100644 --- a/chrome/browser/renderer_host/sync_resource_handler.cc +++ b/chrome/browser/renderer_host/sync_resource_handler.cc @@ -39,7 +39,7 @@ bool SyncResourceHandler::OnRequestRedirected(int request_id, const GURL& new_url, ResourceResponse* response, bool* defer) { - URLRequest* request = rdh_->GetURLRequest( + net::URLRequest* request = rdh_->GetURLRequest( GlobalRequestID(process_id_, request_id)); LoadTimingObserver::PopulateTimingInfo(request, response); DevToolsNetLogObserver::PopulateResponseInfo(request, response); @@ -56,7 +56,7 @@ bool SyncResourceHandler::OnRequestRedirected(int request_id, bool SyncResourceHandler::OnResponseStarted(int request_id, ResourceResponse* response) { - URLRequest* request = rdh_->GetURLRequest( + net::URLRequest* request = rdh_->GetURLRequest( GlobalRequestID(process_id_, request_id)); LoadTimingObserver::PopulateTimingInfo(request, response); DevToolsNetLogObserver::PopulateResponseInfo(request, response); @@ -114,5 +114,5 @@ void SyncResourceHandler::OnRequestClosed() { result_message_->set_reply_error(); receiver_->Send(result_message_); - receiver_ = NULL; // URLRequest is gone, and perhaps also the receiver. + receiver_ = NULL; // net::URLRequest is gone, and perhaps also the receiver. } diff --git a/chrome/browser/renderer_host/test/render_view_host_unittest.cc b/chrome/browser/renderer_host/test/render_view_host_unittest.cc index 2ec5b95..da5a579 100644 --- a/chrome/browser/renderer_host/test/render_view_host_unittest.cc +++ b/chrome/browser/renderer_host/test/render_view_host_unittest.cc @@ -46,7 +46,7 @@ TEST_F(RenderViewHostTest, ResetUnloadOnReload) { NavigateAndCommit(url1); controller().LoadURL(url2, GURL(), 0); - // Simulate the ClosePage call which is normally sent by the URLRequest. + // Simulate the ClosePage call which is normally sent by the net::URLRequest. rvh()->ClosePage(true, 0, 0); // Needed so that navigations are not suspended on the RVH. Normally handled // by way of ViewHostMsg_ShouldClose_ACK. diff --git a/chrome/browser/renderer_host/x509_user_cert_resource_handler.cc b/chrome/browser/renderer_host/x509_user_cert_resource_handler.cc index 9e1cccc..cbd5b08 100644 --- a/chrome/browser/renderer_host/x509_user_cert_resource_handler.cc +++ b/chrome/browser/renderer_host/x509_user_cert_resource_handler.cc @@ -22,7 +22,7 @@ #include "net/url_request/url_request_status.h" X509UserCertResourceHandler::X509UserCertResourceHandler( - ResourceDispatcherHost* host, URLRequest* request, + ResourceDispatcherHost* host, net::URLRequest* request, int render_process_host_id, int render_view_id) : host_(host), request_(request), diff --git a/chrome/browser/ssl/ssl_add_cert_handler.cc b/chrome/browser/ssl/ssl_add_cert_handler.cc index 668df59..e2356af 100644 --- a/chrome/browser/ssl/ssl_add_cert_handler.cc +++ b/chrome/browser/ssl/ssl_add_cert_handler.cc @@ -14,7 +14,7 @@ #include "net/base/x509_certificate.h" #include "net/url_request/url_request.h" -SSLAddCertHandler::SSLAddCertHandler(URLRequest* request, +SSLAddCertHandler::SSLAddCertHandler(net::URLRequest* request, net::X509Certificate* cert, int render_process_host_id, int render_view_id) diff --git a/chrome/browser/ssl/ssl_cert_error_handler.cc b/chrome/browser/ssl/ssl_cert_error_handler.cc index b3d7f87..40bf067 100644 --- a/chrome/browser/ssl/ssl_cert_error_handler.cc +++ b/chrome/browser/ssl/ssl_cert_error_handler.cc @@ -11,7 +11,7 @@ SSLCertErrorHandler::SSLCertErrorHandler( ResourceDispatcherHost* rdh, - URLRequest* request, + net::URLRequest* request, ResourceType::Type resource_type, const std::string& frame_origin, const std::string& main_frame_origin, diff --git a/chrome/browser/ssl/ssl_client_auth_handler.cc b/chrome/browser/ssl/ssl_client_auth_handler.cc index 2081f33..159c1ed 100644 --- a/chrome/browser/ssl/ssl_client_auth_handler.cc +++ b/chrome/browser/ssl/ssl_client_auth_handler.cc @@ -11,7 +11,7 @@ #include "net/url_request/url_request.h" SSLClientAuthHandler::SSLClientAuthHandler( - URLRequest* request, + net::URLRequest* request, net::SSLCertRequestInfo* cert_request_info) : request_(request), cert_request_info_(cert_request_info) { @@ -39,7 +39,7 @@ void SSLClientAuthHandler::SelectCertificate() { // If the RVH does not exist by the time this task gets run, then the task // will be dropped and the scoped_refptr to SSLClientAuthHandler will go // away, so we do not leak anything. The destructor takes care of ensuring - // the URLRequest always gets a response. + // the net::URLRequest always gets a response. CallRenderViewHostSSLDelegate( render_process_host_id, render_view_host_id, &RenderViewHostDelegate::SSL::ShowClientCertificateRequestDialog, diff --git a/chrome/browser/ssl/ssl_client_auth_handler.h b/chrome/browser/ssl/ssl_client_auth_handler.h index 4680602..a1de68e 100644 --- a/chrome/browser/ssl/ssl_client_auth_handler.h +++ b/chrome/browser/ssl/ssl_client_auth_handler.h @@ -19,7 +19,7 @@ class X509Certificate; // This class handles the approval and selection of a certificate for SSL client // authentication by the user. // It is self-owned and deletes itself when the UI reports the user selection or -// when the URLRequest is cancelled. +// when the net::URLRequest is cancelled. class SSLClientAuthHandler : public base::RefCountedThreadSafe<SSLClientAuthHandler, BrowserThread::DeleteOnIOThread> { @@ -54,7 +54,7 @@ class SSLClientAuthHandler // Called on the IO thread. void DoCertificateSelected(net::X509Certificate* cert); - // The URLRequest that triggered this client auth. + // The net::URLRequest that triggered this client auth. net::URLRequest* request_; // The certs to choose from. diff --git a/chrome/browser/ssl/ssl_error_handler.cc b/chrome/browser/ssl/ssl_error_handler.cc index d05c17f..7f90bac 100644 --- a/chrome/browser/ssl/ssl_error_handler.cc +++ b/chrome/browser/ssl/ssl_error_handler.cc @@ -14,7 +14,7 @@ #include "net/url_request/url_request.h" SSLErrorHandler::SSLErrorHandler(ResourceDispatcherHost* rdh, - URLRequest* request, + net::URLRequest* request, ResourceType::Type resource_type, const std::string& frame_origin, const std::string& main_frame_origin) @@ -39,7 +39,7 @@ SSLErrorHandler::SSLErrorHandler(ResourceDispatcherHost* rdh, NOTREACHED(); // This makes sure we don't disappear on the IO thread until we've given an - // answer to the URLRequest. + // answer to the net::URLRequest. // // Release in CompleteCancelRequest, CompleteContinueRequest, or // CompleteTakeNoAction. @@ -119,14 +119,15 @@ void SSLErrorHandler::TakeNoAction() { void SSLErrorHandler::CompleteCancelRequest(int error) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - // It is important that we notify the URLRequest only once. If we try to - // notify the request twice, it may no longer exist and |this| might have + // It is important that we notify the net::URLRequest only once. If we try + // to notify the request twice, it may no longer exist and |this| might have // already have been deleted. DCHECK(!request_has_been_notified_); if (request_has_been_notified_) return; - URLRequest* request = resource_dispatcher_host_->GetURLRequest(request_id_); + net::URLRequest* request = + resource_dispatcher_host_->GetURLRequest(request_id_); if (request) { // The request can be NULL if it was cancelled by the renderer (as the // result of the user navigating to a new page from the location bar). @@ -146,14 +147,15 @@ void SSLErrorHandler::CompleteCancelRequest(int error) { void SSLErrorHandler::CompleteContinueRequest() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - // It is important that we notify the URLRequest only once. If we try to + // It is important that we notify the net::URLRequest only once. If we try to // notify the request twice, it may no longer exist and |this| might have // already have been deleted. DCHECK(!request_has_been_notified_); if (request_has_been_notified_) return; - URLRequest* request = resource_dispatcher_host_->GetURLRequest(request_id_); + net::URLRequest* request = + resource_dispatcher_host_->GetURLRequest(request_id_); if (request) { // The request can be NULL if it was cancelled by the renderer (as the // result of the user navigating to a new page from the location bar). @@ -169,7 +171,7 @@ void SSLErrorHandler::CompleteContinueRequest() { void SSLErrorHandler::CompleteTakeNoAction() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - // It is important that we notify the URLRequest only once. If we try to + // It is important that we notify the net::URLRequest only once. If we try to // notify the request twice, it may no longer exist and |this| might have // already have been deleted. DCHECK(!request_has_been_notified_); diff --git a/chrome/browser/ssl/ssl_error_handler.h b/chrome/browser/ssl/ssl_error_handler.h index 104e9b5..7d4a9cf 100644 --- a/chrome/browser/ssl/ssl_error_handler.h +++ b/chrome/browser/ssl/ssl_error_handler.h @@ -28,7 +28,7 @@ class URLRequest; // UI thread. Subclasses should override the OnDispatched/OnDispatchFailed // methods to implement the actions that should be taken on the UI thread. // These methods can call the different convenience methods ContinueRequest/ -// CancelRequest to perform any required action on the URLRequest the +// CancelRequest to perform any required action on the net::URLRequest the // ErrorHandler was created with. // // IMPORTANT NOTE: @@ -41,7 +41,7 @@ class SSLErrorHandler : public base::RefCountedThreadSafe<SSLErrorHandler> { public: virtual SSLCertErrorHandler* AsSSLCertErrorHandler() { return NULL; } - // Find the appropriate SSLManager for the URLRequest and begin handling + // Find the appropriate SSLManager for the net::URLRequest and begin handling // this error. // // Call on UI thread. @@ -63,24 +63,24 @@ class SSLErrorHandler : public base::RefCountedThreadSafe<SSLErrorHandler> { // called from the UI thread. TabContents* GetTabContents(); - // Cancels the associated URLRequest. + // Cancels the associated net::URLRequest. // This method can be called from OnDispatchFailed and OnDispatched. void CancelRequest(); - // Continue the URLRequest ignoring any previous errors. Note that some + // Continue the net::URLRequest ignoring any previous errors. Note that some // errors cannot be ignored, in which case this will result in the request // being canceled. // This method can be called from OnDispatchFailed and OnDispatched. void ContinueRequest(); - // Cancels the associated URLRequest and mark it as denied. The renderer + // Cancels the associated net::URLRequest and mark it as denied. The renderer // processes such request in a special manner, optionally replacing them // with alternate content (typically frames content is replaced with a // warning message). // This method can be called from OnDispatchFailed and OnDispatched. void DenyRequest(); - // Does nothing on the URLRequest but ensures the current instance ref + // Does nothing on the net::URLRequest but ensures the current instance ref // count is decremented appropriately. Subclasses that do not want to // take any specific actions in their OnDispatched/OnDispatchFailed should // call this. @@ -107,7 +107,7 @@ class SSLErrorHandler : public base::RefCountedThreadSafe<SSLErrorHandler> { // Should only be accessed on the UI thread. SSLManager* manager_; // Our manager. - // The id of the URLRequest associated with this object. + // The id of the net::URLRequest associated with this object. // Should only be accessed from the IO thread. GlobalRequestID request_id_; @@ -150,7 +150,7 @@ class SSLErrorHandler : public base::RefCountedThreadSafe<SSLErrorHandler> { // This read-only member can be accessed on any thread. const std::string main_frame_origin_; - // A flag to make sure we notify the URLRequest exactly once. + // A flag to make sure we notify the net::URLRequest exactly once. // Should only be accessed on the IO thread bool request_has_been_notified_; diff --git a/chrome/browser/ssl/ssl_manager.cc b/chrome/browser/ssl/ssl_manager.cc index abb5a1a..f874cc0 100644 --- a/chrome/browser/ssl/ssl_manager.cc +++ b/chrome/browser/ssl/ssl_manager.cc @@ -24,7 +24,7 @@ // static void SSLManager::OnSSLCertificateError(ResourceDispatcherHost* rdh, - URLRequest* request, + net::URLRequest* request, int cert_error, net::X509Certificate* cert) { DVLOG(1) << "OnSSLCertificateError() cert_error: " << cert_error diff --git a/chrome/browser/ssl/ssl_manager.h b/chrome/browser/ssl/ssl_manager.h index d45fe8c..0c61596 100644 --- a/chrome/browser/ssl/ssl_manager.h +++ b/chrome/browser/ssl/ssl_manager.h @@ -42,7 +42,7 @@ class SSLManager : public NotificationObserver { // Entry point for SSLCertificateErrors. This function begins the process // of resolving a certificate error during an SSL connection. SSLManager // will adjust the security UI and either call |Cancel| or - // |ContinueDespiteLastError| on the URLRequest. + // |ContinueDespiteLastError| on the net::URLRequest. // // Called on the IO thread. static void OnSSLCertificateError(ResourceDispatcherHost* resource_dispatcher, diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc index 20d77d3..2711848bf 100644 --- a/chrome/browser/tab_contents/render_view_context_menu.cc +++ b/chrome/browser/tab_contents/render_view_context_menu.cc @@ -847,11 +847,11 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const { case IDC_CONTENT_CONTEXT_SAVELINKAS: return params_.link_url.is_valid() && - URLRequest::IsHandledURL(params_.link_url); + net::URLRequest::IsHandledURL(params_.link_url); case IDC_CONTENT_CONTEXT_SAVEIMAGEAS: return params_.src_url.is_valid() && - URLRequest::IsHandledURL(params_.src_url); + net::URLRequest::IsHandledURL(params_.src_url); case IDC_CONTENT_CONTEXT_OPENIMAGENEWTAB: // The images shown in the most visited thumbnails do not currently open @@ -895,7 +895,7 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const { return (params_.media_flags & WebContextMenuData::MediaCanSave) && params_.src_url.is_valid() && - URLRequest::IsHandledURL(params_.src_url); + net::URLRequest::IsHandledURL(params_.src_url); case IDC_CONTENT_CONTEXT_OPENAVNEWTAB: return true; diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc index cc26ca6..f7b8074 100644 --- a/chrome/browser/ui/browser_init.cc +++ b/chrome/browser/ui/browser_init.cc @@ -782,7 +782,7 @@ Browser* BrowserInit::LaunchWithProfile::OpenTabsInBrowser( // This avoids us getting into an infinite loop asking ourselves to open // a URL, should the handler be (incorrectly) configured to be us. Anyone // asking us to open such a URL should really ask the handler directly. - if (!process_startup && !URLRequest::IsHandledURL(tabs[i].url)) + if (!process_startup && !net::URLRequest::IsHandledURL(tabs[i].url)) continue; int add_types = first_tab ? TabStripModel::ADD_SELECTED : diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 9606559..512cf28 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -703,9 +703,9 @@ const char kHomePage[] = "homepage"; // "MAP * baz, EXCLUDE www.google.com" --> Remaps everything to "baz", // except for "www.google.com". // -// These mappings apply to the endpoint host in a URLRequest (the TCP connect -// and host resolver in a direct connection, and the CONNECT in an http proxy -// connection, and the endpoint host in a SOCKS proxy connection). +// These mappings apply to the endpoint host in a net::URLRequest (the TCP +// connect and host resolver in a direct connection, and the CONNECT in an http +// proxy connection, and the endpoint host in a SOCKS proxy connection). const char kHostRules[] = "host-rules"; // The maximum number of concurrent host resolve requests (i.e. DNS) to allow. diff --git a/chrome/common/net/url_fetcher.cc b/chrome/common/net/url_fetcher.cc index ceec250..30cb076 100644 --- a/chrome/common/net/url_fetcher.cc +++ b/chrome/common/net/url_fetcher.cc @@ -31,7 +31,7 @@ bool URLFetcher::g_interception_enabled = false; class URLFetcher::Core : public base::RefCountedThreadSafe<URLFetcher::Core>, - public URLRequest::Delegate { + public net::URLRequest::Delegate { public: // For POST requests, set |content_type| to the MIME type of the content // and set |content| to the data to upload. |flags| are flags to apply to @@ -57,9 +57,9 @@ class URLFetcher::Core // Reports that the received content was malformed. void ReceivedContentWasMalformed(); - // URLRequest::Delegate implementation. - virtual void OnResponseStarted(URLRequest* request); - virtual void OnReadCompleted(URLRequest* request, int bytes_read); + // Overridden from net::URLRequest::Delegate: + virtual void OnResponseStarted(net::URLRequest* request); + virtual void OnReadCompleted(net::URLRequest* request, int bytes_read); URLFetcher::Delegate* delegate() const { return delegate_; } @@ -113,7 +113,7 @@ class URLFetcher::Core scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_; // The message loop proxy for the thread // on which the request IO happens. - scoped_ptr<URLRequest> request_; // The actual request this wraps + scoped_ptr<net::URLRequest> request_; // The actual request this wraps int load_flags_; // Flags for the load operation int response_code_; // HTTP status code for the request std::string data_; // Results of the request @@ -264,7 +264,7 @@ void URLFetcher::Core::CancelAll() { g_registry.Get().CancelAll(); } -void URLFetcher::Core::OnResponseStarted(URLRequest* request) { +void URLFetcher::Core::OnResponseStarted(net::URLRequest* request) { DCHECK_EQ(request, request_.get()); DCHECK(io_message_loop_proxy_->BelongsToCurrentThread()); if (request_->status().is_success()) { @@ -282,7 +282,8 @@ void URLFetcher::Core::OnResponseStarted(URLRequest* request) { OnReadCompleted(request_.get(), bytes_read); } -void URLFetcher::Core::OnReadCompleted(URLRequest* request, int bytes_read) { +void URLFetcher::Core::OnReadCompleted(net::URLRequest* request, + int bytes_read) { DCHECK(request == request_); DCHECK(io_message_loop_proxy_->BelongsToCurrentThread()); @@ -328,7 +329,7 @@ void URLFetcher::Core::StartURLRequest() { DCHECK(!request_.get()); g_registry.Get().AddURLFetcherCore(this); - request_.reset(new URLRequest(original_url_, this)); + request_.reset(new net::URLRequest(original_url_, this)); int flags = request_->load_flags() | load_flags_; if (!g_interception_enabled) { flags = flags | net::LOAD_DISABLE_INTERCEPT; diff --git a/chrome/common/net/url_fetcher.h b/chrome/common/net/url_fetcher.h index 547e906..924a6bc 100644 --- a/chrome/common/net/url_fetcher.h +++ b/chrome/common/net/url_fetcher.h @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // -// This file contains URLFetcher, a wrapper around URLRequest that handles +// This file contains URLFetcher, a wrapper around net::URLRequest that handles // low-level details like thread safety, ref counting, and incremental buffer // reading. This is useful for callers who simply want to get the data from a // URL and don't care about all the nitty-gritty details. diff --git a/chrome/common/net/url_fetcher_unittest.cc b/chrome/common/net/url_fetcher_unittest.cc index cd213e7..81cf54b 100644 --- a/chrome/common/net/url_fetcher_unittest.cc +++ b/chrome/common/net/url_fetcher_unittest.cc @@ -395,7 +395,7 @@ URLFetcherBadHTTPSTest::URLFetcherBadHTTPSTest() { // The "server certificate expired" error should result in automatic // cancellation of the request by -// URLRequest::Delegate::OnSSLCertificateError. +// net::URLRequest::Delegate::OnSSLCertificateError. void URLFetcherBadHTTPSTest::OnURLFetchComplete( const URLFetcher* source, const GURL& url, diff --git a/chrome/common/net/url_request_intercept_job.cc b/chrome/common/net/url_request_intercept_job.cc index 329eea6..deadd7d 100644 --- a/chrome/common/net/url_request_intercept_job.cc +++ b/chrome/common/net/url_request_intercept_job.cc @@ -25,7 +25,7 @@ using base::TimeDelta; // URLRequestInterceptJob // -URLRequestInterceptJob::URLRequestInterceptJob(URLRequest* request, +URLRequestInterceptJob::URLRequestInterceptJob(net::URLRequest* request, ChromePluginLib* plugin, ScopableCPRequest* cprequest) : URLRequestJob(request), diff --git a/chrome/common/render_messages_params.h b/chrome/common/render_messages_params.h index ef49d43..bc82818 100644 --- a/chrome/common/render_messages_params.h +++ b/chrome/common/render_messages_params.h @@ -445,7 +445,7 @@ struct ViewHostMsg_Resource_Request { // Additional HTTP request headers. std::string headers; - // URLRequest load flags (0 by default). + // net::URLRequest load flags (0 by default). int load_flags; // Unique ID of process that originated this request. For normal renderer |