Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(741)

Unified Diff: webkit/port/bindings/v8/v8_proxy.cpp

Issue 113085: Split V8Proxy::retrieveActiveFrame() into two methods. (Closed)
Patch Set: Darin feedback Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/port/bindings/v8/v8_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « webkit/port/bindings/v8/v8_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698