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_MANAGER_H_ | 5 #ifndef EXTENSIONS_BROWSER_PROCESS_MANAGER_H_ |
6 #define EXTENSIONS_BROWSER_PROCESS_MANAGER_H_ | 6 #define EXTENSIONS_BROWSER_PROCESS_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 BackgroundPageDataMap background_page_data_; | 290 BackgroundPageDataMap background_page_data_; |
291 | 291 |
292 // True if we have created the startup set of background hosts. | 292 // True if we have created the startup set of background hosts. |
293 bool startup_background_hosts_created_; | 293 bool startup_background_hosts_created_; |
294 | 294 |
295 base::Callback<void(content::DevToolsAgentHost*, bool)> devtools_callback_; | 295 base::Callback<void(content::DevToolsAgentHost*, bool)> devtools_callback_; |
296 | 296 |
297 ImpulseCallbackForTesting keepalive_impulse_callback_for_testing_; | 297 ImpulseCallbackForTesting keepalive_impulse_callback_for_testing_; |
298 ImpulseCallbackForTesting keepalive_impulse_decrement_callback_for_testing_; | 298 ImpulseCallbackForTesting keepalive_impulse_decrement_callback_for_testing_; |
299 | 299 |
300 ObserverList<ProcessManagerObserver> observer_list_; | 300 base::ObserverList<ProcessManagerObserver> observer_list_; |
301 | 301 |
302 // ID Counter used to set ProcessManager::BackgroundPageData close_sequence_id | 302 // ID Counter used to set ProcessManager::BackgroundPageData close_sequence_id |
303 // members. These IDs are tracked per extension in background_page_data_ and | 303 // members. These IDs are tracked per extension in background_page_data_ and |
304 // are used to verify that nothing has interrupted the process of closing a | 304 // are used to verify that nothing has interrupted the process of closing a |
305 // lazy background process. | 305 // lazy background process. |
306 // | 306 // |
307 // Any interruption obtains a new ID by incrementing | 307 // Any interruption obtains a new ID by incrementing |
308 // last_background_close_sequence_id_ and storing it in background_page_data_ | 308 // last_background_close_sequence_id_ and storing it in background_page_data_ |
309 // for a particular extension. Callbacks and round-trip IPC messages store the | 309 // for a particular extension. Callbacks and round-trip IPC messages store the |
310 // value of the extension's close_sequence_id at the beginning of the process. | 310 // value of the extension's close_sequence_id at the beginning of the process. |
311 // Thus comparisons can be done to halt when IDs no longer match. | 311 // Thus comparisons can be done to halt when IDs no longer match. |
312 // | 312 // |
313 // This counter provides unique IDs even when BackgroundPageData objects are | 313 // This counter provides unique IDs even when BackgroundPageData objects are |
314 // reset. | 314 // reset. |
315 uint64 last_background_close_sequence_id_; | 315 uint64 last_background_close_sequence_id_; |
316 | 316 |
317 // Must be last member, see doc on WeakPtrFactory. | 317 // Must be last member, see doc on WeakPtrFactory. |
318 base::WeakPtrFactory<ProcessManager> weak_ptr_factory_; | 318 base::WeakPtrFactory<ProcessManager> weak_ptr_factory_; |
319 | 319 |
320 DISALLOW_COPY_AND_ASSIGN(ProcessManager); | 320 DISALLOW_COPY_AND_ASSIGN(ProcessManager); |
321 }; | 321 }; |
322 | 322 |
323 } // namespace extensions | 323 } // namespace extensions |
324 | 324 |
325 #endif // EXTENSIONS_BROWSER_PROCESS_MANAGER_H_ | 325 #endif // EXTENSIONS_BROWSER_PROCESS_MANAGER_H_ |
OLD | NEW |