summaryrefslogtreecommitdiffstats
path: root/webkit/port/bindings/v8/v8_proxy.cpp
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-12 00:48:58 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-12 00:48:58 +0000
commit9a7b22e6fb1d115a694616fd5a12bfe6e491664b (patch)
tree505bc1a11530c975bf45588b19aa6c3cfbc36c13 /webkit/port/bindings/v8/v8_proxy.cpp
parent08da43b40e557c42b93fe490e91ab44a73d7e0dd (diff)
downloadchromium_src-9a7b22e6fb1d115a694616fd5a12bfe6e491664b.zip
chromium_src-9a7b22e6fb1d115a694616fd5a12bfe6e491664b.tar.gz
chromium_src-9a7b22e6fb1d115a694616fd5a12bfe6e491664b.tar.bz2
Split V8Proxy::retrieveActiveFrame() into two methods.
We now have RetrieveFrameForCurrentContext() and RetrieveFrameForEnteredContext(). These terms means the same thing they do in V8::Context -- 'current' is the top of the js stack and 'entered' is the bottom. I needed 'entered' to fix a bug in extensions where if you call an extension API through the web inspector we get confused and think the web inspector's view is the one who called. Review URL: http://codereview.chromium.org/113085 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15828 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/port/bindings/v8/v8_proxy.cpp')
-rw-r--r--webkit/port/bindings/v8/v8_proxy.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/webkit/port/bindings/v8/v8_proxy.cpp b/webkit/port/bindings/v8/v8_proxy.cpp
index 5685375..8413219 100644
--- a/webkit/port/bindings/v8/v8_proxy.cpp
+++ b/webkit/port/bindings/v8/v8_proxy.cpp
@@ -622,7 +622,7 @@ void ConsoleMessageManager::ProcessDelayedMessages()
// context. If that for some bizarre reason does not
// exist, we clear the list of delayed messages to avoid
// posting messages. We still deallocate the vector.
- Frame* frame = V8Proxy::retrieveActiveFrame();
+ Frame* frame = V8Proxy::retrieveFrameForEnteredContext();
Page* page = NULL;
if (frame)
page = frame->page();
@@ -663,7 +663,7 @@ static void HandleConsoleMessage(v8::Handle<v8::Message> message,
v8::Handle<v8::Value> data)
{
// Use the frame where JavaScript is called from.
- Frame* frame = V8Proxy::retrieveActiveFrame();
+ Frame* frame = V8Proxy::retrieveFrameForEnteredContext();
if (!frame)
return;
@@ -700,7 +700,7 @@ static void ReportUnsafeAccessTo(Frame* target, DelayReporting delay)
if (!targetDocument)
return;
- Frame* source = V8Proxy::retrieveActiveFrame();
+ Frame* source = V8Proxy::retrieveFrameForEnteredContext();
if (!source || !source->document())
return; // Ignore error if the source document is gone.
@@ -1632,7 +1632,7 @@ Frame* V8Proxy::retrieveFrame(v8::Handle<v8::Context> context)
}
-Frame* V8Proxy::retrieveActiveFrame()
+Frame* V8Proxy::retrieveFrameForEnteredContext()
{
v8::Handle<v8::Context> context = v8::Context::GetEntered();
if (context.IsEmpty())
@@ -1641,6 +1641,15 @@ Frame* V8Proxy::retrieveActiveFrame()
}
+Frame* V8Proxy::retrieveFrameForCurrentContext()
+{
+ v8::Handle<v8::Context> context = v8::Context::GetCurrent();
+ if (context.IsEmpty())
+ return 0;
+ return retrieveFrame(context);
+}
+
+
Frame* V8Proxy::retrieveFrame()
{
DOMWindow* window = retrieveWindow();