Changeset 239030 in webkit


Ignore:
Timestamp:
Dec 10, 2018 8:30:53 AM (5 years ago)
Author:
youenn@apple.com
Message:

MockLibWebRTCPeerConnectionFactory should isolate copy its test case
https://bugs.webkit.org/show_bug.cgi?id=192545

Reviewed by Eric Carlson.

Isolate copy the test case member so that it can be destroyed on another thread.
Covered by existing test that should no longer crash.

  • testing/MockLibWebRTCPeerConnection.cpp:

(WebCore::useMockRTCPeerConnectionFactory):
(WebCore::MockLibWebRTCPeerConnectionFactory::MockLibWebRTCPeerConnectionFactory):

  • testing/MockLibWebRTCPeerConnection.h:

(WebCore::MockLibWebRTCPeerConnectionFactory::create):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r239024 r239030  
     12018-12-10  Youenn Fablet  <youenn@apple.com>
     2
     3        MockLibWebRTCPeerConnectionFactory should isolate copy its test case
     4        https://bugs.webkit.org/show_bug.cgi?id=192545
     5
     6        Reviewed by Eric Carlson.
     7
     8        Isolate copy the test case member so that it can be destroyed on another thread.
     9        Covered by existing test that should no longer crash.
     10
     11        * testing/MockLibWebRTCPeerConnection.cpp:
     12        (WebCore::useMockRTCPeerConnectionFactory):
     13        (WebCore::MockLibWebRTCPeerConnectionFactory::MockLibWebRTCPeerConnectionFactory):
     14        * testing/MockLibWebRTCPeerConnection.h:
     15        (WebCore::MockLibWebRTCPeerConnectionFactory::create):
     16
    1172018-12-09  Youenn Fablet  <youenn@apple.com>
    218
  • trunk/Source/WebCore/testing/MockLibWebRTCPeerConnection.cpp

    r237568 r239030  
    6767        factory = provider->factory();
    6868    }
    69     provider->setPeerConnectionFactory(MockLibWebRTCPeerConnectionFactory::create(String(testCase)));
     69    provider->setPeerConnectionFactory(MockLibWebRTCPeerConnectionFactory::create(testCase));
    7070}
    7171
     
    168168};
    169169
    170 MockLibWebRTCPeerConnectionFactory::MockLibWebRTCPeerConnectionFactory(String&& testCase)
    171     : m_testCase(WTFMove(testCase))
     170MockLibWebRTCPeerConnectionFactory::MockLibWebRTCPeerConnectionFactory(const String& testCase)
     171    : m_testCase(testCase.isolatedCopy())
    172172{
    173173}
  • trunk/Source/WebCore/testing/MockLibWebRTCPeerConnection.h

    r237568 r239030  
    236236class MockLibWebRTCPeerConnectionFactory : public webrtc::PeerConnectionFactoryInterface {
    237237public:
    238     static rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> create(String&& testCase) { return new rtc::RefCountedObject<MockLibWebRTCPeerConnectionFactory>(WTFMove(testCase)); }
    239 
    240 protected:
    241     MockLibWebRTCPeerConnectionFactory(String&&);
     238    static rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> create(const String& testCase) { return new rtc::RefCountedObject<MockLibWebRTCPeerConnectionFactory>(testCase); }
     239
     240protected:
     241    explicit MockLibWebRTCPeerConnectionFactory(const String&);
    242242
    243243private:
Note: See TracChangeset for help on using the changeset viewer.