Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1211)

Unified Diff: android_webview/native/aw_contents.cc

Issue 2327433002: Stop using CertStore which is not compatible with PlzNavigate. (Closed)
Patch Set: remove cert_store on ios Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/aw_contents.cc
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc
index bcf3669a81b42c929ef43f90833f264331da830b..4d486d7510910ab88edb568e88c4e745fdff36c6 100644
--- a/android_webview/native/aw_contents.cc
+++ b/android_webview/native/aw_contents.cc
@@ -60,7 +60,6 @@
#include "content/public/browser/android/content_view_core.h"
#include "content/public/browser/android/synchronous_compositor.h"
#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/cert_store.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/favicon_status.h"
#include "content/public/browser/message_port_provider.h"
@@ -769,18 +768,13 @@ base::android::ScopedJavaLocalRef<jbyteArray> AwContents::GetCertificate(
DCHECK_CURRENTLY_ON(BrowserThread::UI);
content::NavigationEntry* entry =
web_contents_->GetController().GetLastCommittedEntry();
- if (!entry)
- return ScopedJavaLocalRef<jbyteArray>();
- // Get the certificate
- int cert_id = entry->GetSSL().cert_id;
- scoped_refptr<net::X509Certificate> cert;
- bool ok = content::CertStore::GetInstance()->RetrieveCert(cert_id, &cert);
- if (!ok)
+ if (!entry || !entry->GetSSL().certificate)
return ScopedJavaLocalRef<jbyteArray>();
// Convert the certificate and return it
std::string der_string;
- net::X509Certificate::GetDEREncoded(cert->os_cert_handle(), &der_string);
+ net::X509Certificate::GetDEREncoded(
+ entry->GetSSL().certificate->os_cert_handle(), &der_string);
return base::android::ToJavaByteArray(
env, reinterpret_cast<const uint8_t*>(der_string.data()),
der_string.length());
« no previous file with comments | « no previous file | chrome/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698