OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/browser/browser_main_loop.h" | 5 #include "content/browser/browser_main_loop.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 { | 624 { |
625 base::SetRecordActionTaskRunner( | 625 base::SetRecordActionTaskRunner( |
626 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI)); | 626 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI)); |
627 } | 627 } |
628 | 628 |
629 #if defined(OS_WIN) | 629 #if defined(OS_WIN) |
630 if (base::win::GetVersion() >= base::win::VERSION_WIN8) | 630 if (base::win::GetVersion() >= base::win::VERSION_WIN8) |
631 screen_orientation_delegate_.reset(new ScreenOrientationDelegateWin()); | 631 screen_orientation_delegate_.reset(new ScreenOrientationDelegateWin()); |
632 #endif | 632 #endif |
633 | 633 |
| 634 // Initialize the singleton discardable_memory::DiscardableSharedMemoryManager |
| 635 // here to avoid initialization happening in IO thread. |
| 636 auto discardable_shared_memory_manager = |
| 637 discardable_memory::DiscardableSharedMemoryManager::current(); |
| 638 |
634 // TODO(boliu): kSingleProcess check is a temporary workaround for | 639 // TODO(boliu): kSingleProcess check is a temporary workaround for |
635 // in-process Android WebView. crbug.com/503724 tracks proper fix. | 640 // in-process Android WebView. crbug.com/503724 tracks proper fix. |
636 if (!parsed_command_line_.HasSwitch(switches::kSingleProcess)) { | 641 if (!parsed_command_line_.HasSwitch(switches::kSingleProcess)) { |
637 base::DiscardableMemoryAllocator::SetInstance( | 642 base::DiscardableMemoryAllocator::SetInstance( |
638 discardable_memory::DiscardableSharedMemoryManager::current()); | 643 discardable_shared_memory_manager); |
639 } | 644 } |
640 | 645 |
641 if (parts_) | 646 if (parts_) |
642 parts_->PostMainMessageLoopStart(); | 647 parts_->PostMainMessageLoopStart(); |
643 | 648 |
644 // Start startup tracing through TracingController's interface. TraceLog has | 649 // Start startup tracing through TracingController's interface. TraceLog has |
645 // been enabled in content_main_runner where threads are not available. Now We | 650 // been enabled in content_main_runner where threads are not available. Now We |
646 // need to start tracing for all other tracing agents, which require threads. | 651 // need to start tracing for all other tracing agents, which require threads. |
647 if (parsed_command_line_.HasSwitch(switches::kTraceStartup)) { | 652 if (parsed_command_line_.HasSwitch(switches::kTraceStartup)) { |
648 base::trace_event::TraceConfig trace_config( | 653 base::trace_event::TraceConfig trace_config( |
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1606 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = | 1611 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = |
1607 audio_thread_->task_runner(); | 1612 audio_thread_->task_runner(); |
1608 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), | 1613 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), |
1609 std::move(worker_task_runner), | 1614 std::move(worker_task_runner), |
1610 MediaInternals::GetInstance()); | 1615 MediaInternals::GetInstance()); |
1611 } | 1616 } |
1612 CHECK(audio_manager_); | 1617 CHECK(audio_manager_); |
1613 } | 1618 } |
1614 | 1619 |
1615 } // namespace content | 1620 } // namespace content |
OLD | NEW |