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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.h

Issue 10829225: Browser Plugin: Add HTML5-like postMessage support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed crash + cleanup Created 8 years, 3 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
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 cf82b9f1493bc7c4a109bddaf8b5cd0855b69482..c4c74218149d40c70ffe6a1d98be756654deffa5 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.h
+++ b/content/browser/browser_plugin/browser_plugin_guest.h
@@ -52,6 +52,7 @@ class Size;
}
struct BrowserPluginHostMsg_ResizeGuest_Params;
+struct ViewMsg_PostMessage_Params;
struct ViewHostMsg_UpdateRect_Params;
namespace content {
@@ -96,6 +97,10 @@ class CONTENT_EXPORT BrowserPluginGuest : public WebContentsDelegate,
// WebContentsDelegate implementation.
virtual void RendererUnresponsive(WebContents* source) OVERRIDE;
+ // Returns the identifier that uniquely identifies a browser plugin guest
+ // within an embedder.
+ int instance_id() const { return instance_id_; }
+
private:
friend class BrowserPluginEmbedder;
friend class BrowserPluginGuestHelper;
@@ -112,9 +117,6 @@ class CONTENT_EXPORT BrowserPluginGuest : public WebContentsDelegate,
RenderProcessHost* embedder_render_process_host() {
return embedder_render_process_host_;
}
- // Returns the identifier that uniquely identifies a browser plugin guest
- // within an embedder.
- int instance_id() const { return instance_id_; }
void SetDamageBuffer(TransportDIB* damage_buffer,
#if defined(OS_WIN)
@@ -127,6 +129,18 @@ class CONTENT_EXPORT BrowserPluginGuest : public WebContentsDelegate,
float damage_buffer_scale_factor() const {
return damage_buffer_scale_factor_;
}
+ void set_swapped_out_embedder_routing_id(int routing_id) {
+ swapped_out_embedder_routing_id_ = routing_id;
+ }
+ int swapped_out_embedder_routing_id() const {
+ return swapped_out_embedder_routing_id_;
+ }
+ void set_swapped_out_guest_routing_id(int routing_id) {
+ swapped_out_guest_routing_id_ = routing_id;
+ }
+ int swapped_out_guest_routing_id() const {
+ return swapped_out_guest_routing_id_;
+ }
void UpdateRect(RenderViewHost* render_view_host,
const ViewHostMsg_UpdateRect_Params& params);
@@ -149,6 +163,9 @@ class CONTENT_EXPORT BrowserPluginGuest : public WebContentsDelegate,
// embedder) instead of default view/widget host.
void HandleInputEventAck(RenderViewHost* render_view_host, bool handled);
+ // Handles postMessages sent from the guest to the embedder.
+ void RouteMessageEvent(const ViewMsg_PostMessage_Params& params);
+
// Helper to send messages to embedder. Overriden in test implementation since
// we want to intercept certain messages for testing.
virtual void SendMessageToEmbedder(IPC::Message*);
@@ -175,6 +192,8 @@ class CONTENT_EXPORT BrowserPluginGuest : public WebContentsDelegate,
IDMap<RenderViewHost> pending_updates_;
int pending_update_counter_;
base::TimeDelta guest_hang_timeout_;
+ int swapped_out_embedder_routing_id_;
+ int swapped_out_guest_routing_id_;
DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest);
};

Powered by Google App Engine
This is Rietveld 408576698