• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ callOnMainThread函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中callOnMainThread函数的典型用法代码示例。如果您正苦于以下问题:C++ callOnMainThread函数的具体用法?C++ callOnMainThread怎么用?C++ callOnMainThread使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了callOnMainThread函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: locker

void CurlDownload::didReceiveData(void* data, int size)
{
    MutexLocker locker(m_mutex);

    callOnMainThread(MainThreadTask(receivedDataCallback, this, size));

    writeDataToFile(static_cast<const char*>(data), size);
}
开发者ID:Zirias,项目名称:webkitfltk,代码行数:8,代码来源:CurlDownload.cpp


示例2: callOnMainThread

void CALLBACK NetworkStateNotifier::addrChangeCallback(void* context, BOOLEAN timedOut)
{
    // NotifyAddrChange only notifies us of a single address change. Now that we've been notified,
    // we need to call it again so we'll get notified the *next* time.
    static_cast<NetworkStateNotifier*>(context)->registerForAddressChange();

    callOnMainThread(callAddressChanged, context);
}
开发者ID:1833183060,项目名称:wke,代码行数:8,代码来源:NetworkStateNotifierWin.cpp


示例3: LOG

void SetIndexesReadyOperation::perform(std::function<void()> completionCallback)
{
    LOG(StorageAPI, "SetIndexesReadyOperation");

    for (size_t i = 0; i < m_indexCount; ++i)
        m_transaction->didCompletePreemptiveEvent();

    callOnMainThread(completionCallback);
}
开发者ID:hnney,项目名称:webkit,代码行数:9,代码来源:IDBTransactionBackendOperations.cpp


示例4: protectedThis

void UserMediaRequest::constraintsValidated()
{
    RefPtr<UserMediaRequest> protectedThis(this);
    callOnMainThread([protectedThis] {
        // 2 - The constraints are valid, ask the user for access to media.
        if (UserMediaController* controller = protectedThis->m_controller)
            controller->requestPermission(*protectedThis.get());
    });
}
开发者ID:LianYue1,项目名称:webkit,代码行数:9,代码来源:UserMediaRequest.cpp


示例5: callOnMainThread

void WebCLEvent::callbackProxy(cl_event event, cl_int type, void* userData)
{
    if (!isMainThread()) {
        callOnMainThread(WTF::bind(callbackProxyOnMainThread, event, type, userData));
        return;
    }

    callbackProxyOnMainThread(event, type, userData);
}
开发者ID:rzr,项目名称:blink-crosswalk,代码行数:9,代码来源:WebCLEvent.cpp


示例6: ASSERT

void StorageTracker::syncImportOriginIdentifiers()
{
    ASSERT(m_isActive);
    
    ASSERT(!isMainThread());

    {
        MutexLocker locker(m_databaseMutex);

        // Don't force creation of StorageTracker's db just because a tracker
        // was initialized. It will be created if local storage dbs are found
        // by syncFileSystemAndTrackerDatabse() or the next time a local storage
        // db is created by StorageAreaSync.
        openTrackerDatabase(false);

        if (m_database.isOpen()) {
            SQLiteTransactionInProgressAutoCounter transactionCounter;

            SQLiteStatement statement(m_database, "SELECT origin FROM Origins");
            if (statement.prepare() != SQLResultOk) {
                LOG_ERROR("Failed to prepare statement.");
                return;
            }
            
            int result;
            
            {
                MutexLocker lockOrigins(m_originSetMutex);
                while ((result = statement.step()) == SQLResultRow)
                    m_originSet.add(statement.getColumnText(0).isolatedCopy());
            }
            
            if (result != SQLResultDone) {
                LOG_ERROR("Failed to read in all origins from the database.");
                return;
            }
        }
    }
    
    syncFileSystemAndTrackerDatabase();
    
    {
        MutexLocker locker(m_clientMutex);

        if (m_client) {
            MutexLocker locker(m_originSetMutex);
            OriginSet::const_iterator end = m_originSet.end();
            for (OriginSet::const_iterator it = m_originSet.begin(); it != end; ++it)
                m_client->dispatchDidModifyOrigin(*it);
        }
    }

    callOnMainThread([this] {
        finishedImportingOriginIdentifiers();
    });
}
开发者ID:houzhenggang,项目名称:webkit,代码行数:56,代码来源:StorageTracker.cpp


