| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/frame/DOMWindow.h" | 5 #include "core/frame/DOMWindow.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptCallStack.h" | 7 #include "bindings/core/v8/ScriptCallStack.h" |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "core/dom/ExceptionCode.h" | 9 #include "core/dom/ExceptionCode.h" |
| 10 #include "core/dom/ExecutionContext.h" | 10 #include "core/dom/ExecutionContext.h" |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 // http://crbug.com/17325 | 236 // http://crbug.com/17325 |
| 237 String DOMWindow::sanitizedCrossDomainAccessErrorMessage(const LocalDOMWindow* c
allingWindow) const | 237 String DOMWindow::sanitizedCrossDomainAccessErrorMessage(const LocalDOMWindow* c
allingWindow) const |
| 238 { | 238 { |
| 239 if (!callingWindow || !callingWindow->document() || !frame()) | 239 if (!callingWindow || !callingWindow->document() || !frame()) |
| 240 return String(); | 240 return String(); |
| 241 | 241 |
| 242 const KURL& callingWindowURL = callingWindow->document()->url(); | 242 const KURL& callingWindowURL = callingWindow->document()->url(); |
| 243 if (callingWindowURL.isNull()) | 243 if (callingWindowURL.isNull()) |
| 244 return String(); | 244 return String(); |
| 245 | 245 |
| 246 ASSERT(!callingWindow->document()->getSecurityOrigin()->canAccessCheckSubori
gins(frame()->securityContext()->getSecurityOrigin())); | |
| 247 | |
| 248 const SecurityOrigin* activeOrigin = callingWindow->document()->getSecurityO
rigin(); | 246 const SecurityOrigin* activeOrigin = callingWindow->document()->getSecurityO
rigin(); |
| 249 String message = "Blocked a frame with origin \"" + activeOrigin->toString()
+ "\" from accessing a cross-origin frame."; | 247 String message = "Blocked a frame with origin \"" + activeOrigin->toString()
+ "\" from accessing a cross-origin frame."; |
| 250 | 248 |
| 251 // FIXME: Evaluate which details from 'crossDomainAccessErrorMessage' may sa
fely be reported to JavaScript. | 249 // FIXME: Evaluate which details from 'crossDomainAccessErrorMessage' may sa
fely be reported to JavaScript. |
| 252 | 250 |
| 253 return message; | 251 return message; |
| 254 } | 252 } |
| 255 | 253 |
| 256 String DOMWindow::crossDomainAccessErrorMessage(const LocalDOMWindow* callingWin
dow) const | 254 String DOMWindow::crossDomainAccessErrorMessage(const LocalDOMWindow* callingWin
dow) const |
| 257 { | 255 { |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */
); | 369 page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */
); |
| 372 } | 370 } |
| 373 | 371 |
| 374 DEFINE_TRACE(DOMWindow) | 372 DEFINE_TRACE(DOMWindow) |
| 375 { | 373 { |
| 376 visitor->trace(m_location); | 374 visitor->trace(m_location); |
| 377 EventTargetWithInlineData::trace(visitor); | 375 EventTargetWithInlineData::trace(visitor); |
| 378 } | 376 } |
| 379 | 377 |
| 380 } // namespace blink | 378 } // namespace blink |
| OLD | NEW |