Changeset 244791 in webkit
- Timestamp:
- Apr 30, 2019 11:38:16 AM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r244783 r244791 1 2019-04-30 Brian Burg <bburg@apple.com> 2 3 Web Automation: use a more informative key to indicate automation availability 4 https://bugs.webkit.org/show_bug.cgi?id=197377 5 <rdar://problem/50258069> 6 7 Reviewed by Devin Rousso. 8 9 The existing WIRAutomationEnabledKey does not encode uncertainty. 10 Add a new key that provides an 'Unknown' state, and prefer to use it. 11 12 Since an application's initial listing is sent from a background dispatch queue 13 on Cocoa platforms, this can race with main thread initialization that sets up 14 RemoteInspector::Client. Therefore, the initial listing may not properly represent 15 the client's capabilites because the client is not yet available. Allowing for 16 an "Unknown" state that is later upgraded to Available or Not Available makes it 17 possible to work around this potential race. 18 19 * inspector/remote/RemoteInspectorConstants.h: 20 * inspector/remote/cocoa/RemoteInspectorCocoa.mm: 21 (Inspector::RemoteInspector::pushListingsNow): 22 1 23 2019-04-30 Keith Miller <keith_miller@apple.com> 2 24 -
trunk/Source/JavaScriptCore/inspector/remote/RemoteInspectorConstants.h
r232833 r244791 69 69 #define WIRListingKey @"WIRListingKey" 70 70 #define WIRRemoteAutomationEnabledKey @"WIRRemoteAutomationEnabledKey" 71 #define WIRAutomationAvailabilityKey @"WIRAutomationAvailabilityKey" 71 72 #define WIRDestinationKey @"WIRDestinationKey" 72 73 #define WIRConnectionDiedMessage @"WIRConnectionDiedMessage" … … 77 78 #define WIRTypeAutomation @"WIRTypeAutomation" 78 79 #define WIRAutomaticallyPause @"WIRAutomaticallyPause" 80 81 // Allowed values for WIRAutomationAvailabilityKey. 82 #define WIRAutomationAvailabilityNotAvailable @"WIRAutomationAvailabilityNotAvailable" 83 #define WIRAutomationAvailabilityAvailable @"WIRAutomationAvailabilityAvailable" 84 #define WIRAutomationAvailabilityUnknown @"WIRAutomationAvailabilityUnknown" 79 85 80 86 #define WIRAutomaticInspectionEnabledKey @"WIRAutomaticInspectionEnabledKey" -
trunk/Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorCocoa.mm
r244657 r244791 455 455 [message setObject:listings.get() forKey:WIRListingKey]; 456 456 457 if (!m_clientCapabilities) 458 [message setObject:WIRAutomationAvailabilityUnknown forKey:WIRAutomationAvailabilityKey]; 459 else if (m_clientCapabilities->remoteAutomationAllowed) 460 [message setObject:WIRAutomationAvailabilityAvailable forKey:WIRAutomationAvailabilityKey]; 461 else 462 [message setObject:WIRAutomationAvailabilityNotAvailable forKey:WIRAutomationAvailabilityKey]; 463 464 // COMPATIBILITY(iOS 13): this key is deprecated and not used by newer versions of webinspectord. 457 465 BOOL isAllowed = m_clientCapabilities && m_clientCapabilities->remoteAutomationAllowed; 458 466 [message setObject:@(isAllowed) forKey:WIRRemoteAutomationEnabledKey];
Note: See TracChangeset
for help on using the changeset viewer.