WebKit-https.git
2 years agoRolling out r212757
jmarcell@apple.com [Wed, 22 Feb 2017 18:36:51 +0000 (18:36 +0000)]
Rolling out r212757

Revert "Resource Load Statistics: Add alternate classification method"

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212841 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[GTK] Do not use g_return_if_fail in EventSenderProxy::continuousMouseScrollBy
commit-queue@webkit.org [Wed, 22 Feb 2017 18:03:13 +0000 (18:03 +0000)]
[GTK] Do not use g_return_if_fail in EventSenderProxy::continuousMouseScrollBy
https://bugs.webkit.org/show_bug.cgi?id=168721

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2017-02-22
Reviewed by Michael Catanzaro.

Use WTFLogAlways instead. It's still shown in stderr, but it won't crash if we ever run tests with fatal
criticals.

* WebKitTestRunner/gtk/EventSenderProxyGtk.cpp:
(WTR::EventSenderProxy::continuousMouseScrollBy):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212839 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoWeb Inspector: RTL: Settings tab labels need adjustment
bburg@apple.com [Wed, 22 Feb 2017 17:56:52 +0000 (17:56 +0000)]
Web Inspector: RTL: Settings tab labels need adjustment
https://bugs.webkit.org/show_bug.cgi?id=168497

Reviewed by Matt Baker.

Flip margins. Use 'text-align: end' instead of manually choosing
right and left based on body[dir].

* UserInterface/Views/SettingsTabContentView.css:
(.content-view.settings > .setting-container > .setting-name):
(body[dir=ltr] .content-view.settings > .setting-container > .setting-name):
(body[dir=rtl] .content-view.settings > .setting-container > .setting-name):
(.content-view.settings > .setting-container > .setting-value-controller input[type="checkbox"]):
(body[dir=ltr] .content-view.settings > .setting-container > .setting-value-controller input[type="checkbox"]):
(body[dir=rtl] .content-view.settings > .setting-container > .setting-value-controller input[type="checkbox"]):
(.content-view.settings > .setting-container > .setting-value-controller input[type="number"]):
(body[dir=ltr] .content-view.settings > .setting-container > .setting-value-controller input[type="number"]):
(body[dir=rtl] .content-view.settings > .setting-container > .setting-value-controller input[type="number"]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212838 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoMove iOS specific symbols to WebKit.ios.exp
aakash_jain@apple.com [Wed, 22 Feb 2017 17:44:34 +0000 (17:44 +0000)]
Move iOS specific symbols to WebKit.ios.exp
https://bugs.webkit.org/show_bug.cgi?id=168726

Reviewed by Alexey Proskuryakov.

Source/WebKit/ios:

* WebKit.iOS.exp:

Source/WebKit/mac:

* WebKit.exp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212833 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[WK2] Call processDidBecomeUnresponsive delegate when a background process is unrespo...
cdumez@apple.com [Wed, 22 Feb 2017 17:15:45 +0000 (17:15 +0000)]
[WK2] Call processDidBecomeUnresponsive delegate when a background process is unresponsive
https://bugs.webkit.org/show_bug.cgi?id=168683
<rdar://problem/30558745>

Reviewed by Dan Bernstein.

Call processDidBecomeUnresponsive delegate when a background process is unresponsive
instead of killing it on WebKit side. This gives the client the choice about what it
wants to do about this process.

* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContext.cpp:
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/BackgroundProcessResponsivenessTimer.cpp: Renamed from Source/WebKit2/UIProcess/UnresponsiveWebProcessTerminator.cpp.
(WebKit::BackgroundProcessResponsivenessTimer::BackgroundProcessResponsivenessTimer):
(WebKit::BackgroundProcessResponsivenessTimer::updateState):
(WebKit::BackgroundProcessResponsivenessTimer::timerFired):
* UIProcess/BackgroundProcessResponsivenessTimer.h: Renamed from Source/WebKit2/UIProcess/UnresponsiveWebProcessTerminator.h.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::dispatchActivityStateChange):
(WebKit::WebPageProxy::terminateProcess):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::m_backgroundResponsivenessTimer):
* UIProcess/WebProcessProxy.h:
* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212832 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[Win] Compile fix.
pvollan@apple.com [Wed, 22 Feb 2017 17:05:22 +0000 (17:05 +0000)]
[Win] Compile fix.
https://bugs.webkit.org/show_bug.cgi?id=168713

Reviewed by Brent Fulgham.

The include file <ANGLE/ShaderLang.h> is not found.

* testing/Internals.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212831 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[GStreamer][EME] Fix issue with allowed systems extraction
calvaris@igalia.com [Wed, 22 Feb 2017 16:54:45 +0000 (16:54 +0000)]
[GStreamer][EME] Fix issue with allowed systems extraction
https://bugs.webkit.org/show_bug.cgi?id=168717

Reviewed by Carlos Garcia Campos.

The allowed systems were not being extracted from the need-context
message because the loop was not stopping on the right condition.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::extractEventsAndSystemsFromMessage): Fix wrong
condition.
(WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
Add better debug category.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212830 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[GTK] [2.15.90] Disable RESOURCE_USAGE on non-Linux systems
berto@igalia.com [Wed, 22 Feb 2017 16:53:17 +0000 (16:53 +0000)]
[GTK] [2.15.90] Disable RESOURCE_USAGE on non-Linux systems
https://bugs.webkit.org/show_bug.cgi?id=168714

Reviewed by Carlos Garcia Campos.

* Source/cmake/OptionsGTK.cmake:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212829 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoREGRESSION(r207669): Crash after mutating selector text
antti@apple.com [Wed, 22 Feb 2017 14:46:06 +0000 (14:46 +0000)]
REGRESSION(r207669): Crash after mutating selector text
https://bugs.webkit.org/show_bug.cgi?id=168655
<rdar://problem/30632111>

Reviewed by Andreas Kling.

Source/WebCore:

Test: fast/css/selector-text-mutation-crash.html

* style/StyleScope.cpp:
(WebCore::Style::Scope::resolver):
(WebCore::Style::Scope::updateStyleResolver):

Protect against entering scheduleUpdate and wiping style resolver while updating it.
Extension stylesheets can trigger this.

(WebCore::Style::Scope::scheduleUpdate):

Clear the style resolver immediately if style sheet content changes. The resolver may
have data structures that point to the old sheet contents.

The resolver would get wiped anyway when the scheduled update actually occurs.

* style/StyleScope.h:

LayoutTests:

* fast/css/selector-text-mutation-crash-expected.txt: Added.
* fast/css/selector-text-mutation-crash.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212828 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[Win] WebCrypto tests are failing.
pvollan@apple.com [Wed, 22 Feb 2017 14:12:37 +0000 (14:12 +0000)]
[Win] WebCrypto tests are failing.
https://bugs.webkit.org/show_bug.cgi?id=165090

Unreviewed test gardening.

* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212827 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUnreviewed GTK+ gardening. Mark fast/css/paint-order-shadow.html as failing.
carlosgc@webkit.org [Wed, 22 Feb 2017 13:23:21 +0000 (13:23 +0000)]
Unreviewed GTK+ gardening. Mark fast/css/paint-order-shadow.html as failing.

* platform/gtk/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212826 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUnreviewed GTK+ gardening. Mark http/tests/media/video-redirect.html as timing out.
carlosgc@webkit.org [Wed, 22 Feb 2017 13:15:02 +0000 (13:15 +0000)]
Unreviewed GTK+ gardening. Mark http/tests/media/video-redirect.html as timing out.

* platform/gtk/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212825 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUnreviewed GTK+ gardening. Remove duplicated entries.
carlosgc@webkit.org [Wed, 22 Feb 2017 13:09:00 +0000 (13:09 +0000)]
Unreviewed GTK+ gardening. Remove duplicated entries.

* platform/gtk/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212824 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[css-grid] Move the track sizing algorithm to its own class
svillar@igalia.com [Wed, 22 Feb 2017 11:44:15 +0000 (11:44 +0000)]
[css-grid] Move the track sizing algorithm to its own class
https://bugs.webkit.org/show_bug.cgi?id=167988

Reviewed by Manuel Rego Casasnovas.

This is about moving the track sizing algorithm code out of RenderGrid to a new class
GridTrackSizingAlgorithm, making RenderGrid more compact and easy to maintain. A nice side
effect of this patch is the removal of the GridSizingData structure as it is no longer
needed. All the data structures in that class were transferred to GridTrackSizingAlgorithm
as private attribute members. The GridTrack class was also moved to the new file.

The algorithm execution starts with the call to run(). It's mandatory to call setup() before
any call to run() in order to properly configure the behaviour of the algorithm. You can
call setup() & run() multiple times for a single layout operation (normally twice, one for
columns and another one for rows). The algorithm uses a state machine to verify that the
client issues the calls in the proper order (i.e. first columns and then rows). After
finishing the layout, the client should call reset() to allow the algorithm to perform
cleanups and to prepare itself for another round of calls.

In order to implement the different behaviours of the algorithm depending on whether the
available size is definite or not, a strategy pattern was implemented in the
GridTrackSizingAlgorithmStrategy class. It has two subclasses, one for definite sizes and
another one for indefinite ones.

We took advantage of this change to perform some renames of the track sizing algorithm
methods that were still using the names from the first versions of the specs. Not only that,
the original track sizing algorithm method (computeUsedBreadthOfGridTracks) was split in 4
different parts representing the 4 steps of the algorithm.

No new tests as this is about moving code and refactoring.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/GridTrackSizingAlgorithm.cpp: Added.
(WebCore::GridTrack::baseSize):
(WebCore::GridTrack::growthLimit):
(WebCore::GridTrack::setBaseSize):
(WebCore::GridTrack::setGrowthLimit):
(WebCore::GridTrack::growthLimitIfNotInfinite):
(WebCore::GridTrack::setTempSize):
(WebCore::GridTrack::growTempSize):
(WebCore::GridTrack::setGrowthLimitCap):
(WebCore::GridTrack::ensureGrowthLimitIsBiggerThanBaseSize):
(WebCore::shouldClearOverrideContainingBlockContentSizeForChild):
(WebCore::hasOverrideContainingBlockContentSizeForChild):
(WebCore::setOverrideContainingBlockContentSizeForChild):
(WebCore::flowAwareDirectionForChild):
(WebCore::overrideContainingBlockContentSizeForChild):
(WebCore::computeMarginLogicalSizeForChild):
(WebCore::marginIntrinsicLogicalWidthForChild):
(WebCore::GridTrackSizingAlgorithm::setFreeSpace):
(WebCore::GridTrackSizingAlgorithm::rawGridTrackSize):
(WebCore::GridTrackSizingAlgorithm::computeTrackBasedSize):
(WebCore::GridTrackSizingAlgorithm::initialBaseSize):
(WebCore::GridTrackSizingAlgorithm::initialGrowthLimit):
(WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
(WebCore::GridTrackSizingAlgorithm::spanningItemCrossesFlexibleSizedTracks):
(WebCore::GridItemWithSpan::GridItemWithSpan):
(WebCore::GridItemWithSpan::gridItem):
(WebCore::GridItemWithSpan::span):
(WebCore::GridItemWithSpan::operator<):
(WebCore::GridTrackSizingAlgorithm::itemSizeForTrackSizeComputationPhase):
(WebCore::shouldProcessTrackForTrackSizeComputationPhase):
(WebCore::trackSizeForTrackSizeComputationPhase):
(WebCore::updateTrackSizeForTrackSizeComputationPhase):
(WebCore::trackShouldGrowBeyondGrowthLimitsForTrackSizeComputationPhase):
(WebCore::markAsInfinitelyGrowableForTrackSizeComputationPhase):
(WebCore::GridTrackSizingAlgorithm::increaseSizesToAccommodateSpanningItems):
(WebCore::sortByGridTrackGrowthPotential):
(WebCore::clampGrowthShareIfNeeded):
(WebCore::GridTrackSizingAlgorithm::distributeSpaceToTracks):
(WebCore::GridTrackSizingAlgorithm::assumedRowsSizeForOrthogonalChild):
(WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild):
(WebCore::GridTrackSizingAlgorithm::gridTrackSize):
(WebCore::GridTrackSizingAlgorithm::computeFlexFactorUnitSize):
(WebCore::GridTrackSizingAlgorithm::computeFlexSizedTracksGrowth):
(WebCore::GridTrackSizingAlgorithm::findFrUnitSize):
(WebCore::GridTrackSizingAlgorithm::computeGridContainerIntrinsicSizes):
(WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild):
(WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild):
(WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild):
(WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild):
(WebCore::GridTrackSizingAlgorithmStrategy::updateOverrideContainingBlockContentSizeForChild):
(WebCore::IndefiniteSizeStrategy::minLogicalWidthForChild):
(WebCore::IndefiniteSizeStrategy::layoutGridItemForMinSizeComputation):
(WebCore::IndefiniteSizeStrategy::maximizeTracks):
(WebCore::normalizedFlexFraction):
(WebCore::IndefiniteSizeStrategy::findUsedFlexFraction):
(WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded):
(WebCore::DefiniteSizeStrategy::minLogicalWidthForChild):
(WebCore::DefiniteSizeStrategy::maximizeTracks):
(WebCore::DefiniteSizeStrategy::layoutGridItemForMinSizeComputation):
(WebCore::DefiniteSizeStrategy::findUsedFlexFraction):
(WebCore::DefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded):
(WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
(WebCore::GridTrackSizingAlgorithm::resolveIntrinsicTrackSizes):
(WebCore::GridTrackSizingAlgorithm::stretchFlexibleTracks):
(WebCore::GridTrackSizingAlgorithm::advanceNextState):
(WebCore::GridTrackSizingAlgorithm::isValidTransition):
(WebCore::GridTrackSizingAlgorithm::setup):
(WebCore::GridTrackSizingAlgorithm::run):
(WebCore::GridTrackSizingAlgorithm::reset):
(WebCore::GridTrackSizingAlgorithm::tracksAreWiderThanMinTrackBreadth):
(WebCore::GridTrackSizingAlgorithm::StateMachine::StateMachine):
(WebCore::GridTrackSizingAlgorithm::StateMachine::~StateMachine):
* rendering/GridTrackSizingAlgorithm.h: Added.
(WebCore::GridTrack::GridTrack):
(WebCore::GridTrack::infiniteGrowthPotential):
(WebCore::GridTrack::plannedSize):
(WebCore::GridTrack::setPlannedSize):
(WebCore::GridTrack::tempSize):
(WebCore::GridTrack::infinitelyGrowable):
(WebCore::GridTrack::setInfinitelyGrowable):
(WebCore::GridTrack::growthLimitCap):
(WebCore::GridTrack::growthLimitIsInfinite):
(WebCore::GridTrack::isGrowthLimitBiggerThanBaseSize):
(WebCore::GridTrackSizingAlgorithmStrategy::GridTrackSizingAlgorithmStrategy):
(WebCore::GridTrackSizingAlgorithmStrategy::computeTrackBasedSize):
(WebCore::GridTrackSizingAlgorithmStrategy::direction):
(WebCore::GridTrackSizingAlgorithmStrategy::findFrUnitSize):
(WebCore::GridTrackSizingAlgorithmStrategy::distributeSpaceToTracks):
(WebCore::GridTrackSizingAlgorithmStrategy::renderGrid):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::RenderGrid):
(WebCore::RenderGrid::computeTrackBasedLogicalHeight):
(WebCore::RenderGrid::computeTrackSizesForDefiniteSize):
(WebCore::RenderGrid::repeatTracksSizingIfNeeded):
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths):
(WebCore::RenderGrid::computeTrackSizesForIndefiniteSize):
(WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
(WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
(WebCore::RenderGrid::layoutGridItems):
(WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets):
(WebCore::RenderGrid::populateGridPositionsForDirection):
(WebCore::RenderGrid::columnAxisOffsetForChild):
(WebCore::RenderGrid::rowAxisOffsetForChild):
(WebCore::RenderGrid::findChildLogicalPosition):
(WebCore::GridTrack::GridTrack): Deleted.
(WebCore::GridTrack::baseSize): Deleted.
(WebCore::GridTrack::growthLimit): Deleted.
(WebCore::GridTrack::setBaseSize): Deleted.
(WebCore::GridTrack::setGrowthLimit): Deleted.
(WebCore::GridTrack::infiniteGrowthPotential): Deleted.
(WebCore::GridTrack::growthLimitIfNotInfinite): Deleted.
(WebCore::GridTrack::plannedSize): Deleted.
(WebCore::GridTrack::setPlannedSize): Deleted.
(WebCore::GridTrack::tempSize): Deleted.
(WebCore::GridTrack::setTempSize): Deleted.
(WebCore::GridTrack::growTempSize): Deleted.
(WebCore::GridTrack::infinitelyGrowable): Deleted.
(WebCore::GridTrack::setInfinitelyGrowable): Deleted.
(WebCore::GridTrack::setGrowthLimitCap): Deleted.
(WebCore::GridTrack::growthLimitCap): Deleted.
(WebCore::GridTrack::growthLimitIsInfinite): Deleted.
(WebCore::GridTrack::isGrowthLimitBiggerThanBaseSize): Deleted.
(WebCore::GridTrack::ensureGrowthLimitIsBiggerThanBaseSize): Deleted.
(WebCore::RenderGrid::GridSizingData::GridSizingData): Deleted.
(WebCore::RenderGrid::GridSizingData::freeSpace): Deleted.
(WebCore::RenderGrid::GridSizingData::availableSpace): Deleted.
(WebCore::RenderGrid::GridSizingData::setAvailableSpace): Deleted.
(WebCore::RenderGrid::GridSizingData::advanceNextState): Deleted.
(WebCore::RenderGrid::GridSizingData::isValidTransition): Deleted.
(WebCore::RenderGrid::GridSizingData::grid): Deleted.
(WebCore::RenderGrid::GridSizingData::setFreeSpace): Deleted.
(WebCore::RenderGrid::computeTrackSizesForDirection): Deleted.
(WebCore::RenderGrid::computeIntrinsicLogicalHeight): Deleted.
(WebCore::normalizedFlexFraction): Deleted.
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks): Deleted.
(WebCore::RenderGrid::computeFlexSizedTracksGrowth): Deleted.
(WebCore::RenderGrid::computeUsedBreadthOfMinLength): Deleted.
(WebCore::RenderGrid::computeUsedBreadthOfMaxLength): Deleted.
(WebCore::RenderGrid::computeFlexFactorUnitSize): Deleted.
(WebCore::RenderGrid::findFlexFactorUnitSize): Deleted.
(WebCore::hasOverrideContainingBlockContentSizeForChild): Deleted.
(WebCore::setOverrideContainingBlockContentSizeForChild): Deleted.
(WebCore::shouldClearOverrideContainingBlockContentSizeForChild): Deleted.
(WebCore::RenderGrid::rawGridTrackSize): Deleted.
(WebCore::RenderGrid::gridTrackSize): Deleted.
(WebCore::RenderGrid::logicalHeightForChild): Deleted.
(WebCore::RenderGrid::minSizeForChild): Deleted.
(WebCore::RenderGrid::updateOverrideContainingBlockContentSizeForChild): Deleted.
(WebCore::RenderGrid::minContentForChild): Deleted.
(WebCore::RenderGrid::maxContentForChild): Deleted.
(WebCore::GridItemWithSpan::GridItemWithSpan): Deleted.
(WebCore::GridItemWithSpan::gridItem): Deleted.
(WebCore::GridItemWithSpan::span): Deleted.
(WebCore::GridItemWithSpan::operator<): Deleted.
(WebCore::RenderGrid::spanningItemCrossesFlexibleSizedTracks): Deleted.
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions): Deleted.
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems): Deleted.
(WebCore::trackSizeForTrackSizeComputationPhase): Deleted.
(WebCore::RenderGrid::shouldProcessTrackForTrackSizeComputationPhase): Deleted.
(WebCore::RenderGrid::trackShouldGrowBeyondGrowthLimitsForTrackSizeComputationPhase): Deleted.
(WebCore::RenderGrid::markAsInfinitelyGrowableForTrackSizeComputationPhase): Deleted.
(WebCore::RenderGrid::updateTrackSizeForTrackSizeComputationPhase): Deleted.
(WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase): Deleted.
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems): Deleted.
(WebCore::sortByGridTrackGrowthPotential): Deleted.
(WebCore::clampGrowthShareIfNeeded): Deleted.
(WebCore::RenderGrid::distributeSpaceToTracks): Deleted.
(WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth): Deleted.
(WebCore::RenderGrid::assumedRowsSizeForOrthogonalChild): Deleted.
(WebCore::RenderGrid::gridAreaBreadthForChild): Deleted.
* rendering/RenderGrid.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212823 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[Win] Crash under CACFLayerTreeHost::acceleratedCompositingAvailable().
pvollan@apple.com [Wed, 22 Feb 2017 11:34:46 +0000 (11:34 +0000)]
[Win] Crash under CACFLayerTreeHost::acceleratedCompositingAvailable().
https://bugs.webkit.org/show_bug.cgi?id=168711

