Chromium Code Reviews| Index: third_party/WebKit/Source/modules/presentation/PresentationConnectionCallbacks.cpp |
| diff --git a/third_party/WebKit/Source/modules/presentation/PresentationConnectionCallbacks.cpp b/third_party/WebKit/Source/modules/presentation/PresentationConnectionCallbacks.cpp |
| index a9d240483347be2444e6f5fc14f4f74db78d7311..04429045cab72bd08b7b1536b46128b0d1ad2117 100644 |
| --- a/third_party/WebKit/Source/modules/presentation/PresentationConnectionCallbacks.cpp |
| +++ b/third_party/WebKit/Source/modules/presentation/PresentationConnectionCallbacks.cpp |
| @@ -45,4 +45,30 @@ void PresentationConnectionCallbacks::onError( |
| m_resolver->reject(PresentationError::take(error)); |
| } |
| +ExistingPresentationConnectionCallbacks:: |
| + ExistingPresentationConnectionCallbacks(ScriptPromiseResolver* resolver, |
| + PresentationConnection* connection) |
| + : m_resolver(resolver), m_connection(connection) { |
| + DCHECK(m_resolver); |
| + DCHECK(m_connection); |
| +} |
| + |
| +void ExistingPresentationConnectionCallbacks::onSuccess( |
| + std::unique_ptr<WebPresentationConnectionClient> |
| + PresentationConnectionClient) { |
| + if (!m_resolver->getExecutionContext() || |
| + m_resolver->getExecutionContext()->isContextDestroyed()) |
| + return; |
|
mlamouri (slow - plz ping)
2017/01/03 12:02:11
style: add { } because of 2-line condition. You ca
zhaobin
2017/01/03 20:12:07
Done.
|
| + |
| + if (m_connection->getState() == WebPresentationConnectionState::Closed) |
| + m_connection->didChangeState(WebPresentationConnectionState::Connecting); |
| + |
| + m_resolver->resolve(m_connection); |
| +} |
| + |
| +void ExistingPresentationConnectionCallbacks::onError( |
| + const WebPresentationError& error) { |
| + NOTREACHED(); |
| +} |
| + |
| } // namespace blink |