diff options
author | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-16 19:06:00 +0000 |
---|---|---|
committer | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-16 19:06:00 +0000 |
commit | 49bd49a6438dccf100904804f1675d13e31a8d97 (patch) | |
tree | 344516fae9c906dfec14a1e8423ef5403b768772 /webkit/tools/test_shell/test_shell_main.cc | |
parent | ffc2aaabcd4e174bb4ba2b7007c7833e5db193bd (diff) | |
download | chromium_src-49bd49a6438dccf100904804f1675d13e31a8d97.zip chromium_src-49bd49a6438dccf100904804f1675d13e31a8d97.tar.gz chromium_src-49bd49a6438dccf100904804f1675d13e31a8d97.tar.bz2 |
Make test_shell stats table names unique.
On Linux, our shared memory name can conflict across users. For now, just try to make the name unique. Eventually we should work towards improving our stats table implementation.
Review URL: http://codereview.chromium.org/10961
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5547 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/test_shell_main.cc')
-rw-r--r-- | webkit/tools/test_shell/test_shell_main.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/webkit/tools/test_shell/test_shell_main.cc b/webkit/tools/test_shell/test_shell_main.cc index f975ce3..979f520 100644 --- a/webkit/tools/test_shell/test_shell_main.cc +++ b/webkit/tools/test_shell/test_shell_main.cc @@ -30,6 +30,7 @@ #include "base/message_loop.h" #include "base/path_service.h" #include "base/process_util.h" +#include "base/rand_util.h" #include "base/stack_container.h" #include "base/stats_table.h" #include "base/string_util.h" @@ -57,7 +58,7 @@ static wchar_t g_currentTestName[MAX_PATH]; namespace { // StatsTable initialization parameters. -static const wchar_t* kStatsFile = L"testshell"; +static const wchar_t* kStatsFilePrefix = L"testshell_"; static int kStatsFileThreads = 20; static int kStatsFileCounters = 200; @@ -296,8 +297,12 @@ int main(int argc, char* argv[]) { // Also expose GCController to JavaScript. webkit_glue::SetShouldExposeGCController(true); - // load and initialize the stats table. - StatsTable *table = new StatsTable(kStatsFile, kStatsFileThreads, kStatsFileCounters); + // Load and initialize the stats table. Attempt to construct a somewhat + // unique name to isolate separate instances from each other. + StatsTable *table = new StatsTable( + kStatsFilePrefix + Uint64ToWString(base::RandUint64()), + kStatsFileThreads, + kStatsFileCounters); StatsTable::set_current(table); TestShell* shell; |