Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Side by Side Diff: chrome/browser/chrome_browser_main.cc

Issue 9181002: Track parent-child relations during profiling (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after
1141 parsed_command_line().HasSwitch(switches::kImportFromFile)) { 1141 parsed_command_line().HasSwitch(switches::kImportFromFile)) {
1142 // We use different BrowserProcess when importing so no GoogleURLTracker is 1142 // We use different BrowserProcess when importing so no GoogleURLTracker is
1143 // instantiated (as it makes a net::URLRequest and we don't have an IO 1143 // instantiated (as it makes a net::URLRequest and we don't have an IO
1144 // thread, see bug #1292702). 1144 // thread, see bug #1292702).
1145 browser_process_.reset(new FirstRunBrowserProcess(parsed_command_line())); 1145 browser_process_.reset(new FirstRunBrowserProcess(parsed_command_line()));
1146 is_first_run_ = false; 1146 is_first_run_ = false;
1147 } else { 1147 } else {
1148 browser_process_.reset(new BrowserProcessImpl(parsed_command_line())); 1148 browser_process_.reset(new BrowserProcessImpl(parsed_command_line()));
1149 } 1149 }
1150 1150
1151 // Default to basic profiling (no parent child support).
1152 tracked_objects::ThreadData::Status status =
1153 tracked_objects::ThreadData::PROFILING_ACTIVE;
1151 if (parsed_command_line().HasSwitch(switches::kEnableProfiling)) { 1154 if (parsed_command_line().HasSwitch(switches::kEnableProfiling)) {
1152 // User wants to override default tracking status. 1155 // User wants to override default tracking status.
1153 std::string flag = 1156 std::string flag =
1154 parsed_command_line().GetSwitchValueASCII(switches::kEnableProfiling); 1157 parsed_command_line().GetSwitchValueASCII(switches::kEnableProfiling);
1155 bool enabled = flag.compare("0") != 0; 1158 if (flag.compare("0") != 0)
1156 tracked_objects::ThreadData::InitializeAndSetTrackingStatus(enabled); 1159 status = tracked_objects::ThreadData::DEACTIVATED;
1160 else if (flag.compare("child") != 0)
1161 status = tracked_objects::ThreadData::PROFILING_CHILDREN_ACTIVE;
1157 } 1162 }
1163 tracked_objects::ThreadData::InitializeAndSetTrackingStatus(status);
1158 1164
1159 // This forces the TabCloseableStateWatcher to be created and, on chromeos, 1165 // This forces the TabCloseableStateWatcher to be created and, on chromeos,
1160 // register for the notifications it needs to track the closeable state of 1166 // register for the notifications it needs to track the closeable state of
1161 // tabs. 1167 // tabs.
1162 browser_process_->tab_closeable_state_watcher(); 1168 browser_process_->tab_closeable_state_watcher();
1163 1169
1164 local_state_ = InitializeLocalState(parsed_command_line(), 1170 local_state_ = InitializeLocalState(parsed_command_line(),
1165 is_first_run_); 1171 is_first_run_);
1166 1172
1167 // If we're running tests (ui_task is non-null), then the ResourceBundle 1173 // If we're running tests (ui_task is non-null), then the ResourceBundle
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
1937 if (base::win::GetVersion() <= base::win::VERSION_XP) 1943 if (base::win::GetVersion() <= base::win::VERSION_XP)
1938 uma_name += "_XP"; 1944 uma_name += "_XP";
1939 1945
1940 uma_name += "_PreRead"; 1946 uma_name += "_PreRead";
1941 uma_name += pre_read == "1" ? "Enabled" : "Disabled"; 1947 uma_name += pre_read == "1" ? "Enabled" : "Disabled";
1942 AddPreReadHistogramTime(uma_name.c_str(), time); 1948 AddPreReadHistogramTime(uma_name.c_str(), time);
1943 } 1949 }
1944 #endif 1950 #endif
1945 #endif 1951 #endif
1946 } 1952 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698