• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/WebCore-7537.78.1/platform/network/soup/

Lines Matching refs:handle

163     virtual void didFail(ResourceHandle* handle, const ResourceError& error)
166 didFinishLoading(handle, 0);
171 // We do not handle authentication for synchronous XMLHttpRequests.
334 ResourceHandle* handle = static_cast<ResourceHandle*>(data);
335 if (!handle || handle->cancelledOrClientless())
338 ResourceHandleInternal* d = handle->getInternal();
364 static void applyAuthenticationToRequest(ResourceHandle* handle, ResourceRequest& request, bool redirect)
367 ResourceHandleInternal* d = handle->getInternal();
369 if (handle->shouldUseCredentialStorage()) {
404 ResourceHandle* handle = static_cast<ResourceHandle*>(data);
405 if (!handle || handle->cancelledOrClientless())
409 ResourceHandleInternal* d = handle->getInternal();
416 static bool shouldRedirect(ResourceHandle* handle)
418 ResourceHandleInternal* d = handle->getInternal();
455 static void doRedirect(ResourceHandle* handle)
457 ResourceHandleInternal* d = handle->getInternal();
461 d->client()->didFail(handle, ResourceError::transportError(d->m_soupRequest.get(), SOUP_STATUS_TOO_MANY_REDIRECTS, "Too many redirects"));
462 cleanupSoupRequestOperation(handle);
466 ResourceRequest newRequest = handle->firstRequest();
470 bool crossOrigin = !protocolHostAndPortAreEqual(handle->firstRequest().url(), newURL);
485 if (!newURL.protocolIs("https") && protocolIs(newRequest.httpReferrer(), "https") && handle->context()->shouldClearReferrerOnHTTPSToHTTPRedirect())
500 applyAuthenticationToRequest(handle, newRequest, true);
502 cleanupSoupRequestOperation(handle);
503 if (!createSoupRequestAndMessageForHandle(handle, newRequest, true)) {
504 d->client()->cannotShowURL(handle);
512 d->client()->willSendRequest(handle, newRequest, d->m_response);
513 handle->sendPendingRequest();
518 RefPtr<ResourceHandle> handle = static_cast<ResourceHandle*>(data);
520 if (handle->cancelledOrClientless()) {
521 cleanupSoupRequestOperation(handle.get());
526 ResourceHandleInternal* d = handle->getInternal();
529 handle->client()->didFail(handle.get(), ResourceError::genericGError(error.get(), d->m_soupRequest.get()));
530 cleanupSoupRequestOperation(handle.get());
536 d->m_cancellable.get(), redirectSkipCallback, handle.get());
541 doRedirect(handle.get());
546 RefPtr<ResourceHandle> handle = static_cast<ResourceHandle*>(data);
547 if (!handle)
551 ResourceHandleInternal* d = handle->getInternal();
554 if (handle->cancelledOrClientless())
557 handle->client()->didSendData(handle.get(), d->m_bodyDataSent, d->m_bodySize);
560 static void cleanupSoupRequestOperation(ResourceHandle* handle, bool isDestroying)
562 ResourceHandleInternal* d = handle->getInternal();
571 0, 0, 0, 0, handle);
572 g_object_set_data(G_OBJECT(d->m_soupMessage.get()), "handle", 0);
587 handle->deref();
590 static bool handleUnignoredTLSErrors(ResourceHandle* handle)
592 ResourceHandleInternal* d = handle->getInternal();
598 String lowercaseHostURL = handle->firstRequest().url().host().lower();
607 handle->client()->didFail(handle, ResourceError::tlsError(d->m_soupRequest.get(), response.soupMessageTLSErrors(), response.soupMessageCertificate()));
613 RefPtr<ResourceHandle> handle = static_cast<ResourceHandle*>(data);
615 if (handle->cancelledOrClientless()) {
616 cleanupSoupRequestOperation(handle.get());
620 ResourceHandleInternal* d = handle->getInternal();
627 handle->client()->didFail(handle.get(), ResourceError::httpError(d->m_soupMessage.get(), error.get(), d->m_soupRequest.get()));
628 cleanupSoupRequestOperation(handle.get());
633 handle->client()->didFinishLoading(handle.get(), 0);
634 cleanupSoupRequestOperation(handle.get());
639 d->m_response.setURL(handle->firstRequest().url());
642 handle->client()->didReceiveResponse(handle.get(), d->m_response);
644 if (handle->cancelledOrClientless()) {
645 cleanupSoupRequestOperation(handle.get());
649 handle->ensureReadBuffer();
651 G_PRIORITY_DEFAULT, d->m_cancellable.get(), readCallback, handle.get());
656 RefPtr<ResourceHandle> handle = static_cast<ResourceHandle*>(data);
658 if (handle->cancelledOrClientless()) {
659 cleanupSoupRequestOperation(handle.get());
663 ResourceHandleInternal* d = handle->getInternal();
675 handle->client()->didFail(handle.get(), ResourceError::httpError(soupMessage, error.get(), d->m_soupRequest.get()));
676 cleanupSoupRequestOperation(handle.get());
683 if (SOUP_STATUS_IS_REDIRECTION(soupMessage->status_code) && shouldRedirect(handle.get())) {
686 d->m_cancellable.get(), redirectSkipCallback, handle.get());
690 if (handle->shouldContentSniff() && soupMessage->status_code != SOUP_STATUS_NOT_MODIFIED) {
696 if (handleUnignoredTLSErrors(handle.get())) {
697 cleanupSoupRequestOperation(handle.get());
702 d->m_response.setURL(handle->firstRequest().url());
709 handle->client()->didReceiveResponse(handle.get(), d->m_response);
711 if (handle->cancelledOrClientless()) {
712 cleanupSoupRequestOperation(handle.get());
719 d->m_cancellable.get(), nextMultipartResponsePartCallback, handle.get());
725 handle->ensureReadBuffer();
727 G_PRIORITY_DEFAULT, d->m_cancellable.get(), readCallback, handle.get());
837 RefPtr<ResourceHandle> handle = static_cast<ResourceHandle*>(data);
838 if (!handle)
841 ResourceHandleInternal* d = handle->getInternal();
850 RefPtr<ResourceHandle> handle = static_cast<ResourceHandle*>(g_object_get_data(G_OBJECT(soupMessage), "handle"));
851 if (!handle)
854 ResourceHandleInternal* d = handle->getInternal();
872 ResourceHandle* handle = static_cast<ResourceHandle*>(data);
873 if (!handle)
876 if (handle->cancelledOrClientless())
879 ResourceHandleInternal* d = handle->getInternal();
937 static bool createSoupMessageForHandleAndRequest(ResourceHandle* handle, const ResourceRequest& request)
939 ASSERT(handle);
941 ResourceHandleInternal* d = handle->getInternal();
951 g_object_set_data(G_OBJECT(soupMessage), "handle", handle);
952 if (!handle->shouldContentSniff())
976 g_signal_connect(d->m_soupMessage.get(), "got-headers", G_CALLBACK(gotHeadersCallback), handle);
977 g_signal_connect(d->m_soupMessage.get(), "restarted", G_CALLBACK(restartedCallback), handle);
978 g_signal_connect(d->m_soupMessage.get(), "wrote-body-data", G_CALLBACK(wroteBodyDataCallback), handle);
984 g_signal_connect(d->m_soupMessage.get(), "network-event", G_CALLBACK(networkEventCallback), handle);
985 g_signal_connect(d->m_soupMessage.get(), "wrote-body", G_CALLBACK(wroteBodyCallback), handle);
995 static bool createSoupRequestAndMessageForHandle(ResourceHandle* handle, const ResourceRequest& request, bool isHTTPFamilyRequest)
997 ResourceHandleInternal* d = handle->getInternal();
1012 if (isHTTPFamilyRequest && !createSoupMessageForHandleAndRequest(handle, request)) {
1240 static bool waitingToSendRequest(ResourceHandle* handle)
1245 return handle->getInternal()->m_soupRequest && !handle->getInternal()->m_cancellable;
1289 RefPtr<ResourceHandle> handle = create(context, request, &syncLoader, false /*defersLoading*/, false /*shouldContentSniff*/);
1290 if (!handle)
1294 if (handle->d->m_scheduledFailureType != NoFailure)
1302 RefPtr<ResourceHandle> handle = static_cast<ResourceHandle*>(data);
1304 if (handle->cancelledOrClientless()) {
1305 cleanupSoupRequestOperation(handle.get());
1309 ResourceHandleInternal* d = handle->getInternal();
1319 handle->client()->didFail(handle.get(), ResourceError::genericGError(error.get(), d->m_soupRequest.get()));
1320 cleanupSoupRequestOperation(handle.get());
1329 d->m_cancellable.get(), nextMultipartResponsePartCallback, handle.get());
1335 handle->client()->didFinishLoading(handle.get(), 0);
1336 cleanupSoupRequestOperation(handle.get());
1343 handle->client()->didReceiveData(handle.get(), d->m_readBufferPtr, bytesRead, bytesRead);
1346 if (handle->cancelledOrClientless()) {
1347 cleanupSoupRequestOperation(handle.get());
1351 handle->ensureReadBuffer();
1353 d->m_cancellable.get(), readCallback, handle.get());
1358 RefPtr<ResourceHandle> handle = static_cast<ResourceHandle*>(data);
1359 handle->client()->didFail(handle.get(), ResourceError::timeoutError(handle->getInternal()->m_firstRequest.url().string()));
1360 handle->cancel();
1367 RefPtr<ResourceHandle> handle = static_cast<ResourceHandle*>(g_object_get_data(G_OBJECT(soupMessage), "handle"));
1368 if (!handle)
1370 handle->didReceiveAuthenticationChallenge(AuthenticationChallenge(session, soupMessage, soupAuth, retrying, handle.get()));