Diff
Modified: trunk/Source/WebCore/ChangeLog (204176 => 204177)
--- trunk/Source/WebCore/ChangeLog 2016-08-05 17:08:22 UTC (rev 204176)
+++ trunk/Source/WebCore/ChangeLog 2016-08-05 17:43:45 UTC (rev 204177)
@@ -1,3 +1,18 @@
+2016-08-05 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r204147.
+ https://bugs.webkit.org/show_bug.cgi?id=160602
+
+ Considering another implementation (Requested by eric_carlson
+ on #webkit).
+
+ Reverted changeset:
+
+ "Add long, boolean, double, and String Media Constraint
+ classes"
+ https://bugs.webkit.org/show_bug.cgi?id=160524
+ http://trac.webkit.org/changeset/204147
+
2016-08-05 John Wilander <[email protected]>
Popups opened from a sandboxed iframe should themselves be sandboxed
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (204176 => 204177)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2016-08-05 17:08:22 UTC (rev 204176)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2016-08-05 17:43:45 UTC (rev 204177)
@@ -1021,7 +1021,6 @@
1AFE119A0CBFFCC4003017FA /* JSSQLResultSetRowList.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AFE11980CBFFCC4003017FA /* JSSQLResultSetRowList.h */; };
1B124D8D1D380B7000ECDFB0 /* MediaSampleAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = 1B124D8C1D380B7000ECDFB0 /* MediaSampleAVFObjC.h */; };
1B124D8F1D380BB600ECDFB0 /* MediaSampleAVFObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1B124D8E1D380BB600ECDFB0 /* MediaSampleAVFObjC.mm */; };
- 1BE5BFC21D515715001666D9 /* MediaConstraints.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1BE5BFC11D515715001666D9 /* MediaConstraints.cpp */; };
1BF9DB3C1D3973AD0026AEB7 /* MediaSample.h in Headers */ = {isa = PBXBuildFile; fileRef = CD641EC7181ED60100EE4C41 /* MediaSample.h */; settings = {ATTRIBUTES = (Private, ); }; };
1C010700192594DF008A4201 /* InlineTextBoxStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C0106FE192594DF008A4201 /* InlineTextBoxStyle.cpp */; };
1C010701192594DF008A4201 /* InlineTextBoxStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C0106FF192594DF008A4201 /* InlineTextBoxStyle.h */; };
@@ -8244,7 +8243,6 @@
1AFE11980CBFFCC4003017FA /* JSSQLResultSetRowList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLResultSetRowList.h; sourceTree = "<group>"; };
1B124D8C1D380B7000ECDFB0 /* MediaSampleAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MediaSampleAVFObjC.h; path = ../MediaSampleAVFObjC.h; sourceTree = "<group>"; };
1B124D8E1D380BB600ECDFB0 /* MediaSampleAVFObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MediaSampleAVFObjC.mm; sourceTree = "<group>"; };
- 1BE5BFC11D515715001666D9 /* MediaConstraints.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaConstraints.cpp; sourceTree = "<group>"; };
1C0106FE192594DF008A4201 /* InlineTextBoxStyle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InlineTextBoxStyle.cpp; sourceTree = "<group>"; };
1C0106FF192594DF008A4201 /* InlineTextBoxStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineTextBoxStyle.h; sourceTree = "<group>"; };
1C0939E81A13E12900B788E5 /* CachedSVGFont.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedSVGFont.cpp; sourceTree = "<group>"; };
@@ -15237,7 +15235,6 @@
07221B9217CF0AD400848E51 /* mediastream */ = {
isa = PBXGroup;
children = (
- 1BE5BFC11D515715001666D9 /* MediaConstraints.cpp */,
0729B14D17CFCCA0004F1D60 /* mac */,
07D6A4F61BF2307D00174146 /* AudioTrackPrivateMediaStream.h */,
5EBB89301C7777E100C65D41 /* IceCandidate.h */,
@@ -31374,7 +31371,6 @@
B2227A460D00BF220071B782 /* SVGMaskElement.cpp in Sources */,
B2227A4A0D00BF220071B782 /* SVGMetadataElement.cpp in Sources */,
B2A1F2B00CEF0ABF00442F6A /* SVGMissingGlyphElement.cpp in Sources */,
- 1BE5BFC21D515715001666D9 /* MediaConstraints.cpp in Sources */,
B2227A4D0D00BF220071B782 /* SVGMPathElement.cpp in Sources */,
A833C7CA0A2CF06B00D57664 /* SVGNames.cpp in Sources */,
B2227A500D00BF220071B782 /* SVGNumberList.cpp in Sources */,
Deleted: trunk/Source/WebCore/platform/mediastream/MediaConstraints.cpp (204176 => 204177)
--- trunk/Source/WebCore/platform/mediastream/MediaConstraints.cpp 2016-08-05 17:08:22 UTC (rev 204176)
+++ trunk/Source/WebCore/platform/mediastream/MediaConstraints.cpp 2016-08-05 17:43:45 UTC (rev 204177)
@@ -1,240 +0,0 @@
-/*
- * Copyright (C) 2016 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 Google Inc. 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"
-#include "MediaConstraints.h"
-
-#include "Dictionary.h"
-#include "Logging.h"
-#include "RealtimeMediaSourceCenter.h"
-#include "RealtimeMediaSourceSupportedConstraints.h"
-
-namespace WebCore {
-
-RefPtr<BaseConstraint> BaseConstraint::create(const String& name, const Dictionary& dictionary)
-{
- RefPtr<BaseConstraint> constraint = createEmptyDerivedConstraint(name);
- if (!constraint)
- return nullptr;
-
- constraint->initializeWithDictionary(dictionary);
- return constraint;
-}
-
-RefPtr<BaseConstraint> BaseConstraint::createEmptyDerivedConstraint(const String& name)
-{
- const RealtimeMediaSourceSupportedConstraints& supportedConstraints = RealtimeMediaSourceCenter::singleton().supportedConstraints();
- MediaConstraintType constraintType = supportedConstraints.constraintFromName(name);
-
- switch (constraintType) {
- case MediaConstraintType::Width:
- case MediaConstraintType::Height:
- case MediaConstraintType::SampleRate:
- case MediaConstraintType::SampleSize:
- return LongConstraint::create(name);
- case MediaConstraintType::AspectRatio:
- case MediaConstraintType::FrameRate:
- case MediaConstraintType::Volume:
- return DoubleConstraint::create(name);
- case MediaConstraintType::EchoCancellation:
- return BooleanConstraint::create(name);
- case MediaConstraintType::FacingMode:
- case MediaConstraintType::DeviceId:
- case MediaConstraintType::GroupId:
- return StringConstraint::create(name);
- case MediaConstraintType::Unknown:
- return nullptr;
- }
-}
-
-Ref<LongConstraint> LongConstraint::create(const String& name)
-{
- return adoptRef(*new LongConstraint(name));
-}
-
-void LongConstraint::setMin(long value)
-{
- m_min = value;
- setHasMin(true);
-}
-
-void LongConstraint::setMax(long value)
-{
- m_max = value;
- setHasMax(true);
-}
-
-void LongConstraint::setExact(long value)
-{
- m_exact = value;
- setHasExact(true);
-}
-
-void LongConstraint::setIdeal(long value)
-{
- m_ideal = value;
- setHasIdeal(true);
-}
-
-void LongConstraint::initializeWithDictionary(const Dictionary& dictionaryConstraintValue)
-{
-
- long minValue;
- if (dictionaryConstraintValue.get("min", minValue))
- setMin(minValue);
-
- long maxValue;
- if (dictionaryConstraintValue.get("max", maxValue))
- setMax(maxValue);
-
- long exactValue;
- if (dictionaryConstraintValue.get("exact", exactValue))
- setExact(exactValue);
-
- long idealValue;
- if (dictionaryConstraintValue.get("ideal", idealValue))
- setIdeal(idealValue);
-
- if (isEmpty())
- LOG(Media, "LongConstraint::initializeWithDictionary(%p) - ignoring constraint since it has no valid or supported key/value pairs.", this);
-}
-
-Ref<DoubleConstraint> DoubleConstraint::create(const String& name)
-{
- return adoptRef(*new DoubleConstraint(name));
-}
-
-void DoubleConstraint::setMin(double value)
-{
- m_min = value;
- setHasMin(true);
-}
-
-void DoubleConstraint::setMax(double value)
-{
- m_max = value;
- setHasMax(true);
-}
-
-void DoubleConstraint::setExact(double value)
-{
- m_exact = value;
- setHasExact(true);
-}
-
-void DoubleConstraint::setIdeal(double value)
-{
- m_ideal = value;
- setHasIdeal(true);
-}
-
-void DoubleConstraint::initializeWithDictionary(const Dictionary& dictionaryConstraintValue)
-{
- double minValue;
- if (dictionaryConstraintValue.get("min", minValue))
- setMin(minValue);
-
- double maxValue;
- if (dictionaryConstraintValue.get("max", maxValue))
- setMax(maxValue);
-
- double exactValue;
- if (dictionaryConstraintValue.get("exact", exactValue))
- setExact(exactValue);
-
- double idealValue;
- if (dictionaryConstraintValue.get("ideal", idealValue))
- setIdeal(idealValue);
-
- if (isEmpty())
- LOG(Media, "DoubleConstraints::initializeWithDictionary(%p) - ignoring constraint since it has no valid or supported key/value pairs.", this);
-}
-
-Ref<BooleanConstraint> BooleanConstraint::create(const String& name)
-{
- return adoptRef(*new BooleanConstraint(name));
-}
-
-void BooleanConstraint::setExact(bool value)
-{
- m_exact = value;
- m_hasExact = true;
-}
-
-void BooleanConstraint::setIdeal(bool value)
-{
- m_ideal = value;
- m_hasIdeal = true;
-}
-
-void BooleanConstraint::initializeWithDictionary(const Dictionary& dictionaryConstraintValue)
-{
- bool exactValue;
- if (dictionaryConstraintValue.get("exact", exactValue))
- setExact(exactValue);
-
- bool idealValue;
- if (dictionaryConstraintValue.get("ideal", idealValue))
- setIdeal(idealValue);
-
- if (isEmpty())
- LOG(Media, "BooleanConstraint::initializeWithDictionary(%p) - ignoring constraint since it has no valid or supported key/value pairs.", this);
-}
-
-Ref<StringConstraint> StringConstraint::create(const String& name)
-{
- return adoptRef(*new StringConstraint(name));
-}
-
-void StringConstraint::setExact(const String& value)
-{
- m_exact = value;
-}
-
-void StringConstraint::setIdeal(const String& value)
-{
- m_ideal = value;
-}
-
-void StringConstraint::initializeWithDictionary(const Dictionary& dictionaryConstraintValue)
-{
- String exactValue;
- if (dictionaryConstraintValue.get("exact", exactValue) && !exactValue.isNull() && !exactValue.isEmpty())
- setExact(exactValue);
-
- String idealValue;
- if (dictionaryConstraintValue.get("ideal", idealValue) && !idealValue.isNull() && !idealValue.isEmpty())
- setIdeal(idealValue);
-
- if (isEmpty())
- LOG(Media, "StringConstraint::initializeWithDictionary(%p) - ignoring constraint since it has no valid or supported key/value pairs.", this);
-}
-
-}
Modified: trunk/Source/WebCore/platform/mediastream/MediaConstraints.h (204176 => 204177)
--- trunk/Source/WebCore/platform/mediastream/MediaConstraints.h 2016-08-05 17:08:22 UTC (rev 204176)
+++ trunk/Source/WebCore/platform/mediastream/MediaConstraints.h 2016-08-05 17:43:45 UTC (rev 204177)
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
- * Copyright (C) 2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -39,175 +38,6 @@
namespace WebCore {
-class Dictionary;
-
-class BaseConstraint : public RefCounted<BaseConstraint> {
-public:
- static RefPtr<BaseConstraint> create(const String& name, const Dictionary&);
-
- virtual ~BaseConstraint() { };
- virtual bool isEmpty() const = 0;
- virtual bool isMandatory() const = 0;
-
- virtual bool hasIdeal() const = 0;
-
- String name() const { return m_name; }
-
-protected:
- explicit BaseConstraint(const String& name)
- : m_name(name)
- {
- }
-
-private:
- static RefPtr<BaseConstraint> createEmptyDerivedConstraint(const String& name);
-
- virtual void initializeWithDictionary(const Dictionary&) = 0;
-
- String m_name;
-};
-
-class NumericConstraint : public BaseConstraint {
-public:
- void setHasMin(bool value) { m_hasMin = value; }
- void setHasMax(bool value) { m_hasMax = value; }
- void setHasExact(bool value) { m_hasExact = value; }
- void setHasIdeal(bool value) { m_hasIdeal = value; }
-
- bool hasMin() const { return m_hasMin; }
- bool hasMax() const { return m_hasMax; }
- bool hasExact() const { return m_hasExact; }
- bool hasIdeal() const override { return m_hasIdeal; }
-
- bool isEmpty() const override { return !m_hasMin && !m_hasMax && !m_hasExact && !m_hasIdeal; }
- bool isMandatory() const override { return m_hasMin || m_hasMax || m_hasExact; }
-
-protected:
- explicit NumericConstraint(const String& name)
- : BaseConstraint(name)
- {
- }
-
-private:
- bool m_hasMin { false };
- bool m_hasMax { false };
- bool m_hasExact { false };
- bool m_hasIdeal { false };
-};
-
-class LongConstraint final : public NumericConstraint {
-public:
- static Ref<LongConstraint> create(const String& name);
-
- void setMin(long value);
- void setMax(long value);
- void setExact(long value);
- void setIdeal(long value);
-
- long min() const { return m_min; }
- long max() const { return m_max; }
- long exact() const { return m_exact; }
- long ideal() const { return m_ideal; }
-
-private:
- explicit LongConstraint(const String& name)
- : WebCore::NumericConstraint(name)
- {
- }
-
- void initializeWithDictionary(const Dictionary&) override;
-
- long m_min;
- long m_max;
- long m_exact;
- long m_ideal;
-};
-
-class DoubleConstraint final : public NumericConstraint {
-public:
- static Ref<DoubleConstraint> create(const String& name);
-
- void setMin(double value);
- void setMax(double value);
- void setExact(double value);
- void setIdeal(double value);
-
- double min() const { return m_min; }
- double max() const { return m_max; }
- double exact() const { return m_exact; }
- double ideal() const { return m_ideal; }
-
-private:
- explicit DoubleConstraint(const String& name)
- : WebCore::NumericConstraint(name)
- {
- }
-
- void initializeWithDictionary(const Dictionary&) override;
-
- double m_min;
- double m_max;
- double m_exact;
- double m_ideal;
-};
-
-class BooleanConstraint final : public BaseConstraint {
-public:
- static Ref<BooleanConstraint> create(const String& name);
-
- void setExact(bool value);
- void setIdeal(bool value);
-
- bool exact() const { return m_exact; }
- bool ideal() const { return m_ideal; }
- bool hasExact() const { return m_hasExact; }
- bool hasIdeal() const override { return m_hasIdeal; }
-
- bool isEmpty() const override { return !m_hasExact && !m_hasIdeal; };
- bool isMandatory() const override { return m_hasExact; }
-
-private:
- explicit BooleanConstraint(const String& name)
- : BaseConstraint(name)
- {
- }
-
- void initializeWithDictionary(const Dictionary&) override;
-
- bool m_exact { false };
- bool m_ideal { false };
- bool m_hasExact { false };
- bool m_hasIdeal { false };
-};
-
-class StringConstraint final : public BaseConstraint {
-public:
- static Ref<StringConstraint> create(const String& name);
-
- void setExact(const String&);
- void setIdeal(const String&);
-
- const String& exact() const { return m_exact; }
- const String& ideal() const { return m_ideal; }
-
- bool hasExact() const { return !m_exact.isEmpty(); }
- bool hasIdeal() const override { return !m_ideal.isEmpty(); }
-
- bool isEmpty() const override { return m_exact.isEmpty() && m_ideal.isEmpty(); }
- bool isMandatory() const override { return !m_exact.isEmpty(); }
-
-private:
- explicit StringConstraint(const String& name)
- : BaseConstraint(name)
- {
- }
-
- void initializeWithDictionary(const Dictionary&) override;
-
- String m_exact;
- String m_ideal;
-};
-
struct MediaConstraint {
MediaConstraint(String name, String value)
: m_name(name)