| 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 14 matching lines...) Expand all Loading... |
| 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 */ | 30 */ |
| 31 | 31 |
| 32 #ifndef V8Binding_h | 32 #ifndef V8Binding_h |
| 33 #define V8Binding_h | 33 #define V8Binding_h |
| 34 | 34 |
| 35 #include "base/trace_event/trace_event.h" |
| 35 #include "bindings/core/v8/DOMDataStore.h" | 36 #include "bindings/core/v8/DOMDataStore.h" |
| 36 #include "bindings/core/v8/DOMWrapperWorld.h" | 37 #include "bindings/core/v8/DOMWrapperWorld.h" |
| 37 #include "bindings/core/v8/ExceptionMessages.h" | 38 #include "bindings/core/v8/ExceptionMessages.h" |
| 38 #include "bindings/core/v8/ExceptionState.h" | 39 #include "bindings/core/v8/ExceptionState.h" |
| 39 #include "bindings/core/v8/NativeValueTraits.h" | 40 #include "bindings/core/v8/NativeValueTraits.h" |
| 40 #include "bindings/core/v8/ScriptValue.h" | 41 #include "bindings/core/v8/ScriptValue.h" |
| 41 #include "bindings/core/v8/ScriptWrappable.h" | 42 #include "bindings/core/v8/ScriptWrappable.h" |
| 42 #include "bindings/core/v8/V8BindingMacros.h" | 43 #include "bindings/core/v8/V8BindingMacros.h" |
| 43 #include "bindings/core/v8/V8PerIsolateData.h" | 44 #include "bindings/core/v8/V8PerIsolateData.h" |
| 44 #include "bindings/core/v8/V8StringResource.h" | 45 #include "bindings/core/v8/V8StringResource.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 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 }; |
| 76 | 77 |
| 77 namespace TraceEvent { | |
| 78 class ConvertableToTraceFormat; | |
| 79 } | |
| 80 | |
| 81 // Helpers for throwing JavaScript TypeErrors for arity mismatches. | 78 // Helpers for throwing JavaScript TypeErrors for arity mismatches. |
| 82 CORE_EXPORT void setArityTypeError(ExceptionState&, const char* valid, unsigned
provided); | 79 CORE_EXPORT void setArityTypeError(ExceptionState&, const char* valid, unsigned
provided); |
| 83 CORE_EXPORT v8::Local<v8::Value> createMinimumArityTypeErrorForMethod(v8::Isolat
e*, const char* method, const char* type, unsigned expected, unsigned provided); | 80 CORE_EXPORT v8::Local<v8::Value> createMinimumArityTypeErrorForMethod(v8::Isolat
e*, const char* method, const char* type, unsigned expected, unsigned provided); |
| 84 v8::Local<v8::Value> createMinimumArityTypeErrorForConstructor(v8::Isolate*, con
st char* type, unsigned expected, unsigned provided); | 81 v8::Local<v8::Value> createMinimumArityTypeErrorForConstructor(v8::Isolate*, con
st char* type, unsigned expected, unsigned provided); |
| 85 CORE_EXPORT void setMinimumArityTypeError(ExceptionState&, unsigned expected, un
signed provided); | 82 CORE_EXPORT void setMinimumArityTypeError(ExceptionState&, unsigned expected, un
signed provided); |
| 86 | 83 |
| 87 template<typename CallbackInfo, typename S> | 84 template<typename CallbackInfo, typename S> |
| 88 inline void v8SetReturnValue(const CallbackInfo& info, const v8::Persistent<S>&
handle) | 85 inline void v8SetReturnValue(const CallbackInfo& info, const v8::Persistent<S>&
handle) |
| 89 { | 86 { |
| 90 info.GetReturnValue().Set(handle); | 87 info.GetReturnValue().Set(handle); |
| (...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1074 | 1071 |
| 1075 private: | 1072 private: |
| 1076 void ensureInitialized() const; | 1073 void ensureInitialized() const; |
| 1077 | 1074 |
| 1078 mutable int m_scriptId; | 1075 mutable int m_scriptId; |
| 1079 mutable int m_lineNumber; | 1076 mutable int m_lineNumber; |
| 1080 mutable String m_resourceName; | 1077 mutable String m_resourceName; |
| 1081 mutable v8::Local<v8::Function> m_function; | 1078 mutable v8::Local<v8::Function> m_function; |
| 1082 }; | 1079 }; |
| 1083 | 1080 |
| 1084 PassRefPtr<TraceEvent::ConvertableToTraceFormat> devToolsTraceEventData(v8::Isol
ate*, ExecutionContext*, v8::Local<v8::Function>); | 1081 scoped_refptr<base::trace_event::ConvertableToTraceFormat> devToolsTraceEventDat
a(v8::Isolate*, ExecutionContext*, v8::Local<v8::Function>); |
| 1085 | 1082 |
| 1086 // Callback functions used by generated code. | 1083 // Callback functions used by generated code. |
| 1087 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>&); |
| 1088 | 1085 |
| 1089 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso
late*); | 1086 typedef void (*InstallTemplateFunction)(v8::Local<v8::FunctionTemplate>, v8::Iso
late*); |
| 1090 | 1087 |
| 1091 } // namespace blink | 1088 } // namespace blink |
| 1092 | 1089 |
| 1093 #endif // V8Binding_h | 1090 #endif // V8Binding_h |
| OLD | NEW |