Reviewed by Alex Christensen.

Add null pointer check.

* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::CACFLayerTreeHost::acceleratedCompositingAvailable):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212822 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUnreviewed GTK+ gardening. Mark WebRTC tests failing after r212812.
carlosgc@webkit.org [Wed, 22 Feb 2017 11:08:50 +0000 (11:08 +0000)]
Unreviewed GTK+ gardening. Mark WebRTC tests failing after r212812.

* platform/gtk/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212821 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoJSModuleNamespace object should have IC
utatane.tea@gmail.com [Wed, 22 Feb 2017 09:23:08 +0000 (09:23 +0000)]
JSModuleNamespace object should have IC
https://bugs.webkit.org/show_bug.cgi?id=160590

Reviewed by Saam Barati.

JSTests:

* modules/module-assert-access-binding.js: Added.
* modules/module-assert-access-namespace.js: Added.
* modules/namespace-empty.js: Added.
(from.string_appeared_here.access):
(i.shouldThrow):
* stress/module-namespace-access-change.js: Added.
(shouldBe):
(access):
(import.string_appeared_here.then):
* stress/module-namespace-access-non-constant.js: Added.
(shouldBe):
(import.string_appeared_here.then):
* stress/module-namespace-access-poly.js: Added.
(shouldBe):
(access):
(import.string_appeared_here.then):
* stress/module-namespace-access-transitive-exports.js: Added.
(shouldBe):
(import.string_appeared_here.then):
* stress/module-namespace-access.js: Added.
(shouldBe):
(import.string_appeared_here.then):
* stress/resources/module-namespace-access-transitive-exports-2.js: Added.
(export.cocoa):
(export.change):
* stress/resources/module-namespace-access-transitive-exports.js: Added.
* stress/resources/module-namespace-access.js: Added.
(export.cocoa):
(export.change):

Source/JavaScriptCore:

This patch optimizes accesses to module namespace objects.

1. Cache the resolutions for module namespace objects.

    When constructing the module namespace object, we already resolves all the exports.
    The module namespace object caches this result and leverage it in the later access in
    getOwnPropertySlot. This avoids resolving bindings through resolveExport.

2. Introduce ModuleNamespaceLoad IC.

    This patch adds new IC for module namespace objects. The mechanism is simple, getOwnPropertySlot
    tells us about module namespace object resolution. The IC first checks whether the given object
    is an expected module namespace object. If this check succeeds, we load the value from the module
    environment.

3. Introduce DFG/FTL optimization.

    After exploiting module namespace object accesses in (2), DFG can recognize this in ByteCodeParser.
    DFG will convert it to CheckCell with the namespace object and GetClosureVar from the cached environment.
    At that time, we have a chance to fold it to the constant.

This optimization improves the performance of accessing to module namespace objects.

Before
    $ time ../../WebKitBuild/module-ic-tot/Release/bin/jsc -m module-assert-access-namespace.js
    ../../WebKitBuild/module-ic-tot/Release/bin/jsc -m   0.43s user 0.03s system 101% cpu 0.451 total
    $ time ../../WebKitBuild/module-ic-tot/Release/bin/jsc -m module-assert-access-binding.js
    ../../WebKitBuild/module-ic-tot/Release/bin/jsc -m   0.08s user 0.02s system 103% cpu 0.104 total

After
    $ time ../../WebKitBuild/module-ic/Release/bin/jsc -m module-assert-access-namespace.js
    ../../WebKitBuild/module-ic/Release/bin/jsc -m   0.11s user 0.01s system 106% cpu 0.109 total
    $ time ../../WebKitBuild/module-ic/Release/bin/jsc -m module-assert-access-binding.js
    ../../WebKitBuild/module-ic/Release/bin/jsc -m module-assert-access-binding.j  0.08s user 0.02s system 102% cpu 0.105 total

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/AccessCase.cpp:
(JSC::AccessCase::create):
(JSC::AccessCase::guardedByStructureCheck):
(JSC::AccessCase::canReplace):
(JSC::AccessCase::visitWeak):
(JSC::AccessCase::generateWithGuard):
(JSC::AccessCase::generateImpl):
* bytecode/AccessCase.h:
* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::GetByIdStatus):
(JSC::GetByIdStatus::computeForStubInfoWithoutExitSiteFeedback):
(JSC::GetByIdStatus::makesCalls):
(JSC::GetByIdStatus::dump):
* bytecode/GetByIdStatus.h:
(JSC::GetByIdStatus::isModuleNamespace):
(JSC::GetByIdStatus::takesSlowPath):
(JSC::GetByIdStatus::moduleNamespaceObject):
(JSC::GetByIdStatus::moduleEnvironment):
(JSC::GetByIdStatus::scopeOffset):
* bytecode/ModuleNamespaceAccessCase.cpp: Added.
(JSC::ModuleNamespaceAccessCase::ModuleNamespaceAccessCase):
(JSC::ModuleNamespaceAccessCase::create):
(JSC::ModuleNamespaceAccessCase::~ModuleNamespaceAccessCase):
(JSC::ModuleNamespaceAccessCase::clone):
(JSC::ModuleNamespaceAccessCase::emit):
* bytecode/ModuleNamespaceAccessCase.h: Added.
(JSC::ModuleNamespaceAccessCase::moduleNamespaceObject):
(JSC::ModuleNamespaceAccessCase::moduleEnvironment):
(JSC::ModuleNamespaceAccessCase::scopeOffset):
* bytecode/PolymorphicAccess.cpp:
(WTF::printInternal):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleModuleNamespaceLoad):
(JSC::DFG::ByteCodeParser::handleGetById):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::loadValue):
* jit/Repatch.cpp:
(JSC::tryCacheGetByID):
* runtime/AbstractModuleRecord.cpp:
(JSC::AbstractModuleRecord::getModuleNamespace):
* runtime/JSModuleNamespaceObject.cpp:
(JSC::JSModuleNamespaceObject::finishCreation):
(JSC::JSModuleNamespaceObject::visitChildren):
(JSC::getValue):
(JSC::JSModuleNamespaceObject::getOwnPropertySlot):
(JSC::JSModuleNamespaceObject::getOwnPropertyNames):
* runtime/JSModuleNamespaceObject.h:
(JSC::isJSModuleNamespaceObject):
(JSC::JSModuleNamespaceObject::create): Deleted.
(JSC::JSModuleNamespaceObject::createStructure): Deleted.
(JSC::JSModuleNamespaceObject::moduleRecord): Deleted.
* runtime/JSModuleRecord.h:
(JSC::JSModuleRecord::moduleEnvironment): Deleted.
* runtime/PropertySlot.h:
(JSC::PropertySlot::PropertySlot):
(JSC::PropertySlot::domJIT):
(JSC::PropertySlot::moduleNamespaceSlot):
(JSC::PropertySlot::setValueModuleNamespace):
(JSC::PropertySlot::setCacheableCustom):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212818 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoFix ASAN build after activating libwebrtc.
achristensen@apple.com [Wed, 22 Feb 2017 08:55:30 +0000 (08:55 +0000)]
Fix ASAN build after activating libwebrtc.

* wtf/Ref.h:
__asan_address_is_poisoned returns an int, not a bool.
This didn't cause a problem before because we didn't include the real definition anywhere,
but libwebrtc includes <sanitizer/asan_interface.h> directly now so the return types need to be correct.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212817 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoNetworkProcess: Stop disabling buffering when NETWORK_CACHE is disabled in build
carlosgc@webkit.org [Wed, 22 Feb 2017 08:33:41 +0000 (08:33 +0000)]
NetworkProcess: Stop disabling buffering when NETWORK_CACHE is disabled in build
https://bugs.webkit.org/show_bug.cgi?id=168637

Reviewed by Alex Christensen.

It was added in r193752 as part of bug #137692 to fix an infinite loop in network process that happened in EFL
because they didn't enable the network cache at that time. I think that was actually a workaround, and it was
added without any comment so it has stayed there even when EFL enabled disk cache, and now that is gone. Looking
at current code I see no reason why buffering can't work with the disk cache disabled, so I think it's time to
remove that workaround.

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::maximumBufferingTime):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212816 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[GStreamer] Crash in MediaPlayerPrivateGStreamerMSE::buffered() when MEDIA_STREAM...
carlosgc@webkit.org [Wed, 22 Feb 2017 08:31:53 +0000 (08:31 +0000)]
[GStreamer] Crash in MediaPlayerPrivateGStreamerMSE::buffered() when MEDIA_STREAM is disabled
https://bugs.webkit.org/show_bug.cgi?id=168662

Reviewed by Michael Catanzaro.

When MEDIA_STREAM is disabled, if MediaPlayer::loadWithNextMediaEngine is called with a current engine and
there's no type specified, the next media engine that is used is the MSE one. Since there's no actually a media
stream, the engine is created but never loaded. When buffered is called it tries to use its media source that is
nullptr. It doesn't happen when MEDIA_STREAM is enabled, because the next media engine returned is Owr that
doesn't implement buffered and always returns an empty PlatformTimeRanges.

* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::buffered): Return an empty PlatformTimeRanges if m_mediaSource is nullptr.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212815 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[GTK] Test fast/events/message-port-postMessage-recursive.html times out
carlosgc@webkit.org [Wed, 22 Feb 2017 08:30:18 +0000 (08:30 +0000)]
[GTK] Test fast/events/message-port-postMessage-recursive.html times out
https://bugs.webkit.org/show_bug.cgi?id=168570

Reviewed by Michael Catanzaro.

Source/WTF:

This has recently been added and the patch is good. It's just revealing a problem with our timers. The test is
posting a message recursively, and also starts a timeout timer to finish the test. The timeout timer is never
fired for us, because WebCore timers have lower priority than the one used by postMessage. ScriptExecutionContext
uses Document::postTask, that uses scheduleOnMainThread, that uses RunLoop::dispatch(). We are not setting any
priority for the timer used by RunLoop::dispatch, so it's using the default.
Use a RunLoop::Timer to schedule tasks to the main thread instead of using RunLoop::dispatch(). This allows us
to use a different priority, that is now set to G_PRIORITY_HIGH_IDLE + 20 to match WebCore timers. But it also
avoids the double queue we had with RunLoop::dispatch(), because scheduleOnMainThread() also queues the tasks.

* wtf/glib/MainThreadGLib.cpp:
(WTF::MainThreadDispatcher::MainThreadDispatcher):
(WTF::MainThreadDispatcher::schedule):
(WTF::MainThreadDispatcher::fired):
(WTF::scheduleDispatchFunctionsOnMainThread):

LayoutTests:

* platform/gtk/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212814 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUnreviewed. Rename AirGraphColoring.* files to AirAllocateRegistersByGraphColoring...
sbarati@apple.com [Wed, 22 Feb 2017 08:04:18 +0000 (08:04 +0000)]
Unreviewed. Rename AirGraphColoring.* files to AirAllocateRegistersByGraphColoring.* to be more consistent with the rest of the Air file names.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/air/AirAllocateRegistersByGraphColoring.cpp: Copied from Source/JavaScriptCore/b3/air/AirGraphColoring.cpp.
* b3/air/AirAllocateRegistersByGraphColoring.h: Copied from Source/JavaScriptCore/b3/air/AirGraphColoring.h.
* b3/air/AirGenerate.cpp:
* b3/air/AirGraphColoring.cpp: Removed.
* b3/air/AirGraphColoring.h: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212813 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[WebRTC][Mac] Activate libwebrtc
achristensen@apple.com [Wed, 22 Feb 2017 07:59:59 +0000 (07:59 +0000)]
[WebRTC][Mac] Activate libwebrtc
https://bugs.webkit.org/show_bug.cgi?id=167293
LayoutTests/imported/w3c:

<rdar://problem/30401864>

Patch by Youenn Fablet <youennf@gmail.com> on 2017-02-21
Reviewed by Alex Christensen.

* web-platform-tests/webrtc/datachannel-emptystring-expected.txt:
* web-platform-tests/webrtc/no-media-call-expected.txt:
* web-platform-tests/webrtc/promises-call-expected.txt:

Source/JavaScriptCore:

<rdar://problem/30401864>

Patch by Youenn Fablet <youenn@apple.com> on 2017-02-21
Reviewed by Alex Christensen.

* Configurations/FeatureDefines.xcconfig:

Source/ThirdParty/libwebrtc:

<rdar://problem/30401864>

Patch by Youenn Fablet <youenn@apple.com> on 2017-02-21
Reviewed by Alex Christensen.

Doing some clean-up.

* Configurations/libwebrtc.xcconfig:
* Source/webrtc/base/checks.h:
* libwebrtc.xcodeproj/project.pbxproj:

Source/WebCore:

Patch by Youenn Fablet <youenn@apple.com> on 2017-02-21
Reviewed by Alex Christensen.

* Configurations/WebCore.xcconfig:
* Configurations/WebCoreTestSupport.xcconfig:
* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

Patch by Youenn Fablet <youenn@apple.com> on 2017-02-21
Reviewed by Alex Christensen.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

<rdar://problem/30401864>

Patch by Youenn Fablet <youenn@apple.com> on 2017-02-21
Reviewed by Alex Christensen.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

<rdar://problem/30401864>

Patch by Youenn Fablet <youenn@apple.com> on 2017-02-21
Reviewed by Alex Christensen.

Activating PeerConnection runtime flag based on successful loading of libwebrtc.dylib.

* Configurations/WebKit.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferencesDefinitions.h:
* UIProcess/WebPreferences.cpp:
(WebKit::checkWebRTCAvailability):

Source/WTF:

