| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 static void keyLocationAttributeGetterCallback(v8::Local<v8::String>, const v8::
PropertyCallbackInfo<v8::Value>& info) | 94 static void keyLocationAttributeGetterCallback(v8::Local<v8::String>, const v8::
PropertyCallbackInfo<v8::Value>& info) |
| 95 { | 95 { |
| 96 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 96 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 97 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::KeyboardE
ventKeyLocation); | 97 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::KeyboardE
ventKeyLocation); |
| 98 EventV8Internal::keyLocationAttributeGetter(info); | 98 EventV8Internal::keyLocationAttributeGetter(info); |
| 99 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 99 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 100 } | 100 } |
| 101 | 101 |
| 102 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) | 102 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 103 { | 103 { |
| 104 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestExte
ndedEvent", info.Holder(), info.GetIsolate()); |
| 104 if (info.Length() < 1) { | 105 if (info.Length() < 1) { |
| 105 throwTypeError(ExceptionMessages::failedToConstruct("TestExtendedEvent",
"An event name must be provided."), info.GetIsolate()); | 106 exceptionState.throwTypeError("An event name must be provided."); |
| 107 exceptionState.throwIfNeeded(); |
| 106 return; | 108 return; |
| 107 } | 109 } |
| 108 | 110 |
| 109 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]); | 111 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]); |
| 110 EventInit eventInit; | 112 EventInit eventInit; |
| 111 if (info.Length() >= 2) { | 113 if (info.Length() >= 2) { |
| 112 V8TRYCATCH_VOID(Dictionary, options, Dictionary(info[1], info.GetIsolate
())); | 114 V8TRYCATCH_VOID(Dictionary, options, Dictionary(info[1], info.GetIsolate
())); |
| 113 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
| 114 if (!initializeEvent(eventInit, options, exceptionState)) { | 115 if (!initializeEvent(eventInit, options, exceptionState)) { |
| 115 exceptionState.throwIfNeeded(); | 116 exceptionState.throwIfNeeded(); |
| 116 return; | 117 return; |
| 117 } | 118 } |
| 118 } | 119 } |
| 119 RefPtr<Event> event = Event::create(type, eventInit); | 120 RefPtr<Event> event = Event::create(type, eventInit); |
| 120 v8::Handle<v8::Object> wrapper = info.Holder(); | 121 v8::Handle<v8::Object> wrapper = info.Holder(); |
| 121 V8DOMWrapper::associateObjectWithWrapper<V8TestExtendedEvent>(event.release(
), &V8TestExtendedEvent::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperCon
figuration::Dependent); | 122 V8DOMWrapper::associateObjectWithWrapper<V8TestExtendedEvent>(event.release(
), &V8TestExtendedEvent::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperCon
figuration::Dependent); |
| 122 v8SetReturnValue(info, wrapper); | 123 v8SetReturnValue(info, wrapper); |
| 123 } | 124 } |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 } | 239 } |
| 239 | 240 |
| 240 template<> | 241 template<> |
| 241 v8::Handle<v8::Value> toV8NoInline(Event* impl, v8::Handle<v8::Object> creationC
ontext, v8::Isolate* isolate) | 242 v8::Handle<v8::Value> toV8NoInline(Event* impl, v8::Handle<v8::Object> creationC
ontext, v8::Isolate* isolate) |
| 242 { | 243 { |
| 243 return toV8(impl, creationContext, isolate); | 244 return toV8(impl, creationContext, isolate); |
| 244 } | 245 } |
| 245 | 246 |
| 246 } // namespace WebCore | 247 } // namespace WebCore |
| 247 #endif // ENABLE(TEST) | 248 #endif // ENABLE(TEST) |
| OLD | NEW |