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

Unified Diff: content/renderer/browser_plugin/browser_plugin.cc

Issue 1169983006: Convert BrowserPlugin to render using cc::Surfaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update test to always call UpdateGuestSizeIfNecessary(). Created 5 years, 6 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
« no previous file with comments | « content/renderer/browser_plugin/browser_plugin.h ('k') | content/renderer/child_frame_compositing_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/browser_plugin/browser_plugin.cc
diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc
index a7baff4180e4e432dd328081de41058e2549dd58..1f415b15cb1314436f1112eb1ff288d663973644 100644
--- a/content/renderer/browser_plugin/browser_plugin.cc
+++ b/content/renderer/browser_plugin/browser_plugin.cc
@@ -10,6 +10,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/thread_task_runner_handle.h"
+#include "cc/surfaces/surface.h"
#include "content/common/browser_plugin/browser_plugin_constants.h"
#include "content/common/browser_plugin/browser_plugin_messages.h"
#include "content/common/view_messages.h"
@@ -106,10 +107,33 @@ bool BrowserPlugin::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(BrowserPluginMsg_SetTooltipText, OnSetTooltipText)
IPC_MESSAGE_HANDLER(BrowserPluginMsg_ShouldAcceptTouchEvents,
OnShouldAcceptTouchEvents)
+ IPC_MESSAGE_HANDLER(BrowserPluginMsg_SetChildFrameSurface,
+ OnSetChildFrameSurface)
IPC_END_MESSAGE_MAP()
return handled;
}
+void BrowserPlugin::OnSetChildFrameSurface(
+ int browser_plugin_instance_id,
+ const cc::SurfaceId& surface_id,
+ const gfx::Size& frame_size,
+ float scale_factor,
+ const cc::SurfaceSequence& sequence) {
+ if (!attached())
+ return;
+
+ EnableCompositing(true);
+ DCHECK(compositing_helper_.get());
+
+ compositing_helper_->OnSetSurface(surface_id, frame_size, scale_factor,
+ sequence);
+}
+
+void BrowserPlugin::SendSatisfySequence(const cc::SurfaceSequence& sequence) {
+ BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_SatisfySequence(
+ render_frame_routing_id_, browser_plugin_instance_id_, sequence));
+}
+
void BrowserPlugin::UpdateDOMAttribute(const std::string& attribute_name,
const base::string16& attribute_value) {
if (!container())
« no previous file with comments | « content/renderer/browser_plugin/browser_plugin.h ('k') | content/renderer/child_frame_compositing_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698