| 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 "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/dom/ExceptionCode.h" | 8 #include "core/dom/ExceptionCode.h" |
| 9 #include "core/dom/ExecutionContext.h" | 9 #include "core/dom/ExecutionContext.h" |
| 10 #include "core/dom/SecurityContext.h" | 10 #include "core/dom/SecurityContext.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 frame()->securityContext()->getSecurityOrigin())) | 148 frame()->securityContext()->getSecurityOrigin())) |
| 149 return false; | 149 return false; |
| 150 } | 150 } |
| 151 | 151 |
| 152 callingWindow.printErrorMessage( | 152 callingWindow.printErrorMessage( |
| 153 crossDomainAccessErrorMessage(&callingWindow)); | 153 crossDomainAccessErrorMessage(&callingWindow)); |
| 154 return true; | 154 return true; |
| 155 } | 155 } |
| 156 | 156 |
| 157 void DOMWindow::resetLocation() { | 157 void DOMWindow::resetLocation() { |
| 158 // Location needs to be reset manually because it doesn't inherit from | 158 // Location needs to be reset manually so that it doesn't retain a stale |
| 159 // DOMWindowProperty. DOMWindowProperty is local-only, and Location needs to | 159 // Frame pointer. |
| 160 // support remote windows, too. | |
| 161 if (m_location) { | 160 if (m_location) { |
| 162 m_location->reset(); | 161 m_location->reset(); |
| 163 m_location = nullptr; | 162 m_location = nullptr; |
| 164 } | 163 } |
| 165 } | 164 } |
| 166 | 165 |
| 167 bool DOMWindow::isSecureContext() const { | 166 bool DOMWindow::isSecureContext() const { |
| 168 if (!frame()) | 167 if (!frame()) |
| 169 return false; | 168 return false; |
| 170 | 169 |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */); | 433 page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */); |
| 435 } | 434 } |
| 436 | 435 |
| 437 DEFINE_TRACE(DOMWindow) { | 436 DEFINE_TRACE(DOMWindow) { |
| 438 visitor->trace(m_frame); | 437 visitor->trace(m_frame); |
| 439 visitor->trace(m_location); | 438 visitor->trace(m_location); |
| 440 EventTargetWithInlineData::trace(visitor); | 439 EventTargetWithInlineData::trace(visitor); |
| 441 } | 440 } |
| 442 | 441 |
| 443 } // namespace blink | 442 } // namespace blink |
| OLD | NEW |