Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(788)

Side by Side Diff: chrome/browser/profiles/profile_keyed_service.h

Issue 9703038: Profiles: Really fix refcounted services. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Forgot to save a file. >_< Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_keyed_base_factory.cc ('k') | chrome/browser/profiles/profile_keyed_service_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698