Chromium Code Reviews

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

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.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « webkit/port/bindings/v8/v8_custom.cpp ('k') | webkit/port/bindings/v8/v8_proxy.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/port/bindings/v8/v8_proxy.h
diff --git a/webkit/port/bindings/v8/v8_proxy.h b/webkit/port/bindings/v8/v8_proxy.h
index 01b3116e9a3d0fac0048572a9a2fda28d43b1855..ea32708448a2d0253be509b6c05d06acab230a0d 100644
--- a/webkit/port/bindings/v8/v8_proxy.h
+++ b/webkit/port/bindings/v8/v8_proxy.h
@@ -283,10 +283,28 @@ class V8Proxy {
// Returns the frame object of the window object associated with
// a context.
static Frame* retrieveFrame(v8::Handle<v8::Context> context);
- // Returns the frame that started JS execution.
- // NOTE: cannot declare retrieveActiveFrame as inline function,
- // VS complains at linking time.
- static Frame* retrieveActiveFrame();
+
+
+ // The two functions below retrieve WebFrame instances relating the currently
+ // executing JavaScript. Since JavaScript can make function calls across
+ // frames, though, we need to be more precise.
+ //
+ // For example, imagine that a JS function in frame A calls a function in
+ // frame B, which calls native code, which wants to know what the 'active'
+ // frame is.
+ //
+ // The 'entered context' is the context where execution first entered the
+ // script engine; the context that is at the bottom of the JS function stack.
+ // RetrieveFrameForEnteredContext() would return Frame A in our example.
+ //
+ // The 'current context' is the context the JS engine is currently inside of;
+ // the context that is at the top of the JS function stack.
+ // RetrieveFrameForCurrentContext() would return Frame B in our example.
+ //
+ // NOTE: These cannot be declared as inline function, because VS complains at
+ // linking time.
+ static Frame* retrieveFrameForEnteredContext();
+ static Frame* retrieveFrameForCurrentContext();
// Returns V8 Context of a frame. If none exists, creates
// a new context. It is potentially slow and consumes memory.
« no previous file with comments | « webkit/port/bindings/v8/v8_custom.cpp ('k') | webkit/port/bindings/v8/v8_proxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine