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

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

Issue 2602523002: [Presentation API] Resolve PresentationRequest::reconnect() with existing presentation connection i… (Closed)
Patch Set: resolve code review comments from haraken, Mark, and mlamouri Created 4 years 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.h
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationConnectionCallbacks.h b/third_party/WebKit/Source/modules/presentation/PresentationConnectionCallbacks.h
index 257e50b0396558caa43a2b458732e9bea2676a15..53670554cc2646e7cc8a4b6c2f925fdd71ad17e2 100644
--- a/third_party/WebKit/Source/modules/presentation/PresentationConnectionCallbacks.h
+++ b/third_party/WebKit/Source/modules/presentation/PresentationConnectionCallbacks.h
@@ -11,6 +11,7 @@
namespace blink {
+class PresentationConnection;
class PresentationRequest;
class ScriptPromiseResolver;
class WebPresentationConnectionClient;
@@ -37,6 +38,28 @@ class PresentationConnectionCallbacks final
WTF_MAKE_NONCOPYABLE(PresentationConnectionCallbacks);
};
+// ExistingPresentationConnectionCallbacks extends WebCallbacks to resolve the
+// underlying promise. It takes the PresentationConnection object that
+// originated the call in its constructor and will resolve underlying promise
+// with that object.
+class ExistingPresentationConnectionCallbacks final
mlamouri (slow - plz ping) 2017/01/03 12:02:11 Can you create a new file for this callback maybe?
zhaobin 2017/01/03 20:12:07 Done.
+ : public WebCallbacks<std::unique_ptr<WebPresentationConnectionClient>,
+ const WebPresentationError&> {
+ public:
+ ExistingPresentationConnectionCallbacks(ScriptPromiseResolver*,
+ PresentationConnection*);
+ ~ExistingPresentationConnectionCallbacks() override = default;
+
+ void onSuccess(std::unique_ptr<WebPresentationConnectionClient>) override;
+ void onError(const WebPresentationError&) override;
+
+ private:
+ Persistent<ScriptPromiseResolver> m_resolver;
+ Persistent<PresentationConnection> m_connection;
+
+ WTF_MAKE_NONCOPYABLE(ExistingPresentationConnectionCallbacks);
+};
+
} // namespace blink
#endif // PresentationConnectionCallbacks_h

Powered by Google App Engine
This is Rietveld 408576698