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

Side by Side Diff: Source/core/frame/LocalDOMWindow.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/bindings/core/v8/BindingSecurity.cpp ('k') | Source/core/frame/LocalFrame.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) 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 1556 matching lines...) Expand 10 before | Expand all | Expand 10 after
1567 // Default. 1567 // Default.
1568 return message + "Protocols, domains, and ports must match."; 1568 return message + "Protocols, domains, and ports must match.";
1569 } 1569 }
1570 1570
1571 bool LocalDOMWindow::isInsecureScriptAccess(DOMWindow& callingWindow, const Stri ng& urlString) 1571 bool LocalDOMWindow::isInsecureScriptAccess(DOMWindow& callingWindow, const Stri ng& urlString)
1572 { 1572 {
1573 if (!DOMWindow::isInsecureScriptAccess(callingWindow, urlString)) 1573 if (!DOMWindow::isInsecureScriptAccess(callingWindow, urlString))
1574 return false; 1574 return false;
1575 1575
1576 if (callingWindow.isLocalDOMWindow()) 1576 if (callingWindow.isLocalDOMWindow())
1577 printErrorMessage(crossDomainAccessErrorMessage(static_cast<LocalDOMWind ow*>(&callingWindow))); 1577 toLocalDOMWindow(&callingWindow)->printErrorMessage(crossDomainAccessErr orMessage(toLocalDOMWindow(&callingWindow)));
1578 return true; 1578 return true;
1579 } 1579 }
1580 1580
1581 PassRefPtrWillBeRawPtr<DOMWindow> LocalDOMWindow::open(const String& urlString, const AtomicString& frameName, const String& windowFeaturesString, 1581 PassRefPtrWillBeRawPtr<DOMWindow> LocalDOMWindow::open(const String& urlString, const AtomicString& frameName, const String& windowFeaturesString,
1582 LocalDOMWindow* callingWindow, LocalDOMWindow* enteredWindow) 1582 LocalDOMWindow* callingWindow, LocalDOMWindow* enteredWindow)
1583 { 1583 {
1584 if (!isCurrentlyDisplayedInFrame()) 1584 if (!isCurrentlyDisplayedInFrame())
1585 return nullptr; 1585 return nullptr;
1586 Document* activeDocument = callingWindow->document(); 1586 Document* activeDocument = callingWindow->document();
1587 if (!activeDocument) 1587 if (!activeDocument)
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
1666 return m_frameObserver->frame(); 1666 return m_frameObserver->frame();
1667 } 1667 }
1668 1668
1669 v8::Handle<v8::Object> LocalDOMWindow::wrap(v8::Handle<v8::Object> creationConte xt, v8::Isolate* isolate) 1669 v8::Handle<v8::Object> LocalDOMWindow::wrap(v8::Handle<v8::Object> creationConte xt, v8::Isolate* isolate)
1670 { 1670 {
1671 ASSERT_NOT_REACHED(); // LocalDOMWindow has [Custom=ToV8]. 1671 ASSERT_NOT_REACHED(); // LocalDOMWindow has [Custom=ToV8].
1672 return v8::Handle<v8::Object>(); 1672 return v8::Handle<v8::Object>();
1673 } 1673 }
1674 1674
1675 } // namespace blink 1675 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/BindingSecurity.cpp ('k') | Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698