Diff
Modified: trunk/Source/WebCore/ChangeLog (240352 => 240353)
--- trunk/Source/WebCore/ChangeLog 2019-01-23 20:09:54 UTC (rev 240352)
+++ trunk/Source/WebCore/ChangeLog 2019-01-23 20:36:37 UTC (rev 240353)
@@ -1,3 +1,86 @@
+2019-01-22 Conrad Shultz <[email protected]>
+
+ Clean up USE(WEB_THREAD)
+ https://bugs.webkit.org/show_bug.cgi?id=193698
+
+ Rubber-stamped by Tim Horton.
+
+ * page/CaptionUserPreferencesMediaAF.cpp:
+ (WebCore::userCaptionPreferencesChangedNotificationCallback):
+ * platform/cf/MainThreadSharedTimerCF.cpp:
+ (WebCore::applicationDidBecomeActive):
+ * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
+ (WebCore::dispatchToMainThread):
+ * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
+ (-[WebCoreTextTrackRepresentationCocoaHelper observeValueForKeyPath:ofObject:change:context:]):
+ * platform/ios/LegacyTileCache.mm:
+ (WebCore::LegacyTileCache::layoutTiles):
+ (WebCore::LegacyTileCache::setTilingMode):
+ * platform/ios/WebCoreMotionManager.mm:
+ (-[WebCoreMotionManager sendAccelerometerData:]):
+ (-[WebCoreMotionManager sendMotionData:withHeading:]):
+ * platform/ios/WebVideoFullscreenControllerAVKit.mm:
+ (VideoFullscreenControllerContext::requestUpdateInlineRect):
+ (VideoFullscreenControllerContext::requestVideoContentLayer):
+ (VideoFullscreenControllerContext::returnVideoContentLayer):
+ (VideoFullscreenControllerContext::didSetupFullscreen):
+ (VideoFullscreenControllerContext::willExitFullscreen):
+ (VideoFullscreenControllerContext::didExitFullscreen):
+ (VideoFullscreenControllerContext::didCleanupFullscreen):
+ (VideoFullscreenControllerContext::fullscreenMayReturnToInline):
+ (VideoFullscreenControllerContext::requestFullscreenMode):
+ (VideoFullscreenControllerContext::setVideoLayerFrame):
+ (VideoFullscreenControllerContext::setVideoLayerGravity):
+ (VideoFullscreenControllerContext::fullscreenModeChanged):
+ (VideoFullscreenControllerContext::play):
+ (VideoFullscreenControllerContext::pause):
+ (VideoFullscreenControllerContext::togglePlayState):
+ (VideoFullscreenControllerContext::toggleMuted):
+ (VideoFullscreenControllerContext::setMuted):
+ (VideoFullscreenControllerContext::setVolume):
+ (VideoFullscreenControllerContext::setPlayingOnSecondScreen):
+ (VideoFullscreenControllerContext::beginScrubbing):
+ (VideoFullscreenControllerContext::endScrubbing):
+ (VideoFullscreenControllerContext::seekToTime):
+ (VideoFullscreenControllerContext::fastSeek):
+ (VideoFullscreenControllerContext::beginScanningForward):
+ (VideoFullscreenControllerContext::beginScanningBackward):
+ (VideoFullscreenControllerContext::endScanning):
+ (VideoFullscreenControllerContext::selectAudioMediaOption):
+ (VideoFullscreenControllerContext::selectLegibleMediaOption):
+ (VideoFullscreenControllerContext::duration const):
+ (VideoFullscreenControllerContext::currentTime const):
+ (VideoFullscreenControllerContext::bufferedTime const):
+ (VideoFullscreenControllerContext::isPlaying const):
+ (VideoFullscreenControllerContext::playbackRate const):
+ (VideoFullscreenControllerContext::seekableRanges const):
+ (VideoFullscreenControllerContext::seekableTimeRangesLastModifiedTime const):
+ (VideoFullscreenControllerContext::liveUpdateInterval const):
+ (VideoFullscreenControllerContext::canPlayFastReverse const):
+ (VideoFullscreenControllerContext::audioMediaSelectionOptions const):
+ (VideoFullscreenControllerContext::audioMediaSelectedIndex const):
+ (VideoFullscreenControllerContext::legibleMediaSelectionOptions const):
+ (VideoFullscreenControllerContext::legibleMediaSelectedIndex const):
+ (VideoFullscreenControllerContext::externalPlaybackEnabled const):
+ (VideoFullscreenControllerContext::externalPlaybackTargetType const):
+ (VideoFullscreenControllerContext::externalPlaybackLocalizedDeviceName const):
+ (VideoFullscreenControllerContext::wirelessVideoPlaybackDisabled const):
+ (VideoFullscreenControllerContext::setUpFullscreen):
+ (VideoFullscreenControllerContext::exitFullscreen):
+ (VideoFullscreenControllerContext::requestHideAndExitFullscreen):
+ (-[WebVideoFullscreenController enterFullscreen:mode:]):
+ (-[WebVideoFullscreenController exitFullscreen]):
+ (-[WebVideoFullscreenController requestHideAndExitFullscreen]):
+ * platform/ios/wak/WAKWindow.mm:
+ (-[WAKWindow setVisible:]):
+ (-[WAKWindow setScreenScale:]):
+ (-[WAKWindow sendEvent:]):
+ (-[WAKWindow sendMouseMoveEvent:contentChange:]):
+ * platform/network/ios/NetworkStateNotifierIOS.mm:
+ (WebCore::NetworkStateNotifier::startObserving):
+ * rendering/RenderThemeIOS.mm:
+ (WebCore::contentSizeCategoryDidChange):
+
2019-01-23 David Kilzer <[email protected]>
REGRESSION (r240292): Attempt to fix WinCairo build
Modified: trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp (240352 => 240353)
--- trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp 2019-01-23 20:09:54 UTC (rev 240352)
+++ trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp 2019-01-23 20:36:37 UTC (rev 240353)
@@ -97,7 +97,7 @@
#if HAVE(MEDIA_ACCESSIBILITY_FRAMEWORK)
static void userCaptionPreferencesChangedNotificationCallback(CFNotificationCenterRef, void* observer, CFStringRef, const void *, CFDictionaryRef)
{
-#if !PLATFORM(IOS_FAMILY)
+#if !USE(WEB_THREAD)
static_cast<CaptionUserPreferencesMediaAF*>(observer)->captionPreferencesChanged();
#else
WebThreadRun(^{
Modified: trunk/Source/WebCore/platform/cf/MainThreadSharedTimerCF.cpp (240352 => 240353)
--- trunk/Source/WebCore/platform/cf/MainThreadSharedTimerCF.cpp 2019-01-23 20:09:54 UTC (rev 240352)
+++ trunk/Source/WebCore/platform/cf/MainThreadSharedTimerCF.cpp 2019-01-23 20:36:37 UTC (rev 240353)
@@ -46,9 +46,13 @@
#if PLATFORM(IOS_FAMILY)
static void applicationDidBecomeActive(CFNotificationCenterRef, void*, CFStringRef, const void*, CFDictionaryRef)
{
+#if USE(WEB_THREAD)
WebThreadRun(^{
restartSharedTimer();
});
+#else
+ restartSharedTimer();
+#endif
}
#endif
Modified: trunk/Source/WebCore/platform/cocoa/ContentFilterUnblockHandlerCocoa.mm (240352 => 240353)
--- trunk/Source/WebCore/platform/cocoa/ContentFilterUnblockHandlerCocoa.mm 2019-01-23 20:09:54 UTC (rev 240352)
+++ trunk/Source/WebCore/platform/cocoa/ContentFilterUnblockHandlerCocoa.mm 2019-01-23 20:36:37 UTC (rev 240353)
@@ -144,7 +144,7 @@
static inline void dispatchToMainThread(void (^block)())
{
dispatch_async(dispatch_get_main_queue(), ^{
-#if PLATFORM(IOS_FAMILY)
+#if USE(WEB_THREAD)
WebThreadRun(block);
#else
block();
Modified: trunk/Source/WebCore/platform/graphics/cocoa/TextTrackRepresentationCocoa.mm (240352 => 240353)
--- trunk/Source/WebCore/platform/graphics/cocoa/TextTrackRepresentationCocoa.mm 2019-01-23 20:09:54 UTC (rev 240352)
+++ trunk/Source/WebCore/platform/graphics/cocoa/TextTrackRepresentationCocoa.mm 2019-01-23 20:36:37 UTC (rev 240353)
@@ -85,7 +85,7 @@
{
UNUSED_PARAM(change);
UNUSED_PARAM(context);
-#if PLATFORM(IOS_FAMILY)
+#if USE(WEB_THREAD)
WebThreadRun(^{
if (_parent && [keyPath isEqual:@"bounds"] && object == _parent->platformLayer())
_parent->client().textTrackRepresentationBoundsChanged(_parent->bounds());
Modified: trunk/Source/WebCore/platform/ios/LegacyTileCache.mm (240352 => 240353)
--- trunk/Source/WebCore/platform/ios/LegacyTileCache.mm 2019-01-23 20:09:54 UTC (rev 240352)
+++ trunk/Source/WebCore/platform/ios/LegacyTileCache.mm 2019-01-23 20:36:37 UTC (rev 240353)
@@ -277,12 +277,16 @@
m_hasPendingLayoutTiles = true;
LegacyTileCacheTombstone *tombstone = m_tombstone.get();
+#if USE(WEB_THREAD)
WebThreadRun(^{
+#endif
if ([tombstone isDead])
return;
m_hasPendingLayoutTiles = false;
doLayoutTiles();
+#if USE(WEB_THREAD)
});
+#endif
}
void LegacyTileCache::layoutTilesNow()
@@ -716,12 +720,16 @@
m_hasPendingUpdateTilingMode = true;
LegacyTileCacheTombstone *tombstone = m_tombstone.get();
+#if USE(WEB_THREAD)
WebThreadRun(^{
+#endif
if ([tombstone isDead])
return;
m_hasPendingUpdateTilingMode = false;
updateTilingMode();
+#if USE(WEB_THREAD)
});
+#endif
}
void LegacyTileCache::setTilingDirection(TilingDirection tilingDirection)
Modified: trunk/Source/WebCore/platform/ios/WebCoreMotionManager.mm (240352 => 240353)
--- trunk/Source/WebCore/platform/ios/WebCoreMotionManager.mm 2019-01-23 20:09:54 UTC (rev 240352)
+++ trunk/Source/WebCore/platform/ios/WebCoreMotionManager.mm 2019-01-23 20:36:37 UTC (rev 240353)
@@ -220,17 +220,23 @@
- (void)sendAccelerometerData:(CMAccelerometerData *)newAcceleration
{
+#if USE(WEB_THREAD)
WebThreadRun(^{
+#endif
CMAcceleration accel = newAcceleration.acceleration;
for (auto& client : copyToVector(m_deviceMotionClients))
client->motionChanged(0, 0, 0, accel.x * kGravity, accel.y * kGravity, accel.z * kGravity, 0, 0, 0);
+#if USE(WEB_THREAD)
});
+#endif
}
- (void)sendMotionData:(CMDeviceMotion *)newMotion withHeading:(CLHeading *)newHeading
{
+#if USE(WEB_THREAD)
WebThreadRun(^{
+#endif
// Acceleration is user + gravity
CMAcceleration userAccel = newMotion.userAcceleration;
CMAcceleration gravity = newMotion.gravity;
@@ -321,7 +327,9 @@
for (size_t i = 0; i < orientationClients.size(); ++i)
orientationClients[i]->orientationChanged(alpha, beta, gamma, heading, headingAccuracy);
+#if USE(WEB_THREAD)
});
+#endif
}
@end
Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm (240352 => 240353)
--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm 2019-01-23 20:09:54 UTC (rev 240352)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm 2019-01-23 20:36:37 UTC (rev 240353)
@@ -221,13 +221,17 @@
void VideoFullscreenControllerContext::requestUpdateInlineRect()
{
#if PLATFORM(IOS_FAMILY)
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
WebThreadRun([protectedThis = makeRefPtr(this), this] () mutable {
+#endif
IntRect clientRect = elementRectInWindow(m_videoElement.get());
dispatch_async(dispatch_get_main_queue(), [protectedThis = WTFMove(protectedThis), this, clientRect] {
m_interface->setInlineRect(clientRect, clientRect != IntRect(0, 0, 0, 0));
});
+#if USE(WEB_THREAD)
});
+#endif
#else
ASSERT_NOT_REACHED();
#endif
@@ -236,8 +240,10 @@
void VideoFullscreenControllerContext::requestVideoContentLayer()
{
#if PLATFORM(IOS_FAMILY)
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
WebThreadRun([protectedThis = makeRefPtr(this), this, videoFullscreenLayer = retainPtr([m_videoFullscreenView layer])] () mutable {
+#endif
[videoFullscreenLayer setBackgroundColor:cachedCGColor(WebCore::Color::transparent)];
m_fullscreenModel->setVideoFullscreenLayer(videoFullscreenLayer.get(), [protectedThis = WTFMove(protectedThis), this] () mutable {
dispatch_async(dispatch_get_main_queue(), [protectedThis = WTFMove(protectedThis), this] {
@@ -244,7 +250,9 @@
m_interface->setHasVideoContentLayer(true);
});
});
+#if USE(WEB_THREAD)
});
+#endif
#else
ASSERT_NOT_REACHED();
#endif
@@ -253,8 +261,10 @@
void VideoFullscreenControllerContext::returnVideoContentLayer()
{
#if PLATFORM(IOS_FAMILY)
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
WebThreadRun([protectedThis = makeRefPtr(this), this, videoFullscreenLayer = retainPtr([m_videoFullscreenView layer])] () mutable {
+#endif
[videoFullscreenLayer setBackgroundColor:cachedCGColor(WebCore::Color::transparent)];
m_fullscreenModel->setVideoFullscreenLayer(nil, [protectedThis = WTFMove(protectedThis), this] () mutable {
dispatch_async(dispatch_get_main_queue(), [protectedThis = WTFMove(protectedThis), this] {
@@ -261,7 +271,9 @@
m_interface->setHasVideoContentLayer(false);
});
});
+#if USE(WEB_THREAD)
});
+#endif
#else
ASSERT_NOT_REACHED();
#endif
@@ -269,13 +281,17 @@
void VideoFullscreenControllerContext::didSetupFullscreen()
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
+#endif
#if PLATFORM(IOS_FAMILY)
dispatch_async(dispatch_get_main_queue(), [protectedThis = makeRefPtr(this), this] {
m_interface->enterFullscreen();
});
#else
+#if USE(WEB_THREAD)
WebThreadRun([protectedThis = makeRefPtr(this), this, videoFullscreenLayer = retainPtr([m_videoFullscreenView layer])] () mutable {
+#endif
[videoFullscreenLayer setBackgroundColor:cachedCGColor(WebCore::Color::transparent)];
m_fullscreenModel->setVideoFullscreenLayer(videoFullscreenLayer.get(), [protectedThis = WTFMove(protectedThis), this] () mutable {
dispatch_async(dispatch_get_main_queue(), [protectedThis = WTFMove(protectedThis), this] {
@@ -282,18 +298,24 @@
m_interface->enterFullscreen();
});
});
+#if USE(WEB_THREAD)
});
#endif
+#endif
}
void VideoFullscreenControllerContext::willExitFullscreen()
{
#if PLATFORM(WATCHOS)
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
WebThreadRun([protectedThis = makeRefPtr(this), this] () mutable {
+#endif
m_fullscreenModel->willExitFullscreen();
+#if USE(WEB_THREAD)
});
#endif
+#endif
}
void VideoFullscreenControllerContext::didExitFullscreen()
@@ -304,25 +326,33 @@
m_interface->cleanupFullscreen();
});
#else
+#if USE(WEB_THREAD)
WebThreadRun([protectedThis = makeRefPtr(this), this] () mutable {
+#endif
m_fullscreenModel->setVideoFullscreenLayer(nil, [protectedThis = WTFMove(protectedThis), this] () mutable {
dispatch_async(dispatch_get_main_queue(), [protectedThis = WTFMove(protectedThis), this] {
m_interface->cleanupFullscreen();
});
});
+#if USE(WEB_THREAD)
});
#endif
+#endif
}
void VideoFullscreenControllerContext::didCleanupFullscreen()
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
+#endif
m_interface->setVideoFullscreenModel(nullptr);
m_interface->setVideoFullscreenChangeObserver(nullptr);
m_interface = nullptr;
m_videoFullscreenView = nil;
+#if USE(WEB_THREAD)
WebThreadRun([protectedThis = makeRefPtr(this), this] {
+#endif
m_fullscreenModel->setVideoFullscreenLayer(nil);
m_fullscreenModel->setVideoElement(nullptr);
m_playbackModel->setMediaElement(nullptr);
@@ -332,18 +362,24 @@
m_videoElement = nullptr;
[m_controller didFinishFullscreen:this];
+#if USE(WEB_THREAD)
});
+#endif
}
void VideoFullscreenControllerContext::fullscreenMayReturnToInline()
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
WebThreadRun([protectedThis = makeRefPtr(this), this] () mutable {
+#endif
IntRect clientRect = elementRectInWindow(m_videoElement.get());
dispatch_async(dispatch_get_main_queue(), [protectedThis = WTFMove(protectedThis), this, clientRect] {
m_interface->preparedToReturnToInline(true, clientRect);
});
+#if USE(WEB_THREAD)
});
+#endif
}
#pragma mark PlaybackSessionModelClient
@@ -555,21 +591,29 @@
void VideoFullscreenControllerContext::requestFullscreenMode(HTMLMediaElementEnums::VideoFullscreenMode mode, bool finishedWithMedia)
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
WebThreadRun([protectedThis = makeRefPtr(this), this, mode, finishedWithMedia] {
+#endif
if (m_fullscreenModel)
m_fullscreenModel->requestFullscreenMode(mode, finishedWithMedia);
+#if USE(WEB_THREAD)
});
+#endif
}
void VideoFullscreenControllerContext::setVideoLayerFrame(FloatRect frame)
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
+#endif
RetainPtr<CALayer> videoFullscreenLayer = [m_videoFullscreenView layer];
[videoFullscreenLayer setSublayerTransform:[videoFullscreenLayer transform]];
dispatch_async(dispatch_get_main_queue(), [protectedThis = makeRefPtr(this), this, frame, videoFullscreenLayer = WTFMove(videoFullscreenLayer)] () mutable {
+#if USE(WEB_THREAD)
WebThreadRun([protectedThis = WTFMove(protectedThis), this, frame, videoFullscreenLayer = WTFMove(videoFullscreenLayer)] {
+#endif
[CATransaction begin];
[CATransaction setDisableActions:YES];
[CATransaction setAnimationDuration:0];
@@ -579,26 +623,36 @@
if (m_fullscreenModel)
m_fullscreenModel->setVideoLayerFrame(frame);
[CATransaction commit];
+#if USE(WEB_THREAD)
});
+#endif
});
}
void VideoFullscreenControllerContext::setVideoLayerGravity(MediaPlayerEnums::VideoGravity videoGravity)
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
WebThreadRun([protectedThis = makeRefPtr(this), this, videoGravity] {
+#endif
if (m_fullscreenModel)
m_fullscreenModel->setVideoLayerGravity(videoGravity);
+#if USE(WEB_THREAD)
});
+#endif
}
void VideoFullscreenControllerContext::fullscreenModeChanged(HTMLMediaElementEnums::VideoFullscreenMode mode)
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
WebThreadRun([protectedThis = makeRefPtr(this), this, mode] {
+#endif
if (m_fullscreenModel)
m_fullscreenModel->fullscreenModeChanged(mode);
+#if USE(WEB_THREAD)
});
+#endif
}
bool VideoFullscreenControllerContext::hasVideo() const
@@ -688,205 +742,289 @@
void VideoFullscreenControllerContext::play()
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
WebThreadRun([protectedThis = makeRefPtr(this), this] {
+#endif
if (m_playbackModel)
m_playbackModel->play();
+#if USE(WEB_THREAD)
});
+#endif
}
void VideoFullscreenControllerContext::pause()
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
WebThreadRun([protectedThis = makeRefPtr(this), this] {
+#endif
if (m_playbackModel)
m_playbackModel->pause();
+#if USE(WEB_THREAD)
});
+#endif
}
void VideoFullscreenControllerContext::togglePlayState()
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
WebThreadRun([protectedThis = makeRefPtr(this), this] {
+#endif
if (m_playbackModel)
m_playbackModel->togglePlayState();
+#if USE(WEB_THREAD)
});
+#endif
}
void VideoFullscreenControllerContext::toggleMuted()
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
WebThreadRun([protectedThis = makeRefPtr(this), this] {
+#endif
if (m_playbackModel)
m_playbackModel->toggleMuted();
+#if USE(WEB_THREAD)
});
+#endif
}
void VideoFullscreenControllerContext::setMuted(bool muted)
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
WebThreadRun([protectedThis = makeRefPtr(this), this, muted] {
+#endif
if (m_playbackModel)
m_playbackModel->setMuted(muted);
+#if USE(WEB_THREAD)
});
+#endif
}
void VideoFullscreenControllerContext::setVolume(double volume)
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
WebThreadRun([protectedThis = makeRefPtr(this), this, volume] {
+#endif
if (m_playbackModel)
m_playbackModel->setVolume(volume);
+#if USE(WEB_THREAD)
});
+#endif
}
void VideoFullscreenControllerContext::setPlayingOnSecondScreen(bool value)
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
WebThreadRun([protectedThis = makeRefPtr(this), this, value] {
+#endif
if (m_playbackModel)
m_playbackModel->setPlayingOnSecondScreen(value);
+#if USE(WEB_THREAD)
});
+#endif
}
void VideoFullscreenControllerContext::beginScrubbing()
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
WebThreadRun([protectedThis = makeRefPtr(this), this] {
+#endif
if (m_playbackModel)
m_playbackModel->beginScrubbing();
+#if USE(WEB_THREAD)
});
+#endif
}
void VideoFullscreenControllerContext::endScrubbing()
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
WebThreadRun([protectedThis = makeRefPtr(this), this] {
+#endif
if (m_playbackModel)
m_playbackModel->endScrubbing();
+#if USE(WEB_THREAD)
});
+#endif
}
void VideoFullscreenControllerContext::seekToTime(double time, double toleranceBefore, double toleranceAfter)
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
WebThreadRun([protectedThis = makeRefPtr(this), this, time, toleranceBefore, toleranceAfter] {
+#endif
if (m_playbackModel)
m_playbackModel->seekToTime(time, toleranceBefore, toleranceAfter);
+#if USE(WEB_THREAD)
});
+#endif
}
void VideoFullscreenControllerContext::fastSeek(double time)
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
WebThreadRun([protectedThis = makeRefPtr(this), this, time] {
+#endif
if (m_playbackModel)
m_playbackModel->fastSeek(time);
+#if USE(WEB_THREAD)
});
+#endif
}
void VideoFullscreenControllerContext::beginScanningForward()
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
WebThreadRun([protectedThis = makeRefPtr(this), this] {
+#endif
if (m_playbackModel)
m_playbackModel->beginScanningForward();
+#if USE(WEB_THREAD)
});
+#endif
}
void VideoFullscreenControllerContext::beginScanningBackward()
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
WebThreadRun([protectedThis = makeRefPtr(this), this] {
+#endif
if (m_playbackModel)
m_playbackModel->beginScanningBackward();
+#if USE(WEB_THREAD)
});
+#endif
}
void VideoFullscreenControllerContext::endScanning()
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
WebThreadRun([protectedThis = makeRefPtr(this), this] {
+#endif
if (m_playbackModel)
m_playbackModel->endScanning();
+#if USE(WEB_THREAD)
});
+#endif
}
void VideoFullscreenControllerContext::selectAudioMediaOption(uint64_t index)
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
WebThreadRun([protectedThis = makeRefPtr(this), this, index] {
+#endif
if (m_playbackModel)
m_playbackModel->selectAudioMediaOption(index);
+#if USE(WEB_THREAD)
});
+#endif
}
void VideoFullscreenControllerContext::selectLegibleMediaOption(uint64_t index)
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
WebThreadRun([protectedThis = makeRefPtr(this), this, index] {
+#endif
if (m_playbackModel)
m_playbackModel->selectLegibleMediaOption(index);
+#if USE(WEB_THREAD)
});
+#endif
}
double VideoFullscreenControllerContext::duration() const
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
+#endif
return m_playbackModel ? m_playbackModel->duration() : 0;
}
double VideoFullscreenControllerContext::currentTime() const
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
+#endif
return m_playbackModel ? m_playbackModel->currentTime() : 0;
}
double VideoFullscreenControllerContext::bufferedTime() const
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
+#endif
return m_playbackModel ? m_playbackModel->bufferedTime() : 0;
}
bool VideoFullscreenControllerContext::isPlaying() const
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
+#endif
return m_playbackModel ? m_playbackModel->isPlaying() : false;
}
float VideoFullscreenControllerContext::playbackRate() const
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
+#endif
return m_playbackModel ? m_playbackModel->playbackRate() : 0;
}
Ref<TimeRanges> VideoFullscreenControllerContext::seekableRanges() const
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
+#endif
return m_playbackModel ? m_playbackModel->seekableRanges() : TimeRanges::create();
}
double VideoFullscreenControllerContext::seekableTimeRangesLastModifiedTime() const
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
+#endif
return m_playbackModel ? m_playbackModel->seekableTimeRangesLastModifiedTime() : 0;
}
double VideoFullscreenControllerContext::liveUpdateInterval() const
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
+#endif
return m_playbackModel ? m_playbackModel->liveUpdateInterval() : 0;
}
bool VideoFullscreenControllerContext::canPlayFastReverse() const
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
+#endif
return m_playbackModel ? m_playbackModel->canPlayFastReverse() : false;
}
Vector<MediaSelectionOption> VideoFullscreenControllerContext::audioMediaSelectionOptions() const
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
+#endif
if (m_playbackModel)
return m_playbackModel->audioMediaSelectionOptions();
return { };
@@ -894,13 +1032,17 @@
uint64_t VideoFullscreenControllerContext::audioMediaSelectedIndex() const
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
+#endif
return m_playbackModel ? m_playbackModel->audioMediaSelectedIndex() : -1;
}
Vector<MediaSelectionOption> VideoFullscreenControllerContext::legibleMediaSelectionOptions() const
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
+#endif
if (m_playbackModel)
return m_playbackModel->legibleMediaSelectionOptions();
return { };
@@ -908,31 +1050,41 @@
uint64_t VideoFullscreenControllerContext::legibleMediaSelectedIndex() const
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
+#endif
return m_playbackModel ? m_playbackModel->legibleMediaSelectedIndex() : -1;
}
bool VideoFullscreenControllerContext::externalPlaybackEnabled() const
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
+#endif
return m_playbackModel ? m_playbackModel->externalPlaybackEnabled() : false;
}
PlaybackSessionModel::ExternalPlaybackTargetType VideoFullscreenControllerContext::externalPlaybackTargetType() const
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
+#endif
return m_playbackModel ? m_playbackModel->externalPlaybackTargetType() : TargetTypeNone;
}
String VideoFullscreenControllerContext::externalPlaybackLocalizedDeviceName() const
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
+#endif
return m_playbackModel ? m_playbackModel->externalPlaybackLocalizedDeviceName() : String();
}
bool VideoFullscreenControllerContext::wirelessVideoPlaybackDisabled() const
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
+#endif
return m_playbackModel ? m_playbackModel->wirelessVideoPlaybackDisabled() : true;
}
@@ -940,7 +1092,9 @@
void VideoFullscreenControllerContext::setUpFullscreen(HTMLVideoElement& videoElement, UIView *view, HTMLMediaElementEnums::VideoFullscreenMode mode)
{
+#if USE(WEB_THREAD)
ASSERT(isMainThread());
+#endif
RetainPtr<UIView> viewRef = view;
m_videoElement = &videoElement;
m_playbackModel = PlaybackSessionModelMediaElement::create();
@@ -958,7 +1112,9 @@
m_fullscreenModel->setVideoLayerFrame(videoLayerFrame);
dispatch_async(dispatch_get_main_queue(), [protectedThis = makeRefPtr(this), this, videoElementClientRect, viewRef, mode, allowsPictureInPicture] {
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
+#endif
Ref<PlaybackSessionInterfaceAVKit> sessionInterface = PlaybackSessionInterfaceAVKit::create(*this);
m_interface = VideoFullscreenInterfaceAVKit::create(sessionInterface.get());
@@ -974,10 +1130,14 @@
void VideoFullscreenControllerContext::exitFullscreen()
{
+#if USE(WEB_THREAD)
ASSERT(WebThreadIsCurrent() || isMainThread());
+#endif
IntRect clientRect = elementRectInWindow(m_videoElement.get());
dispatch_async(dispatch_get_main_queue(), [protectedThis = makeRefPtr(this), this, clientRect] {
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
+#endif
m_interface->exitFullscreen(clientRect);
});
}
@@ -984,7 +1144,9 @@
void VideoFullscreenControllerContext::requestHideAndExitFullscreen()
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
+#endif
m_interface->requestHideAndExitFullscreen();
}
@@ -1013,7 +1175,9 @@
- (void)enterFullscreen:(UIView *)view mode:(HTMLMediaElementEnums::VideoFullscreenMode)mode
{
+#if USE(WEB_THREAD)
ASSERT(isMainThread());
+#endif
_context = VideoFullscreenControllerContext::create();
_context->setController(self);
_context->setUpFullscreen(*_videoElement.get(), view, mode);
@@ -1021,13 +1185,17 @@
- (void)exitFullscreen
{
+#if USE(WEB_THREAD)
ASSERT(WebThreadIsCurrent() || isMainThread());
+#endif
_context->exitFullscreen();
}
- (void)requestHideAndExitFullscreen
{
+#if USE(WEB_THREAD)
ASSERT(isUIThread());
+#endif
if (_context)
_context->requestHideAndExitFullscreen();
}
Modified: trunk/Source/WebCore/platform/ios/wak/WAKWindow.mm (240352 => 240353)
--- trunk/Source/WebCore/platform/ios/wak/WAKWindow.mm 2019-01-23 20:09:54 UTC (rev 240352)
+++ trunk/Source/WebCore/platform/ios/wak/WAKWindow.mm 2019-01-23 20:36:37 UTC (rev 240353)
@@ -199,9 +199,13 @@
_visible = visible;
+#if USE(WEB_THREAD)
WebThreadRun(^{
[[NSNotificationCenter defaultCenter] postNotificationName:WAKWindowVisibilityDidChangeNotification object:self userInfo:nil];
});
+#else
+ [[NSNotificationCenter defaultCenter] postNotificationName:WAKWindowVisibilityDidChangeNotification object:self userInfo:nil];
+#endif
}
- (NSSelectionDirection)keyViewSelectionDirection
@@ -292,9 +296,13 @@
{
_screenScale = scale;
+#if USE(WEB_THREAD)
WebThreadRun(^{
[[NSNotificationCenter defaultCenter] postNotificationName:WAKWindowScreenScaleDidChangeNotification object:self userInfo:nil];
});
+#else
+ [[NSNotificationCenter defaultCenter] postNotificationName:WAKWindowScreenScaleDidChangeNotification object:self userInfo:nil];
+#endif
}
- (CGFloat)screenScale
@@ -315,9 +323,13 @@
- (void)sendEvent:(WebEvent *)anEvent
{
ASSERT(anEvent);
+#if USE(WEB_THREAD)
WebThreadRun(^{
[self sendEventSynchronously:anEvent];
});
+#else
+ [self sendEventSynchronously:anEvent];
+#endif
}
- (void)sendEventSynchronously:(WebEvent *)anEvent
@@ -358,12 +370,16 @@
- (void)sendMouseMoveEvent:(WebEvent *)anEvent contentChange:(WKContentChange *)aContentChange
{
+#if USE(WEB_THREAD)
WebThreadRun(^{
+#endif
[self sendEvent:anEvent];
if (aContentChange)
*aContentChange = WKObservedContentChange();
+#if USE(WEB_THREAD)
});
+#endif
}
- (void)setExposedScrollViewRect:(CGRect)exposedScrollViewRect
Modified: trunk/Source/WebCore/platform/network/ios/NetworkStateNotifierIOS.mm (240352 => 240353)
--- trunk/Source/WebCore/platform/network/ios/NetworkStateNotifierIOS.mm 2019-01-23 20:09:54 UTC (rev 240352)
+++ trunk/Source/WebCore/platform/network/ios/NetworkStateNotifierIOS.mm 2019-01-23 20:36:37 UTC (rev 240353)
@@ -84,9 +84,13 @@
if (DeprecatedGlobalSettings::shouldOptOutOfNetworkStateObservation())
return;
m_observer = adoptNS([[WebNetworkStateObserver alloc] initWithBlock:^ {
+#if USE(WEB_THREAD)
WebThreadRun(^ {
NetworkStateNotifier::singleton().updateStateSoon();
});
+#else
+ NetworkStateNotifier::singleton().updateStateSoon();
+#endif
}]);
}
Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.mm (240352 => 240353)
--- trunk/Source/WebCore/rendering/RenderThemeIOS.mm 2019-01-23 20:09:54 UTC (rev 240352)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.mm 2019-01-23 20:36:37 UTC (rev 240353)
@@ -280,9 +280,13 @@
static void contentSizeCategoryDidChange(CFNotificationCenterRef, void*, CFStringRef name, const void*, CFDictionaryRef)
{
ASSERT_UNUSED(name, CFEqual(name, PAL::get_UIKit_UIContentSizeCategoryDidChangeNotification()));
+#if USE(WEB_THREAD)
WebThreadRun(^{
Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment();
});
+#else
+ Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment();
+#endif
}
RenderThemeIOS::RenderThemeIOS()
Modified: trunk/Source/WebKitLegacy/ios/ChangeLog (240352 => 240353)
--- trunk/Source/WebKitLegacy/ios/ChangeLog 2019-01-23 20:09:54 UTC (rev 240352)
+++ trunk/Source/WebKitLegacy/ios/ChangeLog 2019-01-23 20:36:37 UTC (rev 240353)
@@ -1,3 +1,19 @@
+2019-01-22 Conrad Shultz <[email protected]>
+
+ Clean up USE(WEB_THREAD)
+ https://bugs.webkit.org/show_bug.cgi?id=193698
+
+ Rubber-stamped by Tim Horton.
+
+ * Misc/WebGeolocationProviderIOS.mm:
+ (-[_WebCoreLocationUpdateThreadingProxy geolocationAuthorizationGranted]):
+ (-[_WebCoreLocationUpdateThreadingProxy geolocationAuthorizationDenied]):
+ (-[_WebCoreLocationUpdateThreadingProxy positionChanged:]):
+ (-[_WebCoreLocationUpdateThreadingProxy errorOccurred:]):
+ (-[_WebCoreLocationUpdateThreadingProxy resetGeolocation]):
+ * WebCoreSupport/WebFixedPositionContent.mm:
+ (-[WebFixedPositionContent didFinishScrollingOrZooming]):
+
2019-01-22 Daniel Bates <[email protected]>
[iOS] Interpret text key commands on keydown and app key commands on keypress
Modified: trunk/Source/WebKitLegacy/ios/Misc/WebGeolocationProviderIOS.mm (240352 => 240353)
--- trunk/Source/WebKitLegacy/ios/Misc/WebGeolocationProviderIOS.mm 2019-01-23 20:09:54 UTC (rev 240352)
+++ trunk/Source/WebKitLegacy/ios/Misc/WebGeolocationProviderIOS.mm 2019-01-23 20:36:37 UTC (rev 240353)
@@ -336,38 +336,58 @@
- (void)geolocationAuthorizationGranted
{
+#if USE(WEB_THREAD)
WebThreadRun(^{
[_provider geolocationAuthorizationGranted];
});
+#else
+ [_provider geolocationAuthorizationGranted];
+#endif
}
- (void)geolocationAuthorizationDenied
{
+#if USE(WEB_THREAD)
WebThreadRun(^{
[_provider geolocationAuthorizationDenied];
});
+#else
+ [_provider geolocationAuthorizationDenied];
+#endif
}
- (void)positionChanged:(WebCore::GeolocationPosition&&)position
{
RetainPtr<WebGeolocationPosition> webPosition = adoptNS([[WebGeolocationPosition alloc] initWithGeolocationPosition:WTFMove(position)]);
+#if USE(WEB_THREAD)
WebThreadRun(^{
[_provider positionChanged:webPosition.get()];
});
+#else
+ [_provider positionChanged:webPosition.get()];
+#endif
}
- (void)errorOccurred:(NSString *)errorMessage
{
+#if USE(WEB_THREAD)
WebThreadRun(^{
[_provider errorOccurred:errorMessage];
});
+#else
+ [_provider errorOccurred:errorMessage];
+#endif
}
- (void)resetGeolocation
{
+#if USE(WEB_THREAD)
WebThreadRun(^{
[_provider resetGeolocation];
});
+#else
+ [_provider resetGeolocation];
+#endif
}
@end
Modified: trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebFixedPositionContent.mm (240352 => 240353)
--- trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebFixedPositionContent.mm 2019-01-23 20:09:54 UTC (rev 240352)
+++ trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebFixedPositionContent.mm 2019-01-23 20:36:37 UTC (rev 240353)
@@ -164,10 +164,15 @@
// FIXME: share code with 'sendScrollEvent'?
- (void)didFinishScrollingOrZooming
{
+#if USE(WEB_THREAD)
WebThreadRun(^{
if (Frame* frame = [_private->m_webView _mainCoreFrame])
frame->viewportOffsetChanged(Frame::CompletedScrollOffset);
});
+#else
+ if (Frame* frame = [_private->m_webView _mainCoreFrame])
+ frame->viewportOffsetChanged(Frame::CompletedScrollOffset);
+#endif
}
- (void)setViewportConstrainedLayers:(WTF::HashMap<CALayer *, std::unique_ptr<WebCore::ViewportConstraints>>&)layerMap stickyContainerMap:(const WTF::HashMap<CALayer*, CALayer*>&)stickyContainers
Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (240352 => 240353)
--- trunk/Source/WebKitLegacy/mac/ChangeLog 2019-01-23 20:09:54 UTC (rev 240352)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog 2019-01-23 20:36:37 UTC (rev 240353)
@@ -1,3 +1,38 @@
+2019-01-22 Conrad Shultz <[email protected]>
+
+ Clean up USE(WEB_THREAD)
+ https://bugs.webkit.org/show_bug.cgi?id=193698
+
+ Rubber-stamped by Tim Horton.
+
+ * Misc/WebCache.mm:
+ (+[WebCache emptyInMemoryResources]):
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (-[WebFramePolicyListener use]):
+ * WebCoreSupport/WebGeolocationClient.mm:
+ (-[WebGeolocationPolicyListener allow]):
+ (-[WebGeolocationPolicyListener deny]):
+ (-[WebGeolocationPolicyListener denyOnlyThisRequest]):
+ * WebView/WebFrame.mm:
+ (-[WebFrame deviceOrientationChanged]):
+ * WebView/WebHTMLView.mm:
+ (hardwareKeyboardAvailabilityChangedCallback):
+ * WebView/WebView.mm:
+ (+[WebView _releaseMemoryNow]):
+ (+[WebView willEnterBackgroundWithCompletionHandler:]):
+ (-[WebView updateLayoutIgnorePendingStyleSheets]):
+ (-[WebView _dispatchUnloadEvent]):
+ (-[WebView _close]):
+ (-[WebView _preferencesChangedNotification:]):
+ (-[WebView _setCustomFixedPositionLayoutRectInWebThread:synchronize:]):
+ (-[WebView goBack]):
+ (-[WebView goForward]):
+ (+[WebView _cacheModelChangedNotification:]):
+ (-[WebView stopLoading:]):
+ (-[WebView stopLoadingAndClear]):
+ (-[WebView reload:]):
+ (WebInstallMemoryPressureHandler):
+
2019-01-23 Wenson Hsieh <[email protected]>
Introduce UndoStep::label() and adopt it in WebKitLegacy and WebKit
Modified: trunk/Source/WebKitLegacy/mac/Misc/WebCache.mm (240352 => 240353)
--- trunk/Source/WebKitLegacy/mac/Misc/WebCache.mm 2019-01-23 20:09:54 UTC (rev 240352)
+++ trunk/Source/WebKitLegacy/mac/Misc/WebCache.mm 2019-01-23 20:36:37 UTC (rev 240353)
@@ -139,7 +139,9 @@
// _close]. [WebView _close] schedules its work on the WebThread. So we
// schedule this method on the WebThread as well so as to pick up all the
// dead resources left behind after closing the WebViews
+#if USE(WEB_THREAD)
WebThreadRun(^{
+#endif
WebKit::MemoryMeasure measurer("[WebCache emptyInMemoryResources]");
// Toggling the cache model like this forces the cache to evict all its in-memory resources.
@@ -148,7 +150,9 @@
[WebView _setCacheModel:cacheModel];
WebCore::MemoryCache::singleton().pruneLiveResources(true);
+#if USE(WEB_THREAD)
});
+#endif
}
+ (void)sizeOfDeadResources:(int *)resources
Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm (240352 => 240353)
--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm 2019-01-23 20:09:54 UTC (rev 240352)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm 2019-01-23 20:36:37 UTC (rev 240353)
@@ -2454,12 +2454,16 @@
#if HAVE(APP_LINKS)
if (_appLinkURL && _frame) {
[LSAppLink openWithURL:_appLinkURL.get() completionHandler:^(BOOL success, NSError *) {
+#if USE(WEB_THREAD)
WebThreadRun(^{
+#endif
if (success)
[self receivedPolicyDecision:PolicyAction::Ignore];
else
[self receivedPolicyDecision:PolicyAction::Use];
+#if USE(WEB_THREAD)
});
+#endif
}];
return;
}
Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebGeolocationClient.mm (240352 => 240353)
--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebGeolocationClient.mm 2019-01-23 20:09:54 UTC (rev 240352)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebGeolocationClient.mm 2019-01-23 20:36:37 UTC (rev 240353)
@@ -174,25 +174,37 @@
- (void)allow
{
+#if USE(WEB_THREAD)
WebThreadRun(^{
_geolocation->setIsAllowed(true);
});
+#else
+ _geolocation->setIsAllowed(true);
+#endif
}
- (void)deny
{
+#if USE(WEB_THREAD)
WebThreadRun(^{
_geolocation->setIsAllowed(false);
});
+#else
+ _geolocation->setIsAllowed(false);
+#endif
}
- (void)denyOnlyThisRequest
{
+#if USE(WEB_THREAD)
WebThreadRun(^{
+#endif
// A soft deny does not prevent subsequent request from the Geolocation object.
[self deny];
_geolocation->resetIsAllowed();
+#if USE(WEB_THREAD)
});
+#endif
}
- (BOOL)shouldClearCache
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm (240352 => 240353)
--- trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm 2019-01-23 20:09:54 UTC (rev 240352)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm 2019-01-23 20:36:37 UTC (rev 240353)
@@ -1296,7 +1296,9 @@
- (void)deviceOrientationChanged
{
+#if USE(WEB_THREAD)
WebThreadRun(^{
+#endif
#if ENABLE(ORIENTATION_EVENTS)
WebView *webView = getWebView(self);
[webView _setDeviceOrientation:[[webView _UIKitDelegateForwarder] deviceOrientation]];
@@ -1303,7 +1305,9 @@
#endif
if (WebCore::Frame* frame = core(self))
frame->orientationChanged();
+#if USE(WEB_THREAD)
});
+#endif
}
- (void)setNeedsLayout
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm (240352 => 240353)
--- trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm 2019-01-23 20:09:54 UTC (rev 240352)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm 2019-01-23 20:36:37 UTC (rev 240353)
@@ -820,11 +820,15 @@
static void hardwareKeyboardAvailabilityChangedCallback(CFNotificationCenterRef, void* observer, CFStringRef, const void*, CFDictionaryRef)
{
ASSERT(observer);
+#if USE(WEB_THREAD)
WebThreadRun(^{
+#endif
WebHTMLView *webView = (__bridge WebHTMLView *)observer;
if (Frame* coreFrame = core([webView _frame]))
coreFrame->eventHandler().capsLockStateMayHaveChanged();
+#if USE(WEB_THREAD)
});
+#endif
}
#endif
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebView.mm (240352 => 240353)
--- trunk/Source/WebKitLegacy/mac/WebView/WebView.mm 2019-01-23 20:09:54 UTC (rev 240352)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebView.mm 2019-01-23 20:36:37 UTC (rev 240353)
@@ -1783,9 +1783,13 @@
+ (void)_releaseMemoryNow
{
+#if USE(WEB_THREAD)
WebThreadRun(^{
WebCore::releaseMemory(Critical::Yes, Synchronous::Yes);
});
+#else
+ WebCore::releaseMemory(Critical::Yes, Synchronous::Yes);
+#endif
}
- (void)_replaceCurrentHistoryItem:(WebHistoryItem *)item
@@ -1797,10 +1801,14 @@
+ (void)willEnterBackgroundWithCompletionHandler:(void(^)(void))handler
{
+#if USE(WEB_THREAD)
WebThreadRun(^{
+#endif
[WebView _releaseMemoryNow];
dispatch_async(dispatch_get_main_queue(), handler);
+#if USE(WEB_THREAD)
});
+#endif
}
+ (BOOL)isCharacterSmartReplaceExempt:(unichar)character isPreviousCharacter:(BOOL)b
@@ -1810,13 +1818,17 @@
- (void)updateLayoutIgnorePendingStyleSheets
{
+#if USE(WEB_THREAD)
WebThreadRun(^{
+#endif
for (Frame* frame = [self _mainCoreFrame]; frame; frame = frame->tree().traverseNext()) {
Document *document = frame->document();
if (document)
document->updateLayoutIgnorePendingStylesheets();
}
+#if USE(WEB_THREAD)
});
+#endif
}
#endif
@@ -2155,7 +2167,9 @@
- (void)_dispatchUnloadEvent
{
+#if USE(WEB_THREAD)
WebThreadRun(^{
+#endif
WebFrame *mainFrame = [self mainFrame];
Frame *coreMainFrame = core(mainFrame);
if (coreMainFrame) {
@@ -2163,7 +2177,9 @@
if (document)
document->dispatchWindowEvent(Event::create(eventNames().unloadEvent, Event::CanBubble::No, Event::IsCancelable::No));
}
+#if USE(WEB_THREAD)
});
+#endif
}
- (DOMCSSStyleDeclaration *)styleAtSelectionStart
@@ -2312,8 +2328,10 @@
[self _clearDelegates];
+#if USE(WEB_THREAD)
// Fix for problems such as <rdar://problem/5774587> Crash closing tab in WebCore::Frame::page() from -[WebCoreFrameBridge pauseTimeouts]
WebThreadRun(^{
+#endif
#endif
if (!_private || _private->closed)
@@ -2419,7 +2437,7 @@
[WebCache setDisabled:YES];
}
#endif
-#if PLATFORM(IOS_FAMILY)
+#if PLATFORM(IOS_FAMILY) && USE(WEB_THREAD)
// Fix for problems such as <rdar://problem/5774587> Crash closing tab in WebCore::Frame::page() from -[WebCoreFrameBridge pauseTimeouts]
});
#endif
@@ -2792,7 +2810,9 @@
#if PLATFORM(IOS_FAMILY)
} else {
+#if USE(WEB_THREAD)
WebThreadRun(^{
+#endif
// It is possible that the prefs object has already changed before the invocation could be called
// on the web thread. This is not possible on TOT which is why they have a simple ASSERT.
WebPreferences *preferences = (WebPreferences *)[notification object];
@@ -2799,7 +2819,9 @@
if (preferences != [self preferences])
return;
[self _preferencesChanged:preferences];
+#if USE(WEB_THREAD)
});
+#endif
}
#endif
}
@@ -4359,9 +4381,14 @@
}
if (!synchronize)
return;
+
+#if USE(WEB_THREAD)
WebThreadRun(^{
[self _synchronizeCustomFixedPositionLayoutRect];
});
+#else
+ [self _synchronizeCustomFixedPositionLayoutRect];
+#endif
}
- (void)_setCustomFixedPositionLayoutRect:(CGRect)rect
@@ -6441,11 +6468,11 @@
if (!_private->page)
return NO;
-#if PLATFORM(IOS_FAMILY)
+#if USE(WEB_THREAD)
if (WebThreadIsCurrent() || !WebThreadIsEnabled())
#endif
return _private->page->backForward().goBack();
-#if PLATFORM(IOS_FAMILY)
+#if USE(WEB_THREAD)
WebThreadRun(^{
_private->page->backForward().goBack();
});
@@ -6459,11 +6486,11 @@
if (!_private->page)
return NO;
-#if PLATFORM(IOS_FAMILY)
+#if USE(WEB_THREAD)
if (WebThreadIsCurrent() || !WebThreadIsEnabled())
#endif
return _private->page->backForward().goForward();
-#if PLATFORM(IOS_FAMILY)
+#if USE(WEB_THREAD)
WebThreadRun(^{
_private->page->backForward().goForward();
});
@@ -7414,7 +7441,7 @@
+ (void)_cacheModelChangedNotification:(NSNotification *)notification
{
-#if PLATFORM(IOS_FAMILY)
+#if USE(WEB_THREAD)
// This needs to happen on the Web Thread
WebThreadRun(^{
#endif
@@ -7426,7 +7453,7 @@
[self _setCacheModel:cacheModel];
else if (cacheModel < [self _cacheModel])
[self _setCacheModel:std::max([[WebPreferences standardPreferences] cacheModel], [self _maxCacheModelInAnyInstance])];
-#if PLATFORM(IOS_FAMILY)
+#if USE(WEB_THREAD)
});
#endif
}
@@ -7573,7 +7600,7 @@
- (IBAction)stopLoading:(id)sender
{
-#if PLATFORM(IOS_FAMILY)
+#if USE(WEB_THREAD)
if (WebThreadNotCurrent()) {
_private->isStopping = true;
WebThreadSetShouldYield();
@@ -7582,7 +7609,7 @@
_private->isStopping = false;
#endif
[[self mainFrame] stopLoading];
-#if PLATFORM(IOS_FAMILY)
+#if USE(WEB_THREAD)
});
#endif
}
@@ -7590,11 +7617,13 @@
#if PLATFORM(IOS_FAMILY)
- (void)stopLoadingAndClear
{
+#if USE(WEB_THREAD)
if (WebThreadNotCurrent() && !WebThreadIsLocked()) {
_private->isStopping = true;
WebThreadSetShouldYield();
}
WebThreadRun(^{
+#endif
_private->isStopping = false;
WebFrame *frame = [self mainFrame];
@@ -7609,17 +7638,19 @@
[mainFrameView _setDocumentView:plainWhiteView];
[plainWhiteView setNeedsDisplay:YES];
[plainWhiteView release];
+#if USE(WEB_THREAD)
});
+#endif
}
#endif
- (IBAction)reload:(id)sender
{
-#if PLATFORM(IOS_FAMILY)
+#if USE(WEB_THREAD)
WebThreadRun(^{
#endif
[[self mainFrame] reload];
-#if PLATFORM(IOS_FAMILY)
+#if USE(WEB_THREAD)
});
#endif
}
@@ -10279,11 +10310,11 @@
std::call_once(onceFlag, [] {
auto& memoryPressureHandler = MemoryPressureHandler::singleton();
memoryPressureHandler.setLowMemoryHandler([] (Critical critical, Synchronous synchronous) {
-#if PLATFORM(IOS_FAMILY)
+#if USE(WEB_THREAD)
WebThreadRun(^{
#endif
WebCore::releaseMemory(critical, synchronous);
-#if PLATFORM(IOS_FAMILY)
+#if USE(WEB_THREAD)
});
#endif
});