Chromium Code Reviews| Index: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClient.cpp |
| diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClient.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClient.cpp |
| index 198f6e2afa25966372a7abc900bdd58a6a5852f6..759deaeb03ccf58bd7b537ce7a00276514576b98 100644 |
| --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClient.cpp |
| +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClient.cpp |
| @@ -3,6 +3,7 @@ |
| // found in the LICENSE file. |
| #include "modules/serviceworkers/ServiceWorkerClient.h" |
| +#include "modules/serviceworkers/ServiceWorkerWindowClient.h" |
| #include "bindings/core/v8/CallbackPromiseAdapter.h" |
| #include "bindings/core/v8/ExceptionState.h" |
| @@ -14,6 +15,23 @@ |
| namespace blink { |
| +ServiceWorkerClient* ServiceWorkerClient::take(ScriptPromiseResolver*, PassOwnPtr<WebServiceWorkerClientInfo> webClient) |
| +{ |
| + if (!webClient) |
| + return nullptr; |
|
zino
2016/02/05 06:21:44
nit: indentation
jungkees
2016/02/12 15:03:22
Done.
|
| + |
| + switch (webClient->clientType) { |
| + case WebServiceWorkerClientTypeWindow: |
| + return ServiceWorkerWindowClient::create(*webClient); |
| + case WebServiceWorkerClientTypeWorker: |
| + case WebServiceWorkerClientTypeSharedWorker: |
| + return ServiceWorkerClient::create(*webClient); |
| + case WebServiceWorkerClientTypeLast: |
| + ASSERT_NOT_REACHED(); |
| + return nullptr; |
| + } |
| +} |
| + |
| ServiceWorkerClient* ServiceWorkerClient::create(const WebServiceWorkerClientInfo& info) |
| { |
| return new ServiceWorkerClient(info); |