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 #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 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 CACHE_RELOAD, | 37 CACHE_RELOAD, |
38 CACHE_HISTORY, | 38 CACHE_HISTORY, |
39 CACHE_BYPASS, | 39 CACHE_BYPASS, |
40 CACHE_ONLY, | 40 CACHE_ONLY, |
41 }; | 41 }; |
42 | 42 |
43 typedef base::Callback<void(bool)> SSLCallback; | 43 typedef base::Callback<void(bool)> SSLCallback; |
44 | 44 |
45 class RequestTrackerFactory { | 45 class RequestTrackerFactory { |
46 public: | 46 public: |
| 47 virtual ~RequestTrackerFactory(); |
| 48 |
47 // Returns false if |request| is associated to an invalid tracker and should | 49 // Returns false if |request| is associated to an invalid tracker and should |
48 // be cancelled. In this case |tracker| is set to nullptr. | 50 // be cancelled. In this case |tracker| is set to nullptr. |
49 // Returns true if |request| is associated with a valid tracker or if the | 51 // Returns true if |request| is associated with a valid tracker or if the |
50 // request is not associated to any tracker. | 52 // request is not associated to any tracker. |
51 virtual bool GetRequestTracker(NSURLRequest* request, | 53 virtual bool GetRequestTracker(NSURLRequest* request, |
52 base::WeakPtr<RequestTracker>* tracker) = 0; | 54 base::WeakPtr<RequestTracker>* tracker) = 0; |
53 }; | 55 }; |
54 | 56 |
55 // Sets the RequestTrackerFactory. The factory has to be set before the | 57 // Sets the RequestTrackerFactory. The factory has to be set before the |
56 // GetRequestTracker() function can be called. | 58 // GetRequestTracker() function can be called. |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 bool initialized_; | 165 bool initialized_; |
164 CacheMode cache_mode_; | 166 CacheMode cache_mode_; |
165 base::ThreadChecker thread_checker_; | 167 base::ThreadChecker thread_checker_; |
166 | 168 |
167 base::WeakPtrFactory<RequestTracker> weak_ptr_factory_; | 169 base::WeakPtrFactory<RequestTracker> weak_ptr_factory_; |
168 }; | 170 }; |
169 | 171 |
170 } // namespace net | 172 } // namespace net |
171 | 173 |
172 #endif // IOS_NET_REQUEST_TRACKER_H_ | 174 #endif // IOS_NET_REQUEST_TRACKER_H_ |
OLD | NEW |