Source/Platform/ChangeLog

 12012-05-03 Tommy Widenflycht <tommyw@google.com>
 2
 3 MediaStream API: Make PeerConnection00's API fully compliant with the draft
 4 https://bugs.webkit.org/show_bug.cgi?id=85491
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * chromium/public/WebPeerConnection00HandlerClient.h:
 9
1102012-05-02 Dana Jansens <danakj@chromium.org>
211
312 [chromium] Don't occlude pixels in a surface that are needed for a background filter blur

Source/WebCore/ChangeLog

 12012-05-03 Tommy Widenflycht <tommyw@google.com>
 2
 3 MediaStream API: Make PeerConnection00's API fully compliant with the draft
 4 https://bugs.webkit.org/show_bug.cgi?id=85491
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Mainly making the relevant API's use objects (aka Dictionaries) instead of the temporary strings,
 9 but also making a few API's exception aware and changing the name of a flag.
 10
 11 Existing tests modified.
 12
 13 * Modules/mediastream/PeerConnection00.cpp:
 14 (WebCore::PeerConnection00::createMediaHints):
 15 (WebCore::PeerConnection00::createOffer):
 16 (WebCore):
 17 (WebCore::PeerConnection00::createAnswer):
 18 (WebCore::PeerConnection00::createIceOptions):
 19 (WebCore::PeerConnection00::startIce):
 20 (WebCore::PeerConnection00::addStream):
 21 (WebCore::PeerConnection00::changeReadyState):
 22 * Modules/mediastream/PeerConnection00.h:
 23 (WebCore):
 24 (PeerConnection00):
 25 * Modules/mediastream/PeerConnection00.idl:
 26
1272012-05-03 Ilya Tikhonovsky <loislo@chromium.org>
228
329 Web Inspector: compile time ambiguity happens when I try to assign a TypeBuilder object to an out argument.

Source/WebKit/chromium/ChangeLog

 12012-05-03 Tommy Widenflycht <tommyw@google.com>
 2
 3 MediaStream API: Make PeerConnection00's API fully compliant with the draft
 4 https://bugs.webkit.org/show_bug.cgi?id=85491
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * src/AssertMatchingEnums.cpp:
 9
1102012-05-03 Dana Jansens <danakj@chromium.org>
211
312 [chromium] Don't add small opaque areas to the occlusion tracker's Region

Source/Platform/chromium/public/WebPeerConnection00HandlerClient.h

