OLD | NEW |
1 | 1 |
2 // Copyright 2014 The Chromium Authors. All rights reserved. | 2 // Copyright 2014 The Chromium Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 #include "modules/serviceworkers/ServiceWorkerContainer.h" | 6 #include "modules/serviceworkers/ServiceWorkerContainer.h" |
7 | 7 |
8 #include "bindings/core/v8/Dictionary.h" | 8 #include "bindings/core/v8/Dictionary.h" |
9 #include "bindings/core/v8/ScriptFunction.h" | 9 #include "bindings/core/v8/ScriptFunction.h" |
10 #include "bindings/core/v8/ScriptPromise.h" | 10 #include "bindings/core/v8/ScriptPromise.h" |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 ~WebServiceWorkerProviderImpl() override {} | 287 ~WebServiceWorkerProviderImpl() override {} |
288 | 288 |
289 void registerServiceWorker( | 289 void registerServiceWorker( |
290 const WebURL& pattern, | 290 const WebURL& pattern, |
291 const WebURL& scriptURL, | 291 const WebURL& scriptURL, |
292 std::unique_ptr<WebServiceWorkerRegistrationCallbacks> callbacks) | 292 std::unique_ptr<WebServiceWorkerRegistrationCallbacks> callbacks) |
293 override { | 293 override { |
294 m_owner.m_registerCallCount++; | 294 m_owner.m_registerCallCount++; |
295 m_owner.m_registerScope = pattern; | 295 m_owner.m_registerScope = pattern; |
296 m_owner.m_registerScriptURL = scriptURL; | 296 m_owner.m_registerScriptURL = scriptURL; |
297 m_registrationCallbacksToDelete.append(std::move(callbacks)); | 297 m_registrationCallbacksToDelete.push_back(std::move(callbacks)); |
298 } | 298 } |
299 | 299 |
300 void getRegistration( | 300 void getRegistration( |
301 const WebURL& documentURL, | 301 const WebURL& documentURL, |
302 std::unique_ptr<WebServiceWorkerGetRegistrationCallbacks> callbacks) | 302 std::unique_ptr<WebServiceWorkerGetRegistrationCallbacks> callbacks) |
303 override { | 303 override { |
304 m_owner.m_getRegistrationCallCount++; | 304 m_owner.m_getRegistrationCallCount++; |
305 m_owner.m_getRegistrationURL = documentURL; | 305 m_owner.m_getRegistrationURL = documentURL; |
306 m_getRegistrationCallbacksToDelete.append(std::move(callbacks)); | 306 m_getRegistrationCallbacksToDelete.push_back(std::move(callbacks)); |
307 } | 307 } |
308 | 308 |
309 bool validateScopeAndScriptURL(const WebURL& scope, | 309 bool validateScopeAndScriptURL(const WebURL& scope, |
310 const WebURL& scriptURL, | 310 const WebURL& scriptURL, |
311 WebString* errorMessage) { | 311 WebString* errorMessage) { |
312 return true; | 312 return true; |
313 } | 313 } |
314 | 314 |
315 private: | 315 private: |
316 StubWebServiceWorkerProvider& m_owner; | 316 StubWebServiceWorkerProvider& m_owner; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 ScriptState::Scope scriptScope(getScriptState()); | 368 ScriptState::Scope scriptScope(getScriptState()); |
369 container->getRegistration(getScriptState(), ""); | 369 container->getRegistration(getScriptState(), ""); |
370 EXPECT_EQ(1ul, stubProvider.getRegistrationCallCount()); | 370 EXPECT_EQ(1ul, stubProvider.getRegistrationCallCount()); |
371 EXPECT_EQ(WebURL(KURL(KURL(), "http://localhost/x/index.html")), | 371 EXPECT_EQ(WebURL(KURL(KURL(), "http://localhost/x/index.html")), |
372 stubProvider.getRegistrationURL()); | 372 stubProvider.getRegistrationURL()); |
373 } | 373 } |
374 } | 374 } |
375 | 375 |
376 } // namespace | 376 } // namespace |
377 } // namespace blink | 377 } // namespace blink |
OLD | NEW |