view_manager: A couple of fixes during tear-down.
commit38981977faed3ac9ce2ec8742ce6b367e1819af2
authorsadrul <sadrul@chromium.org>
Wed, 22 Jul 2015 18:41:19 +0000 (22 11:41 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 22 Jul 2015 18:59:48 +0000 (22 18:59 +0000)
treeec57b1e7ae5308aabed72fd6338bf4a954783860
parentefdd5a7de23d3cf7d050d5120cb56b456a102f5f
view_manager: A couple of fixes during tear-down.

. The gpu control thread can outlive the CommandBufferImpl. So make sure the
  task posted to the control-thread from CommandBufferImpl uses a weak-ptr so
  that the callback does not run if the CommandBufferImpl has been destroyed.
. Stop the gpu control thread when the ViewManagerApp terminates.

BUG=504917

Review URL: https://codereview.chromium.org/1243343002

Cr-Commit-Position: refs/heads/master@{#339920}
components/view_manager/gles2/command_buffer_impl.cc
components/view_manager/gles2/command_buffer_impl.h
components/view_manager/gles2/gpu_state.cc
components/view_manager/gles2/gpu_state.h
components/view_manager/view_manager_app.cc