void ReadableStream::readInternalPostAction() { ASSERT(m_state == Readable); if (isQueueEmpty() && m_isDraining) closeInternal(); callPullIfNeeded(); }
void ReadableStream::close() { if (m_state != Readable) return; if (isQueueEmpty()) closeInternal(); else m_isDraining = true; }
bool AbstractDb::closeQuiet() { QWriteLocker locker(&dbOperLock); QWriteLocker connectionLocker(&connectionStateLock); interruptExecution(); bool res = closeInternal(); clearAttaches(); registeredFunctions.clear(); registeredCollations.clear(); if (FUNCTIONS) // FUNCTIONS is already null when closing db while closing entire app disconnect(FUNCTIONS, SIGNAL(functionListChanged()), this, SLOT(registerAllFunctions())); return res; }
void WebSocket::close(unsigned short code, ExceptionCode& ec) { closeInternal(code, String(), ec); }
void WebSocket::close(ExceptionCode& ec) { closeInternal(WebSocketChannel::CloseEventCodeNotSpecified, String(), ec); }
void WebSocket::close(unsigned short code, const String& reason, ExceptionCode& ec) { closeInternal(code, reason, ec); }
DnDURIObject::~DnDURIObject(void) { closeInternal(); }
/** * Closes the object. * This also closes the internal handles associated with the object (to files / ...). */ void DnDURIObject::Close(void) { closeInternal(); }
int DnDURIObject::Read(void *pvBuf, uint32_t cbToRead, uint32_t *pcbRead) { AssertPtrReturn(pvBuf, VERR_INVALID_POINTER); AssertReturn(cbToRead, VERR_INVALID_PARAMETER); /* pcbRead is optional. */ int rc; switch (m_Type) { case File: { if (!u.m_hFile) { /* Open files on the source with RTFILE_O_DENY_WRITE to prevent races * where the OS writes to the file while the destination side transfers * it over. */ rc = RTFileOpen(&u.m_hFile, m_strSrcPath.c_str(), RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE); } else rc = VINF_SUCCESS; bool fDone = false; if (RT_SUCCESS(rc)) { size_t cbRead; rc = RTFileRead(u.m_hFile, pvBuf, cbToRead, &cbRead); if (RT_SUCCESS(rc)) { if (pcbRead) *pcbRead = (uint32_t)cbRead; m_cbProcessed += cbRead; Assert(m_cbProcessed <= m_cbSize); /* End of file reached or error occurred? */ if ( m_cbProcessed == m_cbSize || RT_FAILURE(rc)) { closeInternal(); } } } break; } case Directory: { rc = VINF_SUCCESS; break; } default: rc = VERR_NOT_IMPLEMENTED; break; } LogFlowFunc(("Returning strSourcePath=%s, rc=%Rrc\n", m_strSrcPath.c_str(), rc)); return rc; }
void WebSocket::close(unsigned short code, ExceptionState& exceptionState) { closeInternal(code, String(), exceptionState); }
void WebSocket::close(unsigned short code, const String& reason, ExceptionState& exceptionState) { closeInternal(code, reason, exceptionState); }
ScriptPromise ReadableStream::cancelInternal(ScriptState* scriptState, ScriptValue reason) { setIsDisturbed(); closeInternal(); return m_source->cancelSource(scriptState, reason).then(ConstUndefined::create(scriptState)); }