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

Side by Side Diff: Source/core/dom/Document.cpp

Issue 1171363002: Fix null pointer dereference in ChromeClientImpl::openBeforeUnloadConfirmPanelDelegate. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 2538 matching lines...) Expand 10 before | Expand all | Expand 10 after
2549 return false; 2549 return false;
2550 2550
2551 RefPtrWillBeRawPtr<Document> protect(this); 2551 RefPtrWillBeRawPtr<Document> protect(this);
2552 2552
2553 RefPtrWillBeRawPtr<BeforeUnloadEvent> beforeUnloadEvent = BeforeUnloadEvent: :create(); 2553 RefPtrWillBeRawPtr<BeforeUnloadEvent> beforeUnloadEvent = BeforeUnloadEvent: :create();
2554 m_loadEventProgress = BeforeUnloadEventInProgress; 2554 m_loadEventProgress = BeforeUnloadEventInProgress;
2555 m_domWindow->dispatchEvent(beforeUnloadEvent.get(), this); 2555 m_domWindow->dispatchEvent(beforeUnloadEvent.get(), this);
2556 m_loadEventProgress = BeforeUnloadEventCompleted; 2556 m_loadEventProgress = BeforeUnloadEventCompleted;
2557 if (!beforeUnloadEvent->defaultPrevented()) 2557 if (!beforeUnloadEvent->defaultPrevented())
2558 defaultEventHandler(beforeUnloadEvent.get()); 2558 defaultEventHandler(beforeUnloadEvent.get());
2559 if (beforeUnloadEvent->returnValue().isNull()) 2559 if (!frame() || beforeUnloadEvent->returnValue().isNull())
2560 return true; 2560 return true;
2561 2561
2562 if (didAllowNavigation) { 2562 if (didAllowNavigation) {
2563 addConsoleMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLe vel, "Blocked attempt to show multiple 'beforeunload' confirmation panels for a single navigation.")); 2563 addConsoleMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLe vel, "Blocked attempt to show multiple 'beforeunload' confirmation panels for a single navigation."));
2564 return true; 2564 return true;
2565 } 2565 }
2566 2566
2567 String text = beforeUnloadEvent->returnValue(); 2567 String text = beforeUnloadEvent->returnValue();
2568 if (chromeClient.openBeforeUnloadConfirmPanel(text, m_frame)) { 2568 if (chromeClient.openBeforeUnloadConfirmPanel(text, m_frame)) {
2569 didAllowNavigation = true; 2569 didAllowNavigation = true;
(...skipping 3140 matching lines...) Expand 10 before | Expand all | Expand 10 after
5710 #ifndef NDEBUG 5710 #ifndef NDEBUG
5711 using namespace blink; 5711 using namespace blink;
5712 void showLiveDocumentInstances() 5712 void showLiveDocumentInstances()
5713 { 5713 {
5714 WeakDocumentSet& set = liveDocumentSet(); 5714 WeakDocumentSet& set = liveDocumentSet();
5715 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5715 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5716 for (Document* document : set) 5716 for (Document* document : set)
5717 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5717 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5718 } 5718 }
5719 #endif 5719 #endif
OLDNEW
« no previous file with comments | « LayoutTests/fast/events/before-unload-crash-expected.txt ('k') | Source/core/page/ChromeClient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698