OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "config.h" | 5 #include "config.h" |
6 #include "modules/presentation/PresentationSessionClientCallbacks.h" | 6 #include "modules/presentation/PresentationSessionClientCallbacks.h" |
7 | 7 |
8 #include "bindings/core/v8/ScriptPromiseResolver.h" | 8 #include "bindings/core/v8/ScriptPromiseResolver.h" |
9 #include "core/dom/DOMException.h" | 9 #include "core/dom/DOMException.h" |
10 #include "core/dom/ExceptionCode.h" | 10 #include "core/dom/ExceptionCode.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 } | 32 } |
33 | 33 |
34 void PresentationSessionClientCallbacks::onSuccess(WebPresentationSessionClient*
client) | 34 void PresentationSessionClientCallbacks::onSuccess(WebPresentationSessionClient*
client) |
35 { | 35 { |
36 ASSERT(client); | 36 ASSERT(client); |
37 if (!m_resolver->executionContext() || m_resolver->executionContext()->activ
eDOMObjectsAreStopped()) { | 37 if (!m_resolver->executionContext() || m_resolver->executionContext()->activ
eDOMObjectsAreStopped()) { |
38 PresentationSession::dispose(client); | 38 PresentationSession::dispose(client); |
39 return; | 39 return; |
40 } | 40 } |
41 | 41 |
42 m_resolver->resolve(PresentationSession::take(client, m_presentation)); | 42 PresentationSession* session = PresentationSession::take(client, m_presentat
ion, WebPresentationSessionState::Connected); |
| 43 m_resolver->resolve(session); |
43 } | 44 } |
44 | 45 |
45 void PresentationSessionClientCallbacks::onError(WebPresentationError* error) | 46 void PresentationSessionClientCallbacks::onError(WebPresentationError* error) |
46 { | 47 { |
47 ASSERT(error); | 48 ASSERT(error); |
48 if (!m_resolver->executionContext() || m_resolver->executionContext()->activ
eDOMObjectsAreStopped()) { | 49 if (!m_resolver->executionContext() || m_resolver->executionContext()->activ
eDOMObjectsAreStopped()) { |
49 PresentationError::dispose(error); | 50 PresentationError::dispose(error); |
50 return; | 51 return; |
51 } | 52 } |
52 | 53 |
53 m_resolver->reject(PresentationError::take(error)); | 54 m_resolver->reject(PresentationError::take(error)); |
54 } | 55 } |
55 | 56 |
56 } // namespace blink | 57 } // namespace blink |
OLD | NEW |