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 #include "content/browser/browser_plugin/browser_plugin_message_filter.h" | 5 #include "content/browser/browser_plugin/browser_plugin_message_filter.h" |
6 | 6 |
7 #include "base/supports_user_data.h" | 7 #include "base/supports_user_data.h" |
8 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 8 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
9 #include "content/browser/gpu/gpu_process_host.h" | 9 #include "content/browser/gpu/gpu_process_host.h" |
10 #include "content/browser/web_contents/web_contents_impl.h" | 10 #include "content/browser/web_contents/web_contents_impl.h" |
11 #include "content/common/browser_plugin/browser_plugin_constants.h" | 11 #include "content/common/browser_plugin/browser_plugin_constants.h" |
12 #include "content/common/browser_plugin/browser_plugin_messages.h" | 12 #include "content/common/browser_plugin/browser_plugin_messages.h" |
13 #include "content/common/gpu/gpu_messages.h" | 13 #include "content/common/gpu/gpu_messages.h" |
14 #include "content/common/view_messages.h" | 14 #include "content/common/view_messages.h" |
15 #include "content/public/browser/browser_context.h" | 15 #include "content/public/browser/browser_context.h" |
16 #include "content/public/browser/browser_plugin_guest_manager.h" | 16 #include "content/public/browser/browser_plugin_guest_manager.h" |
17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
18 #include "content/public/browser/render_view_host.h" | 18 #include "content/public/browser/render_view_host.h" |
19 | 19 |
20 namespace content { | 20 namespace content { |
21 | 21 |
22 BrowserPluginMessageFilter::BrowserPluginMessageFilter(int render_process_id, | 22 BrowserPluginMessageFilter::BrowserPluginMessageFilter(int render_process_id) |
23 bool is_guest) | |
24 : BrowserMessageFilter(BrowserPluginMsgStart), | 23 : BrowserMessageFilter(BrowserPluginMsgStart), |
25 render_process_id_(render_process_id), | 24 render_process_id_(render_process_id) { |
26 is_guest_(is_guest) { | |
27 } | 25 } |
28 | 26 |
29 BrowserPluginMessageFilter::~BrowserPluginMessageFilter() { | 27 BrowserPluginMessageFilter::~BrowserPluginMessageFilter() { |
30 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 28 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
31 } | 29 } |
32 | 30 |
33 bool BrowserPluginMessageFilter::OnMessageReceived( | 31 bool BrowserPluginMessageFilter::OnMessageReceived( |
34 const IPC::Message& message) { | 32 const IPC::Message& message) { |
35 // Any message requested by a BrowserPluginGuest should be routed through | 33 // Any message requested by a BrowserPluginGuest should be routed through |
36 // a BrowserPluginGuestManager. | 34 // a BrowserPluginGuestManager. |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 if (!gpu_host) | 94 if (!gpu_host) |
97 return; | 95 return; |
98 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; | 96 AcceleratedSurfaceMsg_BufferPresented_Params ack_params; |
99 ack_params.mailbox = params.mailbox; | 97 ack_params.mailbox = params.mailbox; |
100 ack_params.sync_point = params.sync_point; | 98 ack_params.sync_point = params.sync_point; |
101 gpu_host->Send(new AcceleratedSurfaceMsg_BufferPresented(params.gpu_route_id, | 99 gpu_host->Send(new AcceleratedSurfaceMsg_BufferPresented(params.gpu_route_id, |
102 ack_params)); | 100 ack_params)); |
103 } | 101 } |
104 | 102 |
105 } // namespace content | 103 } // namespace content |
OLD | NEW |