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

Side by Side Diff: net/disk_cache/simple/simple_index.h

Issue 2789683002: Speed up SimpleCache eviction set computation (Closed)
Patch Set: Created 3 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_SIMPLE_SIMPLE_INDEX_H_ 5 #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_
6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ 6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <list> 10 #include <list>
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 168
169 // Returns the estimate of dynamically allocated memory in bytes. 169 // Returns the estimate of dynamically allocated memory in bytes.
170 size_t EstimateMemoryUsage() const; 170 size_t EstimateMemoryUsage() const;
171 171
172 private: 172 private:
173 friend class SimpleIndexTest; 173 friend class SimpleIndexTest;
174 FRIEND_TEST_ALL_PREFIXES(SimpleIndexTest, IndexSizeCorrectOnMerge); 174 FRIEND_TEST_ALL_PREFIXES(SimpleIndexTest, IndexSizeCorrectOnMerge);
175 FRIEND_TEST_ALL_PREFIXES(SimpleIndexTest, DiskWriteQueued); 175 FRIEND_TEST_ALL_PREFIXES(SimpleIndexTest, DiskWriteQueued);
176 FRIEND_TEST_ALL_PREFIXES(SimpleIndexTest, DiskWriteExecuted); 176 FRIEND_TEST_ALL_PREFIXES(SimpleIndexTest, DiskWriteExecuted);
177 FRIEND_TEST_ALL_PREFIXES(SimpleIndexTest, DiskWritePostponed); 177 FRIEND_TEST_ALL_PREFIXES(SimpleIndexTest, DiskWritePostponed);
178 FRIEND_TEST_ALL_PREFIXES(SimpleIndexPerfTest, EvictionPerformance);
pasko 2017/03/31 17:41:56 It would be more readable to introduce a public Si
Maks Orlovich 2017/03/31 19:01:29 Great idea, done. Also lets me avoid being in the
178 179
179 void StartEvictionIfNeeded(); 180 void StartEvictionIfNeeded();
180 void EvictionDone(int result); 181 void EvictionDone(int result);
181 182
182 void PostponeWritingToDisk(); 183 void PostponeWritingToDisk();
183 184
184 void UpdateEntryIteratorSize(EntrySet::iterator* it, 185 void UpdateEntryIteratorSize(EntrySet::iterator* it,
185 base::StrictNumeric<uint32_t> entry_size); 186 base::StrictNumeric<uint32_t> entry_size);
186 187
187 // Must run on IO Thread. 188 // Must run on IO Thread.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 235
235 // Set to true when the app is on the background. When the app is in the 236 // Set to true when the app is on the background. When the app is in the
236 // background we can write the index much more frequently, to insure fresh 237 // background we can write the index much more frequently, to insure fresh
237 // index on next startup. 238 // index on next startup.
238 bool app_on_background_; 239 bool app_on_background_;
239 }; 240 };
240 241
241 } // namespace disk_cache 242 } // namespace disk_cache
242 243
243 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_ 244 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698