| 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/lock.h" | 13 #include "base/synchronization/lock.h" |
| 14 #include "base/threading/platform_thread.h" | 14 #include "base/threading/platform_thread.h" |
| 15 #include "net/url_request/url_request.h" | 15 #include "net/url_request/url_request.h" |
| 16 | 16 |
| 17 template <typename T> struct DefaultSingletonTraits; | 17 template <typename T> struct DefaultSingletonTraits; |
| 18 | 18 |
| 19 namespace net { | 19 namespace net { |
| 20 | 20 |
| 21 // This class is responsible for managing the set of protocol factories and | 21 // This class is responsible for managing the set of protocol factories and |
| 22 // request interceptors that determine how an net::URLRequestJob gets created to | 22 // request interceptors that determine how an net::URLRequestJob gets created to |
| 23 // handle an net::URLRequest. | 23 // handle an net::URLRequest. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 bool enable_file_access() const { return enable_file_access_; } | 69 bool enable_file_access() const { return enable_file_access_; } |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 typedef std::map<std::string, net::URLRequest::ProtocolFactory*> FactoryMap; | 72 typedef std::map<std::string, net::URLRequest::ProtocolFactory*> FactoryMap; |
| 73 typedef std::vector<net::URLRequest::Interceptor*> InterceptorList; | 73 typedef std::vector<net::URLRequest::Interceptor*> InterceptorList; |
| 74 friend struct DefaultSingletonTraits<URLRequestJobManager>; | 74 friend struct DefaultSingletonTraits<URLRequestJobManager>; |
| 75 | 75 |
| 76 URLRequestJobManager(); | 76 URLRequestJobManager(); |
| 77 ~URLRequestJobManager(); | 77 ~URLRequestJobManager(); |
| 78 | 78 |
| 79 mutable Lock lock_; | 79 mutable base::Lock lock_; |
| 80 FactoryMap factories_; | 80 FactoryMap factories_; |
| 81 InterceptorList interceptors_; | 81 InterceptorList interceptors_; |
| 82 bool enable_file_access_; | 82 bool enable_file_access_; |
| 83 | 83 |
| 84 #ifndef NDEBUG | 84 #ifndef NDEBUG |
| 85 // We use this to assert that CreateJob and the registration functions all | 85 // We use this to assert that CreateJob and the registration functions all |
| 86 // run on the same thread. | 86 // run on the same thread. |
| 87 mutable base::PlatformThreadId allowed_thread_; | 87 mutable base::PlatformThreadId allowed_thread_; |
| 88 mutable bool allowed_thread_initialized_; | 88 mutable bool allowed_thread_initialized_; |
| 89 | 89 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 111 #endif | 111 #endif |
| 112 } | 112 } |
| 113 #endif | 113 #endif |
| 114 | 114 |
| 115 DISALLOW_COPY_AND_ASSIGN(URLRequestJobManager); | 115 DISALLOW_COPY_AND_ASSIGN(URLRequestJobManager); |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 } // namespace net | 118 } // namespace net |
| 119 | 119 |
| 120 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_MANAGER_H_ | 120 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_MANAGER_H_ |
| OLD | NEW |