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

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

Issue 2485573004: Fix locked/unlocked in SW IDC memory dumps. (Closed)
Patch Set: comment Created 4 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
« 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 <inttypes.h> 7 #include <inttypes.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 return true; 798 return true;
799 } 799 }
800 800
801 void SoftwareImageDecodeController::DumpImageMemoryForCache( 801 void SoftwareImageDecodeController::DumpImageMemoryForCache(
802 const ImageMRUCache& cache, 802 const ImageMRUCache& cache,
803 const char* cache_name, 803 const char* cache_name,
804 base::trace_event::ProcessMemoryDump* pmd) const { 804 base::trace_event::ProcessMemoryDump* pmd) const {
805 lock_.AssertAcquired(); 805 lock_.AssertAcquired();
806 806
807 for (const auto& image_pair : cache) { 807 for (const auto& image_pair : cache) {
808 std::string dump_name = base::StringPrintf(
809 "cc/image_memory/controller_0x%" PRIXPTR "/%s/image_%" PRIu64 "_id_%d",
810 reinterpret_cast<uintptr_t>(this), cache_name,
811 image_pair.second->tracing_id(), image_pair.first.image_id());
812 // CreateMemoryAllocatorDump will automatically add tracking values for the
813 // total size. If locked, we also add a "locked_size" below.
814 MemoryAllocatorDump* dump =
815 image_pair.second->memory()->CreateMemoryAllocatorDump(
816 dump_name.c_str(), pmd);
817 DCHECK(dump);
808 if (image_pair.second->is_locked()) { 818 if (image_pair.second->is_locked()) {
809 std::string dump_name = base::StringPrintf(
810 "cc/image_memory/controller_0x%" PRIXPTR "/%s/image_%" PRIu64
811 "_id_%d",
812 reinterpret_cast<uintptr_t>(this), cache_name,
813 image_pair.second->tracing_id(), image_pair.first.image_id());
814 MemoryAllocatorDump* dump =
815 image_pair.second->memory()->CreateMemoryAllocatorDump(
816 dump_name.c_str(), pmd);
817 DCHECK(dump);
818 dump->AddScalar("locked_size", MemoryAllocatorDump::kUnitsBytes, 819 dump->AddScalar("locked_size", MemoryAllocatorDump::kUnitsBytes,
819 image_pair.first.locked_bytes()); 820 image_pair.first.locked_bytes());
820 } 821 }
821 } 822 }
822 } 823 }
823 824
824 void SoftwareImageDecodeController::SanityCheckState(int line, 825 void SoftwareImageDecodeController::SanityCheckState(int line,
825 bool lock_acquired) { 826 bool lock_acquired) {
826 #if DCHECK_IS_ON() 827 #if DCHECK_IS_ON()
827 if (!lock_acquired) { 828 if (!lock_acquired) {
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 break; 1123 break;
1123 case base::MemoryState::UNKNOWN: 1124 case base::MemoryState::UNKNOWN:
1124 NOTREACHED(); 1125 NOTREACHED();
1125 return; 1126 return;
1126 } 1127 }
1127 } 1128 }
1128 ReduceCacheUsage(); 1129 ReduceCacheUsage();
1129 } 1130 }
1130 1131
1131 } // namespace cc 1132 } // 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