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

Side by Side Diff: base/memory/memory_pressure_monitor_chromeos.cc

Issue 2495003004: [Mac] Report statistics more regularly in Mac memory pressure monitor (Closed)
Patch Set: Fix parameter name in header 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/memory/memory_pressure_monitor_chromeos.h" 5 #include "base/memory/memory_pressure_monitor_chromeos.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <sys/select.h> 8 #include <sys/select.h>
9 9
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 StopObserving(); 127 StopObserving();
128 } 128 }
129 129
130 void MemoryPressureMonitor::ScheduleEarlyCheck() { 130 void MemoryPressureMonitor::ScheduleEarlyCheck() {
131 ThreadTaskRunnerHandle::Get()->PostTask( 131 ThreadTaskRunnerHandle::Get()->PostTask(
132 FROM_HERE, Bind(&MemoryPressureMonitor::CheckMemoryPressure, 132 FROM_HERE, Bind(&MemoryPressureMonitor::CheckMemoryPressure,
133 weak_ptr_factory_.GetWeakPtr())); 133 weak_ptr_factory_.GetWeakPtr()));
134 } 134 }
135 135
136 MemoryPressureListener::MemoryPressureLevel 136 MemoryPressureListener::MemoryPressureLevel
137 MemoryPressureMonitor::GetCurrentPressureLevel() const { 137 MemoryPressureMonitor::GetCurrentPressureLevel() {
138 return current_memory_pressure_level_; 138 return current_memory_pressure_level_;
139 } 139 }
140 140
141 // static 141 // static
142 MemoryPressureMonitor* MemoryPressureMonitor::Get() { 142 MemoryPressureMonitor* MemoryPressureMonitor::Get() {
143 return static_cast<MemoryPressureMonitor*>( 143 return static_cast<MemoryPressureMonitor*>(
144 base::MemoryPressureMonitor::Get()); 144 base::MemoryPressureMonitor::Get());
145 } 145 }
146 146
147 void MemoryPressureMonitor::StartObserving() { 147 void MemoryPressureMonitor::StartObserving() {
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 return percentage; 279 return percentage;
280 } 280 }
281 281
282 void MemoryPressureMonitor::SetDispatchCallback( 282 void MemoryPressureMonitor::SetDispatchCallback(
283 const DispatchCallback& callback) { 283 const DispatchCallback& callback) {
284 dispatch_callback_ = callback; 284 dispatch_callback_ = callback;
285 } 285 }
286 286
287 } // namespace chromeos 287 } // namespace chromeos
288 } // namespace base 288 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698