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

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, 11 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
« no previous file with comments | « base/tracked_objects_unittest.cc ('k') | content/browser/profiler_controller_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 parsed_command_line().HasSwitch(switches::kImportFromFile)) { 1145 parsed_command_line().HasSwitch(switches::kImportFromFile)) {
1146 // We use different BrowserProcess when importing so no GoogleURLTracker is 1146 // We use different BrowserProcess when importing so no GoogleURLTracker is
1147 // instantiated (as it makes a net::URLRequest and we don't have an IO 1147 // instantiated (as it makes a net::URLRequest and we don't have an IO
1148 // thread, see bug #1292702). 1148 // thread, see bug #1292702).
1149 browser_process_.reset(new FirstRunBrowserProcess(parsed_command_line())); 1149 browser_process_.reset(new FirstRunBrowserProcess(parsed_command_line()));
1150 is_first_run_ = false; 1150 is_first_run_ = false;
1151 } else { 1151 } else {
1152 browser_process_.reset(new BrowserProcessImpl(parsed_command_line())); 1152 browser_process_.reset(new BrowserProcessImpl(parsed_command_line()));
1153 } 1153 }
1154 1154
1155 // Default to basic profiling (no parent child support).
1156 tracked_objects::ThreadData::Status status =
1157 tracked_objects::ThreadData::PROFILING_ACTIVE;
1155 if (parsed_command_line().HasSwitch(switches::kEnableProfiling)) { 1158 if (parsed_command_line().HasSwitch(switches::kEnableProfiling)) {
1156 // User wants to override default tracking status. 1159 // User wants to override default tracking status.
1157 std::string flag = 1160 std::string flag =
1158 parsed_command_line().GetSwitchValueASCII(switches::kEnableProfiling); 1161 parsed_command_line().GetSwitchValueASCII(switches::kEnableProfiling);
1159 bool enabled = flag.compare("0") != 0; 1162 if (flag.compare("0") != 0)
1160 tracked_objects::ThreadData::InitializeAndSetTrackingStatus(enabled); 1163 status = tracked_objects::ThreadData::DEACTIVATED;
1164 else if (flag.compare("child") != 0)
1165 status = tracked_objects::ThreadData::PROFILING_CHILDREN_ACTIVE;
1161 } 1166 }
1167 tracked_objects::ThreadData::InitializeAndSetTrackingStatus(status);
ramant (doing other things) 2012/01/28 02:09:55 nit: It looks like this change calls InitializeAnd
jar (doing other things) 2012/01/30 20:41:56 Lazy initialization really gets tracked_objects go
1162 1168
1163 // This forces the TabCloseableStateWatcher to be created and, on chromeos, 1169 // This forces the TabCloseableStateWatcher to be created and, on chromeos,
1164 // register for the notifications it needs to track the closeable state of 1170 // register for the notifications it needs to track the closeable state of
1165 // tabs. 1171 // tabs.
1166 browser_process_->tab_closeable_state_watcher(); 1172 browser_process_->tab_closeable_state_watcher();
1167 1173
1168 local_state_ = InitializeLocalState(parsed_command_line(), 1174 local_state_ = InitializeLocalState(parsed_command_line(),
1169 is_first_run_); 1175 is_first_run_);
1170 1176
1171 // If we're running tests (ui_task is non-null), then the ResourceBundle 1177 // If we're running tests (ui_task is non-null), then the ResourceBundle
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
1927 if (base::win::GetVersion() <= base::win::VERSION_XP) 1933 if (base::win::GetVersion() <= base::win::VERSION_XP)
1928 uma_name += "_XP"; 1934 uma_name += "_XP";
1929 1935
1930 uma_name += "_PreRead"; 1936 uma_name += "_PreRead";
1931 uma_name += pre_read == "1" ? "Enabled" : "Disabled"; 1937 uma_name += pre_read == "1" ? "Enabled" : "Disabled";
1932 AddPreReadHistogramTime(uma_name.c_str(), time); 1938 AddPreReadHistogramTime(uma_name.c_str(), time);
1933 } 1939 }
1934 #endif 1940 #endif
1935 #endif 1941 #endif
1936 } 1942 }
OLDNEW
« no previous file with comments | « base/tracked_objects_unittest.cc ('k') | content/browser/profiler_controller_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698