Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: Source/web/ServiceWorkerGlobalScopeProxy.cpp

Issue 1078783002: Update the Notification Blink API to use integral persistent ids. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 124
125 void ServiceWorkerGlobalScopeProxy::dispatchMessageEvent(const WebString& messag e, const WebMessagePortChannelArray& webChannels) 125 void ServiceWorkerGlobalScopeProxy::dispatchMessageEvent(const WebString& messag e, const WebMessagePortChannelArray& webChannels)
126 { 126 {
127 ASSERT(m_workerGlobalScope); 127 ASSERT(m_workerGlobalScope);
128 128
129 OwnPtrWillBeRawPtr<MessagePortArray> ports = MessagePort::toMessagePortArray (m_workerGlobalScope, webChannels); 129 OwnPtrWillBeRawPtr<MessagePortArray> ports = MessagePort::toMessagePortArray (m_workerGlobalScope, webChannels);
130 WebSerializedScriptValue value = WebSerializedScriptValue::fromString(messag e); 130 WebSerializedScriptValue value = WebSerializedScriptValue::fromString(messag e);
131 m_workerGlobalScope->dispatchEvent(MessageEvent::create(ports.release(), val ue)); 131 m_workerGlobalScope->dispatchEvent(MessageEvent::create(ports.release(), val ue));
132 } 132 }
133 133
134 void ServiceWorkerGlobalScopeProxy::dispatchNotificationClickEvent(int eventID, int64_t notificationID, const WebNotificationData& data)
135 {
136 ASSERT(m_workerGlobalScope);
137 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope, WaitUntilObserver::NotificationClick, eventID);
138 NotificationEventInit eventInit;
139 eventInit.setNotification(Notification::create(m_workerGlobalScope, notifica tionID, data));
140 RefPtrWillBeRawPtr<Event> event(NotificationEvent::create(EventTypeNames::no tificationclick, eventInit, observer));
141 m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer);
142 }
143
134 void ServiceWorkerGlobalScopeProxy::dispatchNotificationClickEvent(int eventID, const WebString& notificationID, const WebNotificationData& data) 144 void ServiceWorkerGlobalScopeProxy::dispatchNotificationClickEvent(int eventID, const WebString& notificationID, const WebNotificationData& data)
135 { 145 {
136 ASSERT(m_workerGlobalScope); 146 ASSERT(m_workerGlobalScope);
137 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope, WaitUntilObserver::NotificationClick, eventID); 147 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope, WaitUntilObserver::NotificationClick, eventID);
138 NotificationEventInit eventInit; 148 NotificationEventInit eventInit;
139 eventInit.setNotification(Notification::create(m_workerGlobalScope, notifica tionID, data)); 149 eventInit.setNotification(Notification::create(m_workerGlobalScope, notifica tionID, data));
140 RefPtrWillBeRawPtr<Event> event(NotificationEvent::create(EventTypeNames::no tificationclick, eventInit, observer)); 150 RefPtrWillBeRawPtr<Event> event(NotificationEvent::create(EventTypeNames::no tificationclick, eventInit, observer));
141 m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer); 151 m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer);
142 } 152 }
143 153
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 232
223 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) 233 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client)
224 : m_embeddedWorker(embeddedWorker) 234 : m_embeddedWorker(embeddedWorker)
225 , m_document(document) 235 , m_document(document)
226 , m_client(client) 236 , m_client(client)
227 , m_workerGlobalScope(0) 237 , m_workerGlobalScope(0)
228 { 238 {
229 } 239 }
230 240
231 } // namespace blink 241 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/ServiceWorkerGlobalScopeProxy.h ('k') | public/platform/modules/notifications/WebNotificationManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698