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

Issue 224883008: Sniff MIME type for files which have unknown extensions. (Closed)

Created:
6 years, 8 months ago by fukino
Modified:
6 years, 8 months ago
CC:
chromium-reviews, extensions-reviews_chromium.org, nkostylev+watch_chromium.org, tfarina, yoshiki+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
Visibility:
Public.

Description

Sniff MIME type for files which have unknown extensions. What I want to do: Open text files which have unknown extensions(e.g. access.log.1) using packaged apps which can handle 'text/plain'(e.g. Text, Caret,...). Current situation: By following reasons, text files with unknow extension can't be opened. 1. FileManager guess the MIME type as empty, so 'text/plain'-supporting apps are not shown as handlers. 2. PlatformAppLauncher guess the MIME type as 'application/octet-stream', and it launch apps with no data because those apps don't handle 'application/octet-stream'. What I changed: Modified FileManager and PlatformAppLauncher to sniff MIME types if they are unknown based on extensions. BUG=352250 R=benwells@chromium.org, hashimoto@chromium.org, jorgelo@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=264167 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=265239

Patch Set 1 #

Patch Set 2 : Add missing header (<vector>). #

Total comments: 13

Patch Set 3 : Use PostBlockingPoolTaskAndReply and add comments. #

Patch Set 4 : Add another comment. #

Total comments: 2

Patch Set 5 : Modified a comment. #

Total comments: 5

Patch Set 6 : Update test code. #

Total comments: 1

Patch Set 7 : Rebase and omit binary file. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+92 lines, -23 lines) Patch
M apps/launcher.cc View 1 2 3 2 chunks +17 lines, -2 lines 0 comments Download
M chrome/browser/apps/app_browsertest.cc View 1 2 3 4 5 6 1 chunk +9 lines, -1 line 0 comments Download
M chrome/browser/chromeos/extensions/file_manager/private_api_tasks.h View 1 2 2 chunks +8 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/extensions/file_manager/private_api_tasks.cc View 1 2 3 4 5 chunks +57 lines, -8 lines 0 comments Download
M chrome/test/data/extensions/platform_apps/launch_application_octet_stream/test.js View 1 2 3 4 5 1 chunk +1 line, -12 lines 0 comments Download

Messages

