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

Side by Side Diff: net/disk_cache/stress_cache.cc

Issue 7351003: Clean up users of a deprecated base::LaunchApp API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win-only Created 9 years, 5 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 | « media/audio/win/audio_manager_win.cc ('k') | net/tools/crash_cache/crash_cache.cc » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // This is a simple application that stress-tests the crash recovery of the disk 5 // This is a simple application that stress-tests the crash recovery of the disk
6 // cache. The main application starts a copy of itself on a loop, checking the 6 // cache. The main application starts a copy of itself on a loop, checking the
7 // exit code of the child process. When the child dies in an unexpected way, 7 // exit code of the child process. When the child dies in an unexpected way,
8 // the main application quits. 8 // the main application quits.
9 9
10 // The child application has two threads: one to exercise the cache in an 10 // The child application has two threads: one to exercise the cache in an
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 // Starts a new process. 53 // Starts a new process.
54 int RunSlave(int iteration) { 54 int RunSlave(int iteration) {
55 FilePath exe; 55 FilePath exe;
56 PathService::Get(base::FILE_EXE, &exe); 56 PathService::Get(base::FILE_EXE, &exe);
57 57
58 CommandLine cmdline(exe); 58 CommandLine cmdline(exe);
59 cmdline.AppendArg(base::IntToString(iteration)); 59 cmdline.AppendArg(base::IntToString(iteration));
60 60
61 base::ProcessHandle handle; 61 base::ProcessHandle handle;
62 if (!base::LaunchApp(cmdline, false, false, &handle)) { 62 base::LaunchOptions options;
63 options.process_handle = &handle;
64 if (!base::LaunchProcess(cmdline, options)) {
63 printf("Unable to run test\n"); 65 printf("Unable to run test\n");
64 return kError; 66 return kError;
65 } 67 }
66 68
67 int exit_code; 69 int exit_code;
68 if (!base::WaitForExitCode(handle, &exit_code)) { 70 if (!base::WaitForExitCode(handle, &exit_code)) {
69 printf("Unable to get return code\n"); 71 printf("Unable to get return code\n");
70 return kError; 72 return kError;
71 } 73 }
72 return exit_code; 74 return exit_code;
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 long int iteration = strtol(argv[1], &end, 0); 237 long int iteration = strtol(argv[1], &end, 0);
236 238
237 if (!StartCrashThread()) { 239 if (!StartCrashThread()) {
238 printf("failed to start thread\n"); 240 printf("failed to start thread\n");
239 return kError; 241 return kError;
240 } 242 }
241 243
242 StressTheCache(iteration); 244 StressTheCache(iteration);
243 return 0; 245 return 0;
244 } 246 }
OLDNEW
« no previous file with comments | « media/audio/win/audio_manager_win.cc ('k') | net/tools/crash_cache/crash_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698