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/thread_restrictions.h" | 35 #include "base/threading/thread_restrictions.h" |
35 #include "base/threading/thread_task_runner_handle.h" | 36 #include "base/threading/thread_task_runner_handle.h" |
36 #include "base/timer/hi_res_timer_manager.h" | 37 #include "base/timer/hi_res_timer_manager.h" |
37 #include "base/trace_event/memory_dump_manager.h" | 38 #include "base/trace_event/memory_dump_manager.h" |
38 #include "base/trace_event/trace_event.h" | 39 #include "base/trace_event/trace_event.h" |
39 #include "build/build_config.h" | 40 #include "build/build_config.h" |
40 #include "components/tracing/browser/trace_config_file.h" | 41 #include "components/tracing/browser/trace_config_file.h" |
41 #include "components/tracing/common/process_metrics_memory_dump_provider.h" | 42 #include "components/tracing/common/process_metrics_memory_dump_provider.h" |
42 #include "components/tracing/common/trace_to_console.h" | 43 #include "components/tracing/common/trace_to_console.h" |
43 #include "components/tracing/common/tracing_switches.h" | 44 #include "components/tracing/common/tracing_switches.h" |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 } | 735 } |
735 | 736 |
736 int BrowserMainLoop::PreCreateThreads() { | 737 int BrowserMainLoop::PreCreateThreads() { |
737 if (parts_) { | 738 if (parts_) { |
738 TRACE_EVENT0("startup", | 739 TRACE_EVENT0("startup", |
739 "BrowserMainLoop::CreateThreads:PreCreateThreads"); | 740 "BrowserMainLoop::CreateThreads:PreCreateThreads"); |
740 | 741 |
741 result_code_ = parts_->PreCreateThreads(); | 742 result_code_ = parts_->PreCreateThreads(); |
742 } | 743 } |
743 | 744 |
| 745 // Enable SequencedWorkerPool for this process. If the |
| 746 // BrowserMainParts::PreCreateThreads() call above has already enabled |
| 747 // SequencedWorkerPool (with or without redirection to TaskScheduler), this |
| 748 // has no effect. |
| 749 // TODO(fdoray): Remove this once the SequencedWorkerPool to TaskScheduler |
| 750 // redirection experiment concludes https://crbug.com/622400. |
| 751 base::SequencedWorkerPool::EnableForProcess(); |
| 752 |
744 const base::CommandLine* command_line = | 753 const base::CommandLine* command_line = |
745 base::CommandLine::ForCurrentProcess(); | 754 base::CommandLine::ForCurrentProcess(); |
746 // Note that we do not initialize a new FeatureList when calling this for | 755 // Note that we do not initialize a new FeatureList when calling this for |
747 // the second time. | 756 // the second time. |
748 base::FeatureList::InitializeInstance( | 757 base::FeatureList::InitializeInstance( |
749 command_line->GetSwitchValueASCII(switches::kEnableFeatures), | 758 command_line->GetSwitchValueASCII(switches::kEnableFeatures), |
750 command_line->GetSwitchValueASCII(switches::kDisableFeatures)); | 759 command_line->GetSwitchValueASCII(switches::kDisableFeatures)); |
751 | 760 |
752 InitializeMemoryManagementComponent(); | 761 InitializeMemoryManagementComponent(); |
753 | 762 |
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1592 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = | 1601 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = |
1593 audio_thread_->task_runner(); | 1602 audio_thread_->task_runner(); |
1594 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), | 1603 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), |
1595 std::move(worker_task_runner), | 1604 std::move(worker_task_runner), |
1596 MediaInternals::GetInstance()); | 1605 MediaInternals::GetInstance()); |
1597 } | 1606 } |
1598 CHECK(audio_manager_); | 1607 CHECK(audio_manager_); |
1599 } | 1608 } |
1600 | 1609 |
1601 } // namespace content | 1610 } // namespace content |
OLD | NEW |