Changeset 240355 in webkit
- Timestamp:
- Jan 23, 2019 1:03:32 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp
r240353 r240355 98 98 static void userCaptionPreferencesChangedNotificationCallback(CFNotificationCenterRef, void* observer, CFStringRef, const void *, CFDictionaryRef) 99 99 { 100 #if ! USE(WEB_THREAD)100 #if !PLATFORM(IOS_FAMILY) 101 101 static_cast<CaptionUserPreferencesMediaAF*>(observer)->captionPreferencesChanged(); 102 102 #else -
trunk/Source/WebCore/platform/cf/MainThreadSharedTimerCF.cpp
r240353 r240355 47 47 static void applicationDidBecomeActive(CFNotificationCenterRef, void*, CFStringRef, const void*, CFDictionaryRef) 48 48 { 49 #if USE(WEB_THREAD)50 49 WebThreadRun(^{ 51 50 restartSharedTimer(); 52 51 }); 53 #else54 restartSharedTimer();55 #endif56 52 } 57 53 #endif -
trunk/Source/WebCore/platform/cocoa/ContentFilterUnblockHandlerCocoa.mm
r240353 r240355 145 145 { 146 146 dispatch_async(dispatch_get_main_queue(), ^{ 147 #if USE(WEB_THREAD)147 #if PLATFORM(IOS_FAMILY) 148 148 WebThreadRun(block); 149 149 #else -
trunk/Source/WebCore/platform/graphics/cocoa/TextTrackRepresentationCocoa.mm
r240353 r240355 86 86 UNUSED_PARAM(change); 87 87 UNUSED_PARAM(context); 88 #if USE(WEB_THREAD)88 #if PLATFORM(IOS_FAMILY) 89 89 WebThreadRun(^{ 90 90 if (_parent && [keyPath isEqual:@"bounds"] && object == _parent->platformLayer()) -
trunk/Source/WebCore/platform/ios/LegacyTileCache.mm
r240353 r240355 278 278 279 279 LegacyTileCacheTombstone *tombstone = m_tombstone.get(); 280 #if USE(WEB_THREAD)281 280 WebThreadRun(^{ 282 #endif283 281 if ([tombstone isDead]) 284 282 return; 285 283 m_hasPendingLayoutTiles = false; 286 284 doLayoutTiles(); 287 #if USE(WEB_THREAD)288 285 }); 289 #endif290 286 } 291 287 … … 721 717 722 718 LegacyTileCacheTombstone *tombstone = m_tombstone.get(); 723 #if USE(WEB_THREAD)724 719 WebThreadRun(^{ 725 #endif726 720 if ([tombstone isDead]) 727 721 return; 728 722 m_hasPendingUpdateTilingMode = false; 729 723 updateTilingMode(); 730 #if USE(WEB_THREAD)731 724 }); 732 #endif733 725 } 734 726 -
trunk/Source/WebCore/platform/ios/WebCoreMotionManager.mm
r240353 r240355 221 221 - (void)sendAccelerometerData:(CMAccelerometerData *)newAcceleration 222 222 { 223 #if USE(WEB_THREAD)224 223 WebThreadRun(^{ 225 #endif226 224 CMAcceleration accel = newAcceleration.acceleration; 227 225 228 226 for (auto& client : copyToVector(m_deviceMotionClients)) 229 227 client->motionChanged(0, 0, 0, accel.x * kGravity, accel.y * kGravity, accel.z * kGravity, 0, 0, 0); 230 #if USE(WEB_THREAD)231 228 }); 232 #endif233 229 } 234 230 235 231 - (void)sendMotionData:(CMDeviceMotion *)newMotion withHeading:(CLHeading *)newHeading 236 232 { 237 #if USE(WEB_THREAD)238 233 WebThreadRun(^{ 239 #endif240 234 // Acceleration is user + gravity 241 235 CMAcceleration userAccel = newMotion.userAcceleration; … … 328 322 for (size_t i = 0; i < orientationClients.size(); ++i) 329 323 orientationClients[i]->orientationChanged(alpha, beta, gamma, heading, headingAccuracy); 330 #if USE(WEB_THREAD)331 324 }); 325 } 326 327 @end 328 332 329 #endif 333 }334 335 @end336 337 #endif -
trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm
r240353 r240355 222 222 { 223 223 #if PLATFORM(IOS_FAMILY) 224 #if USE(WEB_THREAD)225 224 ASSERT(isUIThread()); 226 225 WebThreadRun([protectedThis = makeRefPtr(this), this] () mutable { 227 #endif228 226 IntRect clientRect = elementRectInWindow(m_videoElement.get()); 229 227 dispatch_async(dispatch_get_main_queue(), [protectedThis = WTFMove(protectedThis), this, clientRect] { 230 228 m_interface->setInlineRect(clientRect, clientRect != IntRect(0, 0, 0, 0)); 231 229 }); 232 #if USE(WEB_THREAD) 233 }); 234 #endif 230 }); 235 231 #else 236 232 ASSERT_NOT_REACHED(); … … 241 237 { 242 238 #if PLATFORM(IOS_FAMILY) 243 #if USE(WEB_THREAD)244 239 ASSERT(isUIThread()); 245 240 WebThreadRun([protectedThis = makeRefPtr(this), this, videoFullscreenLayer = retainPtr([m_videoFullscreenView layer])] () mutable { 246 #endif247 241 [videoFullscreenLayer setBackgroundColor:cachedCGColor(WebCore::Color::transparent)]; 248 242 m_fullscreenModel->setVideoFullscreenLayer(videoFullscreenLayer.get(), [protectedThis = WTFMove(protectedThis), this] () mutable { … … 251 245 }); 252 246 }); 253 #if USE(WEB_THREAD) 254 }); 255 #endif 247 }); 256 248 #else 257 249 ASSERT_NOT_REACHED(); … … 262 254 { 263 255 #if PLATFORM(IOS_FAMILY) 264 #if USE(WEB_THREAD)265 256 ASSERT(isUIThread()); 266 257 WebThreadRun([protectedThis = makeRefPtr(this), this, videoFullscreenLayer = retainPtr([m_videoFullscreenView layer])] () mutable { 267 #endif268 258 [videoFullscreenLayer setBackgroundColor:cachedCGColor(WebCore::Color::transparent)]; 269 259 m_fullscreenModel->setVideoFullscreenLayer(nil, [protectedThis = WTFMove(protectedThis), this] () mutable { … … 272 262 }); 273 263 }); 274 #if USE(WEB_THREAD) 275 }); 276 #endif 264 }); 277 265 #else 278 266 ASSERT_NOT_REACHED(); … … 282 270 void VideoFullscreenControllerContext::didSetupFullscreen() 283 271 { 284 #if USE(WEB_THREAD) 285 ASSERT(isUIThread()); 286 #endif 272 ASSERT(isUIThread()); 287 273 #if PLATFORM(IOS_FAMILY) 288 274 dispatch_async(dispatch_get_main_queue(), [protectedThis = makeRefPtr(this), this] { … … 290 276 }); 291 277 #else 292 #if USE(WEB_THREAD)293 278 WebThreadRun([protectedThis = makeRefPtr(this), this, videoFullscreenLayer = retainPtr([m_videoFullscreenView layer])] () mutable { 294 #endif295 279 [videoFullscreenLayer setBackgroundColor:cachedCGColor(WebCore::Color::transparent)]; 296 280 m_fullscreenModel->setVideoFullscreenLayer(videoFullscreenLayer.get(), [protectedThis = WTFMove(protectedThis), this] () mutable { … … 299 283 }); 300 284 }); 301 #if USE(WEB_THREAD)302 285 }); 303 286 #endif 304 #endif305 287 } 306 288 … … 308 290 { 309 291 #if PLATFORM(WATCHOS) 310 #if USE(WEB_THREAD)311 292 ASSERT(isUIThread()); 312 293 WebThreadRun([protectedThis = makeRefPtr(this), this] () mutable { 313 #endif314 294 m_fullscreenModel->willExitFullscreen(); 315 #if USE(WEB_THREAD) 316 }); 317 #endif 295 }); 318 296 #endif 319 297 } … … 327 305 }); 328 306 #else 329 #if USE(WEB_THREAD)330 307 WebThreadRun([protectedThis = makeRefPtr(this), this] () mutable { 331 #endif332 308 m_fullscreenModel->setVideoFullscreenLayer(nil, [protectedThis = WTFMove(protectedThis), this] () mutable { 333 309 dispatch_async(dispatch_get_main_queue(), [protectedThis = WTFMove(protectedThis), this] { … … 335 311 }); 336 312 }); 337 #if USE(WEB_THREAD)338 313 }); 339 314 #endif 340 #endif341 315 } 342 316 343 317 void VideoFullscreenControllerContext::didCleanupFullscreen() 344 318 { 345 #if USE(WEB_THREAD) 346 ASSERT(isUIThread()); 347 #endif 319 ASSERT(isUIThread()); 348 320 m_interface->setVideoFullscreenModel(nullptr); 349 321 m_interface->setVideoFullscreenChangeObserver(nullptr); … … 351 323 m_videoFullscreenView = nil; 352 324 353 #if USE(WEB_THREAD)354 325 WebThreadRun([protectedThis = makeRefPtr(this), this] { 355 #endif356 326 m_fullscreenModel->setVideoFullscreenLayer(nil); 357 327 m_fullscreenModel->setVideoElement(nullptr); … … 363 333 364 334 [m_controller didFinishFullscreen:this]; 365 #if USE(WEB_THREAD) 366 }); 367 #endif 335 }); 368 336 } 369 337 370 338 void VideoFullscreenControllerContext::fullscreenMayReturnToInline() 371 339 { 372 #if USE(WEB_THREAD)373 340 ASSERT(isUIThread()); 374 341 WebThreadRun([protectedThis = makeRefPtr(this), this] () mutable { 375 #endif376 342 IntRect clientRect = elementRectInWindow(m_videoElement.get()); 377 343 dispatch_async(dispatch_get_main_queue(), [protectedThis = WTFMove(protectedThis), this, clientRect] { 378 344 m_interface->preparedToReturnToInline(true, clientRect); 379 345 }); 380 #if USE(WEB_THREAD) 381 }); 382 #endif 346 }); 383 347 } 384 348 … … 592 556 void VideoFullscreenControllerContext::requestFullscreenMode(HTMLMediaElementEnums::VideoFullscreenMode mode, bool finishedWithMedia) 593 557 { 594 #if USE(WEB_THREAD)595 558 ASSERT(isUIThread()); 596 559 WebThreadRun([protectedThis = makeRefPtr(this), this, mode, finishedWithMedia] { 597 #endif598 560 if (m_fullscreenModel) 599 561 m_fullscreenModel->requestFullscreenMode(mode, finishedWithMedia); 600 #if USE(WEB_THREAD) 601 }); 602 #endif 562 }); 603 563 } 604 564 605 565 void VideoFullscreenControllerContext::setVideoLayerFrame(FloatRect frame) 606 566 { 607 #if USE(WEB_THREAD) 608 ASSERT(isUIThread()); 609 #endif 567 ASSERT(isUIThread()); 610 568 RetainPtr<CALayer> videoFullscreenLayer = [m_videoFullscreenView layer]; 611 569 [videoFullscreenLayer setSublayerTransform:[videoFullscreenLayer transform]]; 612 570 613 571 dispatch_async(dispatch_get_main_queue(), [protectedThis = makeRefPtr(this), this, frame, videoFullscreenLayer = WTFMove(videoFullscreenLayer)] () mutable { 614 #if USE(WEB_THREAD)615 572 WebThreadRun([protectedThis = WTFMove(protectedThis), this, frame, videoFullscreenLayer = WTFMove(videoFullscreenLayer)] { 616 #endif617 573 [CATransaction begin]; 618 574 [CATransaction setDisableActions:YES]; … … 624 580 m_fullscreenModel->setVideoLayerFrame(frame); 625 581 [CATransaction commit]; 626 #if USE(WEB_THREAD) 627 }); 628 #endif 582 }); 629 583 }); 630 584 } … … 632 586 void VideoFullscreenControllerContext::setVideoLayerGravity(MediaPlayerEnums::VideoGravity videoGravity) 633 587 { 634 #if USE(WEB_THREAD)635 588 ASSERT(isUIThread()); 636 589 WebThreadRun([protectedThis = makeRefPtr(this), this, videoGravity] { 637 #endif638 590 if (m_fullscreenModel) 639 591 m_fullscreenModel->setVideoLayerGravity(videoGravity); 640 #if USE(WEB_THREAD) 641 }); 642 #endif 592 }); 643 593 } 644 594 645 595 void VideoFullscreenControllerContext::fullscreenModeChanged(HTMLMediaElementEnums::VideoFullscreenMode mode) 646 596 { 647 #if USE(WEB_THREAD)648 597 ASSERT(isUIThread()); 649 598 WebThreadRun([protectedThis = makeRefPtr(this), this, mode] { 650 #endif651 599 if (m_fullscreenModel) 652 600 m_fullscreenModel->fullscreenModeChanged(mode); 653 #if USE(WEB_THREAD) 654 }); 655 #endif 601 }); 656 602 } 657 603 … … 743 689 void VideoFullscreenControllerContext::play() 744 690 { 745 #if USE(WEB_THREAD)746 691 ASSERT(isUIThread()); 747 692 WebThreadRun([protectedThis = makeRefPtr(this), this] { 748 #endif749 693 if (m_playbackModel) 750 694 m_playbackModel->play(); 751 #if USE(WEB_THREAD) 752 }); 753 #endif 695 }); 754 696 } 755 697 756 698 void VideoFullscreenControllerContext::pause() 757 699 { 758 #if USE(WEB_THREAD)759 700 ASSERT(isUIThread()); 760 701 WebThreadRun([protectedThis = makeRefPtr(this), this] { 761 #endif762 702 if (m_playbackModel) 763 703 m_playbackModel->pause(); 764 #if USE(WEB_THREAD) 765 }); 766 #endif 704 }); 767 705 } 768 706 769 707 void VideoFullscreenControllerContext::togglePlayState() 770 708 { 771 #if USE(WEB_THREAD)772 709 ASSERT(isUIThread()); 773 710 WebThreadRun([protectedThis = makeRefPtr(this), this] { 774 #endif775 711 if (m_playbackModel) 776 712 m_playbackModel->togglePlayState(); 777 #if USE(WEB_THREAD) 778 }); 779 #endif 713 }); 780 714 } 781 715 782 716 void VideoFullscreenControllerContext::toggleMuted() 783 717 { 784 #if USE(WEB_THREAD)785 718 ASSERT(isUIThread()); 786 719 WebThreadRun([protectedThis = makeRefPtr(this), this] { 787 #endif788 720 if (m_playbackModel) 789 721 m_playbackModel->toggleMuted(); 790 #if USE(WEB_THREAD) 791 }); 792 #endif 722 }); 793 723 } 794 724 795 725 void VideoFullscreenControllerContext::setMuted(bool muted) 796 726 { 797 #if USE(WEB_THREAD)798 727 ASSERT(isUIThread()); 799 728 WebThreadRun([protectedThis = makeRefPtr(this), this, muted] { 800 #endif801 729 if (m_playbackModel) 802 730 m_playbackModel->setMuted(muted); 803 #if USE(WEB_THREAD) 804 }); 805 #endif 731 }); 806 732 } 807 733 808 734 void VideoFullscreenControllerContext::setVolume(double volume) 809 735 { 810 #if USE(WEB_THREAD)811 736 ASSERT(isUIThread()); 812 737 WebThreadRun([protectedThis = makeRefPtr(this), this, volume] { 813 #endif814 738 if (m_playbackModel) 815 739 m_playbackModel->setVolume(volume); 816 #if USE(WEB_THREAD) 817 }); 818 #endif 740 }); 819 741 } 820 742 821 743 void VideoFullscreenControllerContext::setPlayingOnSecondScreen(bool value) 822 744 { 823 #if USE(WEB_THREAD)824 745 ASSERT(isUIThread()); 825 746 WebThreadRun([protectedThis = makeRefPtr(this), this, value] { 826 #endif827 747 if (m_playbackModel) 828 748 m_playbackModel->setPlayingOnSecondScreen(value); 829 #if USE(WEB_THREAD) 830 }); 831 #endif 749 }); 832 750 } 833 751 834 752 void VideoFullscreenControllerContext::beginScrubbing() 835 753 { 836 #if USE(WEB_THREAD)837 754 ASSERT(isUIThread()); 838 755 WebThreadRun([protectedThis = makeRefPtr(this), this] { 839 #endif840 756 if (m_playbackModel) 841 757 m_playbackModel->beginScrubbing(); 842 #if USE(WEB_THREAD) 843 }); 844 #endif 758 }); 845 759 } 846 760 847 761 void VideoFullscreenControllerContext::endScrubbing() 848 762 { 849 #if USE(WEB_THREAD)850 763 ASSERT(isUIThread()); 851 764 WebThreadRun([protectedThis = makeRefPtr(this), this] { 852 #endif853 765 if (m_playbackModel) 854 766 m_playbackModel->endScrubbing(); 855 #if USE(WEB_THREAD) 856 }); 857 #endif 767 }); 858 768 } 859 769 860 770 void VideoFullscreenControllerContext::seekToTime(double time, double toleranceBefore, double toleranceAfter) 861 771 { 862 #if USE(WEB_THREAD)863 772 ASSERT(isUIThread()); 864 773 WebThreadRun([protectedThis = makeRefPtr(this), this, time, toleranceBefore, toleranceAfter] { 865 #endif866 774 if (m_playbackModel) 867 775 m_playbackModel->seekToTime(time, toleranceBefore, toleranceAfter); 868 #if USE(WEB_THREAD) 869 }); 870 #endif 776 }); 871 777 } 872 778 873 779 void VideoFullscreenControllerContext::fastSeek(double time) 874 780 { 875 #if USE(WEB_THREAD)876 781 ASSERT(isUIThread()); 877 782 WebThreadRun([protectedThis = makeRefPtr(this), this, time] { 878 #endif879 783 if (m_playbackModel) 880 784 m_playbackModel->fastSeek(time); 881 #if USE(WEB_THREAD) 882 }); 883 #endif 785 }); 884 786 } 885 787 886 788 void VideoFullscreenControllerContext::beginScanningForward() 887 789 { 888 #if USE(WEB_THREAD)889 790 ASSERT(isUIThread()); 890 791 WebThreadRun([protectedThis = makeRefPtr(this), this] { 891 #endif892 792 if (m_playbackModel) 893 793 m_playbackModel->beginScanningForward(); 894 #if USE(WEB_THREAD) 895 }); 896 #endif 794 }); 897 795 } 898 796 899 797 void VideoFullscreenControllerContext::beginScanningBackward() 900 798 { 901 #if USE(WEB_THREAD)902 799 ASSERT(isUIThread()); 903 800 WebThreadRun([protectedThis = makeRefPtr(this), this] { 904 #endif905 801 if (m_playbackModel) 906 802 m_playbackModel->beginScanningBackward(); 907 #if USE(WEB_THREAD) 908 }); 909 #endif 803 }); 910 804 } 911 805 912 806 void VideoFullscreenControllerContext::endScanning() 913 807 { 914 #if USE(WEB_THREAD)915 808 ASSERT(isUIThread()); 916 809 WebThreadRun([protectedThis = makeRefPtr(this), this] { 917 #endif918 810 if (m_playbackModel) 919 811 m_playbackModel->endScanning(); 920 #if USE(WEB_THREAD) 921 }); 922 #endif 812 }); 923 813 } 924 814 925 815 void VideoFullscreenControllerContext::selectAudioMediaOption(uint64_t index) 926 816 { 927 #if USE(WEB_THREAD)928 817 ASSERT(isUIThread()); 929 818 WebThreadRun([protectedThis = makeRefPtr(this), this, index] { 930 #endif931 819 if (m_playbackModel) 932 820 m_playbackModel->selectAudioMediaOption(index); 933 #if USE(WEB_THREAD) 934 }); 935 #endif 821 }); 936 822 } 937 823 938 824 void VideoFullscreenControllerContext::selectLegibleMediaOption(uint64_t index) 939 825 { 940 #if USE(WEB_THREAD)941 826 ASSERT(isUIThread()); 942 827 WebThreadRun([protectedThis = makeRefPtr(this), this, index] { 943 #endif944 828 if (m_playbackModel) 945 829 m_playbackModel->selectLegibleMediaOption(index); 946 #if USE(WEB_THREAD) 947 }); 948 #endif 830 }); 949 831 } 950 832 951 833 double VideoFullscreenControllerContext::duration() const 952 834 { 953 #if USE(WEB_THREAD) 954 ASSERT(isUIThread()); 955 #endif 835 ASSERT(isUIThread()); 956 836 return m_playbackModel ? m_playbackModel->duration() : 0; 957 837 } … … 959 839 double VideoFullscreenControllerContext::currentTime() const 960 840 { 961 #if USE(WEB_THREAD) 962 ASSERT(isUIThread()); 963 #endif 841 ASSERT(isUIThread()); 964 842 return m_playbackModel ? m_playbackModel->currentTime() : 0; 965 843 } … … 967 845 double VideoFullscreenControllerContext::bufferedTime() const 968 846 { 969 #if USE(WEB_THREAD) 970 ASSERT(isUIThread()); 971 #endif 847 ASSERT(isUIThread()); 972 848 return m_playbackModel ? m_playbackModel->bufferedTime() : 0; 973 849 } … … 975 851 bool VideoFullscreenControllerContext::isPlaying() const 976 852 { 977 #if USE(WEB_THREAD) 978 ASSERT(isUIThread()); 979 #endif 853 ASSERT(isUIThread()); 980 854 return m_playbackModel ? m_playbackModel->isPlaying() : false; 981 855 } … … 983 857 float VideoFullscreenControllerContext::playbackRate() const 984 858 { 985 #if USE(WEB_THREAD) 986 ASSERT(isUIThread()); 987 #endif 859 ASSERT(isUIThread()); 988 860 return m_playbackModel ? m_playbackModel->playbackRate() : 0; 989 861 } … … 991 863 Ref<TimeRanges> VideoFullscreenControllerContext::seekableRanges() const 992 864 { 993 #if USE(WEB_THREAD) 994 ASSERT(isUIThread()); 995 #endif 865 ASSERT(isUIThread()); 996 866 return m_playbackModel ? m_playbackModel->seekableRanges() : TimeRanges::create(); 997 867 } … … 999 869 double VideoFullscreenControllerContext::seekableTimeRangesLastModifiedTime() const 1000 870 { 1001 #if USE(WEB_THREAD) 1002 ASSERT(isUIThread()); 1003 #endif 871 ASSERT(isUIThread()); 1004 872 return m_playbackModel ? m_playbackModel->seekableTimeRangesLastModifiedTime() : 0; 1005 873 } … … 1007 875 double VideoFullscreenControllerContext::liveUpdateInterval() const 1008 876 { 1009 #if USE(WEB_THREAD) 1010 ASSERT(isUIThread()); 1011 #endif 877 ASSERT(isUIThread()); 1012 878 return m_playbackModel ? m_playbackModel->liveUpdateInterval() : 0; 1013 879 } … … 1015 881 bool VideoFullscreenControllerContext::canPlayFastReverse() const 1016 882 { 1017 #if USE(WEB_THREAD) 1018 ASSERT(isUIThread()); 1019 #endif 883 ASSERT(isUIThread()); 1020 884 return m_playbackModel ? m_playbackModel->canPlayFastReverse() : false; 1021 885 } … … 1023 887 Vector<MediaSelectionOption> VideoFullscreenControllerContext::audioMediaSelectionOptions() const 1024 888 { 1025 #if USE(WEB_THREAD) 1026 ASSERT(isUIThread()); 1027 #endif 889 ASSERT(isUIThread()); 1028 890 if (m_playbackModel) 1029 891 return m_playbackModel->audioMediaSelectionOptions(); … … 1033 895 uint64_t VideoFullscreenControllerContext::audioMediaSelectedIndex() const 1034 896 { 1035 #if USE(WEB_THREAD) 1036 ASSERT(isUIThread()); 1037 #endif 897 ASSERT(isUIThread()); 1038 898 return m_playbackModel ? m_playbackModel->audioMediaSelectedIndex() : -1; 1039 899 } … … 1041 901 Vector<MediaSelectionOption> VideoFullscreenControllerContext::legibleMediaSelectionOptions() const 1042 902 { 1043 #if USE(WEB_THREAD) 1044 ASSERT(isUIThread()); 1045 #endif 903 ASSERT(isUIThread()); 1046 904 if (m_playbackModel) 1047 905 return m_playbackModel->legibleMediaSelectionOptions(); … … 1051 909 uint64_t VideoFullscreenControllerContext::legibleMediaSelectedIndex() const 1052 910 { 1053 #if USE(WEB_THREAD) 1054 ASSERT(isUIThread()); 1055 #endif 911 ASSERT(isUIThread()); 1056 912 return m_playbackModel ? m_playbackModel->legibleMediaSelectedIndex() : -1; 1057 913 } … … 1059 915 bool VideoFullscreenControllerContext::externalPlaybackEnabled() const 1060 916 { 1061 #if USE(WEB_THREAD) 1062 ASSERT(isUIThread()); 1063 #endif 917 ASSERT(isUIThread()); 1064 918 return m_playbackModel ? m_playbackModel->externalPlaybackEnabled() : false; 1065 919 } … … 1067 921 PlaybackSessionModel::ExternalPlaybackTargetType VideoFullscreenControllerContext::externalPlaybackTargetType() const 1068 922 { 1069 #if USE(WEB_THREAD) 1070 ASSERT(isUIThread()); 1071 #endif 923 ASSERT(isUIThread()); 1072 924 return m_playbackModel ? m_playbackModel->externalPlaybackTargetType() : TargetTypeNone; 1073 925 } … … 1075 927 String VideoFullscreenControllerContext::externalPlaybackLocalizedDeviceName() const 1076 928 { 1077 #if USE(WEB_THREAD) 1078 ASSERT(isUIThread()); 1079 #endif 929 ASSERT(isUIThread()); 1080 930 return m_playbackModel ? m_playbackModel->externalPlaybackLocalizedDeviceName() : String(); 1081 931 } … … 1083 933 bool VideoFullscreenControllerContext::wirelessVideoPlaybackDisabled() const 1084 934 { 1085 #if USE(WEB_THREAD) 1086 ASSERT(isUIThread()); 1087 #endif 935 ASSERT(isUIThread()); 1088 936 return m_playbackModel ? m_playbackModel->wirelessVideoPlaybackDisabled() : true; 1089 937 } … … 1093 941 void VideoFullscreenControllerContext::setUpFullscreen(HTMLVideoElement& videoElement, UIView *view, HTMLMediaElementEnums::VideoFullscreenMode mode) 1094 942 { 1095 #if USE(WEB_THREAD)1096 943 ASSERT(isMainThread()); 1097 #endif1098 944 RetainPtr<UIView> viewRef = view; 1099 945 m_videoElement = &videoElement; … … 1113 959 1114 960 dispatch_async(dispatch_get_main_queue(), [protectedThis = makeRefPtr(this), this, videoElementClientRect, viewRef, mode, allowsPictureInPicture] { 1115 #if USE(WEB_THREAD)1116 961 ASSERT(isUIThread()); 1117 #endif1118 962 1119 963 Ref<PlaybackSessionInterfaceAVKit> sessionInterface = PlaybackSessionInterfaceAVKit::create(*this); … … 1131 975 void VideoFullscreenControllerContext::exitFullscreen() 1132 976 { 1133 #if USE(WEB_THREAD)1134 977 ASSERT(WebThreadIsCurrent() || isMainThread()); 1135 #endif1136 978 IntRect clientRect = elementRectInWindow(m_videoElement.get()); 1137 979 dispatch_async(dispatch_get_main_queue(), [protectedThis = makeRefPtr(this), this, clientRect] { 1138 #if USE(WEB_THREAD)1139 980 ASSERT(isUIThread()); 1140 #endif1141 981 m_interface->exitFullscreen(clientRect); 1142 982 }); … … 1145 985 void VideoFullscreenControllerContext::requestHideAndExitFullscreen() 1146 986 { 1147 #if USE(WEB_THREAD) 1148 ASSERT(isUIThread()); 1149 #endif 987 ASSERT(isUIThread()); 1150 988 m_interface->requestHideAndExitFullscreen(); 1151 989 } … … 1176 1014 - (void)enterFullscreen:(UIView *)view mode:(HTMLMediaElementEnums::VideoFullscreenMode)mode 1177 1015 { 1178 #if USE(WEB_THREAD)1179 1016 ASSERT(isMainThread()); 1180 #endif1181 1017 _context = VideoFullscreenControllerContext::create(); 1182 1018 _context->setController(self); … … 1186 1022 - (void)exitFullscreen 1187 1023 { 1188 #if USE(WEB_THREAD)1189 1024 ASSERT(WebThreadIsCurrent() || isMainThread()); 1190 #endif1191 1025 _context->exitFullscreen(); 1192 1026 } … … 1194 1028 - (void)requestHideAndExitFullscreen 1195 1029 { 1196 #if USE(WEB_THREAD) 1197 ASSERT(isUIThread()); 1198 #endif 1030 ASSERT(isUIThread()); 1199 1031 if (_context) 1200 1032 _context->requestHideAndExitFullscreen(); -
trunk/Source/WebCore/platform/ios/wak/WAKWindow.mm
r240353 r240355 200 200 _visible = visible; 201 201 202 #if USE(WEB_THREAD)203 202 WebThreadRun(^{ 204 203 [[NSNotificationCenter defaultCenter] postNotificationName:WAKWindowVisibilityDidChangeNotification object:self userInfo:nil]; 205 204 }); 206 #else207 [[NSNotificationCenter defaultCenter] postNotificationName:WAKWindowVisibilityDidChangeNotification object:self userInfo:nil];208 #endif209 205 } 210 206 … … 297 293 _screenScale = scale; 298 294 299 #if USE(WEB_THREAD)300 295 WebThreadRun(^{ 301 296 [[NSNotificationCenter defaultCenter] postNotificationName:WAKWindowScreenScaleDidChangeNotification object:self userInfo:nil]; 302 297 }); 303 #else304 [[NSNotificationCenter defaultCenter] postNotificationName:WAKWindowScreenScaleDidChangeNotification object:self userInfo:nil];305 #endif306 298 } 307 299 … … 324 316 { 325 317 ASSERT(anEvent); 326 #if USE(WEB_THREAD)327 318 WebThreadRun(^{ 328 319 [self sendEventSynchronously:anEvent]; 329 320 }); 330 #else331 [self sendEventSynchronously:anEvent];332 #endif333 321 } 334 322 … … 371 359 - (void)sendMouseMoveEvent:(WebEvent *)anEvent contentChange:(WKContentChange *)aContentChange 372 360 { 373 #if USE(WEB_THREAD)374 361 WebThreadRun(^{ 375 #endif376 362 [self sendEvent:anEvent]; 377 363 378 364 if (aContentChange) 379 365 *aContentChange = WKObservedContentChange(); 380 #if USE(WEB_THREAD)381 366 }); 382 #endif383 367 } 384 368 -
trunk/Source/WebCore/platform/network/ios/NetworkStateNotifierIOS.mm
r240353 r240355 85 85 return; 86 86 m_observer = adoptNS([[WebNetworkStateObserver alloc] initWithBlock:^ { 87 #if USE(WEB_THREAD)88 87 WebThreadRun(^ { 89 88 NetworkStateNotifier::singleton().updateStateSoon(); 90 89 }); 91 #else92 NetworkStateNotifier::singleton().updateStateSoon();93 #endif94 90 }]); 95 91 } -
trunk/Source/WebCore/rendering/RenderThemeIOS.mm
r240353 r240355 281 281 { 282 282 ASSERT_UNUSED(name, CFEqual(name, PAL::get_UIKit_UIContentSizeCategoryDidChangeNotification())); 283 #if USE(WEB_THREAD)284 283 WebThreadRun(^{ 285 284 Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment(); 286 285 }); 287 #else288 Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment();289 #endif290 286 } 291 287 -
trunk/Source/WebKitLegacy/ios/Misc/WebGeolocationProviderIOS.mm
r240353 r240355 337 337 - (void)geolocationAuthorizationGranted 338 338 { 339 #if USE(WEB_THREAD)340 339 WebThreadRun(^{ 341 340 [_provider geolocationAuthorizationGranted]; 342 341 }); 343 #else344 [_provider geolocationAuthorizationGranted];345 #endif346 342 } 347 343 348 344 - (void)geolocationAuthorizationDenied 349 345 { 350 #if USE(WEB_THREAD)351 346 WebThreadRun(^{ 352 347 [_provider geolocationAuthorizationDenied]; 353 348 }); 354 #else355 [_provider geolocationAuthorizationDenied];356 #endif357 349 } 358 350 … … 360 352 { 361 353 RetainPtr<WebGeolocationPosition> webPosition = adoptNS([[WebGeolocationPosition alloc] initWithGeolocationPosition:WTFMove(position)]); 362 #if USE(WEB_THREAD)363 354 WebThreadRun(^{ 364 355 [_provider positionChanged:webPosition.get()]; 365 356 }); 366 #else367 [_provider positionChanged:webPosition.get()];368 #endif369 357 } 370 358 371 359 - (void)errorOccurred:(NSString *)errorMessage 372 360 { 373 #if USE(WEB_THREAD)374 361 WebThreadRun(^{ 375 362 [_provider errorOccurred:errorMessage]; 376 363 }); 377 #else378 [_provider errorOccurred:errorMessage];379 #endif380 364 } 381 365 382 366 - (void)resetGeolocation 383 367 { 384 #if USE(WEB_THREAD)385 368 WebThreadRun(^{ 386 369 [_provider resetGeolocation]; 387 370 }); 388 #else389 [_provider resetGeolocation];390 #endif391 371 } 392 372 @end -
trunk/Source/WebKitLegacy/ios/WebCoreSupport/WebFixedPositionContent.mm
r240353 r240355 165 165 - (void)didFinishScrollingOrZooming 166 166 { 167 #if USE(WEB_THREAD)168 167 WebThreadRun(^{ 169 168 if (Frame* frame = [_private->m_webView _mainCoreFrame]) 170 169 frame->viewportOffsetChanged(Frame::CompletedScrollOffset); 171 170 }); 172 #else173 if (Frame* frame = [_private->m_webView _mainCoreFrame])174 frame->viewportOffsetChanged(Frame::CompletedScrollOffset);175 #endif176 171 } 177 172 -
trunk/Source/WebKitLegacy/mac/Misc/WebCache.mm
r240353 r240355 140 140 // schedule this method on the WebThread as well so as to pick up all the 141 141 // dead resources left behind after closing the WebViews 142 #if USE(WEB_THREAD)143 142 WebThreadRun(^{ 144 #endif145 143 WebKit::MemoryMeasure measurer("[WebCache emptyInMemoryResources]"); 146 144 … … 151 149 152 150 WebCore::MemoryCache::singleton().pruneLiveResources(true); 153 #if USE(WEB_THREAD)154 151 }); 155 #endif156 152 } 157 153 -
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm
r240353 r240355 2455 2455 if (_appLinkURL && _frame) { 2456 2456 [LSAppLink openWithURL:_appLinkURL.get() completionHandler:^(BOOL success, NSError *) { 2457 #if USE(WEB_THREAD)2458 2457 WebThreadRun(^{ 2459 #endif2460 2458 if (success) 2461 2459 [self receivedPolicyDecision:PolicyAction::Ignore]; 2462 2460 else 2463 2461 [self receivedPolicyDecision:PolicyAction::Use]; 2464 #if USE(WEB_THREAD)2465 2462 }); 2466 #endif2467 2463 }]; 2468 2464 return; -
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebGeolocationClient.mm
r240353 r240355 175 175 - (void)allow 176 176 { 177 #if USE(WEB_THREAD)178 177 WebThreadRun(^{ 179 178 _geolocation->setIsAllowed(true); 180 179 }); 181 #else182 _geolocation->setIsAllowed(true);183 #endif184 180 } 185 181 186 182 - (void)deny 187 183 { 188 #if USE(WEB_THREAD)189 184 WebThreadRun(^{ 190 185 _geolocation->setIsAllowed(false); 191 186 }); 192 #else193 _geolocation->setIsAllowed(false);194 #endif195 187 } 196 188 197 189 - (void)denyOnlyThisRequest 198 190 { 199 #if USE(WEB_THREAD)200 191 WebThreadRun(^{ 201 #endif202 192 // A soft deny does not prevent subsequent request from the Geolocation object. 203 193 [self deny]; 204 194 _geolocation->resetIsAllowed(); 205 #if USE(WEB_THREAD)206 195 }); 207 #endif208 196 } 209 197 -
trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm
r240353 r240355 1297 1297 - (void)deviceOrientationChanged 1298 1298 { 1299 #if USE(WEB_THREAD)1300 1299 WebThreadRun(^{ 1301 #endif1302 1300 #if ENABLE(ORIENTATION_EVENTS) 1303 1301 WebView *webView = getWebView(self); … … 1306 1304 if (WebCore::Frame* frame = core(self)) 1307 1305 frame->orientationChanged(); 1308 #if USE(WEB_THREAD)1309 1306 }); 1310 #endif1311 1307 } 1312 1308 -
trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm
r240353 r240355 821 821 { 822 822 ASSERT(observer); 823 #if USE(WEB_THREAD)824 823 WebThreadRun(^{ 825 #endif826 824 WebHTMLView *webView = (__bridge WebHTMLView *)observer; 827 825 if (Frame* coreFrame = core([webView _frame])) 828 826 coreFrame->eventHandler().capsLockStateMayHaveChanged(); 829 #if USE(WEB_THREAD)830 827 }); 831 #endif832 828 } 833 829 #endif -
trunk/Source/WebKitLegacy/mac/WebView/WebView.mm
r240353 r240355 1784 1784 + (void)_releaseMemoryNow 1785 1785 { 1786 #if USE(WEB_THREAD)1787 1786 WebThreadRun(^{ 1788 1787 WebCore::releaseMemory(Critical::Yes, Synchronous::Yes); 1789 1788 }); 1790 #else1791 WebCore::releaseMemory(Critical::Yes, Synchronous::Yes);1792 #endif1793 1789 } 1794 1790 … … 1802 1798 + (void)willEnterBackgroundWithCompletionHandler:(void(^)(void))handler 1803 1799 { 1804 #if USE(WEB_THREAD)1805 1800 WebThreadRun(^{ 1806 #endif1807 1801 [WebView _releaseMemoryNow]; 1808 1802 dispatch_async(dispatch_get_main_queue(), handler); 1809 #if USE(WEB_THREAD)1810 1803 }); 1811 #endif1812 1804 } 1813 1805 … … 1819 1811 - (void)updateLayoutIgnorePendingStyleSheets 1820 1812 { 1821 #if USE(WEB_THREAD)1822 1813 WebThreadRun(^{ 1823 #endif1824 1814 for (Frame* frame = [self _mainCoreFrame]; frame; frame = frame->tree().traverseNext()) { 1825 1815 Document *document = frame->document(); … … 1827 1817 document->updateLayoutIgnorePendingStylesheets(); 1828 1818 } 1829 #if USE(WEB_THREAD)1830 1819 }); 1831 #endif1832 1820 } 1833 1821 #endif … … 2168 2156 - (void)_dispatchUnloadEvent 2169 2157 { 2170 #if USE(WEB_THREAD)2171 2158 WebThreadRun(^{ 2172 #endif2173 2159 WebFrame *mainFrame = [self mainFrame]; 2174 2160 Frame *coreMainFrame = core(mainFrame); … … 2178 2164 document->dispatchWindowEvent(Event::create(eventNames().unloadEvent, Event::CanBubble::No, Event::IsCancelable::No)); 2179 2165 } 2180 #if USE(WEB_THREAD)2181 2166 }); 2182 #endif2183 2167 } 2184 2168 … … 2329 2313 [self _clearDelegates]; 2330 2314 2331 #if USE(WEB_THREAD)2332 2315 // Fix for problems such as <rdar://problem/5774587> Crash closing tab in WebCore::Frame::page() from -[WebCoreFrameBridge pauseTimeouts] 2333 2316 WebThreadRun(^{ 2334 #endif2335 2317 #endif 2336 2318 … … 2438 2420 } 2439 2421 #endif 2440 #if PLATFORM(IOS_FAMILY) && USE(WEB_THREAD)2422 #if PLATFORM(IOS_FAMILY) 2441 2423 // Fix for problems such as <rdar://problem/5774587> Crash closing tab in WebCore::Frame::page() from -[WebCoreFrameBridge pauseTimeouts] 2442 2424 }); … … 2811 2793 #if PLATFORM(IOS_FAMILY) 2812 2794 } else { 2813 #if USE(WEB_THREAD)2814 2795 WebThreadRun(^{ 2815 #endif2816 2796 // It is possible that the prefs object has already changed before the invocation could be called 2817 2797 // on the web thread. This is not possible on TOT which is why they have a simple ASSERT. … … 2820 2800 return; 2821 2801 [self _preferencesChanged:preferences]; 2822 #if USE(WEB_THREAD)2823 2802 }); 2824 #endif2825 2803 } 2826 2804 #endif … … 4382 4360 if (!synchronize) 4383 4361 return; 4384 4385 #if USE(WEB_THREAD)4386 4362 WebThreadRun(^{ 4387 4363 [self _synchronizeCustomFixedPositionLayoutRect]; 4388 4364 }); 4389 #else4390 [self _synchronizeCustomFixedPositionLayoutRect];4391 #endif4392 4365 } 4393 4366 … … 6469 6442 return NO; 6470 6443 6471 #if USE(WEB_THREAD)6444 #if PLATFORM(IOS_FAMILY) 6472 6445 if (WebThreadIsCurrent() || !WebThreadIsEnabled()) 6473 6446 #endif 6474 6447 return _private->page->backForward().goBack(); 6475 #if USE(WEB_THREAD)6448 #if PLATFORM(IOS_FAMILY) 6476 6449 WebThreadRun(^{ 6477 6450 _private->page->backForward().goBack(); … … 6487 6460 return NO; 6488 6461 6489 #if USE(WEB_THREAD)6462 #if PLATFORM(IOS_FAMILY) 6490 6463 if (WebThreadIsCurrent() || !WebThreadIsEnabled()) 6491 6464 #endif 6492 6465 return _private->page->backForward().goForward(); 6493 #if USE(WEB_THREAD)6466 #if PLATFORM(IOS_FAMILY) 6494 6467 WebThreadRun(^{ 6495 6468 _private->page->backForward().goForward(); … … 7442 7415 + (void)_cacheModelChangedNotification:(NSNotification *)notification 7443 7416 { 7444 #if USE(WEB_THREAD)7417 #if PLATFORM(IOS_FAMILY) 7445 7418 // This needs to happen on the Web Thread 7446 7419 WebThreadRun(^{ … … 7454 7427 else if (cacheModel < [self _cacheModel]) 7455 7428 [self _setCacheModel:std::max([[WebPreferences standardPreferences] cacheModel], [self _maxCacheModelInAnyInstance])]; 7456 #if USE(WEB_THREAD)7429 #if PLATFORM(IOS_FAMILY) 7457 7430 }); 7458 7431 #endif … … 7601 7574 - (IBAction)stopLoading:(id)sender 7602 7575 { 7603 #if USE(WEB_THREAD)7576 #if PLATFORM(IOS_FAMILY) 7604 7577 if (WebThreadNotCurrent()) { 7605 7578 _private->isStopping = true; … … 7610 7583 #endif 7611 7584 [[self mainFrame] stopLoading]; 7612 #if USE(WEB_THREAD)7585 #if PLATFORM(IOS_FAMILY) 7613 7586 }); 7614 7587 #endif … … 7618 7591 - (void)stopLoadingAndClear 7619 7592 { 7620 #if USE(WEB_THREAD)7621 7593 if (WebThreadNotCurrent() && !WebThreadIsLocked()) { 7622 7594 _private->isStopping = true; … … 7624 7596 } 7625 7597 WebThreadRun(^{ 7626 #endif7627 7598 _private->isStopping = false; 7628 7599 … … 7639 7610 [plainWhiteView setNeedsDisplay:YES]; 7640 7611 [plainWhiteView release]; 7641 #if USE(WEB_THREAD)7642 7612 }); 7643 #endif7644 7613 } 7645 7614 #endif … … 7647 7616 - (IBAction)reload:(id)sender 7648 7617 { 7649 #if USE(WEB_THREAD)7618 #if PLATFORM(IOS_FAMILY) 7650 7619 WebThreadRun(^{ 7651 7620 #endif 7652 7621 [[self mainFrame] reload]; 7653 #if USE(WEB_THREAD)7622 #if PLATFORM(IOS_FAMILY) 7654 7623 }); 7655 7624 #endif … … 10311 10280 auto& memoryPressureHandler = MemoryPressureHandler::singleton(); 10312 10281 memoryPressureHandler.setLowMemoryHandler([] (Critical critical, Synchronous synchronous) { 10313 #if USE(WEB_THREAD)10282 #if PLATFORM(IOS_FAMILY) 10314 10283 WebThreadRun(^{ 10315 10284 #endif 10316 10285 WebCore::releaseMemory(critical, synchronous); 10317 #if USE(WEB_THREAD)10286 #if PLATFORM(IOS_FAMILY) 10318 10287 }); 10319 10288 #endif
Note: See TracChangeset
for help on using the changeset viewer.