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

Issue 14794006: Refactor GpuDataManagerImpl to make it thread-safe, now and forever. (Closed)

Created:
7 years, 7 months ago by Zhenyao Mo
Modified:
7 years, 7 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, apatrick_chromium, bajones
Visibility:
Public.

Description

Refactor GpuDataManagerImpl to make it thread-safe, now and forever. The original impl of GpuDataManagerImpl is thread-safe, but gradurally it regressed. In order to make sure this class is thread-safe in the future, we move all code to GpuDataManagerImplPrivate, and make GpuDataManagerImpl a simple wrapper around GpuDataManagerImplPrivate's public functions, where each function call is guarded by lock, thus thread-safe. BUG=232556 TEST=asan bots no longer crashes as described in crbug.com/232556 R=joi@chromium.org, kbr@chromium.org, piman@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=199530

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : Merged with ToT #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 5

Patch Set 7 : better diff #

Total comments: 12

Patch Set 8 : #

Patch Set 9 : component build fix #

Total comments: 11

Patch Set 10 : #

Total comments: 5

Patch Set 11 : #

Total comments: 1

Patch Set 12 : #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+590 lines, -2174 lines) Patch
M content/browser/gpu/gpu_data_manager_impl.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +35 lines, -127 lines 0 comments Download
M content/browser/gpu/gpu_data_manager_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +102 lines, -812 lines 0 comments Download
A + content/browser/gpu/gpu_data_manager_impl_private.h View 1 2 3 4 5 6 7 8 9 10 11 7 chunks +86 lines, -146 lines 0 comments Download
A + content/browser/gpu/gpu_data_manager_impl_private.cc View 1 2 3 4 5 6 7 8 9 10 11 27 chunks +177 lines, -200 lines 2 comments Download
A + content/browser/gpu/gpu_data_manager_impl_private_unittest.cc View 1 2 3 4 5 6 7 18 chunks +180 lines, -217 lines 0 comments Download
D content/browser/gpu/gpu_data_manager_impl_unittest.cc View 1 2 3 4 5 6 7 1 chunk +0 lines, -656 lines 0 comments Download
M content/browser/gpu/gpu_internals_ui.cc View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +4 lines, -15 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M content/content_tests.gypi View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M content/public/browser/gpu_data_manager_observer.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 34 (0 generated)
Zhenyao Mo
Ken, please review. Tested with --force-compositing-mode --enable-threaded-compositing, no functions in this class are called at ...
7 years, 7 months ago (2013-05-09 00:50:33 UTC) #1
dmichael (off chromium)
https://codereview.chromium.org/14794006/diff/47003/content/browser/gpu/gpu_data_manager_impl_private.h File content/browser/gpu/gpu_data_manager_impl_private.h (right): https://codereview.chromium.org/14794006/diff/47003/content/browser/gpu/gpu_data_manager_impl_private.h#newcode1 content/browser/gpu/gpu_data_manager_impl_private.h:1: // Copyright (c) 2013 The Chromium Authors. All rights ...
7 years, 7 months ago (2013-05-09 15:53:51 UTC) #2
jam
https://codereview.chromium.org/14794006/diff/47003/content/browser/gpu/gpu_data_manager_impl.cc File content/browser/gpu/gpu_data_manager_impl.cc (right): https://codereview.chromium.org/14794006/diff/47003/content/browser/gpu/gpu_data_manager_impl.cc#newcode21 content/browser/gpu/gpu_data_manager_impl.cc:21: #define DELEGATE_TO_PRIVATE_0(name) \ driveby: all these macros seem to ...
7 years, 7 months ago (2013-05-09 16:17:07 UTC) #3
Zhenyao Mo
https://codereview.chromium.org/14794006/diff/47003/content/browser/gpu/gpu_data_manager_impl.cc File content/browser/gpu/gpu_data_manager_impl.cc (right): https://codereview.chromium.org/14794006/diff/47003/content/browser/gpu/gpu_data_manager_impl.cc#newcode21 content/browser/gpu/gpu_data_manager_impl.cc:21: #define DELEGATE_TO_PRIVATE_0(name) \ On 2013/05/09 16:17:07, jam wrote: > ...
7 years, 7 months ago (2013-05-09 18:07:26 UTC) #4
dmichael (off chromium)
On Thu, May 9, 2013 at 12:07 PM, <zmo@chromium.org> wrote: > > https://codereview.chromium.**org/14794006/diff/47003/** > content/browser/gpu/gpu_data_**manager_impl.cc<https://codereview.chromium.org/14794006/diff/47003/content/browser/gpu/gpu_data_manager_impl.cc> ...
7 years, 7 months ago (2013-05-09 18:11:35 UTC) #5
Zhenyao Mo
On 2013/05/09 18:11:35, dmichael wrote: > On Thu, May 9, 2013 at 12:07 PM, <mailto:zmo@chromium.org> ...
7 years, 7 months ago (2013-05-09 18:20:57 UTC) #6
Ken Russell (switch to Gerrit)
https://codereview.chromium.org/14794006/diff/47003/content/browser/gpu/gpu_data_manager_impl.cc File content/browser/gpu/gpu_data_manager_impl.cc (right): https://codereview.chromium.org/14794006/diff/47003/content/browser/gpu/gpu_data_manager_impl.cc#newcode21 content/browser/gpu/gpu_data_manager_impl.cc:21: #define DELEGATE_TO_PRIVATE_0(name) \ On 2013/05/09 18:07:26, Zhenyao Mo wrote: ...
7 years, 7 months ago (2013-05-09 18:33:52 UTC) #7
Zhenyao Mo
Further digging through the coding styles about macro, it seems like the main reasons we ...
7 years, 7 months ago (2013-05-09 19:50:58 UTC) #8
Zhenyao Mo
kbr: the try bots results are in patch set 6. I don't think the failures ...
7 years, 7 months ago (2013-05-09 19:54:01 UTC) #9
Zhenyao Mo
piman: content/ owner.
7 years, 7 months ago (2013-05-09 19:55:09 UTC) #10
jam
On 2013/05/09 19:50:58, Zhenyao Mo wrote: > Further digging through the coding styles about macro, ...
7 years, 7 months ago (2013-05-09 20:09:58 UTC) #11
piman
https://codereview.chromium.org/14794006/diff/62002/content/browser/gpu/gpu_data_manager_impl.cc File content/browser/gpu/gpu_data_manager_impl.cc (right): https://codereview.chromium.org/14794006/diff/62002/content/browser/gpu/gpu_data_manager_impl.cc#newcode21 content/browser/gpu/gpu_data_manager_impl.cc:21: #define DELEGATE_TO_PRIVATE_0(name) \ The macros seem unnecessary. You have ...
7 years, 7 months ago (2013-05-09 20:18:23 UTC) #12
Ken Russell (switch to Gerrit)
On 2013/05/09 20:09:58, jam wrote: > On 2013/05/09 19:50:58, Zhenyao Mo wrote: > > Further ...
7 years, 7 months ago (2013-05-09 20:21:03 UTC) #13
Ken Russell (switch to Gerrit)
https://codereview.chromium.org/14794006/diff/62002/content/browser/gpu/gpu_data_manager_impl_private.cc File content/browser/gpu/gpu_data_manager_impl_private.cc (right): https://codereview.chromium.org/14794006/diff/62002/content/browser/gpu/gpu_data_manager_impl_private.cc#newcode626 content/browser/gpu/gpu_data_manager_impl_private.cc:626: // ProcessCrashed is thread-safe. It's hard to reason about ...
7 years, 7 months ago (2013-05-09 20:21:16 UTC) #14
Zhenyao Mo
Revised. please take another look. https://codereview.chromium.org/14794006/diff/62002/content/browser/gpu/gpu_data_manager_impl.cc File content/browser/gpu/gpu_data_manager_impl.cc (right): https://codereview.chromium.org/14794006/diff/62002/content/browser/gpu/gpu_data_manager_impl.cc#newcode21 content/browser/gpu/gpu_data_manager_impl.cc:21: #define DELEGATE_TO_PRIVATE_0(name) \ On ...
7 years, 7 months ago (2013-05-09 23:35:12 UTC) #15
jam
now that there are no macros, it seems that having another private class isn't needed. ...
7 years, 7 months ago (2013-05-09 23:50:12 UTC) #16
Zhenyao Mo
On 2013/05/09 23:50:12, jam wrote: > now that there are no macros, it seems that ...
7 years, 7 months ago (2013-05-09 23:57:02 UTC) #17
Ken Russell (switch to Gerrit)
On 2013/05/09 23:57:02, Zhenyao Mo wrote: > On 2013/05/09 23:50:12, jam wrote: > > now ...
7 years, 7 months ago (2013-05-10 00:04:34 UTC) #18
Zhenyao Mo
https://codereview.chromium.org/14794006/diff/61009/content/browser/gpu/gpu_data_manager_impl_private.h File content/browser/gpu/gpu_data_manager_impl_private.h (right): https://codereview.chromium.org/14794006/diff/61009/content/browser/gpu/gpu_data_manager_impl_private.h#newcode24 content/browser/gpu/gpu_data_manager_impl_private.h:24: class CONTENT_EXPORT GpuDataManagerImplPrivate { It turns out this is ...
7 years, 7 months ago (2013-05-10 00:16:49 UTC) #19
Zhenyao Mo
piman: owner review.
7 years, 7 months ago (2013-05-10 00:42:44 UTC) #20
piman
There are some patterns that bother me. Because the lock is not obvious in those ...
7 years, 7 months ago (2013-05-10 00:59:36 UTC) #21
Zhenyao Mo
https://codereview.chromium.org/14794006/diff/61009/content/browser/gpu/gpu_data_manager_impl_private.cc File content/browser/gpu/gpu_data_manager_impl_private.cc (right): https://codereview.chromium.org/14794006/diff/61009/content/browser/gpu/gpu_data_manager_impl_private.cc#newcode407 content/browser/gpu/gpu_data_manager_impl_private.cc:407: video_memory_usage_stats); On 2013/05/10 00:59:36, piman wrote: > This is ...
7 years, 7 months ago (2013-05-10 02:25:21 UTC) #22
piman
https://codereview.chromium.org/14794006/diff/86001/content/browser/gpu/gpu_data_manager_impl.h File content/browser/gpu/gpu_data_manager_impl.h (right): https://codereview.chromium.org/14794006/diff/86001/content/browser/gpu/gpu_data_manager_impl.h#newcode179 content/browser/gpu/gpu_data_manager_impl.h:179: // if the owner GpuDataManagerImpl is null. In which ...
7 years, 7 months ago (2013-05-10 02:50:28 UTC) #23
Zhenyao Mo
On 2013/05/10 02:50:28, piman wrote: > https://codereview.chromium.org/14794006/diff/86001/content/browser/gpu/gpu_data_manager_impl.h > File content/browser/gpu/gpu_data_manager_impl.h (right): > > https://codereview.chromium.org/14794006/diff/86001/content/browser/gpu/gpu_data_manager_impl.h#newcode179 > ...
7 years, 7 months ago (2013-05-10 04:27:04 UTC) #24
Zhenyao Mo
piman: please take a look again. https://codereview.chromium.org/14794006/diff/86001/content/browser/gpu/gpu_data_manager_impl.h File content/browser/gpu/gpu_data_manager_impl.h (right): https://codereview.chromium.org/14794006/diff/86001/content/browser/gpu/gpu_data_manager_impl.h#newcode180 content/browser/gpu/gpu_data_manager_impl.h:180: // This should ...
7 years, 7 months ago (2013-05-10 17:36:18 UTC) #25
Zhenyao Mo
Please wait, I just realized another issue. Need to do more work before ready for ...
7 years, 7 months ago (2013-05-10 17:53:15 UTC) #26
Zhenyao Mo
https://codereview.chromium.org/14794006/diff/101001/content/browser/gpu/gpu_data_manager_impl_private.cc File content/browser/gpu/gpu_data_manager_impl_private.cc (left): https://codereview.chromium.org/14794006/diff/101001/content/browser/gpu/gpu_data_manager_impl_private.cc#oldcode675 content/browser/gpu/gpu_data_manager_impl_private.cc:675: gpu_switch_callbacks_[i].Run(); This is another place that callbacks can re-enter ...
7 years, 7 months ago (2013-05-10 18:33:32 UTC) #27
Zhenyao Mo
Now it's ready for review. joi: content/public owner. piman: can you do the final review? ...
7 years, 7 months ago (2013-05-10 18:41:16 UTC) #28
Zhenyao Mo
Also Ken, the code changed some since your LGTM, so maybe you should also have ...
7 years, 7 months ago (2013-05-10 18:48:19 UTC) #29
piman
lgtm
7 years, 7 months ago (2013-05-10 19:11:31 UTC) #30
Jói
LGTM for content/public.
7 years, 7 months ago (2013-05-10 20:34:56 UTC) #31
Zhenyao Mo
Committed patchset #12 manually as r199530 (presubmit successful).
7 years, 7 months ago (2013-05-10 20:43:08 UTC) #32
Ken Russell (switch to Gerrit)
LGTM Very happy that the GPU switch callback was merged into the observer class. @bajones, ...
7 years, 7 months ago (2013-05-10 23:59:19 UTC) #33
Max Vujovic (mvujovic)
7 years, 7 months ago (2013-05-13 18:45:11 UTC) #34
Message was sent while issue was closed.
Looks like this change might have caused the crash described here:
https://code.google.com/p/chromium/issues/detail?id=240365

Powered by Google App Engine
This is Rietveld 408576698