Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 401 m_eventQueue->enqueueEvent(event); | 401 m_eventQueue->enqueueEvent(event); |
| 402 } | 402 } |
| 403 | 403 |
| 404 void LocalDOMWindow::dispatchWindowLoadEvent() | 404 void LocalDOMWindow::dispatchWindowLoadEvent() |
| 405 { | 405 { |
| 406 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden()); | 406 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden()); |
| 407 // Delay 'load' event if we are in EventQueueScope. This is a short-term | 407 // Delay 'load' event if we are in EventQueueScope. This is a short-term |
| 408 // workaround to avoid Editing code crashes. We should always dispatch | 408 // workaround to avoid Editing code crashes. We should always dispatch |
| 409 // 'load' event asynchronously. crbug.com/569511. | 409 // 'load' event asynchronously. crbug.com/569511. |
| 410 if (ScopedEventQueue::instance()->shouldQueueEvents() && m_document) { | 410 if (ScopedEventQueue::instance()->shouldQueueEvents() && m_document) { |
| 411 m_document->postTask(BLINK_FROM_HERE, createSameThreadTask(&LocalDOMWind ow::dispatchLoadEvent, this)); | 411 m_document->postTask(BLINK_FROM_HERE, createSameThreadTask(&LocalDOMWind ow::dispatchLoadEvent, wrapCrossThreadPersistent(this))); |
|
haraken
2016/06/22 06:27:43
Ditto.
tzik
2016/06/22 08:26:04
Done.
| |
| 412 return; | 412 return; |
| 413 } | 413 } |
| 414 dispatchLoadEvent(); | 414 dispatchLoadEvent(); |
| 415 } | 415 } |
| 416 | 416 |
| 417 void LocalDOMWindow::documentWasClosed() | 417 void LocalDOMWindow::documentWasClosed() |
| 418 { | 418 { |
| 419 dispatchWindowLoadEvent(); | 419 dispatchWindowLoadEvent(); |
| 420 enqueuePageshowEvent(PageshowEventNotPersisted); | 420 enqueuePageshowEvent(PageshowEventNotPersisted); |
| 421 if (m_pendingStateObject) | 421 if (m_pendingStateObject) |
| (...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1553 { | 1553 { |
| 1554 // If the LocalDOMWindow still has a frame reference, that frame must point | 1554 // If the LocalDOMWindow still has a frame reference, that frame must point |
| 1555 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation | 1555 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation |
| 1556 // where script execution leaks between different LocalDOMWindows. | 1556 // where script execution leaks between different LocalDOMWindows. |
| 1557 if (m_frameObserver->frame()) | 1557 if (m_frameObserver->frame()) |
| 1558 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() = = this); | 1558 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() = = this); |
| 1559 return m_frameObserver->frame(); | 1559 return m_frameObserver->frame(); |
| 1560 } | 1560 } |
| 1561 | 1561 |
| 1562 } // namespace blink | 1562 } // namespace blink |
| OLD | NEW |