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 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 5 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 6 #define CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
7 | 7 |
8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h" | 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPlugin.h" |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "base/process_util.h" | 12 #include "base/process_util.h" |
13 #include "base/sequenced_task_runner_helpers.h" | 13 #include "base/sequenced_task_runner_helpers.h" |
14 #if defined(OS_WIN) | 14 #if defined(OS_WIN) |
15 #include "base/shared_memory.h" | 15 #include "base/shared_memory.h" |
16 #endif | 16 #endif |
17 #include "content/renderer/browser_plugin/browser_plugin_backing_store.h" | 17 #include "content/renderer/browser_plugin/browser_plugin_backing_store.h" |
18 #include "content/renderer/browser_plugin/browser_plugin_bindings.h" | 18 #include "content/renderer/browser_plugin/browser_plugin_bindings.h" |
19 #include "content/renderer/render_view_impl.h" | 19 #include "content/renderer/render_view_impl.h" |
20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragStatus.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragStatus.h" |
21 | 21 |
22 struct BrowserPluginHostMsg_AutoSize_Params; | 22 struct BrowserPluginHostMsg_AutoSize_Params; |
23 struct BrowserPluginHostMsg_ResizeGuest_Params; | 23 struct BrowserPluginHostMsg_ResizeGuest_Params; |
24 struct BrowserPluginMsg_LoadCommit_Params; | 24 struct BrowserPluginMsg_LoadCommit_Params; |
25 struct BrowserPluginMsg_UpdateRect_Params; | 25 struct BrowserPluginMsg_UpdateRect_Params; |
26 | 26 |
27 namespace content { | 27 namespace content { |
28 | 28 |
| 29 class BrowserPluginCompositingHelper; |
29 class BrowserPluginManager; | 30 class BrowserPluginManager; |
30 class MockBrowserPlugin; | 31 class MockBrowserPlugin; |
31 | 32 |
32 class CONTENT_EXPORT BrowserPlugin : | 33 class CONTENT_EXPORT BrowserPlugin : |
33 NON_EXPORTED_BASE(public WebKit::WebPlugin) { | 34 NON_EXPORTED_BASE(public WebKit::WebPlugin) { |
34 public: | 35 public: |
35 RenderViewImpl* render_view() const { return render_view_.get(); } | 36 RenderViewImpl* render_view() const { return render_view_.get(); } |
36 | 37 |
37 bool OnMessageReceived(const IPC::Message& msg); | 38 bool OnMessageReceived(const IPC::Message& msg); |
38 | 39 |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 const BrowserPluginMsg_UpdateRect_Params& params); | 235 const BrowserPluginMsg_UpdateRect_Params& params); |
235 | 236 |
236 // Indicates whether the |pending_damage_buffer_| was used to copy over pixels | 237 // Indicates whether the |pending_damage_buffer_| was used to copy over pixels |
237 // given the provided |params|. | 238 // given the provided |params|. |
238 bool UsesPendingDamageBuffer( | 239 bool UsesPendingDamageBuffer( |
239 const BrowserPluginMsg_UpdateRect_Params& params); | 240 const BrowserPluginMsg_UpdateRect_Params& params); |
240 | 241 |
241 // IPC message handlers. | 242 // IPC message handlers. |
242 // Please keep in alphabetical order. | 243 // Please keep in alphabetical order. |
243 void OnAdvanceFocus(int instance_id, bool reverse); | 244 void OnAdvanceFocus(int instance_id, bool reverse); |
| 245 void OnBuffersSwapped(int instance_id, |
| 246 const gfx::Size& size, |
| 247 std::string mailbox_name, |
| 248 int gpu_route_id, |
| 249 int gpu_host_id); |
244 void OnGuestContentWindowReady(int instance_id, | 250 void OnGuestContentWindowReady(int instance_id, |
245 int content_window_routing_id); | 251 int content_window_routing_id); |
246 void OnGuestGone(int instance_id, int process_id, int status); | 252 void OnGuestGone(int instance_id, int process_id, int status); |
247 void OnGuestResponsive(int instance_id, int process_id); | 253 void OnGuestResponsive(int instance_id, int process_id); |
248 void OnGuestUnresponsive(int instance_id, int process_id); | 254 void OnGuestUnresponsive(int instance_id, int process_id); |
249 void OnLoadAbort(int instance_id, | 255 void OnLoadAbort(int instance_id, |
250 const GURL& url, | 256 const GURL& url, |
251 bool is_top_level, | 257 bool is_top_level, |
252 const std::string& type); | 258 const std::string& type); |
253 void OnLoadCommit(int instance_id, | 259 void OnLoadCommit(int instance_id, |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 // the embedder process. It should only be updated in response to navigation | 324 // the embedder process. It should only be updated in response to navigation |
319 // events in the guest. No assumptions should be made about how the index | 325 // events in the guest. No assumptions should be made about how the index |
320 // will change after a navigation (e.g., for back, forward, or go), because | 326 // will change after a navigation (e.g., for back, forward, or go), because |
321 // the changes are not always obvious. For example, there is a maximum | 327 // the changes are not always obvious. For example, there is a maximum |
322 // number of entries and earlier ones will automatically be pruned. | 328 // number of entries and earlier ones will automatically be pruned. |
323 int current_nav_entry_index_; | 329 int current_nav_entry_index_; |
324 int nav_entry_count_; | 330 int nav_entry_count_; |
325 | 331 |
326 // Used for HW compositing. | 332 // Used for HW compositing. |
327 bool compositing_enabled_; | 333 bool compositing_enabled_; |
| 334 scoped_ptr<BrowserPluginCompositingHelper> compositing_helper_; |
328 | 335 |
329 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); | 336 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); |
330 }; | 337 }; |
331 | 338 |
332 } // namespace content | 339 } // namespace content |
333 | 340 |
334 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 341 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
OLD | NEW |