Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Issue 294163008: Adds USB writing for OS X. (Closed)

Created:
6 years, 7 months ago by Drew Haven
Modified:
6 years, 6 months ago
Reviewers:
Robert Sesek
CC:
chromium-reviews, stephenlin1
Base URL:
https://chromium.googlesource.com/chromium/src.git@list-devices
Visibility:
Public.

Description

Adds USB writing for OS X. To support imageWriterPrivate on Mac for the Chromebook Recovery Tool we will have to write to USB drives on Mac. OS X allows us to open a single FD with elevated privileges through running the authopen command. Unmounting and claiming the disk are a bit more complicated as they require use of the Disk Arbitration framework. Disk Arbitration is an asynchronous interface. In order to simplify the code we use a mutex to block. The core logic is derived from the previous recovery tool. See googleclient/chrome/chromeos_recovery/mac/ChromeOSRecovery/AppController.mm in the internal Google repositories. BUG=376398 BUG=318451 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=278194

Patch Set 1 #

Patch Set 2 : Uses the runloop to properly do unmounting. #

Patch Set 3 : Cleanup and refactoring. #

Patch Set 4 : Merges and cleanup. #

Patch Set 5 : Cleans out unnecessary changes. #

Patch Set 6 : Fixes windows impl to new function signatures. #

Total comments: 18

Patch Set 7 : Moves DiskUnmounter to DiskUnmounterMac and it's own files. #

Patch Set 8 : Cleanup in DiskUnmounterMac. #

Total comments: 2

Patch Set 9 : Creates a location for code shared between browser and utility process. #

Total comments: 14

Patch Set 10 : Cleans up the OpenDevice call, removes unnecessary files. #

Total comments: 17

Patch Set 11 : Minor updates. #

Total comments: 18

Patch Set 12 : Removes nits, sets recv buffer size correctly. #

Total comments: 2

Patch Set 13 : Adds missing braces. #

Patch Set 14 : Removes unnecessary Mac includes in ImageWriterHandler. #

Patch Set 15 : Fixes return values on ImageWriter platform-specific functions. #

Patch Set 16 : Fixes windows compilation. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+417 lines, -40 lines) Patch
M chrome/chrome_utility.gypi View 1 2 3 4 5 6 2 chunks +4 lines, -1 line 0 comments Download
A chrome/utility/image_writer/disk_unmounter_mac.h View 1 2 3 4 5 6 7 8 9 1 chunk +74 lines, -0 lines 0 comments Download
A chrome/utility/image_writer/disk_unmounter_mac.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +125 lines, -0 lines 0 comments Download
M chrome/utility/image_writer/image_writer.h View 1 2 3 4 5 6 5 chunks +14 lines, -6 lines 0 comments Download
M chrome/utility/image_writer/image_writer.cc View 1 2 3 4 5 6 2 chunks +7 lines, -19 lines 0 comments Download
M chrome/utility/image_writer/image_writer_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +4 lines, -7 lines 0 comments Download
A chrome/utility/image_writer/image_writer_mac.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +159 lines, -0 lines 0 comments Download
M chrome/utility/image_writer/image_writer_stub.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +10 lines, -2 lines 0 comments Download
M chrome/utility/image_writer/image_writer_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +20 lines, -5 lines 0 comments Download

Messages

