OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "modules/serviceworkers/ServiceWorkerWindowClient.h" | 6 #include "modules/serviceworkers/ServiceWorkerWindowClient.h" |
7 | 7 |
8 #include "bindings/core/v8/CallbackPromiseAdapter.h" | 8 #include "bindings/core/v8/CallbackPromiseAdapter.h" |
9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
10 #include "core/page/PageVisibilityState.h" | 10 #include "core/page/PageVisibilityState.h" |
11 #include "core/page/WindowFocusAllowedIndicator.h" | 11 #include "core/page/WindowFocusAllowedIndicator.h" |
12 #include "modules/serviceworkers/ServiceWorkerError.h" | 12 #include "modules/serviceworkers/ServiceWorkerError.h" |
13 #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h" | 13 #include "modules/serviceworkers/ServiceWorkerGlobalScopeClient.h" |
14 #include "public/platform/WebString.h" | 14 #include "public/platform/WebString.h" |
15 #include "wtf/RefPtr.h" | 15 #include "wtf/RefPtr.h" |
16 | 16 |
17 namespace blink { | 17 namespace blink { |
18 | 18 |
| 19 ServiceWorkerWindowClient* ServiceWorkerWindowClient::take(ScriptPromiseResolver
*, ServiceWorkerWindowClient::WebType* webClientRaw) |
| 20 { |
| 21 return ServiceWorkerWindowClient::create(*webClientRaw); |
| 22 } |
| 23 |
| 24 void ServiceWorkerWindowClient::dispose(ServiceWorkerWindowClient::WebType* webC
lientRaw) |
| 25 { |
| 26 delete webClientRaw; |
| 27 } |
| 28 |
19 ServiceWorkerWindowClient* ServiceWorkerWindowClient::create(const WebServiceWor
kerClientInfo& info) | 29 ServiceWorkerWindowClient* ServiceWorkerWindowClient::create(const WebServiceWor
kerClientInfo& info) |
20 { | 30 { |
21 return new ServiceWorkerWindowClient(info); | 31 return new ServiceWorkerWindowClient(info); |
22 } | 32 } |
23 | 33 |
24 ServiceWorkerWindowClient::ServiceWorkerWindowClient(const WebServiceWorkerClien
tInfo& info) | 34 ServiceWorkerWindowClient::ServiceWorkerWindowClient(const WebServiceWorkerClien
tInfo& info) |
25 : ServiceWorkerClient(info) | 35 : ServiceWorkerClient(info) |
26 , m_pageVisibilityState(info.pageVisibilityState) | 36 , m_pageVisibilityState(info.pageVisibilityState) |
27 , m_isFocused(info.isFocused) | 37 , m_isFocused(info.isFocused) |
28 , m_frameType(info.frameType) | 38 , m_frameType(info.frameType) |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 ServiceWorkerGlobalScopeClient::from(scriptState->executionContext())->focus
(id(), new CallbackPromiseAdapter<bool, ServiceWorkerError>(resolver)); | 84 ServiceWorkerGlobalScopeClient::from(scriptState->executionContext())->focus
(id(), new CallbackPromiseAdapter<bool, ServiceWorkerError>(resolver)); |
75 return promise; | 85 return promise; |
76 } | 86 } |
77 | 87 |
78 void ServiceWorkerWindowClient::trace(Visitor* visitor) | 88 void ServiceWorkerWindowClient::trace(Visitor* visitor) |
79 { | 89 { |
80 ServiceWorkerClient::trace(visitor); | 90 ServiceWorkerClient::trace(visitor); |
81 } | 91 } |
82 | 92 |
83 } // namespace blink | 93 } // namespace blink |
OLD | NEW |