| 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 <memory> | 7 #include <memory> |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 ConsoleMessage::create( | 371 ConsoleMessage::create( |
| 372 JSMessageSource, WarningMessageLevel, | 372 JSMessageSource, WarningMessageLevel, |
| 373 "Scripts may close only the windows that were opened by it.")); | 373 "Scripts may close only the windows that were opened by it.")); |
| 374 } | 374 } |
| 375 return; | 375 return; |
| 376 } | 376 } |
| 377 | 377 |
| 378 if (!frame()->shouldClose()) | 378 if (!frame()->shouldClose()) |
| 379 return; | 379 return; |
| 380 | 380 |
| 381 InspectorInstrumentation::NativeBreakpoint nativeBreakpoint( | 381 InspectorInstrumentation::breakIfNeeded(context, "DOMWindow.close"); |
| 382 context, "DOMWindow.close", true); | |
| 383 | 382 |
| 384 page->closeSoon(); | 383 page->closeSoon(); |
| 385 | 384 |
| 386 // So as to make window.closed return the expected result | 385 // So as to make window.closed return the expected result |
| 387 // after window.close(), separately record the to-be-closed | 386 // after window.close(), separately record the to-be-closed |
| 388 // state of this window. Scripts may access window.closed | 387 // state of this window. Scripts may access window.closed |
| 389 // before the deferred close operation has gone ahead. | 388 // before the deferred close operation has gone ahead. |
| 390 m_windowIsClosing = true; | 389 m_windowIsClosing = true; |
| 391 } | 390 } |
| 392 | 391 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 423 } | 422 } |
| 424 | 423 |
| 425 DEFINE_TRACE(DOMWindow) { | 424 DEFINE_TRACE(DOMWindow) { |
| 426 visitor->trace(m_frame); | 425 visitor->trace(m_frame); |
| 427 visitor->trace(m_inputCapabilities); | 426 visitor->trace(m_inputCapabilities); |
| 428 visitor->trace(m_location); | 427 visitor->trace(m_location); |
| 429 EventTargetWithInlineData::trace(visitor); | 428 EventTargetWithInlineData::trace(visitor); |
| 430 } | 429 } |
| 431 | 430 |
| 432 } // namespace blink | 431 } // namespace blink |
| OLD | NEW |