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

Side by Side Diff: webkit/tools/test_shell/test_shell_main.cc

Issue 390015: linux: TCMalloc-based C++ heap profiler. (Closed)
Patch Set: Created 11 years, 1 month 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "base/at_exit.h" 5 #include "base/at_exit.h"
6 #include "base/basictypes.h" 6 #include "base/basictypes.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/event_recorder.h" 8 #include "base/event_recorder.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 11 matching lines...) Expand all
22 #include "net/base/net_module.h" 22 #include "net/base/net_module.h"
23 #include "net/base/net_util.h" 23 #include "net/base/net_util.h"
24 #include "net/http/http_cache.h" 24 #include "net/http/http_cache.h"
25 #include "net/socket/ssl_test_util.h" 25 #include "net/socket/ssl_test_util.h"
26 #include "net/url_request/url_request_context.h" 26 #include "net/url_request/url_request_context.h"
27 #include "webkit/api/public/WebKit.h" 27 #include "webkit/api/public/WebKit.h"
28 #include "webkit/api/public/WebScriptController.h" 28 #include "webkit/api/public/WebScriptController.h"
29 #include "webkit/glue/webkit_glue.h" 29 #include "webkit/glue/webkit_glue.h"
30 #include "webkit/glue/window_open_disposition.h" 30 #include "webkit/glue/window_open_disposition.h"
31 #include "webkit/extensions/v8/gc_extension.h" 31 #include "webkit/extensions/v8/gc_extension.h"
32 #include "webkit/extensions/v8/heap_profiler_extension.h"
32 #include "webkit/extensions/v8/playback_extension.h" 33 #include "webkit/extensions/v8/playback_extension.h"
33 #include "webkit/extensions/v8/profiler_extension.h" 34 #include "webkit/extensions/v8/profiler_extension.h"
34 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" 35 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h"
35 #include "webkit/tools/test_shell/test_shell.h" 36 #include "webkit/tools/test_shell/test_shell.h"
36 #include "webkit/tools/test_shell/test_shell_platform_delegate.h" 37 #include "webkit/tools/test_shell/test_shell_platform_delegate.h"
37 #include "webkit/tools/test_shell/test_shell_request_context.h" 38 #include "webkit/tools/test_shell/test_shell_request_context.h"
38 #include "webkit/tools/test_shell/test_shell_switches.h" 39 #include "webkit/tools/test_shell/test_shell_switches.h"
39 #include "webkit/tools/test_shell/test_shell_webkit_init.h" 40 #include "webkit/tools/test_shell/test_shell_webkit_init.h"
40 41
41 static const size_t kPathBufSize = 2048; 42 static const size_t kPathBufSize = 2048;
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 js_flags += L" --expose-gc"; 219 js_flags += L" --expose-gc";
219 webkit_glue::SetJavaScriptFlags(js_flags); 220 webkit_glue::SetJavaScriptFlags(js_flags);
220 // Expose GCController to JavaScript. 221 // Expose GCController to JavaScript.
221 WebScriptController::registerExtension(extensions_v8::GCExtension::Get()); 222 WebScriptController::registerExtension(extensions_v8::GCExtension::Get());
222 223
223 if (parsed_command_line.HasSwitch(test_shell::kProfiler)) { 224 if (parsed_command_line.HasSwitch(test_shell::kProfiler)) {
224 WebScriptController::registerExtension( 225 WebScriptController::registerExtension(
225 extensions_v8::ProfilerExtension::Get()); 226 extensions_v8::ProfilerExtension::Get());
226 } 227 }
227 228
229 if (parsed_command_line.HasSwitch(test_shell::kHeapProfiler)) {
230 WebScriptController::registerExtension(
231 extensions_v8::HeapProfilerExtension::Get());
232 }
233
228 // Load and initialize the stats table. Attempt to construct a somewhat 234 // Load and initialize the stats table. Attempt to construct a somewhat
229 // unique name to isolate separate instances from each other. 235 // unique name to isolate separate instances from each other.
230 StatsTable *table = new StatsTable( 236 StatsTable *table = new StatsTable(
231 // truncate the random # to 32 bits for the benefit of Mac OS X, to 237 // truncate the random # to 32 bits for the benefit of Mac OS X, to
232 // avoid tripping over its maximum shared memory segment name length 238 // avoid tripping over its maximum shared memory segment name length
233 kStatsFilePrefix + Uint64ToString(base::RandUint64() & 0xFFFFFFFFL), 239 kStatsFilePrefix + Uint64ToString(base::RandUint64() & 0xFFFFFFFFL),
234 kStatsFileThreads, 240 kStatsFileThreads,
235 kStatsFileCounters); 241 kStatsFileCounters);
236 StatsTable::set_current(table); 242 StatsTable::set_current(table);
237 243
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 366
361 TestShell::ShutdownTestShell(); 367 TestShell::ShutdownTestShell();
362 TestShell::CleanupLogging(); 368 TestShell::CleanupLogging();
363 369
364 // Tear down shared StatsTable; prevents unit_tests from leaking it. 370 // Tear down shared StatsTable; prevents unit_tests from leaking it.
365 StatsTable::set_current(NULL); 371 StatsTable::set_current(NULL);
366 delete table; 372 delete table;
367 373
368 return 0; 374 return 0;
369 } 375 }
OLDNEW
« no previous file with comments | « webkit/extensions/v8/heap_profiler_extension.cc ('k') | webkit/tools/test_shell/test_shell_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698