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

Issue 46303005: Fix chrome upload with content uri (Closed)

Created:
7 years, 1 month ago by qinmin
Modified:
7 years, 1 month ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, tzik, joi+watch-content_chromium.org, darin-cc_chromium.org, kinuko+watch, asanka
Visibility:
Public.

Description

Fix chrome upload with content uri For android, the upload file dialog returns files with content uri scheme(content://). This CL makes it possible for upload to work with this new file type. It fixes both the form and fileapi based uploads. The CL follows the same code path used by regular file upload and the content url is encompassed by a FilePath object. R=jar@chromium.org, joth@chromium.org, kinuko@chromium.org, mmenke@chromium.org, tsepez@chromium.org TBR=yfriedman BUG=278640 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=235752

Patch Set 1 : #

Total comments: 12

Patch Set 2 : simplify the change using FILE enum instead of adding a new enum #

Total comments: 23

Patch Set 3 : addressing comments #

Total comments: 4

Patch Set 4 : addressing mmenke's comments #

Total comments: 8

Patch Set 5 : adding unittests #

Total comments: 6

Patch Set 6 : adding unittests for net/ #

Total comments: 10

Patch Set 7 : addressing tsepez's comments #

Total comments: 4

Patch Set 8 : address jar's comments #

Patch Set 9 : rebase #

Patch Set 10 : rebase again #

Unified diffs Side-by-side diffs Delta from patch set Stats (+506 lines, -31 lines) Patch
M base/android/base_jni_registrar.cc View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
A base/android/content_uri_utils.h View 1 2 3 4 1 chunk +27 lines, -0 lines 0 comments Download
A base/android/content_uri_utils.cc View 1 2 3 4 1 chunk +39 lines, -0 lines 0 comments Download
A base/android/java/src/org/chromium/base/ContentUriUtils.java View 1 2 3 4 1 chunk +76 lines, -0 lines 0 comments Download
M base/base.gyp View 1 2 3 4 5 6 7 8 6 chunks +33 lines, -0 lines 0 comments Download
M base/base.gypi View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M base/file_util_posix.cc View 1 2 3 4 5 6 4 chunks +27 lines, -2 lines 0 comments Download
M base/file_util_unittest.cc View 1 2 3 4 5 2 chunks +50 lines, -0 lines 0 comments Download
M base/files/file_path.h View 1 2 3 4 1 chunk +9 lines, -0 lines 0 comments Download
M base/files/file_path.cc View 1 2 3 4 5 6 7 1 chunk +6 lines, -0 lines 0 comments Download
M base/files/file_path_unittest.cc View 1 2 3 4 5 6 7 1 chunk +29 lines, -0 lines 0 comments Download
A base/test/android/java/src/org/chromium/base/ContentUriTestUtils.java View 1 2 3 4 5 1 chunk +51 lines, -0 lines 0 comments Download
A base/test/data/file_util/red.png View 1 2 3 4 Binary file 0 comments Download
M base/test/run_all_unittests.cc View 1 2 3 4 2 chunks +9 lines, -1 line 0 comments Download
M base/test/test_file_util.h View 1 2 3 4 2 chunks +14 lines, -0 lines 0 comments Download
A base/test/test_file_util_android.cc View 1 2 3 4 1 chunk +29 lines, -0 lines 0 comments Download
M content/browser/child_process_security_policy_impl.cc View 1 2 3 4 5 6 7 2 chunks +20 lines, -0 lines 0 comments Download
M net/base/file_stream_context.cc View 1 2 3 4 2 chunks +22 lines, -7 lines 0 comments Download
M net/base/file_stream_unittest.cc View 1 2 3 4 5 2 chunks +53 lines, -0 lines 0 comments Download
A net/data/file_stream_unittest/red.png View 1 2 3 4 5 6 7 Binary file 0 comments Download
M net/net.gyp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M net/test/run_all_unittests.cc View 1 2 3 4 5 2 chunks +2 lines, -0 lines 0 comments Download
M ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -21 lines 0 comments Download

Messages

Total messages: 58 (0 generated)
qinmin
+kinuko & ericu to review all the filepai/upload related functionality +asanka for OWNER of net/ ...
7 years, 1 month ago (2013-10-28 23:32:38 UTC) #1
joth
On 2013/10/28 23:32:38, qinmin wrote: > +kinuko & ericu to review all the filepai/upload related ...
7 years, 1 month ago (2013-10-29 01:10:06 UTC) #2
joth
high level comment - this patch connects a large number of OS_ANDROID specific paths through ...
7 years, 1 month ago (2013-10-29 01:30:25 UTC) #3
qinmin
updated the BUG id, and modified the CL description to reflect the basic work flow ...
7 years, 1 month ago (2013-10-29 02:45:56 UTC) #4
kinuko
Starting with cosmetic comments + some high-level comments. https://codereview.chromium.org/46303005/diff/100004/content/browser/child_process_security_policy_impl.h File content/browser/child_process_security_policy_impl.h (right): https://codereview.chromium.org/46303005/diff/100004/content/browser/child_process_security_policy_impl.h#newcode257 content/browser/child_process_security_policy_impl.h:257: // ...
7 years, 1 month ago (2013-10-29 02:52:30 UTC) #5
asanka
Redirecting to mmenke for net/
7 years, 1 month ago (2013-10-29 14:08:16 UTC) #6
mmenke
On 2013/10/29 14:08:16, asanka wrote: > Redirecting to mmenke for net/ Could I get some ...
7 years, 1 month ago (2013-10-29 14:46:46 UTC) #7
qinmin
On 2013/10/29 14:46:46, mmenke wrote: > On 2013/10/29 14:08:16, asanka wrote: > > Redirecting to ...
7 years, 1 month ago (2013-10-29 15:40:46 UTC) #8
qinmin
https://codereview.chromium.org/46303005/diff/100004/content/browser/child_process_security_policy_impl.h File content/browser/child_process_security_policy_impl.h (right): https://codereview.chromium.org/46303005/diff/100004/content/browser/child_process_security_policy_impl.h#newcode257 content/browser/child_process_security_policy_impl.h:257: // bit-set of base::PlatformFileFlags. On 2013/10/29 02:52:31, kinuko wrote: ...
7 years, 1 month ago (2013-10-29 19:14:20 UTC) #9
qinmin
PTAL again. As suggested by @kinuko, removed the CONTENT_URL_TYPE enum and using the FILE_TYPE enum ...
7 years, 1 month ago (2013-10-31 02:02:22 UTC) #10
kinuko
Thanks for trying to simplify this. I like this change much better than the previous ...
7 years, 1 month ago (2013-10-31 06:10:50 UTC) #11
joth
Yes this feels a much more natural fit, thanks for seeing that change through. Some ...
7 years, 1 month ago (2013-10-31 06:42:38 UTC) #12
mmenke
https://codereview.chromium.org/46303005/diff/290001/net/base/file_stream_context_android.cc File net/base/file_stream_context_android.cc (right): https://codereview.chromium.org/46303005/diff/290001/net/base/file_stream_context_android.cc#newcode1 net/base/file_stream_context_android.cc:1: // Copyright (c) 2013 The Chromium Authors. All rights ...
7 years, 1 month ago (2013-10-31 15:07:06 UTC) #13
qinmin
PTAL again. Moved most of the changes to base/, +thakis for OWNER https://codereview.chromium.org/46303005/diff/290001/base/files/file_path.h File base/files/file_path.h ...
7 years, 1 month ago (2013-11-05 01:41:29 UTC) #14
mmenke
https://codereview.chromium.org/46303005/diff/560001/net/base/file_stream_context.cc File net/base/file_stream_context.cc (right): https://codereview.chromium.org/46303005/diff/560001/net/base/file_stream_context.cc#newcode76 net/base/file_stream_context.cc:76: #endif Can't you just move all content URL code ...
7 years, 1 month ago (2013-11-05 02:33:18 UTC) #15
qinmin
https://codereview.chromium.org/46303005/diff/560001/net/base/file_stream_context.cc File net/base/file_stream_context.cc (right): https://codereview.chromium.org/46303005/diff/560001/net/base/file_stream_context.cc#newcode76 net/base/file_stream_context.cc:76: #endif On 2013/11/05 02:33:19, mmenke wrote: > Can't you ...
7 years, 1 month ago (2013-11-05 03:38:40 UTC) #16
mmenke
My only remaining concern is unit tests - how easy is it to set up ...
7 years, 1 month ago (2013-11-05 15:36:03 UTC) #17
joth
lgtm for the bits I'm OWNER of... https://codereview.chromium.org/46303005/diff/560001/base/android/java/src/org/chromium/base/ContentUriUtils.java File base/android/java/src/org/chromium/base/ContentUriUtils.java (right): https://codereview.chromium.org/46303005/diff/560001/base/android/java/src/org/chromium/base/ContentUriUtils.java#newcode72 base/android/java/src/org/chromium/base/ContentUriUtils.java:72: Log.w(TAG, "Cannot ...
7 years, 1 month ago (2013-11-06 00:27:07 UTC) #18
ericu
I see no problems w.r.t. filesystem code. Bikeshedding: Are these content URIs or content URLs? ...
7 years, 1 month ago (2013-11-06 00:42:10 UTC) #19
kinuko
lgtm for fileapi related files. (Wow the CL's gotten much smaller now) https://codereview.chromium.org/46303005/diff/610001/base/file_util_posix.cc File base/file_util_posix.cc ...
7 years, 1 month ago (2013-11-06 01:42:05 UTC) #20
joth
https://codereview.chromium.org/46303005/diff/610001/net/base/file_stream_context.cc File net/base/file_stream_context.cc (right): https://codereview.chromium.org/46303005/diff/610001/net/base/file_stream_context.cc#newcode217 net/base/file_stream_context.cc:217: #endif // defined(OS_ANDROID) just saw in another review [1], ...
7 years, 1 month ago (2013-11-06 01:49:17 UTC) #21
joth
On 2013/11/06 01:49:17, joth wrote: > https://codereview.chromium.org/46303005/diff/610001/net/base/file_stream_context.cc > File net/base/file_stream_context.cc (right): > > https://codereview.chromium.org/46303005/diff/610001/net/base/file_stream_context.cc#newcode217 > ...
7 years, 1 month ago (2013-11-06 19:34:24 UTC) #22
qinmin
On 2013/11/06 00:42:10, ericu wrote: > I see no problems w.r.t. filesystem code. > > ...
7 years, 1 month ago (2013-11-07 01:10:58 UTC) #23
qinmin
Added new unit tests for changes in file_path.cc and file_utils.cc. To make the test to ...
7 years, 1 month ago (2013-11-07 01:13:34 UTC) #24
qinmin
+jar@ for OWNER for base/, thakis@ is on vacation
7 years, 1 month ago (2013-11-07 01:15:32 UTC) #25
mmenke
Just some test suggestions, and I'm happy. https://codereview.chromium.org/46303005/diff/740021/base/file_util_unittest.cc File base/file_util_unittest.cc (right): https://codereview.chromium.org/46303005/diff/740021/base/file_util_unittest.cc#newcode2322 base/file_util_unittest.cc:2322: #if defined(OS_ANDROID) ...
7 years, 1 month ago (2013-11-07 16:31:54 UTC) #26
qinmin
https://codereview.chromium.org/46303005/diff/740021/base/file_util_unittest.cc File base/file_util_unittest.cc (right): https://codereview.chromium.org/46303005/diff/740021/base/file_util_unittest.cc#newcode2322 base/file_util_unittest.cc:2322: #if defined(OS_ANDROID) On 2013/11/07 16:31:55, mmenke wrote: > Test ...
7 years, 1 month ago (2013-11-08 23:03:02 UTC) #27
qinmin
jar@, would you please review base/? as suggested by all the reviewers, most of the ...
7 years, 1 month ago (2013-11-08 23:04:00 UTC) #28
jar (doing other things)
I'm not familiar with the security model, and promises around file upload, so I'd rather ...
7 years, 1 month ago (2013-11-11 00:34:47 UTC) #29
mmenke
net/ LGTM
7 years, 1 month ago (2013-11-11 16:21:14 UTC) #30
qinmin
+tsepez for security review. tsepez@: hi, Tom, would you please do a security review for ...
7 years, 1 month ago (2013-11-11 17:57:51 UTC) #31
Tom Sepez
LGTM with comments. https://codereview.chromium.org/46303005/diff/1010001/base/files/file_path.cc File base/files/file_path.cc (right): https://codereview.chromium.org/46303005/diff/1010001/base/files/file_path.cc#newcode1285 base/files/file_path.cc:1285: return StartsWithASCII(path_, "content://", false); Are there ...
7 years, 1 month ago (2013-11-11 18:28:33 UTC) #32
qinmin
https://codereview.chromium.org/46303005/diff/1010001/base/files/file_path.cc File base/files/file_path.cc (right): https://codereview.chromium.org/46303005/diff/1010001/base/files/file_path.cc#newcode1285 base/files/file_path.cc:1285: return StartsWithASCII(path_, "content://", false); Done fixing the 3rd parameter ...
7 years, 1 month ago (2013-11-11 20:49:52 UTC) #33
qinmin
Hi, jar@, tsepez lgtm'ed the CL, would you please do a OWNERS review? thanks
7 years, 1 month ago (2013-11-12 17:39:06 UTC) #34
jar (doing other things)
With the security reviewed... base LGTM (with a few lingering questions below). https://codereview.chromium.org/46303005/diff/1230001/base/files/file_path.cc File base/files/file_path.cc ...
7 years, 1 month ago (2013-11-13 01:03:27 UTC) #35
qinmin
https://codereview.chromium.org/46303005/diff/1230001/base/files/file_path.cc File base/files/file_path.cc (right): https://codereview.chromium.org/46303005/diff/1230001/base/files/file_path.cc#newcode1289 base/files/file_path.cc:1289: ((path_[len] >= L'A' && path_[len] <= L'Z') || On ...
7 years, 1 month ago (2013-11-13 23:42:42 UTC) #36
qinmin
jam@, would you please take a look at content/browser/child_process_security_policy_impl.cc? tsepez has done the security review. ...
7 years, 1 month ago (2013-11-13 23:44:31 UTC) #37
jam
On 2013/11/13 23:44:31, qinmin wrote: > jam@, would you please take a look at > ...
7 years, 1 month ago (2013-11-14 18:15:25 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/qinmin@chromium.org/46303005/1560001
7 years, 1 month ago (2013-11-14 18:20:39 UTC) #39
commit-bot: I haz the power
Retried try job too often on linux_rel for step(s) nacl_integration http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_rel&number=190012
7 years, 1 month ago (2013-11-14 19:41:46 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/qinmin@chromium.org/46303005/1560001
7 years, 1 month ago (2013-11-14 21:26:52 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/qinmin@chromium.org/46303005/1560001
7 years, 1 month ago (2013-11-14 21:44:58 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/qinmin@chromium.org/46303005/1560001
7 years, 1 month ago (2013-11-15 01:11:49 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/qinmin@chromium.org/46303005/1560001
7 years, 1 month ago (2013-11-15 03:47:06 UTC) #44
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) nacl_integration http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=224759
7 years, 1 month ago (2013-11-15 06:44:51 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/qinmin@chromium.org/46303005/1560001
7 years, 1 month ago (2013-11-15 07:19:05 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/qinmin@chromium.org/46303005/1560001
7 years, 1 month ago (2013-11-15 14:43:35 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/qinmin@chromium.org/46303005/1560001
7 years, 1 month ago (2013-11-15 21:49:31 UTC) #49
commit-bot: I haz the power
Failed to apply patch for ui/android/java/src/org/chromium/ui/SelectFileDialog.java: While running patch -p1 --forward --force --no-backup-if-mismatch; can't find ...
7 years, 1 month ago (2013-11-15 21:49:50 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/qinmin@chromium.org/46303005/2120001
7 years, 1 month ago (2013-11-15 23:48:23 UTC) #51
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/qinmin@chromium.org/46303005/2120001
7 years, 1 month ago (2013-11-16 00:15:49 UTC) #52
commit-bot: I haz the power
The commit queue went berserk retrying too often for a seemingly flaky test on builder ...
7 years, 1 month ago (2013-11-16 11:27:06 UTC) #53
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/qinmin@chromium.org/46303005/2120001
7 years, 1 month ago (2013-11-17 06:33:51 UTC) #54
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/qinmin@chromium.org/46303005/2120001
7 years, 1 month ago (2013-11-17 22:39:52 UTC) #56
qinmin
7 years, 1 month ago (2013-11-18 17:21:33 UTC) #58
Message was sent while issue was closed.
Committed patchset #10 manually as r235752 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698