OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_FACTORY_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/threading/non_thread_safe.h" | 13 #include "base/threading/non_thread_safe.h" |
| 14 #include "net/base/net_api.h" |
14 | 15 |
15 class GURL; | 16 class GURL; |
16 | 17 |
17 namespace net { | 18 namespace net { |
18 | 19 |
19 class URLRequest; | 20 class URLRequest; |
20 class URLRequestJob; | 21 class URLRequestJob; |
21 | 22 |
22 class URLRequestJobFactory : public base::NonThreadSafe { | 23 class NET_TEST URLRequestJobFactory |
| 24 : NON_EXPORTED_BASE(public base::NonThreadSafe) { |
23 public: | 25 public: |
24 class ProtocolHandler { | 26 class NET_TEST ProtocolHandler { |
25 public: | 27 public: |
26 virtual ~ProtocolHandler(); | 28 virtual ~ProtocolHandler(); |
27 | 29 |
28 virtual URLRequestJob* MaybeCreateJob(URLRequest* request) const = 0; | 30 virtual URLRequestJob* MaybeCreateJob(URLRequest* request) const = 0; |
29 }; | 31 }; |
30 | 32 |
31 class Interceptor { | 33 class NET_TEST Interceptor { |
32 public: | 34 public: |
33 virtual ~Interceptor(); | 35 virtual ~Interceptor(); |
34 | 36 |
35 // Called for every request made. Should return a new job to handle the | 37 // Called for every request made. Should return a new job to handle the |
36 // request if it should be intercepted, or NULL to allow the request to | 38 // request if it should be intercepted, or NULL to allow the request to |
37 // be handled in the normal manner. | 39 // be handled in the normal manner. |
38 virtual URLRequestJob* MaybeIntercept(URLRequest* request) const = 0; | 40 virtual URLRequestJob* MaybeIntercept(URLRequest* request) const = 0; |
39 | 41 |
40 // Called after having received a redirect response, but prior to the | 42 // Called after having received a redirect response, but prior to the |
41 // the request delegate being informed of the redirect. Can return a new | 43 // the request delegate being informed of the redirect. Can return a new |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 89 |
88 ProtocolHandlerMap protocol_handler_map_; | 90 ProtocolHandlerMap protocol_handler_map_; |
89 InterceptorList interceptors_; | 91 InterceptorList interceptors_; |
90 | 92 |
91 DISALLOW_COPY_AND_ASSIGN(URLRequestJobFactory); | 93 DISALLOW_COPY_AND_ASSIGN(URLRequestJobFactory); |
92 }; | 94 }; |
93 | 95 |
94 } // namespace net | 96 } // namespace net |
95 | 97 |
96 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ | 98 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ |
OLD | NEW |