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

Side by Side Diff: Source/modules/presentation/PresentationSessionClientCallbacks.h

Issue 940503002: [PresentationAPI] Added plumbing for start/joinSession from JS to platform (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Full change Created 5 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef PresentationSessionClientCallbacks_h
6 #define PresentationSessionClientCallbacks_h
7
8 #include "platform/heap/Handle.h"
9 #include "public/platform/modules/presentation/WebPresentationClient.h"
10 #include "wtf/Noncopyable.h"
11 #include "wtf/PassRefPtr.h"
12 #include "wtf/RefPtr.h"
13
14 namespace blink {
15
16 class Presentation;
17 class ScriptPromiseResolver;
18
19 // The implementation of the WebCallbacks interface passed to the embedder to
20 // get the result of start/joinSession() calls. Will in its turn resolve the
21 // corresponding Promise given to the frame.
22 // When creating the session succeeds, onSuccess() is invoked with the
23 // implementation of the WebPresentationSessionClient interface. If creating the
24 // session fails, onError() is invoked with the implementation of the
25 // WebPresentationError interface.
26 // Owned by the receiver of the callback and must be deleted after use.
27 class PresentationSessionClientCallbacks final : public WebPresentationSessionCl ientCallbacks {
28 WTF_MAKE_NONCOPYABLE(PresentationSessionClientCallbacks);
29 public:
30 PresentationSessionClientCallbacks(PassRefPtrWillBeRawPtr<ScriptPromiseResol ver>, Presentation*);
31 virtual ~PresentationSessionClientCallbacks();
32
33 // WebPresentationSessionClientCallbacks implementation.
34 virtual void onSuccess(WebPresentationSessionClient*) override;
35 virtual void onError(WebPresentationError*) override;
36
37 private:
38 RefPtrWillBePersistent<ScriptPromiseResolver> m_resolver;
39 Persistent<Presentation> m_presentation;
40 };
41
42 } // namespace blink
43
44 #endif // PresentationSessionClientCallbacks_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698