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

Side by Side Diff: net/sdch/sdch_owner.h

Issue 1051353003: SDCH: add TimeWeightedMemoryUse (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | net/sdch/sdch_owner.cc » ('j') | net/sdch/sdch_owner.cc » ('J')
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 #ifndef NET_SDCH_SDCH_OWNER_H_ 5 #ifndef NET_SDCH_SDCH_OWNER_H_
6 #define NET_SDCH_SDCH_OWNER_H_ 6 #define NET_SDCH_SDCH_OWNER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 109
110 // Schedule loading of all dictionaries described in |persisted_info|. 110 // Schedule loading of all dictionaries described in |persisted_info|.
111 // Returns false and does not schedule a load if |persisted_info| has an 111 // Returns false and does not schedule a load if |persisted_info| has an
112 // unsupported version or no dictionaries key. Skips any dictionaries that are 112 // unsupported version or no dictionaries key. Skips any dictionaries that are
113 // malformed in |persisted_info|. 113 // malformed in |persisted_info|.
114 bool SchedulePersistedDictionaryLoads( 114 bool SchedulePersistedDictionaryLoads(
115 const base::DictionaryValue& persisted_info); 115 const base::DictionaryValue& persisted_info);
116 116
117 bool IsPersistingDictionaries() const; 117 bool IsPersistingDictionaries() const;
118 118
119 // Record the lifetime memory use of a specified dictionary, identified by
120 // server hash.
121 void RecordDictionaryLifetime(const std::string& server_hash, size_t size);
122
119 // For investigation of http://crbug.com/454198; remove when resolved. 123 // For investigation of http://crbug.com/454198; remove when resolved.
120 base::WeakPtr<net::SdchManager> manager_; 124 base::WeakPtr<net::SdchManager> manager_;
121 scoped_ptr<net::SdchDictionaryFetcher> fetcher_; 125 scoped_ptr<net::SdchDictionaryFetcher> fetcher_;
122 126
123 size_t total_dictionary_bytes_; 127 size_t total_dictionary_bytes_;
124 128
125 scoped_ptr<base::Clock> clock_; 129 scoped_ptr<base::Clock> clock_;
126 130
127 size_t max_total_dictionary_size_; 131 size_t max_total_dictionary_size_;
128 size_t min_space_for_dictionary_fetch_; 132 size_t min_space_for_dictionary_fetch_;
(...skipping 22 matching lines...) Expand all
151 155
152 WriteablePrefStore* pref_store_; 156 WriteablePrefStore* pref_store_;
153 157
154 // The use counts of dictionaries when they were loaded from the persistent 158 // The use counts of dictionaries when they were loaded from the persistent
155 // store, keyed by server hash. These are stored to avoid generating 159 // store, keyed by server hash. These are stored to avoid generating
156 // misleading ever-increasing use counts for dictionaries that are persisted, 160 // misleading ever-increasing use counts for dictionaries that are persisted,
157 // since the UMA histogram for use counts is only supposed to be since last 161 // since the UMA histogram for use counts is only supposed to be since last
158 // load. 162 // load.
159 std::map<std::string, int> use_counts_at_load_; 163 std::map<std::string, int> use_counts_at_load_;
160 164
165 // Load times for loaded dictionaries, keyed by server hash. These are used to
166 // track the durations that dictionaries are in memory.
167 std::map<std::string, base::Time> load_times_;
168
161 DISALLOW_COPY_AND_ASSIGN(SdchOwner); 169 DISALLOW_COPY_AND_ASSIGN(SdchOwner);
162 }; 170 };
163 171
164 } // namespace net 172 } // namespace net
165 173
166 #endif // NET_SDCH_SDCH_OWNER_H_ 174 #endif // NET_SDCH_SDCH_OWNER_H_
OLDNEW
« no previous file with comments | « no previous file | net/sdch/sdch_owner.cc » ('j') | net/sdch/sdch_owner.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698