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

Issue 2914433002: arc: Use the MIME type returned by the container to handle content URLs (Closed)

Created:
3 years, 6 months ago by hashimoto
Modified:
3 years, 6 months ago
CC:
chromium-reviews, elijahtaylor+arcwatch_chromium.org, darin (slow to review), oshima+watch_chromium.org, yusukes+watch_chromium.org, tzik, hidehiko+watch_chromium.org, oka+watch_chromium.org, viettrungluu+watch_chromium.org, nhiroki, abarth-chromium, Aaron Boodman, rginda+watch_chromium.org, lhchavez+watch_chromium.org, yzshen+watch_chromium.org, victorhsieh+watch_chromium.org, fukino+watch_chromium.org, yamaguchi+watch_chromium.org, kinuko+fileapi, davemoore+watch_chromium.org, qsr+mojo_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

arc: Use the MIME type returned by the container to handle content URLs Currently, when displaying an ARC file specified by a content URL, we are using MIME type guessed by looking at the extension part of the URL. This doesn't always work so we should ask the ContentResolver running in the container to get the actual MIME type. - Add GetMimeType to FileSystemInstance interface. - Add arc::PathToArcUrl to arc_content_file_system_url_util - Use GetMimeType and arc::PathToArcUrl in filesystem_api_util.cc BUG=704701 TEST=Download a image file to the device's Downloads directory. Open chrome://settings/androidApps/details -> "Manage Android preferences" -> Storage -> Images -> Download -> <the downloaded image file>. Verify that the image file is displayed correctly, not as garbage text. Review-Url: https://codereview.chromium.org/2914433002 Cr-Commit-Position: refs/heads/master@{#476953} Committed: https://chromium.googlesource.com/chromium/src/+/aa692120241e0bfd072ac7b1b34ff26fcc6aa838

Patch Set 1 #

Patch Set 2 : Fix tests #

Total comments: 2

Patch Set 3 : Use ArcFileSystemOperationRunner #

Total comments: 2

Patch Set 4 : Profile check #

Total comments: 6

Patch Set 5 : Address comments #

Total comments: 13

Patch Set 6 : rebase #

Patch Set 7 : Address comments #

Total comments: 8

Patch Set 8 : Comment drop. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+127 lines, -11 lines) Patch
M chrome/browser/chromeos/arc/fileapi/arc_content_file_system_async_file_util_unittest.cc View 1 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/chromeos/arc/fileapi/arc_content_file_system_file_stream_reader_unittest.cc View 1 2 chunks +6 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util.h View 1 2 3 4 5 6 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util.cc View 1 chunk +5 lines, -1 line 0 comments Download
M chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util_unittest.cc View 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.h View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc View 1 2 3 4 5 6 1 chunk +20 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner_unittest.cc View 1 2 4 chunks +10 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/file_manager/filesystem_api_util.cc View 1 2 3 4 5 6 4 chunks +34 lines, -0 lines 0 comments Download
M components/arc/common/file_system.mojom View 1 2 3 4 5 6 7 3 chunks +6 lines, -2 lines 0 comments Download
M components/arc/test/fake_file_system_instance.h View 1 3 chunks +10 lines, -1 line 0 comments Download
M components/arc/test/fake_file_system_instance.cc View 1 2 3 4 5 6 2 chunks +16 lines, -1 line 0 comments Download

Messages

