| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 struct BrowserPluginHostMsg_CreateGuest_Params; | 43 struct BrowserPluginHostMsg_CreateGuest_Params; |
| 44 struct BrowserPluginHostMsg_ResizeGuest_Params; | 44 struct BrowserPluginHostMsg_ResizeGuest_Params; |
| 45 struct ViewHostMsg_CreateWindow_Params; | 45 struct ViewHostMsg_CreateWindow_Params; |
| 46 #if defined(OS_MACOSX) | 46 #if defined(OS_MACOSX) |
| 47 struct ViewHostMsg_ShowPopup_Params; | 47 struct ViewHostMsg_ShowPopup_Params; |
| 48 #endif | 48 #endif |
| 49 struct ViewHostMsg_UpdateRect_Params; | 49 struct ViewHostMsg_UpdateRect_Params; |
| 50 class WebCursor; | 50 class WebCursor; |
| 51 struct WebDropData; | 51 struct WebDropData; |
| 52 | 52 |
| 53 namespace gpu { | |
| 54 struct Mailbox; | |
| 55 } | |
| 56 | |
| 57 namespace WebKit { | 53 namespace WebKit { |
| 58 class WebInputEvent; | 54 class WebInputEvent; |
| 59 } | 55 } |
| 60 | 56 |
| 61 namespace content { | 57 namespace content { |
| 62 | 58 |
| 63 class BrowserPluginHostFactory; | 59 class BrowserPluginHostFactory; |
| 64 class BrowserPluginEmbedder; | 60 class BrowserPluginEmbedder; |
| 65 class BrowserPluginGuestManager; | 61 class BrowserPluginGuestManager; |
| 66 class RenderProcessHost; | 62 class RenderProcessHost; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 virtual void SendMessageToEmbedder(IPC::Message* msg); | 174 virtual void SendMessageToEmbedder(IPC::Message* msg); |
| 179 | 175 |
| 180 // Returns the identifier that uniquely identifies a browser plugin guest | 176 // Returns the identifier that uniquely identifies a browser plugin guest |
| 181 // within an embedder. | 177 // within an embedder. |
| 182 int instance_id() const { return instance_id_; } | 178 int instance_id() const { return instance_id_; } |
| 183 | 179 |
| 184 // Allow the embedder to call this for unhandled messages when | 180 // Allow the embedder to call this for unhandled messages when |
| 185 // BrowserPluginGuest is already destroyed. | 181 // BrowserPluginGuest is already destroyed. |
| 186 static void AcknowledgeBufferPresent(int route_id, | 182 static void AcknowledgeBufferPresent(int route_id, |
| 187 int gpu_host_id, | 183 int gpu_host_id, |
| 188 const gpu::Mailbox& mailbox_name, | 184 const std::string& mailbox_name, |
| 189 uint32 sync_point); | 185 uint32 sync_point); |
| 190 | 186 |
| 191 // Returns whether BrowserPluginGuest is interested in receiving the given | 187 // Returns whether BrowserPluginGuest is interested in receiving the given |
| 192 // |message|. | 188 // |message|. |
| 193 static bool ShouldForwardToBrowserPluginGuest(const IPC::Message& message); | 189 static bool ShouldForwardToBrowserPluginGuest(const IPC::Message& message); |
| 194 | 190 |
| 195 private: | 191 private: |
| 196 typedef std::pair<content::MediaStreamRequest, content::MediaResponseCallback> | 192 typedef std::pair<content::MediaStreamRequest, content::MediaResponseCallback> |
| 197 MediaStreamRequestAndCallbackPair; | 193 MediaStreamRequestAndCallbackPair; |
| 198 typedef std::map<int, MediaStreamRequestAndCallbackPair> | 194 typedef std::map<int, MediaStreamRequestAndCallbackPair> |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 // Additionally, it will slow down Javascript execution and garbage | 285 // Additionally, it will slow down Javascript execution and garbage |
| 290 // collection. See RenderThreadImpl::IdleHandler (executed when hidden) and | 286 // collection. See RenderThreadImpl::IdleHandler (executed when hidden) and |
| 291 // RenderThreadImpl::IdleHandlerInForegroundTab (executed when visible). | 287 // RenderThreadImpl::IdleHandlerInForegroundTab (executed when visible). |
| 292 void OnSetVisibility(int instance_id, bool visible); | 288 void OnSetVisibility(int instance_id, bool visible); |
| 293 // Stop loading the guest. Overriden in tests. | 289 // Stop loading the guest. Overriden in tests. |
| 294 virtual void OnStop(int instance_id); | 290 virtual void OnStop(int instance_id); |
| 295 // Message from embedder acknowledging last HW buffer. | 291 // Message from embedder acknowledging last HW buffer. |
| 296 void OnSwapBuffersACK(int instance_id, | 292 void OnSwapBuffersACK(int instance_id, |
| 297 int route_id, | 293 int route_id, |
| 298 int gpu_host_id, | 294 int gpu_host_id, |
| 299 const gpu::Mailbox& mailbox_name, | 295 const std::string& mailbox_name, |
| 300 uint32 sync_point); | 296 uint32 sync_point); |
| 301 | 297 |
| 302 void OnTerminateGuest(int instance_id); | 298 void OnTerminateGuest(int instance_id); |
| 303 void OnUnlockMouse(); | 299 void OnUnlockMouse(); |
| 304 void OnUnlockMouseAck(int instance_id); | 300 void OnUnlockMouseAck(int instance_id); |
| 305 void OnUpdateRectACK( | 301 void OnUpdateRectACK( |
| 306 int instance_id, | 302 int instance_id, |
| 307 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params, | 303 const BrowserPluginHostMsg_AutoSize_Params& auto_size_params, |
| 308 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params); | 304 const BrowserPluginHostMsg_ResizeGuest_Params& resize_guest_params); |
| 309 | 305 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 // if we allow or disallow the request. The key of the map is unique only for | 366 // if we allow or disallow the request. The key of the map is unique only for |
| 371 // a given BrowserPluginGuest. | 367 // a given BrowserPluginGuest. |
| 372 MediaStreamRequestsMap media_requests_map_; | 368 MediaStreamRequestsMap media_requests_map_; |
| 373 | 369 |
| 374 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 370 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
| 375 }; | 371 }; |
| 376 | 372 |
| 377 } // namespace content | 373 } // namespace content |
| 378 | 374 |
| 379 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 375 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
| OLD | NEW |