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 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1140 parsed_command_line().HasSwitch(switches::kImportFromFile)) { | 1140 parsed_command_line().HasSwitch(switches::kImportFromFile)) { |
1141 // We use different BrowserProcess when importing so no GoogleURLTracker is | 1141 // We use different BrowserProcess when importing so no GoogleURLTracker is |
1142 // instantiated (as it makes a net::URLRequest and we don't have an IO | 1142 // instantiated (as it makes a net::URLRequest and we don't have an IO |
1143 // thread, see bug #1292702). | 1143 // thread, see bug #1292702). |
1144 browser_process_.reset(new FirstRunBrowserProcess(parsed_command_line())); | 1144 browser_process_.reset(new FirstRunBrowserProcess(parsed_command_line())); |
1145 is_first_run_ = false; | 1145 is_first_run_ = false; |
1146 } else { | 1146 } else { |
1147 browser_process_.reset(new BrowserProcessImpl(parsed_command_line())); | 1147 browser_process_.reset(new BrowserProcessImpl(parsed_command_line())); |
1148 } | 1148 } |
1149 | 1149 |
1150 // Default to basic profiling (no parent child support). | |
1151 tracked_objects::ThreadData::Status status = | |
1152 tracked_objects::ThreadData::PROFILING_ACTIVE; | |
1153 if (parsed_command_line().HasSwitch(switches::kEnableProfiling)) { | 1150 if (parsed_command_line().HasSwitch(switches::kEnableProfiling)) { |
1154 // User wants to override default tracking status. | 1151 // User wants to override default tracking status. |
1155 std::string flag = | 1152 std::string flag = |
1156 parsed_command_line().GetSwitchValueASCII(switches::kEnableProfiling); | 1153 parsed_command_line().GetSwitchValueASCII(switches::kEnableProfiling); |
1157 if (flag.compare("0") != 0) | 1154 bool enabled = flag.compare("0") != 0; |
1158 status = tracked_objects::ThreadData::DEACTIVATED; | 1155 tracked_objects::ThreadData::InitializeAndSetTrackingStatus(enabled); |
1159 else if (flag.compare("child") != 0) | |
1160 status = tracked_objects::ThreadData::PROFILING_CHILDREN_ACTIVE; | |
1161 } | 1156 } |
1162 tracked_objects::ThreadData::InitializeAndSetTrackingStatus(status); | |
1163 | 1157 |
1164 // This forces the TabCloseableStateWatcher to be created and, on chromeos, | 1158 // This forces the TabCloseableStateWatcher to be created and, on chromeos, |
1165 // register for the notifications it needs to track the closeable state of | 1159 // register for the notifications it needs to track the closeable state of |
1166 // tabs. | 1160 // tabs. |
1167 browser_process_->tab_closeable_state_watcher(); | 1161 browser_process_->tab_closeable_state_watcher(); |
1168 | 1162 |
1169 local_state_ = InitializeLocalState(parsed_command_line(), | 1163 local_state_ = InitializeLocalState(parsed_command_line(), |
1170 is_first_run_); | 1164 is_first_run_); |
1171 | 1165 |
1172 // These members must be initialized before returning from this function. | 1166 // These members must be initialized before returning from this function. |
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1942 if (base::win::GetVersion() <= base::win::VERSION_XP) | 1936 if (base::win::GetVersion() <= base::win::VERSION_XP) |
1943 uma_name += "_XP"; | 1937 uma_name += "_XP"; |
1944 | 1938 |
1945 uma_name += "_PreRead"; | 1939 uma_name += "_PreRead"; |
1946 uma_name += pre_read == "1" ? "Enabled" : "Disabled"; | 1940 uma_name += pre_read == "1" ? "Enabled" : "Disabled"; |
1947 AddPreReadHistogramTime(uma_name.c_str(), time); | 1941 AddPreReadHistogramTime(uma_name.c_str(), time); |
1948 } | 1942 } |
1949 #endif | 1943 #endif |
1950 #endif | 1944 #endif |
1951 } | 1945 } |
OLD | NEW |