Changeset 111876 in webkit


Ignore:
Timestamp:
Mar 23, 2012 10:16:06 AM (12 years ago)
Author:
tommyw@google.com
Message:

MediaStream API (JSEP): Introducing PeerConnection00 and IceCallback
https://bugs.webkit.org/show_bug.cgi?id=81657

Reviewed by Adam Barth.

Last major WebCore patch for the JSEP PeerConnection, together with the associated
IceCallback (they both depend on each other and IceCallback has very few lines of real code).

My next patch after this one will do a major overhaul of the existing layout tests
and add a few new ones.

  • GNUmakefile.list.am:
  • Modules/mediastream/DOMWindowMediaStream.idl:
  • Modules/mediastream/IceCallback.h: Added.

(WebCore):
(IceCallback):
(WebCore::IceCallback::~IceCallback):

  • Modules/mediastream/IceCallback.idl: Added.
  • Modules/mediastream/PeerConnection00.cpp: Added.

(WebCore):
(WebCore::PeerConnection00::create):
(WebCore::PeerConnection00::PeerConnection00):
(WebCore::PeerConnection00::~PeerConnection00):
(WebCore::PeerConnection00::hasLocalAudioTrack):
(WebCore::PeerConnection00::hasLocalVideoTrack):
(WebCore::PeerConnection00::parseMediaHints):
(WebCore::PeerConnection00::createOffer):
(WebCore::PeerConnection00::createAnswer):
(WebCore::PeerConnection00::setLocalDescription):
(WebCore::PeerConnection00::setRemoteDescription):
(WebCore::PeerConnection00::localDescription):
(WebCore::PeerConnection00::remoteDescription):
(WebCore::PeerConnection00::startIce):
(WebCore::PeerConnection00::processIceMessage):
(WebCore::PeerConnection00::readyState):
(WebCore::PeerConnection00::iceState):
(WebCore::PeerConnection00::addStream):
(WebCore::PeerConnection00::removeStream):
(WebCore::PeerConnection00::localStreams):
(WebCore::PeerConnection00::remoteStreams):
(WebCore::PeerConnection00::close):
(WebCore::PeerConnection00::didGenerateIceCandidate):
(WebCore::PeerConnection00::didChangeReadyState):
(WebCore::PeerConnection00::didChangeIceState):
(WebCore::PeerConnection00::didAddRemoteStream):
(WebCore::PeerConnection00::didRemoveRemoteStream):
(WebCore::PeerConnection00::interfaceName):
(WebCore::PeerConnection00::scriptExecutionContext):
(WebCore::PeerConnection00::stop):
(WebCore::PeerConnection00::eventTargetData):
(WebCore::PeerConnection00::ensureEventTargetData):
(WebCore::PeerConnection00::changeReadyState):
(WebCore::PeerConnection00::changeIceState):

  • Modules/mediastream/PeerConnection00.h: Added.

(WebCore):
(PeerConnection00):
(WebCore::PeerConnection00::refEventTarget):
(WebCore::PeerConnection00::derefEventTarget):

  • Modules/mediastream/PeerConnection00.idl: Added.
  • WebCore.gypi:
  • bindings/generic/RuntimeEnabledFeatures.h:

(WebCore::RuntimeEnabledFeatures::webkitPeerConnection00Enabled):

  • bindings/js/JSPeerConnection00Custom.cpp: Added.

(WebCore):
(WebCore::JSPeerConnection00Constructor::constructJSPeerConnection00):

  • dom/EventTargetFactory.in:
