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 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 { | 626 { |
627 base::SetRecordActionTaskRunner( | 627 base::SetRecordActionTaskRunner( |
628 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI)); | 628 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI)); |
629 } | 629 } |
630 | 630 |
631 #if defined(OS_WIN) | 631 #if defined(OS_WIN) |
632 if (base::win::GetVersion() >= base::win::VERSION_WIN8) | 632 if (base::win::GetVersion() >= base::win::VERSION_WIN8) |
633 screen_orientation_delegate_.reset(new ScreenOrientationDelegateWin()); | 633 screen_orientation_delegate_.reset(new ScreenOrientationDelegateWin()); |
634 #endif | 634 #endif |
635 | 635 |
636 auto* discardable_shared_memory_manager = | 636 // Only use discardable_memory::DiscardableSharedMemoryManager when Chrome is |
637 discardable_memory::DiscardableSharedMemoryManager::CreateInstance(); | 637 // not running in mus+ash. |
| 638 if (!service_manager::ServiceManagerIsRemote()) { |
| 639 auto* discardable_shared_memory_manager = |
| 640 discardable_memory::DiscardableSharedMemoryManager::CreateInstance(); |
638 | 641 |
639 // TODO(boliu): kSingleProcess check is a temporary workaround for | 642 // TODO(boliu): kSingleProcess check is a temporary workaround for |
640 // in-process Android WebView. crbug.com/503724 tracks proper fix. | 643 // in-process Android WebView. crbug.com/503724 tracks proper fix. |
641 if (!parsed_command_line_.HasSwitch(switches::kSingleProcess)) { | 644 if (!parsed_command_line_.HasSwitch(switches::kSingleProcess)) { |
642 base::DiscardableMemoryAllocator::SetInstance( | 645 base::DiscardableMemoryAllocator::SetInstance( |
643 discardable_shared_memory_manager); | 646 discardable_shared_memory_manager); |
| 647 } |
644 } | 648 } |
645 | 649 |
646 if (parts_) | 650 if (parts_) |
647 parts_->PostMainMessageLoopStart(); | 651 parts_->PostMainMessageLoopStart(); |
648 | 652 |
649 // Start startup tracing through TracingController's interface. TraceLog has | 653 // Start startup tracing through TracingController's interface. TraceLog has |
650 // been enabled in content_main_runner where threads are not available. Now We | 654 // been enabled in content_main_runner where threads are not available. Now We |
651 // need to start tracing for all other tracing agents, which require threads. | 655 // need to start tracing for all other tracing agents, which require threads. |
652 if (parsed_command_line_.HasSwitch(switches::kTraceStartup)) { | 656 if (parsed_command_line_.HasSwitch(switches::kTraceStartup)) { |
653 base::trace_event::TraceConfig trace_config( | 657 base::trace_event::TraceConfig trace_config( |
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1609 if (!audio_manager_) { | 1613 if (!audio_manager_) { |
1610 audio_thread_ = base::MakeUnique<AudioDeviceThread>(); | 1614 audio_thread_ = base::MakeUnique<AudioDeviceThread>(); |
1611 audio_manager_ = media::AudioManager::Create( | 1615 audio_manager_ = media::AudioManager::Create( |
1612 audio_thread_->GetTaskRunner(), audio_thread_->worker_task_runner(), | 1616 audio_thread_->GetTaskRunner(), audio_thread_->worker_task_runner(), |
1613 MediaInternals::GetInstance()); | 1617 MediaInternals::GetInstance()); |
1614 } | 1618 } |
1615 CHECK(audio_manager_); | 1619 CHECK(audio_manager_); |
1616 } | 1620 } |
1617 | 1621 |
1618 } // namespace content | 1622 } // namespace content |
OLD | NEW |