mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
When NetworkService is enabled requests created using CefFrame::CreateURLRequest will call CefRequestHandler::GetAuthCredentials for the associated browser after calling CefURLRequestClient::GetAuthCredentials if that call returns false.
This commit is contained in:
@ -546,6 +546,21 @@ void CefRequestContextImpl::ClearCertificateExceptions(
|
||||
this, callback));
|
||||
}
|
||||
|
||||
void CefRequestContextImpl::ClearHttpAuthCredentials(
|
||||
CefRefPtr<CefCompletionCallback> callback) {
|
||||
if (net_service::IsEnabled()) {
|
||||
GetBrowserContext(
|
||||
base::CreateSingleThreadTaskRunnerWithTraits({BrowserThread::UI}),
|
||||
base::Bind(&CefRequestContextImpl::ClearHttpAuthCredentialsInternal,
|
||||
this, callback));
|
||||
} else {
|
||||
GetRequestContextImpl(
|
||||
base::CreateSingleThreadTaskRunnerWithTraits({BrowserThread::IO}),
|
||||
base::Bind(&CefRequestContextImpl::ClearHttpAuthCredentialsInternalOld,
|
||||
this, callback));
|
||||
}
|
||||
}
|
||||
|
||||
void CefRequestContextImpl::CloseAllConnections(
|
||||
CefRefPtr<CefCompletionCallback> callback) {
|
||||
if (net_service::IsEnabled()) {
|
||||
@ -847,6 +862,36 @@ void CefRequestContextImpl::ClearCertificateExceptionsInternal(
|
||||
}
|
||||
}
|
||||
|
||||
void CefRequestContextImpl::ClearHttpAuthCredentialsInternal(
|
||||
CefRefPtr<CefCompletionCallback> callback,
|
||||
CefBrowserContext* browser_context) {
|
||||
CEF_REQUIRE_UIT();
|
||||
|
||||
browser_context->GetNetworkContext()->ClearHttpAuthCache(
|
||||
base::Time(), base::Bind(&CefCompletionCallback::OnComplete, callback));
|
||||
}
|
||||
|
||||
void CefRequestContextImpl::ClearHttpAuthCredentialsInternalOld(
|
||||
CefRefPtr<CefCompletionCallback> callback,
|
||||
scoped_refptr<CefURLRequestContextGetter> request_context) {
|
||||
CEF_REQUIRE_IOT();
|
||||
|
||||
net::URLRequestContext* url_context = request_context->GetURLRequestContext();
|
||||
if (url_context) {
|
||||
net::HttpNetworkSession* http_session =
|
||||
url_context->http_transaction_factory()->GetSession();
|
||||
DCHECK(http_session);
|
||||
|
||||
http_session->http_auth_cache()->ClearEntriesAddedSince(base::Time());
|
||||
http_session->CloseAllConnections();
|
||||
}
|
||||
|
||||
if (callback) {
|
||||
CEF_POST_TASK(CEF_UIT,
|
||||
base::Bind(&CefCompletionCallback::OnComplete, callback));
|
||||
}
|
||||
}
|
||||
|
||||
void CefRequestContextImpl::CloseAllConnectionsInternal(
|
||||
CefRefPtr<CefCompletionCallback> callback,
|
||||
CefBrowserContext* browser_context) {
|
||||
|
Reference in New Issue
Block a user