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

Issue 2687873002: Use mime type for image extension (Closed)

Created:
3 years, 10 months ago by gambard
Modified:
3 years, 10 months ago
CC:
chromium-reviews, marq+watch_chromium.org, pkl (ping after 24h if needed), noyau+watch_chromium.org, sdefresne+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use mime type for image extension This CL uses the mime type to determine the best image extension when saving an image. BUG=690355 Review-Url: https://codereview.chromium.org/2687873002 Cr-Commit-Position: refs/heads/master@{#449365} Committed: https://chromium.googlesource.com/chromium/src/+/9efce7a0be559aa13c499f4400c2f2c3f66157c6

Patch Set 1 #

Total comments: 6

Patch Set 2 : Address comments #

Patch Set 3 : Use const ref #

Total comments: 14

Patch Set 4 : Move RequestData to its own file #

Patch Set 5 : Rebase #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+153 lines, -28 lines) Patch
M components/image_fetcher/BUILD.gn View 1 2 3 2 chunks +3 lines, -0 lines 0 comments Download
M components/image_fetcher/image_data_fetcher.h View 1 2 3 2 chunks +3 lines, -1 line 0 comments Download
M components/image_fetcher/image_data_fetcher.cc View 1 2 3 2 chunks +7 lines, -1 line 0 comments Download
M components/image_fetcher/image_data_fetcher_unittest.cc View 1 2 3 6 chunks +27 lines, -6 lines 0 comments Download
M components/image_fetcher/image_fetcher_impl.h View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M components/image_fetcher/image_fetcher_impl.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M components/image_fetcher/ios/ios_image_data_fetcher_wrapper.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M components/image_fetcher/ios/ios_image_data_fetcher_wrapper.mm View 1 2 2 chunks +8 lines, -3 lines 0 comments Download
A components/image_fetcher/request_metadata.h View 1 2 3 1 chunk +21 lines, -0 lines 0 comments Download
A components/image_fetcher/request_metadata.cc View 1 2 3 1 chunk +17 lines, -0 lines 0 comments Download
A components/image_fetcher/request_metadata_unittest.cc View 1 2 3 1 chunk +29 lines, -0 lines 0 comments Download
M ios/chrome/browser/suggestions/image_fetcher_impl.mm View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ios/chrome/browser/ui/browser_view_controller.mm View 1 2 3 4 7 chunks +30 lines, -13 lines 1 comment Download

Messages

