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

Issue 875513006: Files.app: Implement md5 hashing over file streams. (Closed)

Created:
5 years, 10 months ago by Ben Kwa
Modified:
5 years, 10 months ago
Reviewers:
mtomasz, yoshiki
CC:
chromium-reviews, extensions-reviews_chromium.org, nkostylev+watch_chromium.org, rginda+watch_chromium.org, oshima+watch_chromium.org, chromium-apps-reviews_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Files.app: Implement md5 hashing over file streams. Add a class to deal with the streaming/digesting, and hook it up. File streams are usable in a wider range of scenarios (like over MTP) so this enables hashing in those situations. BUG=453880 Committed: https://crrev.com/eda76cb6f08db5d1d8dbb7a91959b080c56ccac9 Cr-Commit-Position: refs/heads/master@{#314576}

Patch Set 1 #

Total comments: 22

Patch Set 2 : Address feedback. Move I/O onto the IO thread. #

Total comments: 12

Patch Set 3 : Address feedback. #

Total comments: 2

Patch Set 4 : Add a DCHECK to verify that hash computation takes place on the IO thread. #

Total comments: 2

Patch Set 5 : Address feedback. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+138 lines, -12 lines) Patch
M chrome/browser/chromeos/extensions/file_manager/private_api_file_system.h View 1 2 2 chunks +8 lines, -1 line 0 comments Download
M chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc View 1 2 3 4 chunks +35 lines, -7 lines 0 comments Download
M chrome/browser/drive/drive_api_util.h View 1 2 3 chunks +41 lines, -0 lines 0 comments Download
M chrome/browser/drive/drive_api_util.cc View 1 2 3 4 5 chunks +54 lines, -4 lines 0 comments Download

Messages

Total messages: 23 (5 generated)
Ben Kwa
5 years, 10 months ago (2015-01-30 19:43:42 UTC) #2
mtomasz
https://codereview.chromium.org/875513006/diff/1/chrome/browser/drive/drive_api_util.cc File chrome/browser/drive/drive_api_util.cc (right): https://codereview.chromium.org/875513006/diff/1/chrome/browser/drive/drive_api_util.cc#newcode188 chrome/browser/drive/drive_api_util.cc:188: int result = reader_->Read(buffer_.get(), kBufferSize_, nit: const int https://codereview.chromium.org/875513006/diff/1/chrome/browser/drive/drive_api_util.cc#newcode188 ...
5 years, 10 months ago (2015-01-31 04:53:12 UTC) #3
Ben Kwa
Done. Reworking the I/O to occur on the IO thread was a fair bit of ...
5 years, 10 months ago (2015-02-02 22:22:12 UTC) #5
mtomasz
https://codereview.chromium.org/875513006/diff/40001/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc File chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc (right): https://codereview.chromium.org/875513006/diff/40001/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc#newcode742 chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc:742: scoped_refptr<drive::util::FileStreamMd5Digester> digester( You don't need to make it a ...
5 years, 10 months ago (2015-02-02 23:47:08 UTC) #6
Ben Kwa
https://codereview.chromium.org/875513006/diff/40001/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc File chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc (right): https://codereview.chromium.org/875513006/diff/40001/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc#newcode742 chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc:742: scoped_refptr<drive::util::FileStreamMd5Digester> digester( On 2015/02/02 23:47:07, mtomasz wrote: > You ...
5 years, 10 months ago (2015-02-03 06:28:55 UTC) #7
mtomasz
https://codereview.chromium.org/875513006/diff/40001/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc File chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc (right): https://codereview.chromium.org/875513006/diff/40001/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc#newcode742 chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc:742: scoped_refptr<drive::util::FileStreamMd5Digester> digester( On 2015/02/03 06:28:54, Ben Kwa wrote: > ...
5 years, 10 months ago (2015-02-03 10:36:54 UTC) #8
Ben Kwa
Done - PTAL. Thanks! https://codereview.chromium.org/875513006/diff/40001/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc File chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc (right): https://codereview.chromium.org/875513006/diff/40001/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc#newcode742 chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc:742: scoped_refptr<drive::util::FileStreamMd5Digester> digester( On 2015/02/03 10:36:53, ...
5 years, 10 months ago (2015-02-03 16:32:19 UTC) #9
mtomasz
lgtm with nit if no perf problems for large files on a slow chromebook. https://codereview.chromium.org/875513006/diff/60001/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc ...
5 years, 10 months ago (2015-02-04 01:32:30 UTC) #10
Ben Kwa
On 2015/02/04 01:32:30, mtomasz wrote: > lgtm with nit if no perf problems for large ...
5 years, 10 months ago (2015-02-04 15:32:18 UTC) #12
Ben Kwa
https://codereview.chromium.org/875513006/diff/60001/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc File chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc (right): https://codereview.chromium.org/875513006/diff/60001/chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc#newcode219 chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc:219: BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, On 2015/02/04 01:32:30, mtomasz wrote: > nit: ...
5 years, 10 months ago (2015-02-04 15:32:28 UTC) #13
Ben Kwa
Another performance note: Hashing the same file on the same device takes approximately 60s over ...
5 years, 10 months ago (2015-02-04 15:57:39 UTC) #14
yoshiki
lgtm with tiny nit. Thanks. https://codereview.chromium.org/875513006/diff/70001/chrome/browser/drive/drive_api_util.cc File chrome/browser/drive/drive_api_util.cc (right): https://codereview.chromium.org/875513006/diff/70001/chrome/browser/drive/drive_api_util.cc#newcode191 chrome/browser/drive/drive_api_util.cc:191: if (result != net::ERR_IO_PENDING) ...
5 years, 10 months ago (2015-02-04 16:33:57 UTC) #15
Ben Kwa
Done. Thanks! https://codereview.chromium.org/875513006/diff/70001/chrome/browser/drive/drive_api_util.cc File chrome/browser/drive/drive_api_util.cc (right): https://codereview.chromium.org/875513006/diff/70001/chrome/browser/drive/drive_api_util.cc#newcode191 chrome/browser/drive/drive_api_util.cc:191: if (result != net::ERR_IO_PENDING) { On 2015/02/04 ...
5 years, 10 months ago (2015-02-04 16:49:07 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/875513006/90001
5 years, 10 months ago (2015-02-04 16:50:15 UTC) #19
commit-bot: I haz the power
Committed patchset #5 (id:90001)
5 years, 10 months ago (2015-02-04 17:45:44 UTC) #20
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/eda76cb6f08db5d1d8dbb7a91959b080c56ccac9 Cr-Commit-Position: refs/heads/master@{#314576}
5 years, 10 months ago (2015-02-04 17:46:59 UTC) #21
brucedawson
The /analyze builder pointed out that FileStreamMd5Digester::OnChunkRead contains two variables called 'result'. One is an ...
5 years, 10 months ago (2015-02-06 02:03:36 UTC) #22
Ben Kwa
5 years, 10 months ago (2015-02-06 15:59:30 UTC) #23
Message was sent while issue was closed.
On 2015/02/06 02:03:36, brucedawson wrote:
> The /analyze builder pointed out that FileStreamMd5Digester::OnChunkRead
> contains two variables called 'result'. One is an 'int' and the other is a
> string.
> 
> There's no bug, but it is a bit... weird. Consider renaming one of them in a
> future change?

eew, thanks for pointing that out.  Will fix.

Powered by Google App Engine
This is Rietveld 408576698