Index: Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp |
diff --git a/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp b/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp |
index 8712916a69f3f8ec5659512b2144642f6ce16d1e..604af9998a4c02643dd0a5d871ec41b310ea103e 100644 |
--- a/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp |
+++ b/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp |
@@ -77,7 +77,12 @@ ScriptPromise ServiceWorkerWindowClient::focus(ScriptState* scriptState) |
} |
scriptState->executionContext()->consumeWindowInteraction(); |
- ServiceWorkerGlobalScopeClient::from(scriptState->executionContext())->focus(id(), new CallbackPromiseAdapter<ServiceWorkerWindowClient, ServiceWorkerError>(resolver)); |
+ if (!uuid().isEmpty()) { |
+ ServiceWorkerGlobalScopeClient::from(scriptState->executionContext())->focus(uuid(), new CallbackPromiseAdapter<ServiceWorkerWindowClient, ServiceWorkerError>(resolver)); |
+ } else { |
+ // FIXME: Deprecate this when we switch to uuid. |
+ ServiceWorkerGlobalScopeClient::from(scriptState->executionContext())->focus(id(), new CallbackPromiseAdapter<ServiceWorkerWindowClient, ServiceWorkerError>(resolver)); |
+ } |
return promise; |
} |