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

Side by Side Diff: net/disk_cache/stats_histogram.cc

Issue 4192012: Convert implicit scoped_refptr constructor calls to explicit ones, part 1 (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: fix presubmit Created 10 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 | « net/disk_cache/sparse_control.cc ('k') | net/disk_cache/stress_cache.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) 2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2008 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 "net/disk_cache/stats_histogram.h" 5 #include "net/disk_cache/stats_histogram.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "net/disk_cache/stats.h" 8 #include "net/disk_cache/stats.h"
9 9
10 namespace disk_cache { 10 namespace disk_cache {
(...skipping 24 matching lines...) Expand all
35 } 35 }
36 36
37 DCHECK(HISTOGRAM == histogram->histogram_type()); 37 DCHECK(HISTOGRAM == histogram->histogram_type());
38 DCHECK(histogram->HasConstructorArguments(minimum, maximum, bucket_count)); 38 DCHECK(histogram->HasConstructorArguments(minimum, maximum, bucket_count));
39 39
40 // We're preparing for an otherwise unsafe upcast by ensuring we have the 40 // We're preparing for an otherwise unsafe upcast by ensuring we have the
41 // proper class type. 41 // proper class type.
42 Histogram* temp_histogram = histogram.get(); 42 Histogram* temp_histogram = histogram.get();
43 StatsHistogram* temp_stats_histogram = 43 StatsHistogram* temp_stats_histogram =
44 static_cast<StatsHistogram*>(temp_histogram); 44 static_cast<StatsHistogram*>(temp_histogram);
45 scoped_refptr<StatsHistogram> return_histogram = temp_stats_histogram; 45 scoped_refptr<StatsHistogram> return_histogram(temp_stats_histogram);
46 return return_histogram; 46 return return_histogram;
47 } 47 }
48 48
49 bool StatsHistogram::Init(const Stats* stats) { 49 bool StatsHistogram::Init(const Stats* stats) {
50 DCHECK(stats); 50 DCHECK(stats);
51 if (stats_) 51 if (stats_)
52 return false; 52 return false;
53 53
54 SetFlags(kUmaTargetedHistogramFlag); 54 SetFlags(kUmaTargetedHistogramFlag);
55 55
(...skipping 24 matching lines...) Expand all
80 stats_->Snapshot(&my_sample); 80 stats_->Snapshot(&my_sample);
81 81
82 *sample = my_sample; 82 *sample = my_sample;
83 83
84 // Only report UMA data once. 84 // Only report UMA data once.
85 StatsHistogram* mutable_me = const_cast<StatsHistogram*>(this); 85 StatsHistogram* mutable_me = const_cast<StatsHistogram*>(this);
86 mutable_me->ClearFlags(kUmaTargetedHistogramFlag); 86 mutable_me->ClearFlags(kUmaTargetedHistogramFlag);
87 } 87 }
88 88
89 } // namespace disk_cache 89 } // namespace disk_cache
OLDNEW
« no previous file with comments | « net/disk_cache/sparse_control.cc ('k') | net/disk_cache/stress_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698