OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/lock.h" | 10 #include "base/lock.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 typedef std::map<std::string,URLRequest::ProtocolFactory*> FactoryMap; | 50 typedef std::map<std::string,URLRequest::ProtocolFactory*> FactoryMap; |
51 typedef std::vector<URLRequest::Interceptor*> InterceptorList; | 51 typedef std::vector<URLRequest::Interceptor*> InterceptorList; |
52 | 52 |
53 mutable Lock lock_; | 53 mutable Lock lock_; |
54 FactoryMap factories_; | 54 FactoryMap factories_; |
55 InterceptorList interceptors_; | 55 InterceptorList interceptors_; |
56 | 56 |
57 #ifndef NDEBUG | 57 #ifndef NDEBUG |
58 // We use this to assert that CreateJob and the registration functions all | 58 // We use this to assert that CreateJob and the registration functions all |
59 // run on the same thread. | 59 // run on the same thread. |
60 mutable int allowed_thread_; | 60 mutable PlatformThreadId allowed_thread_; |
61 mutable bool allowed_thread_initialized_; | 61 mutable bool allowed_thread_initialized_; |
62 | 62 |
63 // The first guy to call this function sets the allowed thread. This way we | 63 // The first guy to call this function sets the allowed thread. This way we |
64 // avoid needing to define that thread externally. Since we expect all | 64 // avoid needing to define that thread externally. Since we expect all |
65 // callers to be on the same thread, we don't worry about threads racing to | 65 // callers to be on the same thread, we don't worry about threads racing to |
66 // set the allowed thread. | 66 // set the allowed thread. |
67 bool IsAllowedThread() const { | 67 bool IsAllowedThread() const { |
68 #if 0 | 68 #if 0 |
69 if (!allowed_thread_initialized_) { | 69 if (!allowed_thread_initialized_) { |
70 allowed_thread_ = PlatformThread::CurrentId(); | 70 allowed_thread_ = PlatformThread::CurrentId(); |
(...skipping 12 matching lines...) Expand all Loading... |
83 return true; | 83 return true; |
84 #endif | 84 #endif |
85 } | 85 } |
86 #endif | 86 #endif |
87 | 87 |
88 DISALLOW_EVIL_CONSTRUCTORS(URLRequestJobManager); | 88 DISALLOW_EVIL_CONSTRUCTORS(URLRequestJobManager); |
89 }; | 89 }; |
90 | 90 |
91 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_MANAGER_H__ | 91 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_MANAGER_H__ |
92 | 92 |
OLD | NEW |