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 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 { | 723 { |
724 base::SetRecordActionTaskRunner( | 724 base::SetRecordActionTaskRunner( |
725 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI)); | 725 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI)); |
726 } | 726 } |
727 | 727 |
728 #if defined(OS_WIN) | 728 #if defined(OS_WIN) |
729 if (base::win::GetVersion() >= base::win::VERSION_WIN8) | 729 if (base::win::GetVersion() >= base::win::VERSION_WIN8) |
730 screen_orientation_delegate_.reset(new ScreenOrientationDelegateWin()); | 730 screen_orientation_delegate_.reset(new ScreenOrientationDelegateWin()); |
731 #endif | 731 #endif |
732 | 732 |
733 auto* discardable_shared_memory_manager = | 733 // Only use discardable_memory::DiscardableSharedMemoryManager when Chrome is |
734 discardable_memory::DiscardableSharedMemoryManager::CreateInstance(); | 734 // not running in mus+ash. |
| 735 if (!service_manager::ServiceManagerIsRemote()) { |
| 736 auto* discardable_shared_memory_manager = |
| 737 discardable_memory::DiscardableSharedMemoryManager::CreateInstance(); |
735 | 738 |
736 // TODO(boliu): kSingleProcess check is a temporary workaround for | 739 // TODO(boliu): kSingleProcess check is a temporary workaround for |
737 // in-process Android WebView. crbug.com/503724 tracks proper fix. | 740 // in-process Android WebView. crbug.com/503724 tracks proper fix. |
738 if (!parsed_command_line_.HasSwitch(switches::kSingleProcess)) { | 741 if (!parsed_command_line_.HasSwitch(switches::kSingleProcess)) { |
739 base::DiscardableMemoryAllocator::SetInstance( | 742 base::DiscardableMemoryAllocator::SetInstance( |
740 discardable_shared_memory_manager); | 743 discardable_shared_memory_manager); |
| 744 } |
741 } | 745 } |
742 | 746 |
743 if (parts_) | 747 if (parts_) |
744 parts_->PostMainMessageLoopStart(); | 748 parts_->PostMainMessageLoopStart(); |
745 | 749 |
746 // Start startup tracing through TracingController's interface. TraceLog has | 750 // Start startup tracing through TracingController's interface. TraceLog has |
747 // been enabled in content_main_runner where threads are not available. Now We | 751 // been enabled in content_main_runner where threads are not available. Now We |
748 // need to start tracing for all other tracing agents, which require threads. | 752 // need to start tracing for all other tracing agents, which require threads. |
749 if (parsed_command_line_.HasSwitch(switches::kTraceStartup)) { | 753 if (parsed_command_line_.HasSwitch(switches::kTraceStartup)) { |
750 base::trace_event::TraceConfig trace_config( | 754 base::trace_event::TraceConfig trace_config( |
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1789 if (!audio_manager_) { | 1793 if (!audio_manager_) { |
1790 audio_thread_ = base::MakeUnique<AudioManagerThread>(); | 1794 audio_thread_ = base::MakeUnique<AudioManagerThread>(); |
1791 audio_manager_ = media::AudioManager::Create( | 1795 audio_manager_ = media::AudioManager::Create( |
1792 audio_thread_->task_runner(), audio_thread_->worker_task_runner(), | 1796 audio_thread_->task_runner(), audio_thread_->worker_task_runner(), |
1793 MediaInternals::GetInstance()); | 1797 MediaInternals::GetInstance()); |
1794 } | 1798 } |
1795 CHECK(audio_manager_); | 1799 CHECK(audio_manager_); |
1796 } | 1800 } |
1797 | 1801 |
1798 } // namespace content | 1802 } // namespace content |
OLD | NEW |