Index: ppapi/proxy/plugin_var_tracker.cc |
diff --git a/ppapi/proxy/plugin_var_tracker.cc b/ppapi/proxy/plugin_var_tracker.cc |
index cff8fa16ee2a2c0e13b50dbbfda37867dd091040..14a85846043bfe377965bb054a431b6b54945fbb 100644 |
--- a/ppapi/proxy/plugin_var_tracker.cc |
+++ b/ppapi/proxy/plugin_var_tracker.cc |
@@ -31,7 +31,7 @@ bool PluginVarTracker::HostVar::operator<(const HostVar& other) const { |
return host_object_id < other.host_object_id; |
} |
-PluginVarTracker::PluginVarTracker() { |
+PluginVarTracker::PluginVarTracker() : VarTracker(THREAD_SAFE) { |
} |
PluginVarTracker::~PluginVarTracker() { |
@@ -39,7 +39,7 @@ PluginVarTracker::~PluginVarTracker() { |
PP_Var PluginVarTracker::ReceiveObjectPassRef(const PP_Var& host_var, |
PluginDispatcher* dispatcher) { |
- DCHECK(CalledOnValidThread()); |
+ CheckThreadingPreconditions(); |
DCHECK(host_var.type == PP_VARTYPE_OBJECT); |
// Get the object. |
@@ -65,7 +65,7 @@ PP_Var PluginVarTracker::ReceiveObjectPassRef(const PP_Var& host_var, |
PP_Var PluginVarTracker::TrackObjectWithNoReference( |
const PP_Var& host_var, |
PluginDispatcher* dispatcher) { |
- DCHECK(CalledOnValidThread()); |
+ CheckThreadingPreconditions(); |
DCHECK(host_var.type == PP_VARTYPE_OBJECT); |
// Get the object. |
@@ -83,7 +83,7 @@ PP_Var PluginVarTracker::TrackObjectWithNoReference( |
void PluginVarTracker::StopTrackingObjectWithNoReference( |
const PP_Var& plugin_var) { |
- DCHECK(CalledOnValidThread()); |
+ CheckThreadingPreconditions(); |
DCHECK(plugin_var.type == PP_VARTYPE_OBJECT); |
VarMap::iterator found = GetLiveVar(plugin_var); |
@@ -98,8 +98,7 @@ void PluginVarTracker::StopTrackingObjectWithNoReference( |
} |
PP_Var PluginVarTracker::GetHostObject(const PP_Var& plugin_object) const { |
- DCHECK(CalledOnValidThread()); |
- |
+ CheckThreadingPreconditions(); |
if (plugin_object.type != PP_VARTYPE_OBJECT) { |
NOTREACHED(); |
return PP_MakeUndefined(); |
@@ -120,8 +119,7 @@ PP_Var PluginVarTracker::GetHostObject(const PP_Var& plugin_object) const { |
PluginDispatcher* PluginVarTracker::DispatcherForPluginObject( |
const PP_Var& plugin_object) const { |
- DCHECK(CalledOnValidThread()); |
- |
+ CheckThreadingPreconditions(); |
if (plugin_object.type != PP_VARTYPE_OBJECT) |
return NULL; |
@@ -137,7 +135,7 @@ PluginDispatcher* PluginVarTracker::DispatcherForPluginObject( |
void PluginVarTracker::ReleaseHostObject(PluginDispatcher* dispatcher, |
const PP_Var& host_object) { |
- DCHECK(CalledOnValidThread()); |
+ CheckThreadingPreconditions(); |
DCHECK(host_object.type == PP_VARTYPE_OBJECT); |
// Convert the host object to a normal var valid in the plugin. |