| 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 return result->value.newLocal(isolate); | 251 return result->value.newLocal(isolate); |
| 252 | 252 |
| 253 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 253 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
| 254 v8::EscapableHandleScope handleScope(isolate); | 254 v8::EscapableHandleScope handleScope(isolate); |
| 255 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); | 255 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); |
| 256 configureV8TestInterfaceNodeTemplate(templ, isolate, currentWorldType); | 256 configureV8TestInterfaceNodeTemplate(templ, isolate, currentWorldType); |
| 257 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); | 257 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); |
| 258 return handleScope.Escape(templ); | 258 return handleScope.Escape(templ); |
| 259 } | 259 } |
| 260 | 260 |
| 261 bool V8TestInterfaceNode::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate
* isolate, WrapperWorldType currentWorldType) | 261 bool V8TestInterfaceNode::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate
* isolate) |
| 262 { | 262 { |
| 263 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, currentWorldType); | 263 return V8PerIsolateData::from(isolate)->hasInstanceInMainWorld(&wrapperTypeI
nfo, jsValue) |
| 264 } | 264 || V8PerIsolateData::from(isolate)->hasInstanceInNonMainWorld(&wrapperTy
peInfo, jsValue); |
| 265 | |
| 266 bool V8TestInterfaceNode::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v
8::Isolate* isolate) | |
| 267 { | |
| 268 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, MainWorld) | |
| 269 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, IsolatedWorld) | |
| 270 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, WorkerWorld); | |
| 271 } | 265 } |
| 272 | 266 |
| 273 EventTarget* V8TestInterfaceNode::toEventTarget(v8::Handle<v8::Object> object) | 267 EventTarget* V8TestInterfaceNode::toEventTarget(v8::Handle<v8::Object> object) |
| 274 { | 268 { |
| 275 return toNative(object); | 269 return toNative(object); |
| 276 } | 270 } |
| 277 | 271 |
| 278 v8::Handle<v8::Object> V8TestInterfaceNode::createWrapper(PassRefPtr<TestInterfa
ceNode> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 272 v8::Handle<v8::Object> V8TestInterfaceNode::createWrapper(PassRefPtr<TestInterfa
ceNode> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| 279 { | 273 { |
| 280 ASSERT(impl); | 274 ASSERT(impl); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 300 fromInternalPointer(object)->deref(); | 294 fromInternalPointer(object)->deref(); |
| 301 } | 295 } |
| 302 | 296 |
| 303 template<> | 297 template<> |
| 304 v8::Handle<v8::Value> toV8NoInline(TestInterfaceNode* impl, v8::Handle<v8::Objec
t> creationContext, v8::Isolate* isolate) | 298 v8::Handle<v8::Value> toV8NoInline(TestInterfaceNode* impl, v8::Handle<v8::Objec
t> creationContext, v8::Isolate* isolate) |
| 305 { | 299 { |
| 306 return toV8(impl, creationContext, isolate); | 300 return toV8(impl, creationContext, isolate); |
| 307 } | 301 } |
| 308 | 302 |
| 309 } // namespace WebCore | 303 } // namespace WebCore |
| OLD | NEW |