OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/media/buffered_resource_loader.h" | 5 #include "webkit/media/buffered_resource_loader.h" |
6 | 6 |
7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "media/base/media_log.h" | 10 #include "media/base/media_log.h" |
11 #include "net/base/net_errors.h" | 11 #include "net/base/net_errors.h" |
12 #include "net/http/http_request_headers.h" | 12 #include "net/http/http_request_headers.h" |
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKitPlatformSupport
.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKitPlatformSupport
.h" |
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" |
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h" |
17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLLoaderOptions.h
" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLLoaderOptions.h
" |
18 #include "webkit/glue/multipart_response_delegate.h" | 18 #include "webkit/glue/multipart_response_delegate.h" |
19 #include "webkit/glue/webkit_glue.h" | |
20 | 19 |
21 using WebKit::WebFrame; | 20 using WebKit::WebFrame; |
22 using WebKit::WebString; | 21 using WebKit::WebString; |
23 using WebKit::WebURLError; | 22 using WebKit::WebURLError; |
24 using WebKit::WebURLLoader; | 23 using WebKit::WebURLLoader; |
25 using WebKit::WebURLLoaderOptions; | 24 using WebKit::WebURLLoaderOptions; |
26 using WebKit::WebURLRequest; | 25 using WebKit::WebURLRequest; |
27 using WebKit::WebURLResponse; | 26 using WebKit::WebURLResponse; |
28 using webkit_glue::MultipartResponseDelegate; | 27 using webkit_glue::MultipartResponseDelegate; |
29 | 28 |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 if (!start_callback_.get()) { | 350 if (!start_callback_.get()) { |
352 // Set the url in the request to an invalid value (empty url). | 351 // Set the url in the request to an invalid value (empty url). |
353 newRequest.setURL(WebKit::WebURL()); | 352 newRequest.setURL(WebKit::WebURL()); |
354 return; | 353 return; |
355 } | 354 } |
356 | 355 |
357 // Only allow |single_origin_| if we haven't seen a different origin yet. | 356 // Only allow |single_origin_| if we haven't seen a different origin yet. |
358 if (single_origin_) | 357 if (single_origin_) |
359 single_origin_ = url_.GetOrigin() == GURL(newRequest.url()).GetOrigin(); | 358 single_origin_ = url_.GetOrigin() == GURL(newRequest.url()).GetOrigin(); |
360 | 359 |
361 if (!webkit_glue::IsProtocolSupportedForMedia(newRequest.url())) { | |
362 // Set the url in the request to an invalid value (empty url). | |
363 newRequest.setURL(WebKit::WebURL()); | |
364 DoneStart(net::ERR_ADDRESS_INVALID); | |
365 return; | |
366 } | |
367 | |
368 url_ = newRequest.url(); | 360 url_ = newRequest.url(); |
369 } | 361 } |
370 | 362 |
371 void BufferedResourceLoader::didSendData( | 363 void BufferedResourceLoader::didSendData( |
372 WebURLLoader* loader, | 364 WebURLLoader* loader, |
373 unsigned long long bytes_sent, | 365 unsigned long long bytes_sent, |
374 unsigned long long total_bytes_to_be_sent) { | 366 unsigned long long total_bytes_to_be_sent) { |
375 NOTIMPLEMENTED(); | 367 NOTIMPLEMENTED(); |
376 } | 368 } |
377 | 369 |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 if (buffer_.get()) { | 796 if (buffer_.get()) { |
805 media_log_->AddEvent( | 797 media_log_->AddEvent( |
806 media_log_->CreateBufferedExtentsChangedEvent( | 798 media_log_->CreateBufferedExtentsChangedEvent( |
807 offset_ - buffer_->backward_bytes(), | 799 offset_ - buffer_->backward_bytes(), |
808 offset_, | 800 offset_, |
809 offset_ + buffer_->forward_bytes())); | 801 offset_ + buffer_->forward_bytes())); |
810 } | 802 } |
811 } | 803 } |
812 | 804 |
813 } // namespace webkit_media | 805 } // namespace webkit_media |
OLD | NEW |