| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 NetworkDelegate* network_delegate, | 43 NetworkDelegate* network_delegate, |
| 44 const GURL& location) const; | 44 const GURL& location) const; |
| 45 | 45 |
| 46 // Allows interceptors to hijack the request after examining the response | 46 // Allows interceptors to hijack the request after examining the response |
| 47 // status and headers. This is also called when there is no server response | 47 // 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. | 48 // at all to allow interception of failed requests due to network errors. |
| 49 // Returns NULL if no interceptor intervenes. | 49 // Returns NULL if no interceptor intervenes. |
| 50 URLRequestJob* MaybeInterceptResponse( | 50 URLRequestJob* MaybeInterceptResponse( |
| 51 URLRequest* request, NetworkDelegate* network_delegate) const; | 51 URLRequest* request, NetworkDelegate* network_delegate) const; |
| 52 | 52 |
| 53 // Returns true if the manager has a built-in handler for |scheme|. | |
| 54 static bool SupportsScheme(const std::string& scheme); | |
| 55 | |
| 56 private: | 53 private: |
| 57 friend struct base::DefaultSingletonTraits<URLRequestJobManager>; | 54 friend struct base::DefaultSingletonTraits<URLRequestJobManager>; |
| 58 | 55 |
| 59 URLRequestJobManager(); | 56 URLRequestJobManager(); |
| 60 ~URLRequestJobManager(); | 57 ~URLRequestJobManager(); |
| 61 | 58 |
| 62 // The first guy to call this function sets the allowed thread. This way we | 59 // The first guy to call this function sets the allowed thread. This way we |
| 63 // avoid needing to define that thread externally. Since we expect all | 60 // avoid needing to define that thread externally. Since we expect all |
| 64 // callers to be on the same thread, we don't worry about threads racing to | 61 // callers to be on the same thread, we don't worry about threads racing to |
| 65 // set the allowed thread. | 62 // set the allowed thread. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 83 return true; | 80 return true; |
| 84 } | 81 } |
| 85 #endif | 82 #endif |
| 86 | 83 |
| 87 DISALLOW_COPY_AND_ASSIGN(URLRequestJobManager); | 84 DISALLOW_COPY_AND_ASSIGN(URLRequestJobManager); |
| 88 }; | 85 }; |
| 89 | 86 |
| 90 } // namespace net | 87 } // namespace net |
| 91 | 88 |
| 92 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_MANAGER_H_ | 89 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_MANAGER_H_ |
| OLD | NEW |