@@class WebPeerConnection00HandlerClient {
4040public:
4141 enum ReadyState {
4242 ReadyStateNew = 0,
43  ReadyStateNegotiating = 1,
 43 ReadyStateOpening = 1,
4444 ReadyStateActive = 2,
45  ReadyStateClosed = 3
 45 ReadyStateClosed = 3,
 46
 47 // DEPRECATED
 48 ReadyStateNegotiating = 1,
4649 };
4750
4851 enum ICEState {

Source/WebCore/Modules/mediastream/PeerConnection00.cpp

@@bool PeerConnection00::hasLocalVideoTrack()
9191 return false;
9292}
9393
94 PassRefPtr<MediaHints> PeerConnection00::parseMediaHints(const String& mediaHints)
 94PassRefPtr<MediaHints> PeerConnection00::createMediaHints(const Dictionary& dictionary)
9595{
96  Vector<String> hintsList;
97  mediaHints.split(",", hintsList);
9896 bool audio = hasLocalAudioTrack();
9997 bool video = hasLocalVideoTrack();
100  for (Vector<String>::iterator i = hintsList.begin(); i != hintsList.end(); ++i) {
101  if (*i == "audio")
102  audio = true;
103  else if (*i == "no_audio")
104  audio = false;
105  else if (*i == "video")
106  video = true;
107  else if (*i == "no_video")
108  video = false;
109  }
 98 dictionary.get("has_audio", audio);
 99 dictionary.get("has_video", audio);
 100 return MediaHints::create(audio, video);
 101}
110102
 103PassRefPtr<MediaHints> PeerConnection00::createMediaHints()
 104{
 105 bool audio = hasLocalAudioTrack();
 106 bool video = hasLocalVideoTrack();
111107 return MediaHints::create(audio, video);
112108}
113109
114 PassRefPtr<SessionDescription> PeerConnection00::createOffer()
 110PassRefPtr<SessionDescription> PeerConnection00::createOffer(ExceptionCode& ec)
115111{
116  return createOffer("");
 112 return createOffer(createMediaHints(), ec);
117113}
118114
119 PassRefPtr<SessionDescription> PeerConnection00::createOffer(const String& mediaHintsString)
 115PassRefPtr<SessionDescription> PeerConnection00::createOffer(const Dictionary& dictionary, ExceptionCode& ec)
120116{
121  RefPtr<MediaHints> mediaHints = parseMediaHints(mediaHintsString);
122  RefPtr<SessionDescriptionDescriptor> descriptor = m_peerHandler->createOffer(mediaHints.release());
123  if (!descriptor)
 117 return createOffer(createMediaHints(dictionary), ec);
 118}
 119
 120PassRefPtr<SessionDescription> PeerConnection00::createOffer(PassRefPtr<MediaHints> mediaHints, ExceptionCode& ec)
 121{
 122 RefPtr<SessionDescriptionDescriptor> descriptor = m_peerHandler->createOffer(mediaHints);
 123 if (!descriptor) {
 124 ec = SYNTAX_ERR;
124125 return 0;
 126 }
125127
126128 return SessionDescription::create(descriptor.release());
127129}
128130
129 PassRefPtr<SessionDescription> PeerConnection00::createAnswer(const String& offer)
 131PassRefPtr<SessionDescription> PeerConnection00::createAnswer(const String& offer, ExceptionCode& ec)
130132{
131  return createAnswer(offer, "");
 133 return createAnswer(offer, createMediaHints(), ec);
132134}
133135
134 PassRefPtr<SessionDescription> PeerConnection00::createAnswer(const String& offer, const String& mediaHintsString)
 136PassRefPtr<SessionDescription> PeerConnection00::createAnswer(const String& offer, const Dictionary& dictionary, ExceptionCode& ec)
135137{
136  RefPtr<MediaHints> mediaHints = parseMediaHints(mediaHintsString);
137  RefPtr<SessionDescriptionDescriptor> descriptor = m_peerHandler->createAnswer(offer, mediaHints.release());
138  if (!descriptor)
 138 return createAnswer(offer, createMediaHints(dictionary), ec);
 139}
 140
 141PassRefPtr<SessionDescription> PeerConnection00::createAnswer(const String& offer, PassRefPtr<MediaHints> hints, ExceptionCode& ec)
 142{
 143 RefPtr<SessionDescriptionDescriptor> descriptor = m_peerHandler->createAnswer(offer, hints);
 144 if (!descriptor) {
 145 ec = SYNTAX_ERR;
139146 return 0;
 147 }
140148
141149 return SessionDescription::create(descriptor.release());
142150}

@@PassRefPtr<SessionDescription> PeerConnection00::remoteDescription()
215223 return desc.release();
216224}
217225
218 void PeerConnection00::startIce(ExceptionCode& ec)
 226PassRefPtr<IceOptions> PeerConnection00::createIceOptions(const Dictionary& dictionary, ExceptionCode& ec)
