Chromium Code Reviews| Index: sky/viewer/platform/weburlloader_impl.cc |
| diff --git a/sky/viewer/platform/weburlloader_impl.cc b/sky/viewer/platform/weburlloader_impl.cc |
| index 7dd9b0c456e08e440da45424acf38129f65cdc29..a6ce63d1cfd6c8821f356f267e97a16f6a955640 100644 |
| --- a/sky/viewer/platform/weburlloader_impl.cc |
| +++ b/sky/viewer/platform/weburlloader_impl.cc |
| @@ -10,7 +10,6 @@ |
| #include "base/thread_task_runner_handle.h" |
| #include "mojo/common/common_type_converters.h" |
| #include "mojo/services/network/public/interfaces/network_service.mojom.h" |
| -#include "net/base/net_errors.h" |
| #include "sky/engine/public/platform/WebURLError.h" |
| #include "sky/engine/public/platform/WebURLLoadTiming.h" |
| #include "sky/engine/public/platform/WebURLLoaderClient.h" |
| @@ -20,6 +19,13 @@ |
| namespace sky { |
| namespace { |
| +// This corresponds to ERR_ABORTED in net/base/net_error_list.h. |
| +// TODO(ppi): declare an enum in the network service mojom so that the clients |
| +// don't need to hard-code these values. |
| +const int32_t kNetErrorAborted = -3; |
| + |
| +const char kErrorDomain[] = "net"; |
|
abarth-chromium
2015/02/17 17:58:50
Can we declare these values in a header that's sha
ppi
2015/02/17 18:08:02
Done.
|
| + |
| static blink::WebURLResponse::HTTPVersion StatusLineToHTTPVersion( |
| const mojo::String& status_line) { |
| if (status_line.is_null()) |
| @@ -97,7 +103,7 @@ void WebURLLoaderImpl::cancel() { |
| mojo::URLResponsePtr failed_response(mojo::URLResponse::New()); |
| failed_response->url = mojo::String::From(url_); |
| failed_response->error = mojo::NetworkError::New(); |
| - failed_response->error->code = net::ERR_ABORTED; |
| + failed_response->error->code = kNetErrorAborted; |
| base::ThreadTaskRunnerHandle::Get()->PostTask( |
| FROM_HERE, |
| @@ -129,12 +135,12 @@ void WebURLLoaderImpl::OnReceivedResponse(mojo::URLResponsePtr url_response) { |
| void WebURLLoaderImpl::OnReceivedError(mojo::URLResponsePtr url_response) { |
| blink::WebURLError web_error; |
| - web_error.domain = blink::WebString::fromUTF8(net::kErrorDomain); |
| + web_error.domain = blink::WebString::fromUTF8(kErrorDomain); |
| web_error.reason = url_response->error->code; |
| web_error.unreachableURL = GURL(url_response->url); |
| web_error.staleCopyInCache = false; |
| web_error.isCancellation = |
| - url_response->error->code == net::ERR_ABORTED ? true : false; |
| + url_response->error->code == kNetErrorAborted ? true : false; |
| client_->didFail(this, web_error); |
| } |