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

Unified Diff: media/blink/test_response_generator.cc

Issue 1220963004: Check the response URL origin in BufferedDataSource to avoid mixing cross-origin responses. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated hubbe's comment Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/blink/test_response_generator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/test_response_generator.cc
diff --git a/media/blink/test_response_generator.cc b/media/blink/test_response_generator.cc
index de7b5d5bce6b78c49df4a3ea0f4670cb4a61099a..e6883dbd9faaacebedfb26f26814d494f84d437e 100644
--- a/media/blink/test_response_generator.cc
+++ b/media/blink/test_response_generator.cc
@@ -41,13 +41,25 @@ WebURLResponse TestResponseGenerator::Generate200() {
}
WebURLResponse TestResponseGenerator::Generate206(int64 first_byte_offset) {
- return Generate206(first_byte_offset, kNormal);
+ return GeneratePartial206(first_byte_offset, content_length_ - 1, kNormal);
}
WebURLResponse TestResponseGenerator::Generate206(int64 first_byte_offset,
Flags flags) {
+ return GeneratePartial206(first_byte_offset, content_length_ - 1, flags);
+}
+
+WebURLResponse TestResponseGenerator::GeneratePartial206(
+ int64 first_byte_offset,
+ int64 last_byte_offset) {
+ return GeneratePartial206(first_byte_offset, last_byte_offset, kNormal);
+}
+
+WebURLResponse TestResponseGenerator::GeneratePartial206(
+ int64 first_byte_offset,
+ int64 last_byte_offset,
+ Flags flags) {
int64 range_content_length = content_length_ - first_byte_offset;
- int64 last_byte_offset = content_length_ - 1;
WebURLResponse response(gurl_);
response.setHTTPStatusCode(206);
« no previous file with comments | « media/blink/test_response_generator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698