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

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

Issue 1096173003: Print cross-domain access errors on calling window rather than target. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add a test Created 5 years, 8 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 | « Source/core/frame/LocalDOMWindow.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | 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) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 } 286 }
287 287
288 void LocalFrame::printNavigationErrorMessage(const Frame& targetFrame, const cha r* reason) 288 void LocalFrame::printNavigationErrorMessage(const Frame& targetFrame, const cha r* reason)
289 { 289 {
290 if (!targetFrame.isLocalFrame()) 290 if (!targetFrame.isLocalFrame())
291 return; 291 return;
292 292
293 const LocalFrame& targetLocalFrame = toLocalFrameTemporary(targetFrame); 293 const LocalFrame& targetLocalFrame = toLocalFrameTemporary(targetFrame);
294 String message = "Unsafe JavaScript attempt to initiate navigation for frame with URL '" + targetLocalFrame.document()->url().string() + "' from frame with URL '" + document()->url().string() + "'. " + reason + "\n"; 294 String message = "Unsafe JavaScript attempt to initiate navigation for frame with URL '" + targetLocalFrame.document()->url().string() + "' from frame with URL '" + document()->url().string() + "'. " + reason + "\n";
295 295
296 // FIXME: should we print to the console of the document performing the navi gation instead? 296 localDOMWindow()->printErrorMessage(message);
297 targetLocalFrame.localDOMWindow()->printErrorMessage(message);
298 } 297 }
299 298
300 bool LocalFrame::isLoadingAsChild() const 299 bool LocalFrame::isLoadingAsChild() const
301 { 300 {
302 return isLoading() || !document()->isLoadCompleted(); 301 return isLoading() || !document()->isLoadCompleted();
303 } 302 }
304 303
305 WindowProxyManager* LocalFrame::windowProxyManager() const 304 WindowProxyManager* LocalFrame::windowProxyManager() const
306 { 305 {
307 return m_script->windowProxyManager(); 306 return m_script->windowProxyManager();
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 , m_shouldSendDPRHint(false) 817 , m_shouldSendDPRHint(false)
819 , m_shouldSendRWHint(false) 818 , m_shouldSendRWHint(false)
820 { 819 {
821 if (isLocalRoot()) 820 if (isLocalRoot())
822 m_instrumentingAgents = InstrumentingAgents::create(); 821 m_instrumentingAgents = InstrumentingAgents::create();
823 else 822 else
824 m_instrumentingAgents = localFrameRoot()->m_instrumentingAgents; 823 m_instrumentingAgents = localFrameRoot()->m_instrumentingAgents;
825 } 824 }
826 825
827 } // namespace blink 826 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/LocalDOMWindow.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698