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 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1276 return d->requestAnimationFrame(callback); | 1276 return d->requestAnimationFrame(callback); |
1277 return 0; | 1277 return 0; |
1278 } | 1278 } |
1279 | 1279 |
1280 void LocalDOMWindow::cancelAnimationFrame(int id) | 1280 void LocalDOMWindow::cancelAnimationFrame(int id) |
1281 { | 1281 { |
1282 if (Document* d = document()) | 1282 if (Document* d = document()) |
1283 d->cancelAnimationFrame(id); | 1283 d->cancelAnimationFrame(id); |
1284 } | 1284 } |
1285 | 1285 |
1286 bool LocalDOMWindow::addEventListener(const AtomicString& eventType, PassRefPtr<
EventListener> prpListener, bool useCapture) | 1286 bool LocalDOMWindow::addEventListener(const AtomicString& eventType, PassRefPtrW
illBeRawPtr<EventListener> prpListener, bool useCapture) |
1287 { | 1287 { |
1288 RefPtr<EventListener> listener = prpListener; | 1288 RefPtrWillBeRawPtr<EventListener> listener = prpListener; |
1289 if (!EventTarget::addEventListener(eventType, listener, useCapture)) | 1289 if (!EventTarget::addEventListener(eventType, listener, useCapture)) |
1290 return false; | 1290 return false; |
1291 | 1291 |
1292 if (frame() && frame()->host()) | 1292 if (frame() && frame()->host()) |
1293 frame()->host()->eventHandlerRegistry().didAddEventHandler(*this, eventT
ype); | 1293 frame()->host()->eventHandlerRegistry().didAddEventHandler(*this, eventT
ype); |
1294 | 1294 |
1295 if (Document* document = this->document()) { | 1295 if (Document* document = this->document()) { |
1296 document->addListenerTypeIfNeeded(eventType); | 1296 document->addListenerTypeIfNeeded(eventType); |
1297 } | 1297 } |
1298 | 1298 |
(...skipping 11 matching lines...) Expand all Loading... |
1310 addBeforeUnloadEventListener(this); | 1310 addBeforeUnloadEventListener(this); |
1311 } else { | 1311 } else { |
1312 // Subframes return false from allowsBeforeUnloadListeners. | 1312 // Subframes return false from allowsBeforeUnloadListeners. |
1313 UseCounter::count(document(), UseCounter::SubFrameBeforeUnloadRegist
ered); | 1313 UseCounter::count(document(), UseCounter::SubFrameBeforeUnloadRegist
ered); |
1314 } | 1314 } |
1315 } | 1315 } |
1316 | 1316 |
1317 return true; | 1317 return true; |
1318 } | 1318 } |
1319 | 1319 |
1320 bool LocalDOMWindow::removeEventListener(const AtomicString& eventType, PassRefP
tr<EventListener> listener, bool useCapture) | 1320 bool LocalDOMWindow::removeEventListener(const AtomicString& eventType, PassRefP
trWillBeRawPtr<EventListener> listener, bool useCapture) |
1321 { | 1321 { |
1322 if (!EventTarget::removeEventListener(eventType, listener, useCapture)) | 1322 if (!EventTarget::removeEventListener(eventType, listener, useCapture)) |
1323 return false; | 1323 return false; |
1324 | 1324 |
1325 if (frame() && frame()->host()) | 1325 if (frame() && frame()->host()) |
1326 frame()->host()->eventHandlerRegistry().didRemoveEventHandler(*this, eve
ntType); | 1326 frame()->host()->eventHandlerRegistry().didRemoveEventHandler(*this, eve
ntType); |
1327 | 1327 |
1328 notifyRemoveEventListener(this, eventType); | 1328 notifyRemoveEventListener(this, eventType); |
1329 | 1329 |
1330 if (eventType == EventTypeNames::unload) { | 1330 if (eventType == EventTypeNames::unload) { |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1487 DOMWindow::trace(visitor); | 1487 DOMWindow::trace(visitor); |
1488 DOMWindowLifecycleNotifier::trace(visitor); | 1488 DOMWindowLifecycleNotifier::trace(visitor); |
1489 } | 1489 } |
1490 | 1490 |
1491 LocalFrame* LocalDOMWindow::frame() const | 1491 LocalFrame* LocalDOMWindow::frame() const |
1492 { | 1492 { |
1493 return m_frameObserver->frame(); | 1493 return m_frameObserver->frame(); |
1494 } | 1494 } |
1495 | 1495 |
1496 } // namespace blink | 1496 } // namespace blink |
OLD | NEW |