OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if defined(OS_WIN) | 5 #if defined(OS_WIN) |
6 #include <windows.h> | 6 #include <windows.h> |
7 #endif | 7 #endif |
8 | 8 |
9 #include "content/browser/renderer_host/gpu_message_filter.h" | 9 #include "content/browser/renderer_host/gpu_message_filter.h" |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 render_widget_helper_(render_widget_helper), | 60 render_widget_helper_(render_widget_helper), |
61 weak_ptr_factory_(this) { | 61 weak_ptr_factory_(this) { |
62 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 62 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
63 } | 63 } |
64 | 64 |
65 GpuMessageFilter::~GpuMessageFilter() { | 65 GpuMessageFilter::~GpuMessageFilter() { |
66 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 66 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
67 EndAllFrameSubscriptions(); | 67 EndAllFrameSubscriptions(); |
68 } | 68 } |
69 | 69 |
70 bool GpuMessageFilter::OnMessageReceived( | 70 bool GpuMessageFilter::OnMessageReceived(const IPC::Message& message) { |
71 const IPC::Message& message, | |
72 bool* message_was_ok) { | |
73 bool handled = true; | 71 bool handled = true; |
74 IPC_BEGIN_MESSAGE_MAP_EX(GpuMessageFilter, message, *message_was_ok) | 72 IPC_BEGIN_MESSAGE_MAP(GpuMessageFilter, message) |
75 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_EstablishGpuChannel, | 73 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_EstablishGpuChannel, |
76 OnEstablishGpuChannel) | 74 OnEstablishGpuChannel) |
77 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_CreateViewCommandBuffer, | 75 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuHostMsg_CreateViewCommandBuffer, |
78 OnCreateViewCommandBuffer) | 76 OnCreateViewCommandBuffer) |
79 IPC_MESSAGE_UNHANDLED(handled = false) | 77 IPC_MESSAGE_UNHANDLED(handled = false) |
80 IPC_END_MESSAGE_MAP_EX() | 78 IPC_END_MESSAGE_MAP() |
81 return handled; | 79 return handled; |
82 } | 80 } |
83 | 81 |
84 void GpuMessageFilter::BeginFrameSubscription( | 82 void GpuMessageFilter::BeginFrameSubscription( |
85 int route_id, | 83 int route_id, |
86 scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) { | 84 scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) { |
87 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 85 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
88 linked_ptr<FrameSubscription> subscription( | 86 linked_ptr<FrameSubscription> subscription( |
89 new FrameSubscription(route_id, subscriber.Pass())); | 87 new FrameSubscription(route_id, subscriber.Pass())); |
90 BeginFrameSubscriptionInternal(subscription); | 88 BeginFrameSubscriptionInternal(subscription); |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 // so it is not necessary to end it. | 256 // so it is not necessary to end it. |
259 if (!host || !subscription->surface_id) | 257 if (!host || !subscription->surface_id) |
260 return; | 258 return; |
261 | 259 |
262 // Note that GpuProcessHost here might not be the same one that frame | 260 // Note that GpuProcessHost here might not be the same one that frame |
263 // subscription has applied. | 261 // subscription has applied. |
264 host->EndFrameSubscription(subscription->surface_id); | 262 host->EndFrameSubscription(subscription->surface_id); |
265 } | 263 } |
266 | 264 |
267 } // namespace content | 265 } // namespace content |
OLD | NEW |