0

Check if the delegate in WebContents::CanTerminate is valid

before invoking on it. not doing this causes a UT test
'VisibleBrowserTest.WindowOpenClose' to crash frequently.



Review URL: http://codereview.chromium.org/17366

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7905 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
joshia@google.com
2009-01-13 00:02:25 +00:00
parent 10c64a48c1
commit ee4ac82f11

@ -1342,6 +1342,9 @@ void WebContents::OnEnterOrSpace() {
}
bool WebContents::CanTerminate() const {
if (!delegate())
return true;
return !delegate()->IsExternalTabContainer();
}
@ -1358,7 +1361,8 @@ void WebContents::FileSelectionCanceled(void* params) {
void WebContents::BeforeUnloadFiredFromRenderManager(
bool proceed,
bool* proceed_to_fire_unload) {
delegate()->BeforeUnloadFired(this, proceed, proceed_to_fire_unload);
if (delegate())
delegate()->BeforeUnloadFired(this, proceed, proceed_to_fire_unload);
}
void WebContents::UpdateRenderViewSizeForRenderManager() {