Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: net/url_request/url_request_job_manager.h

Issue 18677: Use PlatformThreadId, not int when dealing with thread ids. (Closed)
Patch Set: Addressing comments Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/thread_collision_warner.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « base/thread_collision_warner.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698