| 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 "media/filters/file_data_source.h" | 5 #include "media/filters/file_data_source.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> |
| 8 | 9 |
| 9 #include "base/logging.h" | 10 #include "base/logging.h" |
| 10 | 11 |
| 11 namespace media { | 12 namespace media { |
| 12 | 13 |
| 13 FileDataSource::FileDataSource() | 14 FileDataSource::FileDataSource() |
| 14 : force_read_errors_(false), | 15 : force_read_errors_(false), |
| 15 force_streaming_(false), | 16 force_streaming_(false), |
| 16 bytes_read_(0) { | 17 bytes_read_(0) { |
| 17 } | 18 } |
| 18 | 19 |
| 19 FileDataSource::FileDataSource(base::File file) | 20 FileDataSource::FileDataSource(base::File file) |
| 20 : force_read_errors_(false), | 21 : force_read_errors_(false), |
| 21 force_streaming_(false), | 22 force_streaming_(false), |
| 22 bytes_read_(0) { | 23 bytes_read_(0) { |
| 23 file_.Initialize(file.Pass()); | 24 file_.Initialize(std::move(file)); |
| 24 } | 25 } |
| 25 | 26 |
| 26 bool FileDataSource::Initialize(const base::FilePath& file_path) { | 27 bool FileDataSource::Initialize(const base::FilePath& file_path) { |
| 27 DCHECK(!file_.IsValid()); | 28 DCHECK(!file_.IsValid()); |
| 28 return file_.Initialize(file_path); | 29 return file_.Initialize(file_path); |
| 29 } | 30 } |
| 30 | 31 |
| 31 void FileDataSource::Stop() { | 32 void FileDataSource::Stop() { |
| 32 } | 33 } |
| 33 | 34 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 63 | 64 |
| 64 bool FileDataSource::IsStreaming() { | 65 bool FileDataSource::IsStreaming() { |
| 65 return force_streaming_; | 66 return force_streaming_; |
| 66 } | 67 } |
| 67 | 68 |
| 68 void FileDataSource::SetBitrate(int bitrate) {} | 69 void FileDataSource::SetBitrate(int bitrate) {} |
| 69 | 70 |
| 70 FileDataSource::~FileDataSource() {} | 71 FileDataSource::~FileDataSource() {} |
| 71 | 72 |
| 72 } // namespace media | 73 } // namespace media |
| OLD | NEW |