Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Unified Diff: webkit/glue/weburlloader_impl.cc

Issue 10640019: Remove the HANDLED_EXTERNALLY status code. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase + fix nits Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/resource_loader_bridge.h ('k') | webkit/tools/test_shell/simple_resource_loader_bridge.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/weburlloader_impl.cc
diff --git a/webkit/glue/weburlloader_impl.cc b/webkit/glue/weburlloader_impl.cc
index cb4793c924030620a9ee4e9b084f3c84b8a198c8..7606719300443d4b6f5581a7bdd22f14259c4e5b 100644
--- a/webkit/glue/weburlloader_impl.cc
+++ b/webkit/glue/weburlloader_impl.cc
@@ -123,11 +123,11 @@ class HeaderFlattener : public WebHTTPHeaderVisitor {
bool GetInfoFromDataURL(const GURL& url,
ResourceResponseInfo* info,
std::string* data,
- net::URLRequestStatus* status) {
+ int* error_code) {
std::string mime_type;
std::string charset;
if (net::DataURL::Parse(url, &mime_type, &charset, data)) {
- *status = net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0);
+ *error_code = net::OK;
// Assure same time for all time fields of data: URLs.
Time now = Time::Now();
info->load_timing.base_time = now;
@@ -144,8 +144,7 @@ bool GetInfoFromDataURL(const GURL& url,
return true;
}
- *status = net::URLRequestStatus(net::URLRequestStatus::FAILED,
- net::ERR_INVALID_URL);
+ *error_code = net::ERR_INVALID_URL;
return false;
}
@@ -299,7 +298,8 @@ class WebURLLoaderImpl::Context : public base::RefCounted<Context>,
int data_length,
int encoded_data_length);
virtual void OnReceivedCachedMetadata(const char* data, int len);
- virtual void OnCompletedRequest(const net::URLRequestStatus& status,
+ virtual void OnCompletedRequest(int error_code,
+ bool was_ignored_by_handler,
const std::string& security_info,
const base::TimeTicks& completion_time);
@@ -364,7 +364,7 @@ void WebURLLoaderImpl::Context::Start(
std::string data;
GetInfoFromDataURL(sync_load_response->url, sync_load_response,
&sync_load_response->data,
- &sync_load_response->status);
+ &sync_load_response->error_code);
} else {
AddRef(); // Balanced in OnCompletedRequest
MessageLoop::current()->PostTask(FROM_HERE,
@@ -637,7 +637,8 @@ void WebURLLoaderImpl::Context::OnReceivedCachedMetadata(
}
void WebURLLoaderImpl::Context::OnCompletedRequest(
- const net::URLRequestStatus& status,
+ int error_code,
+ bool was_ignored_by_handler,
const std::string& security_info,
const base::TimeTicks& completion_time) {
if (ftp_listing_delegate_.get()) {
@@ -654,15 +655,7 @@ void WebURLLoaderImpl::Context::OnCompletedRequest(
completed_bridge_.swap(bridge_);
if (client_) {
- if (status.status() != net::URLRequestStatus::SUCCESS) {
- int error_code;
- 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;
- } else {
- error_code = status.error();
- }
+ if (error_code != net::OK) {
WebURLError error;
if (error_code == net::ERR_ABORTED) {
error.isCancellation = true;
@@ -718,16 +711,17 @@ bool WebURLLoaderImpl::Context::CanHandleDataURL(const GURL& url) const {
void WebURLLoaderImpl::Context::HandleDataURL() {
ResourceResponseInfo info;
- net::URLRequestStatus status;
+ int error_code;
std::string data;
- if (GetInfoFromDataURL(request_.url(), &info, &data, &status)) {
+ if (GetInfoFromDataURL(request_.url(), &info, &data, &error_code)) {
OnReceivedResponse(info);
if (!data.empty())
OnReceivedData(data.data(), data.size(), 0);
}
- OnCompletedRequest(status, info.security_info, base::TimeTicks::Now());
+ OnCompletedRequest(error_code, false, info.security_info,
+ base::TimeTicks::Now());
}
// WebURLLoaderImpl -----------------------------------------------------------
@@ -752,13 +746,11 @@ 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 net::URLRequestStatus::Status& status =
- sync_load_response.status.status();
- if (status != net::URLRequestStatus::SUCCESS &&
- status != net::URLRequestStatus::HANDLED_EXTERNALLY) {
+ int error_code = sync_load_response.error_code;
+ if (error_code != net::OK) {
response.setURL(final_url);
error.domain = WebString::fromUTF8(net::kErrorDomain);
- error.reason = sync_load_response.status.error();
+ error.reason = error_code;
error.unreachableURL = final_url;
return;
}
« no previous file with comments | « webkit/glue/resource_loader_bridge.h ('k') | webkit/tools/test_shell/simple_resource_loader_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698