Patch by Youenn Fablet <youenn@apple.com> on 2017-02-21
Reviewed by Alex Christensen.

* wtf/Platform.h:

Tools:

<rdar://problem/30401864>

Patch by Youenn Fablet <youenn@apple.com> on 2017-02-21
Reviewed by Alex Christensen.

Fixing paths to allow loading libwebrtc.dylib successfully.

* Scripts/build-webkit:
* Scripts/webkitdirs.pm:
(setupMacWebKitEnvironment):
(setupIOSWebKitEnvironment):
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

LayoutTests:

<rdar://problem/30401864>

Patch by Youenn Fablet <youenn@apple.com> on 2017-02-21
Reviewed by Alex Christensen.

* TestExpectations:
* fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt:
* fast/mediastream/RTCPeerConnection-addTrack-reuse-sender-expected.txt:
* fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt:
* fast/mediastream/RTCPeerConnection-legacy-stream-based-api-expected.txt:
* platform/gtk/TestExpectations:
* platform/gtk/fast/mediastream/RTCPeerConnection-AddRemoveStream-expected.txt: Added.
* platform/gtk/fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt: Copied from LayoutTests/fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt.
* platform/gtk/fast/mediastream/RTCPeerConnection-addTrack-reuse-sender-expected.txt: Copied from LayoutTests/fast/mediastream/RTCPeerConnection-addTrack-reuse-sender-expected.txt.
* platform/gtk/fast/mediastream/RTCPeerConnection-closed-state-expected.txt: Added.
* platform/gtk/fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt: Copied from LayoutTests/fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt.
* platform/gtk/fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event-expected.txt: Added.
* platform/gtk/fast/mediastream/RTCPeerConnection-legacy-stream-based-api-expected.txt: Copied from LayoutTests/fast/mediastream/RTCPeerConnection-legacy-stream-based-api-expected.txt.
* platform/gtk/fast/mediastream/RTCPeerConnection-onnegotiationneeded-expected.txt: Added.
* platform/gtk/fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt: Added.
* platform/gtk/fast/mediastream/RTCRtpSender-replaceTrack-expected.txt: Added.
* platform/gtk/fast/mediastream/no-media-call-expected.txt: Added.
* platform/ios-simulator-wk2/TestExpectations:
* platform/mac-wk1/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212812 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUnreviewed. Fix WinCairo build after r212703.
carlosgc@webkit.org [Wed, 22 Feb 2017 07:54:37 +0000 (07:54 +0000)]
Unreviewed. Fix WinCairo build after r212703.

* platform/TextureMapper.cmake:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212811 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUnreviewed, rolling out r212786.
commit-queue@webkit.org [Wed, 22 Feb 2017 07:43:33 +0000 (07:43 +0000)]
Unreviewed, rolling out r212786.
https://bugs.webkit.org/show_bug.cgi?id=168710

It broke GTK+ port when using single shared process model
(Requested by KaL on #webkit).

Reverted changeset:

"Refactor WebViewImpl creation in preparation for supporting
multiple WebsiteDataStores."
https://bugs.webkit.org/show_bug.cgi?id=168676
http://trac.webkit.org/changeset/212786

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212810 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoExport various NSString symbols from WebFramePrivate.h
aakash_jain@apple.com [Wed, 22 Feb 2017 06:57:13 +0000 (06:57 +0000)]
Export various NSString symbols from WebFramePrivate.h
https://bugs.webkit.org/show_bug.cgi?id=168702

Reviewed by Alexey Proskuryakov.

* WebKit.exp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212809 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoAdd support for CSS properties paint-order, stroke-linecap, and stroke-linejoin in...
pvollan@apple.com [Wed, 22 Feb 2017 06:55:54 +0000 (06:55 +0000)]
Add support for CSS properties paint-order, stroke-linecap, and stroke-linejoin in text rendering.
https://bugs.webkit.org/show_bug.cgi?id=168601
Source/WebCore:

rdar://problem/30583872

Reviewed by Simon Fraser.

Text rendering should respect the CSS properties paint-order, stroke-linecap, and stroke-linejoin,
see https://drafts.fxtf.org/paint/. The text rendering changes are mainly in the TextPainter class,
where text is painted in three phases (fill, stroke, markers), where the order follows the
paint-order property. The linecap and linejoin properties are set on the graphics context before
rendering the text.

Tests: fast/css/paint-order.html
       fast/css/paint-order-shadow.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::paintOrder):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertPaintOrder):
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextPaintStyle):
(WebCore::updateGraphicsContext):
* rendering/TextPaintStyle.h:
* rendering/TextPainter.cpp:
(WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::paintTypesForPaintOrder):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setPaintOrder):
(WebCore::RenderStyle::initialPaintOrder):
* rendering/style/RenderStyleConstants.h:
* rendering/style/SVGRenderStyleDefs.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::fillStrokeMarkers):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::paint):

LayoutTests:

Reviewed by Simon Fraser.

* fast/css/paint-order-expected.html: Added.
* fast/css/paint-order-shadow-expected.html: Added.
* fast/css/paint-order-shadow.html: Added.
* fast/css/paint-order.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212808 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoRemove the extra `'s errornously added during the final editing.
rniwa@webkit.org [Wed, 22 Feb 2017 06:51:07 +0000 (06:51 +0000)]
Remove the extra `'s errornously added during the final editing.

* ReadMe.md:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212807 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[User Timing] Throw a SyntaxError for performance.measure if mark name is not found
commit-queue@webkit.org [Wed, 22 Feb 2017 05:43:50 +0000 (05:43 +0000)]
[User Timing] Throw a SyntaxError for performance.measure if mark name is not found
https://bugs.webkit.org/show_bug.cgi?id=168707

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-02-21
Reviewed by Ryosuke Niwa.

Source/WebCore:

Test: performance-api/performance-measure-name.html

* page/PerformanceUserTiming.cpp:
(WebCore::UserTiming::findExistingMarkStartTime):
Instead of returning zero, throw a SyntaxError. This is more in line
with User Timing Level 1 and behavior in Window. This is an issue with
the Level 2 spec: https://github.com/w3c/user-timing/issues/21

LayoutTests:

* performance-api/performance-measure-name-expected.txt: Added.
* performance-api/performance-measure-name.html: Added.
* performance-api/resources/measure-name.js: Added.
Test to cover SyntaxError for missing measure start/end mark names.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212806 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoExport various NSString symbols from WebPreferencesPrivate.h
aakash_jain@apple.com [Wed, 22 Feb 2017 05:08:54 +0000 (05:08 +0000)]
Export various NSString symbols from WebPreferencesPrivate.h
https://bugs.webkit.org/show_bug.cgi?id=168701

Reviewed by Alexey Proskuryakov.

* WebKit.exp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212805 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUnreviewed, marking a set of test cases as skipped while we investigate.
wilander@apple.com [Wed, 22 Feb 2017 04:28:21 +0000 (04:28 +0000)]
Unreviewed, marking a set of test cases as skipped while we investigate.

Both the test cases and the new code are part of
https://bugs.webkit.org/show_bug.cgi?id=168347. Crashes so far only happen
on release builds on the bots. Not locally release nor debug.

* platform/wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212800 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoAdd the Briggs optimistic allocator to run on ARM64
sbarati@apple.com [Wed, 22 Feb 2017 04:17:32 +0000 (04:17 +0000)]
Add the Briggs optimistic allocator to run on ARM64
https://bugs.webkit.org/show_bug.cgi?id=168454

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

This patch adds the Briggs allocator to Air:
http://www.cs.utexas.edu/users/mckinley/380C/lecs/briggs-thesis-1992.pdf
It uses it by default on ARM64. I was measuring an 8-10% speedup
in the phase because of this. I also wasn't able to detect a slowdown
for generated code on ARM64. There are still a few things we can do
to speed things up even further. Moving the interference graph into
a BitVector was another 10-20% speedup. We should consider doing this
in a follow up patch. This is especially important now, since making
register allocation faster has a direct impact on startup time for
Wasm modules.

I abstracted away the common bits between Briggs and IRC, and moved
them into a common super class. In a follow up to this patch, I plan
on implementing biased coloring for both Briggs and IRC (this is
described in Briggs's thesis). I was able to detect a 1% slowdown
with Briggs on Octane for x86-64. This is because the register file
for x86-64 is smaller than ARM64. When I implemented biased coloring,
I was no longer able to detect this slowdown. I still think it's a
sensible plan to run Briggs on ARM64 and IRC on x86-64.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/air/AirGenerate.cpp:
(JSC::B3::Air::prepareForGeneration):
* b3/air/AirGraphColoring.cpp: Copied from Source/JavaScriptCore/b3/air/AirIteratedRegisterCoalescing.cpp.
(JSC::B3::Air::allocateRegistersByGraphColoring):
(JSC::B3::Air::iteratedRegisterCoalescing): Deleted.
* b3/air/AirGraphColoring.h: Copied from Source/JavaScriptCore/b3/air/AirIteratedRegisterCoalescing.h.
* b3/air/AirIteratedRegisterCoalescing.cpp: Removed.
* b3/air/AirIteratedRegisterCoalescing.h: Removed.
* runtime/Options.h:

Tools:

* Scripts/run-jsc-stress-tests:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212799 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoAdd missing WebConsoleMessage string key
commit-queue@webkit.org [Wed, 22 Feb 2017 03:08:33 +0000 (03:08 +0000)]
Add missing WebConsoleMessage string key
https://bugs.webkit.org/show_bug.cgi?id=168690

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-02-21
Reviewed by Alexey Proskuryakov.

* WebKit.exp:
* WebView/WebUIDelegatePrivate.h:
This key has an implementation but was not extern / exported like the others.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212797 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoMake WebKitStatisticsPrivate.h project header
aakash_jain@apple.com [Wed, 22 Feb 2017 02:42:43 +0000 (02:42 +0000)]
Make WebKitStatisticsPrivate.h project header
https://bugs.webkit.org/show_bug.cgi?id=168686

Reviewed by Alexey Proskuryakov.

* WebKit.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212795 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoExport various NSString symbols from WebViewPrivate.h
aakash_jain@apple.com [Wed, 22 Feb 2017 02:39:31 +0000 (02:39 +0000)]
Export various NSString symbols from WebViewPrivate.h
https://bugs.webkit.org/show_bug.cgi?id=168689

Reviewed by Alexey Proskuryakov.

* WebKit.exp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212792 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoAdd more missing exception checks detected by running marathon.js.
mark.lam@apple.com [Wed, 22 Feb 2017 02:29:48 +0000 (02:29 +0000)]
Add more missing exception checks detected by running marathon.js.
https://bugs.webkit.org/show_bug.cgi?id=168697

Reviewed by Saam Barati.

* runtime/StringPrototype.cpp:
(JSC::replaceUsingRegExpSearch):
(JSC::replaceUsingStringSearch):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212791 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoAdd ReadMe.md to WebKit
rniwa@webkit.org [Wed, 22 Feb 2017 02:16:35 +0000 (02:16 +0000)]
Add ReadMe.md to WebKit
https://bugs.webkit.org/show_bug.cgi?id=168413

Reviewed by Chris Dumez.

Add a ReadMe.md to be read on https://github.com/WebKit/webkit based on webkit.org content.

* ReadMe.md: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212790 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUnreviewed attempt to fix the Windows build.
ryanhaddad@apple.com [Wed, 22 Feb 2017 02:04:57 +0000 (02:04 +0000)]
Unreviewed attempt to fix the Windows build.

* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::supportsSubpixelAntialiasedText):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212789 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUnreviewed, rolling out r212737.
ryanhaddad@apple.com [Wed, 22 Feb 2017 01:59:57 +0000 (01:59 +0000)]
Unreviewed, rolling out r212737.

This change caused an existing LayoutTest to crash.

Reverted changeset:

"REGRESSION(r207669): Crash after mutating selector text"
https://bugs.webkit.org/show_bug.cgi?id=168655
http://trac.webkit.org/changeset/212737

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212788 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUnreviewed, rolling out r212768.
commit-queue@webkit.org [Wed, 22 Feb 2017 01:58:29 +0000 (01:58 +0000)]
Unreviewed, rolling out r212768.
https://bugs.webkit.org/show_bug.cgi?id=168698

Rolling out since this would break other projects. (Requested
by aakashjain on #webkit).

Reverted changeset:

"[iOS] Remove old WebKit1 MemoryMeasure helper."
https://bugs.webkit.org/show_bug.cgi?id=168675
http://trac.webkit.org/changeset/212768

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212787 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoRefactor WebViewImpl creation in preparation for supporting multiple WebsiteDataStores.
beidson@apple.com [Wed, 22 Feb 2017 01:35:13 +0000 (01:35 +0000)]
Refactor WebViewImpl creation in preparation for supporting multiple WebsiteDataStores.
https://bugs.webkit.org/show_bug.cgi?id=168676

Reviewed by Alex Christensen.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]): Allow for WebViewImpl creation to fail.

* UIProcess/API/mac/WKView.mm:
(-[WKView initWithFrame:processPool:configuration:]): Ditto.

* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::maybeCreate):
(WebKit::WebViewImpl::WebViewImpl):

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcess): New WebProcess creation might fail. Handle it.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcess):
(WebKit::WebProcessPool::warmInitialProcess):
(WebKit::WebProcessPool::maybeCreateNewWebProcessRespectingProcessCountLimit): This can now fail
  if the process will have a non-default WebsiteDataStore but we've already reached the process cap.
(WebKit::WebProcessPool::createWebPage):
(WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit): Deleted.
* UIProcess/WebProcessPool.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212786 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoREGRESSION (r207720): /more/conformance/conformance/quickCheckAPI-S_V.html test fails
cdumez@apple.com [Wed, 22 Feb 2017 01:19:42 +0000 (01:19 +0000)]
REGRESSION (r207720): /more/conformance/conformance/quickCheckAPI-S_V.html test fails
https://bugs.webkit.org/show_bug.cgi?id=168632
<rdar://problem/30620129>

Reviewed by Darin Adler.

Source/WebCore:

After r207720, the following WebGL conformance tests started failing:
- /more/conformance/conformance/quickCheckAPI-S_V.html
- /context/context-lost.html

We started throwing security errors in case where we did not before.
Chrome and Firefox are both passing these tests so our new behavior was not interoperable.

This patch reverts part of r207720 to restore our previous behavior.

* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::texSubImage2D):
(WebCore::WebGLRenderingContextBase::texImage2D):
(WebCore::WebGLRenderingContextBase::validateHTMLImageElement):
(WebCore::WebGLRenderingContextBase::validateHTMLCanvasElement):
(WebCore::WebGLRenderingContextBase::validateHTMLVideoElement):
* html/canvas/WebGLRenderingContextBase.h:

LayoutTests:

Import layout test coverage.

* http/tests/webgl/1.0.2/resources/webgl_test_files/conformance/context/context-lost-expected.txt: Added.
* http/tests/webgl/1.0.2/resources/webgl_test_files/conformance/context/context-lost.html: Added.
* http/tests/webgl/1.0.2/resources/webgl_test_files/conformance/more/conformance/argGenerators-S_V.js: Added.
* http/tests/webgl/1.0.2/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-S_V-expected.txt: Added.
* http/tests/webgl/1.0.2/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI-S_V.html: Added.
* http/tests/webgl/1.0.2/resources/webgl_test_files/conformance/more/conformance/quickCheckAPI.js: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212784 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoNo need for static attributes when creating a pixel format
dino@apple.com [Wed, 22 Feb 2017 01:18:31 +0000 (01:18 +0000)]
No need for static attributes when creating a pixel format
https://bugs.webkit.org/show_bug.cgi?id=168688
<rdar://problem/30642256>

Reviewed by Myles Maxfield.

Just create the attributes when needed.

* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::GraphicsContext3DManager::updateHighPerformanceState):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212783 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoFullCodeOrigin for CodeBlock+CodeOrigin printing
jfbastien@apple.com [Wed, 22 Feb 2017 01:16:42 +0000 (01:16 +0000)]
FullCodeOrigin for CodeBlock+CodeOrigin printing
https://bugs.webkit.org/show_bug.cgi?id=168673

Reviewed by Filip Pizlo.

WebAssembly doesn't have a CodeBlock, so printing it isn't
valid. This patch adds FullCodeOrigin to handle the
CodeBlock+CodeOrigin printing pattern, and uses it through all the
places I could find, including Repatch.cpp where it's relevant for
WebAssembly.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::noticeIncomingCall):
* bytecode/FullCodeOrigin.cpp: Added.
(JSC::FullCodeOrigin::dump):
(JSC::FullCodeOrigin::dumpInContext):
* bytecode/FullCodeOrigin.h: Added.
(JSC::FullCodeOrigin::FullCodeOrigin):
* bytecode/PolymorphicAccess.cpp:
(JSC::PolymorphicAccess::regenerate):
* jit/PolymorphicCallStubRoutine.cpp:
(JSC::PolymorphicCallStubRoutine::PolymorphicCallStubRoutine):
* jit/Repatch.cpp:
(JSC::linkFor):
(JSC::linkDirectFor):
(JSC::linkVirtualFor):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212782 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[WebRTC] WebKit2 should assert that libwebrtc transmitted IP addresses family is...
commit-queue@webkit.org [Wed, 22 Feb 2017 01:07:10 +0000 (01:07 +0000)]
[WebRTC] WebKit2 should assert that libwebrtc transmitted IP addresses family is IP4 or IP6
https://bugs.webkit.org/show_bug.cgi?id=168691

