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

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

Issue 2606633002: encrypted-media tests should not count # of SuspendableObjects (Closed)
Patch Set: temp Created 3 years, 11 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 18 matching lines...) Expand all
29 #include "bindings/core/v8/ScriptState.h" 29 #include "bindings/core/v8/ScriptState.h"
30 #include "bindings/core/v8/V8ThrowException.h" 30 #include "bindings/core/v8/V8ThrowException.h"
31 #include "core/dom/DOMArrayBuffer.h" 31 #include "core/dom/DOMArrayBuffer.h"
32 #include "core/dom/DOMException.h" 32 #include "core/dom/DOMException.h"
33 #include "core/dom/ExceptionCode.h" 33 #include "core/dom/ExceptionCode.h"
34 #include "core/dom/ExecutionContext.h" 34 #include "core/dom/ExecutionContext.h"
35 #include "core/html/HTMLMediaElement.h" 35 #include "core/html/HTMLMediaElement.h"
36 #include "modules/encryptedmedia/ContentDecryptionModuleResultPromise.h" 36 #include "modules/encryptedmedia/ContentDecryptionModuleResultPromise.h"
37 #include "modules/encryptedmedia/EncryptedMediaUtils.h" 37 #include "modules/encryptedmedia/EncryptedMediaUtils.h"
38 #include "modules/encryptedmedia/MediaKeySession.h" 38 #include "modules/encryptedmedia/MediaKeySession.h"
39 #include "platform/InstanceCounters.h"
39 #include "platform/Timer.h" 40 #include "platform/Timer.h"
40 #include "public/platform/WebContentDecryptionModule.h" 41 #include "public/platform/WebContentDecryptionModule.h"
41 #include "wtf/RefPtr.h" 42 #include "wtf/RefPtr.h"
42 #include <memory> 43 #include <memory>
43 44
44 #define MEDIA_KEYS_LOG_LEVEL 3 45 #define MEDIA_KEYS_LOG_LEVEL 3
45 46
46 namespace blink { 47 namespace blink {
47 48
48 // A class holding a pending action. 49 // A class holding a pending action.
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 ExecutionContext* context, 140 ExecutionContext* context,
140 const WebVector<WebEncryptedMediaSessionType>& supportedSessionTypes, 141 const WebVector<WebEncryptedMediaSessionType>& supportedSessionTypes,
141 std::unique_ptr<WebContentDecryptionModule> cdm) 142 std::unique_ptr<WebContentDecryptionModule> cdm)
142 : SuspendableObject(context), 143 : SuspendableObject(context),
143 m_supportedSessionTypes(supportedSessionTypes), 144 m_supportedSessionTypes(supportedSessionTypes),
144 m_cdm(std::move(cdm)), 145 m_cdm(std::move(cdm)),
145 m_mediaElement(nullptr), 146 m_mediaElement(nullptr),
146 m_reservedForMediaElement(false), 147 m_reservedForMediaElement(false),
147 m_timer(this, &MediaKeys::timerFired) { 148 m_timer(this, &MediaKeys::timerFired) {
148 DVLOG(MEDIA_KEYS_LOG_LEVEL) << __func__ << "(" << this << ")"; 149 DVLOG(MEDIA_KEYS_LOG_LEVEL) << __func__ << "(" << this << ")";
150 InstanceCounters::incrementCounter(InstanceCounters::MediaKeysCounter);
149 } 151 }
150 152
151 MediaKeys::~MediaKeys() { 153 MediaKeys::~MediaKeys() {
152 DVLOG(MEDIA_KEYS_LOG_LEVEL) << __func__ << "(" << this << ")"; 154 DVLOG(MEDIA_KEYS_LOG_LEVEL) << __func__ << "(" << this << ")";
155 InstanceCounters::decrementCounter(InstanceCounters::MediaKeysCounter);
153 } 156 }
154 157
155 MediaKeySession* MediaKeys::createSession(ScriptState* scriptState, 158 MediaKeySession* MediaKeys::createSession(ScriptState* scriptState,
156 const String& sessionTypeString, 159 const String& sessionTypeString,
157 ExceptionState& exceptionState) { 160 ExceptionState& exceptionState) {
158 DVLOG(MEDIA_KEYS_LOG_LEVEL) << __func__ << "(" << this << ") " 161 DVLOG(MEDIA_KEYS_LOG_LEVEL) << __func__ << "(" << this << ") "
159 << sessionTypeString; 162 << sessionTypeString;
160 163
161 // From http://w3c.github.io/encrypted-media/#createSession 164 // From http://w3c.github.io/encrypted-media/#createSession
162 165
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 // Remain around if there are pending events. 311 // Remain around if there are pending events.
309 DVLOG(MEDIA_KEYS_LOG_LEVEL) 312 DVLOG(MEDIA_KEYS_LOG_LEVEL)
310 << __func__ << "(" << this << ")" 313 << __func__ << "(" << this << ")"
311 << (!m_pendingActions.isEmpty() ? " !m_pendingActions.isEmpty()" : "") 314 << (!m_pendingActions.isEmpty() ? " !m_pendingActions.isEmpty()" : "")
312 << (m_reservedForMediaElement ? " m_reservedForMediaElement" : ""); 315 << (m_reservedForMediaElement ? " m_reservedForMediaElement" : "");
313 316
314 return !m_pendingActions.isEmpty() || m_reservedForMediaElement; 317 return !m_pendingActions.isEmpty() || m_reservedForMediaElement;
315 } 318 }
316 319
317 } // namespace blink 320 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698