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

Side by Side Diff: media/blink/buffered_resource_loader.h

Issue 1266953002: [Merge to M45]Check the response URL origin in BufferedDataSource to avoid mixing cross-origin resp… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2454
Patch Set: Created 5 years, 4 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/buffered_data_source_unittest.cc ('k') | media/blink/buffered_resource_loader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 #ifndef MEDIA_BLINK_BUFFERED_RESOURCE_LOADER_H_ 5 #ifndef MEDIA_BLINK_BUFFERED_RESOURCE_LOADER_H_
6 #define MEDIA_BLINK_BUFFERED_RESOURCE_LOADER_H_ 6 #define MEDIA_BLINK_BUFFERED_RESOURCE_LOADER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 const std::string& content_range_str, int64* first_byte_position, 198 const std::string& content_range_str, int64* first_byte_position,
199 int64* last_byte_position, int64* instance_size); 199 int64* last_byte_position, int64* instance_size);
200 200
201 // Cancels and closes any outstanding deferred ActiveLoader instances. Does 201 // Cancels and closes any outstanding deferred ActiveLoader instances. Does
202 // not report a failed state, so subsequent read calls to cache may still 202 // not report a failed state, so subsequent read calls to cache may still
203 // complete okay. If the ActiveLoader is not deferred it will be canceled once 203 // complete okay. If the ActiveLoader is not deferred it will be canceled once
204 // it is unless playback starts before then (as determined by the reported 204 // it is unless playback starts before then (as determined by the reported
205 // playback rate). 205 // playback rate).
206 void CancelUponDeferral(); 206 void CancelUponDeferral();
207 207
208 // Returns the original URL of the response. If the request is redirected to
209 // another URL it is the URL after redirected. If the response is generated in
210 // a Service Worker it is empty.
211 const GURL response_original_url() const { return response_original_url_; }
212
208 private: 213 private:
209 friend class BufferedDataSourceTest; 214 friend class BufferedDataSourceTest;
210 friend class BufferedResourceLoaderTest; 215 friend class BufferedResourceLoaderTest;
211 friend class MockBufferedDataSource; 216 friend class MockBufferedDataSource;
212 217
213 // Updates the |buffer_|'s forward and backward capacities. 218 // Updates the |buffer_|'s forward and backward capacities.
214 void UpdateBufferWindow(); 219 void UpdateBufferWindow();
215 220
216 // Updates deferring behavior based on current buffering scheme. 221 // Updates deferring behavior based on current buffering scheme.
217 void UpdateDeferBehavior(); 222 void UpdateDeferBehavior();
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 314
310 // Injected WebURLLoader instance for testing purposes. 315 // Injected WebURLLoader instance for testing purposes.
311 scoped_ptr<blink::WebURLLoader> test_loader_; 316 scoped_ptr<blink::WebURLLoader> test_loader_;
312 317
313 // Bitrate of the media. Set to 0 if unknown. 318 // Bitrate of the media. Set to 0 if unknown.
314 int bitrate_; 319 int bitrate_;
315 320
316 // Playback rate of the media. 321 // Playback rate of the media.
317 double playback_rate_; 322 double playback_rate_;
318 323
324 GURL response_original_url_;
325
319 scoped_refptr<MediaLog> media_log_; 326 scoped_refptr<MediaLog> media_log_;
320 327
321 bool cancel_upon_deferral_; 328 bool cancel_upon_deferral_;
322 329
323 DISALLOW_COPY_AND_ASSIGN(BufferedResourceLoader); 330 DISALLOW_COPY_AND_ASSIGN(BufferedResourceLoader);
324 }; 331 };
325 332
326 } // namespace media 333 } // namespace media
327 334
328 #endif // MEDIA_BLINK_BUFFERED_RESOURCE_LOADER_H_ 335 #endif // MEDIA_BLINK_BUFFERED_RESOURCE_LOADER_H_
OLDNEW
« no previous file with comments | « media/blink/buffered_data_source_unittest.cc ('k') | media/blink/buffered_resource_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698