Index: content/browser/browser_main_loop.cc |
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc |
index 648873d6c243ff38638dfb43e33d088dd150381f..c6650f59b8ff7df419fe07ba5ea43b6bd8fd393c 100644 |
--- a/content/browser/browser_main_loop.cc |
+++ b/content/browser/browser_main_loop.cc |
@@ -631,11 +631,16 @@ void BrowserMainLoop::PostMainMessageLoopStart() { |
screen_orientation_delegate_.reset(new ScreenOrientationDelegateWin()); |
#endif |
+ // Initialize the singleton discardable_memory::DiscardableSharedMemoryManager |
+ // here to avoid initialization happening in IO thread. |
+ auto discardable_shared_memory_manager = |
+ discardable_memory::DiscardableSharedMemoryManager::current(); |
+ |
// 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_memory::DiscardableSharedMemoryManager::current()); |
+ discardable_shared_memory_manager); |
} |
if (parts_) |