Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(953)

Unified Diff: third_party/WebKit/Source/modules/presentation/PresentationConnectionCallbacks.cpp

Issue 2471263003: [Presentation API] (4th)(1-UA blink side) Add WebPresentationConnection and WebPresentationConnecti… (Closed)
Patch Set: resolve code review comments from dcheng Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698