| 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 #include "net/base/net_export.h" |
| 15 | 15 |
| 16 class GURL; | 16 class GURL; |
| 17 | 17 |
| 18 namespace net { | 18 namespace net { |
| 19 | 19 |
| 20 class URLRequest; | 20 class URLRequest; |
| 21 class URLRequestJob; | 21 class URLRequestJob; |
| 22 | 22 |
| 23 class NET_API URLRequestJobFactory | 23 class NET_EXPORT URLRequestJobFactory |
| 24 : NON_EXPORTED_BASE(public base::NonThreadSafe) { | 24 : NON_EXPORTED_BASE(public base::NonThreadSafe) { |
| 25 public: | 25 public: |
| 26 class NET_API ProtocolHandler { | 26 class NET_EXPORT ProtocolHandler { |
| 27 public: | 27 public: |
| 28 virtual ~ProtocolHandler(); | 28 virtual ~ProtocolHandler(); |
| 29 | 29 |
| 30 virtual URLRequestJob* MaybeCreateJob(URLRequest* request) const = 0; | 30 virtual URLRequestJob* MaybeCreateJob(URLRequest* request) const = 0; |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 class NET_API Interceptor { | 33 class NET_EXPORT Interceptor { |
| 34 public: | 34 public: |
| 35 virtual ~Interceptor(); | 35 virtual ~Interceptor(); |
| 36 | 36 |
| 37 // 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 |
| 38 // 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 |
| 39 // be handled in the normal manner. | 39 // be handled in the normal manner. |
| 40 virtual URLRequestJob* MaybeIntercept(URLRequest* request) const = 0; | 40 virtual URLRequestJob* MaybeIntercept(URLRequest* request) const = 0; |
| 41 | 41 |
| 42 // Called after having received a redirect response, but prior to the | 42 // Called after having received a redirect response, but prior to the |
| 43 // 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 ProtocolHandlerMap protocol_handler_map_; | 102 ProtocolHandlerMap protocol_handler_map_; |
| 103 InterceptorList interceptors_; | 103 InterceptorList interceptors_; |
| 104 | 104 |
| 105 DISALLOW_COPY_AND_ASSIGN(URLRequestJobFactory); | 105 DISALLOW_COPY_AND_ASSIGN(URLRequestJobFactory); |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 } // namespace net | 108 } // namespace net |
| 109 | 109 |
| 110 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ | 110 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ |
| OLD | NEW |