| Differences between
and this patch
- a/Source/WebCore/ChangeLog +20 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2014-05-02  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2
3
        Convert OwnPtr to std::unique_ptr in CDM
4
        https://bugs.webkit.org/show_bug.cgi?id=132467
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Use std::unique_ptr in CDM class.
9
10
        No new tests, no behavior change.
11
12
        * Modules/encryptedmedia/CDM.cpp:
13
        (WebCore::CDM::create):
14
        * Modules/encryptedmedia/CDM.h:
15
        * Modules/encryptedmedia/CDMPrivate.h:
16
        * Modules/encryptedmedia/MediaKeys.cpp:
17
        (WebCore::MediaKeys::create):
18
        (WebCore::MediaKeys::MediaKeys):
19
        * Modules/encryptedmedia/MediaKeys.h:
20
1
2014-05-01  Myles C. Maxfield  <mmaxfield@apple.com>
21
2014-05-01  Myles C. Maxfield  <mmaxfield@apple.com>
2
22
3
        Migrate all uses of DeviceMotionController and DeviceOrientationController to std::unique_ptr
23
        Migrate all uses of DeviceMotionController and DeviceOrientationController to std::unique_ptr
- a/Source/WebCore/Modules/encryptedmedia/CDM.cpp -2 / +2 lines
Lines 94-105 bool CDM::keySystemSupportsMimeType(const String& keySystem, const String& mimeT a/Source/WebCore/Modules/encryptedmedia/CDM.cpp_sec1
94
    return false;
94
    return false;
95
}
95
}
96
96
97
PassOwnPtr<CDM> CDM::create(const String& keySystem)
97
std::unique_ptr<CDM> CDM::create(const String& keySystem)
98
{
98
{
99
    if (!supportsKeySystem(keySystem))
99
    if (!supportsKeySystem(keySystem))
100
        return nullptr;
100
        return nullptr;
101
101
102
    return adoptPtr(new CDM(keySystem));
102
    return std::make_unique<CDM>(keySystem);
103
}
103
}
104
104
105
CDM::CDM(const String& keySystem)
105
CDM::CDM(const String& keySystem)
- a/Source/WebCore/Modules/encryptedmedia/CDM.h -4 / +3 lines
Lines 53-63 public: a/Source/WebCore/Modules/encryptedmedia/CDM.h_sec1
53
53
54
class CDM {
54
class CDM {
55
public:
55
public:
56
    explicit CDM(const String& keySystem);
56
57
57
    enum CDMErrorCode { UnknownError = 1, ClientError, ServiceError, OutputError, HardwareChangeError, DomainError };
58
    enum CDMErrorCode { UnknownError = 1, ClientError, ServiceError, OutputError, HardwareChangeError, DomainError };
58
    static bool supportsKeySystem(const String&);
59
    static bool supportsKeySystem(const String&);
59
    static bool keySystemSupportsMimeType(const String& keySystem, const String& mimeType);
60
    static bool keySystemSupportsMimeType(const String& keySystem, const String& mimeType);
60
    static PassOwnPtr<CDM> create(const String& keySystem);
61
    static std::unique_ptr<CDM> create(const String& keySystem);
61
    static void registerCDMFactory(CreateCDM, CDMSupportsKeySystem, CDMSupportsKeySystemAndMimeType);
62
    static void registerCDMFactory(CreateCDM, CDMSupportsKeySystem, CDMSupportsKeySystemAndMimeType);
62
    ~CDM();
63
    ~CDM();
63
64
Lines 72-81 public: a/Source/WebCore/Modules/encryptedmedia/CDM.h_sec2
72
    MediaPlayer* mediaPlayer() const;
73
    MediaPlayer* mediaPlayer() const;
73
74
74
private:
75
private:
75
    CDM(const String& keySystem);
76
77
    String m_keySystem;
76
    String m_keySystem;
78
    OwnPtr<CDMPrivateInterface> m_private;
77
    std::unique_ptr<CDMPrivateInterface> m_private;
79
    CDMClient* m_client;
78
    CDMClient* m_client;
80
};
79
};
81
80
- a/Source/WebCore/Modules/encryptedmedia/CDMPrivate.h -1 lines
Lines 28-34 a/Source/WebCore/Modules/encryptedmedia/CDMPrivate.h_sec1
28
28
29
#if ENABLE(ENCRYPTED_MEDIA_V2)
29
#if ENABLE(ENCRYPTED_MEDIA_V2)
30
30
31
#include <wtf/OwnPtr.h>
32
#include <wtf/text/WTFString.h>
31
#include <wtf/text/WTFString.h>
33
32
34
namespace WebCore {
33
namespace WebCore {
- a/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp -3 / +3 lines
Lines 57-63 PassRefPtr<MediaKeys> MediaKeys::create(const String& keySystem, ExceptionCode& a/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp_sec1
57
57
58
    // 3. Let cdm be the content decryption module corresponding to keySystem.
58
    // 3. Let cdm be the content decryption module corresponding to keySystem.
59
    // 4. Load cdm if necessary.
59
    // 4. Load cdm if necessary.
60
    OwnPtr<CDM> cdm = CDM::create(keySystem);
60
    std::unique_ptr<CDM> cdm = CDM::create(keySystem);
61
61
62
    // 5. Create a new MediaKeys object.
62
    // 5. Create a new MediaKeys object.
63
    // 5.1 Let the keySystem attribute be keySystem.
63
    // 5.1 Let the keySystem attribute be keySystem.
Lines 65-74 PassRefPtr<MediaKeys> MediaKeys::create(const String& keySystem, ExceptionCode& a/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp_sec2
65
    return adoptRef(new MediaKeys(keySystem, cdm.release()));
65
    return adoptRef(new MediaKeys(keySystem, cdm.release()));
66
}
66
}
67
67
68
MediaKeys::MediaKeys(const String& keySystem, PassOwnPtr<CDM> cdm)
68
MediaKeys::MediaKeys(const String& keySystem, std::unique_ptr<CDM> cdm)
69
    : m_mediaElement(0)
69
    : m_mediaElement(0)
70
    , m_keySystem(keySystem)
70
    , m_keySystem(keySystem)
71
    , m_cdm(cdm)
71
    , m_cdm(std::move(cdm))
72
{
72
{
73
    m_cdm->setClient(this);
73
    m_cdm->setClient(this);
74
}
74
}
- a/Source/WebCore/Modules/encryptedmedia/MediaKeys.h -2 / +1 lines
Lines 32-38 a/Source/WebCore/Modules/encryptedmedia/MediaKeys.h_sec1
32
#include "EventTarget.h"
32
#include "EventTarget.h"
33
#include "ExceptionCode.h"
33
#include "ExceptionCode.h"
34
#include <runtime/Uint8Array.h>
34
#include <runtime/Uint8Array.h>
35
#include <wtf/OwnPtr.h>
36
#include <wtf/PassRefPtr.h>
35
#include <wtf/PassRefPtr.h>
37
#include <wtf/RefCounted.h>
36
#include <wtf/RefCounted.h>
38
#include <wtf/Vector.h>
37
#include <wtf/Vector.h>
Lines 68-74 protected: a/Source/WebCore/Modules/encryptedmedia/MediaKeys.h_sec2
68
67
69
    HTMLMediaElement* m_mediaElement;
68
    HTMLMediaElement* m_mediaElement;
70
    String m_keySystem;
69
    String m_keySystem;
71
    OwnPtr<CDM> m_cdm;
70
    std::unique_ptr<CDM> m_cdm;
72
};
71
};
73
72
74
}
73
}

Return to Bug 132467