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

Unified Diff: mojo/edk/system/request_context.h

Issue 1767003002: [mojo-edk] Cache the context thread-local in the RequestContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | mojo/edk/system/request_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/request_context.h
diff --git a/mojo/edk/system/request_context.h b/mojo/edk/system/request_context.h
index 75ba61fdf6cccc2128122d368928f3be5c3a1518..56b849870e33ba07048d5f450e911880be51b045 100644
--- a/mojo/edk/system/request_context.h
+++ b/mojo/edk/system/request_context.h
@@ -10,6 +10,10 @@
#include "mojo/edk/system/handle_signals_state.h"
#include "mojo/edk/system/watcher.h"
+namespace base {
+template<typename T> class ThreadLocalPointer;
+}
+
namespace mojo {
namespace edk {
@@ -73,6 +77,11 @@ class RequestContext {
WatchNotifyFinalizerList watch_notify_finalizers_;
WatchCancelFinalizerList watch_cancel_finalizers_;
+ // Pointer to the TLS context. Although this can easily be accessed via the
+ // global LazyInstance, accessing a LazyInstance has a large cost relative to
+ // the rest of this class and its usages.
+ base::ThreadLocalPointer<RequestContext>* tls_context_;
Ken Rockot(use gerrit already) 2016/03/07 04:25:00 Hmm, couldn't this just be a raw pointer?
+
DISALLOW_COPY_AND_ASSIGN(RequestContext);
};
« no previous file with comments | « no previous file | mojo/edk/system/request_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698