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

Side by Side Diff: ios/net/crn_http_protocol_handler.mm

Issue 2630763002: Revert of Remove support for GlobalNetworkClientFactory from RequestTracker. (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | ios/net/request_tracker.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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());
666 } 671 }
667 672
668 // Now that all of the network clients are set up, if there was an error with 673 // Now that all of the network clients are set up, if there was an error with
669 // the URL, it can be raised and all of the clients will have a chance to 674 // the URL, it can be raised and all of the clients will have a chance to
670 // handle it. 675 // handle it.
671 if (!url.is_valid()) { 676 if (!url.is_valid()) {
672 DLOG(ERROR) << "Trying to load an invalid URL: " 677 DLOG(ERROR) << "Trying to load an invalid URL: "
673 << base::SysNSStringToUTF8([[request_ URL] absoluteString]); 678 << base::SysNSStringToUTF8([[request_ URL] absoluteString]);
674 [top_level_client_ didFailWithNSErrorCode:NSURLErrorBadURL 679 [top_level_client_ didFailWithNSErrorCode:NSURLErrorBadURL
675 netErrorCode:ERR_INVALID_URL]; 680 netErrorCode:ERR_INVALID_URL];
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 base::Bind(&net::HttpProtocolHandlerCore::Cancel, _core)); 1023 base::Bind(&net::HttpProtocolHandlerCore::Cancel, _core));
1019 [_protocolProxy invalidate]; 1024 [_protocolProxy invalidate];
1020 } 1025 }
1021 1026
1022 - (void)stopLoading { 1027 - (void)stopLoading {
1023 [self cancelRequest]; 1028 [self cancelRequest];
1024 _protocolProxy.reset(); 1029 _protocolProxy.reset();
1025 } 1030 }
1026 1031
1027 @end 1032 @end
OLDNEW
« no previous file with comments | « no previous file | ios/net/request_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698