Changeset 217180 in webkit


Ignore:
Timestamp:
May 19, 2017 6:59:16 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

Add RTCPeerConnection connection state change logging
https://bugs.webkit.org/show_bug.cgi?id=172314

Patch by Youenn Fablet <youenn@apple.com> on 2017-05-19
Reviewed by Eric Carlson.

No change of behavior.
Adding some release logging of connection state changes.

  • Modules/mediastream/RTCPeerConnection.cpp:

(WebCore::rtcIceGatheringStateToString):
(WebCore::RTCPeerConnection::updateIceGatheringState):
(WebCore::rtcIceConnectionStateToString):
(WebCore::RTCPeerConnection::updateIceConnectionState):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r217176 r217180  
     12017-05-19  Youenn Fablet  <youenn@apple.com>
     2
     3        Add RTCPeerConnection connection state change logging
     4        https://bugs.webkit.org/show_bug.cgi?id=172314
     5
     6        Reviewed by Eric Carlson.
     7
     8        No change of behavior.
     9        Adding some release logging of connection state changes.
     10
     11        * Modules/mediastream/RTCPeerConnection.cpp:
     12        (WebCore::rtcIceGatheringStateToString):
     13        (WebCore::RTCPeerConnection::updateIceGatheringState):
     14        (WebCore::rtcIceConnectionStateToString):
     15        (WebCore::RTCPeerConnection::updateIceConnectionState):
     16
    1172017-05-19  Jeremy Jones  <jeremyj@apple.com>
    218
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp

    r217082 r217180  
    445445}
    446446
     447#if !RELEASE_LOG_DISABLED
     448static inline const char* rtcIceGatheringStateToString(RTCIceGatheringState newState)
     449{
     450    switch (newState) {
     451    case RTCIceGatheringState::New:
     452        return "new";
     453    case RTCIceGatheringState::Gathering:
     454        return "gathering";
     455    case RTCIceGatheringState::Complete:
     456        return "complete";
     457    }
     458}
     459#endif
     460
    447461void RTCPeerConnection::updateIceGatheringState(RTCIceGatheringState newState)
    448462{
     463    RELEASE_LOG(WebRTC, "New ICE gathering state: %s\n", rtcIceGatheringStateToString(newState));
     464
    449465    scriptExecutionContext()->postTask([protectedThis = makeRef(*this), newState](ScriptExecutionContext&) {
    450466        if (protectedThis->isClosed() || protectedThis->m_iceGatheringState == newState)
     
    457473}
    458474
     475#if !RELEASE_LOG_DISABLED
     476static inline const char* rtcIceConnectionStateToString(RTCIceConnectionState newState)
     477{
     478    switch (newState) {
     479    case RTCIceConnectionState::New:
     480        return "new";
     481    case RTCIceConnectionState::Checking:
     482        return "checking";
     483    case RTCIceConnectionState::Connected:
     484        return "connected";
     485    case RTCIceConnectionState::Completed:
     486        return "completed";
     487    case RTCIceConnectionState::Failed:
     488        return "failed";
     489    case RTCIceConnectionState::Disconnected:
     490        return "disconnected";
     491    case RTCIceConnectionState::Closed:
     492        return "closed";
     493    }
     494}
     495#endif
     496
    459497void RTCPeerConnection::updateIceConnectionState(RTCIceConnectionState newState)
    460498{
     499    RELEASE_LOG(WebRTC, "New ICE connection state: %s\n", rtcIceConnectionStateToString(newState));
     500
    461501    scriptExecutionContext()->postTask([protectedThis = makeRef(*this), newState](ScriptExecutionContext&) {
    462502        if (protectedThis->isClosed() || protectedThis->m_iceConnectionState == newState)
Note: See TracChangeset for help on using the changeset viewer.