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

Side by Side Diff: Source/core/frame/LocalDOMWindow.cpp

Issue 413683002: LocalWindow::printErrorMessage(): check if frame is available. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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
« no previous file with comments | « LayoutTests/fast/dom/document-navigation-error-no-crash-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1707 matching lines...) Expand 10 before | Expand all | Expand 10 after
1718 1718
1719 // We want a new history item if we are processing a user gesture. 1719 // We want a new history item if we are processing a user gesture.
1720 m_frame->navigationScheduler().scheduleLocationChange(activeDocument, 1720 m_frame->navigationScheduler().scheduleLocationChange(activeDocument,
1721 // FIXME: What if activeDocument()->frame() is 0? 1721 // FIXME: What if activeDocument()->frame() is 0?
1722 completedURL, Referrer(activeDocument->outgoingReferrer(), activeDocumen t->referrerPolicy()), 1722 completedURL, Referrer(activeDocument->outgoingReferrer(), activeDocumen t->referrerPolicy()),
1723 locking != LockHistoryBasedOnGestureState); 1723 locking != LockHistoryBasedOnGestureState);
1724 } 1724 }
1725 1725
1726 void LocalDOMWindow::printErrorMessage(const String& message) 1726 void LocalDOMWindow::printErrorMessage(const String& message)
1727 { 1727 {
1728 if (!isCurrentlyDisplayedInFrame())
1729 return;
1730
1728 if (message.isEmpty()) 1731 if (message.isEmpty())
1729 return; 1732 return;
1730 1733
1731 frameConsole()->addMessage(JSMessageSource, ErrorMessageLevel, message); 1734 frameConsole()->addMessage(JSMessageSource, ErrorMessageLevel, message);
1732 } 1735 }
1733 1736
1734 // FIXME: Once we're throwing exceptions for cross-origin access violations, we will always sanitize the target 1737 // FIXME: Once we're throwing exceptions for cross-origin access violations, we will always sanitize the target
1735 // frame details, so we can safely combine 'crossDomainAccessErrorMessage' with this method after considering 1738 // frame details, so we can safely combine 'crossDomainAccessErrorMessage' with this method after considering
1736 // exactly which details may be exposed to JavaScript. 1739 // exactly which details may be exposed to JavaScript.
1737 // 1740 //
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1953 visitor->trace(m_localStorage); 1956 visitor->trace(m_localStorage);
1954 visitor->trace(m_applicationCache); 1957 visitor->trace(m_applicationCache);
1955 visitor->trace(m_performance); 1958 visitor->trace(m_performance);
1956 visitor->trace(m_css); 1959 visitor->trace(m_css);
1957 visitor->trace(m_eventQueue); 1960 visitor->trace(m_eventQueue);
1958 WillBeHeapSupplementable<LocalDOMWindow>::trace(visitor); 1961 WillBeHeapSupplementable<LocalDOMWindow>::trace(visitor);
1959 EventTargetWithInlineData::trace(visitor); 1962 EventTargetWithInlineData::trace(visitor);
1960 } 1963 }
1961 1964
1962 } // namespace blink 1965 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/document-navigation-error-no-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698