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

Side by Side Diff: base/metrics/statistics_recorder.cc

Issue 731373002: Enable MSVC warning for unused locals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
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/metrics/statistics_recorder.h" 5 #include "base/metrics/statistics_recorder.h"
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/debug/leak_annotations.h" 8 #include "base/debug/leak_annotations.h"
9 #include "base/json/string_escape.h" 9 #include "base/json/string_escape.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 ranges_ = new RangesMap; 282 ranges_ = new RangesMap;
283 283
284 if (VLOG_IS_ON(1)) 284 if (VLOG_IS_ON(1))
285 AtExitManager::RegisterCallback(&DumpHistogramsToVlog, this); 285 AtExitManager::RegisterCallback(&DumpHistogramsToVlog, this);
286 } 286 }
287 287
288 // static 288 // static
289 void StatisticsRecorder::DumpHistogramsToVlog(void* instance) { 289 void StatisticsRecorder::DumpHistogramsToVlog(void* instance) {
290 DCHECK(VLOG_IS_ON(1)); 290 DCHECK(VLOG_IS_ON(1));
291 291
292 StatisticsRecorder* me = reinterpret_cast<StatisticsRecorder*>(instance);
293 string output; 292 string output;
294 me->WriteGraph(std::string(), &output); 293 reinterpret_cast<StatisticsRecorder*>(instance)->WriteGraph(std::string(),
294 &output);
295 VLOG(1) << output; 295 VLOG(1) << output;
296 } 296 }
297 297
298 StatisticsRecorder::~StatisticsRecorder() { 298 StatisticsRecorder::~StatisticsRecorder() {
299 DCHECK(histograms_ && ranges_ && lock_); 299 DCHECK(histograms_ && ranges_ && lock_);
300 300
301 // Clean up. 301 // Clean up.
302 scoped_ptr<HistogramMap> histograms_deleter; 302 scoped_ptr<HistogramMap> histograms_deleter;
303 scoped_ptr<RangesMap> ranges_deleter; 303 scoped_ptr<RangesMap> ranges_deleter;
304 // We don't delete lock_ on purpose to avoid having to properly protect 304 // We don't delete lock_ on purpose to avoid having to properly protect
(...skipping 10 matching lines...) Expand all
315 315
316 316
317 // static 317 // static
318 StatisticsRecorder::HistogramMap* StatisticsRecorder::histograms_ = NULL; 318 StatisticsRecorder::HistogramMap* StatisticsRecorder::histograms_ = NULL;
319 // static 319 // static
320 StatisticsRecorder::RangesMap* StatisticsRecorder::ranges_ = NULL; 320 StatisticsRecorder::RangesMap* StatisticsRecorder::ranges_ = NULL;
321 // static 321 // static
322 base::Lock* StatisticsRecorder::lock_ = NULL; 322 base::Lock* StatisticsRecorder::lock_ = NULL;
323 323
324 } // namespace base 324 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698