Adding cache for security origin validations in 2D/WebGL canvases

There used to be a similar cache before r168864. The old cache
system did not survive the refactoring, which caused a measurable
performance degradation on several mobile platforms.  This change
reinstates it in a refactored form.

BUG=354565
TEST=jsgamebench telemetry on android

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

git-svn-id: svn://svn.chromium.org/blink/trunk@174995 bbb929c8-8fbe-4397-9dbb-9b2b20218538