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

Side by Side Diff: net/disk_cache/stats.h

Issue 6780035: Use lock-free lazy initialization for static histogram references (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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
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 NET_DISK_CACHE_STATS_H_ 5 #ifndef NET_DISK_CACHE_STATS_H_
6 #define NET_DISK_CACHE_STATS_H_ 6 #define NET_DISK_CACHE_STATS_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 void Snapshot(StatsHistogram::StatsSamples* samples) const; 79 void Snapshot(StatsHistogram::StatsSamples* samples) const;
80 80
81 private: 81 private:
82 int GetStatsBucket(int32 size); 82 int GetStatsBucket(int32 size);
83 int GetRatio(Counters hit, Counters miss) const; 83 int GetRatio(Counters hit, Counters miss) const;
84 84
85 BackendImpl* backend_; 85 BackendImpl* backend_;
86 uint32 storage_addr_; 86 uint32 storage_addr_;
87 int data_sizes_[kDataSizesLength]; 87 int data_sizes_[kDataSizesLength];
88 int64 counters_[MAX_COUNTER]; 88 int64 counters_[MAX_COUNTER];
89 scoped_refptr<StatsHistogram> size_histogram_; 89 StatsHistogram* size_histogram_;
rvargas (doing something else) 2011/04/01 19:20:52 Can we have a scoped_ptr instead?. Probably not...
jar (doing other things) 2011/04/01 21:50:27 Since we're deliberately leaking all of these, we
90 90
91 DISALLOW_COPY_AND_ASSIGN(Stats); 91 DISALLOW_COPY_AND_ASSIGN(Stats);
92 }; 92 };
93 93
94 } // namespace disk_cache 94 } // namespace disk_cache
95 95
96 #endif // NET_DISK_CACHE_STATS_H_ 96 #endif // NET_DISK_CACHE_STATS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698