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

Unified Diff: chrome/browser/memory/chrome_memory_coordinator_delegate.cc

Issue 2399293002: Add MemoryCoordinatorDelegate (Closed)
Patch Set: Add a separate delegate class 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/memory/chrome_memory_coordinator_delegate.h ('k') | chrome/browser/memory/tab_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/memory/chrome_memory_coordinator_delegate.cc
diff --git a/chrome/browser/memory/chrome_memory_coordinator_delegate.cc b/chrome/browser/memory/chrome_memory_coordinator_delegate.cc
new file mode 100644
index 0000000000000000000000000000000000000000..672b203569a5a65f9071cc5d4eb783f726a64b80
--- /dev/null
+++ b/chrome/browser/memory/chrome_memory_coordinator_delegate.cc
@@ -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.
+
+#include "chrome/browser/memory/chrome_memory_coordinator_delegate.h"
+
+#include "base/memory/ptr_util.h"
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/memory/tab_manager.h"
+
+namespace memory {
+
+// static
+std::unique_ptr<content::MemoryCoordinatorDelegate>
+ChromeMemoryCoordinatorDelegate::Create() {
+ return base::WrapUnique(new ChromeMemoryCoordinatorDelegate);
+}
+
+ChromeMemoryCoordinatorDelegate::ChromeMemoryCoordinatorDelegate() {}
+
+ChromeMemoryCoordinatorDelegate::~ChromeMemoryCoordinatorDelegate() {}
+
+bool ChromeMemoryCoordinatorDelegate::CanSuspendBackgroundedRenderer(
+ int render_process_id) {
+#if defined(OS_ANDROID)
+ // TODO(bashi): Implement
+ return true;
+#else
+ return g_browser_process->GetTabManager()->CanSuspendBackgroundedRenderer(
+ render_process_id);
+#endif
+}
+
+} // namespace memory
« no previous file with comments | « chrome/browser/memory/chrome_memory_coordinator_delegate.h ('k') | chrome/browser/memory/tab_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698