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