| Index: chrome/utility/image_writer/image_writer.cc
|
| diff --git a/chrome/utility/image_writer/image_writer.cc b/chrome/utility/image_writer/image_writer.cc
|
| index 13175d7624f043327460e672e36221b2b9576ba3..65994dbcb6a89fe8b9178443e1fcbe7f21b4feda 100644
|
| --- a/chrome/utility/image_writer/image_writer.cc
|
| +++ b/chrome/utility/image_writer/image_writer.cc
|
| @@ -2,12 +2,17 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include "chrome/utility/image_writer/image_writer.h"
|
| +
|
| #include "base/memory/aligned_memory.h"
|
| #include "chrome/utility/image_writer/error_messages.h"
|
| -#include "chrome/utility/image_writer/image_writer.h"
|
| #include "chrome/utility/image_writer/image_writer_handler.h"
|
| #include "content/public/utility/utility_thread.h"
|
|
|
| +#if defined(OS_MACOSX)
|
| +#include "chrome/utility/image_writer/disk_unmounter_mac.h"
|
| +#endif
|
| +
|
| namespace image_writer {
|
|
|
| // Since block devices like large sequential access and IPC is expensive we're
|
| @@ -90,24 +95,7 @@ bool ImageWriter::InitializeFiles() {
|
| }
|
|
|
| if (!device_file_.IsValid()) {
|
| -#if defined(OS_WIN)
|
| - // Windows requires that device files be opened with FILE_FLAG_NO_BUFFERING
|
| - // and FILE_FLAG_WRITE_THROUGH. These two flags are not part of base::File.
|
| - device_file_ =
|
| - base::File(CreateFile(device_path_.value().c_str(),
|
| - GENERIC_READ | GENERIC_WRITE,
|
| - FILE_SHARE_READ | FILE_SHARE_WRITE,
|
| - NULL,
|
| - OPEN_EXISTING,
|
| - FILE_FLAG_NO_BUFFERING | FILE_FLAG_WRITE_THROUGH,
|
| - NULL));
|
| -#else
|
| - device_file_.Initialize(
|
| - device_path_,
|
| - base::File::FLAG_OPEN | base::File::FLAG_READ | base::File::FLAG_WRITE |
|
| - base::File::FLAG_EXCLUSIVE_READ | base::File::FLAG_EXCLUSIVE_WRITE);
|
| -#endif
|
| - if (!device_file_.IsValid()) {
|
| + if (!OpenDevice()) {
|
| Error(error::kOpenDevice);
|
| return false;
|
| }
|
|
|