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

Unified Diff: chrome/browser/profiles/profile_keyed_service.h

Issue 6766004: Create a ProfileDependencyManager to order ProfileKeyedService destruction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/profile_keyed_service.h
diff --git a/chrome/browser/profiles/profile_keyed_service.h b/chrome/browser/profiles/profile_keyed_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..3584ce5c49751f7db3cca2cbdccec0c037f37459
--- /dev/null
+++ b/chrome/browser/profiles/profile_keyed_service.h
@@ -0,0 +1,26 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_PROFILES_PROFILE_KEYED_SERVICE_H_
+#define CHROME_BROWSER_PROFILES_PROFILE_KEYED_SERVICE_H_
+
+// Base class for all ProfileKeyedServices to allow for correct destruction
+// order.
+//
+// Many services that hang off Profile have a two-pass shutdown. Many
+// subsystems need a first pass shutdown phase where they drop references. Not
+// all services will need this, so there's a default implementation. Only once
+// ever system has been given a chance to drop references do we start deleting
Miranda Callahan 2011/03/29 19:07:04 s/ever/every
+// objects.
+class ProfileKeyedService {
+ public:
+ // The first pass is to call Shutdown on a ProfileKeyedService.
+ virtual void Shutdown() {}
+
+ // The second pass is the actual deletion of each object.
+ virtual ~ProfileKeyedService() {}
+};
+
+#endif // CHROME_BROWSER_PROFILES_PROFILE_KEYED_SERVICE_H_
+

Powered by Google App Engine
This is Rietveld 408576698