| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 return result->value.newLocal(isolate); | 184 return result->value.newLocal(isolate); |
| 185 | 185 |
| 186 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 186 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
| 187 v8::EscapableHandleScope handleScope(isolate); | 187 v8::EscapableHandleScope handleScope(isolate); |
| 188 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); | 188 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); |
| 189 configureV8TestNodeTemplate(templ, isolate, currentWorldType); | 189 configureV8TestNodeTemplate(templ, isolate, currentWorldType); |
| 190 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); | 190 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); |
| 191 return handleScope.Escape(templ); | 191 return handleScope.Escape(templ); |
| 192 } | 192 } |
| 193 | 193 |
| 194 bool V8TestNode::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate
, WrapperWorldType currentWorldType) | 194 bool V8TestNode::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate
) |
| 195 { | 195 { |
| 196 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, currentWorldType); | 196 return V8PerIsolateData::from(isolate)->hasInstanceInMainWorld(&wrapperTypeI
nfo, jsValue) |
| 197 } | 197 || V8PerIsolateData::from(isolate)->hasInstanceInNonMainWorld(&wrapperTy
peInfo, jsValue); |
| 198 | |
| 199 bool V8TestNode::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolat
e* isolate) | |
| 200 { | |
| 201 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, MainWorld) | |
| 202 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, IsolatedWorld) | |
| 203 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, WorkerWorld); | |
| 204 } | 198 } |
| 205 | 199 |
| 206 EventTarget* V8TestNode::toEventTarget(v8::Handle<v8::Object> object) | 200 EventTarget* V8TestNode::toEventTarget(v8::Handle<v8::Object> object) |
| 207 { | 201 { |
| 208 return toNative(object); | 202 return toNative(object); |
| 209 } | 203 } |
| 210 | 204 |
| 211 v8::Handle<v8::Object> V8TestNode::createWrapper(PassRefPtr<TestNode> impl, v8::
Handle<v8::Object> creationContext, v8::Isolate* isolate) | 205 v8::Handle<v8::Object> V8TestNode::createWrapper(PassRefPtr<TestNode> impl, v8::
Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| 212 { | 206 { |
| 213 ASSERT(impl); | 207 ASSERT(impl); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 233 fromInternalPointer(object)->deref(); | 227 fromInternalPointer(object)->deref(); |
| 234 } | 228 } |
| 235 | 229 |
| 236 template<> | 230 template<> |
| 237 v8::Handle<v8::Value> toV8NoInline(TestNode* impl, v8::Handle<v8::Object> creati
onContext, v8::Isolate* isolate) | 231 v8::Handle<v8::Value> toV8NoInline(TestNode* impl, v8::Handle<v8::Object> creati
onContext, v8::Isolate* isolate) |
| 238 { | 232 { |
| 239 return toV8(impl, creationContext, isolate); | 233 return toV8(impl, creationContext, isolate); |
| 240 } | 234 } |
| 241 | 235 |
| 242 } // namespace WebCore | 236 } // namespace WebCore |
| OLD | NEW |