void AuthenticationManager::useCredentialForSingleChallenge(uint64_t challengeID, const Credential& credential, const CertificateInfo& certificateInfo) { auto challenge = m_challenges.take(challengeID); ASSERT(!challenge.challenge.isNull()); #if USE(NETWORK_SESSION) auto completionHandler = challenge.completionHandler; #else ChallengeCompletionHandler completionHandler = nullptr; #endif if (tryUseCertificateInfoForChallenge(challenge.challenge, certificateInfo, completionHandler)) return; AuthenticationClient* coreClient = challenge.challenge.authenticationClient(); #if USE(NETWORK_SESSION) // If there is a completion handler, then there is no AuthenticationClient. // FIXME: Remove the use of AuthenticationClient in WebKit2 once NETWORK_SESSION is used for all loads. if (completionHandler) { ASSERT(!coreClient); challenge.completionHandler(AuthenticationChallengeDisposition::UseCredential, credential); return; } #endif if (coreClient) coreClient->receivedCredential(challenge.challenge, credential); else receivedCredential(challenge.challenge, credential); }
void AuthenticationManager::useCredentialForSingleChallenge(uint64_t challengeID, const Credential& credential, const CertificateInfo& certificateInfo) { auto challenge = m_challenges.take(challengeID); ASSERT(!challenge.challenge.isNull()); if (tryUseCertificateInfoForChallenge(challenge.challenge, certificateInfo)) return; AuthenticationClient* coreClient = challenge.challenge.authenticationClient(); #if USE(NETWORK_SESSION) // If there is a completion handler, then there is no AuthenticationClient. // FIXME: Remove the use of AuthenticationClient in WebKit2 once NETWORK_SESSION is used for all loads. if (challenge.completionHandler) { ASSERT(!coreClient); challenge.completionHandler(AuthenticationChallengeDisposition::UseCredential, credential); return; } #else if (!coreClient) { // FIXME: The authentication client is null for downloads, but it can also be null for canceled loads. // We should not call Download::receivedCredential in the latter case. Download::receivedCredential(challenge.challenge, credential); return; } #endif ASSERT(coreClient); coreClient->receivedCredential(challenge.challenge, credential); }
void persist( std::initializer_list< message_ptr > evts, H completionHandler ) { for( auto evt : evts ) { apply( evt ); } completionHandler(); }
void DOMFileSystem::listDirectory(ScriptExecutionContext& context, FileSystemDirectoryEntry& directory, DirectoryListingCallback&& completionHandler) { ASSERT(&directory.filesystem() == this); auto directoryVirtualPath = directory.virtualPath(); auto fullPath = evaluatePath(directoryVirtualPath); if (fullPath == m_rootPath) { Vector<Ref<FileSystemEntry>> children; children.append(fileAsEntry(context)); completionHandler(WTFMove(children)); return; } m_workQueue->dispatch([this, context = makeRef(context), completionHandler = WTFMove(completionHandler), fullPath = crossThreadCopy(fullPath), directoryVirtualPath = crossThreadCopy(directoryVirtualPath)]() mutable { auto listedChildren = listDirectoryWithMetadata(fullPath); callOnMainThread([this, context = WTFMove(context), completionHandler = WTFMove(completionHandler), listedChildren = crossThreadCopy(listedChildren), directoryVirtualPath = directoryVirtualPath.isolatedCopy()]() mutable { completionHandler(toFileSystemEntries(context, *this, WTFMove(listedChildren), directoryVirtualPath)); }); }); }
void AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge(uint64_t challengeID) { auto challenge = m_challenges.take(challengeID); ASSERT(!challenge.challenge.isNull()); AuthenticationClient* coreClient = challenge.challenge.authenticationClient(); #if USE(NETWORK_SESSION) if (challenge.completionHandler) { ASSERT(!coreClient); challenge.completionHandler(AuthenticationChallengeDisposition::RejectProtectionSpace, Credential()); return; } #endif if (coreClient) coreClient->receivedChallengeRejection(challenge.challenge); else receivedChallengeRejection(challenge.challenge); }
void AuthenticationManager::performDefaultHandlingForSingleChallenge(uint64_t challengeID) { auto challenge = m_challenges.take(challengeID); ASSERT(!challenge.challenge.isNull()); AuthenticationClient* coreClient = challenge.challenge.authenticationClient(); #if USE(NETWORK_SESSION) if (challenge.completionHandler) { ASSERT(!coreClient); challenge.completionHandler(AuthenticationChallengeDisposition::PerformDefaultHandling, Credential()); return; } #endif if (coreClient) coreClient->receivedRequestToPerformDefaultHandling(challenge.challenge); else receivedRequestToPerformDefaultHandling(challenge.challenge); }
void process(AUAudioFrameCount frameCount, AUAudioFrameCount bufferOffset) override { for (int frameIndex = 0; frameIndex < frameCount; ++frameIndex) { int frameOffset = int(frameIndex + bufferOffset); startPoint = double(startPointRamper.getAndStep()); endPoint = double(endPointRamper.getAndStep()); rate = double(rateRamper.getAndStep()); volume = double(volumeRamper.getAndStep()); SPFLOAT dur = (SPFLOAT)ftbl_size / sp->sr; //length of playableSample vs actual int subsectionLength = endPoint - startPoint; float percentLen = (float)subsectionLength / (float)ftbl_size; phasor->freq = fabs(1.0 / dur * rate / percentLen); for (int channel = 0; channel < channels; ++channel) { float *out = (float *)outBufferListPtr->mBuffers[channel].mData + frameOffset; if (started) { if (channel == 0) { sp_phasor_compute(sp, phasor, NULL, &position); tabread1->index = position * percentLen + (startPoint / ftbl_size); tabread2->index = position * percentLen + (startPoint / ftbl_size); sp_tabread_compute(sp, tabread1, NULL, out); } else { sp_tabread_compute(sp, tabread2, NULL, out); } *out *= volume; } else { *out = 0; } } if (!loop && position < lastPosition) { started = false; completionHandler(); } else { lastPosition = position; } } }
void AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge(uint64_t challengeID) { auto challenge = m_challenges.take(challengeID); ASSERT(!challenge.challenge.isNull()); AuthenticationClient* coreClient = challenge.challenge.authenticationClient(); #if USE(NETWORK_SESSION) if (challenge.completionHandler) { ASSERT(!coreClient); challenge.completionHandler(AuthenticationChallengeDisposition::RejectProtectionSpace, Credential()); return; } #else if (!coreClient) { // FIXME: The authentication client is null for downloads, but it can also be null for canceled loads. // We should not call Download::receivedCredential in the latter case. Download::receivedChallengeRejection(challenge.challenge); return; } #endif ASSERT(coreClient); coreClient->receivedChallengeRejection(challenge.challenge); }