Changeset 190061 in webkit


Ignore:
Timestamp:
Sep 21, 2015 11:03:25 AM (9 years ago)
Author:
timothy_horton@apple.com
Message:

UserMediaClientMock leaks every test run
https://bugs.webkit.org/show_bug.cgi?id=149358

Reviewed by Eric Carlson.

  • Modules/mediastream/UserMediaController.cpp:

(WebCore::provideUserMediaTo):
Make provideUserMediaTo operate unconditionally, just like all of the
other similar functions, reverting r165733.

  • Modules/mediastream/UserMediaController.h:
  • testing/Internals.cpp:

(WebCore::Internals::Internals):
Remove the existing UserMediaController supplement before installing a new one.
This way, we're replacing it with the one Internals is trying to install,
instead of leaking UserMediaClientMocks.

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r190059 r190061  
     12015-09-21  Tim Horton  <timothy_horton@apple.com>
     2
     3        UserMediaClientMock leaks every test run
     4        https://bugs.webkit.org/show_bug.cgi?id=149358
     5
     6        Reviewed by Eric Carlson.
     7
     8        * Modules/mediastream/UserMediaController.cpp:
     9        (WebCore::provideUserMediaTo):
     10        Make provideUserMediaTo operate unconditionally, just like all of the
     11        other similar functions, reverting r165733.
     12
     13        * Modules/mediastream/UserMediaController.h:
     14        * testing/Internals.cpp:
     15        (WebCore::Internals::Internals):
     16        Remove the existing UserMediaController supplement before installing a new one.
     17        This way, we're replacing it with the one Internals is trying to install,
     18        instead of leaking UserMediaClientMocks.
     19
    1202015-09-21  Alex Christensen  <achristensen@webkit.org>
    221
  • trunk/Source/WebCore/Modules/mediastream/UserMediaController.cpp

    r168144 r190061  
    4747void provideUserMediaTo(Page* page, UserMediaClient* client)
    4848{
    49     if (!Supplement<Page>::from(page, UserMediaController::supplementName()))
    50         UserMediaController::provideTo(page, UserMediaController::supplementName(), std::make_unique<UserMediaController>(client));
     49    UserMediaController::provideTo(page, UserMediaController::supplementName(), std::make_unique<UserMediaController>(client));
    5150}
    5251
  • trunk/Source/WebCore/Modules/mediastream/UserMediaController.h

    r177259 r190061  
    4343    void cancelRequest(UserMediaRequest&);
    4444
    45     static const char* supplementName();
     45    WEBCORE_EXPORT static const char* supplementName();
    4646    static UserMediaController* from(Page* page) { return static_cast<UserMediaController*>(Supplement<Page>::from(page, supplementName())); }
    4747
  • trunk/Source/WebCore/testing/Internals.cpp

    r190009 r190061  
    113113#include "TreeScope.h"
    114114#include "TypeConversions.h"
     115#include "UserMediaController.h"
    115116#include "ViewportArguments.h"
    116117#include "WebConsoleAgent.h"
     
    386387    MockRealtimeMediaSourceCenter::registerMockRealtimeMediaSourceCenter();
    387388    enableMockRTCPeerConnectionHandler();
     389    document->page()->removeSupplement(UserMediaController::supplementName());
    388390    WebCore::provideUserMediaTo(document->page(), new UserMediaClientMock());
    389391#endif
Note: See TracChangeset for help on using the changeset viewer.