219227{
220  startIce("", ec);
221 }
222 
223 void PeerConnection00::startIce(const String& options, ExceptionCode& ec)
224 {
225  if (m_readyState == CLOSED) {
226  ec = INVALID_STATE_ERR;
227  return;
228  }
 228 String useCandidates;
 229 dictionary.get("use_candidates", useCandidates);
229230
230231 IceOptions::UseCandidatesOption option;
231 
232  if (options == "" || options == "all")
 232 if (useCandidates == "" || useCandidates == "all")
233233 option = IceOptions::ALL;
234  else if (options == "no_relay")
 234 else if (useCandidates == "no_relay")
235235 option = IceOptions::NO_RELAY;
236  else if (options == "only_relay")
 236 else if (useCandidates == "only_relay")
237237 option = IceOptions::ONLY_RELAY;
238238 else {
239239 ec = TYPE_MISMATCH_ERR;
 240 return 0;
 241 }
 242
 243 return IceOptions::create(option);
 244}
 245
 246PassRefPtr<IceOptions> PeerConnection00::createIceOptions()
 247{
 248 return IceOptions::create(IceOptions::ALL);
 249}
 250
 251void PeerConnection00::startIce(ExceptionCode& ec)
 252{
 253 startIce(createIceOptions(), ec);
 254}
 255
 256void PeerConnection00::startIce(const Dictionary& dictionary, ExceptionCode& ec)
 257{
 258 RefPtr<IceOptions> iceOptions = createIceOptions(dictionary, ec);
 259 if (!ec)
 260 return;
 261
 262 startIce(iceOptions.release(), ec);
 263}
 264
 265void PeerConnection00::startIce(PassRefPtr<IceOptions> iceOptions, ExceptionCode& ec)
 266{
 267 if (m_readyState == CLOSED) {
 268 ec = INVALID_STATE_ERR;
240269 return;
241270 }
242271
243  bool valid = m_peerHandler->startIce(IceOptions::create(option));
 272 bool valid = m_peerHandler->startIce(iceOptions);
244273 if (!valid)
245274 ec = SYNTAX_ERR;
246275}

@@PeerConnection00::IceState PeerConnection00::iceState() const
273302 return m_iceState;
274303}
275304
276 void PeerConnection00::addStream(PassRefPtr<MediaStream> stream, ExceptionCode& ec)
277 {
278  String emptyHints;
279  return addStream(stream, emptyHints, ec);
280 }
281 
282 void PeerConnection00::addStream(PassRefPtr<MediaStream> prpStream, const String& mediaStreamHints, ExceptionCode& ec)
 305void PeerConnection00::addStream(PassRefPtr<MediaStream> prpStream, ExceptionCode& ec)
