OLD | NEW |
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 class EventListener; | 56 class EventListener; |
57 class EventTarget; | 57 class EventTarget; |
58 class ExceptionState; | 58 class ExceptionState; |
59 class ExecutionContext; | 59 class ExecutionContext; |
60 class FlexibleArrayBufferView; | 60 class FlexibleArrayBufferView; |
61 class Frame; | 61 class Frame; |
62 class LocalDOMWindow; | 62 class LocalDOMWindow; |
63 class LocalFrame; | 63 class LocalFrame; |
64 class NodeFilter; | 64 class NodeFilter; |
65 class WorkerGlobalScope; | 65 class WorkerGlobalScope; |
| 66 class WorkerOrWorkletGlobalScope; |
66 class XPathNSResolver; | 67 class XPathNSResolver; |
67 | 68 |
68 template <typename T> | 69 template <typename T> |
69 struct V8TypeOf { | 70 struct V8TypeOf { |
70 STATIC_ONLY(V8TypeOf); | 71 STATIC_ONLY(V8TypeOf); |
71 // |Type| provides C++ -> V8 type conversion for DOM wrappers. | 72 // |Type| provides C++ -> V8 type conversion for DOM wrappers. |
72 // The Blink binding code generator will generate specialized version of | 73 // The Blink binding code generator will generate specialized version of |
73 // V8TypeOf for each wrapper class. | 74 // V8TypeOf for each wrapper class. |
74 typedef void Type; | 75 typedef void Type; |
75 }; | 76 }; |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 | 236 |
236 template<typename CallbackInfo> | 237 template<typename CallbackInfo> |
237 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, EventTarget* impl
) | 238 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, EventTarget* impl
) |
238 { | 239 { |
239 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf
o.GetIsolate())); | 240 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf
o.GetIsolate())); |
240 } | 241 } |
241 | 242 |
242 template<typename CallbackInfo> | 243 template<typename CallbackInfo> |
243 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, WorkerGlobalScope
* impl) | 244 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, WorkerGlobalScope
* impl) |
244 { | 245 { |
245 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf
o.GetIsolate())); | 246 v8SetReturnValue(callbackInfo, toV8((WorkerOrWorkletGlobalScope*) impl, call
backInfo.Holder(), callbackInfo.GetIsolate())); |
246 } | 247 } |
247 | 248 |
248 template<typename CallbackInfo, typename T> | 249 template<typename CallbackInfo, typename T> |
249 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<T> imp
l) | 250 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<T> imp
l) |
250 { | 251 { |
251 v8SetReturnValue(callbackInfo, impl.get()); | 252 v8SetReturnValue(callbackInfo, impl.get()); |
252 } | 253 } |
253 | 254 |
254 template<typename CallbackInfo, typename T> | 255 template<typename CallbackInfo, typename T> |
255 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, RawPtr<T> impl) | 256 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, RawPtr<T> impl) |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 | 306 |
306 template<typename CallbackInfo> | 307 template<typename CallbackInfo> |
307 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, Event
Target* impl) | 308 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, Event
Target* impl) |
308 { | 309 { |
309 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf
o.GetIsolate())); | 310 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf
o.GetIsolate())); |
310 } | 311 } |
311 | 312 |
312 template<typename CallbackInfo> | 313 template<typename CallbackInfo> |
313 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, Worke
rGlobalScope* impl) | 314 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, Worke
rGlobalScope* impl) |
314 { | 315 { |
315 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf
o.GetIsolate())); | 316 v8SetReturnValue(callbackInfo, toV8((WorkerOrWorkletGlobalScope*) impl, call
backInfo.Holder(), callbackInfo.GetIsolate())); |
316 } | 317 } |
317 | 318 |
318 template<typename CallbackInfo, typename T> | 319 template<typename CallbackInfo, typename T> |
319 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<T> impl) | 320 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<T> impl) |
320 { | 321 { |
321 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); | 322 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); |
322 } | 323 } |
323 | 324 |
324 template<typename CallbackInfo, typename T> | 325 template<typename CallbackInfo, typename T> |
325 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, RawPt
r<T> impl) | 326 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, RawPt
r<T> impl) |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 | 364 |
364 template<typename CallbackInfo> | 365 template<typename CallbackInfo> |
365 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, EventTarget*
impl, const ScriptWrappable*) | 366 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, EventTarget*
impl, const ScriptWrappable*) |
366 { | 367 { |
367 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf
o.GetIsolate())); | 368 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf
o.GetIsolate())); |
368 } | 369 } |
369 | 370 |
370 template<typename CallbackInfo> | 371 template<typename CallbackInfo> |
371 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, WorkerGlobalS
cope* impl, const ScriptWrappable*) | 372 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, WorkerGlobalS
cope* impl, const ScriptWrappable*) |
372 { | 373 { |
373 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInf
o.GetIsolate())); | 374 v8SetReturnValue(callbackInfo, toV8((WorkerOrWorkletGlobalScope*) impl, call
backInfo.Holder(), callbackInfo.GetIsolate())); |
374 } | 375 } |
375 | 376 |
376 template<typename CallbackInfo, typename T, typename Wrappable> | 377 template<typename CallbackInfo, typename T, typename Wrappable> |
377 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<T>
impl, const Wrappable* wrappable) | 378 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<T>
impl, const Wrappable* wrappable) |
378 { | 379 { |
379 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | 380 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); |
380 } | 381 } |
381 | 382 |
382 template<typename CallbackInfo, typename T, typename Wrappable> | 383 template<typename CallbackInfo, typename T, typename Wrappable> |
383 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, RawPtr<T> imp
l, const Wrappable* wrappable) | 384 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, RawPtr<T> imp
l, const Wrappable* wrappable) |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
950 | 951 |
951 CORE_EXPORT v8::Isolate* toIsolate(ExecutionContext*); | 952 CORE_EXPORT v8::Isolate* toIsolate(ExecutionContext*); |
952 CORE_EXPORT v8::Isolate* toIsolate(LocalFrame*); | 953 CORE_EXPORT v8::Isolate* toIsolate(LocalFrame*); |
953 | 954 |
954 DOMWindow* toDOMWindow(v8::Isolate*, v8::Local<v8::Value>); | 955 DOMWindow* toDOMWindow(v8::Isolate*, v8::Local<v8::Value>); |
955 DOMWindow* toDOMWindow(v8::Local<v8::Context>); | 956 DOMWindow* toDOMWindow(v8::Local<v8::Context>); |
956 LocalDOMWindow* enteredDOMWindow(v8::Isolate*); | 957 LocalDOMWindow* enteredDOMWindow(v8::Isolate*); |
957 CORE_EXPORT LocalDOMWindow* currentDOMWindow(v8::Isolate*); | 958 CORE_EXPORT LocalDOMWindow* currentDOMWindow(v8::Isolate*); |
958 CORE_EXPORT LocalDOMWindow* callingDOMWindow(v8::Isolate*); | 959 CORE_EXPORT LocalDOMWindow* callingDOMWindow(v8::Isolate*); |
959 CORE_EXPORT ExecutionContext* toExecutionContext(v8::Local<v8::Context>); | 960 CORE_EXPORT ExecutionContext* toExecutionContext(v8::Local<v8::Context>); |
| 961 CORE_EXPORT void registerToExecutionContextForModules(ExecutionContext* (*toExec
utionContextForModules)(v8::Local<v8::Context>)); |
960 CORE_EXPORT ExecutionContext* currentExecutionContext(v8::Isolate*); | 962 CORE_EXPORT ExecutionContext* currentExecutionContext(v8::Isolate*); |
961 CORE_EXPORT ExecutionContext* callingExecutionContext(v8::Isolate*); | 963 CORE_EXPORT ExecutionContext* callingExecutionContext(v8::Isolate*); |
962 | 964 |
963 // Returns a V8 context associated with a ExecutionContext and a DOMWrapperWorld
. | 965 // Returns a V8 context associated with a ExecutionContext and a DOMWrapperWorld
. |
964 // This method returns an empty context if there is no frame or the frame is alr
eady detached. | 966 // This method returns an empty context if there is no frame or the frame is alr
eady detached. |
965 CORE_EXPORT v8::Local<v8::Context> toV8Context(ExecutionContext*, DOMWrapperWorl
d&); | 967 CORE_EXPORT v8::Local<v8::Context> toV8Context(ExecutionContext*, DOMWrapperWorl
d&); |
966 // Returns a V8 context associated with a Frame and a DOMWrapperWorld. | 968 // Returns a V8 context associated with a Frame and a DOMWrapperWorld. |
967 // This method returns an empty context if the frame is already detached. | 969 // This method returns an empty context if the frame is already detached. |
968 CORE_EXPORT v8::Local<v8::Context> toV8Context(Frame*, DOMWrapperWorld&); | 970 CORE_EXPORT v8::Local<v8::Context> toV8Context(Frame*, DOMWrapperWorld&); |
969 // Like toV8Context but also returns the context if the frame is already detache
d. | 971 // Like toV8Context but also returns the context if the frame is already detache
d. |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(v8::Isol
ate*, ExecutionContext*, v8::Local<v8::Function>); | 1086 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(v8::Isol
ate*, ExecutionContext*, v8::Local<v8::Function>); |
1085 | 1087 |
1086 // Callback functions used by generated code. | 1088 // Callback functions used by generated code. |
1087 CORE_EXPORT void v8ConstructorAttributeGetter(v8::Local<v8::Name> propertyName,
const v8::PropertyCallbackInfo<v8::Value>&); | 1089 CORE_EXPORT void v8ConstructorAttributeGetter(v8::Local<v8::Name> propertyName,
const v8::PropertyCallbackInfo<v8::Value>&); |
1088 | 1090 |
1089 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso
late*); | 1091 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso
late*); |
1090 | 1092 |
1091 } // namespace blink | 1093 } // namespace blink |
1092 | 1094 |
1093 #endif // V8Binding_h | 1095 #endif // V8Binding_h |
OLD | NEW |