| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "modules/serviceworkers/ServiceWorkerLinkResource.h" | 5 #include "modules/serviceworkers/ServiceWorkerLinkResource.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/frame/DOMWindow.h" | 8 #include "core/frame/DOMWindow.h" |
| 9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
| 10 #include "core/html/HTMLLinkElement.h" | 10 #include "core/html/HTMLLinkElement.h" |
| 11 #include "core/loader/FrameLoaderClient.h" | 11 #include "core/loader/FrameLoaderClient.h" |
| 12 #include "modules/serviceworkers/NavigatorServiceWorker.h" | 12 #include "modules/serviceworkers/NavigatorServiceWorker.h" |
| 13 #include "modules/serviceworkers/ServiceWorkerContainer.h" | 13 #include "modules/serviceworkers/ServiceWorkerContainer.h" |
| 14 #include "public/platform/Platform.h" | 14 #include "public/platform/Platform.h" |
| 15 #include "public/platform/WebScheduler.h" | 15 #include "public/platform/WebScheduler.h" |
| 16 #include "wtf/PtrUtil.h" | 16 #include "wtf/PtrUtil.h" |
| 17 | 17 |
| 18 namespace blink { | 18 namespace blink { |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 class RegistrationCallback : public WebServiceWorkerProvider::WebServiceWorkerRe
gistrationCallbacks { | 22 class RegistrationCallback : public WebServiceWorkerProvider::WebServiceWorkerRe
gistrationCallbacks { |
| 23 public: | 23 public: |
| 24 explicit RegistrationCallback(LinkLoaderClient* client) : m_client(client) {
} | 24 explicit RegistrationCallback(LinkLoaderClient* client) : m_client(client) {
} |
| 25 ~RegistrationCallback() override {} | 25 ~RegistrationCallback() override {} |
| 26 | 26 |
| 27 void onSuccess(std::unique_ptr<WebServiceWorkerRegistration::Handle> handle)
override | 27 void onSuccess(std::unique_ptr<WebServiceWorkerRegistration::Handle> handle)
override |
| 28 { | 28 { |
| 29 Platform::current()->currentThread()->scheduler()->timerTaskRunner()->po
stTask(BLINK_FROM_HERE, bind(&LinkLoaderClient::linkLoaded, m_client)); | 29 Platform::current()->currentThread()->scheduler()->timerTaskRunner()->po
stTask(BLINK_FROM_HERE, WTF::bind(&LinkLoaderClient::linkLoaded, m_client)); |
| 30 } | 30 } |
| 31 | 31 |
| 32 void onError(const WebServiceWorkerError& error) override | 32 void onError(const WebServiceWorkerError& error) override |
| 33 { | 33 { |
| 34 Platform::current()->currentThread()->scheduler()->timerTaskRunner()->po
stTask(BLINK_FROM_HERE, bind(&LinkLoaderClient::linkLoadingErrored, m_client)); | 34 Platform::current()->currentThread()->scheduler()->timerTaskRunner()->po
stTask(BLINK_FROM_HERE, WTF::bind(&LinkLoaderClient::linkLoadingErrored, m_clien
t)); |
| 35 } | 35 } |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 WTF_MAKE_NONCOPYABLE(RegistrationCallback); | 38 WTF_MAKE_NONCOPYABLE(RegistrationCallback); |
| 39 | 39 |
| 40 Persistent<LinkLoaderClient> m_client; | 40 Persistent<LinkLoaderClient> m_client; |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 } | 43 } |
| 44 | 44 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 { | 85 { |
| 86 process(); | 86 process(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 ServiceWorkerLinkResource::ServiceWorkerLinkResource(HTMLLinkElement* owner) | 89 ServiceWorkerLinkResource::ServiceWorkerLinkResource(HTMLLinkElement* owner) |
| 90 : LinkResource(owner) | 90 : LinkResource(owner) |
| 91 { | 91 { |
| 92 } | 92 } |
| 93 | 93 |
| 94 } // namespace blink | 94 } // namespace blink |
| OLD | NEW |