| 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 "chrome/browser/media_galleries/win/snapshot_file_details.h" | 5 #include "chrome/browser/media_galleries/win/snapshot_file_details.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 | 8 |
| 9 namespace chrome { | 9 namespace chrome { |
| 10 | 10 |
| 11 using fileapi::MTPDeviceAsyncDelegate; | |
| 12 | |
| 13 /////////////////////////////////////////////////////////////////////////////// | 11 /////////////////////////////////////////////////////////////////////////////// |
| 14 // SnapshotRequestInfo // | 12 // SnapshotRequestInfo // |
| 15 /////////////////////////////////////////////////////////////////////////////// | 13 /////////////////////////////////////////////////////////////////////////////// |
| 16 | 14 |
| 17 SnapshotRequestInfo::SnapshotRequestInfo( | 15 SnapshotRequestInfo::SnapshotRequestInfo( |
| 18 const base::FilePath& device_file_path, | 16 const base::FilePath& device_file_path, |
| 19 const base::FilePath& snapshot_file_path, | 17 const base::FilePath& snapshot_file_path, |
| 20 const MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback& | 18 const MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback& |
| 21 success_callback, | 19 success_callback, |
| 22 const MTPDeviceAsyncDelegate::ErrorCallback& error_callback) | 20 const MTPDeviceAsyncDelegate::ErrorCallback& error_callback) |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 if ((bytes_written == 0) || | 62 if ((bytes_written == 0) || |
| 65 (bytes_written_ > kuint64max - bytes_written) || | 63 (bytes_written_ > kuint64max - bytes_written) || |
| 66 (bytes_written_ + bytes_written > file_info_.size)) | 64 (bytes_written_ + bytes_written > file_info_.size)) |
| 67 return false; | 65 return false; |
| 68 | 66 |
| 69 bytes_written_ += bytes_written; | 67 bytes_written_ += bytes_written; |
| 70 return true; | 68 return true; |
| 71 } | 69 } |
| 72 | 70 |
| 73 } // namespace chrome | 71 } // namespace chrome |
| OLD | NEW |