这篇教程C++ AllowCrossThreadAccess函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中AllowCrossThreadAccess函数的典型用法代码示例。如果您正苦于以下问题:C++ AllowCrossThreadAccess函数的具体用法?C++ AllowCrossThreadAccess怎么用?C++ AllowCrossThreadAccess使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了AllowCrossThreadAccess函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: dispatchTaskToMainThreadvoid WorkerFileSystemCallbacksBridge::postCreateFileToMainThread(WebFileSystem* fileSystem, const KURL& path, bool exclusive, const String& mode){ dispatchTaskToMainThread( createCallbackTask(&createFileOnMainThread, AllowCrossThreadAccess(fileSystem), path, exclusive, this, mode));}
开发者ID:ragner,项目名称:webkit,代码行数:7,
示例2: callOnMainThreadvoid AsyncFileStream::startOnFileThread(){ // FIXME: It is not correct to check m_client from a secondary thread - stop() could be racing with this check. if (!m_client) return; m_stream->start(); callOnMainThread(didStart, AllowCrossThreadAccess(this));}
开发者ID:3163504123,项目名称:phantomjs,代码行数:8,
示例3: m_threadDataConsumerHandleTestUtil::Thread::Thread(const char* name, InitializationPolicy initializationPolicy) : m_thread(WebThreadSupportingGC::create(name)) , m_initializationPolicy(initializationPolicy) , m_waitableEvent(adoptPtr(Platform::current()->createWaitableEvent())){ m_thread->postTask(BLINK_FROM_HERE, new Task(threadSafeBind(&Thread::initialize, AllowCrossThreadAccess(this)))); m_waitableEvent->wait();}
开发者ID:howardroark2018,项目名称:chromium,代码行数:8,
示例4: ASSERTvoid WorkerFileSystemCallbacksBridge::postCreateSnapshotFileToMainThread(WebFileSystem* fileSystem, const KURL& path, const String& mode){ ASSERT(fileSystem); dispatchTaskToMainThread( createCallbackTask(&createSnapshotFileOnMainThread, AllowCrossThreadAccess(fileSystem), path, this, mode));}
开发者ID:ragner,项目名称:webkit,代码行数:8,
示例5: AllowCrossThreadAccessvoid WebWorkerClientImpl::confirmMessageFromWorkerObject(bool hasPendingActivity){ // unconfirmed_message_count_ can only be updated on the thread where it's // accessed. Otherwise there are race conditions with v8's garbage // collection. m_scriptExecutionContext->postTask(createCallbackTask(&confirmMessageFromWorkerObjectTask, AllowCrossThreadAccess(this)));}
开发者ID:KDE,项目名称:android-qtwebkit,代码行数:8,
示例6: clearClientWrappervoid WorkerThreadableLoader::MainThreadBridge::destroy(){ // Ensure that no more client callbacks are done in the worker context's thread. clearClientWrapper(); // "delete this" and m_mainThreadLoader::deref() on the worker object's thread. m_loaderProxy.postTaskToLoader( createCallbackTask(&MainThreadBridge::mainThreadDestroy, AllowCrossThreadAccess(this)));}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:9,
示例7: ASSERTvoid HTMLParserThread::postTask(PassOwnPtr<CrossThreadClosure> closure){ ASSERT(isMainThread()); if (!m_thread) { m_thread = WebThreadSupportingGC::create("HTMLParserThread"); postTask(threadSafeBind(&HTMLParserThread::setupHTMLParserThread, AllowCrossThreadAccess(this))); } m_thread->postTask(BLINK_FROM_HERE, closure);}
开发者ID:aobzhirov,项目名称:ChromiumGStreamerBackend,代码行数:10,
示例8: dispatchTaskToMainThreadvoid WebWorkerBase::postConsoleMessageToWorkerObject(MessageSource source, MessageType type, MessageLevel level, const String& message, int lineNumber, const String& sourceURL){ dispatchTaskToMainThread(createCallbackTask(&postConsoleMessageTask, AllowCrossThreadAccess(this), source, type, level, message, lineNumber, sourceURL));}
开发者ID:sysrqb,项目名称:chromium-src,代码行数:11,
示例9: m_workerClientWrapperWorkerThreadableLoader::MainThreadBridge::MainThreadBridge(PassRefPtr<ThreadableLoaderClientWrapper> workerClientWrapper, WorkerLoaderProxy& loaderProxy, const String& taskMode, const ResourceRequest& request, const ThreadableLoaderOptions& options, const String& outgoingReferrer) : m_workerClientWrapper(workerClientWrapper) , m_loaderProxy(loaderProxy) , m_taskMode(taskMode.isolatedCopy()){ ASSERT(m_workerClientWrapper.get()); m_loaderProxy.postTaskToLoader( createCallbackTask(&MainThreadBridge::mainThreadCreateLoader, AllowCrossThreadAccess(this), request, options, outgoingReferrer));}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:11,
示例10: ASSERTvoid WorkerThreadableWebSocketChannel::Bridge::initialize(){ ASSERT(!m_peer); setMethodNotCompleted(); Ref<Bridge> protect(*this); m_loaderProxy.postTaskToLoader(CrossThreadTask(&Bridge::mainThreadInitialize, AllowCrossThreadAccess(&m_loaderProxy), m_workerClientWrapper, m_taskMode)); waitForMethodCompletion(); // m_peer may be null when the nested runloop exited before a peer has created. m_peer = m_workerClientWrapper->peer(); if (!m_peer) m_workerClientWrapper->setFailedWebSocketChannelCreation();}
开发者ID:chenbk85,项目名称:webkit2-wincairo,代码行数:12,
示例11: createCallbackTaskvoid WebWorkerClientImpl::terminateWorkerContext(){ if (m_askedToTerminate) return; m_askedToTerminate = true; if (!isMainThread()) { WebWorkerBase::dispatchTaskToMainThread( createCallbackTask(&terminateWorkerContextTask, AllowCrossThreadAccess(this))); return; } m_webWorker->terminateWorkerContext();}
开发者ID:KDE,项目名称:android-qtwebkit,代码行数:12,
示例12: createCallbackTaskvoid WorkerThreadableLoader::MainThreadBridge::cancel(){ m_loaderProxy.postTaskToLoader( createCallbackTask(&MainThreadBridge::mainThreadCancel, AllowCrossThreadAccess(this))); ThreadableLoaderClientWrapper* clientWrapper = m_workerClientWrapper.get(); if (!clientWrapper->done()) { // If the client hasn't reached a termination state, then transition it by sending a cancellation error. // Note: no more client callbacks will be done after this method -- the clearClientWrapper() call ensures that. ResourceError error(String(), 0, String(), String()); error.setIsCancellation(true); clientWrapper->didFail(error); } clearClientWrapper();}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:14,
示例13: ASSERTbool CCThreadProxy::initializeLayerRenderer(){ RefPtr<GraphicsContext3D> context = m_layerTreeHost->createLayerTreeHostContext3D(); if (!context) return false; ASSERT(context->hasOneRef()); // Leak the context pointer so we can transfer ownership of it to the other side... GraphicsContext3D* contextPtr = context.release().leakRef(); ASSERT(contextPtr->hasOneRef()); // Make a blocking call to initializeLayerRendererOnCCThread. The results of that call // are pushed into the initializeSucceeded and capabilities local variables. CCCompletionEvent completion; bool initializeSucceeded; LayerRendererCapabilities capabilities; ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::initializeLayerRendererOnCCThread, AllowCrossThreadAccess(contextPtr), AllowCrossThreadAccess(&completion), AllowCrossThreadAccess(&initializeSucceeded), AllowCrossThreadAccess(&capabilities))); completion.wait(); if (initializeSucceeded) m_layerRendererCapabilitiesMainThreadCopy = capabilities; return initializeSucceeded;}
开发者ID:Xertz,项目名称:EAWebKit,代码行数:24,
示例14: TRACE_EVENT0bool CCThreadProxy::recreateContext(){ TRACE_EVENT0("cc", "CCThreadProxy::recreateContext"); ASSERT(isMainThread()); // Try to create the context. RefPtr<GraphicsContext3D> context = m_layerTreeHost->createContext(); if (!context) return false; if (CCLayerTreeHost::needsFilterContext()) if (!SharedGraphicsContext3D::createForImplThread()) return false; ASSERT(context->hasOneRef()); // Leak the context pointer so we can transfer ownership of it to the other side... GraphicsContext3D* contextPtr = context.release().leakRef(); ASSERT(contextPtr->hasOneRef()); // Make a blocking call to recreateContextOnImplThread. The results of that // call are pushed into the recreateSucceeded and capabilities local // variables. CCCompletionEvent completion; bool recreateSucceeded = false; LayerRendererCapabilities capabilities; CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::recreateContextOnImplThread, AllowCrossThreadAccess(&completion), AllowCrossThreadAccess(contextPtr), AllowCrossThreadAccess(&recreateSucceeded), AllowCrossThreadAccess(&capabilities))); completion.wait(); if (recreateSucceeded) m_layerRendererCapabilitiesMainThreadCopy = capabilities; return recreateSucceeded;}
开发者ID:xiaolu31,项目名称:webkit-node,代码行数:36,
示例15: m_clientBridgeWorkerThreadableLoader::MainThreadBridge::MainThreadBridge( PassRefPtr<ThreadableLoaderClientWrapper> workerClientWrapper, PassOwnPtr<ThreadableLoaderClient> clientBridge, WorkerLoaderProxy& loaderProxy, const ResourceRequest& request, const ThreadableLoaderOptions& options, const ResourceLoaderOptions& resourceLoaderOptions, const String& outgoingReferrer) : m_clientBridge(clientBridge) , m_workerClientWrapper(workerClientWrapper) , m_loaderProxy(loaderProxy){ ASSERT(m_workerClientWrapper.get()); ASSERT(m_clientBridge.get()); m_loaderProxy.postTaskToLoader( createCrossThreadTask(&MainThreadBridge::mainThreadCreateLoader, AllowCrossThreadAccess(this), request, options, resourceLoaderOptions, outgoingReferrer));}
开发者ID:335969568,项目名称:Blink-1,代码行数:17,
示例16: MessagePortChannelArrayvoid WebWorkerImpl::postMessageToWorkerContext(const WebString& message, const WebMessagePortChannelArray& webChannels){ OwnPtr<MessagePortChannelArray> channels; if (webChannels.size()) { channels = new MessagePortChannelArray(webChannels.size()); for (size_t i = 0; i < webChannels.size(); ++i) { RefPtr<PlatformMessagePortChannel> platform_channel = PlatformMessagePortChannel::create(webChannels[i]); webChannels[i]->setClient(platform_channel.get()); (*channels)[i] = MessagePortChannel::create(platform_channel); } } workerThread()->runLoop().postTask( createCallbackTask(&postMessageToWorkerContextTask, AllowCrossThreadAccess(this), String(message), channels.release()));}
开发者ID:KDE,项目名称:android-qtwebkit,代码行数:18,
示例17: TEST_FTEST_F(ImageFrameGeneratorTest, incompleteDecodeBecomesCompleteMultiThreaded){ setFrameStatus(ImageFrame::FramePartial); char buffer[100 * 100 * 4]; m_generator->decodeAndScale(imageInfo(), 0, buffer, 100 * 4); EXPECT_EQ(1, m_decodeRequestCount); EXPECT_EQ(0, m_decodersDestroyed); // LocalFrame can now be decoded completely. setFrameStatus(ImageFrame::FrameComplete); addNewData(); OwnPtr<WebThread> thread = adoptPtr(Platform::current()->createThread("DecodeThread")); thread->postTask(FROM_HERE, new Task(threadSafeBind(&decodeThreadMain, AllowCrossThreadAccess(m_generator.get())))); thread.clear(); EXPECT_EQ(2, m_decodeRequestCount); EXPECT_EQ(1, m_decodersDestroyed); // Decoder created again. m_generator->decodeAndScale(imageInfo(), 0, buffer, 100 * 4); EXPECT_EQ(3, m_decodeRequestCount);}
开发者ID:smishenk,项目名称:chromium-crosswalk,代码行数:22,
注:本文中的AllowCrossThreadAccess函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ AlphaBlend函数代码示例 C++ Allocator_free函数代码示例 |