本文整理汇总了C++中PassOwnPtr::get方法的典型用法代码示例。如果您正苦于以下问题:C++ PassOwnPtr::get方法的具体用法?C++ PassOwnPtr::get怎么用?C++ PassOwnPtr::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PassOwnPtr
的用法示例。
在下文中一共展示了PassOwnPtr::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onSuccess
void IDBOpenDBRequest::onSuccess(PassOwnPtr<WebIDBDatabase> backend, const IDBDatabaseMetadata& metadata)
{
IDB_TRACE("IDBOpenDBRequest::onSuccess()");
if (m_contextStopped || !executionContext()) {
OwnPtr<WebIDBDatabase> db = backend;
if (db)
db->close();
return;
}
if (!shouldEnqueueEvent())
return;
IDBDatabase* idbDatabase = nullptr;
if (resultAsAny()) {
// Previous onUpgradeNeeded call delivered the backend.
ASSERT(!backend.get());
idbDatabase = resultAsAny()->idbDatabase();
ASSERT(idbDatabase);
ASSERT(!m_databaseCallbacks);
} else {
ASSERT(backend.get());
ASSERT(m_databaseCallbacks);
idbDatabase = IDBDatabase::create(executionContext(), backend, m_databaseCallbacks.release());
setResult(IDBAny::create(idbDatabase));
}
idbDatabase->setMetadata(metadata);
enqueueEvent(Event::create(EventTypeNames::success));
}
示例2: send
WebSocketChannel::SendResult MainThreadWebSocketChannel::send(PassOwnPtr<Vector<char> > data)
{
WTF_LOG(Network, "MainThreadWebSocketChannel %p send() Sending Vector %p", this, data.get());
enqueueVector(WebSocketFrame::OpCodeBinary, data);
processOutgoingFrameQueue();
return WebSocketChannel::SendSuccess;
}
示例3: commitNewTreeState
void ScrollingTree::commitNewTreeState(PassOwnPtr<ScrollingStateTree> scrollingStateTree)
{
ASSERT(ScrollingThread::isCurrentThread());
bool rootStateNodeChanged = scrollingStateTree->hasNewRootStateNode();
ScrollingStateScrollingNode* rootNode = scrollingStateTree->rootStateNode();
if (rootNode
&& (rootStateNodeChanged
|| rootNode->hasChangedProperty(ScrollingStateScrollingNode::WheelEventHandlerCount)
|| rootNode->hasChangedProperty(ScrollingStateScrollingNode::NonFastScrollableRegion)
|| rootNode->hasChangedProperty(ScrollingStateNode::ScrollLayer))) {
MutexLocker lock(m_mutex);
if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateNode::ScrollLayer))
m_mainFrameScrollPosition = IntPoint();
if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateScrollingNode::WheelEventHandlerCount))
m_hasWheelEventHandlers = scrollingStateTree->rootStateNode()->wheelEventHandlerCount();
if (rootStateNodeChanged || rootNode->hasChangedProperty(ScrollingStateScrollingNode::NonFastScrollableRegion))
m_nonFastScrollableRegion = scrollingStateTree->rootStateNode()->nonFastScrollableRegion();
}
bool scrollRequestIsProgammatic = rootNode ? rootNode->requestedScrollPositionRepresentsProgrammaticScroll() : false;
TemporaryChange<bool> changeHandlingProgrammaticScroll(m_isHandlingProgrammaticScroll, scrollRequestIsProgammatic);
removeDestroyedNodes(scrollingStateTree.get());
updateTreeFromStateNode(rootNode);
}
示例4: SkPixelRef
DiscardablePixelRef::DiscardablePixelRef(const SkImageInfo& info, size_t rowBytes, PassOwnPtr<SkMutex> mutex)
: SkPixelRef(info, mutex.get())
, m_lockedMemory(0)
, m_mutex(mutex)
, m_rowBytes(rowBytes)
{
}
示例5: registerDOMObjectHolderInternal
void DOMWrapperWorld::registerDOMObjectHolderInternal(PassOwnPtr<DOMObjectHolderBase> holderBase)
{
ASSERT(!m_domObjectHolders.contains(holderBase.get()));
holderBase->setWorld(this);
holderBase->setWeak(&DOMWrapperWorld::weakCallbackForDOMObjectHolder);
m_domObjectHolders.add(holderBase);
}
示例6: ASSERT
PassOwnPtr<AsyncFileWriter> WorkerPlatformAsyncFileSystemCallbacks::createAsyncFileWriter(PassOwnPtr<BlackBerry::Platform::WebFileWriter> platformWriter)
{
ASSERT(m_writerClient);
BlackBerry::Platform::WebFileWriter* platformWriterPtr = platformWriter.get();
OwnPtr<WorkerAsyncFileWriterBlackBerry> writer = WorkerAsyncFileWriterBlackBerry::create(m_context, m_mode, platformWriter, m_writerClient);
platformWriterPtr->setClient(writer->platformWriterClient());
return writer.release();
}
示例7: create
static PassRefPtr<DrawingBufferForTests> create(PassOwnPtr<WebGraphicsContext3D> context,
const IntSize& size, PreserveDrawingBuffer preserve)
{
OwnPtr<Extensions3DUtil> extensionsUtil = Extensions3DUtil::create(context.get());
RefPtr<DrawingBufferForTests> drawingBuffer =
adoptRef(new DrawingBufferForTests(context, extensionsUtil.release(), preserve));
if (!drawingBuffer->initialize(size)) {
drawingBuffer->beginDestruction();
return PassRefPtr<DrawingBufferForTests>();
}
return drawingBuffer.release();
}
示例8: commitNewTreeState
void ScrollingTree::commitNewTreeState(PassOwnPtr<ScrollingTreeState> scrollingTreeState)
{
ASSERT(ScrollingThread::isCurrentThread());
if (scrollingTreeState->changedProperties() & ScrollingTreeState::WheelEventHandlerCount) {
MutexLocker lock(m_mutex);
m_hasWheelEventHandlers = scrollingTreeState->wheelEventHandlerCount();
}
m_rootNode->update(scrollingTreeState.get());
}
示例9: perform
void MainThreadTaskRunner::perform(PassOwnPtr<ExecutionContextTask> task, bool isInspectorTask)
{
if (!isInspectorTask && (m_context->tasksNeedSuspension() || !m_pendingTasks.isEmpty())) {
m_pendingTasks.append(task);
return;
}
const bool instrumenting = !isInspectorTask && !task->taskNameForInstrumentation().isEmpty();
if (instrumenting)
InspectorInstrumentation::willPerformExecutionContextTask(m_context, task.get());
task->performTask(m_context);
if (instrumenting)
InspectorInstrumentation::didPerformExecutionContextTask(m_context);
}
示例10: postMessageToWorkerContextTask
void WebWorkerClientImpl::postMessageToWorkerContextTask(ScriptExecutionContext* context,
WebWorkerClientImpl* thisPtr,
const String& message,
PassOwnPtr<MessagePortChannelArray> channels)
{
WebMessagePortChannelArray webChannels(channels.get() ? channels->size() : 0);
for (size_t i = 0; i < webChannels.size(); ++i) {
webChannels[i] = (*channels)[i]->channel()->webChannelRelease();
webChannels[i]->setClient(0);
}
thisPtr->m_webWorker->postMessageToWorkerContext(message, webChannels);
}
示例11: beginFrameAndCommit
void CCThreadProxy::beginFrameAndCommit(int sequenceNumber, double frameBeginTime, PassOwnPtr<CCScrollUpdateSet> scrollInfo)
{
TRACE_EVENT("CCThreadProxy::beginFrameAndCommit", this, 0);
ASSERT(isMainThread());
if (!m_layerTreeHost)
return;
// Scroll deltas need to be applied even if the commit will be dropped.
m_layerTreeHost->applyScrollDeltas(*scrollInfo.get());
// Drop beginFrameAndCommit calls that occur out of sequence. See createBeginFrameAndCommitTaskOnImplThread for
// an explanation of how out-of-sequence beginFrameAndCommit tasks can occur.
if (sequenceNumber < m_lastExecutedBeginFrameAndCommitSequenceNumber) {
TRACE_EVENT("EarlyOut_StaleBeginFrameAndCommit", this, 0);
return;
}
m_lastExecutedBeginFrameAndCommitSequenceNumber = sequenceNumber;
// FIXME: recreate the context if it was requested by the impl thread
{
TRACE_EVENT("CCLayerTreeHost::animateAndLayout", this, 0);
m_layerTreeHost->animateAndLayout(frameBeginTime);
}
ASSERT(m_lastExecutedBeginFrameAndCommitSequenceNumber == sequenceNumber);
// Clear the commit flag after animateAndLayout here --- objects that only
// layout when painted will trigger another setNeedsCommit inside
// updateLayers.
m_commitRequested = false;
m_layerTreeHost->updateLayers();
{
// Blocking call to CCThreadProxy::commitOnImplThread
TRACE_EVENT("commit", this, 0);
CCCompletionEvent completion;
s_ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::commitOnImplThread, AllowCrossThreadAccess(&completion)));
completion.wait();
}
m_layerTreeHost->commitComplete();
if (m_redrawAfterCommit)
setNeedsRedraw();
m_redrawAfterCommit = false;
ASSERT(m_lastExecutedBeginFrameAndCommitSequenceNumber == sequenceNumber);
}
示例12: postMessageTask
void WebWorkerBase::postMessageTask(ScriptExecutionContext* context,
WebWorkerBase* thisPtr,
String message,
PassOwnPtr<MessagePortChannelArray> channels)
{
if (!thisPtr->client())
return;
WebMessagePortChannelArray webChannels(channels.get() ? channels->size() : 0);
for (size_t i = 0; i < webChannels.size(); ++i) {
webChannels[i] = (*channels)[i]->channel()->webChannelRelease();
webChannels[i]->setClient(0);
}
thisPtr->client()->postMessageToWorkerObject(message, webChannels);
}
示例13: preload
void HTMLResourcePreloader::preload(PassOwnPtr<PreloadRequest> preload)
{
if (preload->isPreconnect()) {
preconnectHost(preload.get());
return;
}
// TODO(yoichio): Should preload if document is imported.
if (!m_document->loader())
return;
FetchRequest request = preload->resourceRequest(m_document);
// TODO(dgozman): This check should go to HTMLPreloadScanner, but this requires
// making Document::completeURLWithOverride logic to be statically accessible.
if (request.url().protocolIsData())
return;
if (preload->resourceType() == Resource::Script || preload->resourceType() == Resource::CSSStyleSheet || preload->resourceType() == Resource::ImportResource)
request.setCharset(preload->charset().isEmpty() ? m_document->charset().string() : preload->charset());
request.setForPreload(true);
Platform::current()->histogramCustomCounts("WebCore.PreloadDelayMs", static_cast<int>(1000 * (monotonicallyIncreasingTime() - preload->discoveryTime())), 0, 2000, 20);
m_document->loader()->startPreload(preload->resourceType(), request);
}
示例14: commitNewTreeState
void ScrollingTree::commitNewTreeState(PassOwnPtr<ScrollingStateTree> scrollingStateTree)
{
ASSERT(ScrollingThread::isCurrentThread());
if (scrollingStateTree->rootStateNode()->changedProperties() & (ScrollingStateScrollingNode::WheelEventHandlerCount | ScrollingStateScrollingNode::NonFastScrollableRegion) || scrollingStateTree->rootStateNode()->scrollLayerDidChange()) {
MutexLocker lock(m_mutex);
if (scrollingStateTree->rootStateNode()->scrollLayerDidChange())
m_mainFrameScrollPosition = IntPoint();
if (scrollingStateTree->rootStateNode()->changedProperties() & ScrollingStateScrollingNode::WheelEventHandlerCount)
m_hasWheelEventHandlers = scrollingStateTree->rootStateNode()->wheelEventHandlerCount();
if (scrollingStateTree->rootStateNode()->changedProperties() & ScrollingStateScrollingNode::NonFastScrollableRegion)
m_nonFastScrollableRegion = scrollingStateTree->rootStateNode()->nonFastScrollableRegion();
}
TemporaryChange<bool> changeHandlingProgrammaticScroll(m_isHandlingProgrammaticScroll, scrollingStateTree->rootStateNode()->requestedScrollPositionRepresentsProgrammaticScroll());
removeDestroyedNodes(scrollingStateTree.get());
updateTreeFromStateNode(scrollingStateTree->rootStateNode());
}
示例15: addConsoleMessage
void InspectorConsoleAgent::addConsoleMessage(PassOwnPtr<ConsoleMessage> consoleMessage)
{
ASSERT_ARG(consoleMessage, consoleMessage);
if (m_previousMessage && !isGroupMessage(m_previousMessage->type()) && m_previousMessage->isEqual(consoleMessage.get())) {
m_previousMessage->incrementCount();
if (m_frontend && m_enabled)
m_previousMessage->updateRepeatCountInConsole(m_frontend);
} else {
m_previousMessage = consoleMessage.get();
m_consoleMessages.append(consoleMessage);
if (m_frontend && m_enabled)
m_previousMessage->addToFrontend(m_frontend, m_injectedScriptManager, true);
}
if (!m_frontend && m_consoleMessages.size() >= maximumConsoleMessages) {
m_expiredConsoleMessageCount += expireConsoleMessagesStep;
m_consoleMessages.remove(0, expireConsoleMessagesStep);
}
}