| 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/glue/media/simple_data_source.h" | 5 #include "webkit/glue/media/simple_data_source.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/process_util.h" | 8 #include "base/process_util.h" |
| 9 #include "media/base/filter_host.h" | 9 #include "media/base/filter_host.h" |
| 10 #include "net/base/data_url.h" | 10 #include "net/base/data_url.h" |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 | 314 |
| 315 // Cancel any pending requests. | 315 // Cancel any pending requests. |
| 316 if (url_loader_.get()) { | 316 if (url_loader_.get()) { |
| 317 url_loader_->cancel(); | 317 url_loader_->cancel(); |
| 318 url_loader_.reset(); | 318 url_loader_.reset(); |
| 319 } | 319 } |
| 320 } | 320 } |
| 321 | 321 |
| 322 void SimpleDataSource::DoneInitialization_Locked(bool success) { | 322 void SimpleDataSource::DoneInitialization_Locked(bool success) { |
| 323 lock_.AssertAcquired(); | 323 lock_.AssertAcquired(); |
| 324 media::PipelineError error = media::PIPELINE_ERROR_NETWORK; | 324 media::PipelineStatus status = media::PIPELINE_ERROR_NETWORK; |
| 325 if (success) { | 325 if (success) { |
| 326 state_ = INITIALIZED; | 326 state_ = INITIALIZED; |
| 327 | 327 |
| 328 UpdateHostState(); | 328 UpdateHostState(); |
| 329 error = media::PIPELINE_OK; | 329 status = media::PIPELINE_OK; |
| 330 } else { | 330 } else { |
| 331 state_ = UNINITIALIZED; | 331 state_ = UNINITIALIZED; |
| 332 url_loader_.reset(); | 332 url_loader_.reset(); |
| 333 } | 333 } |
| 334 | 334 |
| 335 scoped_ptr<media::PipelineStatusCallback> initialize_callback( | 335 scoped_ptr<media::PipelineStatusCallback> initialize_callback( |
| 336 initialize_callback_.release()); | 336 initialize_callback_.release()); |
| 337 initialize_callback->Run(error); | 337 initialize_callback->Run(status); |
| 338 } | 338 } |
| 339 | 339 |
| 340 void SimpleDataSource::UpdateHostState() { | 340 void SimpleDataSource::UpdateHostState() { |
| 341 if (host()) { | 341 if (host()) { |
| 342 host()->SetTotalBytes(size_); | 342 host()->SetTotalBytes(size_); |
| 343 host()->SetBufferedBytes(size_); | 343 host()->SetBufferedBytes(size_); |
| 344 // If scheme is file or data, say we are loaded. | 344 // If scheme is file or data, say we are loaded. |
| 345 host()->SetLoaded(url_.SchemeIsFile() || url_.SchemeIs(kDataScheme)); | 345 host()->SetLoaded(url_.SchemeIsFile() || url_.SchemeIs(kDataScheme)); |
| 346 } | 346 } |
| 347 } | 347 } |
| 348 | 348 |
| 349 } // namespace webkit_glue | 349 } // namespace webkit_glue |
| OLD | NEW |