Total messages: 23 (9 generated)
gambard
PTAL.
3 years, 10 months ago (2017-02-09 12:19:26 UTC) #2
Marc Treib
https://codereview.chromium.org/2687873002/diff/1/components/image_fetcher/image_data_fetcher.cc File components/image_fetcher/image_data_fetcher.cc (right): https://codereview.chromium.org/2687873002/diff/1/components/image_fetcher/image_data_fetcher.cc#newcode82 components/image_fetcher/image_data_fetcher.cc:82: if (source->GetResponseHeaders()) nit: braces please https://codereview.chromium.org/2687873002/diff/1/components/image_fetcher/image_data_fetcher.h File components/image_fetcher/image_data_fetcher.h (right): ...
3 years, 10 months ago (2017-02-09 12:34:45 UTC) #3
gambard
Thanks, PTAL! https://codereview.chromium.org/2687873002/diff/1/components/image_fetcher/image_data_fetcher.cc File components/image_fetcher/image_data_fetcher.cc (right): https://codereview.chromium.org/2687873002/diff/1/components/image_fetcher/image_data_fetcher.cc#newcode82 components/image_fetcher/image_data_fetcher.cc:82: if (source->GetResponseHeaders()) On 2017/02/09 12:34:45, Marc Treib ...
3 years, 10 months ago (2017-02-09 13:44:12 UTC) #4
Marc Treib
https://codereview.chromium.org/2687873002/diff/40001/components/image_fetcher/image_data_fetcher.cc File components/image_fetcher/image_data_fetcher.cc (right): https://codereview.chromium.org/2687873002/diff/40001/components/image_fetcher/image_data_fetcher.cc#newcode83 components/image_fetcher/image_data_fetcher.cc:83: source->GetResponseHeaders()->GetMimeType(&mime_type); You could read directly into &metadata.mime_type https://codereview.chromium.org/2687873002/diff/40001/components/image_fetcher/image_data_fetcher.h File ...
3 years, 10 months ago (2017-02-09 13:49:48 UTC) #5
sdefresne
https://codereview.chromium.org/2687873002/diff/40001/components/image_fetcher/image_data_fetcher.h File components/image_fetcher/image_data_fetcher.h (right): https://codereview.chromium.org/2687873002/diff/40001/components/image_fetcher/image_data_fetcher.h#newcode27 components/image_fetcher/image_data_fetcher.h:27: struct RequestMetadata { On 2017/02/09 13:49:48, Marc Treib wrote: ...
3 years, 10 months ago (2017-02-09 13:55:28 UTC) #6
marq (ping after 24h)
ios/ LGTM https://codereview.chromium.org/2687873002/diff/40001/ios/chrome/browser/ui/browser_view_controller.mm File ios/chrome/browser/ui/browser_view_controller.mm (right): https://codereview.chromium.org/2687873002/diff/40001/ios/chrome/browser/ui/browser_view_controller.mm#newcode3077 ios/chrome/browser/ui/browser_view_controller.mm:3077: fileExtension:(NSString*)fileExtension { withFileExtension: reads better, I think. ...
3 years, 10 months ago (2017-02-09 14:31:30 UTC) #7
gambard
Thanks, PTAL. https://codereview.chromium.org/2687873002/diff/40001/components/image_fetcher/image_data_fetcher.cc File components/image_fetcher/image_data_fetcher.cc (right): https://codereview.chromium.org/2687873002/diff/40001/components/image_fetcher/image_data_fetcher.cc#newcode83 components/image_fetcher/image_data_fetcher.cc:83: source->GetResponseHeaders()->GetMimeType(&mime_type); On 2017/02/09 13:49:47, Marc Treib wrote: ...
3 years, 10 months ago (2017-02-09 15:10:32 UTC) #8
Marc Treib
components/image_fetcher LGTM (I assume you'll land this one first, and then update https://codereview.chromium.org/2677993002/ accordingly?)
3 years, 10 months ago (2017-02-09 15:31:15 UTC) #9
gambard
On 2017/02/09 15:31:15, Marc Treib wrote: > components/image_fetcher LGTM > (I assume you'll land this ...
3 years, 10 months ago (2017-02-09 15:31:59 UTC) #10
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/2687873002/60001
3 years, 10 months ago (2017-02-09 15:32:25 UTC) #13
commit-bot: I haz the power
Failed to apply patch for ios/chrome/browser/ui/browser_view_controller.mm: While running git apply --index -p1; error: patch failed: ...
3 years, 10 months ago (2017-02-09 16:56:52 UTC) #15
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/2687873002/80001
3 years, 10 months ago (2017-02-09 17:05:11 UTC) #18
commit-bot: I haz the power
Committed patchset #5 (id:80001) as https://chromium.googlesource.com/chromium/src/+/9efce7a0be559aa13c499f4400c2f2c3f66157c6
3 years, 10 months ago (2017-02-09 18:53:59 UTC) #21
Olivier
3 years, 10 months ago (2017-02-10 08:54:43 UTC) #23
Message was sent while issue was closed.
https://codereview.chromium.org/2687873002/diff/80001/ios/chrome/browser/ui/b...
File ios/chrome/browser/ui/browser_view_controller.mm (right):

https://codereview.chromium.org/2687873002/diff/80001/ios/chrome/browser/ui/b...
ios/chrome/browser/ui/browser_view_controller.mm:3116:
stringByAppendingString:fileExtension];
nit, and not important for this CL:
Whenever manipulating path, try to use path specific methods. 
Here, prefer [NSString stringByAppendingPathExtension:]

Powered by Google App Engine
This is Rietveld 408576698