WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch for landing
bug-132467-20140504145431.patch (text/plain), 8.56 KB, created by
Gyuyoung Kim
on 2014-05-03 22:54:54 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Gyuyoung Kim
Created:
2014-05-03 22:54:54 PDT
Size:
8.56 KB
patch
obsolete
>Subversion Revision: 168221 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 821e812ce64fa72e165a59ff13fa729d70508322..9339beb9f914a6b4e5cfd1b286d1ca708dd9e374 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,25 @@ >+2014-05-03 Gyuyoung Kim <gyuyoung.kim@samsung.com> >+ >+ Convert OwnPtr to std::unique_ptr in CDM >+ https://bugs.webkit.org/show_bug.cgi?id=132467 >+ >+ Use std::unique_ptr in CDM class. >+ >+ No new tests, no behavior change. >+ >+ * Modules/encryptedmedia/CDM.cpp: >+ (WebCore::CDM::create): >+ (WebCore::CDM::CDM): >+ * Modules/encryptedmedia/CDM.h: >+ * Modules/encryptedmedia/CDMPrivateMediaPlayer.h: >+ (WebCore::CDMPrivateMediaPlayer::CDMPrivateMediaPlayer): >+ (WebCore::CDMPrivateMediaPlayer::create): >+ * Modules/encryptedmedia/MediaKeys.cpp: >+ (WebCore::MediaKeys::create): >+ (WebCore::MediaKeys::MediaKeys): >+ * Modules/encryptedmedia/MediaKeys.h: >+ * WebCore.exp.in: >+ > 2014-05-03 Zalan Bujtas <zalan@apple.com> > > Subpixel rendering: Fieldset legend has a horizontal line through, when the fieldset is painted on odd device pixel position. >diff --git a/Source/WebCore/Modules/encryptedmedia/CDM.cpp b/Source/WebCore/Modules/encryptedmedia/CDM.cpp >index 75268844196058981bf76bb464db8f6b4acc7b08..e9d52477f70bacddb0302eacc864037d4289473d 100644 >--- a/Source/WebCore/Modules/encryptedmedia/CDM.cpp >+++ b/Source/WebCore/Modules/encryptedmedia/CDM.cpp >@@ -94,19 +94,19 @@ bool CDM::keySystemSupportsMimeType(const String& keySystem, const String& mimeT > return false; > } > >-PassOwnPtr<CDM> CDM::create(const String& keySystem) >+std::unique_ptr<CDM> CDM::create(const String& keySystem) > { > if (!supportsKeySystem(keySystem)) > return nullptr; > >- return adoptPtr(new CDM(keySystem)); >+ return std::make_unique<CDM>(keySystem); > } > > CDM::CDM(const String& keySystem) > : m_keySystem(keySystem) > , m_client(0) > { >- m_private = CDMFactoryForKeySystem(keySystem)->constructor(this); >+ m_private = std::move(CDMFactoryForKeySystem(keySystem)->constructor(this)); > } > > CDM::~CDM() >diff --git a/Source/WebCore/Modules/encryptedmedia/CDM.h b/Source/WebCore/Modules/encryptedmedia/CDM.h >index f30d64f8d468e86b4851e7b7acf476955a087bd5..852dc23d8a6bf59a3e27bfc2bcd04bc4c6d49286 100644 >--- a/Source/WebCore/Modules/encryptedmedia/CDM.h >+++ b/Source/WebCore/Modules/encryptedmedia/CDM.h >@@ -40,7 +40,7 @@ class CDM; > class CDMPrivateInterface; > class MediaPlayer; > >-typedef PassOwnPtr<CDMPrivateInterface> (*CreateCDM)(CDM*); >+typedef std::unique_ptr<CDMPrivateInterface> (*CreateCDM)(CDM*); > typedef bool (*CDMSupportsKeySystem)(const String&); > typedef bool (*CDMSupportsKeySystemAndMimeType)(const String&, const String&); > >@@ -53,11 +53,12 @@ public: > > class CDM { > public: >+ explicit CDM(const String& keySystem); > > enum CDMErrorCode { UnknownError = 1, ClientError, ServiceError, OutputError, HardwareChangeError, DomainError }; > static bool supportsKeySystem(const String&); > static bool keySystemSupportsMimeType(const String& keySystem, const String& mimeType); >- static PassOwnPtr<CDM> create(const String& keySystem); >+ static std::unique_ptr<CDM> create(const String& keySystem); > static void registerCDMFactory(CreateCDM, CDMSupportsKeySystem, CDMSupportsKeySystemAndMimeType); > ~CDM(); > >@@ -72,10 +73,8 @@ public: > MediaPlayer* mediaPlayer() const; > > private: >- CDM(const String& keySystem); >- > String m_keySystem; >- OwnPtr<CDMPrivateInterface> m_private; >+ std::unique_ptr<CDMPrivateInterface> m_private; > CDMClient* m_client; > }; > >diff --git a/Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.h b/Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.h >index 484dd4163c4e2bfe6be015e07a3179f86e0551bf..a49279fb99254202f03f5e088ac51619f9ed9b79 100644 >--- a/Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.h >+++ b/Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.h >@@ -38,7 +38,11 @@ class CDM; > > class CDMPrivateMediaPlayer : public CDMPrivateInterface { > public: >- static PassOwnPtr<CDMPrivateInterface> create(CDM* cdm) { return adoptPtr(new CDMPrivateMediaPlayer(cdm)); } >+ explicit CDMPrivateMediaPlayer(CDM* cdm) >+ : m_cdm(cdm) >+ { } >+ >+ static std::unique_ptr<CDMPrivateInterface> create(CDM* cdm) { return std::make_unique<CDMPrivateMediaPlayer>(cdm); } > static bool supportsKeySystem(const String&); > static bool supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType); > >@@ -50,7 +54,6 @@ public: > CDM* cdm() const { return m_cdm; } > > protected: >- CDMPrivateMediaPlayer(CDM* cdm) : m_cdm(cdm) { } > CDM* m_cdm; > }; > >diff --git a/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp b/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp >index c29c33f9c07e1a79e7a85c6cf3bfa06b8c0a3c41..286af20a59c2164bf2cee62597db601c23be2a7c 100644 >--- a/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp >+++ b/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp >@@ -57,18 +57,18 @@ PassRefPtr<MediaKeys> MediaKeys::create(const String& keySystem, ExceptionCode& > > // 3. Let cdm be the content decryption module corresponding to keySystem. > // 4. Load cdm if necessary. >- OwnPtr<CDM> cdm = CDM::create(keySystem); >+ std::unique_ptr<CDM> cdm = CDM::create(keySystem); > > // 5. Create a new MediaKeys object. > // 5.1 Let the keySystem attribute be keySystem. > // 6. Return the new object to the caller. >- return adoptRef(new MediaKeys(keySystem, cdm.release())); >+ return adoptRef(new MediaKeys(keySystem, std::move(cdm))); > } > >-MediaKeys::MediaKeys(const String& keySystem, PassOwnPtr<CDM> cdm) >+MediaKeys::MediaKeys(const String& keySystem, std::unique_ptr<CDM> cdm) > : m_mediaElement(0) > , m_keySystem(keySystem) >- , m_cdm(cdm) >+ , m_cdm(std::move(cdm)) > { > m_cdm->setClient(this); > } >diff --git a/Source/WebCore/Modules/encryptedmedia/MediaKeys.h b/Source/WebCore/Modules/encryptedmedia/MediaKeys.h >index cbfef87021fa68d845946453dad118f6358b9693..be6f3a858e3af30635f73d4d30745e3419d536f3 100644 >--- a/Source/WebCore/Modules/encryptedmedia/MediaKeys.h >+++ b/Source/WebCore/Modules/encryptedmedia/MediaKeys.h >@@ -32,7 +32,6 @@ > #include "EventTarget.h" > #include "ExceptionCode.h" > #include <runtime/Uint8Array.h> >-#include <wtf/OwnPtr.h> > #include <wtf/PassRefPtr.h> > #include <wtf/RefCounted.h> > #include <wtf/Vector.h> >@@ -62,13 +61,13 @@ protected: > // CDMClient: > virtual MediaPlayer* cdmMediaPlayer(const CDM*) const override; > >- MediaKeys(const String& keySystem, PassOwnPtr<CDM>); >+ MediaKeys(const String& keySystem, std::unique_ptr<CDM>); > > Vector<RefPtr<MediaKeySession>> m_sessions; > > HTMLMediaElement* m_mediaElement; > String m_keySystem; >- OwnPtr<CDM> m_cdm; >+ std::unique_ptr<CDM> m_cdm; > }; > > } >diff --git a/Source/WebCore/WebCore.exp.in b/Source/WebCore/WebCore.exp.in >index c584f62addd6a53674b8a2dfeea9563aef3e13d7..c510b326ddba1ad5f348654b9e492c7b09a6ceb3 100644 >--- a/Source/WebCore/WebCore.exp.in >+++ b/Source/WebCore/WebCore.exp.in >@@ -2938,7 +2938,7 @@ __ZN7WebCore8DragDataC1EP11objc_objectRKNS_8IntPointES5_NS_13DragOperationENS_20 > #endif > > #if ENABLE(ENCRYPTED_MEDIA_V2) >-__ZN7WebCore3CDM18registerCDMFactoryEPFN3WTF10PassOwnPtrINS_19CDMPrivateInterfaceEEEPS0_EPFbRKNS1_6StringEEPFbSA_SA_E >+__ZN7WebCore3CDM18registerCDMFactoryEPFNSt3__110unique_ptrINS_19CDMPrivateInterfaceENS1_14default_deleteIS3_EEEEPS0_EPFbRKN3WTF6StringEEPFbSD_SD_E > #endif > > #if ENABLE(FULLSCREEN_API) >diff --git a/Source/WebCore/testing/MockCDM.h b/Source/WebCore/testing/MockCDM.h >index 97d0207c076b73da7970d0100f52f516ef9a639d..b7be8fac71530059bd42011333bd2bdd70f01371 100644 >--- a/Source/WebCore/testing/MockCDM.h >+++ b/Source/WebCore/testing/MockCDM.h >@@ -29,7 +29,6 @@ > #if ENABLE(ENCRYPTED_MEDIA_V2) > > #include "CDMPrivate.h" >-#include <wtf/PassOwnPtr.h> > > namespace WebCore { > >@@ -37,8 +36,12 @@ class CDM; > > class MockCDM : public CDMPrivateInterface { > public: >+ explicit MockCDM(CDM* cdm) >+ : m_cdm(cdm) >+ { } >+ > // CDMFactory support: >- static PassOwnPtr<CDMPrivateInterface> create(CDM* cdm) { return adoptPtr(new MockCDM(cdm)); } >+ static std::unique_ptr<CDMPrivateInterface> create(CDM* cdm) { return std::make_unique<MockCDM>(cdm); } > static bool supportsKeySystem(const String&); > static bool supportsKeySystemAndMimeType(const String& keySystem, const String& mimeType); > >@@ -48,7 +51,6 @@ public: > virtual std::unique_ptr<CDMSession> createSession() override; > > protected: >- MockCDM(CDM* cdm) : m_cdm(cdm) { } > CDM* m_cdm; > }; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 132467
:
230660
|
230661
|
230743
|
230784
|
230786