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 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/threading/non_thread_safe.h" | 12 #include "base/threading/thread_checker.h" |
13 #include "net/base/net_export.h" | 13 #include "net/base/net_export.h" |
14 | 14 |
15 class GURL; | 15 class GURL; |
16 | 16 |
17 namespace net { | 17 namespace net { |
18 | 18 |
19 class NetworkDelegate; | 19 class NetworkDelegate; |
20 class URLRequest; | 20 class URLRequest; |
21 class URLRequestJob; | 21 class URLRequestJob; |
22 | 22 |
23 class NET_EXPORT URLRequestJobFactory | 23 class NET_EXPORT URLRequestJobFactory { |
24 : NON_EXPORTED_BASE(public base::NonThreadSafe) { | |
25 public: | 24 public: |
26 // TODO(shalev): Move this to URLRequestJobFactoryImpl. | 25 // TODO(shalev): Move this to URLRequestJobFactoryImpl. |
27 class NET_EXPORT ProtocolHandler { | 26 class NET_EXPORT ProtocolHandler { |
28 public: | 27 public: |
29 virtual ~ProtocolHandler(); | 28 virtual ~ProtocolHandler(); |
30 | 29 |
31 virtual URLRequestJob* MaybeCreateJob( | 30 virtual URLRequestJob* MaybeCreateJob( |
32 URLRequest* request, NetworkDelegate* network_delegate) const = 0; | 31 URLRequest* request, NetworkDelegate* network_delegate) const = 0; |
33 | 32 |
34 // Indicates if it should be safe to redirect to |location|. Should handle | 33 // Indicates if it should be safe to redirect to |location|. Should handle |
(...skipping 18 matching lines...) Expand all Loading... |
53 const GURL& location) const = 0; | 52 const GURL& location) const = 0; |
54 | 53 |
55 virtual URLRequestJob* MaybeInterceptResponse( | 54 virtual URLRequestJob* MaybeInterceptResponse( |
56 URLRequest* request, | 55 URLRequest* request, |
57 NetworkDelegate* network_delegate) const = 0; | 56 NetworkDelegate* network_delegate) const = 0; |
58 | 57 |
59 virtual bool IsHandledProtocol(const std::string& scheme) const = 0; | 58 virtual bool IsHandledProtocol(const std::string& scheme) const = 0; |
60 | 59 |
61 virtual bool IsSafeRedirectTarget(const GURL& location) const = 0; | 60 virtual bool IsSafeRedirectTarget(const GURL& location) const = 0; |
62 | 61 |
| 62 protected: |
| 63 THREAD_CHECKER(thread_checker_); |
| 64 |
63 private: | 65 private: |
64 DISALLOW_COPY_AND_ASSIGN(URLRequestJobFactory); | 66 DISALLOW_COPY_AND_ASSIGN(URLRequestJobFactory); |
65 }; | 67 }; |
66 | 68 |
67 } // namespace net | 69 } // namespace net |
68 | 70 |
69 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ | 71 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ |
OLD | NEW |