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 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_READ_FILE_WORKER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_READ_FILE_WORKER_H_ |
6 #define CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_READ_FILE_WORKER_H_ | 6 #define CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_READ_FILE_WORKER_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include <string> | 10 #include <string> |
9 | 11 |
10 #include "base/callback.h" | 12 #include "base/callback.h" |
11 #include "base/files/file.h" | 13 #include "base/files/file.h" |
| 14 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
14 | 17 |
15 namespace base { | 18 namespace base { |
16 class FilePath; | 19 class FilePath; |
17 } | 20 } |
18 | 21 |
19 class SnapshotFileDetails; | 22 class SnapshotFileDetails; |
20 struct SnapshotRequestInfo; | 23 struct SnapshotRequestInfo; |
21 | 24 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 71 |
69 // Called when the data chunk is written to the | 72 // Called when the data chunk is written to the |
70 // |snapshot_file_details_.snapshot_file_path|. | 73 // |snapshot_file_details_.snapshot_file_path|. |
71 // | 74 // |
72 // If the write operation succeeds, |bytes_written| is set to a non-zero | 75 // If the write operation succeeds, |bytes_written| is set to a non-zero |
73 // value. | 76 // value. |
74 // | 77 // |
75 // If the write operation fails, |bytes_written| is set to zero. | 78 // If the write operation fails, |bytes_written| is set to zero. |
76 void OnDidWriteDataChunkIntoSnapshotFile( | 79 void OnDidWriteDataChunkIntoSnapshotFile( |
77 scoped_ptr<SnapshotFileDetails> snapshot_file_details, | 80 scoped_ptr<SnapshotFileDetails> snapshot_file_details, |
78 uint32 bytes_written); | 81 uint32_t bytes_written); |
79 | 82 |
80 // The device unique identifier to query the device. | 83 // The device unique identifier to query the device. |
81 const std::string device_handle_; | 84 const std::string device_handle_; |
82 | 85 |
83 // For callbacks that may run after destruction. | 86 // For callbacks that may run after destruction. |
84 base::WeakPtrFactory<MTPReadFileWorker> weak_ptr_factory_; | 87 base::WeakPtrFactory<MTPReadFileWorker> weak_ptr_factory_; |
85 | 88 |
86 DISALLOW_COPY_AND_ASSIGN(MTPReadFileWorker); | 89 DISALLOW_COPY_AND_ASSIGN(MTPReadFileWorker); |
87 }; | 90 }; |
88 | 91 |
89 #endif // CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_READ_FILE_WORKER_H_ | 92 #endif // CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_READ_FILE_WORKER_H_ |
OLD | NEW |