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

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

Issue 1535363003: Switch to standard integer types in net/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: stddef Created 5 years 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
« no previous file with comments | « net/disk_cache/disk_cache_test_util.h ('k') | net/disk_cache/entry_unittest.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "net/disk_cache/disk_cache_test_util.h" 5 #include "net/disk_cache/disk_cache_test_util.h"
6 6
7 #include "base/files/file.h" 7 #include "base/files/file.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 file.SetLength(4 * 1024 * 1024); 52 file.SetLength(4 * 1024 * 1024);
53 return true; 53 return true;
54 } 54 }
55 55
56 bool DeleteCache(const base::FilePath& path) { 56 bool DeleteCache(const base::FilePath& path) {
57 disk_cache::DeleteCache(path, false); 57 disk_cache::DeleteCache(path, false);
58 return true; 58 return true;
59 } 59 }
60 60
61 bool CheckCacheIntegrity(const base::FilePath& path, bool new_eviction, 61 bool CheckCacheIntegrity(const base::FilePath& path,
62 uint32 mask) { 62 bool new_eviction,
63 uint32_t mask) {
63 scoped_ptr<disk_cache::BackendImpl> cache(new disk_cache::BackendImpl( 64 scoped_ptr<disk_cache::BackendImpl> cache(new disk_cache::BackendImpl(
64 path, mask, base::ThreadTaskRunnerHandle::Get(), NULL)); 65 path, mask, base::ThreadTaskRunnerHandle::Get(), NULL));
65 if (!cache.get()) 66 if (!cache.get())
66 return false; 67 return false;
67 if (new_eviction) 68 if (new_eviction)
68 cache->SetNewEviction(); 69 cache->SetNewEviction();
69 cache->SetFlags(disk_cache::kNoRandom); 70 cache->SetFlags(disk_cache::kNoRandom);
70 if (cache->SyncInit() != net::OK) 71 if (cache->SyncInit() != net::OK)
71 return false; 72 return false;
72 return cache->SelfCheck() >= 0; 73 return cache->SelfCheck() >= 0;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 136
136 if (reuse_) { 137 if (reuse_) {
137 DCHECK_EQ(1, reuse_); 138 DCHECK_EQ(1, reuse_);
138 if (2 == reuse_) 139 if (2 == reuse_)
139 helper_->set_callback_reused_error(true); 140 helper_->set_callback_reused_error(true);
140 reuse_++; 141 reuse_++;
141 } 142 }
142 143
143 helper_->CallbackWasCalled(); 144 helper_->CallbackWasCalled();
144 } 145 }
OLDNEW
« no previous file with comments | « net/disk_cache/disk_cache_test_util.h ('k') | net/disk_cache/entry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698