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

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

Issue 6005015: Revert 70618 - First pass at adding http/backend cache events to the NetLog. ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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/http/http_cache.h » ('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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 base::Thread cache_thread("CacheThread"); 97 base::Thread cache_thread("CacheThread");
98 if (!cache_thread.StartWithOptions( 98 if (!cache_thread.StartWithOptions(
99 base::Thread::Options(MessageLoop::TYPE_IO, 0))) 99 base::Thread::Options(MessageLoop::TYPE_IO, 0)))
100 return; 100 return;
101 101
102 TestCompletionCallback cb; 102 TestCompletionCallback cb;
103 disk_cache::Backend* cache; 103 disk_cache::Backend* cache;
104 int rv = disk_cache::BackendImpl::CreateBackend( 104 int rv = disk_cache::BackendImpl::CreateBackend(
105 path, false, cache_size, net::DISK_CACHE, 105 path, false, cache_size, net::DISK_CACHE,
106 disk_cache::kNoLoadProtection | disk_cache::kNoRandom, 106 disk_cache::kNoLoadProtection | disk_cache::kNoRandom,
107 cache_thread.message_loop_proxy(), NULL, &cache, &cb); 107 cache_thread.message_loop_proxy(), &cache, &cb);
108 108
109 if (cb.GetResult(rv) != net::OK) { 109 if (cb.GetResult(rv) != net::OK) {
110 printf("Unable to initialize cache.\n"); 110 printf("Unable to initialize cache.\n");
111 return; 111 return;
112 } 112 }
113 printf("Iteration %d, initial entries: %d\n", iteration, 113 printf("Iteration %d, initial entries: %d\n", iteration,
114 cache->GetEntryCount()); 114 cache->GetEntryCount());
115 115
116 int seed = static_cast<int>(Time::Now().ToInternalValue()); 116 int seed = static_cast<int>(Time::Now().ToInternalValue());
117 srand(seed); 117 srand(seed);
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 long int iteration = strtol(argv[1], &end, 0); 235 long int iteration = strtol(argv[1], &end, 0);
236 236
237 if (!StartCrashThread()) { 237 if (!StartCrashThread()) {
238 printf("failed to start thread\n"); 238 printf("failed to start thread\n");
239 return kError; 239 return kError;
240 } 240 }
241 241
242 StressTheCache(iteration); 242 StressTheCache(iteration);
243 return 0; 243 return 0;
244 } 244 }
OLDNEW
« no previous file with comments | « net/disk_cache/sparse_control.cc ('k') | net/http/http_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698