Fix data race in in-process SharedImageInterface

WeakPtrFactory::GetWeakPtr is not thread-safe, but SharedImageInterface
is expected to be called from multiple threads (without locks). Instead,
grab a single WeakPtr for the GPU thread at construction time. It's more
efficient anyway.

Bug: 870116
Change-Id: Ie550b788a4569e0ff8ed62a690e21ae52e0a1e0c
Reviewed-on: https://chromium-review.googlesource.com/c/1325566
Reviewed-by: Sunny Sachanandani <sunnyps@chromium.org>
Commit-Queue: Antoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606697}
1 file changed