| 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 "chrome/browser/chrome_browser_main.h" | 5 #include "chrome/browser/chrome_browser_main.h" |
| 6 | 6 |
| 7 #if defined(TOOLKIT_GTK) | 7 #if defined(TOOLKIT_GTK) |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 #endif | 786 #endif |
| 787 | 787 |
| 788 scoped_refptr<base::SequencedTaskRunner> local_state_task_runner = | 788 scoped_refptr<base::SequencedTaskRunner> local_state_task_runner = |
| 789 JsonPrefStore::GetTaskRunnerForFile( | 789 JsonPrefStore::GetTaskRunnerForFile( |
| 790 base::FilePath(chrome::kLocalStorePoolName), | 790 base::FilePath(chrome::kLocalStorePoolName), |
| 791 BrowserThread::GetBlockingPool()); | 791 BrowserThread::GetBlockingPool()); |
| 792 | 792 |
| 793 { | 793 { |
| 794 TRACE_EVENT0("startup", | 794 TRACE_EVENT0("startup", |
| 795 "ChromeBrowserMainParts::PreCreateThreadsImpl:InitBrowswerProcessImpl"); | 795 "ChromeBrowserMainParts::PreCreateThreadsImpl:InitBrowswerProcessImpl"); |
| 796 browser_process_.reset(new BrowserProcessImpl(local_state_task_runner, | 796 browser_process_.reset(new BrowserProcessImpl(local_state_task_runner.get(), |
| 797 parsed_command_line())); | 797 parsed_command_line())); |
| 798 } | 798 } |
| 799 | 799 |
| 800 if (parsed_command_line().HasSwitch(switches::kEnableProfiling)) { | 800 if (parsed_command_line().HasSwitch(switches::kEnableProfiling)) { |
| 801 TRACE_EVENT0("startup", | 801 TRACE_EVENT0("startup", |
| 802 "ChromeBrowserMainParts::PreCreateThreadsImpl:InitProfiling"); | 802 "ChromeBrowserMainParts::PreCreateThreadsImpl:InitProfiling"); |
| 803 // User wants to override default tracking status. | 803 // User wants to override default tracking status. |
| 804 std::string flag = | 804 std::string flag = |
| 805 parsed_command_line().GetSwitchValueASCII(switches::kEnableProfiling); | 805 parsed_command_line().GetSwitchValueASCII(switches::kEnableProfiling); |
| 806 // Default to basic profiling (no parent child support). | 806 // Default to basic profiling (no parent child support). |
| 807 tracked_objects::ThreadData::Status status = | 807 tracked_objects::ThreadData::Status status = |
| 808 tracked_objects::ThreadData::PROFILING_ACTIVE; | 808 tracked_objects::ThreadData::PROFILING_ACTIVE; |
| 809 if (flag.compare("0") != 0) | 809 if (flag.compare("0") != 0) |
| 810 status = tracked_objects::ThreadData::DEACTIVATED; | 810 status = tracked_objects::ThreadData::DEACTIVATED; |
| 811 else if (flag.compare("child") != 0) | 811 else if (flag.compare("child") != 0) |
| 812 status = tracked_objects::ThreadData::PROFILING_CHILDREN_ACTIVE; | 812 status = tracked_objects::ThreadData::PROFILING_CHILDREN_ACTIVE; |
| 813 tracked_objects::ThreadData::InitializeAndSetTrackingStatus(status); | 813 tracked_objects::ThreadData::InitializeAndSetTrackingStatus(status); |
| 814 } | 814 } |
| 815 | 815 |
| 816 if (parsed_command_line().HasSwitch(switches::kProfilingOutputFile)) { | 816 if (parsed_command_line().HasSwitch(switches::kProfilingOutputFile)) { |
| 817 tracking_objects_.set_output_file_path( | 817 tracking_objects_.set_output_file_path( |
| 818 parsed_command_line().GetSwitchValuePath( | 818 parsed_command_line().GetSwitchValuePath( |
| 819 switches::kProfilingOutputFile)); | 819 switches::kProfilingOutputFile)); |
| 820 } | 820 } |
| 821 | 821 |
| 822 local_state_ = InitializeLocalState(local_state_task_runner, | 822 local_state_ = InitializeLocalState( |
| 823 parsed_command_line(), | 823 local_state_task_runner.get(), parsed_command_line(), is_first_run); |
| 824 is_first_run); | |
| 825 | 824 |
| 826 // These members must be initialized before returning from this function. | 825 // These members must be initialized before returning from this function. |
| 827 master_prefs_.reset(new first_run::MasterPrefs); | 826 master_prefs_.reset(new first_run::MasterPrefs); |
| 828 | 827 |
| 829 #if !defined(OS_ANDROID) | 828 #if !defined(OS_ANDROID) |
| 830 // Android doesn't use StartupBrowserCreator. | 829 // Android doesn't use StartupBrowserCreator. |
| 831 browser_creator_.reset(new StartupBrowserCreator); | 830 browser_creator_.reset(new StartupBrowserCreator); |
| 832 // TODO(yfriedman): Refactor Android to re-use UMABrowsingActivityObserver | 831 // TODO(yfriedman): Refactor Android to re-use UMABrowsingActivityObserver |
| 833 chrome::UMABrowsingActivityObserver::Init(); | 832 chrome::UMABrowsingActivityObserver::Init(); |
| 834 #endif | 833 #endif |
| (...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1774 if (base::win::GetVersion() <= base::win::VERSION_XP) | 1773 if (base::win::GetVersion() <= base::win::VERSION_XP) |
| 1775 uma_name += "_XP"; | 1774 uma_name += "_XP"; |
| 1776 | 1775 |
| 1777 uma_name += "_PreRead_"; | 1776 uma_name += "_PreRead_"; |
| 1778 uma_name += pre_read_percentage; | 1777 uma_name += pre_read_percentage; |
| 1779 AddPreReadHistogramTime(uma_name.c_str(), time); | 1778 AddPreReadHistogramTime(uma_name.c_str(), time); |
| 1780 } | 1779 } |
| 1781 #endif | 1780 #endif |
| 1782 #endif | 1781 #endif |
| 1783 } | 1782 } |
| OLD | NEW |