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

Unified Diff: content/renderer/render_view_impl.cc

Issue 10412056: Browser Plugin: Remove MapInstance from BrowserPluginHost + More cross-process navigation work (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simplified size logic Created 8 years, 7 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/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 1bb2373787bc251c0914ddf7c45de945bc4fe72c..b7edfee60011c79abd616bea091ffcf9b40a0a48 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -26,6 +26,7 @@
#include "base/time.h"
#include "base/utf_string_conversions.h"
#include "content/common/appcache/appcache_dispatcher.h"
+#include "content/common/browser_plugin_messages.h"
#include "content/common/child_thread.h"
#include "content/common/clipboard_messages.h"
#include "content/common/database_messages.h"
@@ -55,6 +56,7 @@
#include "content/public/renderer/navigation_state.h"
#include "content/public/renderer/render_view_observer.h"
#include "content/public/renderer/render_view_visitor.h"
+#include "content/renderer/browser_plugin/browser_plugin_channel_manager.h"
#include "content/renderer/browser_plugin/guest_to_embedder_channel.h"
#include "content/renderer/device_orientation_dispatcher.h"
#include "content/renderer/devtools_agent.h"
@@ -775,6 +777,16 @@ void RenderViewImpl::SetReportLoadProgressEnabled(bool enabled) {
load_progress_tracker_.reset(new LoadProgressTracker(this));
}
+content::GuestToEmbedderChannel*
+ RenderViewImpl::guest_to_embedder_channel() const {
jam 2012/05/23 22:11:10 nit: if the function definition is in the cc file,
Fady Samuel 2012/05/23 22:23:43 I left it in the CC file to avoid including guest_
jam 2012/05/23 22:30:20 I'm not following. Why do you need to include gues
+ return guest_to_embedder_channel_;
+}
+
+void RenderViewImpl::set_guest_to_embedder_channel(
+ content::GuestToEmbedderChannel* channel) {
+ guest_to_embedder_channel_ = channel;
+}
+
void RenderViewImpl::PluginCrashed(const FilePath& plugin_path) {
Send(new ViewHostMsg_CrashedPlugin(routing_id_, plugin_path));
}
@@ -950,6 +962,25 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
}
void RenderViewImpl::OnNavigate(const ViewMsg_Navigate_Params& params) {
+ // If we don't have guest-to-embedder channel associated with this RenderView
+ // but we need one, grab one now.
+ if (!params.embedder_channel_name.empty() && !guest_to_embedder_channel()) {
+ content::GuestToEmbedderChannel* embedder_channel =
+ RenderThreadImpl::current()->browser_plugin_channel_manager()->
+ GetChannelByName(params.embedder_channel_name);
+ DCHECK(embedder_channel);
+ set_guest_to_embedder_channel(embedder_channel);
+ host_window_set_ = false;
+ // TODO(fsamuel): This is test code. Need to find a better way to tell
+ // a WebView to drop its context. This needs to change in
+ // GuestToEmbedderChannel::OnContextLost.
+ GetWebView()->loseCompositorContext(1);
+ RenderThreadImpl::current()->browser_plugin_channel_manager()->
+ ReportChannelToEmbedder(this,
+ embedder_channel->embedder_channel_handle(),
+ params.embedder_channel_name,
+ params.embedder_container_id);
+ }
MaybeHandleDebugURL(params.url);
if (!webview())
return;
@@ -3718,8 +3749,9 @@ void RenderViewImpl::GuestReady(PP_Instance instance) {
false,
this);
DCHECK(success);
+ CompleteInit(host_window_);
+ guest_uninitialized_context_ = NULL;
}
- CompleteInit(host_window_);
}
webkit::ppapi::WebPluginImpl* RenderViewImpl::CreateBrowserPlugin(

Powered by Google App Engine
This is Rietveld 408576698