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

Unified Diff: content/renderer/browser_plugin/browser_plugin.h

Issue 444813002: Remove BrowserPlugin's -internal-attach method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't crash on tear down 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/public/renderer/render_frame.h ('k') | content/renderer/browser_plugin/browser_plugin.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/browser_plugin/browser_plugin.h
diff --git a/content/renderer/browser_plugin/browser_plugin.h b/content/renderer/browser_plugin/browser_plugin.h
index ee606a1781c5d0d95e3ef046e92f7cf81b43b946..357ff016e35becb9e047d97277a1e00a76483fe0 100644
--- a/content/renderer/browser_plugin/browser_plugin.h
+++ b/content/renderer/browser_plugin/browser_plugin.h
@@ -33,8 +33,9 @@ class CONTENT_EXPORT BrowserPlugin :
public:
RenderViewImpl* render_view() const { return render_view_.get(); }
int render_view_routing_id() const { return render_view_routing_id_; }
- int guest_instance_id() const { return guest_instance_id_; }
+ int browser_plugin_instance_id() const { return browser_plugin_instance_id_; }
bool attached() const { return attached_; }
+ bool ready() const { return attached_ || attach_pending_; }
BrowserPluginManager* browser_plugin_manager() const {
return browser_plugin_manager_.get();
}
@@ -63,8 +64,6 @@ class CONTENT_EXPORT BrowserPlugin :
// Returns whether the guest process has crashed.
bool guest_crashed() const { return guest_crashed_; }
- // Returns whether this BrowserPlugin has allocated an instance ID.
- bool HasGuestInstanceID() const;
// Informs the guest of an updated focus state.
void UpdateGuestFocusState();
@@ -79,15 +78,15 @@ class CONTENT_EXPORT BrowserPlugin :
void EnableCompositing(bool enable);
// Provided that a guest instance ID has been allocated, this method attaches
- // this BrowserPlugin instance to that guest. |extra_params| are parameters
- // passed in by the content embedder to the browser process.
- void Attach(int guest_instance_id,
- scoped_ptr<base::DictionaryValue> extra_params);
+ // this BrowserPlugin instance to that guest.
+ void Attach();
// Notify the plugin about a compositor commit so that frame ACKs could be
// sent, if needed.
void DidCommitCompositorFrame();
+ static BrowserPlugin* FromNode(blink::WebNode& node);
+
// Returns whether a message should be forwarded to BrowserPlugin.
static bool ShouldForwardToBrowserPlugin(const IPC::Message& message);
@@ -163,8 +162,9 @@ class CONTENT_EXPORT BrowserPlugin :
// A BrowserPlugin object is a controller that represents an instance of a
// browser plugin within the embedder renderer process. Once a BrowserPlugin
// does an initial navigation or is attached to a newly created guest, it
- // acquires a guest_instance_id as well. The guest instance ID uniquely
- // identifies a guest WebContents that's hosted by this BrowserPlugin.
+ // acquires a browser_plugin_instance_id as well. The guest instance ID
+ // uniquely identifies a guest WebContents that's hosted by this
+ // BrowserPlugin.
BrowserPlugin(RenderViewImpl* render_view,
blink::WebFrame* frame,
bool auto_navigate);
@@ -196,7 +196,7 @@ class CONTENT_EXPORT BrowserPlugin :
// IPC message handlers.
// Please keep in alphabetical order.
void OnAdvanceFocus(int instance_id, bool reverse);
- void OnAttachACK(int instance_id);
+ void OnAttachACK(int browser_plugin_instance_id);
void OnBuffersSwapped(int instance_id,
const FrameMsg_BuffersSwapped_Params& params);
void OnCompositorFrameSwapped(const IPC::Message& message);
@@ -213,12 +213,10 @@ class CONTENT_EXPORT BrowserPlugin :
void OnUpdateRect(int instance_id,
const BrowserPluginMsg_UpdateRect_Params& params);
- // This is the browser-process-allocated instance ID that uniquely identifies
- // a guest WebContents.
- int guest_instance_id_;
// This indicates whether this BrowserPlugin has been attached to a
// WebContents.
bool attached_;
+ bool attach_pending_;
const base::WeakPtr<RenderViewImpl> render_view_;
// We cache the |render_view_|'s routing ID because we need it on destruction.
// If the |render_view_| is destroyed before the BrowserPlugin is destroyed
@@ -257,6 +255,9 @@ class CONTENT_EXPORT BrowserPlugin :
// Used to identify the plugin to WebBindings.
scoped_ptr<struct _NPP> npp_;
+ // URL for the embedder frame.
+ int browser_plugin_instance_id_;
+
std::vector<EditCommand> edit_commands_;
// Weak factory used in v8 |MakeWeak| callback, since the v8 callback might
« no previous file with comments | « content/public/renderer/render_frame.h ('k') | content/renderer/browser_plugin/browser_plugin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698