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

Issue 1031293002: Fix crashes due to gfx::Image unsafe thread passing (Closed)

Created:
5 years, 9 months ago by Kibeom Kim (inactive)
Modified:
5 years, 8 months ago
CC:
chromium-reviews, noyau+watch_chromium.org, Theresa, lpromero
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix crashes due to gfx::Image unsafe thread passing gfx::Image has |storage_| member which is base::RefCounted, not thread safe. Thus passing around gfx::Image to other threads by copying is incorrect. Workaround by using scoped_ptr and making ImageRecord class RefCountedThreadSafe. Related discussion: https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/8LqVoXQ_2bo BUG=471800 Committed: https://crrev.com/16a0d2a22d17e3932432dab4559e63c5134aaccc Cr-Commit-Position: refs/heads/master@{#323720}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : self-review first pass. Tests & ios aren't updated yet. #

Patch Set 5 : ImageRecord constructor fix #

Patch Set 6 : Fixed tests (Android) #

Patch Set 7 : added image_record.cc as constructors & destructor are not trivial #

Patch Set 8 : gypi update #

Patch Set 9 : add image_record.cc to GN #

Patch Set 10 : Attempt #1 to fix image_store_ios_unittest.mm #

Patch Set 11 : Attempt #2 to fix image_store_ios_unittest.mm #

Total comments: 2

Patch Set 12 : Make ResizeImage to take const gfx::Image& #

Total comments: 4

Patch Set 13 : nits #

Total comments: 11

Patch Set 14 : Remove unnecessary Pass() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+231 lines, -140 lines) Patch
M chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +27 lines, -16 lines 0 comments Download
M chrome/browser/enhanced_bookmarks/android/enhanced_bookmarks_bridge.cc View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M components/enhanced_bookmarks.gypi View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M components/enhanced_bookmarks/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M components/enhanced_bookmarks/bookmark_image_service.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +11 lines, -10 lines 0 comments Download
M components/enhanced_bookmarks/bookmark_image_service.cc View 1 2 3 4 5 6 7 8 9 10 11 8 chunks +34 lines, -24 lines 0 comments Download
M components/enhanced_bookmarks/image_record.h View 1 2 3 4 5 6 2 chunks +14 lines, -5 lines 0 comments Download
A components/enhanced_bookmarks/image_record.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +28 lines, -0 lines 0 comments Download
M components/enhanced_bookmarks/image_store.h View 1 2 2 chunks +5 lines, -3 lines 0 comments Download
M components/enhanced_bookmarks/image_store.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/enhanced_bookmarks/image_store_ios_unittest.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +13 lines, -9 lines 0 comments Download
M components/enhanced_bookmarks/image_store_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 8 chunks +54 lines, -39 lines 0 comments Download
M components/enhanced_bookmarks/persistent_image_store.h View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M components/enhanced_bookmarks/persistent_image_store.cc View 1 2 5 chunks +14 lines, -13 lines 0 comments Download
M components/enhanced_bookmarks/test_image_store.h View 1 2 3 4 5 2 chunks +7 lines, -4 lines 0 comments Download
M components/enhanced_bookmarks/test_image_store.cc View 1 2 3 4 5 4 chunks +14 lines, -10 lines 0 comments Download

Messages

