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

Issue 2252163003: Update Context Client Visibility to use Scoped Pattern (Closed)

Created:
4 years, 4 months ago by ericrk
Modified:
4 years, 3 months ago
Reviewers:
danakj, no sievers, Wez, boliu
CC:
chromium-reviews, piman+watch_chromium.org, cc-bugs_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Update Context Client Visibility to use Scoped Pattern Currently, ContextSupport::SetClientVisibile relies on the caller remembering to pair visible/not-visible calls. Failure to do so will result in a "leak", where the context support will always think there are visible clients. To avoid this, SetClientVisible is now only accessible through the ScopedContextClientVisibility object, which ensures that visible/ not-visible calls are paired. CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel

Patch Set 1 #

Patch Set 2 : fixes #

Patch Set 3 : rename #

Patch Set 4 : refactor #

Patch Set 5 : cleanup #

Total comments: 24

Patch Set 6 : feedback #

Patch Set 7 : feedback #

Total comments: 8

Patch Set 8 : feedback #

Patch Set 9 : rebase #

Patch Set 10 : Simplify cc context cleanup #

Total comments: 2

Patch Set 11 : feedback #

Patch Set 12 : fix webview #

Unified diffs Side-by-side diffs Delta from patch set Stats (+265 lines, -114 lines) Patch
M android_webview/browser/aw_render_thread_context_provider.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M blimp/client/feature/compositor/blimp_context_provider.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M cc/output/gl_renderer.h View 1 2 3 4 5 3 chunks +6 lines, -0 lines 0 comments Download
M cc/output/gl_renderer.cc View 1 2 3 4 5 6 7 8 9 4 chunks +19 lines, -10 lines 0 comments Download
M cc/output/gl_renderer_unittest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +24 lines, -7 lines 0 comments Download
M cc/test/test_context_support.h View 1 2 3 4 5 6 7 8 9 3 chunks +6 lines, -4 lines 0 comments Download
M cc/test/test_context_support.cc View 1 2 3 4 5 6 7 8 9 3 chunks +35 lines, -14 lines 0 comments Download
M cc/test/test_in_process_context_provider.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_host_impl.h View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_host_impl.cc View 1 2 3 4 5 6 7 8 9 6 chunks +35 lines, -21 lines 0 comments Download
M cc/trees/layer_tree_host_unittest.cc View 1 2 3 4 5 6 7 8 9 3 chunks +29 lines, -13 lines 0 comments Download
M content/common/gpu/client/context_provider_command_buffer.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/android/synchronous_compositor_output_surface.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +1 line, -7 lines 0 comments Download
M gpu/command_buffer/client/context_support.h View 1 2 3 4 5 6 7 8 9 2 chunks +6 lines, -7 lines 0 comments Download
M gpu/command_buffer/client/gles2_implementation.h View 1 2 3 4 5 6 7 8 9 3 chunks +6 lines, -5 lines 0 comments Download
M gpu/command_buffer/client/gles2_implementation.cc View 1 2 3 4 5 6 7 8 9 6 chunks +42 lines, -15 lines 0 comments Download
M gpu/command_buffer/client/gles2_implementation_unittest.cc View 1 2 3 4 5 6 7 8 9 3 chunks +40 lines, -11 lines 0 comments Download
M ui/compositor/test/in_process_context_provider.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 41 (26 generated)
ericrk
Here's an idea for using a scoped pattern to ensure correctness. It seems to work ...
4 years, 4 months ago (2016-08-17 21:26:04 UTC) #4
ericrk
Ok, cleaned this up a bit more. Let me know how this looks. Thanks!
4 years, 4 months ago (2016-08-18 18:15:33 UTC) #5
danakj
https://codereview.chromium.org/2252163003/diff/80001/cc/output/gl_renderer.cc File cc/output/gl_renderer.cc (right): https://codereview.chromium.org/2252163003/diff/80001/cc/output/gl_renderer.cc#newcode151 cc/output/gl_renderer.cc:151: if (is_visible && *scoped_visibility) These 2 can be combined ...
4 years, 4 months ago (2016-08-18 21:39:44 UTC) #6
ericrk
Decided to keep clearing the compositor context in LTHI, 128k isn't too much, but enough ...
4 years, 4 months ago (2016-08-19 17:23:19 UTC) #10
danakj
LGTM https://codereview.chromium.org/2252163003/diff/160001/cc/test/test_context_support.cc File cc/test/test_context_support.cc (right): https://codereview.chromium.org/2252163003/diff/160001/cc/test/test_context_support.cc#newcode31 cc/test/test_context_support.cc:31: // |initial_context_support_| is just stored/used for sanity-checking Release. ...
4 years, 4 months ago (2016-08-19 18:29:55 UTC) #11
ericrk
https://codereview.chromium.org/2252163003/diff/160001/cc/test/test_context_support.cc File cc/test/test_context_support.cc (right): https://codereview.chromium.org/2252163003/diff/160001/cc/test/test_context_support.cc#newcode31 cc/test/test_context_support.cc:31: // |initial_context_support_| is just stored/used for sanity-checking Release. On ...
4 years, 4 months ago (2016-08-19 18:49:58 UTC) #12
ericrk
Made some changes here to remove SetAggressivelyFreeResources and handle this internally in GLES2Implementation based on ...
4 years, 4 months ago (2016-08-23 22:29:41 UTC) #20
ericrk
On 2016/08/23 22:29:41, ericrk wrote: > Made some changes here to remove SetAggressivelyFreeResources and handle ...
4 years, 4 months ago (2016-08-23 22:53:42 UTC) #21
ericrk
Ok, this has been refactored to simplify the CC calling patterns and the ContextSupport interface. ...
4 years, 4 months ago (2016-08-24 16:43:15 UTC) #26
danakj
LGTM thanks for cleaning up that API https://codereview.chromium.org/2252163003/diff/320001/blimp/client/feature/compositor/blimp_context_provider.cc File blimp/client/feature/compositor/blimp_context_provider.cc (right): https://codereview.chromium.org/2252163003/diff/320001/blimp/client/feature/compositor/blimp_context_provider.cc#newcode99 blimp/client/feature/compositor/blimp_context_provider.cc:99: ContextSupport()->TrimResources(); Did ...
4 years, 4 months ago (2016-08-24 20:12:49 UTC) #27
ericrk
Adding additional reviewers for small tweaks to the various ContextProviders: +wez for blimp/ +boliu for ...
4 years, 4 months ago (2016-08-24 21:58:52 UTC) #29
boliu
lgtm
4 years, 3 months ago (2016-08-24 22:15:40 UTC) #32
Wez
blimp/ LGTM
4 years, 3 months ago (2016-08-24 22:38:51 UTC) #35
ericrk
Bo, I made an additional change to synchronous_compositor_output_surface.cc if you'd like to review - forgot ...
4 years, 3 months ago (2016-08-25 17:30:24 UTC) #36
boliu
4 years, 3 months ago (2016-08-25 19:40:53 UTC) #37
On 2016/08/25 17:30:24, ericrk wrote:
> Bo, I made an additional change to synchronous_compositor_output_surface.cc if
> you'd like to review - forgot that we called SetAggressivelyFreeResources
there
> as well.
> 
> New code is a bit simpler and should provide the same cleanup. I considered
> adding visibility tracking to the webview code, but given that it uses the
> synchronous compositor, it seems unlikely that additional work will come in
> after we set memory limit to 0, so this seemed like overkill... WDYT?

seems fine in my head too :)

lgtm

Powered by Google App Engine
This is Rietveld 408576698