| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 NET_URL_REQUEST_URL_REQUEST_JOB_MANAGER_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_MANAGER_H_ |
| 6 #define NET_URL_REQUEST_URL_REQUEST_JOB_MANAGER_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_JOB_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 // (i.e., it is safe to call SupportsScheme on any thread). | 29 // (i.e., it is safe to call SupportsScheme on any thread). |
| 30 // | 30 // |
| 31 class URLRequestJobManager { | 31 class URLRequestJobManager { |
| 32 public: | 32 public: |
| 33 // Returns the singleton instance. | 33 // Returns the singleton instance. |
| 34 static URLRequestJobManager* GetInstance(); | 34 static URLRequestJobManager* GetInstance(); |
| 35 | 35 |
| 36 // Instantiate an URLRequestJob implementation based on the registered | 36 // Instantiate an URLRequestJob implementation based on the registered |
| 37 // interceptors and protocol factories. This will always succeed in | 37 // interceptors and protocol factories. This will always succeed in |
| 38 // returning a job unless we are--in the extreme case--out of memory. | 38 // returning a job unless we are--in the extreme case--out of memory. |
| 39 URLRequestJob* CreateJob(URLRequest* request) const; | 39 URLRequestJob* CreateJob(URLRequest* request, |
| 40 NetworkDelegate* network_delegate) const; |
| 40 | 41 |
| 41 // Allows interceptors to hijack the request after examining the new location | 42 // Allows interceptors to hijack the request after examining the new location |
| 42 // of a redirect. Returns NULL if no interceptor intervenes. | 43 // of a redirect. Returns NULL if no interceptor intervenes. |
| 43 URLRequestJob* MaybeInterceptRedirect(URLRequest* request, | 44 URLRequestJob* MaybeInterceptRedirect(URLRequest* request, |
| 44 const GURL& location) const; | 45 const GURL& location) const; |
| 45 | 46 |
| 46 // Allows interceptors to hijack the request after examining the response | 47 // Allows interceptors to hijack the request after examining the response |
| 47 // status and headers. This is also called when there is no server response | 48 // status and headers. This is also called when there is no server response |
| 48 // at all to allow interception of failed requests due to network errors. | 49 // at all to allow interception of failed requests due to network errors. |
| 49 // Returns NULL if no interceptor intervenes. | 50 // Returns NULL if no interceptor intervenes. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 mutable base::Lock lock_; | 105 mutable base::Lock lock_; |
| 105 FactoryMap factories_; | 106 FactoryMap factories_; |
| 106 InterceptorList interceptors_; | 107 InterceptorList interceptors_; |
| 107 | 108 |
| 108 DISALLOW_COPY_AND_ASSIGN(URLRequestJobManager); | 109 DISALLOW_COPY_AND_ASSIGN(URLRequestJobManager); |
| 109 }; | 110 }; |
| 110 | 111 |
| 111 } // namespace net | 112 } // namespace net |
| 112 | 113 |
| 113 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_MANAGER_H_ | 114 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_MANAGER_H_ |
| OLD | NEW |