OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/app/content_main.h" | 5 #include "content/app/content_main.h" |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/debugger.h" | 9 #include "base/debug/debugger.h" |
10 #include "base/i18n/icu_util.h" | 10 #include "base/i18n/icu_util.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 #endif | 150 #endif |
151 } | 151 } |
152 | 152 |
153 void InitializeStatsTable(base::ProcessId browser_pid, | 153 void InitializeStatsTable(base::ProcessId browser_pid, |
154 const CommandLine& command_line) { | 154 const CommandLine& command_line) { |
155 // Initialize the Stats Counters table. With this initialized, | 155 // Initialize the Stats Counters table. With this initialized, |
156 // the StatsViewer can be utilized to read counters outside of | 156 // the StatsViewer can be utilized to read counters outside of |
157 // Chrome. These lines can be commented out to effectively turn | 157 // Chrome. These lines can be commented out to effectively turn |
158 // counters 'off'. The table is created and exists for the life | 158 // counters 'off'. The table is created and exists for the life |
159 // of the process. It is not cleaned up. | 159 // of the process. It is not cleaned up. |
160 if (command_line.HasSwitch(switches::kEnableStatsTable) || | 160 if (command_line.HasSwitch(switches::kEnableStatsTable)) { |
161 command_line.HasSwitch(switches::kEnableBenchmarking)) { | |
162 // NOTIMPLEMENTED: we probably need to shut this down correctly to avoid | 161 // NOTIMPLEMENTED: we probably need to shut this down correctly to avoid |
163 // leaking shared memory regions on posix platforms. | 162 // leaking shared memory regions on posix platforms. |
164 std::string statsfile = | 163 std::string statsfile = |
165 base::StringPrintf("%s-%u", | 164 base::StringPrintf("%s-%u", |
166 content::kStatsFilename, | 165 content::kStatsFilename, |
167 static_cast<unsigned int>(browser_pid)); | 166 static_cast<unsigned int>(browser_pid)); |
168 base::StatsTable* stats_table = new base::StatsTable(statsfile, | 167 base::StatsTable* stats_table = new base::StatsTable(statsfile, |
169 content::kStatsMaxThreads, content::kStatsMaxCounters); | 168 content::kStatsMaxThreads, content::kStatsMaxCounters); |
170 base::StatsTable::set_current(stats_table); | 169 base::StatsTable::set_current(stats_table); |
171 } | 170 } |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 _CrtDumpMemoryLeaks(); | 448 _CrtDumpMemoryLeaks(); |
450 #endif // _CRTDBG_MAP_ALLOC | 449 #endif // _CRTDBG_MAP_ALLOC |
451 | 450 |
452 _Module.Term(); | 451 _Module.Term(); |
453 #endif // OS_WIN | 452 #endif // OS_WIN |
454 | 453 |
455 return exit_code; | 454 return exit_code; |
456 } | 455 } |
457 | 456 |
458 } // namespace content | 457 } // namespace content |
OLD | NEW |