| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/callback.h" | 5 #include "base/callback.h" |
| 6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
| 7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
| 10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 } | 644 } |
| 645 | 645 |
| 646 // This method simply returns kTimeoutMilliseconds. The purpose of this | 646 // This method simply returns kTimeoutMilliseconds. The purpose of this |
| 647 // method is to be overidded so as to provide a different timeout value | 647 // method is to be overidded so as to provide a different timeout value |
| 648 // for testing purpose. | 648 // for testing purpose. |
| 649 base::TimeDelta BufferedDataSource::GetTimeoutMilliseconds() { | 649 base::TimeDelta BufferedDataSource::GetTimeoutMilliseconds() { |
| 650 return base::TimeDelta::FromMilliseconds(kTimeoutMilliseconds); | 650 return base::TimeDelta::FromMilliseconds(kTimeoutMilliseconds); |
| 651 } | 651 } |
| 652 | 652 |
| 653 ///////////////////////////////////////////////////////////////////////////// | 653 ///////////////////////////////////////////////////////////////////////////// |
| 654 // BufferedDataSource, media::MediaFilter implementation | 654 // BufferedDataSource, media::Filter implementation |
| 655 void BufferedDataSource::Initialize(const std::string& url, | 655 void BufferedDataSource::Initialize(const std::string& url, |
| 656 media::FilterCallback* callback) { | 656 media::FilterCallback* callback) { |
| 657 // Saves the url. | 657 // Saves the url. |
| 658 url_ = GURL(url); | 658 url_ = GURL(url); |
| 659 | 659 |
| 660 if (!IsProtocolSupportedForMedia(url_)) { | 660 if (!IsProtocolSupportedForMedia(url_)) { |
| 661 // This method is called on the thread where host() lives so it is safe | 661 // This method is called on the thread where host() lives so it is safe |
| 662 // to make this call. | 662 // to make this call. |
| 663 host()->SetError(media::PIPELINE_ERROR_NETWORK); | 663 host()->SetError(media::PIPELINE_ERROR_NETWORK); |
| 664 callback->Run(); | 664 callback->Run(); |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1162 return; | 1162 return; |
| 1163 | 1163 |
| 1164 if (network_activity != network_activity_) { | 1164 if (network_activity != network_activity_) { |
| 1165 network_activity_ = network_activity; | 1165 network_activity_ = network_activity; |
| 1166 host()->SetNetworkActivity(network_activity); | 1166 host()->SetNetworkActivity(network_activity); |
| 1167 } | 1167 } |
| 1168 host()->SetBufferedBytes(buffered_last_byte_position + 1); | 1168 host()->SetBufferedBytes(buffered_last_byte_position + 1); |
| 1169 } | 1169 } |
| 1170 | 1170 |
| 1171 } // namespace webkit_glue | 1171 } // namespace webkit_glue |
| OLD | NEW |