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

Side by Side Diff: extensions/browser/extension_pref_value_map.cc

Issue 843643002: Cleanup: Remove some redundant container clear() calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « content/browser/download/download_manager_impl.cc ('k') | net/quic/quic_session.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "extensions/browser/extension_pref_value_map.h" 5 #include "extensions/browser/extension_pref_value_map.h"
6 6
7 #include "base/prefs/pref_value_map.h" 7 #include "base/prefs/pref_value_map.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 10
(...skipping 21 matching lines...) Expand all
32 32
33 ExtensionPrefValueMap::ExtensionPrefValueMap() : destroyed_(false) { 33 ExtensionPrefValueMap::ExtensionPrefValueMap() : destroyed_(false) {
34 } 34 }
35 35
36 ExtensionPrefValueMap::~ExtensionPrefValueMap() { 36 ExtensionPrefValueMap::~ExtensionPrefValueMap() {
37 if (!destroyed_) { 37 if (!destroyed_) {
38 NotifyOfDestruction(); 38 NotifyOfDestruction();
39 destroyed_ = true; 39 destroyed_ = true;
40 } 40 }
41 STLDeleteValues(&entries_); 41 STLDeleteValues(&entries_);
42 entries_.clear();
43 } 42 }
44 43
45 void ExtensionPrefValueMap::Shutdown() { 44 void ExtensionPrefValueMap::Shutdown() {
46 NotifyOfDestruction(); 45 NotifyOfDestruction();
47 destroyed_ = true; 46 destroyed_ = true;
48 } 47 }
49 48
50 void ExtensionPrefValueMap::SetExtensionPref(const std::string& ext_id, 49 void ExtensionPrefValueMap::SetExtensionPref(const std::string& ext_id,
51 const std::string& key, 50 const std::string& key,
52 ExtensionPrefsScope scope, 51 ExtensionPrefsScope scope,
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 393
395 void ExtensionPrefValueMap::NotifyPrefValueChanged(const std::string& key) { 394 void ExtensionPrefValueMap::NotifyPrefValueChanged(const std::string& key) {
396 FOR_EACH_OBSERVER(ExtensionPrefValueMap::Observer, observers_, 395 FOR_EACH_OBSERVER(ExtensionPrefValueMap::Observer, observers_,
397 OnPrefValueChanged(key)); 396 OnPrefValueChanged(key));
398 } 397 }
399 398
400 void ExtensionPrefValueMap::NotifyOfDestruction() { 399 void ExtensionPrefValueMap::NotifyOfDestruction() {
401 FOR_EACH_OBSERVER(ExtensionPrefValueMap::Observer, observers_, 400 FOR_EACH_OBSERVER(ExtensionPrefValueMap::Observer, observers_,
402 OnExtensionPrefValueMapDestruction()); 401 OnExtensionPrefValueMapDestruction());
403 } 402 }
OLDNEW
« no previous file with comments | « content/browser/download/download_manager_impl.cc ('k') | net/quic/quic_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698