OLD | NEW |
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 "base/files/file.h" | 5 #include "base/files/file.h" |
6 #include "base/files/file_util.h" | 6 #include "base/files/file_util.h" |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/hash.h" | 8 #include "base/hash.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 using SimpleIndexFile::Deserialize; | 72 using SimpleIndexFile::Deserialize; |
73 using SimpleIndexFile::LegacyIsIndexFileStale; | 73 using SimpleIndexFile::LegacyIsIndexFileStale; |
74 using SimpleIndexFile::Serialize; | 74 using SimpleIndexFile::Serialize; |
75 using SimpleIndexFile::SerializeFinalData; | 75 using SimpleIndexFile::SerializeFinalData; |
76 | 76 |
77 explicit WrappedSimpleIndexFile(const base::FilePath& index_file_directory) | 77 explicit WrappedSimpleIndexFile(const base::FilePath& index_file_directory) |
78 : SimpleIndexFile(base::ThreadTaskRunnerHandle::Get(), | 78 : SimpleIndexFile(base::ThreadTaskRunnerHandle::Get(), |
79 base::ThreadTaskRunnerHandle::Get(), | 79 base::ThreadTaskRunnerHandle::Get(), |
80 net::DISK_CACHE, | 80 net::DISK_CACHE, |
81 index_file_directory) {} | 81 index_file_directory) {} |
82 virtual ~WrappedSimpleIndexFile() { | 82 ~WrappedSimpleIndexFile() override {} |
83 } | |
84 | 83 |
85 const base::FilePath& GetIndexFilePath() const { | 84 const base::FilePath& GetIndexFilePath() const { |
86 return index_file_; | 85 return index_file_; |
87 } | 86 } |
88 | 87 |
89 bool CreateIndexFileDirectory() const { | 88 bool CreateIndexFileDirectory() const { |
90 return base::CreateDirectory(index_file_.DirName()); | 89 return base::CreateDirectory(index_file_.DirName()); |
91 } | 90 } |
92 }; | 91 }; |
93 | 92 |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 WrappedSimpleIndexFile::Deserialize(contents.data(), | 332 WrappedSimpleIndexFile::Deserialize(contents.data(), |
334 contents.size(), | 333 contents.size(), |
335 &when_index_last_saw_cache, | 334 &when_index_last_saw_cache, |
336 &deserialize_result); | 335 &deserialize_result); |
337 EXPECT_TRUE(deserialize_result.did_load); | 336 EXPECT_TRUE(deserialize_result.did_load); |
338 } | 337 } |
339 | 338 |
340 #endif // defined(OS_POSIX) | 339 #endif // defined(OS_POSIX) |
341 | 340 |
342 } // namespace disk_cache | 341 } // namespace disk_cache |
OLD | NEW |