Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #import "ios/net/crn_http_protocol_handler.h" | 5 #import "ios/net/crn_http_protocol_handler.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 656 // The request is associated with a tracker that does not exist, cancel it. | 656 // The request is associated with a tracker that does not exist, cancel it. |
| 657 // NSURLErrorCancelled avoids triggering any error page. | 657 // NSURLErrorCancelled avoids triggering any error page. |
| 658 [top_level_client_ didFailWithNSErrorCode:NSURLErrorCancelled | 658 [top_level_client_ didFailWithNSErrorCode:NSURLErrorCancelled |
| 659 netErrorCode:ERR_ABORTED]; | 659 netErrorCode:ERR_ABORTED]; |
| 660 return; | 660 return; |
| 661 } | 661 } |
| 662 | 662 |
| 663 if (tracker_) { | 663 if (tracker_) { |
| 664 // Set up any clients that can operate regardless of the request | 664 // Set up any clients that can operate regardless of the request |
| 665 PushClients(tracker_->ClientsHandlingAnyRequest()); | 665 PushClients(tracker_->ClientsHandlingAnyRequest()); |
| 666 } else { | |
| 667 // There was no request_group_id, so the request was from something like a | |
| 668 // data: or file: URL. | |
| 669 // Attach any global clients to the request. | |
| 670 PushClients(RequestTracker::GlobalClientsHandlingAnyRequest()); | |
|
sdefresne
2017/01/13 10:29:12
This method was always returning an empty NSArray,
| |
| 671 } | 666 } |
| 672 | 667 |
| 673 // Now that all of the network clients are set up, if there was an error with | 668 // Now that all of the network clients are set up, if there was an error with |
| 674 // the URL, it can be raised and all of the clients will have a chance to | 669 // the URL, it can be raised and all of the clients will have a chance to |
| 675 // handle it. | 670 // handle it. |
| 676 if (!url.is_valid()) { | 671 if (!url.is_valid()) { |
| 677 DLOG(ERROR) << "Trying to load an invalid URL: " | 672 DLOG(ERROR) << "Trying to load an invalid URL: " |
| 678 << base::SysNSStringToUTF8([[request_ URL] absoluteString]); | 673 << base::SysNSStringToUTF8([[request_ URL] absoluteString]); |
| 679 [top_level_client_ didFailWithNSErrorCode:NSURLErrorBadURL | 674 [top_level_client_ didFailWithNSErrorCode:NSURLErrorBadURL |
| 680 netErrorCode:ERR_INVALID_URL]; | 675 netErrorCode:ERR_INVALID_URL]; |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1023 base::Bind(&net::HttpProtocolHandlerCore::Cancel, _core)); | 1018 base::Bind(&net::HttpProtocolHandlerCore::Cancel, _core)); |
| 1024 [_protocolProxy invalidate]; | 1019 [_protocolProxy invalidate]; |
| 1025 } | 1020 } |
| 1026 | 1021 |
| 1027 - (void)stopLoading { | 1022 - (void)stopLoading { |
| 1028 [self cancelRequest]; | 1023 [self cancelRequest]; |
| 1029 _protocolProxy.reset(); | 1024 _protocolProxy.reset(); |
| 1030 } | 1025 } |
| 1031 | 1026 |
| 1032 @end | 1027 @end |
| OLD | NEW |