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

Side by Side Diff: components/memory_pressure/test_memory_pressure_calculator.cc

Issue 2874553004: Remove memory_pressure component. (Closed)
Patch Set: Created 3 years, 7 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 | « components/memory_pressure/test_memory_pressure_calculator.h ('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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "components/memory_pressure/test_memory_pressure_calculator.h"
6
7 namespace memory_pressure {
8
9 #if defined(MEMORY_PRESSURE_IS_POLLING)
10
11 TestMemoryPressureCalculator::TestMemoryPressureCalculator()
12 : level_(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE), calls_(0) {}
13
14 TestMemoryPressureCalculator::TestMemoryPressureCalculator(
15 MemoryPressureLevel level)
16 : level_(level), calls_(0) {}
17
18 TestMemoryPressureCalculator::MemoryPressureLevel
19 TestMemoryPressureCalculator::CalculateCurrentPressureLevel() {
20 ++calls_;
21 return level_;
22 }
23
24 void TestMemoryPressureCalculator::SetLevel(MemoryPressureLevel level) {
25 level_ = level;
26 }
27
28 void TestMemoryPressureCalculator::SetNone() {
29 level_ = MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE;
30 }
31
32 void TestMemoryPressureCalculator::SetModerate() {
33 level_ = MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE;
34 }
35
36 void TestMemoryPressureCalculator::SetCritical() {
37 level_ = MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL;
38 }
39
40 void TestMemoryPressureCalculator::ResetCalls() {
41 calls_ = 0;
42 }
43
44 #endif // defined(MEMORY_PRESSURE_IS_POLLING)
45
46 } // namespace memory_pressure
OLDNEW
« no previous file with comments | « components/memory_pressure/test_memory_pressure_calculator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698