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

Side by Side Diff: content/child/memory/child_memory_coordinator_impl.cc

Issue 2752153002: memory coordinator: Change tracing event category (Closed)
Patch Set: Created 3 years, 9 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 | « content/browser/memory/memory_coordinator_impl.cc ('k') | 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "content/child/memory/child_memory_coordinator_impl.h" 5 #include "content/child/memory/child_memory_coordinator_impl.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/memory/memory_coordinator_client_registry.h" 8 #include "base/memory/memory_coordinator_client_registry.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 base::AutoLock lock(*g_lock.Pointer()); 57 base::AutoLock lock(*g_lock.Pointer());
58 DCHECK(g_child_memory_coordinator == this); 58 DCHECK(g_child_memory_coordinator == this);
59 g_child_memory_coordinator = nullptr; 59 g_child_memory_coordinator = nullptr;
60 } 60 }
61 61
62 base::MemoryState ChildMemoryCoordinatorImpl::GetCurrentMemoryState() const { 62 base::MemoryState ChildMemoryCoordinatorImpl::GetCurrentMemoryState() const {
63 return current_state_; 63 return current_state_;
64 } 64 }
65 65
66 void ChildMemoryCoordinatorImpl::PurgeMemory() { 66 void ChildMemoryCoordinatorImpl::PurgeMemory() {
67 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("memory-infra"), 67 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("memory_coordinator"),
68 "ChildMemoryCoordinatorImpl::PurgeMemory"); 68 "ChildMemoryCoordinatorImpl::PurgeMemory");
69 base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory(); 69 base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory();
70 } 70 }
71 71
72 void ChildMemoryCoordinatorImpl::OnStateChange(mojom::MemoryState state) { 72 void ChildMemoryCoordinatorImpl::OnStateChange(mojom::MemoryState state) {
73 current_state_ = ToBaseMemoryState(state); 73 current_state_ = ToBaseMemoryState(state);
74 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("memory-infra"), 74 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("memory_coordinator"),
75 "ChildMemoryCoordinatorImpl::OnStateChange", "state", 75 "ChildMemoryCoordinatorImpl::OnStateChange", "state",
76 MemoryStateToString(current_state_)); 76 MemoryStateToString(current_state_));
77 base::MemoryCoordinatorClientRegistry::GetInstance()->Notify(current_state_); 77 base::MemoryCoordinatorClientRegistry::GetInstance()->Notify(current_state_);
78 } 78 }
79 79
80 #if !defined(OS_ANDROID) 80 #if !defined(OS_ANDROID)
81 std::unique_ptr<ChildMemoryCoordinatorImpl> CreateChildMemoryCoordinator( 81 std::unique_ptr<ChildMemoryCoordinatorImpl> CreateChildMemoryCoordinator(
82 mojom::MemoryCoordinatorHandlePtr parent, 82 mojom::MemoryCoordinatorHandlePtr parent,
83 ChildMemoryCoordinatorDelegate* delegate) { 83 ChildMemoryCoordinatorDelegate* delegate) {
84 return base::WrapUnique( 84 return base::WrapUnique(
85 new ChildMemoryCoordinatorImpl(std::move(parent), delegate)); 85 new ChildMemoryCoordinatorImpl(std::move(parent), delegate));
86 } 86 }
87 #endif 87 #endif
88 88
89 } // namespace content 89 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/memory/memory_coordinator_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698