Get MEDIA_STREAM compiling on OSX

https://bugs.webkit.org/show_bug.cgi?id=120650

Reviewed by Darin Adler.

No new tests, the code changed doesn't run on OSX yet.

* DerivedSources.make: Add MediaStream idl files.

* Modules/mediastream/LocalMediaStream.h: Mark class as FINAL.

* Modules/mediastream/MediaConstraintsImpl.cpp:
(WebCore::MediaConstraintsImpl::getOptionalConstraints): append -> appendRange so we don't
    need a MediaConstraint copy constructor.

* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::send): Remove an unused parameter name.
* Modules/mediastream/RTCDataChannel.h: ArrayBuffer and ArrayBufferView are in the JSC namespace.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::RTCPeerConnection): loader() doesn't return a pointer.
(WebCore::RTCPeerConnection::localDescription): Set the ExceptionCode on error.
(WebCore::RTCPeerConnection::remoteDescription): Ditto.

* Modules/mediastream/RTCSessionDescription.cpp:
(WebCore::RTCSessionDescription::setSdp): Remove the unused ExceptionCode parameter.
* Modules/mediastream/RTCSessionDescription.h: Ditto.
* Modules/mediastream/RTCSessionDescription.idl: Ditto.

* Modules/mediastream/RTCStatsResponse.cpp:
(WebCore::RTCStatsResponse::canGetItemsForName): Add so JSRTCStatsResponse::canGetItemsForName
    doesn't cause ref count churn.
* Modules/mediastream/RTCStatsResponse.h: Mark class as FINAL. Declare canGetItemsForName.

* WebCore.xcodeproj/project.pbxproj: Add new files.

* bindings/js/JSRTCStatsResponseCustom.cpp:
(WebCore::JSRTCStatsResponse::canGetItemsForName): Use canGetItemsForName instead of namedItem.
    Use propertyNameToAtomicString instead of propertyNameToString 
(WebCore::JSRTCStatsResponse::nameGetter): Use propertyNameToAtomicString instead of 
    propertyNameToString because namedItem takes an AtomicString.