Location:
trunk/Source/WebCore
Files:
4 added
7 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r111875 r111876  
     12012-03-23  Tommy Widenflycht  <tommyw@google.com>
     2
     3        MediaStream API (JSEP): Introducing PeerConnection00 and IceCallback
     4        https://bugs.webkit.org/show_bug.cgi?id=81657
     5
     6        Reviewed by Adam Barth.
     7
     8        Last major WebCore patch for the JSEP PeerConnection, together with the associated
     9        IceCallback (they both depend on each other and IceCallback has very few lines of real code).
     10
     11        My next patch after this one will do a major overhaul of the existing layout tests
     12        and add a few new ones.
     13
     14        * GNUmakefile.list.am:
     15        * Modules/mediastream/DOMWindowMediaStream.idl:
     16        * Modules/mediastream/IceCallback.h: Added.
     17        (WebCore):
     18        (IceCallback):
     19        (WebCore::IceCallback::~IceCallback):
     20        * Modules/mediastream/IceCallback.idl: Added.
     21        * Modules/mediastream/PeerConnection00.cpp: Added.
     22        (WebCore):
     23        (WebCore::PeerConnection00::create):
     24        (WebCore::PeerConnection00::PeerConnection00):
     25        (WebCore::PeerConnection00::~PeerConnection00):
     26        (WebCore::PeerConnection00::hasLocalAudioTrack):
     27        (WebCore::PeerConnection00::hasLocalVideoTrack):
     28        (WebCore::PeerConnection00::parseMediaHints):
     29        (WebCore::PeerConnection00::createOffer):
     30        (WebCore::PeerConnection00::createAnswer):
     31        (WebCore::PeerConnection00::setLocalDescription):
     32        (WebCore::PeerConnection00::setRemoteDescription):
     33        (WebCore::PeerConnection00::localDescription):
     34        (WebCore::PeerConnection00::remoteDescription):
     35        (WebCore::PeerConnection00::startIce):
     36        (WebCore::PeerConnection00::processIceMessage):
     37        (WebCore::PeerConnection00::readyState):
     38        (WebCore::PeerConnection00::iceState):
     39        (WebCore::PeerConnection00::addStream):
     40        (WebCore::PeerConnection00::removeStream):
     41        (WebCore::PeerConnection00::localStreams):
     42        (WebCore::PeerConnection00::remoteStreams):
     43        (WebCore::PeerConnection00::close):
     44        (WebCore::PeerConnection00::didGenerateIceCandidate):
     45        (WebCore::PeerConnection00::didChangeReadyState):
     46        (WebCore::PeerConnection00::didChangeIceState):
     47        (WebCore::PeerConnection00::didAddRemoteStream):
     48        (WebCore::PeerConnection00::didRemoveRemoteStream):
     49        (WebCore::PeerConnection00::interfaceName):
     50        (WebCore::PeerConnection00::scriptExecutionContext):
     51        (WebCore::PeerConnection00::stop):
     52        (WebCore::PeerConnection00::eventTargetData):
     53        (WebCore::PeerConnection00::ensureEventTargetData):
     54        (WebCore::PeerConnection00::changeReadyState):
     55        (WebCore::PeerConnection00::changeIceState):
     56        * Modules/mediastream/PeerConnection00.h: Added.
     57        (WebCore):
     58        (PeerConnection00):
     59        (WebCore::PeerConnection00::refEventTarget):
     60        (WebCore::PeerConnection00::derefEventTarget):
     61        * Modules/mediastream/PeerConnection00.idl: Added.
     62        * WebCore.gypi:
     63        * bindings/generic/RuntimeEnabledFeatures.h:
     64        (WebCore::RuntimeEnabledFeatures::webkitPeerConnection00Enabled):
     65        * bindings/js/JSPeerConnection00Custom.cpp: Added.
     66        (WebCore):
     67        (WebCore::JSPeerConnection00Constructor::constructJSPeerConnection00):
     68        * dom/EventTargetFactory.in:
     69
    1702012-03-23  Adrienne Walker  <enne@google.com>
    271
  • trunk/Source/WebCore/GNUmakefile.list.am

    r111832 r111876  
    345345        DerivedSources/WebCore/JSHTMLVideoElement.cpp \
    346346        DerivedSources/WebCore/JSHTMLVideoElement.h \
     347        DerivedSources/WebCore/JSIceCallback.cpp \
     348        DerivedSources/WebCore/JSIceCallback.h \
    347349        DerivedSources/WebCore/JSIceCandidate.cpp \
    348350        DerivedSources/WebCore/JSIceCandidate.h \
     
    437439        DerivedSources/WebCore/JSPageTransitionEvent.cpp \
    438440        DerivedSources/WebCore/JSPageTransitionEvent.h \
     441        DerivedSources/WebCore/JSPeerConnection00.cpp \
     442        DerivedSources/WebCore/JSPeerConnection00.h \
    439443        DerivedSources/WebCore/JSPerformance.cpp \
    440444        DerivedSources/WebCore/JSPerformance.h \
     
    665669        $(WebCore)/Modules/mediastream/DeprecatedPeerConnection.idl \
    666670        $(WebCore)/Modules/mediastream/DOMWindowMediaStream.idl \
     671        $(WebCore)/Modules/mediastream/IceCallback.idl \
    667672        $(WebCore)/Modules/mediastream/IceCandidate.idl \
    668673        $(WebCore)/Modules/mediastream/LocalMediaStream.idl \
     
    676681        $(WebCore)/Modules/mediastream/NavigatorUserMediaErrorCallback.idl \
    677682        $(WebCore)/Modules/mediastream/NavigatorUserMediaSuccessCallback.idl \
     683        $(WebCore)/Modules/mediastream/PeerConnection00.idl \
    678684        $(WebCore)/Modules/mediastream/SessionDescription.idl \
    679685        $(WebCore)/Modules/mediastream/SignalingCallback.idl \
     
    10981104        Source/WebCore/Modules/mediastream/DeprecatedPeerConnection.cpp \
    10991105        Source/WebCore/Modules/mediastream/DeprecatedPeerConnection.h \
     1106        Source/WebCore/Modules/mediastream/IceCallback.h \
    11001107        Source/WebCore/Modules/mediastream/IceCandidate.cpp \
    11011108        Source/WebCore/Modules/mediastream/IceCandidate.h \
     
    11191126        Source/WebCore/Modules/mediastream/NavigatorUserMediaErrorCallback.h \
    11201127        Source/WebCore/Modules/mediastream/NavigatorUserMediaSuccessCallback.h \
     1128        Source/WebCore/Modules/mediastream/PeerConnection00.cpp \
     1129        Source/WebCore/Modules/mediastream/PeerConnection00.h \
    11211130        Source/WebCore/Modules/mediastream/SessionDescription.cpp \
    11221131        Source/WebCore/Modules/mediastream/SessionDescription.h \
  • trunk/Source/WebCore/Modules/mediastream/DOMWindowMediaStream.idl

    r111558 r111876  
    11/*
    22 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
    3  * Copyright (C) 2011 Google Inc. All rights reserved.
     3 * Copyright (C) 2012 Google Inc. All rights reserved.
    44 *
    55 * Redistribution and use in source and binary forms, with or without
     
    3333        attribute [V8EnabledAtRuntime] DeprecatedPeerConnectionConstructor webkitDeprecatedPeerConnection;
    3434        attribute [V8EnabledAtRuntime] MediaStreamConstructor webkitMediaStream;
     35        attribute [V8EnabledAtRuntime] PeerConnection00Constructor webkitPeerConnection00;
     36        attribute SessionDescriptionConstructor SessionDescription;
     37        attribute IceCandidateConstructor IceCandidate;
    3538        attribute MediaStreamEventConstructor MediaStreamEvent;
    3639    };
  • trunk/Source/WebCore/Modules/mediastream/IceCallback.h

    r111875 r111876  
    2929 */
    3030
    31 #include "config.h"
     31#ifndef IceCallback_h
     32#define IceCallback_h
    3233
    3334#if ENABLE(MEDIA_STREAM)
    3435
    35 #include "SessionDescription.h"
    36 
    37 #include "IceCandidate.h"
    38 #include "IceCandidateDescriptor.h"
    39 #include "MediaStreamCenter.h"
    40 #include "SessionDescriptionDescriptor.h"
     36#include <wtf/RefCounted.h>
    4137
    4238namespace WebCore {
    4339
    44 PassRefPtr<SessionDescription> SessionDescription::create(const String& sdp)
    45 {
    46     return adoptRef(new SessionDescription(SessionDescriptionDescriptor::create(sdp)));
    47 }
     40class IceCandidate;
     41class PeerConnection00;
    4842
    49 PassRefPtr<SessionDescription> SessionDescription::create(PassRefPtr<SessionDescriptionDescriptor> descriptor)
    50 {
    51     return adoptRef(new SessionDescription(descriptor));
    52 }
    53 
    54 SessionDescription::SessionDescription(PassRefPtr<SessionDescriptionDescriptor> descriptor)
    55     : m_descriptor(descriptor)
    56 {
    57 }
    58 
    59 SessionDescription::~SessionDescription()
    60 {
    61 }
    62 
    63 void SessionDescription::addCandidate(PassRefPtr<IceCandidate> candidate)
    64 {
    65     m_descriptor->addCandidate(candidate->descriptor());
    66 }
    67 
    68 String SessionDescription::toSdp()
    69 {
    70     return m_descriptor->toSDP();
    71 }
    72 
    73 SessionDescriptionDescriptor* SessionDescription::descriptor()
    74 {
    75     return m_descriptor.get();
    76 }
     43class IceCallback : public RefCounted<IceCallback> {
     44public:
     45    virtual ~IceCallback() { }
     46    virtual bool handleEvent(IceCandidate*, bool moreToFollow, PeerConnection00*) = 0;
     47};
    7748
    7849} // namespace WebCore
    7950
    8051#endif // ENABLE(MEDIA_STREAM)
     52
     53#endif // IceCallback_h
  • trunk/Source/WebCore/Modules/mediastream/SessionDescription.cpp

    r111577 r111876  
    4949PassRefPtr<SessionDescription> SessionDescription::create(PassRefPtr<SessionDescriptionDescriptor> descriptor)
    5050{
     51    ASSERT(!!descriptor);
    5152    return adoptRef(new SessionDescription(descriptor));
    5253}
  • trunk/Source/WebCore/WebCore.gypi

    r111832 r111876  
    791791            'Modules/mediastream/DeprecatedPeerConnection.idl',
    792792            'Modules/mediastream/DOMWindowMediaStream.idl',
     793            'Modules/mediastream/IceCallback.idl',
    793794            'Modules/mediastream/IceCandidate.idl',
    794795            'Modules/mediastream/LocalMediaStream.idl',
     
    802803            'Modules/mediastream/NavigatorUserMediaErrorCallback.idl',
    803804            'Modules/mediastream/NavigatorUserMediaSuccessCallback.idl',
     805            'Modules/mediastream/PeerConnection00.idl',
    804806            'Modules/mediastream/SessionDescription.idl',
    805807            'Modules/mediastream/SignalingCallback.idl',
     
    14601462            'Modules/mediastream/DeprecatedPeerConnection.cpp',
    14611463            'Modules/mediastream/DeprecatedPeerConnection.h',
     1464            'Modules/mediastream/IceCallback.h',
    14621465            'Modules/mediastream/IceCandidate.cpp',
    14631466            'Modules/mediastream/IceCandidate.h',
     
    14811484            'Modules/mediastream/NavigatorUserMediaErrorCallback.h',
    14821485            'Modules/mediastream/NavigatorUserMediaSuccessCallback.h',
     1486            'Modules/mediastream/PeerConnection00.cpp',
     1487            'Modules/mediastream/PeerConnection00.h',
    14831488            'Modules/mediastream/SessionDescription.cpp',
    14841489            'Modules/mediastream/SessionDescription.h',
  • trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h

    r111558 r111876  
    188188    static bool webkitDeprecatedPeerConnectionEnabled() { return isMediaStreamEnabled; }
    189189    static bool webkitMediaStreamEnabled() { return isMediaStreamEnabled; }
     190    static bool webkitPeerConnection00Enabled() { return isMediaStreamEnabled; }
    190191#endif
    191192
  • trunk/Source/WebCore/dom/EventTargetFactory.in

    r110991 r111876  
    2121Node
    2222Notification conditional=NOTIFICATIONS|LEGACY_NOTIFICATIONS
     23PeerConnection00 conditional=MEDIA_STREAM
    2324SharedWorker conditional=SHARED_WORKERS
    2425SharedWorkerContext conditional=SHARED_WORKERS
Note: See TracChangeset for help on using the changeset viewer.