WebKit Bugzilla
Attachment 359858 Details for
Bug 193698
: Clean up USE(WEB_THREAD)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193698-20190122225216.patch (text/plain), 51.14 KB, created by
Conrad Shultz
on 2019-01-22 22:52:11 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Conrad Shultz
Created:
2019-01-22 22:52:11 PST
Size:
51.14 KB
patch
obsolete
>Subversion Revision: 240299 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index d9ef453f48665c98734ef9afb53cddd3db4fbab4..4f5fd5972ead3b84a8e86bc569a45244bc245970 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,86 @@ >+2019-01-22 Conrad Shultz <conrad_shultz@apple.com> >+ >+ Clean up USE(WEB_THREAD) >+ https://bugs.webkit.org/show_bug.cgi?id=193698 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * 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-22 Alex Christensen <achristensen@webkit.org> > > Fix more builds. >diff --git a/Source/WebKitLegacy/ios/ChangeLog b/Source/WebKitLegacy/ios/ChangeLog >index d093f3e321bbe595e32f9be7ef33b856a59b698a..7c11d709cf3af4dfe6cb7fea799f87c7723276da 100644 >--- a/Source/WebKitLegacy/ios/ChangeLog >+++ b/Source/WebKitLegacy/ios/ChangeLog >@@ -1,3 +1,19 @@ >+2019-01-22 Conrad Shultz <conrad_shultz@apple.com> >+ >+ Clean up USE(WEB_THREAD) >+ https://bugs.webkit.org/show_bug.cgi?id=193698 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Misc/WebGeolocationProviderIOS.mm: >+ (-[_WebCoreLocationUpdateThreadingProxy geolocationAuthorizationGranted]): >+ (-[_WebCoreLocationUpdateThreadingProxy geolocationAuthorizationDenied]): >+ (-[_WebCoreLocationUpdateThreadingProxy positionChanged:]): >+ (-[_WebCoreLocationUpdateThreadingProxy errorOccurred:]): >+ (-[_WebCoreLocationUpdateThreadingProxy resetGeolocation]): >+ * WebCoreSupport/WebFixedPositionContent.mm: >+ (-[WebFixedPositionContent didFinishScrollingOrZooming]): >+ > 2019-01-22 Daniel Bates <dabates@apple.com> > > [iOS] Interpret text key commands on keydown and app key commands on keypress >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index c07f40f2bab5d891fff387682a54aa719957d225..4991f28f79992816ce221db68f52df5b0740da81 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,38 @@ >+2019-01-22 Conrad Shultz <conrad_shultz@apple.com> >+ >+ Clean up USE(WEB_THREAD) >+ https://bugs.webkit.org/show_bug.cgi?id=193698 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * 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-22 Alex Christensen <achristensen@webkit.org> > > Move NetworkStorageSession ownership to NetworkProcess >diff --git a/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp b/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp >index b7923f7832226ed53f0c91f8deda85db9d63162c..763a1cadfa3c8b42d6f3797ef5dad4bf45bebe91 100644 >--- a/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp >+++ b/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp >@@ -97,7 +97,7 @@ namespace WebCore { > #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(^{ >diff --git a/Source/WebCore/platform/cf/MainThreadSharedTimerCF.cpp b/Source/WebCore/platform/cf/MainThreadSharedTimerCF.cpp >index b68922805e5d373de7f0aed7890825acccc12039..56d3b16779d6e0d5cc5202dde553ae3f4318fe08 100644 >--- a/Source/WebCore/platform/cf/MainThreadSharedTimerCF.cpp >+++ b/Source/WebCore/platform/cf/MainThreadSharedTimerCF.cpp >@@ -46,9 +46,13 @@ static const CFTimeInterval kCFTimeIntervalDistantFuture = std::numeric_limits<C > #if PLATFORM(IOS_FAMILY) > static void applicationDidBecomeActive(CFNotificationCenterRef, void*, CFStringRef, const void*, CFDictionaryRef) > { >+#if USE(WEB_THREAD) > WebThreadRun(^{ > restartSharedTimer(); > }); >+#else >+ restartSharedTimer(); >+#endif > } > #endif > >diff --git a/Source/WebCore/platform/cocoa/ContentFilterUnblockHandlerCocoa.mm b/Source/WebCore/platform/cocoa/ContentFilterUnblockHandlerCocoa.mm >index 9c329e7bc44c756d9a73a5ff63307bf120007219..3390ed81f99ce24f13547eb1aa24ec9c534620d7 100644 >--- a/Source/WebCore/platform/cocoa/ContentFilterUnblockHandlerCocoa.mm >+++ b/Source/WebCore/platform/cocoa/ContentFilterUnblockHandlerCocoa.mm >@@ -144,7 +144,7 @@ bool ContentFilterUnblockHandler::canHandleRequest(const ResourceRequest& reques > static inline void dispatchToMainThread(void (^block)()) > { > dispatch_async(dispatch_get_main_queue(), ^{ >-#if PLATFORM(IOS_FAMILY) >+#if USE(WEB_THREAD) > WebThreadRun(block); > #else > block(); >diff --git a/Source/WebCore/platform/graphics/cocoa/TextTrackRepresentationCocoa.mm b/Source/WebCore/platform/graphics/cocoa/TextTrackRepresentationCocoa.mm >index 6e60ebf1ffa6590f6f34e528a3e3358318b5ebdf..53826c4335eadefa20f38a23960ffde9784a30d8 100644 >--- a/Source/WebCore/platform/graphics/cocoa/TextTrackRepresentationCocoa.mm >+++ b/Source/WebCore/platform/graphics/cocoa/TextTrackRepresentationCocoa.mm >@@ -85,7 +85,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N > { > 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()); >diff --git a/Source/WebCore/platform/ios/LegacyTileCache.mm b/Source/WebCore/platform/ios/LegacyTileCache.mm >index 209f88f47a3b7cdc0143de92e24baddf9664b5f4..f85c8d9c71050391ec62a3e79941a214f4986488 100644 >--- a/Source/WebCore/platform/ios/LegacyTileCache.mm >+++ b/Source/WebCore/platform/ios/LegacyTileCache.mm >@@ -277,12 +277,16 @@ void LegacyTileCache::layoutTiles() > 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 @@ void LegacyTileCache::setTilingMode(TilingMode tilingMode) > 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) >diff --git a/Source/WebCore/platform/ios/WebCoreMotionManager.mm b/Source/WebCore/platform/ios/WebCoreMotionManager.mm >index 8f0a86d959b801f2881b02aca1156db158652e29..6703fd0c169e7959be6b667676eb4a34779e78b3 100644 >--- a/Source/WebCore/platform/ios/WebCoreMotionManager.mm >+++ b/Source/WebCore/platform/ios/WebCoreMotionManager.mm >@@ -220,17 +220,23 @@ - (void)update > > - (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 @@ - (void)sendMotionData:(CMDeviceMotion *)newMotion withHeading:(CLHeading *)newH > > for (size_t i = 0; i < orientationClients.size(); ++i) > orientationClients[i]->orientationChanged(alpha, beta, gamma, heading, headingAccuracy); >+#if USE(WEB_THREAD) > }); >+#endif > } > > @end >diff --git a/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm b/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm >index 691cbf81765c7dd156327bdd3f8c2f1e64faa9a6..ffe2110f9a8d11da78e15f6ccc17a2d89980f788 100644 >--- a/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm >+++ b/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm >@@ -221,13 +221,17 @@ private: > 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,15 +240,19 @@ void VideoFullscreenControllerContext::requestUpdateInlineRect() > 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] { > m_interface->setHasVideoContentLayer(true); > }); > }); >+#if USE(WEB_THREAD) > }); >+#endif > #else > ASSERT_NOT_REACHED(); > #endif >@@ -253,15 +261,19 @@ void VideoFullscreenControllerContext::requestVideoContentLayer() > 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] { > m_interface->setHasVideoContentLayer(false); > }); > }); >+#if USE(WEB_THREAD) > }); >+#endif > #else > ASSERT_NOT_REACHED(); > #endif >@@ -269,31 +281,41 @@ void VideoFullscreenControllerContext::returnVideoContentLayer() > > 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] { > 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 @@ void VideoFullscreenControllerContext::didExitFullscreen() > 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 @@ void VideoFullscreenControllerContext::didCleanupFullscreen() > 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::removeClient(VideoFullscreenModelClient& > > 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 @@ void VideoFullscreenControllerContext::setVideoLayerFrame(FloatRect frame) > 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::removeClient(PlaybackSessionModelClient& > > 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 @@ Vector<MediaSelectionOption> VideoFullscreenControllerContext::audioMediaSelecti > > 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 @@ Vector<MediaSelectionOption> VideoFullscreenControllerContext::legibleMediaSelec > > 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 @@ bool VideoFullscreenControllerContext::wirelessVideoPlaybackDisabled() const > > 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 @@ void VideoFullscreenControllerContext::setUpFullscreen(HTMLVideoElement& videoEl > 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,17 +1130,23 @@ void VideoFullscreenControllerContext::setUpFullscreen(HTMLVideoElement& videoEl > > 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); > }); > } > > void VideoFullscreenControllerContext::requestHideAndExitFullscreen() > { >+#if USE(WEB_THREAD) > ASSERT(isUIThread()); >+#endif > m_interface->requestHideAndExitFullscreen(); > } > >@@ -1013,7 +1175,9 @@ - (HTMLVideoElement*)videoElement > > - (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)enterFullscreen:(UIView *)view mode:(HTMLMediaElementEnums::VideoFullscr > > - (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(); > } >diff --git a/Source/WebCore/platform/ios/wak/WAKWindow.mm b/Source/WebCore/platform/ios/wak/WAKWindow.mm >index 8fcd0527ec98e753389859a4d18d5de4e2deaea1..7b0b45eb02965278ddbf896e22322d0027995b15 100644 >--- a/Source/WebCore/platform/ios/wak/WAKWindow.mm >+++ b/Source/WebCore/platform/ios/wak/WAKWindow.mm >@@ -199,9 +199,13 @@ - (void)setVisible:(BOOL)visible > > _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 @@ - (void)setScreenScale:(CGFloat)scale > { > _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 @@ - (CALayer *)rootLayer > - (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)sendEventSynchronously:(WebEvent *)anEvent > > - (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 >diff --git a/Source/WebCore/platform/network/ios/NetworkStateNotifierIOS.mm b/Source/WebCore/platform/network/ios/NetworkStateNotifierIOS.mm >index 21021928e6e5821ab20b962a1a93edbba247a460..df81c32a86ec0747007f4c7f521e4b89babe7ee8 100644 >--- a/Source/WebCore/platform/network/ios/NetworkStateNotifierIOS.mm >+++ b/Source/WebCore/platform/network/ios/NetworkStateNotifierIOS.mm >@@ -84,9 +84,13 @@ void NetworkStateNotifier::startObserving() > if (DeprecatedGlobalSettings::shouldOptOutOfNetworkStateObservation()) > return; > m_observer = adoptNS([[WebNetworkStateObserver alloc] initWithBlock:^ { >+#if USE(WEB_THREAD) > WebThreadRun(^ { > NetworkStateNotifier::singleton().updateStateSoon(); > }); >+#else >+ NetworkStateNotifier::singleton().updateStateSoon(); >+#endif > }]); > } > >diff --git a/Source/WebCore/rendering/RenderThemeIOS.mm b/Source/WebCore/rendering/RenderThemeIOS.mm >index 3215dce7058d8a13cb02daf73ecd07baf98e00fe..72eb887e10a4190140ea87a2583de151cca50992 100644 >--- a/Source/WebCore/rendering/RenderThemeIOS.mm >+++ b/Source/WebCore/rendering/RenderThemeIOS.mm >@@ -280,9 +280,13 @@ static IOSGradientRef gradientWithName(IOSGradientType gradientType) > 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() >diff --git a/Source/WebKitLegacy/ios/Misc/WebGeolocationProviderIOS.mm b/Source/WebKitLegacy/ios/Misc/WebGeolocationProviderIOS.mm >index c2ff350f74526e1256c19e4f52085cb351d24968..3d13a0767290ea09abb755996bce5601e3cd54c4 100644 >--- a/Source/WebKitLegacy/ios/Misc/WebGeolocationProviderIOS.mm >+++ b/Source/WebKitLegacy/ios/Misc/WebGeolocationProviderIOS.mm >@@ -336,38 +336,58 @@ - (id)initWithProvider:(WebGeolocationProviderIOS*)provider > > - (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 > >diff --git a/Source/WebKitLegacy/ios/WebCoreSupport/WebFixedPositionContent.mm b/Source/WebKitLegacy/ios/WebCoreSupport/WebFixedPositionContent.mm >index 217a4ed0a85a6bb414d3194cb7bfaefde036d47a..d4f7466103406f60ab48bfc52a8ca10369a0f749 100644 >--- a/Source/WebKitLegacy/ios/WebCoreSupport/WebFixedPositionContent.mm >+++ b/Source/WebKitLegacy/ios/WebCoreSupport/WebFixedPositionContent.mm >@@ -164,10 +164,15 @@ - (void)overflowScrollPositionForLayer:(CALayer *)scrollLayer changedTo:(CGPoint > // 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 >diff --git a/Source/WebKitLegacy/mac/Misc/WebCache.mm b/Source/WebKitLegacy/mac/Misc/WebCache.mm >index 3b6cd923aff115e736e21f21c9347850bc250092..4a2c330eaf38a98c1caad2eb6136b48ff24e448d 100644 >--- a/Source/WebKitLegacy/mac/Misc/WebCache.mm >+++ b/Source/WebKitLegacy/mac/Misc/WebCache.mm >@@ -139,7 +139,9 @@ + (void)emptyInMemoryResources > // _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 @@ + (void)emptyInMemoryResources > [WebView _setCacheModel:cacheModel]; > > WebCore::MemoryCache::singleton().pruneLiveResources(true); >+#if USE(WEB_THREAD) > }); >+#endif > } > > + (void)sizeOfDeadResources:(int *)resources >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm >index ae8b9efb7dadec6e818ece70f6739a2548d6dc58..73de0ed9639fb087f342953748f788c46476d7e2 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm >@@ -2454,12 +2454,16 @@ - (void)use > #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; > } >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebGeolocationClient.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebGeolocationClient.mm >index 2cf715e2d90dfe7668488bc17451b13edb2e30f8..012d04b1d9aee8dcb798d1c95fbbb485d768e4fc 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebGeolocationClient.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebGeolocationClient.mm >@@ -174,25 +174,37 @@ - (id)initWithGeolocation:(Geolocation*)geolocation forWebView:(WebView*)webView > > - (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 >diff --git a/Source/WebKitLegacy/mac/WebView/WebFrame.mm b/Source/WebKitLegacy/mac/WebView/WebFrame.mm >index a93def61399a5cc54ef61cae9c0379905890cd7c..7d16fc922ad2ab3c84013c11617eb32cb7b0bb1a 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebFrame.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebFrame.mm >@@ -1296,14 +1296,18 @@ - (void)_saveViewState > > - (void)deviceOrientationChanged > { >+#if USE(WEB_THREAD) > WebThreadRun(^{ >+#endif > #if ENABLE(ORIENTATION_EVENTS) > WebView *webView = getWebView(self); > [webView _setDeviceOrientation:[[webView _UIKitDelegateForwarder] deviceOrientation]]; > #endif > if (WebCore::Frame* frame = core(self)) > frame->orientationChanged(); >+#if USE(WEB_THREAD) > }); >+#endif > } > > - (void)setNeedsLayout >diff --git a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >index 7b4394aef3d9577374d6e9ee259cbd1df80d0fa8..c4208f2616f562bb0d78bb3e5a1c28e3c7869966 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >@@ -820,11 +820,15 @@ static NSString * const WebMarkedTextUpdatedNotification = @"WebMarkedTextUpdate > 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 > >diff --git a/Source/WebKitLegacy/mac/WebView/WebView.mm b/Source/WebKitLegacy/mac/WebView/WebView.mm >index ed0e0df79b03da66e8a29bced9ceaa93cd665e8c..e2013530e9f5e75a34a7396005f12d5fffd9333f 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebView.mm >@@ -1783,9 +1783,13 @@ - (id)initSimpleHTMLDocumentWithStyle:(NSString *)style frame:(CGRect)frame pref > > + (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)_replaceCurrentHistoryItem:(WebHistoryItem *)item > > + (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 @@ + (BOOL)isCharacterSmartReplaceExempt:(unichar)character isPreviousCharacter:(BO > > - (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 @@ - (BOOL)_isClosed > > - (void)_dispatchUnloadEvent > { >+#if USE(WEB_THREAD) > WebThreadRun(^{ >+#endif > WebFrame *mainFrame = [self mainFrame]; > Frame *coreMainFrame = core(mainFrame); > if (coreMainFrame) { >@@ -2163,7 +2177,9 @@ - (void)_dispatchUnloadEvent > 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 @@ - (void)_close > > [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 @@ - (void)_close > [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,14 +2810,18 @@ - (void)_preferencesChangedNotification:(NSNotification *)notification > > #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]; > if (preferences != [self preferences]) > return; > [self _preferencesChanged:preferences]; >+#if USE(WEB_THREAD) > }); >+#endif > } > #endif > } >@@ -4359,9 +4381,14 @@ - (void)_setCustomFixedPositionLayoutRectInWebThread:(CGRect)rect synchronize:(B > } > if (!synchronize) > return; >+ >+#if USE(WEB_THREAD) > WebThreadRun(^{ > [self _synchronizeCustomFixedPositionLayoutRect]; > }); >+#else >+ [self _synchronizeCustomFixedPositionLayoutRect]; >+#endif > } > > - (void)_setCustomFixedPositionLayoutRect:(CGRect)rect >@@ -6441,11 +6468,11 @@ - (BOOL)goBack > 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 @@ - (BOOL)goForward > 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 @@ + (WebCacheModel)_maxCacheModelInAnyInstance > > + (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 @@ + (void)_cacheModelChangedNotification:(NSNotification *)notification > [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)goForward:(id)sender > > - (IBAction)stopLoading:(id)sender > { >-#if PLATFORM(IOS_FAMILY) >+#if USE(WEB_THREAD) > if (WebThreadNotCurrent()) { > _private->isStopping = true; > WebThreadSetShouldYield(); >@@ -7582,7 +7609,7 @@ - (IBAction)stopLoading:(id)sender > _private->isStopping = false; > #endif > [[self mainFrame] stopLoading]; >-#if PLATFORM(IOS_FAMILY) >+#if USE(WEB_THREAD) > }); > #endif > } >@@ -7590,11 +7617,13 @@ - (IBAction)stopLoading:(id)sender > #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 @@ - (void)stopLoadingAndClear > [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 @@ void WebInstallMemoryPressureHandler(void) > 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 > });
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
thorton
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193698
: 359858