Skip to content

Commit

Permalink
android: Trim instead of reset program cache on background
Browse files Browse the repository at this point in the history
Deleting the program cache is not safe because not all channels are
closed before hand. There's specific check for leaving webgl context
behind. Those context would be using a dangling program cache pointer
after that.

Bug: 756497
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I28b23f66049a92dae9fe4490f0850d2207f07f9f
Reviewed-on: https://chromium-review.googlesource.com/646238
Reviewed-by: Victor Miura <vmiura@chromium.org>
Commit-Queue: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499112}
  • Loading branch information
Bo Liu authored and Commit Bot committed Sep 1, 2017
1 parent 04cb546 commit d65c983
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gpu/ipc/service/gpu_channel_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ void GpuChannelManager::OnApplicationBackgrounded() {
for (int channel : channels_to_clear)
RemoveChannel(channel);

program_cache_.reset();
if (program_cache_)
program_cache_->Trim(0u);
}
#endif

Expand Down

0 comments on commit d65c983

Please sign in to comment.