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

Unified Diff: ppapi/proxy/plugin_var_serialization_rules.cc

Issue 6286070: Remove all uses of the global Dispatcher Get function. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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/plugin_resource_tracker_unittest.cc ('k') | ppapi/proxy/plugin_var_tracker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/plugin_var_serialization_rules.cc
===================================================================
--- ppapi/proxy/plugin_var_serialization_rules.cc (revision 74021)
+++ ppapi/proxy/plugin_var_serialization_rules.cc (working copy)
@@ -4,6 +4,7 @@
#include "ppapi/proxy/plugin_var_serialization_rules.h"
+#include "base/logging.h"
#include "ppapi/proxy/plugin_dispatcher.h"
#include "ppapi/proxy/plugin_var_tracker.h"
@@ -42,8 +43,11 @@
return ret;
}
- if (var.type == PP_VARTYPE_OBJECT)
- return var_tracker_->TrackObjectWithNoReference(var, dispatcher);
+ if (var.type == PP_VARTYPE_OBJECT) {
+ DCHECK(dispatcher->IsPlugin());
+ return var_tracker_->TrackObjectWithNoReference(
+ var, static_cast<PluginDispatcher*>(dispatcher));
+ }
return var;
}
@@ -85,7 +89,9 @@
// folded in to its set of refs it maintains (with one ref representing all
// fo them in the browser).
if (var.type == PP_VARTYPE_OBJECT) {
- return var_tracker_->ReceiveObjectPassRef(var, dispatcher);
+ DCHECK(dispatcher->IsPlugin());
+ return var_tracker_->ReceiveObjectPassRef(
+ var, static_cast<PluginDispatcher*>(dispatcher));
}
// Other types are unchanged.
@@ -124,8 +130,10 @@
// The var we have in our inner class has been converted to a host object
// by BeginSendPassRef. This means it's not a normal var valid in the plugin,
// so we need to use the special ReleaseHostObject.
- if (var.type == PP_VARTYPE_OBJECT)
- var_tracker_->ReleaseHostObject(dispatcher, var);
+ if (var.type == PP_VARTYPE_OBJECT) {
+ var_tracker_->ReleaseHostObject(
+ static_cast<PluginDispatcher*>(dispatcher), var);
+ }
}
void PluginVarSerializationRules::ReleaseObjectRef(const PP_Var& var) {
« no previous file with comments | « ppapi/proxy/plugin_resource_tracker_unittest.cc ('k') | ppapi/proxy/plugin_var_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698