| 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/common/browser_plugin/browser_plugin_message_enums.h" | 17 #include "content/common/browser_plugin/browser_plugin_message_enums.h" |
| 18 #include "content/renderer/browser_plugin/browser_plugin_backing_store.h" | 18 #include "content/renderer/browser_plugin/browser_plugin_backing_store.h" |
| 19 #include "content/renderer/browser_plugin/browser_plugin_bindings.h" | 19 #include "content/renderer/browser_plugin/browser_plugin_bindings.h" |
| 20 #include "content/renderer/mouse_lock_dispatcher.h" | 20 #include "content/renderer/mouse_lock_dispatcher.h" |
| 21 #include "content/renderer/render_view_impl.h" | 21 #include "content/renderer/render_view_impl.h" |
| 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragStatus.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragStatus.h" |
| 23 | 23 |
| 24 struct BrowserPluginHostMsg_AutoSize_Params; | 24 struct BrowserPluginHostMsg_AutoSize_Params; |
| 25 struct BrowserPluginHostMsg_ResizeGuest_Params; | 25 struct BrowserPluginHostMsg_ResizeGuest_Params; |
| 26 struct BrowserPluginMsg_Attach_ACK_Params; |
| 26 struct BrowserPluginMsg_LoadCommit_Params; | 27 struct BrowserPluginMsg_LoadCommit_Params; |
| 27 struct BrowserPluginMsg_UpdateRect_Params; | 28 struct BrowserPluginMsg_UpdateRect_Params; |
| 28 | 29 |
| 29 namespace content { | 30 namespace content { |
| 30 | 31 |
| 31 class BrowserPluginCompositingHelper; | 32 class BrowserPluginCompositingHelper; |
| 32 class BrowserPluginManager; | 33 class BrowserPluginManager; |
| 33 class MockBrowserPlugin; | 34 class MockBrowserPlugin; |
| 34 | 35 |
| 35 class CONTENT_EXPORT BrowserPlugin : | 36 class CONTENT_EXPORT BrowserPlugin : |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 // object goes out of scope in JavaScript. | 317 // object goes out of scope in JavaScript. |
| 317 void OnRequestObjectGarbageCollected(int request_id); | 318 void OnRequestObjectGarbageCollected(int request_id); |
| 318 // V8 garbage collection callback for |object|. | 319 // V8 garbage collection callback for |object|. |
| 319 static void WeakCallbackForPersistObject(v8::Isolate* isolate, | 320 static void WeakCallbackForPersistObject(v8::Isolate* isolate, |
| 320 v8::Persistent<v8::Value> object, | 321 v8::Persistent<v8::Value> object, |
| 321 void* param); | 322 void* param); |
| 322 | 323 |
| 323 // IPC message handlers. | 324 // IPC message handlers. |
| 324 // Please keep in alphabetical order. | 325 // Please keep in alphabetical order. |
| 325 void OnAdvanceFocus(int instance_id, bool reverse); | 326 void OnAdvanceFocus(int instance_id, bool reverse); |
| 327 void OnAttachACK(int instance_id, |
| 328 const BrowserPluginMsg_Attach_ACK_Params& ack_params); |
| 326 void OnBuffersSwapped(int instance_id, | 329 void OnBuffersSwapped(int instance_id, |
| 327 const gfx::Size& size, | 330 const gfx::Size& size, |
| 328 std::string mailbox_name, | 331 std::string mailbox_name, |
| 329 int gpu_route_id, | 332 int gpu_route_id, |
| 330 int gpu_host_id); | 333 int gpu_host_id); |
| 331 void OnCompositorFrameSwapped(const IPC::Message& message); | 334 void OnCompositorFrameSwapped(const IPC::Message& message); |
| 332 void OnGuestContentWindowReady(int instance_id, | 335 void OnGuestContentWindowReady(int instance_id, |
| 333 int content_window_routing_id); | 336 int content_window_routing_id); |
| 334 void OnGuestGone(int instance_id, int process_id, int status); | 337 void OnGuestGone(int instance_id, int process_id, int status); |
| 335 void OnGuestResponsive(int instance_id, int process_id); | 338 void OnGuestResponsive(int instance_id, int process_id); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 int content_window_routing_id_; | 388 int content_window_routing_id_; |
| 386 bool plugin_focused_; | 389 bool plugin_focused_; |
| 387 // Tracks the visibility of the browser plugin regardless of the whole | 390 // Tracks the visibility of the browser plugin regardless of the whole |
| 388 // embedder RenderView's visibility. | 391 // embedder RenderView's visibility. |
| 389 bool visible_; | 392 bool visible_; |
| 390 | 393 |
| 391 WebCursor cursor_; | 394 WebCursor cursor_; |
| 392 | 395 |
| 393 gfx::Size last_view_size_; | 396 gfx::Size last_view_size_; |
| 394 bool size_changed_in_flight_; | 397 bool size_changed_in_flight_; |
| 395 bool allocate_instance_id_sent_; | 398 bool before_first_navigation_; |
| 396 | 399 |
| 397 // Each permission request item in the map is a pair of request id and | 400 // Each permission request item in the map is a pair of request id and |
| 398 // permission type. | 401 // permission type. |
| 399 typedef std::map<int, BrowserPluginPermissionType> PendingPermissionRequests; | 402 typedef std::map<int, BrowserPluginPermissionType> PendingPermissionRequests; |
| 400 PendingPermissionRequests pending_permission_requests_; | 403 PendingPermissionRequests pending_permission_requests_; |
| 401 | 404 |
| 402 typedef std::pair<int, base::WeakPtr<BrowserPlugin> > | 405 typedef std::pair<int, base::WeakPtr<BrowserPlugin> > |
| 403 AliveV8PermissionRequestItem; | 406 AliveV8PermissionRequestItem; |
| 404 std::map<int, AliveV8PermissionRequestItem*> | 407 std::map<int, AliveV8PermissionRequestItem*> |
| 405 alive_v8_permission_request_objects_; | 408 alive_v8_permission_request_objects_; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 429 // Weak factory used in v8 |MakeWeak| callback, since the v8 callback might | 432 // Weak factory used in v8 |MakeWeak| callback, since the v8 callback might |
| 430 // get called after BrowserPlugin has been destroyed. | 433 // get called after BrowserPlugin has been destroyed. |
| 431 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; | 434 base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_; |
| 432 | 435 |
| 433 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); | 436 DISALLOW_COPY_AND_ASSIGN(BrowserPlugin); |
| 434 }; | 437 }; |
| 435 | 438 |
| 436 } // namespace content | 439 } // namespace content |
| 437 | 440 |
| 438 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ | 441 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_BROWSER_PLUGIN_H_ |
| OLD | NEW |