summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-07 01:30:58 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-07 01:30:58 +0000
commitb5d6c0347585b1a44270637d68864712f80881e2 (patch)
tree6026ef785fef1c795dcaa1f7313a9513f4362781
parent90594c625bd6ea7a2493cdda2c22f9352de14c97 (diff)
downloadchromium_src-b5d6c0347585b1a44270637d68864712f80881e2.zip
chromium_src-b5d6c0347585b1a44270637d68864712f80881e2.tar.gz
chromium_src-b5d6c0347585b1a44270637d68864712f80881e2.tar.bz2
In some cases (related to window.open() with no contents, see bug for more details) we may get notified of SSL error or mixed-contents without a NavigationEntry.
This CL ensures we don't crash in that case. BUG=3845 TEST=See bug. Review URL: http://codereview.chromium.org/17218 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7644 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ssl_manager.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/chrome/browser/ssl_manager.cc b/chrome/browser/ssl_manager.cc
index 2a875d4..5ff8778 100644
--- a/chrome/browser/ssl_manager.cc
+++ b/chrome/browser/ssl_manager.cc
@@ -468,12 +468,24 @@ void SSLManager::OnMixedContentRequest(ResourceDispatcherHost* rdh,
void SSLManager::OnCertError(CertError* error) {
// Ask our delegate to deal with the error.
NavigationEntry* entry = controller_->GetActiveEntry();
+ // We might not have a navigation entry in some cases (e.g. when a
+ // HTTPS page opens a popup with no URL and then populate it with
+ // document.write()). See bug http://crbug.com/3845.
+ if (!entry)
+ return;
+
delegate()->OnCertError(entry->url(), error);
}
void SSLManager::OnMixedContent(MixedContentHandler* mixed_content) {
// Ask our delegate to deal with the mixed content.
NavigationEntry* entry = controller_->GetActiveEntry();
+ // We might not have a navigation entry in some cases (e.g. when a
+ // HTTPS page opens a popup with no URL and then populate it with
+ // document.write()). See bug http://crbug.com/3845.
+ if (!entry)
+ return;
+
delegate()->OnMixedContent(controller_, entry->url(), mixed_content);
}