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" |
11 #include "modules/presentation/Presentation.h" | 11 #include "modules/presentation/Presentation.h" |
12 #include "modules/presentation/PresentationError.h" | 12 #include "modules/presentation/PresentationError.h" |
13 #include "modules/presentation/PresentationSession.h" | 13 #include "modules/presentation/PresentationSession.h" |
14 #include "public/platform/WebString.h" | 14 #include "public/platform/WebString.h" |
15 #include "public/platform/modules/presentation/WebPresentationError.h" | 15 #include "public/platform/modules/presentation/WebPresentationError.h" |
16 #include "wtf/OwnPtr.h" | 16 #include "wtf/OwnPtr.h" |
17 | 17 |
18 namespace blink { | 18 namespace blink { |
19 | 19 |
20 PresentationSessionClientCallbacks::PresentationSessionClientCallbacks( | 20 PresentationSessionClientCallbacks::PresentationSessionClientCallbacks( |
21 PassRefPtrWillBeRawPtr<ScriptPromiseResolver> resolver, | 21 ScriptPromiseResolver* resolver, |
22 Presentation* presentation) | 22 Presentation* presentation) |
23 : m_resolver(resolver) | 23 : m_resolver(resolver) |
24 , m_presentation(presentation) | 24 , m_presentation(presentation) |
25 { | 25 { |
26 ASSERT(m_resolver); | 26 ASSERT(m_resolver); |
27 ASSERT(m_presentation); | 27 ASSERT(m_presentation); |
28 } | 28 } |
29 | 29 |
30 PresentationSessionClientCallbacks::~PresentationSessionClientCallbacks() | 30 PresentationSessionClientCallbacks::~PresentationSessionClientCallbacks() |
31 { | 31 { |
(...skipping 11 matching lines...) Expand all Loading... |
43 void PresentationSessionClientCallbacks::onError(WebPresentationError* result) | 43 void PresentationSessionClientCallbacks::onError(WebPresentationError* result) |
44 { | 44 { |
45 OwnPtr<WebPresentationError> error = adoptPtr(result); | 45 OwnPtr<WebPresentationError> error = adoptPtr(result); |
46 if (!m_resolver->executionContext() || m_resolver->executionContext()->activ
eDOMObjectsAreStopped()) | 46 if (!m_resolver->executionContext() || m_resolver->executionContext()->activ
eDOMObjectsAreStopped()) |
47 return; | 47 return; |
48 | 48 |
49 m_resolver->reject(PresentationError::take(*error)); | 49 m_resolver->reject(PresentationError::take(*error)); |
50 } | 50 } |
51 | 51 |
52 } // namespace blink | 52 } // namespace blink |
OLD | NEW |