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

Side by Side Diff: ios/net/request_tracker.h

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 | « ios/net/crn_http_protocol_handler.mm ('k') | ios/net/request_tracker.mm » ('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 #ifndef IOS_NET_REQUEST_TRACKER_H_ 5 #ifndef IOS_NET_REQUEST_TRACKER_H_
6 #define IOS_NET_REQUEST_TRACKER_H_ 6 #define IOS_NET_REQUEST_TRACKER_H_
7 7
8 #import <Foundation/Foundation.h> 8 #import <Foundation/Foundation.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 base::WeakPtr<RequestTracker> GetWeakPtr(); 73 base::WeakPtr<RequestTracker> GetWeakPtr();
74 74
75 // This function has to be called before using the tracker. 75 // This function has to be called before using the tracker.
76 virtual void Init(); 76 virtual void Init();
77 77
78 // Add a factory that may create network clients for requests going through 78 // Add a factory that may create network clients for requests going through
79 // this tracker. 79 // this tracker.
80 void AddNetworkClientFactory(CRNForwardingNetworkClientFactory* factory); 80 void AddNetworkClientFactory(CRNForwardingNetworkClientFactory* factory);
81 81
82 // Registers a factory with the class that will be added to all trackers.
83 // Requests without associated trackers can add clients from these factories
84 // using GlobalClientsHandlingAnyRequest().
85 // Only |-clientHandlingAnyRequest| will be called on |factory|, the other
86 // methods are not supported.
87 static void AddGlobalNetworkClientFactory(
88 CRNForwardingNetworkClientFactory* factory);
89
82 // Gets the request context associated with the tracker. 90 // Gets the request context associated with the tracker.
83 virtual URLRequestContext* GetRequestContext() = 0; 91 virtual URLRequestContext* GetRequestContext() = 0;
84 92
85 // Network client generation methods. All of these four ClientsHandling... 93 // Network client generation methods. All of these four ClientsHandling...
86 // methods return an array of CRNForwardingNetworkClient instances, according 94 // methods return an array of CRNForwardingNetworkClient instances, according
87 // to the CRNForwardingNetworkClientFactories added to the tracker. The array 95 // to the CRNForwardingNetworkClientFactories added to the tracker. The array
88 // may be empty. The caller is responsible for taking ownership of the clients 96 // may be empty. The caller is responsible for taking ownership of the clients
89 // in the array. 97 // in the array.
90 98
99 // Static method that returns clients that can handle any request, for use
100 // in cases where a request isn't associated with any request_tracker.
101 static NSArray* GlobalClientsHandlingAnyRequest();
102
91 // Returns clients that can handle any request. 103 // Returns clients that can handle any request.
92 NSArray* ClientsHandlingAnyRequest(); 104 NSArray* ClientsHandlingAnyRequest();
93 // Returns clients that can handle |request|. 105 // Returns clients that can handle |request|.
94 NSArray* ClientsHandlingRequest(const URLRequest& request); 106 NSArray* ClientsHandlingRequest(const URLRequest& request);
95 // Returns clients that can handle |request| with |response|. 107 // Returns clients that can handle |request| with |response|.
96 NSArray* ClientsHandlingRequestAndResponse(const URLRequest& request, 108 NSArray* ClientsHandlingRequestAndResponse(const URLRequest& request,
97 NSURLResponse* response); 109 NSURLResponse* response);
98 // Returns clients that can handle a redirect of |request| to |new_url| based 110 // Returns clients that can handle a redirect of |request| to |new_url| based
99 // on |redirect_response|. 111 // on |redirect_response|.
100 NSArray* ClientsHandlingRedirect(const URLRequest& request, 112 NSArray* ClientsHandlingRedirect(const URLRequest& request,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 bool initialized_; 166 bool initialized_;
155 CacheMode cache_mode_; 167 CacheMode cache_mode_;
156 base::ThreadChecker thread_checker_; 168 base::ThreadChecker thread_checker_;
157 169
158 base::WeakPtrFactory<RequestTracker> weak_ptr_factory_; 170 base::WeakPtrFactory<RequestTracker> weak_ptr_factory_;
159 }; 171 };
160 172
161 } // namespace net 173 } // namespace net
162 174
163 #endif // IOS_NET_REQUEST_TRACKER_H_ 175 #endif // IOS_NET_REQUEST_TRACKER_H_
OLDNEW
« no previous file with comments | « ios/net/crn_http_protocol_handler.mm ('k') | ios/net/request_tracker.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698