Index: content/renderer/pepper/pepper_plugin_instance_impl.h |
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.h b/content/renderer/pepper/pepper_plugin_instance_impl.h |
index ee66136bd4a0d76f24573849ca4ffe006c654f75..9c2feba033ef28bdc1c40cdcaef87c724e925dd1 100644 |
--- a/content/renderer/pepper/pepper_plugin_instance_impl.h |
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.h |
@@ -23,6 +23,8 @@ |
#include "content/public/renderer/pepper_plugin_instance.h" |
#include "content/public/renderer/render_frame_observer.h" |
#include "content/renderer/mouse_lock_dispatcher.h" |
+#include "content/renderer/pepper/message_channel.h" |
+#include "gin/handle.h" |
#include "ppapi/c/dev/pp_cursor_type_dev.h" |
#include "ppapi/c/dev/ppp_printing_dev.h" |
#include "ppapi/c/dev/ppp_selection_dev.h" |
@@ -102,7 +104,6 @@ namespace content { |
class ContentDecryptorDelegate; |
class FullscreenContainer; |
-class MessageChannel; |
class PepperCompositorHost; |
class PepperGraphics2DHost; |
class PluginModule; |
@@ -134,7 +135,6 @@ class CONTENT_EXPORT PepperPluginInstanceImpl |
const GURL& plugin_url); |
RenderFrameImpl* render_frame() const { return render_frame_; } |
PluginModule* module() const { return module_.get(); } |
- MessageChannel& message_channel() { return *message_channel_; } |
blink::WebPluginContainer* container() const { return container_; } |
@@ -146,6 +146,12 @@ class CONTENT_EXPORT PepperPluginInstanceImpl |
return *resource_creation_.get(); |
} |
+ // This pointer is only valid on the stack. |
+ MessageChannel* GetMessageChannel(); |
+ v8::Local<v8::Object> GetMessageChannelObject(); |
+ |
+ v8::Handle<v8::Context> GetPluginContext(); |
+ |
// Does some pre-destructor cleanup on the instance. This is necessary |
// because some cleanup depends on the plugin instance still existing (like |
// calling the plugin's DidDestroy function). This function is called from |
@@ -189,7 +195,7 @@ class CONTENT_EXPORT PepperPluginInstanceImpl |
bool HandleDocumentLoad(const blink::WebURLResponse& response); |
bool HandleInputEvent(const blink::WebInputEvent& event, |
blink::WebCursorInfo* cursor_info); |
- PP_Var GetInstanceObject(); |
+ PP_Var GetInstanceObject(v8::Isolate* isolate); |
void ViewChanged(const gfx::Rect& position, |
const gfx::Rect& clip, |
const std::vector<gfx::Rect>& cut_outs_rects); |
@@ -518,10 +524,6 @@ class CONTENT_EXPORT PepperPluginInstanceImpl |
// the given module. |
bool IsValidInstanceOf(PluginModule* module); |
- // Returns the plugin NPP identifier that this plugin will use to identify |
- // itself when making NPObject scripting calls to WebBindings. |
- struct _NPP* instanceNPP(); |
- |
// cc::TextureLayerClient implementation. |
virtual bool PrepareTextureMailbox( |
cc::TextureMailbox* mailbox, |
@@ -830,7 +832,7 @@ class CONTENT_EXPORT PepperPluginInstanceImpl |
// The MessageChannel used to implement bidirectional postMessage for the |
// instance. |
- scoped_ptr<MessageChannel> message_channel_; |
+ v8::Persistent<v8::Object> message_channel_; |
// Bitmap for crashed plugin. Lazily initialized, non-owning pointer. |
SkBitmap* sad_plugin_; |
@@ -880,10 +882,6 @@ class CONTENT_EXPORT PepperPluginInstanceImpl |
// The link currently under the cursor. |
base::string16 link_under_cursor_; |
- // Dummy NPP value used when calling in to WebBindings, to allow the bindings |
- // to correctly track NPObjects belonging to this plugin instance. |
- scoped_ptr<struct _NPP> npp_; |
- |
// We store the isolate at construction so that we can be sure to use the |
// Isolate in which this Instance was created when interacting with v8. |
v8::Isolate* isolate_; |