| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 // Deletes an entry without first Opening it. Does not check if there is | 51 // Deletes an entry without first Opening it. Does not check if there is |
| 52 // already an Entry object in memory holding the open files. Be careful! This | 52 // already an Entry object in memory holding the open files. Be careful! This |
| 53 // is meant to be used by the Backend::DoomEntry() call. |callback| will be | 53 // is meant to be used by the Backend::DoomEntry() call. |callback| will be |
| 54 // run by |callback_runner|. | 54 // run by |callback_runner|. |
| 55 static void DoomEntry(const FilePath& path, | 55 static void DoomEntry(const FilePath& path, |
| 56 const std::string& key, | 56 const std::string& key, |
| 57 scoped_refptr<base::TaskRunner> callback_runner, | 57 scoped_refptr<base::TaskRunner> callback_runner, |
| 58 const net::CompletionCallback& callback); | 58 const net::CompletionCallback& callback); |
| 59 | 59 |
| 60 // N.B. DoomAndClose(), Close(), ReadData() and WriteData() may block on IO. | 60 // N.B. Close(), ReadData() and WriteData() may block on IO. |
| 61 void DoomAndClose(); | |
| 62 void Close(); | 61 void Close(); |
| 63 void ReadData(int index, | 62 void ReadData(int index, |
| 64 int offset, | 63 int offset, |
| 65 net::IOBuffer* buf, | 64 net::IOBuffer* buf, |
| 66 int buf_len, | 65 int buf_len, |
| 67 const SynchronousEntryCallback& callback); | 66 const SynchronousEntryCallback& callback); |
| 68 void WriteData(int index, | 67 void WriteData(int index, |
| 69 int offset, | 68 int offset, |
| 70 net::IOBuffer* buf, | 69 net::IOBuffer* buf, |
| 71 int buf_len, | 70 int buf_len, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 base::Time last_modified_; | 114 base::Time last_modified_; |
| 116 int32 data_size_[kSimpleEntryFileCount]; | 115 int32 data_size_[kSimpleEntryFileCount]; |
| 117 | 116 |
| 118 base::PlatformFile files_[kSimpleEntryFileCount]; | 117 base::PlatformFile files_[kSimpleEntryFileCount]; |
| 119 EntryStatus status_[kSimpleEntryFileCount]; | 118 EntryStatus status_[kSimpleEntryFileCount]; |
| 120 }; | 119 }; |
| 121 | 120 |
| 122 } // namespace disk_cache | 121 } // namespace disk_cache |
| 123 | 122 |
| 124 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_SYNCHRONOUS_ENTRY_H_ | 123 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_SYNCHRONOUS_ENTRY_H_ |
| OLD | NEW |