OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 17 matching lines...) Expand all Loading... |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "web/ServiceWorkerGlobalScopeClientImpl.h" | 31 #include "web/ServiceWorkerGlobalScopeClientImpl.h" |
32 | 32 |
33 #include "modules/fetch/Response.h" | 33 #include "modules/fetch/Response.h" |
34 #include "public/platform/WebURL.h" | 34 #include "public/platform/WebURL.h" |
35 #include "public/platform/modules/serviceworker/WebServiceWorkerResponse.h" | 35 #include "public/platform/modules/serviceworker/WebServiceWorkerResponse.h" |
36 #include "public/web/modules/serviceworker/WebServiceWorkerContextClient.h" | 36 #include "public/web/modules/serviceworker/WebServiceWorkerContextClient.h" |
37 #include <memory> | 37 #include <memory> |
| 38 #include <utility> |
38 | 39 |
39 namespace blink { | 40 namespace blink { |
40 | 41 |
41 ServiceWorkerGlobalScopeClient* ServiceWorkerGlobalScopeClientImpl::create( | 42 ServiceWorkerGlobalScopeClient* ServiceWorkerGlobalScopeClientImpl::create( |
42 WebServiceWorkerContextClient& client) { | 43 WebServiceWorkerContextClient& client) { |
43 return new ServiceWorkerGlobalScopeClientImpl(client); | 44 return new ServiceWorkerGlobalScopeClientImpl(client); |
44 } | 45 } |
45 | 46 |
46 ServiceWorkerGlobalScopeClientImpl::~ServiceWorkerGlobalScopeClientImpl() {} | 47 ServiceWorkerGlobalScopeClientImpl::~ServiceWorkerGlobalScopeClientImpl() {} |
47 | 48 |
48 void ServiceWorkerGlobalScopeClientImpl::getClient( | 49 void ServiceWorkerGlobalScopeClientImpl::getClient( |
49 const WebString& id, | 50 const WebString& id, |
50 WebServiceWorkerClientCallbacks* callbacks) { | 51 std::unique_ptr<WebServiceWorkerClientCallbacks> callbacks) { |
51 m_client.getClient(id, callbacks); | 52 m_client.getClient(id, std::move(callbacks)); |
52 } | 53 } |
53 | 54 |
54 void ServiceWorkerGlobalScopeClientImpl::getClients( | 55 void ServiceWorkerGlobalScopeClientImpl::getClients( |
55 const WebServiceWorkerClientQueryOptions& options, | 56 const WebServiceWorkerClientQueryOptions& options, |
56 WebServiceWorkerClientsCallbacks* callbacks) { | 57 std::unique_ptr<WebServiceWorkerClientsCallbacks> callbacks) { |
57 m_client.getClients(options, callbacks); | 58 m_client.getClients(options, std::move(callbacks)); |
58 } | 59 } |
59 | 60 |
60 void ServiceWorkerGlobalScopeClientImpl::openWindow( | 61 void ServiceWorkerGlobalScopeClientImpl::openWindow( |
61 const WebURL& url, | 62 const WebURL& url, |
62 WebServiceWorkerClientCallbacks* callbacks) { | 63 std::unique_ptr<WebServiceWorkerClientCallbacks> callbacks) { |
63 m_client.openWindow(url, callbacks); | 64 m_client.openWindow(url, std::move(callbacks)); |
64 } | 65 } |
65 | 66 |
66 void ServiceWorkerGlobalScopeClientImpl::setCachedMetadata(const WebURL& url, | 67 void ServiceWorkerGlobalScopeClientImpl::setCachedMetadata(const WebURL& url, |
67 const char* data, | 68 const char* data, |
68 size_t size) { | 69 size_t size) { |
69 m_client.setCachedMetadata(url, data, size); | 70 m_client.setCachedMetadata(url, data, size); |
70 } | 71 } |
71 | 72 |
72 void ServiceWorkerGlobalScopeClientImpl::clearCachedMetadata( | 73 void ServiceWorkerGlobalScopeClientImpl::clearCachedMetadata( |
73 const WebURL& url) { | 74 const WebURL& url) { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 157 |
157 void ServiceWorkerGlobalScopeClientImpl::postMessageToCrossOriginClient( | 158 void ServiceWorkerGlobalScopeClientImpl::postMessageToCrossOriginClient( |
158 const WebCrossOriginServiceWorkerClient& client, | 159 const WebCrossOriginServiceWorkerClient& client, |
159 const WebString& message, | 160 const WebString& message, |
160 std::unique_ptr<WebMessagePortChannelArray> webChannels) { | 161 std::unique_ptr<WebMessagePortChannelArray> webChannels) { |
161 m_client.postMessageToCrossOriginClient(client, message, | 162 m_client.postMessageToCrossOriginClient(client, message, |
162 webChannels.release()); | 163 webChannels.release()); |
163 } | 164 } |
164 | 165 |
165 void ServiceWorkerGlobalScopeClientImpl::skipWaiting( | 166 void ServiceWorkerGlobalScopeClientImpl::skipWaiting( |
166 WebServiceWorkerSkipWaitingCallbacks* callbacks) { | 167 std::unique_ptr<WebServiceWorkerSkipWaitingCallbacks> callbacks) { |
167 m_client.skipWaiting(callbacks); | 168 m_client.skipWaiting(std::move(callbacks)); |
168 } | 169 } |
169 | 170 |
170 void ServiceWorkerGlobalScopeClientImpl::claim( | 171 void ServiceWorkerGlobalScopeClientImpl::claim( |
171 WebServiceWorkerClientsClaimCallbacks* callbacks) { | 172 std::unique_ptr<WebServiceWorkerClientsClaimCallbacks> callbacks) { |
172 m_client.claim(callbacks); | 173 m_client.claim(std::move(callbacks)); |
173 } | 174 } |
174 | 175 |
175 void ServiceWorkerGlobalScopeClientImpl::focus( | 176 void ServiceWorkerGlobalScopeClientImpl::focus( |
176 const WebString& clientUUID, | 177 const WebString& clientUUID, |
177 WebServiceWorkerClientCallbacks* callback) { | 178 std::unique_ptr<WebServiceWorkerClientCallbacks> callback) { |
178 m_client.focus(clientUUID, callback); | 179 m_client.focus(clientUUID, std::move(callback)); |
179 } | 180 } |
180 | 181 |
181 void ServiceWorkerGlobalScopeClientImpl::navigate( | 182 void ServiceWorkerGlobalScopeClientImpl::navigate( |
182 const WebString& clientUUID, | 183 const WebString& clientUUID, |
183 const WebURL& url, | 184 const WebURL& url, |
184 WebServiceWorkerClientCallbacks* callback) { | 185 std::unique_ptr<WebServiceWorkerClientCallbacks> callback) { |
185 m_client.navigate(clientUUID, url, callback); | 186 m_client.navigate(clientUUID, url, std::move(callback)); |
186 } | 187 } |
187 | 188 |
188 void ServiceWorkerGlobalScopeClientImpl::registerForeignFetchScopes( | 189 void ServiceWorkerGlobalScopeClientImpl::registerForeignFetchScopes( |
189 const WebVector<WebURL>& subScopes, | 190 const WebVector<WebURL>& subScopes, |
190 const WebVector<WebSecurityOrigin>& origins) { | 191 const WebVector<WebSecurityOrigin>& origins) { |
191 m_client.registerForeignFetchScopes(subScopes, origins); | 192 m_client.registerForeignFetchScopes(subScopes, origins); |
192 } | 193 } |
193 | 194 |
194 ServiceWorkerGlobalScopeClientImpl::ServiceWorkerGlobalScopeClientImpl( | 195 ServiceWorkerGlobalScopeClientImpl::ServiceWorkerGlobalScopeClientImpl( |
195 WebServiceWorkerContextClient& client) | 196 WebServiceWorkerContextClient& client) |
196 : m_client(client) {} | 197 : m_client(client) {} |
197 | 198 |
198 } // namespace blink | 199 } // namespace blink |
OLD | NEW |