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 30c89bb1c5090ddda6219a54eea174d9554cc423..605511bbbdbf080cfc1115bed31eb72df91271d5 100644 |
--- a/third_party/WebKit/Source/modules/presentation/PresentationConnectionCallbacks.cpp |
+++ b/third_party/WebKit/Source/modules/presentation/PresentationConnectionCallbacks.cpp |
@@ -18,7 +18,7 @@ namespace blink { |
PresentationConnectionCallbacks::PresentationConnectionCallbacks( |
ScriptPromiseResolver* resolver, |
PresentationRequest* request) |
- : m_resolver(resolver), m_request(request) { |
+ : m_resolver(resolver), m_request(request), m_connection(nullptr) { |
ASSERT(m_resolver); |
ASSERT(m_request); |
} |
@@ -29,8 +29,10 @@ void PresentationConnectionCallbacks::onSuccess( |
m_resolver->getExecutionContext()->isContextDestroyed()) { |
return; |
} |
- m_resolver->resolve( |
- PresentationConnection::take(m_resolver.get(), sessionInfo, m_request)); |
+ |
+ m_connection = |
+ PresentationConnection::take(m_resolver.get(), sessionInfo, m_request); |
+ m_resolver->resolve(m_connection); |
} |
void PresentationConnectionCallbacks::onError( |
@@ -39,6 +41,11 @@ void PresentationConnectionCallbacks::onError( |
m_resolver->getExecutionContext()->isContextDestroyed()) |
imcheng
2017/01/20 20:15:43
nit: braces and empty line for consistency
zhaobin
2017/01/23 19:38:49
Done.
|
return; |
m_resolver->reject(PresentationError::take(error)); |
+ m_connection = nullptr; |
imcheng
2017/01/20 20:15:43
not needed since it's already set to nullptr?
zhaobin
2017/01/23 19:38:49
Set m_connection to nullptr so following sequence
|
+} |
+ |
+WebPresentationConnection* PresentationConnectionCallbacks::getConnection() { |
+ return m_connection.get(); |
} |
} // namespace blink |