Patch by Youenn Fablet <youenn@apple.com> on 2017-02-21
Reviewed by Alex Christensen.

Adding some asserts that family is IPv4 or IPv6.

* Shared/RTCNetwork.cpp:
(WebKit::RTCNetwork::IPAddress::decode):
(WebKit::RTCNetwork::IPAddress::encode):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212781 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUnreviewed, fix cloop. I managed to have my local patch for relanding be the one...
fpizlo@apple.com [Wed, 22 Feb 2017 01:05:13 +0000 (01:05 +0000)]
Unreviewed, fix cloop. I managed to have my local patch for relanding be the one without the cloop
fix. I keep forgetting about cloop!

* heap/Heap.cpp:
(JSC::Heap::stopThePeriphery):
* runtime/JSLock.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212780 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoAdd missing exception checks detected by running marathon.js.
mark.lam@apple.com [Wed, 22 Feb 2017 01:01:16 +0000 (01:01 +0000)]
Add missing exception checks detected by running marathon.js.
https://bugs.webkit.org/show_bug.cgi?id=168687

Reviewed by Saam Barati.

When running the marathon.js test from https://bugs.webkit.org/show_bug.cgi?id=168580,
we get some crashes due to missing exception checks.  This patch adds those
missing exception checks.

* runtime/JSCJSValueInlines.h:
(JSC::JSValue::toPropertyKey):
* runtime/JSObject.cpp:
(JSC::JSObject::getPrimitiveNumber):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212779 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoThe collector thread should only start when the mutator doesn't have heap access
fpizlo@apple.com [Wed, 22 Feb 2017 00:58:15 +0000 (00:58 +0000)]
The collector thread should only start when the mutator doesn't have heap access
https://bugs.webkit.org/show_bug.cgi?id=167737

Reviewed by Keith Miller.
JSTests:

Add versions of splay that flash heap access, to simulate what might happen if a third-party app
was running concurrent GC. In this case, we might actually start the collector thread.

* stress/splay-flash-access-1ms.js: Added.
(performance.now):
(this.Setup.setup.setup):
(this.TearDown.tearDown.tearDown):
(Benchmark):
(BenchmarkResult):
(BenchmarkResult.prototype.valueOf):
(BenchmarkSuite):
(alert):
(Math.random):
(BenchmarkSuite.ResetRNG):
(RunStep):
(BenchmarkSuite.RunSuites):
(BenchmarkSuite.CountBenchmarks):
(BenchmarkSuite.GeometricMean):
(BenchmarkSuite.GeometricMeanTime):
(BenchmarkSuite.AverageAbovePercentile):
(BenchmarkSuite.GeometricMeanLatency):
(BenchmarkSuite.FormatScore):
(BenchmarkSuite.prototype.NotifyStep):
(BenchmarkSuite.prototype.NotifyResult):
(BenchmarkSuite.prototype.NotifyError):
(BenchmarkSuite.prototype.RunSingleBenchmark):
(RunNextSetup):
(RunNextBenchmark):
(RunNextTearDown):
(BenchmarkSuite.prototype.RunStep):
(GeneratePayloadTree):
(GenerateKey):
(SplayUpdateStats):
(InsertNewNode):
(SplaySetup):
(SplayTearDown):
(SplayRun):
(SplayTree):
(SplayTree.prototype.isEmpty):
(SplayTree.prototype.insert):
(SplayTree.prototype.remove):
(SplayTree.prototype.find):
(SplayTree.prototype.findMax):
(SplayTree.prototype.findGreatestLessThan):
(SplayTree.prototype.exportKeys):
(SplayTree.prototype.splay_):
(SplayTree.Node):
(SplayTree.Node.prototype.traverse_):
(jscSetUp):
(jscTearDown):
(jscRun):
(averageAbovePercentile):
(printPercentile):
* stress/splay-flash-access.js: Added.
(performance.now):
(this.Setup.setup.setup):
(this.TearDown.tearDown.tearDown):
(Benchmark):
(BenchmarkResult):
(BenchmarkResult.prototype.valueOf):
(BenchmarkSuite):
(alert):
(Math.random):
(BenchmarkSuite.ResetRNG):
(RunStep):
(BenchmarkSuite.RunSuites):
(BenchmarkSuite.CountBenchmarks):
(BenchmarkSuite.GeometricMean):
(BenchmarkSuite.GeometricMeanTime):
(BenchmarkSuite.AverageAbovePercentile):
(BenchmarkSuite.GeometricMeanLatency):
(BenchmarkSuite.FormatScore):
(BenchmarkSuite.prototype.NotifyStep):
(BenchmarkSuite.prototype.NotifyResult):
(BenchmarkSuite.prototype.NotifyError):
(BenchmarkSuite.prototype.RunSingleBenchmark):
(RunNextSetup):
(RunNextBenchmark):
(RunNextTearDown):
(BenchmarkSuite.prototype.RunStep):
(GeneratePayloadTree):
(GenerateKey):
(SplayUpdateStats):
(InsertNewNode):
(SplaySetup):
(SplayTearDown):
(SplayRun):
(SplayTree):
(SplayTree.prototype.isEmpty):
(SplayTree.prototype.insert):
(SplayTree.prototype.remove):
(SplayTree.prototype.find):
(SplayTree.prototype.findMax):
(SplayTree.prototype.findGreatestLessThan):
(SplayTree.prototype.exportKeys):
(SplayTree.prototype.splay_):
(SplayTree.Node):
(SplayTree.Node.prototype.traverse_):
(jscSetUp):
(jscTearDown):
(jscRun):
(averageAbovePercentile):
(printPercentile):

Source/JavaScriptCore:

This turns the collector thread's workflow into a state machine, so that the mutator thread can
run it directly. This reduces the amount of synchronization we do with the collector thread, and
means that most apps will never start the collector thread. The collector thread will still start
when we need to finish collecting and we don't have heap access.

In this new world, "stopping the world" means relinquishing control of collection to the mutator.
This means tracking who is conducting collection. I use the GCConductor enum to say who is
conducting. It's either GCConductor::Mutator or GCConductor::Collector. I use the term "conn" to
refer to the concept of conducting (having the conn, relinquishing the conn, taking the conn).
So, stopping the world means giving the mutator the conn. Releasing heap access means giving the
collector the conn.

This meant bringing back the conservative scan of the calling thread. It turns out that this
scan was too slow to be called on each GC increment because apparently setjmp() now does system
calls. So, I wrote our own callee save register saving for the GC. Then I had doubts about
whether or not it was correct, so I also made it so that the GC only rarely asks for the register
state. I think we still want to use my register saving code instead of setjmp because setjmp
seems to save things we don't need, and that could make us overly conservative.

It turns out that this new scheduling discipline makes the old space-time scheduler perform
better than the new stochastic space-time scheduler on systems with fewer than 4 cores. This is
because the mutator having the conn enables us to time the mutator<->collector context switches
by polling. The OS is never involved. So, we can use super precise timing. This allows the old
space-time schduler to shine like it hadn't before.

The splay results imply that this is all a good thing. On 2-core systems, this reduces pause
times by 40% and it increases throughput about 5%. On 1-core systems, this reduces pause times by
half and reduces throughput by 8%. On 4-or-more-core systems, this doesn't seem to have much
effect.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::visitChildren):
* dfg/DFGWorklist.cpp:
(JSC::DFG::Worklist::ThreadBody::ThreadBody):
(JSC::DFG::Worklist::dump):
(JSC::DFG::numberOfWorklists):
(JSC::DFG::ensureWorklistForIndex):
(JSC::DFG::existingWorklistForIndexOrNull):
(JSC::DFG::existingWorklistForIndex):
* dfg/DFGWorklist.h:
(JSC::DFG::numberOfWorklists): Deleted.
(JSC::DFG::ensureWorklistForIndex): Deleted.
(JSC::DFG::existingWorklistForIndexOrNull): Deleted.
(JSC::DFG::existingWorklistForIndex): Deleted.
* heap/CollectingScope.h: Added.
(JSC::CollectingScope::CollectingScope):
(JSC::CollectingScope::~CollectingScope):
* heap/CollectorPhase.cpp: Added.
(JSC::worldShouldBeSuspended):
(WTF::printInternal):
* heap/CollectorPhase.h: Added.
* heap/EdenGCActivityCallback.cpp:
(JSC::EdenGCActivityCallback::lastGCLength):
* heap/FullGCActivityCallback.cpp:
(JSC::FullGCActivityCallback::doCollection):
(JSC::FullGCActivityCallback::lastGCLength):
* heap/GCConductor.cpp: Added.
(JSC::gcConductorShortName):
(WTF::printInternal):
* heap/GCConductor.h: Added.
* heap/GCFinalizationCallback.cpp: Added.
(JSC::GCFinalizationCallback::GCFinalizationCallback):
(JSC::GCFinalizationCallback::~GCFinalizationCallback):
* heap/GCFinalizationCallback.h: Added.
(JSC::GCFinalizationCallbackFuncAdaptor::GCFinalizationCallbackFuncAdaptor):
(JSC::createGCFinalizationCallback):
* heap/Heap.cpp:
(JSC::Heap::Thread::Thread):
(JSC::Heap::Heap):
(JSC::Heap::lastChanceToFinalize):
(JSC::Heap::gatherStackRoots):
(JSC::Heap::updateObjectCounts):
(JSC::Heap::sweepSynchronously):
(JSC::Heap::collectAllGarbage):
(JSC::Heap::collectAsync):
(JSC::Heap::collectSync):
(JSC::Heap::shouldCollectInCollectorThread):
(JSC::Heap::collectInCollectorThread):
(JSC::Heap::checkConn):
(JSC::Heap::runNotRunningPhase):
(JSC::Heap::runBeginPhase):
(JSC::Heap::runFixpointPhase):
(JSC::Heap::runConcurrentPhase):
(JSC::Heap::runReloopPhase):
(JSC::Heap::runEndPhase):
(JSC::Heap::changePhase):
(JSC::Heap::finishChangingPhase):
(JSC::Heap::stopThePeriphery):
(JSC::Heap::resumeThePeriphery):
(JSC::Heap::stopTheMutator):
(JSC::Heap::resumeTheMutator):
(JSC::Heap::stopIfNecessarySlow):
(JSC::Heap::collectInMutatorThread):
(JSC::Heap::waitForCollector):
(JSC::Heap::acquireAccessSlow):
(JSC::Heap::releaseAccessSlow):
(JSC::Heap::relinquishConn):
(JSC::Heap::finishRelinquishingConn):
(JSC::Heap::handleNeedFinalize):
(JSC::Heap::notifyThreadStopping):
(JSC::Heap::finalize):
(JSC::Heap::addFinalizationCallback):
(JSC::Heap::requestCollection):
(JSC::Heap::waitForCollection):
(JSC::Heap::updateAllocationLimits):
(JSC::Heap::didFinishCollection):
(JSC::Heap::collectIfNecessaryOrDefer):
(JSC::Heap::notifyIsSafeToCollect):
(JSC::Heap::preventCollection):
(JSC::Heap::performIncrement):
(JSC::Heap::markToFixpoint): Deleted.
(JSC::Heap::shouldCollectInThread): Deleted.
(JSC::Heap::collectInThread): Deleted.
(JSC::Heap::stopTheWorld): Deleted.
(JSC::Heap::resumeTheWorld): Deleted.
* heap/Heap.h:
(JSC::Heap::machineThreads):
(JSC::Heap::lastFullGCLength):
(JSC::Heap::lastEdenGCLength):
(JSC::Heap::increaseLastFullGCLength):
* heap/HeapInlines.h:
(JSC::Heap::mutatorIsStopped): Deleted.
* heap/HeapStatistics.cpp: Removed.
* heap/HeapStatistics.h: Removed.
* heap/HelpingGCScope.h: Removed.
* heap/IncrementalSweeper.cpp:
(JSC::IncrementalSweeper::stopSweeping):
(JSC::IncrementalSweeper::willFinishSweeping): Deleted.
* heap/IncrementalSweeper.h:
* heap/MachineStackMarker.cpp:
(JSC::MachineThreads::gatherFromCurrentThread):
(JSC::MachineThreads::gatherConservativeRoots):
(JSC::callWithCurrentThreadState):
* heap/MachineStackMarker.h:
* heap/MarkedAllocator.cpp:
(JSC::MarkedAllocator::allocateSlowCaseImpl):
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::Handle::sweep):
* heap/MarkedSpace.cpp:
(JSC::MarkedSpace::sweep):
* heap/MutatorState.cpp:
(WTF::printInternal):
* heap/MutatorState.h:
* heap/RegisterState.h: Added.
* heap/RunningScope.h: Added.
(JSC::RunningScope::RunningScope):
(JSC::RunningScope::~RunningScope):
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::SlotVisitor):
(JSC::SlotVisitor::drain):
(JSC::SlotVisitor::drainFromShared):
(JSC::SlotVisitor::drainInParallelPassively):
(JSC::SlotVisitor::donateAll):
(JSC::SlotVisitor::donate):
* heap/SlotVisitor.h:
(JSC::SlotVisitor::codeName):
* heap/StochasticSpaceTimeMutatorScheduler.cpp:
(JSC::StochasticSpaceTimeMutatorScheduler::beginCollection):
(JSC::StochasticSpaceTimeMutatorScheduler::synchronousDrainingDidStall):
(JSC::StochasticSpaceTimeMutatorScheduler::timeToStop):
* heap/SweepingScope.h: Added.
(JSC::SweepingScope::SweepingScope):
(JSC::SweepingScope::~SweepingScope):
* jit/JITWorklist.cpp:
(JSC::JITWorklist::Thread::Thread):
* jsc.cpp:
(GlobalObject::finishCreation):
(functionFlashHeapAccess):
* runtime/InitializeThreading.cpp:
(JSC::initializeThreading):
* runtime/JSCellInlines.h:
(JSC::JSCell::classInfo):
* runtime/Options.cpp:
(JSC::overrideDefaults):
* runtime/Options.h:
* runtime/TestRunnerUtils.cpp:
(JSC::finalizeStatsAtEndOfTesting):

Source/WebCore:

Added new tests in JSTests.

The WebCore changes involve:

- Refactoring around new header discipline.

- Adding crazy GC APIs to window.internals to enable us to test the GC's runloop discipline.

* ForwardingHeaders/heap/GCFinalizationCallback.h: Added.
* ForwardingHeaders/heap/IncrementalSweeper.h: Added.
* ForwardingHeaders/heap/MachineStackMarker.h: Added.
* ForwardingHeaders/heap/RunningScope.h: Added.
* bindings/js/CommonVM.cpp:
* testing/Internals.cpp:
(WebCore::Internals::parserMetaData):
(WebCore::Internals::isReadableStreamDisturbed):
(WebCore::Internals::isGCRunning):
(WebCore::Internals::addGCFinalizationCallback):
(WebCore::Internals::stopSweeping):
(WebCore::Internals::startSweeping):
* testing/Internals.h:
* testing/Internals.idl:

Source/WTF:

Extend the use of AbstractLocker so that we can use more locking idioms.

* wtf/AutomaticThread.cpp:
(WTF::AutomaticThreadCondition::notifyOne):
(WTF::AutomaticThreadCondition::notifyAll):
(WTF::AutomaticThreadCondition::add):
(WTF::AutomaticThreadCondition::remove):
(WTF::AutomaticThreadCondition::contains):
(WTF::AutomaticThread::AutomaticThread):
(WTF::AutomaticThread::tryStop):
(WTF::AutomaticThread::isWaiting):
(WTF::AutomaticThread::notify):
(WTF::AutomaticThread::start):
(WTF::AutomaticThread::threadIsStopping):
* wtf/AutomaticThread.h:
* wtf/NumberOfCores.cpp:
(WTF::numberOfProcessorCores):
* wtf/ParallelHelperPool.cpp:
(WTF::ParallelHelperClient::finish):
(WTF::ParallelHelperClient::claimTask):
(WTF::ParallelHelperPool::Thread::Thread):
(WTF::ParallelHelperPool::didMakeWorkAvailable):
(WTF::ParallelHelperPool::hasClientWithTask):
(WTF::ParallelHelperPool::getClientWithTask):
* wtf/ParallelHelperPool.h:

Tools:

Make more tests collect continuously.

* Scripts/run-jsc-stress-tests:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212778 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoDon't build libwebrtc on 32-bit architectures
achristensen@apple.com [Wed, 22 Feb 2017 00:53:19 +0000 (00:53 +0000)]
Don't build libwebrtc on 32-bit architectures
https://bugs.webkit.org/show_bug.cgi?id=168692

Reviewed by Dan Bernstein.

* Configurations/Base.xcconfig:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212777 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoAdd support to PlatformCALayer/GraphicsLayerCA for subpixel-antialiased text, with...
simon.fraser@apple.com [Wed, 22 Feb 2017 00:30:32 +0000 (00:30 +0000)]
Add support to PlatformCALayer/GraphicsLayerCA for subpixel-antialiased text, with a Setting and a MiniBrowser switch
https://bugs.webkit.org/show_bug.cgi?id=168620
<rdar://problem/30617772>

Reviewed by Tim Horton.
Source/WebCore:

