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

Side by Side Diff: content/child/memory/child_memory_coordinator_impl.h

Issue 2376233005: [NotForReview] An idea for experimenting purge & suspend (Closed)
Patch Set: 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_CHILD_MEMORY_CHILD_MEMORY_COORDINATOR_IMPL_H_ 5 #ifndef CONTENT_CHILD_MEMORY_CHILD_MEMORY_COORDINATOR_IMPL_H_
6 #define CONTENT_CHILD_MEMORY_CHILD_MEMORY_COORDINATOR_IMPL_H_ 6 #define CONTENT_CHILD_MEMORY_CHILD_MEMORY_COORDINATOR_IMPL_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/memory_coordinator_client.h" 9 #include "base/memory/memory_coordinator_client.h"
10 #include "content/common/child_memory_coordinator.mojom.h" 10 #include "content/common/child_memory_coordinator.mojom.h"
(...skipping 10 matching lines...) Expand all
21 // Called when the system requests immediate actions to free memory. 21 // Called when the system requests immediate actions to free memory.
22 virtual void OnTrimMemoryImmediately() = 0; 22 virtual void OnTrimMemoryImmediately() = 0;
23 }; 23 };
24 24
25 // ChildMemoryCoordinatorImpl is the implementation of ChildMemoryCoordinator. 25 // ChildMemoryCoordinatorImpl is the implementation of ChildMemoryCoordinator.
26 // It lives in child processes and is responsible for dispatching memory events 26 // It lives in child processes and is responsible for dispatching memory events
27 // to its clients. 27 // to its clients.
28 class CONTENT_EXPORT ChildMemoryCoordinatorImpl 28 class CONTENT_EXPORT ChildMemoryCoordinatorImpl
29 : NON_EXPORTED_BASE(public mojom::ChildMemoryCoordinator) { 29 : NON_EXPORTED_BASE(public mojom::ChildMemoryCoordinator) {
30 public: 30 public:
31 // Returns true when memory coordinator is enabled.
32 static bool IsEnabled();
33
31 // Returns the instance of ChildMemoryCoordinatorImpl. Could be nullptr. 34 // Returns the instance of ChildMemoryCoordinatorImpl. Could be nullptr.
32 static ChildMemoryCoordinatorImpl* GetInstance(); 35 static ChildMemoryCoordinatorImpl* GetInstance();
33 36
34 ChildMemoryCoordinatorImpl(mojom::MemoryCoordinatorHandlePtr parent, 37 ChildMemoryCoordinatorImpl(mojom::MemoryCoordinatorHandlePtr parent,
35 ChildMemoryCoordinatorDelegate* delegate); 38 ChildMemoryCoordinatorDelegate* delegate);
36 ~ChildMemoryCoordinatorImpl() override; 39 ~ChildMemoryCoordinatorImpl() override;
37 40
38 // mojom::ChildMemoryCoordinator implementations: 41 // mojom::ChildMemoryCoordinator implementations:
39 void OnStateChange(mojom::MemoryState state) override; 42 void OnStateChange(mojom::MemoryState state) override;
40 43
(...skipping 12 matching lines...) Expand all
53 56
54 // Factory function for creating a ChildMemoryCoordinator for the current 57 // Factory function for creating a ChildMemoryCoordinator for the current
55 // platform. Doesn't take the ownership of |delegate|. 58 // platform. Doesn't take the ownership of |delegate|.
56 CONTENT_EXPORT std::unique_ptr<ChildMemoryCoordinatorImpl> 59 CONTENT_EXPORT std::unique_ptr<ChildMemoryCoordinatorImpl>
57 CreateChildMemoryCoordinator(mojom::MemoryCoordinatorHandlePtr parent, 60 CreateChildMemoryCoordinator(mojom::MemoryCoordinatorHandlePtr parent,
58 ChildMemoryCoordinatorDelegate* delegate); 61 ChildMemoryCoordinatorDelegate* delegate);
59 62
60 } // namespace content 63 } // namespace content
61 64
62 #endif // CONTENT_CHILD_MEMORY_CHILD_MEMORY_COORDINATOR_IMPL_H_ 65 #endif // CONTENT_CHILD_MEMORY_CHILD_MEMORY_COORDINATOR_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/child/memory/child_memory_coordinator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698