OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_RENDERER_STATE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_RENDERER_STATE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_RENDERER_STATE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_RENDERER_STATE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
14 | 14 |
15 class WebViewGuest; | 15 class WebViewGuest; |
16 | 16 |
17 // This class keeps track of renderer state for use on the IO thread. All | 17 // This class keeps track of renderer state for use on the IO thread. All |
18 // methods should be called on the IO thread except for Init and Shutdown. | 18 // methods should be called on the IO thread except for Init and Shutdown. |
19 class ExtensionRendererState { | 19 class ExtensionRendererState { |
20 public: | 20 public: |
21 struct WebViewInfo { | 21 struct WebViewInfo { |
22 int embedder_process_id; | 22 int embedder_process_id; |
23 int instance_id; | 23 int instance_id; |
| 24 std::string partition_id; |
24 }; | 25 }; |
25 | 26 |
26 static ExtensionRendererState* GetInstance(); | 27 static ExtensionRendererState* GetInstance(); |
27 | 28 |
28 // These are called on the UI thread to start and stop listening to tab | 29 // These are called on the UI thread to start and stop listening to tab |
29 // notifications. | 30 // notifications. |
30 void Init(); | 31 void Init(); |
31 void Shutdown(); | 32 void Shutdown(); |
32 | 33 |
33 // Looks up the information for the embedder <webview> for a given render | 34 // Looks up the information for the embedder <webview> for a given render |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 void RemoveWebView(int render_process_host_id, int routing_id); | 68 void RemoveWebView(int render_process_host_id, int routing_id); |
68 | 69 |
69 TabObserver* observer_; | 70 TabObserver* observer_; |
70 TabAndWindowIdMap map_; | 71 TabAndWindowIdMap map_; |
71 WebViewInfoMap webview_info_map_; | 72 WebViewInfoMap webview_info_map_; |
72 | 73 |
73 DISALLOW_COPY_AND_ASSIGN(ExtensionRendererState); | 74 DISALLOW_COPY_AND_ASSIGN(ExtensionRendererState); |
74 }; | 75 }; |
75 | 76 |
76 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_RENDERER_STATE_H_ | 77 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_RENDERER_STATE_H_ |
OLD | NEW |