Add a Setting for subpixel-antialiased layer text. Plumb this through GraphicsLayerCA and
PlatformCALayer, where it ultimately affects the layer contents format.

TileControllers are slightly special because we communicate with them via an Obj-C
WebTiledBackingLayer.

Test: compositing/contents-format/subpixel-antialiased-text-enabled.html

* page/Settings.in:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::GraphicsLayer):
(WebCore::GraphicsLayer::dumpProperties):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::supportsSubpixelAntialiasedText):
(WebCore::GraphicsLayer::setSupportsSubpixelAntialiasedText):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setSupportsSubpixelAntialiasedText):
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::updateSupportsSubpixelAntialiasedText):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::PlatformCALayer::drawRepaintIndicator):
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::setWantsDeepColorBackingStore):
(WebCore::TileController::setSupportsSubpixelAntialiasedText):
(WebCore::TileController::setTilesOpaque):
* platform/graphics/ca/TileController.h:
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::updateTileLayerProperties):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::supportsSubpixelAntialiasedText):
(PlatformCALayerCocoa::setSupportsSubpixelAntialiasedText):
(layerContentsFormat):
(PlatformCALayerCocoa::updateContentsFormat):
(PlatformCALayer::drawLayerContents):
* platform/graphics/ca/cocoa/WebTiledBackingLayer.h:
* platform/graphics/ca/cocoa/WebTiledBackingLayer.mm:
(-[WebTiledBackingLayer drawsAsynchronously]):
(-[WebTiledBackingLayer setSupportsSubpixelAntialiasedText:]):
(-[WebTiledBackingLayer supportsSubpixelAntialiasedText]):
* platform/spi/cocoa/QuartzCoreSPI.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createGraphicsLayer):

Source/WebKit/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences subpixelAntialiasedLayerTextEnabled]):
(-[WebPreferences setSubpixelAntialiasedLayerTextEnabled:]):
* WebView/WebPreferencesPrivate.h:

Source/WebKit2:

Add a Setting for subpixel-antialiased layer text. Plumb this through GraphicsLayerCA and
PlatformCALayer, where it ultimately affects the layer contents format.

This is not supported with UI-side compositing.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetSubpixelAntialiasedLayerTextEnabled):
(WKPreferencesGetSubpixelAntialiasedLayerTextEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _subpixelAntialiasedLayerTextEnabled]):
(-[WKPreferences _setSubpixelAntialiasedLayerTextEnabled:]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::supportsSubpixelAntialiasedText):
(WebKit::PlatformCALayerRemote::setSupportsSubpixelAntialiasedText):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:
* WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
(WebKit::PlatformCALayerRemoteTiledBacking::supportsSubpixelAntialiasedText):
(WebKit::PlatformCALayerRemoteTiledBacking::setSupportsSubpixelAntialiasedText):
* WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:

Tools:

Add a setting that allows one to toggle subpixel-antialiased layer text on and off.

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
* MiniBrowser/mac/SettingsController.h:
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController _populateMenu]):
(-[SettingsController validateMenuItem:]):
(-[SettingsController toggleSubpixelAntialiasedLayerTextEnabled:]):
(-[SettingsController subpixelAntialiasedLayerTextEnabled]):
* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController didChangeSettings]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController didChangeSettings]):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212776 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoAir should have a disassembly mode that dumps IR and assembly intermixed
sbarati@apple.com [Tue, 21 Feb 2017 23:57:03 +0000 (23:57 +0000)]
Air should have a disassembly mode that dumps IR and assembly intermixed
https://bugs.webkit.org/show_bug.cgi?id=168629

Reviewed by Filip Pizlo.

This will make dumping FTL disassembly dump Air intermixed
with the assembly generated by each Air Inst. This is similar
to how dumpDFGDisassembly dumps the generated assembly for each
Node.

Here is what the output will look like:

Generated FTL JIT code for foo#CUaFiQ:[0x10b76c960->0x10b76c2d0->0x10b7b6da0, FTLFunctionCall, 40 (NeverInline)], instruction count = 40:
BB#0: ; frequency = 1.000000
        0x469004e02e00: push %rbp
        0x469004e02e01: mov %rsp, %rbp
        0x469004e02e04: add $0xffffffffffffffd0, %rsp
    Move $0x10b76c960, %rax, $4487301472(@16)
        0x469004e02e08: mov $0x10b76c960, %rax
    Move %rax, 16(%rbp), @19
        0x469004e02e12: mov %rax, 0x10(%rbp)
    Patch &Patchpoint2, %rbp, %rax, @20
        0x469004e02e16: lea -0x50(%rbp), %rax
        0x469004e02e1a: mov $0x1084081e0, %r11
        0x469004e02e24: cmp %rax, (%r11)
        0x469004e02e27: ja 0x469004e02e9a
    Move 56(%rbp), %rdx, @23
        0x469004e02e2d: mov 0x38(%rbp), %rdx
    Move $0xffff000000000002, %rax, $-281474976710654(@15)
        0x469004e02e31: mov $0xffff000000000002, %rax
    Patch &BranchTest64(3,SameAsRep)1, NonZero, %rdx, %rax, %rdx, @26
        0x469004e02e3b: test %rdx, %rax
        0x469004e02e3e: jnz 0x469004e02f08
    Move 48(%rbp), %rax, @29
        0x469004e02e44: mov 0x30(%rbp), %rax
    Move %rax, %rcx, @31
        0x469004e02e48: mov %rax, %rcx
    Xor64 $6, %rcx, @31
        0x469004e02e4b: xor $0x6, %rcx
    Patch &BranchTest64(3,SameAsRep)1, NonZero, %rcx, $-2, %rax, @35
        0x469004e02e4f: test $0xfffffffffffffffe, %rcx
        0x469004e02e56: jnz 0x469004e02f12
    Patch &Branch32(3,SameAsRep)0, NotEqual, (%rdx), $266, %rdx, @45
        0x469004e02e5c: cmp $0x10a, (%rdx)
        0x469004e02e62: jnz 0x469004e02f1c
    BranchTest32 NonZero, %rax, $1, @49
        0x469004e02e68: test $0x1, %al
        0x469004e02e6a: jnz 0x469004e02e91
  Successors: #3, #1
BB#1: ; frequency = 1.000000
  Predecessors: #0
    Move $0, %rcx, @65
        0x469004e02e70: xor %rcx, %rcx
    Jump @66
  Successors: #2
BB#2: ; frequency = 1.000000
  Predecessors: #1, #3
    Move 24(%rdx), %rax, @58
        0x469004e02e73: mov 0x18(%rdx), %rax
    Patch &BranchAdd32(4,ForceLateUseUnlessRecoverable)3, Overflow, %rcx, %rax, %rcx, %rcx, %rax, @60
        0x469004e02e77: add %eax, %ecx
        0x469004e02e79: jo 0x469004e02f26
    Move $0xffff000000000000, %rax, $-281474976710656(@14)
        0x469004e02e7f: mov $0xffff000000000000, %rax
    Add64 %rcx, %rax, %rax, @62
        0x469004e02e89: add %rcx, %rax
    Ret64 %rax, @63
        0x469004e02e8c: mov %rbp, %rsp
        0x469004e02e8f: pop %rbp
        0x469004e02e90: ret
BB#3: ; frequency = 1.000000
  Predecessors: #0
    Move 16(%rdx), %rcx, @52
        0x469004e02e91: mov 0x10(%rdx), %rcx
    Jump @55
        0x469004e02e95: jmp 0x469004e02e73
  Successors: #2

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/air/AirCode.h:
(JSC::B3::Air::Code::setDisassembler):
(JSC::B3::Air::Code::disassembler):
* b3/air/AirDisassembler.cpp: Added.
(JSC::B3::Air::Disassembler::startEntrypoint):
(JSC::B3::Air::Disassembler::endEntrypoint):
(JSC::B3::Air::Disassembler::startLatePath):
(JSC::B3::Air::Disassembler::endLatePath):
(JSC::B3::Air::Disassembler::startBlock):
(JSC::B3::Air::Disassembler::addInst):
(JSC::B3::Air::Disassembler::dump):
* b3/air/AirDisassembler.h: Added.
* b3/air/AirGenerate.cpp:
(JSC::B3::Air::generate):
* ftl/FTLCompile.cpp:
(JSC::FTL::compile):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212775 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoExport various NSString symbols from WebUIDelegatePrivate.h
aakash_jain@apple.com [Tue, 21 Feb 2017 23:49:42 +0000 (23:49 +0000)]
Export various NSString symbols from WebUIDelegatePrivate.h
https://bugs.webkit.org/show_bug.cgi?id=168679

Reviewed by Joseph Pecoraro.

* WebKit.exp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212774 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoREGRESSION (203941): iAd Producer: Clicking buttons in Preview does not work
cdumez@apple.com [Tue, 21 Feb 2017 23:25:49 +0000 (23:25 +0000)]
REGRESSION (203941): iAd Producer: Clicking buttons in Preview does not work
https://bugs.webkit.org/show_bug.cgi?id=168677
<rdar://problem/30640101>

Reviewed by Ryosuke Niwa.

Add quirk to initMouseEvent to unbreak iAd Producer.

* dom/MouseEvent.cpp:
(WebCore::MouseEvent::initMouseEventQuirk):
* dom/MouseEvent.h:
* dom/MouseEvent.idl:
* platform/RuntimeApplicationChecks.h:
* platform/RuntimeApplicationChecks.mm:
(WebCore::MacApplication::isIADProducer):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212773 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[Xcode] libwebrtc installhdrs doesn’t install any of the headers
achristensen@apple.com [Tue, 21 Feb 2017 23:23:38 +0000 (23:23 +0000)]
[Xcode] libwebrtc installhdrs doesn’t install any of the headers
https://bugs.webkit.org/show_bug.cgi?id=168634

Patch by Youenn Fablet <youenn@apple.com> on 2017-02-21
Reviewed by Alex Christensen.

* Configurations/libwebrtc.xcconfig:
* libwebrtc.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212772 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoAudioSampleDataSource doesn't need to use the m_scratchBuffer on the pulling thread
jer.noble@apple.com [Tue, 21 Feb 2017 23:18:36 +0000 (23:18 +0000)]
AudioSampleDataSource doesn't need to use the m_scratchBuffer on the pulling thread
https://bugs.webkit.org/show_bug.cgi?id=168640

Reviewed by Eric Carlson.

Rather than copying the pulled data into a scratch buffer, applying a volume transformation
and then copying back out, just do the volume transformation in-place in the destination
buffer.

* platform/audio/mac/AudioSampleDataSource.cpp:
(WebCore::AudioSampleDataSource::pullSamplesInternal):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212771 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoExport symbols for various classes present in webkit SPI
aakash_jain@apple.com [Tue, 21 Feb 2017 23:16:43 +0000 (23:16 +0000)]
Export symbols for various classes present in webkit SPI
https://bugs.webkit.org/show_bug.cgi?id=168674

Reviewed by Dan Bernstein.

* WebKit.exp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212770 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[WebRTC] Implement Incoming libwebrtc audio source support.
commit-queue@webkit.org [Tue, 21 Feb 2017 23:16:02 +0000 (23:16 +0000)]
[WebRTC] Implement Incoming libwebrtc audio source support.
https://bugs.webkit.org/show_bug.cgi?id=167961

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

Hook libwebrtc incoming audio source into WebCore audio rendering path.
Manually testing that muted sources produce data with zeros and unmuted sources provide data with non zeros.

* platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::create):
(WebCore::streamDescription):
(WebCore::RealtimeIncomingAudioSource::OnData):
(WebCore::RealtimeIncomingAudioSource::audioSourceProvider):
* platform/mediastream/mac/RealtimeIncomingAudioSource.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212769 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[iOS] Remove old WebKit1 MemoryMeasure helper.
akling@apple.com [Tue, 21 Feb 2017 23:07:51 +0000 (23:07 +0000)]
[iOS] Remove old WebKit1 MemoryMeasure helper.
<https://webkit.org/b/168675>

Reviewed by Sam Weinig.

Source/WebKit:

* WebKit.xcodeproj/project.pbxproj:

Source/WebKit/ios:

Remove the MemoryMeasure logging helper from the WebKit1 days. It was using an old way
of measuring memory, and we were only using it in a single place anyway.

* Misc/MemoryMeasure.h: Removed.
* Misc/MemoryMeasure.mm: Removed.
* WebKit.iOS.exp:

Source/WebKit/mac:

* Configurations/WebKitLegacy.xcconfig:
* Misc/WebCache.mm:
(+[WebCache emptyInMemoryResources]):
* WebView/WebView.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212768 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoResource Load Statistics: Only scan website data store once per session ID + reinstat...
wilander@apple.com [Tue, 21 Feb 2017 22:55:27 +0000 (22:55 +0000)]
Resource Load Statistics: Only scan website data store once per session ID + reinstate removal counting
https://bugs.webkit.org/show_bug.cgi?id=168541

Reviewed by Alex Christensen.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyOwnedDomainsInAllPersistentDataStores):
    The CallbackAggregator now merges a list of domains for which we
    have removed data records and eventually reports this back to the
    caller.
* UIProcess/WebProcessProxy.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
    Now reports back to its WebCore::ResourceLoadStatisticsStore
    which domains have had data records removed.
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchDataForTopPrivatelyOwnedDomains):
    The completion handler now handles data record removal counting.
(WebKit::WebsiteDataStore::removeDataForTopPrivatelyOwnedDomains):
    The completion handler now handles data record removal counting.
* UIProcess/WebsiteData/WebsiteDataStore.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212766 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoFix ImageBitmap comment to not insert a <canvas>.
simon.fraser@apple.com [Tue, 21 Feb 2017 22:54:17 +0000 (22:54 +0000)]
Fix ImageBitmap comment to not insert a <canvas>.

* features.json:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212765 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoWeb Inspector: Prefer Resources tab over Network tab when showing files
commit-queue@webkit.org [Tue, 21 Feb 2017 22:44:29 +0000 (22:44 +0000)]
Web Inspector: Prefer Resources tab over Network tab when showing files
https://bugs.webkit.org/show_bug.cgi?id=168021

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2017-02-21
Reviewed by Timothy Hatcher.

* UserInterface/Base/Main.js:
(WebInspector.handlePossibleLinkClick):
(WebInspector.openURL):
Add `options` parameter to provide greater customization.

* UserInterface/Views/TabBrowser.js:
(WebInspector.TabBrowser.prototype.bestTabContentViewForRepresentedObject):
Add logic for `ignoreNetworkTab` option that will ignore instances of NetworkTabContentView.

* UserInterface/Controllers/BreakpointPopoverController.js:
(WebInspector.BreakpointPopoverController.prototype.appendContextMenuItems):
* UserInterface/Protocol/InspectorFrontendAPI.js:
(InspectorFrontendAPI.showMainResourceForFrame):
* UserInterface/Views/CSSStyleDeclarationTextEditor.js:
(WebInspector.CSSStyleDeclarationTextEditor.tokenTrackingControllerHighlightedRangeWasClicked.showRangeInSourceCode):
* UserInterface/Views/ComputedStyleDetailsPanel.js:
(WebInspector.ComputedStyleDetailsPanel.prototype.cssStyleDeclarationTextEditorShowProperty):
* UserInterface/Views/ContextMenuUtilities.js:
(WebInspector.appendContextMenuItemsForSourceCode):
* UserInterface/Views/DOMTreeContentView.js:
(WebInspector.DOMTreeContentView.prototype._mouseWasClicked.followLink):
* UserInterface/Views/DOMTreeElement.js:
(WebInspector.DOMTreeElement.prototype._populateTagContextMenu):
(WebInspector.DOMTreeElement.prototype._showCustomElementDefinition):
* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.prototype._treeSelectionDidChange):
* UserInterface/Views/NetworkTimelineView.js:
(WebInspector.NetworkTimelineView.prototype.showContentViewForTreeElement):
* UserInterface/Views/ObjectTreeBaseTreeElement.js:
(WebInspector.ObjectTreeBaseTreeElement.prototype._appendMenusItemsForObject):
* UserInterface/Views/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel.prototype._treeSelectionDidChange):
* UserInterface/Views/ResourceTimelineDataGridNode.js:
(WebInspector.ResourceTimelineDataGridNode.prototype._dataGridNodeGoToArrowClicked):
* UserInterface/Views/SearchSidebarPanel.js:
(WebInspector.SearchSidebarPanel.prototype._treeSelectionDidChange):
(WebInspector.SearchSidebarPanel.prototype._treeElementDoubleClick):
* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype.tokenTrackingControllerHighlightedRangeWasClicked):
* UserInterface/Views/TimelineDataGrid.js:
(WebInspector.TimelineDataGrid.prototype._popoverCallStackTreeSelectionDidChange):
* UserInterface/Views/VisualStyleSelectorTreeItem.js:
(WebInspector.VisualStyleSelectorTreeItem.prototype.populateContextMenu):
Change arguments of functions to change content views to ignore the Network tab.

