| Index: content/browser/browser_plugin/browser_plugin_guest.h
|
| diff --git a/content/browser/browser_plugin/browser_plugin_guest.h b/content/browser/browser_plugin/browser_plugin_guest.h
|
| index d3cd739c8fdd53dd352281cc44a437821833909d..178ee760b77582cffa4c7442f86fe55b1a1672a6 100644
|
| --- a/content/browser/browser_plugin/browser_plugin_guest.h
|
| +++ b/content/browser/browser_plugin/browser_plugin_guest.h
|
| @@ -46,6 +46,7 @@ struct FrameHostMsg_ReclaimCompositorResources_Params;
|
| #if defined(OS_MACOSX)
|
| struct FrameHostMsg_ShowPopup_Params;
|
| #endif
|
| +struct FrameMsg_CompositorFrameSwapped_Params;
|
|
|
| namespace blink {
|
| class WebInputEvent;
|
| @@ -126,6 +127,8 @@ class CONTENT_EXPORT BrowserPluginGuest : public WebContentsObserver {
|
| // within an embedder.
|
| int browser_plugin_instance_id() const { return browser_plugin_instance_id_; }
|
|
|
| + void Init();
|
| +
|
| bool OnMessageReceivedFromEmbedder(const IPC::Message& message);
|
|
|
| WebContentsImpl* embedder_web_contents() const {
|
| @@ -216,9 +219,8 @@ class CONTENT_EXPORT BrowserPluginGuest : public WebContentsObserver {
|
|
|
| void WillDestroy();
|
|
|
| - void Initialize(int browser_plugin_instance_id,
|
| - const BrowserPluginHostMsg_Attach_Params& params,
|
| - WebContentsImpl* embedder_web_contents);
|
| + void InitInternal(const BrowserPluginHostMsg_Attach_Params& params,
|
| + WebContentsImpl* owner_web_contents);
|
|
|
| bool InAutoSizeBounds(const gfx::Size& size) const;
|
|
|
| @@ -252,7 +254,8 @@ class CONTENT_EXPORT BrowserPluginGuest : public WebContentsObserver {
|
| void OnLockMouseAck(int instance_id, bool succeeded);
|
| // Resizes the guest's web contents.
|
| void OnResizeGuest(
|
| - int instance_id, const BrowserPluginHostMsg_ResizeGuest_Params& params);
|
| + int browser_plugin_instance_id,
|
| + const BrowserPluginHostMsg_ResizeGuest_Params& params);
|
| void OnSetFocus(int instance_id, bool focused);
|
| // Sets the name of the guest so that other guests in the same partition can
|
| // access it.
|
| @@ -358,6 +361,10 @@ class CONTENT_EXPORT BrowserPluginGuest : public WebContentsObserver {
|
|
|
| bool is_in_destruction_;
|
|
|
| + // BrowserPluginGuest::Init can only be called once. This flag allows it to
|
| + // exit early if it's already been called.
|
| + bool initialized_;
|
| +
|
| // Text input type states.
|
| ui::TextInputType last_text_input_type_;
|
| ui::TextInputMode last_input_mode_;
|
| @@ -368,6 +375,15 @@ class CONTENT_EXPORT BrowserPluginGuest : public WebContentsObserver {
|
| // WebContents in the embedder's process.
|
| int guest_proxy_routing_id_;
|
|
|
| + // Guests generate frames and send a CompositorFrameSwapped (CFS) message
|
| + // indicating the next frame is ready to be positioned and composited.
|
| + // Subsequent frames are not generated until the IPC is ACKed. We would like
|
| + // to ensure that the guest generates frames on attachment so we directly ACK
|
| + // an unACKed CFS. ACKs could get lost between the time a guest is detached
|
| + // from a container and the time it is attached elsewhere. This mitigates this
|
| + // race by ensuring the guest is ACKed on attachment.
|
| + scoped_ptr<FrameMsg_CompositorFrameSwapped_Params> pending_frame_;
|
| +
|
| // This is a queue of messages that are destined to be sent to the embedder
|
| // once the guest is attached to a particular embedder.
|
| std::deque<linked_ptr<IPC::Message> > pending_messages_;
|
|
|