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

Side by Side Diff: net/disk_cache/simple/simple_synchronous_entry.h

Issue 22859060: Fix race condition for non-open/create operations happening after a doom. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 3 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
OLDNEW
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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 bool had_index, 78 bool had_index,
79 SimpleEntryCreationResults* out_results); 79 SimpleEntryCreationResults* out_results);
80 80
81 static void CreateEntry(net::CacheType cache_type, 81 static void CreateEntry(net::CacheType cache_type,
82 const base::FilePath& path, 82 const base::FilePath& path,
83 const std::string& key, 83 const std::string& key,
84 uint64 entry_hash, 84 uint64 entry_hash,
85 bool had_index, 85 bool had_index,
86 SimpleEntryCreationResults* out_results); 86 SimpleEntryCreationResults* out_results);
87 87
88 // Deletes an entry without first Opening it. Does not check if there is 88 // Deletes an entry from the file system without affecting the state of the
89 // already an Entry object in memory holding the open files. Be careful! This 89 // corresponding instance, if any (allowing operations to continue to be
90 // is meant to be used by the Backend::DoomEntry() call. |callback| will be 90 // executed through that instance). Returns a net error code.
91 // run by |callback_runner|. 91 static int DoomEntry(const base::FilePath& path,
92 static void DoomEntry(const base::FilePath& path, 92 const std::string& key,
93 const std::string& key, 93 uint64 entry_hash);
94 uint64 entry_hash,
95 int* out_result);
96 94
97 // Like |DoomEntry()| above. Deletes all entries corresponding to the 95 // Like |DoomEntry()| above. Deletes all entries corresponding to the
98 // |key_hashes|. Succeeds only when all entries are deleted. Returns a net 96 // |key_hashes|. Succeeds only when all entries are deleted. Returns a net
99 // error code. 97 // error code.
100 static int DoomEntrySet(scoped_ptr<std::vector<uint64> > key_hashes, 98 static int DoomEntrySet(scoped_ptr<std::vector<uint64> > key_hashes,
101 const base::FilePath& path); 99 const base::FilePath& path);
102 100
103 // N.B. ReadData(), WriteData(), CheckEOFRecord() and Close() may block on IO. 101 // N.B. ReadData(), WriteData(), CheckEOFRecord() and Close() may block on IO.
104 void ReadData(const EntryOperationData& in_entry_op, 102 void ReadData(const EntryOperationData& in_entry_op,
105 net::IOBuffer* out_buf, 103 net::IOBuffer* out_buf,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 160
163 bool have_open_files_; 161 bool have_open_files_;
164 bool initialized_; 162 bool initialized_;
165 163
166 base::PlatformFile files_[kSimpleEntryFileCount]; 164 base::PlatformFile files_[kSimpleEntryFileCount];
167 }; 165 };
168 166
169 } // namespace disk_cache 167 } // namespace disk_cache
170 168
171 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_SYNCHRONOUS_ENTRY_H_ 169 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_SYNCHRONOUS_ENTRY_H_
OLDNEW
« no previous file with comments | « net/disk_cache/simple/simple_entry_operation.cc ('k') | net/disk_cache/simple/simple_synchronous_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698