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

Unified Diff: chrome/browser/ui/website_settings/website_settings.cc

Issue 1317443002: Fix UAF in Origin Info Bubble and permission settings UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Give WebsiteSettings a WebContents instead of an InfoBarService; retrieve the IBS just before it's … Created 5 years, 4 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/website_settings/website_settings.cc
diff --git a/chrome/browser/ui/website_settings/website_settings.cc b/chrome/browser/ui/website_settings/website_settings.cc
index caeab798cf18acb559e1c792a80a264e78b82999..c477a78a857b617c78b36c72eab125b0d74717b8 100644
--- a/chrome/browser/ui/website_settings/website_settings.cc
+++ b/chrome/browser/ui/website_settings/website_settings.cc
@@ -23,6 +23,7 @@
#include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h"
#include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h"
#include "chrome/browser/history/history_service_factory.h"
+#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h"
#include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h"
@@ -146,14 +147,14 @@ WebsiteSettings::WebsiteSettings(
WebsiteSettingsUI* ui,
Profile* profile,
TabSpecificContentSettings* tab_specific_content_settings,
- InfoBarService* infobar_service,
+ content::WebContents* web_contents,
const GURL& url,
const content::SSLStatus& ssl,
content::CertStore* cert_store)
: TabSpecificContentSettings::SiteDataObserver(
tab_specific_content_settings),
ui_(ui),
- infobar_service_(infobar_service),
+ web_contents_(web_contents),
show_info_bar_(false),
site_url_(url),
site_identity_status_(SITE_IDENTITY_STATUS_UNKNOWN),
@@ -321,8 +322,12 @@ void WebsiteSettings::OnSiteDataAccessed() {
}
void WebsiteSettings::OnUIClosing() {
- if (show_info_bar_)
- WebsiteSettingsInfoBarDelegate::Create(infobar_service_);
+ if (show_info_bar_) {
+ InfoBarService* infobar_service =
+ InfoBarService::FromWebContents(web_contents_);
felt 2015/08/25 22:30:43 does this fail gracefully if web_contents is a nul
palmer 2015/08/25 22:40:50 We do need the check; it would deref the nullptr.
+ if (infobar_service)
+ WebsiteSettingsInfoBarDelegate::Create(infobar_service);
+ }
SSLCertificateDecisionsDidRevoke user_decision =
did_revoke_user_ssl_decisions_ ? USER_CERT_DECISIONS_REVOKED
« no previous file with comments | « chrome/browser/ui/website_settings/website_settings.h ('k') | chrome/browser/ui/website_settings/website_settings_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698