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

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

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "platform/ContentType.h" 43 #include "platform/ContentType.h"
44 #include "platform/Logging.h" 44 #include "platform/Logging.h"
45 #include "platform/Timer.h" 45 #include "platform/Timer.h"
46 #include "public/platform/WebContentDecryptionModule.h" 46 #include "public/platform/WebContentDecryptionModule.h"
47 #include "public/platform/WebContentDecryptionModuleException.h" 47 #include "public/platform/WebContentDecryptionModuleException.h"
48 #include "public/platform/WebContentDecryptionModuleSession.h" 48 #include "public/platform/WebContentDecryptionModuleSession.h"
49 #include "public/platform/WebEncryptedMediaKeyInformation.h" 49 #include "public/platform/WebEncryptedMediaKeyInformation.h"
50 #include "public/platform/WebString.h" 50 #include "public/platform/WebString.h"
51 #include "public/platform/WebURL.h" 51 #include "public/platform/WebURL.h"
52 #include "wtf/ASCIICType.h" 52 #include "wtf/ASCIICType.h"
53 #include "wtf/PtrUtil.h"
54 #include <cmath> 53 #include <cmath>
55 #include <limits> 54 #include <limits>
56 55
57 #define MEDIA_KEY_SESSION_LOG_LEVEL 3 56 #define MEDIA_KEY_SESSION_LOG_LEVEL 3
58 57
59 namespace { 58 namespace {
60 59
61 // Minimum and maximum length for session ids. 60 // Minimum and maximum length for session ids.
62 enum { 61 enum {
63 MinSessionIdLength = 1, 62 MinSessionIdLength = 1,
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 , m_closedPromise(new ClosedPromise(scriptState->getExecutionContext(), this , ClosedPromise::Closed)) 324 , m_closedPromise(new ClosedPromise(scriptState->getExecutionContext(), this , ClosedPromise::Closed))
326 , m_actionTimer(this, &MediaKeySession::actionTimerFired) 325 , m_actionTimer(this, &MediaKeySession::actionTimerFired)
327 { 326 {
328 DVLOG(MEDIA_KEY_SESSION_LOG_LEVEL) << __FUNCTION__ << "(" << this << ")"; 327 DVLOG(MEDIA_KEY_SESSION_LOG_LEVEL) << __FUNCTION__ << "(" << this << ")";
329 ThreadState::current()->registerPreFinalizer(this); 328 ThreadState::current()->registerPreFinalizer(this);
330 329
331 // Create the matching Chromium object. It will not be usable until 330 // Create the matching Chromium object. It will not be usable until
332 // initializeNewSession() is called in response to the user calling 331 // initializeNewSession() is called in response to the user calling
333 // generateRequest(). 332 // generateRequest().
334 WebContentDecryptionModule* cdm = mediaKeys->contentDecryptionModule(); 333 WebContentDecryptionModule* cdm = mediaKeys->contentDecryptionModule();
335 m_session = wrapUnique(cdm->createSession()); 334 m_session = adoptPtr(cdm->createSession());
336 m_session->setClientInterface(this); 335 m_session->setClientInterface(this);
337 336
338 // From https://w3c.github.io/encrypted-media/#createSession: 337 // From https://w3c.github.io/encrypted-media/#createSession:
339 // MediaKeys::createSession(), step 3. 338 // MediaKeys::createSession(), step 3.
340 // 3.1 Let the sessionId attribute be the empty string. 339 // 3.1 Let the sessionId attribute be the empty string.
341 DCHECK(sessionId().isEmpty()); 340 DCHECK(sessionId().isEmpty());
342 341
343 // 3.2 Let the expiration attribute be NaN. 342 // 3.2 Let the expiration attribute be NaN.
344 DCHECK(std::isnan(m_expiration)); 343 DCHECK(std::isnan(m_expiration));
345 344
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 visitor->trace(m_asyncEventQueue); 926 visitor->trace(m_asyncEventQueue);
928 visitor->trace(m_pendingActions); 927 visitor->trace(m_pendingActions);
929 visitor->trace(m_mediaKeys); 928 visitor->trace(m_mediaKeys);
930 visitor->trace(m_keyStatusesMap); 929 visitor->trace(m_keyStatusesMap);
931 visitor->trace(m_closedPromise); 930 visitor->trace(m_closedPromise);
932 EventTargetWithInlineData::trace(visitor); 931 EventTargetWithInlineData::trace(visitor);
933 ActiveDOMObject::trace(visitor); 932 ActiveDOMObject::trace(visitor);
934 } 933 }
935 934
936 } // namespace blink 935 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698