| 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 const base::CommandLine* command_line = |
| 699 // was already set up by the embedder. | 699 base::CommandLine::ForCurrentProcess(); |
| 700 base::FeatureList::InitializeInstance(); | 700 // Note that we do not initialize a new FeatureList when calling this for |
| 701 // the second time. |
| 702 base::FeatureList::InitializeInstance( |
| 703 command_line->GetSwitchValueASCII(switches::kEnableFeatures), |
| 704 command_line->GetSwitchValueASCII(switches::kDisableFeatures)); |
| 701 | 705 |
| 702 // TODO(chrisha): Abstract away this construction mess to a helper function, | 706 // TODO(chrisha): Abstract away this construction mess to a helper function, |
| 703 // once MemoryPressureMonitor is made a concrete class. | 707 // once MemoryPressureMonitor is made a concrete class. |
| 704 #if defined(OS_CHROMEOS) | 708 #if defined(OS_CHROMEOS) |
| 705 if (chromeos::switches::MemoryPressureHandlingEnabled()) { | 709 if (chromeos::switches::MemoryPressureHandlingEnabled()) { |
| 706 memory_pressure_monitor_.reset(new base::chromeos::MemoryPressureMonitor( | 710 memory_pressure_monitor_.reset(new base::chromeos::MemoryPressureMonitor( |
| 707 chromeos::switches::GetMemoryPressureThresholds())); | 711 chromeos::switches::GetMemoryPressureThresholds())); |
| 708 } | 712 } |
| 709 #elif defined(OS_MACOSX) | 713 #elif defined(OS_MACOSX) |
| 710 memory_pressure_monitor_.reset(new base::mac::MemoryPressureMonitor()); | 714 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_); | 1447 DCHECK(is_tracing_startup_for_duration_); |
| 1444 | 1448 |
| 1445 is_tracing_startup_for_duration_ = false; | 1449 is_tracing_startup_for_duration_ = false; |
| 1446 TracingController::GetInstance()->StopTracing( | 1450 TracingController::GetInstance()->StopTracing( |
| 1447 TracingController::CreateFileSink( | 1451 TracingController::CreateFileSink( |
| 1448 startup_trace_file_, | 1452 startup_trace_file_, |
| 1449 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); | 1453 base::Bind(OnStoppedStartupTracing, startup_trace_file_))); |
| 1450 } | 1454 } |
| 1451 | 1455 |
| 1452 } // namespace content | 1456 } // namespace content |
| OLD | NEW |