summaryrefslogtreecommitdiffstats
path: root/content/renderer
diff options
context:
space:
mode:
authorfsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-17 19:49:09 +0000
committerfsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-17 19:49:09 +0000
commit6d04e15cd579efcb7ff014a92d53121cdaba9a5f (patch)
tree4565d88b5827ccb124818b26c4a7d211bda980a9 /content/renderer
parentf04822efba0269001d4082466aec58fecb88f6da (diff)
downloadchromium_src-6d04e15cd579efcb7ff014a92d53121cdaba9a5f.zip
chromium_src-6d04e15cd579efcb7ff014a92d53121cdaba9a5f.tar.gz
chromium_src-6d04e15cd579efcb7ff014a92d53121cdaba9a5f.tar.bz2
Revert 162487 - Browser Plugin: Add HTML5-like postMessage support
This is an implementation of HTML5-like postMessage support for the browser plugin. It works as follows: In BrowserPluginEmbedder:NavigateGuest, the browser process creates two swapped out RenderView: A swapped out RenderView for the guest in the embedder render process and a swapped out RenderView for the embedder in the guest render process. The guest RenderView in the embedder process can be accessed via browserPlugin.contentWindow or through the MessageEvent object received from the guest, event.source. The embedder RenderView in the guest process can be accessed through the MessageEvent object on message events, event.source. BrowserPluginEmbedderHelper, and BrowserPluginGuestHelper intercept ViewHostMsg_RouteMessageEvent messages from the swapped out RenderViews and route them appropriately. Note: BrowserPluginBindings now registers add/removeCustomEventListener instead of add/removeEventListener so that the default WebKit implementations are not shadowed by the custom implementations to allow for WebKit MessageEvents to be registered. BUG=141238 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=162353 Review URL: https://codereview.chromium.org/10829225 TBR=fsamuel@chromium.org Review URL: https://codereview.chromium.org/11185036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162492 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer')
-rw-r--r--content/renderer/browser_plugin/browser_plugin.cc17
-rw-r--r--content/renderer/browser_plugin/browser_plugin.h7
-rw-r--r--content/renderer/browser_plugin/browser_plugin_bindings.cc15
-rw-r--r--content/renderer/browser_plugin/browser_plugin_manager_impl.cc9
-rw-r--r--content/renderer/browser_plugin/browser_plugin_manager_impl.h1
5 files changed, 0 insertions, 49 deletions
diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc
index d74cab2..6139b83 100644
--- a/content/renderer/browser_plugin/browser_plugin.cc
+++ b/content/renderer/browser_plugin/browser_plugin.cc
@@ -72,7 +72,6 @@ BrowserPlugin::BrowserPlugin(
navigate_src_sent_(false),
process_id_(-1),
persist_storage_(false),
- content_window_routing_id_(MSG_ROUTING_NONE),
visible_(true),
current_nav_entry_index_(0),
nav_entry_count_(0) {
@@ -135,17 +134,6 @@ void BrowserPlugin::SetSrcAttribute(const std::string& src) {
src_ = src;
}
-NPObject* BrowserPlugin::GetContentWindow() const {
- if (content_window_routing_id_ == MSG_ROUTING_NONE)
- return NULL;
- RenderViewImpl* guest_render_view = static_cast<RenderViewImpl*>(
- ChildThread::current()->ResolveRoute(content_window_routing_id_));
- if (!guest_render_view)
- return NULL;
- WebKit::WebFrame* guest_frame = guest_render_view->GetWebView()->mainFrame();
- return guest_frame->windowObject();
-}
-
std::string BrowserPlugin::GetPartitionAttribute() const {
std::string value;
if (persist_storage_)
@@ -498,11 +486,6 @@ void BrowserPlugin::AdvanceFocus(bool reverse) {
render_view_->GetWebView()->advanceFocus(reverse);
}
-void BrowserPlugin::GuestContentWindowReady(int content_window_routing_id) {
- DCHECK(content_window_routing_id != MSG_ROUTING_NONE);
- content_window_routing_id_ = content_window_routing_id;
-}
-
void BrowserPlugin::SetAcceptTouchEvents(bool accept) {
if (container())
container()->setIsAcceptingTouchEvents(accept);
diff --git a/content/renderer/browser_plugin/browser_plugin.h b/content/renderer/browser_plugin/browser_plugin.h
index 359b8b0..f646f3c2 100644
--- a/content/renderer/browser_plugin/browser_plugin.h
+++ b/content/renderer/browser_plugin/browser_plugin.h
@@ -38,8 +38,6 @@ class CONTENT_EXPORT BrowserPlugin :
// Set the src attribute value of the BrowserPlugin instance and reset
// the guest_crashed_ flag.
void SetSrcAttribute(const std::string& src);
- // Get the guest's DOMWindow proxy.
- NPObject* GetContentWindow() const;
// Returns Chrome's process ID for the current guest.
int process_id() const { return process_id_; }
// The partition identifier string is stored as UTF-8.
@@ -74,10 +72,6 @@ class CONTENT_EXPORT BrowserPlugin :
// element.
void AdvanceFocus(bool reverse);
- // Inform the BrowserPlugin that the guest's contentWindow is ready,
- // and provide it with a routing ID to grab it.
- void GuestContentWindowReady(int content_window_routing_id);
-
// Informs the BrowserPlugin that the guest has started/stopped accepting
// touch events.
void SetAcceptTouchEvents(bool accept);
@@ -208,7 +202,6 @@ class CONTENT_EXPORT BrowserPlugin :
int process_id_;
std::string storage_partition_id_;
bool persist_storage_;
- int content_window_routing_id_;
// Tracks the visibility of the browser plugin regardless of the whole
// embedder RenderView's visibility.
bool visible_;
diff --git a/content/renderer/browser_plugin/browser_plugin_bindings.cc b/content/renderer/browser_plugin/browser_plugin_bindings.cc
index b0dfca7..bf94852 100644
--- a/content/renderer/browser_plugin/browser_plugin_bindings.cc
+++ b/content/renderer/browser_plugin/browser_plugin_bindings.cc
@@ -41,7 +41,6 @@ const char kAddEventListener[] = "addEventListener";
const char kBackMethod[] = "back";
const char kCanGoBack[] = "canGoBack";
const char kCanGoForward[] = "canGoForward";
-const char kContentWindow[] = "contentWindow";
const char kForwardMethod[] = "forward";
const char kGetProcessId[] = "getProcessId";
const char kGoMethod[] = "go";
@@ -57,10 +56,6 @@ BrowserPluginBindings* GetBindings(NPObject* object) {
message_channel;
}
-bool IdentifierIsContentWindow(NPIdentifier identifier) {
- return WebBindings::getStringIdentifier(kContentWindow) == identifier;
-}
-
bool IdentifierIsPartitionAttribute(NPIdentifier identifier) {
return WebBindings::getStringIdentifier(kPartitionAttribute) == identifier;
}
@@ -146,7 +141,6 @@ bool BrowserPluginBindingsInvokeDefault(NPObject* np_obj,
bool BrowserPluginBindingsHasProperty(NPObject* np_obj, NPIdentifier name) {
return IdentifierIsSrcAttribute(name) ||
- IdentifierIsContentWindow(name) ||
IdentifierIsPartitionAttribute(name);
}
@@ -169,15 +163,6 @@ bool BrowserPluginBindingsGetProperty(NPObject* np_obj, NPIdentifier name,
return StringToNPVariant(src, result);
}
- if (IdentifierIsContentWindow(name)) {
- NPObject* obj = bindings->instance()->GetContentWindow();
- if (obj) {
- result->type = NPVariantType_Object;
- result->value.objectValue = WebBindings::retainObject(obj);
- }
- return true;
- }
-
if (IdentifierIsPartitionAttribute(name)) {
std::string partition_id = bindings->instance()->GetPartitionAttribute();
return StringToNPVariant(partition_id, result);
diff --git a/content/renderer/browser_plugin/browser_plugin_manager_impl.cc b/content/renderer/browser_plugin/browser_plugin_manager_impl.cc
index 8b4226a..a88b34f 100644
--- a/content/renderer/browser_plugin/browser_plugin_manager_impl.cc
+++ b/content/renderer/browser_plugin/browser_plugin_manager_impl.cc
@@ -39,8 +39,6 @@ bool BrowserPluginManagerImpl::OnControlMessageReceived(
IPC_MESSAGE_HANDLER(BrowserPluginMsg_GuestCrashed, OnGuestCrashed)
IPC_MESSAGE_HANDLER(BrowserPluginMsg_DidNavigate, OnDidNavigate)
IPC_MESSAGE_HANDLER(BrowserPluginMsg_AdvanceFocus, OnAdvanceFocus)
- IPC_MESSAGE_HANDLER(BrowserPluginMsg_GuestContentWindowReady,
- OnGuestContentWindowReady)
IPC_MESSAGE_HANDLER(BrowserPluginMsg_ShouldAcceptTouchEvents,
OnShouldAcceptTouchEvents)
IPC_MESSAGE_HANDLER(BrowserPluginMsg_LoadStart, OnLoadStart)
@@ -80,13 +78,6 @@ void BrowserPluginManagerImpl::OnAdvanceFocus(int instance_id, bool reverse) {
plugin->AdvanceFocus(reverse);
}
-void BrowserPluginManagerImpl::OnGuestContentWindowReady(int instance_id,
- int guest_routing_id) {
- BrowserPlugin* plugin = GetBrowserPlugin(instance_id);
- if (plugin)
- plugin->GuestContentWindowReady(guest_routing_id);
-}
-
void BrowserPluginManagerImpl::OnShouldAcceptTouchEvents(int instance_id,
bool accept) {
BrowserPlugin* plugin = GetBrowserPlugin(instance_id);
diff --git a/content/renderer/browser_plugin/browser_plugin_manager_impl.h b/content/renderer/browser_plugin/browser_plugin_manager_impl.h
index 28e1486..9a53f78 100644
--- a/content/renderer/browser_plugin/browser_plugin_manager_impl.h
+++ b/content/renderer/browser_plugin/browser_plugin_manager_impl.h
@@ -37,7 +37,6 @@ class BrowserPluginManagerImpl : public BrowserPluginManager {
void OnDidNavigate(int instance_id,
const BrowserPluginMsg_DidNavigate_Params& params);
void OnAdvanceFocus(int instance_id, bool reverse);
- void OnGuestContentWindowReady(int instance_id, int guest_routing_id);
void OnShouldAcceptTouchEvents(int instance_id, bool accept);
void OnLoadStart(int instance_id,
const GURL& url,