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

Unified Diff: ppapi/proxy/plugin_globals.h

Issue 9296017: Remove static initializer for TLS object. This moves the TLS to the (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 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 | « no previous file | ppapi/proxy/ppb_message_loop_proxy.cc » ('j') | ppapi/proxy/ppb_message_loop_proxy.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/plugin_globals.h
===================================================================
--- ppapi/proxy/plugin_globals.h (revision 120498)
+++ ppapi/proxy/plugin_globals.h (working copy)
@@ -6,7 +6,9 @@
#define PPAPI_PROXY_PLUGIN_GLOBALS_H_
#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
#include "base/synchronization/lock.h"
+#include "base/threading/thread_local_storage.h"
#include "ppapi/proxy/plugin_resource_tracker.h"
#include "ppapi/proxy/plugin_var_tracker.h"
#include "ppapi/proxy/ppapi_proxy_export.h"
@@ -66,6 +68,20 @@
plugin_proxy_delegate_ = d;
}
+ // Returns the TLS slot that holds the message loop TLS.
+ //
+ // If we end up needing more TLS storage for more stuff, we should probably
+ // have a struct in here for the different items.
+ base::ThreadLocalStorage::Slot* msg_loop_slot() {
+ return msg_loop_slot_.get();
+ }
+
+ // Sets the message loop slot, takes ownership of the given heap-alloated
+ // pointer.
+ void set_msg_loop_slot(base::ThreadLocalStorage::Slot* slot) {
+ msg_loop_slot_.reset(slot);
+ }
+
// The embedder should call this function when the name of the plugin module
// is known. This will be used for error logging.
void set_plugin_name(const std::string& name) { plugin_name_ = name; }
@@ -82,6 +98,8 @@
scoped_refptr<CallbackTracker> callback_tracker_;
base::Lock proxy_lock_;
+ scoped_ptr<base::ThreadLocalStorage::Slot> msg_loop_slot_;
+
// Name of the plugin used for error logging. This will be empty until
// SetPluginName is called.
std::string plugin_name_;
« no previous file with comments | « no previous file | ppapi/proxy/ppb_message_loop_proxy.cc » ('j') | ppapi/proxy/ppb_message_loop_proxy.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698