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

Unified Diff: content/renderer/pepper/pepper_plugin_instance_impl.h

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/message_channel.cc ('k') | content/renderer/pepper/pepper_plugin_instance_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 aef12aa3c4a9eefc2aa8ab603a07b4cf6c25d213..4b86e6e67c2eb6af8a76fbc077e6ba8be9674188 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.h
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.h
@@ -23,7 +23,6 @@
#include "content/public/renderer/pepper_plugin_instance.h"
#include "content/public/renderer/render_frame_observer.h"
#include "content/renderer/mouse_lock_dispatcher.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"
@@ -132,6 +131,7 @@
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_; }
@@ -142,9 +142,6 @@
ppapi::thunk::ResourceCreationAPI& resource_creation() {
return *resource_creation_.get();
}
-
- MessageChannel* message_channel() { return message_channel_; }
- v8::Local<v8::Object> GetMessageChannelObject();
// Return the v8 context that the plugin is in.
v8::Local<v8::Context> GetContext();
@@ -192,7 +189,7 @@
bool HandleDocumentLoad(const blink::WebURLResponse& response);
bool HandleInputEvent(const blink::WebInputEvent& event,
blink::WebCursorInfo* cursor_info);
- PP_Var GetInstanceObject(v8::Isolate* isolate);
+ PP_Var GetInstanceObject();
void ViewChanged(const gfx::Rect& position,
const gfx::Rect& clip,
const std::vector<gfx::Rect>& cut_outs_rects);
@@ -521,6 +518,10 @@
// 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,
@@ -829,11 +830,7 @@
// The MessageChannel used to implement bidirectional postMessage for the
// instance.
- v8::Persistent<v8::Object> message_channel_object_;
-
- // A pointer to the MessageChannel underlying |message_channel_object_|. It is
- // only valid as long as |message_channel_object_| is alive.
- MessageChannel* message_channel_;
+ scoped_ptr<MessageChannel> message_channel_;
// Bitmap for crashed plugin. Lazily initialized, non-owning pointer.
SkBitmap* sad_plugin_;
@@ -882,6 +879,10 @@
// 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.
« no previous file with comments | « content/renderer/pepper/message_channel.cc ('k') | content/renderer/pepper/pepper_plugin_instance_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698