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

Unified Diff: base/global_descriptors_posix.h

Issue 5581008: Add a new GetInstance() method for singleton classes, take 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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
« no previous file with comments | « no previous file | base/global_descriptors_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/global_descriptors_posix.h
diff --git a/base/global_descriptors_posix.h b/base/global_descriptors_posix.h
index 8ea743ee7263827814dd1eff1cc70442ccc1ba33..702a1243b9ae6914f2ecb5115e2ecf8f048ae4af 100644
--- a/base/global_descriptors_posix.h
+++ b/base/global_descriptors_posix.h
@@ -41,6 +41,13 @@ class GlobalDescriptors {
// the following constant to the key value:
static const int kBaseDescriptor = 3; // 0, 1, 2 are already taken.
+ // Returns a pointer to the singleton object constructed with default traits.
+ static GlobalDescriptors* GetInstance();
M-A Ruel 2010/12/07 17:32:21 You realize that you're creating two objects here?
Satish 2010/12/07 17:45:27 The leaky instance is created in src/chrome/app/ch
M-A Ruel 2010/12/07 17:49:17 Ok, adding Evan to know if it was intentional.
Evan Martin 2010/12/07 17:55:16 Ugh, no, this was definitely not intentional. :(
+
+ // Returns a pointer to the singleton object constructed with leaky traits,
+ // i.e. one which won't be freed on shutdown.
+ static GlobalDescriptors* GetLeakyInstance();
+
// Get a descriptor given a key. It is a fatal error if the key is not known.
int Get(Key key) const;
// Get a descriptor give a key. Returns -1 on error.
« no previous file with comments | « no previous file | base/global_descriptors_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698