Chromium Code Reviews| 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 "media/blink/buffered_data_source.h" | 5 #include "media/blink/buffered_data_source.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 intermediate_read_buffer_(kInitialReadBufferSize), | 94 intermediate_read_buffer_(kInitialReadBufferSize), |
| 95 render_task_runner_(task_runner), | 95 render_task_runner_(task_runner), |
| 96 stop_signal_received_(false), | 96 stop_signal_received_(false), |
| 97 media_has_played_(false), | 97 media_has_played_(false), |
| 98 preload_(AUTO), | 98 preload_(AUTO), |
| 99 bitrate_(0), | 99 bitrate_(0), |
| 100 playback_rate_(0.0), | 100 playback_rate_(0.0), |
| 101 media_log_(media_log), | 101 media_log_(media_log), |
| 102 host_(host), | 102 host_(host), |
| 103 downloading_cb_(downloading_cb), | 103 downloading_cb_(downloading_cb), |
| 104 weak_factory_(this) { | 104 weak_factory_(this), |
| 105 weak_ptr_(weak_factory_.GetWeakPtr()) { | |
|
Wez
2014/11/18 23:28:10
You don't seem to be actually referring to this me
| |
| 105 DCHECK(host_); | 106 DCHECK(host_); |
| 106 DCHECK(!downloading_cb_.is_null()); | 107 DCHECK(!downloading_cb_.is_null()); |
| 107 } | 108 } |
| 108 | 109 |
| 109 BufferedDataSource::~BufferedDataSource() {} | 110 BufferedDataSource::~BufferedDataSource() {} |
| 110 | 111 |
| 111 // A factory method to create BufferedResourceLoader using the read parameters. | 112 // A factory method to create BufferedResourceLoader using the read parameters. |
| 112 // This method can be overridden to inject mock BufferedResourceLoader object | 113 // This method can be overridden to inject mock BufferedResourceLoader object |
| 113 // for testing purpose. | 114 // for testing purpose. |
| 114 BufferedResourceLoader* BufferedDataSource::CreateResourceLoader( | 115 BufferedResourceLoader* BufferedDataSource::CreateResourceLoader( |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 527 } | 528 } |
| 528 | 529 |
| 529 // If media is currently playing or the page indicated preload=auto or the | 530 // If media is currently playing or the page indicated preload=auto or the |
| 530 // the server does not support the byte range request or we do not want to go | 531 // the server does not support the byte range request or we do not want to go |
| 531 // too far ahead of the read head, use threshold strategy to enable/disable | 532 // too far ahead of the read head, use threshold strategy to enable/disable |
| 532 // deferring when the buffer is full/depleted. | 533 // deferring when the buffer is full/depleted. |
| 533 loader_->UpdateDeferStrategy(BufferedResourceLoader::kCapacityDefer); | 534 loader_->UpdateDeferStrategy(BufferedResourceLoader::kCapacityDefer); |
| 534 } | 535 } |
| 535 | 536 |
| 536 } // namespace media | 537 } // namespace media |
| OLD | NEW |