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

Side by Side Diff: chrome/browser/extensions/extension_pref_store.h

Issue 2923008: Fix memory leak in extension pref store... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_pref_store.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_EXTENSIONS_EXTENSION_PREF_STORE_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_STORE_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_STORE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_STORE_H_
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/scoped_ptr.h" 13 #include "base/scoped_ptr.h"
14 #include "chrome/common/pref_store.h" 14 #include "chrome/common/pref_store.h"
15 15
16 class DictionaryValue; 16 class DictionaryValue;
17 class PrefService; 17 class PrefService;
18 class Value; 18 class Value;
19 19
20 // This PrefStore keeps track of preferences set by extensions: for example, 20 // This PrefStore keeps track of preferences set by extensions: for example,
21 // proxy settings. A stack of relevant extension IDs is stored in order of 21 // proxy settings. A stack of relevant extension IDs is stored in order of
22 // their addition to this PrefStore. For each preference, the last-added 22 // their addition to this PrefStore. For each preference, the last-added
23 // enabled extension that tries to set it overrules any others. 23 // enabled extension that tries to set it overrules any others.
24 class ExtensionPrefStore : public PrefStore { 24 class ExtensionPrefStore : public PrefStore {
25 public: 25 public:
26 explicit ExtensionPrefStore(PrefService* pref_service); 26 explicit ExtensionPrefStore(PrefService* pref_service);
27 virtual ~ExtensionPrefStore() {} 27 virtual ~ExtensionPrefStore();
28 28
29 // The PrefService creates the ExtensionPrefStore, so we need to be able to 29 // The PrefService creates the ExtensionPrefStore, so we need to be able to
30 // defer setting the PrefService here until after construction. 30 // defer setting the PrefService here until after construction.
31 void SetPrefService(PrefService* pref_service) { 31 void SetPrefService(PrefService* pref_service) {
32 pref_service_ = pref_service; 32 pref_service_ = pref_service;
33 } 33 }
34 34
35 // Begins tracking the preference and value an extension wishes to set. This 35 // Begins tracking the preference and value an extension wishes to set. This
36 // must be called each time an extension API tries to set a preference. 36 // must be called each time an extension API tries to set a preference.
37 virtual void InstallExtensionPref(std::string extension_id, 37 virtual void InstallExtensionPref(std::string extension_id,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 }; 78 };
79 79
80 // A pseudo-stack of extensions and their preferences. Extensions are always 80 // A pseudo-stack of extensions and their preferences. Extensions are always
81 // added to the head, but may be removed from the middle. This stack owns 81 // added to the head, but may be removed from the middle. This stack owns
82 // the values in the extensions' PrefValueMaps. 82 // the values in the extensions' PrefValueMaps.
83 typedef std::list<ExtensionPrefs*> ExtensionStack; 83 typedef std::list<ExtensionPrefs*> ExtensionStack;
84 ExtensionStack extension_stack_; 84 ExtensionStack extension_stack_;
85 }; 85 };
86 86
87 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_STORE_H_ 87 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_STORE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_pref_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698