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_RENDERER_STARTUP_HELPER_H_ | 5 #ifndef EXTENSIONS_BROWSER_RENDERER_STARTUP_HELPER_H_ |
6 #define EXTENSIONS_BROWSER_RENDERER_STARTUP_HELPER_H_ | 6 #define EXTENSIONS_BROWSER_RENDERER_STARTUP_HELPER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // Initializes the specified process, informing it of system state and loaded | 62 // Initializes the specified process, informing it of system state and loaded |
63 // extensions. | 63 // extensions. |
64 void InitializeProcess(content::RenderProcessHost* process); | 64 void InitializeProcess(content::RenderProcessHost* process); |
65 | 65 |
66 // Untracks the given process. | 66 // Untracks the given process. |
67 void UntrackProcess(content::RenderProcessHost* process); | 67 void UntrackProcess(content::RenderProcessHost* process); |
68 | 68 |
69 content::BrowserContext* browser_context_; // Not owned. | 69 content::BrowserContext* browser_context_; // Not owned. |
70 | 70 |
71 // The set of render processes that have had the initial batch of IPC messages | 71 // The set of render processes that have had the initial batch of IPC messages |
72 // sent, including the set of loaded extensions. Further messages that | 72 // sent, together with the set of loaded extensions. Further messages that |
73 // activate, load, or unload extensions should not be sent until after this | 73 // activate, load, or unload extensions should not be sent until after this |
74 // happens. | 74 // happens. Used to keep the track of initialized processes along with its |
75 std::set<content::RenderProcessHost*> initialized_processes_; | 75 // loaded extensions. |
| 76 std::map<content::RenderProcessHost*, std::set<ExtensionId>> |
| 77 loaded_extensions_; |
76 | 78 |
77 // The set of ids for extensions that are active in a process that has not | 79 // The set of ids for extensions that are active in a process that has not |
78 // been initialized. The activation message will be sent the process is | 80 // been initialized. The activation message will be sent once the process is |
79 // initialized. | 81 // initialized. This is only valid for uninitialized processes. |
80 std::map<content::RenderProcessHost*, std::set<ExtensionId>> | 82 std::map<content::RenderProcessHost*, std::set<ExtensionId>> |
81 pending_active_extensions_; | 83 pending_active_extensions_; |
82 | 84 |
83 content::NotificationRegistrar registrar_; | 85 content::NotificationRegistrar registrar_; |
84 | 86 |
85 DISALLOW_COPY_AND_ASSIGN(RendererStartupHelper); | 87 DISALLOW_COPY_AND_ASSIGN(RendererStartupHelper); |
86 }; | 88 }; |
87 | 89 |
88 // Factory for RendererStartupHelpers. Declared here because this header is | 90 // Factory for RendererStartupHelpers. Declared here because this header is |
89 // rarely included and it's probably cheaper to put it here than to make the | 91 // rarely included and it's probably cheaper to put it here than to make the |
(...skipping 16 matching lines...) Expand all Loading... |
106 content::BrowserContext* GetBrowserContextToUse( | 108 content::BrowserContext* GetBrowserContextToUse( |
107 content::BrowserContext* context) const override; | 109 content::BrowserContext* context) const override; |
108 bool ServiceIsCreatedWithBrowserContext() const override; | 110 bool ServiceIsCreatedWithBrowserContext() const override; |
109 | 111 |
110 DISALLOW_COPY_AND_ASSIGN(RendererStartupHelperFactory); | 112 DISALLOW_COPY_AND_ASSIGN(RendererStartupHelperFactory); |
111 }; | 113 }; |
112 | 114 |
113 } // namespace extensions | 115 } // namespace extensions |
114 | 116 |
115 #endif // EXTENSIONS_BROWSER_RENDERER_STARTUP_HELPER_H_ | 117 #endif // EXTENSIONS_BROWSER_RENDERER_STARTUP_HELPER_H_ |
OLD | NEW |