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

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

Issue 11359024: Texture provider to feed data to the impl side thread for webview compositing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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/browser_plugin/browser_plugin_compositing_filter.cc
diff --git a/content/renderer/browser_plugin/browser_plugin_compositing_filter.cc b/content/renderer/browser_plugin/browser_plugin_compositing_filter.cc
new file mode 100644
index 0000000000000000000000000000000000000000..25dc2f0d06eca1de2919d2768e4cfed594eaea1a
--- /dev/null
+++ b/content/renderer/browser_plugin/browser_plugin_compositing_filter.cc
@@ -0,0 +1,47 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/common/browser_plugin_messages.h"
+#include "content/renderer/browser_plugin/browser_plugin_compositing_filter.h"
+
+namespace content {
+
+BrowserPluginCompositingFilter::BrowserPluginCompositingFilter(
+ base::TaskRunner* target_task_runner,
+ int instance_id,
+ const Handler& handler)
+ : target_task_runner_(target_task_runner),
+ instance_id_(instance_id),
+ handler_(handler){
+
+ DCHECK(target_task_runner_);
+ message_ids_to_filter_.insert(BrowserPluginMsg_BuffersSwapped::ID);
+ message_ids_to_filter_.insert(BrowserPluginMsg_SurfaceResize::ID);
+}
+
+int BrowserPluginCompositingFilter::GetPluginInstanceID(
+ const IPC::Message& message) {
+ int instance_id;
+ DCHECK(!message.is_sync());
+ PickleIterator iter(message);
+ bool success = iter.ReadInt(&instance_id);
+ DCHECK(success);
+ return instance_id;
+}
+
+bool BrowserPluginCompositingFilter::OnMessageReceived(
+ const IPC::Message& message) {
+ if (message_ids_to_filter_.find(message.type()) ==
+ message_ids_to_filter_.end() ||
+ GetPluginInstanceID(message) != instance_id_)
+ return false;
+
+ target_task_runner_->PostTask(FROM_HERE, base::Bind(handler_, message));
+ return true;
+}
+
+BrowserPluginCompositingFilter::~BrowserPluginCompositingFilter() {
+}
+
+} // namespace IPC

Powered by Google App Engine
This is Rietveld 408576698