Chromium Code Reviews| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 { | 64 { |
| 65 MediaKeySession* session = adoptRefCountedGarbageCollectedWillBeNoop(new Med iaKeySession(context, cdm, keys)); | 65 MediaKeySession* session = adoptRefCountedGarbageCollectedWillBeNoop(new Med iaKeySession(context, cdm, keys)); |
| 66 session->suspendIfNeeded(); | 66 session->suspendIfNeeded(); |
| 67 return session; | 67 return session; |
| 68 } | 68 } |
| 69 | 69 |
| 70 MediaKeySession::MediaKeySession(ExecutionContext* context, blink::WebContentDec ryptionModule* cdm, MediaKeys* keys) | 70 MediaKeySession::MediaKeySession(ExecutionContext* context, blink::WebContentDec ryptionModule* cdm, MediaKeys* keys) |
| 71 : ActiveDOMObject(context) | 71 : ActiveDOMObject(context) |
| 72 , m_keySystem(keys->keySystem()) | 72 , m_keySystem(keys->keySystem()) |
| 73 , m_asyncEventQueue(GenericEventQueue::create(this)) | 73 , m_asyncEventQueue(GenericEventQueue::create(this)) |
| 74 , m_session(adoptPtr(cdm->createSession(this))) | 74 , m_session(adoptPtr(cdm->createSession())) |
| 75 , m_keys(keys) | 75 , m_keys(keys) |
| 76 , m_isClosed(false) | 76 , m_isClosed(false) |
| 77 , m_actionTimer(this, &MediaKeySession::actionTimerFired) | 77 , m_actionTimer(this, &MediaKeySession::actionTimerFired) |
| 78 { | 78 { |
| 79 WTF_LOG(Media, "MediaKeySession::MediaKeySession"); | 79 WTF_LOG(Media, "MediaKeySession::MediaKeySession"); |
| 80 ScriptWrappable::init(this); | 80 ScriptWrappable::init(this); |
| 81 ASSERT(m_session); | 81 m_session->setClientInterface(this); |
|
ddorwin
2014/07/10 23:22:30
The point of this change is to allow refactoring.
jrummell
2014/07/11 00:55:53
Without promises implemented, all responses come b
| |
| 82 } | 82 } |
| 83 | 83 |
| 84 MediaKeySession::~MediaKeySession() | 84 MediaKeySession::~MediaKeySession() |
| 85 { | 85 { |
| 86 m_session.clear(); | 86 m_session.clear(); |
| 87 #if !ENABLE(OILPAN) | 87 #if !ENABLE(OILPAN) |
| 88 // MediaKeySession and m_asyncEventQueue always become unreachable | 88 // MediaKeySession and m_asyncEventQueue always become unreachable |
| 89 // together. So MediaKeySession and m_asyncEventQueue are destructed in the | 89 // together. So MediaKeySession and m_asyncEventQueue are destructed in the |
| 90 // same GC. We don't need to call cancelAllEvents explicitly in Oilpan. | 90 // same GC. We don't need to call cancelAllEvents explicitly in Oilpan. |
| 91 m_asyncEventQueue->cancelAllEvents(); | 91 m_asyncEventQueue->cancelAllEvents(); |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 298 | 298 |
| 299 void MediaKeySession::trace(Visitor* visitor) | 299 void MediaKeySession::trace(Visitor* visitor) |
| 300 { | 300 { |
| 301 visitor->trace(m_error); | 301 visitor->trace(m_error); |
| 302 visitor->trace(m_asyncEventQueue); | 302 visitor->trace(m_asyncEventQueue); |
| 303 visitor->trace(m_keys); | 303 visitor->trace(m_keys); |
| 304 EventTargetWithInlineData::trace(visitor); | 304 EventTargetWithInlineData::trace(visitor); |
| 305 } | 305 } |
| 306 | 306 |
| 307 } | 307 } |
| OLD | NEW |