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 { | |
10 | |
11 /////////////////////////////////////////////////////////////////////////////// | 9 /////////////////////////////////////////////////////////////////////////////// |
12 // SnapshotRequestInfo // | 10 // SnapshotRequestInfo // |
13 /////////////////////////////////////////////////////////////////////////////// | 11 /////////////////////////////////////////////////////////////////////////////// |
14 | 12 |
15 SnapshotRequestInfo::SnapshotRequestInfo( | 13 SnapshotRequestInfo::SnapshotRequestInfo( |
16 const base::FilePath& device_file_path, | 14 const base::FilePath& device_file_path, |
17 const base::FilePath& snapshot_file_path, | 15 const base::FilePath& snapshot_file_path, |
18 const MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback& | 16 const MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback& |
19 success_callback, | 17 success_callback, |
20 const MTPDeviceAsyncDelegate::ErrorCallback& error_callback) | 18 const MTPDeviceAsyncDelegate::ErrorCallback& error_callback) |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 58 |
61 bool SnapshotFileDetails::AddBytesWritten(DWORD bytes_written) { | 59 bool SnapshotFileDetails::AddBytesWritten(DWORD bytes_written) { |
62 if ((bytes_written == 0) || | 60 if ((bytes_written == 0) || |
63 (bytes_written_ > kuint64max - bytes_written) || | 61 (bytes_written_ > kuint64max - bytes_written) || |
64 (bytes_written_ + bytes_written > file_info_.size)) | 62 (bytes_written_ + bytes_written > file_info_.size)) |
65 return false; | 63 return false; |
66 | 64 |
67 bytes_written_ += bytes_written; | 65 bytes_written_ += bytes_written; |
68 return true; | 66 return true; |
69 } | 67 } |
70 | |
71 } // namespace chrome | |
OLD | NEW |