这篇教程C++ urlWithCredentials函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中urlWithCredentials函数的典型用法代码示例。如果您正苦于以下问题:C++ urlWithCredentials函数的具体用法?C++ urlWithCredentials怎么用?C++ urlWithCredentials使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了urlWithCredentials函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: urlWithCredentialsvoid XMLHttpRequest::open(const String& method, const KURL& url, bool async, const String& user, ExceptionCode& ec){ KURL urlWithCredentials(url); urlWithCredentials.setUser(user); open(method, urlWithCredentials, async, ec);}
开发者ID:jparound30,项目名称:webkit,代码行数:7,
示例2: urlWithCredentialsvoid XMLHttpRequest::open(const String& method, const String& url, bool async, const String& user, ExceptionCode& ec){ KURL urlWithCredentials(scriptExecutionContext()->completeURL(url)); urlWithCredentials.setUser(user); internalOpen(method, urlWithCredentials, async, ec);}
开发者ID:sanyaade-webdev,项目名称:webkit,代码行数:7,
示例3: handlevoid ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, StoredCredentials /*storedCredentials*/, ResourceError& error, ResourceResponse& response, Vector<char>& data, Frame* frame){ WebCoreSynchronousLoader syncLoader; ResourceHandle handle(request, &syncLoader, true, false, true);#if QT_VERSION < 0x040400 if (!QWebNetworkManager::self()->add(&handle, QWebNetworkInterface::defaultInterface(), QWebNetworkManager::SynchronousJob)) { // FIXME Create a sane ResourceError error = ResourceError(String(), -1, String(), String()); return; }#else ResourceHandleInternal *d = handle.getInternal(); if (!(d->m_user.isEmpty() || d->m_pass.isEmpty())) { // If credentials were specified for this request, add them to the url, // so that they will be passed to QNetworkRequest. KURL urlWithCredentials(d->m_request.url()); urlWithCredentials.setUser(d->m_user); urlWithCredentials.setPass(d->m_pass); d->m_request.setURL(urlWithCredentials); } d->m_frame = static_cast<FrameLoaderClientQt*>(frame->loader()->client())->webFrame(); d->m_job = new QNetworkReplyHandler(&handle, QNetworkReplyHandler::LoadNormal);#endif syncLoader.waitForCompletion(); error = syncLoader.resourceError(); data = syncLoader.data(); response = syncLoader.resourceResponse();}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:30,
示例4: urlWithCredentialsbool ResourceHandle::start(Frame* frame){ if (!frame) return false; Page *page = frame->page(); // If we are no longer attached to a Page, this must be an attempted load from an // onUnload handler, so let's just block it. if (!page) return false; if (!(d->m_user.isEmpty() || d->m_pass.isEmpty())) { // If credentials were specified for this request, add them to the url, // so that they will be passed to QNetworkRequest. KURL urlWithCredentials(d->m_request.url()); urlWithCredentials.setUser(d->m_user); urlWithCredentials.setPass(d->m_pass); d->m_request.setURL(urlWithCredentials); } getInternal()->m_frame = static_cast<FrameLoaderClientQt*>(frame->loader()->client())->webFrame();#if QT_VERSION < 0x040400 return QWebNetworkManager::self()->add(this, getInternal()->m_frame->page()->d->networkInterface);#else ResourceHandleInternal *d = getInternal(); d->m_job = new QNetworkReplyHandler(this, QNetworkReplyHandler::LoadMode(d->m_defersLoading)); return true;#endif}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:29,
示例5: adoptRefvoid ResourceHandle::loadResourceSynchronously(NetworkingContext* context, const ResourceRequest& request, StoredCredentials /*storedCredentials*/, ResourceError& error, ResourceResponse& response, Vector<char>& data){ WebCoreSynchronousLoader syncLoader; RefPtr<ResourceHandle> handle = adoptRef(new ResourceHandle(request, &syncLoader, true, false)); ResourceHandleInternal* d = handle->getInternal(); if (!d->m_user.isEmpty() || !d->m_pass.isEmpty()) { // If credentials were specified for this request, add them to the url, // so that they will be passed to QNetworkRequest. KURL urlWithCredentials(d->m_firstRequest.url()); urlWithCredentials.setUser(d->m_user); urlWithCredentials.setPass(d->m_pass); d->m_firstRequest.setURL(urlWithCredentials); } d->m_context = context; d->m_job = new QNetworkReplyHandler(handle.get(), QNetworkReplyHandler::SynchronousLoad); QNetworkReply* reply = d->m_job->reply(); // When using synchronous calls, we are finished when reaching this point. if (reply->isFinished()) { syncLoader.setReplyFinished(true); d->m_job->forwardData(); d->m_job->finish(); } else syncLoader.waitForCompletion(); error = syncLoader.resourceError(); data = syncLoader.data(); response = syncLoader.resourceResponse();}
开发者ID:dankurka,项目名称:webkit_titanium,代码行数:30,
示例6: urlWithCredentialsvoid XMLHttpRequest::open(const AtomicString& method, const KURL& url, bool async, const String& user, const String& password, ExceptionState& exceptionState){ KURL urlWithCredentials(url); urlWithCredentials.setUser(user); urlWithCredentials.setPass(password); open(method, urlWithCredentials, async, exceptionState);}
开发者ID:Igalia,项目名称:blink,代码行数:8,
示例7: syncLoadervoid ResourceHandle::platformLoadResourceSynchronously(NetworkingContext* context, const ResourceRequest& request, StoredCredentials /*storedCredentials*/, ResourceError& error, ResourceResponse& response, Vector<char>& data){ WebCoreSynchronousLoader syncLoader(error, response, data); RefPtr<ResourceHandle> handle = adoptRef(new ResourceHandle(context, request, &syncLoader, true, false)); ResourceHandleInternal* d = handle->getInternal(); if (!d->m_user.isEmpty() || !d->m_pass.isEmpty()) { // If credentials were specified for this request, add them to the url, // so that they will be passed to QNetworkRequest. URL urlWithCredentials(d->m_firstRequest.url()); urlWithCredentials.setUser(d->m_user); urlWithCredentials.setPass(d->m_pass); d->m_firstRequest.setURL(urlWithCredentials); } // starting in deferred mode gives d->m_job the chance of being set before sending the request. d->m_job = new QNetworkReplyHandler(handle.get(), QNetworkReplyHandler::SynchronousLoad, true); d->m_job->setLoadingDeferred(false);}
开发者ID:webOS-ports,项目名称:webkit,代码行数:19,
示例8: urlWithCredentialsvoid ResourceHandle::createCFURLConnection(bool shouldUseCredentialStorage, bool shouldContentSniff, CFDictionaryRef clientProperties){ if ((!d->m_user.isEmpty() || !d->m_pass.isEmpty()) && !firstRequest().url().protocolInHTTPFamily()) { // Credentials for ftp can only be passed in URL, the didReceiveAuthenticationChallenge delegate call won't be made. KURL urlWithCredentials(firstRequest().url()); urlWithCredentials.setUser(d->m_user); urlWithCredentials.setPass(d->m_pass); firstRequest().setURL(urlWithCredentials); } // <rdar://problem/7174050> - For URLs that match the paths of those previously challenged for HTTP Basic authentication, // try and reuse the credential preemptively, as allowed by RFC 2617. if (shouldUseCredentialStorage && firstRequest().url().protocolInHTTPFamily()) { if (d->m_user.isEmpty() && d->m_pass.isEmpty()) { // <rdar://problem/7174050> - For URLs that match the paths of those previously challenged for HTTP Basic authentication, // try and reuse the credential preemptively, as allowed by RFC 2617. d->m_initialCredential = CredentialStorage::get(firstRequest().url()); } else { // If there is already a protection space known for the URL, update stored credentials before sending a request. // This makes it possible to implement logout by sending an XMLHttpRequest with known incorrect credentials, and aborting it immediately // (so that an authentication dialog doesn't pop up). CredentialStorage::set(Credential(d->m_user, d->m_pass, CredentialPersistenceNone), firstRequest().url()); } } if (!d->m_initialCredential.isEmpty()) { // FIXME: Support Digest authentication, and Proxy-Authorization. applyBasicAuthorizationHeader(firstRequest(), d->m_initialCredential); } RetainPtr<CFURLRequestRef> request(AdoptCF, makeFinalRequest(firstRequest(), shouldContentSniff));#if HAVE(CFNETWORK_DATA_ARRAY_CALLBACK) && USE(PROTECTION_SPACE_AUTH_CALLBACK) CFURLConnectionClient_V6 client = { 6, this, 0, 0, 0, WebCore::willSendRequest, didReceiveResponse, didReceiveData, 0, didFinishLoading, didFail, willCacheResponse, didReceiveChallenge, didSendBodyData, shouldUseCredentialStorageCallback, 0, canRespondToProtectionSpace, 0, didReceiveDataArray};#else CFURLConnectionClient_V3 client = { 3, this, 0, 0, 0, WebCore::willSendRequest, didReceiveResponse, didReceiveData, 0, didFinishLoading, didFail, willCacheResponse, didReceiveChallenge, didSendBodyData, shouldUseCredentialStorageCallback, 0};#endif RetainPtr<CFDictionaryRef> connectionProperties(AdoptCF, createConnectionProperties(shouldUseCredentialStorage, clientProperties)); CFURLRequestSetShouldStartSynchronously(request.get(), 1); d->m_connection.adoptCF(CFURLConnectionCreateWithProperties(0, request.get(), reinterpret_cast<CFURLConnectionClient*>(&client), connectionProperties.get()));}
开发者ID:sanyaade-mobiledev,项目名称:Webkit-Projects,代码行数:42,
示例9: urlWithCredentialsbool ResourceHandle::start(){ // If NetworkingContext is invalid then we are no longer attached to a Page, // this must be an attempted load from an unload event handler, so let's just block it. if (d->m_context && !d->m_context->isValid()) return false; if (!d->m_user.isEmpty() || !d->m_pass.isEmpty()) { // If credentials were specified for this request, add them to the url, // so that they will be passed to QNetworkRequest. URL urlWithCredentials(firstRequest().url()); urlWithCredentials.setUser(d->m_user); urlWithCredentials.setPass(d->m_pass); d->m_firstRequest.setURL(urlWithCredentials); } ResourceHandleInternal *d = getInternal(); d->m_job = new QNetworkReplyHandler(this, QNetworkReplyHandler::AsynchronousLoad, d->m_defersLoading); return true;}
开发者ID:webOS-ports,项目名称:webkit,代码行数:20,
示例10: handlevoid ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, StoredCredentials /*storedCredentials*/, ResourceError& error, ResourceResponse& response, Vector<char>& data, Frame* frame){ WebCoreSynchronousLoader syncLoader; ResourceHandle handle(request, &syncLoader, true, false); ResourceHandleInternal *d = handle.getInternal(); if (!(d->m_user.isEmpty() || d->m_pass.isEmpty())) { // If credentials were specified for this request, add them to the url, // so that they will be passed to QNetworkRequest. KURL urlWithCredentials(d->m_request.url()); urlWithCredentials.setUser(d->m_user); urlWithCredentials.setPass(d->m_pass); d->m_request.setURL(urlWithCredentials); } d->m_frame = static_cast<FrameLoaderClientQt*>(frame->loader()->client())->webFrame(); d->m_job = new QNetworkReplyHandler(&handle, QNetworkReplyHandler::LoadNormal); syncLoader.waitForCompletion(); error = syncLoader.resourceError(); data = syncLoader.data(); response = syncLoader.resourceResponse();}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.vendor,代码行数:22,
示例11: urlWithCredentialsvoid ResourceHandle::createCFURLConnection(bool shouldUseCredentialStorage, bool shouldRelaxThirdPartyCookiePolicy, bool shouldContentSniff){ if ((!d->m_user.isEmpty() || !d->m_pass.isEmpty()) && !firstRequest().url().protocolIsInHTTPFamily()) { // Credentials for ftp can only be passed in URL, the didReceiveAuthenticationChallenge delegate call won't be made. KURL urlWithCredentials(firstRequest().url()); urlWithCredentials.setUser(d->m_user); urlWithCredentials.setPass(d->m_pass); firstRequest().setURL(urlWithCredentials); } if (shouldRelaxThirdPartyCookiePolicy) firstRequest().setFirstPartyForCookies(firstRequest().url()); // <rdar://problem/7174050> - For URLs that match the paths of those previously challenged for HTTP Basic authentication, // try and reuse the credential preemptively, as allowed by RFC 2617. if (shouldUseCredentialStorage && firstRequest().url().protocolIsInHTTPFamily()) { if (d->m_user.isEmpty() && d->m_pass.isEmpty()) { // <rdar://problem/7174050> - For URLs that match the paths of those previously challenged for HTTP Basic authentication, // try and reuse the credential preemptively, as allowed by RFC 2617. d->m_initialCredential = CredentialStorage::get(firstRequest().url()); } else { // If there is already a protection space known for the URL, update stored credentials before sending a request. // This makes it possible to implement logout by sending an XMLHttpRequest with known incorrect credentials, and aborting it immediately // (so that an authentication dialog doesn't pop up). CredentialStorage::set(Credential(d->m_user, d->m_pass, CredentialPersistenceNone), firstRequest().url()); } } if (!d->m_initialCredential.isEmpty()) { // FIXME: Support Digest authentication, and Proxy-Authorization. applyBasicAuthorizationHeader(firstRequest(), d->m_initialCredential); } RetainPtr<CFMutableURLRequestRef> request = adoptCF(CFURLRequestCreateMutableCopy(kCFAllocatorDefault, firstRequest().cfURLRequest())); wkSetRequestStorageSession(d->m_storageSession.get(), request.get()); if (!shouldContentSniff) wkSetCFURLRequestShouldContentSniff(request.get(), false); RetainPtr<CFMutableDictionaryRef> sslProps; if (allowsAnyHTTPSCertificateHosts().contains(firstRequest().url().host().lower())) { sslProps.adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); CFDictionaryAddValue(sslProps.get(), kCFStreamSSLAllowsAnyRoot, kCFBooleanTrue); CFDictionaryAddValue(sslProps.get(), kCFStreamSSLAllowsExpiredRoots, kCFBooleanTrue); CFDictionaryAddValue(sslProps.get(), kCFStreamSSLAllowsExpiredCertificates, kCFBooleanTrue); CFDictionaryAddValue(sslProps.get(), kCFStreamSSLValidatesCertificateChain, kCFBooleanFalse); } HashMap<String, RetainPtr<CFDataRef> >::iterator clientCert = clientCerts().find(firstRequest().url().host().lower()); if (clientCert != clientCerts().end()) { if (!sslProps) sslProps.adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));#if PLATFORM(WIN) wkSetClientCertificateInSSLProperties(sslProps.get(), (clientCert->value).get());#endif } if (sslProps) CFURLRequestSetSSLProperties(request.get(), sslProps.get());#if PLATFORM(WIN) if (CFHTTPCookieStorageRef cookieStorage = overridenCookieStorage()) { // Overridden cookie storage doesn't come from a session, so the request does not have it yet. CFURLRequestSetHTTPCookieStorage(request.get(), cookieStorage); }#endif CFURLConnectionClient_V6 client = { 6, this, 0, 0, 0, WebCore::willSendRequest, didReceiveResponse, didReceiveData, 0, didFinishLoading, didFail, willCacheResponse, didReceiveChallenge, didSendBodyData, shouldUseCredentialStorageCallback, 0,#if USE(PROTECTION_SPACE_AUTH_CALLBACK) canRespondToProtectionSpace,#else 0,#endif 0,#if USE(NETWORK_CFDATA_ARRAY_CALLBACK) didReceiveDataArray#else 0#endif }; RetainPtr<CFDictionaryRef> connectionProperties(AdoptCF, createConnectionProperties(shouldUseCredentialStorage)); d->m_connection.adoptCF(CFURLConnectionCreateWithProperties(0, request.get(), reinterpret_cast<CFURLConnectionClient*>(&client), connectionProperties.get()));}
开发者ID:kcomkar,项目名称:webkit,代码行数:85,
注:本文中的urlWithCredentials函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ url_close函数代码示例 C++ uri_parse函数代码示例 |