| 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 CHROME_BROWSER_PROFILES_PROFILE_KEYED_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_KEYED_SERVICE_H_ |
| 6 #define CHROME_BROWSER_PROFILES_PROFILE_KEYED_SERVICE_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILE_KEYED_SERVICE_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/profiles/profile_keyed_base.h" | 8 class ProfileKeyedServiceFactory; |
| 9 | 9 |
| 10 // Base class for all ProfileKeyedServices to allow for correct destruction | 10 // Base class for all ProfileKeyedServices to allow for correct destruction |
| 11 // order. | 11 // order. |
| 12 // | 12 // |
| 13 // Many services that hang off Profile have a two-pass shutdown. Many | 13 // Many services that hang off Profile have a two-pass shutdown. Many |
| 14 // subsystems need a first pass shutdown phase where they drop references. Not | 14 // 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 | 15 // 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 | 16 // every system has been given a chance to drop references do we start deleting |
| 17 // objects. | 17 // objects. |
| 18 class ProfileKeyedService : public ProfileKeyedBase { | 18 class ProfileKeyedService { |
| 19 public: | 19 public: |
| 20 // The first pass is to call Shutdown on a ProfileKeyedService. | 20 // The first pass is to call Shutdown on a ProfileKeyedService. |
| 21 virtual void Shutdown() {} | 21 virtual void Shutdown() {} |
| 22 | 22 |
| 23 protected: |
| 24 friend class ProfileKeyedServiceFactory; |
| 25 |
| 23 // The second pass is the actual deletion of each object. | 26 // The second pass is the actual deletion of each object. |
| 24 virtual ~ProfileKeyedService() {} | 27 virtual ~ProfileKeyedService() {} |
| 25 }; | 28 }; |
| 26 | 29 |
| 27 #endif // CHROME_BROWSER_PROFILES_PROFILE_KEYED_SERVICE_H_ | 30 #endif // CHROME_BROWSER_PROFILES_PROFILE_KEYED_SERVICE_H_ |
| OLD | NEW |