diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-13 02:12:44 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-13 02:12:44 +0000 |
commit | f90bf0d9264f7f272b7f4a65f864cb7170417fe8 (patch) | |
tree | 3df23eb7b118bfd40c7601df6245d869b56ced49 /chrome_frame | |
parent | 56d8cf25ee047078688c8af5917fcfbc63ac749b (diff) | |
download | chromium_src-f90bf0d9264f7f272b7f4a65f864cb7170417fe8.zip chromium_src-f90bf0d9264f7f272b7f4a65f864cb7170417fe8.tar.gz chromium_src-f90bf0d9264f7f272b7f4a65f864cb7170417fe8.tar.bz2 |
net: Remove typedef net::URLRequestStatus URLRequestStatus;
BUG=64263
TEST=compiled locally, trybots
Review URL: http://codereview.chromium.org/6166010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71285 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/cfproxy_test.cc | 6 | ||||
-rw-r--r-- | chrome_frame/chrome_frame_automation.cc | 7 | ||||
-rw-r--r-- | chrome_frame/external_tab.cc | 4 | ||||
-rw-r--r-- | chrome_frame/metrics_service.cc | 5 | ||||
-rw-r--r-- | chrome_frame/npapi_url_request.cc | 31 | ||||
-rw-r--r-- | chrome_frame/test/automation_client_mock.cc | 7 | ||||
-rw-r--r-- | chrome_frame/test/url_request_test.cc | 10 | ||||
-rw-r--r-- | chrome_frame/urlmon_url_request.cc | 21 |
8 files changed, 47 insertions, 44 deletions
diff --git a/chrome_frame/cfproxy_test.cc b/chrome_frame/cfproxy_test.cc index 082f44d..b618b3e 100644 --- a/chrome_frame/cfproxy_test.cc +++ b/chrome_frame/cfproxy_test.cc @@ -1,5 +1,4 @@ - -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -52,7 +51,8 @@ struct MockChromeProxyDelegate : public ChromeProxyDelegate { MOCK_METHOD2(Network_Start, void(int request_id, const AutomationURLRequest& request_info)); MOCK_METHOD2(Network_Read, void(int request_id, int bytes_to_read)); - MOCK_METHOD2(Network_End, void(int request_id, const URLRequestStatus& s)); + MOCK_METHOD2(Network_End, void(int request_id, + const net::URLRequestStatus& s)); MOCK_METHOD1(Network_DownloadInHost, void(int request_id)); MOCK_METHOD2(GetCookies, void(const GURL& url, int cookie_id)); MOCK_METHOD2(SetCookie, void(const GURL& url, const std::string& cookie)); diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc index 529122f..aa5d946 100644 --- a/chrome_frame/chrome_frame_automation.cc +++ b/chrome_frame/chrome_frame_automation.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -1453,8 +1453,9 @@ void ChromeFrameAutomationClient::OnReadComplete(int request_id, tab_->handle(), request_id, data)); } -void ChromeFrameAutomationClient::OnResponseEnd(int request_id, - const URLRequestStatus& status) { +void ChromeFrameAutomationClient::OnResponseEnd( + int request_id, + const net::URLRequestStatus& status) { automation_server_->Send(new AutomationMsg_RequestEnd( tab_->handle(), request_id, status)); } diff --git a/chrome_frame/external_tab.cc b/chrome_frame/external_tab.cc index d7a4fe1..a470328 100644 --- a/chrome_frame/external_tab.cc +++ b/chrome_frame/external_tab.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -353,7 +353,7 @@ void ExternalTabProxy::OnNetwork_Read(int request_id, int bytes_to_read) { } void ExternalTabProxy::OnNetwork_End(int request_id, - const URLRequestStatus& s) { + const net::URLRequestStatus& s) { // TODO(stoyan): } diff --git a/chrome_frame/metrics_service.cc b/chrome_frame/metrics_service.cc index e94b069..ebb23cf 100644 --- a/chrome_frame/metrics_service.cc +++ b/chrome_frame/metrics_service.cc @@ -1,8 +1,7 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. - //------------------------------------------------------------------------------ // Description of the life cycle of a instance of MetricsService. // @@ -334,7 +333,7 @@ class ChromeFrameMetricsDataUploader // URLFetcher::Delegate virtual void OnURLFetchComplete(const URLFetcher* source, const GURL& url, - const URLRequestStatus& status, + const net::URLRequestStatus& status, int response_code, const ResponseCookies& cookies, const std::string& data) { diff --git a/chrome_frame/npapi_url_request.cc b/chrome_frame/npapi_url_request.cc index 0596f84..306321d 100644 --- a/chrome_frame/npapi_url_request.cc +++ b/chrome_frame/npapi_url_request.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -30,7 +30,7 @@ class NPAPIUrlRequest : public PluginUrlRequest { virtual unsigned long API_CALL AddRef(); virtual unsigned long API_CALL Release(); - const URLRequestStatus& status() const { + const net::URLRequestStatus& status() const { return status_; } @@ -43,7 +43,7 @@ class NPAPIUrlRequest : public PluginUrlRequest { NPP instance_; NPStream* stream_; size_t pending_read_size_; - URLRequestStatus status_; + net::URLRequestStatus status_; base::PlatformThreadId thread_; static int instance_count_; @@ -55,7 +55,7 @@ int NPAPIUrlRequest::instance_count_ = 0; NPAPIUrlRequest::NPAPIUrlRequest(NPP instance) : ref_count_(0), instance_(instance), stream_(NULL), pending_read_size_(0), - status_(URLRequestStatus::FAILED, net::ERR_FAILED), + status_(net::URLRequestStatus::FAILED, net::ERR_FAILED), thread_(base::PlatformThread::CurrentId()) { DVLOG(1) << "Created request. Count: " << ++instance_count_; } @@ -112,7 +112,7 @@ bool NPAPIUrlRequest::Start() { } delegate_->OnResponseEnd(id(), - URLRequestStatus(URLRequestStatus::FAILED, os_error)); + net::URLRequestStatus(net::URLRequestStatus::FAILED, os_error)); return false; } @@ -123,7 +123,7 @@ void NPAPIUrlRequest::Stop() { DVLOG(1) << "Finished request: Url - " << url() << " result: " << static_cast<int>(status_.status()); - status_.set_status(URLRequestStatus::CANCELED); + status_.set_status(net::URLRequestStatus::CANCELED); if (stream_) { npapi::DestroyStream(instance_, stream_, NPRES_USER_BREAK); stream_ = NULL; @@ -138,7 +138,7 @@ bool NPAPIUrlRequest::Read(int bytes_to_read) { NPError NPAPIUrlRequest::OnStreamCreated(const char* mime_type, NPStream* stream) { stream_ = stream; - status_.set_status(URLRequestStatus::IO_PENDING); + status_.set_status(net::URLRequestStatus::IO_PENDING); // TODO(iyengar) // Add support for passing persistent cookies and information about any URL // redirects to Chrome. @@ -154,19 +154,19 @@ NPError NPAPIUrlRequest::OnStreamDestroyed(NPReason reason) { // instead. To prevent Chrome from receiving a notification of a failed // network connection, when Chrome actually canceled the request, we ignore // the status here. - if (URLRequestStatus::CANCELED != status_.status()) { + if (net::URLRequestStatus::CANCELED != status_.status()) { switch (reason) { case NPRES_DONE: - status_.set_status(URLRequestStatus::SUCCESS); + status_.set_status(net::URLRequestStatus::SUCCESS); status_.set_os_error(0); break; case NPRES_USER_BREAK: - status_.set_status(URLRequestStatus::CANCELED); + status_.set_status(net::URLRequestStatus::CANCELED); status_.set_os_error(net::ERR_ABORTED); break; case NPRES_NETWORK_ERR: default: - status_.set_status(URLRequestStatus::FAILED); + status_.set_status(net::URLRequestStatus::FAILED); status_.set_os_error(net::ERR_CONNECTION_CLOSED); break; } @@ -334,8 +334,9 @@ void NPAPIUrlRequestManager::OnReadComplete(int request_id, delegate_->OnReadComplete(request_id, data); } -void NPAPIUrlRequestManager::OnResponseEnd(int request_id, - const URLRequestStatus& status) { +void NPAPIUrlRequestManager::OnResponseEnd( + int request_id, + const net::URLRequestStatus& status) { // Delete from map. RequestMap::iterator it = request_map_.find(request_id); DCHECK(request_map_.end() != it); @@ -343,7 +344,7 @@ void NPAPIUrlRequestManager::OnResponseEnd(int request_id, request_map_.erase(it); // Inform delegate unless canceled. - if (status.status() != URLRequestStatus::CANCELED) + if (status.status() != net::URLRequestStatus::CANCELED) delegate_->OnResponseEnd(request_id, status); } @@ -363,7 +364,7 @@ NPError NPAPIUrlRequestManager::NewStream(NPMIMEType type, // This stream is being constructed for a request that has already been // canceled. Signal its immediate termination. - if (URLRequestStatus::CANCELED == request->status().status()) { + if (net::URLRequestStatus::CANCELED == request->status().status()) { return npapi::DestroyStream(request->instance(), stream, NPRES_USER_BREAK); } diff --git a/chrome_frame/test/automation_client_mock.cc b/chrome_frame/test/automation_client_mock.cc index 7265e10..c3f93d5 100644 --- a/chrome_frame/test/automation_client_mock.cc +++ b/chrome_frame/test/automation_client_mock.cc @@ -1,6 +1,7 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. + #include "chrome_frame/test/automation_client_mock.h" #include "base/callback.h" @@ -205,8 +206,8 @@ TEST(CFACWithChrome, NavigateFailed) { const FilePath profile_path( chrome_frame_test::GetProfilePath(L"Adam.N.Epilinter")); const std::string url = "http://127.0.0.3:65412/"; - const URLRequestStatus connection_failed(URLRequestStatus::FAILED, - net::ERR_INVALID_URL); + const net::URLRequestStatus connection_failed(net::URLRequestStatus::FAILED, + net::ERR_INVALID_URL); scoped_refptr<ChromeFrameAutomationClient> client; client = new ChromeFrameAutomationClient; diff --git a/chrome_frame/test/url_request_test.cc b/chrome_frame/test/url_request_test.cc index 874bf64..e6db001 100644 --- a/chrome_frame/test/url_request_test.cc +++ b/chrome_frame/test/url_request_test.cc @@ -41,7 +41,7 @@ class MockUrlDelegate : public PluginUrlRequestDelegate { const std::string& redirect_url, int redirect_status)); MOCK_METHOD2(OnReadComplete, void(int request_id, const std::string& data)); MOCK_METHOD2(OnResponseEnd, void(int request_id, - const URLRequestStatus& status)); + const net::URLRequestStatus& status)); MOCK_METHOD4(OnCookiesRetrieved, void(bool success, const GURL& url, const std::string& cookie, int cookie_id)); @@ -185,7 +185,8 @@ TEST(UrlmonUrlRequestTest, UnreachableUrl) { .WillOnce(QUIT_LOOP_SOON(loop, 2)); EXPECT_CALL(mock, OnResponseEnd(1, testing::Property( - &URLRequestStatus::os_error, net::ERR_TUNNEL_CONNECTION_FAILED))) + &net::URLRequestStatus::os_error, + net::ERR_TUNNEL_CONNECTION_FAILED))) .Times(testing::AtMost(1)); request.Start(); @@ -231,8 +232,7 @@ TEST(UrlmonUrlRequestTest, ZeroLengthResponse) { // Invoke read. Only now the response end ("server closed the connection") // is supposed to be delivered. EXPECT_CALL(mock, OnResponseEnd(1, testing::Property( - &URLRequestStatus::is_success, true))) - .Times(1); + &net::URLRequestStatus::is_success, true))).Times(1); request.Read(512); request.Release(); } @@ -245,7 +245,7 @@ ACTION_P4(ManagerRead, loop, mgr, request_id, bytes_to_read) { ACTION_P3(ManagerEndRequest, loop, mgr, request_id) { loop->PostDelayedTask(FROM_HERE, NewRunnableMethod(mgr, &UrlmonUrlRequestManager::EndUrlRequest, request_id, - URLRequestStatus()), 0); + net::URLRequestStatus()), 0); } // Simplest test - retrieve file from local web server. diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc index 7f3c8e9..ba9d8f7 100644 --- a/chrome_frame/urlmon_url_request.cc +++ b/chrome_frame/urlmon_url_request.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -58,7 +58,7 @@ bool UrlmonUrlRequest::Start() { HRESULT hr = StartAsyncDownload(); if (FAILED(hr) && status_.get_state() != UrlmonUrlRequest::Status::DONE) { status_.Done(); - status_.set_result(URLRequestStatus::FAILED, HresultToNetError(hr)); + status_.set_result(net::URLRequestStatus::FAILED, HresultToNetError(hr)); NotifyDelegateAndDie(); } return true; @@ -373,8 +373,8 @@ STDMETHODIMP UrlmonUrlRequest::OnStopBinding(HRESULT result, LPCWSTR error) { if (result == E_ACCESSDENIED) { int http_code = GetHttpResponseStatusFromBinding(binding_); if (300 <= http_code && http_code < 400) { - status_.set_result(URLRequestStatus::FAILED, - net::ERR_UNSAFE_REDIRECT); + status_.set_result(net::URLRequestStatus::FAILED, + net::ERR_UNSAFE_REDIRECT); } } @@ -838,7 +838,7 @@ void UrlmonUrlRequest::NotifyDelegateAndDie() { ReleaseBindings(); TerminateTransaction(); if (delegate) { - URLRequestStatus result = status_.get_result(); + net::URLRequestStatus result = status_.get_result(); delegate->OnResponseEnd(id(), result); } else { DLOG(WARNING) << __FUNCTION__ << me() << "no delegate"; @@ -987,8 +987,8 @@ void UrlmonUrlRequestManager::StartRequest(int request_id, << ".Pending url request for url:" << pending_request_->url() << " was expected."; - URLRequestStatus result; - result.set_status(URLRequestStatus::FAILED); + net::URLRequestStatus result; + result.set_status(net::URLRequestStatus::FAILED); OnResponseEnd(request_id, result); return; } @@ -1175,11 +1175,12 @@ void UrlmonUrlRequestManager::OnReadComplete(int request_id, DVLOG(1) << __FUNCTION__ << " done id: " << request_id; } -void UrlmonUrlRequestManager::OnResponseEnd(int request_id, - const URLRequestStatus& status) { +void UrlmonUrlRequestManager::OnResponseEnd( + int request_id, + const net::URLRequestStatus& status) { DCHECK_NE(request_id, -1); DVLOG(1) << __FUNCTION__; - DCHECK(status.status() != URLRequestStatus::CANCELED); + DCHECK(status.status() != net::URLRequestStatus::CANCELED); RequestMap::size_type n = request_map_.erase(request_id); if (n != 1u) { DLOG(WARNING) << __FUNCTION__ |