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

Issue 291333006: Adds removable-drive listing 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, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org, stephenlin1
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Adds removable-drive listing for OS X. Listing disks on OS X is very similar to components/storage_monitor/storage_monitor.h except that we want to list all whole-drives and not just mountable volumes. The code here basically follows that code, but with minor changes. Since the Disk Arbitration code is so stateful and involves so many callbacks I created an internal class to handle the state without changing the interface. BUG=376382 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=276927

Patch Set 1 #

Patch Set 2 : Refactors (again) and adds a few unit tests. #

Patch Set 3 : Removes unnecessary changes. #

Total comments: 20

Patch Set 4 : Cleans up naming, files and tests. #

Patch Set 5 : A few small wording cleanups. #

Patch Set 6 : Minor rename and fixes ordering of deletion. #

Patch Set 7 : Fixes missed rename in the test. #

Total comments: 18

Patch Set 8 : More cleanup, mostly tests. #

Total comments: 2

Patch Set 9 : Rewrite to use IOKit, greatly simplifying this CL. #

Total comments: 18

Patch Set 10 : Removes references to DiskArbitration from RemovableStorageProvider for mac. #

Patch Set 11 : A little more cleanup. #

Total comments: 4

Patch Set 12 : Changes some failure conditions to continue instead. #

Total comments: 5

Patch Set 13 : Adds AssertIOAllowed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -1 line) Patch
M chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +83 lines, -1 line 0 comments Download

Messages

Total messages: 21 (0 generated)
Drew Haven
Robert and Rachel, Here's the version of the device-listing code that I have for Mac. ...
6 years, 6 months ago (2014-05-31 01:21:53 UTC) #1
Robert Sesek
Some high-level comments to get started. This is not what we discussed over email. This ...
6 years, 6 months ago (2014-06-02 19:56:05 UTC) #2
Drew Haven
Thanks for taking the time to review this. This isn't quite what we were talking ...
6 years, 6 months ago (2014-06-03 02:03:23 UTC) #3
groby-ooo-7-16
rsesek definitely knows this better than I do - taking myself off reviewer list, unless ...
6 years, 6 months ago (2014-06-04 18:41:09 UTC) #4
Robert Sesek
https://codereview.chromium.org/291333006/diff/40001/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc File chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc (right): https://codereview.chromium.org/291333006/diff/40001/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc#newcode52 chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc:52: content::BrowserThread::PostTask( On 2014/06/03 02:03:23, Drew Haven wrote: > On ...
6 years, 6 months ago (2014-06-04 19:10:42 UTC) #5
Drew Haven
https://codereview.chromium.org/291333006/diff/40001/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc File chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc (right): https://codereview.chromium.org/291333006/diff/40001/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc#newcode52 chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc:52: content::BrowserThread::PostTask( On 2014/06/04 19:10:43, rsesek wrote: > On 2014/06/03 ...
6 years, 6 months ago (2014-06-05 01:52:49 UTC) #6
Drew Haven
Ping. Also, see new comment. https://codereview.chromium.org/291333006/diff/40001/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc File chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc (right): https://codereview.chromium.org/291333006/diff/40001/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc#newcode52 chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc:52: content::BrowserThread::PostTask( On 2014/06/05 01:52:50, ...
6 years, 6 months ago (2014-06-09 23:13:02 UTC) #7
Robert Sesek
https://codereview.chromium.org/291333006/diff/40001/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc File chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc (right): https://codereview.chromium.org/291333006/diff/40001/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc#newcode52 chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc:52: content::BrowserThread::PostTask( On 2014/06/09 23:13:02, Drew Haven wrote: > On ...
6 years, 6 months ago (2014-06-10 20:52:23 UTC) #8
Drew Haven
On 2014/06/10 20:52:23, rsesek wrote: > https://codereview.chromium.org/291333006/diff/40001/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc > File > chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc > (right): > > ...
6 years, 6 months ago (2014-06-10 23:21:18 UTC) #9
Robert Sesek
This is _much_ simpler now, but it can be even more so. https://codereview.chromium.org/291333006/diff/200001/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc File chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc ...
6 years, 6 months ago (2014-06-11 16:54:58 UTC) #10
Drew Haven
So, I altered the behavior a little bit in this change. I stopped checking for ...
6 years, 6 months ago (2014-06-11 21:48:13 UTC) #11
Robert Sesek
Very nice! Last few comments. https://codereview.chromium.org/291333006/diff/200001/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc File chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc (right): https://codereview.chromium.org/291333006/diff/200001/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc#newcode89 chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc:89: DADiskCreateFromIOMedia(NULL, session, disk_obj)); On ...
6 years, 6 months ago (2014-06-12 13:56:07 UTC) #12
Drew Haven
https://codereview.chromium.org/291333006/diff/240001/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc File chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc (right): https://codereview.chromium.org/291333006/diff/240001/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc#newcode70 chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc:70: LOG(ERROR) << "Unable to find device characteristics."; On 2014/06/12 ...
6 years, 6 months ago (2014-06-12 20:45:03 UTC) #13
Robert Sesek
Argh, missed this last item on the last round. https://codereview.chromium.org/291333006/diff/260001/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc File chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc (right): https://codereview.chromium.org/291333006/diff/260001/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc#newcode25 chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc:25: ...
6 years, 6 months ago (2014-06-12 20:53:39 UTC) #14
Drew Haven
https://codereview.chromium.org/291333006/diff/260001/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc File chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc (right): https://codereview.chromium.org/291333006/diff/260001/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc#newcode25 chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc:25: CFMutableDictionaryRef matching = IOServiceMatching(kIOMediaClass); On 2014/06/12 20:53:39, rsesek wrote: ...
6 years, 6 months ago (2014-06-12 21:10:30 UTC) #15
Robert Sesek
LGTM https://codereview.chromium.org/291333006/diff/260001/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc File chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc (right): https://codereview.chromium.org/291333006/diff/260001/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc#newcode25 chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc:25: CFMutableDictionaryRef matching = IOServiceMatching(kIOMediaClass); On 2014/06/12 21:10:30, Drew ...
6 years, 6 months ago (2014-06-12 21:14:21 UTC) #16
Robert Sesek
https://codereview.chromium.org/291333006/diff/260001/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc File chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc (right): https://codereview.chromium.org/291333006/diff/260001/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc#newcode22 chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc:22: bool RemovableStorageProvider::PopulateDeviceList( Also, you should add a base::ThreadRestrictions::AssertIOAllowed() here. ...
6 years, 6 months ago (2014-06-12 21:46:12 UTC) #17
Drew Haven
https://codereview.chromium.org/291333006/diff/260001/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc File chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc (right): https://codereview.chromium.org/291333006/diff/260001/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc#newcode22 chrome/browser/extensions/api/image_writer_private/removable_storage_provider_mac.cc:22: bool RemovableStorageProvider::PopulateDeviceList( On 2014/06/12 21:46:12, rsesek wrote: > Also, ...
6 years, 6 months ago (2014-06-12 23:08:59 UTC) #18
Drew Haven
The CQ bit was checked by haven@chromium.org
6 years, 6 months ago (2014-06-12 23:09:04 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/haven@chromium.org/291333006/280001
6 years, 6 months ago (2014-06-12 23:11:43 UTC) #20
commit-bot: I haz the power
6 years, 6 months ago (2014-06-13 04:56:38 UTC) #21
Message was sent while issue was closed.
Change committed as 276927

Powered by Google App Engine
This is Rietveld 408576698