Index: webkit/port/bindings/v8/v8_proxy.cpp |
diff --git a/webkit/port/bindings/v8/v8_proxy.cpp b/webkit/port/bindings/v8/v8_proxy.cpp |
index 5685375c6b45902956658a06e0358b92444d9329..8413219b0b8f7c3704a2fba17e2f3c46c832571b 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(); |