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 |