Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. | 5 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. |
| 6 | 6 |
| 7 #include "webkit/glue/weburlloader_impl.h" | 7 #include "webkit/glue/weburlloader_impl.h" |
| 8 | 8 |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 647 if (status.status() != net::URLRequestStatus::SUCCESS) { | 647 if (status.status() != net::URLRequestStatus::SUCCESS) { |
| 648 int error_code; | 648 int error_code; |
| 649 if (status.status() == net::URLRequestStatus::HANDLED_EXTERNALLY) { | 649 if (status.status() == net::URLRequestStatus::HANDLED_EXTERNALLY) { |
| 650 // By marking this request as aborted we insure that we don't navigate | 650 // By marking this request as aborted we insure that we don't navigate |
| 651 // to an error page. | 651 // to an error page. |
| 652 error_code = net::ERR_ABORTED; | 652 error_code = net::ERR_ABORTED; |
| 653 } else { | 653 } else { |
| 654 error_code = status.os_error(); | 654 error_code = status.os_error(); |
| 655 } | 655 } |
| 656 WebURLError error; | 656 WebURLError error; |
| 657 if (status.status() == net::URLRequestStatus::CANCELED) | |
| 658 error.isCanceling = true; | |
|
darin (slow to review)
2011/06/15 16:35:03
The net error code ERR_ABORTED is ordinarily used
darin (slow to review)
2011/06/15 16:48:44
OK... after some more coffee, I now understand wha
| |
| 657 error.domain = WebString::fromUTF8(net::kErrorDomain); | 659 error.domain = WebString::fromUTF8(net::kErrorDomain); |
| 658 error.reason = error_code; | 660 error.reason = error_code; |
| 659 error.unreachableURL = request_.url(); | 661 error.unreachableURL = request_.url(); |
| 660 client_->didFail(loader_, error); | 662 client_->didFail(loader_, error); |
| 661 } else { | 663 } else { |
| 662 client_->didFinishLoading(loader_, completion_time.ToDoubleT()); | 664 client_->didFinishLoading(loader_, completion_time.ToDoubleT()); |
| 663 } | 665 } |
| 664 } | 666 } |
| 665 | 667 |
| 666 // Temporary logging, see site_isolation_metrics.h/cc | 668 // Temporary logging, see site_isolation_metrics.h/cc |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 757 | 759 |
| 758 void WebURLLoaderImpl::cancel() { | 760 void WebURLLoaderImpl::cancel() { |
| 759 context_->Cancel(); | 761 context_->Cancel(); |
| 760 } | 762 } |
| 761 | 763 |
| 762 void WebURLLoaderImpl::setDefersLoading(bool value) { | 764 void WebURLLoaderImpl::setDefersLoading(bool value) { |
| 763 context_->SetDefersLoading(value); | 765 context_->SetDefersLoading(value); |
| 764 } | 766 } |
| 765 | 767 |
| 766 } // namespace webkit_glue | 768 } // namespace webkit_glue |
| OLD | NEW |