OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 v8::Handle<v8::Object> createUpgradeCandidateWrapper(ElementType* element, v8::H
andle<v8::Object> creationContext, v8::Isolate* isolate, v8::Handle<v8::Object>
(*createSpecificWrapper)(ElementType* element, v8::Handle<v8::Object> creationCo
ntext, v8::Isolate*)) | 79 v8::Handle<v8::Object> createUpgradeCandidateWrapper(ElementType* element, v8::H
andle<v8::Object> creationContext, v8::Isolate* isolate, v8::Handle<v8::Object>
(*createSpecificWrapper)(ElementType* element, v8::Handle<v8::Object> creationCo
ntext, v8::Isolate*)) |
80 { | 80 { |
81 if (CustomElement::isValidName(element->localName())) | 81 if (CustomElement::isValidName(element->localName())) |
82 return createDirectWrapper(element, creationContext, isolate); | 82 return createDirectWrapper(element, creationContext, isolate); |
83 if (createSpecificWrapper) | 83 if (createSpecificWrapper) |
84 return createSpecificWrapper(element, creationContext, isolate); | 84 return createSpecificWrapper(element, creationContext, isolate); |
85 return createFallbackWrapper(element, creationContext, isolate); | 85 return createFallbackWrapper(element, creationContext, isolate); |
86 } | 86 } |
87 | 87 |
88 template<typename ElementType, typename WrapperType> | 88 template<typename ElementType, typename WrapperType> |
89 v8::Handle<v8::Object> CustomElementWrapper<ElementType, WrapperType>::wrap(Pass
RefPtr<ElementType> element, v8::Handle<v8::Object> creationContext, v8::Isolate
* isolate, v8::Handle<v8::Object> (*createSpecificWrapper)(ElementType* element,
v8::Handle<v8::Object> creationContext, v8::Isolate*)) | 89 v8::Handle<v8::Object> CustomElementWrapper<ElementType, WrapperType>::wrap(Pass
RefPtrWillBeRawPtr<ElementType> element, v8::Handle<v8::Object> creationContext,
v8::Isolate* isolate, v8::Handle<v8::Object> (*createSpecificWrapper)(ElementTy
pe* element, v8::Handle<v8::Object> creationContext, v8::Isolate*)) |
90 { | 90 { |
91 ASSERT(DOMDataStore::getWrapper<V8Element>(element.get(), isolate).IsEmpty()
); | 91 ASSERT(DOMDataStore::getWrapper<V8Element>(element.get(), isolate).IsEmpty()
); |
92 | 92 |
93 // FIXME: creationContext.IsEmpty() should never happen. Remove | 93 // FIXME: creationContext.IsEmpty() should never happen. Remove |
94 // this when callers (like InspectorController::inspect) are fixed | 94 // this when callers (like InspectorController::inspect) are fixed |
95 // to never pass an empty creation context. | 95 // to never pass an empty creation context. |
96 v8::Handle<v8::Context> context = creationContext.IsEmpty() ? isolate->GetCu
rrentContext() : creationContext->CreationContext(); | 96 v8::Handle<v8::Context> context = creationContext.IsEmpty() ? isolate->GetCu
rrentContext() : creationContext->CreationContext(); |
97 | 97 |
98 if (!element->isUpgradedCustomElement() || DOMWrapperWorld::world(context).i
sIsolatedWorld()) | 98 if (!element->isUpgradedCustomElement() || DOMWrapperWorld::world(context).i
sIsolatedWorld()) |
99 return createUpgradeCandidateWrapper(element.get(), creationContext, iso
late, createSpecificWrapper); | 99 return createUpgradeCandidateWrapper(element.get(), creationContext, iso
late, createSpecificWrapper); |
(...skipping 13 matching lines...) Expand all Loading... |
113 return wrapper; | 113 return wrapper; |
114 } | 114 } |
115 | 115 |
116 template | 116 template |
117 class CustomElementWrapper<HTMLElement, V8HTMLElement>; | 117 class CustomElementWrapper<HTMLElement, V8HTMLElement>; |
118 | 118 |
119 template | 119 template |
120 class CustomElementWrapper<SVGElement, V8SVGElement>; | 120 class CustomElementWrapper<SVGElement, V8SVGElement>; |
121 | 121 |
122 } // namespace WebCore | 122 } // namespace WebCore |
OLD | NEW |