| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_RENDERER_STATE_H_ | 5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_RENDERER_STATE_H_ |
| 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_RENDERER_STATE_H_ | 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_RENDERER_STATE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/memory/singleton.h" | 12 #include "base/memory/singleton.h" |
| 13 | 13 |
| 14 namespace extensions { | 14 namespace extensions { |
| 15 | 15 |
| 16 class WebViewGuest; | 16 class WebViewGuest; |
| 17 | 17 |
| 18 // This class keeps track of <webview> renderer state for use on the IO thread. | 18 // This class keeps track of <webview> renderer state for use on the IO thread. |
| 19 // All methods should be called on the IO thread. | 19 // All methods should be called on the IO thread. |
| 20 class WebViewRendererState { | 20 class WebViewRendererState { |
| 21 public: | 21 public: |
| 22 struct WebViewInfo { | 22 struct WebViewInfo { |
| 23 int embedder_process_id; | 23 int embedder_process_id; |
| 24 int instance_id; | 24 int instance_id; |
| 25 int rules_registry_id; |
| 25 std::string partition_id; | 26 std::string partition_id; |
| 26 std::string embedder_extension_id; | 27 std::string embedder_extension_id; |
| 27 }; | 28 }; |
| 28 | 29 |
| 29 static WebViewRendererState* GetInstance(); | 30 static WebViewRendererState* GetInstance(); |
| 30 | 31 |
| 31 // Looks up the information for the embedder <webview> for a given render | 32 // Looks up the information for the embedder <webview> for a given render |
| 32 // view, if one exists. Called on the IO thread. | 33 // view, if one exists. Called on the IO thread. |
| 33 bool GetInfo(int guest_process_id, int guest_routing_id, | 34 bool GetInfo(int guest_process_id, int guest_routing_id, |
| 34 WebViewInfo* webview_info); | 35 WebViewInfo* webview_info); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 69 |
| 69 WebViewInfoMap webview_info_map_; | 70 WebViewInfoMap webview_info_map_; |
| 70 WebViewPartitionIDMap webview_partition_id_map_; | 71 WebViewPartitionIDMap webview_partition_id_map_; |
| 71 | 72 |
| 72 DISALLOW_COPY_AND_ASSIGN(WebViewRendererState); | 73 DISALLOW_COPY_AND_ASSIGN(WebViewRendererState); |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 } // namespace extensions | 76 } // namespace extensions |
| 76 | 77 |
| 77 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_RENDERER_STATE_H_ | 78 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_RENDERER_STATE_H_ |
| OLD | NEW |