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

Unified Diff: content/browser/browser_main_loop.cc

Issue 2548423002: Hosting the discardable memory service in the mus process (Closed)
Patch Set: Rebase Created 4 years 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
Index: content/browser/browser_main_loop.cc
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index 4e52a51413cdf13748a5525affae192d5b34a72c..574416b1f35907a9ace912186bcfb361796eb807 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -730,14 +730,18 @@ void BrowserMainLoop::PostMainMessageLoopStart() {
screen_orientation_delegate_.reset(new ScreenOrientationDelegateWin());
#endif
- auto* discardable_shared_memory_manager =
- discardable_memory::DiscardableSharedMemoryManager::CreateInstance();
-
- // TODO(boliu): kSingleProcess check is a temporary workaround for
- // in-process Android WebView. crbug.com/503724 tracks proper fix.
- if (!parsed_command_line_.HasSwitch(switches::kSingleProcess)) {
- base::DiscardableMemoryAllocator::SetInstance(
- discardable_shared_memory_manager);
+ // Only use discardable_memory::DiscardableSharedMemoryManager when Chrome is
+ // not running in mus+ash.
+ if (!service_manager::ServiceManagerIsRemote()) {
+ auto* discardable_shared_memory_manager =
+ discardable_memory::DiscardableSharedMemoryManager::CreateInstance();
+
+ // TODO(boliu): kSingleProcess check is a temporary workaround for
+ // in-process Android WebView. crbug.com/503724 tracks proper fix.
+ if (!parsed_command_line_.HasSwitch(switches::kSingleProcess)) {
+ base::DiscardableMemoryAllocator::SetInstance(
+ discardable_shared_memory_manager);
+ }
}
if (parts_)

Powered by Google App Engine
This is Rietveld 408576698