OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_EXTENSION_API_FRAME_ID_MAP_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_API_FRAME_ID_MAP_H_ |
6 #define EXTENSIONS_BROWSER_EXTENSION_API_FRAME_ID_MAP_H_ | 6 #define EXTENSIONS_BROWSER_EXTENSION_API_FRAME_ID_MAP_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <memory> | 10 #include <memory> |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 // If this method is not called, the cached mapping for the frame is retained | 134 // If this method is not called, the cached mapping for the frame is retained |
135 // forever. | 135 // forever. |
136 void RemoveFrameData(content::RenderFrameHost* rfh); | 136 void RemoveFrameData(content::RenderFrameHost* rfh); |
137 | 137 |
138 // Updates the tab and window id for the given RenderFrameHost, if any exists. | 138 // Updates the tab and window id for the given RenderFrameHost, if any exists. |
139 void UpdateTabAndWindowId(int tab_id, | 139 void UpdateTabAndWindowId(int tab_id, |
140 int window_id, | 140 int window_id, |
141 content::RenderFrameHost* rfh); | 141 content::RenderFrameHost* rfh); |
142 | 142 |
143 protected: | 143 protected: |
144 friend struct base::DefaultLazyInstanceTraits<ExtensionApiFrameIdMap>; | 144 friend struct base::LazyInstanceTraitsBase<ExtensionApiFrameIdMap>; |
145 | 145 |
146 // A set of identifiers that uniquely identifies a RenderFrame. | 146 // A set of identifiers that uniquely identifies a RenderFrame. |
147 struct RenderFrameIdKey { | 147 struct RenderFrameIdKey { |
148 RenderFrameIdKey(); | 148 RenderFrameIdKey(); |
149 RenderFrameIdKey(int render_process_id, int frame_routing_id); | 149 RenderFrameIdKey(int render_process_id, int frame_routing_id); |
150 | 150 |
151 // The process ID of the renderer that contains the RenderFrame. | 151 // The process ID of the renderer that contains the RenderFrame. |
152 int render_process_id; | 152 int render_process_id; |
153 | 153 |
154 // The routing ID of the RenderFrame. | 154 // The routing ID of the RenderFrame. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 // This lock protects |frame_data_map_| from being concurrently written on the | 209 // This lock protects |frame_data_map_| from being concurrently written on the |
210 // UI thread and read on the IO thread. | 210 // UI thread and read on the IO thread. |
211 base::Lock frame_data_map_lock_; | 211 base::Lock frame_data_map_lock_; |
212 | 212 |
213 DISALLOW_COPY_AND_ASSIGN(ExtensionApiFrameIdMap); | 213 DISALLOW_COPY_AND_ASSIGN(ExtensionApiFrameIdMap); |
214 }; | 214 }; |
215 | 215 |
216 } // namespace extensions | 216 } // namespace extensions |
217 | 217 |
218 #endif // EXTENSIONS_BROWSER_EXTENSION_API_FRAME_ID_MAP_H_ | 218 #endif // EXTENSIONS_BROWSER_EXTENSION_API_FRAME_ID_MAP_H_ |
OLD | NEW |