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

Unified Diff: content/renderer/pepper/pepper_webplugin_impl.cc

Issue 512983004: Revert of Replace NPObject usage in ppapi with gin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | « content/renderer/pepper/pepper_webplugin_impl.h ('k') | content/renderer/pepper/plugin_object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/pepper_webplugin_impl.cc
diff --git a/content/renderer/pepper/pepper_webplugin_impl.cc b/content/renderer/pepper/pepper_webplugin_impl.cc
index 7c519c4adb50e2598135183858dc45f0f7de075c..828da7a3d87a5209ac1c1e2bceaa0cc7f19b6af1 100644
--- a/content/renderer/pepper/pepper_webplugin_impl.cc
+++ b/content/renderer/pepper/pepper_webplugin_impl.cc
@@ -11,9 +11,9 @@
#include "content/public/common/page_zoom.h"
#include "content/public/renderer/content_renderer_client.h"
#include "content/renderer/pepper/message_channel.h"
+#include "content/renderer/pepper/npobject_var.h"
#include "content/renderer/pepper/pepper_plugin_instance_impl.h"
#include "content/renderer/pepper/plugin_module.h"
-#include "content/renderer/pepper/v8object_var.h"
#include "content/renderer/render_frame_impl.h"
#include "ppapi/shared_impl/ppapi_globals.h"
#include "ppapi/shared_impl/var_tracker.h"
@@ -31,7 +31,7 @@
#include "third_party/WebKit/public/web/WebPrintScalingOption.h"
#include "url/gurl.h"
-using ppapi::V8ObjectVar;
+using ppapi::NPObjectVar;
using blink::WebCanvas;
using blink::WebPlugin;
using blink::WebPluginContainer;
@@ -126,27 +126,29 @@
base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
}
-v8::Local<v8::Object> PepperWebPluginImpl::v8ScriptableObject(
- v8::Isolate* isolate) {
+NPObject* PepperWebPluginImpl::scriptableObject() {
// Call through the plugin to get its instance object. The plugin should pass
// us a reference which we release in destroy().
if (instance_object_.type == PP_VARTYPE_UNDEFINED)
- instance_object_ = instance_->GetInstanceObject(isolate);
+ instance_object_ = instance_->GetInstanceObject();
// GetInstanceObject talked to the plugin which may have removed the instance
// from the DOM, in which case instance_ would be NULL now.
if (!instance_.get())
- return v8::Local<v8::Object>();
-
- scoped_refptr<V8ObjectVar> object_var(
- V8ObjectVar::FromPPVar(instance_object_));
+ return NULL;
+
+ scoped_refptr<NPObjectVar> object(NPObjectVar::FromPPVar(instance_object_));
// If there's an InstanceObject, tell the Instance's MessageChannel to pass
// any non-postMessage calls to it.
- if (object_var.get())
- instance_->message_channel()->SetPassthroughObject(object_var->GetHandle());
-
- v8::Handle<v8::Object> result = instance_->GetMessageChannelObject();
- return result;
-}
+ if (object.get()) {
+ instance_->message_channel().SetPassthroughObject(object->np_object());
+ }
+ NPObject* message_channel_np_object(instance_->message_channel().np_object());
+ // The object is expected to be retained before it is returned.
+ blink::WebBindings::retainObject(message_channel_np_object);
+ return message_channel_np_object;
+}
+
+NPP PepperWebPluginImpl::pluginNPP() { return instance_->instanceNPP(); }
bool PepperWebPluginImpl::getFormValue(WebString& value) { return false; }
« no previous file with comments | « content/renderer/pepper/pepper_webplugin_impl.h ('k') | content/renderer/pepper/plugin_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698