Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_SIMPLE_SIMPLE_SYNCHRONOUS_ENTRY_H_ | 5 #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_SYNCHRONOUS_ENTRY_H_ |
| 6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_SYNCHRONOUS_ENTRY_H_ | 6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_SYNCHRONOUS_ENTRY_H_ |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 SimpleEntryCreationResults* out_results); | 77 SimpleEntryCreationResults* out_results); |
| 78 | 78 |
| 79 static void CreateEntry(const base::FilePath& path, | 79 static void CreateEntry(const base::FilePath& path, |
| 80 const std::string& key, | 80 const std::string& key, |
| 81 uint64 entry_hash, | 81 uint64 entry_hash, |
| 82 bool had_index, | 82 bool had_index, |
| 83 SimpleEntryCreationResults* out_results); | 83 SimpleEntryCreationResults* out_results); |
| 84 | 84 |
| 85 // Deletes an entry without first Opening it. Does not check if there is | 85 // Deletes an entry without first Opening it. Does not check if there is |
| 86 // already an Entry object in memory holding the open files. Be careful! This | 86 // already an Entry object in memory holding the open files. Be careful! This |
| 87 // is meant to be used by the Backend::DoomEntry() call. |callback| will be | 87 // is meant to be used by the Backend::DoomEntry() call. Returns a net error |
| 88 // run by |callback_runner|. | 88 // code. |
|
Randy Smith (Not in Mondays)
2013/09/03 18:48:19
Suggestion: Now that dooms on active entries are d
Philippe
2013/09/04 09:35:23
Thanks Randy. I find that the current comment wasn
Randy Smith (Not in Mondays)
2013/09/04 15:44:16
Awesome; thank you. Just because I'm a (maybe too
Philippe
2013/09/04 15:50:32
Done.
| |
| 89 static void DoomEntry(const base::FilePath& path, | 89 static int DoomEntry(const base::FilePath& path, |
| 90 const std::string& key, | 90 const std::string& key, |
| 91 uint64 entry_hash, | 91 uint64 entry_hash); |
| 92 int* out_result); | |
| 93 | 92 |
| 94 // Like |DoomEntry()| above. Deletes all entries corresponding to the | 93 // Like |DoomEntry()| above. Deletes all entries corresponding to the |
| 95 // |key_hashes|. Succeeds only when all entries are deleted. Returns a net | 94 // |key_hashes|. Succeeds only when all entries are deleted. Returns a net |
| 96 // error code. | 95 // error code. |
| 97 static int DoomEntrySet(scoped_ptr<std::vector<uint64> > key_hashes, | 96 static int DoomEntrySet(scoped_ptr<std::vector<uint64> > key_hashes, |
| 98 const base::FilePath& path); | 97 const base::FilePath& path); |
| 99 | 98 |
| 100 // N.B. ReadData(), WriteData(), CheckEOFRecord() and Close() may block on IO. | 99 // N.B. ReadData(), WriteData(), CheckEOFRecord() and Close() may block on IO. |
| 101 void ReadData(const EntryOperationData& in_entry_op, | 100 void ReadData(const EntryOperationData& in_entry_op, |
| 102 net::IOBuffer* out_buf, | 101 net::IOBuffer* out_buf, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 157 | 156 |
| 158 bool have_open_files_; | 157 bool have_open_files_; |
| 159 bool initialized_; | 158 bool initialized_; |
| 160 | 159 |
| 161 base::PlatformFile files_[kSimpleEntryFileCount]; | 160 base::PlatformFile files_[kSimpleEntryFileCount]; |
| 162 }; | 161 }; |
| 163 | 162 |
| 164 } // namespace disk_cache | 163 } // namespace disk_cache |
| 165 | 164 |
| 166 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_SYNCHRONOUS_ENTRY_H_ | 165 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_SYNCHRONOUS_ENTRY_H_ |
| OLD | NEW |