本文整理汇总了C++中OwnPtrWillBeRawPtr::release方法的典型用法代码示例。如果您正苦于以下问题:C++ OwnPtrWillBeRawPtr::release方法的具体用法?C++ OwnPtrWillBeRawPtr::release怎么用?C++ OwnPtrWillBeRawPtr::release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OwnPtrWillBeRawPtr
的用法示例。
在下文中一共展示了OwnPtrWillBeRawPtr::release方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WorkerStateClient
WorkerInspectorController::WorkerInspectorController(WorkerGlobalScope* workerGlobalScope)
: m_workerGlobalScope(workerGlobalScope)
, m_stateClient(adoptPtr(new WorkerStateClient(workerGlobalScope)))
, m_state(adoptPtrWillBeNoop(new InspectorCompositeState(m_stateClient.get())))
, m_instrumentingAgents(InstrumentingAgents::create())
, m_injectedScriptManager(InjectedScriptManager::createForWorker())
, m_workerThreadDebugger(adoptPtr(new WorkerThreadDebugger(workerGlobalScope->thread())))
, m_agents(m_instrumentingAgents.get(), m_state.get())
, m_inspectorTaskRunner(adoptPtr(new InspectorTaskRunner(v8::Isolate::GetCurrent())))
, m_beforeInitlizedScope(adoptPtr(new InspectorTaskRunner::IgnoreInterruptsScope(m_inspectorTaskRunner.get())))
, m_paused(false)
{
OwnPtrWillBeRawPtr<WorkerRuntimeAgent> workerRuntimeAgent = WorkerRuntimeAgent::create(m_injectedScriptManager.get(), m_workerThreadDebugger->debugger(), workerGlobalScope, this);
m_workerRuntimeAgent = workerRuntimeAgent.get();
m_agents.append(workerRuntimeAgent.release());
OwnPtrWillBeRawPtr<WorkerDebuggerAgent> workerDebuggerAgent = WorkerDebuggerAgent::create(m_workerThreadDebugger.get(), workerGlobalScope, m_injectedScriptManager.get());
m_workerDebuggerAgent = workerDebuggerAgent.get();
m_agents.append(workerDebuggerAgent.release());
m_asyncCallTracker = adoptPtrWillBeNoop(new AsyncCallTracker(m_workerDebuggerAgent->v8DebuggerAgent(), m_instrumentingAgents.get()));
v8::Isolate* isolate = workerGlobalScope->thread()->isolate();
m_agents.append(InspectorProfilerAgent::create(isolate, m_injectedScriptManager.get(), 0));
m_agents.append(InspectorHeapProfilerAgent::create(isolate, m_injectedScriptManager.get()));
OwnPtrWillBeRawPtr<WorkerConsoleAgent> workerConsoleAgent = WorkerConsoleAgent::create(m_injectedScriptManager.get(), workerGlobalScope);
WorkerConsoleAgent* workerConsoleAgentPtr = workerConsoleAgent.get();
workerConsoleAgentPtr->setDebuggerAgent(m_workerDebuggerAgent->v8DebuggerAgent());
m_agents.append(workerConsoleAgent.release());
m_agents.append(InspectorTimelineAgent::create());
m_injectedScriptManager->injectedScriptHost()->init(workerConsoleAgentPtr, m_workerDebuggerAgent->v8DebuggerAgent(), nullptr, m_workerThreadDebugger->debugger(), adoptPtr(new WorkerInjectedScriptHostClient()));
}
示例2: applyEffects
void KeyframeEffect::applyEffects()
{
ASSERT(isInEffect());
ASSERT(animation());
if (!m_target || !m_model)
return;
// Cancel composited animation of transform if a motion path has been introduced on the element.
if (m_target->computedStyle()
&& m_target->computedStyle()->hasMotionPath()
&& animation()->hasActiveAnimationsOnCompositor()
&& animation()->affects(*m_target, CSSPropertyTransform)) {
animation()->cancelAnimationOnCompositor();
}
double iteration = currentIteration();
ASSERT(iteration >= 0);
OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> interpolations = m_sampledEffect ? m_sampledEffect->mutableInterpolations() : nullptr;
// FIXME: Handle iteration values which overflow int.
m_model->sample(static_cast<int>(iteration), timeFraction(), iterationDuration(), interpolations);
if (m_sampledEffect) {
m_sampledEffect->setInterpolations(interpolations.release());
} else if (interpolations && !interpolations->isEmpty()) {
OwnPtrWillBeRawPtr<SampledEffect> sampledEffect = SampledEffect::create(this, interpolations.release());
m_sampledEffect = sampledEffect.get();
ensureAnimationStack(m_target).add(sampledEffect.release());
} else {
return;
}
m_target->setNeedsAnimationStyleRecalc();
if (m_target->isSVGElement())
m_sampledEffect->applySVGUpdate(toSVGElement(*m_target));
}
示例3: InspectorCompositeState
InspectorController::InspectorController(Page* page, InspectorClient* inspectorClient)
: m_instrumentingAgents(InstrumentingAgents::create())
, m_injectedScriptManager(InjectedScriptManager::createForPage())
, m_state(adoptPtrWillBeNoop(new InspectorCompositeState(inspectorClient)))
, m_overlay(InspectorOverlay::create(page, inspectorClient))
, m_cssAgent(nullptr)
, m_resourceAgent(nullptr)
, m_layerTreeAgent(nullptr)
, m_inspectorFrontendClient(nullptr)
, m_page(page)
, m_inspectorClient(inspectorClient)
, m_agents(m_instrumentingAgents.get(), m_state.get())
, m_isUnderTest(false)
, m_deferredAgentsInitialized(false)
{
InjectedScriptManager* injectedScriptManager = m_injectedScriptManager.get();
InspectorOverlay* overlay = m_overlay.get();
m_agents.append(InspectorInspectorAgent::create(m_page, injectedScriptManager));
OwnPtrWillBeRawPtr<InspectorPageAgent> pageAgentPtr(InspectorPageAgent::create(m_page, injectedScriptManager, inspectorClient, overlay));
m_pageAgent = pageAgentPtr.get();
m_agents.append(pageAgentPtr.release());
OwnPtrWillBeRawPtr<InspectorDOMAgent> domAgentPtr(InspectorDOMAgent::create(m_pageAgent, injectedScriptManager, overlay));
m_domAgent = domAgentPtr.get();
m_agents.append(domAgentPtr.release());
OwnPtrWillBeRawPtr<InspectorLayerTreeAgent> layerTreeAgentPtr(InspectorLayerTreeAgent::create(m_page));
m_layerTreeAgent = layerTreeAgentPtr.get();
m_agents.append(layerTreeAgentPtr.release());
OwnPtrWillBeRawPtr<InspectorWorkerAgent> workerAgentPtr = InspectorWorkerAgent::create();
OwnPtrWillBeRawPtr<InspectorTracingAgent> tracingAgentPtr = InspectorTracingAgent::create(inspectorClient, workerAgentPtr.get());
m_tracingAgent = tracingAgentPtr.get();
m_agents.append(tracingAgentPtr.release());
m_agents.append(workerAgentPtr.release());
OwnPtrWillBeRawPtr<InspectorTimelineAgent> timelineAgentPtr(InspectorTimelineAgent::create(m_pageAgent, m_layerTreeAgent,
overlay, InspectorTimelineAgent::PageInspector, inspectorClient));
m_timelineAgent = timelineAgentPtr.get();
m_agents.append(timelineAgentPtr.release());
PageScriptDebugServer* pageScriptDebugServer = &PageScriptDebugServer::shared();
m_agents.append(PageRuntimeAgent::create(injectedScriptManager, inspectorClient, pageScriptDebugServer, m_page, m_pageAgent));
m_agents.append(PageConsoleAgent::create(injectedScriptManager, m_domAgent, m_timelineAgent, m_page));
ASSERT_ARG(inspectorClient, inspectorClient);
m_injectedScriptManager->injectedScriptHost()->init(m_instrumentingAgents.get(), pageScriptDebugServer);
}
示例4: createInspectorAgentFor
void DatabaseClient::createInspectorAgentFor(Page* page)
{
ASSERT(!m_inspectorAgent);
OwnPtrWillBeRawPtr<InspectorDatabaseAgent> inspectorAgent = InspectorDatabaseAgent::create();
m_inspectorAgent = inspectorAgent.get();
page->inspectorController().registerModuleAgent(inspectorAgent.release());
}
示例5: loadChildSheet
void XSLStyleSheet::loadChildSheet(const String& href)
{
OwnPtrWillBeRawPtr<XSLImportRule> childRule = XSLImportRule::create(this, href);
XSLImportRule* c = childRule.get();
m_children.append(childRule.release());
c->loadSheet();
}
示例6: contextLabel
PassOwnPtrWillBeRawPtr<CanvasRenderingContext> WebGL2RenderingContext::Factory::create(HTMLCanvasElement* canvas, const CanvasContextCreationAttributes& attrs, Document&)
{
if (!RuntimeEnabledFeatures::unsafeES3APIsEnabled()) {
canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcontextcreationerror, false, true, "Creation of WebGL2 contexts disabled."));
return nullptr;
}
WebGLContextAttributes attributes = toWebGLContextAttributes(attrs);
OwnPtr<WebGraphicsContext3D> context(createWebGraphicsContext3D(canvas, attributes, 2));
if (!context)
return nullptr;
OwnPtr<Extensions3DUtil> extensionsUtil = Extensions3DUtil::create(context.get());
if (!extensionsUtil)
return nullptr;
if (extensionsUtil->supportsExtension("GL_EXT_debug_marker")) {
String contextLabel(String::format("WebGL2RenderingContext-%p", context.get()));
context->pushGroupMarkerEXT(contextLabel.ascii().data());
}
OwnPtrWillBeRawPtr<WebGL2RenderingContext> renderingContext = adoptPtrWillBeNoop(new WebGL2RenderingContext(canvas, context.release(), attributes));
if (!renderingContext->drawingBuffer()) {
canvas->dispatchEvent(WebGLContextEvent::create(EventTypeNames::webglcontextcreationerror, false, true, "Could not create a WebGL2 context."));
return nullptr;
}
renderingContext->initializeNewContext();
renderingContext->registerContextExtensions();
return renderingContext.release();
}
示例7: 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());
}
}
示例8: 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());
}
}
示例9: add
bool MediaQuerySet::add(const String& queryString)
{
// To "parse a media query" for a given string means to follow "the parse
// a media query list" steps and return "null" if more than one media query
// is returned, or else the returned media query.
RefPtrWillBeRawPtr<MediaQuerySet> result = create(queryString);
// Only continue if exactly one media query is found, as described above.
if (result->m_queries.size() != 1)
return true;
OwnPtrWillBeRawPtr<MediaQuery> newQuery = result->m_queries[0].release();
ASSERT(newQuery);
// If comparing with any of the media queries in the collection of media
// queries returns true terminate these steps.
for (size_t i = 0; i < m_queries.size(); ++i) {
MediaQuery* query = m_queries[i].get();
if (*query == *newQuery)
return true;
}
m_queries.append(newQuery.release());
return true;
}
示例10: setInterval
int setInterval(ScriptState* scriptState, EventTarget& eventTarget, const ScriptValue& handler, int timeout, const Vector<ScriptValue>& arguments)
{
ExecutionContext* executionContext = eventTarget.executionContext();
if (!isAllowed(scriptState, executionContext, false))
return 0;
OwnPtrWillBeRawPtr<ScheduledAction> action = ScheduledAction::create(scriptState, handler, arguments);
return DOMTimer::install(executionContext, action.release(), timeout, false);
}
示例11: performTask
virtual void performTask(ExecutionContext* scriptContext)
{
ASSERT_WITH_SECURITY_IMPLICATION(scriptContext->isWorkerGlobalScope());
DedicatedWorkerGlobalScope* context = static_cast<DedicatedWorkerGlobalScope*>(scriptContext);
OwnPtrWillBeRawPtr<MessagePortArray> ports = MessagePort::entanglePorts(*scriptContext, m_channels.release());
context->dispatchEvent(MessageEvent::create(ports.release(), m_message));
context->thread()->workerObjectProxy().confirmMessageFromWorkerObject(context->hasPendingActivity());
}
示例12: postMessageToWorkerObject
void WorkerMessagingProxy::postMessageToWorkerObject(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels)
{
if (!m_workerObject || m_askedToTerminate)
return;
OwnPtrWillBeRawPtr<MessagePortArray> ports = MessagePort::entanglePorts(*m_executionContext.get(), channels);
m_workerObject->dispatchEvent(MessageEvent::create(ports.release(), message));
}
示例13: toSVGIntegerOptionalInteger
PassOwnPtrWillBeRawPtr<InterpolableValue> IntegerOptionalIntegerSVGInterpolation::toInterpolableValue(SVGPropertyBase* value)
{
RefPtrWillBeRawPtr<SVGIntegerOptionalInteger> integerOptionalInteger = toSVGIntegerOptionalInteger(value);
OwnPtrWillBeRawPtr<InterpolableList> result = InterpolableList::create(2);
result->set(0, InterpolableNumber::create(integerOptionalInteger->firstInteger()->value()));
result->set(1, InterpolableNumber::create(integerOptionalInteger->secondInteger()->value()));
return result.release();
}
示例14:
PassOwnPtrWillBeRawPtr<NodeSet> NodeSet::create(const NodeSet& other)
{
OwnPtrWillBeRawPtr<NodeSet> nodeSet = NodeSet::create();
nodeSet->m_isSorted = other.m_isSorted;
nodeSet->m_subtreesAreDisjoint = other.m_subtreesAreDisjoint;
nodeSet->m_nodes.appendVector(other.m_nodes);
return nodeSet.release();
}
示例15: createRuleList
BisonCSSParser::RuleList* BisonCSSParser::createRuleList()
{
OwnPtrWillBeRawPtr<RuleList> list = adoptPtrWillBeNoop(new RuleList);
RuleList* listPtr = list.get();
m_parsedRuleLists.append(list.release());
return listPtr;
}