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

Unified Diff: Source/modules/serviceworkers/ServiceWorkerClient.cpp

Issue 990583002: Use UUID for ServiceWorker Client identifier (1/3, blink) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/serviceworkers/ServiceWorkerClient.cpp
diff --git a/Source/modules/serviceworkers/ServiceWorkerClient.cpp b/Source/modules/serviceworkers/ServiceWorkerClient.cpp
index 4ee82cac8eb8960e6cf6b4ad4c3d25af3d038a2a..109f50fb943abfe7396fcd7c8bb2df533a887be8 100644
--- a/Source/modules/serviceworkers/ServiceWorkerClient.cpp
+++ b/Source/modules/serviceworkers/ServiceWorkerClient.cpp
@@ -21,6 +21,7 @@ ServiceWorkerClient* ServiceWorkerClient::create(const WebServiceWorkerClientInf
ServiceWorkerClient::ServiceWorkerClient(const WebServiceWorkerClientInfo& info)
: m_id(info.clientID)
+ , m_uuid(info.uuid)
, m_url(info.url.string())
{
}
@@ -38,7 +39,12 @@ void ServiceWorkerClient::postMessage(ExecutionContext* context, PassRefPtr<Seri
WebString messageString = message->toWireString();
OwnPtr<WebMessagePortChannelArray> webChannels = MessagePort::toWebMessagePortChannelArray(channels.release());
- ServiceWorkerGlobalScopeClient::from(context)->postMessageToClient(m_id, messageString, webChannels.release());
+ if (!m_uuid.isEmpty()) {
+ ServiceWorkerGlobalScopeClient::from(context)->postMessageToClient(m_uuid, messageString, webChannels.release());
+ } else {
+ // FIXME: Deprecate this when we switch to uuid.
+ ServiceWorkerGlobalScopeClient::from(context)->postMessageToClient(m_id, messageString, webChannels.release());
+ }
}
} // namespace blink
« no previous file with comments | « Source/modules/serviceworkers/ServiceWorkerClient.h ('k') | Source/modules/serviceworkers/ServiceWorkerGlobalScopeClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698