| 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 EXTENSIONS_BROWSER_PROCESS_MAP_H_ | 5 #ifndef EXTENSIONS_BROWSER_PROCESS_MAP_H_ |
| 6 #define EXTENSIONS_BROWSER_PROCESS_MAP_H_ | 6 #define EXTENSIONS_BROWSER_PROCESS_MAP_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 // RenderProcessHost::FromID() and check the profile of the resulting object. | 68 // RenderProcessHost::FromID() and check the profile of the resulting object. |
| 69 // | 69 // |
| 70 // TODO(aa): The above warnings suggest this class could use improvement :). | 70 // TODO(aa): The above warnings suggest this class could use improvement :). |
| 71 // | 71 // |
| 72 // TODO(kalman): This class is not threadsafe, but is used on both the UI and | 72 // TODO(kalman): This class is not threadsafe, but is used on both the UI and |
| 73 // IO threads. Somebody should fix that, either make it | 73 // IO threads. Somebody should fix that, either make it |
| 74 // threadsafe or enforce single thread. Investigation required. | 74 // threadsafe or enforce single thread. Investigation required. |
| 75 class ProcessMap : public KeyedService { | 75 class ProcessMap : public KeyedService { |
| 76 public: | 76 public: |
| 77 ProcessMap(); | 77 ProcessMap(); |
| 78 virtual ~ProcessMap(); | 78 ~ProcessMap() override; |
| 79 | 79 |
| 80 // Returns the instance for |browser_context|. An instance is shared between | 80 // Returns the instance for |browser_context|. An instance is shared between |
| 81 // an incognito and a regular context. | 81 // an incognito and a regular context. |
| 82 static ProcessMap* Get(content::BrowserContext* browser_context); | 82 static ProcessMap* Get(content::BrowserContext* browser_context); |
| 83 | 83 |
| 84 size_t size() const { return items_.size(); } | 84 size_t size() const { return items_.size(); } |
| 85 | 85 |
| 86 bool Insert(const std::string& extension_id, int process_id, | 86 bool Insert(const std::string& extension_id, int process_id, |
| 87 int site_instance_id); | 87 int site_instance_id); |
| 88 | 88 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 131 |
| 132 typedef std::set<Item> ItemSet; | 132 typedef std::set<Item> ItemSet; |
| 133 ItemSet items_; | 133 ItemSet items_; |
| 134 | 134 |
| 135 DISALLOW_COPY_AND_ASSIGN(ProcessMap); | 135 DISALLOW_COPY_AND_ASSIGN(ProcessMap); |
| 136 }; | 136 }; |
| 137 | 137 |
| 138 } // namespace extensions | 138 } // namespace extensions |
| 139 | 139 |
| 140 #endif // EXTENSIONS_BROWSER_PROCESS_MAP_H_ | 140 #endif // EXTENSIONS_BROWSER_PROCESS_MAP_H_ |
| OLD | NEW |