| 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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 m_eventQueue->enqueueEvent(event); | 387 m_eventQueue->enqueueEvent(event); |
| 388 } | 388 } |
| 389 | 389 |
| 390 void LocalDOMWindow::dispatchWindowLoadEvent() | 390 void LocalDOMWindow::dispatchWindowLoadEvent() |
| 391 { | 391 { |
| 392 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden()); | 392 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden()); |
| 393 // Delay 'load' event if we are in EventQueueScope. This is a short-term | 393 // Delay 'load' event if we are in EventQueueScope. This is a short-term |
| 394 // workaround to avoid Editing code crashes. We should always dispatch | 394 // workaround to avoid Editing code crashes. We should always dispatch |
| 395 // 'load' event asynchronously. crbug.com/569511. | 395 // 'load' event asynchronously. crbug.com/569511. |
| 396 if (ScopedEventQueue::instance()->shouldQueueEvents() && m_document) { | 396 if (ScopedEventQueue::instance()->shouldQueueEvents() && m_document) { |
| 397 m_document->postTask(BLINK_FROM_HERE, createSameThreadTask(&LocalDOMWind
ow::dispatchLoadEvent, this)); | 397 m_document->postTask(BLINK_FROM_HERE, createSameThreadTask(&LocalDOMWind
ow::dispatchLoadEvent, retainedRef(this))); |
| 398 return; | 398 return; |
| 399 } | 399 } |
| 400 dispatchLoadEvent(); | 400 dispatchLoadEvent(); |
| 401 } | 401 } |
| 402 | 402 |
| 403 void LocalDOMWindow::documentWasClosed() | 403 void LocalDOMWindow::documentWasClosed() |
| 404 { | 404 { |
| 405 dispatchWindowLoadEvent(); | 405 dispatchWindowLoadEvent(); |
| 406 enqueuePageshowEvent(PageshowEventNotPersisted); | 406 enqueuePageshowEvent(PageshowEventNotPersisted); |
| 407 if (m_pendingStateObject) | 407 if (m_pendingStateObject) |
| (...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1497 { | 1497 { |
| 1498 // If the LocalDOMWindow still has a frame reference, that frame must point | 1498 // If the LocalDOMWindow still has a frame reference, that frame must point |
| 1499 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation | 1499 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation |
| 1500 // where script execution leaks between different LocalDOMWindows. | 1500 // where script execution leaks between different LocalDOMWindows. |
| 1501 if (m_frameObserver->frame()) | 1501 if (m_frameObserver->frame()) |
| 1502 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() =
= this); | 1502 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() =
= this); |
| 1503 return m_frameObserver->frame(); | 1503 return m_frameObserver->frame(); |
| 1504 } | 1504 } |
| 1505 | 1505 |
| 1506 } // namespace blink | 1506 } // namespace blink |
| OLD | NEW |