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

Unified Diff: net/disk_cache/stress_cache.cc

Issue 21236: Revert cl 9528 to fix mac test_shell_tests (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/disk_cache/mem_entry_impl.cc ('k') | net/http/http_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/stress_cache.cc
===================================================================
--- net/disk_cache/stress_cache.cc (revision 9528)
+++ net/disk_cache/stress_cache.cc (working copy)
@@ -23,7 +23,6 @@
#include "base/process_util.h"
#include "base/string_util.h"
#include "base/thread.h"
-#include "net/base/io_buffer.h"
#include "net/disk_cache/disk_cache.h"
#include "net/disk_cache/disk_cache_test_util.h"
@@ -97,9 +96,9 @@
keys[i] = GenerateKey(true);
}
- const int kSize = 4000;
- scoped_refptr<net::IOBuffer> buffer = new net::IOBuffer(kSize);
- memset(buffer->data(), 'k', kSize);
+ const int kDataLen = 4000;
+ char data[kDataLen];
+ memset(data, 'k', kDataLen);
for (int i = 0;; i++) {
int slot = rand() % kNumEntries;
@@ -111,8 +110,9 @@
if (!cache->OpenEntry(keys[key], &entries[slot]))
CHECK(cache->CreateEntry(keys[key], &entries[slot]));
- base::snprintf(buffer->data(), kSize, "%d %d", iteration, i);
- CHECK(kSize == entries[slot]->WriteData(0, 0, buffer, kSize, NULL, false));
+ base::snprintf(data, kDataLen, "%d %d", iteration, i);
+ CHECK(kDataLen == entries[slot]->WriteData(0, 0, data, kDataLen, NULL,
+ false));
if (rand() % 100 > 80) {
key = rand() % kNumKeys;
@@ -188,7 +188,7 @@
// Some time for the memory manager to flush stuff.
PlatformThread::Sleep(3000);
- MessageLoop message_loop(MessageLoop::TYPE_IO);
+ MessageLoop message_loop;
char* end;
long int iteration = strtol(argv[1], &end, 0);
« no previous file with comments | « net/disk_cache/mem_entry_impl.cc ('k') | net/http/http_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698