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 #include "config.h" | 5 #include "config.h" |
6 #include "modules/presentation/PresentationSession.h" | 6 #include "modules/presentation/PresentationSession.h" |
7 | 7 |
8 #include "core/dom/DOMArrayBuffer.h" | 8 #include "core/dom/DOMArrayBuffer.h" |
9 #include "core/dom/DOMArrayBufferView.h" | 9 #include "core/dom/DOMArrayBufferView.h" |
10 #include "core/dom/Document.h" | 10 #include "core/dom/Document.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 DEFINE_INLINE_TRACE() | 79 DEFINE_INLINE_TRACE() |
80 { | 80 { |
81 visitor->trace(m_presentationSession); | 81 visitor->trace(m_presentationSession); |
82 } | 82 } |
83 | 83 |
84 private: | 84 private: |
85 Member<PresentationSession> m_presentationSession; | 85 Member<PresentationSession> m_presentationSession; |
86 FileReaderLoader m_loader; | 86 FileReaderLoader m_loader; |
87 }; | 87 }; |
88 | 88 |
89 PresentationSession::PresentationSession(LocalFrame* frame, const String& id, co
nst String& url) | 89 PresentationSession::PresentationSession(LocalFrame* frame, const String& id, co
nst String& url, WebPresentationSessionState state) |
90 : DOMWindowProperty(frame) | 90 : DOMWindowProperty(frame) |
91 , m_id(id) | 91 , m_id(id) |
92 , m_url(url) | 92 , m_url(url) |
93 , m_state(WebPresentationSessionState::Disconnected) | 93 , m_state(state) |
94 { | 94 { |
95 } | 95 } |
96 | 96 |
97 PresentationSession::~PresentationSession() | 97 PresentationSession::~PresentationSession() |
98 { | 98 { |
99 ASSERT(!m_blobLoader); | 99 ASSERT(!m_blobLoader); |
100 } | 100 } |
101 | 101 |
102 // static | 102 // static |
103 PresentationSession* PresentationSession::take(WebPresentationSessionClient* cli
entRaw, Presentation* presentation) | 103 PresentationSession* PresentationSession::take(WebPresentationSessionClient* cli
entRaw, Presentation* presentation, WebPresentationSessionState state) |
104 { | 104 { |
105 ASSERT(clientRaw); | 105 ASSERT(clientRaw); |
106 ASSERT(presentation); | 106 ASSERT(presentation); |
107 OwnPtr<WebPresentationSessionClient> client = adoptPtr(clientRaw); | 107 OwnPtr<WebPresentationSessionClient> client = adoptPtr(clientRaw); |
108 | 108 |
109 PresentationSession* session = new PresentationSession(presentation->frame()
, client->getId(), client->getUrl()); | 109 PresentationSession* session = new PresentationSession(presentation->frame()
, client->getId(), client->getUrl(), state); |
110 presentation->registerSession(session); | 110 presentation->registerSession(session); |
111 return session; | 111 return session; |
112 } | 112 } |
113 | 113 |
114 // static | 114 // static |
115 void PresentationSession::dispose(WebPresentationSessionClient* client) | 115 void PresentationSession::dispose(WebPresentationSessionClient* client) |
116 { | 116 { |
117 delete client; | 117 delete client; |
118 } | 118 } |
119 | 119 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 { | 282 { |
283 ASSERT(!m_messages.isEmpty() && m_messages.first()->type == MessageTypeBlob)
; | 283 ASSERT(!m_messages.isEmpty() && m_messages.first()->type == MessageTypeBlob)
; |
284 // FIXME: generate error message? | 284 // FIXME: generate error message? |
285 // Ignore the current failed blob item and continue with next items. | 285 // Ignore the current failed blob item and continue with next items. |
286 m_messages.removeFirst(); | 286 m_messages.removeFirst(); |
287 m_blobLoader.clear(); | 287 m_blobLoader.clear(); |
288 handleMessageQueue(); | 288 handleMessageQueue(); |
289 } | 289 } |
290 | 290 |
291 } // namespace blink | 291 } // namespace blink |
OLD | NEW |