OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 | 367 |
368 DispatchEventResult Notification::dispatchEventInternal(Event* event) { | 368 DispatchEventResult Notification::dispatchEventInternal(Event* event) { |
369 DCHECK(getExecutionContext()->isContextThread()); | 369 DCHECK(getExecutionContext()->isContextThread()); |
370 return EventTarget::dispatchEventInternal(event); | 370 return EventTarget::dispatchEventInternal(event); |
371 } | 371 } |
372 | 372 |
373 const AtomicString& Notification::interfaceName() const { | 373 const AtomicString& Notification::interfaceName() const { |
374 return EventTargetNames::Notification; | 374 return EventTargetNames::Notification; |
375 } | 375 } |
376 | 376 |
377 void Notification::stop() { | 377 void Notification::contextDestroyed() { |
378 notificationManager()->notifyDelegateDestroyed(this); | 378 notificationManager()->notifyDelegateDestroyed(this); |
379 | 379 |
380 m_state = State::Closed; | 380 m_state = State::Closed; |
381 | 381 |
382 if (m_prepareShowMethodRunner) | 382 if (m_prepareShowMethodRunner) |
383 m_prepareShowMethodRunner->stop(); | 383 m_prepareShowMethodRunner->stop(); |
384 | 384 |
385 if (m_loader) | 385 if (m_loader) |
386 m_loader->stop(); | 386 m_loader->stop(); |
387 } | 387 } |
388 | 388 |
389 bool Notification::hasPendingActivity() const { | 389 bool Notification::hasPendingActivity() const { |
390 // Non-persistent notification can receive events until they've been closed. | 390 // Non-persistent notification can receive events until they've been closed. |
391 // Persistent notifications should be subject to regular garbage collection. | 391 // Persistent notifications should be subject to regular garbage collection. |
392 if (m_type == Type::NonPersistent) | 392 if (m_type == Type::NonPersistent) |
393 return m_state != State::Closed; | 393 return m_state != State::Closed; |
394 | 394 |
395 return false; | 395 return false; |
396 } | 396 } |
397 | 397 |
398 DEFINE_TRACE(Notification) { | 398 DEFINE_TRACE(Notification) { |
399 visitor->trace(m_prepareShowMethodRunner); | 399 visitor->trace(m_prepareShowMethodRunner); |
400 visitor->trace(m_loader); | 400 visitor->trace(m_loader); |
401 EventTargetWithInlineData::trace(visitor); | 401 EventTargetWithInlineData::trace(visitor); |
402 ActiveDOMObject::trace(visitor); | 402 ActiveDOMObject::trace(visitor); |
403 } | 403 } |
404 | 404 |
405 } // namespace blink | 405 } // namespace blink |
OLD | NEW |