Index: content/browser/browser_main_loop.cc |
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc |
index c87ed7b42d65bcc9b5232a9551886a98d26100d4..6592c4fba59573958d15541824cbac57482b7420 100644 |
--- a/content/browser/browser_main_loop.cc |
+++ b/content/browser/browser_main_loop.cc |
@@ -632,11 +632,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(); |
reveman
2016/11/18 21:55:25
Why would it be initialize on the IO thread? Ideal
Peng
2016/11/21 15:56:38
I just tried your suggestion. The content_browsert
|
+ |
// 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_) |