cc::DisplayResourceProvider: Add {Lock,Unlock}ForExternalUse.

Add {Lock,Unlock}ForExternalUse to replace
GetResourceMetadataForExternalUse. It is because the sync_token for
GetResourceMetadataForExternalUse should be considered as unverified sync
token due to the task (which will release the token) is not scheduled
when calling GetResourceMetadataForExternalUse. It will cause
problems, if the we return resources with the token to child before
calling the SwapBuffers(which will schedule a GPU task to SwapBuffers
and release the sync token). This case will not happen right now, but it
is better to not assume it will not happen in future.

Bug: 824382
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I59de9191d3405ca64704b00bedd71564812394a4
Reviewed-on: https://chromium-review.googlesource.com/986505
Reviewed-by: enne <enne@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548641}
6 files changed