| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 static_assert(arraysize(data_size_) == arraysize(crc_check_state_), | 198 static_assert(arraysize(data_size_) == arraysize(crc_check_state_), |
| 199 "arrays should be the same size"); | 199 "arrays should be the same size"); |
| 200 MakeUninitialized(); | 200 MakeUninitialized(); |
| 201 net_log_.BeginEvent(net::NetLogEventType::SIMPLE_CACHE_ENTRY, | 201 net_log_.BeginEvent(net::NetLogEventType::SIMPLE_CACHE_ENTRY, |
| 202 CreateNetLogSimpleEntryConstructionCallback(this)); | 202 CreateNetLogSimpleEntryConstructionCallback(this)); |
| 203 } | 203 } |
| 204 | 204 |
| 205 void SimpleEntryImpl::SetActiveEntryProxy( | 205 void SimpleEntryImpl::SetActiveEntryProxy( |
| 206 std::unique_ptr<ActiveEntryProxy> active_entry_proxy) { | 206 std::unique_ptr<ActiveEntryProxy> active_entry_proxy) { |
| 207 DCHECK(!active_entry_proxy_); | 207 DCHECK(!active_entry_proxy_); |
| 208 active_entry_proxy_.reset(active_entry_proxy.release()); | 208 active_entry_proxy_ = std::move(active_entry_proxy); |
| 209 } | 209 } |
| 210 | 210 |
| 211 int SimpleEntryImpl::OpenEntry(Entry** out_entry, | 211 int SimpleEntryImpl::OpenEntry(Entry** out_entry, |
| 212 const CompletionCallback& callback) { | 212 const CompletionCallback& callback) { |
| 213 DCHECK(backend_.get()); | 213 DCHECK(backend_.get()); |
| 214 | 214 |
| 215 net_log_.AddEvent(net::NetLogEventType::SIMPLE_CACHE_ENTRY_OPEN_CALL); | 215 net_log_.AddEvent(net::NetLogEventType::SIMPLE_CACHE_ENTRY_OPEN_CALL); |
| 216 | 216 |
| 217 bool have_index = backend_->index()->initialized(); | 217 bool have_index = backend_->index()->initialized(); |
| 218 // This enumeration is used in histograms, add entries only at end. | 218 // This enumeration is used in histograms, add entries only at end. |
| (...skipping 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1545 } | 1545 } |
| 1546 crc32s_end_offset_[stream_index] = offset + length; | 1546 crc32s_end_offset_[stream_index] = offset + length; |
| 1547 } else if (offset < crc32s_end_offset_[stream_index]) { | 1547 } else if (offset < crc32s_end_offset_[stream_index]) { |
| 1548 // 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 |
| 1549 // computation of the crc32 need to start from 0 again. | 1549 // computation of the crc32 need to start from 0 again. |
| 1550 crc32s_end_offset_[stream_index] = 0; | 1550 crc32s_end_offset_[stream_index] = 0; |
| 1551 } | 1551 } |
| 1552 } | 1552 } |
| 1553 | 1553 |
| 1554 } // namespace disk_cache | 1554 } // namespace disk_cache |
| OLD | NEW |