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

Issue 23055007: aura: Fix raciness in context loss and recreation. (Closed)

Created:
7 years, 4 months ago by danakj
Modified:
7 years, 4 months ago
Reviewers:
piman
CC:
chromium-reviews, joi+watch-content_chromium.org, jam, sievers+watch_chromium.org, jbauman+watch_chromium.org, darin-cc_chromium.org, piman+watch_chromium.org, cc-bugs_chromium.org, danakj+watch_chromium.org, cpu_(ooo_6.6-7.5)
Visibility:
Public.

Description

aura: Fix raciness in context loss and recreation. When the context is lost, we post a task to notify observers about the loss. They should be able to use the old context to clean up after themselves. However, if anyone came and asked for the shared context in between the post task and it executing, the shared context would be destroyed immediately since we looked in the getter if the context was lost. Instead, always return the same context3d from the shared context getter, and only destroy it in the execution of the post task. Also, the OwnedTexture class holds a raw pointer to the shared context, but the OwnedTexture is not destroyed by the lost context notifications (contrary to a misleading comment). So when the context is lost, the OwnedTexture needs to drop its raw pointer to the old context 3d, which will be deleted after the notification. This ended up incorporating exactly the changes made by cpu@ in https://codereview.chromium.org/23364002/. Finally, the compositor thread shared context does not have a lost context listener in the GpuProcessContextFactory, but we want it to always be in the same share group as the main thread context. So when we lost the main thread context and drop the reference on the context3d, we will also do the same for the compositor thread's context. This way both contexts are replaced on the main thread at the same time. The next commit by the compositor will use a new context for both threads, and a commit between the loss and the post task executing will use the old contexts on both threads. R=piman BUG=275775 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=219119

Patch Set 1 #

Total comments: 2

Patch Set 2 : contextrace: -c #

Unified diffs Side-by-side diffs Delta from patch set Stats (+26 lines, -10 lines) Patch
M cc/layers/texture_layer.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/aura/gpu_process_transport_factory.cc View 1 5 chunks +25 lines, -9 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
danakj
7 years, 4 months ago (2013-08-22 00:17:12 UTC) #1
piman
LGTM, thanks! https://codereview.chromium.org/23055007/diff/1/content/browser/aura/gpu_process_transport_factory.cc File content/browser/aura/gpu_process_transport_factory.cc (right): https://codereview.chromium.org/23055007/diff/1/content/browser/aura/gpu_process_transport_factory.cc#newcode504 content/browser/aura/gpu_process_transport_factory.cc:504: // Kill shared contexts for both threads ...
7 years, 4 months ago (2013-08-22 01:14:47 UTC) #2
danakj
https://codereview.chromium.org/23055007/diff/1/content/browser/aura/gpu_process_transport_factory.cc File content/browser/aura/gpu_process_transport_factory.cc (right): https://codereview.chromium.org/23055007/diff/1/content/browser/aura/gpu_process_transport_factory.cc#newcode504 content/browser/aura/gpu_process_transport_factory.cc:504: // Kill shared contexts for both threads in tandom ...
7 years, 4 months ago (2013-08-22 01:18:04 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/23055007/8001
7 years, 4 months ago (2013-08-22 18:43:39 UTC) #4
commit-bot: I haz the power
7 years, 4 months ago (2013-08-22 21:59:40 UTC) #5
Message was sent while issue was closed.
Change committed as 219119

Powered by Google App Engine
This is Rietveld 408576698