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

Issue 61643015: Adds imageWriterPrivate support for Windows (Closed)

Created:
7 years, 1 month ago by Drew Haven
Modified:
6 years, 10 months ago
CC:
chromium-reviews, stephenlin, jam
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

In order to support writing on windows we need to take advantage of the new privileged operation in the utility thread. This code overlaps heavily with the Linux and OS X code, so all the writing for those is moved as well. BUG= Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=252466

Patch Set 1 #

Patch Set 2 : Finishes moving image-writer code to utility thread. #

Patch Set 3 : Reorganization and test updates. #

Total comments: 14

Patch Set 4 : Fixes file that got left out of last CL. #

Patch Set 5 : Updated namespaces, documentation and file paths. #

Patch Set 6 : Feedback and test updates. #

Patch Set 7 : Cleans up testing, implementation and formatting. #

Patch Set 8 : Cleanup and now working on Windows with minimal changes. #

Total comments: 10

Patch Set 9 : Review feedback and cleanup, specifically on ImageWriter and ImageWriterHandler relationship. #

Total comments: 6

Patch Set 10 : Fixes comment. #

Total comments: 52

Patch Set 11 : Adds comments to chrome_utility_messages.h #

Total comments: 2

Patch Set 12 : Moves ImageWriterClient to image_writer_private/ImageWriterUtilityClient. #

Patch Set 13 : Review feedback. #

Total comments: 6

Patch Set 14 : More review feedback. #

Patch Set 15 : Removes unnecessary check in test code. #

Patch Set 16 : Rebase onto master #

Patch Set 17 : Test cleanup and cross-platform fixes. #

Patch Set 18 : Fixes ordering on test cleanup. #

Patch Set 19 : Fixes test cleanup ordering for Chrome OS. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1450 lines, -368 lines) Patch
M chrome/browser/extensions/api/image_writer_private/destroy_partitions_operation.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +7 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/image_writer_private/destroy_partitions_operation_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +20 lines, -26 lines 0 comments Download
A chrome/browser/extensions/api/image_writer_private/image_writer_utility_client.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +87 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/image_writer_private/image_writer_utility_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +158 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/image_writer_private/operation.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +23 lines, -13 lines 0 comments Download
M chrome/browser/extensions/api/image_writer_private/operation.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 7 chunks +53 lines, -20 lines 0 comments Download
D chrome/browser/extensions/api/image_writer_private/operation_linux.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +0 lines, -195 lines 0 comments Download
D chrome/browser/extensions/api/image_writer_private/operation_mac.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +0 lines, -20 lines 0 comments Download
M chrome/browser/extensions/api/image_writer_private/operation_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 11 4 chunks +28 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/image_writer_private/operation_nonchromeos.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +76 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/image_writer_private/operation_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 5 chunks +62 lines, -56 lines 0 comments Download
D chrome/browser/extensions/api/image_writer_private/operation_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +0 lines, -20 lines 0 comments Download
M chrome/browser/extensions/api/image_writer_private/test_utils.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +44 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/image_writer_private/test_utils.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +73 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/image_writer_private/write_from_file_operation.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +12 lines, -6 lines 0 comments Download
M chrome/browser/extensions/api/image_writer_private/write_from_file_operation_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +22 lines, -4 lines 0 comments Download
M chrome/chrome.gyp View 1 2 3 4 5 6 7 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/chrome_browser_extensions.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/chrome_utility_messages.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +26 lines, -0 lines 0 comments Download
M chrome/utility/chrome_content_utility_client.cc View 1 2 3 4 5 6 7 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/utility/chrome_content_utility_ipc_whitelist.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +4 lines, -1 line 0 comments Download
A + chrome/utility/image_writer/OWNERS View 1 2 3 4 5 6 0 chunks +-1 lines, --1 lines 0 comments Download
A chrome/utility/image_writer/error_messages.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +27 lines, -0 lines 0 comments Download
A chrome/utility/image_writer/error_messages.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +24 lines, -0 lines 0 comments Download
A chrome/utility/image_writer/image_writer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +63 lines, -0 lines 0 comments Download
A chrome/utility/image_writer/image_writer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +244 lines, -0 lines 0 comments Download
A chrome/utility/image_writer/image_writer_handler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +51 lines, -0 lines 0 comments Download
A chrome/utility/image_writer/image_writer_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +151 lines, -0 lines 0 comments Download
A chrome/utility/image_writer/image_writer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +182 lines, -0 lines 0 comments Download