Total messages: 45 (25 generated)
hashimoto
nya@, could you review this change?
3 years, 6 months ago (2017-05-30 07:35:16 UTC) #10
Shuhei Takahashi (google)
https://codereview.chromium.org/2914433002/diff/20001/chrome/browser/chromeos/file_manager/filesystem_api_util.cc File chrome/browser/chromeos/file_manager/filesystem_api_util.cc (right): https://codereview.chromium.org/2914433002/diff/20001/chrome/browser/chromeos/file_manager/filesystem_api_util.cc#newcode205 chrome/browser/chromeos/file_manager/filesystem_api_util.cc:205: auto* file_system_instance = ARC_GET_INSTANCE_FOR_METHOD( Please add ArcFileSystemOperationRunner::GetMimeType() and call ...
3 years, 6 months ago (2017-05-30 09:30:17 UTC) #14
hashimoto
Thank you for reviewing! PTAL https://codereview.chromium.org/2914433002/diff/20001/chrome/browser/chromeos/file_manager/filesystem_api_util.cc File chrome/browser/chromeos/file_manager/filesystem_api_util.cc (right): https://codereview.chromium.org/2914433002/diff/20001/chrome/browser/chromeos/file_manager/filesystem_api_util.cc#newcode205 chrome/browser/chromeos/file_manager/filesystem_api_util.cc:205: auto* file_system_instance = ARC_GET_INSTANCE_FOR_METHOD( ...
3 years, 6 months ago (2017-05-30 10:51:23 UTC) #15
Shuhei Takahashi
Mostly looks good, thanks for the change! Please send me Android changes later. Also I ...
3 years, 6 months ago (2017-05-31 03:22:55 UTC) #17
hashimoto
nya@: PTAL dcheng@: Please review components/arc/common/file_system.mojom as a security owner. https://codereview.chromium.org/2914433002/diff/40001/chrome/browser/chromeos/file_manager/filesystem_api_util.cc File chrome/browser/chromeos/file_manager/filesystem_api_util.cc (right): https://codereview.chromium.org/2914433002/diff/40001/chrome/browser/chromeos/file_manager/filesystem_api_util.cc#newcode204 ...
3 years, 6 months ago (2017-06-01 09:38:25 UTC) #19
Shuhei Takahashi (google)
lgtm. Thanks!
3 years, 6 months ago (2017-06-01 10:18:59 UTC) #25
Shuhei Takahashi
lgtm I happened to use a wrong account...
3 years, 6 months ago (2017-06-01 10:20:01 UTC) #27
dcheng
https://codereview.chromium.org/2914433002/diff/60001/chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc File chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc (right): https://codereview.chromium.org/2914433002/diff/60001/chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc#newcode121 chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc:121: FROM_HERE, base::Bind(callback, base::Optional<std::string>())); Let's use base::nullopt instead of base::Optional<T>() ...
3 years, 6 months ago (2017-06-01 11:06:44 UTC) #28
hashimoto
dcheng@, thank you for reviewing! PTAL https://codereview.chromium.org/2914433002/diff/60001/chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc File chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc (right): https://codereview.chromium.org/2914433002/diff/60001/chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc#newcode121 chrome/browser/chromeos/arc/fileapi/arc_file_system_operation_runner.cc:121: FROM_HERE, base::Bind(callback, base::Optional<std::string>())); ...
3 years, 6 months ago (2017-06-01 11:30:16 UTC) #29
dcheng
ipc lgtm https://codereview.chromium.org/2914433002/diff/80001/chrome/browser/chromeos/file_manager/filesystem_api_util.cc File chrome/browser/chromeos/file_manager/filesystem_api_util.cc (right): https://codereview.chromium.org/2914433002/diff/80001/chrome/browser/chromeos/file_manager/filesystem_api_util.cc#newcode69 chrome/browser/chromeos/file_manager/filesystem_api_util.cc:69: const base::Callback<void(bool, const std::string&)>& callback, I didn't ...
3 years, 6 months ago (2017-06-02 15:58:29 UTC) #30
hashimoto
hidehiko@: Please review as an arc owner. mtomasz@: Please review as an owner of chrome/browser/chromeos/fileapi ...
3 years, 6 months ago (2017-06-05 04:08:57 UTC) #32
mtomasz
https://codereview.chromium.org/2914433002/diff/80001/chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util.h File chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util.h (right): https://codereview.chromium.org/2914433002/diff/80001/chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util.h#newcode45 chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util.h:45: // container. nit: Shall we add a comment when ...
3 years, 6 months ago (2017-06-05 04:29:55 UTC) #33
hashimoto
Thank you for reviewing! PTAL https://codereview.chromium.org/2914433002/diff/80001/chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util.h File chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util.h (right): https://codereview.chromium.org/2914433002/diff/80001/chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util.h#newcode45 chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util.h:45: // container. On 2017/06/05 ...
3 years, 6 months ago (2017-06-05 04:55:37 UTC) #34
mtomasz
lgtm! https://codereview.chromium.org/2914433002/diff/80001/components/arc/common/file_system.mojom File components/arc/common/file_system.mojom (right): https://codereview.chromium.org/2914433002/diff/80001/components/arc/common/file_system.mojom#newcode110 components/arc/common/file_system.mojom:110: // empty string). On 2017/06/05 04:55:37, hashimoto wrote: ...
3 years, 6 months ago (2017-06-05 05:01:06 UTC) #35
hidehiko
LGTM with optional comments. https://codereview.chromium.org/2914433002/diff/120001/chrome/browser/chromeos/file_manager/filesystem_api_util.cc File chrome/browser/chromeos/file_manager/filesystem_api_util.cc (right): https://codereview.chromium.org/2914433002/diff/120001/chrome/browser/chromeos/file_manager/filesystem_api_util.cc#newcode159 chrome/browser/chromeos/file_manager/filesystem_api_util.cc:159: void GetNonNativeLocalPathMimeType( Optional: As this ...
3 years, 6 months ago (2017-06-05 05:18:04 UTC) #36
hashimoto
https://codereview.chromium.org/2914433002/diff/120001/chrome/browser/chromeos/file_manager/filesystem_api_util.cc File chrome/browser/chromeos/file_manager/filesystem_api_util.cc (right): https://codereview.chromium.org/2914433002/diff/120001/chrome/browser/chromeos/file_manager/filesystem_api_util.cc#newcode159 chrome/browser/chromeos/file_manager/filesystem_api_util.cc:159: void GetNonNativeLocalPathMimeType( On 2017/06/05 05:18:04, hidehiko wrote: > Optional: ...
3 years, 6 months ago (2017-06-05 05:40:53 UTC) #37
hidehiko
Thank you for updating the bug. still lgtm. https://codereview.chromium.org/2914433002/diff/120001/components/arc/common/file_system.mojom File components/arc/common/file_system.mojom (right): https://codereview.chromium.org/2914433002/diff/120001/components/arc/common/file_system.mojom#newcode110 components/arc/common/file_system.mojom:110: // ...
3 years, 6 months ago (2017-06-05 05:52:53 UTC) #38
hashimoto
Thank you for the extensive research! https://codereview.chromium.org/2914433002/diff/120001/components/arc/common/file_system.mojom File components/arc/common/file_system.mojom (right): https://codereview.chromium.org/2914433002/diff/120001/components/arc/common/file_system.mojom#newcode110 components/arc/common/file_system.mojom:110: // empty string). ...
3 years, 6 months ago (2017-06-05 06:03:51 UTC) #39
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/2914433002/140001
3 years, 6 months ago (2017-06-05 06:04:43 UTC) #42
commit-bot: I haz the power
3 years, 6 months ago (2017-06-05 06:35:22 UTC) #45
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://chromium.googlesource.com/chromium/src/+/aa692120241e0bfd072ac7b1b34f...

Powered by Google App Engine
This is Rietveld 408576698