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 "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
15 #include "ipc/ipc_message.h" | 15 #include "ipc/ipc_message.h" |
16 | 16 |
17 struct BrowserPluginHostMsg_CreateGuest_Params; | 17 struct BrowserPluginHostMsg_CreateGuest_Params; |
18 struct BrowserPluginHostMsg_ResizeGuest_Params; | 18 struct BrowserPluginHostMsg_ResizeGuest_Params; |
19 class GURL; | 19 class GURL; |
20 | 20 |
21 namespace gfx { | 21 namespace gfx { |
22 class Point; | 22 class Point; |
23 } | 23 } |
24 | 24 |
| 25 namespace gpu { |
| 26 struct Mailbox; |
| 27 } |
| 28 |
25 namespace IPC { | 29 namespace IPC { |
26 class Message; | 30 class Message; |
27 } // namespace IPC | 31 } // namespace IPC |
28 | 32 |
29 namespace content { | 33 namespace content { |
30 | 34 |
31 class BrowserPluginGuest; | 35 class BrowserPluginGuest; |
32 class BrowserPluginHostFactory; | 36 class BrowserPluginHostFactory; |
33 class RenderProcessHostImpl; | 37 class RenderProcessHostImpl; |
34 class SiteInstance; | 38 class SiteInstance; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 BrowserPluginGuest* guest); | 89 BrowserPluginGuest* guest); |
86 | 90 |
87 // Returns an existing SiteInstance if the current profile has a guest of the | 91 // Returns an existing SiteInstance if the current profile has a guest of the |
88 // given |guest_site|. | 92 // given |guest_site|. |
89 SiteInstance* GetGuestSiteInstance(const GURL& guest_site); | 93 SiteInstance* GetGuestSiteInstance(const GURL& guest_site); |
90 | 94 |
91 // Message handlers. | 95 // Message handlers. |
92 void OnUnhandledSwapBuffersACK(int instance_id, | 96 void OnUnhandledSwapBuffersACK(int instance_id, |
93 int route_id, | 97 int route_id, |
94 int gpu_host_id, | 98 int gpu_host_id, |
95 const std::string& mailbox_name, | 99 const gpu::Mailbox& mailbox_name, |
96 uint32 sync_point); | 100 uint32 sync_point); |
97 | 101 |
98 // Static factory instance (always NULL outside of tests). | 102 // Static factory instance (always NULL outside of tests). |
99 static BrowserPluginHostFactory* factory_; | 103 static BrowserPluginHostFactory* factory_; |
100 | 104 |
101 // Contains guests' WebContents, mapping from their instance ids. | 105 // Contains guests' WebContents, mapping from their instance ids. |
102 typedef std::map<int, WebContentsImpl*> GuestInstanceMap; | 106 typedef std::map<int, WebContentsImpl*> GuestInstanceMap; |
103 GuestInstanceMap guest_web_contents_by_instance_id_; | 107 GuestInstanceMap guest_web_contents_by_instance_id_; |
104 int next_instance_id_; | 108 int next_instance_id_; |
105 | 109 |
106 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuestManager); | 110 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuestManager); |
107 }; | 111 }; |
108 | 112 |
109 } // namespace content | 113 } // namespace content |
110 | 114 |
111 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_MANAGER_H_ | 115 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_MANAGER_H_ |
112 | 116 |
OLD | NEW |