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

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

Issue 1437883002: [Background Sync] Align exposed API with spec (Closed) Base URL: https://chromium.googlesource.com/chromium/src@remove-periodic
Patch Set: Rebase Created 5 years, 1 month 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
« no previous file with comments | « third_party/WebKit/Source/modules/background_sync/SyncRegistration.idl ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 #include "modules/notifications/NotificationEventInit.h" 54 #include "modules/notifications/NotificationEventInit.h"
55 #include "modules/push_messaging/PushEvent.h" 55 #include "modules/push_messaging/PushEvent.h"
56 #include "modules/push_messaging/PushMessageData.h" 56 #include "modules/push_messaging/PushMessageData.h"
57 #include "modules/serviceworkers/ExtendableEvent.h" 57 #include "modules/serviceworkers/ExtendableEvent.h"
58 #include "modules/serviceworkers/FetchEvent.h" 58 #include "modules/serviceworkers/FetchEvent.h"
59 #include "modules/serviceworkers/InstallEvent.h" 59 #include "modules/serviceworkers/InstallEvent.h"
60 #include "modules/serviceworkers/ServiceWorkerGlobalScope.h" 60 #include "modules/serviceworkers/ServiceWorkerGlobalScope.h"
61 #include "modules/serviceworkers/WaitUntilObserver.h" 61 #include "modules/serviceworkers/WaitUntilObserver.h"
62 #include "platform/RuntimeEnabledFeatures.h" 62 #include "platform/RuntimeEnabledFeatures.h"
63 #include "public/platform/WebCrossOriginServiceWorkerClient.h" 63 #include "public/platform/WebCrossOriginServiceWorkerClient.h"
64 #include "public/platform/modules/background_sync/WebSyncRegistration.h"
64 #include "public/platform/modules/notifications/WebNotificationData.h" 65 #include "public/platform/modules/notifications/WebNotificationData.h"
65 #include "public/platform/modules/serviceworker/WebServiceWorkerEventResult.h" 66 #include "public/platform/modules/serviceworker/WebServiceWorkerEventResult.h"
66 #include "public/platform/modules/serviceworker/WebServiceWorkerRequest.h" 67 #include "public/platform/modules/serviceworker/WebServiceWorkerRequest.h"
67 #include "public/web/WebSerializedScriptValue.h" 68 #include "public/web/WebSerializedScriptValue.h"
68 #include "public/web/modules/serviceworker/WebServiceWorkerContextClient.h" 69 #include "public/web/modules/serviceworker/WebServiceWorkerContextClient.h"
69 #include "web/WebEmbeddedWorkerImpl.h" 70 #include "web/WebEmbeddedWorkerImpl.h"
70 #include "wtf/Assertions.h" 71 #include "wtf/Assertions.h"
71 #include "wtf/Functional.h" 72 #include "wtf/Functional.h"
72 #include "wtf/PassOwnPtr.h" 73 #include "wtf/PassOwnPtr.h"
73 74
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 } 171 }
171 172
172 void ServiceWorkerGlobalScopeProxy::dispatchSyncEvent(int eventID, const WebSync Registration& registration, LastChanceOption lastChance) 173 void ServiceWorkerGlobalScopeProxy::dispatchSyncEvent(int eventID, const WebSync Registration& registration, LastChanceOption lastChance)
173 { 174 {
174 ASSERT(m_workerGlobalScope); 175 ASSERT(m_workerGlobalScope);
175 if (!RuntimeEnabledFeatures::backgroundSyncEnabled()) { 176 if (!RuntimeEnabledFeatures::backgroundSyncEnabled()) {
176 ServiceWorkerGlobalScopeClient::from(m_workerGlobalScope)->didHandleSync Event(eventID, WebServiceWorkerEventResultCompleted); 177 ServiceWorkerGlobalScopeClient::from(m_workerGlobalScope)->didHandleSync Event(eventID, WebServiceWorkerEventResultCompleted);
177 return; 178 return;
178 } 179 }
179 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope, WaitUntilObserver::Sync, eventID); 180 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope, WaitUntilObserver::Sync, eventID);
180 RefPtrWillBeRawPtr<Event> event(SyncEvent::create(EventTypeNames::sync, Sync Registration::create(registration, m_workerGlobalScope->registration()), lastCha nce == IsLastChance, observer)); 181 RefPtrWillBeRawPtr<Event> event(SyncEvent::create(EventTypeNames::sync, regi stration.tag, lastChance == IsLastChance, observer));
181 m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer); 182 m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer);
182 } 183 }
183 184
184 void ServiceWorkerGlobalScopeProxy::dispatchCrossOriginMessageEvent(const WebCro ssOriginServiceWorkerClient& webClient, const WebString& message, const WebMessa gePortChannelArray& webChannels) 185 void ServiceWorkerGlobalScopeProxy::dispatchCrossOriginMessageEvent(const WebCro ssOriginServiceWorkerClient& webClient, const WebString& message, const WebMessa gePortChannelArray& webChannels)
185 { 186 {
186 ASSERT(m_workerGlobalScope); 187 ASSERT(m_workerGlobalScope);
187 MessagePortArray* ports = MessagePort::toMessagePortArray(m_workerGlobalScop e, webChannels); 188 MessagePortArray* ports = MessagePort::toMessagePortArray(m_workerGlobalScop e, webChannels);
188 WebSerializedScriptValue value = WebSerializedScriptValue::fromString(messag e); 189 WebSerializedScriptValue value = WebSerializedScriptValue::fromString(messag e);
189 // FIXME: Have proper source for this MessageEvent. 190 // FIXME: Have proper source for this MessageEvent.
190 RefPtrWillBeRawPtr<MessageEvent> event = MessageEvent::create(ports, value, webClient.origin.string()); 191 RefPtrWillBeRawPtr<MessageEvent> event = MessageEvent::create(ports, value, webClient.origin.string());
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) 247 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client)
247 : m_embeddedWorker(embeddedWorker) 248 : m_embeddedWorker(embeddedWorker)
248 , m_document(document) 249 , m_document(document)
249 , m_documentURL(document.url().copy()) 250 , m_documentURL(document.url().copy())
250 , m_client(client) 251 , m_client(client)
251 , m_workerGlobalScope(nullptr) 252 , m_workerGlobalScope(nullptr)
252 { 253 {
253 } 254 }
254 255
255 } // namespace blink 256 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/background_sync/SyncRegistration.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698