示例7: ASSERT

void IDBServerConnectionLevelDB::commitTransaction(int64_t transactionID, BoolCallbackFunction successCallback)
{
    RefPtr<IDBBackingStoreTransactionLevelDB> transaction = m_backingStoreTransactions.get(transactionID);
    ASSERT(transaction);

    bool result = transaction->commit();
    callOnMainThread([successCallback, result]() {
        successCallback(result);
    });
}
开发者ID:ZeusbaseWeb,项目名称:webkit,代码行数:10,代码来源:IDBServerConnectionLevelDB.cpp


示例8: viewportController

void ThreadedCompositor::didChangeVisibleRect()
{
    FloatRect visibleRect = viewportController()->visibleContentsRect();
    float scale = viewportController()->pageScaleFactor();
    callOnMainThread([=] {
        m_client->setVisibleContentsRect(visibleRect, FloatPoint::zero(), scale);
    });

    scheduleDisplayImmediately();
}
开发者ID:runt18,项目名称:webkit,代码行数:10,代码来源:ThreadedCompositor.cpp


示例9: callOnMainThread

void ScrollingTreeIOS::currentSnapPointIndicesDidChange(WebCore::ScrollingNodeID nodeID, unsigned horizontal, unsigned vertical)
{
    if (!m_scrollingCoordinator)
        return;
    
    RefPtr<AsyncScrollingCoordinator> scrollingCoordinator = m_scrollingCoordinator;
    callOnMainThread([scrollingCoordinator, nodeID, horizontal, vertical] {
        scrollingCoordinator->setActiveScrollSnapIndices(nodeID, horizontal, vertical);
    });
}
开发者ID:cheekiatng,项目名称:webkit,代码行数:10,代码来源:ScrollingTreeIOS.cpp


示例10: setMainFrameScrollPosition

void ScrollingTreeIOS::scrollingTreeNodeDidScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, SetOrSyncScrollingLayerPosition scrollingLayerPositionAction)
{
    if (!m_scrollingCoordinator)
        return;

    if (nodeID == rootNode()->scrollingNodeID())
        setMainFrameScrollPosition(scrollPosition);

    callOnMainThread(bind(&AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll, m_scrollingCoordinator.get(), nodeID, scrollPosition, isHandlingProgrammaticScroll(), scrollingLayerPositionAction));
}
开发者ID:MYSHLIFE,项目名称:webkit,代码行数:10,代码来源:ScrollingTreeIOS.cpp


示例11: formFinalize

static void formFinalize(CFReadStreamRef stream, void* context)
{
    FormStreamFields* form = static_cast<FormStreamFields*>(context);
    ASSERT_UNUSED(stream, form->formStream == stream);

    callOnMainThread([form] {
        closeCurrentStream(form);
        delete form;
    });
}
开发者ID:jeff-jenness,项目名称:webkit,代码行数:10,代码来源:FormDataStreamCFNet.cpp


示例12: blobRegistry

void ThreadableBlobRegistry::registerFileBlobURL(const URL& url, const String& path, const String& contentType)
{
    if (isMainThread())
        blobRegistry().registerFileBlobURL(url, BlobDataFileReference::create(path), contentType);
    else {
        callOnMainThread([url = url.isolatedCopy(), path = path.isolatedCopy(), contentType = contentType.isolatedCopy()] {
            blobRegistry().registerFileBlobURL(url, BlobDataFileReference::create(path), contentType);
        });
    }
}
开发者ID:caiolima,项目名称:webkit,代码行数:10,代码来源:ThreadableBlobRegistry.cpp


示例13: locker

