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..9c5365657ba8759b09a235998b2c7a56cba4a588 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,18 @@ |
| namespace blink { |
| +ServiceWorkerClient* ServiceWorkerClient::take(ScriptPromiseResolver*, PassOwnPtr<WebServiceWorkerClientInfo> webClient) |
| +{ |
| + ServiceWorkerClient* client; |
| + if (!webClient) |
| + client = nullptr; |
| + else if (webClient->clientType == WebServiceWorkerClientTypeWindow) |
| + client = ServiceWorkerWindowClient::create(*webClient); |
| + else |
| + client = ServiceWorkerClient::create(*webClient); |
|
nhiroki
2016/02/03 09:40:00
Can you verify the passed |webClient| type using s
jungkees
2016/02/03 14:15:07
Addressed. Thanks!
|
| + return client; |
| +} |
| + |
| ServiceWorkerClient* ServiceWorkerClient::create(const WebServiceWorkerClientInfo& info) |
| { |
| return new ServiceWorkerClient(info); |