这篇教程C++ suspendIfNeeded函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中suspendIfNeeded函数的典型用法代码示例。如果您正苦于以下问题:C++ suspendIfNeeded函数的具体用法?C++ suspendIfNeeded怎么用?C++ suspendIfNeeded使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了suspendIfNeeded函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: getExecutionContextvoid SuspendableScriptExecutor::run(){ ExecutionContext* context = getExecutionContext(); DCHECK(context); if (!context->activeDOMObjectsAreSuspended()) { suspendIfNeeded(); executeAndDestroySelf(); return; } startOneShot(0, BLINK_FROM_HERE); suspendIfNeeded();}
开发者ID:aobzhirov,项目名称:ChromiumGStreamerBackend,代码行数:12,
示例2: ASSERTExceptionOr<Ref<Worker>> Worker::create(ScriptExecutionContext& context, const String& url, JSC::RuntimeFlags runtimeFlags){ ASSERT(isMainThread()); // We don't currently support nested workers, so workers can only be created from documents. ASSERT_WITH_SECURITY_IMPLICATION(context.isDocument()); auto worker = adoptRef(*new Worker(context, runtimeFlags)); worker->suspendIfNeeded(); bool shouldBypassMainWorldContentSecurityPolicy = context.shouldBypassMainWorldContentSecurityPolicy(); auto scriptURL = worker->resolveURL(url, shouldBypassMainWorldContentSecurityPolicy); if (scriptURL.hasException()) return scriptURL.releaseException(); worker->m_shouldBypassMainWorldContentSecurityPolicy = shouldBypassMainWorldContentSecurityPolicy; // The worker context does not exist while loading, so we must ensure that the worker object is not collected, nor are its event listeners. worker->setPendingActivity(worker.ptr()); worker->m_scriptLoader = WorkerScriptLoader::create(); auto contentSecurityPolicyEnforcement = shouldBypassMainWorldContentSecurityPolicy ? ContentSecurityPolicyEnforcement::DoNotEnforce : ContentSecurityPolicyEnforcement::EnforceChildSrcDirective; worker->m_scriptLoader->loadAsynchronously(&context, scriptURL.releaseReturnValue(), FetchOptions::Mode::SameOrigin, contentSecurityPolicyEnforcement, worker->m_identifier, worker.ptr()); return WTFMove(worker);}
开发者ID:ollie314,项目名称:webkit,代码行数:26,
示例3: m_databaseIDBTransaction::IDBTransaction(IDBDatabase& database, const IDBTransactionInfo& info) : WebCore::IDBTransaction(database.scriptExecutionContext()) , m_database(database) , m_info(info) , m_operationTimer(*this, &IDBTransaction::operationTimerFired){ relaxAdoptionRequirement(); if (m_info.mode() == IndexedDB::TransactionMode::VersionChange) { m_originalDatabaseInfo = std::make_unique<IDBDatabaseInfo>(m_database->info()); m_startedOnServer = true; } else { activate(); RefPtr<IDBTransaction> self; JSC::VM& vm = JSDOMWindowBase::commonVM(); vm.whenIdle([self, this]() { deactivate(); }); establishOnServer(); } suspendIfNeeded();}
开发者ID:abihf,项目名称:WebKitForWayland,代码行数:26,
示例4: LoaderClient LoaderClient(ExecutionContext* executionContext, BodyStreamBuffer* buffer, FetchDataLoader::Client* client) : ActiveDOMObject(executionContext) , m_buffer(buffer) , m_client(client) { suspendIfNeeded(); }
开发者ID:aobzhirov,项目名称:ChromiumGStreamerBackend,代码行数:7,
示例5: IDBRequestIDBOpenDBRequest::IDBOpenDBRequest(IDBConnectionToServer& connection, ScriptExecutionContext* context, const IDBDatabaseIdentifier& databaseIdentifier, uint64_t version) : IDBRequest(connection, context) , m_databaseIdentifier(databaseIdentifier) , m_version(version){ suspendIfNeeded();}
开发者ID:rodrigo-speller,项目名称:webkit,代码行数:7,
示例6: IDBOpenDBRequestIDBRequest::IDBRequest(IDBConnectionToServer& connection, ScriptExecutionContext* context) : IDBOpenDBRequest(context) , m_connection(connection) , m_resourceIdentifier(connection){ suspendIfNeeded();}
开发者ID:sailei1,项目名称:webkit,代码行数:7,
示例7: m_databaseIDBTransaction::IDBTransaction(IDBDatabase& database, const IDBTransactionInfo& info, IDBOpenDBRequest* request) : WebCore::IDBTransaction(database.scriptExecutionContext()) , m_database(database) , m_info(info) , m_operationTimer(*this, &IDBTransaction::operationTimerFired) , m_openDBRequest(request){ LOG(IndexedDB, "IDBTransaction::IDBTransaction - %s", m_info.loggingString().utf8().data()); relaxAdoptionRequirement(); if (m_info.mode() == IndexedDB::TransactionMode::VersionChange) { ASSERT(m_openDBRequest); m_openDBRequest->setVersionChangeTransaction(*this); m_startedOnServer = true; } else { activate(); RefPtr<IDBTransaction> self; JSC::VM& vm = JSDOMWindowBase::commonVM(); vm.whenIdle([self, this]() { deactivate(); }); establishOnServer(); } suspendIfNeeded();}
开发者ID:kamihouse,项目名称:webkit,代码行数:30,
示例8: ActiveDOMObjectIDBIndex::IDBIndex(ScriptExecutionContext& context, const IDBIndexInfo& info, IDBObjectStore& objectStore) : ActiveDOMObject(&context) , m_info(info) , m_objectStore(objectStore){ suspendIfNeeded();}
开发者ID:emutavchi,项目名称:WebKitForWayland,代码行数:7,
示例9: ActiveDOMObjectFontFaceSet::FontFaceSet(Document& document) : ActiveDOMObject(&document) , m_shouldFireLoadingEvent(false) , m_asyncRunner(this, &FontFaceSet::handlePendingEventsAndPromises){ suspendIfNeeded();}
开发者ID:Jamesducque,项目名称:mojo,代码行数:7,
示例10: suspendIfNeededvoid SuspendableScriptExecutor::run(){ suspendIfNeeded(); ExecutionContext* context = executionContext(); ASSERT(context); if (context && !context->activeDOMObjectsAreSuspended()) executeAndDestroySelf();}
开发者ID:RobinWuDev,项目名称:Qt,代码行数:8,
示例11: ActiveDOMObjectScriptedIdleTaskController::ScriptedIdleTaskController(ExecutionContext* context) : ActiveDOMObject(context) , m_scheduler(Platform::current()->currentThread()->scheduler()) , m_nextCallbackId(0) , m_suspended(false){ suspendIfNeeded();}
开发者ID:shaoboyan,项目名称:chromium-crosswalk,代码行数:8,
示例12: ActiveDOMObjectReadableStream::ReadableStream(ScriptExecutionContext& scriptExecutionContext) : ActiveDOMObject(&scriptExecutionContext){#ifndef NDEBUG readableStreamCounter.increment();#endif suspendIfNeeded();}
开发者ID:cheekiatng,项目名称:webkit,代码行数:8,
示例13: m_connectionIDBDatabase::IDBDatabase(ScriptExecutionContext& context, IDBConnectionToServer& connection, const IDBResultData& resultData) : WebCore::IDBDatabase(&context) , m_connection(connection) , m_info(resultData.databaseInfo()){ suspendIfNeeded(); relaxAdoptionRequirement(); m_connection->registerDatabaseConnection(*this);}
开发者ID:aaronz,项目名称:webkit,代码行数:9,
示例14: ActiveDOMObjectFontLoader::FontLoader(Document* document) : ActiveDOMObject(document) , m_document(document) , m_numLoadingFromCSS(0) , m_numLoadingFromJS(0) , m_pendingEventsTimer(*this, &FontLoader::pendingEventsTimerFired){ suspendIfNeeded();}
开发者ID:houzhenggang,项目名称:webkit,代码行数:9,
示例15: MediaStreamTrackCanvasCaptureMediaStreamTrack::CanvasCaptureMediaStreamTrack( const CanvasCaptureMediaStreamTrack& track, MediaStreamComponent* component) : MediaStreamTrack(track.m_canvasElement->getExecutionContext(), component), m_canvasElement(track.m_canvasElement), m_drawListener(track.m_drawListener) { suspendIfNeeded(); m_canvasElement->addListener(m_drawListener.get());}
开发者ID:mirror,项目名称:chromium,代码行数:9,
示例16: ActiveDOMObjectFontFaceSet::FontFaceSet(Document& document) : ActiveDOMObject(&document) , m_shouldFireLoadingEvent(false) , m_isLoading(false) , m_ready(new ReadyProperty(executionContext(), this, ReadyProperty::Ready)) , m_asyncRunner(this, &FontFaceSet::handlePendingEventsAndPromises){ suspendIfNeeded();}
开发者ID:shaoboyan,项目名称:chromium-crosswalk,代码行数:9,
示例17: ActiveDOMObjectIDBObjectStore::IDBObjectStore(ScriptExecutionContext& context, const IDBObjectStoreInfo& info, IDBTransaction& transaction) : ActiveDOMObject(&context) , m_info(info) , m_originalInfo(info) , m_transaction(transaction){ ASSERT(currentThread() == m_transaction->database().originThreadID()); suspendIfNeeded();}
开发者ID:caiolima,项目名称:webkit,代码行数:10,
示例18: IDBActiveDOMObjectIDBDatabase::IDBDatabase(ScriptExecutionContext& context, IDBClient::IDBConnectionProxy& connectionProxy, const IDBResultData& resultData) : IDBActiveDOMObject(&context) , m_connectionProxy(connectionProxy) , m_info(resultData.databaseInfo()) , m_databaseConnectionIdentifier(resultData.databaseConnectionIdentifier()){ LOG(IndexedDB, "IDBDatabase::IDBDatabase - Creating database %s with version %" PRIu64 " connection %" PRIu64 " (%p)", m_info.name().utf8().data(), m_info.version(), m_databaseConnectionIdentifier, this); suspendIfNeeded(); m_connectionProxy->registerDatabaseConnection(*this);}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:10,
示例19: ActiveDOMObjectIDBIndex::IDBIndex(ScriptExecutionContext& context, const IDBIndexInfo& info, IDBObjectStore& objectStore) : ActiveDOMObject(&context) , m_info(info) , m_originalInfo(info) , m_objectStore(objectStore){ ASSERT(currentThread() == m_objectStore.transaction().database().originThreadID()); suspendIfNeeded();}
开发者ID:ollie314,项目名称:webkit,代码行数:10,
示例20: ActiveDOMObjectMediaStreamTrack::MediaStreamTrack(MediaStreamTrack* other) : ActiveDOMObject(other->scriptExecutionContext()) , m_privateTrack(*other->privateTrack().clone()) , m_eventDispatchScheduled(false) , m_stoppingTrack(false){ suspendIfNeeded(); m_privateTrack->setClient(this);}
开发者ID:kodybrown,项目名称:webkit,代码行数:10,
示例21: ActiveDOMObjectReadableStream::ReadableStream(ScriptExecutionContext& scriptExecutionContext, Ref<ReadableStreamSource>&& source) : ActiveDOMObject(&scriptExecutionContext) , m_state(State::Readable) , m_source(WTF::move(source)){#ifndef NDEBUG readableStreamCounter.increment();#endif suspendIfNeeded();}
开发者ID:vinod-designer1,项目名称:webkit,代码行数:10,
示例22: m_serverConnectionIDBDatabase::IDBDatabase(ScriptExecutionContext& context, IDBConnectionToServer& connection, const IDBResultData& resultData) : WebCore::IDBDatabase(&context) , m_serverConnection(connection) , m_info(resultData.databaseInfo()) , m_databaseConnectionIdentifier(resultData.databaseConnectionIdentifier()){ LOG(IndexedDB, "IDBDatabase::IDBDatabase - Creating database %s with version %" PRIu64, m_info.name().utf8().data(), m_info.version()); suspendIfNeeded(); relaxAdoptionRequirement(); m_serverConnection->registerDatabaseConnection(*this);}
开发者ID:transformersprimeabcxyz,项目名称:webkit,代码行数:11,
示例23: ActiveDOMObjectReadableStreamReader::ReadableStreamReader(ReadableStream& stream) : ActiveDOMObject(stream.scriptExecutionContext()){#ifndef NDEBUG readableStreamReaderCounter.increment();#endif suspendIfNeeded(); ASSERT_WITH_MESSAGE(!stream.reader(), "A ReadableStream cannot be locked by two readers at the same time."); m_stream = &stream; stream.lock(*this);}
开发者ID:feel2d,项目名称:webkit,代码行数:11,
示例24: adoptRefExceptionOr<Ref<OfflineAudioContext>> OfflineAudioContext::create(ScriptExecutionContext& context, unsigned numberOfChannels, size_t numberOfFrames, float sampleRate){ // FIXME: Add support for workers. if (!is<Document>(context)) return Exception { NOT_SUPPORTED_ERR }; if (!numberOfChannels || numberOfChannels > 10 || !numberOfFrames || !isSampleRateRangeGood(sampleRate)) return Exception { SYNTAX_ERR }; auto audioContext = adoptRef(*new OfflineAudioContext(downcast<Document>(context), numberOfChannels, numberOfFrames, sampleRate)); audioContext->suspendIfNeeded(); return WTFMove(audioContext);}
开发者ID:eocanha,项目名称:webkit,代码行数:11,
示例25: RefCountedMediaStreamTrack::MediaStreamTrack(ScriptExecutionContext& context, MediaStreamTrackPrivate& privateTrack) : RefCounted() , ActiveDOMObject(&context) , m_privateTrack(privateTrack) , m_eventDispatchScheduled(false) , m_stoppingTrack(false){ suspendIfNeeded(); m_privateTrack->setClient(this);}
开发者ID:fanghongjia,项目名称:JavaScriptCore,代码行数:11,
示例26: ActiveDOMObjectReadableStream::ReadableStream(ExecutionContext* executionContext, UnderlyingSource* source) : ActiveDOMObject(executionContext) , m_source(source) , m_isStarted(false) , m_isDraining(false) , m_isPulling(false) , m_state(Waiting) , m_ready(new WaitPromise(executionContext, this, WaitPromise::Ready)) , m_closed(new ClosedPromise(executionContext, this, ClosedPromise::Closed)){ suspendIfNeeded();}
开发者ID:kjthegod,项目名称:WebKit,代码行数:12,
注:本文中的suspendIfNeeded函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ suspend_console函数代码示例 C++ suspend函数代码示例 |