| Index: components/security_interstitials/content/security_interstitial_page.cc
|
| diff --git a/components/security_interstitials/content/security_interstitial_page.cc b/components/security_interstitials/content/security_interstitial_page.cc
|
| index 6ff9b3a9ac5a82ac4f91ea2164dcbf8362ed3e07..c3fefb5699ce3ea238e4c39e44c2af78ea3bc743 100644
|
| --- a/components/security_interstitials/content/security_interstitial_page.cc
|
| +++ b/components/security_interstitials/content/security_interstitial_page.cc
|
| @@ -34,9 +34,12 @@ SecurityInterstitialPage::SecurityInterstitialPage(
|
| create_view_(true),
|
| controller_(std::move(controller)) {
|
| // Determine if any prefs need to be updated prior to showing the security
|
| - // interstitial.
|
| - safe_browsing::UpdatePrefsBeforeSecurityInterstitial(
|
| - controller_->GetPrefService());
|
| + // interstitial. Note that some content embedders (such as Android WebView)
|
| + // uses security interstitials without a prefservice.
|
| + if (controller_->GetPrefService()) {
|
| + safe_browsing::UpdatePrefsBeforeSecurityInterstitial(
|
| + controller_->GetPrefService());
|
| + }
|
|
|
| // Creating interstitial_page_ without showing it leaks memory, so don't
|
| // create it here.
|
| @@ -74,10 +77,6 @@ void SecurityInterstitialPage::Show() {
|
| AfterShow();
|
| }
|
|
|
| -bool SecurityInterstitialPage::IsPrefEnabled(const char* pref) {
|
| - return controller_->GetPrefService()->GetBoolean(pref);
|
| -}
|
| -
|
| SecurityInterstitialControllerClient* SecurityInterstitialPage::controller() {
|
| return controller_.get();
|
| }
|
|
|