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

Side by Side 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. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_PROXY_H__ 5 #ifndef V8_PROXY_H__
6 #define V8_PROXY_H__ 6 #define V8_PROXY_H__
7 7
8 #include <v8.h> 8 #include <v8.h>
9 #include "v8_index.h" 9 #include "v8_index.h"
10 #include "v8_custom.h" 10 #include "v8_custom.h"
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 static V8Proxy* retrieve(Frame* frame); 276 static V8Proxy* retrieve(Frame* frame);
277 // Returns V8Proxy object associated with a script execution context. 277 // Returns V8Proxy object associated with a script execution context.
278 static V8Proxy* retrieve(ScriptExecutionContext* context); 278 static V8Proxy* retrieve(ScriptExecutionContext* context);
279 279
280 // Returns the frame object of the window object associated 280 // Returns the frame object of the window object associated
281 // with the currently executing context. 281 // with the currently executing context.
282 static Frame* retrieveFrame(); 282 static Frame* retrieveFrame();
283 // Returns the frame object of the window object associated with 283 // Returns the frame object of the window object associated with
284 // a context. 284 // a context.
285 static Frame* retrieveFrame(v8::Handle<v8::Context> context); 285 static Frame* retrieveFrame(v8::Handle<v8::Context> context);
286 // Returns the frame that started JS execution. 286
287 // NOTE: cannot declare retrieveActiveFrame as inline function, 287
288 // VS complains at linking time. 288 // The two functions below retrieve WebFrame instances relating the currently
289 static Frame* retrieveActiveFrame(); 289 // executing JavaScript. Since JavaScript can make function calls across
290 // frames, though, we need to be more precise.
291 //
292 // For example, imagine that a JS function in frame A calls a function in
293 // frame B, which calls native code, which wants to know what the 'active'
294 // frame is.
295 //
296 // The 'entered context' is the context where execution first entered the
297 // script engine; the context that is at the bottom of the JS function stack.
298 // RetrieveFrameForEnteredContext() would return Frame A in our example.
299 //
300 // The 'current context' is the context the JS engine is currently inside of;
301 // the context that is at the top of the JS function stack.
302 // RetrieveFrameForCurrentContext() would return Frame B in our example.
303 //
304 // NOTE: These cannot be declared as inline function, because VS complains at
305 // linking time.
306 static Frame* retrieveFrameForEnteredContext();
307 static Frame* retrieveFrameForCurrentContext();
290 308
291 // Returns V8 Context of a frame. If none exists, creates 309 // Returns V8 Context of a frame. If none exists, creates
292 // a new context. It is potentially slow and consumes memory. 310 // a new context. It is potentially slow and consumes memory.
293 static v8::Local<v8::Context> GetContext(Frame* frame); 311 static v8::Local<v8::Context> GetContext(Frame* frame);
294 static v8::Local<v8::Context> GetCurrentContext(); 312 static v8::Local<v8::Context> GetCurrentContext();
295 313
296 // If the current context causes out of memory, JavaScript setting 314 // If the current context causes out of memory, JavaScript setting
297 // is disabled and it returns true. 315 // is disabled and it returns true.
298 static bool HandleOutOfMemory(); 316 static bool HandleOutOfMemory();
299 317
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 V8Proxy::SetDOMWrapper(args.Holder(), tag, obj.get()); 617 V8Proxy::SetDOMWrapper(args.Holder(), tag, obj.get());
600 obj->ref(); 618 obj->ref();
601 V8Proxy::SetJSWrapperForDOMObject( 619 V8Proxy::SetJSWrapperForDOMObject(
602 obj.get(), v8::Persistent<v8::Object>::New(args.Holder())); 620 obj.get(), v8::Persistent<v8::Object>::New(args.Holder()));
603 return args.Holder(); 621 return args.Holder();
604 } 622 }
605 623
606 } // namespace WebCore 624 } // namespace WebCore
607 625
608 #endif // V8_PROXY_H__ 626 #endif // V8_PROXY_H__
OLDNEW
« 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
This is Rietveld 408576698