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

Unified Diff: Source/modules/presentation/PresentationSessionClientCallbacks.cpp

Issue 1212423003: Presentation API: Blink changes to allow getAvailability() to be rejected. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@presentation-availability-cleanups
Patch Set: Created 5 years, 5 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: Source/modules/presentation/PresentationSessionClientCallbacks.cpp
diff --git a/Source/modules/presentation/PresentationSessionClientCallbacks.cpp b/Source/modules/presentation/PresentationSessionClientCallbacks.cpp
index 10033511af7fd644826875b4e18c519f6635feb6..330c3b81b285526988e7280f351aacfc8cd600c9 100644
--- a/Source/modules/presentation/PresentationSessionClientCallbacks.cpp
+++ b/Source/modules/presentation/PresentationSessionClientCallbacks.cpp
@@ -31,26 +31,22 @@ PresentationSessionClientCallbacks::~PresentationSessionClientCallbacks()
{
}
-void PresentationSessionClientCallbacks::onSuccess(WebPresentationSessionClient* client)
+void PresentationSessionClientCallbacks::onSuccess(WebPresentationSessionClient* result)
{
- ASSERT(client);
- if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) {
- PresentationSession::dispose(client);
+ OwnPtr<WebPresentationSessionClient> client = adoptPtr(result);
+ if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped())
return;
- }
- m_resolver->resolve(PresentationSession::take(client, m_presentation));
+ m_resolver->resolve(PresentationSession::take(client.get(), m_presentation));
}
-void PresentationSessionClientCallbacks::onError(WebPresentationError* error)
+void PresentationSessionClientCallbacks::onError(WebPresentationError* result)
{
- ASSERT(error);
- if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped()) {
- PresentationError::dispose(error);
+ OwnPtr<WebPresentationError> error = adoptPtr(result);
+ if (!m_resolver->executionContext() || m_resolver->executionContext()->activeDOMObjectsAreStopped())
return;
- }
- m_resolver->reject(PresentationError::take(error));
+ m_resolver->reject(PresentationError::take(*error));
}
} // namespace blink
« no previous file with comments | « Source/modules/presentation/PresentationSession.cpp ('k') | public/platform/modules/presentation/WebPresentationClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698