| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2013 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 void MediaKeySession::message(const unsigned char* message, size_t messageLength
, const blink::WebURL& destinationURL) | 178 void MediaKeySession::message(const unsigned char* message, size_t messageLength
, const blink::WebURL& destinationURL) |
| 179 { | 179 { |
| 180 WTF_LOG(Media, "MediaKeySession::message"); | 180 WTF_LOG(Media, "MediaKeySession::message"); |
| 181 | 181 |
| 182 MediaKeyMessageEventInit init; | 182 MediaKeyMessageEventInit init; |
| 183 init.bubbles = false; | 183 init.bubbles = false; |
| 184 init.cancelable = false; | 184 init.cancelable = false; |
| 185 init.message = Uint8Array::create(message, messageLength); | 185 init.message = Uint8Array::create(message, messageLength); |
| 186 init.destinationURL = destinationURL.string(); | 186 init.destinationURL = destinationURL.string(); |
| 187 | 187 |
| 188 RefPtr<MediaKeyMessageEvent> event = MediaKeyMessageEvent::create(EventTypeN
ames::message, init); | 188 RefPtrWillBeRawPtr<MediaKeyMessageEvent> event = MediaKeyMessageEvent::creat
e(EventTypeNames::message, init); |
| 189 event->setTarget(this); | 189 event->setTarget(this); |
| 190 m_asyncEventQueue->enqueueEvent(event.release()); | 190 m_asyncEventQueue->enqueueEvent(event.release()); |
| 191 } | 191 } |
| 192 | 192 |
| 193 void MediaKeySession::ready() | 193 void MediaKeySession::ready() |
| 194 { | 194 { |
| 195 WTF_LOG(Media, "MediaKeySession::ready"); | 195 WTF_LOG(Media, "MediaKeySession::ready"); |
| 196 | 196 |
| 197 RefPtr<Event> event = Event::create(EventTypeNames::ready); | 197 RefPtrWillBeRawPtr<Event> event = Event::create(EventTypeNames::ready); |
| 198 event->setTarget(this); | 198 event->setTarget(this); |
| 199 m_asyncEventQueue->enqueueEvent(event.release()); | 199 m_asyncEventQueue->enqueueEvent(event.release()); |
| 200 } | 200 } |
| 201 | 201 |
| 202 void MediaKeySession::close() | 202 void MediaKeySession::close() |
| 203 { | 203 { |
| 204 WTF_LOG(Media, "MediaKeySession::close"); | 204 WTF_LOG(Media, "MediaKeySession::close"); |
| 205 | 205 |
| 206 RefPtr<Event> event = Event::create(EventTypeNames::close); | 206 RefPtrWillBeRawPtr<Event> event = Event::create(EventTypeNames::close); |
| 207 event->setTarget(this); | 207 event->setTarget(this); |
| 208 m_asyncEventQueue->enqueueEvent(event.release()); | 208 m_asyncEventQueue->enqueueEvent(event.release()); |
| 209 | 209 |
| 210 // Once closed, the session can no longer be the target of events from | 210 // Once closed, the session can no longer be the target of events from |
| 211 // the CDM so this object can be garbage collected. | 211 // the CDM so this object can be garbage collected. |
| 212 m_isClosed = true; | 212 m_isClosed = true; |
| 213 } | 213 } |
| 214 | 214 |
| 215 // Queue a task to fire a simple event named keyadded at the MediaKeySession obj
ect. | 215 // Queue a task to fire a simple event named keyadded at the MediaKeySession obj
ect. |
| 216 void MediaKeySession::error(MediaKeyErrorCode errorCode, unsigned long systemCod
e) | 216 void MediaKeySession::error(MediaKeyErrorCode errorCode, unsigned long systemCod
e) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 227 break; | 227 break; |
| 228 } | 228 } |
| 229 | 229 |
| 230 // 1. Create a new MediaKeyError object with the following attributes: | 230 // 1. Create a new MediaKeyError object with the following attributes: |
| 231 // code = the appropriate MediaKeyError code | 231 // code = the appropriate MediaKeyError code |
| 232 // systemCode = a Key System-specific value, if provided, and 0 otherwise | 232 // systemCode = a Key System-specific value, if provided, and 0 otherwise |
| 233 // 2. Set the MediaKeySession object's error attribute to the error object c
reated in the previous step. | 233 // 2. Set the MediaKeySession object's error attribute to the error object c
reated in the previous step. |
| 234 m_error = MediaKeyError::create(mediaKeyErrorCode, systemCode); | 234 m_error = MediaKeyError::create(mediaKeyErrorCode, systemCode); |
| 235 | 235 |
| 236 // 3. queue a task to fire a simple event named keyerror at the MediaKeySess
ion object. | 236 // 3. queue a task to fire a simple event named keyerror at the MediaKeySess
ion object. |
| 237 RefPtr<Event> event = Event::create(EventTypeNames::error); | 237 RefPtrWillBeRawPtr<Event> event = Event::create(EventTypeNames::error); |
| 238 event->setTarget(this); | 238 event->setTarget(this); |
| 239 m_asyncEventQueue->enqueueEvent(event.release()); | 239 m_asyncEventQueue->enqueueEvent(event.release()); |
| 240 } | 240 } |
| 241 | 241 |
| 242 const AtomicString& MediaKeySession::interfaceName() const | 242 const AtomicString& MediaKeySession::interfaceName() const |
| 243 { | 243 { |
| 244 return EventTargetNames::MediaKeySession; | 244 return EventTargetNames::MediaKeySession; |
| 245 } | 245 } |
| 246 | 246 |
| 247 ExecutionContext* MediaKeySession::executionContext() const | 247 ExecutionContext* MediaKeySession::executionContext() const |
| (...skipping 17 matching lines...) Expand all Loading... |
| 265 m_session.clear(); | 265 m_session.clear(); |
| 266 m_isClosed = true; | 266 m_isClosed = true; |
| 267 | 267 |
| 268 if (m_actionTimer.isActive()) | 268 if (m_actionTimer.isActive()) |
| 269 m_actionTimer.stop(); | 269 m_actionTimer.stop(); |
| 270 m_pendingActions.clear(); | 270 m_pendingActions.clear(); |
| 271 m_asyncEventQueue->close(); | 271 m_asyncEventQueue->close(); |
| 272 } | 272 } |
| 273 | 273 |
| 274 } | 274 } |
| OLD | NEW |