* UserInterface/Views/NetworkGridContentView.js:
(WebInspector.NetworkGridContentView.prototype.hasRepresentedObject):
* UserInterface/Views/NetworkSidebarPanel.js:
(WebInspector.NetworkSidebarPanel.prototype.hasRepresentedObject):
* UserInterface/Views/NetworkTabContentView.js:
(WebInspector.NetworkTabContentView.prototype.canShowRepresentedObject):
Ensure that the Network tab can only display resources that it has entries for in its view.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212761 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoResource Load Statistics: Add alternate classification method
wilander@apple.com [Tue, 21 Feb 2017 22:40:28 +0000 (22:40 +0000)]
Resource Load Statistics: Add alternate classification method
https://bugs.webkit.org/show_bug.cgi?id=168347
<rdar://problem/30352793>

Reviewed by Alex Christensen.

Source/WebCore:

This patch only adds test infrastructure in WebCore.

Tests: http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html
       http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html
       http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html
       http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html
       http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html
       http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html
       http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html
       http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setSubframeUnderTopFrameOrigin):
(WebCore::ResourceLoadObserver::setSubresourceUnderTopFrameOrigin):
(WebCore::ResourceLoadObserver::setSubresourceUniqueRedirectTo):
* loader/ResourceLoadObserver.h:

Source/WebKit2:

This patch adds a CorePrediction-based classifier to the WebResourceLoadStatisticsStore.
The CorePrediction framework is introduced as a dependency for macOS and iOS. The patch
also adds functions to support layout tests of the feature.

* Configurations/BaseTarget.xcconfig:
* Configurations/WebKit.xcconfig:
    Added dependency on CorePrediction.
* Platform/classifier: Added.
* Platform/classifier/ResourceLoadStatisticsClassifier.h: Added.
    Pulls in the Cocoa-specific classifier for Cocoa-based platforms.
(WebKit::ResourceLoadStatisticsClassifier::ResourceLoadStatisticsClassifier):
* Platform/classifier/ResourceLoadStatisticsClassifierBase.cpp: Added.
(WebKit::ResourceLoadStatisticsClassifierBase::hasPrevalentResourceCharacteristics):
    Shared classifier logic.
(WebKit::ResourceLoadStatisticsClassifierBase::classifyWithVectorThreshold):
    Fallback classifier for when we don't have CorePrediction.
* Platform/classifier/ResourceLoadStatisticsClassifierBase.h: Added.
(WebKit::ResourceLoadStatisticsClassifierBase::ResourceLoadStatisticsClassifierBase):
(WebKit::ResourceLoadStatisticsClassifierBase::~ResourceLoadStatisticsClassifierBase):
* Platform/classifier/cocoa: Added.
* Platform/classifier/cocoa/CorePredictionSPI.h: Added.
    Includes CorePrediction if available, otherwise declares needed symbols.
    Always redeclares the functions so we'll get a build error if
    CorePrediction changes.
* Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: Added.
(WebKit::ResourceLoadStatisticsClassifier::classify):
(WebKit::ResourceLoadStatisticsClassifier::storagePath):
(WebKit::ResourceLoadStatisticsClassifier::shouldUseCorePrediction):
    The new classifier for Cocoa platforms.
* Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h: Added.
(WebKit::ResourceLoadStatisticsClassifier::ResourceLoadStatisticsClassifier):
* PlatformGTK.cmake:
   Added Platform/classifier directory and ResourceLoadStatisticsClassifierBase.cpp.
* PlatformMac.cmake:
   Added Platform/classifier and Platform/classifier/cocoa directories, and
   source files ResourceLoadStatisticsClassifierBase.cpp and
   ResourceLoadStatisticsClassifierCocoa.cpp
* Resources/ResourceLoadStatistics: Added.
* Resources/ResourceLoadStatistics/corePrediction_model: Added.
    Model file to load into CorePrediction.
* UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
(WKResourceLoadStatisticsManagerSetSubframeUnderTopFrameOrigin):
(WKResourceLoadStatisticsManagerSetSubresourceUnderTopFrameOrigin):
(WKResourceLoadStatisticsManagerSetSubresourceUniqueRedirectTo):
    Test infrastructure.
* UIProcess/API/C/WKResourceLoadStatisticsManager.h:
* UIProcess/WebResourceLoadStatisticsManager.cpp:
(WebKit::WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin):
(WebKit::WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo):
    Test infrastructure.
* UIProcess/WebResourceLoadStatisticsManager.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
    Renamed m_storagePath to m_statisticsStoragePath for clarity.
(WebKit::WebResourceLoadStatisticsStore::classifyResource):
    Now calls the classifier through its ResourceLoadStatisticsClassifier
    member variable.
(WebKit::WebResourceLoadStatisticsStore::persistentStoragePath):
    Renamed m_storagePath to m_statisticsStoragePath for clarity.
(WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
    Renamed m_storagePath to m_statisticsStoragePath for clarity.
(WebKit::WebResourceLoadStatisticsStore::hasPrevalentResourceCharacteristics): Deleted.
* UIProcess/WebResourceLoadStatisticsStore.h:
* WebKit2.xcodeproj/project.pbxproj:
    Added the new classifier source files under Platform/classifier and the
    corePrediction_model file under Resources/ResourceLoadStatistics.

Source/WTF:

* wtf/Platform.h:
    Added support for HAVE(CORE_PREDICTION).

Tools:

Added three testRunner functions to facilitate layout tests:
- setStatisticsSubframeUnderTopFrameOrigin()
- setStatisticsSubresourceUnderTopFrameOrigin()
- setStatisticsSubresourceUniqueRedirectTo()

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setStatisticsSubframeUnderTopFrameOrigin):
(WTR::TestRunner::setStatisticsSubresourceUnderTopFrameOrigin):
(WTR::TestRunner::setStatisticsSubresourceUniqueRedirectTo):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::setStatisticsSubframeUnderTopFrameOrigin):
(WTR::TestController::setStatisticsSubresourceUnderTopFrameOrigin):
(WTR::TestController::setStatisticsSubresourceUniqueRedirectTo):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

WebKitLibraries:

* WebKitPrivateFrameworkStubs/iOS/10/CorePrediction.framework: Added.
* WebKitPrivateFrameworkStubs/iOS/10/CorePrediction.framework/CorePrediction.tbd: Added.
    Stubs for private framework.

LayoutTests:

* http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html: Added.
* platform/gtk/TestExpectations:
    The whole http/tests/loading/resourceLoadStatistics marked as crashing based on
    Carlos Garcia Campos's assessment in https://bugs.webkit.org/show_bug.cgi?id=168171.
* platform/wk2/TestExpectations:
    The above tests are only valid for WebKit2. Marked as [ Pass ].

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212757 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoFix CMake build.
achristensen@apple.com [Tue, 21 Feb 2017 22:14:50 +0000 (22:14 +0000)]
Fix CMake build.

* PlatformMac.cmake:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212756 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoAdd Media Streams and Capture to features.json.
simon.fraser@apple.com [Tue, 21 Feb 2017 22:13:33 +0000 (22:13 +0000)]
Add Media Streams and Capture to features.json.

* features.json:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212755 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoClarify the status of 'webkitSubtle' and 'subtle' attributes on the WebCrypto API.
jiewen_tan@apple.com [Tue, 21 Feb 2017 22:07:53 +0000 (22:07 +0000)]
Clarify the status of 'webkitSubtle' and 'subtle' attributes on the WebCrypto API.

* features.json:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212749 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[Readable Streams API] Add ReadableStreamBYOBRequest view getter
commit-queue@webkit.org [Tue, 21 Feb 2017 21:53:28 +0000 (21:53 +0000)]
[Readable Streams API] Add ReadableStreamBYOBRequest view getter
https://bugs.webkit.org/show_bug.cgi?id=168652

Patch by Romain Bellessort <romain.bellessort@crf.canon.fr> on 2017-02-21
Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Updated test expectations.

* web-platform-tests/streams/readable-byte-streams/general-expected.txt:
* web-platform-tests/streams/readable-byte-streams/general.dedicatedworker-expected.txt:

Source/WebCore:

Implemented getter for ReadableStreamBYOBRequest view attribute.

Added 1 test checking that view length corresponds to autoAllocateChunkSize.
Also updated test expectations for W3C imported tests.

* Modules/streams/ReadableByteStreamInternals.js:
(isReadableStreamBYOBRequest): Added.
* Modules/streams/ReadableStreamBYOBRequest.js:
(view): Added.

LayoutTests:

Added 1 test checking that view length corresponds to autoAllocateChunkSize.

* streams/readable-stream-byob-request-expected.txt: Updated.
* streams/readable-stream-byob-request.js: Added 1 test.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212748 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoClarify the status of 'webkitSubtle' and 'subtle' attributes on the WebCrypto API.
simon.fraser@apple.com [Tue, 21 Feb 2017 21:47:40 +0000 (21:47 +0000)]
Clarify the status of 'webkitSubtle' and 'subtle' attributes on the WebCrypto API.

* features.json:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212747 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[WebRTC][Mac] Network process sandbox does not allow WebRTC networking
commit-queue@webkit.org [Tue, 21 Feb 2017 21:30:56 +0000 (21:30 +0000)]
[WebRTC][Mac] Network process sandbox does not allow WebRTC networking
https://bugs.webkit.org/show_bug.cgi?id=168594

Patch by Youenn Fablet <youenn@apple.com> on 2017-02-21
Reviewed by Brent Fulgham.

UIProcess was passing a boolean to know whether WebRTC networking is allowed or not to the network process.
This boolean was known to late for the sandbox to be relaxed.
A sandbox extension is now used instead to relax the sandbox.

* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcess):
(WebKit::NetworkProcess::initializeSandbox):
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212746 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[WebRTC] ICE candidates should be filtered according a policy
commit-queue@webkit.org [Tue, 21 Feb 2017 21:29:01 +0000 (21:29 +0000)]
[WebRTC] ICE candidates should be filtered according a policy
https://bugs.webkit.org/show_bug.cgi?id=168348

Patch by Youenn Fablet <youenn@apple.com> on 2017-02-21
Reviewed by Alex Christensen.

Source/WebCore:

Covered by manual tests. Should be covered in the future by layout tests with dedicated internals API.

Adding support for ICE candidate filtering at RTCPeerConnection level.
If ICE candidate filtering is on (by default), host candidates are stored and not sent immediately.
Reflexive candidates are purged from raddr information to not leak the host IP address.

Stored candidates may be advertised to the JS layer if RTCController is notified of a change of filtering policy.
To implement that, PeerConnectionBackend stores all filtered out candidates and RTCPeerConnection register
themselves to RTCController to get notifications of filtering policy changes.

Making RTCPeerConnection use setPendingActivity throughout its lifetime.
This ensures it does not get collected until the page is off or close() is called on the object.

Adding support for enumerating or not all interfaces at libwebrtc level.
This choice is done at creation of the peer connection.

* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::enableICECandidateFiltering):
(WebCore::PeerConnectionBackend::disableICECandidateFiltering):
(WebCore::filterICECandidate):
(WebCore::PeerConnectionBackend::newICECandidate):
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCController.cpp: Added.
(WebCore::RTCController::remove):
(WebCore::RTCController::add):
(WebCore::RTCController::disableICECandidateFiltering):
(WebCore::RTCController::enableICECandidateFiltering):
* Modules/mediastream/RTCController.h: Added.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::create):
(WebCore::RTCPeerConnection::close):
(WebCore::RTCPeerConnection::rtcController):
(WebCore::RTCPeerConnection::registerToController):
(WebCore::RTCPeerConnection::unregisterFromController):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::OnIceCandidate):
* WebCore.xcodeproj/project.pbxproj:
* page/Page.h:
(WebCore::Page::rtcController):
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::LibWebRTCProvider::createPeerConnection):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:

Source/WebKit2:

Adding the possibility for the UI process to control the ICE candidate filtering and whether libwebrtc can
enumerate all interfaces or not.

Disabling ICE candidate filtering for the moment.
Enabling to enumerate all interfaces for the moment.

In the future, ICE candidate filtering should be tied to getUserMedia.
Interface enumeration should be disabled with the default configuration.
We should do that once we have sufficient testing in various network infrastructures.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::initializeWebPage):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::disableICECandidateFiltering):
(WebKit::WebPage::enableICECandidateFiltering):
(WebKit::WebPage::disableEnumeratingAllNetworkInterfaces):
(WebKit::WebPage::enableEnumeratingAllNetworkInterfaces):
* WebProcess/WebPage/WebPage.messages.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212745 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUnreviewed, update WebCrypto API feature status.
jiewen_tan@apple.com [Tue, 21 Feb 2017 21:20:30 +0000 (21:20 +0000)]
Unreviewed, update WebCrypto API feature status.

* features.json:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212744 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoFix the bad JSON.
simon.fraser@apple.com [Tue, 21 Feb 2017 21:15:17 +0000 (21:15 +0000)]
Fix the bad JSON.

* features.json:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212743 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[iOS] WebKit1 should use shared memory pressure handler code.
akling@apple.com [Tue, 21 Feb 2017 21:04:50 +0000 (21:04 +0000)]
[iOS] WebKit1 should use shared memory pressure handler code.
<https://webkit.org/b/168653>

Reviewed by Antti Koivisto.

Source/WebCore:

Remove iOS WebKit1 specific members and code from MemoryPressureHandler in favor
of using the same code that iOS WebKit2 and macOS WebKit uses.

* page/cocoa/MemoryReleaseCocoa.mm:
(WebCore::platformReleaseMemory): Add two cleanup calls that were only in the iOS WebView code.
* platform/MemoryPressureHandler.h:
(WebCore::MemoryPressureHandler::m_releaseMemoryBlock): Deleted.
* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::respondToMemoryPressureCallback): Deleted.
(WebCore::MemoryPressureHandler::installMemoryReleaseBlock): Deleted.
(WebCore::MemoryPressureHandler::setReceivedMemoryPressure): Deleted.
(WebCore::MemoryPressureHandler::clearMemoryPressure): Deleted.
(WebCore::MemoryPressureHandler::shouldWaitForMemoryClearMessage): Deleted.
(WebCore::MemoryPressureHandler::respondToMemoryPressureIfNeeded): Deleted.

Source/WebKit/ios:

* Misc/WebUIKitSupport.mm:
(WebKitInitialize): Don't unconditionally install a memory warning handler just
because the framework is loaded.

Source/WebKit/mac:

Register a WebThread-aware memory callback with the shared MemoryPressureHandler
and get rid of the old iOS WebKit1 specific implementation. Some of it was even
dead code since MobileSafari has been using WebKit2 for quite a while.

* WebView/WebView.h:
* WebView/WebView.mm:
(WebInstallMemoryPressureHandler):
(+[WebView _handleMemoryWarning]): Deleted.
(+[WebView registerForMemoryNotifications]): Deleted.
(+[WebView releaseFastMallocMemoryOnCurrentThread]): Deleted.
(+[WebView garbageCollectNow]): Deleted.
(+[WebView purgeInactiveFontData]): Deleted.
(+[WebView drainLayerPool]): Deleted.
(+[WebView discardAllCompiledCode]): Deleted.
(+[WebView _clearMemoryPressure]): Deleted.
(+[WebView _shouldWaitForMemoryClearMessage]): Deleted.
* WebView/WebViewPrivate.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212742 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agowebkitpy: Refactor Device class
jbedard@apple.com [Tue, 21 Feb 2017 21:03:55 +0000 (21:03 +0000)]
webkitpy: Refactor Device class
https://bugs.webkit.org/show_bug.cgi?id=168332

Reviewed by Alexey Proskuryakov.

Separate the more specific SimulatedDevice from the abstract
idea of a device.

* Scripts/webkitpy/xcode/device.py: Added.
(Device):  Base device class.
(Device.__init__): Initialize _host, name and udid.
(Device.install_app): Function declaration.
(Device.launch_app): Ditto.
(Device.__eq__): Compare two devices by udid.
(Device.__ne__): Ditto.
(Device.__repr__): Return device name and udid in formatted string.
* Scripts/webkitpy/xcode/simulated_device.py: Copied from Tools/Scripts/webkitpy/xcode/simulator.py.
(SimulatedDevice):
(SimulatedDevice.__init__): Call Device.__init__ first.
(SimulatedDevice.delete): Device -> SimulatedDevice.
(SimulatedDevice.reset): Ditto.
(SimulatedDevice.__eq__): Moved to device.py.
(SimulatedDevice.__ne__): Ditto.
(SimulatedDevice.__repr__): Call Device __repr__ first.
(DeviceType): Kept in Scripts/webkitpy/xcode/simulator.py.
(Runtime): Kept in Scripts/webkitpy/xcode/simulator.py.
(Device): Renamed SimulatedDevice.
(Simulator): Kept in Scripts/webkitpy/xcode/simulator.py.
* Scripts/webkitpy/xcode/simulator.py:
(Simulator): Define Simulator.Device class as None.
(Simulator.__init__): Import SimulatedDevice as Simulator.Device.
(Simulator.delete_device): Use Simulator.Device.
(Simulator.reset_device): Ditto.
(Simulator._parse_devices): Ditto.
(Simulator.lookup_or_create_device): Make
(Device): Moved to simulated_device as SimulatedDevice.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212741 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoFix two failing WebKit legacy tests
andersca@apple.com [Tue, 21 Feb 2017 20:15:11 +0000 (20:15 +0000)]
Fix two failing WebKit legacy tests
https://bugs.webkit.org/show_bug.cgi?id=168667

Reviewed by Tim Horton.

Handle the NSPasteboardTypeString type.

* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::read):
(WebCore::addHTMLClipboardTypesForCocoaType):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212739 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoAdd Web Audio and Web MIDI to features.json.
simon.fraser@apple.com [Tue, 21 Feb 2017 20:12:24 +0000 (20:12 +0000)]
Add Web Audio and Web MIDI to features.json.

* features.json:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212738 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoREGRESSION(r207669): Crash after mutating selector text
antti@apple.com [Tue, 21 Feb 2017 20:06:48 +0000 (20:06 +0000)]
REGRESSION(r207669): Crash after mutating selector text
https://bugs.webkit.org/show_bug.cgi?id=168655
<rdar://problem/30632111>

Reviewed by Brent Fulgham.

Source/WebCore:

Test: fast/css/selector-text-mutation-crash.html

* style/StyleScope.cpp:
(WebCore::Style::Scope::scheduleUpdate):

Clear the style resolver immediately if style sheet content changes. The resolver may
have data structures that point to the old sheet contents.

The resolver would get wiped anyway when the scheduled update actually occurs.

LayoutTests:

* fast/css/selector-text-mutation-crash-expected.txt: Added.
* fast/css/selector-text-mutation-crash.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212737 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[WebCrypto] Add support for AES-CFB
jiewen_tan@apple.com [Tue, 21 Feb 2017 20:04:44 +0000 (20:04 +0000)]
[WebCrypto] Add support for AES-CFB
https://bugs.webkit.org/show_bug.cgi?id=168344
<rdar://problem/20940221>

Reviewed by Brent Fulgham.

Source/WebCore:

This patch adds support for AES-CFB. Operations of AES-CFB include: encrypt, decrypt, generateKey,
importKey, exportKey, wrapKey, and unwrapKey. This implementation follows a slightly old version
of WebCryptoAPI spec: https://www.w3.org/TR/2014/CR-WebCryptoAPI-20141211/#aes-cfb.

Tests: crypto/subtle/aes-cbc-cfb-decrypt-malformed-parameters.html
       crypto/subtle/aes-cbc-cfb-encrypt-malformed-parameters.html
       crypto/subtle/aes-cbc-import-key-unwrap-jwk-rsa-key-public.html
       crypto/subtle/aes-cfb-generate-export-key-jwk-length-128.html
       crypto/subtle/aes-cfb-generate-export-key-jwk-length-192.html
       crypto/subtle/aes-cfb-generate-export-key-jwk-length-256.html
       crypto/subtle/aes-cfb-generate-export-raw-key.html
       crypto/subtle/aes-cfb-generate-key-encrypt-decrypt.html
       crypto/subtle/aes-cfb-generate-key.html
       crypto/subtle/aes-cfb-import-jwk-key-length-128.html
       crypto/subtle/aes-cfb-import-jwk-key-length-192.html
       crypto/subtle/aes-cfb-import-jwk-key-length-256.html
       crypto/subtle/aes-cfb-import-key-decrypt.html
       crypto/subtle/aes-cfb-import-key-encrypt.html
       crypto/subtle/aes-cfb-import-key-unwrap-jwk-key.html
       crypto/subtle/aes-cfb-import-key-unwrap-raw-key.html
       crypto/subtle/aes-cfb-import-key-wrap-jwk-key.html
       crypto/subtle/aes-cfb-import-key-wrap-raw-key.html
       crypto/subtle/aes-cfb-import-raw-key.html
       crypto/workers/subtle/aes-cfb-import-key-decrypt.html
       crypto/workers/subtle/aes-cfb-import-key-encrypt.html
       crypto/workers/subtle/aes-cfb-import-key-unwrap-key.html
       crypto/workers/subtle/aes-cfb-import-key-wrap-key.html

* CMakeLists.txt:
* DerivedSources.make:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
Add CryptoAlgorithmAES_CFB.cpp,
change AesCbcParams.idl to AesCbcCfbParams.idl.
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
Add support for AES-CFB.
* crypto/CryptoAlgorithm.h:
Include <wtf/Variant.h>.
* crypto/CryptoAlgorithmParameters.h:
Add support for AES-CFB.
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::encrypt):
(WebCore::CryptoAlgorithmAES_CBC::decrypt):
Rename CryptoAlgorithmAesCbcParams to CryptoAlgorithmAesCbcCfbParams.
* crypto/algorithms/CryptoAlgorithmAES_CFB.cpp: Added.
(WebCore::usagesAreInvalidForCryptoAlgorithmAES_CFB):
(WebCore::CryptoAlgorithmAES_CFB::create):
(WebCore::CryptoAlgorithmAES_CFB::identifier):
(WebCore::CryptoAlgorithmAES_CFB::encrypt):
(WebCore::CryptoAlgorithmAES_CFB::decrypt):
(WebCore::CryptoAlgorithmAES_CFB::generateKey):
(WebCore::CryptoAlgorithmAES_CFB::importKey):
(WebCore::CryptoAlgorithmAES_CFB::exportKey):
* crypto/algorithms/CryptoAlgorithmAES_CFB.h: Added.
* crypto/gnutls/CryptoAlgorithmAES_CFBGnuTLS.cpp: Added.
(WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
Add dummy support of AES_CFB for GTK+.
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
(WebCore::transformAES_CBC):
Drop conditional PLATFORM(COCOA).
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
Rename CryptoAlgorithmAesCbcParams to CryptoAlgorithmAesCbcCfbParams.
* crypto/mac/CryptoAlgorithmAES_CFBMac.cpp: Added.
(WebCore::transformAES_CFB):
(WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
* crypto/mac/CryptoAlgorithmRegistryMac.cpp:
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
Add support for AES-CFB.
* crypto/parameters/AesCbcCfbParams.idl: Renamed from Source/WebCore/crypto/parameters/AesCbcParams.idl.
* crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmAesCbcParams.h.
Since dictionaries AesCbcParams and AesCfbParams are essentially the same, I combine them together in our implementations.

LayoutTests:

* crypto/subtle/aes-cbc-cfb-decrypt-malformed-parameters-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-decrypt-malformed-parameters-expected.txt.
* crypto/subtle/aes-cbc-cfb-decrypt-malformed-parameters.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-decrypt-malformed-parameters.html.
* crypto/subtle/aes-cbc-cfb-encrypt-malformed-parameters-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-encrypt-malformed-parameters-expected.txt.
* crypto/subtle/aes-cbc-cfb-encrypt-malformed-parameters.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-encrypt-malformed-parameters.html.
* crypto/subtle/aes-cbc-import-key-unwrap-jwk-rsa-key-public-expected.txt: Renamed from LayoutTests/crypto/subtle/aes-cbc-import-key-uwrap-jwk-rsa-key-public-expected.txt.
* crypto/subtle/aes-cbc-import-key-unwrap-jwk-rsa-key-public.html: Renamed from LayoutTests/crypto/subtle/aes-cbc-import-key-uwrap-jwk-rsa-key-public.html.
* crypto/subtle/aes-cfb-generate-export-key-jwk-length-128-expected.txt: Added.
* crypto/subtle/aes-cfb-generate-export-key-jwk-length-128.html: Added.
* crypto/subtle/aes-cfb-generate-export-key-jwk-length-192-expected.txt: Added.
* crypto/subtle/aes-cfb-generate-export-key-jwk-length-192.html: Added.
* crypto/subtle/aes-cfb-generate-export-key-jwk-length-256-expected.txt: Added.
* crypto/subtle/aes-cfb-generate-export-key-jwk-length-256.html: Added.
* crypto/subtle/aes-cfb-generate-export-raw-key-expected.txt: Added.
* crypto/subtle/aes-cfb-generate-export-raw-key.html: Added.
* crypto/subtle/aes-cfb-generate-key-encrypt-decrypt-expected.txt: Added.
* crypto/subtle/aes-cfb-generate-key-encrypt-decrypt.html: Added.
* crypto/subtle/aes-cfb-generate-key-expected.txt: Added.
* crypto/subtle/aes-cfb-generate-key.html: Added.
* crypto/subtle/aes-cfb-import-jwk-key-length-128-expected.txt: Added.
* crypto/subtle/aes-cfb-import-jwk-key-length-128.html: Added.
* crypto/subtle/aes-cfb-import-jwk-key-length-192-expected.txt: Added.
* crypto/subtle/aes-cfb-import-jwk-key-length-192.html: Added.
* crypto/subtle/aes-cfb-import-jwk-key-length-256-expected.txt: Added.
* crypto/subtle/aes-cfb-import-jwk-key-length-256.html: Added.
* crypto/subtle/aes-cfb-import-key-decrypt-expected.txt: Added.
* crypto/subtle/aes-cfb-import-key-decrypt.html: Added.
* crypto/subtle/aes-cfb-import-key-encrypt-expected.txt: Added.
* crypto/subtle/aes-cfb-import-key-encrypt.html: Added.
* crypto/subtle/aes-cfb-import-key-unwrap-jwk-key-expected.txt: Added.
* crypto/subtle/aes-cfb-import-key-unwrap-jwk-key.html: Added.
* crypto/subtle/aes-cfb-import-key-unwrap-raw-key-expected.txt: Added.
* crypto/subtle/aes-cfb-import-key-unwrap-raw-key.html: Added.
* crypto/subtle/aes-cfb-import-key-wrap-jwk-key-expected.txt: Added.
* crypto/subtle/aes-cfb-import-key-wrap-jwk-key.html: Added.
* crypto/subtle/aes-cfb-import-key-wrap-raw-key-expected.txt: Added.
* crypto/subtle/aes-cfb-import-key-wrap-raw-key.html: Added.
* crypto/subtle/aes-cfb-import-raw-key-expected.txt: Added.
* crypto/subtle/aes-cfb-import-raw-key.html: Added.
* crypto/subtle/aes-generate-key-malformed-parameters-expected.txt:
* crypto/subtle/aes-generate-key-malformed-parameters.html:
* crypto/subtle/aes-import-key-malformed-parameters-expected.txt:
* crypto/subtle/aes-import-key-malformed-parameters.html:
* crypto/workers/subtle/aes-cfb-import-key-decrypt-expected.txt: Added.
* crypto/workers/subtle/aes-cfb-import-key-decrypt.html: Added.
* crypto/workers/subtle/aes-cfb-import-key-encrypt-expected.txt: Added.
* crypto/workers/subtle/aes-cfb-import-key-encrypt.html: Added.
* crypto/workers/subtle/aes-cfb-import-key-unwrap-key-expected.txt: Added.
* crypto/workers/subtle/aes-cfb-import-key-unwrap-key.html: Added.
* crypto/workers/subtle/aes-cfb-import-key-wrap-key-expected.txt: Added.
* crypto/workers/subtle/aes-cfb-import-key-wrap-key.html: Added.
* crypto/workers/subtle/resources/aes-cfb-import-key-decrypt.js: Added.
* crypto/workers/subtle/resources/aes-cfb-import-key-encrypt.js: Added.
* crypto/workers/subtle/resources/aes-cfb-import-key-unwrap-key.js: Added.
* crypto/workers/subtle/resources/aes-cfb-import-key-wrap-key.js: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212736 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoFix cmake build
jfbastien@apple.com [Tue, 21 Feb 2017 20:00:52 +0000 (20:00 +0000)]
Fix cmake build
https://bugs.webkit.org/show_bug.cgi?id=168665

Reviewed by Mark Lam.

It was broken by r212555 and r212681.

Source/WebKit:

* PlatformMac.cmake:

Tools:

* DumpRenderTree/PlatformMac.cmake:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212735 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUnreviewed, fix the ToT iOS build
wenson_hsieh@apple.com [Tue, 21 Feb 2017 20:00:34 +0000 (20:00 +0000)]
Unreviewed, fix the ToT iOS build

Adopt updated UIKit SPI and remove calls to the deprecated version.

* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderPasteboard setItems:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212734 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[WebRTC] NetworkRTCMonitor should ensure clearing its manager only once
commit-queue@webkit.org [Tue, 21 Feb 2017 19:34:50 +0000 (19:34 +0000)]
[WebRTC] NetworkRTCMonitor should ensure clearing its manager only once
https://bugs.webkit.org/show_bug.cgi?id=168661

Patch by Youenn Fablet <youenn@apple.com> on 2017-02-21
Reviewed by Alex Christensen.

Making sure NetworkRTCMonitor manager is cleared only once.
ALso ensuring that manager does not get destroyed as part of NetworkRTCMonitor destructor.
The manager needs to be destroyed in the RTC network thread.

* NetworkProcess/webrtc/NetworkRTCMonitor.cpp:
(WebKit::NetworkRTCMonitor::~NetworkRTCMonitor):
(WebKit::NetworkRTCMonitor::stopUpdating):
* NetworkProcess/webrtc/NetworkRTCMonitor.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212733 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[WebRTC][Mac][WebKit2] Revise sandbox to limit connections to UDP and TCP
bfulgham@apple.com [Tue, 21 Feb 2017 19:29:10 +0000 (19:29 +0000)]
[WebRTC][Mac][WebKit2] Revise sandbox to limit connections to UDP and TCP
https://bugs.webkit.org/show_bug.cgi?id=168664
<rdar://problem/30600587>

Reviewed by Youenn Fablet.

Add filters to the WebRTC rule to limit network traffic to UDP and TCP.

* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212732 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[Win] WebView is not painting in accelerated compositing mode.
pvollan@apple.com [Tue, 21 Feb 2017 19:21:31 +0000 (19:21 +0000)]
[Win] WebView is not painting in accelerated compositing mode.
https://bugs.webkit.org/show_bug.cgi?id=168654

Reviewed by Brent Fulgham.

Initializing the uncommitted layer change flags to CoverageRectChanged in GraphicsLayerCA,
stops WebView painting in accelerated mode.

Covered by existing tests.

* platform/graphics/ca/GraphicsLayerCA.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212730 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoImprove bot watcher's dashboard performance
ap@apple.com [Tue, 21 Feb 2017 19:11:27 +0000 (19:11 +0000)]
Improve bot watcher's dashboard performance
https://bugs.webkit.org/show_bug.cgi?id=168624
<rdar://problem/30190109>

Reviewed by Daniel Bates.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Trac.js:
There was an unnecessary linear complexity algorithm in indexOfRevision().

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212729 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoMake logging in high-priority audio threads less expensive
jer.noble@apple.com [Tue, 21 Feb 2017 18:45:10 +0000 (18:45 +0000)]
Make logging in high-priority audio threads less expensive
https://bugs.webkit.org/show_bug.cgi?id=168639

Reviewed by Jon Lee.

Logging from inside a high-priority audio thread will make a number of calls to malloc, block, and
therefore cause audio glitches. Make this logging less expensive by dispatching to the main thread
before creating and outputting the log string.

* WebCore.xcodeproj/project.pbxproj:
* platform/audio/mac/AudioSampleDataSource.mm: Renamed from Source/WebCore/platform/audio/mac/AudioSampleDataSource.cpp.
(WebCore::AudioSampleDataSource::pushSamplesInternal):
(WebCore::AudioSampleDataSource::pullSamplesInternal):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212727 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoCheck what LocalStorage data exists in deleteDatabasesModifiedSince() before attempti...
ryanhaddad@apple.com [Tue, 21 Feb 2017 18:36:00 +0000 (18:36 +0000)]
Check what LocalStorage data exists in deleteDatabasesModifiedSince() before attempting deletion.
https://bugs.webkit.org/show_bug.cgi?id=168659
rdar://problem/22781730

Patch by Maureen Daum <mdaum@apple.com> on 2017-02-21
Reviewed by Brady Eidson.

Check what LocalStorage data exists in deleteDatabasesModifiedSince() before attempting deletion.
It is possible that another process has caused information to be added to LocalStorage
after we created this LocalStorageDatabaseTracker instance, so we should update our
internal state by checking the contents of StorageTracker.db and the other local
storage files so we know what databases actually exist. By calling importOriginIdentifiers()
at the start of deleteDatabasesModifiedSince(), m_origins will now have the up-to-date
list of origins LocalStorage contains data for.

* UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212726 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoGive the Mock audio input a "hum" to make drop-outs more detectable
jer.noble@apple.com [Tue, 21 Feb 2017 18:28:47 +0000 (18:28 +0000)]
Give the Mock audio input a "hum" to make drop-outs more detectable
https://bugs.webkit.org/show_bug.cgi?id=168641

Reviewed by Eric Carlson.

Add two helper functions to generate waveforms: addHum() and writeHum(). Use these methods
to create a bip-bop audio buffer which can be used to "blit" a portion the waveform into the
destination buffer during rendering. The background hum must be seamless across multiple
pull operations, so add the hum sound during rendering.

To ensure the waveform buffer is created, initialize the sampleRate to zero, then call
applySampleRate() with the desired default rate, 44.1kHz.

* platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
(WebCore::writeHum):
(WebCore::addHum):
(WebCore::MockRealtimeAudioSource::create):
(WebCore::MockRealtimeAudioSourceMac::render):
(WebCore::MockRealtimeAudioSourceMac::applySampleRate):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212725 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoReduce platform ifdefs in WebKit2 custom protocols implementation
commit-queue@webkit.org [Tue, 21 Feb 2017 18:24:51 +0000 (18:24 +0000)]
Reduce platform ifdefs in WebKit2 custom protocols implementation
https://bugs.webkit.org/show_bug.cgi?id=165028

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2017-02-21
Reviewed by Darin Adler.

Make mac implementation use the APICustomProtocolManagerClient to share more code with the soup based ports.

* CMakeLists.txt: Add CustomProtocolManagerProxy.cpp.
* PlatformEfl.cmake: Remove CustomProtocolManagerProxySoup.cpp.
* PlatformGTK.cmake: Ditto.
* PlatformMac.cmake: Remove CustomProtocolManagerProxyMac.mm.
* UIProcess/API/APICustomProtocolManagerClient.h:
(API::CustomProtocolManagerClient::startLoading): Make it void, since we were always returning true and the
returned value was ignored.
* UIProcess/API/efl/ewk_url_scheme_request.cpp:
(EwkUrlSchemeRequest::finish): Update to new CustomProtocolManagerProxy API.
* UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp:
* UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
(webkitURISchemeRequestReadCallback): Ditto.
* UIProcess/Cocoa/CustomProtocolManagerClient.h: Added.
* UIProcess/Cocoa/CustomProtocolManagerClient.mm: Added.
(-[WKCustomProtocolLoader initWithCustomProtocolManagerProxy:customProtocolID:request:]):
(-[WKCustomProtocolLoader dealloc]):
(-[WKCustomProtocolLoader connection:didFailWithError:]):
(-[WKCustomProtocolLoader connection:didReceiveResponse:]):
(-[WKCustomProtocolLoader connection:didReceiveData:]):
(-[WKCustomProtocolLoader connection:willSendRequest:redirectResponse:]):
(-[WKCustomProtocolLoader connectionDidFinishLoading:]):
(WebKit::CustomProtocolManagerClient::startLoading):
(WebKit::CustomProtocolManagerClient::stopLoading):
(WebKit::CustomProtocolManagerClient::invalidate):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitialize): Set the CustomProtocolManagerClient.
(WebKit::WebProcessPool::platformInitializeNetworkProcess): Remove code that is now shared.
* UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.cpp: Added.
(WebKit::CustomProtocolManagerProxy::startLoading):
(WebKit::CustomProtocolManagerProxy::processDidClose):
(WebKit::CustomProtocolManagerProxy::wasRedirectedToRequest):
(WebKit::CustomProtocolManagerProxy::didReceiveResponse):
* UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::globalURLSchemesWithCustomProtocolHandlers): Just moved here to use it from ensureNetworkProcess().
(WebKit::WebProcessPool::WebProcessPool): Remove soup ifdefs.
(WebKit::WebProcessPool::setCustomProtocolManagerClient): Moved from the soup implementation.
(WebKit::WebProcessPool::ensureNetworkProcess): Initialize custom protocols parameters.
(WebKit::WebProcessPool::registerSchemeForCustomProtocol): Register the protocol if not already registered globally.
(WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): Remove soup ifdefs.
* UIProcess/WebProcessPool.h: Remove soup ifdefs.
* UIProcess/efl/RequestManagerClientEfl.cpp:
* UIProcess/soup/WebProcessPoolSoup.cpp:
(WebKit::WebProcessPool::platformInitializeNetworkProcess): Remove code that is now shared.
* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212724 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoWeb Inspector: RTL: console scope bar's unread message indicator is misaligned
bburg@apple.com [Tue, 21 Feb 2017 18:20:07 +0000 (18:20 +0000)]
Web Inspector: RTL: console scope bar's unread message indicator is misaligned
https://bugs.webkit.org/show_bug.cgi?id=168625

