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

Side by Side Diff: base/prefs/json_pref_store.cc

Issue 1138783003: Fix uninitialized memory error Valgrind bots are barking about. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/prefs/json_pref_store.h" 5 #include "base/prefs/json_pref_store.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 scoped_ptr<PrefFilter> pref_filter) 171 scoped_ptr<PrefFilter> pref_filter)
172 : path_(filename), 172 : path_(filename),
173 alternate_path_(alternate_filename), 173 alternate_path_(alternate_filename),
174 sequenced_task_runner_(sequenced_task_runner), 174 sequenced_task_runner_(sequenced_task_runner),
175 prefs_(new base::DictionaryValue()), 175 prefs_(new base::DictionaryValue()),
176 read_only_(false), 176 read_only_(false),
177 writer_(filename, sequenced_task_runner), 177 writer_(filename, sequenced_task_runner),
178 pref_filter_(pref_filter.Pass()), 178 pref_filter_(pref_filter.Pass()),
179 initialized_(false), 179 initialized_(false),
180 filtering_in_progress_(false), 180 filtering_in_progress_(false),
181 pending_lossy_write_(false),
181 read_error_(PREF_READ_ERROR_NONE), 182 read_error_(PREF_READ_ERROR_NONE),
182 write_count_histogram_(writer_.commit_interval(), path_) { 183 write_count_histogram_(writer_.commit_interval(), path_) {
183 DCHECK(!path_.empty()); 184 DCHECK(!path_.empty());
184 } 185 }
185 186
186 bool JsonPrefStore::GetValue(const std::string& key, 187 bool JsonPrefStore::GetValue(const std::string& key,
187 const base::Value** result) const { 188 const base::Value** result) const {
188 DCHECK(CalledOnValidThread()); 189 DCHECK(CalledOnValidThread());
189 190
190 base::Value* tmp = NULL; 191 base::Value* tmp = NULL;
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 DCHECK_EQ(31, num_buckets); 541 DCHECK_EQ(31, num_buckets);
541 542
542 // The histogram below is an expansion of the UMA_HISTOGRAM_CUSTOM_COUNTS 543 // The histogram below is an expansion of the UMA_HISTOGRAM_CUSTOM_COUNTS
543 // macro adapted to allow for a dynamically suffixed histogram name. 544 // macro adapted to allow for a dynamically suffixed histogram name.
544 // Note: The factory creates and owns the histogram. 545 // Note: The factory creates and owns the histogram.
545 base::HistogramBase* histogram = base::Histogram::FactoryGet( 546 base::HistogramBase* histogram = base::Histogram::FactoryGet(
546 histogram_name, min_value, max_value, num_buckets, 547 histogram_name, min_value, max_value, num_buckets,
547 base::HistogramBase::kUmaTargetedHistogramFlag); 548 base::HistogramBase::kUmaTargetedHistogramFlag);
548 return histogram; 549 return histogram;
549 } 550 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698