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

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

Issue 9597005: Revert 124890 - Convert uses of int ms to TimeDelta in chrome/browser and net. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 | « net/curvecp/client_packetizer.cc ('k') | no next file » | 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 // 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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 base::KillProcessById(base::GetCurrentProcId(), kExpectedCrash, false); 201 base::KillProcessById(base::GetCurrentProcId(), kExpectedCrash, false);
202 #elif defined(OS_POSIX) 202 #elif defined(OS_POSIX)
203 // On POSIX, _exit() will terminate the process with minimal cleanup, 203 // On POSIX, _exit() will terminate the process with minimal cleanup,
204 // and it is cleaner than killing. 204 // and it is cleaner than killing.
205 _exit(kExpectedCrash); 205 _exit(kExpectedCrash);
206 #endif 206 #endif
207 } 207 }
208 } 208 }
209 209
210 void RunSoon(MessageLoop* target_loop) { 210 void RunSoon(MessageLoop* target_loop) {
211 const base::TimeDelta kTaskDelay = base::TimeDelta::FromSeconds(10); 211 const int kTaskDelay = 10000; // 10 seconds
212 target_loop->PostDelayedTask( 212 target_loop->PostDelayedTask(
213 FROM_HERE, base::Bind(&CrashCallback), kTaskDelay); 213 FROM_HERE, base::Bind(&CrashCallback), kTaskDelay);
214 } 214 }
215 215
216 // We leak everything here :) 216 // We leak everything here :)
217 bool StartCrashThread() { 217 bool StartCrashThread() {
218 base::Thread* thread = new base::Thread("party_crasher"); 218 base::Thread* thread = new base::Thread("party_crasher");
219 if (!thread->Start()) 219 if (!thread->Start())
220 return false; 220 return false;
221 221
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 long int iteration = strtol(argv[1], &end, 0); 278 long int iteration = strtol(argv[1], &end, 0);
279 279
280 if (!StartCrashThread()) { 280 if (!StartCrashThread()) {
281 printf("failed to start thread\n"); 281 printf("failed to start thread\n");
282 return kError; 282 return kError;
283 } 283 }
284 284
285 StressTheCache(iteration); 285 StressTheCache(iteration);
286 return 0; 286 return 0;
287 } 287 }
OLDNEW
« no previous file with comments | « net/curvecp/client_packetizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698