Changeset 256531 in webkit
- Timestamp:
- Feb 13, 2020 12:22:05 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r256530 r256531 1 2020-02-13 Per Arne Vollan <pvollan@apple.com> 2 3 [iOS] Check if PIP is supported in the UI process 4 https://bugs.webkit.org/show_bug.cgi?id=207406 5 6 Reviewed by Brent Fulgham. 7 8 This is currently being checked in the WebProcess, but since this check is initiating communication with the frontboard 9 service which will be blocked, this check should be moved to the UI process. In the UI process, this is checked when 10 starting a new WebContent process, and sent to the WebContent process as part of the process creation parameters. The 11 WebContent is storing the received value. 12 13 API test: WebKit.PictureInPictureSupport 14 15 * platform/PictureInPictureSupport.h: 16 * platform/ios/VideoFullscreenInterfaceAVKit.mm: 17 (WebCore::setSupportsPictureInPicture): 18 (WebCore::supportsPictureInPicture): 19 * testing/Internals.cpp: 20 (WebCore::Internals::supportsPictureInPicture): 21 * testing/Internals.h: 22 * testing/Internals.idl: 23 1 24 2020-02-13 Benjamin Nham <nham@apple.com> 2 25 -
trunk/Source/WebCore/platform/PictureInPictureSupport.h
r251834 r256531 29 29 30 30 #if PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)) 31 WEBCORE_EXPORT void setSupportsPictureInPicture(bool); 31 32 WEBCORE_EXPORT bool supportsPictureInPicture(); 32 33 #else -
trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm
r254512 r256531 1504 1504 #endif // HAVE(AVKIT) 1505 1505 1506 static Optional<bool> isPictureInPictureSupported; 1507 1508 void WebCore::setSupportsPictureInPicture(bool isSupported) 1509 { 1510 isPictureInPictureSupported = isSupported; 1511 } 1512 1506 1513 bool WebCore::supportsPictureInPicture() 1507 1514 { 1508 1515 #if PLATFORM(IOS_FAMILY) && HAVE(AVKIT) && !PLATFORM(WATCHOS) 1516 if (isPictureInPictureSupported.hasValue()) 1517 return *isPictureInPictureSupported; 1509 1518 return [getAVPictureInPictureControllerClass() isPictureInPictureSupported]; 1510 1519 #else -
trunk/Source/WebCore/testing/Internals.cpp
r255957 r256531 139 139 #include "PageOverlay.h" 140 140 #include "PathUtilities.h" 141 #include "PictureInPictureSupport.h" 141 142 #include "PlatformKeyboardEvent.h" 142 143 #include "PlatformMediaSessionManager.h" … … 5467 5468 } 5468 5469 5470 bool Internals::supportsPictureInPicture() 5471 { 5472 return WebCore::supportsPictureInPicture(); 5473 } 5474 5469 5475 String Internals::focusRingColor() 5470 5476 { -
trunk/Source/WebCore/testing/Internals.h
r255875 r256531 936 936 String mediaMIMETypeForExtension(const String& extension); 937 937 938 bool supportsPictureInPicture(); 939 938 940 String focusRingColor(); 939 941 -
trunk/Source/WebCore/testing/Internals.idl
r255875 r256531 844 844 845 845 DOMString mediaMIMETypeForExtension(DOMString extension); 846 }; 846 847 boolean supportsPictureInPicture(); 848 }; -
trunk/Source/WebKit/ChangeLog
r256530 r256531 1 2020-02-13 Per Arne Vollan <pvollan@apple.com> 2 3 [iOS] Check if PIP is supported in the UI process 4 https://bugs.webkit.org/show_bug.cgi?id=207406 5 6 Reviewed by Brent Fulgham. 7 8 When starting a new WebContent process, check if PIP is supported, and pass the results to the newly created 9 WebContent process. 10 11 * Shared/WebProcessCreationParameters.cpp: 12 (WebKit::WebProcessCreationParameters::encode const): 13 (WebKit::WebProcessCreationParameters::decode): 14 * Shared/WebProcessCreationParameters.h: 15 * UIProcess/Cocoa/WebProcessPoolCocoa.mm: 16 (WebKit::WebProcessPool::platformInitializeWebProcess): 17 * WebProcess/cocoa/WebProcessCocoa.mm: 18 (WebKit::WebProcess::platformInitializeWebProcess): 19 1 20 2020-02-13 Benjamin Nham <nham@apple.com> 2 21 -
trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp
r255457 r256531 173 173 #if PLATFORM(IOS_FAMILY) 174 174 encoder << currentUserInterfaceIdiomIsPad; 175 encoder << supportsPictureInPicture; 175 176 encoder << cssValueToSystemColorMap; 176 177 encoder << focusRingColor; … … 455 456 return false; 456 457 458 if (!decoder.decode(parameters.supportsPictureInPicture)) 459 return false; 460 457 461 Optional<WebCore::RenderThemeIOS::CSSValueToSystemColorMap> cssValueToSystemColorMap; 458 462 decoder >> cssValueToSystemColorMap; -
trunk/Source/WebKit/Shared/WebProcessCreationParameters.h
r255457 r256531 215 215 #if PLATFORM(IOS_FAMILY) 216 216 bool currentUserInterfaceIdiomIsPad { false }; 217 bool supportsPictureInPicture { false }; 217 218 WebCore::RenderThemeIOS::CSSValueToSystemColorMap cssValueToSystemColorMap; 218 219 WebCore::Color focusRingColor; -
trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
r256530 r256531 361 361 #if PLATFORM(IOS_FAMILY) 362 362 parameters.currentUserInterfaceIdiomIsPad = currentUserInterfaceIdiomIsPad(); 363 parameters.supportsPictureInPicture = supportsPictureInPicture(); 363 364 parameters.cssValueToSystemColorMap = RenderThemeIOS::cssValueToSystemColorMap(); 364 365 parameters.focusRingColor = RenderTheme::singleton().focusRingColor(OptionSet<StyleColor::Options>()); -
trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm
r255881 r256531 64 64 #import <WebCore/NSScrollerImpDetails.h> 65 65 #import <WebCore/PerformanceLogging.h> 66 #import <WebCore/PictureInPictureSupport.h> 66 67 #import <WebCore/RuntimeApplicationChecks.h> 67 68 #import <WebCore/SWContextManager.h> … … 198 199 #if PLATFORM(IOS_FAMILY) 199 200 setCurrentUserInterfaceIdiomIsPad(parameters.currentUserInterfaceIdiomIsPad); 201 setSupportsPictureInPicture(parameters.supportsPictureInPicture); 200 202 #endif 201 203 -
trunk/Tools/ChangeLog
r256528 r256531 1 2020-02-13 Per Arne Vollan <pvollan@apple.com> 2 3 [iOS] Check if PIP is supported in the UI process 4 https://bugs.webkit.org/show_bug.cgi?id=207406 5 6 Reviewed by Brent Fulgham. 7 8 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 9 * TestWebKitAPI/Tests/WebKit/PictureInPictureSupport.mm: Added. 10 (TEST): 11 1 12 2020-02-13 Jonathan Bedard <jbedard@apple.com> 2 13 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r256234 r256531 991 991 E194E1BD177E53C7009C4D4E /* StopLoadingFromDidReceiveResponse.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = E194E1BC177E534A009C4D4E /* StopLoadingFromDidReceiveResponse.html */; }; 992 992 E324A6F02041C82000A76593 /* UniqueArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E398BC0F2041C76300387136 /* UniqueArray.cpp */; }; 993 E325C90723E3870200BC7D3B /* PictureInPictureSupport.mm in Sources */ = {isa = PBXBuildFile; fileRef = E325C90623E3870200BC7D3B /* PictureInPictureSupport.mm */; }; 993 994 E32B549222810AC4008AD702 /* Packed.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E32B549122810AC0008AD702 /* Packed.cpp */; }; 994 995 E35FC7B222B82A7300F32F98 /* JSLockTakesWebThreadLock.mm in Sources */ = {isa = PBXBuildFile; fileRef = E35FC7B122B82A6D00F32F98 /* JSLockTakesWebThreadLock.mm */; }; … … 2565 2566 E194E1BA177E5145009C4D4E /* StopLoadingFromDidReceiveResponse.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StopLoadingFromDidReceiveResponse.mm; sourceTree = "<group>"; }; 2566 2567 E194E1BC177E534A009C4D4E /* StopLoadingFromDidReceiveResponse.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = StopLoadingFromDidReceiveResponse.html; sourceTree = "<group>"; }; 2568 E325C90623E3870200BC7D3B /* PictureInPictureSupport.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PictureInPictureSupport.mm; sourceTree = "<group>"; }; 2567 2569 E32B549122810AC0008AD702 /* Packed.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Packed.cpp; sourceTree = "<group>"; }; 2568 2570 E35FC7B122B82A6D00F32F98 /* JSLockTakesWebThreadLock.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = JSLockTakesWebThreadLock.mm; sourceTree = "<group>"; }; … … 2872 2874 E394AE6E23F2303E005B4936 /* GrantAccessToMobileAssets.mm */, 2873 2875 C145CC0B23DA5A0F003A5EEB /* MimeTypes.mm */, 2876 E325C90623E3870200BC7D3B /* PictureInPictureSupport.mm */, 2874 2877 0F139E751A423A5300F590F5 /* WeakObjCPtr.mm */, 2875 2878 ); … … 4918 4921 7C83E0531D0A643A00FEBCF3 /* PendingAPIRequestURL.cpp in Sources */, 4919 4922 3FCC4FE51EC4E8520076E37C /* PictureInPictureDelegate.mm in Sources */, 4923 E325C90723E3870200BC7D3B /* PictureInPictureSupport.mm in Sources */, 4920 4924 7CCE7EA61A411A0F00447C4C /* PlatformUtilitiesMac.mm in Sources */, 4921 4925 7CCE7EA71A411A1300447C4C /* PlatformWebViewMac.mm in Sources */, -
trunk/Tools/TestWebKitAPI/Tests/WebKit/PictureInPictureSupport.mm
r256530 r256531 1 1 /* 2 * Copyright (C) 20 19Apple Inc. All rights reserved.2 * Copyright (C) 2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 # pragma once26 #include "config.h" 27 27 28 namespace WebCore { 28 #if WK_HAVE_C_SPI 29 29 30 #if PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)) 31 WEBCORE_EXPORT bool supportsPictureInPicture(); 32 #else 33 constexpr bool supportsPictureInPicture() { return false; } 34 #endif 30 #import "PlatformUtilities.h" 31 #import "TestWKWebView.h" 32 #import <WebCore/PictureInPictureSupport.h> 35 33 34 TEST(WebKit, PictureInPictureSupport) 35 { 36 auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]); 37 WKRetainPtr<WKContextRef> context = adoptWK(TestWebKitAPI::Util::createContextForInjectedBundleTest("InternalsInjectedBundleTest")); 38 configuration.get().processPool = (WKProcessPool *)context.get(); 39 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 300, 300) configuration:configuration.get() addToWindow:YES]); 40 41 auto supportsPictureInPicture = [&] { 42 return [webView stringByEvaluatingJavaScript:@"window.internals.supportsPictureInPicture()"].boolValue; 43 }; 44 45 ASSERT_TRUE(supportsPictureInPicture() == WebCore::supportsPictureInPicture()); 36 46 } 47 48 #endif // WK_HAVE_C_SPI
Note: See TracChangeset
for help on using the changeset viewer.