| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 BrowserPluginGuestManager serves as a message router to BrowserPluginGuests | 5 // A BrowserPluginGuestManager serves as a message router to BrowserPluginGuests |
| 6 // for all guests within a given profile. | 6 // for all guests within a given profile. |
| 7 // Messages are routed to a particular guest instance based on an instance_id. | 7 // Messages are routed to a particular guest instance based on an instance_id. |
| 8 | 8 |
| 9 #ifndef CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_MANAGER_H_ | 9 #ifndef CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_MANAGER_H_ |
| 10 #define CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_MANAGER_H_ | 10 #define CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_MANAGER_H_ |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/supports_user_data.h" | 13 #include "base/supports_user_data.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
| 16 #include "ipc/ipc_message.h" | 16 #include "ipc/ipc_message.h" |
| 17 | 17 |
| 18 struct BrowserPluginHostMsg_Attach_Params; | 18 struct BrowserPluginHostMsg_Attach_Params; |
| 19 struct BrowserPluginHostMsg_ResizeGuest_Params; | 19 struct BrowserPluginHostMsg_ResizeGuest_Params; |
| 20 struct FrameHostMsg_BuffersSwappedACK_Params; |
| 20 class GURL; | 21 class GURL; |
| 21 | 22 |
| 22 namespace gfx { | 23 namespace gfx { |
| 23 class Point; | 24 class Point; |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace IPC { | 27 namespace IPC { |
| 27 class Message; | 28 class Message; |
| 28 } // namespace IPC | 29 } // namespace IPC |
| 29 | 30 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // is not permitted to use that instance ID or access the associated guest, | 111 // is not permitted to use that instance ID or access the associated guest, |
| 111 // then it returns false. | 112 // then it returns false. |
| 112 bool CanEmbedderAccessInstanceID(int embedder_render_process_id, | 113 bool CanEmbedderAccessInstanceID(int embedder_render_process_id, |
| 113 int instance_id) const; | 114 int instance_id) const; |
| 114 | 115 |
| 115 // Returns an existing SiteInstance if the current profile has a guest of the | 116 // Returns an existing SiteInstance if the current profile has a guest of the |
| 116 // given |guest_site|. | 117 // given |guest_site|. |
| 117 SiteInstance* GetGuestSiteInstance(const GURL& guest_site); | 118 SiteInstance* GetGuestSiteInstance(const GURL& guest_site); |
| 118 | 119 |
| 119 // Message handlers. | 120 // Message handlers. |
| 120 void OnUnhandledSwapBuffersACK(int instance_id, | 121 void OnUnhandledSwapBuffersACK( |
| 121 int route_id, | 122 int instance_id, |
| 122 int gpu_host_id, | 123 const FrameHostMsg_BuffersSwappedACK_Params& params); |
| 123 const std::string& mailbox_name, | |
| 124 uint32 sync_point); | |
| 125 | 124 |
| 126 // Static factory instance (always NULL outside of tests). | 125 // Static factory instance (always NULL outside of tests). |
| 127 static BrowserPluginHostFactory* factory_; | 126 static BrowserPluginHostFactory* factory_; |
| 128 | 127 |
| 129 // Contains guests' WebContents, mapping from their instance ids. | 128 // Contains guests' WebContents, mapping from their instance ids. |
| 130 typedef std::map<int, WebContentsImpl*> GuestInstanceMap; | 129 typedef std::map<int, WebContentsImpl*> GuestInstanceMap; |
| 131 GuestInstanceMap guest_web_contents_by_instance_id_; | 130 GuestInstanceMap guest_web_contents_by_instance_id_; |
| 132 int next_instance_id_; | 131 int next_instance_id_; |
| 133 | 132 |
| 134 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuestManager); | 133 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuestManager); |
| 135 }; | 134 }; |
| 136 | 135 |
| 137 } // namespace content | 136 } // namespace content |
| 138 | 137 |
| 139 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_MANAGER_H_ | 138 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_MANAGER_H_ |
| 140 | 139 |
| OLD | NEW |