OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
348 void BufferedResourceLoader::didSendData( | 348 void BufferedResourceLoader::didSendData( |
349 WebURLLoader* loader, | 349 WebURLLoader* loader, |
350 unsigned long long bytes_sent, | 350 unsigned long long bytes_sent, |
351 unsigned long long total_bytes_to_be_sent) { | 351 unsigned long long total_bytes_to_be_sent) { |
352 NOTIMPLEMENTED(); | 352 NOTIMPLEMENTED(); |
353 } | 353 } |
354 | 354 |
355 void BufferedResourceLoader::didReceiveResponse( | 355 void BufferedResourceLoader::didReceiveResponse( |
356 WebURLLoader* loader, | 356 WebURLLoader* loader, |
357 const WebURLResponse& response) { | 357 const WebURLResponse& response) { |
358 DVLOG(1) << "didReceiveResponse: " << response.httpStatusCode(); | 358 DVLOG(1) << "didReceiveResponse: HTTP/" |
359 << (response.httpVersion() == WebURLResponse::HTTP_0_9 ? "0.9" : | |
darin (slow to review)
2012/05/21 23:39:07
nit: feels like httpVersion() should have a helper
| |
360 response.httpVersion() == WebURLResponse::HTTP_1_0 ? "1.0" : | |
361 response.httpVersion() == WebURLResponse::HTTP_1_1 ? "1.1" : | |
362 "Unknown") | |
363 << " " << response.httpStatusCode(); | |
359 DCHECK(active_loader_.get()); | 364 DCHECK(active_loader_.get()); |
360 | 365 |
361 // The loader may have been stopped and |start_cb| is destroyed. | 366 // The loader may have been stopped and |start_cb| is destroyed. |
362 // In this case we shouldn't do anything. | 367 // In this case we shouldn't do anything. |
363 if (start_cb_.is_null()) | 368 if (start_cb_.is_null()) |
364 return; | 369 return; |
365 | 370 |
366 // Expected content length can be |kPositionNotSpecified|, in that case | 371 // Expected content length can be |kPositionNotSpecified|, in that case |
367 // |content_length_| is not specified and this is a streaming response. | 372 // |content_length_| is not specified and this is a streaming response. |
368 content_length_ = response.expectedContentLength(); | 373 content_length_ = response.expectedContentLength(); |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
808 | 813 |
809 void BufferedResourceLoader::Log() { | 814 void BufferedResourceLoader::Log() { |
810 media_log_->AddEvent( | 815 media_log_->AddEvent( |
811 media_log_->CreateBufferedExtentsChangedEvent( | 816 media_log_->CreateBufferedExtentsChangedEvent( |
812 offset_ - buffer_.backward_bytes(), | 817 offset_ - buffer_.backward_bytes(), |
813 offset_, | 818 offset_, |
814 offset_ + buffer_.forward_bytes())); | 819 offset_ + buffer_.forward_bytes())); |
815 } | 820 } |
816 | 821 |
817 } // namespace webkit_media | 822 } // namespace webkit_media |
OLD | NEW |