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

Side by Side Diff: cc/tiles/software_image_decode_controller.cc

Issue 1839783004: cc: ImageDecodes: Increase the cache item count limit to 1000. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "cc/tiles/software_image_decode_controller.h" 5 #include "cc/tiles/software_image_decode_controller.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <functional> 9 #include <functional>
10 10
(...skipping 12 matching lines...) Expand all
23 // used to inform the caller of the amount of space available in the cache. The 23 // used to inform the caller of the amount of space available in the cache. The
24 // caller can still request tasks which can cause this limit to be breached. 24 // caller can still request tasks which can cause this limit to be breached.
25 const size_t kLockedMemoryLimitBytes = 128 * 1024 * 1024; 25 const size_t kLockedMemoryLimitBytes = 128 * 1024 * 1024;
26 26
27 // The largest single high quality image to try and process. Images above this 27 // The largest single high quality image to try and process. Images above this
28 // size will drop down to medium quality. 28 // size will drop down to medium quality.
29 const size_t kMaxHighQualityImageSizeBytes = 64 * 1024 * 1024; 29 const size_t kMaxHighQualityImageSizeBytes = 64 * 1024 * 1024;
30 30
31 // The number of entries to keep around in the cache. This limit can be breached 31 // The number of entries to keep around in the cache. This limit can be breached
32 // if more items are locked. That is, locked items ignore this limit. 32 // if more items are locked. That is, locked items ignore this limit.
33 const size_t kMaxItemsInCache = 100; 33 const size_t kMaxItemsInCache = 1000;
34 34
35 class AutoRemoveKeyFromTaskMap { 35 class AutoRemoveKeyFromTaskMap {
36 public: 36 public:
37 AutoRemoveKeyFromTaskMap( 37 AutoRemoveKeyFromTaskMap(
38 std::unordered_map<SoftwareImageDecodeController::ImageKey, 38 std::unordered_map<SoftwareImageDecodeController::ImageKey,
39 scoped_refptr<ImageDecodeTask>, 39 scoped_refptr<ImageDecodeTask>,
40 SoftwareImageDecodeController::ImageKeyHash>* task_map, 40 SoftwareImageDecodeController::ImageKeyHash>* task_map,
41 const SoftwareImageDecodeController::ImageKey& key) 41 const SoftwareImageDecodeController::ImageKey& key)
42 : task_map_(task_map), key_(key) {} 42 : task_map_(task_map), key_(key) {}
43 ~AutoRemoveKeyFromTaskMap() { task_map_->erase(key_); } 43 ~AutoRemoveKeyFromTaskMap() { task_map_->erase(key_); }
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 void SoftwareImageDecodeController::MemoryBudget::ResetUsage() { 890 void SoftwareImageDecodeController::MemoryBudget::ResetUsage() {
891 current_usage_bytes_ = 0; 891 current_usage_bytes_ = 0;
892 } 892 }
893 893
894 size_t SoftwareImageDecodeController::MemoryBudget::GetCurrentUsageSafe() 894 size_t SoftwareImageDecodeController::MemoryBudget::GetCurrentUsageSafe()
895 const { 895 const {
896 return current_usage_bytes_.ValueOrDie(); 896 return current_usage_bytes_.ValueOrDie();
897 } 897 }
898 898
899 } // namespace cc 899 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698