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

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

Issue 2176183008: Simple Cache: validate lengths before allocations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 4 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
« no previous file with comments | « net/disk_cache/entry_unittest.cc ('k') | net/disk_cache/simple/simple_synchronous_entry.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 int file_size, 272 int file_size,
273 SimpleEntryStat* out_entry_stat, 273 SimpleEntryStat* out_entry_stat,
274 scoped_refptr<net::GrowableIOBuffer>* stream_0_data, 274 scoped_refptr<net::GrowableIOBuffer>* stream_0_data,
275 uint32_t* out_stream_0_crc32); 275 uint32_t* out_stream_0_crc32);
276 276
277 int GetEOFRecordData(int index, 277 int GetEOFRecordData(int index,
278 const SimpleEntryStat& entry_stat, 278 const SimpleEntryStat& entry_stat,
279 bool* out_has_crc32, 279 bool* out_has_crc32,
280 bool* out_has_key_sha256, 280 bool* out_has_key_sha256,
281 uint32_t* out_crc32, 281 uint32_t* out_crc32,
282 int* out_data_size) const; 282 int32_t* out_data_size) const;
283 void Doom() const; 283 void Doom() const;
284 284
285 // Opens the sparse data file and scans it if it exists. 285 // Opens the sparse data file and scans it if it exists.
286 bool OpenSparseFileIfExists(int32_t* out_sparse_data_size); 286 bool OpenSparseFileIfExists(int32_t* out_sparse_data_size);
287 287
288 // Creates and initializes the sparse data file. 288 // Creates and initializes the sparse data file.
289 bool CreateSparseFile(); 289 bool CreateSparseFile();
290 290
291 // Closes the sparse data file. 291 // Closes the sparse data file.
292 void CloseSparseFile(); 292 void CloseSparseFile();
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 int64_t sparse_tail_offset_; 362 int64_t sparse_tail_offset_;
363 363
364 // True if the entry was created, or false if it was opened. Used to log 364 // True if the entry was created, or false if it was opened. Used to log
365 // SimpleCache.*.EntryCreatedWithStream2Omitted only for created entries. 365 // SimpleCache.*.EntryCreatedWithStream2Omitted only for created entries.
366 bool files_created_; 366 bool files_created_;
367 }; 367 };
368 368
369 } // namespace disk_cache 369 } // namespace disk_cache
370 370
371 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_SYNCHRONOUS_ENTRY_H_ 371 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_SYNCHRONOUS_ENTRY_H_
OLDNEW
« no previous file with comments | « net/disk_cache/entry_unittest.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