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 /webkit | |
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 'webkit')
24 files changed, 189 insertions, 181 deletions
diff --git a/webkit/appcache/appcache_host.cc b/webkit/appcache/appcache_host.cc index e954e80..5e8e4db 100644 --- a/webkit/appcache/appcache_host.cc +++ b/webkit/appcache/appcache_host.cc @@ -255,8 +255,8 @@ AppCacheHost* AppCacheHost::GetParentAppCacheHost() const { } AppCacheRequestHandler* AppCacheHost::CreateRequestHandler( - URLRequest* request, - ResourceType::Type resource_type) { + net::URLRequest* request, + ResourceType::Type resource_type) { if (is_for_dedicated_worker()) { AppCacheHost* parent_host = GetParentAppCacheHost(); if (parent_host) diff --git a/webkit/appcache/appcache_interceptor.cc b/webkit/appcache/appcache_interceptor.cc index 6fcd322..3f61e71 100644 --- a/webkit/appcache/appcache_interceptor.cc +++ b/webkit/appcache/appcache_interceptor.cc @@ -14,17 +14,18 @@ namespace appcache { void AppCacheInterceptor::SetHandler( - URLRequest* request, AppCacheRequestHandler* handler) { + net::URLRequest* request, AppCacheRequestHandler* handler) { request->SetUserData(instance(), handler); // request takes ownership } -AppCacheRequestHandler* AppCacheInterceptor::GetHandler(URLRequest* request) { +AppCacheRequestHandler* AppCacheInterceptor::GetHandler( + net::URLRequest* request) { return reinterpret_cast<AppCacheRequestHandler*>( request->GetUserData(instance())); } void AppCacheInterceptor::SetExtraRequestInfo( - URLRequest* request, AppCacheService* service, int process_id, + net::URLRequest* request, AppCacheService* service, int process_id, int host_id, ResourceType::Type resource_type) { if (!service || (host_id == kNoHostId)) return; @@ -46,7 +47,7 @@ void AppCacheInterceptor::SetExtraRequestInfo( SetHandler(request, handler); } -void AppCacheInterceptor::GetExtraResponseInfo(URLRequest* request, +void AppCacheInterceptor::GetExtraResponseInfo(net::URLRequest* request, int64* cache_id, GURL* manifest_url) { DCHECK(*cache_id == kNoCacheId); @@ -57,14 +58,14 @@ void AppCacheInterceptor::GetExtraResponseInfo(URLRequest* request, } AppCacheInterceptor::AppCacheInterceptor() { - URLRequest::RegisterRequestInterceptor(this); + net::URLRequest::RegisterRequestInterceptor(this); } AppCacheInterceptor::~AppCacheInterceptor() { - URLRequest::UnregisterRequestInterceptor(this); + net::URLRequest::UnregisterRequestInterceptor(this); } -URLRequestJob* AppCacheInterceptor::MaybeIntercept(URLRequest* request) { +URLRequestJob* AppCacheInterceptor::MaybeIntercept(net::URLRequest* request) { AppCacheRequestHandler* handler = GetHandler(request); if (!handler) return NULL; @@ -72,8 +73,8 @@ URLRequestJob* AppCacheInterceptor::MaybeIntercept(URLRequest* request) { } URLRequestJob* AppCacheInterceptor::MaybeInterceptRedirect( - URLRequest* request, - const GURL& location) { + net::URLRequest* request, + const GURL& location) { AppCacheRequestHandler* handler = GetHandler(request); if (!handler) return NULL; @@ -81,7 +82,7 @@ URLRequestJob* AppCacheInterceptor::MaybeInterceptRedirect( } URLRequestJob* AppCacheInterceptor::MaybeInterceptResponse( - URLRequest* request) { + net::URLRequest* request) { AppCacheRequestHandler* handler = GetHandler(request); if (!handler) return NULL; diff --git a/webkit/appcache/appcache_interceptor.h b/webkit/appcache/appcache_interceptor.h index 519d89b..5a7acfd 100644 --- a/webkit/appcache/appcache_interceptor.h +++ b/webkit/appcache/appcache_interceptor.h @@ -17,7 +17,7 @@ class AppCacheService; // An interceptor to hijack requests and potentially service them out of // the appcache. -class AppCacheInterceptor : public URLRequest::Interceptor { +class AppCacheInterceptor : public net::URLRequest::Interceptor { public: // Registers a singleton instance with the net library. // Should be called early in the IO thread prior to initiating requests. @@ -26,7 +26,7 @@ class AppCacheInterceptor : public URLRequest::Interceptor { } // Must be called to make a request eligible for retrieval from an appcache. - static void SetExtraRequestInfo(URLRequest* request, + static void SetExtraRequestInfo(net::URLRequest* request, AppCacheService* service, int process_id, int host_id, @@ -34,12 +34,12 @@ class AppCacheInterceptor : public URLRequest::Interceptor { // May be called after response headers are complete to retrieve extra // info about the response. - static void GetExtraResponseInfo(URLRequest* request, + static void GetExtraResponseInfo(net::URLRequest* request, int64* cache_id, GURL* manifest_url); protected: - // URLRequest::Interceptor overrides + // Overridde from net::URLRequest::Interceptor: virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request); virtual net::URLRequestJob* MaybeInterceptResponse(net::URLRequest* request); virtual net::URLRequestJob* MaybeInterceptRedirect(net::URLRequest* request, diff --git a/webkit/appcache/appcache_interfaces.cc b/webkit/appcache/appcache_interfaces.cc index 4ed0f09..be8cef5 100644 --- a/webkit/appcache/appcache_interfaces.cc +++ b/webkit/appcache/appcache_interfaces.cc @@ -52,7 +52,7 @@ bool IsSchemeSupported(const GURL& url) { // TODO(michaeln): It would be really nice if this could optionally work for // file urls too to help web developers experiment and test their apps, // perhaps enabled via a cmd line flag or some other developer tool setting. - // Unfortunately file scheme URLRequest don't produce the same signalling + // Unfortunately file scheme net::URLRequest don't produce the same signalling // (200 response codes, headers) as http URLRequests, so this doesn't work // just yet. // supported |= url.SchemeIsFile(); @@ -64,7 +64,7 @@ bool IsMethodSupported(const std::string& method) { return (method == kHttpGETMethod) || (method == kHttpHEADMethod); } -bool IsSchemeAndMethodSupported(const URLRequest* request) { +bool IsSchemeAndMethodSupported(const net::URLRequest* request) { return IsSchemeSupported(request->url()) && IsMethodSupported(request->method()); } diff --git a/webkit/appcache/appcache_request_handler.cc b/webkit/appcache/appcache_request_handler.cc index 8cbb805..72e6beb 100644 --- a/webkit/appcache/appcache_request_handler.cc +++ b/webkit/appcache/appcache_request_handler.cc @@ -41,7 +41,7 @@ void AppCacheRequestHandler::GetExtraResponseInfo( } AppCacheURLRequestJob* AppCacheRequestHandler::MaybeLoadResource( - URLRequest* request) { + net::URLRequest* request) { if (!host_ || !IsSchemeAndMethodSupported(request) || cache_entry_not_found_) return NULL; @@ -86,7 +86,7 @@ AppCacheURLRequestJob* AppCacheRequestHandler::MaybeLoadResource( } AppCacheURLRequestJob* AppCacheRequestHandler::MaybeLoadFallbackForRedirect( - URLRequest* request, const GURL& location) { + net::URLRequest* request, const GURL& location) { if (!host_ || !IsSchemeAndMethodSupported(request) || cache_entry_not_found_) return NULL; if (is_main_resource()) @@ -115,7 +115,7 @@ AppCacheURLRequestJob* AppCacheRequestHandler::MaybeLoadFallbackForRedirect( } AppCacheURLRequestJob* AppCacheRequestHandler::MaybeLoadFallbackForResponse( - URLRequest* request) { + net::URLRequest* request) { if (!host_ || !IsSchemeAndMethodSupported(request) || cache_entry_not_found_) return NULL; if (!found_fallback_entry_.has_response_id()) @@ -186,7 +186,7 @@ void AppCacheRequestHandler::DeliverNetworkResponse() { // Main-resource handling ---------------------------------------------- -void AppCacheRequestHandler::MaybeLoadMainResource(URLRequest* request) { +void AppCacheRequestHandler::MaybeLoadMainResource(net::URLRequest* request) { DCHECK(!job_); // We may have to wait for our storage query to complete, but @@ -244,7 +244,7 @@ void AppCacheRequestHandler::OnMainResponseFound( // Sub-resource handling ---------------------------------------------- void AppCacheRequestHandler::MaybeLoadSubResource( - URLRequest* request) { + net::URLRequest* request) { DCHECK(!job_); if (host_->is_selection_pending()) { diff --git a/webkit/appcache/appcache_request_handler.h b/webkit/appcache/appcache_request_handler.h index fcf7f8f..e07a77c 100644 --- a/webkit/appcache/appcache_request_handler.h +++ b/webkit/appcache/appcache_request_handler.h @@ -19,8 +19,8 @@ namespace appcache { class AppCacheURLRequestJob; -// An instance is created for each URLRequest. The instance survives all -// http transactions involved in the processing of its URLRequest, and is +// An instance is created for each net::URLRequest. The instance survives all +// http transactions involved in the processing of its net::URLRequest, and is // given the opportunity to hijack the request along the way. Callers // should use AppCacheHost::CreateRequestHandler to manufacture instances // that can retrieve resources for a particular host. diff --git a/webkit/appcache/appcache_request_handler_unittest.cc b/webkit/appcache/appcache_request_handler_unittest.cc index ae0be75..3556d51 100644 --- a/webkit/appcache/appcache_request_handler_unittest.cc +++ b/webkit/appcache/appcache_request_handler_unittest.cc @@ -73,16 +73,16 @@ class AppCacheRequestHandlerTest : public testing::Test { class MockURLRequestJob : public URLRequestJob { public: - MockURLRequestJob(URLRequest* request, int response_code) + MockURLRequestJob(net::URLRequest* request, int response_code) : URLRequestJob(request), response_code_(response_code) {} virtual void Start() {} virtual int GetResponseCode() const { return response_code_; } int response_code_; }; - class MockURLRequest : public URLRequest { + class MockURLRequest : public net::URLRequest { public: - explicit MockURLRequest(const GURL& url) : URLRequest(url, NULL) {} + explicit MockURLRequest(const GURL& url) : net::URLRequest(url, NULL) {} void SimulateResponseCode(int http_response_code) { mock_factory_job_ = new MockURLRequestJob(this, http_response_code); @@ -94,7 +94,7 @@ class AppCacheRequestHandlerTest : public testing::Test { } }; - static URLRequestJob* MockHttpJobFactory(URLRequest* request, + static URLRequestJob* MockHttpJobFactory(net::URLRequest* request, const std::string& scheme) { if (mock_factory_job_) { URLRequestJob* temp = mock_factory_job_; @@ -133,7 +133,7 @@ class AppCacheRequestHandlerTest : public testing::Test { void SetUpTest() { DCHECK(MessageLoop::current() == io_thread_->message_loop()); - orig_http_factory_ = URLRequest::RegisterProtocolFactory( + orig_http_factory_ = net::URLRequest::RegisterProtocolFactory( "http", MockHttpJobFactory); mock_service_.reset(new MockAppCacheService); mock_frontend_.reset(new MockFrontend); @@ -148,7 +148,7 @@ class AppCacheRequestHandlerTest : public testing::Test { void TearDownTest() { DCHECK(MessageLoop::current() == io_thread_->message_loop()); DCHECK(!mock_factory_job_); - URLRequest::RegisterProtocolFactory("http", orig_http_factory_); + net::URLRequest::RegisterProtocolFactory("http", orig_http_factory_); orig_http_factory_ = NULL; job_ = NULL; handler_.reset(); @@ -665,7 +665,7 @@ class AppCacheRequestHandlerTest : public testing::Test { scoped_ptr<MockURLRequest> request_; scoped_ptr<AppCacheRequestHandler> handler_; scoped_refptr<AppCacheURLRequestJob> job_; - URLRequest::ProtocolFactory* orig_http_factory_; + net::URLRequest::ProtocolFactory* orig_http_factory_; static scoped_ptr<base::Thread> io_thread_; static URLRequestJob* mock_factory_job_; diff --git a/webkit/appcache/appcache_update_job.cc b/webkit/appcache/appcache_update_job.cc index d34017a..2578fd3 100644 --- a/webkit/appcache/appcache_update_job.cc +++ b/webkit/appcache/appcache_update_job.cc @@ -23,8 +23,8 @@ static const size_t kMaxConcurrentUrlFetches = 2; static const int kMax503Retries = 3; // Extra info associated with requests for use during response processing. -// This info is deleted when the URLRequest is deleted. -class UpdateJobInfo : public URLRequest::UserData { +// This info is deleted when the net::URLRequest is deleted. +class UpdateJobInfo : public net::URLRequest::UserData { public: enum RequestType { MANIFEST_FETCH, @@ -45,7 +45,7 @@ class UpdateJobInfo : public URLRequest::UserData { void SetUpResponseWriter(AppCacheResponseWriter* writer, AppCacheUpdateJob* update, - URLRequest* request) { + net::URLRequest* request) { DCHECK(!response_writer_.get()); response_writer_.reset(writer); update_job_ = update; @@ -67,7 +67,7 @@ class UpdateJobInfo : public URLRequest::UserData { // Info needed to write responses to storage and process callbacks. scoped_ptr<AppCacheResponseWriter> response_writer_; AppCacheUpdateJob* update_job_; - URLRequest* request_; + net::URLRequest* request_; net::CompletionCallbackImpl<UpdateJobInfo> write_callback_; }; @@ -174,7 +174,7 @@ AppCacheUpdateJob::~AppCacheUpdateJob() { policy_callback_->Cancel(); } -UpdateJobInfo* AppCacheUpdateJob::GetUpdateJobInfo(URLRequest* request) { +UpdateJobInfo* AppCacheUpdateJob::GetUpdateJobInfo(net::URLRequest* request) { return static_cast<UpdateJobInfo*>(request->GetUserData(this)); } @@ -287,7 +287,7 @@ void AppCacheUpdateJob::HandleCacheFailure(const std::string& error_message) { void AppCacheUpdateJob::FetchManifest(bool is_first_fetch) { DCHECK(!manifest_url_request_); - manifest_url_request_ = new URLRequest(manifest_url_, this); + manifest_url_request_ = new net::URLRequest(manifest_url_, this); UpdateJobInfo::RequestType fetch_type = is_first_fetch ? UpdateJobInfo::MANIFEST_FETCH : UpdateJobInfo::MANIFEST_REFETCH; manifest_url_request_->SetUserData(this, new UpdateJobInfo(fetch_type)); @@ -316,7 +316,7 @@ void AppCacheUpdateJob::FetchManifest(bool is_first_fetch) { } void AppCacheUpdateJob::AddConditionalHeaders( - URLRequest* request, const net::HttpResponseInfo* info) { + net::URLRequest* request, const net::HttpResponseInfo* info) { DCHECK(request && info); net::HttpRequestHeaders extra_headers; @@ -341,7 +341,7 @@ void AppCacheUpdateJob::AddConditionalHeaders( request->SetExtraRequestHeaders(extra_headers); } -void AppCacheUpdateJob::OnResponseStarted(URLRequest *request) { +void AppCacheUpdateJob::OnResponseStarted(net::URLRequest *request) { if (request->status().is_success() && (request->GetResponseCode() / 100) == 2) { // Write response info to storage for URL fetches. Wait for async write @@ -365,7 +365,7 @@ void AppCacheUpdateJob::OnResponseStarted(URLRequest *request) { } } -void AppCacheUpdateJob::ReadResponseData(URLRequest* request) { +void AppCacheUpdateJob::ReadResponseData(net::URLRequest* request) { if (internal_state_ == CACHE_FAILURE || internal_state_ == CANCELLED || internal_state_ == COMPLETED) { return; @@ -377,7 +377,8 @@ void AppCacheUpdateJob::ReadResponseData(URLRequest* request) { OnReadCompleted(request, bytes_read); } -void AppCacheUpdateJob::OnReadCompleted(URLRequest* request, int bytes_read) { +void AppCacheUpdateJob::OnReadCompleted(net::URLRequest* request, + int bytes_read) { bool data_consumed = true; if (request->status().is_success() && bytes_read > 0) { UpdateJobInfo* info = GetUpdateJobInfo(request); @@ -400,7 +401,7 @@ void AppCacheUpdateJob::OnReadCompleted(URLRequest* request, int bytes_read) { OnResponseCompleted(request); } -bool AppCacheUpdateJob::ConsumeResponseData(URLRequest* request, +bool AppCacheUpdateJob::ConsumeResponseData(net::URLRequest* request, UpdateJobInfo* info, int bytes_read) { DCHECK_GT(bytes_read, 0); @@ -424,7 +425,7 @@ bool AppCacheUpdateJob::ConsumeResponseData(URLRequest* request, } void AppCacheUpdateJob::OnWriteResponseComplete(int result, - URLRequest* request, + net::URLRequest* request, UpdateJobInfo* info) { if (result < 0) { request->Cancel(); @@ -435,7 +436,7 @@ void AppCacheUpdateJob::OnWriteResponseComplete(int result, ReadResponseData(request); } -void AppCacheUpdateJob::OnReceivedRedirect(URLRequest* request, +void AppCacheUpdateJob::OnReceivedRedirect(net::URLRequest* request, const GURL& new_url, bool* defer_redirect) { // Redirect is not allowed by the update process. @@ -443,7 +444,7 @@ void AppCacheUpdateJob::OnReceivedRedirect(URLRequest* request, OnResponseCompleted(request); } -void AppCacheUpdateJob::OnResponseCompleted(URLRequest* request) { +void AppCacheUpdateJob::OnResponseCompleted(net::URLRequest* request) { // Retry for 503s where retry-after is 0. if (request->status().is_success() && request->GetResponseCode() == 503 && @@ -472,7 +473,7 @@ void AppCacheUpdateJob::OnResponseCompleted(URLRequest* request) { delete request; } -bool AppCacheUpdateJob::RetryRequest(URLRequest* request) { +bool AppCacheUpdateJob::RetryRequest(net::URLRequest* request) { UpdateJobInfo* info = GetUpdateJobInfo(request); if (info->retry_503_attempts_ >= kMax503Retries) { return false; @@ -482,7 +483,7 @@ bool AppCacheUpdateJob::RetryRequest(URLRequest* request) { return false; const GURL& url = request->original_url(); - URLRequest* retry = new URLRequest(url, this); + net::URLRequest* retry = new net::URLRequest(url, this); UpdateJobInfo* retry_info = new UpdateJobInfo(info->type_); retry_info->retry_503_attempts_ = info->retry_503_attempts_ + 1; retry_info->existing_entry_ = info->existing_entry_; @@ -514,7 +515,7 @@ bool AppCacheUpdateJob::RetryRequest(URLRequest* request) { return true; } -void AppCacheUpdateJob::HandleManifestFetchCompleted(URLRequest* request) { +void AppCacheUpdateJob::HandleManifestFetchCompleted(net::URLRequest* request) { DCHECK(internal_state_ == FETCH_MANIFEST); manifest_url_request_ = NULL; @@ -621,7 +622,7 @@ void AppCacheUpdateJob::ContinueHandleManifestFetchCompleted(bool changed) { MaybeCompleteUpdate(); // if not done, continues when async fetches complete } -void AppCacheUpdateJob::HandleUrlFetchCompleted(URLRequest* request) { +void AppCacheUpdateJob::HandleUrlFetchCompleted(net::URLRequest* request) { DCHECK(internal_state_ == DOWNLOADING); UpdateJobInfo* info = GetUpdateJobInfo(request); @@ -684,7 +685,8 @@ void AppCacheUpdateJob::HandleUrlFetchCompleted(URLRequest* request) { MaybeCompleteUpdate(); } -void AppCacheUpdateJob::HandleMasterEntryFetchCompleted(URLRequest* request) { +void AppCacheUpdateJob::HandleMasterEntryFetchCompleted( + net::URLRequest* request) { DCHECK(internal_state_ == NO_UPDATE || internal_state_ == DOWNLOADING); // TODO(jennb): Handle downloads completing during cache failure when update @@ -767,7 +769,8 @@ void AppCacheUpdateJob::HandleMasterEntryFetchCompleted(URLRequest* request) { MaybeCompleteUpdate(); } -void AppCacheUpdateJob::HandleManifestRefetchCompleted(URLRequest* request) { +void AppCacheUpdateJob::HandleManifestRefetchCompleted( + net::URLRequest* request) { DCHECK(internal_state_ == REFETCH_MANIFEST); manifest_url_request_ = NULL; @@ -1021,7 +1024,7 @@ void AppCacheUpdateJob::FetchUrls() { } // Send URL request for the resource. - URLRequest* request = new URLRequest(url_to_fetch.url, this); + net::URLRequest* request = new net::URLRequest(url_to_fetch.url, this); request->SetUserData(this, info); request->set_context(service_->request_context()); request->set_load_flags( @@ -1136,7 +1139,7 @@ void AppCacheUpdateJob::FetchMasterEntries() { } } else { // Send URL request for the master entry. - URLRequest* request = new URLRequest(url, this); + net::URLRequest* request = new net::URLRequest(url, this); request->SetUserData(this, new UpdateJobInfo(UpdateJobInfo::MASTER_ENTRY_FETCH)); request->set_context(service_->request_context()); diff --git a/webkit/appcache/appcache_update_job.h b/webkit/appcache/appcache_update_job.h index b0a683c..dacff44 100644 --- a/webkit/appcache/appcache_update_job.h +++ b/webkit/appcache/appcache_update_job.h @@ -29,7 +29,7 @@ class UpdateJobInfo; class HostNotifier; // Application cache Update algorithm and state. -class AppCacheUpdateJob : public URLRequest::Delegate, +class AppCacheUpdateJob : public net::URLRequest::Delegate, public AppCacheStorage::Delegate, public AppCacheHost::Observer { public: @@ -49,7 +49,7 @@ class AppCacheUpdateJob : public URLRequest::Delegate, // in different tabs. typedef std::vector<AppCacheHost*> PendingHosts; typedef std::map<GURL, PendingHosts> PendingMasters; - typedef std::map<GURL, URLRequest*> PendingUrlFetches; + typedef std::map<GURL, net::URLRequest*> PendingUrlFetches; typedef std::map<int64, GURL> LoadingResponses; static const int kRerunDelayMs = 1000; @@ -91,14 +91,14 @@ class AppCacheUpdateJob : public URLRequest::Delegate, scoped_refptr<AppCacheResponseInfo> existing_response_info; }; - UpdateJobInfo* GetUpdateJobInfo(URLRequest* request); + UpdateJobInfo* GetUpdateJobInfo(net::URLRequest* request); - // Methods for URLRequest::Delegate. - void OnResponseStarted(URLRequest* request); - void OnReadCompleted(URLRequest* request, int bytes_read); - void OnReceivedRedirect(URLRequest* request, - const GURL& new_url, - bool* defer_redirect); + // Overridden from net::URLRequest::Delegate: + virtual void OnResponseStarted(net::URLRequest* request); + virtual void OnReadCompleted(net::URLRequest* request, int bytes_read); + virtual void OnReceivedRedirect(net::URLRequest* request, + const GURL& new_url, + bool* defer_redirect); // TODO(jennb): any other delegate callbacks to handle? certificate? // Methods for AppCacheStorage::Delegate. @@ -121,33 +121,33 @@ class AppCacheUpdateJob : public URLRequest::Delegate, // Add extra conditional HTTP headers to the request based on the // currently cached response headers. - void AddConditionalHeaders(URLRequest* request, + void AddConditionalHeaders(net::URLRequest* request, const net::HttpResponseInfo* info); - void OnResponseCompleted(URLRequest* request); + void OnResponseCompleted(net::URLRequest* request); // Retries a 503 request with retry-after header of 0. // Returns true if request should be retried and deletes original request. - bool RetryRequest(URLRequest* request); + bool RetryRequest(net::URLRequest* request); - void ReadResponseData(URLRequest* request); + void ReadResponseData(net::URLRequest* request); // Returns false if response data is processed asynchronously, in which // case ReadResponseData will be invoked when it is safe to continue // reading more response data from the request. - bool ConsumeResponseData(URLRequest* request, + bool ConsumeResponseData(net::URLRequest* request, UpdateJobInfo* info, int bytes_read); - void OnWriteResponseComplete(int result, URLRequest* request, + void OnWriteResponseComplete(int result, net::URLRequest* request, UpdateJobInfo* info); - void HandleManifestFetchCompleted(URLRequest* request); + void HandleManifestFetchCompleted(net::URLRequest* request); void ContinueHandleManifestFetchCompleted(bool changed); - void HandleUrlFetchCompleted(URLRequest* request); - void HandleMasterEntryFetchCompleted(URLRequest* request); + void HandleUrlFetchCompleted(net::URLRequest* request); + void HandleMasterEntryFetchCompleted(net::URLRequest* request); - void HandleManifestRefetchCompleted(URLRequest* request); + void HandleManifestRefetchCompleted(net::URLRequest* request); void OnManifestInfoWriteComplete(int result); void OnManifestDataWriteComplete(int result); @@ -252,7 +252,7 @@ class AppCacheUpdateJob : public URLRequest::Delegate, LoadingResponses loading_responses_; // Keep track of pending URL requests so we can cancel them if necessary. - URLRequest* manifest_url_request_; + net::URLRequest* manifest_url_request_; PendingUrlFetches pending_url_fetches_; // Temporary storage of manifest response data for parsing and comparison. diff --git a/webkit/appcache/appcache_update_job_unittest.cc b/webkit/appcache/appcache_update_job_unittest.cc index defe9f7..543ece5 100644 --- a/webkit/appcache/appcache_update_job_unittest.cc +++ b/webkit/appcache/appcache_update_job_unittest.cc @@ -41,7 +41,7 @@ class MockHttpServer { return GURL("http://mockhost/" + path); } - static URLRequestJob* JobFactory(URLRequest* request, + static URLRequestJob* JobFactory(net::URLRequest* request, const std::string& scheme) { if (request->url().host() != "mockhost") return new URLRequestErrorJob(request, -1); @@ -287,7 +287,7 @@ class MockFrontend : public AppCacheFrontend { }; // Helper factories to simulate redirected URL responses for tests. -static URLRequestJob* RedirectFactory(URLRequest* request, +static URLRequestJob* RedirectFactory(net::URLRequest* request, const std::string& scheme) { return new URLRequestTestJob(request, URLRequestTestJob::test_redirect_headers(), @@ -322,7 +322,7 @@ class RetryRequestTestJob : public URLRequestTestJob { expected_requests_ = 0; } - static URLRequestJob* RetryFactory(URLRequest* request, + static URLRequestJob* RetryFactory(net::URLRequest* request, const std::string& scheme) { ++num_requests_; if (num_retries_ > 0 && request->original_url() == kRetryUrl) { @@ -377,7 +377,8 @@ class RetryRequestTestJob : public URLRequestTestJob { "http://retry\r"); // must be same as kRetryUrl } - explicit RetryRequestTestJob(URLRequest* request, const std::string& headers, + explicit RetryRequestTestJob(net::URLRequest* request, + const std::string& headers, int response_code) : URLRequestTestJob(request, headers, data(), true), response_code_(response_code) { @@ -423,7 +424,7 @@ class HttpHeadersRequestTestJob : public URLRequestTestJob { already_checked_ = false; } - static URLRequestJob* IfModifiedSinceFactory(URLRequest* request, + static URLRequestJob* IfModifiedSinceFactory(net::URLRequest* request, const std::string& scheme) { if (!already_checked_) { already_checked_ = true; // only check once for a test @@ -477,17 +478,17 @@ class IOThread : public base::Thread { } virtual void Init() { - old_factory_ = URLRequest::RegisterProtocolFactory( + old_factory_ = net::URLRequest::RegisterProtocolFactory( "http", MockHttpServer::JobFactory); request_context_ = new TestURLRequestContext(); } virtual void CleanUp() { - URLRequest::RegisterProtocolFactory("http", old_factory_); + net::URLRequest::RegisterProtocolFactory("http", old_factory_); request_context_ = NULL; } - URLRequest::ProtocolFactory* old_factory_; + net::URLRequest::ProtocolFactory* old_factory_; scoped_refptr<URLRequestContext> request_context_; }; @@ -790,7 +791,7 @@ class AppCacheUpdateJobTest : public testing::Test, ASSERT_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type()); old_factory_ = - URLRequest::RegisterProtocolFactory("http", RedirectFactory); + net::URLRequest::RegisterProtocolFactory("http", RedirectFactory); registered_factory_ = true; MakeService(); @@ -1581,7 +1582,7 @@ class AppCacheUpdateJobTest : public testing::Test, // Set some large number of times to return retry. // Expect 1 manifest fetch and 3 retries. RetryRequestTestJob::Initialize(5, RetryRequestTestJob::RETRY_AFTER_0, 4); - old_factory_ = URLRequest::RegisterProtocolFactory( + old_factory_ = net::URLRequest::RegisterProtocolFactory( "http", RetryRequestTestJob::RetryFactory); registered_factory_ = true; @@ -1612,7 +1613,7 @@ class AppCacheUpdateJobTest : public testing::Test, // Set some large number of times to return retry. // Expect 1 manifest fetch and 0 retries. RetryRequestTestJob::Initialize(5, RetryRequestTestJob::NO_RETRY_AFTER, 1); - old_factory_ = URLRequest::RegisterProtocolFactory( + old_factory_ = net::URLRequest::RegisterProtocolFactory( "http", RetryRequestTestJob::RetryFactory); registered_factory_ = true; @@ -1644,7 +1645,7 @@ class AppCacheUpdateJobTest : public testing::Test, // Expect 1 request and 0 retry attempts. RetryRequestTestJob::Initialize( 5, RetryRequestTestJob::NONZERO_RETRY_AFTER, 1); - old_factory_ = URLRequest::RegisterProtocolFactory( + old_factory_ = net::URLRequest::RegisterProtocolFactory( "http", RetryRequestTestJob::RetryFactory); registered_factory_ = true; @@ -1675,7 +1676,7 @@ class AppCacheUpdateJobTest : public testing::Test, // Set 2 as the retry limit (does not exceed the max). // Expect 1 manifest fetch, 2 retries, 1 url fetch, 1 manifest refetch. RetryRequestTestJob::Initialize(2, RetryRequestTestJob::RETRY_AFTER_0, 5); - old_factory_ = URLRequest::RegisterProtocolFactory( + old_factory_ = net::URLRequest::RegisterProtocolFactory( "http", RetryRequestTestJob::RetryFactory); registered_factory_ = true; @@ -1706,7 +1707,7 @@ class AppCacheUpdateJobTest : public testing::Test, // Set 1 as the retry limit (does not exceed the max). // Expect 1 manifest fetch, 1 url fetch, 1 url retry, 1 manifest refetch. RetryRequestTestJob::Initialize(1, RetryRequestTestJob::RETRY_AFTER_0, 4); - old_factory_ = URLRequest::RegisterProtocolFactory( + old_factory_ = net::URLRequest::RegisterProtocolFactory( "http", RetryRequestTestJob::RetryFactory); registered_factory_ = true; @@ -2547,7 +2548,7 @@ class AppCacheUpdateJobTest : public testing::Test, void IfModifiedSinceTest() { ASSERT_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type()); - old_factory_ = URLRequest::RegisterProtocolFactory( + old_factory_ = net::URLRequest::RegisterProtocolFactory( "http", HttpHeadersRequestTestJob::IfModifiedSinceFactory); registered_factory_ = true; @@ -2613,7 +2614,7 @@ class AppCacheUpdateJobTest : public testing::Test, ASSERT_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type()); HttpHeadersRequestTestJob::Initialize("Sat, 29 Oct 1994 19:43:31 GMT", ""); - old_factory_ = URLRequest::RegisterProtocolFactory( + old_factory_ = net::URLRequest::RegisterProtocolFactory( "http", HttpHeadersRequestTestJob::IfModifiedSinceFactory); registered_factory_ = true; @@ -2671,7 +2672,7 @@ class AppCacheUpdateJobTest : public testing::Test, ASSERT_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type()); HttpHeadersRequestTestJob::Initialize("", "\"LadeDade\""); - old_factory_ = URLRequest::RegisterProtocolFactory( + old_factory_ = net::URLRequest::RegisterProtocolFactory( "http", HttpHeadersRequestTestJob::IfModifiedSinceFactory); registered_factory_ = true; @@ -2729,7 +2730,7 @@ class AppCacheUpdateJobTest : public testing::Test, ASSERT_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type()); HttpHeadersRequestTestJob::Initialize("", "\"LadeDade\""); - old_factory_ = URLRequest::RegisterProtocolFactory( + old_factory_ = net::URLRequest::RegisterProtocolFactory( "http", HttpHeadersRequestTestJob::IfModifiedSinceFactory); registered_factory_ = true; @@ -2764,7 +2765,7 @@ class AppCacheUpdateJobTest : public testing::Test, // Verify that code is correct when building multiple extra headers. HttpHeadersRequestTestJob::Initialize( "Sat, 29 Oct 1994 19:43:31 GMT", "\"LadeDade\""); - old_factory_ = URLRequest::RegisterProtocolFactory( + old_factory_ = net::URLRequest::RegisterProtocolFactory( "http", HttpHeadersRequestTestJob::IfModifiedSinceFactory); registered_factory_ = true; @@ -2831,7 +2832,7 @@ class AppCacheUpdateJobTest : public testing::Test, response_infos_.clear(); service_.reset(NULL); if (registered_factory_) - URLRequest::RegisterProtocolFactory("http", old_factory_); + net::URLRequest::RegisterProtocolFactory("http", old_factory_); event_->Signal(); } @@ -3180,7 +3181,7 @@ class AppCacheUpdateJobTest : public testing::Test, std::map<GURL, int64> expect_response_ids_; bool registered_factory_; - URLRequest::ProtocolFactory* old_factory_; + net::URLRequest::ProtocolFactory* old_factory_; }; // static diff --git a/webkit/appcache/appcache_url_request_job.cc b/webkit/appcache/appcache_url_request_job.cc index 88b19d2..c70cd7a 100644 --- a/webkit/appcache/appcache_url_request_job.cc +++ b/webkit/appcache/appcache_url_request_job.cc @@ -20,7 +20,7 @@ namespace appcache { AppCacheURLRequestJob::AppCacheURLRequestJob( - URLRequest* request, AppCacheStorage* storage) + net::URLRequest* request, AppCacheStorage* storage) : URLRequestJob(request), storage_(storage), has_been_started_(false), has_been_killed_(false), delivery_type_(AWAITING_DELIVERY_ORDERS), diff --git a/webkit/appcache/appcache_url_request_job_unittest.cc b/webkit/appcache/appcache_url_request_job_unittest.cc index 2475c79..b64f079b 100644 --- a/webkit/appcache/appcache_url_request_job_unittest.cc +++ b/webkit/appcache/appcache_url_request_job_unittest.cc @@ -56,7 +56,7 @@ class AppCacheURLRequestJobTest : public testing::Test { AppCacheURLRequestJobTest* test_; }; - class MockURLRequestDelegate : public URLRequest::Delegate { + class MockURLRequestDelegate : public net::URLRequest::Delegate { public: explicit MockURLRequestDelegate(AppCacheURLRequestJobTest* test) : test_(test), @@ -65,7 +65,7 @@ class AppCacheURLRequestJobTest : public testing::Test { kill_after_amount_received_(0), kill_with_io_pending_(false) { } - virtual void OnResponseStarted(URLRequest* request) { + virtual void OnResponseStarted(net::URLRequest* request) { amount_received_ = 0; did_receive_headers_ = false; if (request->status().is_success()) { @@ -78,7 +78,7 @@ class AppCacheURLRequestJobTest : public testing::Test { } } - virtual void OnReadCompleted(URLRequest* request, int bytes_read) { + virtual void OnReadCompleted(net::URLRequest* request, int bytes_read) { if (bytes_read > 0) { amount_received_ += bytes_read; @@ -102,7 +102,7 @@ class AppCacheURLRequestJobTest : public testing::Test { } } - void ReadSome(URLRequest* request) { + void ReadSome(net::URLRequest* request) { DCHECK(amount_received_ + kBlockSize <= kNumBlocks * kBlockSize); scoped_refptr<IOBuffer> wrapped_buffer( new net::WrappedIOBuffer(received_data_->data() + amount_received_)); @@ -124,7 +124,7 @@ class AppCacheURLRequestJobTest : public testing::Test { bool kill_with_io_pending_; }; - static URLRequestJob* MockHttpJobFactory(URLRequest* request, + static URLRequestJob* MockHttpJobFactory(net::URLRequest* request, const std::string& scheme) { if (mock_factory_job_) { URLRequestJob* temp = mock_factory_job_; @@ -186,7 +186,7 @@ class AppCacheURLRequestJobTest : public testing::Test { void SetUpTest() { DCHECK(MessageLoop::current() == io_thread_->message_loop()); DCHECK(task_stack_.empty()); - orig_http_factory_ = URLRequest::RegisterProtocolFactory( + orig_http_factory_ = net::URLRequest::RegisterProtocolFactory( "http", MockHttpJobFactory); url_request_delegate_.reset(new MockURLRequestDelegate(this)); storage_delegate_.reset(new MockStorageDelegate(this)); @@ -204,7 +204,7 @@ class AppCacheURLRequestJobTest : public testing::Test { void TearDownTest() { DCHECK(MessageLoop::current() == io_thread_->message_loop()); - URLRequest::RegisterProtocolFactory("http", orig_http_factory_); + net::URLRequest::RegisterProtocolFactory("http", orig_http_factory_); orig_http_factory_ = NULL; request_.reset(); url_request_delegate_.reset(); @@ -393,7 +393,7 @@ class AppCacheURLRequestJobTest : public testing::Test { // Basic ------------------------------------------------------------------- void Basic() { AppCacheStorage* storage = service_->storage(); - URLRequest request(GURL("http://blah/"), NULL); + net::URLRequest request(GURL("http://blah/"), NULL); scoped_refptr<AppCacheURLRequestJob> job; // Create an instance and see that it looks as expected. @@ -415,7 +415,7 @@ class AppCacheURLRequestJobTest : public testing::Test { // DeliveryOrders ----------------------------------------------------- void DeliveryOrders() { AppCacheStorage* storage = service_->storage(); - URLRequest request(GURL("http://blah/"), NULL); + net::URLRequest request(GURL("http://blah/"), NULL); scoped_refptr<AppCacheURLRequestJob> job; // Create an instance, give it a delivery order and see that @@ -456,7 +456,7 @@ class AppCacheURLRequestJobTest : public testing::Test { AppCacheStorage* storage = service_->storage(); request_.reset( - new URLRequest(GURL("http://blah/"), url_request_delegate_.get())); + new net::URLRequest(GURL("http://blah/"), url_request_delegate_.get())); // Setup to create an AppCacheURLRequestJob with orders to deliver // a network response. @@ -488,7 +488,7 @@ class AppCacheURLRequestJobTest : public testing::Test { AppCacheStorage* storage = service_->storage(); request_.reset( - new URLRequest(GURL("http://blah/"), url_request_delegate_.get())); + new net::URLRequest(GURL("http://blah/"), url_request_delegate_.get())); // Setup to create an AppCacheURLRequestJob with orders to deliver // a network response. @@ -517,7 +517,7 @@ class AppCacheURLRequestJobTest : public testing::Test { void DeliverSmallAppCachedResponse() { // This test has several async steps. // 1. Write a small response to response storage. - // 2. Use URLRequest to retrieve it. + // 2. Use net::URLRequest to retrieve it. // 3. Verify we received what we expected to receive. PushNextTask(NewRunnableMethod( @@ -534,7 +534,7 @@ class AppCacheURLRequestJobTest : public testing::Test { void RequestAppCachedResource(bool start_after_delivery_orders) { AppCacheStorage* storage = service_->storage(); request_.reset( - new URLRequest(GURL("http://blah/"), url_request_delegate_.get())); + new net::URLRequest(GURL("http://blah/"), url_request_delegate_.get())); // Setup to create an AppCacheURLRequestJob with orders to deliver // a network response. @@ -585,7 +585,7 @@ class AppCacheURLRequestJobTest : public testing::Test { void DeliverLargeAppCachedResponse() { // This test has several async steps. // 1. Write a large response to response storage. - // 2. Use URLRequest to retrieve it. + // 2. Use net::URLRequest to retrieve it. // 3. Verify we received what we expected to receive. PushNextTask(NewRunnableMethod( @@ -628,7 +628,7 @@ class AppCacheURLRequestJobTest : public testing::Test { void DeliverPartialResponse() { // This test has several async steps. // 1. Write a small response to response storage. - // 2. Use URLRequest to retrieve it a subset using a range request + // 2. Use net::URLRequest to retrieve it a subset using a range request // 3. Verify we received what we expected to receive. PushNextTask(NewRunnableMethod( this, &AppCacheURLRequestJobTest::VerifyDeliverPartialResponse)); @@ -643,7 +643,7 @@ class AppCacheURLRequestJobTest : public testing::Test { void MakeRangeRequest() { AppCacheStorage* storage = service_->storage(); request_.reset( - new URLRequest(GURL("http://blah/"), url_request_delegate_.get())); + new net::URLRequest(GURL("http://blah/"), url_request_delegate_.get())); // Request a range, the 3 middle chars out of 'Hello' net::HttpRequestHeaders extra_headers; @@ -692,7 +692,7 @@ class AppCacheURLRequestJobTest : public testing::Test { void CancelRequest() { // This test has several async steps. // 1. Write a large response to response storage. - // 2. Use URLRequest to retrieve it. + // 2. Use net::URLRequest to retrieve it. // 3. Cancel the request after data starts coming in. PushNextTask(NewRunnableMethod( @@ -720,7 +720,7 @@ class AppCacheURLRequestJobTest : public testing::Test { void CancelRequestWithIOPending() { // This test has several async steps. // 1. Write a large response to response storage. - // 2. Use URLRequest to retrieve it. + // 2. Use net::URLRequest to retrieve it. // 3. Cancel the request after data starts coming in. PushNextTask(NewRunnableMethod( @@ -766,8 +766,8 @@ class AppCacheURLRequestJobTest : public testing::Test { int writer_deletion_count_down_; bool write_callback_was_called_; - URLRequest::ProtocolFactory* orig_http_factory_; - scoped_ptr<URLRequest> request_; + net::URLRequest::ProtocolFactory* orig_http_factory_; + scoped_ptr<net::URLRequest> request_; scoped_ptr<MockURLRequestDelegate> url_request_delegate_; static scoped_ptr<base::Thread> io_thread_; diff --git a/webkit/appcache/view_appcache_internals_job.cc b/webkit/appcache/view_appcache_internals_job.cc index 0819cd7..7679dc8 100644 --- a/webkit/appcache/view_appcache_internals_job.cc +++ b/webkit/appcache/view_appcache_internals_job.cc @@ -152,7 +152,7 @@ struct ManifestURLComparator { namespace appcache { ViewAppCacheInternalsJob::ViewAppCacheInternalsJob( - URLRequest* request, + net::URLRequest* request, AppCacheService* service) : URLRequestSimpleJob(request), appcache_service_(service) { } diff --git a/webkit/blob/blob_storage_controller.cc b/webkit/blob/blob_storage_controller.cc index de70774..41583af 100644 --- a/webkit/blob/blob_storage_controller.cc +++ b/webkit/blob/blob_storage_controller.cc @@ -129,7 +129,7 @@ void BlobStorageController::ResolveBlobReferencesInUploadData( break; case webkit_blob::BlobData::TYPE_FILE: // TODO(michaeln): Ensure that any temp files survive till the - // URLRequest is done with the upload. + // net::URLRequest is done with the upload. iter->SetToFilePathRange( item.file_path(), item.offset(), diff --git a/webkit/blob/blob_url_request_job.cc b/webkit/blob/blob_url_request_job.cc index 41165e5..6b62605 100644 --- a/webkit/blob/blob_url_request_job.cc +++ b/webkit/blob/blob_url_request_job.cc @@ -40,7 +40,7 @@ static const char* kHTTPRequestedRangeNotSatisfiableText = static const char* kHTTPInternalErrorText = "Internal Server Error"; BlobURLRequestJob::BlobURLRequestJob( - URLRequest* request, + net::URLRequest* request, BlobData* blob_data, base::MessageLoopProxy* file_thread_proxy) : URLRequestJob(request), diff --git a/webkit/blob/blob_url_request_job_unittest.cc b/webkit/blob/blob_url_request_job_unittest.cc index 2fb2337..65b1e91 100644 --- a/webkit/blob/blob_url_request_job_unittest.cc +++ b/webkit/blob/blob_url_request_job_unittest.cc @@ -41,14 +41,14 @@ class BlobURLRequestJobTest : public testing::Test { // Test Harness ------------------------------------------------------------- // TODO(jianli): share this test harness with AppCacheURLRequestJobTest - class MockURLRequestDelegate : public URLRequest::Delegate { + class MockURLRequestDelegate : public net::URLRequest::Delegate { public: explicit MockURLRequestDelegate(BlobURLRequestJobTest* test) : test_(test), received_data_(new net::IOBuffer(kBufferSize)) { } - virtual void OnResponseStarted(URLRequest* request) { + virtual void OnResponseStarted(net::URLRequest* request) { if (request->status().is_success()) { EXPECT_TRUE(request->response_headers()); ReadSome(request); @@ -57,7 +57,7 @@ class BlobURLRequestJobTest : public testing::Test { } } - virtual void OnReadCompleted(URLRequest* request, int bytes_read) { + virtual void OnReadCompleted(net::URLRequest* request, int bytes_read) { if (bytes_read > 0) ReceiveData(request, bytes_read); else @@ -67,7 +67,7 @@ class BlobURLRequestJobTest : public testing::Test { const std::string& response_data() const { return response_data_; } private: - void ReadSome(URLRequest* request) { + void ReadSome(net::URLRequest* request) { if (request->job()->is_done()) { RequestComplete(); return; @@ -84,7 +84,7 @@ class BlobURLRequestJobTest : public testing::Test { ReceiveData(request, bytes_read); } - void ReceiveData(URLRequest* request, int bytes_read) { + void ReceiveData(net::URLRequest* request, int bytes_read) { if (bytes_read) { response_data_.append(received_data_->data(), static_cast<size_t>(bytes_read)); @@ -150,7 +150,7 @@ class BlobURLRequestJobTest : public testing::Test { io_thread_.reset(NULL); } - static URLRequestJob* BlobURLRequestJobFactory(URLRequest* request, + static URLRequestJob* BlobURLRequestJobFactory(net::URLRequest* request, const std::string& scheme) { BlobURLRequestJob* temp = blob_url_request_job_; blob_url_request_job_ = NULL; @@ -172,7 +172,7 @@ class BlobURLRequestJobTest : public testing::Test { void SetUpTest() { DCHECK(MessageLoop::current() == io_thread_->message_loop()); - URLRequest::RegisterProtocolFactory("blob", &BlobURLRequestJobFactory); + net::URLRequest::RegisterProtocolFactory("blob", &BlobURLRequestJobFactory); url_request_delegate_.reset(new MockURLRequestDelegate(this)); } @@ -183,7 +183,7 @@ class BlobURLRequestJobTest : public testing::Test { url_request_delegate_.reset(); DCHECK(!blob_url_request_job_); - URLRequest::RegisterProtocolFactory("blob", NULL); + net::URLRequest::RegisterProtocolFactory("blob", NULL); } void TestFinished() { @@ -245,8 +245,8 @@ class BlobURLRequestJobTest : public testing::Test { const net::HttpRequestHeaders& extra_headers, BlobData* blob_data) { // This test has async steps. - request_.reset(new URLRequest(GURL("blob:blah"), - url_request_delegate_.get())); + request_.reset(new net::URLRequest(GURL("blob:blah"), + url_request_delegate_.get())); request_->set_method(method); blob_url_request_job_ = new BlobURLRequestJob(request_.get(), blob_data, NULL); @@ -391,7 +391,7 @@ class BlobURLRequestJobTest : public testing::Test { scoped_ptr<base::WaitableEvent> test_finished_event_; std::stack<std::pair<Task*, bool> > task_stack_; - scoped_ptr<URLRequest> request_; + scoped_ptr<net::URLRequest> request_; scoped_ptr<MockURLRequestDelegate> url_request_delegate_; int expected_status_code_; std::string expected_response_; diff --git a/webkit/blob/view_blob_internals_job.cc b/webkit/blob/view_blob_internals_job.cc index 00c3eb3..6d6955b 100644 --- a/webkit/blob/view_blob_internals_job.cc +++ b/webkit/blob/view_blob_internals_job.cc @@ -100,7 +100,7 @@ void AddHTMLButton(const std::string& title, namespace webkit_blob { ViewBlobInternalsJob::ViewBlobInternalsJob( - URLRequest* request, BlobStorageController* blob_storage_controller) + net::URLRequest* request, BlobStorageController* blob_storage_controller) : URLRequestSimpleJob(request), blob_storage_controller_(blob_storage_controller) { } diff --git a/webkit/fileapi/file_system_operation.cc b/webkit/fileapi/file_system_operation.cc index 97e2bfe..ba0f3d5 100644 --- a/webkit/fileapi/file_system_operation.cc +++ b/webkit/fileapi/file_system_operation.cc @@ -141,7 +141,8 @@ void FileSystemOperation::Write( #endif DCHECK(blob_url.is_valid()); file_writer_delegate_.reset(new FileWriterDelegate(this, offset)); - blob_request_.reset(new URLRequest(blob_url, file_writer_delegate_.get())); + blob_request_.reset( + new net::URLRequest(blob_url, file_writer_delegate_.get())); blob_request_->set_context(url_request_context); base::FileUtilProxy::CreateOrOpen( proxy_, diff --git a/webkit/fileapi/file_writer_delegate.cc b/webkit/fileapi/file_writer_delegate.cc index 21f69b1..bb6becf 100644 --- a/webkit/fileapi/file_writer_delegate.cc +++ b/webkit/fileapi/file_writer_delegate.cc @@ -29,7 +29,8 @@ FileWriterDelegate::FileWriterDelegate( FileWriterDelegate::~FileWriterDelegate() { } -void FileWriterDelegate::Start(base::PlatformFile file, URLRequest* request) { +void FileWriterDelegate::Start(base::PlatformFile file, + net::URLRequest* request) { file_ = file; request_ = request; file_stream_.reset( @@ -41,30 +42,30 @@ void FileWriterDelegate::Start(base::PlatformFile file, URLRequest* request) { } void FileWriterDelegate::OnReceivedRedirect( - URLRequest* request, const GURL& new_url, bool* defer_redirect) { + net::URLRequest* request, const GURL& new_url, bool* defer_redirect) { NOTREACHED(); OnError(base::PLATFORM_FILE_ERROR_SECURITY); } void FileWriterDelegate::OnAuthRequired( - URLRequest* request, net::AuthChallengeInfo* auth_info) { + net::URLRequest* request, net::AuthChallengeInfo* auth_info) { NOTREACHED(); OnError(base::PLATFORM_FILE_ERROR_SECURITY); } void FileWriterDelegate::OnCertificateRequested( - URLRequest* request, net::SSLCertRequestInfo* cert_request_info) { + net::URLRequest* request, net::SSLCertRequestInfo* cert_request_info) { NOTREACHED(); OnError(base::PLATFORM_FILE_ERROR_SECURITY); } void FileWriterDelegate::OnSSLCertificateError( - URLRequest* request, int cert_error, net::X509Certificate* cert) { + net::URLRequest* request, int cert_error, net::X509Certificate* cert) { NOTREACHED(); OnError(base::PLATFORM_FILE_ERROR_SECURITY); } -void FileWriterDelegate::OnResponseStarted(URLRequest* request) { +void FileWriterDelegate::OnResponseStarted(net::URLRequest* request) { DCHECK_EQ(request_, request); if (!request->status().is_success()) { OnError(base::PLATFORM_FILE_ERROR_FAILED); @@ -78,7 +79,8 @@ void FileWriterDelegate::OnResponseStarted(URLRequest* request) { Read(); } -void FileWriterDelegate::OnReadCompleted(URLRequest* request, int bytes_read) { +void FileWriterDelegate::OnReadCompleted(net::URLRequest* request, + int bytes_read) { DCHECK_EQ(request_, request); if (!request->status().is_success()) { OnError(base::PLATFORM_FILE_ERROR_FAILED); diff --git a/webkit/fileapi/file_writer_delegate.h b/webkit/fileapi/file_writer_delegate.h index ed35ce6..8e90a23 100644 --- a/webkit/fileapi/file_writer_delegate.h +++ b/webkit/fileapi/file_writer_delegate.h @@ -20,28 +20,28 @@ namespace fileapi { class FileSystemOperation; -class FileWriterDelegate : public URLRequest::Delegate { +class FileWriterDelegate : public net::URLRequest::Delegate { public: FileWriterDelegate( FileSystemOperation* write_operation, int64 offset); virtual ~FileWriterDelegate(); - void Start(base::PlatformFile file, URLRequest* request); + void Start(base::PlatformFile file, net::URLRequest* request); base::PlatformFile file() { return file_; } virtual void OnReceivedRedirect( - URLRequest* request, const GURL& new_url, bool* defer_redirect); + net::URLRequest* request, const GURL& new_url, bool* defer_redirect); virtual void OnAuthRequired( - URLRequest* request, net::AuthChallengeInfo* auth_info); + net::URLRequest* request, net::AuthChallengeInfo* auth_info); virtual void OnCertificateRequested( - URLRequest* request, net::SSLCertRequestInfo* cert_request_info); + net::URLRequest* request, net::SSLCertRequestInfo* cert_request_info); virtual void OnSSLCertificateError( - URLRequest* request, int cert_error, net::X509Certificate* cert); - virtual void OnResponseStarted(URLRequest* request); - virtual void OnReadCompleted(URLRequest* request, int bytes_read); + net::URLRequest* request, int cert_error, net::X509Certificate* cert); + virtual void OnResponseStarted(net::URLRequest* request); + virtual void OnReadCompleted(net::URLRequest* request, int bytes_read); private: void Read(); @@ -60,7 +60,7 @@ class FileWriterDelegate : public URLRequest::Delegate { int bytes_read_; scoped_refptr<net::IOBufferWithSize> io_buffer_; scoped_ptr<net::FileStream> file_stream_; - URLRequest* request_; + net::URLRequest* request_; base::ScopedCallbackFactory<FileWriterDelegate> callback_factory_; ScopedRunnableMethodFactory<FileWriterDelegate> method_factory_; }; diff --git a/webkit/glue/resource_loader_bridge.h b/webkit/glue/resource_loader_bridge.h index bd2f8b9..951eb87 100644 --- a/webkit/glue/resource_loader_bridge.h +++ b/webkit/glue/resource_loader_bridge.h @@ -259,9 +259,9 @@ class ResourceLoaderBridge { // within webkit. The Peer and it's bridge should have identical lifetimes // as they represent each end of a communication channel. // - // These callbacks mirror URLRequest::Delegate and the order and conditions - // in which they will be called are identical. See url_request.h for more - // information. + // These callbacks mirror net::URLRequest::Delegate and the order and + // conditions in which they will be called are identical. See url_request.h + // for more information. class Peer { public: virtual ~Peer() {} diff --git a/webkit/tools/test_shell/simple_appcache_system.cc b/webkit/tools/test_shell/simple_appcache_system.cc index 0ffbeeb..10abaaee 100644 --- a/webkit/tools/test_shell/simple_appcache_system.cc +++ b/webkit/tools/test_shell/simple_appcache_system.cc @@ -436,7 +436,7 @@ WebApplicationCacheHost* SimpleAppCacheSystem::CreateCacheHostForWebKit( } void SimpleAppCacheSystem::SetExtraRequestBits( - URLRequest* request, int host_id, ResourceType::Type resource_type) { + net::URLRequest* request, int host_id, ResourceType::Type resource_type) { if (is_initialized()) { DCHECK(is_io_thread()); AppCacheInterceptor::SetExtraRequestInfo( @@ -445,7 +445,7 @@ void SimpleAppCacheSystem::SetExtraRequestBits( } void SimpleAppCacheSystem::GetExtraResponseBits( - URLRequest* request, int64* cache_id, GURL* manifest_url) { + net::URLRequest* request, int64* cache_id, GURL* manifest_url) { if (is_initialized()) { DCHECK(is_io_thread()); AppCacheInterceptor::GetExtraResponseInfo( diff --git a/webkit/tools/test_shell/simple_resource_loader_bridge.cc b/webkit/tools/test_shell/simple_resource_loader_bridge.cc index 351c5d9..73e4bb2 100644 --- a/webkit/tools/test_shell/simple_resource_loader_bridge.cc +++ b/webkit/tools/test_shell/simple_resource_loader_bridge.cc @@ -3,22 +3,22 @@ // found in the LICENSE file. // // This file contains an implementation of the ResourceLoaderBridge class. -// The class is implemented using URLRequest, meaning it is a "simple" version -// that directly issues requests. The more complicated one used in the +// The class is implemented using net::URLRequest, meaning it is a "simple" +// version that directly issues requests. The more complicated one used in the // browser uses IPC. // -// Because URLRequest only provides an asynchronous resource loading API, this -// file makes use of URLRequest from a background IO thread. Requests for -// cookies and synchronously loaded resources result in the main thread of the -// application blocking until the IO thread completes the operation. (See +// Because net::URLRequest only provides an asynchronous resource loading API, +// this file makes use of net::URLRequest from a background IO thread. Requests +// for cookies and synchronously loaded resources result in the main thread of +// the application blocking until the IO thread completes the operation. (See // GetCookies and SyncLoad) // // Main thread IO thread // ----------- --------- // ResourceLoaderBridge <---o---------> RequestProxy (normal case) -// \ -> URLRequest +// \ -> net::URLRequest // o-------> SyncRequestProxy (synchronous case) -// -> URLRequest +// -> net::URLRequest // SetCookie <------------------------> CookieSetter // -> net_util::SetCookie // GetCookies <-----------------------> CookieGetter @@ -26,7 +26,7 @@ // // NOTE: The implementation in this file may be used to have WebKit fetch // resources in-process. For example, it is handy for building a single- -// process WebKit embedding (e.g., test_shell) that can use URLRequest to +// process WebKit embedding (e.g., test_shell) that can use net::URLRequest to // perform URL loads. See renderer/resource_dispatcher.h for details on an // alternate implementation that defers fetching to another process. @@ -97,7 +97,7 @@ struct TestShellRequestContextParams { bool accept_all_cookies; }; -static URLRequestJob* BlobURLRequestJobFactory(URLRequest* request, +static URLRequestJob* BlobURLRequestJobFactory(net::URLRequest* request, const std::string& scheme) { webkit_blob::BlobStorageController* blob_storage_controller = static_cast<TestShellRequestContext*>(request->context())-> @@ -147,7 +147,7 @@ class IOThread : public base::Thread { TestShellWebBlobRegistryImpl::InitializeOnIOThread( g_request_context->blob_storage_controller()); - URLRequest::RegisterProtocolFactory("blob", &BlobURLRequestJobFactory); + net::URLRequest::RegisterProtocolFactory("blob", &BlobURLRequestJobFactory); } virtual void CleanUp() { @@ -193,9 +193,9 @@ struct RequestParams { static const int kUpdateUploadProgressIntervalMsec = 100; // The RequestProxy does most of its work on the IO thread. The Start and -// Cancel methods are proxied over to the IO thread, where an URLRequest object -// is instantiated. -class RequestProxy : public URLRequest::Delegate, +// Cancel methods are proxied over to the IO thread, where an net::URLRequest +// object is instantiated. +class RequestProxy : public net::URLRequest::Delegate, public base::RefCountedThreadSafe<RequestProxy> { public: // Takes ownership of the params. @@ -235,7 +235,7 @@ class RequestProxy : public URLRequest::Delegate, // -------------------------------------------------------------------------- // The following methods are called on the owner's thread in response to - // various URLRequest callbacks. The event hooks, defined below, trigger + // various net::URLRequest callbacks. The event hooks, defined below, trigger // these methods asynchronously. void NotifyReceivedRedirect(const GURL& new_url, @@ -317,7 +317,7 @@ class RequestProxy : public URLRequest::Delegate, params->upload.get()); } - request_.reset(new URLRequest(params->url, this)); + request_.reset(new net::URLRequest(params->url, this)); request_->set_method(params->method); request_->set_first_party_for_cookies(params->first_party_for_cookies); request_->set_referrer(params->referrer.spec()); @@ -391,7 +391,7 @@ class RequestProxy : public URLRequest::Delegate, } // -------------------------------------------------------------------------- - // The following methods are event hooks (corresponding to URLRequest + // The following methods are event hooks (corresponding to net::URLRequest // callbacks) that run on the IO thread. They are designed to be overridden // by the SyncRequestProxy subclass. @@ -437,9 +437,9 @@ class RequestProxy : public URLRequest::Delegate, } // -------------------------------------------------------------------------- - // URLRequest::Delegate implementation: + // net::URLRequest::Delegate implementation: - virtual void OnReceivedRedirect(URLRequest* request, + virtual void OnReceivedRedirect(net::URLRequest* request, const GURL& new_url, bool* defer_redirect) { DCHECK(request->status().is_success()); @@ -448,7 +448,7 @@ class RequestProxy : public URLRequest::Delegate, OnReceivedRedirect(new_url, info, defer_redirect); } - virtual void OnResponseStarted(URLRequest* request) { + virtual void OnResponseStarted(net::URLRequest* request) { if (request->status().is_success()) { ResourceResponseInfo info; PopulateResponseInfo(request, &info); @@ -459,14 +459,14 @@ class RequestProxy : public URLRequest::Delegate, } } - virtual void OnSSLCertificateError(URLRequest* request, + virtual void OnSSLCertificateError(net::URLRequest* request, int cert_error, net::X509Certificate* cert) { // Allow all certificate errors. request->ContinueDespiteLastError(); } - virtual void OnReadCompleted(URLRequest* request, int bytes_read) { + virtual void OnReadCompleted(net::URLRequest* request, int bytes_read) { if (request->status().is_success() && bytes_read > 0) { OnReceivedData(bytes_read); } else { @@ -489,8 +489,8 @@ class RequestProxy : public URLRequest::Delegate, // Called on the IO thread. void MaybeUpdateUploadProgress() { - // If a redirect is received upload is cancelled in URLRequest, we should - // try to stop the |upload_progress_timer_| timer and return. + // If a redirect is received upload is cancelled in net::URLRequest, we + // should try to stop the |upload_progress_timer_| timer and return. if (!request_->has_upload()) { if (upload_progress_timer_.IsRunning()) upload_progress_timer_.Stop(); @@ -522,7 +522,7 @@ class RequestProxy : public URLRequest::Delegate, } } - void PopulateResponseInfo(URLRequest* request, + void PopulateResponseInfo(net::URLRequest* request, ResourceResponseInfo* info) const { info->request_time = request->request_time(); info->response_time = request->response_time(); @@ -538,7 +538,7 @@ class RequestProxy : public URLRequest::Delegate, &info->appcache_manifest_url); } - scoped_ptr<URLRequest> request_; + scoped_ptr<net::URLRequest> request_; // Support for request.download_to_file behavior. bool download_to_file_; diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index ab95653..e5d4461 100644 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -86,7 +86,7 @@ const int kSVGTestWindowHeight = 360; // URLRequestTestShellFileJob is used to serve the inspector class URLRequestTestShellFileJob : public URLRequestFileJob { public: - static URLRequestJob* InspectorFactory(URLRequest* request, + static URLRequestJob* InspectorFactory(net::URLRequest* request, const std::string& scheme) { FilePath path; PathService::Get(base::DIR_EXE, &path); @@ -97,7 +97,7 @@ class URLRequestTestShellFileJob : public URLRequestFileJob { } private: - URLRequestTestShellFileJob(URLRequest* request, const FilePath& path) + URLRequestTestShellFileJob(net::URLRequest* request, const FilePath& path) : URLRequestFileJob(request, path) { } virtual ~URLRequestTestShellFileJob() { } |