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

Issue 1038573002: Fixed thread-unsafe use of gfx::Image in app shortcut creation. (Closed)

Created:
5 years, 9 months ago by Matt Giuca
Modified:
5 years, 8 months ago
Reviewers:
jackhou1, benwells, msw
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org, tfarina, jackhou1
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fixed thread-unsafe use of gfx::Image in app shortcut creation. Refactored web_app::ShortcutInfo so it is always passed via a scoped_ptr (always having exactly one owner). This allows it to be safely passed between threads without having a data race on the favicon image's reference count. Removed TSan suppression on ImageFamily. BUG=364006 Committed: https://crrev.com/b21fe8ee736f3c2ee95b1cf181ef0a678bfcbf05 Cr-Commit-Position: refs/heads/master@{#324360}

Patch Set 1 #

Patch Set 2 : Move expressions out of argument lists (fix unspecified behaviour). #

Total comments: 2

Patch Set 3 : Rebase. #

Patch Set 4 : Url shortcuts: Copy the bitmap before it gets reset. #

Patch Set 5 : Allow shortcut_info_ to be null in create dialog. #

Patch Set 6 : web_app::GetShortcutInfoForTab now returns a scoped_ptr<ShortcutInfo>. #

Patch Set 7 : Un-rebase off my other CL so I can run trybots. #

Patch Set 8 : Rebase. #

Patch Set 9 : Update web_app_win and web_app_mac (untested). #

Patch Set 10 : Rebase. #

Patch Set 11 : Attempt to fix Mac compile. #

Patch Set 12 : Attempt to fix Mac and Win compiles. #

Patch Set 13 : Attempt to fix Mac and Win compiles. #

Patch Set 14 : Attempt to fix Mac compile. #

Patch Set 15 : Fix Win compile. #

Patch Set 16 : Attempt to fix Mac compile. #

Patch Set 17 : Attempt to fix Mac compile. #

Patch Set 18 : Cleanup. #

Patch Set 19 : Rebase. #

Total comments: 6

Patch Set 20 : Use a pointer instead of a reference. #

Patch Set 21 : Attempt to fix Mac compile. #

Total comments: 2

Patch Set 22 : Added DCHECK. #

Patch Set 23 : Fix ChromeOS compile. #

Total comments: 7

Patch Set 24 : Rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+343 lines, -306 lines) Patch
M build/sanitizers/tsan_suppressions.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/apps/app_shim/app_shim_interactive_uitest_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2 chunks +6 lines, -4 lines 0 comments Download
M chrome/browser/ui/app_list/app_list_service_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 3 chunks +18 lines, -17 lines 0 comments Download
M chrome/browser/ui/app_list/app_list_view_delegate.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/browser/ui/views/create_application_shortcut_view.h View 1 2 3 4 3 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/create_application_shortcut_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 8 chunks +28 lines, -15 lines 0 comments Download
M chrome/browser/web_applications/update_shortcut_worker_win.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/web_applications/update_shortcut_worker_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 5 chunks +11 lines, -10 lines 0 comments Download
M chrome/browser/web_applications/web_app.h View 1 2 3 4 5 6 7 8 chunks +17 lines, -10 lines 0 comments Download
M chrome/browser/web_applications/web_app.cc View 1 2 3 4 5 6 7 8 8 chunks +50 lines, -46 lines 0 comments Download
M chrome/browser/web_applications/web_app_chromeos.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/web_applications/web_app_linux.cc View 1 2 3 4 5 6 7 8 3 chunks +10 lines, -12 lines 0 comments Download
M chrome/browser/web_applications/web_app_mac.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 4 chunks +7 lines, -4 lines 0 comments Download
M chrome/browser/web_applications/web_app_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 21 chunks +92 lines, -85 lines 0 comments Download
M chrome/browser/web_applications/web_app_mac_unittest.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 14 chunks +39 lines, -33 lines 0 comments Download
M chrome/browser/web_applications/web_app_unittest.cc View 1 2 3 4 5 2 chunks +6 lines, -5 lines 0 comments Download
M chrome/browser/web_applications/web_app_win.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/web_applications/web_app_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 9 chunks +45 lines, -50 lines 0 comments Download

