Chromium Code Reviews| 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/bind.h" | 13 #include "base/bind.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/feature_list.h" | 15 #include "base/feature_list.h" |
| 16 #include "base/location.h" | 16 #include "base/location.h" |
| 17 #include "base/logging.h" | 17 #include "base/logging.h" |
| 18 #include "base/macros.h" | 18 #include "base/macros.h" |
| 19 #include "base/memory/memory_pressure_monitor.h" | 19 #include "base/memory/memory_pressure_monitor.h" |
| 20 #include "base/memory/ptr_util.h" | 20 #include "base/memory/ptr_util.h" |
| 21 #include "base/metrics/field_trial.h" | 21 #include "base/metrics/field_trial.h" |
| 22 #include "base/metrics/histogram.h" | 22 #include "base/metrics/histogram.h" |
| 23 #include "base/metrics/user_metrics.h" | |
| 23 #include "base/pending_task.h" | 24 #include "base/pending_task.h" |
| 24 #include "base/power_monitor/power_monitor.h" | 25 #include "base/power_monitor/power_monitor.h" |
| 25 #include "base/power_monitor/power_monitor_device_source.h" | 26 #include "base/power_monitor/power_monitor_device_source.h" |
| 26 #include "base/process/process_metrics.h" | 27 #include "base/process/process_metrics.h" |
| 27 #include "base/profiler/scoped_profile.h" | 28 #include "base/profiler/scoped_profile.h" |
| 28 #include "base/run_loop.h" | 29 #include "base/run_loop.h" |
| 29 #include "base/single_thread_task_runner.h" | 30 #include "base/single_thread_task_runner.h" |
| 30 #include "base/strings/string_number_conversions.h" | 31 #include "base/strings/string_number_conversions.h" |
| 31 #include "base/strings/string_split.h" | 32 #include "base/strings/string_split.h" |
| 32 #include "base/system_monitor/system_monitor.h" | 33 #include "base/system_monitor/system_monitor.h" |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 583 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:OnlineStateObserver"); | 584 TRACE_EVENT0("startup", "BrowserMainLoop::Subsystem:OnlineStateObserver"); |
| 584 online_state_observer_.reset(new BrowserOnlineStateObserver); | 585 online_state_observer_.reset(new BrowserOnlineStateObserver); |
| 585 } | 586 } |
| 586 | 587 |
| 587 { | 588 { |
| 588 system_stats_monitor_.reset( | 589 system_stats_monitor_.reset( |
| 589 new base::trace_event::TraceEventSystemStatsMonitor( | 590 new base::trace_event::TraceEventSystemStatsMonitor( |
| 590 base::ThreadTaskRunnerHandle::Get())); | 591 base::ThreadTaskRunnerHandle::Get())); |
| 591 } | 592 } |
| 592 | 593 |
| 594 { | |
|
Alexei Svitkine (slow)
2016/04/22 14:30:13
Nit: why the {}'s?
| |
| 595 base::SetRecordActionTaskRunner( | |
| 596 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI)); | |
| 597 } | |
| 598 | |
| 593 #if defined(OS_WIN) | 599 #if defined(OS_WIN) |
| 594 if (base::win::GetVersion() >= base::win::VERSION_WIN8) | 600 if (base::win::GetVersion() >= base::win::VERSION_WIN8) |
| 595 screen_orientation_delegate_.reset(new ScreenOrientationDelegateWin()); | 601 screen_orientation_delegate_.reset(new ScreenOrientationDelegateWin()); |
| 596 #endif | 602 #endif |
| 597 | 603 |
| 598 // TODO(boliu): kSingleProcess check is a temporary workaround for | 604 // TODO(boliu): kSingleProcess check is a temporary workaround for |
| 599 // in-process Android WebView. crbug.com/503724 tracks proper fix. | 605 // in-process Android WebView. crbug.com/503724 tracks proper fix. |
| 600 if (!parsed_command_line_.HasSwitch(switches::kSingleProcess)) { | 606 if (!parsed_command_line_.HasSwitch(switches::kSingleProcess)) { |
| 601 base::DiscardableMemoryAllocator::SetInstance( | 607 base::DiscardableMemoryAllocator::SetInstance( |
| 602 HostDiscardableSharedMemoryManager::current()); | 608 HostDiscardableSharedMemoryManager::current()); |
| (...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1491 audio_task_runner = audio_thread_->task_runner(); | 1497 audio_task_runner = audio_thread_->task_runner(); |
| 1492 worker_task_runner = audio_thread_->task_runner(); | 1498 worker_task_runner = audio_thread_->task_runner(); |
| 1493 monitor_task_runner = io_thread_->task_runner(); | 1499 monitor_task_runner = io_thread_->task_runner(); |
| 1494 #endif // defined(OS_MACOSX) | 1500 #endif // defined(OS_MACOSX) |
| 1495 audio_manager_ = media::AudioManager::Create( | 1501 audio_manager_ = media::AudioManager::Create( |
| 1496 std::move(audio_task_runner), std::move(worker_task_runner), | 1502 std::move(audio_task_runner), std::move(worker_task_runner), |
| 1497 std::move(monitor_task_runner), MediaInternals::GetInstance()); | 1503 std::move(monitor_task_runner), MediaInternals::GetInstance()); |
| 1498 } | 1504 } |
| 1499 | 1505 |
| 1500 } // namespace content | 1506 } // namespace content |
| OLD | NEW |