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

Unified Diff: content/browser/gpu/browser_gpu_channel_host_factory.cc

Issue 11195011: Send vsync timebase updates to the browser compositor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased again. 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
« no previous file with comments | « content/browser/gpu/browser_gpu_channel_host_factory.h ('k') | content/browser/gpu/gpu_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/browser_gpu_channel_host_factory.cc
diff --git a/content/browser/gpu/browser_gpu_channel_host_factory.cc b/content/browser/gpu/browser_gpu_channel_host_factory.cc
index ee6ac87270cf4f10c8f11f05e33557f8622870bd..b0b5513f8cd6660f5502046824590417ffb85f5b 100644
--- a/content/browser/gpu/browser_gpu_channel_host_factory.cc
+++ b/content/browser/gpu/browser_gpu_channel_host_factory.cc
@@ -13,6 +13,7 @@
#include "content/common/child_process_host_impl.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_client.h"
+#include "ipc/ipc_forwarding_message_filter.h"
namespace content {
@@ -290,4 +291,32 @@ GpuChannelHost* BrowserGpuChannelHostFactory::EstablishGpuChannelSync(
return gpu_channel_.get();
}
+// static
+void BrowserGpuChannelHostFactory::AddFilterOnIO(
+ int host_id,
+ scoped_refptr<IPC::ChannelProxy::MessageFilter> filter) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ GpuProcessHost* host = GpuProcessHost::FromID(host_id);
+ if (host)
+ host->AddFilter(filter);
+}
+
+void BrowserGpuChannelHostFactory::SetHandlerForControlMessages(
+ const uint32* message_ids,
+ size_t num_messages,
+ const base::Callback<void(const IPC::Message&)>& handler,
+ base::TaskRunner* target_task_runner) {
+ scoped_refptr<IPC::ForwardingMessageFilter> filter =
+ new IPC::ForwardingMessageFilter(message_ids,
+ num_messages,
+ target_task_runner);
+ filter->AddRoute(MSG_ROUTING_CONTROL, handler);
+
+ GetIOLoopProxy()->PostTask(
+ FROM_HERE,
+ base::Bind(&BrowserGpuChannelHostFactory::AddFilterOnIO,
+ gpu_host_id_,
+ filter));
+}
+
} // namespace content
« no previous file with comments | « content/browser/gpu/browser_gpu_channel_host_factory.h ('k') | content/browser/gpu/gpu_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698