Chromium Code Reviews| Index: content/public/browser/memory_pressure_controller.h |
| diff --git a/content/public/browser/memory_pressure_controller.h b/content/public/browser/memory_pressure_controller.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..86df6be2f8214666808952ee8a615e15f014d185 |
| --- /dev/null |
| +++ b/content/public/browser/memory_pressure_controller.h |
| @@ -0,0 +1,34 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_PUBLIC_BROWSER_MEMORY_PRESSURE_CONTROLLER_H_ |
| +#define CONTENT_PUBLIC_BROWSER_MEMORY_PRESSURE_CONTROLLER_H_ |
| + |
| +#include "base/memory/memory_pressure_listener.h" |
| +#include "content/common/content_export.h" |
| + |
| +namespace content { |
| + |
| +class BrowserChildProcessHost; |
| +class RenderProcessHost; |
| + |
| +// Facade around the singleton MemoryPressureControllerImpl class defined in |
|
Charlie Reis
2016/01/29 19:46:56
We probably shouldn't introduce a public class in
chrisha
2016/01/29 21:12:12
Done.
|
| +// content/browser/memory/memory_pressure_controller_impl.h. See that header for |
| +// more details. These are exposed so that chrome/browser can interact with the |
|
Charlie Reis
2016/01/29 19:46:56
Let's say "content embedders" rather than chrome/b
chrisha
2016/01/29 21:12:12
Done.
|
| +// content memory pressure subsystem. These may be called from any thread. |
| +class CONTENT_EXPORT MemoryPressureController { |
| + public: |
| + static void SendPressureNotification( |
|
Charlie Reis
2016/01/29 19:46:56
Let's copy the comments on these functions here, s
chrisha
2016/01/29 21:12:12
Done.
|
| + const BrowserChildProcessHost* child_process_host, |
| + base::MemoryPressureListener::MemoryPressureLevel level); |
| + static void SendPressureNotification( |
| + const RenderProcessHost* render_process_host, |
| + base::MemoryPressureListener::MemoryPressureLevel level); |
| + private: |
|
Charlie Reis
2016/01/29 19:46:56
nit: Add blank line above.
chrisha
2016/01/29 21:12:13
Done.
|
| + DISALLOW_COPY_AND_ASSIGN(MemoryPressureController); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_PUBLIC_BROWSER_MEMORY_MEMORY_PRESSURE_CONTROLLER_H_ |
|
Charlie Reis
2016/01/29 19:46:56
Looks like you have an extra MEMORY_ here.
chrisha
2016/01/29 21:12:12
Indeed I do. Removed.
|