Messages

Total messages: 47 (0 generated)
Drew Haven
John, Here's my initial attempt at organizing things so that the image-writing code is in ...
7 years, 1 month ago (2013-11-20 01:12:16 UTC) #1
jam
Can you get someone from the extensions team to review the extensions changes, and also ...
7 years, 1 month ago (2013-11-21 19:35:28 UTC) #2
jam
https://codereview.chromium.org/61643015/diff/60001/chrome/browser/extensions/api/image_writer_private/operation.h File chrome/browser/extensions/api/image_writer_private/operation.h (right): https://codereview.chromium.org/61643015/diff/60001/chrome/browser/extensions/api/image_writer_private/operation.h#newcode64 chrome/browser/extensions/api/image_writer_private/operation.h:64: virtual void OnWriteImageSucceeded() OVERRIDE; nit: convention is to put ...
7 years, 1 month ago (2013-11-21 19:36:40 UTC) #3
haven(GOOGLE)
Thanks for the feedback so far. I understand the code is still a bit rough ...
7 years, 1 month ago (2013-11-21 19:47:30 UTC) #4
Drew Haven
Thanks for the feedback. I've gone through, addressed comments, cleaned up a lot of the ...
7 years ago (2013-11-26 02:10:42 UTC) #5
Matt Perry
Mostly LG, with a couple questions. https://codereview.chromium.org/61643015/diff/430001/chrome/browser/image_writer_client.cc File chrome/browser/image_writer_client.cc (right): https://codereview.chromium.org/61643015/diff/430001/chrome/browser/image_writer_client.cc#newcode53 chrome/browser/image_writer_client.cc:53: message_loop_proxy_->PostTask( Why is ...
6 years, 10 months ago (2014-02-14 00:16:23 UTC) #6
Drew Haven
Matt, Thanks for the review. Sorry about the delay. I did my best to clean ...
6 years, 10 months ago (2014-02-14 02:32:56 UTC) #7
Drew Haven
Jorge, Would you mind taking a look at this from a security standpoint? You'll see ...
6 years, 10 months ago (2014-02-14 02:35:22 UTC) #8
Drew Haven
FYI, I'd like to get this in for M34. Any tips to make sure that ...
6 years, 10 months ago (2014-02-14 18:05:32 UTC) #9
Matt Perry
Changes LGTM. Feel free to get OWNERS approval whenever. https://codereview.chromium.org/61643015/diff/480001/chrome/utility/image_writer/image_writer_handler.cc File chrome/utility/image_writer/image_writer_handler.cc (right): https://codereview.chromium.org/61643015/diff/480001/chrome/utility/image_writer/image_writer_handler.cc#newcode33 chrome/utility/image_writer/image_writer_handler.cc:33: ...
6 years, 10 months ago (2014-02-14 20:13:40 UTC) #10
Jorge Lucangeli Obes
Did you end up implementing checks for the destination device of the write? https://codereview.chromium.org/61643015/diff/480001/chrome/browser/extensions/api/image_writer_private/operation.h File ...
6 years, 10 months ago (2014-02-14 20:42:13 UTC) #11
Drew Haven
On 2014/02/14 20:42:13, Jorge Lucangeli Obes wrote: > Did you end up implementing checks for ...
6 years, 10 months ago (2014-02-14 21:34:33 UTC) #12
Jorge Lucangeli Obes
What about checking that you're not asked to write a file that's not the original ...
6 years, 10 months ago (2014-02-14 22:23:27 UTC) #13
Drew Haven
On 2014/02/14 22:23:27, Jorge Lucangeli Obes wrote: > What about checking that you're not asked ...
6 years, 10 months ago (2014-02-14 22:44:42 UTC) #14
Jorge Lucangeli Obes
On 2014/02/14 22:44:42, Drew Haven wrote: > On 2014/02/14 22:23:27, Jorge Lucangeli Obes wrote: > ...
6 years, 10 months ago (2014-02-14 22:51:05 UTC) #15
Drew Haven
Responded to comments. I have the update for that comment and some other small fixes ...
6 years, 10 months ago (2014-02-14 23:00:56 UTC) #16
Drew Haven
Julien, Here is what has become of that utility-process USB writing I mentioned to you ...
6 years, 10 months ago (2014-02-14 23:26:06 UTC) #17
Jorge Lucangeli Obes
chrome_content_utility_ipc_whitelist.cc LGTM
6 years, 10 months ago (2014-02-14 23:29:00 UTC) #18
Drew Haven
On 2014/02/14 22:51:05, Jorge Lucangeli Obes wrote: > On 2014/02/14 22:44:42, Drew Haven wrote: > ...
6 years, 10 months ago (2014-02-14 23:29:36 UTC) #19
Drew Haven
Lei, Here's that CL with the image-writer-in-utility-thread that I mentioned. Mind taking a look to ...
6 years, 10 months ago (2014-02-14 23:32:59 UTC) #20
Jorge Lucangeli Obes
https://codereview.chromium.org/61643015/diff/670001/chrome/common/chrome_utility_messages.h File chrome/common/chrome_utility_messages.h (right): https://codereview.chromium.org/61643015/diff/670001/chrome/common/chrome_utility_messages.h#newcode278 chrome/common/chrome_utility_messages.h:278: base::FilePath /* target file */) Please amend the comment ...
6 years, 10 months ago (2014-02-14 23:35:52 UTC) #21
Lei Zhang
Can we put chrome/browser/image_writer_client.* under chrome/browser/extensions somewhere? Reading the rest of the CL...
6 years, 10 months ago (2014-02-15 00:01:12 UTC) #22
Drew Haven
Jorge: comments added. https://codereview.chromium.org/61643015/diff/670001/chrome/common/chrome_utility_messages.h File chrome/common/chrome_utility_messages.h (right): https://codereview.chromium.org/61643015/diff/670001/chrome/common/chrome_utility_messages.h#newcode278 chrome/common/chrome_utility_messages.h:278: base::FilePath /* target file */) On ...
6 years, 10 months ago (2014-02-15 00:07:05 UTC) #23
Jorge Lucangeli Obes
chrome/common/chrome_utility_messages.h lgtm. https://codereview.chromium.org/61643015/diff/640003/chrome/common/chrome_utility_messages.h File chrome/common/chrome_utility_messages.h (right): https://codereview.chromium.org/61643015/diff/640003/chrome/common/chrome_utility_messages.h#newcode283 chrome/common/chrome_utility_messages.h:283: // was written to the target. As ...
6 years, 10 months ago (2014-02-15 00:13:59 UTC) #24
Lei Zhang
https://codereview.chromium.org/61643015/diff/670001/chrome/browser/extensions/api/image_writer_private/operation.cc File chrome/browser/extensions/api/image_writer_private/operation.cc (right): https://codereview.chromium.org/61643015/diff/670001/chrome/browser/extensions/api/image_writer_private/operation.cc#newcode201 chrome/browser/extensions/api/image_writer_private/operation.cc:201: int progress = kProgressComplete * curr_bytes / total_bytes; Can ...
6 years, 10 months ago (2014-02-15 00:26:59 UTC) #25
Lei Zhang
https://codereview.chromium.org/61643015/diff/670001/chrome/utility/image_writer/image_writer.cc File chrome/utility/image_writer/image_writer.cc (right): https://codereview.chromium.org/61643015/diff/670001/chrome/utility/image_writer/image_writer.cc#newcode134 chrome/utility/image_writer/image_writer.cc:134: bool ImageWriter::IsRunning() { nit: const method https://codereview.chromium.org/61643015/diff/670001/chrome/utility/image_writer/image_writer.cc#newcode174 chrome/utility/image_writer/image_writer.cc:174: bytes_processed_ ...
6 years, 10 months ago (2014-02-15 00:49:15 UTC) #26
Lei Zhang
https://codereview.chromium.org/61643015/diff/1260001/chrome/browser/extensions/api/image_writer_private/test_utils.cc File chrome/browser/extensions/api/image_writer_private/test_utils.cc (right): https://codereview.chromium.org/61643015/diff/1260001/chrome/browser/extensions/api/image_writer_private/test_utils.cc#newcode116 chrome/browser/extensions/api/image_writer_private/test_utils.cc:116: if (image_bytes_read == 0) This can't happen when you ...
6 years, 10 months ago (2014-02-15 01:07:25 UTC) #27
Drew Haven
Sending response to review so far. https://codereview.chromium.org/61643015/diff/670001/chrome/browser/extensions/api/image_writer_private/operation.cc File chrome/browser/extensions/api/image_writer_private/operation.cc (right): https://codereview.chromium.org/61643015/diff/670001/chrome/browser/extensions/api/image_writer_private/operation.cc#newcode201 chrome/browser/extensions/api/image_writer_private/operation.cc:201: int progress = ...
6 years, 10 months ago (2014-02-15 01:23:57 UTC) #28
Lei Zhang
lgtm I have not checked all the browser <-> utility interactions. I assume mpcomplete already ...
6 years, 10 months ago (2014-02-15 01:41:49 UTC) #29
Jorge Lucangeli Obes
https://codereview.chromium.org/61643015/diff/670001/chrome/browser/extensions/api/image_writer_private/operation.cc File chrome/browser/extensions/api/image_writer_private/operation.cc (right): https://codereview.chromium.org/61643015/diff/670001/chrome/browser/extensions/api/image_writer_private/operation.cc#newcode201 chrome/browser/extensions/api/image_writer_private/operation.cc:201: int progress = kProgressComplete * curr_bytes / total_bytes; On ...
6 years, 10 months ago (2014-02-15 01:43:18 UTC) #30
Drew Haven
https://codereview.chromium.org/61643015/diff/1260001/chrome/browser/extensions/api/image_writer_private/test_utils.cc File chrome/browser/extensions/api/image_writer_private/test_utils.cc (right): https://codereview.chromium.org/61643015/diff/1260001/chrome/browser/extensions/api/image_writer_private/test_utils.cc#newcode116 chrome/browser/extensions/api/image_writer_private/test_utils.cc:116: if (image_bytes_read == 0) On 2014/02/15 01:07:26, Lei Zhang ...
6 years, 10 months ago (2014-02-15 02:15:14 UTC) #31
Jorge Lucangeli Obes
On 2014/02/15 02:15:14, Drew Haven wrote: > https://codereview.chromium.org/61643015/diff/1260001/chrome/browser/extensions/api/image_writer_private/test_utils.cc > File chrome/browser/extensions/api/image_writer_private/test_utils.cc (right): > > https://codereview.chromium.org/61643015/diff/1260001/chrome/browser/extensions/api/image_writer_private/test_utils.cc#newcode116 ...
6 years, 10 months ago (2014-02-15 02:20:07 UTC) #32
Drew Haven
https://code.google.com/p/chromium/issues/detail?id=344117 On Fri, Feb 14, 2014 at 6:20 PM, <jorgelo@chromium.org> wrote: > On 2014/02/15 02:15:14, ...
6 years, 10 months ago (2014-02-15 03:14:23 UTC) #33
Drew Haven
Ping on final security sign-off. Perhaps if Julien is busy we can find someone else. ...
6 years, 10 months ago (2014-02-19 00:50:54 UTC) #34
jln (very slow on Chromium)
On 2014/02/19 00:50:54, Drew Haven wrote: > Ping on final security sign-off. Perhaps if Julien ...
6 years, 10 months ago (2014-02-19 01:07:38 UTC) #35
Drew Haven
Thank you, everyone! I wouldn't be able to do this without all the input from ...
6 years, 10 months ago (2014-02-19 01:15:22 UTC) #36
Drew Haven
The CQ bit was checked by haven@chromium.org
6 years, 10 months ago (2014-02-20 19:13:14 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/haven@chromium.org/61643015/1780002
6 years, 10 months ago (2014-02-20 19:14:14 UTC) #38
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-20 20:40:51 UTC) #39
commit-bot: I haz the power
Retried try job too often on linux_chromeos for step(s) unit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_chromeos&number=203940
6 years, 10 months ago (2014-02-20 20:40:52 UTC) #40
Drew Haven
The CQ bit was checked by haven@chromium.org
6 years, 10 months ago (2014-02-20 22:23:44 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/haven@chromium.org/61643015/2150001
6 years, 10 months ago (2014-02-20 22:24:25 UTC) #42
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-21 00:04:08 UTC) #43
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) content_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=267405
6 years, 10 months ago (2014-02-21 00:04:09 UTC) #44
Drew Haven
The CQ bit was checked by haven@chromium.org
6 years, 10 months ago (2014-02-21 01:06:11 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/haven@chromium.org/61643015/2150001
6 years, 10 months ago (2014-02-21 01:11:04 UTC) #46
commit-bot: I haz the power
6 years, 10 months ago (2014-02-21 02:28:38 UTC) #47
Message was sent while issue was closed.
Change committed as 252466

Powered by Google App Engine
This is Rietveld 408576698