| 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 { | 264 { |
| 265 } | 265 } |
| 266 | 266 |
| 267 virtual ~LoadSessionResultPromise() | 267 virtual ~LoadSessionResultPromise() |
| 268 { | 268 { |
| 269 } | 269 } |
| 270 | 270 |
| 271 // ContentDecryptionModuleResult implementation. | 271 // ContentDecryptionModuleResult implementation. |
| 272 virtual void completeWithSession(WebContentDecryptionModuleResult::SessionSt
atus status) override | 272 virtual void completeWithSession(WebContentDecryptionModuleResult::SessionSt
atus status) override |
| 273 { | 273 { |
| 274 bool result = false; | |
| 275 switch (status) { | 274 switch (status) { |
| 276 case WebContentDecryptionModuleResult::NewSession: | 275 case WebContentDecryptionModuleResult::NewSession: |
| 277 result = true; | 276 m_session->finishLoad(); |
| 278 break; | 277 resolve(true); |
| 278 return; |
| 279 | 279 |
| 280 case WebContentDecryptionModuleResult::SessionNotFound: | 280 case WebContentDecryptionModuleResult::SessionNotFound: |
| 281 result = false; | 281 resolve(false); |
| 282 break; | 282 return; |
| 283 | 283 |
| 284 case WebContentDecryptionModuleResult::SessionAlreadyExists: | 284 case WebContentDecryptionModuleResult::SessionAlreadyExists: |
| 285 ASSERT_NOT_REACHED(); | 285 ASSERT_NOT_REACHED(); |
| 286 reject(InvalidStateError, "Unexpected completion."); | 286 reject(InvalidStateError, "Unexpected completion."); |
| 287 return; | 287 return; |
| 288 } | 288 } |
| 289 | 289 |
| 290 m_session->finishLoad(); | 290 ASSERT_NOT_REACHED(); |
| 291 resolve(result); | |
| 292 } | 291 } |
| 293 | 292 |
| 294 DEFINE_INLINE_TRACE() | 293 DEFINE_INLINE_TRACE() |
| 295 { | 294 { |
| 296 visitor->trace(m_session); | 295 visitor->trace(m_session); |
| 297 ContentDecryptionModuleResultPromise::trace(visitor); | 296 ContentDecryptionModuleResultPromise::trace(visitor); |
| 298 } | 297 } |
| 299 | 298 |
| 300 private: | 299 private: |
| 301 Member<MediaKeySession> m_session; | 300 Member<MediaKeySession> m_session; |
| (...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 924 visitor->trace(m_asyncEventQueue); | 923 visitor->trace(m_asyncEventQueue); |
| 925 visitor->trace(m_pendingActions); | 924 visitor->trace(m_pendingActions); |
| 926 visitor->trace(m_mediaKeys); | 925 visitor->trace(m_mediaKeys); |
| 927 visitor->trace(m_keyStatusesMap); | 926 visitor->trace(m_keyStatusesMap); |
| 928 visitor->trace(m_closedPromise); | 927 visitor->trace(m_closedPromise); |
| 929 RefCountedGarbageCollectedEventTargetWithInlineData<MediaKeySession>::trace(
visitor); | 928 RefCountedGarbageCollectedEventTargetWithInlineData<MediaKeySession>::trace(
visitor); |
| 930 ActiveDOMObject::trace(visitor); | 929 ActiveDOMObject::trace(visitor); |
| 931 } | 930 } |
| 932 | 931 |
| 933 } // namespace blink | 932 } // namespace blink |
| OLD | NEW |