本文整理汇总了C++中PassRefPtrWillBeRawPtr::get方法的典型用法代码示例。如果您正苦于以下问题:C++ PassRefPtrWillBeRawPtr::get方法的具体用法?C++ PassRefPtrWillBeRawPtr::get怎么用?C++ PassRefPtrWillBeRawPtr::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PassRefPtrWillBeRawPtr
的用法示例。
在下文中一共展示了PassRefPtrWillBeRawPtr::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ASSERT
v8::Handle<v8::Object> V8TestInterfaceDocument::createWrapper(PassRefPtrWillBeRawPtr<TestInterfaceDocument> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
ASSERT(impl);
ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceDocument>(impl.get(), isolate));
if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
const WrapperTypeInfo* actualInfo = ScriptWrappable::fromObject(impl.get())->typeInfo();
// Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
// the same object de-ref functions, though, so use that as the basis of the check.
RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
}
if (LocalFrame* frame = impl->frame()) {
if (frame->script().initializeMainWorld()) {
// initializeMainWorld may have created a wrapper for the object, retry from the start.
v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapper<V8TestInterfaceDocument>(impl.get(), isolate);
if (!wrapper.IsEmpty())
return wrapper;
}
}
v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
if (UNLIKELY(wrapper.IsEmpty()))
return wrapper;
installPerContextEnabledProperties(wrapper, impl.get(), isolate);
V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceDocument>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Dependent);
return wrapper;
}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_external_chromium_org,代码行数:27,代码来源:V8TestInterfaceDocument.cpp
示例2: toMouseEvent
PassRefPtrWillBeRawPtr<MouseEvent> MouseEvent::create(const AtomicString& eventType, PassRefPtrWillBeRawPtr<AbstractView> view, PassRefPtrWillBeRawPtr<Event> underlyingEvent, SimulatedClickCreationScope creationScope)
{
PlatformEvent::Modifiers modifiers = PlatformEvent::NoModifiers;
if (UIEventWithKeyState* keyStateEvent = findEventWithKeyState(underlyingEvent.get())) {
modifiers = keyStateEvent->modifiers();
}
PlatformMouseEvent::SyntheticEventType syntheticType = PlatformMouseEvent::Positionless;
int screenX = 0;
int screenY = 0;
if (underlyingEvent && underlyingEvent->isMouseEvent()) {
syntheticType = PlatformMouseEvent::RealOrIndistinguishable;
MouseEvent* mouseEvent = toMouseEvent(underlyingEvent.get());
screenX = mouseEvent->screenLocation().x();
screenY = mouseEvent->screenLocation().y();
}
double timestamp = underlyingEvent ? underlyingEvent->platformTimeStamp() : monotonicallyIncreasingTime();
RefPtrWillBeRawPtr<MouseEvent> createdEvent = MouseEvent::create(eventType, true, true, view,
0, screenX, screenY, 0, 0, 0, 0, modifiers, 0, 0, nullptr,
timestamp, syntheticType);
createdEvent->setTrusted(creationScope == SimulatedClickCreationScope::FromUserAgent);
createdEvent->setUnderlyingEvent(underlyingEvent);
if (syntheticType == PlatformMouseEvent::RealOrIndistinguishable) {
MouseEvent* mouseEvent = toMouseEvent(createdEvent->underlyingEvent());
createdEvent->initCoordinates(mouseEvent->clientLocation());
}
return createdEvent.release();
}
示例3: 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;
}
示例4: ASSERT
static v8::Local<v8::Object> createInjectedScriptHostV8Wrapper(PassRefPtrWillBeRawPtr<InjectedScriptHost> host, InjectedScriptManager* injectedScriptManager, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
ASSERT(host);
v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &V8InjectedScriptHost::wrapperTypeInfo, host->toScriptWrappableBase(), isolate);
if (UNLIKELY(wrapper.IsEmpty()))
return wrapper;
// Create a weak reference to the v8 wrapper of InspectorBackend to deref
// InspectorBackend when the wrapper is garbage collected.
InjectedScriptManager::CallbackData* callbackData = injectedScriptManager->createCallbackData(injectedScriptManager);
#if ENABLE(OILPAN)
callbackData->hostPtr = WrapperPersistent<InjectedScriptHost>::create(host.get());
#else
callbackData->host = host.get();
#endif
callbackData->handle.set(isolate, wrapper);
callbackData->handle.setWeak(callbackData, &InjectedScriptManager::setWeakCallback);
#if ENABLE(OILPAN)
V8DOMWrapper::setNativeInfoWithPersistentHandle(wrapper, &V8InjectedScriptHost::wrapperTypeInfo, host->toScriptWrappableBase(), callbackData->hostPtr);
#else
V8DOMWrapper::setNativeInfo(wrapper, &V8InjectedScriptHost::wrapperTypeInfo, host->toScriptWrappableBase());
#endif
ASSERT(V8DOMWrapper::isDOMWrapper(wrapper));
return wrapper;
}
示例5: CSSCalcBinaryOperation
CSSCalcBinaryOperation(PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> leftSide, PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> rightSide, CalcOperator op, CalculationCategory category)
: CSSCalcExpressionNode(category, isIntegerResult(leftSide.get(), rightSide.get(), op))
, m_leftSide(leftSide)
, m_rightSide(rightSide)
, m_operator(op)
{
}
示例6:
TextCheckingParagraph::TextCheckingParagraph(PassRefPtrWillBeRawPtr<Range> checkingRange, PassRefPtrWillBeRawPtr<Range> paragraphRange)
: m_checkingRange(checkingRange.get())
, m_paragraphRange(paragraphRange.get())
, m_checkingStart(-1)
, m_checkingEnd(-1)
, m_checkingLength(-1)
{
}
示例7: create
static PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> createSimplified(PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> leftSide, PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> rightSide, CalcOperator op)
{
CalculationCategory leftCategory = leftSide->category();
CalculationCategory rightCategory = rightSide->category();
ASSERT(leftCategory != CalcOther && rightCategory != CalcOther);
bool isInteger = isIntegerResult(leftSide.get(), rightSide.get(), op);
// Simplify numbers.
if (leftCategory == CalcNumber && rightCategory == CalcNumber) {
return CSSCalcPrimitiveValue::create(evaluateOperator(leftSide->doubleValue(), rightSide->doubleValue(), op), CSSPrimitiveValue::UnitType::Number, isInteger);
}
// Simplify addition and subtraction between same types.
if (op == CalcAdd || op == CalcSubtract) {
if (leftCategory == rightSide->category()) {
CSSPrimitiveValue::UnitType leftType = leftSide->typeWithCalcResolved();
if (hasDoubleValue(leftType)) {
CSSPrimitiveValue::UnitType rightType = rightSide->typeWithCalcResolved();
if (leftType == rightType)
return CSSCalcPrimitiveValue::create(evaluateOperator(leftSide->doubleValue(), rightSide->doubleValue(), op), leftType, isInteger);
CSSPrimitiveValue::UnitCategory leftUnitCategory = CSSPrimitiveValue::unitCategory(leftType);
if (leftUnitCategory != CSSPrimitiveValue::UOther && leftUnitCategory == CSSPrimitiveValue::unitCategory(rightType)) {
CSSPrimitiveValue::UnitType canonicalType = CSSPrimitiveValue::canonicalUnitTypeForCategory(leftUnitCategory);
if (canonicalType != CSSPrimitiveValue::UnitType::Unknown) {
double leftValue = leftSide->doubleValue() * CSSPrimitiveValue::conversionToCanonicalUnitsScaleFactor(leftType);
double rightValue = rightSide->doubleValue() * CSSPrimitiveValue::conversionToCanonicalUnitsScaleFactor(rightType);
return CSSCalcPrimitiveValue::create(evaluateOperator(leftValue, rightValue, op), canonicalType, isInteger);
}
}
}
}
} else {
// Simplify multiplying or dividing by a number for simplifiable types.
ASSERT(op == CalcMultiply || op == CalcDivide);
CSSCalcExpressionNode* numberSide = getNumberSide(leftSide.get(), rightSide.get());
if (!numberSide)
return create(leftSide, rightSide, op);
if (numberSide == leftSide && op == CalcDivide)
return nullptr;
CSSCalcExpressionNode* otherSide = leftSide == numberSide ? rightSide.get() : leftSide.get();
double number = numberSide->doubleValue();
if (std::isnan(number) || std::isinf(number))
return nullptr;
if (op == CalcDivide && !number)
return nullptr;
CSSPrimitiveValue::UnitType otherType = otherSide->typeWithCalcResolved();
if (hasDoubleValue(otherType))
return CSSCalcPrimitiveValue::create(evaluateOperator(otherSide->doubleValue(), number, op), otherType, isInteger);
}
return create(leftSide, rightSide, op);
}
示例8: keyframes
PassRefPtrWillBeRawPtr<AnimationEffect> makeAnimationEffect(CSSPropertyID id, PassRefPtrWillBeRawPtr<AnimatableValue> value)
{
AnimatableValueKeyframeVector keyframes(2);
keyframes[0] = AnimatableValueKeyframe::create();
keyframes[0]->setOffset(0.0);
keyframes[0]->setPropertyValue(id, value.get());
keyframes[1] = AnimatableValueKeyframe::create();
keyframes[1]->setOffset(1.0);
keyframes[1]->setPropertyValue(id, value.get());
return AnimatableValueKeyframeEffectModel::create(keyframes);
}
示例9: continueFunction
void IDBCursor::continueFunction(PassRefPtrWillBeRawPtr<IDBKey> key, PassRefPtrWillBeRawPtr<IDBKey> primaryKey, ExceptionState& exceptionState)
{
ASSERT(!primaryKey || (key && primaryKey));
if (m_transaction->isFinished() || m_transaction->isFinishing()) {
exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::transactionFinishedErrorMessage);
return;
}
if (!m_transaction->isActive()) {
exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::transactionInactiveErrorMessage);
return;
}
if (!m_gotValue) {
exceptionState.throwDOMException(InvalidStateError, IDBDatabase::noValueErrorMessage);
return;
}
if (isDeleted()) {
exceptionState.throwDOMException(InvalidStateError, IDBDatabase::sourceDeletedErrorMessage);
return;
}
if (key) {
ASSERT(m_key);
if (m_direction == WebIDBCursor::Next || m_direction == WebIDBCursor::NextNoDuplicate) {
const bool ok = m_key->isLessThan(key.get())
|| (primaryKey && m_key->isEqual(key.get()) && m_primaryKey->isLessThan(primaryKey.get()));
if (!ok) {
exceptionState.throwDOMException(DataError, "The parameter is less than or equal to this cursor's position.");
return;
}
} else {
const bool ok = key->isLessThan(m_key.get())
|| (primaryKey && key->isEqual(m_key.get()) && primaryKey->isLessThan(m_primaryKey.get()));
if (!ok) {
exceptionState.throwDOMException(DataError, "The parameter is greater than or equal to this cursor's position.");
return;
}
}
}
// FIXME: We're not using the context from when continue was called, which means the callback
// will be on the original context openCursor was called on. Is this right?
m_request->setPendingCursor(this);
m_gotValue = false;
m_backend->continueFunction(key, primaryKey, WebIDBCallbacksImpl::create(m_request).leakPtr());
}
示例10: addField
void DateTimeEditElement::addField(PassRefPtrWillBeRawPtr<DateTimeFieldElement> field)
{
if (m_fields.size() == m_fields.capacity())
return;
m_fields.append(field.get());
fieldsWrapperElement()->appendChild(field);
}
示例11: requestSucceeded
void RTCStatsRequestImpl::requestSucceeded(PassRefPtrWillBeRawPtr<RTCStatsResponseBase> response)
{
if (!m_successCallback)
return;
m_successCallback->handleEvent(static_cast<RTCStatsResponse*>(response.get()));
clear();
}
示例12: initCSSFontFace
void FontFace::initCSSFontFace(Document* document, PassRefPtrWillBeRawPtr<CSSValue> src)
{
m_cssFontFace = createCSSFontFace(this, m_unicodeRange.get());
if (m_error)
return;
// Each item in the src property's list is a single CSSFontFaceSource. Put them all into a CSSFontFace.
ASSERT(src);
ASSERT(src->isValueList());
CSSValueList* srcList = toCSSValueList(src.get());
int srcLength = srcList->length();
bool foundSVGFont = false;
for (int i = 0; i < srcLength; i++) {
// An item in the list either specifies a string (local font name) or a URL (remote font to download).
CSSFontFaceSrcValue* item = toCSSFontFaceSrcValue(srcList->item(i));
OwnPtrWillBeRawPtr<CSSFontFaceSource> source = nullptr;
#if ENABLE(SVG_FONTS)
foundSVGFont = item->isSVGFontFaceSrc() || item->svgFontFaceElement();
#endif
if (!item->isLocal()) {
Settings* settings = document ? document->frame() ? document->frame()->settings() : 0 : 0;
bool allowDownloading = foundSVGFont || (settings && settings->downloadableBinaryFontsEnabled());
if (allowDownloading && item->isSupportedFormat() && document) {
FontResource* fetched = item->fetch(document);
if (fetched) {
FontLoader* fontLoader = document->styleEngine()->fontSelector()->fontLoader();
#if ENABLE(SVG_FONTS)
if (foundSVGFont) {
source = adoptPtrWillBeNoop(new SVGRemoteFontFaceSource(item->resource(), fetched, fontLoader));
} else
#endif
{
source = adoptPtrWillBeNoop(new RemoteFontFaceSource(fetched, fontLoader));
}
}
}
} else {
#if ENABLE(SVG_FONTS)
if (item->svgFontFaceElement()) {
RefPtrWillBeRawPtr<SVGFontFaceElement> fontfaceElement = item->svgFontFaceElement();
// SVGFontFaceSource assumes that it is the case where <font-face> element resides in the same document.
// We put a RELEASE_ASSERT here as it will cause UAF if the assumption is false.
RELEASE_ASSERT(fontfaceElement->inDocument());
RELEASE_ASSERT(fontfaceElement->document() == document);
source = adoptPtrWillBeNoop(new SVGFontFaceSource(fontfaceElement.get()));
} else
#endif
{
source = adoptPtrWillBeNoop(new LocalFontFaceSource(item->resource()));
}
}
if (source)
m_cssFontFace->addSource(source.release());
}
}
示例13: setWebAnimatedAttribute
void SVGElement::setWebAnimatedAttribute(const QualifiedName& attribute, PassRefPtrWillBeRawPtr<SVGPropertyBase> value)
{
updateInstancesAnimatedAttribute(this, attribute, [&value](SVGAnimatedPropertyBase& animatedProperty) {
animatedProperty.setAnimatedValue(value.get());
});
ensureSVGRareData()->webAnimatedAttributes().add(&attribute);
}
示例14: initCSSFontFace
void FontFace::initCSSFontFace(Document* document, PassRefPtrWillBeRawPtr<CSSValue> src)
{
m_cssFontFace = createCSSFontFace(this, m_unicodeRange.get());
if (m_error)
return;
// Each item in the src property's list is a single CSSFontFaceSource. Put them all into a CSSFontFace.
ASSERT(src);
ASSERT(src->isValueList());
CSSValueList* srcList = toCSSValueList(src.get());
int srcLength = srcList->length();
for (int i = 0; i < srcLength; i++) {
// An item in the list either specifies a string (local font name) or a URL (remote font to download).
CSSFontFaceSrcValue* item = toCSSFontFaceSrcValue(srcList->item(i));
OwnPtrWillBeRawPtr<CSSFontFaceSource> source = nullptr;
if (!item->isLocal()) {
const Settings* settings = document ? document->settings() : nullptr;
bool allowDownloading = settings && settings->downloadableBinaryFontsEnabled();
if (allowDownloading && item->isSupportedFormat() && document) {
FontResource* fetched = item->fetch(document);
if (fetched) {
FontLoader* fontLoader = document->styleEngine().fontSelector()->fontLoader();
source = adoptPtrWillBeNoop(new RemoteFontFaceSource(fetched, fontLoader));
}
}
} else {
source = adoptPtrWillBeNoop(new LocalFontFaceSource(item->resource()));
}
if (source)
m_cssFontFace->addSource(source.release());
}
}
示例15: dispatchEventInternal
bool IDBDatabase::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event)
{
IDB_TRACE("IDBDatabase::dispatchEvent");
if (m_contextStopped || !executionContext())
return false;
ASSERT(event->type() == EventTypeNames::versionchange || event->type() == EventTypeNames::close);
for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) {
if (m_enqueuedEvents[i].get() == event.get())
m_enqueuedEvents.remove(i);
}
bool result = EventTarget::dispatchEventInternal(event.get());
if (event->type() == EventTypeNames::versionchange && !m_closePending && m_backend)
m_backend->versionChangeIgnored();
return result;
}