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

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

Issue 8598016: Fix leak in ComponentLoader. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/component_loader.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_COMPONENT_LOADER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_COMPONENT_LOADER_H_
6 #define CHROME_BROWSER_EXTENSIONS_COMPONENT_LOADER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_COMPONENT_LOADER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 const content::NotificationSource& source, 60 const content::NotificationSource& source,
61 const content::NotificationDetails& details) OVERRIDE; 61 const content::NotificationDetails& details) OVERRIDE;
62 62
63 static void RegisterUserPrefs(PrefService* prefs); 63 static void RegisterUserPrefs(PrefService* prefs);
64 64
65 // Parse the given JSON manifest. Returns NULL if it cannot be parsed, or if 65 // Parse the given JSON manifest. Returns NULL if it cannot be parsed, or if
66 // if the result is not a DictionaryValue. 66 // if the result is not a DictionaryValue.
67 DictionaryValue* ParseManifest(const std::string& manifest_contents) const; 67 DictionaryValue* ParseManifest(const std::string& manifest_contents) const;
68 68
69 // Clear the list of registered extensions. 69 // Clear the list of registered extensions.
70 void ClearAllRegistered() { 70 void ClearAllRegistered();
71 component_extensions_.clear();
72 }
73 71
74 private: 72 private:
75 // Information about a registered component extension. 73 // Information about a registered component extension.
76 struct ComponentExtensionInfo { 74 struct ComponentExtensionInfo {
77 ComponentExtensionInfo(const DictionaryValue* manifest, 75 ComponentExtensionInfo(const DictionaryValue* manifest,
78 const FilePath& root_directory) 76 const FilePath& root_directory)
79 : manifest(manifest), 77 : manifest(manifest),
80 root_directory(root_directory) { 78 root_directory(root_directory) {
81 } 79 }
82 80
(...skipping 23 matching lines...) Expand all
106 // List of registered component extensions (see Extension::Location). 104 // List of registered component extensions (see Extension::Location).
107 typedef std::vector<ComponentExtensionInfo> RegisteredComponentExtensions; 105 typedef std::vector<ComponentExtensionInfo> RegisteredComponentExtensions;
108 RegisteredComponentExtensions component_extensions_; 106 RegisteredComponentExtensions component_extensions_;
109 107
110 PrefChangeRegistrar pref_change_registrar_; 108 PrefChangeRegistrar pref_change_registrar_;
111 }; 109 };
112 110
113 } // namespace extensions 111 } // namespace extensions
114 112
115 #endif // CHROME_BROWSER_EXTENSIONS_COMPONENT_LOADER_H_ 113 #endif // CHROME_BROWSER_EXTENSIONS_COMPONENT_LOADER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/component_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698