| 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 // WebViewRendererState manages state data for WebView guest renderer processes. | 5 // WebViewRendererState manages state data for WebView guest renderer processes. |
| 6 // | 6 // |
| 7 // This class's data can be accessed via its methods from both the UI and IO | 7 // This class's data can be accessed via its methods from both the UI and IO |
| 8 // threads, and uses locks to mediate this access. When making changes to this | 8 // threads, and uses locks to mediate this access. When making changes to this |
| 9 // class, ensure that you avoid introducing any reentrant code in the methods, | 9 // class, ensure that you avoid introducing any reentrant code in the methods, |
| 10 // and that you always aquire the locks in the order |web_view_info_map_lock_| | 10 // and that you always aquire the locks in the order |web_view_info_map_lock_| |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 void AddContentScriptIDs(int embedder_process_id, | 66 void AddContentScriptIDs(int embedder_process_id, |
| 67 int view_instance_id, | 67 int view_instance_id, |
| 68 const std::set<int>& script_ids); | 68 const std::set<int>& script_ids); |
| 69 void RemoveContentScriptIDs(int embedder_process_id, | 69 void RemoveContentScriptIDs(int embedder_process_id, |
| 70 int view_instance_id, | 70 int view_instance_id, |
| 71 const std::set<int>& script_ids); | 71 const std::set<int>& script_ids); |
| 72 | 72 |
| 73 private: | 73 private: |
| 74 friend class WebViewGuest; | 74 friend class WebViewGuest; |
| 75 friend struct DefaultSingletonTraits<WebViewRendererState>; | 75 friend struct base::DefaultSingletonTraits<WebViewRendererState>; |
| 76 | 76 |
| 77 using RenderId = std::pair<int, int>; | 77 using RenderId = std::pair<int, int>; |
| 78 using WebViewInfoMap = std::map<RenderId, WebViewInfo>; | 78 using WebViewInfoMap = std::map<RenderId, WebViewInfo>; |
| 79 | 79 |
| 80 struct WebViewPartitionInfo { | 80 struct WebViewPartitionInfo { |
| 81 int web_view_count; | 81 int web_view_count; |
| 82 std::string partition_id; | 82 std::string partition_id; |
| 83 WebViewPartitionInfo() {} | 83 WebViewPartitionInfo() {} |
| 84 WebViewPartitionInfo(int count, std::string partition): | 84 WebViewPartitionInfo(int count, std::string partition): |
| 85 web_view_count(count), | 85 web_view_count(count), |
| (...skipping 16 matching lines...) Expand all Loading... |
| 102 mutable base::Lock web_view_info_map_lock_; | 102 mutable base::Lock web_view_info_map_lock_; |
| 103 WebViewPartitionIDMap web_view_partition_id_map_; | 103 WebViewPartitionIDMap web_view_partition_id_map_; |
| 104 mutable base::Lock web_view_partition_id_map_lock_; | 104 mutable base::Lock web_view_partition_id_map_lock_; |
| 105 | 105 |
| 106 DISALLOW_COPY_AND_ASSIGN(WebViewRendererState); | 106 DISALLOW_COPY_AND_ASSIGN(WebViewRendererState); |
| 107 }; | 107 }; |
| 108 | 108 |
| 109 } // namespace extensions | 109 } // namespace extensions |
| 110 | 110 |
| 111 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_RENDERER_STATE_H_ | 111 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_RENDERER_STATE_H_ |
| OLD | NEW |