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

Unified Diff: ppapi/proxy/ppb_var_proxy.cc

Issue 8016008: Make much of the proxy thread-safe with 1 great big lock. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 9 years, 2 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 | « ppapi/proxy/ppb_core_proxy.cc ('k') | ppapi/proxy/ppb_var_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_var_proxy.cc
diff --git a/ppapi/proxy/ppb_var_proxy.cc b/ppapi/proxy/ppb_var_proxy.cc
index 4ee6cc1a347fdea829731bec20b7f78363e2c543..0c7cf5bf75685589eb2b408be8cd77ddd451691a 100644
--- a/ppapi/proxy/ppb_var_proxy.cc
+++ b/ppapi/proxy/ppb_var_proxy.cc
@@ -8,6 +8,7 @@
#include "ppapi/c/ppb_var.h"
#include "ppapi/proxy/plugin_resource_tracker.h"
#include "ppapi/proxy/plugin_var_tracker.h"
+#include "ppapi/shared_impl/proxy_lock.h"
#include "ppapi/shared_impl/var.h"
namespace ppapi {
@@ -18,18 +19,22 @@ namespace {
// PPP_Var plugin --------------------------------------------------------------
void AddRefVar(PP_Var var) {
+ ppapi::ProxyAutoLock lock;
PluginResourceTracker::GetInstance()->var_tracker().AddRefVar(var);
}
void ReleaseVar(PP_Var var) {
+ ppapi::ProxyAutoLock lock;
PluginResourceTracker::GetInstance()->var_tracker().ReleaseVar(var);
}
PP_Var VarFromUtf8(PP_Module module, const char* data, uint32_t len) {
+ ppapi::ProxyAutoLock lock;
return StringVar::StringToPPVar(module, data, len);
}
const char* VarToUtf8(PP_Var var, uint32_t* len) {
+ ppapi::ProxyAutoLock lock;
StringVar* str = StringVar::FromPPVar(var);
if (str) {
*len = static_cast<uint32_t>(str->value().size());
« no previous file with comments | « ppapi/proxy/ppb_core_proxy.cc ('k') | ppapi/proxy/ppb_var_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698