OLD | NEW |
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 #include "cc/output/output_surface.h" | 5 #include "cc/output/output_surface.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // always be scoped to a single OnMemoryDump funciton call. | 42 // always be scoped to a single OnMemoryDump funciton call. |
43 explicit SkiaGpuTraceMemoryDump(base::trace_event::ProcessMemoryDump* pmd, | 43 explicit SkiaGpuTraceMemoryDump(base::trace_event::ProcessMemoryDump* pmd, |
44 uint64_t share_group_tracing_guid) | 44 uint64_t share_group_tracing_guid) |
45 : pmd_(pmd), share_group_tracing_guid_(share_group_tracing_guid) {} | 45 : pmd_(pmd), share_group_tracing_guid_(share_group_tracing_guid) {} |
46 | 46 |
47 // Overridden from SkTraceMemoryDump: | 47 // Overridden from SkTraceMemoryDump: |
48 void dumpNumericValue(const char* dump_name, | 48 void dumpNumericValue(const char* dump_name, |
49 const char* value_name, | 49 const char* value_name, |
50 const char* units, | 50 const char* units, |
51 uint64_t value) override { | 51 uint64_t value) override { |
52 auto dump = GetOrCreateAllocatorDump(dump_name); | 52 auto* dump = GetOrCreateAllocatorDump(dump_name); |
53 dump->AddScalar(value_name, units, value); | 53 dump->AddScalar(value_name, units, value); |
54 } | 54 } |
55 | 55 |
56 void setMemoryBacking(const char* dump_name, | 56 void setMemoryBacking(const char* dump_name, |
57 const char* backing_type, | 57 const char* backing_type, |
58 const char* backing_object_id) override { | 58 const char* backing_object_id) override { |
59 const uint64_t tracing_process_id = | 59 const uint64_t tracing_process_id = |
60 base::trace_event::MemoryDumpManager::GetInstance() | 60 base::trace_event::MemoryDumpManager::GetInstance() |
61 ->GetTracingProcessId(); | 61 ->GetTracingProcessId(); |
62 | 62 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 LevelOfDetail getRequestedDetails() const override { | 97 LevelOfDetail getRequestedDetails() const override { |
98 // TODO(ssid): Use MemoryDumpArgs to create light dumps when requested | 98 // TODO(ssid): Use MemoryDumpArgs to create light dumps when requested |
99 // (crbug.com/499731). | 99 // (crbug.com/499731). |
100 return kObjectsBreakdowns_LevelOfDetail; | 100 return kObjectsBreakdowns_LevelOfDetail; |
101 } | 101 } |
102 | 102 |
103 private: | 103 private: |
104 // Helper to create allocator dumps. | 104 // Helper to create allocator dumps. |
105 base::trace_event::MemoryAllocatorDump* GetOrCreateAllocatorDump( | 105 base::trace_event::MemoryAllocatorDump* GetOrCreateAllocatorDump( |
106 const char* dump_name) { | 106 const char* dump_name) { |
107 auto dump = pmd_->GetAllocatorDump(dump_name); | 107 auto* dump = pmd_->GetAllocatorDump(dump_name); |
108 if (!dump) | 108 if (!dump) |
109 dump = pmd_->CreateAllocatorDump(dump_name); | 109 dump = pmd_->CreateAllocatorDump(dump_name); |
110 return dump; | 110 return dump; |
111 } | 111 } |
112 | 112 |
113 base::trace_event::ProcessMemoryDump* pmd_; | 113 base::trace_event::ProcessMemoryDump* pmd_; |
114 uint64_t share_group_tracing_guid_; | 114 uint64_t share_group_tracing_guid_; |
115 | 115 |
116 DISALLOW_COPY_AND_ASSIGN(SkiaGpuTraceMemoryDump); | 116 DISALLOW_COPY_AND_ASSIGN(SkiaGpuTraceMemoryDump); |
117 }; | 117 }; |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 if (context_provider_.get()) { | 334 if (context_provider_.get()) { |
335 context_provider_->SetLostContextCallback( | 335 context_provider_->SetLostContextCallback( |
336 ContextProvider::LostContextCallback()); | 336 ContextProvider::LostContextCallback()); |
337 } | 337 } |
338 context_provider_ = nullptr; | 338 context_provider_ = nullptr; |
339 client_ = nullptr; | 339 client_ = nullptr; |
340 weak_ptr_factory_.InvalidateWeakPtrs(); | 340 weak_ptr_factory_.InvalidateWeakPtrs(); |
341 } | 341 } |
342 | 342 |
343 } // namespace cc | 343 } // namespace cc |
OLD | NEW |