| 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 #ifndef CONTENT_BROWSER_RENDERER_DATA_MEMOIZING_STORE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_DATA_MEMOIZING_STORE_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_DATA_MEMOIZING_STORE_H_ | 6 #define CONTENT_BROWSER_RENDERER_DATA_MEMOIZING_STORE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/synchronization/lock.h" | 11 #include "base/synchronization/lock.h" |
| 12 #include "content/browser/renderer_host/render_view_host_impl.h" | |
| 13 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
| 13 #include "content/public/browser/render_process_host.h" |
| 14 #include "content/public/browser/render_process_host_observer.h" | 14 #include "content/public/browser/render_process_host_observer.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 | 17 |
| 18 // RendererDataMemoizingStore is a thread-safe container that retains reference | 18 // RendererDataMemoizingStore is a thread-safe container that retains reference |
| 19 // counted objects that are associated with one or more render processes. | 19 // counted objects that are associated with one or more render processes. |
| 20 // Objects are identified by an int and only a single reference to a given | 20 // Objects are identified by an int and only a single reference to a given |
| 21 // object is retained. RendererDataMemoizingStore watches for render process | 21 // object is retained. RendererDataMemoizingStore watches for render process |
| 22 // termination and releases objects that are no longer associated with any | 22 // termination and releases objects that are no longer associated with any |
| 23 // render process. | 23 // render process. |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 int next_item_id_; | 206 int next_item_id_; |
| 207 | 207 |
| 208 // This lock protects: process_id_to_item_id_, item_id_to_process_id_, | 208 // This lock protects: process_id_to_item_id_, item_id_to_process_id_, |
| 209 // id_to_item_, and item_to_id_. | 209 // id_to_item_, and item_to_id_. |
| 210 base::Lock lock_; | 210 base::Lock lock_; |
| 211 }; | 211 }; |
| 212 | 212 |
| 213 } // namespace content | 213 } // namespace content |
| 214 | 214 |
| 215 #endif // CONTENT_BROWSER_RENDERER_DATA_MEMOIZING_STORE_H_ | 215 #endif // CONTENT_BROWSER_RENDERER_DATA_MEMOIZING_STORE_H_ |
| OLD | NEW |