Index: net/url_request/url_request_context.h |
diff --git a/net/url_request/url_request_context.h b/net/url_request/url_request_context.h |
index 206b01059971c7fb906723599c16146afe158b2b..80a059adb5a41ffb75b135537ec2bed1ec881e85 100644 |
--- a/net/url_request/url_request_context.h |
+++ b/net/url_request/url_request_context.h |
@@ -15,7 +15,7 @@ |
#include "base/macros.h" |
#include "base/memory/ref_counted.h" |
#include "base/memory/weak_ptr.h" |
-#include "base/threading/non_thread_safe.h" |
+#include "base/threading/thread_checker.h" |
#include "base/trace_event/memory_dump_provider.h" |
#include "net/base/net_export.h" |
#include "net/base/request_priority.h" |
@@ -60,8 +60,7 @@ class URLRequestThrottlerManager; |
// URLRequestContext rather than creating a new one, as guaranteeing that the |
// URLRequestContext is destroyed before its members can be difficult. |
class NET_EXPORT URLRequestContext |
- : NON_EXPORTED_BASE(public base::NonThreadSafe), |
- public base::trace_event::MemoryDumpProvider { |
+ : public base::trace_event::MemoryDumpProvider { |
public: |
URLRequestContext(); |
~URLRequestContext() override; |
@@ -281,6 +280,10 @@ class NET_EXPORT URLRequestContext |
bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, |
base::trace_event::ProcessMemoryDump* pmd) override; |
+ void AssertCalledOnValidThread() { |
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); |
+ } |
mmenke
2017/05/31 19:28:08
De-inline this?
gab
2017/05/31 20:46:36
If inlined the compiler can know to compile it out
|
+ |
private: |
// --------------------------------------------------------------------------- |
// Important: When adding any new members below, consider whether they need to |
@@ -333,6 +336,8 @@ class NET_EXPORT URLRequestContext |
// |this| and are not yet destroyed. This doesn't need to be in CopyFrom. |
mutable size_t largest_outstanding_requests_count_seen_; |
+ THREAD_CHECKER(thread_checker_); |
+ |
DISALLOW_COPY_AND_ASSIGN(URLRequestContext); |
}; |