OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <set> | 5 #include <set> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 if (ValidateDataOrigin(other->data_origin_)) { | 73 if (ValidateDataOrigin(other->data_origin_)) { |
74 DCHECK(thread_checker_.CalledOnValidThread()); | 74 DCHECK(thread_checker_.CalledOnValidThread()); |
75 valid_until_ = std::max(valid_until_, other->valid_until_); | 75 valid_until_ = std::max(valid_until_, other->valid_until_); |
76 // set_length() will not override the length if already known. | 76 // set_length() will not override the length if already known. |
77 set_length(other->length_); | 77 set_length(other->length_); |
78 cacheable_ |= other->cacheable_; | 78 cacheable_ |= other->cacheable_; |
79 range_supported_ |= other->range_supported_; | 79 range_supported_ |= other->range_supported_; |
80 if (last_modified_.is_null()) { | 80 if (last_modified_.is_null()) { |
81 last_modified_ = other->last_modified_; | 81 last_modified_ = other->last_modified_; |
82 } | 82 } |
| 83 bytes_read_from_cache_ += other->bytes_read_from_cache_; |
83 multibuffer()->MergeFrom(other->multibuffer()); | 84 multibuffer()->MergeFrom(other->multibuffer()); |
84 } | 85 } |
85 } | 86 } |
86 | 87 |
87 void UrlData::set_cacheable(bool cacheable) { | 88 void UrlData::set_cacheable(bool cacheable) { |
88 DCHECK(thread_checker_.CalledOnValidThread()); | 89 DCHECK(thread_checker_.CalledOnValidThread()); |
89 cacheable_ = cacheable; | 90 cacheable_ = cacheable; |
90 } | 91 } |
91 | 92 |
92 void UrlData::set_length(int64_t length) { | 93 void UrlData::set_length(int64_t length) { |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 url_data->CachedSize() > (*by_url_slot)->CachedSize())) { | 269 url_data->CachedSize() > (*by_url_slot)->CachedSize())) { |
269 *by_url_slot = url_data; | 270 *by_url_slot = url_data; |
270 } else { | 271 } else { |
271 (*by_url_slot)->MergeFrom(url_data); | 272 (*by_url_slot)->MergeFrom(url_data); |
272 } | 273 } |
273 } | 274 } |
274 return *by_url_slot; | 275 return *by_url_slot; |
275 } | 276 } |
276 | 277 |
277 } // namespace media | 278 } // namespace media |
OLD | NEW |