canvas2d: Manage lifetime of SharedImage resource for StaticBitmapImage.

The StaticBitmapImage holds a reference to the SharedImage's mailbox
used by a canvas2d instance. Use a callback which wraps the
CanvasResource that owns this SharedImage to both ensure that the
SharedImage stays alive for the lifetime of the StaticBitmapImage and
the resource is recycled once all refs to the StaticBitmapImage have
been released.

R=kbr@chromium.org, piman@chromium.org

Bug: 948133
Change-Id: Ibc6f578fd8656a90b32a0267511d723f20cf745e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1610520
Commit-Queue: Khushal <khushalsagar@chromium.org>
Auto-Submit: Khushal <khushalsagar@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#660271}
7 files changed