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

Side by Side Diff: content/browser/memory/memory_coordinator_impl.h

Issue 2412413002: WIP: Add MemoryCoordinator::GetCurrentMemoryState (Closed)
Patch Set: (rebase) Created 4 years, 2 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
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 #ifndef CONTENT_BROWSER_MEMORY_MEMORY_COORDINATOR_IMPL_H_ 5 #ifndef CONTENT_BROWSER_MEMORY_MEMORY_COORDINATOR_IMPL_H_
6 #define CONTENT_BROWSER_MEMORY_MEMORY_COORDINATOR_IMPL_H_ 6 #define CONTENT_BROWSER_MEMORY_MEMORY_COORDINATOR_IMPL_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/singleton.h" 9 #include "base/memory/singleton.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 29 matching lines...) Expand all
40 MemoryCoordinatorImpl(scoped_refptr<base::SingleThreadTaskRunner> task_runner, 40 MemoryCoordinatorImpl(scoped_refptr<base::SingleThreadTaskRunner> task_runner,
41 std::unique_ptr<MemoryMonitor> monitor); 41 std::unique_ptr<MemoryMonitor> monitor);
42 ~MemoryCoordinatorImpl() override; 42 ~MemoryCoordinatorImpl() override;
43 43
44 // MemoryCoordinator implementations: 44 // MemoryCoordinator implementations:
45 void Start() override; 45 void Start() override;
46 void OnChildAdded(int render_process_id) override; 46 void OnChildAdded(int render_process_id) override;
47 47
48 MemoryMonitor* memory_monitor() { return memory_monitor_.get(); } 48 MemoryMonitor* memory_monitor() { return memory_monitor_.get(); }
49 49
50 base::MemoryState GetCurrentMemoryState() const override;
51
50 private: 52 private:
51 FRIEND_TEST_ALL_PREFIXES(MemoryCoordinatorImplTest, CalculateNextState); 53 FRIEND_TEST_ALL_PREFIXES(MemoryCoordinatorImplTest, CalculateNextState);
52 FRIEND_TEST_ALL_PREFIXES(MemoryCoordinatorImplTest, UpdateState); 54 FRIEND_TEST_ALL_PREFIXES(MemoryCoordinatorImplTest, UpdateState);
53 55
54 friend struct MemoryCoordinatorSingletonTraits; 56 friend struct MemoryCoordinatorSingletonTraits;
55 57
56 using MemoryState = base::MemoryState; 58 using MemoryState = base::MemoryState;
57 59
58 // Calculates the next global state from the amount of free memory using 60 // Calculates the next global state from the amount of free memory using
59 // a heuristic. 61 // a heuristic.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 base::TimeDelta monitoring_interval_; 112 base::TimeDelta monitoring_interval_;
111 113
112 base::WeakPtrFactory<MemoryCoordinatorImpl> weak_ptr_factory_; 114 base::WeakPtrFactory<MemoryCoordinatorImpl> weak_ptr_factory_;
113 115
114 DISALLOW_COPY_AND_ASSIGN(MemoryCoordinatorImpl); 116 DISALLOW_COPY_AND_ASSIGN(MemoryCoordinatorImpl);
115 }; 117 };
116 118
117 } // namespace content 119 } // namespace content
118 120
119 #endif // CONTENT_BROWSER_MEMORY_MEMORY_COORDINATOR_IMPL_H_ 121 #endif // CONTENT_BROWSER_MEMORY_MEMORY_COORDINATOR_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/memory/memory_coordinator.cc ('k') | content/browser/memory/memory_coordinator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698