| 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 "chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.h" | 5 #include "chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 &MTPDeviceDelegateImplLinux::OnDidGetFileInfoToCreateSnapshotFile, | 276 &MTPDeviceDelegateImplLinux::OnDidGetFileInfoToCreateSnapshotFile, |
| 277 weak_ptr_factory_.GetWeakPtr(), | 277 weak_ptr_factory_.GetWeakPtr(), |
| 278 base::Passed(&request_info)), | 278 base::Passed(&request_info)), |
| 279 base::Bind(&MTPDeviceDelegateImplLinux::HandleDeviceFileError, | 279 base::Bind(&MTPDeviceDelegateImplLinux::HandleDeviceFileError, |
| 280 weak_ptr_factory_.GetWeakPtr(), | 280 weak_ptr_factory_.GetWeakPtr(), |
| 281 error_callback)); | 281 error_callback)); |
| 282 EnsureInitAndRunTask(PendingTaskInfo(FROM_HERE, call_closure)); | 282 EnsureInitAndRunTask(PendingTaskInfo(FROM_HERE, call_closure)); |
| 283 } | 283 } |
| 284 | 284 |
| 285 bool MTPDeviceDelegateImplLinux::IsStreaming() { | 285 bool MTPDeviceDelegateImplLinux::IsStreaming() { |
| 286 return false; | 286 return true; |
| 287 } | 287 } |
| 288 | 288 |
| 289 void MTPDeviceDelegateImplLinux::ReadBytes( | 289 void MTPDeviceDelegateImplLinux::ReadBytes( |
| 290 const base::FilePath& device_file_path, | 290 const base::FilePath& device_file_path, |
| 291 net::IOBuffer* buf, int64 offset, int buf_len, | 291 net::IOBuffer* buf, int64 offset, int buf_len, |
| 292 const ReadBytesSuccessCallback& success_callback, | 292 const ReadBytesSuccessCallback& success_callback, |
| 293 const ErrorCallback& error_callback) { | 293 const ErrorCallback& error_callback) { |
| 294 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 294 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
| 295 DCHECK(!device_file_path.empty()); | 295 DCHECK(!device_file_path.empty()); |
| 296 std::string device_file_relative_path = | 296 std::string device_file_relative_path = |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 task_in_progress_ = false; | 507 task_in_progress_ = false; |
| 508 ProcessNextPendingRequest(); | 508 ProcessNextPendingRequest(); |
| 509 } | 509 } |
| 510 | 510 |
| 511 void CreateMTPDeviceAsyncDelegate( | 511 void CreateMTPDeviceAsyncDelegate( |
| 512 const std::string& device_location, | 512 const std::string& device_location, |
| 513 const CreateMTPDeviceAsyncDelegateCallback& callback) { | 513 const CreateMTPDeviceAsyncDelegateCallback& callback) { |
| 514 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 514 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
| 515 callback.Run(new MTPDeviceDelegateImplLinux(device_location)); | 515 callback.Run(new MTPDeviceDelegateImplLinux(device_location)); |
| 516 } | 516 } |
| OLD | NEW |