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

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

Issue 2094583002: Add MemoryCoordinator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment 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_IMPL_H_
6 #define COMPONENTS_MEMORY_COORDINATOR_BROWSER_MEMORY_COORDINATOR_IMPL_H_
7
8 #include "components/memory_coordinator/public/interfaces/memory_coordinator.moj om.h"
9 #include "mojo/public/cpp/bindings/binding_set.h"
10 #include "mojo/public/cpp/bindings/interface_ptr_set.h"
11 #include "services/shell/public/cpp/interface_provider.h"
12
13 namespace memory_coordinator {
14
15 // The implementation of MemoryCoordinator. See memory_coordinator.mojom
16 // for the role of this class.
17 class MemoryCoordinatorImpl : public mojom::MemoryCoordinator {
18 public:
19 MemoryCoordinatorImpl();
20 ~MemoryCoordinatorImpl() override;
21
22 // Called when a renderer process is launched.
23 void RendererLaunched(shell::InterfaceProvider* remote_interfaces);
24
25 // Iterates all children synchronously.
26 template <typename FunctionType>
27 void IterateChildren(FunctionType function) {
haraken 2016/07/08 02:40:26 Is this only for testing? Or is it going to be use
bashi 2016/07/08 02:44:49 Yes. I don't have plans to use it outside tests.
haraken 2016/07/08 02:48:54 Then IterateChildrenForTesting?
bashi 2016/07/08 02:51:46 Will do.
28 children_.ForAllPtrs(function);
29 }
30
31 private:
32 mojo::InterfacePtrSet<mojom::ChildMemoryCoordinator> children_;
33
34 DISALLOW_COPY_AND_ASSIGN(MemoryCoordinatorImpl);
35 };
36
37 } // memory_coordinator
38
39 #endif // COMPONENTS_MEMORY_COORDINATOR_BROWSER_MEMORY_COORDINATOR_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698