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/webshare/NavigatorShare.h" | 5 #include "modules/webshare/NavigatorShare.h" |
6 | 6 |
7 #include "core/dom/DOMException.h" | 7 #include "core/dom/DOMException.h" |
8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
9 #include "core/dom/ExceptionCode.h" | 9 #include "core/dom/ExceptionCode.h" |
10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 return promise; | 120 return promise; |
121 } | 121 } |
122 | 122 |
123 ScriptPromise NavigatorShare::share(ScriptState* scriptState, | 123 ScriptPromise NavigatorShare::share(ScriptState* scriptState, |
124 Navigator& navigator, | 124 Navigator& navigator, |
125 const ShareData& shareData) { | 125 const ShareData& shareData) { |
126 return from(navigator).share(scriptState, shareData); | 126 return from(navigator).share(scriptState, shareData); |
127 } | 127 } |
128 | 128 |
129 void NavigatorShare::onConnectionError() { | 129 void NavigatorShare::onConnectionError() { |
| 130 if (!Platform::current()) { |
| 131 // TODO(rockot): Clean this up once renderer shutdown sequence is fixed. |
| 132 return; |
| 133 } |
| 134 |
130 for (auto& client : m_clients) { | 135 for (auto& client : m_clients) { |
131 client->onConnectionError(); | 136 client->onConnectionError(); |
132 } | 137 } |
133 m_clients.clear(); | 138 m_clients.clear(); |
134 m_service.reset(); | 139 m_service.reset(); |
135 } | 140 } |
136 | 141 |
137 } // namespace blink | 142 } // namespace blink |
OLD | NEW |