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/LocalFrame.h" | 8 #include "core/frame/LocalFrame.h" |
9 #include "core/html/HTMLLinkElement.h" | 9 #include "core/html/HTMLLinkElement.h" |
10 #include "core/loader/FrameLoaderClient.h" | 10 #include "core/loader/FrameLoaderClient.h" |
11 #include "modules/serviceworkers/NavigatorServiceWorker.h" | 11 #include "modules/serviceworkers/NavigatorServiceWorker.h" |
12 #include "modules/serviceworkers/ServiceWorkerContainer.h" | 12 #include "modules/serviceworkers/ServiceWorkerContainer.h" |
13 #include "public/platform/Platform.h" | 13 #include "public/platform/Platform.h" |
14 #include "public/platform/WebScheduler.h" | 14 #include "public/platform/WebScheduler.h" |
15 | 15 |
16 namespace blink { | 16 namespace blink { |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 class RegistrationCallback : public WebServiceWorkerProvider::WebServiceWorkerRe
gistrationCallbacks { | 20 class RegistrationCallback : public WebServiceWorkerProvider::WebServiceWorkerRe
gistrationCallbacks { |
21 public: | 21 public: |
22 explicit RegistrationCallback(LinkLoaderClient* client) : m_client(client) {
} | 22 explicit RegistrationCallback(LinkLoaderClient* client) : m_client(client) {
} |
23 ~RegistrationCallback() override {} | 23 ~RegistrationCallback() override {} |
24 | 24 |
25 void onSuccess(WebPassOwnPtr<WebServiceWorkerRegistration::Handle> handle) o
verride | 25 void onSuccess(std::unique_ptr<WebServiceWorkerRegistration::Handle> handle)
override |
26 { | 26 { |
27 Platform::current()->currentThread()->scheduler()->timerTaskRunner()->po
stTask(BLINK_FROM_HERE, bind(&LinkLoaderClient::linkLoaded, m_client)); | 27 Platform::current()->currentThread()->scheduler()->timerTaskRunner()->po
stTask(BLINK_FROM_HERE, bind(&LinkLoaderClient::linkLoaded, m_client)); |
28 } | 28 } |
29 | 29 |
30 void onError(const WebServiceWorkerError& error) override | 30 void onError(const WebServiceWorkerError& error) override |
31 { | 31 { |
32 Platform::current()->currentThread()->scheduler()->timerTaskRunner()->po
stTask(BLINK_FROM_HERE, bind(&LinkLoaderClient::linkLoadingErrored, m_client)); | 32 Platform::current()->currentThread()->scheduler()->timerTaskRunner()->po
stTask(BLINK_FROM_HERE, bind(&LinkLoaderClient::linkLoadingErrored, m_client)); |
33 } | 33 } |
34 | 34 |
35 private: | 35 private: |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 { | 83 { |
84 process(); | 84 process(); |
85 } | 85 } |
86 | 86 |
87 ServiceWorkerLinkResource::ServiceWorkerLinkResource(HTMLLinkElement* owner) | 87 ServiceWorkerLinkResource::ServiceWorkerLinkResource(HTMLLinkElement* owner) |
88 : LinkResource(owner) | 88 : LinkResource(owner) |
89 { | 89 { |
90 } | 90 } |
91 | 91 |
92 } // namespace blink | 92 } // namespace blink |
OLD | NEW |