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

Unified Diff: chrome/renderer/plugins/chrome_plugin_placeholder.cc

Issue 107893003: Make the renderer-side prerendering code use RenderFrames instead of RenderViews. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 7 years 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 | « chrome/renderer/plugins/chrome_plugin_placeholder.h ('k') | chrome/renderer/prerender/prerender_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/plugins/chrome_plugin_placeholder.cc
===================================================================
--- chrome/renderer/plugins/chrome_plugin_placeholder.cc (revision 239848)
+++ chrome/renderer/plugins/chrome_plugin_placeholder.cc (working copy)
@@ -13,6 +13,7 @@
#include "chrome/renderer/plugins/plugin_uma.h"
#include "content/public/common/context_menu_params.h"
#include "content/public/renderer/render_frame.h"
+#include "content/public/renderer/render_frame_observer.h"
#include "content/public/renderer/render_thread.h"
#include "content/public/renderer/render_view.h"
#include "grit/generated_resources.h"
@@ -47,6 +48,29 @@
const char ChromePluginPlaceholder::kPluginPlaceholderDataURL[] =
"chrome://pluginplaceholderdata/";
+class ChromePluginPlaceholder::RenderFrameObserver
+ : public content::RenderFrameObserver {
+ public:
+ explicit RenderFrameObserver(ChromePluginPlaceholder* placeholder)
+ : content::RenderFrameObserver(placeholder->GetRenderFrame()),
+ placeholder_(placeholder) {}
+
+ // content::RenderFrameObserver implementation:
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE {
+ // We don't swallow these messages because multiple blocked plugins and
+ // other objects have an interest in them.
+ IPC_BEGIN_MESSAGE_MAP(ChromePluginPlaceholder, message)
+ IPC_MESSAGE_FORWARD(PrerenderMsg_SetIsPrerendering, placeholder_,
+ ChromePluginPlaceholder::OnSetIsPrerendering)
+ IPC_END_MESSAGE_MAP()
+
+ return false;
+ }
+
+ private:
+ ChromePluginPlaceholder* placeholder_;
+};
+
ChromePluginPlaceholder::ChromePluginPlaceholder(
content::RenderView* render_view,
content::RenderFrame* render_frame,
@@ -68,6 +92,8 @@
has_host_(false),
context_menu_request_id_(0) {
RenderThread::Get()->AddObserver(this);
+
+ frame_observer_.reset(new RenderFrameObserver(this));
}
ChromePluginPlaceholder::~ChromePluginPlaceholder() {
@@ -209,11 +235,10 @@
return true;
#endif
- // We don't swallow these messages because multiple blocked plugins have an
- // interest in them.
+ // We don't swallow these messages because multiple blocked plugins and other
+ // objects have an interest in them.
IPC_BEGIN_MESSAGE_MAP(ChromePluginPlaceholder, message)
IPC_MESSAGE_HANDLER(ChromeViewMsg_LoadBlockedPlugins, OnLoadBlockedPlugins)
- IPC_MESSAGE_HANDLER(PrerenderMsg_SetIsPrerendering, OnSetIsPrerendering)
IPC_END_MESSAGE_MAP()
return false;
« no previous file with comments | « chrome/renderer/plugins/chrome_plugin_placeholder.h ('k') | chrome/renderer/prerender/prerender_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698