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

Unified Diff: net/url_request/url_request_context.h

Issue 2910473005: Deprecate NonThreadSafe in net/ in favor of SequenceChecker/ThreadChecker. (Closed)
Patch Set: Fix chromecast compile Created 3 years, 7 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
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..5a8ea66b7f9db304f67d3f21c6a821eb29802523 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/sequence_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 AssertCalledOnValidSequence() const {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ }
+
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_;
+ SEQUENCE_CHECKER(sequence_checker_);
+
DISALLOW_COPY_AND_ASSIGN(URLRequestContext);
};

Powered by Google App Engine
This is Rietveld 408576698