Index: net/url_request/url_request_job_manager.h |
diff --git a/net/url_request/url_request_job_manager.h b/net/url_request/url_request_job_manager.h |
index 6329eab0bb797d73c1e8836f1a21485f8c1c7b2a..7729abbbe2b710031367cd0f8fbc588b111ce2e1 100644 |
--- a/net/url_request/url_request_job_manager.h |
+++ b/net/url_request/url_request_job_manager.h |
@@ -6,10 +6,8 @@ |
#define NET_URL_REQUEST_URL_REQUEST_JOB_MANAGER_H_ |
#include <string> |
-#include <vector> |
-#include "base/synchronization/lock.h" |
-#include "base/threading/platform_thread.h" |
+#include "base/threading/thread_checker.h" |
#include "net/base/net_export.h" |
#include "net/url_request/url_request.h" |
@@ -64,11 +62,12 @@ class NET_EXPORT URLRequestJobManager { |
// set the allowed thread. |
bool IsAllowedThread() const { |
#if 0 |
- if (!allowed_thread_initialized_) { |
- allowed_thread_ = base::PlatformThread::CurrentId(); |
- allowed_thread_initialized_ = true; |
- } |
- return allowed_thread_ == base::PlatformThread::CurrentId(); |
+ return thread_checker_.CalledOnValidThread(); |
+ } |
+ |
+ // We use this to assert that CreateJob and the registration functions all |
+ // run on the same thread. |
+ base::ThreadChecker thread_checker_; |
#else |
// The previous version of this check used GetCurrentThread on Windows to |
// get thread handles to compare. Unfortunately, GetCurrentThread returns |
@@ -80,15 +79,8 @@ class NET_EXPORT URLRequestJobManager { |
// check back on. |
return true; |
} |
- |
- // We use this to assert that CreateJob and the registration functions all |
- // run on the same thread. |
- mutable base::PlatformThreadId allowed_thread_; |
- mutable bool allowed_thread_initialized_; |
#endif |
- mutable base::Lock lock_; |
- |
DISALLOW_COPY_AND_ASSIGN(URLRequestJobManager); |
}; |