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 #include "net/disk_cache/simple/simple_entry_impl.h" | 5 #include "net/disk_cache/simple/simple_entry_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cstring> | 8 #include <cstring> |
9 #include <limits> | 9 #include <limits> |
10 #include <utility> | 10 #include <utility> |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "base/time/time.h" | 22 #include "base/time/time.h" |
23 #include "net/base/io_buffer.h" | 23 #include "net/base/io_buffer.h" |
24 #include "net/base/net_errors.h" | 24 #include "net/base/net_errors.h" |
25 #include "net/disk_cache/net_log_parameters.h" | 25 #include "net/disk_cache/net_log_parameters.h" |
26 #include "net/disk_cache/simple/simple_backend_impl.h" | 26 #include "net/disk_cache/simple/simple_backend_impl.h" |
27 #include "net/disk_cache/simple/simple_histogram_macros.h" | 27 #include "net/disk_cache/simple/simple_histogram_macros.h" |
28 #include "net/disk_cache/simple/simple_index.h" | 28 #include "net/disk_cache/simple/simple_index.h" |
29 #include "net/disk_cache/simple/simple_net_log_parameters.h" | 29 #include "net/disk_cache/simple/simple_net_log_parameters.h" |
30 #include "net/disk_cache/simple/simple_synchronous_entry.h" | 30 #include "net/disk_cache/simple/simple_synchronous_entry.h" |
31 #include "net/disk_cache/simple/simple_util.h" | 31 #include "net/disk_cache/simple/simple_util.h" |
| 32 #include "net/log/net_log.h" |
32 #include "net/log/net_log_source_type.h" | 33 #include "net/log/net_log_source_type.h" |
33 #include "third_party/zlib/zlib.h" | 34 #include "third_party/zlib/zlib.h" |
34 | 35 |
35 namespace disk_cache { | 36 namespace disk_cache { |
36 namespace { | 37 namespace { |
37 | 38 |
38 // An entry can store sparse data taking up to 1 / kMaxSparseDataSizeDivisor of | 39 // An entry can store sparse data taking up to 1 / kMaxSparseDataSizeDivisor of |
39 // the cache. | 40 // the cache. |
40 const int64_t kMaxSparseDataSizeDivisor = 10; | 41 const int64_t kMaxSparseDataSizeDivisor = 10; |
41 | 42 |
(...skipping 1502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1544 } | 1545 } |
1545 crc32s_end_offset_[stream_index] = offset + length; | 1546 crc32s_end_offset_[stream_index] = offset + length; |
1546 } else if (offset < crc32s_end_offset_[stream_index]) { | 1547 } else if (offset < crc32s_end_offset_[stream_index]) { |
1547 // If a range for which the crc32 was already computed is rewritten, the | 1548 // If a range for which the crc32 was already computed is rewritten, the |
1548 // computation of the crc32 need to start from 0 again. | 1549 // computation of the crc32 need to start from 0 again. |
1549 crc32s_end_offset_[stream_index] = 0; | 1550 crc32s_end_offset_[stream_index] = 0; |
1550 } | 1551 } |
1551 } | 1552 } |
1552 | 1553 |
1553 } // namespace disk_cache | 1554 } // namespace disk_cache |
OLD | NEW |