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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8Binding.h

Issue 2723973002: Make V8Binding helpers return LocalFrame/LocalDOMWindow as appropriate (Closed)
Patch Set: . Created 3 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Ericsson AB. All rights reserved. 3 * Copyright (C) 2012 Ericsson AB. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 v8::Local<v8::Value> value, 976 v8::Local<v8::Value> value,
977 ExceptionState& exceptionState) { 977 ExceptionState& exceptionState) {
978 return toImplArray<Vector<T>>(value, 0, isolate, exceptionState); 978 return toImplArray<Vector<T>>(value, 0, isolate, exceptionState);
979 } 979 }
980 }; 980 };
981 981
982 CORE_EXPORT v8::Isolate* toIsolate(ExecutionContext*); 982 CORE_EXPORT v8::Isolate* toIsolate(ExecutionContext*);
983 CORE_EXPORT v8::Isolate* toIsolate(LocalFrame*); 983 CORE_EXPORT v8::Isolate* toIsolate(LocalFrame*);
984 984
985 CORE_EXPORT DOMWindow* toDOMWindow(v8::Isolate*, v8::Local<v8::Value>); 985 CORE_EXPORT DOMWindow* toDOMWindow(v8::Isolate*, v8::Local<v8::Value>);
986 DOMWindow* toDOMWindow(v8::Local<v8::Context>); 986 LocalDOMWindow* toLocalDOMWindow(v8::Local<v8::Context>);
987 LocalDOMWindow* enteredDOMWindow(v8::Isolate*); 987 LocalDOMWindow* enteredDOMWindow(v8::Isolate*);
988 CORE_EXPORT LocalDOMWindow* currentDOMWindow(v8::Isolate*); 988 CORE_EXPORT LocalDOMWindow* currentDOMWindow(v8::Isolate*);
989 CORE_EXPORT ExecutionContext* toExecutionContext(v8::Local<v8::Context>); 989 CORE_EXPORT ExecutionContext* toExecutionContext(v8::Local<v8::Context>);
990 CORE_EXPORT void registerToExecutionContextForModules( 990 CORE_EXPORT void registerToExecutionContextForModules(
991 ExecutionContext* (*toExecutionContextForModules)(v8::Local<v8::Context>)); 991 ExecutionContext* (*toExecutionContextForModules)(v8::Local<v8::Context>));
992 CORE_EXPORT ExecutionContext* currentExecutionContext(v8::Isolate*); 992 CORE_EXPORT ExecutionContext* currentExecutionContext(v8::Isolate*);
993 993
994 // Returns a V8 context associated with a ExecutionContext and a 994 // Returns a V8 context associated with a ExecutionContext and a
995 // DOMWrapperWorld. This method returns an empty context if there is no frame 995 // DOMWrapperWorld. This method returns an empty context if there is no frame
996 // or the frame is already detached. 996 // or the frame is already detached.
997 CORE_EXPORT v8::Local<v8::Context> toV8Context(ExecutionContext*, 997 CORE_EXPORT v8::Local<v8::Context> toV8Context(ExecutionContext*,
998 DOMWrapperWorld&); 998 DOMWrapperWorld&);
999 // Returns a V8 context associated with a Frame and a DOMWrapperWorld. 999 // Returns a V8 context associated with a Frame and a DOMWrapperWorld.
1000 // This method returns an empty context if the frame is already detached. 1000 // This method returns an empty context if the frame is already detached.
1001 CORE_EXPORT v8::Local<v8::Context> toV8Context(Frame*, DOMWrapperWorld&); 1001 CORE_EXPORT v8::Local<v8::Context> toV8Context(LocalFrame*, DOMWrapperWorld&);
1002 // Like toV8Context but also returns the context if the frame is already 1002 // Like toV8Context but also returns the context if the frame is already
1003 // detached. 1003 // detached.
1004 CORE_EXPORT v8::Local<v8::Context> toV8ContextEvenIfDetached(Frame*, 1004 CORE_EXPORT v8::Local<v8::Context> toV8ContextEvenIfDetached(LocalFrame*,
1005 DOMWrapperWorld&); 1005 DOMWrapperWorld&);
1006 1006
1007 // Returns the frame object of the window object associated with 1007 // Returns the frame object of the window object associated with
1008 // a context, if the window is currently being displayed in a Frame. 1008 // a context, if the window is currently being displayed in a Frame.
1009 CORE_EXPORT Frame* toFrameIfNotDetached(v8::Local<v8::Context>); 1009 CORE_EXPORT LocalFrame* toLocalFrameIfNotDetached(v8::Local<v8::Context>);
1010 1010
1011 // If 'storage' is non-null, it must be large enough to copy all bytes in the 1011 // If 'storage' is non-null, it must be large enough to copy all bytes in the
1012 // array buffer view into it. Use allocateFlexibleArrayBufferStorage(v8Value) 1012 // array buffer view into it. Use allocateFlexibleArrayBufferStorage(v8Value)
1013 // to allocate it using alloca() in the callers stack frame. 1013 // to allocate it using alloca() in the callers stack frame.
1014 CORE_EXPORT void toFlexibleArrayBufferView(v8::Isolate*, 1014 CORE_EXPORT void toFlexibleArrayBufferView(v8::Isolate*,
1015 v8::Local<v8::Value>, 1015 v8::Local<v8::Value>,
1016 FlexibleArrayBufferView&, 1016 FlexibleArrayBufferView&,
1017 void* storage = nullptr); 1017 void* storage = nullptr);
1018 1018
1019 // Converts a V8 value to an array (an IDL sequence) as per the WebIDL 1019 // Converts a V8 value to an array (an IDL sequence) as per the WebIDL
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1148 // If the argument isn't an object, this will crash. 1148 // If the argument isn't an object, this will crash.
1149 CORE_EXPORT v8::Local<v8::Value> freezeV8Object(v8::Local<v8::Value>, 1149 CORE_EXPORT v8::Local<v8::Value> freezeV8Object(v8::Local<v8::Value>,
1150 v8::Isolate*); 1150 v8::Isolate*);
1151 1151
1152 CORE_EXPORT v8::Local<v8::Value> fromJSONString(v8::Isolate*, 1152 CORE_EXPORT v8::Local<v8::Value> fromJSONString(v8::Isolate*,
1153 const String& stringifiedJSON, 1153 const String& stringifiedJSON,
1154 ExceptionState&); 1154 ExceptionState&);
1155 } // namespace blink 1155 } // namespace blink
1156 1156
1157 #endif // V8Binding_h 1157 #endif // V8Binding_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptState.cpp ('k') | third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698