Reviewed by Matt Baker.

* UserInterface/Views/LogContentView.css:
(.log-scope-bar > li.unread::before):
(body[dir=ltr] .log-scope-bar > li.unread::before):
(body[dir=rtl] .log-scope-bar > li.unread::before):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212719 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoRemove unused files.
commit-queue@webkit.org [Tue, 21 Feb 2017 18:12:20 +0000 (18:12 +0000)]
Remove unused files.
https://bugs.webkit.org/show_bug.cgi?id=168656.

Patch by Daewoong Jang <daewoong.jang@navercorp.com> on 2017-02-21
Reviewed by Csaba Osztrogonác.

Remove files which became unused after removal of EFL port.

* UIProcess/CoordinatedGraphics/PageViewportController.cpp: Removed.
* UIProcess/CoordinatedGraphics/PageViewportController.h: Removed.
* UIProcess/PageViewportControllerClient.h: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212718 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUnreviewed, rolling out r212712.
ryanhaddad@apple.com [Tue, 21 Feb 2017 18:00:43 +0000 (18:00 +0000)]
Unreviewed, rolling out r212712.

This change broke the CLoop build.

Reverted changeset:

"JSModuleNamespace object should have IC"
https://bugs.webkit.org/show_bug.cgi?id=160590
http://trac.webkit.org/changeset/212712

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212717 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoMake TrackPrivateBase ThreadSafeRefCounted, so that it can be retained in non-main...
jer.noble@apple.com [Tue, 21 Feb 2017 17:25:02 +0000 (17:25 +0000)]
Make TrackPrivateBase ThreadSafeRefCounted, so that it can be retained in non-main threads
https://bugs.webkit.org/show_bug.cgi?id=168642

Reviewed by Eric Carlson.

AudioTrackPrivateMediaStreamCocoa has two entry points from background threads:
audioSamplesAvailable() and render(). Protect against being destroyed mid-execution by
retaining this for the duration of those methods.

* platform/graphics/TrackPrivateBase.h:
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
(WebCore::AudioTrackPrivateMediaStreamCocoa::render):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212716 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoPulling too quickly from an AudioSampleDataSource should increase the pre-buffer...
jer.noble@apple.com [Tue, 21 Feb 2017 17:24:34 +0000 (17:24 +0000)]
Pulling too quickly from an AudioSampleDataSource should increase the pre-buffer amount
https://bugs.webkit.org/show_bug.cgi?id=168645

Reviewed by Eric Carlson.

If a pull operation runs past the end of the buffered range of a CARingBuffer, the underrun
is zero-filled, causing an audible glitch.  In this case, bias m_outputSampleOffset by the
amount of the underrun, which should keep the underrun from reoccurring.

* platform/audio/mac/AudioSampleDataSource.cpp:
(WebCore::AudioSampleDataSource::pullSamplesInternal):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212715 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoAudioSampleBufferList::zeroABL() takes a byte-count, not a sample-count.
jer.noble@apple.com [Tue, 21 Feb 2017 17:19:10 +0000 (17:19 +0000)]
AudioSampleBufferList::zeroABL() takes a byte-count, not a sample-count.
https://bugs.webkit.org/show_bug.cgi?id=168635

Reviewed by Jon Lee.

* platform/audio/mac/AudioSampleDataSource.cpp:
(WebCore::AudioSampleDataSource::pullSamplesInternal):
(WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212714 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years ago[WebRTC] LibWebRTCSocket::SendTo message should have a correct SocketAddress
commit-queue@webkit.org [Tue, 21 Feb 2017 16:27:35 +0000 (16:27 +0000)]
[WebRTC] LibWebRTCSocket::SendTo message should have a correct SocketAddress
https://bugs.webkit.org/show_bug.cgi?id=168636

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

* WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
(WebKit::LibWebRTCSocket::SendTo): Ensuring address remains valid during SendTo message lifetime.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212713 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoJSModuleNamespace object should have IC
utatane.tea@gmail.com [Tue, 21 Feb 2017 10:38:58 +0000 (10:38 +0000)]
JSModuleNamespace object should have IC
https://bugs.webkit.org/show_bug.cgi?id=160590

Reviewed by Saam Barati.

JSTests:

* modules/module-assert-access-binding.js: Added.
* modules/module-assert-access-namespace.js: Added.
* modules/namespace-empty.js: Added.
(from.string_appeared_here.access):
(i.shouldThrow):
* stress/module-namespace-access-change.js: Added.
(shouldBe):
(access):
(import.string_appeared_here.then):
* stress/module-namespace-access-non-constant.js: Added.
(shouldBe):
(import.string_appeared_here.then):
* stress/module-namespace-access-poly.js: Added.
(shouldBe):
(access):
(import.string_appeared_here.then):
* stress/module-namespace-access-transitive-exports.js: Added.
(shouldBe):
(import.string_appeared_here.then):
* stress/module-namespace-access.js: Added.
(shouldBe):
(import.string_appeared_here.then):
* stress/resources/module-namespace-access-transitive-exports-2.js: Added.
(export.cocoa):
(export.change):
* stress/resources/module-namespace-access-transitive-exports.js: Added.
* stress/resources/module-namespace-access.js: Added.
(export.cocoa):
(export.change):

Source/JavaScriptCore:

This patch optimizes accesses to module namespace objects.

1. Cache the resolutions for module namespace objects.

    When constructing the module namespace object, we already resolves all the exports.
    The module namespace object caches this result and leverage it in the later access in
    getOwnPropertySlot. This avoids resolving bindings through resolveExport.

2. Introduce ModuleNamespaceLoad IC.

    This patch adds new IC for module namespace objects. The mechanism is simple, getOwnPropertySlot
    tells us about module namespace object resolution. The IC first checks whether the given object
    is an expected module namespace object. If this check succeeds, we load the value from the module
    environment.

3. Introduce DFG/FTL optimization.

    After exploiting module namespace object accesses in (2), DFG can recognize this in ByteCodeParser.
    DFG will convert it to CheckCell with the namespace object and GetClosureVar from the cached environment.
    At that time, we have a chance to fold it to the constant.

This optimization improves the performance of accessing to module namespace objects.

Before
    $ time ../../WebKitBuild/module-ic-tot/Release/bin/jsc -m module-assert-access-namespace.js
    ../../WebKitBuild/module-ic-tot/Release/bin/jsc -m   0.43s user 0.03s system 101% cpu 0.451 total
    $ time ../../WebKitBuild/module-ic-tot/Release/bin/jsc -m module-assert-access-binding.js
    ../../WebKitBuild/module-ic-tot/Release/bin/jsc -m   0.08s user 0.02s system 103% cpu 0.104 total

After
    $ time ../../WebKitBuild/module-ic/Release/bin/jsc -m module-assert-access-namespace.js
    ../../WebKitBuild/module-ic/Release/bin/jsc -m   0.11s user 0.01s system 106% cpu 0.109 total
    $ time ../../WebKitBuild/module-ic/Release/bin/jsc -m module-assert-access-binding.js
    ../../WebKitBuild/module-ic/Release/bin/jsc -m module-assert-access-binding.j  0.08s user 0.02s system 102% cpu 0.105 total

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/AccessCase.cpp:
(JSC::AccessCase::create):
(JSC::AccessCase::guardedByStructureCheck):
(JSC::AccessCase::canReplace):
(JSC::AccessCase::visitWeak):
(JSC::AccessCase::generateWithGuard):
(JSC::AccessCase::generateImpl):
* bytecode/AccessCase.h:
* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::GetByIdStatus):
(JSC::GetByIdStatus::computeForStubInfoWithoutExitSiteFeedback):
(JSC::GetByIdStatus::makesCalls):
(JSC::GetByIdStatus::dump):
* bytecode/GetByIdStatus.h:
(JSC::GetByIdStatus::isModuleNamespace):
(JSC::GetByIdStatus::takesSlowPath):
(JSC::GetByIdStatus::moduleNamespaceObject):
(JSC::GetByIdStatus::moduleEnvironment):
(JSC::GetByIdStatus::scopeOffset):
* bytecode/ModuleNamespaceAccessCase.cpp: Added.
(JSC::ModuleNamespaceAccessCase::ModuleNamespaceAccessCase):
(JSC::ModuleNamespaceAccessCase::create):
(JSC::ModuleNamespaceAccessCase::~ModuleNamespaceAccessCase):
(JSC::ModuleNamespaceAccessCase::clone):
(JSC::ModuleNamespaceAccessCase::emit):
* bytecode/ModuleNamespaceAccessCase.h: Added.
(JSC::ModuleNamespaceAccessCase::moduleNamespaceObject):
(JSC::ModuleNamespaceAccessCase::moduleEnvironment):
(JSC::ModuleNamespaceAccessCase::scopeOffset):
* bytecode/PolymorphicAccess.cpp:
(WTF::printInternal):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleModuleNamespaceLoad):
(JSC::DFG::ByteCodeParser::handleGetById):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::loadValue):
* jit/Repatch.cpp:
(JSC::tryCacheGetByID):
* runtime/AbstractModuleRecord.cpp:
(JSC::AbstractModuleRecord::getModuleNamespace):
* runtime/JSModuleNamespaceObject.cpp:
(JSC::JSModuleNamespaceObject::finishCreation):
(JSC::JSModuleNamespaceObject::visitChildren):
(JSC::getValue):
(JSC::JSModuleNamespaceObject::getOwnPropertySlot):
(JSC::JSModuleNamespaceObject::getOwnPropertyNames):
* runtime/JSModuleNamespaceObject.h:
(JSC::isJSModuleNamespaceObject):
(JSC::JSModuleNamespaceObject::create): Deleted.
(JSC::JSModuleNamespaceObject::createStructure): Deleted.
(JSC::JSModuleNamespaceObject::moduleRecord): Deleted.
* runtime/JSModuleRecord.h:
(JSC::JSModuleRecord::moduleEnvironment): Deleted.
* runtime/PropertySlot.h:
(JSC::PropertySlot::PropertySlot):
(JSC::PropertySlot::domJIT):
(JSC::PropertySlot::moduleNamespaceSlot):
(JSC::PropertySlot::setValueModuleNamespace):
(JSC::PropertySlot::setCacheableCustom):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212712 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoREGRESSION(r212681): Crash when dragging links without a drag image
carlosgc@webkit.org [Tue, 21 Feb 2017 10:37:31 +0000 (10:37 +0000)]
REGRESSION(r212681): Crash when dragging links without a drag image
https://bugs.webkit.org/show_bug.cgi?id=168648

Reviewed by Tim Horton.

This happens in GTK+ port, because we don't use a drag image for links.

Fixes: editing/pasteboard/drop-link.html
       editing/pasteboard/drop-text-without-selection.html
       editing/pasteboard/files-during-page-drags.html
       fast/events/content-changed-during-drop.html
       fast/events/drag-and-drop-link-fast-multiple-times-does-not-crash.html
       fast/events/drag-and-drop-link-into-focused-contenteditable.html
       fast/events/drag-and-drop-link.html
       fast/events/drag-in-frames.html
       fast/events/drag-parent-node.html
       fast/events/shift-drag-selection-on-link-triggers-drag-n-drop.html

* page/DragController.cpp:
(WebCore::DragController::startDrag): Do not try to use drag image and its size when createDragImageForLink
returns nullptr.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212711 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoASSERTION FAILED: "!scope.exception()" with Object.isSealed/isFrozen and uninitialize...
utatane.tea@gmail.com [Tue, 21 Feb 2017 09:07:41 +0000 (09:07 +0000)]
ASSERTION FAILED: "!scope.exception()" with Object.isSealed/isFrozen and uninitialized module bindings
https://bugs.webkit.org/show_bug.cgi?id=168605

Reviewed by Saam Barati.

JSTests:

* modules/module-namespace-is-frozen.js: Added.
(from.string_appeared_here.shouldThrow):
(export.b):
* modules/module-namespace-is-sealed.js: Added.
(from.string_appeared_here.shouldThrow):
(export.b):

Source/JavaScriptCore:

We should check exception state after calling getOwnPropertyDescriptor() since it can throw errors.

* runtime/ObjectConstructor.cpp:
(JSC::objectConstructorIsSealed):
(JSC::objectConstructorIsFrozen):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212710 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoUnreviewed, rolling out r212699.
achristensen@apple.com [Tue, 21 Feb 2017 08:19:34 +0000 (08:19 +0000)]
Unreviewed, rolling out r212699.

Internal build not ready

Reverted changeset:

"[WebRTC][Mac] Activate libwebrtc"
https://bugs.webkit.org/show_bug.cgi?id=167293
http://trac.webkit.org/changeset/212699

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212704 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoRemove ENABLE_THREADED_COMPOSITOR build option
carlosgc@webkit.org [Tue, 21 Feb 2017 07:12:17 +0000 (07:12 +0000)]
Remove ENABLE_THREADED_COMPOSITOR build option
https://bugs.webkit.org/show_bug.cgi?id=168606

Reviewed by Michael Catanzaro.

.:

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/WebKitFeatures.cmake:

Source/WebCore:

* platform/TextureMapper.cmake:

Source/WebKit2:

Now that we have AC mode on demand with the threaded compositor there's no reason to keep the old AC code.

* PlatformGTK.cmake:
* WebProcess/WebPage/LayerTreeHost.cpp:
(WebKit::LayerTreeHost::create):
* WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: Removed.
* WebProcess/WebPage/gtk/LayerTreeHostGtk.h: Removed.

Tools:

* Scripts/webkitperl/FeatureList.pm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212703 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2 years agoWeb Inspector: Tooltip for "Show console tab" should read "Show Console tab"
commit-queue@webkit.org [Tue, 21 Feb 2017 06:37:30 +0000 (06:37 +0000)]
Web Inspector: Tooltip for "Show console tab" should read "Show Console tab"
https://bugs.webkit.org/show_bug.cgi?id=168630
<rdar://problem/30621662>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-02-20
Reviewed by Brian Burg.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/LogContentView.js:
(WebInspector.LogContentView):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212702 268f45cc-cd09-0410-ab3c-d52691b4dbfc