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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 , m_state(WebPresentationSessionState::Connected) | 93 , m_state(WebPresentationSessionState::Connected) |
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
ent, Presentation* presentation) |
104 { | 104 { |
105 ASSERT(clientRaw); | 105 ASSERT(client); |
106 ASSERT(presentation); | 106 ASSERT(presentation); |
107 OwnPtr<WebPresentationSessionClient> client = adoptPtr(clientRaw); | |
108 | 107 |
109 PresentationSession* session = new PresentationSession(presentation->frame()
, client->getId(), client->getUrl()); | 108 PresentationSession* session = new PresentationSession(presentation->frame()
, client->getId(), client->getUrl()); |
110 presentation->registerSession(session); | 109 presentation->registerSession(session); |
111 return session; | 110 return session; |
112 } | 111 } |
113 | 112 |
114 // static | |
115 void PresentationSession::dispose(WebPresentationSessionClient* client) | |
116 { | |
117 delete client; | |
118 } | |
119 | |
120 const AtomicString& PresentationSession::interfaceName() const | 113 const AtomicString& PresentationSession::interfaceName() const |
121 { | 114 { |
122 return EventTargetNames::PresentationSession; | 115 return EventTargetNames::PresentationSession; |
123 } | 116 } |
124 | 117 |
125 ExecutionContext* PresentationSession::executionContext() const | 118 ExecutionContext* PresentationSession::executionContext() const |
126 { | 119 { |
127 if (!frame()) | 120 if (!frame()) |
128 return nullptr; | 121 return nullptr; |
129 return frame()->document();} | 122 return frame()->document();} |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 { | 275 { |
283 ASSERT(!m_messages.isEmpty() && m_messages.first()->type == MessageTypeBlob)
; | 276 ASSERT(!m_messages.isEmpty() && m_messages.first()->type == MessageTypeBlob)
; |
284 // FIXME: generate error message? | 277 // FIXME: generate error message? |
285 // Ignore the current failed blob item and continue with next items. | 278 // Ignore the current failed blob item and continue with next items. |
286 m_messages.removeFirst(); | 279 m_messages.removeFirst(); |
287 m_blobLoader.clear(); | 280 m_blobLoader.clear(); |
288 handleMessageQueue(); | 281 handleMessageQueue(); |
289 } | 282 } |
290 | 283 |
291 } // namespace blink | 284 } // namespace blink |
OLD | NEW |