void CurlDownload::didReceiveData(void* data, int size)
{
    MutexLocker locker(m_mutex);

    callOnMainThread([this, size] {
        didReceiveDataOfLength(size);
    });

    writeDataToFile(static_cast<const char*>(data), size);
}
开发者ID:AndriyKalashnykov,项目名称:webkit,代码行数:10,代码来源:CurlDownload.cpp


示例14: strongThis

void AudioContext::isPlayingAudioDidChange()
{
    // Make sure to call Document::updateIsPlayingMedia() on the main thread, since
    // we could be on the audio I/O thread here and the call into WebCore could block.
    RefPtr<AudioContext> strongThis(this);
    callOnMainThread([strongThis] {
        if (strongThis->document())
            strongThis->document()->updateIsPlayingMedia();
    });
}
开发者ID:valbok,项目名称:WebKitForWayland,代码行数:10,代码来源:AudioContext.cpp


示例15: protectedThis

void UserMediaRequest::userMediaAccessGranted(const String& videoDeviceUID, const String& audioDeviceUID)
{
    m_chosenVideoDeviceUID = videoDeviceUID;
    m_chosenAudioDeviceUID = audioDeviceUID;
    RefPtr<UserMediaRequest> protectedThis(this);
    callOnMainThread([protectedThis] {
        // 3 - the user granted access, ask platform to create the media stream descriptors.
        RealtimeMediaSourceCenter::singleton().createMediaStream(protectedThis.get(), protectedThis->m_audioConstraints, protectedThis->m_videoConstraints);
    });
}
开发者ID:nickooms,项目名称:webkit,代码行数:10,代码来源:UserMediaRequest.cpp


示例16: locker

void NetworkResourceLoadScheduler::scheduleRemoveLoader(NetworkResourceLoader* loader)
{
    MutexLocker locker(m_loadersToRemoveMutex);
    
    m_loadersToRemove.append(loader);
    
    if (!removeScheduledLoadersCalled) {
        removeScheduledLoadersCalled = true;
        callOnMainThread(NetworkResourceLoadScheduler::removeScheduledLoaders, this);
    }
}
开发者ID:MYSHLIFE,项目名称:webkit,代码行数:11,代码来源:NetworkResourceLoadScheduler.cpp


示例17: ASSERT

void MediaStreamPrivate::scheduleDeferredTask(std::function<void()> function)
{
    ASSERT(function);
    auto weakThis = createWeakPtr();
    callOnMainThread([weakThis, function] {
        if (!weakThis)
            return;

        function();
    });
}
开发者ID:edcwconan,项目名称:webkit,代码行数:11,代码来源:MediaStreamPrivate.cpp


示例18: ASSERT

void DatabaseTracker::scheduleForNotification()
{
    ASSERT(!notificationMutex().tryLock());

    if (!notificationScheduled) {
        callOnMainThread([] {
            notifyDatabasesChanged();
        });
        notificationScheduled = true;
    }
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:11,代码来源:DatabaseTracker.cpp


示例19: callOnMainThread

void BlobResourceHandle::notifyFinish()
{
    if (m_async) {
        // Schedule to notify the client from a standalone function because the client might dispose the handle immediately from the callback function
        // while we still have BlobResourceHandle calls in the stack.
        callOnMainThread(doNotifyFinish, this);
        return;
    }

    doNotifyFinish(this);
}
开发者ID:dankurka,项目名称:webkit_titanium,代码行数:11,代码来源:BlobResourceHandle.cpp


示例20: lock

void ScrollingTree::updateMainFrameScrollPositionAndScrollLayerPosition(const IntPoint& scrollPosition)
{
    if (!m_scrollingCoordinator)
        return;

    {
        MutexLocker lock(m_mutex);
        m_mainFrameScrollPosition = scrollPosition;
    }

    callOnMainThread(bind(&ScrollingCoordinator::updateMainFrameScrollPositionAndScrollLayerPosition, m_scrollingCoordinator.get()));
}
开发者ID:pial003,项目名称:RespImg-WebCore,代码行数:12,代码来源:ScrollingTree.cpp



注:本文中的callOnMainThread函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ callTM函数代码示例发布时间:2022-05-30
下一篇:
C++ callFunction函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap