| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_BROWSER_CONTEXT_KEYED_SERVICE_H
_ | 5 #ifndef COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_BROWSER_CONTEXT_KEYED_SERVICE_H
_ |
| 6 #define COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_BROWSER_CONTEXT_KEYED_SERVICE_H
_ | 6 #define COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_BROWSER_CONTEXT_KEYED_SERVICE_H
_ |
| 7 | 7 |
| 8 #include "components/browser_context_keyed_service/browser_context_keyed_service
_export.h" |
| 9 |
| 8 class BrowserContextKeyedServiceFactory; | 10 class BrowserContextKeyedServiceFactory; |
| 9 | 11 |
| 10 // Base class for all BrowserContextKeyedServices to allow for correct | 12 // Base class for all BrowserContextKeyedServices to allow for correct |
| 11 // destruction order. | 13 // destruction order. |
| 12 // | 14 // |
| 13 // Many services that hang off BrowserContext have a two-pass shutdown. Many | 15 // Many services that hang off BrowserContext have a two-pass shutdown. Many |
| 14 // subsystems need a first pass shutdown phase where they drop references. Not | 16 // subsystems need a first pass shutdown phase where they drop references. Not |
| 15 // all services will need this, so there's a default implementation. Only once | 17 // all services will need this, so there's a default implementation. Only once |
| 16 // every system has been given a chance to drop references do we start deleting | 18 // every system has been given a chance to drop references do we start deleting |
| 17 // objects. | 19 // objects. |
| 18 class BrowserContextKeyedService { | 20 class BROWSER_CONTEXT_KEYED_SERVICE_EXPORT BrowserContextKeyedService { |
| 19 public: | 21 public: |
| 20 // The first pass is to call Shutdown on a BrowserContextKeyedService. | 22 // The first pass is to call Shutdown on a BrowserContextKeyedService. |
| 21 virtual void Shutdown() {} | 23 virtual void Shutdown() {} |
| 22 | 24 |
| 23 protected: | 25 protected: |
| 24 friend class BrowserContextKeyedServiceFactory; | 26 friend class BrowserContextKeyedServiceFactory; |
| 25 | 27 |
| 26 // The second pass is the actual deletion of each object. | 28 // The second pass is the actual deletion of each object. |
| 27 virtual ~BrowserContextKeyedService() {} | 29 virtual ~BrowserContextKeyedService() {} |
| 28 }; | 30 }; |
| 29 | 31 |
| 30 #endif // COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_BROWSER_CONTEXT_KEYED_SERVIC
E_H_ | 32 #endif // COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_BROWSER_CONTEXT_KEYED_SERVIC
E_H_ |
| OLD | NEW |