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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 // Deletes an entry without first Opening it. Does not check if there is | 52 // Deletes an entry without first Opening it. Does not check if there is |
53 // already an Entry object in memory holding the open files. Be careful! This | 53 // already an Entry object in memory holding the open files. Be careful! This |
54 // is meant to be used by the Backend::DoomEntry() call. |callback| will be | 54 // is meant to be used by the Backend::DoomEntry() call. |callback| will be |
55 // run by |callback_runner|. | 55 // run by |callback_runner|. |
56 static void DoomEntry(const base::FilePath& path, | 56 static void DoomEntry(const base::FilePath& path, |
57 const std::string& key, | 57 const std::string& key, |
58 scoped_refptr<base::TaskRunner> callback_runner, | 58 scoped_refptr<base::TaskRunner> callback_runner, |
59 const net::CompletionCallback& callback); | 59 const net::CompletionCallback& callback); |
60 | 60 |
61 // N.B. DoomAndClose(), Close(), ReadData() and WriteData() may block on IO. | 61 // N.B. Close(), ReadData() and WriteData() may block on IO. |
62 void DoomAndClose(); | |
63 void Close(); | 62 void Close(); |
64 void ReadData(int index, | 63 void ReadData(int index, |
65 int offset, | 64 int offset, |
66 net::IOBuffer* buf, | 65 net::IOBuffer* buf, |
67 int buf_len, | 66 int buf_len, |
68 const SynchronousOperationCallback& callback); | 67 const SynchronousOperationCallback& callback); |
69 void WriteData(int index, | 68 void WriteData(int index, |
70 int offset, | 69 int offset, |
71 net::IOBuffer* buf, | 70 net::IOBuffer* buf, |
72 int buf_len, | 71 int buf_len, |
(...skipping 29 matching lines...) Expand all Loading... |
102 base::Time last_used_; | 101 base::Time last_used_; |
103 base::Time last_modified_; | 102 base::Time last_modified_; |
104 int32 data_size_[kSimpleEntryFileCount]; | 103 int32 data_size_[kSimpleEntryFileCount]; |
105 | 104 |
106 base::PlatformFile files_[kSimpleEntryFileCount]; | 105 base::PlatformFile files_[kSimpleEntryFileCount]; |
107 }; | 106 }; |
108 | 107 |
109 } // namespace disk_cache | 108 } // namespace disk_cache |
110 | 109 |
111 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_SYNCHRONOUS_ENTRY_H_ | 110 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_SYNCHRONOUS_ENTRY_H_ |
OLD | NEW |