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

Side by Side Diff: media/blink/url_index.cc

Issue 2842763003: media: Send chrome-cache: frfr on first request. (Closed)
Patch Set: merge Created 3 years, 7 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 | « media/blink/url_index.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/blink/url_index.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698