* platform/mediastream/mac: Added.
* platform/mediastream/mac/MediaStreamCenterMac.cpp: Added.
* platform/mediastream/mac/MediaStreamCenterMac.h: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 077d0425
2013-09-04 Andreas Kling <akling@apple.com>
2013-09-04 Eric Carlson <eric.carlson@apple.com>
RenderSVGResource shouldn't trigger relayout during render tree teardown.
<https://webkit.org/b/120689>
<rdar://problem/14908967>
Get MEDIA_STREAM compiling on OSX
https://bugs.webkit.org/show_bug.cgi?id=120650
Reviewed by Antti Koivisto.
Reviewed by Darin Adler.
No new tests, the code changed doesn't run on OSX yet.
* DerivedSources.make: Add MediaStream idl files.
* Modules/mediastream/LocalMediaStream.h: Mark class as FINAL.
* Modules/mediastream/MediaConstraintsImpl.cpp:
(WebCore::MediaConstraintsImpl::getOptionalConstraints): append -> appendRange so we don't
need a MediaConstraint copy constructor.
* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::send): Remove an unused parameter name.
* Modules/mediastream/RTCDataChannel.h: ArrayBuffer and ArrayBufferView are in the JSC namespace.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::RTCPeerConnection): loader() doesn't return a pointer.
(WebCore::RTCPeerConnection::localDescription): Set the ExceptionCode on error.
(WebCore::RTCPeerConnection::remoteDescription): Ditto.
* Modules/mediastream/RTCSessionDescription.cpp:
(WebCore::RTCSessionDescription::setSdp): Remove the unused ExceptionCode parameter.
* Modules/mediastream/RTCSessionDescription.h: Ditto.
* Modules/mediastream/RTCSessionDescription.idl: Ditto.
* Modules/mediastream/RTCStatsResponse.cpp:
(WebCore::RTCStatsResponse::canGetItemsForName): Add so JSRTCStatsResponse::canGetItemsForName
doesn't cause ref count churn.
* Modules/mediastream/RTCStatsResponse.h: Mark class as FINAL. Declare canGetItemsForName.
* WebCore.xcodeproj/project.pbxproj: Add new files.
The new assertion in FrameView::scheduleRelayoutOfSubtree() caught a fish!
We were doing some unnecessary relayout scheduling while tearing down SVG
resource renderers.
* bindings/js/JSRTCStatsResponseCustom.cpp:
(WebCore::JSRTCStatsResponse::canGetItemsForName): Use canGetItemsForName instead of namedItem.
Use propertyNameToAtomicString instead of propertyNameToString
(WebCore::JSRTCStatsResponse::nameGetter): Use propertyNameToAtomicString instead of
propertyNameToString because namedItem takes an AtomicString.
* rendering/svg/RenderSVGResource.cpp:
(WebCore::RenderSVGResource::markForLayoutAndParentResourceInvalidation):
* platform/mediastream/mac: Added.
* platform/mediastream/mac/MediaStreamCenterMac.cpp: Added.
* platform/mediastream/mac/MediaStreamCenterMac.h: Added.
2013-09-04 Daniel Bates <dabates@apple.com>
......@@ -34,6 +34,7 @@ VPATH = \
$(WebCore)/Modules/indexeddb \
$(WebCore)/Modules/indieui \
$(WebCore)/Modules/mediasource \
$(WebCore)/Modules/mediastream \
$(WebCore)/Modules/notifications \
$(WebCore)/Modules/quota \
$(WebCore)/Modules/speech \
......@@ -115,6 +116,28 @@ BINDING_IDLS = \
$(WebCore)/Modules/mediasource/MediaSource.idl \
$(WebCore)/Modules/mediasource/SourceBuffer.idl \
$(WebCore)/Modules/mediasource/SourceBufferList.idl \
$(WebCore)/Modules/mediastream/LocalMediaStream.idl \
$(WebCore)/Modules/mediastream/MediaStream.idl \
$(WebCore)/Modules/mediastream/MediaStreamEvent.idl \
$(WebCore)/Modules/mediastream/MediaStreamTrack.idl \
$(WebCore)/Modules/mediastream/MediaStreamTrackEvent.idl \
$(WebCore)/Modules/mediastream/NavigatorMediaStream.idl \
$(WebCore)/Modules/mediastream/NavigatorUserMediaError.idl \
$(WebCore)/Modules/mediastream/NavigatorUserMediaErrorCallback.idl \
$(WebCore)/Modules/mediastream/NavigatorUserMediaSuccessCallback.idl \
$(WebCore)/Modules/mediastream/RTCDTMFSender.idl \
$(WebCore)/Modules/mediastream/RTCDTMFToneChangeEvent.idl \
$(WebCore)/Modules/mediastream/RTCDataChannel.idl \
$(WebCore)/Modules/mediastream/RTCDataChannelEvent.idl \
$(WebCore)/Modules/mediastream/RTCErrorCallback.idl \
$(WebCore)/Modules/mediastream/RTCIceCandidate.idl \
$(WebCore)/Modules/mediastream/RTCIceCandidateEvent.idl \
$(WebCore)/Modules/mediastream/RTCPeerConnection.idl \
$(WebCore)/Modules/mediastream/RTCSessionDescription.idl \
$(WebCore)/Modules/mediastream/RTCSessionDescriptionCallback.idl \
$(WebCore)/Modules/mediastream/RTCStatsCallback.idl \
$(WebCore)/Modules/mediastream/RTCStatsReport.idl \
$(WebCore)/Modules/mediastream/RTCStatsResponse.idl \
$(WebCore)/Modules/notifications/DOMWindowNotifications.idl \
$(WebCore)/Modules/notifications/Notification.idl \
$(WebCore)/Modules/notifications/NotificationCenter.idl \
......@@ -152,6 +175,7 @@ BINDING_IDLS = \
$(WebCore)/Modules/webaudio/DynamicsCompressorNode.idl \
$(WebCore)/Modules/webaudio/ScriptProcessorNode.idl \
$(WebCore)/Modules/webaudio/MediaElementAudioSourceNode.idl \
$(WebCore)/Modules/webaudio/MediaStreamAudioDestinationNode.idl \
$(WebCore)/Modules/webaudio/MediaStreamAudioSourceNode.idl \
$(WebCore)/Modules/webaudio/OscillatorNode.idl \
$(WebCore)/Modules/webaudio/OfflineAudioContext.idl \
......@@ -867,6 +891,10 @@ ifeq ($(findstring ENABLE_ENCRYPTED_MEDIA,$(FEATURE_DEFINES)), ENABLE_ENCRYPTED_
HTML_FLAGS := $(HTML_FLAGS) ENABLE_ENCRYPTED_MEDIA=1
endif
ifeq ($(findstring ENABLE_MEDIA_STREAM,$(FEATURE_DEFINES)), ENABLE_MEDIA_STREAM)
HTML_FLAGS := $(HTML_FLAGS) ENABLE_MEDIA_STREAM=1
endif
ifdef HTML_FLAGS
HTMLElementFactory.cpp HTMLNames.cpp : dom/make_names.pl bindings/scripts/Hasher.pm bindings/scripts/StaticString.pm html/HTMLTagNames.in html/HTMLAttributeNames.in
......
......@@ -32,7 +32,7 @@
namespace WebCore {
class LocalMediaStream : public MediaStream {
class LocalMediaStream FINAL : public MediaStream {
public:
static PassRefPtr<LocalMediaStream> create(ScriptExecutionContext*, const MediaStreamSourceVector& audioSources, const MediaStreamSourceVector& videoSources);
static PassRefPtr<LocalMediaStream> create(ScriptExecutionContext*, PassRefPtr<MediaStreamDescriptor>);
......
......@@ -130,7 +130,7 @@ void MediaConstraintsImpl::getMandatoryConstraints(Vector<MediaConstraint>& cons
void MediaConstraintsImpl::getOptionalConstraints(Vector<MediaConstraint>& constraints) const
{
constraints.clear();
constraints.append(m_optionalConstraints);
constraints.appendRange(m_optionalConstraints.begin(), m_optionalConstraints.end());
}
bool MediaConstraintsImpl::getMandatoryConstraintValue(const String& name, String& value) const
......
......@@ -164,7 +164,7 @@ void RTCDataChannel::send(PassRefPtr<ArrayBufferView> data, ExceptionCode& ec)
send(arrayBuffer.release(), ec);
}
void RTCDataChannel::send(PassRefPtr<Blob> data, ExceptionCode& ec)
void RTCDataChannel::send(PassRefPtr<Blob>, ExceptionCode& ec)
{
// FIXME: implement
ec = NOT_SUPPORTED_ERR;
......
......@@ -32,6 +32,11 @@
#include "Timer.h"
#include <wtf/RefCounted.h>
namespace JSC {
class ArrayBuffer;
class ArrayBufferView;
}
namespace WebCore {
class Blob;
......@@ -53,8 +58,8 @@ public:
void setBinaryType(const String&, ExceptionCode&);
void send(const String&, ExceptionCode&);
void send(PassRefPtr<ArrayBuffer>, ExceptionCode&);
void send(PassRefPtr<ArrayBufferView>, ExceptionCode&);
void send(PassRefPtr<JSC::ArrayBuffer>, ExceptionCode&);
void send(PassRefPtr<JSC::ArrayBufferView>, ExceptionCode&);
void send(PassRefPtr<Blob>, ExceptionCode&);
void close();
......
......@@ -152,7 +152,7 @@ RTCPeerConnection::RTCPeerConnection(ScriptExecutionContext* context, PassRefPtr
return;
}
document->frame()->loader()->client().dispatchWillStartUsingPeerConnectionHandler(m_peerHandler.get());
document->frame()->loader().client().dispatchWillStartUsingPeerConnectionHandler(m_peerHandler.get());
if (!m_peerHandler->initialize(configuration, constraints)) {
ec = NOT_SUPPORTED_ERR;
......@@ -225,8 +225,10 @@ void RTCPeerConnection::setLocalDescription(PassRefPtr<RTCSessionDescription> pr
PassRefPtr<RTCSessionDescription> RTCPeerConnection::localDescription(ExceptionCode& ec)
{
RefPtr<RTCSessionDescriptionDescriptor> descriptor = m_peerHandler->localDescription();
if (!descriptor)
if (!descriptor) {
ec = INVALID_STATE_ERR;
return 0;
}
RefPtr<RTCSessionDescription> sessionDescription = RTCSessionDescription::create(descriptor.release());
return sessionDescription.release();
......@@ -252,8 +254,10 @@ void RTCPeerConnection::setRemoteDescription(PassRefPtr<RTCSessionDescription> p
PassRefPtr<RTCSessionDescription> RTCPeerConnection::remoteDescription(ExceptionCode& ec)
{
RefPtr<RTCSessionDescriptionDescriptor> descriptor = m_peerHandler->remoteDescription();
if (!descriptor)
if (!descriptor) {
ec = INVALID_STATE_ERR;
return 0;
}
RefPtr<RTCSessionDescription> desc = RTCSessionDescription::create(descriptor.release());
return desc.release();
......
......@@ -97,7 +97,7 @@ const String& RTCSessionDescription::sdp() const
return m_descriptor->sdp();
}
void RTCSessionDescription::setSdp(const String& sdp, ExceptionCode& ec)
void RTCSessionDescription::setSdp(const String& sdp)
{
m_descriptor->setSdp(sdp);
}
......
......@@ -53,7 +53,7 @@ public:
void setType(const String&, ExceptionCode&);
const String& sdp() const;
void setSdp(const String&, ExceptionCode&);
void setSdp(const String&);
RTCSessionDescriptionDescriptor* descriptor();
......
......@@ -34,6 +34,6 @@
ConstructorRaisesException
] interface RTCSessionDescription {
[SetterRaisesException] attribute DOMString type;
[SetterRaisesException] attribute DOMString sdp;
attribute DOMString sdp;
};
......@@ -46,6 +46,11 @@ PassRefPtr<RTCStatsReport> RTCStatsResponse::namedItem(const AtomicString& name)
return 0;
}
bool RTCStatsResponse::canGetItemsForName(const AtomicString& name)
{
return m_idmap.contains(name);
}
size_t RTCStatsResponse::addReport(String id, String type, double timestamp)
{
m_result.append(RTCStatsReport::create(id, type, timestamp));
......
......@@ -39,13 +39,14 @@
namespace WebCore {
class RTCStatsResponse : public RTCStatsResponseBase {
class RTCStatsResponse FINAL : public RTCStatsResponseBase {
public:
static PassRefPtr<RTCStatsResponse> create();
const Vector<RefPtr<RTCStatsReport> >& result() const { return m_result; };
PassRefPtr<RTCStatsReport> namedItem(const AtomicString& name);
PassRefPtr<RTCStatsReport> namedItem(const AtomicString&);
bool canGetItemsForName(const AtomicString&);
virtual size_t addReport(String id, String type, double timestamp) OVERRIDE;
virtual void addStatistic(size_t report, String name, String value) OVERRIDE;
......
......@@ -24,25 +24,26 @@
*/
#include "config.h"
#if ENABLE(MEDIA_STREAM)
#include "JSRTCStatsResponse.h"
#include "JSRTCStatsReport.h"
#include "RTCStatsResponse.h"
#include <wtf/text/AtomicString.h>
using namespace JSC;
namespace WebCore {
bool JSRTCStatsResponse::canGetItemsForName(ExecState*, RTCStatsResponse* impl, PropertyName propertyName)
bool JSRTCStatsResponse::canGetItemsForName(ExecState*, RTCStatsResponse* response, PropertyName propertyName)
{
return impl->namedItem(propertyNameToString(propertyName));
return response->canGetItemsForName(propertyNameToAtomicString(propertyName));
}
JSValue JSRTCStatsResponse::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
{
JSRTCStatsResponse* thisObj = jsCast<JSRTCStatsResponse*>(asObject(slotBase));
return toJS(exec, thisObj->globalObject(), thisObj->impl()->namedItem(propertyNameToString(propertyName)));
return toJS(exec, thisObj->globalObject(), thisObj->impl()->namedItem(propertyNameToAtomicString(propertyName)));
}
} // namespace WebCore
......
/*
* Copyright (C) 2013 Apple, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Ericsson nor the names of its contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#if ENABLE(MEDIA_STREAM)
#include "MediaStreamCenterMac.h"
#include "MediaStreamDescriptor.h"
#include "MediaStreamSourcesQueryClient.h"
#include "NotImplemented.h"
#include <wtf/MainThread.h>
namespace WebCore {
MediaStreamCenter& MediaStreamCenter::instance()
{
ASSERT(isMainThread());
DEFINE_STATIC_LOCAL(MediaStreamCenterMac, center, ());
return center;
}
MediaStreamCenterMac::MediaStreamCenterMac()
{
}
MediaStreamCenterMac::~MediaStreamCenterMac()
{
}
void MediaStreamCenterMac::queryMediaStreamSources(PassRefPtr<MediaStreamSourcesQueryClient>)
{
notImplemented();
}
void MediaStreamCenterMac::didSetMediaStreamTrackEnabled(MediaStreamDescriptor*, MediaStreamComponent*)
{
notImplemented();
}
bool MediaStreamCenterMac::didAddMediaStreamTrack(MediaStreamDescriptor*, MediaStreamComponent*)
{
notImplemented();
return false;
}
bool MediaStreamCenterMac::didRemoveMediaStreamTrack(MediaStreamDescriptor*, MediaStreamComponent*)
{
notImplemented();
return false;
}
void MediaStreamCenterMac::didStopLocalMediaStream(MediaStreamDescriptor* stream)
{
endLocalMediaStream(stream);
}
void MediaStreamCenterMac::didCreateMediaStream(MediaStreamDescriptor*)
{
notImplemented();
}
} // namespace WebCore
#endif // ENABLE(MEDIA_STREAM)
/*
* Copyright (C) 2013 Apple, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Ericsson nor the names of its contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef MediaStreamCenterMac_h
#define MediaStreamCenterMac_h
#if ENABLE(MEDIA_STREAM)
#include "MediaStreamCenter.h"
#include <wtf/PassRefPtr.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
class MediaStreamComponent;
class MediaStreamDescriptor;
class MediaStreamSourcesQueryClient;
class MediaStreamCenterMac FINAL : public MediaStreamCenter {
public:
MediaStreamCenterMac();
~MediaStreamCenterMac();
// MediaStreamCenter
virtual void queryMediaStreamSources(PassRefPtr<MediaStreamSourcesQueryClient>) OVERRIDE;
virtual void didSetMediaStreamTrackEnabled(MediaStreamDescriptor*, MediaStreamComponent*) OVERRIDE;
virtual bool didAddMediaStreamTrack(MediaStreamDescriptor*, MediaStreamComponent*) OVERRIDE;
virtual bool didRemoveMediaStreamTrack(MediaStreamDescriptor*, MediaStreamComponent*) OVERRIDE;
virtual void didStopLocalMediaStream(MediaStreamDescriptor*) OVERRIDE;
virtual void didCreateMediaStream(MediaStreamDescriptor*) OVERRIDE;
};
} // namespace WebCore
#endif // ENABLE(MEDIA_STREAM)
#endif // MediaStreamCenterMac_h
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment