#ifndef CHROME_BROWSER_MEDIA_GALLERIES_WIN_SNAPSHOT_FILE_DETAILS_H_
#define CHROME_BROWSER_MEDIA_GALLERIES_WIN_SNAPSHOT_FILE_DETAILS_H_
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/win/scoped_comptr.h"
#include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h"
struct SnapshotRequestInfo {
SnapshotRequestInfo(
const base::FilePath& device_file_path,
const base::FilePath& snapshot_file_path,
const MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback&
success_callback,
const MTPDeviceAsyncDelegate::ErrorCallback& error_callback);
base::FilePath device_file_path;
base::FilePath snapshot_file_path;
MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback
success_callback;
MTPDeviceAsyncDelegate::ErrorCallback error_callback;
};
class SnapshotFileDetails {
public:
explicit SnapshotFileDetails(const SnapshotRequestInfo& request_info);
~SnapshotFileDetails();
void set_file_info(const base::File::Info& file_info);
void set_device_file_stream(IStream* file_stream);
void set_optimal_transfer_size(DWORD optimal_transfer_size);
SnapshotRequestInfo request_info() const {
return request_info_;
}
base::File::Info file_info() const {
return file_info_;
}
IStream* device_file_stream() const {
return file_stream_.get();
}
DWORD optimal_transfer_size() const {
return optimal_transfer_size_;
}
bool IsSnapshotFileWriteComplete() const;
bool AddBytesWritten(DWORD bytes_written);
private:
SnapshotRequestInfo request_info_;
base::File::Info file_info_;
base::win::ScopedComPtr<IStream> file_stream_;
DWORD optimal_transfer_size_;
DWORD bytes_written_;
};
#endif