OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 15 matching lines...) Expand all Loading... |
26 // safe to call SupportsScheme on any thread). | 26 // safe to call SupportsScheme on any thread). |
27 // | 27 // |
28 class URLRequestJobManager { | 28 class URLRequestJobManager { |
29 public: | 29 public: |
30 URLRequestJobManager(); | 30 URLRequestJobManager(); |
31 ~URLRequestJobManager(); | 31 ~URLRequestJobManager(); |
32 | 32 |
33 // Instantiate an URLRequestJob implementation based on the registered | 33 // Instantiate an URLRequestJob implementation based on the registered |
34 // interceptors and protocol factories. This will always succeed in | 34 // interceptors and protocol factories. This will always succeed in |
35 // returning a job unless we are--in the extreme case--out of memory. | 35 // returning a job unless we are--in the extreme case--out of memory. |
36 URLRequestJob* CreateJob(URLRequest* request) const; | 36 net::URLRequestJob* CreateJob(net::URLRequest* request) const; |
37 | 37 |
38 // Allows interceptors to hijack the request after examining the new location | 38 // Allows interceptors to hijack the request after examining the new location |
39 // of a redirect. Returns NULL if no interceptor intervenes. | 39 // of a redirect. Returns NULL if no interceptor intervenes. |
40 URLRequestJob* MaybeInterceptRedirect(URLRequest* request, | 40 net::URLRequestJob* MaybeInterceptRedirect(net::URLRequest* request, |
41 const GURL& location) const; | 41 const GURL& location) const; |
42 | 42 |
43 // Allows interceptors to hijack the request after examining the response | 43 // Allows interceptors to hijack the request after examining the response |
44 // status and headers. This is also called when there is no server response | 44 // status and headers. This is also called when there is no server response |
45 // at all to allow interception of failed requests due to network errors. | 45 // at all to allow interception of failed requests due to network errors. |
46 // Returns NULL if no interceptor intervenes. | 46 // Returns NULL if no interceptor intervenes. |
47 URLRequestJob* MaybeInterceptResponse(URLRequest* request) const; | 47 net::URLRequestJob* MaybeInterceptResponse(net::URLRequest* request) const; |
48 | 48 |
49 // Returns true if there is a protocol factory registered for the given | 49 // Returns true if there is a protocol factory registered for the given |
50 // scheme. Note: also returns true if there is a built-in handler for the | 50 // scheme. Note: also returns true if there is a built-in handler for the |
51 // given scheme. | 51 // given scheme. |
52 bool SupportsScheme(const std::string& scheme) const; | 52 bool SupportsScheme(const std::string& scheme) const; |
53 | 53 |
54 // Register a protocol factory associated with the given scheme. The factory | 54 // Register a protocol factory associated with the given scheme. The factory |
55 // parameter may be null to clear any existing association. Returns the | 55 // parameter may be null to clear any existing association. Returns the |
56 // previously registered protocol factory if any. | 56 // previously registered protocol factory if any. |
57 URLRequest::ProtocolFactory* RegisterProtocolFactory( | 57 URLRequest::ProtocolFactory* RegisterProtocolFactory( |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // check back on. | 101 // check back on. |
102 return true; | 102 return true; |
103 #endif | 103 #endif |
104 } | 104 } |
105 #endif | 105 #endif |
106 | 106 |
107 DISALLOW_COPY_AND_ASSIGN(URLRequestJobManager); | 107 DISALLOW_COPY_AND_ASSIGN(URLRequestJobManager); |
108 }; | 108 }; |
109 | 109 |
110 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_MANAGER_H__ | 110 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_MANAGER_H__ |
OLD | NEW |