summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--content/browser/renderer_host/buffered_resource_handler.cc4
-rw-r--r--content/browser/renderer_host/resource_dispatcher_host_impl.cc10
-rw-r--r--net/url_request/url_request.cc4
-rw-r--r--net/url_request/url_request.h4
-rw-r--r--webkit/appcache/appcache_update_job_unittest.cc8
5 files changed, 14 insertions, 16 deletions
diff --git a/content/browser/renderer_host/buffered_resource_handler.cc b/content/browser/renderer_host/buffered_resource_handler.cc
index 1645ffe..3cfbbba 100644
--- a/content/browser/renderer_host/buffered_resource_handler.cc
+++ b/content/browser/renderer_host/buffered_resource_handler.cc
@@ -277,7 +277,7 @@ bool BufferedResourceHandler::CompleteResponseStarted(int request_id) {
// certificate.
// TODO(abarth): We should abstract the response_code test, but this kind
// of check is scattered throughout our codebase.
- request_->SimulateError(net::ERR_FILE_NOT_FOUND);
+ request_->CancelWithError(net::ERR_FILE_NOT_FOUND);
return false;
}
@@ -300,7 +300,7 @@ bool BufferedResourceHandler::CompleteResponseStarted(int request_id) {
// own error page instead of triggering a download.
// TODO(abarth): We should abstract the response_code test, but this kind
// of check is scattered throughout our codebase.
- request_->SimulateError(net::ERR_FILE_NOT_FOUND);
+ request_->CancelWithError(net::ERR_FILE_NOT_FOUND);
return false;
}
diff --git a/content/browser/renderer_host/resource_dispatcher_host_impl.cc b/content/browser/renderer_host/resource_dispatcher_host_impl.cc
index f25227b7..9aeadc7 100644
--- a/content/browser/renderer_host/resource_dispatcher_host_impl.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host_impl.cc
@@ -1684,9 +1684,9 @@ void ResourceDispatcherHostImpl::BeginRequestInternal(
// If enqueing/starting this request will exceed our per-process memory
// bound, abort it right away.
if (memory_cost > max_outstanding_requests_cost_per_process_) {
- // We call "SimulateError()" as a way of setting the net::URLRequest's
+ // We call "CancelWithError()" as a way of setting the net::URLRequest's
// status -- it has no effect beyond this, since the request hasn't started.
- request->SimulateError(net::ERR_INSUFFICIENT_RESOURCES);
+ request->CancelWithError(net::ERR_INSUFFICIENT_RESOURCES);
// TODO(eroman): this is kinda funky -- we insert the unstarted request into
// |pending_requests_| simply to please ResponseCompleted().
@@ -1969,12 +1969,10 @@ void ResourceDispatcherHostImpl::CancelSSLRequest(
if (!request || !request->is_pending())
return;
DVLOG(1) << "CancelSSLRequest() url: " << request->url().spec();
- // TODO(toyoshim): Following method names SimulateSSLError() and
- // SimulateError() looks inconsistent with other Cancel methods.
if (ssl_info)
- request->SimulateSSLError(error, *ssl_info);
+ request->CancelWithSSLError(error, *ssl_info);
else
- request->SimulateError(error);
+ request->CancelWithError(error);
}
void ResourceDispatcherHostImpl::ContinueSSLRequest(
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index ba7870f..63138af 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -483,11 +483,11 @@ void URLRequest::Cancel() {
DoCancel(ERR_ABORTED, SSLInfo());
}
-void URLRequest::SimulateError(int error) {
+void URLRequest::CancelWithError(int error) {
DoCancel(error, SSLInfo());
}
-void URLRequest::SimulateSSLError(int error, const SSLInfo& ssl_info) {
+void URLRequest::CancelWithSSLError(int error, const SSLInfo& ssl_info) {
// This should only be called on a started request.
if (!is_pending_ || !job_ || job_->has_response_started()) {
NOTREACHED();
diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h
index c02c7a3..92d5c22 100644
--- a/net/url_request/url_request.h
+++ b/net/url_request/url_request.h
@@ -504,13 +504,13 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe),
// Cancels the request and sets the error to |error| (see net_error_list.h
// for values).
- void SimulateError(int error);
+ void CancelWithError(int error);
// Cancels the request and sets the error to |error| (see net_error_list.h
// for values) and attaches |ssl_info| as the SSLInfo for that request. This
// is useful to attach a certificate and certificate error to a canceled
// request.
- void SimulateSSLError(int error, const SSLInfo& ssl_info);
+ void CancelWithSSLError(int error, const SSLInfo& ssl_info);
// Read initiates an asynchronous read from the response, and must only
// be called after the OnResponseStarted callback is received with a
diff --git a/webkit/appcache/appcache_update_job_unittest.cc b/webkit/appcache/appcache_update_job_unittest.cc
index 1d6a4ec..3bb3f03b 100644
--- a/webkit/appcache/appcache_update_job_unittest.cc
+++ b/webkit/appcache/appcache_update_job_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -703,7 +703,7 @@ class AppCacheUpdateJobTest : public testing::Test,
update->StartUpdate(host, GURL());
EXPECT_TRUE(update->manifest_fetcher_ != NULL);
- update->manifest_fetcher_->request()->SimulateError(-100);
+ update->manifest_fetcher_->request()->CancelWithError(-100);
// Set up checks for when update job finishes.
do_checks_after_update_finished_ = true;
@@ -735,7 +735,7 @@ class AppCacheUpdateJobTest : public testing::Test,
update->StartUpdate(NULL, GURL());
EXPECT_TRUE(update->manifest_fetcher_ != NULL);
- update->manifest_fetcher_->request()->SimulateError(-100);
+ update->manifest_fetcher_->request()->CancelWithError(-100);
// Set up checks for when update job finishes.
do_checks_after_update_finished_ = true;
@@ -1910,7 +1910,7 @@ class AppCacheUpdateJobTest : public testing::Test,
update->StartUpdate(host, host->new_master_entry_url_);
EXPECT_TRUE(update->manifest_fetcher_ != NULL);
- update->manifest_fetcher_->request()->SimulateError(-100);
+ update->manifest_fetcher_->request()->CancelWithError(-100);
// Set up checks for when update job finishes.
do_checks_after_update_finished_ = true;