OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PresentationSession_h | 5 #ifndef PresentationSession_h |
6 #define PresentationSession_h | 6 #define PresentationSession_h |
7 | 7 |
8 #include "core/events/EventTarget.h" | 8 #include "core/events/EventTarget.h" |
9 #include "core/fileapi/Blob.h" | 9 #include "core/fileapi/Blob.h" |
10 #include "core/fileapi/FileError.h" | 10 #include "core/fileapi/FileError.h" |
(...skipping 13 matching lines...) Expand all Loading... | |
24 class Presentation; | 24 class Presentation; |
25 class PresentationController; | 25 class PresentationController; |
26 | 26 |
27 class PresentationSession final | 27 class PresentationSession final |
28 : public RefCountedGarbageCollectedEventTargetWithInlineData<PresentationSes sion> | 28 : public RefCountedGarbageCollectedEventTargetWithInlineData<PresentationSes sion> |
29 , public DOMWindowProperty { | 29 , public DOMWindowProperty { |
30 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(PresentationSession); | 30 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(PresentationSession); |
31 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PresentationSession); | 31 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PresentationSession); |
32 DEFINE_WRAPPERTYPEINFO(); | 32 DEFINE_WRAPPERTYPEINFO(); |
33 public: | 33 public: |
34 static PresentationSession* take(WebPresentationSessionClient*, Presentation *); | 34 static PresentationSession* take(WebPresentationSessionClient*, Presentation *, WebPresentationSessionState); |
whywhat
2015/06/25 19:57:53
I'd prefer the state be passed as part of the WebP
| |
35 static void dispose(WebPresentationSessionClient*); | 35 static void dispose(WebPresentationSessionClient*); |
36 virtual ~PresentationSession(); | 36 virtual ~PresentationSession(); |
37 | 37 |
38 // EventTarget implementation. | 38 // EventTarget implementation. |
39 virtual const AtomicString& interfaceName() const override; | 39 virtual const AtomicString& interfaceName() const override; |
40 virtual ExecutionContext* executionContext() const override; | 40 virtual ExecutionContext* executionContext() const override; |
41 | 41 |
42 DECLARE_VIRTUAL_TRACE(); | 42 DECLARE_VIRTUAL_TRACE(); |
43 | 43 |
44 const String id() const { return m_id; } | 44 const String id() const { return m_id; } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
83 Message(PassRefPtr<BlobDataHandle> blobDataHandle) | 83 Message(PassRefPtr<BlobDataHandle> blobDataHandle) |
84 : type(MessageTypeBlob) | 84 : type(MessageTypeBlob) |
85 , blobDataHandle(blobDataHandle) { } | 85 , blobDataHandle(blobDataHandle) { } |
86 | 86 |
87 MessageType type; | 87 MessageType type; |
88 String text; | 88 String text; |
89 RefPtr<DOMArrayBuffer> arrayBuffer; | 89 RefPtr<DOMArrayBuffer> arrayBuffer; |
90 RefPtr<BlobDataHandle> blobDataHandle; | 90 RefPtr<BlobDataHandle> blobDataHandle; |
91 }; | 91 }; |
92 | 92 |
93 PresentationSession(LocalFrame*, const String& id, const String& url); | 93 PresentationSession(LocalFrame*, const String& id, const String& url, WebPre sentationSessionState); |
94 | 94 |
95 // Returns the |PresentationController| object associated with the frame | 95 // Returns the |PresentationController| object associated with the frame |
96 // |Presentation| corresponds to. Can return |nullptr| if the frame is | 96 // |Presentation| corresponds to. Can return |nullptr| if the frame is |
97 // detached from the document. | 97 // detached from the document. |
98 PresentationController* presentationController(); | 98 PresentationController* presentationController(); |
99 | 99 |
100 bool canSendMessage(ExceptionState&); | 100 bool canSendMessage(ExceptionState&); |
101 void handleMessageQueue(); | 101 void handleMessageQueue(); |
102 | 102 |
103 // Callbacks invoked from BlobLoader. | 103 // Callbacks invoked from BlobLoader. |
104 void didFinishLoadingBlob(PassRefPtr<DOMArrayBuffer>); | 104 void didFinishLoadingBlob(PassRefPtr<DOMArrayBuffer>); |
105 void didFailLoadingBlob(FileError::ErrorCode); | 105 void didFailLoadingBlob(FileError::ErrorCode); |
106 | 106 |
107 String m_id; | 107 String m_id; |
108 String m_url; | 108 String m_url; |
109 WebPresentationSessionState m_state; | 109 WebPresentationSessionState m_state; |
110 | 110 |
111 // For Blob data handling. | 111 // For Blob data handling. |
112 Member<BlobLoader> m_blobLoader; | 112 Member<BlobLoader> m_blobLoader; |
113 Deque<OwnPtr<Message>> m_messages; | 113 Deque<OwnPtr<Message>> m_messages; |
114 }; | 114 }; |
115 | 115 |
116 } // namespace blink | 116 } // namespace blink |
117 | 117 |
118 #endif // PresentationSession_h | 118 #endif // PresentationSession_h |
OLD | NEW |