283306{
284307 RefPtr<MediaStream> stream = prpStream;
285308 if (!stream) {

@@void PeerConnection00::addStream(PassRefPtr<MediaStream> prpStream, const String
297320
298321 m_localStreams->append(stream);
299322
300  // FIXME: When the spec says what the mediaStreamHints should look like send it down.
301323 m_peerHandler->addStream(stream->descriptor());
302324}
303325
 326void PeerConnection00::addStream(PassRefPtr<MediaStream> stream, const Dictionary& mediaStreamHints, ExceptionCode& ec)
 327{
 328 // FIXME: When the spec says what the mediaStreamHints should look like use it.
 329 addStream(stream, ec);
 330}
 331
304332void PeerConnection00::removeStream(MediaStream* stream, ExceptionCode& ec)
305333{
306334 if (m_readyState == CLOSED) {

@@void PeerConnection00::changeReadyState(ReadyState readyState)
435463 m_readyState = readyState;
436464
437465 switch (m_readyState) {
438  case NEGOTIATING:
 466 case OPENING:
439467 dispatchEvent(Event::create(eventNames().connectingEvent, false, false));
440468 break;
441469 case ACTIVE:

Source/WebCore/Modules/mediastream/PeerConnection00.h

3434#if ENABLE(MEDIA_STREAM)
3535
3636#include "ActiveDOMObject.h"
 37#include "Dictionary.h"
3738#include "EventTarget.h"
3839#include "ExceptionBase.h"
3940#include "IceCallback.h"

4950namespace WebCore {
5051
5152class MediaHints;
 53class IceOptions;
5254
5355// Note:
5456// SDP stands for Session Description Protocol, which is intended for describing

@@class PeerConnection00 : public RefCounted<PeerConnection00>, public PeerConnect
6365public:
6466 enum ReadyState {
6567 NEW = 0,
66  NEGOTIATING = 1,
 68 OPENING = 1,
6769 ACTIVE = 2,
6870 CLOSED = 3
6971 };

@@public:
8789 static PassRefPtr<PeerConnection00> create(ScriptExecutionContext*, const String& serverConfiguration, PassRefPtr<IceCallback>);
8890 ~PeerConnection00();
8991
90  PassRefPtr<SessionDescription> createOffer();
91  PassRefPtr<SessionDescription> createOffer(const String& mediaHints);
92  PassRefPtr<SessionDescription> createAnswer(const String& offer);
93  PassRefPtr<SessionDescription> createAnswer(const String& offer, const String& mediaHints);
 92 PassRefPtr<SessionDescription> createOffer(ExceptionCode&);
 93 PassRefPtr<SessionDescription> createOffer(const Dictionary& mediaHints, ExceptionCode&);
 94 PassRefPtr<SessionDescription> createAnswer(const String& offer, ExceptionCode&);
 95 PassRefPtr<SessionDescription> createAnswer(const String& offer, const Dictionary& mediaHints, ExceptionCode&);
9496
9597 void setLocalDescription(int action, PassRefPtr<SessionDescription>, ExceptionCode&);
9698 void setRemoteDescription(int action, PassRefPtr<SessionDescription>, ExceptionCode&);

@@public:
98100 PassRefPtr<SessionDescription> remoteDescription();
99101
100102 void startIce(ExceptionCode&);
101  void startIce(const String& options, ExceptionCode&);
 103 void startIce(const Dictionary& iceOptions, ExceptionCode&);
102104 void processIceMessage(PassRefPtr<IceCandidate>, ExceptionCode&);
103105
104106 IceState iceState() const;
105107 ReadyState readyState() const;
106108
107109 void addStream(const PassRefPtr<MediaStream>, ExceptionCode&);
108  void addStream(const PassRefPtr<MediaStream>, const String& mediaStreamHints, ExceptionCode&);
 110 void addStream(const PassRefPtr<MediaStream>, const Dictionary& mediaStreamHints, ExceptionCode&);
109111 void removeStream(MediaStream*, ExceptionCode&);
110112 MediaStreamList* localStreams() const;
111113 MediaStreamList* remoteStreams() const;

@@private:
147149
148150 void changeReadyState(ReadyState);
149151 void changeIceState(IceState);
 152
150153 bool hasLocalAudioTrack();
151154 bool hasLocalVideoTrack();
152  PassRefPtr<MediaHints> parseMediaHints(const String& mediaHintsString);
 155 PassRefPtr<MediaHints> createMediaHints(const Dictionary&);
 156 PassRefPtr<MediaHints> createMediaHints();
 157 PassRefPtr<IceOptions> createIceOptions(const Dictionary&, ExceptionCode&);
 158 PassRefPtr<IceOptions> createIceOptions();
 159 PassRefPtr<SessionDescription> createOffer(PassRefPtr<MediaHints>, ExceptionCode&);
 160 PassRefPtr<SessionDescription> createAnswer(const String& offer, PassRefPtr<MediaHints>, ExceptionCode&);
 161 void startIce(PassRefPtr<IceOptions>, ExceptionCode&);
153162
154163 RefPtr<IceCallback> m_iceCallback;
155164

Source/WebCore/Modules/mediastream/PeerConnection00.idl

@@module p2p {
3737 CallWith=ScriptExecutionContext,
3838 EventTarget
3939 ] PeerConnection00 {
40  // FIXME: Make mediaHints an object
41  SessionDescription createOffer(in [Optional] DOMString mediaHints);
42 
43  // FIXME: Make mediaHints an object
44  SessionDescription createAnswer(in DOMString offer, in [Optional] DOMString mediaHints);
 40 SessionDescription createOffer(in [Optional] Dictionary mediaHints)
 41 raises(DOMException);
 42 SessionDescription createAnswer(in DOMString offer, in [Optional] Dictionary mediaHints)
 43 raises(DOMException);
4544
4645 // Actions, for setLocalDescription/setRemoteDescription.
4746 const unsigned short SDP_OFFER = 0x100;

@@module p2p {
5049
5150 void setLocalDescription(in unsigned short action, in SessionDescription desc)
5251 raises(DOMException);
53 
5452 void setRemoteDescription(in unsigned short action, in SessionDescription desc)
5553 raises(DOMException);
5654
5755 readonly attribute SessionDescription localDescription;
58 
5956 readonly attribute SessionDescription remoteDescription;
6057
6158 const unsigned short NEW = 0;
62  const unsigned short NEGOTIATING = 1;
 59 const unsigned short OPENING = 1;
6360 const unsigned short ACTIVE = 2;
6461 const unsigned short CLOSED = 3;
6562 readonly attribute unsigned short readyState;
6663
67  // FIXME: Make iceOptions an object
68  void startIce(in [Optional] DOMString iceOptions)
 64 void startIce(in [Optional] Dictionary iceOptions)
6965 raises(DOMException);
7066
7167 void processIceMessage(in IceCandidate candidate)

@@module p2p {
8076 const unsigned short ICE_CLOSED = 0x700;
8177 readonly attribute unsigned short iceState;
8278
83  // FIXME: Make mediaStreamHints an object
84  [StrictTypeChecking] void addStream(in MediaStream stream, in [Optional] DOMString mediaStreamHints)
 79 [StrictTypeChecking] void addStream(in MediaStream stream, in [Optional] Dictionary mediaStreamHints)
8580 raises(DOMException);
8681 [StrictTypeChecking] void removeStream(in MediaStream stream)
8782 raises(DOMException);

Source/WebKit/chromium/src/AssertMatchingEnums.cpp

@@COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00Handler::ActionSDPPRanswer, Peer
547547COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00Handler::ActionSDPAnswer, PeerConnection00::SDP_ANSWER);
548548
549549COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00HandlerClient::ReadyStateNew, PeerConnection00::NEW);
550 COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00HandlerClient::ReadyStateNegotiating, PeerConnection00::NEGOTIATING);
 550COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00HandlerClient::ReadyStateOpening, PeerConnection00::OPENING);
 551COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00HandlerClient::ReadyStateNegotiating, PeerConnection00::OPENING);
551552COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00HandlerClient::ReadyStateActive, PeerConnection00::ACTIVE);
552553COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00HandlerClient::ReadyStateClosed, PeerConnection00::CLOSED);
553554

LayoutTests/ChangeLog

 12012-05-03 Tommy Widenflycht <tommyw@google.com>
 2
 3 style
 4
 5 GTK fix
 6
 7 ChangeLogs
 8
 9 Dictionary & compliance
 10
 11 MediaStream API: Make PeerConnection00's API fully compliant with the draft
 12 https://bugs.webkit.org/show_bug.cgi?id=85491
 13
 14 Reviewed by NOBODY (OOPS!).
 15
 16 * fast/mediastream/peerconnection-Attributes-expected.txt:
 17
 182012-05-03 Tommy Widenflycht <tommyw@google.com>
 19
 20 MediaStream API: Make PeerConnection00's API fully compliant with the draft
 21 https://bugs.webkit.org/show_bug.cgi?id=85491
 22
 23 Reviewed by NOBODY (OOPS!).
 24
 25 * fast/mediastream/peerconnection-Attributes-expected.txt:
 26
1272012-05-03 Mihnea Ovidenie <mihnea@adobe.com>
228
329 [CSSRegions]Correct fast/regions/region-style-inline-background-color.html

LayoutTests/fast/mediastream/peerconnection-Attributes-expected.txt

@@PASS typeof pc.addStream === 'function' is true
77PASS typeof pc.removeStream === 'function' is true
88PASS typeof pc.close === 'function' is true
99PASS pc.NEW === 0 is true
10 FAIL pc.OPENING === 1 should be true. Was false.
 10PASS pc.OPENING === 1 is true
1111PASS pc.ACTIVE === 2 is true
1212PASS pc.CLOSED === 3 is true
1313PASS pc.ICE_GATHERING === 0x100 is true