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 13 matching lines...) Expand all Loading... | |
24 #include "base/metrics/user_metrics.h" | 24 #include "base/metrics/user_metrics.h" |
25 #include "base/pending_task.h" | 25 #include "base/pending_task.h" |
26 #include "base/power_monitor/power_monitor.h" | 26 #include "base/power_monitor/power_monitor.h" |
27 #include "base/power_monitor/power_monitor_device_source.h" | 27 #include "base/power_monitor/power_monitor_device_source.h" |
28 #include "base/process/process_metrics.h" | 28 #include "base/process/process_metrics.h" |
29 #include "base/run_loop.h" | 29 #include "base/run_loop.h" |
30 #include "base/single_thread_task_runner.h" | 30 #include "base/single_thread_task_runner.h" |
31 #include "base/strings/string_number_conversions.h" | 31 #include "base/strings/string_number_conversions.h" |
32 #include "base/strings/string_split.h" | 32 #include "base/strings/string_split.h" |
33 #include "base/system_monitor/system_monitor.h" | 33 #include "base/system_monitor/system_monitor.h" |
34 #include "base/threading/sequenced_worker_pool.h" | 34 #include "base/threading/sequenced_worker_pool.h" |
dcheng
2016/11/28 18:26:54
Please try to separate rebases from addressing rev
| |
35 #include "base/threading/thread_restrictions.h" | 35 #include "base/threading/thread_restrictions.h" |
36 #include "base/threading/thread_task_runner_handle.h" | 36 #include "base/threading/thread_task_runner_handle.h" |
37 #include "base/timer/hi_res_timer_manager.h" | 37 #include "base/timer/hi_res_timer_manager.h" |
38 #include "base/trace_event/memory_dump_manager.h" | 38 #include "base/trace_event/memory_dump_manager.h" |
39 #include "base/trace_event/trace_event.h" | 39 #include "base/trace_event/trace_event.h" |
40 #include "build/build_config.h" | 40 #include "build/build_config.h" |
41 #include "components/discardable_memory/service/discardable_shared_memory_manage r.h" | 41 #include "components/discardable_memory/service/discardable_shared_memory_manage r.h" |
42 #include "components/tracing/browser/trace_config_file.h" | 42 #include "components/tracing/browser/trace_config_file.h" |
43 #include "components/tracing/common/process_metrics_memory_dump_provider.h" | 43 #include "components/tracing/common/process_metrics_memory_dump_provider.h" |
44 #include "components/tracing/common/trace_to_console.h" | 44 #include "components/tracing/common/trace_to_console.h" |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
627 { | 627 { |
628 base::SetRecordActionTaskRunner( | 628 base::SetRecordActionTaskRunner( |
629 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI)); | 629 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI)); |
630 } | 630 } |
631 | 631 |
632 #if defined(OS_WIN) | 632 #if defined(OS_WIN) |
633 if (base::win::GetVersion() >= base::win::VERSION_WIN8) | 633 if (base::win::GetVersion() >= base::win::VERSION_WIN8) |
634 screen_orientation_delegate_.reset(new ScreenOrientationDelegateWin()); | 634 screen_orientation_delegate_.reset(new ScreenOrientationDelegateWin()); |
635 #endif | 635 #endif |
636 | 636 |
637 auto* discardable_shared_memory_manager = | |
638 discardable_memory::DiscardableSharedMemoryManager::CreateInstance(); | |
639 | |
637 // TODO(boliu): kSingleProcess check is a temporary workaround for | 640 // TODO(boliu): kSingleProcess check is a temporary workaround for |
638 // in-process Android WebView. crbug.com/503724 tracks proper fix. | 641 // in-process Android WebView. crbug.com/503724 tracks proper fix. |
639 if (!parsed_command_line_.HasSwitch(switches::kSingleProcess)) { | 642 if (!parsed_command_line_.HasSwitch(switches::kSingleProcess)) { |
640 base::DiscardableMemoryAllocator::SetInstance( | 643 base::DiscardableMemoryAllocator::SetInstance( |
641 discardable_memory::DiscardableSharedMemoryManager::current()); | 644 discardable_shared_memory_manager); |
642 } | 645 } |
643 | 646 |
644 if (parts_) | 647 if (parts_) |
645 parts_->PostMainMessageLoopStart(); | 648 parts_->PostMainMessageLoopStart(); |
646 | 649 |
647 // Start startup tracing through TracingController's interface. TraceLog has | 650 // Start startup tracing through TracingController's interface. TraceLog has |
648 // been enabled in content_main_runner where threads are not available. Now We | 651 // been enabled in content_main_runner where threads are not available. Now We |
649 // need to start tracing for all other tracing agents, which require threads. | 652 // need to start tracing for all other tracing agents, which require threads. |
650 if (parsed_command_line_.HasSwitch(switches::kTraceStartup)) { | 653 if (parsed_command_line_.HasSwitch(switches::kTraceStartup)) { |
651 base::trace_event::TraceConfig trace_config( | 654 base::trace_event::TraceConfig trace_config( |
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1626 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = | 1629 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = |
1627 audio_thread_->task_runner(); | 1630 audio_thread_->task_runner(); |
1628 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), | 1631 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), |
1629 std::move(worker_task_runner), | 1632 std::move(worker_task_runner), |
1630 MediaInternals::GetInstance()); | 1633 MediaInternals::GetInstance()); |
1631 } | 1634 } |
1632 CHECK(audio_manager_); | 1635 CHECK(audio_manager_); |
1633 } | 1636 } |
1634 | 1637 |
1635 } // namespace content | 1638 } // namespace content |
OLD | NEW |