Total messages: 26 (0 generated)
Drew Haven
Robert, Here's the actual writing code we talked about. It uses a similar pattern of ...
6 years, 6 months ago (2014-06-05 18:16:43 UTC) #1
Robert Sesek
Yes, this is in pretty good shape. It looks like you may have crossed two ...
6 years, 6 months ago (2014-06-05 19:49:49 UTC) #2
Drew Haven
See question about IsValidDevice https://codereview.chromium.org/294163008/diff/100001/chrome/utility/image_writer/image_writer_mac.cc File chrome/utility/image_writer/image_writer_mac.cc (right): https://codereview.chromium.org/294163008/diff/100001/chrome/utility/image_writer/image_writer_mac.cc#newcode63 chrome/utility/image_writer/image_writer_mac.cc:63: CFStringRef reason = CFSTR( On ...
6 years, 6 months ago (2014-06-05 22:28:28 UTC) #3
Robert Sesek
https://codereview.chromium.org/294163008/diff/100001/chrome/utility/image_writer/image_writer_mac.cc File chrome/utility/image_writer/image_writer_mac.cc (right): https://codereview.chromium.org/294163008/diff/100001/chrome/utility/image_writer/image_writer_mac.cc#newcode120 chrome/utility/image_writer/image_writer_mac.cc:120: bool ImageWriter::IsValidDevice() { On 2014/06/05 22:28:27, Drew Haven wrote: ...
6 years, 6 months ago (2014-06-06 18:34:06 UTC) #4
Drew Haven
https://codereview.chromium.org/294163008/diff/100001/chrome/utility/image_writer/image_writer_mac.cc File chrome/utility/image_writer/image_writer_mac.cc (right): https://codereview.chromium.org/294163008/diff/100001/chrome/utility/image_writer/image_writer_mac.cc#newcode120 chrome/utility/image_writer/image_writer_mac.cc:120: bool ImageWriter::IsValidDevice() { On 2014/06/06 18:34:06, rsesek wrote: > ...
6 years, 6 months ago (2014-06-10 01:13:26 UTC) #5
Robert Sesek
https://codereview.chromium.org/294163008/diff/180001/chrome/common/extensions/image_writer/image_writer_test_util_mac.h File chrome/common/extensions/image_writer/image_writer_test_util_mac.h (right): https://codereview.chromium.org/294163008/diff/180001/chrome/common/extensions/image_writer/image_writer_test_util_mac.h#newcode18 chrome/common/extensions/image_writer/image_writer_test_util_mac.h:18: typedef enum DriveType { In C++, just |enum DriveType| ...
6 years, 6 months ago (2014-06-10 19:47:47 UTC) #6
Robert Sesek
This design is in pretty good shape now, most of the comments are focused on ...
6 years, 6 months ago (2014-06-10 19:48:08 UTC) #7
Drew Haven
https://codereview.chromium.org/294163008/diff/180001/chrome/common/extensions/image_writer/image_writer_test_util_mac.h File chrome/common/extensions/image_writer/image_writer_test_util_mac.h (right): https://codereview.chromium.org/294163008/diff/180001/chrome/common/extensions/image_writer/image_writer_test_util_mac.h#newcode18 chrome/common/extensions/image_writer/image_writer_test_util_mac.h:18: typedef enum DriveType { On 2014/06/10 19:47:46, rsesek wrote: ...
6 years, 6 months ago (2014-06-12 02:24:27 UTC) #8
Robert Sesek
https://codereview.chromium.org/294163008/diff/200001/chrome/utility/image_writer/image_writer_mac.cc File chrome/utility/image_writer/image_writer_mac.cc (right): https://codereview.chromium.org/294163008/diff/200001/chrome/utility/image_writer/image_writer_mac.cc#newcode20 chrome/utility/image_writer/image_writer_mac.cc:20: static const char* kAuthOpenPath = "/usr/libexec/authopen"; Use const char ...
6 years, 6 months ago (2014-06-12 22:01:35 UTC) #9
Drew Haven
https://codereview.chromium.org/294163008/diff/200001/chrome/utility/image_writer/image_writer_mac.cc File chrome/utility/image_writer/image_writer_mac.cc (right): https://codereview.chromium.org/294163008/diff/200001/chrome/utility/image_writer/image_writer_mac.cc#newcode20 chrome/utility/image_writer/image_writer_mac.cc:20: static const char* kAuthOpenPath = "/usr/libexec/authopen"; On 2014/06/12 22:01:34, ...
6 years, 6 months ago (2014-06-12 22:55:10 UTC) #10
Drew Haven
Ping? I'm hoping this is getting into good shape and we can get it all ...
6 years, 6 months ago (2014-06-16 18:23:38 UTC) #11
Robert Sesek
On 2014/06/16 18:23:38, Drew Haven wrote: > Ping? > > I'm hoping this is getting ...
6 years, 6 months ago (2014-06-16 19:32:54 UTC) #12
Drew Haven
No worries about the energy problems. It happens. I find myself feeling the same way ...
6 years, 6 months ago (2014-06-16 21:51:39 UTC) #13
Robert Sesek
LGTM w/ a nit https://codereview.chromium.org/294163008/diff/240001/chrome/utility/image_writer/image_writer_mac.cc File chrome/utility/image_writer/image_writer_mac.cc (right): https://codereview.chromium.org/294163008/diff/240001/chrome/utility/image_writer/image_writer_mac.cc#newcode138 chrome/utility/image_writer/image_writer_mac.cc:138: fd = *reinterpret_cast<int*>(CMSG_DATA(cmsg_socket_header)); nit: braces ...
6 years, 6 months ago (2014-06-16 22:15:21 UTC) #14
Drew Haven
https://codereview.chromium.org/294163008/diff/240001/chrome/utility/image_writer/image_writer_mac.cc File chrome/utility/image_writer/image_writer_mac.cc (right): https://codereview.chromium.org/294163008/diff/240001/chrome/utility/image_writer/image_writer_mac.cc#newcode138 chrome/utility/image_writer/image_writer_mac.cc:138: fd = *reinterpret_cast<int*>(CMSG_DATA(cmsg_socket_header)); On 2014/06/16 22:15:21, rsesek wrote: > ...
6 years, 6 months ago (2014-06-17 00:00:45 UTC) #15
Drew Haven
The CQ bit was checked by haven@chromium.org
6 years, 6 months ago (2014-06-17 01:36:35 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/haven@chromium.org/294163008/300001
6 years, 6 months ago (2014-06-17 01:40:20 UTC) #17
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-17 10:30:50 UTC) #18
commit-bot: I haz the power
Try jobs failed on following builders: win_gpu on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/win_gpu/builds/20960)
6 years, 6 months ago (2014-06-17 10:30:51 UTC) #19
Drew Haven
The CQ bit was checked by haven@chromium.org
6 years, 6 months ago (2014-06-17 21:49:57 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/haven@chromium.org/294163008/320001
6 years, 6 months ago (2014-06-17 21:51:24 UTC) #21
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 6 months ago (2014-06-18 09:25:34 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/win_chromium_rel/builds/28848)
6 years, 6 months ago (2014-06-18 09:25:35 UTC) #23
Drew Haven
The CQ bit was checked by haven@chromium.org
6 years, 6 months ago (2014-06-18 17:52:34 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/haven@chromium.org/294163008/320001
6 years, 6 months ago (2014-06-18 17:54:00 UTC) #25
commit-bot: I haz the power
6 years, 6 months ago (2014-06-18 23:47:37 UTC) #26
Message was sent while issue was closed.
Change committed as 278194

Powered by Google App Engine
This is Rietveld 408576698