Chromium Code Reviews| 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 <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/location.h" | 14 #include "base/location.h" |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/message_loop/message_loop_proxy.h" | |
| 16 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
| 17 #include "base/task_runner.h" | 18 #include "base/task_runner.h" |
| 18 #include "base/task_runner_util.h" | 19 #include "base/task_runner_util.h" |
| 19 #include "base/thread_task_runner_handle.h" | 20 #include "base/thread_task_runner_handle.h" |
| 20 #include "base/time/time.h" | 21 #include "base/time/time.h" |
| 21 #include "net/base/io_buffer.h" | 22 #include "net/base/io_buffer.h" |
| 22 #include "net/base/net_errors.h" | 23 #include "net/base/net_errors.h" |
| 23 #include "net/disk_cache/net_log_parameters.h" | 24 #include "net/disk_cache/net_log_parameters.h" |
| 24 #include "net/disk_cache/simple/simple_backend_impl.h" | 25 #include "net/disk_cache/simple/simple_backend_impl.h" |
| 25 #include "net/disk_cache/simple/simple_histogram_macros.h" | 26 #include "net/disk_cache/simple/simple_histogram_macros.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 135 DCHECK(!completion_callback.is_null()); | 136 DCHECK(!completion_callback.is_null()); |
| 136 if (!backend.get()) | 137 if (!backend.get()) |
| 137 return; | 138 return; |
| 138 completion_callback.Run(result); | 139 completion_callback.Run(result); |
| 139 } | 140 } |
| 140 | 141 |
| 141 } // namespace | 142 } // namespace |
| 142 | 143 |
| 143 using base::Closure; | 144 using base::Closure; |
| 144 using base::FilePath; | 145 using base::FilePath; |
| 145 using base::MessageLoopProxy; | 146 using base::MessageLoopProxy; |
|
danakj
2015/04/21 20:16:31
i don't actually see this class being used?
Sami
2015/04/23 17:48:25
Heh, well spotted. Removed.
| |
| 146 using base::Time; | 147 using base::Time; |
| 147 using base::TaskRunner; | 148 using base::TaskRunner; |
| 148 | 149 |
| 149 // A helper class to insure that RunNextOperationIfNeeded() is called when | 150 // A helper class to insure that RunNextOperationIfNeeded() is called when |
| 150 // exiting the current stack frame. | 151 // exiting the current stack frame. |
| 151 class SimpleEntryImpl::ScopedOperationRunner { | 152 class SimpleEntryImpl::ScopedOperationRunner { |
| 152 public: | 153 public: |
| 153 explicit ScopedOperationRunner(SimpleEntryImpl* entry) : entry_(entry) { | 154 explicit ScopedOperationRunner(SimpleEntryImpl* entry) : entry_(entry) { |
| 154 } | 155 } |
| 155 | 156 |
| (...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1524 } | 1525 } |
| 1525 crc32s_end_offset_[stream_index] = offset + length; | 1526 crc32s_end_offset_[stream_index] = offset + length; |
| 1526 } else if (offset < crc32s_end_offset_[stream_index]) { | 1527 } else if (offset < crc32s_end_offset_[stream_index]) { |
| 1527 // If a range for which the crc32 was already computed is rewritten, the | 1528 // If a range for which the crc32 was already computed is rewritten, the |
| 1528 // computation of the crc32 need to start from 0 again. | 1529 // computation of the crc32 need to start from 0 again. |
| 1529 crc32s_end_offset_[stream_index] = 0; | 1530 crc32s_end_offset_[stream_index] = 0; |
| 1530 } | 1531 } |
| 1531 } | 1532 } |
| 1532 | 1533 |
| 1533 } // namespace disk_cache | 1534 } // namespace disk_cache |
| OLD | NEW |