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

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

Issue 153001: Fix 15 coverity complaints.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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/disk_cache_test_base.cc ('k') | net/disk_cache/mapped_file.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) 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 #include "net/disk_cache/disk_cache_test_util.h" 5 #include "net/disk_cache/disk_cache_test_util.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
11 #include "net/disk_cache/backend_impl.h" 11 #include "net/disk_cache/backend_impl.h"
12 #include "net/disk_cache/cache_util.h" 12 #include "net/disk_cache/cache_util.h"
13 #include "net/disk_cache/file.h" 13 #include "net/disk_cache/file.h"
14 14
15 using base::Time; 15 using base::Time;
16 using base::TimeDelta; 16 using base::TimeDelta;
17 17
18 namespace { 18 namespace {
19 19
20 std::wstring BuildCachePath(const std::wstring& name) { 20 std::wstring BuildCachePath(const std::wstring& name) {
21 FilePath path; 21 FilePath path;
22 PathService::Get(base::DIR_TEMP, &path); 22 PathService::Get(base::DIR_TEMP, &path); // Ignore return value;
23 path = path.Append(FilePath::FromWStringHack(name)); 23 path = path.Append(FilePath::FromWStringHack(name));
24 if (!file_util::PathExists(path)) 24 if (!file_util::PathExists(path))
25 file_util::CreateDirectory(path); 25 file_util::CreateDirectory(path);
26 26
27 return path.ToWStringHack(); 27 return path.ToWStringHack();
28 } 28 }
29 29
30 } // namespace. 30 } // namespace.
31 31
32 std::string GenerateKey(bool same_length) { 32 std::string GenerateKey(bool same_length) {
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 } else { 163 } else {
164 // Not finished yet. See if we have to abort. 164 // Not finished yet. See if we have to abort.
165 if (last_ == g_cache_tests_received) 165 if (last_ == g_cache_tests_received)
166 num_iterations_++; 166 num_iterations_++;
167 else 167 else
168 last_ = g_cache_tests_received; 168 last_ = g_cache_tests_received;
169 if (40 == num_iterations_) 169 if (40 == num_iterations_)
170 MessageLoop::current()->Quit(); 170 MessageLoop::current()->Quit();
171 } 171 }
172 } 172 }
OLDNEW
« no previous file with comments | « net/disk_cache/disk_cache_test_base.cc ('k') | net/disk_cache/mapped_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698