⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 237493 in webkit


Ignore:
Timestamp:
Oct 27, 2018, 8:34:35 AM (8 years ago)
Author:
cturner@igalia.com
Message:

[EME] Add a logging macro
​https://bugs.webkit.org/show_bug.cgi?id=190984

Reviewed by Xabier Rodriguez-Calvar.

No tests since no new functionality.

  • Modules/encryptedmedia/MediaKeySession.cpp:

(WebCore::MediaKeySession::MediaKeySession):
(WebCore::MediaKeySession::generateRequest):
(WebCore::MediaKeySession::update):
(WebCore::MediaKeySession::close):
(WebCore::MediaKeySession::remove):
(WebCore::MediaKeySession::sessionClosed):

  • Modules/encryptedmedia/MediaKeys.cpp:

(WebCore::MediaKeys::createSession):

  • Modules/encryptedmedia/NavigatorEME.cpp:

(WebCore::NavigatorEME::requestMediaKeySystemAccess):

  • platform/Logging.h:
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r237488 r237493  
     12018-10-27  Charlie Turner  <cturner@igalia.com>
     2
     3        [EME] Add a logging macro
     4        https://bugs.webkit.org/show_bug.cgi?id=190984
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        No tests since no new functionality.
     9
     10        * Modules/encryptedmedia/MediaKeySession.cpp:
     11        (WebCore::MediaKeySession::MediaKeySession):
     12        (WebCore::MediaKeySession::generateRequest):
     13        (WebCore::MediaKeySession::update):
     14        (WebCore::MediaKeySession::close):
     15        (WebCore::MediaKeySession::remove):
     16        (WebCore::MediaKeySession::sessionClosed):
     17        * Modules/encryptedmedia/MediaKeys.cpp:
     18        (WebCore::MediaKeys::createSession):
     19        * Modules/encryptedmedia/NavigatorEME.cpp:
     20        (WebCore::NavigatorEME::requestMediaKeySystemAccess):
     21        * platform/Logging.h:
     22
    1232018-10-27  Xabier Rodriguez Calvar  <calvaris@igalia.com>
    224
  • trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp

    r236462 r237493  
    3636#include "Document.h"
    3737#include "EventNames.h"
     38#include "Logging.h"
    3839#include "MediaKeyMessageEvent.h"
    3940#include "MediaKeyMessageType.h"
    … …  
    7071    // W3C Editor's Draft 09 November 2016
    7172    // createSession(), ctd.
     73
     74    LOG(EME, "EME - new session created");
    7275
    7376    // 3.1. Let the sessionId attribute be the empty string.
    … …  
    121124    // 1. If this object is closed, return a promise rejected with an InvalidStateError.
    122125    // 2. If this object's uninitialized value is false, return a promise rejected with an InvalidStateError.
     126    LOG(EME, "EME - generate request");
     127
    123128    if (m_closed || !m_uninitialized) {
    124129        promise->reject(InvalidStateError);
    … …  
    195200        }
    196201
     202        LOG(EME, "EME - request license from CDM implementation");
    197203        m_instanceSession->requestLicense(m_sessionType, initDataType, WTFMove(initData), [this, weakThis = makeWeakPtr(*this), promise = WTFMove(promise)] (Ref<SharedBuffer>&& message, const String& sessionId, bool needsIndividualization, CDMInstanceSession::SuccessValue succeeded) mutable {
    198204            if (!weakThis)
    … …  
    360366    // 1. If this object is closed, return a promise rejected with an InvalidStateError.
    361367    // 2. If this object's callable value is false, return a promise rejected with an InvalidStateError.
     368    LOG(EME, "EME - update session for %s", m_sessionId.utf8().data());
     369
    362370    if (m_closed || !m_callable) {
    363371        promise->reject(InvalidStateError);
    … …  
    416424
    417425            if (succeeded == CDMInstanceSession::SuccessValue::Failed) {
     426                LOG(EME, "EME - failed to update CDM license for %s", m_sessionId.utf8().data());
    418427                promise->reject(TypeError);
    419428                return;
    … …  
    425434            // 6.8. Queue a task to run the following steps:
    426435            m_taskQueue.enqueueTask([this, sessionWasClosed, changedKeys = WTFMove(changedKeys), changedExpiration = WTFMove(changedExpiration), message = WTFMove(message), promise = WTFMove(promise)] () mutable {
     436                LOG(EME, "EME - updating CDM license succeeded for session %s, sending a message to the license server", m_sessionId.utf8().data());
    427437                // 6.8.1.
    428438                if (sessionWasClosed) {
    … …  
    485495    // 1. Let session be the associated MediaKeySession object.
    486496    // 2. If session is closed, return a resolved promise.
     497    LOG(EME, "EME - closing session %s", m_sessionId.utf8().data());
     498
    487499    if (m_closed) {
    488500        promise->resolve();
    … …  
    501513        // 5.1. Let cdm be the CDM instance represented by session's cdm instance value.
    502514        // 5.2. Use cdm to close the key session associated with session.
     515        LOG(EME, "EME - closing CDM session %s", m_sessionId.utf8().data());
    503516        m_instanceSession->closeSession(m_sessionId, [this, weakThis = makeWeakPtr(*this), promise = WTFMove(promise)] () mutable {
    504517            if (!weakThis)
    … …  
    526539    // 1. If this object is closed, return a promise rejected with an InvalidStateError.
    527540    // 2. If this object's callable value is false, return a promise rejected with an InvalidStateError.
     541    LOG(EME, "EME - removing session %s", m_sessionId.utf8().data());
     542
    528543    if (m_closed || !m_callable) {
    529544        promise->reject(InvalidStateError);
    … …  
    661676    // https://w3c.github.io/encrypted-media/#session-closed
    662677    // W3C Editor's Draft 09 November 2016
     678    LOG(EME, "EME - session %s was closed", m_sessionId.utf8().data());
    663679
    664680    // 1. Let session be the associated MediaKeySession object.
  • trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp

    r236317 r237493  
    3535#include "CDMClient.h"
    3636#include "CDMInstance.h"
     37#include "Logging.h"
    3738#include "MediaKeySession.h"
    3839#include "SharedBuffer.h"
    … …  
    5556    // https://w3c.github.io/encrypted-media/#dom-mediakeys-setservercertificate
    5657    // W3C Editor's Draft 09 November 2016
     58    LOG(EME, "EME - check if a new session can be created");
    5759
    5860    // When this method is invoked, the user agent must run the following steps:
  • trunk/Source/WebCore/Modules/encryptedmedia/NavigatorEME.cpp

    r227895 r237493  
    3535#include "Document.h"
    3636#include "JSMediaKeySystemAccess.h"
     37#include "Logging.h"
    3738
    3839namespace WebCore {
    … …  
    4445    // https://w3c.github.io/encrypted-media/#dom-navigator-requestmediakeysystemaccess
    4546    // W3C Editor's Draft 09 November 2016
     47    LOG(EME, "EME - request media key system access for %s", keySystem.utf8().data());
    4648
    4749    // When this method is invoked, the user agent must run the following steps:
    … …  
    6163        //      String comparison is case-sensitive.
    6264        if (!CDM::supportsKeySystem(keySystem)) {
     65            LOG(EME, "EME - %s is not supported", keySystem.utf8().data());
    6366            promise->reject(NotSupportedError);
    6467            return;
  • trunk/Source/WebCore/platform/Logging.h

    r236954 r237493  
    4747    M(DOMTimers) \
    4848    M(Editing) \
     49    M(EME) \
    4950    M(Events) \
    5051    M(FileAPI) \
Note: See TracChangeset for help on using the changeset viewer.