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

Unified Diff: net/url_request/url_request_job_manager.h

Issue 851503003: Update from https://crrev.com/311076 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/url_request/url_request_http_job.cc ('k') | net/url_request/url_request_job_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « net/url_request/url_request_http_job.cc ('k') | net/url_request/url_request_job_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698