void DocumentThreadableLoader::handleSuccessfulFinish(unsigned long identifier, double finishTime) { ASSERT(m_fallbackRequestForServiceWorker.isNull()); if (!m_actualRequest.isNull()) { // FIXME: Timeout should be applied to whole fetch, not for each of // preflight and actual request. m_timeoutTimer.stop(); ASSERT(!m_sameOriginRequest); ASSERT(m_options.crossOriginRequestPolicy == UseAccessControl); loadActualRequest(); return; } ThreadableLoaderClient* client = m_client; m_client = 0; // Don't clear the resource as the client may need to access the downloaded // file which will be released when the resource is destoryed. if (m_async) { m_timeoutTimer.stop(); m_requestStartedSeconds = 0.0; } client->didFinishLoading(identifier, finishTime); // |this| may be dead here in async mode. }
void DocumentThreadableLoader::handleSuccessfulFinish(unsigned long identifier, double finishTime) { DCHECK(m_fallbackRequestForServiceWorker.isNull()); if (!m_actualRequest.isNull()) { // FIXME: Timeout should be applied to whole fetch, not for each of // preflight and actual request. m_timeoutTimer.stop(); DCHECK(!m_sameOriginRequest); DCHECK_EQ(m_options.crossOriginRequestPolicy, UseAccessControl); loadActualRequest(); return; } ThreadableLoaderClient* client = m_client; // Protect the resource in |didFinishLoading| in order not to release the // downloaded file. Persistent<Resource> protect = resource(); clear(); client->didFinishLoading(identifier, finishTime); }