| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 return result->value.newLocal(isolate); | 99 return result->value.newLocal(isolate); |
| 100 | 100 |
| 101 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 101 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
| 102 v8::EscapableHandleScope handleScope(isolate); | 102 v8::EscapableHandleScope handleScope(isolate); |
| 103 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); | 103 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); |
| 104 configureV8TestInterfaceDocumentTemplate(templ, isolate, currentWorldType); | 104 configureV8TestInterfaceDocumentTemplate(templ, isolate, currentWorldType); |
| 105 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); | 105 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); |
| 106 return handleScope.Escape(templ); | 106 return handleScope.Escape(templ); |
| 107 } | 107 } |
| 108 | 108 |
| 109 bool V8TestInterfaceDocument::hasInstance(v8::Handle<v8::Value> jsValue, v8::Iso
late* isolate, WrapperWorldType currentWorldType) | 109 bool V8TestInterfaceDocument::hasInstance(v8::Handle<v8::Value> jsValue, v8::Iso
late* isolate) |
| 110 { | 110 { |
| 111 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, currentWorldType); | 111 return V8PerIsolateData::from(isolate)->hasInstanceInMainWorld(&wrapperTypeI
nfo, jsValue) |
| 112 } | 112 || V8PerIsolateData::from(isolate)->hasInstanceInNonMainWorld(&wrapperTy
peInfo, jsValue); |
| 113 | |
| 114 bool V8TestInterfaceDocument::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValu
e, v8::Isolate* isolate) | |
| 115 { | |
| 116 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, MainWorld) | |
| 117 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, IsolatedWorld) | |
| 118 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, WorkerWorld); | |
| 119 } | 113 } |
| 120 | 114 |
| 121 EventTarget* V8TestInterfaceDocument::toEventTarget(v8::Handle<v8::Object> objec
t) | 115 EventTarget* V8TestInterfaceDocument::toEventTarget(v8::Handle<v8::Object> objec
t) |
| 122 { | 116 { |
| 123 return toNative(object); | 117 return toNative(object); |
| 124 } | 118 } |
| 125 | 119 |
| 126 v8::Handle<v8::Object> wrap(TestInterfaceDocument* impl, v8::Handle<v8::Object>
creationContext, v8::Isolate* isolate) | 120 v8::Handle<v8::Object> wrap(TestInterfaceDocument* impl, v8::Handle<v8::Object>
creationContext, v8::Isolate* isolate) |
| 127 { | 121 { |
| 128 ASSERT(impl); | 122 ASSERT(impl); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 fromInternalPointer(object)->deref(); | 163 fromInternalPointer(object)->deref(); |
| 170 } | 164 } |
| 171 | 165 |
| 172 template<> | 166 template<> |
| 173 v8::Handle<v8::Value> toV8NoInline(TestInterfaceDocument* impl, v8::Handle<v8::O
bject> creationContext, v8::Isolate* isolate) | 167 v8::Handle<v8::Value> toV8NoInline(TestInterfaceDocument* impl, v8::Handle<v8::O
bject> creationContext, v8::Isolate* isolate) |
| 174 { | 168 { |
| 175 return toV8(impl, creationContext, isolate); | 169 return toV8(impl, creationContext, isolate); |
| 176 } | 170 } |
| 177 | 171 |
| 178 } // namespace WebCore | 172 } // namespace WebCore |
| OLD | NEW |