Total messages: 33 (0 generated)
fukino
hashimoto san, If you have time, could you take a look at File Manager part ...
6 years, 8 months ago (2014-04-10 08:47:31 UTC) #1
hashimoto
looking good! https://codereview.chromium.org/224883008/diff/10001/apps/launcher.cc File apps/launcher.cc (right): https://codereview.chromium.org/224883008/diff/10001/apps/launcher.cc#newcode195 apps/launcher.cc:195: std::string(), nit: How about adding a comment ...
6 years, 8 months ago (2014-04-10 09:29:11 UTC) #2
fukino
Thank you for comments! https://codereview.chromium.org/224883008/diff/10001/apps/launcher.cc File apps/launcher.cc (right): https://codereview.chromium.org/224883008/diff/10001/apps/launcher.cc#newcode195 apps/launcher.cc:195: std::string(), On 2014/04/10 09:29:12, hashimoto ...
6 years, 8 months ago (2014-04-10 11:12:05 UTC) #3
hashimoto
lgtm with a nit https://codereview.chromium.org/224883008/diff/10001/chrome/browser/chromeos/extensions/file_manager/private_api_tasks.cc File chrome/browser/chromeos/extensions/file_manager/private_api_tasks.cc (right): https://codereview.chromium.org/224883008/diff/10001/chrome/browser/chromeos/extensions/file_manager/private_api_tasks.cc#newcode180 chrome/browser/chromeos/extensions/file_manager/private_api_tasks.cc:180: scoped_ptr<PathAndMimeTypeSet> sniffed_path_mime_set(new PathAndMimeTypeSet); On 2014/04/10 ...
6 years, 8 months ago (2014-04-10 11:54:21 UTC) #4
fukino
https://codereview.chromium.org/224883008/diff/40004/chrome/browser/chromeos/extensions/file_manager/private_api_tasks.cc File chrome/browser/chromeos/extensions/file_manager/private_api_tasks.cc (right): https://codereview.chromium.org/224883008/diff/40004/chrome/browser/chromeos/extensions/file_manager/private_api_tasks.cc#newcode74 chrome/browser/chromeos/extensions/file_manager/private_api_tasks.cc:74: // content via network frequently. On 2014/04/10 11:54:21, hashimoto ...
6 years, 8 months ago (2014-04-10 12:10:58 UTC) #5
fukino
Hi Ben, could you take a look at apps/launcher.cc?
6 years, 8 months ago (2014-04-10 12:14:39 UTC) #6
fukino
Hi Jorge, I'm making a minor change about how to launch platform apps with files ...
6 years, 8 months ago (2014-04-10 15:17:28 UTC) #7
Jorge Lucangeli Obes
https://codereview.chromium.org/224883008/diff/60001/apps/launcher.cc File apps/launcher.cc (right): https://codereview.chromium.org/224883008/diff/60001/apps/launcher.cc#newcode191 apps/launcher.cc:191: if (bytes_read >= 0) { Why do we want ...
6 years, 8 months ago (2014-04-10 20:36:08 UTC) #8
fukino
Thanks for comment! https://codereview.chromium.org/224883008/diff/60001/apps/launcher.cc File apps/launcher.cc (right): https://codereview.chromium.org/224883008/diff/60001/apps/launcher.cc#newcode191 apps/launcher.cc:191: if (bytes_read >= 0) { On ...
6 years, 8 months ago (2014-04-10 23:50:32 UTC) #9
Jorge Lucangeli Obes
On 2014/04/10 23:50:32, fukino wrote: > Thanks for comment! > > https://codereview.chromium.org/224883008/diff/60001/apps/launcher.cc > File apps/launcher.cc ...
6 years, 8 months ago (2014-04-10 23:53:40 UTC) #10
fukino
On 2014/04/10 23:53:40, Jorge Lucangeli Obes wrote: > On 2014/04/10 23:50:32, fukino wrote: > > ...
6 years, 8 months ago (2014-04-11 00:32:01 UTC) #11
Jorge Lucangeli Obes
On 2014/04/11 00:32:01, fukino wrote: > On 2014/04/10 23:53:40, Jorge Lucangeli Obes wrote: > > ...
6 years, 8 months ago (2014-04-11 18:38:59 UTC) #12
benwells
https://codereview.chromium.org/224883008/diff/60001/apps/launcher.cc File apps/launcher.cc (right): https://codereview.chromium.org/224883008/diff/60001/apps/launcher.cc#newcode189 apps/launcher.cc:189: std::vector<char> content(net::kMaxBytesToSniff); Is there a reason not to use ...
6 years, 8 months ago (2014-04-11 23:22:34 UTC) #13
fukino
https://codereview.chromium.org/224883008/diff/60001/apps/launcher.cc File apps/launcher.cc (right): https://codereview.chromium.org/224883008/diff/60001/apps/launcher.cc#newcode189 apps/launcher.cc:189: std::vector<char> content(net::kMaxBytesToSniff); On 2014/04/11 23:22:35, benwells wrote: > Is ...
6 years, 8 months ago (2014-04-12 06:21:14 UTC) #14
benwells
lgtm. just to confirm, the apps/launcher.cc code is for launching chrome packaged apps. In the ...
6 years, 8 months ago (2014-04-14 05:47:41 UTC) #15
fukino
On 2014/04/14 05:47:41, benwells wrote: > lgtm. > > just to confirm, the apps/launcher.cc code ...
6 years, 8 months ago (2014-04-14 07:05:04 UTC) #16
Jorge Lucangeli Obes
On 2014/04/14 07:05:04, fukino wrote: > On 2014/04/14 05:47:41, benwells wrote: > > lgtm. > ...
6 years, 8 months ago (2014-04-14 18:56:49 UTC) #17
benwells
Any file access to 3rd party extensions will go through a stringent security review, I'm ...
6 years, 8 months ago (2014-04-14 22:05:21 UTC) #18
fukino
The CQ bit was checked by fukino@chromium.org
6 years, 8 months ago (2014-04-14 22:26:32 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fukino@chromium.org/224883008/60001
6 years, 8 months ago (2014-04-14 22:27:46 UTC) #20
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-14 23:31:15 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on linux_chromium_rel
6 years, 8 months ago (2014-04-14 23:31:15 UTC) #22
fukino
Hi Ben, I updated test codes. (Sorry, I forgot to do it.) Could you take ...
6 years, 8 months ago (2014-04-15 07:28:59 UTC) #23
benwells
lgtm
6 years, 8 months ago (2014-04-15 22:15:12 UTC) #24
fukino
On 2014/04/15 22:15:12, benwells wrote: > lgtm thanks!
6 years, 8 months ago (2014-04-15 23:51:43 UTC) #25
yoshiki
Committed patchset #6 manually as r264167 (presubmit successful).
6 years, 8 months ago (2014-04-16 10:02:35 UTC) #26
fukino
Ben, This change was reverted because the newly added test case (PlatformAppBrowserTest, LaunchWithSniffableType) failed on ...
6 years, 8 months ago (2014-04-17 02:00:07 UTC) #27
fukino
The failure with browser_tests on Windows was caused by this issue. http://crbug.com/243885 I'll try to ...
6 years, 8 months ago (2014-04-17 09:07:58 UTC) #28
benwells
On 2014/04/17 09:07:58, fukino wrote: > The failure with browser_tests on Windows was caused by ...
6 years, 8 months ago (2014-04-17 09:44:18 UTC) #29
fukino
On 2014/04/17 09:44:18, benwells wrote: > On 2014/04/17 09:07:58, fukino wrote: > > The failure ...
6 years, 8 months ago (2014-04-22 10:38:45 UTC) #30
fukino
The CQ bit was checked by fukino@chromium.org
6 years, 8 months ago (2014-04-22 10:42:13 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fukino@chromium.org/224883008/100001
6 years, 8 months ago (2014-04-22 10:42:27 UTC) #32
commit-bot: I haz the power
6 years, 8 months ago (2014-04-22 13:01:54 UTC) #33
Message was sent while issue was closed.
Change committed as 265239

Powered by Google App Engine
This is Rietveld 408576698