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 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1558 } else if (eventType == EventTypeNames::beforeunload && allowsBeforeUnloadLi
steners(this)) { | 1558 } else if (eventType == EventTypeNames::beforeunload && allowsBeforeUnloadLi
steners(this)) { |
1559 removeBeforeUnloadEventListener(this); | 1559 removeBeforeUnloadEventListener(this); |
1560 } | 1560 } |
1561 | 1561 |
1562 return true; | 1562 return true; |
1563 } | 1563 } |
1564 | 1564 |
1565 void LocalDOMWindow::dispatchLoadEvent() | 1565 void LocalDOMWindow::dispatchLoadEvent() |
1566 { | 1566 { |
1567 RefPtrWillBeRawPtr<Event> loadEvent(Event::create(EventTypeNames::load)); | 1567 RefPtrWillBeRawPtr<Event> loadEvent(Event::create(EventTypeNames::load)); |
1568 if (frame() && frame()->loader().documentLoader() && !frame()->loader().docu
mentLoader()->timing()->loadEventStart()) { | 1568 if (frame() && frame()->loader().documentLoader() && !frame()->loader().docu
mentLoader()->timing().loadEventStart()) { |
1569 // The DocumentLoader (and thus its DocumentLoadTiming) might get destro
yed while dispatching | 1569 // The DocumentLoader (and thus its DocumentLoadTiming) might get destro
yed while dispatching |
1570 // the event, so protect it to prevent writing the end time into freed m
emory. | 1570 // the event, so protect it to prevent writing the end time into freed m
emory. |
1571 RefPtr<DocumentLoader> documentLoader = frame()->loader().documentLoader
(); | 1571 RefPtr<DocumentLoader> documentLoader = frame()->loader().documentLoader
(); |
1572 DocumentLoadTiming* timing = documentLoader->timing(); | 1572 DocumentLoadTiming& timing = documentLoader->timing(); |
1573 timing->markLoadEventStart(); | 1573 timing.markLoadEventStart(); |
1574 dispatchEvent(loadEvent, document()); | 1574 dispatchEvent(loadEvent, document()); |
1575 timing->markLoadEventEnd(); | 1575 timing.markLoadEventEnd(); |
1576 } else | 1576 } else |
1577 dispatchEvent(loadEvent, document()); | 1577 dispatchEvent(loadEvent, document()); |
1578 | 1578 |
1579 // For load events, send a separate load event to the enclosing frame only. | 1579 // For load events, send a separate load event to the enclosing frame only. |
1580 // This is a DOM extension and is independent of bubbling/capturing rules of | 1580 // This is a DOM extension and is independent of bubbling/capturing rules of |
1581 // the DOM. | 1581 // the DOM. |
1582 FrameOwner* owner = frame() ? frame()->owner() : nullptr; | 1582 FrameOwner* owner = frame() ? frame()->owner() : nullptr; |
1583 if (owner) | 1583 if (owner) |
1584 owner->dispatchLoad(); | 1584 owner->dispatchLoad(); |
1585 | 1585 |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1843 return m_frameObserver->frame(); | 1843 return m_frameObserver->frame(); |
1844 } | 1844 } |
1845 | 1845 |
1846 v8::Handle<v8::Object> LocalDOMWindow::wrap(v8::Handle<v8::Object> creationConte
xt, v8::Isolate* isolate) | 1846 v8::Handle<v8::Object> LocalDOMWindow::wrap(v8::Handle<v8::Object> creationConte
xt, v8::Isolate* isolate) |
1847 { | 1847 { |
1848 ASSERT_NOT_REACHED(); // LocalDOMWindow has [Custom=ToV8]. | 1848 ASSERT_NOT_REACHED(); // LocalDOMWindow has [Custom=ToV8]. |
1849 return v8::Handle<v8::Object>(); | 1849 return v8::Handle<v8::Object>(); |
1850 } | 1850 } |
1851 | 1851 |
1852 } // namespace blink | 1852 } // namespace blink |
OLD | NEW |