Changeset 223827 in webkit
- Timestamp:
- Oct 22, 2017 7:20:19 PM (6 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r223822 r223827 1 2017-10-22 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iOS] WebProcess::initializeWebProcess spends ~150ms spinning up AVSystemController on some devices 4 https://bugs.webkit.org/show_bug.cgi?id=178640 5 <rdar://problem/35113105> 6 7 Reviewed by Youenn Fablet. 8 9 In r213933, we added a mechanism to allow the web process to drive media capture, by setting an attribute on the 10 shared AVSystemController. This requires us to fault in the Celestial framework, which is a slight performance 11 hit on some hardware. Instead of doing this at the start of every web process launch, we can just do this work 12 lazily, the first time the web process requests permissions for user media access. 13 14 * WebProcess/WebCoreSupport/WebUserMediaClient.cpp: 15 (WebKit::WebUserMediaClient::requestUserMediaAccess): 16 * WebProcess/WebPage/WebPage.cpp: 17 (WebKit::WebPage::prepareToSendUserMediaPermissionRequest): 18 * WebProcess/WebPage/WebPage.h: 19 * WebProcess/WebPage/ios/WebPageIOS.mm: 20 (WebKit::WebPage::prepareToSendUserMediaPermissionRequest): 21 * WebProcess/cocoa/WebProcessCocoa.mm: 22 (WebKit::WebProcess::platformInitializeWebProcess): 23 1 24 2017-10-21 Michael Catanzaro <mcatanzaro@igalia.com> 2 25 -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebUserMediaClient.cpp
r218601 r223827 44 44 void WebUserMediaClient::requestUserMediaAccess(UserMediaRequest& request) 45 45 { 46 m_page.prepareToSendUserMediaPermissionRequest(); 46 47 m_page.userMediaPermissionRequestManager().startUserMediaRequest(request); 47 48 } -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r223779 r223827 3899 3899 3900 3900 #if ENABLE(MEDIA_STREAM) 3901 3902 #if !PLATFORM(IOS) 3903 void WebPage::prepareToSendUserMediaPermissionRequest() 3904 { 3905 } 3906 #endif 3907 3901 3908 void WebPage::userMediaAccessWasGranted(uint64_t userMediaID, String&& audioDeviceUID, String&& videoDeviceUID, String&& mediaDeviceIdentifierHashSalt) 3902 3909 { -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r223726 r223827 512 512 #if ENABLE(MEDIA_STREAM) 513 513 UserMediaPermissionRequestManager& userMediaPermissionRequestManager() { return *m_userMediaPermissionRequestManager; } 514 void prepareToSendUserMediaPermissionRequest(); 514 515 #endif 515 516 -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r223726 r223827 100 100 #import <WebCore/RenderThemeIOS.h> 101 101 #import <WebCore/RenderView.h> 102 #import <WebCore/RuntimeApplicationChecks.h> 102 103 #import <WebCore/Settings.h> 103 104 #import <WebCore/SharedBuffer.h> … … 111 112 #import <wtf/MemoryPressureHandler.h> 112 113 #import <wtf/SetForScope.h> 114 #import <wtf/SoftLinking.h> 113 115 #import <wtf/text/TextStream.h> 116 117 #if ENABLE(MEDIA_STREAM) 118 #import "CelestialSPI.h" 119 SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL(Celestial) 120 SOFT_LINK_CLASS_OPTIONAL(Celestial, AVSystemController) 121 SOFT_LINK_CONSTANT_MAY_FAIL(Celestial, AVSystemController_PIDToInheritApplicationStateFrom, NSString *) 122 #endif 114 123 115 124 using namespace WebCore; … … 3412 3421 #endif 3413 3422 3423 #if ENABLE(MEDIA_STREAM) 3424 void WebPage::prepareToSendUserMediaPermissionRequest() 3425 { 3426 static std::once_flag once; 3427 std::call_once(once, [] { 3428 if (!canLoadAVSystemController_PIDToInheritApplicationStateFrom()) 3429 return; 3430 3431 NSError *error = nil; 3432 [[getAVSystemControllerClass() sharedAVSystemController] setAttribute:@(WebCore::presentingApplicationPID()) forKey:getAVSystemController_PIDToInheritApplicationStateFrom() error:&error]; 3433 if (error) 3434 WTFLogAlways("Failed to set up PID proxying: %s", error.localizedDescription.UTF8String); 3435 }); 3436 } 3437 #endif 3438 3414 3439 } // namespace WebKit 3415 3440 -
trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm
r222896 r223827 71 71 72 72 #if PLATFORM(IOS) 73 #import "CelestialSPI.h"74 73 #import <pal/spi/ios/GraphicsServicesSPI.h> 75 #import <wtf/SoftLinking.h>76 74 #endif 77 75 78 76 #if USE(OS_STATE) 79 77 #import <os/state_private.h> 80 #endif81 82 #if PLATFORM(IOS)83 SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL(Celestial)84 85 SOFT_LINK_CLASS_OPTIONAL(Celestial, AVSystemController)86 87 SOFT_LINK_CONSTANT_MAY_FAIL(Celestial, AVSystemController_PIDToInheritApplicationStateFrom, NSString *)88 89 #define AVSystemController_PIDToInheritApplicationStateFrom getAVSystemController_PIDToInheritApplicationStateFrom()90 78 #endif 91 79 … … 175 163 // Priority decay on iOS 9 is impacting page load time so we fix the priority of the WebProcess' main thread (rdar://problem/22003112). 176 164 pthread_set_fixedpriority_self(); 177 #endif178 179 #if PLATFORM(IOS)180 if (canLoadAVSystemController_PIDToInheritApplicationStateFrom()) {181 pid_t pid = WebCore::presentingApplicationPID();182 NSError *error = nil;183 [[getAVSystemControllerClass() sharedAVSystemController] setAttribute:@(pid) forKey:AVSystemController_PIDToInheritApplicationStateFrom error:&error];184 if (error)185 WTFLogAlways("Failed to set up PID proxying: %s", [[error localizedDescription] UTF8String]);186 }187 165 #endif 188 166 }
Note: See TracChangeset
for help on using the changeset viewer.