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

Unified Diff: chrome/browser/prefs/pref_service.h

Issue 6392022: Pacify Coverity when reading kExtensionsPref dictionary (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Converted CHECKs to NOTREACHED Created 9 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/prefs/pref_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prefs/pref_service.h
diff --git a/chrome/browser/prefs/pref_service.h b/chrome/browser/prefs/pref_service.h
index 41d4e507dfe5ca760248bcbd558e4fe1eeab8b40..4fa7c43f7e224482b6fd78ea63b9789c37a89d4a 100644
--- a/chrome/browser/prefs/pref_service.h
+++ b/chrome/browser/prefs/pref_service.h
@@ -167,8 +167,9 @@ class PrefService : public base::NonThreadSafe {
std::string GetString(const char* path) const;
FilePath GetFilePath(const char* path) const;
- // Returns the branch if it exists. If it's not a branch or the branch does
- // not exist, returns NULL.
+ // Returns the branch if it exists, or the registered default value otherwise.
+ // Note that |path| must point to a registered preference. In that case, these
+ // functions will never return NULL.
const DictionaryValue* GetDictionary(const char* path) const;
const ListValue* GetList(const char* path) const;
@@ -274,8 +275,10 @@ class PrefService : public base::NonThreadSafe {
virtual void AddPrefObserver(const char* path, NotificationObserver* obs);
virtual void RemovePrefObserver(const char* path, NotificationObserver* obs);
- // Add a preference to the PreferenceMap. If the pref already exists, return
- // false. This method takes ownership of |default_value|.
+ // Registers a new preference at |path|. The |default_value| must not be
+ // NULL as it determines the preference value's type.
+ // RegisterPreference must not be called twice for the same path.
+ // This method takes ownership of |default_value|.
void RegisterPreference(const char* path, Value* default_value);
// Sets the value for this pref path in the user pref store and informs the
« no previous file with comments | « no previous file | chrome/browser/prefs/pref_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698