extensions: Use on-demand cache for ScriptContext::GetURL().
commit0d7ef9f6a37afc663282fb59707cf032ff0d4b9e
authorSadrul Habib Chowdhury <sadrul@chromium.org>
Wed, 3 Dec 2014 20:07:30 +0000 (3 15:07 -0500)
committerSadrul Habib Chowdhury <sadrul@chromium.org>
Wed, 3 Dec 2014 20:09:09 +0000 (3 20:09 +0000)
treed15883343375a9da988c424ae8ceb68ed6bcabdc
parentc117ddbdc78bba89a184e19f8e948d211b3ccdd3
extensions: Use on-demand cache for ScriptContext::GetURL().

Caching the URL in ScriptContext is necessary since it can be called after the
page has been closed. This fixes detaching event-bindings during tear-down.

BUG=434727
R=fsamuel@chromium.org, kalman@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#306658}
extensions/browser/api/web_request/web_request_api.cc
extensions/renderer/script_context.cc
extensions/renderer/script_context.h
extensions/renderer/script_context_set_unittest.cc