OLD | NEW |
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 #include "content/renderer/media/test_response_generator.h" | 5 #include "media/blink/test_response_generator.h" |
6 | 6 |
7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
11 #include "third_party/WebKit/public/platform/WebString.h" | 11 #include "third_party/WebKit/public/platform/WebString.h" |
12 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 12 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
13 | 13 |
14 using blink::WebString; | 14 using blink::WebString; |
15 using blink::WebURLError; | 15 using blink::WebURLError; |
16 using blink::WebURLResponse; | 16 using blink::WebURLResponse; |
17 | 17 |
18 namespace content { | 18 namespace media { |
19 | 19 |
20 TestResponseGenerator::TestResponseGenerator(const GURL& gurl, | 20 TestResponseGenerator::TestResponseGenerator(const GURL& gurl, |
21 int64 content_length) | 21 int64 content_length) |
22 : gurl_(gurl), | 22 : gurl_(gurl), |
23 content_length_(content_length) { | 23 content_length_(content_length) { |
24 } | 24 } |
25 | 25 |
26 WebURLError TestResponseGenerator::GenerateError() { | 26 WebURLError TestResponseGenerator::GenerateError() { |
27 WebURLError error; | 27 WebURLError error; |
28 error.reason = net::ERR_ABORTED; | 28 error.reason = net::ERR_ABORTED; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 response.setHTTPStatusCode(0); | 91 response.setHTTPStatusCode(0); |
92 | 92 |
93 if (first_byte_offset >= 0) { | 93 if (first_byte_offset >= 0) { |
94 response.setExpectedContentLength(content_length_ - first_byte_offset); | 94 response.setExpectedContentLength(content_length_ - first_byte_offset); |
95 } else { | 95 } else { |
96 response.setExpectedContentLength(-1); | 96 response.setExpectedContentLength(-1); |
97 } | 97 } |
98 return response; | 98 return response; |
99 } | 99 } |
100 | 100 |
101 } // namespace content | 101 } // namespace media |
OLD | NEW |