Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(483)

Side by Side Diff: third_party/WebKit/Source/modules/encryptedmedia/MediaKeySession.cpp

Issue 2606633002: encrypted-media tests should not count # of SuspendableObjects (Closed)
Patch Set: temp Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 22 matching lines...) Expand all
33 #include "core/dom/DOMArrayBuffer.h" 33 #include "core/dom/DOMArrayBuffer.h"
34 #include "core/dom/DOMException.h" 34 #include "core/dom/DOMException.h"
35 #include "core/dom/ExceptionCode.h" 35 #include "core/dom/ExceptionCode.h"
36 #include "core/events/Event.h" 36 #include "core/events/Event.h"
37 #include "core/events/GenericEventQueue.h" 37 #include "core/events/GenericEventQueue.h"
38 #include "modules/encryptedmedia/ContentDecryptionModuleResultPromise.h" 38 #include "modules/encryptedmedia/ContentDecryptionModuleResultPromise.h"
39 #include "modules/encryptedmedia/EncryptedMediaUtils.h" 39 #include "modules/encryptedmedia/EncryptedMediaUtils.h"
40 #include "modules/encryptedmedia/MediaKeyMessageEvent.h" 40 #include "modules/encryptedmedia/MediaKeyMessageEvent.h"
41 #include "modules/encryptedmedia/MediaKeys.h" 41 #include "modules/encryptedmedia/MediaKeys.h"
42 #include "platform/ContentDecryptionModuleResult.h" 42 #include "platform/ContentDecryptionModuleResult.h"
43 #include "platform/InstanceCounters.h"
43 #include "platform/Timer.h" 44 #include "platform/Timer.h"
44 #include "platform/network/mime/ContentType.h" 45 #include "platform/network/mime/ContentType.h"
45 #include "public/platform/WebContentDecryptionModule.h" 46 #include "public/platform/WebContentDecryptionModule.h"
46 #include "public/platform/WebContentDecryptionModuleException.h" 47 #include "public/platform/WebContentDecryptionModuleException.h"
47 #include "public/platform/WebContentDecryptionModuleSession.h" 48 #include "public/platform/WebContentDecryptionModuleSession.h"
48 #include "public/platform/WebEncryptedMediaKeyInformation.h" 49 #include "public/platform/WebEncryptedMediaKeyInformation.h"
49 #include "public/platform/WebString.h" 50 #include "public/platform/WebString.h"
50 #include "public/platform/WebURL.h" 51 #include "public/platform/WebURL.h"
51 #include "wtf/ASCIICType.h" 52 #include "wtf/ASCIICType.h"
52 #include "wtf/PtrUtil.h" 53 #include "wtf/PtrUtil.h"
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 m_expiration(std::numeric_limits<double>::quiet_NaN()), 372 m_expiration(std::numeric_limits<double>::quiet_NaN()),
372 m_keyStatusesMap(new MediaKeyStatusMap()), 373 m_keyStatusesMap(new MediaKeyStatusMap()),
373 m_isUninitialized(true), 374 m_isUninitialized(true),
374 m_isCallable(false), 375 m_isCallable(false),
375 m_isClosed(false), 376 m_isClosed(false),
376 m_closedPromise(new ClosedPromise(scriptState->getExecutionContext(), 377 m_closedPromise(new ClosedPromise(scriptState->getExecutionContext(),
377 this, 378 this,
378 ClosedPromise::Closed)), 379 ClosedPromise::Closed)),
379 m_actionTimer(this, &MediaKeySession::actionTimerFired) { 380 m_actionTimer(this, &MediaKeySession::actionTimerFired) {
380 DVLOG(MEDIA_KEY_SESSION_LOG_LEVEL) << __func__ << "(" << this << ")"; 381 DVLOG(MEDIA_KEY_SESSION_LOG_LEVEL) << __func__ << "(" << this << ")";
382 InstanceCounters::incrementCounter(InstanceCounters::MediaKeySessionCounter);
381 383
382 // Create the matching Chromium object. It will not be usable until 384 // Create the matching Chromium object. It will not be usable until
383 // initializeNewSession() is called in response to the user calling 385 // initializeNewSession() is called in response to the user calling
384 // generateRequest(). 386 // generateRequest().
385 WebContentDecryptionModule* cdm = mediaKeys->contentDecryptionModule(); 387 WebContentDecryptionModule* cdm = mediaKeys->contentDecryptionModule();
386 m_session = WTF::wrapUnique(cdm->createSession()); 388 m_session = WTF::wrapUnique(cdm->createSession());
387 m_session->setClientInterface(this); 389 m_session->setClientInterface(this);
388 390
389 // From https://w3c.github.io/encrypted-media/#createSession: 391 // From https://w3c.github.io/encrypted-media/#createSession:
390 // MediaKeys::createSession(), step 3. 392 // MediaKeys::createSession(), step 3.
(...skipping 21 matching lines...) Expand all
412 // 3.8 Let the use distinctive identifier value be this object's 414 // 3.8 Let the use distinctive identifier value be this object's
413 // use distinctive identifier. 415 // use distinctive identifier.
414 // FIXME: Implement this (http://crbug.com/448922). 416 // FIXME: Implement this (http://crbug.com/448922).
415 417
416 // 3.9 Let the cdm implementation value be this object's cdm implementation. 418 // 3.9 Let the cdm implementation value be this object's cdm implementation.
417 // 3.10 Let the cdm instance value be this object's cdm instance. 419 // 3.10 Let the cdm instance value be this object's cdm instance.
418 } 420 }
419 421
420 MediaKeySession::~MediaKeySession() { 422 MediaKeySession::~MediaKeySession() {
421 DVLOG(MEDIA_KEY_SESSION_LOG_LEVEL) << __func__ << "(" << this << ")"; 423 DVLOG(MEDIA_KEY_SESSION_LOG_LEVEL) << __func__ << "(" << this << ")";
424 InstanceCounters::decrementCounter(InstanceCounters::MediaKeySessionCounter);
422 } 425 }
423 426
424 void MediaKeySession::dispose() { 427 void MediaKeySession::dispose() {
425 // Promptly clears a raw reference from content/ to an on-heap object 428 // Promptly clears a raw reference from content/ to an on-heap object
426 // so that content/ doesn't access it in a lazy sweeping phase. 429 // so that content/ doesn't access it in a lazy sweeping phase.
427 m_session.reset(); 430 m_session.reset();
428 } 431 }
429 432
430 String MediaKeySession::sessionId() const { 433 String MediaKeySession::sessionId() const {
431 return m_session->sessionId(); 434 return m_session->sessionId();
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 visitor->trace(m_asyncEventQueue); 1046 visitor->trace(m_asyncEventQueue);
1044 visitor->trace(m_pendingActions); 1047 visitor->trace(m_pendingActions);
1045 visitor->trace(m_mediaKeys); 1048 visitor->trace(m_mediaKeys);
1046 visitor->trace(m_keyStatusesMap); 1049 visitor->trace(m_keyStatusesMap);
1047 visitor->trace(m_closedPromise); 1050 visitor->trace(m_closedPromise);
1048 EventTargetWithInlineData::trace(visitor); 1051 EventTargetWithInlineData::trace(visitor);
1049 SuspendableObject::trace(visitor); 1052 SuspendableObject::trace(visitor);
1050 } 1053 }
1051 1054
1052 } // namespace blink 1055 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/testing/Internals.idl ('k') | third_party/WebKit/Source/modules/encryptedmedia/MediaKeys.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698