| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 | 688 |
| 689 int BrowserMainLoop::PreCreateThreads() { | 689 int BrowserMainLoop::PreCreateThreads() { |
| 690 if (parts_) { | 690 if (parts_) { |
| 691 TRACE_EVENT0("startup", | 691 TRACE_EVENT0("startup", |
| 692 "BrowserMainLoop::CreateThreads:PreCreateThreads"); | 692 "BrowserMainLoop::CreateThreads:PreCreateThreads"); |
| 693 TRACK_SCOPED_REGION("Startup", "BrowserMainLoop::PreCreateThreads"); | 693 TRACK_SCOPED_REGION("Startup", "BrowserMainLoop::PreCreateThreads"); |
| 694 | 694 |
| 695 result_code_ = parts_->PreCreateThreads(); | 695 result_code_ = parts_->PreCreateThreads(); |
| 696 } | 696 } |
| 697 | 697 |
| 698 // Initialize an instance of FeatureList. This will be a no-op if an instance | 698 // Initialize from command line flags only if we haven't yet. |
| 699 // was already set up by the embedder. | 699 const base::CommandLine* command_line = |
| 700 base::FeatureList::InitializeInstance(); | 700 base::CommandLine::ForCurrentProcess(); |
| 701 base::FeatureList::InitializeInstance( |
| 702 command_line->GetSwitchValueASCII(switches::kEnableFeatures), |
| 703 command_line->GetSwitchValueASCII(switches::kDisableFeatures)); |
| 701 | 704 |
| 702 // TODO(chrisha): Abstract away this construction mess to a helper function, | 705 // TODO(chrisha): Abstract away this construction mess to a helper function, |
| 703 // once MemoryPressureMonitor is made a concrete class. | 706 // once MemoryPressureMonitor is made a concrete class. |
| 704 #if defined(OS_CHROMEOS) | 707 #if defined(OS_CHROMEOS) |
| 705 if (chromeos::switches::MemoryPressureHandlingEnabled()) { | 708 if (chromeos::switches::MemoryPressureHandlingEnabled()) { |
| 706 memory_pressure_monitor_.reset(new base::chromeos::MemoryPressureMonitor( | 709 memory_pressure_monitor_.reset(new base::chromeos::MemoryPressureMonitor( |
| 707 chromeos::switches::GetMemoryPressureThresholds())); | 710 chromeos::switches::GetMemoryPressureThresholds())); |
| 708 } | 711 } |
| 709 #elif defined(OS_MACOSX) | 712 #elif defined(OS_MACOSX) |
| 710 memory_pressure_monitor_.reset(new base::mac::MemoryPressureMonitor()); | 713 memory_pressure_monitor_.reset(new base::mac::MemoryPressureMonitor()); |
| (...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1443 DCHECK(is_tracing_startup_for_duration_); | 1446 DCHECK(is_tracing_startup_for_duration_); |
| 1444 | 1447 |
| 1445 is_tracing_startup_for_duration_ = false; | 1448 is_tracing_startup_for_duration_ = false; |
| 1446 TracingController::GetInstance()->StopTracing( | 1449 TracingController::GetInstance()->StopTracing( |
| 1447 TracingController::CreateFileSink( | 1450 TracingController::CreateFileSink( |
| 1448 startup_trace_file_, | 1451 startup_trace_file_, |
| 1449 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1452 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
| 1450 } | 1453 } |
| 1451 | 1454 |
| 1452 } // namespace content | 1455 } // namespace content |
| OLD | NEW |