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

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

Issue 2881010: Revert 51456 - Disk cache: Switch the disk cache to use the cache_thread.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 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 | « net/disk_cache/sparse_control.cc ('k') | net/net.gyp » ('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) 2006-2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 CHECK_EQ(kSize, cb.GetResult(rv)); 133 CHECK_EQ(kSize, cb.GetResult(rv));
134 134
135 if (rand() % 100 > 80) { 135 if (rand() % 100 > 80) {
136 key = rand() % kNumKeys; 136 key = rand() % kNumKeys;
137 rv = cache->DoomEntry(keys[key], &cb); 137 rv = cache->DoomEntry(keys[key], &cb);
138 cb.GetResult(rv); 138 cb.GetResult(rv);
139 } 139 }
140 140
141 if (!(i % 100)) 141 if (!(i % 100))
142 printf("Entries: %d \r", i); 142 printf("Entries: %d \r", i);
143 MessageLoop::current()->RunAllPending();
143 } 144 }
144 } 145 }
145 146
146 // We want to prevent the timer thread from killing the process while we are 147 // We want to prevent the timer thread from killing the process while we are
147 // waiting for the debugger to attach. 148 // waiting for the debugger to attach.
148 bool g_crashing = false; 149 bool g_crashing = false;
149 150
150 class CrashTask : public Task { 151 class CrashTask : public Task {
151 public: 152 public:
152 CrashTask() {} 153 CrashTask() {}
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 long int iteration = strtol(argv[1], &end, 0); 214 long int iteration = strtol(argv[1], &end, 0);
214 215
215 if (!StartCrashThread()) { 216 if (!StartCrashThread()) {
216 printf("failed to start thread\n"); 217 printf("failed to start thread\n");
217 return kError; 218 return kError;
218 } 219 }
219 220
220 StressTheCache(iteration); 221 StressTheCache(iteration);
221 return 0; 222 return 0;
222 } 223 }
OLDNEW
« no previous file with comments | « net/disk_cache/sparse_control.cc ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698