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

Side by Side Diff: net/disk_cache/disk_cache_test_util.h

Issue 2891022: Disk cache: Read the index and data_0 files in a single... (Closed) Base URL: svn://chrome-svn/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
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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 #ifndef NET_DISK_CACHE_DISK_CACHE_TEST_UTIL_H_ 5 #ifndef NET_DISK_CACHE_DISK_CACHE_TEST_UTIL_H_
6 #define NET_DISK_CACHE_DISK_CACHE_TEST_UTIL_H_ 6 #define NET_DISK_CACHE_DISK_CACHE_TEST_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/file_path.h" 11 #include "base/file_path.h"
12 #include "base/message_loop.h" 12 #include "base/message_loop.h"
13 #include "base/timer.h" 13 #include "base/timer.h"
14 #include "build/build_config.h" 14 #include "build/build_config.h"
15 15
16 class FilePath; 16 class FilePath;
17 17
18 // Re-creates a given test file inside the cache test folder. 18 // Re-creates a given test file inside the cache test folder.
19 bool CreateCacheTestFile(const FilePath& name); 19 bool CreateCacheTestFile(const FilePath& name);
20 20
21 // Deletes all file son the cache. 21 // Deletes all file son the cache.
22 bool DeleteCache(const FilePath& path); 22 bool DeleteCache(const FilePath& path);
23 23
24 // Copies a set of cache files from the data folder to the test folder.
25 bool CopyTestCache(const std::string& name);
gavinp 2010/07/15 15:03:48 Just a question: why are the const char*/std::stri
rvargas (doing something else) 2010/07/15 18:31:50 They are basically the same (to me)... I just did
26
24 // Gets the path to the cache test folder. 27 // Gets the path to the cache test folder.
25 FilePath GetCacheFilePath(); 28 FilePath GetCacheFilePath();
26 29
27 // Fills buffer with random values (may contain nulls unless no_nulls is true). 30 // Fills buffer with random values (may contain nulls unless no_nulls is true).
28 void CacheTestFillBuffer(char* buffer, size_t len, bool no_nulls); 31 void CacheTestFillBuffer(char* buffer, size_t len, bool no_nulls);
29 32
30 // Generates a random key of up to 200 bytes. 33 // Generates a random key of up to 200 bytes.
31 std::string GenerateKey(bool same_length); 34 std::string GenerateKey(bool same_length);
32 35
33 // Returns true if the cache is not corrupt. 36 // Returns true if the cache is not corrupt.
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 base::RepeatingTimer<MessageLoopHelper> timer_; 95 base::RepeatingTimer<MessageLoopHelper> timer_;
93 int num_callbacks_; 96 int num_callbacks_;
94 int num_iterations_; 97 int num_iterations_;
95 int last_; 98 int last_;
96 bool completed_; 99 bool completed_;
97 100
98 DISALLOW_COPY_AND_ASSIGN(MessageLoopHelper); 101 DISALLOW_COPY_AND_ASSIGN(MessageLoopHelper);
99 }; 102 };
100 103
101 #endif // NET_DISK_CACHE_DISK_CACHE_TEST_UTIL_H_ 104 #endif // NET_DISK_CACHE_DISK_CACHE_TEST_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698