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

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

Issue 7980060: Actually fix memory leak in ExtensionSettingsStorageQuotaEnforcer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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 | tools/heapcheck/suppressions.txt » ('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_EXTENSION_SETTINGS_STORAGE_QUOTA_ENFORCER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_QUOTA_ENFORCER_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_QUOTA_ENFORCER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_QUOTA_ENFORCER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 22 matching lines...) Expand all
33 virtual Result Clear() OVERRIDE; 33 virtual Result Clear() OVERRIDE;
34 34
35 private: 35 private:
36 // The storage quota in bytes. 36 // The storage quota in bytes.
37 size_t const quota_bytes_; 37 size_t const quota_bytes_;
38 38
39 // The maximum number of settings keys allowed. 39 // The maximum number of settings keys allowed.
40 size_t const max_keys_; 40 size_t const max_keys_;
41 41
42 // The delegate storage area. 42 // The delegate storage area.
43 ExtensionSettingsStorage* const delegate_; 43 scoped_ptr<ExtensionSettingsStorage> const delegate_;
44 44
45 // Total size of the settings currently being used. Includes both settings 45 // Total size of the settings currently being used. Includes both settings
46 // keys and their JSON-encoded values. 46 // keys and their JSON-encoded values.
47 size_t used_total_; 47 size_t used_total_;
48 48
49 // Map of key to size of that key, including the key itself. 49 // Map of key to size of that key, including the key itself.
50 std::map<std::string, size_t> used_per_setting_; 50 std::map<std::string, size_t> used_per_setting_;
51 51
52 DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsStorageQuotaEnforcer); 52 DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsStorageQuotaEnforcer);
53 }; 53 };
54 54
55 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_QUOTA_ENFORCER_H _ 55 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_QUOTA_ENFORCER_H _
OLDNEW
« no previous file with comments | « no previous file | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698