OLD | NEW |
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 CHROME_BROWSER_MEMORY_CHROME_MEMORY_COORDINATOR_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_MEMORY_CHROME_MEMORY_COORDINATOR_DELEGATE_H_ |
6 #define CHROME_BROWSER_MEMORY_CHROME_MEMORY_COORDINATOR_DELEGATE_H_ | 6 #define CHROME_BROWSER_MEMORY_CHROME_MEMORY_COORDINATOR_DELEGATE_H_ |
7 | 7 |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "content/public/browser/memory_coordinator_delegate.h" | 9 #include "content/public/browser/memory_coordinator_delegate.h" |
10 | 10 |
11 namespace memory { | 11 namespace memory { |
12 | 12 |
13 // A MemoryCoordinatorDelegate which uses TabManager internally. | 13 // A MemoryCoordinatorDelegate which uses TabManager internally. |
14 class ChromeMemoryCoordinatorDelegate | 14 class ChromeMemoryCoordinatorDelegate |
15 : public content::MemoryCoordinatorDelegate { | 15 : public content::MemoryCoordinatorDelegate { |
16 public: | 16 public: |
17 static std::unique_ptr<content::MemoryCoordinatorDelegate> Create(); | 17 static std::unique_ptr<content::MemoryCoordinatorDelegate> Create(); |
18 | 18 |
19 ~ChromeMemoryCoordinatorDelegate() override; | 19 ~ChromeMemoryCoordinatorDelegate() override; |
20 | 20 |
21 // MemoryCoordinatorDelegate implementation. | 21 // MemoryCoordinatorDelegate implementation. |
22 bool CanSuspendBackgroundedRenderer(int render_process_id) override; | 22 bool CanSuspendBackgroundedRenderer(int render_process_id) override; |
23 void DiscardTab() override; | 23 bool DiscardTab() override; |
24 | 24 |
25 private: | 25 private: |
26 ChromeMemoryCoordinatorDelegate(); | 26 ChromeMemoryCoordinatorDelegate(); |
27 | 27 |
28 DISALLOW_COPY_AND_ASSIGN(ChromeMemoryCoordinatorDelegate); | 28 DISALLOW_COPY_AND_ASSIGN(ChromeMemoryCoordinatorDelegate); |
29 }; | 29 }; |
30 | 30 |
31 } // namespace memory | 31 } // namespace memory |
32 | 32 |
33 #endif // CHROME_BROWSER_MEMORY_CHROME_MEMORY_COORDINATOR_DELEGATE_H_ | 33 #endif // CHROME_BROWSER_MEMORY_CHROME_MEMORY_COORDINATOR_DELEGATE_H_ |
OLD | NEW |