| 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 // completeWithError() will reject the promise with an exception. complete() | 218 // completeWithError() will reject the promise with an exception. complete() |
| 219 // is not expected to be called, and will reject the promise. | 219 // is not expected to be called, and will reject the promise. |
| 220 class NewSessionResultPromise : public ContentDecryptionModuleResultPromise { | 220 class NewSessionResultPromise : public ContentDecryptionModuleResultPromise { |
| 221 public: | 221 public: |
| 222 NewSessionResultPromise(ScriptState* scriptState, MediaKeySession* session) | 222 NewSessionResultPromise(ScriptState* scriptState, MediaKeySession* session) |
| 223 : ContentDecryptionModuleResultPromise(scriptState) | 223 : ContentDecryptionModuleResultPromise(scriptState) |
| 224 , m_session(session) | 224 , m_session(session) |
| 225 { | 225 { |
| 226 } | 226 } |
| 227 | 227 |
| 228 virtual ~NewSessionResultPromise() | 228 ~NewSessionResultPromise() override |
| 229 { | 229 { |
| 230 } | 230 } |
| 231 | 231 |
| 232 // ContentDecryptionModuleResult implementation. | 232 // ContentDecryptionModuleResult implementation. |
| 233 virtual void completeWithSession(WebContentDecryptionModuleResult::SessionSt
atus status) override | 233 void completeWithSession(WebContentDecryptionModuleResult::SessionStatus sta
tus) override |
| 234 { | 234 { |
| 235 if (status != WebContentDecryptionModuleResult::NewSession) { | 235 if (status != WebContentDecryptionModuleResult::NewSession) { |
| 236 ASSERT_NOT_REACHED(); | 236 ASSERT_NOT_REACHED(); |
| 237 reject(InvalidStateError, "Unexpected completion."); | 237 reject(InvalidStateError, "Unexpected completion."); |
| 238 } | 238 } |
| 239 | 239 |
| 240 m_session->finishGenerateRequest(); | 240 m_session->finishGenerateRequest(); |
| 241 resolve(); | 241 resolve(); |
| 242 } | 242 } |
| 243 | 243 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 257 // completeWithError() will reject the promise with an exception. complete() | 257 // completeWithError() will reject the promise with an exception. complete() |
| 258 // is not expected to be called, and will reject the promise. | 258 // is not expected to be called, and will reject the promise. |
| 259 class LoadSessionResultPromise : public ContentDecryptionModuleResultPromise { | 259 class LoadSessionResultPromise : public ContentDecryptionModuleResultPromise { |
| 260 public: | 260 public: |
| 261 LoadSessionResultPromise(ScriptState* scriptState, MediaKeySession* session) | 261 LoadSessionResultPromise(ScriptState* scriptState, MediaKeySession* session) |
| 262 : ContentDecryptionModuleResultPromise(scriptState) | 262 : ContentDecryptionModuleResultPromise(scriptState) |
| 263 , m_session(session) | 263 , m_session(session) |
| 264 { | 264 { |
| 265 } | 265 } |
| 266 | 266 |
| 267 virtual ~LoadSessionResultPromise() | 267 ~LoadSessionResultPromise() override |
| 268 { | 268 { |
| 269 } | 269 } |
| 270 | 270 |
| 271 // ContentDecryptionModuleResult implementation. | 271 // ContentDecryptionModuleResult implementation. |
| 272 virtual void completeWithSession(WebContentDecryptionModuleResult::SessionSt
atus status) override | 272 void completeWithSession(WebContentDecryptionModuleResult::SessionStatus sta
tus) override |
| 273 { | 273 { |
| 274 switch (status) { | 274 switch (status) { |
| 275 case WebContentDecryptionModuleResult::NewSession: | 275 case WebContentDecryptionModuleResult::NewSession: |
| 276 m_session->finishLoad(); | 276 m_session->finishLoad(); |
| 277 resolve(true); | 277 resolve(true); |
| 278 return; | 278 return; |
| 279 | 279 |
| 280 case WebContentDecryptionModuleResult::SessionNotFound: | 280 case WebContentDecryptionModuleResult::SessionNotFound: |
| 281 resolve(false); | 281 resolve(false); |
| 282 return; | 282 return; |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 visitor->trace(m_asyncEventQueue); | 923 visitor->trace(m_asyncEventQueue); |
| 924 visitor->trace(m_pendingActions); | 924 visitor->trace(m_pendingActions); |
| 925 visitor->trace(m_mediaKeys); | 925 visitor->trace(m_mediaKeys); |
| 926 visitor->trace(m_keyStatusesMap); | 926 visitor->trace(m_keyStatusesMap); |
| 927 visitor->trace(m_closedPromise); | 927 visitor->trace(m_closedPromise); |
| 928 RefCountedGarbageCollectedEventTargetWithInlineData<MediaKeySession>::trace(
visitor); | 928 RefCountedGarbageCollectedEventTargetWithInlineData<MediaKeySession>::trace(
visitor); |
| 929 ActiveDOMObject::trace(visitor); | 929 ActiveDOMObject::trace(visitor); |
| 930 } | 930 } |
| 931 | 931 |
| 932 } // namespace blink | 932 } // namespace blink |
| OLD | NEW |