| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 return result->value.newLocal(isolate); | 146 return result->value.newLocal(isolate); |
| 147 | 147 |
| 148 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 148 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
| 149 v8::EscapableHandleScope handleScope(isolate); | 149 v8::EscapableHandleScope handleScope(isolate); |
| 150 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); | 150 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); |
| 151 configureV8TestInterfaceEventTargetTemplate(templ, isolate, currentWorldType
); | 151 configureV8TestInterfaceEventTargetTemplate(templ, isolate, currentWorldType
); |
| 152 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); | 152 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); |
| 153 return handleScope.Escape(templ); | 153 return handleScope.Escape(templ); |
| 154 } | 154 } |
| 155 | 155 |
| 156 bool V8TestInterfaceEventTarget::hasInstance(v8::Handle<v8::Value> jsValue, v8::
Isolate* isolate, WrapperWorldType currentWorldType) | 156 bool V8TestInterfaceEventTarget::hasInstance(v8::Handle<v8::Value> jsValue, v8::
Isolate* isolate) |
| 157 { | 157 { |
| 158 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, currentWorldType); | 158 return V8PerIsolateData::from(isolate)->hasInstanceInMainWorld(&wrapperTypeI
nfo, jsValue) |
| 159 } | 159 || V8PerIsolateData::from(isolate)->hasInstanceInNonMainWorld(&wrapperTy
peInfo, jsValue); |
| 160 | |
| 161 bool V8TestInterfaceEventTarget::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsV
alue, v8::Isolate* isolate) | |
| 162 { | |
| 163 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, MainWorld) | |
| 164 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, IsolatedWorld) | |
| 165 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, WorkerWorld); | |
| 166 } | 160 } |
| 167 | 161 |
| 168 EventTarget* V8TestInterfaceEventTarget::toEventTarget(v8::Handle<v8::Object> ob
ject) | 162 EventTarget* V8TestInterfaceEventTarget::toEventTarget(v8::Handle<v8::Object> ob
ject) |
| 169 { | 163 { |
| 170 return toNative(object); | 164 return toNative(object); |
| 171 } | 165 } |
| 172 | 166 |
| 173 v8::Handle<v8::Object> V8TestInterfaceEventTarget::createWrapper(PassRefPtr<Test
InterfaceEventTarget> impl, v8::Handle<v8::Object> creationContext, v8::Isolate*
isolate) | 167 v8::Handle<v8::Object> V8TestInterfaceEventTarget::createWrapper(PassRefPtr<Test
InterfaceEventTarget> impl, v8::Handle<v8::Object> creationContext, v8::Isolate*
isolate) |
| 174 { | 168 { |
| 175 ASSERT(impl); | 169 ASSERT(impl); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 195 fromInternalPointer(object)->deref(); | 189 fromInternalPointer(object)->deref(); |
| 196 } | 190 } |
| 197 | 191 |
| 198 template<> | 192 template<> |
| 199 v8::Handle<v8::Value> toV8NoInline(TestInterfaceEventTarget* impl, v8::Handle<v8
::Object> creationContext, v8::Isolate* isolate) | 193 v8::Handle<v8::Value> toV8NoInline(TestInterfaceEventTarget* impl, v8::Handle<v8
::Object> creationContext, v8::Isolate* isolate) |
| 200 { | 194 { |
| 201 return toV8(impl, creationContext, isolate); | 195 return toV8(impl, creationContext, isolate); |
| 202 } | 196 } |
| 203 | 197 |
| 204 } // namespace WebCore | 198 } // namespace WebCore |
| OLD | NEW |