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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/feature_list.h" |
9 #include "base/location.h" | 10 #include "base/location.h" |
10 #include "base/logging.h" | 11 #include "base/logging.h" |
11 #include "base/memory/memory_pressure_monitor.h" | 12 #include "base/memory/memory_pressure_monitor.h" |
12 #include "base/metrics/field_trial.h" | 13 #include "base/metrics/field_trial.h" |
13 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
14 #include "base/pending_task.h" | 15 #include "base/pending_task.h" |
15 #include "base/power_monitor/power_monitor.h" | 16 #include "base/power_monitor/power_monitor.h" |
16 #include "base/power_monitor/power_monitor_device_source.h" | 17 #include "base/power_monitor/power_monitor_device_source.h" |
17 #include "base/process/process_metrics.h" | 18 #include "base/process/process_metrics.h" |
18 #include "base/profiler/scoped_profile.h" | 19 #include "base/profiler/scoped_profile.h" |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 | 684 |
684 int BrowserMainLoop::PreCreateThreads() { | 685 int BrowserMainLoop::PreCreateThreads() { |
685 if (parts_) { | 686 if (parts_) { |
686 TRACE_EVENT0("startup", | 687 TRACE_EVENT0("startup", |
687 "BrowserMainLoop::CreateThreads:PreCreateThreads"); | 688 "BrowserMainLoop::CreateThreads:PreCreateThreads"); |
688 TRACK_SCOPED_REGION("Startup", "BrowserMainLoop::PreCreateThreads"); | 689 TRACK_SCOPED_REGION("Startup", "BrowserMainLoop::PreCreateThreads"); |
689 | 690 |
690 result_code_ = parts_->PreCreateThreads(); | 691 result_code_ = parts_->PreCreateThreads(); |
691 } | 692 } |
692 | 693 |
| 694 // Initialize an instance of FeatureList. This will be a no-op if an instance |
| 695 // was already set up by the embedder. |
| 696 base::FeatureList::InitializeInstance(); |
| 697 |
693 // TODO(chrisha): Abstract away this construction mess to a helper function, | 698 // TODO(chrisha): Abstract away this construction mess to a helper function, |
694 // once MemoryPressureMonitor is made a concrete class. | 699 // once MemoryPressureMonitor is made a concrete class. |
695 #if defined(OS_CHROMEOS) | 700 #if defined(OS_CHROMEOS) |
696 if (chromeos::switches::MemoryPressureHandlingEnabled()) { | 701 if (chromeos::switches::MemoryPressureHandlingEnabled()) { |
697 memory_pressure_monitor_.reset(new base::chromeos::MemoryPressureMonitor( | 702 memory_pressure_monitor_.reset(new base::chromeos::MemoryPressureMonitor( |
698 chromeos::switches::GetMemoryPressureThresholds())); | 703 chromeos::switches::GetMemoryPressureThresholds())); |
699 } | 704 } |
700 #elif defined(OS_MACOSX) && !defined(OS_IOS) | 705 #elif defined(OS_MACOSX) && !defined(OS_IOS) |
701 memory_pressure_monitor_.reset(new base::mac::MemoryPressureMonitor()); | 706 memory_pressure_monitor_.reset(new base::mac::MemoryPressureMonitor()); |
702 #elif defined(OS_WIN) | 707 #elif defined(OS_WIN) |
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1422 DCHECK(is_tracing_startup_for_duration_); | 1427 DCHECK(is_tracing_startup_for_duration_); |
1423 | 1428 |
1424 is_tracing_startup_for_duration_ = false; | 1429 is_tracing_startup_for_duration_ = false; |
1425 TracingController::GetInstance()->DisableRecording( | 1430 TracingController::GetInstance()->DisableRecording( |
1426 TracingController::CreateFileSink( | 1431 TracingController::CreateFileSink( |
1427 startup_trace_file_, | 1432 startup_trace_file_, |
1428 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1433 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
1429 } | 1434 } |
1430 | 1435 |
1431 } // namespace content | 1436 } // namespace content |
OLD | NEW |