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

Issue 2830743004: Extracting and unittesting PrepareDropDataForChildProcess function. (Closed)

Created:
3 years, 8 months ago by Łukasz Anforowicz
Modified:
3 years, 8 months ago
Reviewers:
ncarter (slow)
CC:
chromium-reviews, jam, darin-cc_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Extracting and unittesting PrepareDropDataForChildProcess function. This CL extracts PrepareDropDataForChildProcess out of RenderWidgetHostImpl::GrantFileAccessFromDropData into a standalone function. This allows newly added unit tests to provide |security_policy|, |child_id| and |file_system_context| without having a dependency on RenderProcessHostImpl and/or RenderWidgetHostImpl. This CL adds unit tests that PrepareDropDataForChildProcess works as expected for DropData::filenames and for DropData::file_system_files. The latter one is a regression test that would have prevented http://crbug.com/705295 from happening. BUG=705295 Review-Url: https://codereview.chromium.org/2830743004 Cr-Commit-Position: refs/heads/master@{#466883} Committed: https://chromium.googlesource.com/chromium/src/+/bf8f0b785a35a56c879f034013ea6210b9d2ed7c

Patch Set 1 #

Patch Set 2 : One more test + some minor test fixes and improvements. #

Patch Set 3 : Fixing build on Windows + adding a bit more test verifications. #

Total comments: 5

Patch Set 4 : Adding the helper in browser_file_system_helper.h rather than in child_process_security_policy_impl… #

Patch Set 5 : Rebasing... #

Patch Set 6 : git cl format #

Patch Set 7 : Self-review. #

Total comments: 8

Patch Set 8 : Adding a summary comment to PrepareDropDataForChildProcess as suggested in the CR feedback. #

Patch Set 9 : Windows requires testing with actual files (to make sure the paths are absolute). #

Patch Set 10 : Make sure Windows also uses absolute path when calling ExternalMountPoints::RegisterFileSystem. #

Patch Set 11 : Readding a summary comment to PrepareDropDataForChildProcess as suggested in the CR feedback... (it… #

Unified diffs Side-by-side diffs Delta from patch set Stats (+302 lines, -80 lines) Patch
M content/browser/fileapi/browser_file_system_helper.h View 1 2 3 4 5 6 7 9 10 2 chunks +20 lines, -0 lines 0 comments Download
M content/browser/fileapi/browser_file_system_helper.cc View 1 2 3 8 2 chunks +88 lines, -0 lines 0 comments Download
A content/browser/fileapi/browser_file_system_helper_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +187 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_impl.cc View 1 2 3 4 2 chunks +5 lines, -79 lines 0 comments Download
M content/test/BUILD.gn View 1 2 3 4 5 2 chunks +2 lines, -1 line 0 comments Download

Messages

Total messages: 32 (23 generated)
Łukasz Anforowicz
nick@, can you PTAL?
3 years, 8 months ago (2017-04-20 20:36:56 UTC) #10
ncarter (slow)
https://codereview.chromium.org/2830743004/diff/40001/content/browser/child_process_security_policy_impl.cc File content/browser/child_process_security_policy_impl.cc (right): https://codereview.chromium.org/2830743004/diff/40001/content/browser/child_process_security_policy_impl.cc#newcode967 content/browser/child_process_security_policy_impl.cc:967: filename.display_name = base::FilePath::FromUTF8Unsafe(name); Mutating the |drop_data| seems like an ...
3 years, 8 months ago (2017-04-24 18:54:46 UTC) #13
Łukasz Anforowicz
Thanks Nick - can you take another look please? https://codereview.chromium.org/2830743004/diff/40001/content/browser/child_process_security_policy_impl.cc File content/browser/child_process_security_policy_impl.cc (right): https://codereview.chromium.org/2830743004/diff/40001/content/browser/child_process_security_policy_impl.cc#newcode967 content/browser/child_process_security_policy_impl.cc:967: ...
3 years, 8 months ago (2017-04-24 21:30:24 UTC) #16
ncarter (slow)
lgtm, but you need to rename the CL which refers to the old name https://codereview.chromium.org/2830743004/diff/40001/content/browser/child_process_security_policy_impl.cc ...
3 years, 8 months ago (2017-04-24 22:01:51 UTC) #17
Łukasz Anforowicz
On 2017/04/24 22:01:51, ncarter wrote: > lgtm, but you need to rename the CL which ...
3 years, 8 months ago (2017-04-24 22:18:11 UTC) #19
Łukasz Anforowicz
On 2017/04/24 22:18:11, Łukasz A. wrote: > Also - I see that trybots say that ...
3 years, 8 months ago (2017-04-24 23:57:03 UTC) #23
Łukasz Anforowicz
On 2017/04/24 23:57:03, Łukasz A. wrote: > - AFAICT the requirement to use absolute paths ...
3 years, 8 months ago (2017-04-24 23:59:19 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2830743004/200001
3 years, 8 months ago (2017-04-25 03:16:07 UTC) #29
commit-bot: I haz the power
3 years, 8 months ago (2017-04-25 05:22:40 UTC) #32
Message was sent while issue was closed.
Committed patchset #11 (id:200001) as
https://chromium.googlesource.com/chromium/src/+/bf8f0b785a35a56c879f034013ea...

Powered by Google App Engine
This is Rietveld 408576698