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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 #include "wtf/text/AtomicString.h" | 50 #include "wtf/text/AtomicString.h" |
51 #include <v8.h> | 51 #include <v8.h> |
52 | 52 |
53 namespace blink { | 53 namespace blink { |
54 | 54 |
55 class DOMWindow; | 55 class DOMWindow; |
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 Frame; | 61 class Frame; |
61 class LocalDOMWindow; | 62 class LocalDOMWindow; |
62 class LocalFrame; | 63 class LocalFrame; |
63 class NodeFilter; | 64 class NodeFilter; |
64 class WorkerGlobalScope; | 65 class WorkerGlobalScope; |
65 class XPathNSResolver; | 66 class XPathNSResolver; |
66 | 67 |
67 template <typename T> | 68 template <typename T> |
68 struct V8TypeOf { | 69 struct V8TypeOf { |
69 // |Type| provides C++ -> V8 type conversion for DOM wrappers. | 70 // |Type| provides C++ -> V8 type conversion for DOM wrappers. |
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 CORE_EXPORT v8::Local<v8::Context> toV8Context(Frame*, DOMWrapperWorld&); | 967 CORE_EXPORT v8::Local<v8::Context> toV8Context(Frame*, DOMWrapperWorld&); |
967 // Like toV8Context but also returns the context if the frame is already detache
d. | 968 // Like toV8Context but also returns the context if the frame is already detache
d. |
968 CORE_EXPORT v8::Local<v8::Context> toV8ContextEvenIfDetached(Frame*, DOMWrapperW
orld&); | 969 CORE_EXPORT v8::Local<v8::Context> toV8ContextEvenIfDetached(Frame*, DOMWrapperW
orld&); |
969 | 970 |
970 // Returns the frame object of the window object associated with | 971 // Returns the frame object of the window object associated with |
971 // a context, if the window is currently being displayed in a Frame. | 972 // a context, if the window is currently being displayed in a Frame. |
972 CORE_EXPORT Frame* toFrameIfNotDetached(v8::Local<v8::Context>); | 973 CORE_EXPORT Frame* toFrameIfNotDetached(v8::Local<v8::Context>); |
973 | 974 |
974 CORE_EXPORT EventTarget* toEventTarget(v8::Isolate*, v8::Local<v8::Value>); | 975 CORE_EXPORT EventTarget* toEventTarget(v8::Isolate*, v8::Local<v8::Value>); |
975 | 976 |
| 977 // If 'storage' is non-null, it must be large enough to copy all bytes in the |
| 978 // array buffer view into it. Use allocateFlexibleArrayBufferStorage(v8Value) |
| 979 // to allocate it using alloca() in the callers stack frame. |
| 980 CORE_EXPORT void toFlexibleArrayBufferView(v8::Isolate*, v8::Local<v8::Value>, F
lexibleArrayBufferView&, void* storage = nullptr); |
| 981 |
976 // If the current context causes out of memory, JavaScript setting | 982 // If the current context causes out of memory, JavaScript setting |
977 // is disabled and it returns true. | 983 // is disabled and it returns true. |
978 bool handleOutOfMemory(); | 984 bool handleOutOfMemory(); |
979 void crashIfV8IsDead(); | 985 void crashIfV8IsDead(); |
980 | 986 |
981 inline bool isUndefinedOrNull(v8::Local<v8::Value> value) | 987 inline bool isUndefinedOrNull(v8::Local<v8::Value> value) |
982 { | 988 { |
983 return value.IsEmpty() || value->IsNull() || value->IsUndefined(); | 989 return value.IsEmpty() || value->IsNull() || value->IsUndefined(); |
984 } | 990 } |
985 v8::Local<v8::Function> getBoundFunction(v8::Local<v8::Function>); | 991 v8::Local<v8::Function> getBoundFunction(v8::Local<v8::Function>); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(v8::Isol
ate*, ExecutionContext*, v8::Local<v8::Function>); | 1081 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(v8::Isol
ate*, ExecutionContext*, v8::Local<v8::Function>); |
1076 | 1082 |
1077 // Callback functions used by generated code. | 1083 // Callback functions used by generated code. |
1078 CORE_EXPORT void v8ConstructorAttributeGetter(v8::Local<v8::Name> propertyName,
const v8::PropertyCallbackInfo<v8::Value>&); | 1084 CORE_EXPORT void v8ConstructorAttributeGetter(v8::Local<v8::Name> propertyName,
const v8::PropertyCallbackInfo<v8::Value>&); |
1079 | 1085 |
1080 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso
late*); | 1086 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso
late*); |
1081 | 1087 |
1082 } // namespace blink | 1088 } // namespace blink |
1083 | 1089 |
1084 #endif // V8Binding_h | 1090 #endif // V8Binding_h |
OLD | NEW |