| 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 // A BrowserPluginGuest is the browser side of a browser <--> embedder | 5 // A BrowserPluginGuest is the browser side of a browser <--> embedder |
| 6 // renderer channel. A BrowserPlugin (a WebPlugin) is on the embedder | 6 // renderer channel. A BrowserPlugin (a WebPlugin) is on the embedder |
| 7 // renderer side of browser <--> embedder renderer communication. | 7 // renderer side of browser <--> embedder renderer communication. |
| 8 // | 8 // |
| 9 // BrowserPluginGuest lives on the UI thread of the browser process. It has a | 9 // BrowserPluginGuest lives on the UI thread of the browser process. It has a |
| 10 // helper, BrowserPluginGuestHelper, which is a RenderViewHostObserver. The | 10 // helper, BrowserPluginGuestHelper, which is a RenderViewHostObserver. The |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 struct BrowserPluginHostMsg_CreateGuest_Params; | 44 struct BrowserPluginHostMsg_CreateGuest_Params; |
| 45 struct BrowserPluginHostMsg_ResizeGuest_Params; | 45 struct BrowserPluginHostMsg_ResizeGuest_Params; |
| 46 struct ViewHostMsg_CreateWindow_Params; | 46 struct ViewHostMsg_CreateWindow_Params; |
| 47 #if defined(OS_MACOSX) | 47 #if defined(OS_MACOSX) |
| 48 struct ViewHostMsg_ShowPopup_Params; | 48 struct ViewHostMsg_ShowPopup_Params; |
| 49 #endif | 49 #endif |
| 50 struct ViewHostMsg_UpdateRect_Params; | 50 struct ViewHostMsg_UpdateRect_Params; |
| 51 class WebCursor; | 51 class WebCursor; |
| 52 struct WebDropData; | 52 struct WebDropData; |
| 53 | 53 |
| 54 namespace gpu { |
| 55 struct Mailbox; |
| 56 } |
| 57 |
| 54 namespace WebKit { | 58 namespace WebKit { |
| 55 class WebInputEvent; | 59 class WebInputEvent; |
| 56 } | 60 } |
| 57 | 61 |
| 58 namespace content { | 62 namespace content { |
| 59 | 63 |
| 60 class BrowserPluginHostFactory; | 64 class BrowserPluginHostFactory; |
| 61 class BrowserPluginEmbedder; | 65 class BrowserPluginEmbedder; |
| 62 class BrowserPluginGuestManager; | 66 class BrowserPluginGuestManager; |
| 63 class RenderProcessHost; | 67 class RenderProcessHost; |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 void SetGeolocationPermission(int request_id, bool allowed); | 189 void SetGeolocationPermission(int request_id, bool allowed); |
| 186 | 190 |
| 187 // Returns the identifier that uniquely identifies a browser plugin guest | 191 // Returns the identifier that uniquely identifies a browser plugin guest |
| 188 // within an embedder. | 192 // within an embedder. |
| 189 int instance_id() const { return instance_id_; } | 193 int instance_id() const { return instance_id_; } |
| 190 | 194 |
| 191 // Allow the embedder to call this for unhandled messages when | 195 // Allow the embedder to call this for unhandled messages when |
| 192 // BrowserPluginGuest is already destroyed. | 196 // BrowserPluginGuest is already destroyed. |
| 193 static void AcknowledgeBufferPresent(int route_id, | 197 static void AcknowledgeBufferPresent(int route_id, |
| 194 int gpu_host_id, | 198 int gpu_host_id, |
| 195 const std::string& mailbox_name, | 199 const gpu::Mailbox& mailbox_name, |
| 196 uint32 sync_point); | 200 uint32 sync_point); |
| 197 | 201 |
| 198 // Returns whether BrowserPluginGuest is interested in receiving the given | 202 // Returns whether BrowserPluginGuest is interested in receiving the given |
| 199 // |message|. | 203 // |message|. |
| 200 static bool ShouldForwardToBrowserPluginGuest(const IPC::Message& message); | 204 static bool ShouldForwardToBrowserPluginGuest(const IPC::Message& message); |
| 201 | 205 |
| 202 private: | 206 private: |
| 203 typedef std::pair<content::MediaStreamRequest, content::MediaResponseCallback> | 207 typedef std::pair<content::MediaStreamRequest, content::MediaResponseCallback> |
| 204 MediaStreamRequestAndCallbackPair; | 208 MediaStreamRequestAndCallbackPair; |
| 205 typedef std::map<int, MediaStreamRequestAndCallbackPair> | 209 typedef std::map<int, MediaStreamRequestAndCallbackPair> |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 // Additionally, it will slow down Javascript execution and garbage | 300 // Additionally, it will slow down Javascript execution and garbage |
| 297 // collection. See RenderThreadImpl::IdleHandler (executed when hidden) and | 301 // collection. See RenderThreadImpl::IdleHandler (executed when hidden) and |
| 298 // RenderThreadImpl::IdleHandlerInForegroundTab (executed when visible). | 302 // RenderThreadImpl::IdleHandlerInForegroundTab (executed when visible). |
| 299 void OnSetVisibility(int instance_id, bool visible); | 303 void OnSetVisibility(int instance_id, bool visible); |
| 300 // Stop loading the guest. Overriden in tests. | 304 // Stop loading the guest. Overriden in tests. |
| 301 virtual void OnStop(int instance_id); | 305 virtual void OnStop(int instance_id); |
| 302 // Message from embedder acknowledging last HW buffer. | 306 // Message from embedder acknowledging last HW buffer. |
| 303 void OnSwapBuffersACK(int instance_id, | 307 void OnSwapBuffersACK(int instance_id, |
| 304 int route_id, | 308 int route_id, |
| 305 int gpu_host_id, | 309 int gpu_host_id, |
| 306 const std::string& mailbox_name, | 310 const gpu::Mailbox& mailbox_name, |
| 307 uint32 sync_point); | 311 uint32 sync_point); |
| 308 | 312 |
| 309 void OnTerminateGuest(int instance_id); | 313 void OnTerminateGuest(int instance_id); |
| 310 void OnUnlockMouse(); | 314 void OnUnlockMouse(); |
| 311 void OnUnlockMouseAck(int instance_id); | 315 void OnUnlockMouseAck(int instance_id); |
| 312 void OnUpdateRectACK( | 316 void OnUpdateRectACK( |
| 313 int instance_id, | 317 int instance_id, |
| 314 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params, | 318 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params, |
| 315 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params); | 319 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params); |
| 316 | 320 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 // if we allow or disallow the request. The key of the map is unique only for | 389 // if we allow or disallow the request. The key of the map is unique only for |
| 386 // a given BrowserPluginGuest. | 390 // a given BrowserPluginGuest. |
| 387 MediaStreamRequestsMap media_requests_map_; | 391 MediaStreamRequestsMap media_requests_map_; |
| 388 | 392 |
| 389 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 393 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
| 390 }; | 394 }; |
| 391 | 395 |
| 392 } // namespace content | 396 } // namespace content |
| 393 | 397 |
| 394 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 398 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
| OLD | NEW |