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

Side by Side Diff: components/memory_coordinator/browser/memory_coordinator.h

Issue 2143353004: Revert of Add MemoryCoordinator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_MEMORY_COORDINATOR_BROWSER_MEMORY_COORDINATOR_H_
6 #define COMPONENTS_MEMORY_COORDINATOR_BROWSER_MEMORY_COORDINATOR_H_
7
8 #include "components/memory_coordinator/public/interfaces/memory_coordinator.moj om.h"
9 #include "mojo/public/cpp/bindings/binding.h"
10
11 namespace memory_coordinator {
12
13 class MemoryCoordinatorHandleImpl;
14
15 // MemoryCoordinator is responsible for the whole memory management accross the
16 // browser and child proceeses. It will dispatch memory events to its clients
17 // and child processes based on its best knowledge of the memory usage.
18 class MemoryCoordinator {
19 public:
20 MemoryCoordinator();
21 ~MemoryCoordinator();
22
23 void CreateHandle(int render_process_id,
24 mojom::MemoryCoordinatorHandleRequest request);
25
26 // Returns number of children. Only used for testing.
27 size_t NumChildrenForTesting();
28
29 private:
30 void OnConnectionError(int render_process_id);
31
32 // Mappings of RenderProcessHost::GetID() -> MemoryCoordinatorHandleImpl.
33 // A mapping is added when a renderer connects to MemoryCoordinator and
34 // removed automatically when a underlying binding is disconnected.
35 std::map<int, std::unique_ptr<MemoryCoordinatorHandleImpl>> children_;
36
37 DISALLOW_COPY_AND_ASSIGN(MemoryCoordinator);
38 };
39
40 } // memory_coordinator
41
42 #endif // COMPONENTS_MEMORY_COORDINATOR_BROWSER_MEMORY_COORDINATOR_H_
OLDNEW
« no previous file with comments | « components/memory_coordinator/browser/BUILD.gn ('k') | components/memory_coordinator/browser/memory_coordinator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698