Total messages: 36 (13 generated)
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1031293002/40001
5 years, 8 months ago (2015-03-30 17:54:31 UTC) #2
commit-bot: I haz the power
No LGTM from a valid reviewer yet. Only full committers are accepted. Even if an ...
5 years, 8 months ago (2015-03-30 17:54:32 UTC) #4
Kibeom Kim (inactive)
Worked around by making ImageRecord base::RefCountedTheadSafe.
5 years, 8 months ago (2015-03-30 18:01:18 UTC) #6
Kibeom Kim (inactive)
ptal ready for review.
5 years, 8 months ago (2015-03-31 21:02:06 UTC) #7
noyau (Ping after 24h)
https://codereview.chromium.org/1031293002/diff/200001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc File chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc (right): https://codereview.chromium.org/1031293002/diff/200001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc#newcode216 chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc:216: scoped_ptr<gfx::Image> *image) { I'm not a fan of this ...
5 years, 8 months ago (2015-04-01 11:07:13 UTC) #8
Kibeom Kim (inactive)
https://codereview.chromium.org/1031293002/diff/200001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc File chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc (right): https://codereview.chromium.org/1031293002/diff/200001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc#newcode216 chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc:216: scoped_ptr<gfx::Image> *image) { On 2015/04/01 11:07:12, noyau wrote: > ...
5 years, 8 months ago (2015-04-01 19:09:06 UTC) #9
noyau (Ping after 24h)
lgtm with nits. https://codereview.chromium.org/1031293002/diff/220001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc File chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc (right): https://codereview.chromium.org/1031293002/diff/220001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc#newcode219 chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc:219: scoped_ptr<gfx::Image> result(new gfx::Image(image)); I know it ...
5 years, 8 months ago (2015-04-02 07:48:20 UTC) #10
Kibeom Kim (inactive)
https://codereview.chromium.org/1031293002/diff/220001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc File chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc (right): https://codereview.chromium.org/1031293002/diff/220001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc#newcode219 chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc:219: scoped_ptr<gfx::Image> result(new gfx::Image(image)); On 2015/04/02 07:48:20, noyau wrote: > ...
5 years, 8 months ago (2015-04-02 08:48:18 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1031293002/240001
5 years, 8 months ago (2015-04-02 08:48:45 UTC) #14
noyau (Ping after 24h)
https://codereview.chromium.org/1031293002/diff/240001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc File chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc (right): https://codereview.chromium.org/1031293002/diff/240001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc#newcode219 chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc:219: scoped_ptr<gfx::Image> result(new gfx::Image()); scoped_ptr<gfx::Image> result; Why the new image? ...
5 years, 8 months ago (2015-04-02 09:39:31 UTC) #15
Kibeom Kim (inactive)
https://codereview.chromium.org/1031293002/diff/240001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc File chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc (right): https://codereview.chromium.org/1031293002/diff/240001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc#newcode219 chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc:219: scoped_ptr<gfx::Image> result(new gfx::Image()); On 2015/04/02 09:39:30, noyau wrote: > ...
5 years, 8 months ago (2015-04-02 09:45:50 UTC) #17
Kibeom Kim (inactive)
https://codereview.chromium.org/1031293002/diff/240001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc File chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc (right): https://codereview.chromium.org/1031293002/diff/240001/chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc#newcode219 chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.cc:219: scoped_ptr<gfx::Image> result(new gfx::Image()); On 2015/04/02 09:45:50, Kibeom Kim wrote: ...
5 years, 8 months ago (2015-04-02 09:59:22 UTC) #18
lpromero
Rather unrelated comments to the beef of your discussion. https://codereview.chromium.org/1031293002/diff/240001/components/enhanced_bookmarks/bookmark_image_service.cc File components/enhanced_bookmarks/bookmark_image_service.cc (right): https://codereview.chromium.org/1031293002/diff/240001/components/enhanced_bookmarks/bookmark_image_service.cc#newcode233 components/enhanced_bookmarks/bookmark_image_service.cc:233: ...
5 years, 8 months ago (2015-04-02 11:48:11 UTC) #20
noyau (Ping after 24h)
https://codereview.chromium.org/1031293002/diff/240001/components/enhanced_bookmarks/bookmark_image_service.cc File components/enhanced_bookmarks/bookmark_image_service.cc (right): https://codereview.chromium.org/1031293002/diff/240001/components/enhanced_bookmarks/bookmark_image_service.cc#newcode194 components/enhanced_bookmarks/bookmark_image_service.cc:194: scoped_ptr<gfx::Image> image) { What is going to happen if ...
5 years, 8 months ago (2015-04-02 12:46:35 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1031293002/260001
5 years, 8 months ago (2015-04-02 18:39:18 UTC) #24
Kibeom Kim (inactive)
https://codereview.chromium.org/1031293002/diff/240001/components/enhanced_bookmarks/bookmark_image_service.cc File components/enhanced_bookmarks/bookmark_image_service.cc (right): https://codereview.chromium.org/1031293002/diff/240001/components/enhanced_bookmarks/bookmark_image_service.cc#newcode194 components/enhanced_bookmarks/bookmark_image_service.cc:194: scoped_ptr<gfx::Image> image) { On 2015/04/02 12:46:34, noyau wrote: > ...
5 years, 8 months ago (2015-04-02 18:41:09 UTC) #25
Kibeom Kim (inactive)
ptal
5 years, 8 months ago (2015-04-02 18:43:29 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1031293002/260001
5 years, 8 months ago (2015-04-02 20:54:26 UTC) #29
commit-bot: I haz the power
This issue passed the CQ dry run.
5 years, 8 months ago (2015-04-03 04:52:39 UTC) #31
noyau (Ping after 24h)
On 2015/04/03 04:52:39, I haz the power (commit-bot) wrote: > This issue passed the CQ ...
5 years, 8 months ago (2015-04-03 10:06:34 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1031293002/260001
5 years, 8 months ago (2015-04-03 10:07:18 UTC) #34
commit-bot: I haz the power
Committed patchset #14 (id:260001)
5 years, 8 months ago (2015-04-03 10:08:20 UTC) #35
commit-bot: I haz the power
5 years, 8 months ago (2015-04-03 20:36:49 UTC) #36
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/16a0d2a22d17e3932432dab4559e63c5134aaccc
Cr-Commit-Position: refs/heads/master@{#323720}

Powered by Google App Engine
This is Rietveld 408576698