diff options
109 files changed, 590 insertions, 543 deletions
diff --git a/chrome/browser/alternate_nav_url_fetcher.cc b/chrome/browser/alternate_nav_url_fetcher.cc index 199afbc..b2496ee 100644 --- a/chrome/browser/alternate_nav_url_fetcher.cc +++ b/chrome/browser/alternate_nav_url_fetcher.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. @@ -86,12 +86,13 @@ void AlternateNavURLFetcher::Observe(NotificationType type, } } -void AlternateNavURLFetcher::OnURLFetchComplete(const URLFetcher* source, - const GURL& url, - const URLRequestStatus& status, - int response_code, - const ResponseCookies& cookies, - const std::string& data) { +void AlternateNavURLFetcher::OnURLFetchComplete( + const URLFetcher* source, + const GURL& url, + const net::URLRequestStatus& status, + int response_code, + const ResponseCookies& cookies, + const std::string& data) { DCHECK(fetcher_.get() == source); SetStatusFromURLFetch(url, status, response_code); ShowInfobarIfPossible(); @@ -133,7 +134,7 @@ void AlternateNavURLFetcher::InfoBarClosed() { void AlternateNavURLFetcher::SetStatusFromURLFetch( const GURL& url, - const URLRequestStatus& status, + const net::URLRequestStatus& status, int response_code) { if (!status.is_success() || // HTTP 2xx, 401, and 407 all indicate that the target address exists. diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc index f7c7cb3..2b308a3 100644 --- a/chrome/browser/autocomplete/search_provider.cc +++ b/chrome/browser/autocomplete/search_provider.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. @@ -228,7 +228,7 @@ void SearchProvider::Stop() { void SearchProvider::OnURLFetchComplete(const URLFetcher* source, const GURL& url, - const URLRequestStatus& status, + const net::URLRequestStatus& status, int response_code, const ResponseCookies& cookie, const std::string& data) { diff --git a/chrome/browser/autocomplete/search_provider_unittest.cc b/chrome/browser/autocomplete/search_provider_unittest.cc index 80ae91a..bf74e5f 100644 --- a/chrome/browser/autocomplete/search_provider_unittest.cc +++ b/chrome/browser/autocomplete/search_provider_unittest.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. @@ -208,7 +208,7 @@ void SearchProviderTest::FinishDefaultSuggestQuery() { // Tell the SearchProvider the default suggest query is done. default_fetcher->delegate()->OnURLFetchComplete( - default_fetcher, GURL(), URLRequestStatus(), 200, ResponseCookies(), + default_fetcher, GURL(), net::URLRequestStatus(), 200, ResponseCookies(), std::string()); } @@ -233,7 +233,7 @@ TEST_F(SearchProviderTest, QueryDefaultProvider) { // Tell the SearchProvider the suggest query is done. fetcher->delegate()->OnURLFetchComplete( - fetcher, GURL(), URLRequestStatus(), 200, ResponseCookies(), + fetcher, GURL(), net::URLRequestStatus(), 200, ResponseCookies(), std::string()); fetcher = NULL; @@ -281,7 +281,7 @@ TEST_F(SearchProviderTest, QueryKeywordProvider) { // Tell the SearchProvider the default suggest query is done. default_fetcher->delegate()->OnURLFetchComplete( - default_fetcher, GURL(), URLRequestStatus(), 200, ResponseCookies(), + default_fetcher, GURL(), net::URLRequestStatus(), 200, ResponseCookies(), std::string()); default_fetcher = NULL; @@ -298,7 +298,7 @@ TEST_F(SearchProviderTest, QueryKeywordProvider) { // Tell the SearchProvider the keyword suggest query is done. keyword_fetcher->delegate()->OnURLFetchComplete( - keyword_fetcher, GURL(), URLRequestStatus(), 200, ResponseCookies(), + keyword_fetcher, GURL(), net::URLRequestStatus(), 200, ResponseCookies(), std::string()); keyword_fetcher = NULL; diff --git a/chrome/browser/autofill/autofill_browsertest.cc b/chrome/browser/autofill/autofill_browsertest.cc index c36bd10..baf2843 100644 --- a/chrome/browser/autofill/autofill_browsertest.cc +++ b/chrome/browser/autofill/autofill_browsertest.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. @@ -108,9 +108,9 @@ class AutoFillTest : public InProcessBrowserTest { void SimulateURLFetch(bool success) { TestURLFetcher* fetcher = url_fetcher_factory_.GetFetcherByID(0); ASSERT_TRUE(fetcher); - URLRequestStatus status; - status.set_status(success ? URLRequestStatus::SUCCESS : - URLRequestStatus::FAILED); + net::URLRequestStatus status; + status.set_status(success ? net::URLRequestStatus::SUCCESS : + net::URLRequestStatus::FAILED); std::string script = " var google = {};" "google.translate = (function() {" diff --git a/chrome/browser/autofill/autofill_download_unittest.cc b/chrome/browser/autofill/autofill_download_unittest.cc index a2f9d78..aed18e3 100644 --- a/chrome/browser/autofill/autofill_download_unittest.cc +++ b/chrome/browser/autofill/autofill_download_unittest.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. @@ -219,7 +219,8 @@ TEST(AutoFillDownloadTest, QueryAndUploadTest) { // Return them out of sequence. TestURLFetcher* fetcher = factory.GetFetcherByID(1); ASSERT_TRUE(fetcher); - fetcher->delegate()->OnURLFetchComplete(fetcher, GURL(), URLRequestStatus(), + fetcher->delegate()->OnURLFetchComplete(fetcher, GURL(), + net::URLRequestStatus(), 200, ResponseCookies(), std::string(responses[1])); // After that upload rates would be adjusted to 0.5/0.3 @@ -228,12 +229,14 @@ TEST(AutoFillDownloadTest, QueryAndUploadTest) { fetcher = factory.GetFetcherByID(2); ASSERT_TRUE(fetcher); - fetcher->delegate()->OnURLFetchComplete(fetcher, GURL(), URLRequestStatus(), + fetcher->delegate()->OnURLFetchComplete(fetcher, GURL(), + net::URLRequestStatus(), 404, ResponseCookies(), std::string(responses[2])); fetcher = factory.GetFetcherByID(0); ASSERT_TRUE(fetcher); - fetcher->delegate()->OnURLFetchComplete(fetcher, GURL(), URLRequestStatus(), + fetcher->delegate()->OnURLFetchComplete(fetcher, GURL(), + net::URLRequestStatus(), 200, ResponseCookies(), std::string(responses[0])); EXPECT_EQ(static_cast<size_t>(3), helper.responses_.size()); @@ -281,7 +284,8 @@ TEST(AutoFillDownloadTest, QueryAndUploadTest) { ASSERT_TRUE(fetcher); fetcher->set_backoff_delay( base::TimeDelta::FromMilliseconds(TestTimeouts::action_max_timeout_ms())); - fetcher->delegate()->OnURLFetchComplete(fetcher, GURL(), URLRequestStatus(), + fetcher->delegate()->OnURLFetchComplete(fetcher, GURL(), + net::URLRequestStatus(), 500, ResponseCookies(), std::string(responses[0])); EXPECT_EQ(AutoFillDownloadTestHelper::REQUEST_QUERY_FAILED, @@ -307,7 +311,8 @@ TEST(AutoFillDownloadTest, QueryAndUploadTest) { ASSERT_TRUE(fetcher); fetcher->set_backoff_delay( base::TimeDelta::FromMilliseconds(TestTimeouts::action_max_timeout_ms())); - fetcher->delegate()->OnURLFetchComplete(fetcher, GURL(), URLRequestStatus(), + fetcher->delegate()->OnURLFetchComplete(fetcher, GURL(), + net::URLRequestStatus(), 503, ResponseCookies(), std::string(responses[2])); EXPECT_EQ(AutoFillDownloadTestHelper::REQUEST_UPLOAD_FAILED, diff --git a/chrome/browser/automation/url_request_automation_job.cc b/chrome/browser/automation/url_request_automation_job.cc index 7e2bc57..97f48c0 100644 --- a/chrome/browser/automation/url_request_automation_job.cc +++ b/chrome/browser/automation/url_request_automation_job.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. @@ -149,7 +149,8 @@ void URLRequestAutomationJob::Kill() { if (message_filter_.get()) { if (!is_pending()) { message_filter_->Send(new AutomationMsg_RequestEnd(tab_, id_, - URLRequestStatus(URLRequestStatus::CANCELED, net::ERR_ABORTED))); + net::URLRequestStatus(net::URLRequestStatus::CANCELED, + net::ERR_ABORTED))); } } DisconnectFromMessageFilter(); @@ -169,7 +170,7 @@ bool URLRequestAutomationJob::ReadRawData( if (message_filter_) { message_filter_->Send(new AutomationMsg_RequestRead(tab_, id_, buf_size)); - SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); + SetStatus(net::URLRequestStatus(net::URLRequestStatus::IO_PENDING, 0)); } else { MessageLoop::current()->PostTask( FROM_HERE, @@ -292,7 +293,7 @@ void URLRequestAutomationJob::OnDataAvailable( // The request completed, and we have all the data. // Clear any IO pending status. - SetStatus(URLRequestStatus()); + SetStatus(net::URLRequestStatus()); if (pending_buf_ && pending_buf_->data()) { DCHECK_GE(pending_buf_size_, bytes.size()); @@ -309,7 +310,7 @@ void URLRequestAutomationJob::OnDataAvailable( } void URLRequestAutomationJob::OnRequestEnd( - int id, const URLRequestStatus& status) { + int id, const net::URLRequestStatus& status) { #ifndef NDEBUG std::string url; if (request_) @@ -322,7 +323,7 @@ void URLRequestAutomationJob::OnRequestEnd( // OnSSLCertificateError(). Right now we don't have the certificate // so we don't. We could possibly call OnSSLCertificateError with a NULL // certificate, but I'm not sure if all implementations expect it. - // if (status.status() == URLRequestStatus::FAILED && + // if (status.status() == net::URLRequestStatus::FAILED && // net::IsCertificateError(status.os_error()) && request_->delegate()) { // request_->delegate()->OnSSLCertificateError(request_, status.os_error()); // } @@ -381,8 +382,8 @@ void URLRequestAutomationJob::StartAsync() { DCHECK(!is_pending()); if (!request_) { - NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, - net::ERR_FAILED)); + NotifyStartError(net::URLRequestStatus(net::URLRequestStatus::FAILED, + net::ERR_FAILED)); return; } diff --git a/chrome/browser/automation/url_request_automation_job.h b/chrome/browser/automation/url_request_automation_job.h index f1e1aa1..61e5dc2 100644 --- a/chrome/browser/automation/url_request_automation_job.h +++ b/chrome/browser/automation/url_request_automation_job.h @@ -120,7 +120,7 @@ class URLRequestAutomationJob : public net::URLRequestJob { // Contains the request status code, which is eventually passed to the http // stack when we receive a Read request for a completed job. - URLRequestStatus request_status_; + net::URLRequestStatus request_status_; ScopedRunnableMethodFactory<URLRequestAutomationJob> method_factory_; diff --git a/chrome/browser/bug_report_util.cc b/chrome/browser/bug_report_util.cc index 28cc685..aae584e 100644 --- a/chrome/browser/bug_report_util.cc +++ b/chrome/browser/bug_report_util.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. @@ -90,7 +90,7 @@ class BugReportUtil::PostCleanup : public URLFetcher::Delegate { // Overridden from 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); @@ -112,7 +112,7 @@ class BugReportUtil::PostCleanup : public URLFetcher::Delegate { void BugReportUtil::PostCleanup::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/browser/chromeos/login/cookie_fetcher.cc b/chrome/browser/chromeos/login/cookie_fetcher.cc index 10dde76..22fb2da 100644 --- a/chrome/browser/chromeos/login/cookie_fetcher.cc +++ b/chrome/browser/chromeos/login/cookie_fetcher.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. @@ -34,7 +34,7 @@ void CookieFetcher::AttemptFetch(const std::string& credentials) { void CookieFetcher::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/browser/chromeos/login/cookie_fetcher_unittest.cc b/chrome/browser/chromeos/login/cookie_fetcher_unittest.cc index e188b8f..f6ef428 100644 --- a/chrome/browser/chromeos/login/cookie_fetcher_unittest.cc +++ b/chrome/browser/chromeos/login/cookie_fetcher_unittest.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. @@ -46,7 +46,7 @@ class CookieFetcherTest : public ::testing::Test { // Check that successful HTTP responses from both end points results in // the browser window getting put up. TEST_F(CookieFetcherTest, SuccessfulFetchTest) { - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); MockAuthResponseHandler* cl_handler = new MockAuthResponseHandler(iat_url_, status, kHttpSuccess, token_); @@ -72,7 +72,7 @@ TEST_F(CookieFetcherTest, SuccessfulFetchTest) { // Check that a network failure when trying IssueAuthToken results in us bailing // and putting up the browser window. TEST_F(CookieFetcherTest, IssueAuthTokenNetworkFailureTest) { - URLRequestStatus failed(URLRequestStatus::FAILED, ECONNRESET); + net::URLRequestStatus failed(net::URLRequestStatus::FAILED, ECONNRESET); MockAuthResponseHandler* cl_handler = new MockAuthResponseHandler(iat_url_, failed, kHttpSuccess, token_); @@ -94,8 +94,8 @@ TEST_F(CookieFetcherTest, IssueAuthTokenNetworkFailureTest) { // Check that a network failure when trying TokenAuth results in us bailing // and putting up the browser window. TEST_F(CookieFetcherTest, TokenAuthNetworkFailureTest) { - URLRequestStatus success; - URLRequestStatus failed(URLRequestStatus::FAILED, ECONNRESET); + net::URLRequestStatus success; + net::URLRequestStatus failed(net::URLRequestStatus::FAILED, ECONNRESET); MockAuthResponseHandler* cl_handler = new MockAuthResponseHandler(iat_url_, success, kHttpSuccess, token_); @@ -121,7 +121,7 @@ TEST_F(CookieFetcherTest, TokenAuthNetworkFailureTest) { // Check that an unsuccessful HTTP response when trying IssueAuthToken results // in us bailing and putting up the browser window. TEST_F(CookieFetcherTest, IssueAuthTokenDeniedTest) { - URLRequestStatus success; + net::URLRequestStatus success; MockAuthResponseHandler* cl_handler = new MockAuthResponseHandler(iat_url_, success, 403, std::string()); @@ -143,7 +143,7 @@ TEST_F(CookieFetcherTest, IssueAuthTokenDeniedTest) { // Check that an unsuccessful HTTP response when trying TokenAuth results // in us bailing and putting up the browser window. TEST_F(CookieFetcherTest, TokenAuthDeniedTest) { - URLRequestStatus success; + net::URLRequestStatus success; MockAuthResponseHandler* cl_handler = new MockAuthResponseHandler(iat_url_, diff --git a/chrome/browser/chromeos/login/google_authenticator_unittest.cc b/chrome/browser/chromeos/login/google_authenticator_unittest.cc index 04437fb..3a1b766 100644 --- a/chrome/browser/chromeos/login/google_authenticator_unittest.cc +++ b/chrome/browser/chromeos/login/google_authenticator_unittest.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. @@ -492,7 +492,7 @@ TEST_F(GoogleAuthenticatorTest, OnlineLogin) { TEST_F(GoogleAuthenticatorTest, CheckLocalaccount) { GURL source(AuthResponseHandler::kTokenAuthUrl); - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); MockConsumer consumer; EXPECT_CALL(consumer, OnLoginSuccess(username_, std::string(), _, false)) diff --git a/chrome/browser/chromeos/login/mock_auth_response_handler.cc b/chrome/browser/chromeos/login/mock_auth_response_handler.cc index 755064d..be82e83 100644 --- a/chrome/browser/chromeos/login/mock_auth_response_handler.cc +++ b/chrome/browser/chromeos/login/mock_auth_response_handler.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. @@ -17,10 +17,11 @@ namespace chromeos { using ::testing::_; using ::testing::Invoke; -MockAuthResponseHandler::MockAuthResponseHandler(const GURL& url, - const URLRequestStatus& status, - const int code, - const std::string& data) +MockAuthResponseHandler::MockAuthResponseHandler( + const GURL& url, + const net::URLRequestStatus& status, + const int code, + const std::string& data) : remote_(url), status_(status), http_response_code_(code), @@ -34,7 +35,7 @@ MockAuthResponseHandler::MockAuthResponseHandler(const GURL& url, void MockAuthResponseHandler::CompleteFetch(URLFetcher::Delegate* delegate, const GURL remote, - const URLRequestStatus status, + const net::URLRequestStatus status, const int http_response_code, const std::string data) { delegate->OnURLFetchComplete(NULL, diff --git a/chrome/browser/chromeos/login/mock_url_fetchers.cc b/chrome/browser/chromeos/login/mock_url_fetchers.cc index dec800b..1dc01de 100644 --- a/chrome/browser/chromeos/login/mock_url_fetchers.cc +++ b/chrome/browser/chromeos/login/mock_url_fetchers.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. @@ -56,8 +56,8 @@ GotCanceledFetcher::GotCanceledFetcher(bool success, GotCanceledFetcher::~GotCanceledFetcher() {} void GotCanceledFetcher::Start() { - URLRequestStatus status; - status.set_status(URLRequestStatus::CANCELED); + net::URLRequestStatus status; + status.set_status(net::URLRequestStatus::CANCELED); delegate()->OnURLFetchComplete(this, url_, status, @@ -78,7 +78,7 @@ SuccessFetcher::SuccessFetcher(bool success, SuccessFetcher::~SuccessFetcher() {} void SuccessFetcher::Start() { - URLRequestStatus success(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus success(net::URLRequestStatus::SUCCESS, 0); delegate()->OnURLFetchComplete(this, url_, success, @@ -99,7 +99,7 @@ FailFetcher::FailFetcher(bool success, FailFetcher::~FailFetcher() {} void FailFetcher::Start() { - URLRequestStatus failed(URLRequestStatus::FAILED, ECONNRESET); + net::URLRequestStatus failed(net::URLRequestStatus::FAILED, ECONNRESET); delegate()->OnURLFetchComplete(this, url_, failed, @@ -145,7 +145,7 @@ std::string CaptchaFetcher::GetUnlockUrl() { } void CaptchaFetcher::Start() { - URLRequestStatus success(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus success(net::URLRequestStatus::SUCCESS, 0); std::string body = base::StringPrintf("Error=%s\n" "Url=%s\n" "CaptchaUrl=%s\n" @@ -174,7 +174,7 @@ HostedFetcher::HostedFetcher(bool success, HostedFetcher::~HostedFetcher() {} void HostedFetcher::Start() { - URLRequestStatus success(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus success(net::URLRequestStatus::SUCCESS, 0); int response_code = RC_REQUEST_OK; std::string data; VLOG(1) << upload_data(); diff --git a/chrome/browser/dom_ui/chrome_url_data_manager.cc b/chrome/browser/dom_ui/chrome_url_data_manager.cc index 5b69fe5..8acd19f 100644 --- a/chrome/browser/dom_ui/chrome_url_data_manager.cc +++ b/chrome/browser/dom_ui/chrome_url_data_manager.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. @@ -375,7 +375,7 @@ void URLRequestChromeJob::DataAvailable(RefCountedMemory* bytes) { if (bytes) { // The request completed, and we have all the data. // Clear any IO pending status. - SetStatus(URLRequestStatus()); + SetStatus(net::URLRequestStatus()); data_ = bytes; int bytes_read; @@ -387,14 +387,15 @@ void URLRequestChromeJob::DataAvailable(RefCountedMemory* bytes) { } } else { // The request failed. - NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, net::ERR_FAILED)); + NotifyDone(net::URLRequestStatus(net::URLRequestStatus::FAILED, + net::ERR_FAILED)); } } bool URLRequestChromeJob::ReadRawData(net::IOBuffer* buf, int buf_size, int* bytes_read) { if (!data_.get()) { - SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); + SetStatus(net::URLRequestStatus(net::URLRequestStatus::IO_PENDING, 0)); DCHECK(!pending_buf_.get()); CHECK(buf->data()); pending_buf_ = buf; @@ -427,8 +428,8 @@ void URLRequestChromeJob::StartAsync() { this)) { NotifyHeadersComplete(); } else { - NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, - net::ERR_INVALID_URL)); + NotifyStartError(net::URLRequestStatus(net::URLRequestStatus::FAILED, + net::ERR_INVALID_URL)); } } diff --git a/chrome/browser/dom_ui/filebrowse_ui.cc b/chrome/browser/dom_ui/filebrowse_ui.cc index 833341c..ef5a867 100644 --- a/chrome/browser/dom_ui/filebrowse_ui.cc +++ b/chrome/browser/dom_ui/filebrowse_ui.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. @@ -139,7 +139,7 @@ class FilebrowseHandler : public net::DirectoryLister::DirectoryListerDelegate, 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); @@ -542,7 +542,7 @@ void FilebrowseHandler::MountChanged(chromeos::MountLibrary* obj, void FilebrowseHandler::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/browser/extensions/extension_updater.cc b/chrome/browser/extensions/extension_updater.cc index 04fb637..b7d4f1f 100644 --- a/chrome/browser/extensions/extension_updater.cc +++ b/chrome/browser/extensions/extension_updater.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. @@ -463,8 +463,11 @@ void ExtensionUpdater::Stop() { } void ExtensionUpdater::OnURLFetchComplete( - const URLFetcher* source, const GURL& url, const URLRequestStatus& status, - int response_code, const ResponseCookies& cookies, + const URLFetcher* source, + const GURL& url, + const net::URLRequestStatus& status, + int response_code, + const ResponseCookies& cookies, const std::string& data) { // Stop() destroys all our URLFetchers, which means we shouldn't be // called after Stop() is called. @@ -553,13 +556,15 @@ class SafeManifestParser : public UtilityProcessHost::Client { }; -void ExtensionUpdater::OnManifestFetchComplete(const GURL& url, - const URLRequestStatus& status, - int response_code, - const std::string& data) { +void ExtensionUpdater::OnManifestFetchComplete( + const GURL& url, + const net::URLRequestStatus& status, + int response_code, + const std::string& data) { // We want to try parsing the manifest, and if it indicates updates are // available, we want to fire off requests to fetch those updates. - if (status.status() == URLRequestStatus::SUCCESS && response_code == 200) { + if ((status.status() == net::URLRequestStatus::SUCCESS) && + (response_code == 200)) { scoped_refptr<SafeManifestParser> safe_parser( new SafeManifestParser(data, current_manifest_fetch_.release(), this)); safe_parser->Start(); @@ -643,10 +648,10 @@ void ExtensionUpdater::ProcessBlacklist(const std::string& data) { } void ExtensionUpdater::OnCRXFetchComplete(const GURL& url, - const URLRequestStatus& status, + const net::URLRequestStatus& status, int response_code, const std::string& data) { - if (status.status() == URLRequestStatus::SUCCESS && + if (status.status() == net::URLRequestStatus::SUCCESS && response_code == 200) { if (current_extension_fetch_.id == kBlacklistAppID) { ProcessBlacklist(data); diff --git a/chrome/browser/extensions/extension_updater_unittest.cc b/chrome/browser/extensions/extension_updater_unittest.cc index d806b6e..03610fb 100644 --- a/chrome/browser/extensions/extension_updater_unittest.cc +++ b/chrome/browser/extensions/extension_updater_unittest.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. @@ -591,7 +591,7 @@ class ExtensionUpdaterTest : public testing::Test { EXPECT_TRUE(fetcher != NULL && fetcher->delegate() != NULL); EXPECT_TRUE(fetcher->load_flags() == expected_load_flags); fetcher->delegate()->OnURLFetchComplete( - fetcher, url1, URLRequestStatus(), 200, ResponseCookies(), + fetcher, url1, net::URLRequestStatus(), 200, ResponseCookies(), invalid_xml); // Now that the first request is complete, make sure the second one has @@ -609,7 +609,7 @@ class ExtensionUpdaterTest : public testing::Test { EXPECT_TRUE(fetcher != NULL && fetcher->delegate() != NULL); EXPECT_TRUE(fetcher->load_flags() == expected_load_flags); fetcher->delegate()->OnURLFetchComplete( - fetcher, url2, URLRequestStatus(), 200, ResponseCookies(), + fetcher, url2, net::URLRequestStatus(), 200, ResponseCookies(), kValidXml); // This should run the manifest parsing, then we want to make sure that our @@ -666,7 +666,7 @@ class ExtensionUpdaterTest : public testing::Test { EXPECT_TRUE(fetcher != NULL && fetcher->delegate() != NULL); EXPECT_TRUE(fetcher->load_flags() == expected_load_flags); fetcher->delegate()->OnURLFetchComplete( - fetcher, test_url, URLRequestStatus(), 200, ResponseCookies(), + fetcher, test_url, net::URLRequestStatus(), 200, ResponseCookies(), extension_data); file_thread.Stop(); @@ -716,7 +716,7 @@ class ExtensionUpdaterTest : public testing::Test { EXPECT_TRUE(fetcher != NULL && fetcher->delegate() != NULL); EXPECT_TRUE(fetcher->load_flags() == expected_load_flags); fetcher->delegate()->OnURLFetchComplete( - fetcher, test_url, URLRequestStatus(), 200, ResponseCookies(), + fetcher, test_url, net::URLRequestStatus(), 200, ResponseCookies(), extension_data); message_loop.RunAllPending(); @@ -768,7 +768,7 @@ class ExtensionUpdaterTest : public testing::Test { EXPECT_TRUE(fetcher != NULL && fetcher->delegate() != NULL); EXPECT_TRUE(fetcher->load_flags() == expected_load_flags); fetcher->delegate()->OnURLFetchComplete( - fetcher, url1, URLRequestStatus(), 200, ResponseCookies(), + fetcher, url1, net::URLRequestStatus(), 200, ResponseCookies(), extension_data1); message_loop.RunAllPending(); @@ -787,7 +787,7 @@ class ExtensionUpdaterTest : public testing::Test { EXPECT_TRUE(fetcher != NULL && fetcher->delegate() != NULL); EXPECT_TRUE(fetcher->load_flags() == expected_load_flags); fetcher->delegate()->OnURLFetchComplete( - fetcher, url2, URLRequestStatus(), 200, ResponseCookies(), + fetcher, url2, net::URLRequestStatus(), 200, ResponseCookies(), extension_data2); message_loop.RunAllPending(); EXPECT_EQ(id2, service.extension_id()); @@ -845,7 +845,8 @@ class ExtensionUpdaterTest : public testing::Test { EXPECT_TRUE(fetcher != NULL && fetcher->delegate() != NULL); fetched_urls.push_back(fetcher->original_url()); fetcher->delegate()->OnURLFetchComplete( - fetcher, fetched_urls[0], URLRequestStatus(), 500, ResponseCookies(), ""); + fetcher, fetched_urls[0], net::URLRequestStatus(), 500, + ResponseCookies(), ""); fetcher = factory.GetFetcherByID(ExtensionUpdater::kManifestFetcherId); fetched_urls.push_back(fetcher->original_url()); diff --git a/chrome/browser/extensions/user_script_listener_unittest.cc b/chrome/browser/extensions/user_script_listener_unittest.cc index 8c8a415..9847694 100644 --- a/chrome/browser/extensions/user_script_listener_unittest.cc +++ b/chrome/browser/extensions/user_script_listener_unittest.cc @@ -73,7 +73,7 @@ class DummyResourceHandler : public ResourceHandler { } virtual bool OnResponseCompleted(int request_id, - const URLRequestStatus& status, + const net::URLRequestStatus& status, const std::string& security_info) { NOTREACHED(); return true; diff --git a/chrome/browser/geolocation/network_location_provider_unittest.cc b/chrome/browser/geolocation/network_location_provider_unittest.cc index 9bef39c..c56c3d9 100644 --- a/chrome/browser/geolocation/network_location_provider_unittest.cc +++ b/chrome/browser/geolocation/network_location_provider_unittest.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. @@ -433,7 +433,7 @@ TEST_F(GeolocationNetworkProviderTest, MultipleWifiScansComplete) { " \"access_token\": \"" REFERENCE_ACCESS_TOKEN "\"" "}"; fetcher->delegate()->OnURLFetchComplete( - fetcher, test_server_url_, URLRequestStatus(), 200, // OK + fetcher, test_server_url_, net::URLRequestStatus(), 200, // OK ResponseCookies(), kNoFixNetworkResponse); // This should have set the access token anyhow @@ -467,7 +467,7 @@ TEST_F(GeolocationNetworkProviderTest, MultipleWifiScansComplete) { " }" "}"; fetcher->delegate()->OnURLFetchComplete( - fetcher, test_server_url_, URLRequestStatus(), 200, // OK + fetcher, test_server_url_, net::URLRequestStatus(), 200, // OK ResponseCookies(), kReferenceNetworkResponse); provider->GetPosition(&position); @@ -505,7 +505,7 @@ TEST_F(GeolocationNetworkProviderTest, MultipleWifiScansComplete) { // ...reply with a network error. fetcher->delegate()->OnURLFetchComplete( fetcher, test_server_url_, - URLRequestStatus(URLRequestStatus::FAILED, -1), + net::URLRequestStatus(net::URLRequestStatus::FAILED, -1), 200, // should be ignored ResponseCookies(), ""); @@ -541,7 +541,7 @@ TEST_F(GeolocationNetworkProviderTest, GatewayAndWifiScans) { " \"access_token\": \"" REFERENCE_ACCESS_TOKEN "\"" "}"; fetcher->delegate()->OnURLFetchComplete( - fetcher, test_server_url_, URLRequestStatus(), 200, // OK + fetcher, test_server_url_, net::URLRequestStatus(), 200, // OK ResponseCookies(), kNoFixNetworkResponse); // This should have set the access token anyhow @@ -576,7 +576,7 @@ TEST_F(GeolocationNetworkProviderTest, GatewayAndWifiScans) { " }" "}"; fetcher->delegate()->OnURLFetchComplete( - fetcher, test_server_url_, URLRequestStatus(), 200, // OK + fetcher, test_server_url_, net::URLRequestStatus(), 200, // OK ResponseCookies(), kReferenceNetworkResponse_1); provider->GetPosition(&position); @@ -616,7 +616,7 @@ TEST_F(GeolocationNetworkProviderTest, GatewayAndWifiScans) { " }" "}"; fetcher->delegate()->OnURLFetchComplete( - fetcher, test_server_url_, URLRequestStatus(), 200, // OK + fetcher, test_server_url_, net::URLRequestStatus(), 200, // OK ResponseCookies(), kReferenceNetworkResponse_2); provider->GetPosition(&position); @@ -649,7 +649,7 @@ TEST_F(GeolocationNetworkProviderTest, GatewayAndWifiScans) { " }" "}"; fetcher->delegate()->OnURLFetchComplete( - fetcher, test_server_url_, URLRequestStatus(), 200, // OK + fetcher, test_server_url_, net::URLRequestStatus(), 200, // OK ResponseCookies(), kReferenceNetworkResponse_3); provider->GetPosition(&position); diff --git a/chrome/browser/geolocation/network_location_request.cc b/chrome/browser/geolocation/network_location_request.cc index cc56caf..5edade1 100644 --- a/chrome/browser/geolocation/network_location_request.cc +++ b/chrome/browser/geolocation/network_location_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. @@ -116,12 +116,13 @@ bool NetworkLocationRequest::MakeRequest(const std::string& host_name, return true; } -void NetworkLocationRequest::OnURLFetchComplete(const URLFetcher* source, - const GURL& url, - const URLRequestStatus& status, - int response_code, - const ResponseCookies& cookies, - const std::string& data) { +void NetworkLocationRequest::OnURLFetchComplete( + const URLFetcher* source, + const GURL& url, + const net::URLRequestStatus& status, + int response_code, + const ResponseCookies& cookies, + const std::string& data) { DCHECK_EQ(url_fetcher_.get(), source); DCHECK(url_.possibly_invalid_spec() == url.possibly_invalid_spec()); diff --git a/chrome/browser/google/google_url_tracker.cc b/chrome/browser/google/google_url_tracker.cc index 0070cfb..0b35f8a 100644 --- a/chrome/browser/google/google_url_tracker.cc +++ b/chrome/browser/google/google_url_tracker.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. @@ -213,7 +213,7 @@ void GoogleURLTracker::StartFetchIfDesirable() { void GoogleURLTracker::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/browser/google/google_url_tracker_unittest.cc b/chrome/browser/google/google_url_tracker_unittest.cc index 0892ee3..14e9b95 100644 --- a/chrome/browser/google/google_url_tracker_unittest.cc +++ b/chrome/browser/google/google_url_tracker_unittest.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. @@ -206,8 +206,8 @@ void GoogleURLTrackerTest::MockSearchDomainCheckResponse( if (!fetcher) return; fetcher->delegate()->OnURLFetchComplete(fetcher, - GURL(GoogleURLTracker::kSearchDomainCheckURL), URLRequestStatus(), 200, - ResponseCookies(), domain); + GURL(GoogleURLTracker::kSearchDomainCheckURL), net::URLRequestStatus(), + 200, ResponseCookies(), domain); // At this point, |fetcher| is deleted. MessageLoop::current()->RunAllPending(); } diff --git a/chrome/browser/intranet_redirect_detector.cc b/chrome/browser/intranet_redirect_detector.cc index 78c4089..8be4d5e 100644 --- a/chrome/browser/intranet_redirect_detector.cc +++ b/chrome/browser/intranet_redirect_detector.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. @@ -107,7 +107,7 @@ void IntranetRedirectDetector::StartFetchesIfPossible() { void IntranetRedirectDetector::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/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc index a5394c0..d3afe2b 100644 --- a/chrome/browser/metrics/metrics_service.cc +++ b/chrome/browser/metrics/metrics_service.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. @@ -1332,21 +1332,21 @@ void MetricsService::PrepareFetchWithPendingLog() { current_fetch_->set_upload_data(kMetricsType, compressed_log_); } -static const char* StatusToString(const URLRequestStatus& status) { +static const char* StatusToString(const net::URLRequestStatus& status) { switch (status.status()) { - case URLRequestStatus::SUCCESS: + case net::URLRequestStatus::SUCCESS: return "SUCCESS"; - case URLRequestStatus::IO_PENDING: + case net::URLRequestStatus::IO_PENDING: return "IO_PENDING"; - case URLRequestStatus::HANDLED_EXTERNALLY: + case net::URLRequestStatus::HANDLED_EXTERNALLY: return "HANDLED_EXTERNALLY"; - case URLRequestStatus::CANCELED: + case net::URLRequestStatus::CANCELED: return "CANCELED"; - case URLRequestStatus::FAILED: + case net::URLRequestStatus::FAILED: return "FAILED"; default: @@ -1357,7 +1357,7 @@ static const char* StatusToString(const URLRequestStatus& status) { void MetricsService::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/browser/net/chrome_dns_cert_provenance_checker.cc b/chrome/browser/net/chrome_dns_cert_provenance_checker.cc index fe0ca9d..c7ecb6e 100644 --- a/chrome/browser/net/chrome_dns_cert_provenance_checker.cc +++ b/chrome/browser/net/chrome_dns_cert_provenance_checker.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. @@ -79,7 +79,7 @@ class ChromeDnsCertProvenanceChecker : // Delegate implementation void OnResponseStarted(net::URLRequest* request) { - const URLRequestStatus& status(request->status()); + const net::URLRequestStatus& status(request->status()); if (!status.is_success()) { LOG(WARNING) << "Certificate upload failed" << " status:" << status.status() diff --git a/chrome/browser/net/sdch_dictionary_fetcher.cc b/chrome/browser/net/sdch_dictionary_fetcher.cc index 696d3112..5efae09 100644 --- a/chrome/browser/net/sdch_dictionary_fetcher.cc +++ b/chrome/browser/net/sdch_dictionary_fetcher.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 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. @@ -64,13 +64,15 @@ void SdchDictionaryFetcher::StartFetching() { current_fetch_->Start(); } -void SdchDictionaryFetcher::OnURLFetchComplete(const URLFetcher* source, - const GURL& url, - const URLRequestStatus& status, - int response_code, - const ResponseCookies& cookies, - const std::string& data) { - if ((200 == response_code) && (status.status() == URLRequestStatus::SUCCESS)) +void SdchDictionaryFetcher::OnURLFetchComplete( + const URLFetcher* source, + const GURL& url, + const net::URLRequestStatus& status, + int response_code, + const ResponseCookies& cookies, + const std::string& data) { + if ((200 == response_code) && + (status.status() == net::URLRequestStatus::SUCCESS)) SdchManager::Global()->AddSdchDictionary(data, url); current_fetch_.reset(NULL); ScheduleDelayedRun(); diff --git a/chrome/browser/net/url_request_failed_dns_job.cc b/chrome/browser/net/url_request_failed_dns_job.cc index 3481ee7..d6224c3 100644 --- a/chrome/browser/net/url_request_failed_dns_job.cc +++ b/chrome/browser/net/url_request_failed_dns_job.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. @@ -41,6 +41,6 @@ net::URLRequestJob* URLRequestFailedDnsJob::Factory(net::URLRequest* request, } void URLRequestFailedDnsJob::StartAsync() { - NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, + NotifyStartError(net::URLRequestStatus(net::URLRequestStatus::FAILED, net::ERR_NAME_NOT_RESOLVED)); } 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 b88b160..0cf0df3 100644 --- a/chrome/browser/net/url_request_mock_net_error_job.cc +++ b/chrome/browser/net/url_request_mock_net_error_job.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. @@ -109,7 +109,8 @@ void URLRequestMockNetErrorJob::StartAsync() { request_->delegate()->OnSSLCertificateError(request_, error, ssl_cert_.get()); } else { - NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, error)); + NotifyStartError(net::URLRequestStatus(net::URLRequestStatus::FAILED, + error)); } } } diff --git a/chrome/browser/net/url_request_slow_download_job.cc b/chrome/browser/net/url_request_slow_download_job.cc index d4b2007..79c2676 100644 --- a/chrome/browser/net/url_request_slow_download_job.cc +++ b/chrome/browser/net/url_request_slow_download_job.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 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. @@ -115,7 +115,7 @@ bool URLRequestSlowDownloadJob::ReadRawData(net::IOBuffer* buf, int buf_size, // If we make it here, the first chunk has been sent and we need to wait // until a request is made for kFinishDownloadUrl. - SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); + SetStatus(net::URLRequestStatus(net::URLRequestStatus::IO_PENDING, 0)); MessageLoop::current()->PostDelayedTask(FROM_HERE, NewRunnableMethod( this, &URLRequestSlowDownloadJob::CheckDoneStatus), 100); AddRef(); @@ -127,7 +127,7 @@ bool URLRequestSlowDownloadJob::ReadRawData(net::IOBuffer* buf, int buf_size, void URLRequestSlowDownloadJob::CheckDoneStatus() { if (should_finish_download_) { should_send_second_chunk_ = true; - SetStatus(URLRequestStatus()); + SetStatus(net::URLRequestStatus()); NotifyReadComplete(kSecondDownloadSize); Release(); } else { diff --git a/chrome/browser/policy/device_management_backend_impl.cc b/chrome/browser/policy/device_management_backend_impl.cc index d479c80..11e54d9 100644 --- a/chrome/browser/policy/device_management_backend_impl.cc +++ b/chrome/browser/policy/device_management_backend_impl.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. @@ -90,7 +90,7 @@ class DeviceManagementJobBase } // DeviceManagementJob overrides: - virtual void HandleResponse(const URLRequestStatus& status, + virtual void HandleResponse(const net::URLRequestStatus& status, int response_code, const ResponseCookies& cookies, const std::string& data); @@ -156,14 +156,15 @@ class DeviceManagementJobBase DISALLOW_COPY_AND_ASSIGN(DeviceManagementJobBase); }; -void DeviceManagementJobBase::HandleResponse(const URLRequestStatus& status, - int response_code, - const ResponseCookies& cookies, - const std::string& data) { +void DeviceManagementJobBase::HandleResponse( + const net::URLRequestStatus& status, + int response_code, + const ResponseCookies& cookies, + const std::string& data) { // Delete ourselves when this is done. scoped_ptr<DeviceManagementJob> scoped_killer(this); - if (status.status() != URLRequestStatus::SUCCESS) { + if (status.status() != net::URLRequestStatus::SUCCESS) { OnError(DeviceManagementBackend::kErrorRequestFailed); return; } diff --git a/chrome/browser/policy/device_management_service.cc b/chrome/browser/policy/device_management_service.cc index 689c947..f069d03 100644 --- a/chrome/browser/policy/device_management_service.cc +++ b/chrome/browser/policy/device_management_service.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. @@ -174,7 +174,7 @@ void DeviceManagementService::StartJob(DeviceManagementJob* job) { void DeviceManagementService::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/browser/policy/device_management_service_unittest.cc b/chrome/browser/policy/device_management_service_unittest.cc index 1a11424..4162a3f 100644 --- a/chrome/browser/policy/device_management_service_unittest.cc +++ b/chrome/browser/policy/device_management_service_unittest.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. @@ -82,7 +82,7 @@ class DeviceManagementServiceTestBase : public TESTBASE { struct FailedRequestParams { FailedRequestParams(DeviceManagementBackend::ErrorCode expected_error, - URLRequestStatus::Status request_status, + net::URLRequestStatus::Status request_status, int http_status, const std::string& response) : expected_error_(expected_error), @@ -91,7 +91,7 @@ struct FailedRequestParams { response_(response) {} DeviceManagementBackend::ErrorCode expected_error_; - URLRequestStatus request_status_; + net::URLRequestStatus request_status_; int http_status_; std::string response_; }; @@ -161,37 +161,37 @@ INSTANTIATE_TEST_CASE_P( testing::Values( FailedRequestParams( DeviceManagementBackend::kErrorRequestFailed, - URLRequestStatus::FAILED, + net::URLRequestStatus::FAILED, 200, PROTO_STRING(kResponseEmpty)), FailedRequestParams( DeviceManagementBackend::kErrorHttpStatus, - URLRequestStatus::SUCCESS, + net::URLRequestStatus::SUCCESS, 500, PROTO_STRING(kResponseEmpty)), FailedRequestParams( DeviceManagementBackend::kErrorResponseDecoding, - URLRequestStatus::SUCCESS, + net::URLRequestStatus::SUCCESS, 200, PROTO_STRING("Not a protobuf.")), FailedRequestParams( DeviceManagementBackend::kErrorServiceManagementNotSupported, - URLRequestStatus::SUCCESS, + net::URLRequestStatus::SUCCESS, 200, PROTO_STRING(kResponseErrorManagementNotSupported)), FailedRequestParams( DeviceManagementBackend::kErrorServiceDeviceNotFound, - URLRequestStatus::SUCCESS, + net::URLRequestStatus::SUCCESS, 200, PROTO_STRING(kResponseErrorDeviceNotFound)), FailedRequestParams( DeviceManagementBackend::kErrorServiceManagementTokenInvalid, - URLRequestStatus::SUCCESS, + net::URLRequestStatus::SUCCESS, 200, PROTO_STRING(kResponseErrorManagementTokenInvalid)), FailedRequestParams( DeviceManagementBackend::kErrorServiceActivationPending, - URLRequestStatus::SUCCESS, + net::URLRequestStatus::SUCCESS, 200, PROTO_STRING(kResponseErrorActivationPending)))); @@ -299,7 +299,7 @@ TEST_F(DeviceManagementServiceTest, RegisterRequest) { response_wrapper.set_error(em::DeviceManagementResponse::SUCCESS); response_wrapper.mutable_register_response()->CopyFrom(expected_response); ASSERT_TRUE(response_wrapper.SerializeToString(&response_data)); - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); fetcher->delegate()->OnURLFetchComplete(fetcher, GURL(kServiceUrl), status, @@ -342,7 +342,7 @@ TEST_F(DeviceManagementServiceTest, UnregisterRequest) { response_wrapper.set_error(em::DeviceManagementResponse::SUCCESS); response_wrapper.mutable_unregister_response()->CopyFrom(expected_response); ASSERT_TRUE(response_wrapper.SerializeToString(&response_data)); - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); fetcher->delegate()->OnURLFetchComplete(fetcher, GURL(kServiceUrl), status, @@ -397,7 +397,7 @@ TEST_F(DeviceManagementServiceTest, PolicyRequest) { response_wrapper.set_error(em::DeviceManagementResponse::SUCCESS); response_wrapper.mutable_policy_response()->CopyFrom(expected_response); ASSERT_TRUE(response_wrapper.SerializeToString(&response_data)); - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); fetcher->delegate()->OnURLFetchComplete(fetcher, GURL(kServiceUrl), status, @@ -473,7 +473,7 @@ TEST_F(DeviceManagementServiceTest, JobQueueing) { response_wrapper.set_error(em::DeviceManagementResponse::SUCCESS); response_wrapper.mutable_register_response()->CopyFrom(expected_response); ASSERT_TRUE(response_wrapper.SerializeToString(&response_data)); - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); fetcher->delegate()->OnURLFetchComplete(fetcher, GURL(kServiceUrl), status, diff --git a/chrome/browser/prerender/prerender_interceptor_unittest.cc b/chrome/browser/prerender/prerender_interceptor_unittest.cc index 2fc236fc..413e616 100644 --- a/chrome/browser/prerender/prerender_interceptor_unittest.cc +++ b/chrome/browser/prerender/prerender_interceptor_unittest.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. @@ -74,7 +74,7 @@ TEST_F(PrerenderInterceptorTest, Interception) { req_->Start(); MessageLoop::current()->Run(); - EXPECT_EQ(URLRequestStatus::SUCCESS, req_->status().status()); + EXPECT_EQ(net::URLRequestStatus::SUCCESS, req_->status().status()); EXPECT_EQ(gurl_, last_intercepted_gurl_); } @@ -84,7 +84,7 @@ TEST_F(PrerenderInterceptorTest, NotAPrefetch) { req_->Start(); MessageLoop::current()->Run(); - EXPECT_EQ(URLRequestStatus::SUCCESS, req_->status().status()); + EXPECT_EQ(net::URLRequestStatus::SUCCESS, req_->status().status()); EXPECT_NE(gurl_, last_intercepted_gurl_); } @@ -94,7 +94,7 @@ TEST_F(PrerenderInterceptorTest, WrongMimeType) { req_->Start(); MessageLoop::current()->Run(); - EXPECT_EQ(URLRequestStatus::SUCCESS, req_->status().status()); + EXPECT_EQ(net::URLRequestStatus::SUCCESS, req_->status().status()); EXPECT_NE(gurl_, last_intercepted_gurl_); } diff --git a/chrome/browser/prerender/prerender_resource_handler_unittest.cc b/chrome/browser/prerender/prerender_resource_handler_unittest.cc index b2ba2e0..92ae2e3 100644 --- a/chrome/browser/prerender/prerender_resource_handler_unittest.cc +++ b/chrome/browser/prerender/prerender_resource_handler_unittest.cc @@ -48,7 +48,7 @@ class MockResourceHandler : public ResourceHandler { } virtual bool OnResponseCompleted(int request_id, - const URLRequestStatus& status, + const net::URLRequestStatus& status, const std::string& security_info) { return true; } diff --git a/chrome/browser/remoting/directory_add_request.cc b/chrome/browser/remoting/directory_add_request.cc index c7d2645..691c7a2 100644 --- a/chrome/browser/remoting/directory_add_request.cc +++ b/chrome/browser/remoting/directory_add_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. @@ -61,7 +61,7 @@ void DirectoryAddRequest::AddHost(const remoting::ChromotingHostInfo& host_info, void DirectoryAddRequest::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/browser/remoting/directory_add_request_unittest.cc b/chrome/browser/remoting/directory_add_request_unittest.cc index 6389b3e8..3c6d496 100644 --- a/chrome/browser/remoting/directory_add_request_unittest.cc +++ b/chrome/browser/remoting/directory_add_request_unittest.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. @@ -36,7 +36,7 @@ class DirectoryAddRequestTest : public testing::Test { NewCallback(&callback, &MockDoneCallback::OnDone)); GURL url; - URLRequestStatus status_ok; + net::URLRequestStatus status_ok; ResponseCookies cookies; target_->OnURLFetchComplete(NULL, url, status_ok, response_code, cookies, data); diff --git a/chrome/browser/renderer_host/async_resource_handler.cc b/chrome/browser/renderer_host/async_resource_handler.cc index 8f84d08..0a2bcbb 100644 --- a/chrome/browser/renderer_host/async_resource_handler.cc +++ b/chrome/browser/renderer_host/async_resource_handler.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. @@ -229,7 +229,7 @@ void AsyncResourceHandler::OnDataDownloaded( bool AsyncResourceHandler::OnResponseCompleted( int request_id, - const URLRequestStatus& status, + const net::URLRequestStatus& status, const std::string& security_info) { Time completion_time = Time::Now(); filter_->Send(new ViewMsg_Resource_RequestComplete(routing_id_, @@ -241,7 +241,8 @@ bool AsyncResourceHandler::OnResponseCompleted( // If we still have a read buffer, then see about caching it for later... // Note that we have to make sure the buffer is not still being used, so we // have to perform an explicit check on the status code. - if (g_spare_read_buffer || URLRequestStatus::SUCCESS != status.status()) { + if (g_spare_read_buffer || + net::URLRequestStatus::SUCCESS != status.status()) { read_buffer_ = NULL; } else if (read_buffer_.get()) { DCHECK(read_buffer_->data()); diff --git a/chrome/browser/renderer_host/buffered_resource_handler.cc b/chrome/browser/renderer_host/buffered_resource_handler.cc index bc35c42..2cccbc2 100644 --- a/chrome/browser/renderer_host/buffered_resource_handler.cc +++ b/chrome/browser/renderer_host/buffered_resource_handler.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. @@ -89,7 +89,7 @@ bool BufferedResourceHandler::OnResponseStarted(int request_id, bool BufferedResourceHandler::OnResponseCompleted( int request_id, - const URLRequestStatus& status, + const net::URLRequestStatus& status, const std::string& security_info) { return real_handler_->OnResponseCompleted(request_id, status, security_info); } @@ -455,7 +455,7 @@ void BufferedResourceHandler::UseAlternateResourceHandler( // Inform the original ResourceHandler that this will be handled entirely by // the new ResourceHandler. real_handler_->OnResponseStarted(info->request_id(), response_); - URLRequestStatus status(URLRequestStatus::HANDLED_EXTERNALLY, 0); + net::URLRequestStatus status(net::URLRequestStatus::HANDLED_EXTERNALLY, 0); real_handler_->OnResponseCompleted(info->request_id(), status, std::string()); // Remove the non-owning pointer to the CrossSiteResourceHandler, if any, diff --git a/chrome/browser/renderer_host/cross_site_resource_handler.cc b/chrome/browser/renderer_host/cross_site_resource_handler.cc index b1ac20a..d3236f6 100644 --- a/chrome/browser/renderer_host/cross_site_resource_handler.cc +++ b/chrome/browser/renderer_host/cross_site_resource_handler.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 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. @@ -100,7 +100,7 @@ bool CrossSiteResourceHandler::OnReadCompleted(int request_id, bool CrossSiteResourceHandler::OnResponseCompleted( int request_id, - const URLRequestStatus& status, + const net::URLRequestStatus& status, const std::string& security_info) { if (!in_cross_site_transition_) { if (has_started_response_) { diff --git a/chrome/browser/renderer_host/download_resource_handler.cc b/chrome/browser/renderer_host/download_resource_handler.cc index 7adc462..a75ae97 100644 --- a/chrome/browser/renderer_host/download_resource_handler.cc +++ b/chrome/browser/renderer_host/download_resource_handler.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. @@ -210,7 +210,7 @@ bool DownloadResourceHandler::OnReadCompleted(int request_id, int* bytes_read) { bool DownloadResourceHandler::OnResponseCompleted( int request_id, - const URLRequestStatus& status, + const net::URLRequestStatus& status, const std::string& security_info) { VLOG(20) << __FUNCTION__ << "()" << DebugString() << " request_id = " << request_id diff --git a/chrome/browser/renderer_host/download_throttling_resource_handler.cc b/chrome/browser/renderer_host/download_throttling_resource_handler.cc index 833c8a1..ad1459f 100644 --- a/chrome/browser/renderer_host/download_throttling_resource_handler.cc +++ b/chrome/browser/renderer_host/download_throttling_resource_handler.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-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. @@ -119,7 +119,7 @@ bool DownloadThrottlingResourceHandler::OnReadCompleted(int request_id, bool DownloadThrottlingResourceHandler::OnResponseCompleted( int request_id, - const URLRequestStatus& status, + const net::URLRequestStatus& status, const std::string& security_info) { if (download_handler_.get()) return download_handler_->OnResponseCompleted(request_id, status, diff --git a/chrome/browser/renderer_host/offline_resource_handler.cc b/chrome/browser/renderer_host/offline_resource_handler.cc index 362f411..6013c16 100644 --- a/chrome/browser/renderer_host/offline_resource_handler.cc +++ b/chrome/browser/renderer_host/offline_resource_handler.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. @@ -53,7 +53,7 @@ bool OfflineResourceHandler::OnResponseStarted(int request_id, bool OfflineResourceHandler::OnResponseCompleted( int request_id, - const URLRequestStatus& status, + const net::URLRequestStatus& status, const std::string& security_info) { return next_handler_->OnResponseCompleted(request_id, status, security_info); } diff --git a/chrome/browser/renderer_host/redirect_to_file_resource_handler.cc b/chrome/browser/renderer_host/redirect_to_file_resource_handler.cc index 1e7d4b3..11d5934 100644 --- a/chrome/browser/renderer_host/redirect_to_file_resource_handler.cc +++ b/chrome/browser/renderer_host/redirect_to_file_resource_handler.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. @@ -133,7 +133,7 @@ bool RedirectToFileResourceHandler::OnReadCompleted(int request_id, bool RedirectToFileResourceHandler::OnResponseCompleted( int request_id, - const URLRequestStatus& status, + const net::URLRequestStatus& status, const std::string& security_info) { return next_handler_->OnResponseCompleted(request_id, status, security_info); } diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc index 2d10e4e..31bd0bf 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.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. @@ -6,7 +6,7 @@ // If this gets included after the gtk headers, then a bunch of compiler // errors happen because of a "#define Status int" in Xlib.h, which interacts -// badly with URLRequestStatus::Status. +// badly with net::URLRequestStatus::Status. #include "chrome/common/render_messages.h" #include <cairo/cairo.h> diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.cc b/chrome/browser/renderer_host/resource_dispatcher_host.cc index 74fcc51..dc3427a 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host.cc +++ b/chrome/browser/renderer_host/resource_dispatcher_host.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. @@ -304,10 +304,10 @@ bool ResourceDispatcherHost::HandleExternalProtocol(int request_id, NewRunnableFunction( &ExternalProtocolHandler::LaunchUrl, url, child_id, route_id)); - handler->OnResponseCompleted(request_id, URLRequestStatus( - URLRequestStatus::FAILED, - net::ERR_ABORTED), - std::string()); // No security info necessary. + handler->OnResponseCompleted( + request_id, + net::URLRequestStatus(net::URLRequestStatus::FAILED, net::ERR_ABORTED), + std::string()); // No security info necessary. return true; } @@ -378,7 +378,8 @@ void ResourceDispatcherHost::BeginRequest( if (is_shutdown_ || !ShouldServiceRequest(process_type, child_id, request_data)) { - URLRequestStatus status(URLRequestStatus::FAILED, net::ERR_ABORTED); + net::URLRequestStatus status(net::URLRequestStatus::FAILED, + net::ERR_ABORTED); if (sync_result) { SyncLoadResult result; result.status = status; diff --git a/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc b/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc index 91bbe4d..a619355 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc +++ b/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc @@ -396,13 +396,13 @@ TEST_F(ResourceDispatcherHostTest, Cancel) { ASSERT_EQ(ViewMsg_Resource_RequestComplete::ID, msgs[1][1].type()); int request_id; - URLRequestStatus status; + net::URLRequestStatus status; void* iter = NULL; ASSERT_TRUE(IPC::ReadParam(&msgs[1][1], &iter, &request_id)); ASSERT_TRUE(IPC::ReadParam(&msgs[1][1], &iter, &status)); - EXPECT_EQ(URLRequestStatus::CANCELED, status.status()); + EXPECT_EQ(net::URLRequestStatus::CANCELED, status.status()); } // The host delegate acts as a second one so we can have some requests @@ -766,14 +766,14 @@ TEST_F(ResourceDispatcherHostTest, TooManyOutstandingRequests) { // The RequestComplete message should have had status // (CANCELLED, ERR_INSUFFICIENT_RESOURCES). int request_id; - URLRequestStatus status; + net::URLRequestStatus status; void* iter = NULL; EXPECT_TRUE(IPC::ReadParam(&msgs[index][0], &iter, &request_id)); EXPECT_TRUE(IPC::ReadParam(&msgs[index][0], &iter, &status)); EXPECT_EQ(index + 1, request_id); - EXPECT_EQ(URLRequestStatus::CANCELED, status.status()); + EXPECT_EQ(net::URLRequestStatus::CANCELED, status.status()); EXPECT_EQ(net::ERR_INSUFFICIENT_RESOURCES, status.os_error()); } @@ -930,14 +930,14 @@ TEST_F(ResourceDispatcherHostTest, ForbiddenDownload) { // The RequestComplete message should have had status // (CANCELED, ERR_FILE_NOT_FOUND). int request_id; - URLRequestStatus status; + net::URLRequestStatus status; void* iter = NULL; EXPECT_TRUE(IPC::ReadParam(&msgs[0][0], &iter, &request_id)); EXPECT_TRUE(IPC::ReadParam(&msgs[0][0], &iter, &status)); EXPECT_EQ(1, request_id); - EXPECT_EQ(URLRequestStatus::CANCELED, status.status()); + EXPECT_EQ(net::URLRequestStatus::CANCELED, status.status()); EXPECT_EQ(net::ERR_FILE_NOT_FOUND, status.os_error()); } @@ -971,7 +971,9 @@ class DummyResourceHandler : public ResourceHandler { bool OnReadCompleted(int request_id, int* bytes_read) { return true; } bool OnResponseCompleted( - int request_id, const URLRequestStatus& status, const std::string& info) { + int request_id, + const net::URLRequestStatus& status, + const std::string& info) { return true; } diff --git a/chrome/browser/renderer_host/resource_queue.cc b/chrome/browser/renderer_host/resource_queue.cc index 66d02a1..3b667bf 100644 --- a/chrome/browser/renderer_host/resource_queue.cc +++ b/chrome/browser/renderer_host/resource_queue.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 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. @@ -86,7 +86,7 @@ void ResourceQueue::StartDelayedRequest(ResourceQueueDelegate* delegate, if (ContainsKey(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()); + DCHECK_EQ(net::URLRequestStatus::SUCCESS, request->status().status()); request->Start(); } } diff --git a/chrome/browser/renderer_host/resource_queue_unittest.cc b/chrome/browser/renderer_host/resource_queue_unittest.cc index 3339701..a1a32da 100644 --- a/chrome/browser/renderer_host/resource_queue_unittest.cc +++ b/chrome/browser/renderer_host/resource_queue_unittest.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. @@ -59,7 +59,7 @@ class DummyResourceHandler : public ResourceHandler { } virtual bool OnResponseCompleted(int request_id, - const URLRequestStatus& status, + const net::URLRequestStatus& status, const std::string& security_info) { NOTREACHED(); return true; diff --git a/chrome/browser/renderer_host/safe_browsing_resource_handler.cc b/chrome/browser/renderer_host/safe_browsing_resource_handler.cc index 237cad8..062cb89 100644 --- a/chrome/browser/renderer_host/safe_browsing_resource_handler.cc +++ b/chrome/browser/renderer_host/safe_browsing_resource_handler.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. @@ -121,7 +121,7 @@ bool SafeBrowsingResourceHandler::OnReadCompleted(int request_id, } bool SafeBrowsingResourceHandler::OnResponseCompleted( - int request_id, const URLRequestStatus& status, + int request_id, const net::URLRequestStatus& status, const std::string& security_info) { Shutdown(); return next_handler_->OnResponseCompleted(request_id, status, security_info); diff --git a/chrome/browser/renderer_host/save_file_resource_handler.cc b/chrome/browser/renderer_host/save_file_resource_handler.cc index d33e205..54b4388 100644 --- a/chrome/browser/renderer_host/save_file_resource_handler.cc +++ b/chrome/browser/renderer_host/save_file_resource_handler.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. @@ -94,7 +94,7 @@ bool SaveFileResourceHandler::OnReadCompleted(int request_id, int* bytes_read) { bool SaveFileResourceHandler::OnResponseCompleted( int request_id, - const URLRequestStatus& status, + const net::URLRequestStatus& status, const std::string& security_info) { BrowserThread::PostTask( BrowserThread::FILE, FROM_HERE, diff --git a/chrome/browser/renderer_host/sync_resource_handler.cc b/chrome/browser/renderer_host/sync_resource_handler.cc index aa42c72..5ae3333 100644 --- a/chrome/browser/renderer_host/sync_resource_handler.cc +++ b/chrome/browser/renderer_host/sync_resource_handler.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. @@ -98,7 +98,7 @@ bool SyncResourceHandler::OnReadCompleted(int request_id, int* bytes_read) { bool SyncResourceHandler::OnResponseCompleted( int request_id, - const URLRequestStatus& status, + const net::URLRequestStatus& status, const std::string& security_info) { result_.status = status; 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 68b62ca..c4703c1 100644 --- a/chrome/browser/renderer_host/x509_user_cert_resource_handler.cc +++ b/chrome/browser/renderer_host/x509_user_cert_resource_handler.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 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. @@ -93,9 +93,9 @@ bool X509UserCertResourceHandler::OnReadCompleted(int request_id, bool X509UserCertResourceHandler::OnResponseCompleted( int request_id, - const URLRequestStatus& urs, + const net::URLRequestStatus& urs, const std::string& sec_info) { - if (urs.status() != URLRequestStatus::SUCCESS) + if (urs.status() != net::URLRequestStatus::SUCCESS) return false; // TODO(gauravsh): Verify that 'request_id' was actually a keygen form post diff --git a/chrome/browser/safe_browsing/client_side_detection_service.cc b/chrome/browser/safe_browsing/client_side_detection_service.cc index 14aac20..5b2da22 100644 --- a/chrome/browser/safe_browsing/client_side_detection_service.cc +++ b/chrome/browser/safe_browsing/client_side_detection_service.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. @@ -105,7 +105,7 @@ void ClientSideDetectionService::SendClientReportPhishingRequest( void ClientSideDetectionService::OnURLFetchComplete( const URLFetcher* source, const GURL& url, - const URLRequestStatus& status, + const net::URLRequestStatus& status, int response_code, const ResponseCookies& cookies, const std::string& data) { @@ -275,7 +275,7 @@ void ClientSideDetectionService::StartClientReportPhishingRequest( void ClientSideDetectionService::HandleModelResponse( const URLFetcher* source, const GURL& url, - const URLRequestStatus& status, + const net::URLRequestStatus& status, int response_code, const ResponseCookies& cookies, const std::string& data) { @@ -306,7 +306,7 @@ void ClientSideDetectionService::HandleModelResponse( void ClientSideDetectionService::HandlePhishingVerdict( 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/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc index 26abb9a..2ff5f4c 100644 --- a/chrome/browser/safe_browsing/protocol_manager.cc +++ b/chrome/browser/safe_browsing/protocol_manager.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. @@ -201,7 +201,7 @@ void SafeBrowsingProtocolManager::GetNextUpdate() { void SafeBrowsingProtocolManager::OnURLFetchComplete( const URLFetcher* source, const GURL& url, - const URLRequestStatus& status, + const net::URLRequestStatus& status, int response_code, const ResponseCookies& cookies, const std::string& data) { @@ -255,7 +255,7 @@ void SafeBrowsingProtocolManager::OnURLFetchComplete( } } else { HandleGetHashError(Time::Now()); - if (status.status() == URLRequestStatus::FAILED) { + if (status.status() == net::URLRequestStatus::FAILED) { VLOG(1) << "SafeBrowsing GetHash request for: " << source->url() << " failed with os error: " << status.os_error(); } else { @@ -329,7 +329,7 @@ void SafeBrowsingProtocolManager::OnURLFetchComplete( if (request_type_ == CHUNK_REQUEST) chunk_request_urls_.clear(); UpdateFinished(false); - if (status.status() == URLRequestStatus::FAILED) { + if (status.status() == net::URLRequestStatus::FAILED) { VLOG(1) << "SafeBrowsing request for: " << source->url() << " failed with os error: " << status.os_error(); } else { diff --git a/chrome/browser/safe_browsing/safe_browsing_test.cc b/chrome/browser/safe_browsing/safe_browsing_test.cc index 7cc8f86e..fb48e28 100644 --- a/chrome/browser/safe_browsing/safe_browsing_test.cc +++ b/chrome/browser/safe_browsing/safe_browsing_test.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. // @@ -341,7 +341,7 @@ class SafeBrowsingServiceTestHelper explicit SafeBrowsingServiceTestHelper( SafeBrowsingServiceTest* safe_browsing_test) : safe_browsing_test_(safe_browsing_test), - response_status_(URLRequestStatus::FAILED) { + response_status_(net::URLRequestStatus::FAILED) { } // Callbacks for SafeBrowsingService::Client. @@ -441,13 +441,13 @@ class SafeBrowsingServiceTestHelper } void WaitTillServerReady(const char* host, int port) { - response_status_ = URLRequestStatus::FAILED; + response_status_ = net::URLRequestStatus::FAILED; GURL url(StringPrintf("http://%s:%d%s?test_step=0", host, port, kDBResetPath)); // TODO(lzheng): We should have a way to reliably tell when a server is // ready so we could get rid of the Sleep and retry loop. while (true) { - if (FetchUrl(url) == URLRequestStatus::SUCCESS) + if (FetchUrl(url) == net::URLRequestStatus::SUCCESS) break; // Wait and try again if last fetch was failed. The loop will hit the // timeout in OutOfProcTestRunner if the fetch can not get success @@ -457,8 +457,8 @@ class SafeBrowsingServiceTestHelper } // Calls test server to fetch database for verification. - URLRequestStatus::Status FetchDBToVerify(const char* host, int port, - int test_step) { + net::URLRequestStatus::Status FetchDBToVerify(const char* host, int port, + int test_step) { // TODO(lzheng): Remove chunk_type=add once it is not needed by the server. GURL url(StringPrintf("http://%s:%d%s?" "client=chromium&appver=1.0&pver=2.2&test_step=%d&" @@ -468,8 +468,8 @@ class SafeBrowsingServiceTestHelper } // Calls test server to fetch URLs for verification. - URLRequestStatus::Status FetchUrlsToVerify(const char* host, int port, - int test_step) { + net::URLRequestStatus::Status FetchUrlsToVerify(const char* host, int port, + int test_step) { GURL url(StringPrintf("http://%s:%d%s?" "client=chromium&appver=1.0&pver=2.2&test_step=%d", host, port, kUrlVerifyPath, test_step)); @@ -479,8 +479,8 @@ class SafeBrowsingServiceTestHelper // Calls test server to check if test data is done. E.g.: if there is a // bad URL that server expects test to fetch full hash but the test didn't, // this verification will fail. - URLRequestStatus::Status VerifyTestComplete(const char* host, int port, - int test_step) { + net::URLRequestStatus::Status VerifyTestComplete(const char* host, int port, + int test_step) { GURL url(StringPrintf("http://%s:%d%s?test_step=%d", host, port, kTestCompletePath, test_step)); return FetchUrl(url); @@ -489,7 +489,7 @@ class SafeBrowsingServiceTestHelper // Callback for URLFetcher. 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) { @@ -511,7 +511,7 @@ class SafeBrowsingServiceTestHelper // Fetch a URL. If message_loop_started is true, starts the message loop // so the caller could wait till OnURLFetchComplete is called. - URLRequestStatus::Status FetchUrl(const GURL& url) { + net::URLRequestStatus::Status FetchUrl(const GURL& url) { url_fetcher_.reset(new URLFetcher(url, URLFetcher::GET, this)); url_fetcher_->set_load_flags(net::LOAD_DISABLE_CACHE); url_fetcher_->set_request_context(Profile::GetDefaultRequestContext()); @@ -524,7 +524,7 @@ class SafeBrowsingServiceTestHelper SafeBrowsingServiceTest* safe_browsing_test_; scoped_ptr<URLFetcher> url_fetcher_; std::string response_data_; - URLRequestStatus::Status response_status_; + net::URLRequestStatus::Status response_status_; DISALLOW_COPY_AND_ASSIGN(SafeBrowsingServiceTestHelper); }; @@ -584,7 +584,7 @@ IN_PROC_BROWSER_TEST_F(SafeBrowsingServiceTest, SafeBrowsingSystemTest) { } // Fetches URLs to verify and waits till server responses with data. - EXPECT_EQ(URLRequestStatus::SUCCESS, + EXPECT_EQ(net::URLRequestStatus::SUCCESS, safe_browsing_helper->FetchUrlsToVerify(server_host, server_port, step)); @@ -615,7 +615,7 @@ IN_PROC_BROWSER_TEST_F(SafeBrowsingServiceTest, SafeBrowsingSystemTest) { } // TODO(lzheng): We should verify the fetched database with local // database to make sure they match. - EXPECT_EQ(URLRequestStatus::SUCCESS, + EXPECT_EQ(net::URLRequestStatus::SUCCESS, safe_browsing_helper->FetchDBToVerify(server_host, server_port, step)); @@ -624,7 +624,7 @@ IN_PROC_BROWSER_TEST_F(SafeBrowsingServiceTest, SafeBrowsingSystemTest) { } // Verifies with server if test is done and waits till server responses. - EXPECT_EQ(URLRequestStatus::SUCCESS, + EXPECT_EQ(net::URLRequestStatus::SUCCESS, safe_browsing_helper->VerifyTestComplete(server_host, server_port, last_step)); diff --git a/chrome/browser/search_engines/template_url_fetcher.cc b/chrome/browser/search_engines/template_url_fetcher.cc index b5fe3db..293f59b 100644 --- a/chrome/browser/search_engines/template_url_fetcher.cc +++ b/chrome/browser/search_engines/template_url_fetcher.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. @@ -42,7 +42,7 @@ class TemplateURLFetcher::RequestDelegate : public URLFetcher::Delegate, // the TemplateURLModel. 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); @@ -119,7 +119,7 @@ void TemplateURLFetcher::RequestDelegate::Observe( void TemplateURLFetcher::RequestDelegate::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/browser/speech/speech_recognition_request.cc b/chrome/browser/speech/speech_recognition_request.cc index b1234b0..402af7e 100644 --- a/chrome/browser/speech/speech_recognition_request.cc +++ b/chrome/browser/speech/speech_recognition_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. @@ -175,7 +175,7 @@ bool SpeechRecognitionRequest::Send(const std::string& language, void SpeechRecognitionRequest::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/browser/speech/speech_recognition_request_unittest.cc b/chrome/browser/speech/speech_recognition_request_unittest.cc index 6d1db5f..cf3f60b 100644 --- a/chrome/browser/speech/speech_recognition_request_unittest.cc +++ b/chrome/browser/speech/speech_recognition_request_unittest.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. @@ -50,9 +50,9 @@ void SpeechRecognitionRequestTest::CreateAndTestRequest( std::string()); TestURLFetcher* fetcher = url_fetcher_factory_.GetFetcherByID(0); ASSERT_TRUE(fetcher); - URLRequestStatus status; - status.set_status(success ? URLRequestStatus::SUCCESS : - URLRequestStatus::FAILED); + net::URLRequestStatus status; + status.set_status(success ? net::URLRequestStatus::SUCCESS : + net::URLRequestStatus::FAILED); fetcher->delegate()->OnURLFetchComplete(fetcher, fetcher->original_url(), status, success ? 200 : 500, ResponseCookies(), diff --git a/chrome/browser/speech/speech_recognizer_unittest.cc b/chrome/browser/speech/speech_recognizer_unittest.cc index 44967b1..372c48c 100644 --- a/chrome/browser/speech/speech_recognizer_unittest.cc +++ b/chrome/browser/speech/speech_recognizer_unittest.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. @@ -142,8 +142,8 @@ TEST_F(SpeechRecognizerTest, StopWithData) { // Issue the network callback to complete the process. TestURLFetcher* fetcher = url_fetcher_factory_.GetFetcherByID(0); ASSERT_TRUE(fetcher); - URLRequestStatus status; - status.set_status(URLRequestStatus::SUCCESS); + net::URLRequestStatus status; + status.set_status(net::URLRequestStatus::SUCCESS); fetcher->delegate()->OnURLFetchComplete( fetcher, fetcher->original_url(), status, 200, ResponseCookies(), "{\"hypotheses\":[{\"utterance\":\"123\"}]}"); diff --git a/chrome/browser/sync/glue/http_bridge.cc b/chrome/browser/sync/glue/http_bridge.cc index 2ec5a1b..4693153 100644 --- a/chrome/browser/sync/glue/http_bridge.cc +++ b/chrome/browser/sync/glue/http_bridge.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. @@ -219,15 +219,16 @@ const std::string HttpBridge::GetResponseHeaderValue( return value; } -void HttpBridge::OnURLFetchComplete(const URLFetcher *source, const GURL &url, - const URLRequestStatus &status, +void HttpBridge::OnURLFetchComplete(const URLFetcher *source, + const GURL &url, + const net::URLRequestStatus &status, int response_code, const ResponseCookies &cookies, const std::string &data) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); request_completed_ = true; - request_succeeded_ = (URLRequestStatus::SUCCESS == status.status()); + request_succeeded_ = (net::URLRequestStatus::SUCCESS == status.status()); http_response_code_ = response_code; os_error_code_ = status.os_error(); diff --git a/chrome/browser/sync/glue/http_bridge_unittest.cc b/chrome/browser/sync/glue/http_bridge_unittest.cc index f9aa32c..7b60be4 100644 --- a/chrome/browser/sync/glue/http_bridge_unittest.cc +++ b/chrome/browser/sync/glue/http_bridge_unittest.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. @@ -137,7 +137,8 @@ class ShuntedHttpBridge : public HttpBridge { std::string response_content = "success!"; DummyURLFetcher fetcher; - OnURLFetchComplete(&fetcher, GURL("www.google.com"), URLRequestStatus(), + OnURLFetchComplete(&fetcher, GURL("www.google.com"), + net::URLRequestStatus(), 200, cookies, response_content); } HttpBridgeTest* test_; diff --git a/chrome/browser/sync/signin_manager_unittest.cc b/chrome/browser/sync/signin_manager_unittest.cc index d54ed66..12c4204d 100644 --- a/chrome/browser/sync/signin_manager_unittest.cc +++ b/chrome/browser/sync/signin_manager_unittest.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. @@ -35,8 +35,9 @@ class SigninManagerTest : public TokenServiceTestHarness { DCHECK(fetcher); DCHECK(fetcher->delegate()); fetcher->delegate()->OnURLFetchComplete( - fetcher, GURL(GaiaAuthFetcher::kClientLoginUrl), URLRequestStatus(), - 200, ResponseCookies(), "SID=sid\nLSID=lsid\nAuth=auth"); + fetcher, GURL(GaiaAuthFetcher::kClientLoginUrl), + net::URLRequestStatus(), 200, ResponseCookies(), + "SID=sid\nLSID=lsid\nAuth=auth"); // Then simulate the correct GetUserInfo response for the canonical email. // A new URL fetcher is used for each call. @@ -44,8 +45,9 @@ class SigninManagerTest : public TokenServiceTestHarness { DCHECK(fetcher); DCHECK(fetcher->delegate()); fetcher->delegate()->OnURLFetchComplete( - fetcher, GURL(GaiaAuthFetcher::kGetUserInfoUrl), URLRequestStatus(), - 200, ResponseCookies(), "email=user@gmail.com"); + fetcher, GURL(GaiaAuthFetcher::kGetUserInfoUrl), + net::URLRequestStatus(), 200, ResponseCookies(), + "email=user@gmail.com"); } diff --git a/chrome/browser/task_manager/task_manager.cc b/chrome/browser/task_manager/task_manager.cc index d3e89a9..28418b8 100644 --- a/chrome/browser/task_manager/task_manager.cc +++ b/chrome/browser/task_manager/task_manager.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. @@ -877,7 +877,7 @@ void TaskManagerModel::OnJobRemoved(net::URLRequestJob* job) { } void TaskManagerModel::OnJobDone(net::URLRequestJob* job, - const URLRequestStatus& status) { + const net::URLRequestStatus& status) { } void TaskManagerModel::OnJobRedirect(net::URLRequestJob* job, diff --git a/chrome/browser/translate/translate_manager.cc b/chrome/browser/translate/translate_manager.cc index 40fbae6..446a87f 100644 --- a/chrome/browser/translate/translate_manager.cc +++ b/chrome/browser/translate/translate_manager.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. @@ -280,7 +280,7 @@ void TranslateManager::Observe(NotificationType type, void TranslateManager::OnURLFetchComplete(const URLFetcher* source, const GURL& url, - const URLRequestStatus& status, + const net::URLRequestStatus& status, int response_code, const ResponseCookies& cookies, const std::string& data) { @@ -288,7 +288,8 @@ void TranslateManager::OnURLFetchComplete(const URLFetcher* source, DCHECK(translate_script_request_pending_); translate_script_request_pending_ = false; bool error = - (status.status() != URLRequestStatus::SUCCESS || response_code != 200); + (status.status() != net::URLRequestStatus::SUCCESS || + response_code != 200); if (!error) { base::StringPiece str = ResourceBundle::GetSharedInstance(). diff --git a/chrome/browser/translate/translate_manager_unittest.cc b/chrome/browser/translate/translate_manager_unittest.cc index 89cc355..f821b5c 100644 --- a/chrome/browser/translate/translate_manager_unittest.cc +++ b/chrome/browser/translate/translate_manager_unittest.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. @@ -181,9 +181,9 @@ class TranslateManagerTest : public RenderViewHostTestHarness, void SimulateURLFetch(bool success) { TestURLFetcher* fetcher = url_fetcher_factory_.GetFetcherByID(0); ASSERT_TRUE(fetcher); - URLRequestStatus status; - status.set_status(success ? URLRequestStatus::SUCCESS : - URLRequestStatus::FAILED); + net::URLRequestStatus status; + status.set_status(success ? net::URLRequestStatus::SUCCESS : + net::URLRequestStatus::FAILED); fetcher->delegate()->OnURLFetchComplete(fetcher, fetcher->original_url(), status, success ? 200 : 500, ResponseCookies(), diff --git a/chrome/browser/web_resource/web_resource_service.cc b/chrome/browser/web_resource/web_resource_service.cc index cdee197..35f4aea 100644 --- a/chrome/browser/web_resource/web_resource_service.cc +++ b/chrome/browser/web_resource/web_resource_service.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. @@ -84,7 +84,7 @@ class WebResourceService::WebResourceFetcher // From URLFetcher::Delegate. 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/common/automation_messages_internal.h b/chrome/common/automation_messages_internal.h index a788d18..23249da 100644 --- a/chrome/common/automation_messages_internal.h +++ b/chrome/common/automation_messages_internal.h @@ -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. @@ -958,7 +958,7 @@ IPC_MESSAGE_ROUTED2(AutomationMsg_RequestData, IPC_MESSAGE_ROUTED2(AutomationMsg_RequestEnd, int /* request_id */, - URLRequestStatus /* status */) + net::URLRequestStatus /* status */) IPC_MESSAGE_CONTROL1(AutomationMsg_PrintAsync, int /* tab_handle */) diff --git a/chrome/common/common_param_traits.cc b/chrome/common/common_param_traits.cc index 40417fc..c3728fb 100644 --- a/chrome/common/common_param_traits.cc +++ b/chrome/common/common_param_traits.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. @@ -290,50 +290,52 @@ void ParamTraits<WebApplicationInfo>::Log(const WebApplicationInfo& p, l->append("<WebApplicationInfo>"); } -void ParamTraits<URLRequestStatus>::Write(Message* m, const param_type& p) { +void ParamTraits<net::URLRequestStatus>::Write(Message* m, + const param_type& p) { WriteParam(m, static_cast<int>(p.status())); WriteParam(m, p.os_error()); } -bool ParamTraits<URLRequestStatus>::Read(const Message* m, void** iter, - param_type* r) { +bool ParamTraits<net::URLRequestStatus>::Read(const Message* m, void** iter, + param_type* r) { int status, os_error; if (!ReadParam(m, iter, &status) || !ReadParam(m, iter, &os_error)) return false; - r->set_status(static_cast<URLRequestStatus::Status>(status)); + r->set_status(static_cast<net::URLRequestStatus::Status>(status)); r->set_os_error(os_error); return true; } -void ParamTraits<URLRequestStatus>::Log(const param_type& p, std::string* l) { +void ParamTraits<net::URLRequestStatus>::Log(const param_type& p, + std::string* l) { std::string status; switch (p.status()) { - case URLRequestStatus::SUCCESS: + case net::URLRequestStatus::SUCCESS: status = "SUCCESS"; break; - case URLRequestStatus::IO_PENDING: + case net::URLRequestStatus::IO_PENDING: status = "IO_PENDING "; break; - case URLRequestStatus::HANDLED_EXTERNALLY: + case net::URLRequestStatus::HANDLED_EXTERNALLY: status = "HANDLED_EXTERNALLY"; break; - case URLRequestStatus::CANCELED: + case net::URLRequestStatus::CANCELED: status = "CANCELED"; break; - case URLRequestStatus::FAILED: + case net::URLRequestStatus::FAILED: status = "FAILED"; break; default: status = "UNKNOWN"; break; } - if (p.status() == URLRequestStatus::FAILED) + if (p.status() == net::URLRequestStatus::FAILED) l->append("("); LogParam(status, l); - if (p.status() == URLRequestStatus::FAILED) { + if (p.status() == net::URLRequestStatus::FAILED) { l->append(", "); LogParam(p.os_error(), l); l->append(")"); diff --git a/chrome/common/common_param_traits.h b/chrome/common/common_param_traits.h index ad9c05a..7b6ed40 100644 --- a/chrome/common/common_param_traits.h +++ b/chrome/common/common_param_traits.h @@ -265,8 +265,8 @@ struct ParamTraits<TransportDIB::Id> { // Traits for URLRequestStatus template <> -struct ParamTraits<URLRequestStatus> { - typedef URLRequestStatus param_type; +struct ParamTraits<net::URLRequestStatus> { + typedef net::URLRequestStatus param_type; static void Write(Message* m, const param_type& p); static bool Read(const Message* m, void** iter, param_type* r); static void Log(const param_type& p, std::string* l); diff --git a/chrome/common/extensions/extension_localization_peer.cc b/chrome/common/extensions/extension_localization_peer.cc index e04bd0b..a01b601 100644 --- a/chrome/common/extensions/extension_localization_peer.cc +++ b/chrome/common/extensions/extension_localization_peer.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. @@ -66,17 +66,18 @@ void ExtensionLocalizationPeer::OnReceivedData(const char* data, int len) { } void ExtensionLocalizationPeer::OnCompletedRequest( - const URLRequestStatus& status, + const net::URLRequestStatus& status, const std::string& security_info, const base::Time& completion_time) { // Make sure we delete ourselves at the end of this call. scoped_ptr<ExtensionLocalizationPeer> this_deleter(this); // Give sub-classes a chance at altering the data. - if (status.status() != URLRequestStatus::SUCCESS) { + if (status.status() != net::URLRequestStatus::SUCCESS) { // We failed to load the resource. original_peer_->OnReceivedResponse(response_info_, true); - URLRequestStatus status(URLRequestStatus::CANCELED, net::ERR_ABORTED); + net::URLRequestStatus status(net::URLRequestStatus::CANCELED, + net::ERR_ABORTED); original_peer_->OnCompletedRequest(status, security_info, completion_time); return; } diff --git a/chrome/common/extensions/extension_localization_peer_unittest.cc b/chrome/common/extensions/extension_localization_peer_unittest.cc index dc67d5b..87cea6b 100644 --- a/chrome/common/extensions/extension_localization_peer_unittest.cc +++ b/chrome/common/extensions/extension_localization_peer_unittest.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. @@ -69,7 +69,7 @@ class MockResourceLoaderBridgePeer MOCK_METHOD1(OnDownloadedData, void(int len)); MOCK_METHOD2(OnReceivedData, void(const char* data, int len)); MOCK_METHOD3(OnCompletedRequest, void( - const URLRequestStatus& status, + const net::URLRequestStatus& status, const std::string& security_info, const base::Time& completion_time)); @@ -141,10 +141,10 @@ TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestBadURLRequestStatus) { EXPECT_CALL(*original_peer_, OnReceivedResponse(_, true)); EXPECT_CALL(*original_peer_, OnCompletedRequest( - IsURLRequestEqual(URLRequestStatus::CANCELED), "", base::Time())); + IsURLRequestEqual(net::URLRequestStatus::CANCELED), "", base::Time())); - URLRequestStatus status; - status.set_status(URLRequestStatus::FAILED); + net::URLRequestStatus status; + status.set_status(net::URLRequestStatus::FAILED); filter_peer->OnCompletedRequest(status, "", base::Time()); } @@ -157,10 +157,10 @@ TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestEmptyData) { EXPECT_CALL(*original_peer_, OnReceivedResponse(_, true)); EXPECT_CALL(*original_peer_, OnCompletedRequest( - IsURLRequestEqual(URLRequestStatus::SUCCESS), "", base::Time())); + IsURLRequestEqual(net::URLRequestStatus::SUCCESS), "", base::Time())); - URLRequestStatus status; - status.set_status(URLRequestStatus::SUCCESS); + net::URLRequestStatus status; + status.set_status(net::URLRequestStatus::SUCCESS); filter_peer->OnCompletedRequest(status, "", base::Time()); } @@ -178,10 +178,11 @@ TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestNoCatalogs) { EXPECT_CALL(*original_peer_, OnReceivedResponse(_, true)).Times(2); EXPECT_CALL(*original_peer_, OnCompletedRequest( - IsURLRequestEqual(URLRequestStatus::SUCCESS), "", base::Time())).Times(2); + IsURLRequestEqual( + net::URLRequestStatus::SUCCESS), "", base::Time())).Times(2); - URLRequestStatus status; - status.set_status(URLRequestStatus::SUCCESS); + net::URLRequestStatus status; + status.set_status(net::URLRequestStatus::SUCCESS); filter_peer->OnCompletedRequest(status, "", base::Time()); // Test if Send gets called again (it shouldn't be) when first call returned @@ -215,10 +216,10 @@ TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestWithCatalogs) { EXPECT_CALL(*original_peer_, OnReceivedResponse(_, true)); EXPECT_CALL(*original_peer_, OnCompletedRequest( - IsURLRequestEqual(URLRequestStatus::SUCCESS), "", base::Time())); + IsURLRequestEqual(net::URLRequestStatus::SUCCESS), "", base::Time())); - URLRequestStatus status; - status.set_status(URLRequestStatus::SUCCESS); + net::URLRequestStatus status; + status.set_status(net::URLRequestStatus::SUCCESS); filter_peer->OnCompletedRequest(status, "", base::Time()); } @@ -245,9 +246,9 @@ TEST_F(ExtensionLocalizationPeerTest, OnCompletedRequestReplaceMessagesFails) { EXPECT_CALL(*original_peer_, OnReceivedResponse(_, true)); EXPECT_CALL(*original_peer_, OnCompletedRequest( - IsURLRequestEqual(URLRequestStatus::SUCCESS), "", base::Time())); + IsURLRequestEqual(net::URLRequestStatus::SUCCESS), "", base::Time())); - URLRequestStatus status; - status.set_status(URLRequestStatus::SUCCESS); + net::URLRequestStatus status; + status.set_status(net::URLRequestStatus::SUCCESS); filter_peer->OnCompletedRequest(status, "", base::Time()); } diff --git a/chrome/common/net/gaia/gaia_auth_fetcher.cc b/chrome/common/net/gaia/gaia_auth_fetcher.cc index 0da33ca..520c135 100644 --- a/chrome/common/net/gaia/gaia_auth_fetcher.cc +++ b/chrome/common/net/gaia/gaia_auth_fetcher.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. @@ -314,10 +314,10 @@ void GaiaAuthFetcher::StartGetUserInfo(const std::string& lsid, // static GoogleServiceAuthError GaiaAuthFetcher::GenerateAuthError( const std::string& data, - const URLRequestStatus& status) { + const net::URLRequestStatus& status) { if (!status.is_success()) { - if (status.status() == URLRequestStatus::CANCELED) { + if (status.status() == net::URLRequestStatus::CANCELED) { return GoogleServiceAuthError(GoogleServiceAuthError::REQUEST_CANCELED); } else { LOG(WARNING) << "Could not reach Google Accounts servers: errno " @@ -365,7 +365,7 @@ GoogleServiceAuthError GaiaAuthFetcher::GenerateAuthError( } void GaiaAuthFetcher::OnClientLoginFetched(const std::string& data, - const URLRequestStatus& status, + const net::URLRequestStatus& status, int response_code) { if (status.is_success() && response_code == RC_REQUEST_OK) { @@ -383,7 +383,7 @@ void GaiaAuthFetcher::OnClientLoginFetched(const std::string& data, void GaiaAuthFetcher::OnIssueAuthTokenFetched( const std::string& data, - const URLRequestStatus& status, + const net::URLRequestStatus& status, int response_code) { if (status.is_success() && response_code == RC_REQUEST_OK) { // Only the bare token is returned in the body of this Gaia call @@ -397,7 +397,7 @@ void GaiaAuthFetcher::OnIssueAuthTokenFetched( void GaiaAuthFetcher::OnGetUserInfoFetched( const std::string& data, - const URLRequestStatus& status, + const net::URLRequestStatus& status, int response_code) { using std::vector; using std::string; @@ -421,7 +421,7 @@ void GaiaAuthFetcher::OnGetUserInfoFetched( void GaiaAuthFetcher::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/common/net/gaia/gaia_auth_fetcher_unittest.cc b/chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc index c7814c9..0830766 100644 --- a/chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc +++ b/chrome/common/net/gaia/gaia_auth_fetcher_unittest.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. // @@ -115,7 +115,7 @@ TEST_F(GaiaAuthFetcherTest, ErrorComparator) { TEST_F(GaiaAuthFetcherTest, LoginNetFailure) { int error_no = net::ERR_CONNECTION_RESET; - URLRequestStatus status(URLRequestStatus::FAILED, error_no); + net::URLRequestStatus status(net::URLRequestStatus::FAILED, error_no); GoogleServiceAuthError expected_error = GoogleServiceAuthError::FromConnectionError(error_no); @@ -137,7 +137,7 @@ TEST_F(GaiaAuthFetcherTest, LoginNetFailure) { TEST_F(GaiaAuthFetcherTest, TokenNetFailure) { int error_no = net::ERR_CONNECTION_RESET; - URLRequestStatus status(URLRequestStatus::FAILED, error_no); + net::URLRequestStatus status(net::URLRequestStatus::FAILED, error_no); GoogleServiceAuthError expected_error = GoogleServiceAuthError::FromConnectionError(error_no); @@ -160,7 +160,7 @@ TEST_F(GaiaAuthFetcherTest, TokenNetFailure) { TEST_F(GaiaAuthFetcherTest, LoginDenied) { std::string data("Error=BadAuthentication"); - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); GoogleServiceAuthError expected_error( GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS); @@ -220,7 +220,7 @@ TEST_F(GaiaAuthFetcherTest, OnlineLogin) { GaiaAuthFetcher auth(&consumer, std::string(), profile_.GetRequestContext()); - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); auth.OnURLFetchComplete(NULL, client_login_source_, status, @@ -236,7 +236,7 @@ TEST_F(GaiaAuthFetcherTest, WorkingIssueAuthToken) { GaiaAuthFetcher auth(&consumer, std::string(), profile_.GetRequestContext()); - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); auth.OnURLFetchComplete(NULL, issue_auth_token_source_, status, @@ -270,7 +270,7 @@ TEST_F(GaiaAuthFetcherTest, TwoFactorLogin) { GaiaAuthFetcher auth(&consumer, std::string(), profile_.GetRequestContext()); - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); auth.OnURLFetchComplete(NULL, client_login_source_, status, @@ -280,7 +280,7 @@ TEST_F(GaiaAuthFetcherTest, TwoFactorLogin) { } TEST_F(GaiaAuthFetcherTest, CaptchaParse) { - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); std::string data = "Url=http://www.google.com/login/captcha\n" "Error=CaptchaRequired\n" "CaptchaToken=CCTOKEN\n" @@ -299,7 +299,7 @@ TEST_F(GaiaAuthFetcherTest, CaptchaParse) { } TEST_F(GaiaAuthFetcherTest, AccountDeletedError) { - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); std::string data = "Error=AccountDeleted\n"; GoogleServiceAuthError error = GaiaAuthFetcher::GenerateAuthError(data, status); @@ -307,7 +307,7 @@ TEST_F(GaiaAuthFetcherTest, AccountDeletedError) { } TEST_F(GaiaAuthFetcherTest, AccountDisabledError) { - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); std::string data = "Error=AccountDisabled\n"; GoogleServiceAuthError error = GaiaAuthFetcher::GenerateAuthError(data, status); @@ -315,7 +315,7 @@ TEST_F(GaiaAuthFetcherTest, AccountDisabledError) { } TEST_F(GaiaAuthFetcherTest,BadAuthenticationError) { - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); std::string data = "Error=BadAuthentication\n"; GoogleServiceAuthError error = GaiaAuthFetcher::GenerateAuthError(data, status); @@ -323,7 +323,7 @@ TEST_F(GaiaAuthFetcherTest,BadAuthenticationError) { } TEST_F(GaiaAuthFetcherTest,IncomprehensibleError) { - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); std::string data = "Error=Gobbledygook\n"; GoogleServiceAuthError error = GaiaAuthFetcher::GenerateAuthError(data, status); @@ -331,7 +331,7 @@ TEST_F(GaiaAuthFetcherTest,IncomprehensibleError) { } TEST_F(GaiaAuthFetcherTest,ServiceUnavailableError) { - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); std::string data = "Error=ServiceUnavailable\n"; GoogleServiceAuthError error = GaiaAuthFetcher::GenerateAuthError(data, status); @@ -403,12 +403,13 @@ TEST_F(GaiaAuthFetcherTest, ClientFetchPending) { URLFetcher::set_factory(NULL); EXPECT_TRUE(auth.HasPendingFetch()); - auth.OnURLFetchComplete(NULL, - client_login_source_, - URLRequestStatus(URLRequestStatus::SUCCESS, 0), - RC_REQUEST_OK, - cookies_, - "SID=sid\nLSID=lsid\nAuth=auth\n"); + auth.OnURLFetchComplete( + NULL, + client_login_source_, + net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0), + RC_REQUEST_OK, + cookies_, + "SID=sid\nLSID=lsid\nAuth=auth\n"); EXPECT_FALSE(auth.HasPendingFetch()); } @@ -427,12 +428,13 @@ TEST_F(GaiaAuthFetcherTest, FullTokenSuccess) { URLFetcher::set_factory(NULL); EXPECT_TRUE(auth.HasPendingFetch()); - auth.OnURLFetchComplete(NULL, - issue_auth_token_source_, - URLRequestStatus(URLRequestStatus::SUCCESS, 0), - RC_REQUEST_OK, - cookies_, - "token"); + auth.OnURLFetchComplete( + NULL, + issue_auth_token_source_, + net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0), + RC_REQUEST_OK, + cookies_, + "token"); EXPECT_FALSE(auth.HasPendingFetch()); } @@ -451,11 +453,12 @@ TEST_F(GaiaAuthFetcherTest, FullTokenFailure) { URLFetcher::set_factory(NULL); EXPECT_TRUE(auth.HasPendingFetch()); - auth.OnURLFetchComplete(NULL, - issue_auth_token_source_, - URLRequestStatus(URLRequestStatus::SUCCESS, 0), - RC_FORBIDDEN, - cookies_, - ""); + auth.OnURLFetchComplete( + NULL, + issue_auth_token_source_, + net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0), + RC_FORBIDDEN, + cookies_, + ""); EXPECT_FALSE(auth.HasPendingFetch()); } diff --git a/chrome/common/net/gaia/gaia_auth_fetcher_unittest.h b/chrome/common/net/gaia/gaia_auth_fetcher_unittest.h index 4676a26..65235b1 100644 --- a/chrome/common/net/gaia/gaia_auth_fetcher_unittest.h +++ b/chrome/common/net/gaia/gaia_auth_fetcher_unittest.h @@ -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. // @@ -32,17 +32,17 @@ class MockFetcher : public URLFetcher { ~MockFetcher() {} void Start() { - URLRequestStatus::Status code; + net::URLRequestStatus::Status code; int http_code; if (success_) { http_code = RC_REQUEST_OK; - code = URLRequestStatus::SUCCESS; + code = net::URLRequestStatus::SUCCESS; } else { http_code = RC_FORBIDDEN; - code = URLRequestStatus::FAILED; + code = net::URLRequestStatus::FAILED; } - URLRequestStatus status(code, 0); + net::URLRequestStatus status(code, 0); delegate()->OnURLFetchComplete(NULL, url_, status, diff --git a/chrome/common/net/test_url_fetcher_factory.cc b/chrome/common/net/test_url_fetcher_factory.cc index 8336dfd..af65eb9 100644 --- a/chrome/common/net/test_url_fetcher_factory.cc +++ b/chrome/common/net/test_url_fetcher_factory.cc @@ -1,8 +1,9 @@ -// 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/common/net/test_url_fetcher_factory.h" + #include <string> #include "base/compiler_specific.h" @@ -67,9 +68,9 @@ class FakeURLFetcher : public URLFetcher { // This is the method which actually calls the delegate that is passed in the // constructor. void RunDelegate() { - URLRequestStatus status; - status.set_status(success_ ? URLRequestStatus::SUCCESS : - URLRequestStatus::FAILED); + net::URLRequestStatus status; + status.set_status(success_ ? net::URLRequestStatus::SUCCESS : + net::URLRequestStatus::FAILED); delegate()->OnURLFetchComplete(this, url_, status, success_ ? 200 : 500, ResponseCookies(), response_data_); } diff --git a/chrome/common/net/url_fetcher.cc b/chrome/common/net/url_fetcher.cc index 4f267af..53487b7 100644 --- a/chrome/common/net/url_fetcher.cc +++ b/chrome/common/net/url_fetcher.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. @@ -91,7 +91,7 @@ class URLFetcher::Core void StartURLRequest(); void StartURLRequestWhenAppropriate(); void CancelURLRequest(); - void OnCompletedURLRequest(const URLRequestStatus& status); + void OnCompletedURLRequest(const net::URLRequestStatus& status); void NotifyMalformedContent(); // Deletes the request, removes it from the registry, and removes the @@ -408,7 +408,8 @@ void URLFetcher::Core::CancelURLRequest() { was_cancelled_ = true; } -void URLFetcher::Core::OnCompletedURLRequest(const URLRequestStatus& status) { +void URLFetcher::Core::OnCompletedURLRequest( + const net::URLRequestStatus& status) { DCHECK(delegate_loop_proxy_->BelongsToCurrentThread()); // Checks the response from server. diff --git a/chrome/common/net/url_fetcher_unittest.cc b/chrome/common/net/url_fetcher_unittest.cc index 1618892..44277e9 100644 --- a/chrome/common/net/url_fetcher_unittest.cc +++ b/chrome/common/net/url_fetcher_unittest.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. @@ -62,7 +62,7 @@ class URLFetcherTest : public testing::Test, public URLFetcher::Delegate { // 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); @@ -108,7 +108,7 @@ class URLFetcherPostTest : public URLFetcherTest { // 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); @@ -120,7 +120,7 @@ class URLFetcherHeadersTest : public URLFetcherTest { // 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); @@ -133,7 +133,7 @@ class URLFetcherProtectTest : public URLFetcherTest { // 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); @@ -149,7 +149,7 @@ class URLFetcherProtectTestPassedThrough : public URLFetcherTest { // 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); @@ -165,7 +165,7 @@ class URLFetcherBadHTTPSTest : public URLFetcherTest { // 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); @@ -181,7 +181,7 @@ class URLFetcherCancelTest : public URLFetcherTest { // 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); @@ -234,7 +234,7 @@ class URLFetcherMultipleAttemptTest : public URLFetcherTest { // 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); @@ -269,7 +269,7 @@ void URLFetcherTest::CreateFetcher(const GURL& url) { void URLFetcherTest::OnURLFetchComplete(const URLFetcher* source, const GURL& url, - const URLRequestStatus& status, + const net::URLRequestStatus& status, int response_code, const ResponseCookies& cookies, const std::string& data) { @@ -297,7 +297,7 @@ void URLFetcherPostTest::CreateFetcher(const GURL& url) { void URLFetcherPostTest::OnURLFetchComplete(const URLFetcher* source, const GURL& url, - const URLRequestStatus& status, + const net::URLRequestStatus& status, int response_code, const ResponseCookies& cookies, const std::string& data) { @@ -309,7 +309,7 @@ void URLFetcherPostTest::OnURLFetchComplete(const URLFetcher* source, void URLFetcherHeadersTest::OnURLFetchComplete( const URLFetcher* source, const GURL& url, - const URLRequestStatus& status, + const net::URLRequestStatus& status, int response_code, const ResponseCookies& cookies, const std::string& data) { @@ -330,12 +330,13 @@ void URLFetcherProtectTest::CreateFetcher(const GURL& url) { fetcher_->Start(); } -void URLFetcherProtectTest::OnURLFetchComplete(const URLFetcher* source, - const GURL& url, - const URLRequestStatus& status, - int response_code, - const ResponseCookies& cookies, - const std::string& data) { +void URLFetcherProtectTest::OnURLFetchComplete( + const URLFetcher* source, + const GURL& url, + const net::URLRequestStatus& status, + int response_code, + const ResponseCookies& cookies, + const std::string& data) { const TimeDelta one_second = TimeDelta::FromMilliseconds(1000); if (response_code >= 500) { // Now running ServerUnavailable test. @@ -374,7 +375,7 @@ void URLFetcherProtectTestPassedThrough::CreateFetcher(const GURL& url) { void URLFetcherProtectTestPassedThrough::OnURLFetchComplete( const URLFetcher* source, const GURL& url, - const URLRequestStatus& status, + const net::URLRequestStatus& status, int response_code, const ResponseCookies& cookies, const std::string& data) { @@ -413,13 +414,13 @@ URLFetcherBadHTTPSTest::URLFetcherBadHTTPSTest() { void URLFetcherBadHTTPSTest::OnURLFetchComplete( const URLFetcher* source, const GURL& url, - const URLRequestStatus& status, + const net::URLRequestStatus& status, int response_code, const ResponseCookies& cookies, const std::string& data) { // This part is different from URLFetcherTest::OnURLFetchComplete // because this test expects the request to be cancelled. - EXPECT_EQ(URLRequestStatus::CANCELED, status.status()); + EXPECT_EQ(net::URLRequestStatus::CANCELED, status.status()); EXPECT_EQ(net::ERR_ABORTED, status.os_error()); EXPECT_EQ(-1, response_code); EXPECT_TRUE(cookies.empty()); @@ -443,12 +444,13 @@ void URLFetcherCancelTest::CreateFetcher(const GURL& url) { CancelRequest(); } -void URLFetcherCancelTest::OnURLFetchComplete(const URLFetcher* source, - const GURL& url, - const URLRequestStatus& status, - int response_code, - const ResponseCookies& cookies, - const std::string& data) { +void URLFetcherCancelTest::OnURLFetchComplete( + const URLFetcher* source, + const GURL& url, + const net::URLRequestStatus& status, + int response_code, + const ResponseCookies& cookies, + const std::string& data) { // We should have cancelled the request before completion. ADD_FAILURE(); delete fetcher_; @@ -465,7 +467,7 @@ void URLFetcherCancelTest::CancelRequest() { void URLFetcherMultipleAttemptTest::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/common/net/url_request_intercept_job.cc b/chrome/common/net/url_request_intercept_job.cc index 641a8e8..89b0c55 100644 --- a/chrome/common/net/url_request_intercept_job.cc +++ b/chrome/common/net/url_request_intercept_job.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. // @@ -91,10 +91,11 @@ bool URLRequestInterceptJob::ReadRawData(net::IOBuffer* dest, int dest_size, if (rv == CPERR_IO_PENDING) { read_buffer_ = dest; read_buffer_size_ = dest_size; - SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); + SetStatus(net::URLRequestStatus(net::URLRequestStatus::IO_PENDING, 0)); } else { // TODO(mpcomplete): better error code - NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, net::ERR_FAILED)); + NotifyDone(net::URLRequestStatus(net::URLRequestStatus::FAILED, + net::ERR_FAILED)); } return false; @@ -208,8 +209,8 @@ void URLRequestInterceptJob::StartAsync() { void URLRequestInterceptJob::OnStartCompleted(int result) { if (result != CPERR_SUCCESS) { - NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, - net::ERR_CONNECTION_FAILED)); + NotifyDone(net::URLRequestStatus(net::URLRequestStatus::FAILED, + net::ERR_CONNECTION_FAILED)); return; } @@ -218,11 +219,12 @@ void URLRequestInterceptJob::OnStartCompleted(int result) { void URLRequestInterceptJob::OnReadCompleted(int bytes_read) { if (bytes_read < 0) { - NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, net::ERR_FAILED)); + NotifyDone(net::URLRequestStatus(net::URLRequestStatus::FAILED, + net::ERR_FAILED)); return; } - SetStatus(URLRequestStatus()); // clear the async flag + SetStatus(net::URLRequestStatus()); // clear the async flag NotifyReadComplete(bytes_read); } diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index 22b0c7f..2af6911 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -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. @@ -354,7 +354,7 @@ IPC_MESSAGE_ROUTED2(ViewMsg_Resource_DataDownloaded, // Sent when the request has been completed. IPC_MESSAGE_ROUTED4(ViewMsg_Resource_RequestComplete, int /* request_id */, - URLRequestStatus /* status */, + net::URLRequestStatus /* status */, std::string /* security info */, base::Time /* completion_time */) diff --git a/chrome/common/resource_dispatcher.cc b/chrome/common/resource_dispatcher.cc index bcb4644..e59a464 100644 --- a/chrome/common/resource_dispatcher.cc +++ b/chrome/common/resource_dispatcher.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. @@ -213,7 +213,7 @@ void IPCResourceLoaderBridge::SetDefersLoading(bool value) { void IPCResourceLoaderBridge::SyncLoad(SyncLoadResponse* response) { if (request_id_ != -1) { NOTREACHED() << "Starting a request twice"; - response->status.set_status(URLRequestStatus::FAILED); + response->status.set_status(net::URLRequestStatus::FAILED); return; } @@ -224,7 +224,7 @@ void IPCResourceLoaderBridge::SyncLoad(SyncLoadResponse* response) { request_, &result); // NOTE: This may pump events (see RenderThread::Send). if (!dispatcher_->message_sender()->Send(msg)) { - response->status.set_status(URLRequestStatus::FAILED); + response->status.set_status(net::URLRequestStatus::FAILED); return; } @@ -428,7 +428,7 @@ void ResourceDispatcher::FollowPendingRedirect( } void ResourceDispatcher::OnRequestComplete(int request_id, - const URLRequestStatus& status, + const net::URLRequestStatus& status, const std::string& security_info, const base::Time& completion_time) { PendingRequestInfo* request_info = GetPendingRequestInfo(request_id); @@ -437,7 +437,7 @@ void ResourceDispatcher::OnRequestComplete(int request_id, webkit_glue::ResourceLoaderBridge::Peer* peer = request_info->peer; - if (status.status() == URLRequestStatus::CANCELED && + if (status.status() == net::URLRequestStatus::CANCELED && status.os_error() != net::ERR_ABORTED) { // Resource canceled with a specific error are filtered. SecurityFilterPeer* new_peer = diff --git a/chrome/common/resource_dispatcher_unittest.cc b/chrome/common/resource_dispatcher_unittest.cc index e5d6dfd..2de1a07 100644 --- a/chrome/common/resource_dispatcher_unittest.cc +++ b/chrome/common/resource_dispatcher_unittest.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. @@ -64,7 +64,7 @@ class TestRequestCallback : public ResourceLoaderBridge::Peer { data_.append(data, len); } - virtual void OnCompletedRequest(const URLRequestStatus& status, + virtual void OnCompletedRequest(const net::URLRequestStatus& status, const std::string& security_info, const base::Time& completion_time) { EXPECT_FALSE(complete_); @@ -231,7 +231,7 @@ class DeferredResourceLoadingTest : public ResourceDispatcherTest, set_defer_loading(true); ResourceResponseHead response_head; - response_head.status.set_status(URLRequestStatus::SUCCESS); + response_head.status.set_status(net::URLRequestStatus::SUCCESS); IPC::Message* response_message = new ViewMsg_Resource_ReceivedResponse(0, 0, response_head); @@ -284,7 +284,7 @@ class DeferredResourceLoadingTest : public ResourceDispatcherTest, set_defer_loading(false); } - virtual void OnCompletedRequest(const URLRequestStatus& status, + virtual void OnCompletedRequest(const net::URLRequestStatus& status, const std::string& security_info, const base::Time& completion_time) { } diff --git a/chrome/common/resource_response.h b/chrome/common/resource_response.h index 058a811..a5284df 100644 --- a/chrome/common/resource_response.h +++ b/chrome/common/resource_response.h @@ -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. @@ -21,7 +21,7 @@ struct ResourceResponseHead : webkit_glue::ResourceResponseInfo { ~ResourceResponseHead(); // The response status. - URLRequestStatus status; + net::URLRequestStatus status; // Whether we should apply a filter to this resource that replaces // localization templates with the appropriate localized strings. This is set diff --git a/chrome/common/security_filter_peer.cc b/chrome/common/security_filter_peer.cc index 3be8864..37db9a7 100644 --- a/chrome/common/security_filter_peer.cc +++ b/chrome/common/security_filter_peer.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. @@ -84,7 +84,7 @@ void SecurityFilterPeer::OnReceivedData(const char* data, int len) { NOTREACHED(); } -void SecurityFilterPeer::OnCompletedRequest(const URLRequestStatus& status, +void SecurityFilterPeer::OnCompletedRequest(const net::URLRequestStatus& status, const std::string& security_info, const base::Time& completion_time) { NOTREACHED(); @@ -143,17 +143,18 @@ void BufferedPeer::OnReceivedData(const char* data, int len) { data_.append(data, len); } -void BufferedPeer::OnCompletedRequest(const URLRequestStatus& status, +void BufferedPeer::OnCompletedRequest(const net::URLRequestStatus& status, const std::string& security_info, const base::Time& completion_time) { // Make sure we delete ourselves at the end of this call. scoped_ptr<BufferedPeer> this_deleter(this); // Give sub-classes a chance at altering the data. - if (status.status() != URLRequestStatus::SUCCESS || !DataReady()) { + if (status.status() != net::URLRequestStatus::SUCCESS || !DataReady()) { // Pretend we failed to load the resource. original_peer_->OnReceivedResponse(response_info_, true); - URLRequestStatus status(URLRequestStatus::CANCELED, net::ERR_ABORTED); + net::URLRequestStatus status(net::URLRequestStatus::CANCELED, + net::ERR_ABORTED); original_peer_->OnCompletedRequest(status, security_info, completion_time); return; } @@ -192,7 +193,7 @@ void ReplaceContentPeer::OnReceivedData(const char* data, int len) { } void ReplaceContentPeer::OnCompletedRequest( - const URLRequestStatus& status, + const net::URLRequestStatus& status, const std::string& security_info, const base::Time& completion_time) { webkit_glue::ResourceResponseInfo info; @@ -203,7 +204,7 @@ void ReplaceContentPeer::OnCompletedRequest( if (!data_.empty()) original_peer_->OnReceivedData(data_.data(), static_cast<int>(data_.size())); - original_peer_->OnCompletedRequest(URLRequestStatus(), + original_peer_->OnCompletedRequest(net::URLRequestStatus(), security_info, completion_time); diff --git a/chrome/plugin/chrome_plugin_host.cc b/chrome/plugin/chrome_plugin_host.cc index 8458e25..690bf05 100644 --- a/chrome/plugin/chrome_plugin_host.cc +++ b/chrome/plugin/chrome_plugin_host.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. @@ -111,7 +111,7 @@ class PluginRequestHandlerProxy } } - virtual void OnCompletedRequest(const URLRequestStatus& status, + virtual void OnCompletedRequest(const net::URLRequestStatus& status, const std::string& security_info, const base::Time& completion_time) { completed_ = true; diff --git a/chrome/renderer/safe_browsing/render_view_fake_resources_test.cc b/chrome/renderer/safe_browsing/render_view_fake_resources_test.cc index bc52ef2..becffd81 100644 --- a/chrome/renderer/safe_browsing/render_view_fake_resources_test.cc +++ b/chrome/renderer/safe_browsing/render_view_fake_resources_test.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. @@ -163,7 +163,7 @@ void RenderViewFakeResourcesTest::OnRequestResource( ASSERT_TRUE(channel_->Send(new ViewMsg_Resource_RequestComplete( message.routing_id(), request_id, - URLRequestStatus(), + net::URLRequestStatus(), std::string(), base::Time()))); } diff --git a/chrome/service/cloud_print/cloud_print_url_fetcher.cc b/chrome/service/cloud_print/cloud_print_url_fetcher.cc index feae6b7..9840e14 100644 --- a/chrome/service/cloud_print/cloud_print_url_fetcher.cc +++ b/chrome/service/cloud_print/cloud_print_url_fetcher.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. @@ -41,7 +41,7 @@ void CloudPrintURLFetcher::StartPostRequest( void CloudPrintURLFetcher::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/service/cloud_print/cloud_print_url_fetcher_unittest.cc b/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc index be3b8aa..53658cd 100644 --- a/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc +++ b/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.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. @@ -78,7 +78,7 @@ class CloudPrintURLFetcherTest : public testing::Test, virtual CloudPrintURLFetcher::ResponseAction HandleRawResponse( const URLFetcher* source, const GURL& url, - const URLRequestStatus& status, + const net::URLRequestStatus& status, int response_code, const ResponseCookies& cookies, const std::string& data); @@ -126,7 +126,7 @@ class CloudPrintURLFetcherBasicTest : public CloudPrintURLFetcherTest { virtual CloudPrintURLFetcher::ResponseAction HandleRawResponse( const URLFetcher* source, const GURL& url, - const URLRequestStatus& status, + const net::URLRequestStatus& status, int response_code, const ResponseCookies& cookies, const std::string& data); @@ -199,7 +199,7 @@ CloudPrintURLFetcher::ResponseAction CloudPrintURLFetcherTest::HandleRawResponse( const URLFetcher* source, const GURL& url, - const URLRequestStatus& status, + const net::URLRequestStatus& status, int response_code, const ResponseCookies& cookies, const std::string& data) { @@ -213,7 +213,7 @@ CloudPrintURLFetcher::ResponseAction CloudPrintURLFetcherBasicTest::HandleRawResponse( 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/test/automation/automation_proxy_uitest.cc b/chrome/test/automation/automation_proxy_uitest.cc index 60830e0..cbf3e13 100644 --- a/chrome/test/automation/automation_proxy_uitest.cc +++ b/chrome/test/automation/automation_proxy_uitest.cc @@ -686,10 +686,10 @@ void ExternalTabUITestMockClient::ReplyData( } void ExternalTabUITestMockClient::ReplyEOF(int tab_handle, int request_id) { - ReplyEnd(URLRequestStatus(), tab_handle, request_id); + ReplyEnd(net::URLRequestStatus(), tab_handle, request_id); } -void ExternalTabUITestMockClient::ReplyEnd(const URLRequestStatus& status, +void ExternalTabUITestMockClient::ReplyEnd(const net::URLRequestStatus& status, int tab_handle, int request_id) { AutomationProxy::Send(new AutomationMsg_RequestEnd(tab_handle, request_id, status)); @@ -729,7 +729,7 @@ void ExternalTabUITestMockClient::IgnoreFavIconNetworkRequest() { .Times(testing::AnyNumber()) .WillRepeatedly(testing::WithArgs<0, 0>(testing::Invoke( CreateFunctor(this, &ExternalTabUITestMockClient::ReplyEnd, - URLRequestStatus(URLRequestStatus::FAILED, 0))))); + net::URLRequestStatus(net::URLRequestStatus::FAILED, 0))))); } void ExternalTabUITestMockClient::InvalidateHandle( diff --git a/chrome/test/live_sync/live_sync_test.cc b/chrome/test/live_sync/live_sync_test.cc index d768b58..e2270fa 100644 --- a/chrome/test/live_sync/live_sync_test.cc +++ b/chrome/test/live_sync/live_sync_test.cc @@ -61,11 +61,11 @@ class SyncServerStatusChecker : public 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) { - running_ = (status.status() == URLRequestStatus::SUCCESS && + running_ = (status.status() == net::URLRequestStatus::SUCCESS && response_code == 200 && data.find("ok") == 0); MessageLoop::current()->Quit(); } 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__ diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc index 586f7dc..e6413429 100644 --- a/net/spdy/spdy_network_transaction_unittest.cc +++ b/net/spdy/spdy_network_transaction_unittest.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. @@ -2252,7 +2252,7 @@ TEST_P(SpdyNetworkTransactionTest, RedirectGetRequest) { MessageLoop::current()->Run(); EXPECT_EQ(1, d.response_started_count()); EXPECT_FALSE(d.received_data_before_response()); - EXPECT_EQ(URLRequestStatus::SUCCESS, r.status().status()); + EXPECT_EQ(net::URLRequestStatus::SUCCESS, r.status().status()); std::string contents("hello!"); EXPECT_EQ(contents, d.data_received()); } @@ -2390,7 +2390,7 @@ TEST_P(SpdyNetworkTransactionTest, RedirectServerPush) { MessageLoop::current()->Run(); EXPECT_EQ(1, d2.response_started_count()); EXPECT_FALSE(d2.received_data_before_response()); - EXPECT_EQ(URLRequestStatus::SUCCESS, r2.status().status()); + EXPECT_EQ(net::URLRequestStatus::SUCCESS, r2.status().status()); std::string contents2("hello!"); EXPECT_EQ(contents2, d2.data_received()); } diff --git a/net/url_request/url_request_job_tracker_unittest.cc b/net/url_request/url_request_job_tracker_unittest.cc index 31818ac..11a5e3b 100644 --- a/net/url_request/url_request_job_tracker_unittest.cc +++ b/net/url_request/url_request_job_tracker_unittest.cc @@ -54,7 +54,7 @@ class MockJobObserver : public net::URLRequestJobTracker::JobObserver { MOCK_METHOD1(OnJobAdded, void(net::URLRequestJob* job)); MOCK_METHOD1(OnJobRemoved, void(net::URLRequestJob* job)); MOCK_METHOD2(OnJobDone, void(net::URLRequestJob* job, - const URLRequestStatus& status)); + const net::URLRequestStatus& status)); MOCK_METHOD3(OnJobRedirect, void(net::URLRequestJob* job, const GURL& location, int status_code)); @@ -94,12 +94,12 @@ class URLRequestJobTrackerTestJob : public net::URLRequestJob { response_data_.erase(0, bytes_to_read); if (async_reads_) { - SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); + SetStatus(net::URLRequestStatus(net::URLRequestStatus::IO_PENDING, 0)); MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( this, &URLRequestJobTrackerTestJob::OnReadCompleted, bytes_to_read)); } else { - SetStatus(URLRequestStatus()); + SetStatus(net::URLRequestStatus()); *bytes_read = bytes_to_read; } return !async_reads_; @@ -107,9 +107,9 @@ class URLRequestJobTrackerTestJob : public net::URLRequestJob { void OnReadCompleted(int status) { if (status == 0) { - NotifyDone(URLRequestStatus()); + NotifyDone(net::URLRequestStatus()); } else if (status > 0) { - SetStatus(URLRequestStatus()); + SetStatus(net::URLRequestStatus()); } else { ASSERT_FALSE(true) << "Unexpected OnReadCompleted callback."; } @@ -136,7 +136,7 @@ class URLRequestJobTrackerTestJob : public net::URLRequestJob { const bool async_reads_; }; -// Google Mock Matcher to check two URLRequestStatus instances for +// Google Mock Matcher to check two net::URLRequestStatus instances for // equality. MATCHER_P(StatusEq, other, "") { return (arg.status() == other.status() && @@ -172,7 +172,8 @@ class URLRequestJobTrackerTest : public PlatformTest { EXPECT_CALL(observer, OnBytesRead(NotNull(), MemEq(body.data(), body.size()), Eq(static_cast<int>(body.size())))); - EXPECT_CALL(observer, OnJobDone(NotNull(), StatusEq(URLRequestStatus()))); + EXPECT_CALL(observer, OnJobDone(NotNull(), + StatusEq(net::URLRequestStatus()))); EXPECT_CALL(observer, OnJobRemoved(NotNull())); // Attach our observer and perform the resource fetch. diff --git a/net/url_request/url_request_status.h b/net/url_request/url_request_status.h index 332e7e9..1c50cc3 100644 --- a/net/url_request/url_request_status.h +++ b/net/url_request/url_request_status.h @@ -68,7 +68,4 @@ class URLRequestStatus { } // namespace net -// TODO(tfarina): Fix the callers and remove this! -typedef net::URLRequestStatus URLRequestStatus; - #endif // NET_URL_REQUEST_URL_REQUEST_STATUS_H_ diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc index 11a313b..8d57e1e 100644 --- a/net/url_request/url_request_unittest.cc +++ b/net/url_request/url_request_unittest.cc @@ -197,7 +197,7 @@ TEST_F(URLRequestTestHTTP, ProxyTunnelRedirectTest) { MessageLoop::current()->Run(); - EXPECT_EQ(URLRequestStatus::FAILED, r.status().status()); + EXPECT_EQ(net::URLRequestStatus::FAILED, r.status().status()); EXPECT_EQ(net::ERR_TUNNEL_CONNECTION_FAILED, r.status().os_error()); EXPECT_EQ(1, d.response_started_count()); // We should not have followed the redirect. @@ -222,7 +222,7 @@ TEST_F(URLRequestTestHTTP, UnexpectedServerAuthTest) { MessageLoop::current()->Run(); - EXPECT_EQ(URLRequestStatus::FAILED, r.status().status()); + EXPECT_EQ(net::URLRequestStatus::FAILED, r.status().status()); EXPECT_EQ(net::ERR_TUNNEL_CONNECTION_FAILED, r.status().os_error()); } } @@ -475,7 +475,7 @@ TEST_F(URLRequestTestHTTP, CancelTest2) { EXPECT_EQ(1, d.response_started_count()); EXPECT_EQ(0, d.bytes_received()); EXPECT_FALSE(d.received_data_before_response()); - EXPECT_EQ(URLRequestStatus::CANCELED, r.status().status()); + EXPECT_EQ(net::URLRequestStatus::CANCELED, r.status().status()); } } @@ -499,7 +499,7 @@ TEST_F(URLRequestTestHTTP, CancelTest3) { // or it could have been all the bytes. // EXPECT_EQ(0, d.bytes_received()); EXPECT_FALSE(d.received_data_before_response()); - EXPECT_EQ(URLRequestStatus::CANCELED, r.status().status()); + EXPECT_EQ(net::URLRequestStatus::CANCELED, r.status().status()); } } @@ -540,7 +540,7 @@ TEST_F(URLRequestTestHTTP, CancelTest5) { r.set_context(context); r.Start(); MessageLoop::current()->Run(); - EXPECT_EQ(URLRequestStatus::SUCCESS, r.status().status()); + EXPECT_EQ(net::URLRequestStatus::SUCCESS, r.status().status()); } // cancel read from cache (see bug 990242) @@ -552,7 +552,7 @@ TEST_F(URLRequestTestHTTP, CancelTest5) { r.Cancel(); MessageLoop::current()->Run(); - EXPECT_EQ(URLRequestStatus::CANCELED, r.status().status()); + EXPECT_EQ(net::URLRequestStatus::CANCELED, r.status().status()); EXPECT_EQ(1, d.response_started_count()); EXPECT_EQ(0, d.bytes_received()); EXPECT_FALSE(d.received_data_before_response()); @@ -1031,7 +1031,7 @@ TEST_F(URLRequestTestHTTP, RestrictRedirects) { req.Start(); MessageLoop::current()->Run(); - EXPECT_EQ(URLRequestStatus::FAILED, req.status().status()); + EXPECT_EQ(net::URLRequestStatus::FAILED, req.status().status()); EXPECT_EQ(net::ERR_UNSAFE_REDIRECT, req.status().os_error()); } @@ -1044,7 +1044,7 @@ TEST_F(URLRequestTestHTTP, RedirectToInvalidURL) { req.Start(); MessageLoop::current()->Run(); - EXPECT_EQ(URLRequestStatus::FAILED, req.status().status()); + EXPECT_EQ(net::URLRequestStatus::FAILED, req.status().status()); EXPECT_EQ(net::ERR_INVALID_URL, req.status().os_error()); } @@ -1075,7 +1075,7 @@ TEST_F(URLRequestTestHTTP, CancelRedirect) { EXPECT_EQ(1, d.response_started_count()); EXPECT_EQ(0, d.bytes_received()); EXPECT_FALSE(d.received_data_before_response()); - EXPECT_EQ(URLRequestStatus::CANCELED, req.status().status()); + EXPECT_EQ(net::URLRequestStatus::CANCELED, req.status().status()); } } @@ -1097,7 +1097,7 @@ TEST_F(URLRequestTestHTTP, DeferredRedirect) { EXPECT_EQ(1, d.response_started_count()); EXPECT_FALSE(d.received_data_before_response()); - EXPECT_EQ(URLRequestStatus::SUCCESS, req.status().status()); + EXPECT_EQ(net::URLRequestStatus::SUCCESS, req.status().status()); FilePath path; PathService::Get(base::DIR_SOURCE_ROOT, &path); @@ -1131,7 +1131,7 @@ TEST_F(URLRequestTestHTTP, CancelDeferredRedirect) { EXPECT_EQ(1, d.response_started_count()); EXPECT_EQ(0, d.bytes_received()); EXPECT_FALSE(d.received_data_before_response()); - EXPECT_EQ(URLRequestStatus::CANCELED, req.status().status()); + EXPECT_EQ(net::URLRequestStatus::CANCELED, req.status().status()); } } @@ -1678,7 +1678,7 @@ TEST_F(URLRequestTest, CancelTest_During_OnGetCookies) { MessageLoop::current()->Run(); - EXPECT_EQ(URLRequestStatus::CANCELED, req.status().status()); + EXPECT_EQ(net::URLRequestStatus::CANCELED, req.status().status()); EXPECT_EQ(1, d.blocked_get_cookies_count()); EXPECT_EQ(0, d.blocked_set_cookie_count()); @@ -1707,7 +1707,7 @@ TEST_F(URLRequestTest, CancelTest_During_OnSetCookie) { MessageLoop::current()->Run(); - EXPECT_EQ(URLRequestStatus::CANCELED, req.status().status()); + EXPECT_EQ(net::URLRequestStatus::CANCELED, req.status().status()); // Even though the response will contain 3 set-cookie headers, we expect // only one to be blocked as that first one will cause OnSetCookie to be @@ -2192,7 +2192,7 @@ TEST_F(URLRequestTest, InterceptRespectsCancelMain) { // Check we see a canceled request EXPECT_FALSE(req.status().is_success()); - EXPECT_EQ(URLRequestStatus::CANCELED, req.status().status()); + EXPECT_EQ(net::URLRequestStatus::CANCELED, req.status().status()); } TEST_F(URLRequestTest, InterceptRespectsCancelRedirect) { @@ -2224,7 +2224,7 @@ TEST_F(URLRequestTest, InterceptRespectsCancelRedirect) { // Check we see a canceled request EXPECT_FALSE(req.status().is_success()); - EXPECT_EQ(URLRequestStatus::CANCELED, req.status().status()); + EXPECT_EQ(net::URLRequestStatus::CANCELED, req.status().status()); } TEST_F(URLRequestTest, InterceptRespectsCancelFinal) { @@ -2248,7 +2248,7 @@ TEST_F(URLRequestTest, InterceptRespectsCancelFinal) { // Check we see a canceled request EXPECT_FALSE(req.status().is_success()); - EXPECT_EQ(URLRequestStatus::CANCELED, req.status().status()); + EXPECT_EQ(net::URLRequestStatus::CANCELED, req.status().status()); } TEST_F(URLRequestTest, InterceptRespectsCancelInRestart) { @@ -2274,7 +2274,7 @@ TEST_F(URLRequestTest, InterceptRespectsCancelInRestart) { // Check we see a canceled request EXPECT_FALSE(req.status().is_success()); - EXPECT_EQ(URLRequestStatus::CANCELED, req.status().status()); + EXPECT_EQ(net::URLRequestStatus::CANCELED, req.status().status()); } class URLRequestTestFTP : public URLRequestTest { diff --git a/net/url_request/url_request_unittest.h b/net/url_request/url_request_unittest.h index c336b41..043ee87 100644 --- a/net/url_request/url_request_unittest.h +++ b/net/url_request/url_request_unittest.h @@ -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. @@ -238,8 +238,8 @@ class TestDelegate : public net::URLRequest::Delegate { request->Cancel(); OnResponseCompleted(request); } else if (!request->status().is_success()) { - DCHECK(request->status().status() == URLRequestStatus::FAILED || - request->status().status() == URLRequestStatus::CANCELED); + DCHECK(request->status().status() == net::URLRequestStatus::FAILED || + request->status().status() == net::URLRequestStatus::CANCELED); request_failed_ = true; OnResponseCompleted(request); } else { diff --git a/webkit/appcache/appcache_request_handler.cc b/webkit/appcache/appcache_request_handler.cc index 72e6beb..a514517 100644 --- a/webkit/appcache/appcache_request_handler.cc +++ b/webkit/appcache/appcache_request_handler.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. @@ -121,8 +121,8 @@ AppCacheURLRequestJob* AppCacheRequestHandler::MaybeLoadFallbackForResponse( if (!found_fallback_entry_.has_response_id()) return NULL; - if (request->status().status() == URLRequestStatus::CANCELED || - request->status().status() == URLRequestStatus::HANDLED_EXTERNALLY) { + if (request->status().status() == net::URLRequestStatus::CANCELED || + request->status().status() == net::URLRequestStatus::HANDLED_EXTERNALLY) { // 6.9.6, step 4: But not if the user canceled the download. return NULL; } diff --git a/webkit/appcache/appcache_url_request_job.cc b/webkit/appcache/appcache_url_request_job.cc index 10245f7..205458f 100644 --- a/webkit/appcache/appcache_url_request_job.cc +++ b/webkit/appcache/appcache_url_request_job.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. @@ -94,8 +94,8 @@ void AppCacheURLRequestJob::BeginDelivery() { case ERROR_DELIVERY: request()->net_log().AddEvent( net::NetLog::TYPE_APPCACHE_DELIVERING_ERROR_RESPONSE, NULL); - NotifyStartError( - URLRequestStatus(URLRequestStatus::FAILED, net::ERR_FAILED)); + NotifyStartError(net::URLRequestStatus(net::URLRequestStatus::FAILED, + net::ERR_FAILED)); break; case APPCACHED_DELIVERY: @@ -188,11 +188,11 @@ void AppCacheURLRequestJob::SetupRangeResponse() { void AppCacheURLRequestJob::OnReadComplete(int result) { DCHECK(is_delivering_appcache_response()); if (result == 0) - NotifyDone(URLRequestStatus()); + NotifyDone(net::URLRequestStatus()); else if (result < 0) - NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, result)); + NotifyDone(net::URLRequestStatus(net::URLRequestStatus::FAILED, result)); else - SetStatus(URLRequestStatus()); // Clear the IO_PENDING status + SetStatus(net::URLRequestStatus()); // Clear the IO_PENDING status NotifyReadComplete(result); } @@ -267,7 +267,7 @@ bool AppCacheURLRequestJob::ReadRawData(net::IOBuffer* buf, int buf_size, DCHECK(bytes_read); DCHECK(!reader_->IsReadPending()); reader_->ReadData(buf, buf_size, &read_callback_); - SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); + SetStatus(net::URLRequestStatus(net::URLRequestStatus::IO_PENDING, 0)); return false; } diff --git a/webkit/appcache/appcache_url_request_job_unittest.cc b/webkit/appcache/appcache_url_request_job_unittest.cc index a83fd10b..e1772c3 100644 --- a/webkit/appcache/appcache_url_request_job_unittest.cc +++ b/webkit/appcache/appcache_url_request_job_unittest.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. @@ -711,7 +711,7 @@ class AppCacheURLRequestJobTest : public testing::Test { } void VerifyCancel() { - EXPECT_EQ(URLRequestStatus::CANCELED, + EXPECT_EQ(net::URLRequestStatus::CANCELED, request_->status().status()); TestFinished(); } diff --git a/webkit/blob/blob_url_request_job.cc b/webkit/blob/blob_url_request_job.cc index 4fb5611..9f78e66 100644 --- a/webkit/blob/blob_url_request_job.cc +++ b/webkit/blob/blob_url_request_job.cc @@ -1,4 +1,4 @@ -// Copyright (c) 20010 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. @@ -337,7 +337,7 @@ bool BlobURLRequestJob::ReadFile(const BlobData::Item& item, // If I/O pending error is returned, we just need to wait. if (rv == net::ERR_IO_PENDING) { - SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); + SetStatus(net::URLRequestStatus(net::URLRequestStatus::IO_PENDING, 0)); return false; } @@ -357,7 +357,7 @@ void BlobURLRequestJob::DidRead(int result) { NotifyFailure(net::ERR_FAILED); return; } - SetStatus(URLRequestStatus()); // Clear the IO_PENDING status + SetStatus(net::URLRequestStatus()); // Clear the IO_PENDING status AdvanceBytesRead(result); @@ -466,7 +466,8 @@ void BlobURLRequestJob::NotifyFailure(int error_code) { // If we already return the headers on success, we can't change the headers // now. Instead, we just error out. if (headers_set_) { - NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, error_code)); + NotifyDone(net::URLRequestStatus(net::URLRequestStatus::FAILED, + error_code)); return; } diff --git a/webkit/glue/resource_loader_bridge.h b/webkit/glue/resource_loader_bridge.h index 85facfa..23ebb35 100644 --- a/webkit/glue/resource_loader_bridge.h +++ b/webkit/glue/resource_loader_bridge.h @@ -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. // @@ -248,7 +248,7 @@ class ResourceLoaderBridge { ~SyncLoadResponse(); // The response status. - URLRequestStatus status; + net::URLRequestStatus status; // The final URL of the response. This may differ from the request URL in // the case of a server redirect. diff --git a/webkit/glue/weburlloader_impl.cc b/webkit/glue/weburlloader_impl.cc index 0372567..a99e6be 100644 --- a/webkit/glue/weburlloader_impl.cc +++ b/webkit/glue/weburlloader_impl.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. @@ -146,11 +146,12 @@ ResourceType::Type FromTargetType(WebURLRequest::TargetType type) { // Extracts the information from a data: url. bool GetInfoFromDataURL(const GURL& url, ResourceResponseInfo* info, - std::string* data, URLRequestStatus* status) { + std::string* data, + net::URLRequestStatus* status) { std::string mime_type; std::string charset; if (net::DataURL::Parse(url, &mime_type, &charset, data)) { - *status = URLRequestStatus(URLRequestStatus::SUCCESS, 0); + *status = net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0); info->request_time = Time::Now(); info->response_time = Time::Now(); info->headers = NULL; @@ -162,7 +163,8 @@ bool GetInfoFromDataURL(const GURL& url, return true; } - *status = URLRequestStatus(URLRequestStatus::FAILED, net::ERR_INVALID_URL); + *status = net::URLRequestStatus(net::URLRequestStatus::FAILED, + net::ERR_INVALID_URL); return false; } @@ -294,10 +296,9 @@ class WebURLLoaderImpl::Context : public base::RefCounted<Context>, virtual void OnDownloadedData(int len); virtual void OnReceivedData(const char* data, int len); virtual void OnReceivedCachedMetadata(const char* data, int len); - virtual void OnCompletedRequest( - const URLRequestStatus& status, - const std::string& security_info, - const base::Time& completion_time); + virtual void OnCompletedRequest(const net::URLRequestStatus& status, + const std::string& security_info, + const base::Time& completion_time); private: friend class base::RefCounted<Context>; @@ -621,7 +622,7 @@ void WebURLLoaderImpl::Context::OnReceivedCachedMetadata( } void WebURLLoaderImpl::Context::OnCompletedRequest( - const URLRequestStatus& status, + const net::URLRequestStatus& status, const std::string& security_info, const base::Time& completion_time) { if (ftp_listing_delegate_.get()) { @@ -638,9 +639,9 @@ void WebURLLoaderImpl::Context::OnCompletedRequest( completed_bridge_.swap(bridge_); if (client_) { - if (status.status() != URLRequestStatus::SUCCESS) { + if (status.status() != net::URLRequestStatus::SUCCESS) { int error_code; - if (status.status() == URLRequestStatus::HANDLED_EXTERNALLY) { + if (status.status() == net::URLRequestStatus::HANDLED_EXTERNALLY) { // By marking this request as aborted we insure that we don't navigate // to an error page. error_code = net::ERR_ABORTED; @@ -691,7 +692,7 @@ bool WebURLLoaderImpl::Context::CanHandleDataURL(const GURL& url) const { void WebURLLoaderImpl::Context::HandleDataURL() { ResourceResponseInfo info; - URLRequestStatus status; + net::URLRequestStatus status; std::string data; if (GetInfoFromDataURL(request_.url(), &info, &data, &status)) { @@ -724,9 +725,10 @@ void WebURLLoaderImpl::loadSynchronously(const WebURLRequest& request, // TODO(tc): For file loads, we may want to include a more descriptive // status code or status text. - const URLRequestStatus::Status& status = sync_load_response.status.status(); - if (status != URLRequestStatus::SUCCESS && - status != URLRequestStatus::HANDLED_EXTERNALLY) { + const net::URLRequestStatus::Status& status = + sync_load_response.status.status(); + if (status != net::URLRequestStatus::SUCCESS && + status != net::URLRequestStatus::HANDLED_EXTERNALLY) { response.setURL(final_url); error.domain = WebString::fromUTF8(net::kErrorDomain); error.reason = sync_load_response.status.os_error(); diff --git a/webkit/tools/test_shell/simple_resource_loader_bridge.cc b/webkit/tools/test_shell/simple_resource_loader_bridge.cc index e0348ff..f2c4658 100644 --- a/webkit/tools/test_shell/simple_resource_loader_bridge.cc +++ b/webkit/tools/test_shell/simple_resource_loader_bridge.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. // @@ -291,7 +291,7 @@ class RequestProxy : public net::URLRequest::Delegate, peer_->OnDownloadedData(bytes_read); } - void NotifyCompletedRequest(const URLRequestStatus& status, + void NotifyCompletedRequest(const net::URLRequestStatus& status, const std::string& security_info, const base::Time& complete_time) { if (peer_) { @@ -423,7 +423,7 @@ class RequestProxy : public net::URLRequest::Delegate, this, &RequestProxy::NotifyReceivedData, bytes_read)); } - virtual void OnCompletedRequest(const URLRequestStatus& status, + virtual void OnCompletedRequest(const net::URLRequestStatus& status, const std::string& security_info, const base::Time& complete_time) { if (download_to_file_) @@ -611,7 +611,7 @@ class SyncRequestProxy : public RequestProxy { AsyncReadData(); // read more (may recurse) } - virtual void OnCompletedRequest(const URLRequestStatus& status, + virtual void OnCompletedRequest(const net::URLRequestStatus& status, const std::string& security_info, const base::Time& complete_time) { if (download_to_file_) |