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

Unified Diff: chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.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: chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc
diff --git a/chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc b/chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc
index 03a141daabe613dedb9569c4ea283a1101778b24..dd72f247e52988197f51642806794d44cba426b3 100644
--- a/chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc
+++ b/chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc
@@ -76,7 +76,9 @@ ChromeToolbarModelDelegate::GetSecurityLevel() const {
if (!web_contents)
return security_state::SecurityStateModel::NONE;
auto* client = ChromeSecurityStateModelClient::FromWebContents(web_contents);
- return client->GetSecurityInfo().security_level;
+ security_state::SecurityStateModel::SecurityInfo security_info;
+ client->GetSecurityInfo(&security_info);
+ return security_info.security_level;
}
scoped_refptr<net::X509Certificate> ChromeToolbarModelDelegate::GetCertificate()
@@ -91,10 +93,12 @@ bool ChromeToolbarModelDelegate::FailsMalwareCheck() const {
content::WebContents* web_contents = GetActiveWebContents();
// If there is no active WebContents (which can happen during toolbar
// initialization), so nothing can fail.
- return web_contents &&
- ChromeSecurityStateModelClient::FromWebContents(web_contents)
- ->GetSecurityInfo()
- .fails_malware_check;
+ if (!web_contents)
+ return false;
+ security_state::SecurityStateModel::SecurityInfo security_info;
+ ChromeSecurityStateModelClient::FromWebContents(web_contents)
+ ->GetSecurityInfo(&security_info);
+ return security_info.fails_malware_check;
}
content::NavigationController*

Powered by Google App Engine
This is Rietveld 408576698