本文整理汇总了C++中PassRefPtrWillBeRawPtr::customElementDefinition方法的典型用法代码示例。如果您正苦于以下问题:C++ PassRefPtrWillBeRawPtr::customElementDefinition方法的具体用法?C++ PassRefPtrWillBeRawPtr::customElementDefinition怎么用?C++ PassRefPtrWillBeRawPtr::customElementDefinition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PassRefPtrWillBeRawPtr
的用法示例。
在下文中一共展示了PassRefPtrWillBeRawPtr::customElementDefinition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createUpgradeCandidateWrapper
v8::Handle<v8::Object> CustomElementWrapper<ElementType, WrapperType>::wrap(PassRefPtrWillBeRawPtr<ElementType> element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate, v8::Handle<v8::Object> (*createSpecificWrapper)(ElementType* element, v8::Handle<v8::Object> creationContext, v8::Isolate*))
{
ASSERT(DOMDataStore::getWrapper<V8Element>(element.get(), isolate).IsEmpty());
// FIXME: creationContext.IsEmpty() should never happen. Remove
// this when callers (like InspectorController::inspect) are fixed
// to never pass an empty creation context.
v8::Handle<v8::Context> context = creationContext.IsEmpty() ? isolate->GetCurrentContext() : creationContext->CreationContext();
if (!element->isUpgradedCustomElement() || DOMWrapperWorld::world(context).isIsolatedWorld())
return createUpgradeCandidateWrapper(element.get(), creationContext, isolate, createSpecificWrapper);
V8PerContextData* perContextData = V8PerContextData::from(context);
if (!perContextData)
return v8::Handle<v8::Object>();
CustomElementBinding* binding = perContextData->customElementBinding(element->customElementDefinition());
v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, binding->wrapperType(), element.get(), isolate);
if (wrapper.IsEmpty())
return v8::Handle<v8::Object>();
wrapper->SetPrototype(binding->prototype());
V8DOMWrapper::associateObjectWithWrapper<WrapperType>(element, binding->wrapperType(), wrapper, isolate, WrapperConfiguration::Dependent);
return wrapper;
}