| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 class DOMWindow; | 57 class DOMWindow; |
| 58 class EventListener; | 58 class EventListener; |
| 59 class EventTarget; | 59 class EventTarget; |
| 60 class ExceptionState; | 60 class ExceptionState; |
| 61 class ExecutionContext; | 61 class ExecutionContext; |
| 62 class FlexibleArrayBufferView; | 62 class FlexibleArrayBufferView; |
| 63 class Frame; | 63 class Frame; |
| 64 class LocalDOMWindow; | 64 class LocalDOMWindow; |
| 65 class LocalFrame; | 65 class LocalFrame; |
| 66 class NodeFilter; | 66 class NodeFilter; |
| 67 class TracedValue; |
| 67 class WorkerGlobalScope; | 68 class WorkerGlobalScope; |
| 68 class WorkerOrWorkletGlobalScope; | 69 class WorkerOrWorkletGlobalScope; |
| 69 class XPathNSResolver; | 70 class XPathNSResolver; |
| 70 | 71 |
| 71 template <typename T> | 72 template <typename T> |
| 72 struct V8TypeOf { | 73 struct V8TypeOf { |
| 73 STATIC_ONLY(V8TypeOf); | 74 STATIC_ONLY(V8TypeOf); |
| 74 // |Type| provides C++ -> V8 type conversion for DOM wrappers. | 75 // |Type| provides C++ -> V8 type conversion for DOM wrappers. |
| 75 // The Blink binding code generator will generate specialized version of | 76 // The Blink binding code generator will generate specialized version of |
| 76 // V8TypeOf for each wrapper class. | 77 // V8TypeOf for each wrapper class. |
| 77 typedef void Type; | 78 typedef void Type; |
| 78 }; | 79 }; |
| 79 | 80 |
| 80 namespace TraceEvent { | |
| 81 class ConvertableToTraceFormat; | |
| 82 } | |
| 83 | |
| 84 // Helpers for throwing JavaScript TypeErrors for arity mismatches. | 81 // Helpers for throwing JavaScript TypeErrors for arity mismatches. |
| 85 CORE_EXPORT void setArityTypeError(ExceptionState&, const char* valid, unsigned
provided); | 82 CORE_EXPORT void setArityTypeError(ExceptionState&, const char* valid, unsigned
provided); |
| 86 CORE_EXPORT v8::Local<v8::Value> createMinimumArityTypeErrorForMethod(v8::Isolat
e*, const char* method, const char* type, unsigned expected, unsigned provided); | 83 CORE_EXPORT v8::Local<v8::Value> createMinimumArityTypeErrorForMethod(v8::Isolat
e*, const char* method, const char* type, unsigned expected, unsigned provided); |
| 87 v8::Local<v8::Value> createMinimumArityTypeErrorForConstructor(v8::Isolate*, con
st char* type, unsigned expected, unsigned provided); | 84 v8::Local<v8::Value> createMinimumArityTypeErrorForConstructor(v8::Isolate*, con
st char* type, unsigned expected, unsigned provided); |
| 88 CORE_EXPORT void setMinimumArityTypeError(ExceptionState&, unsigned expected, un
signed provided); | 85 CORE_EXPORT void setMinimumArityTypeError(ExceptionState&, unsigned expected, un
signed provided); |
| 89 | 86 |
| 90 template<typename CallbackInfo, typename S> | 87 template<typename CallbackInfo, typename S> |
| 91 inline void v8SetReturnValue(const CallbackInfo& info, const v8::Persistent<S>&
handle) | 88 inline void v8SetReturnValue(const CallbackInfo& info, const v8::Persistent<S>&
handle) |
| 92 { | 89 { |
| 93 info.GetReturnValue().Set(handle); | 90 info.GetReturnValue().Set(handle); |
| (...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 | 1073 |
| 1077 private: | 1074 private: |
| 1078 void ensureInitialized() const; | 1075 void ensureInitialized() const; |
| 1079 | 1076 |
| 1080 mutable int m_scriptId; | 1077 mutable int m_scriptId; |
| 1081 mutable int m_lineNumber; | 1078 mutable int m_lineNumber; |
| 1082 mutable String m_resourceName; | 1079 mutable String m_resourceName; |
| 1083 mutable v8::Local<v8::Function> m_function; | 1080 mutable v8::Local<v8::Function> m_function; |
| 1084 }; | 1081 }; |
| 1085 | 1082 |
| 1086 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(v8::Isol
ate*, ExecutionContext*, v8::Local<v8::Function>); | 1083 PassRefPtr<TracedValue> devToolsTraceEventData(v8::Isolate*, ExecutionContext*,
v8::Local<v8::Function>); |
| 1087 | 1084 |
| 1088 // Callback functions used by generated code. | 1085 // Callback functions used by generated code. |
| 1089 CORE_EXPORT void v8ConstructorAttributeGetter(v8::Local<v8::Name> propertyName,
const v8::PropertyCallbackInfo<v8::Value>&); | 1086 CORE_EXPORT void v8ConstructorAttributeGetter(v8::Local<v8::Name> propertyName,
const v8::PropertyCallbackInfo<v8::Value>&); |
| 1090 | 1087 |
| 1091 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso
late*); | 1088 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso
late*); |
| 1092 | 1089 |
| 1093 // Utiltiies for calling functions added to the V8 extras binding object. | 1090 // Utiltiies for calling functions added to the V8 extras binding object. |
| 1094 | 1091 |
| 1095 inline v8::MaybeLocal<v8::Value> v8CallExtraHelper(ScriptState* scriptState, con
st char* name, size_t numArgs, v8::Local<v8::Value>* args) | 1092 inline v8::MaybeLocal<v8::Value> v8CallExtraHelper(ScriptState* scriptState, con
st char* name, size_t numArgs, v8::Local<v8::Value>* args) |
| 1096 { | 1093 { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1110 | 1107 |
| 1111 template <size_t N> | 1108 template <size_t N> |
| 1112 v8::Local<v8::Value> v8CallExtraOrCrash(ScriptState* scriptState, const char* na
me, v8::Local<v8::Value>(&args)[N]) | 1109 v8::Local<v8::Value> v8CallExtraOrCrash(ScriptState* scriptState, const char* na
me, v8::Local<v8::Value>(&args)[N]) |
| 1113 { | 1110 { |
| 1114 return v8CallOrCrash(v8CallExtraHelper(scriptState, name, N, args)); | 1111 return v8CallOrCrash(v8CallExtraHelper(scriptState, name, N, args)); |
| 1115 } | 1112 } |
| 1116 | 1113 |
| 1117 } // namespace blink | 1114 } // namespace blink |
| 1118 | 1115 |
| 1119 #endif // V8Binding_h | 1116 #endif // V8Binding_h |
| OLD | NEW |