Messages

Total messages: 43 (11 generated)
Matt Giuca
benwells: WDYT? This is sort of a straw-man proposal (suggested on the chromium-dev thread about ...
5 years, 9 months ago (2015-03-25 02:57:14 UTC) #2
benwells
On 2015/03/25 02:57:14, Matt Giuca wrote: > benwells: WDYT? This is sort of a straw-man ...
5 years, 9 months ago (2015-03-25 04:34:13 UTC) #3
Matt Giuca
> I haven't looked closely, but I don't really like this at all. OK, that's ...
5 years, 9 months ago (2015-03-25 05:41:30 UTC) #4
benwells
On 2015/03/25 05:41:30, Matt Giuca wrote: > > I haven't looked closely, but I don't ...
5 years, 9 months ago (2015-03-25 06:03:33 UTC) #5
Matt Giuca
> From the thread it sounds like gfx::Image has bigger issues with thread safety > ...
5 years, 9 months ago (2015-03-25 06:18:21 UTC) #6
benwells
On 2015/03/25 06:18:21, Matt Giuca wrote: > > From the thread it sounds like gfx::Image ...
5 years, 9 months ago (2015-03-25 07:01:36 UTC) #7
Matt Giuca
Ah I see. Didn't notice ImageSkia's DeepCopy() before. Well, we could add a DeepCopy() method ...
5 years, 9 months ago (2015-03-25 07:08:56 UTC) #8
benwells
On 2015/03/25 07:08:56, Matt Giuca wrote: > Ah I see. Didn't notice ImageSkia's DeepCopy() before. ...
5 years, 9 months ago (2015-03-25 07:53:57 UTC) #9
Matt Giuca
> Deep copying to do image manipulation on another thread for performance reasons > does ...
5 years, 9 months ago (2015-03-25 22:36:55 UTC) #10
Matt Giuca
Wow. Just had a go at making gfx::Image deep-copyable. It's far too complex. I got ...
5 years, 9 months ago (2015-03-26 00:44:07 UTC) #11
benwells
https://codereview.chromium.org/1038573002/diff/20001/chrome/browser/ui/views/create_application_shortcut_view.cc File chrome/browser/ui/views/create_application_shortcut_view.cc (right): https://codereview.chromium.org/1038573002/diff/20001/chrome/browser/ui/views/create_application_shortcut_view.cc#newcode402 chrome/browser/ui/views/create_application_shortcut_view.cc:402: shortcut_info_.reset(new web_app::ShortcutInfo); Why do this? Put another way, why ...
5 years, 9 months ago (2015-03-26 05:28:51 UTC) #12
Matt Giuca
Hmm, just realised I forgot to update the Windows and Mac versions of web_app_*. So ...
5 years, 9 months ago (2015-03-27 08:14:47 UTC) #13
benwells
On 2015/03/27 08:14:47, Matt Giuca wrote: > Hmm, just realised I forgot to update the ...
5 years, 8 months ago (2015-03-30 01:00:43 UTC) #14
Matt Giuca
Ich. This got a LOT worse after I did the Windows and Mac integration (especially ...
5 years, 8 months ago (2015-03-31 00:16:32 UTC) #16
jackhou1
mac lgtm
5 years, 8 months ago (2015-03-31 02:39:03 UTC) #17
benwells
https://codereview.chromium.org/1038573002/diff/360001/chrome/browser/web_applications/web_app_mac.h File chrome/browser/web_applications/web_app_mac.h (right): https://codereview.chromium.org/1038573002/diff/360001/chrome/browser/web_applications/web_app_mac.h#newcode53 chrome/browser/web_applications/web_app_mac.h:53: // outlive the WebAppShortcutCreator. This is unfortunate. Do you ...
5 years, 8 months ago (2015-04-01 02:01:33 UTC) #18
Matt Giuca
https://codereview.chromium.org/1038573002/diff/360001/chrome/browser/web_applications/web_app_mac.h File chrome/browser/web_applications/web_app_mac.h (right): https://codereview.chromium.org/1038573002/diff/360001/chrome/browser/web_applications/web_app_mac.h#newcode53 chrome/browser/web_applications/web_app_mac.h:53: // outlive the WebAppShortcutCreator. Well, you do need |favicon|, ...
5 years, 8 months ago (2015-04-01 03:31:47 UTC) #19
Matt Giuca
Good now? (Assuming the mac still works.) https://codereview.chromium.org/1038573002/diff/360001/chrome/browser/web_applications/web_app_mac.h File chrome/browser/web_applications/web_app_mac.h (right): https://codereview.chromium.org/1038573002/diff/360001/chrome/browser/web_applications/web_app_mac.h#newcode53 chrome/browser/web_applications/web_app_mac.h:53: // outlive ...
5 years, 8 months ago (2015-04-01 03:54:26 UTC) #20
Matt Giuca
msw: For chrome/browser/ui/views/create_application_shortcut_view owners. Thanks!
5 years, 8 months ago (2015-04-01 03:55:35 UTC) #22
benwells
lgtm https://codereview.chromium.org/1038573002/diff/400001/chrome/browser/web_applications/web_app_mac.mm File chrome/browser/web_applications/web_app_mac.mm (right): https://codereview.chromium.org/1038573002/diff/400001/chrome/browser/web_applications/web_app_mac.mm#newcode638 chrome/browser/web_applications/web_app_mac.mm:638: file_handlers_info_(file_handlers_info) { Nit: wanna add DCHECK(shortcut_info) in here?
5 years, 8 months ago (2015-04-01 04:49:10 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1038573002/400001
5 years, 8 months ago (2015-04-01 06:29:02 UTC) #26
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/53193)
5 years, 8 months ago (2015-04-01 06:38:53 UTC) #28
Matt Giuca
https://codereview.chromium.org/1038573002/diff/400001/chrome/browser/web_applications/web_app_mac.mm File chrome/browser/web_applications/web_app_mac.mm (right): https://codereview.chromium.org/1038573002/diff/400001/chrome/browser/web_applications/web_app_mac.mm#newcode638 chrome/browser/web_applications/web_app_mac.mm:638: file_handlers_info_(file_handlers_info) { On 2015/04/01 04:49:10, benwells wrote: > Nit: ...
5 years, 8 months ago (2015-04-01 07:04:25 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1038573002/440001
5 years, 8 months ago (2015-04-01 07:19:50 UTC) #32
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/53201)
5 years, 8 months ago (2015-04-01 07:29:49 UTC) #34
msw
lgtm with nits and qs. https://codereview.chromium.org/1038573002/diff/440001/chrome/browser/ui/views/create_application_shortcut_view.cc File chrome/browser/ui/views/create_application_shortcut_view.cc (right): https://codereview.chromium.org/1038573002/diff/440001/chrome/browser/ui/views/create_application_shortcut_view.cc#newcode376 chrome/browser/ui/views/create_application_shortcut_view.cc:376: // Can happen if ...
5 years, 8 months ago (2015-04-01 16:23:00 UTC) #35
Matt Giuca
I'm on vacation and can't make code changes now. I'll do the other things you ...
5 years, 8 months ago (2015-04-01 22:52:17 UTC) #36
msw
On 2015/04/01 22:52:17, Matt Giuca (OOO until April 9) wrote: > I'm on vacation and ...
5 years, 8 months ago (2015-04-01 23:35:02 UTC) #37
Matt Giuca
Thanks. I'll just wait a week anyhow to avoid congestion with branch point.
5 years, 8 months ago (2015-04-02 00:00:58 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1038573002/460001
5 years, 8 months ago (2015-04-08 23:34:42 UTC) #41
commit-bot: I haz the power
Committed patchset #24 (id:460001)
5 years, 8 months ago (2015-04-09 04:00:54 UTC) #42
commit-bot: I haz the power
5 years, 8 months ago (2015-04-09 04:02:30 UTC) #43
Message was sent while issue was closed.
Patchset 24 (id:??) landed as
https://crrev.com/b21fe8ee736f3c2ee95b1cf181ef0a678bfcbf05
Cr-Commit-Position: refs/heads/master@{#324360}

Powered by Google App Engine
This is Rietveld 408576698