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

Unified Diff: components/security_state/security_state_model.cc

Issue 2363623002: Remove SecurityStateModel memoization (Closed)
Patch Set: 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
Index: components/security_state/security_state_model.cc
diff --git a/components/security_state/security_state_model.cc b/components/security_state/security_state_model.cc
index 4c6ae2c0560551e7337600476bb7830789d61cbe..e8dba3c1062248533b2db58122676827f4c07e86 100644
--- a/components/security_state/security_state_model.cc
+++ b/components/security_state/security_state_model.cc
@@ -293,30 +293,14 @@ SecurityStateModel::SecurityStateModel() {}
SecurityStateModel::~SecurityStateModel() {}
-const SecurityStateModel::SecurityInfo& SecurityStateModel::GetSecurityInfo()
- const {
+void SecurityStateModel::GetSecurityInfo(
+ SecurityStateModel::SecurityInfo* result) const {
scoped_refptr<net::X509Certificate> cert = nullptr;
client_->RetrieveCert(&cert);
- // Check if the cached |security_info_| must be recomputed.
VisibleSecurityState new_visible_state;
client_->GetVisibleSecurityState(&new_visible_state);
- bool visible_security_state_changed =
- !(visible_security_state_ == new_visible_state);
- if (!visible_security_state_changed) {
- // A cert must be present in order for the site to be considered
- // EV_SECURE, and the cert might have been removed since the
- // security level was last computed.
- if (security_info_.security_level == EV_SECURE && !cert) {
- security_info_.security_level = SECURE;
- }
- return security_info_;
- }
-
- visible_security_state_ = new_visible_state;
- SecurityInfoForRequest(client_, visible_security_state_, cert,
- &security_info_);
- return security_info_;
+ SecurityInfoForRequest(client_, new_visible_state, cert, result);
}
void SecurityStateModel::SetClient(SecurityStateModelClient* client) {
« no previous file with comments | « components/security_state/security_state_model.h ('k') | components/security_state/security_state_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698