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

Unified Diff: third_party/WebKit/Source/core/frame/DOMWindow.cpp

Issue 1417023006: bindings: Refactors BindingSecurity::shouldAllowAccessToXXX. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed the assertion condition. Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/frame/DOMWindow.cpp
diff --git a/third_party/WebKit/Source/core/frame/DOMWindow.cpp b/third_party/WebKit/Source/core/frame/DOMWindow.cpp
index 442a2d7d36c649e224618198bd85fa70aa31290f..d48031ce4df847e4ffdb4dba9c8a4e9ed7380bc1 100644
--- a/third_party/WebKit/Source/core/frame/DOMWindow.cpp
+++ b/third_party/WebKit/Source/core/frame/DOMWindow.cpp
@@ -230,7 +230,7 @@ void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, const Mes
// exactly which details may be exposed to JavaScript.
//
// http://crbug.com/17325
-String DOMWindow::sanitizedCrossDomainAccessErrorMessage(LocalDOMWindow* callingWindow)
+String DOMWindow::sanitizedCrossDomainAccessErrorMessage(const LocalDOMWindow* callingWindow) const
{
if (!callingWindow || !callingWindow->document() || !frame())
return String();
@@ -241,7 +241,7 @@ String DOMWindow::sanitizedCrossDomainAccessErrorMessage(LocalDOMWindow* calling
ASSERT(!callingWindow->document()->securityOrigin()->canAccessCheckSuborigins(frame()->securityContext()->securityOrigin()));
- SecurityOrigin* activeOrigin = callingWindow->document()->securityOrigin();
+ const SecurityOrigin* activeOrigin = callingWindow->document()->securityOrigin();
String message = "Blocked a frame with origin \"" + activeOrigin->toString() + "\" from accessing a cross-origin frame.";
// FIXME: Evaluate which details from 'crossDomainAccessErrorMessage' may safely be reported to JavaScript.
@@ -249,7 +249,7 @@ String DOMWindow::sanitizedCrossDomainAccessErrorMessage(LocalDOMWindow* calling
return message;
}
-String DOMWindow::crossDomainAccessErrorMessage(LocalDOMWindow* callingWindow)
+String DOMWindow::crossDomainAccessErrorMessage(const LocalDOMWindow* callingWindow) const
{
if (!callingWindow || !callingWindow->document() || !frame())
return String();
@@ -259,8 +259,8 @@ String DOMWindow::crossDomainAccessErrorMessage(LocalDOMWindow* callingWindow)
return String();
// FIXME: This message, and other console messages, have extra newlines. Should remove them.
- SecurityOrigin* activeOrigin = callingWindow->document()->securityOrigin();
- SecurityOrigin* targetOrigin = frame()->securityContext()->securityOrigin();
+ const SecurityOrigin* activeOrigin = callingWindow->document()->securityOrigin();
+ const SecurityOrigin* targetOrigin = frame()->securityContext()->securityOrigin();
ASSERT(!activeOrigin->canAccessCheckSuborigins(targetOrigin));
String message = "Blocked a frame with origin \"" + activeOrigin->toString() + "\" from accessing a frame with origin \"" + targetOrigin->toString() + "\". ";
« no previous file with comments | « third_party/WebKit/Source/core/frame/DOMWindow.h ('k') | third_party/WebKit/Source/core/frame/LocalDOMWindow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698