| 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_LAZY_BACKGROUND_TASK_QUEUE_H_ | 5 #ifndef EXTENSIONS_BROWSER_LAZY_BACKGROUND_TASK_QUEUE_H_ |
| 6 #define EXTENSIONS_BROWSER_LAZY_BACKGROUND_TASK_QUEUE_H_ | 6 #define EXTENSIONS_BROWSER_LAZY_BACKGROUND_TASK_QUEUE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 std::map<PendingTasksKey, std::unique_ptr<PendingTasksList>>; | 79 std::map<PendingTasksKey, std::unique_ptr<PendingTasksList>>; |
| 80 | 80 |
| 81 // content::NotificationObserver interface. | 81 // content::NotificationObserver interface. |
| 82 void Observe(int type, | 82 void Observe(int type, |
| 83 const content::NotificationSource& source, | 83 const content::NotificationSource& source, |
| 84 const content::NotificationDetails& details) override; | 84 const content::NotificationDetails& details) override; |
| 85 | 85 |
| 86 // ExtensionRegistryObserver interface. | 86 // ExtensionRegistryObserver interface. |
| 87 void OnExtensionUnloaded(content::BrowserContext* browser_context, | 87 void OnExtensionUnloaded(content::BrowserContext* browser_context, |
| 88 const Extension* extension, | 88 const Extension* extension, |
| 89 UnloadedExtensionInfo::Reason reason) override; | 89 UnloadedExtensionReason reason) override; |
| 90 | 90 |
| 91 // Called when a lazy background page has finished loading, or has failed to | 91 // Called when a lazy background page has finished loading, or has failed to |
| 92 // load (host is NULL in that case). All enqueued tasks are run in order. | 92 // load (host is NULL in that case). All enqueued tasks are run in order. |
| 93 void ProcessPendingTasks( | 93 void ProcessPendingTasks( |
| 94 ExtensionHost* host, | 94 ExtensionHost* host, |
| 95 content::BrowserContext* context, | 95 content::BrowserContext* context, |
| 96 const Extension* extension); | 96 const Extension* extension); |
| 97 | 97 |
| 98 content::BrowserContext* browser_context_; | 98 content::BrowserContext* browser_context_; |
| 99 content::NotificationRegistrar registrar_; | 99 content::NotificationRegistrar registrar_; |
| 100 PendingTasksMap pending_tasks_; | 100 PendingTasksMap pending_tasks_; |
| 101 | 101 |
| 102 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 102 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
| 103 extension_registry_observer_; | 103 extension_registry_observer_; |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 } // namespace extensions | 106 } // namespace extensions |
| 107 | 107 |
| 108 #endif // EXTENSIONS_BROWSER_LAZY_BACKGROUND_TASK_QUEUE_H_ | 108 #endif // EXTENSIONS_BROWSER_LAZY_BACKGROUND_TASK_QUEUE_H_ |
| OLD | NEW |