| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. | 3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. |
| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 const char* WorkerGlobalScopeNotifications::supplementName() | 48 const char* WorkerGlobalScopeNotifications::supplementName() |
| 49 { | 49 { |
| 50 return "WorkerGlobalScopeNotifications"; | 50 return "WorkerGlobalScopeNotifications"; |
| 51 } | 51 } |
| 52 | 52 |
| 53 WorkerGlobalScopeNotifications& WorkerGlobalScopeNotifications::from(WorkerGloba
lScope& context) | 53 WorkerGlobalScopeNotifications& WorkerGlobalScopeNotifications::from(WorkerGloba
lScope& context) |
| 54 { | 54 { |
| 55 WorkerGlobalScopeNotifications* supplement = static_cast<WorkerGlobalScopeNo
tifications*>(WorkerSupplement::from(context, supplementName())); | 55 WorkerGlobalScopeNotifications* supplement = static_cast<WorkerGlobalScopeNo
tifications*>(WorkerSupplement::from(context, supplementName())); |
| 56 if (!supplement) { | 56 if (!supplement) { |
| 57 supplement = new WorkerGlobalScopeNotifications(context); | 57 supplement = new WorkerGlobalScopeNotifications(context); |
| 58 WorkerSupplement::provideTo(context, supplementName(), adoptPtr(suppleme
nt)); | 58 WorkerSupplement::provideTo(context, supplementName(), adoptPtrWillBeNoo
p(supplement)); |
| 59 } | 59 } |
| 60 return *supplement; | 60 return *supplement; |
| 61 } | 61 } |
| 62 | 62 |
| 63 NotificationCenter* WorkerGlobalScopeNotifications::webkitNotifications(WorkerGl
obalScope& context) | 63 NotificationCenter* WorkerGlobalScopeNotifications::webkitNotifications(WorkerGl
obalScope& context) |
| 64 { | 64 { |
| 65 return WorkerGlobalScopeNotifications::from(context).webkitNotifications(); | 65 return WorkerGlobalScopeNotifications::from(context).webkitNotifications(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 NotificationCenter* WorkerGlobalScopeNotifications::webkitNotifications() | 68 NotificationCenter* WorkerGlobalScopeNotifications::webkitNotifications() |
| 69 { | 69 { |
| 70 if (!m_notificationCenter) | 70 if (!m_notificationCenter) |
| 71 m_notificationCenter = NotificationCenter::create(&m_context, m_context.
thread()->getNotificationClient()); | 71 m_notificationCenter = NotificationCenter::create(&m_context, m_context.
thread()->getNotificationClient()); |
| 72 return m_notificationCenter.get(); | 72 return m_notificationCenter.get(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void WorkerGlobalScopeNotifications::trace(Visitor* visitor) |
| 76 { |
| 77 visitor->trace(m_notificationCenter); |
| 78 } |
| 79 |
| 75 } // namespace WebCore | 80 } // namespace WebCore |
| 76 | 81 |
| 77 #endif // ENABLE(LEGACY_NOTIFICATIONS) | 82 #endif // ENABLE(LEGACY_NOTIFICATIONS) |
| OLD | NEW |