| 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()); | |
| 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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1097 [[DeferredCancellation alloc] initWithCore:[self getCore]]; | 1092 [[DeferredCancellation alloc] initWithCore:[self getCore]]; |
| 1098 NSArray* modes = @[ [[NSRunLoop currentRunLoop] currentMode] ]; | 1093 NSArray* modes = @[ [[NSRunLoop currentRunLoop] currentMode] ]; |
| 1099 [cancellation performSelector:@selector(cancel) | 1094 [cancellation performSelector:@selector(cancel) |
| 1100 onThread:[self getClientThread] | 1095 onThread:[self getClientThread] |
| 1101 withObject:nil | 1096 withObject:nil |
| 1102 waitUntilDone:NO | 1097 waitUntilDone:NO |
| 1103 modes:modes]; | 1098 modes:modes]; |
| 1104 } | 1099 } |
| 1105 | 1100 |
| 1106 @end | 1101 @end |
| OLD | NEW |