86ce120869ce08ef9fe8ca17529744e7ac510d4e
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-08-17  Tim Horton  <timothy_horton@apple.com>
2
3         Start bringing up Unified Sources in WebKit2
4         https://bugs.webkit.org/show_bug.cgi?id=188703
5
6         Reviewed by Simon Fraser.
7
8         * Configurations/BaseTarget.xcconfig:
9         Add SRCROOT to the include path, so unified sources can find the source files.
10
11         * Shared/APIWebArchive.mm:
12         (API::releaseWebArchiveData):
13         (API::WebArchive::data):
14         (API::releaseCFData): Deleted.
15         * Shared/APIWebArchiveResource.mm:
16         (API::releaseWebArchiveResourceData):
17         (API::WebArchiveResource::data):
18         (API::releaseCFData): Deleted.
19         Disambiguate two static methods by renaming them.
20
21         * Shared/cf/ArgumentCodersCF.cpp:
22         Leave a comment about the bizarreness of this file.
23
24         * Shared/NavigationActionData.cpp:
25         (WebKit::NavigationActionData::decode):
26         * Shared/WebPlatformTouchPoint.cpp:
27         * Shared/WebPopupItem.cpp:
28         (WebKit::WebPopupItem::WebPopupItem):
29         (WebKit::WebPopupItem::decode):
30         * Shared/WebPreferencesStore.cpp:
31         * Shared/WebRenderLayer.cpp:
32         (WebKit::WebRenderLayer::create):
33         (WebKit::WebRenderLayer::createArrayFromLayerList):
34         (WebKit::WebRenderLayer::WebRenderLayer):
35         * Shared/gtk/WebEventFactory.cpp:
36         * Shared/mac/WebCoreArgumentCodersMac.mm:
37         * Shared/mac/WebEventFactory.mm:
38         (WebKit::WebEventFactory::createWebMouseEvent):
39         (WebKit::WebEventFactory::createWebWheelEvent):
40         (WebKit::WebEventFactory::createWebKeyboardEvent):
41         * Shared/mac/WebMemorySampler.mac.mm:
42         (WebKit::WebMemorySampler::sampleWebKit const):
43         * UIProcess/API/APIAutomationSessionClient.h:
44         (API::AutomationSessionClient::sessionIdentifier const):
45         (API::AutomationSessionClient::messageOfCurrentJavaScriptDialogOnPage):
46         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
47         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
48         (WebKit::RemoteLayerBackingStore::setNeedsDisplay):
49         (WebKit::RemoteLayerBackingStore::backingStoreSize const):
50         (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
51         (WebKit::RemoteLayerBackingStore::display):
52         (WebKit::RemoteLayerBackingStore::drawInContext):
53         (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
54         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
55         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::LayerCreationProperties):
56         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
57         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
58         (WebKit::RemoteLayerTreeTransaction::decode):
59         (WebKit::RemoteLayerTreeTransaction::setRootLayerID):
60         (WebKit::RemoteLayerTreeTransaction::setDestroyedLayerIDs):
61         (WebKit::RemoteLayerTreeTransaction::setLayerIDsWithNewlyUnreachableBackingStore):
62         (WebKit::dumpChangedLayers):
63         (WebKit::RemoteLayerTreeTransaction::description const):
64         * Shared/WebPlatformTouchPoint.cpp:
65         (WebKit::WebPlatformTouchPoint::WebPlatformTouchPoint):
66         Get rid of lots of `using namespace`.
67
68         * Sources.txt: Added.
69         * SourcesCocoa.txt: Added.
70         * WebKit.xcodeproj/project.pbxproj:
71         Set up unified sources.
72         Right now, we only unify Platform/ and Shared/[^API].
73
74 2018-08-17  Aditya Keerthi  <akeerthi@apple.com>
75
76         [Datalist][iOS] Display suggestions for input[type=color]
77         https://bugs.webkit.org/show_bug.cgi?id=188669
78
79         Reviewed by Tim Horton.
80
81         An input[type=color] element that has an associated datalist element should
82         display the color values provided on iOS. Similar to macOS, we now support 1-12
83         suggested colors, that will be displayed at the top of the color picker.
84
85         Also ensured that we get rounded corners on both sides of a color swatch if it is
86         the only one in its row.
87
88         * Shared/AssistedNodeInformation.cpp: Added suggestedColors field.
89         (WebKit::AssistedNodeInformation::encode const):
90         (WebKit::AssistedNodeInformation::decode):
91         * Shared/AssistedNodeInformation.h:
92         * UIProcess/ios/forms/WKFormColorPicker.mm:
93         (+[WKColorPicker defaultTopColorMatrix]):
94         (-[WKColorPicker initWithView:]): Use the list of suggestedColors if it exists.
95         (-[WKColorPicker drawSelectionIndicatorForColorButton:]):
96         * WebProcess/WebCoreSupport/WebColorChooser.cpp:
97         (WebKit::WebColorChooser::WebColorChooser):
98         (WebKit::WebColorChooser::reattachColorChooser):
99         * WebProcess/WebPage/ios/WebPageIOS.mm:
100         (WebKit::WebPage::getAssistedNodeInformation):
101
102 2018-08-17  Ryan Haddad  <ryanhaddad@apple.com>
103
104         Unreviewed, rolling out r234991.
105
106         Caused an assertion failure on the bots.
107
108         Reverted changeset:
109
110         "Pass webPageID and webFrameID to NetworkLoad for speculative
111         loads"
112         https://bugs.webkit.org/show_bug.cgi?id=188682
113         https://trac.webkit.org/changeset/234991
114
115 2018-08-17  Alex Christensen  <achristensen@webkit.org>
116
117         Add some plumbing for safe browsing
118         https://bugs.webkit.org/show_bug.cgi?id=188709
119
120         Reviewed by Tim Horton.
121
122         Also adding a URL to SafeBrowsingResult because we'll need it.
123         Also adding a bool to LoadParameters because we will need to do special things
124         when loading the safe browsing warning, like adding a way to skip the safe browsing check.
125
126         * Shared/LoadParameters.cpp:
127         (WebKit::LoadParameters::encode const):
128         (WebKit::LoadParameters::decode):
129         * Shared/LoadParameters.h:
130         * UIProcess/Cocoa/SafeBrowsingResultCocoa.mm:
131         (WebKit::SafeBrowsingResult::SafeBrowsingResult):
132         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
133         (WebKit::WebPageProxy::beginSafeBrowsingCheck):
134         * UIProcess/SafeBrowsingResult.h:
135         (WebKit::SafeBrowsingResult::url const):
136         * UIProcess/WebPageProxy.cpp:
137         (WebKit::WebPageProxy::loadAlternateHTML):
138         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
139         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
140         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
141         * UIProcess/WebPageProxy.h:
142         * UIProcess/WebPageProxy.messages.in:
143         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
144         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
145         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
146
147 2018-08-16  Ryosuke Niwa  <rniwa@webkit.org>
148
149         Replace canBubble and cancelable booleans in Event by enum classes
150         https://bugs.webkit.org/show_bug.cgi?id=188692
151
152         Reviewed by Alex Christensen.
153
154         * WebProcess/WebPage/WebPage.cpp:
155         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
156
157 2018-08-17  Andy Estes  <aestes@apple.com>
158
159         [Xcode] Fix up file reference paths in Source/WebKit/NetworkProcess
160         https://bugs.webkit.org/show_bug.cgi?id=188700
161
162         Rubber-stamped by Dan Bernstein.
163
164         * WebKit.xcodeproj/project.pbxproj:
165
166 2018-08-17  Alex Christensen  <achristensen@webkit.org>
167
168         Pass webPageID and webFrameID to NetworkLoad for speculative loads
169         https://bugs.webkit.org/show_bug.cgi?id=188682
170
171         Reviewed by Youenn Fablet.
172
173         This also removes an authentication shortcut I introduced in r234941
174
175         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
176         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
177         (WebKit::NetworkCache::SpeculativeLoad::didReceiveResponse):
178         * Shared/Authentication/AuthenticationManager.cpp:
179         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
180
181 2018-08-17  Alex Christensen  <achristensen@webkit.org>
182
183         Simplify server trust authentication flow
184         https://bugs.webkit.org/show_bug.cgi?id=188684
185
186         Reviewed by Youenn Fablet.
187
188         We unnecessarily had the allowsSpecificHTTPSCertificateForHost check at two different abstraction levels.
189
190         * NetworkProcess/NetworkLoad.cpp:
191         (WebKit::NetworkLoad::didReceiveChallenge):
192         * NetworkProcess/NetworkSession.cpp:
193         (WebKit::NetworkSession::allowsSpecificHTTPSCertificateForHost): Deleted.
194         * NetworkProcess/NetworkSession.h:
195         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
196         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
197
198 2018-08-17  Alex Christensen  <achristensen@webkit.org>
199
200         Fix API tests after r234985
201         https://bugs.webkit.org/show_bug.cgi?id=188679
202
203         * UIProcess/API/C/WKPage.cpp:
204         (encodingOf):
205         (dataFrom):
206         The encoding of null strings had changed, which is no big deal because there's no data in that encoding,
207         but switching it back fixes the tests.
208
209 2018-08-17  Alex Christensen  <achristensen@webkit.org>
210
211         Replace WebPageProxy::loadAlternateHTMLString with loadAlternateHTML
212         https://bugs.webkit.org/show_bug.cgi?id=188679
213
214         Reviewed by Carlos Garcia Campos.
215
216         * Shared/LoadParameters.cpp:
217         (WebKit::LoadParameters::encode const):
218         (WebKit::LoadParameters::decode):
219         * Shared/LoadParameters.h:
220         * UIProcess/API/C/WKPage.cpp:
221         (encodingOf):
222         (dataFrom):
223         (loadString):
224         (WKPageLoadAlternateHTMLString):
225         (WKPageLoadAlternateHTMLStringWithUserData):
226         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
227         (-[WKBrowsingContextController loadAlternateHTMLString:baseURL:forUnreachableURL:]):
228         * UIProcess/API/Cocoa/WKWebView.mm:
229         (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]):
230         * UIProcess/WebPageProxy.cpp:
231         (WebKit::WebPageProxy::loadAlternateHTML):
232         (WebKit::WebPageProxy::loadAlternateHTMLString): Deleted.
233         * UIProcess/WebPageProxy.h:
234         * WebProcess/WebPage/WebPage.cpp:
235         (WebKit::WebPage::loadAlternateHTMLString):
236
237 2018-08-17  Michael Catanzaro  <mcatanzaro@igalia.com>
238
239         Unreviewed, rolling out r234259.
240
241         Caused excessive CPU usage
242
243         Reverted changeset:
244
245         "[GTK][WPE] Improve the way request displayRefresh
246         notifications"
247         https://bugs.webkit.org/show_bug.cgi?id=188005
248         https://trac.webkit.org/changeset/234259
249
250 2018-08-16  Commit Queue  <commit-queue@webkit.org>
251
252         Unreviewed, rolling out r234958.
253         https://bugs.webkit.org/show_bug.cgi?id=188683
254
255         Breaking builds due to copy failure (Requested by brichards on
256         #webkit).
257
258         Reverted changeset:
259
260         "Add script to generate WebContent service resource files"
261         https://bugs.webkit.org/show_bug.cgi?id=188601
262         https://trac.webkit.org/changeset/234958
263
264 2018-08-16  Sihui Liu  <sihui_liu@apple.com>
265
266         Remove unused parentProcessName from NetworkProcessCreationParameters
267         https://bugs.webkit.org/show_bug.cgi?id=188618
268
269         Reviewed by Alex Christensen.
270
271         * NetworkProcess/NetworkProcessCreationParameters.cpp:
272         (WebKit::NetworkProcessCreationParameters::encode const):
273         (WebKit::NetworkProcessCreationParameters::decode):
274         * NetworkProcess/NetworkProcessCreationParameters.h:
275         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
276         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
277
278 2018-08-16  Andy Estes  <aestes@apple.com>
279
280         [watchOS] Upstream Proximity Networking (nee Wi-Fi Assertions)
281         https://bugs.webkit.org/show_bug.cgi?id=188664
282
283         Reviewed by Tim Horton.
284
285         Proximity Networking provides two features for speeding up page loads on watchOS:
286
287         1. Binding requests to the Apple Watch's Wi-Fi interface even when the iPhone is in proximity.
288         2. When Wi-Fi isn't available, preemptively upgrading the Bluetooth link to its fastest data
289         rate prior to starting page loads.
290
291         * Configurations/WebKit.xcconfig:
292
293         Added LDFLAGS for Proximity Networking.
294
295         * NetworkProcess/NetworkProcess.cpp:
296         (WebKit::NetworkProcess::NetworkProcess):
297         (WebKit::NetworkProcess::proximityManager):
298         * NetworkProcess/NetworkProcess.h:
299
300         Added NetworkProximityManager as a supplement.
301
302         * NetworkProcess/NetworkProcessCreationParameters.cpp:
303         (WebKit::NetworkProcessCreationParameters::encode const):
304         (WebKit::NetworkProcessCreationParameters::decode):
305         * NetworkProcess/NetworkProcessCreationParameters.h:
306
307         Renamed ENABLE(WIFI_ASSERTIONS) to ENABLE(PROXIMITY_NETWORKING).
308
309         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
310
311         Renamed m_wiFiAssertionHolder to m_proximityAssertionToken and changed its type from an
312         optional WiFiAssertionHolder to an optional NetworkProximityAssertion::Token.
313
314         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
315         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
316         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
317         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
318         (WebKit::NetworkProcess::platformPrepareToSuspend):
319         (WebKit::NetworkProcess::platformProcessDidResume):
320         (WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
321         (WebKit::NetworkProcess::platformProcessDidTransitionToForeground):
322
323         Changed to use NetworkProximityManager.
324
325         * NetworkProcess/cocoa/WiFiAssertionHolder.h: Removed.
326         * NetworkProcess/cocoa/WiFiAssertionHolder.mm: Removed.
327         * NetworkProcess/watchos/NetworkProximityAssertion.h: Added.
328         (WebKit::NetworkProximityAssertion::Token::Token):
329         (WebKit::NetworkProximityAssertion::Token::~Token):
330
331         Added. NetworkDataTasks hold these tokens to keep Bluetooth or Wi-Fi assertions active
332         during loading. When the last token is destroyed, its associated assertion will be
333         deactivated.
334
335         * NetworkProcess/watchos/NetworkProximityAssertion.mm: Added.
336         (WebKit::NetworkProximityAssertion::NetworkProximityAssertion):
337         (WebKit::NetworkProximityAssertion::hold):
338         (WebKit::NetworkProximityAssertion::release):
339         (WebKit::NetworkProximityAssertion::resume):
340         (WebKit::NetworkProximityAssertion::suspend):
341         (WebKit::NetworkProximityAssertion::suspendNow):
342         (WebKit::NetworkProximityAssertion::releaseTimerFired):
343         (WebKit::NetworkProximityAssertion::suspendAfterBackgroundingTimerFired):
344
345         Added. NetworkProximityAssertion is the base class for Bluetooth and Wi-Fi assertions. It
346         manages the logic for holding and releasing assertions as well as responding to network
347         process backgrounding and suspension.
348
349         (WebKit::BluetoothProximityAssertion::BluetoothProximityAssertion):
350         (WebKit::BluetoothProximityAssertion::suspend):
351         (WebKit::BluetoothProximityAssertion::holdNow):
352         (WebKit::BluetoothProximityAssertion::releaseNow):
353
354         Added. Holds a Bluetooth assertion by calling -[IDSService setLinkPreferences:].
355
356         (WebKit::WiFiProximityAssertion::WiFiProximityAssertion):
357         (WebKit::WiFiProximityAssertion::holdNow):
358         (WebKit::WiFiProximityAssertion::releaseNow):
359
360         Added. Holds a Wi-Fi assertion by using WiFiManagerClient.
361
362         * NetworkProcess/watchos/NetworkProximityManager.h: Added.
363         * NetworkProcess/watchos/NetworkProximityManager.mm: Added.
364         (-[WKProximityServiceDelegate setClient:]):
365         (-[WKProximityServiceDelegate service:devicesChanged:]):
366         (-[WKProximityServiceDelegate service:nearbyDevicesChanged:]):
367         (WebKit::NetworkProximityManager::NetworkProximityManager):
368         (WebKit::NetworkProximityManager::~NetworkProximityManager):
369         (WebKit::NetworkProximityManager::supplementName):
370         (WebKit::bindRequestToWiFi):
371         (WebKit::NetworkProximityManager::applyProperties):
372         (WebKit::NetworkProximityManager::resume):
373         (WebKit::NetworkProximityManager::suspend):
374         (WebKit::NetworkProximityManager::recommendation const):
375         (WebKit::NetworkProximityManager::processRecommendations):
376         (WebKit::toProcessID):
377         (WebKit::NetworkProximityManager::resumeRecommendations):
378         (WebKit::NetworkProximityManager::suspendRecommendations):
379         (WebKit::NetworkProximityManager::updateCompanionProximity):
380         (WebKit::NetworkProximityManager::updateRecommendation):
381         (WebKit::NetworkProximityManager::initialize):
382         (WebKit::NetworkProximityManager::devicesChanged):
383
384         Added. NetworkProximityManager is a network process supplement that can bind
385         NetworkDataTasks to Wi-Fi, associate assertions with NetworkDataTasks, check for companion
386         proximity, ask for proximity network recommendations, and respond to network process
387         backgrounding and suspending.
388
389         * Platform/Logging.h:
390
391         Renamed the WiFiAssertions log channel to ProximityNetworking.
392
393         * Platform/spi/ios/MobileWiFiSPI.h:
394         * UIProcess/API/APIProcessPoolConfiguration.cpp:
395         (API::ProcessPoolConfiguration::copy):
396         * UIProcess/API/APIProcessPoolConfiguration.h:
397         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
398         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
399         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
400
401         Renamed ENABLE(WIFI_ASSERTIONS) to ENABLE(PROXIMITY_NETWORKING).
402
403         * WebKit.xcodeproj/project.pbxproj:
404         * config.h:
405
406         Removed unused definition of HAVE_MOBILE_WIFI.
407
408 2018-08-16  Alex Christensen  <achristensen@webkit.org>
409
410         Remove unused and deprecated _WKProcessPoolConfiguration.allowsCellularAccess
411         https://bugs.webkit.org/show_bug.cgi?id=188681
412
413         Reviewed by Tim Horton.
414
415         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
416         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
417         (-[_WKProcessPoolConfiguration allowsCellularAccess]): Deleted.
418         (-[_WKProcessPoolConfiguration setAllowsCellularAccess:]): Deleted.
419
420 2018-08-16  Alex Christensen  <achristensen@webkit.org>
421
422         Deprecate SPI that is or ought to be unused
423         https://bugs.webkit.org/show_bug.cgi?id=188616
424
425         Reviewed by Tim Horton.
426
427         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
428         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
429         * UIProcess/Cocoa/NavigationState.mm:
430         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
431         * UIProcess/Cocoa/UIDelegate.mm:
432         (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
433
434 2018-08-16  Alex Christensen  <achristensen@webkit.org>
435
436         Add temporary SPI WKContextHandlesSafeBrowsing
437         https://bugs.webkit.org/show_bug.cgi?id=188676
438
439         Reviewed by Joseph Pecoraro.
440
441         WebKit showing the safe browsing warning doesn't play well with Safari showing the safe browsing warning.
442         I plan to adopt this SPI in Safari to disable Safari's safe browsing check if it's true.
443         Then when I implement safe browsing in WebKit, I can switch this value to true in the same change and
444         not have a broken Safari.
445
446         * UIProcess/API/C/mac/WKContextPrivateMac.h:
447         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
448         (WKContextHandlesSafeBrowsing):
449
450 2018-08-16  Ben Richards  <benton_richards@apple.com>
451
452         Add script to generate WebContent service resource files
453         https://bugs.webkit.org/show_bug.cgi?id=188601
454
455         Reviewed by Dan Bernstein.
456
457         Added new build phase to WebContent service to copy resource files to WebKit.framework/PrivateHeaders/CustomWebContentResource.
458         These resources are intended to be used by a client to create a custom WebContent service.
459
460         * Scripts/copy-webcontent-resources-to-private-headers.sh: Added.
461         * WebKit.xcodeproj/project.pbxproj:
462
463 2018-08-16  Alex Christensen  <achristensen@webkit.org>
464
465         Consolidate data/string API loading paths
466         https://bugs.webkit.org/show_bug.cgi?id=188417
467
468         Reviewed by Michael Catanzaro.
469
470         loadHTMLString and loadData are basically duplicate code.
471         loadPlainTextString was also basically the same except it didn't set up a navigation, which
472         was almost certainly a bug, but nobody uses it in all of Apple and Debian.  We should probably deprecate
473         and remove it, but for now I make it use the same data loading path.
474
475         * UIProcess/API/C/WKPage.cpp:
476         (WKPageLoadData):
477         (WKPageLoadDataWithUserData):
478         (loadString):
479         (WKPageLoadHTMLString):
480         (WKPageLoadHTMLStringWithUserData):
481         (WKPageLoadPlainTextString):
482         (WKPageLoadPlainTextStringWithUserData):
483         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
484         (-[WKBrowsingContextController loadHTMLString:baseURL:userData:]):
485         (-[WKBrowsingContextController loadData:MIMEType:textEncodingName:baseURL:userData:]):
486         * UIProcess/API/Cocoa/WKWebView.mm:
487         (-[WKWebView loadData:MIMEType:characterEncodingName:baseURL:]):
488         (-[WKWebView _loadData:MIMEType:characterEncodingName:baseURL:userData:]):
489         * UIProcess/API/glib/WebKitWebView.cpp:
490         (webkit_web_view_load_html):
491         (webkit_web_view_load_plain_text):
492         * UIProcess/WebPageProxy.cpp:
493         (WebKit::WebPageProxy::loadData):
494         (WebKit::WebPageProxy::loadHTMLString): Deleted.
495         (WebKit::WebPageProxy::loadPlainTextString): Deleted.
496         * UIProcess/WebPageProxy.h:
497         * WebProcess/WebPage/WebPage.cpp:
498         (WebKit::WebPage::loadData):
499         (WebKit::WebPage::loadString): Deleted.
500         * WebProcess/WebPage/WebPage.h:
501         * WebProcess/WebPage/WebPage.messages.in:
502
503 2018-08-16  Alex Christensen  <achristensen@webkit.org>
504
505         Transition more WKWebViewConfiguration ivars to API::PageConfiguration values
506         https://bugs.webkit.org/show_bug.cgi?id=188665
507
508         Reviewed by Joseph Pecoraro.
509
510         APPLICATION_MANIFEST is enabled on all Cocoa platforms, so I removed some guards, too!
511
512         * UIProcess/API/APIPageConfiguration.cpp:
513         (API::PageConfiguration::applicationManifest const):
514         * UIProcess/API/APIPageConfiguration.h:
515         * UIProcess/API/Cocoa/WKWebView.mm:
516         (-[WKWebView _initializeWithConfiguration:]):
517         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
518         (-[WKWebViewConfiguration init]):
519         (-[WKWebViewConfiguration copyWithZone:]):
520         (-[WKWebViewConfiguration _applicationManifest]):
521         (-[WKWebViewConfiguration _setApplicationManifest:]):
522         (-[WKWebViewConfiguration _setCPULimit:]):
523         (-[WKWebViewConfiguration _cpuLimit]):
524
525 2018-08-16  Alex Christensen  <achristensen@webkit.org>
526
527         Transition more WKWebViewConfiguration ivars to API::PageConfiguration values
528         https://bugs.webkit.org/show_bug.cgi?id=188663
529
530         Reviewed by Tim Horton.
531
532         * UIProcess/API/Cocoa/WKWebView.mm:
533         (-[WKWebView _initializeWithConfiguration:]):
534         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
535         (-[WKWebViewConfiguration init]):
536         (-[WKWebViewConfiguration copyWithZone:]):
537         (-[WKWebViewConfiguration _drawsBackground]):
538         (-[WKWebViewConfiguration _setDrawsBackground:]):
539         (-[WKWebViewConfiguration _waitsForPaintAfterViewDidMoveToWindow]):
540         (-[WKWebViewConfiguration _setWaitsForPaintAfterViewDidMoveToWindow:]):
541         (-[WKWebViewConfiguration _isControlledByAutomation]):
542         (-[WKWebViewConfiguration _setControlledByAutomation:]):
543
544 2018-08-16  Alex Christensen  <achristensen@webkit.org>
545
546         Stop using canAuthenticateAgainstProtectionSpace in modern WebKit
547         https://bugs.webkit.org/show_bug.cgi?id=188639
548
549         Reviewed by Youenn Fablet.
550
551         canAuthenticateAgainstProtectionSpace is an unnecessary step in the authentication process.
552         It is leftover from when it was necessary when we used NSURLConnection, which is only used in WebKitLegacy now.
553         Now it's just an extra IPC roundtrip asking if we should use NSURLSessionAuthChallengeRejectProtectionSpace
554         or if we are going to ask the API client.  We can move this step into the C API for compatibility
555         with the 1 client that still uses it (not for long, see rdar://problem/43358403) and simplify and optimize
556         authentication.
557
558         * NetworkProcess/Downloads/PendingDownload.cpp:
559         (WebKit::PendingDownload::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
560         * NetworkProcess/Downloads/PendingDownload.h:
561         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
562         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
563         * NetworkProcess/NetworkLoad.cpp:
564         (WebKit::NetworkLoad::~NetworkLoad):
565         (WebKit::NetworkLoad::didReceiveChallenge):
566         (WebKit::NetworkLoad::completeAuthenticationChallenge): Deleted.
567         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace): Deleted.
568         * NetworkProcess/NetworkLoad.h:
569         * NetworkProcess/NetworkLoadClient.h:
570         * NetworkProcess/NetworkProcess.cpp:
571         (WebKit::NetworkProcess::cancelDownload):
572         (WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace): Deleted.
573         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace): Deleted.
574         * NetworkProcess/NetworkProcess.h:
575         * NetworkProcess/NetworkProcess.messages.in:
576         * NetworkProcess/NetworkResourceLoader.cpp:
577         (WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
578         * NetworkProcess/NetworkResourceLoader.h:
579         * NetworkProcess/PreconnectTask.cpp:
580         (WebKit::PreconnectTask::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
581         * NetworkProcess/PreconnectTask.h:
582         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
583         (WebKit::NetworkCache::SpeculativeLoad::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
584         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
585         * Shared/Authentication/AuthenticationManager.cpp:
586         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
587         * Shared/Authentication/AuthenticationManager.h:
588         * UIProcess/API/C/WKPage.cpp:
589         (WKPageSetPageNavigationClient):
590         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
591         * UIProcess/Cocoa/NavigationState.h:
592         * UIProcess/Cocoa/NavigationState.mm:
593         (WebKit::NavigationState::setNavigationDelegate):
594         (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
595         (WebKit::NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace): Deleted.
596         * UIProcess/Network/NetworkProcessProxy.cpp:
597         (WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace): Deleted.
598         * UIProcess/Network/NetworkProcessProxy.h:
599         * UIProcess/Network/NetworkProcessProxy.messages.in:
600         * UIProcess/WebPageProxy.cpp:
601         (WebKit::WebPageProxy::canAuthenticateAgainstProtectionSpace): Deleted.
602         * UIProcess/WebPageProxy.h:
603
604 2018-08-15  Jer Noble  <jer.noble@apple.com>
605
606         Add Experimental Feature support for SourceBuffer.changeType()
607         https://bugs.webkit.org/show_bug.cgi?id=188626
608
609         Reviewed by Eric Carlson.
610
611         * Shared/WebPreferences.yaml:
612         * UIProcess/API/C/WKPreferences.cpp:
613         (WKPreferencesSetSourceBufferChangeTypeEnabled):
614         (WKPreferencesGetSourceBufferChangeTypeEnabled):
615         * UIProcess/API/C/WKPreferencesRefPrivate.h:
616
617 2018-08-16  Alex Christensen  <achristensen@webkit.org>
618
619         Transition more WKWebViewConfiguration ivars to API::PageConfiguration values
620         https://bugs.webkit.org/show_bug.cgi?id=188661
621
622         Reviewed by Anders Carlsson.
623
624         * UIProcess/API/Cocoa/WKWebView.mm:
625         (-[WKWebView _initializeWithConfiguration:]):
626         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
627         (-[WKWebViewConfiguration init]):
628         (-[WKWebViewConfiguration copyWithZone:]):
629         (-[WKWebViewConfiguration _alwaysRunsAtForegroundPriority]):
630         (-[WKWebViewConfiguration _setAlwaysRunsAtForegroundPriority:]):
631         (-[WKWebViewConfiguration _initialCapitalizationEnabled]):
632         (-[WKWebViewConfiguration _setInitialCapitalizationEnabled:]):
633         (-[WKWebViewConfiguration _overrideContentSecurityPolicy]):
634         (-[WKWebViewConfiguration _setOverrideContentSecurityPolicy:]):
635
636 2018-08-16  Aditya Keerthi  <akeerthi@apple.com>
637
638         Support drag-and-drop for input[type=color]
639         https://bugs.webkit.org/show_bug.cgi?id=188464
640
641         Reviewed by Wenson Hsieh.
642
643         On iOS, the drag preview for the color input is a rounded rectangle. In order to
644         ensure that the corners appear transparent, the visiblePath property of the
645         UIDragPreviewParameters was set to match the preview's shape. This also required
646         the creation of an additional ArgumentCoder for Path.
647
648         When beginning the drag session, the preview should appear centered about the
649         color input. This is managed in createTargetedDragPreview. However, once the
650         preview is dragged, the preview should be at the center of the touch location.
651         Consequently, DragSourceActionColor was added to the list of sources that could
652         update the drag preview after lifting.
653
654         * Shared/WebCoreArgumentCoders.cpp:
655         (IPC::ArgumentCoder<Path>::decode):
656         * Shared/WebCoreArgumentCoders.h:
657         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
658         (WebKit::WebPasteboardProxy::setPasteboardColor):
659         * UIProcess/WebPasteboardProxy.h:
660         * UIProcess/WebPasteboardProxy.messages.in:
661         * UIProcess/ios/DragDropInteractionState.h:
662         * UIProcess/ios/DragDropInteractionState.mm:
663         (WebKit::createTargetedDragPreview):
664         (WebKit::shouldUseDragImageToCreatePreviewForDragSource):
665         (WebKit::shouldUseVisiblePathToCreatePreviewForDragSource):
666         (WebKit::canUpdatePreviewForActiveDragSource):
667         (WebKit::DragDropInteractionState::previewForDragItem const):
668         (WebKit::DragDropInteractionState::stageDragItem):
669         (WebKit::DragDropInteractionState::updatePreviewsForActiveDragSources):
670         * UIProcess/ios/forms/WKFormColorPicker.mm:
671         (-[WKColorPicker initWithView:]):
672         * UIProcess/mac/WebColorPickerMac.h:
673         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
674         (WebKit::WebPlatformStrategies::setColor):
675         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
676
677 2018-08-16  Per Arne Vollan  <pvollan@apple.com>
678
679         Assert that calling CGSSetDenyWindowServerConnections(true) succeeds
680         https://bugs.webkit.org/show_bug.cgi?id=188615
681
682         Reviewed by Brent Fulgham.
683
684         If the call to CGSSetDenyWindowServerConnections(true) fails, it means there are open WindowServer connections
685         at this point, and future WindowServer connections will not be denied. We should assert that this call succeeds.
686
687         * WebProcess/cocoa/WebProcessCocoa.mm:
688         (WebKit::WebProcess::platformInitializeProcess):
689
690 2018-08-16  Philippe Normand  <pnormand@igalia.com>
691
692         Unreviewed, WPE build fix after r234920.
693
694         * UIProcess/API/wpe/PageClientImpl.cpp:
695         (WebKit::PageClientImpl::isViewWindowActive):
696         (WebKit::PageClientImpl::isViewFocused):
697         (WebKit::PageClientImpl::isViewVisible):
698         (WebKit::PageClientImpl::isViewInWindow):
699         * UIProcess/API/wpe/WPEView.cpp:
700         (WKWPE::View::setViewState):
701         * UIProcess/API/wpe/WPEView.h:
702
703 2018-08-16  Antti Koivisto  <antti@apple.com>
704
705         Use OptionSet for ActivityState::Flags
706         https://bugs.webkit.org/show_bug.cgi?id=188554
707
708         Reviewed by Brent Fulgham.
709
710         * Shared/WebPageCreationParameters.h:
711         * UIProcess/Cocoa/WebViewImpl.mm:
712         (WebKit::WebViewImpl::windowDidOrderOffScreen):
713         (WebKit::WebViewImpl::windowDidOrderOnScreen):
714         (WebKit::WebViewImpl::viewDidMoveToWindow):
715         * UIProcess/WebPageProxy.cpp:
716         (WebKit::WebPageProxy::updateActivityState):
717         (WebKit::WebPageProxy::activityStateDidChange):
718         (WebKit::WebPageProxy::dispatchActivityStateChange):
719         (WebKit::WebPageProxy::setMuted):
720         (WebKit::WebPageProxy::isPlayingMediaDidChange):
721         * UIProcess/WebPageProxy.h:
722         (WebKit::WebPageProxy::isInWindow const):
723         (WebKit::WebPageProxy::isViewVisible const):
724         (WebKit::WebPageProxy::isViewFocused const):
725         (WebKit::WebPageProxy::isViewWindowActive const):
726         * WebProcess/Plugins/PluginView.cpp:
727         (WebKit::PluginView::activityStateDidChange):
728         * WebProcess/Plugins/PluginView.h:
729         * WebProcess/WebPage/DrawingArea.h:
730         (WebKit::DrawingArea::activityStateDidChange):
731         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
732         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
733         (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):
734         * WebProcess/WebPage/WebPage.cpp:
735         (WebKit::WebPage::updateThrottleState):
736         (WebKit::WebPage::updateIsInWindow):
737         (WebKit::WebPage::visibilityDidChange):
738         (WebKit::WebPage::setActivityState):
739         * WebProcess/WebPage/WebPage.h:
740         (WebKit::WebPage::isVisible const):
741         (WebKit::WebPage::isVisibleOrOccluded const):
742         * WebProcess/WebPage/WebPage.messages.in:
743         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
744         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
745         (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange):
746         * WebProcess/WebProcess.cpp:
747         (WebKit::WebProcess::pageActivityStateDidChange):
748         * WebProcess/WebProcess.h:
749
750 2018-08-15  Ansh Shukla  <ansh_shukla@apple.com>
751
752         NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault
753         https://bugs.webkit.org/show_bug.cgi?id=186870
754         <rdar://problem/41314410>
755
756         Reviewed by Alex Christensen.
757
758         Correctly expose the OAuth protection space type in API.
759
760         * UIProcess/API/C/WKAPICast.h:
761         (WebKit::toAPI):
762         * UIProcess/API/C/WKProtectionSpaceTypes.h:
763
764 2018-08-15  Ben Richards  <benton_richards@apple.com>
765
766         We should cache the compiled sandbox profile in a data vault
767         https://bugs.webkit.org/show_bug.cgi?id=184991
768
769         Reviewed by Ryosuke Niwa.
770
771         This patch changes a few things (note: data vaults and sandbox entitlements are only used in internal builds):
772         (1) Instead of compiling a sandbox every time a process is launched, processes now look for a cached sandbox
773             in a process specific data vault on macOS platforms. (ChildProcessMac.mm)
774         (2) If a valid cached sandbox is not found, a process will create the data vault (or ensure that it exists),
775             compile a sandbox, and cache it.
776         (3) In order to create process specific data vaults, each process now has their own <process name>-OSX-sandbox.entitlements
777             file which contains an entitlement with a process specific "storage class" which ensures that each process
778             can only ever access its own data vault. (See the article on confluence "Data Vaults and Restricted Files" for more info)
779         (4) The sandbox entitlements file for the Network and WebContent services are loaded dynamically
780             through Scripts/<process name>-process-entitlements.sh which is triggered in a new build phase for each service.
781             The Storage process sandbox entitlements are loaded directly in Configurations/StorageService.xcconfig.
782             The reason that the sandbox entitlements are applied dynamically is so that these sandbox entitlements
783             are only applied when WK_USE_RESTRICTED_ENTITLEMENTS is YES. This means that open source builds will still work.
784
785         * Configurations/Network-OSX-sandbox.entitlements: Added.
786         * Configurations/Storage-OSX-sandbox.entitlements: Added.
787         * Configurations/StorageService.xcconfig:
788         * Configurations/WebContent-OSX-sandbox.entitlements: Added.
789         * Configurations/WebKit.xcconfig:
790         * NetworkProcess/NetworkProcess.h:
791         * PluginProcess/PluginProcess.h:
792         * Scripts/process-network-sandbox-entitlements.sh: Added.
793         * Scripts/process-webcontent-sandbox-entitlements.sh: Added.
794         * Shared/ChildProcess.h:
795         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
796         (WebKit::XPCServiceInitializer):
797         * Shared/SandboxInitializationParameters.h:
798         (WebKit::SandboxInitializationParameters::setOverrideSandboxProfilePath):
799         (WebKit::SandboxInitializationParameters::overrideSandboxProfilePath const):
800         (WebKit::SandboxInitializationParameters::setSandboxProfile):
801         (WebKit::SandboxInitializationParameters::sandboxProfile const):
802         (): Deleted.
803         * Shared/mac/ChildProcessMac.mm:
804         (WebKit::SandboxProfileDeleter::operator()):
805         (WebKit::SandboxParametersDeleter::operator()):
806         (WebKit::SandboxInfo::SandboxInfo):
807         (WebKit::fileContents):
808         (WebKit::processStorageClass):
809         (WebKit::setAndSerializeSandboxParameters):
810         (WebKit::sandboxDataVaultParentDirectory):
811         (WebKit::sandboxDirectory):
812         (WebKit::sandboxFilePath):
813         (WebKit::ensureSandboxCacheDirectory):
814         (WebKit::writeSandboxDataToCacheFile):
815         (WebKit::compileAndCacheSandboxProfile):
816         (WebKit::tryApplyCachedSandbox):
817         (WebKit::webKit2Bundle):
818         (WebKit::getSandboxProfileOrProfilePath):
819         (WebKit::compileAndApplySandboxSlowCase):
820         (WebKit::applySandbox):
821         (WebKit::initializeSandboxParameters):
822         (WebKit::ChildProcess::initializeSandbox):
823         * Shared/mac/SandboxInitialiationParametersMac.mm:
824         (WebKit::SandboxInitializationParameters::SandboxInitializationParameters):
825         * StorageProcess/StorageProcess.h:
826         * WebKit.xcodeproj/project.pbxproj:
827         * WebProcess/WebProcess.h:
828
829 2018-08-15  Ross Kirsling  <ross.kirsling@sony.com>
830
831         [WinCairo] Unreviewed build fix after r234896.
832
833         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
834         (WebKit::NetworkDataTaskCurl::tryHttpAuthentication):
835
836 2018-08-15  Ryosuke Niwa  <rniwa@webkit.org>
837
838         Can't share an app on AppStore to WeChat due to a release assert
839         https://bugs.webkit.org/show_bug.cgi?id=188621
840         <rdar://problem/43343976>
841
842         Reviewed by Geoffrey Garen.
843
844         Disable the thread safety check when the app is not linked on or after iOS 12 since this release assert
845         is getting hit by third party applications on iOS in UI process.
846
847         * UIProcess/Cocoa/VersionChecks.h:
848         (WebKit::SDKVersion::FirstWithMainThreadReleaseAssertionInWebPageProxy): Added. It's iOS 12 or macOS 10.14 Mojave.
849         * UIProcess/WebProcessProxy.cpp:
850         (WebKit::isMainThreadOrCheckDisabled): Added. Returns true whether when we're in the main thread or if the app
851         is not linked on or after iOS 12 or macOS 10.14 Mojave.
852         (WebKit::globalPageMap):
853         (WebKit::m_isInPrewarmedPool):
854         (WebKit::WebProcessProxy::~WebProcessProxy):
855         (WebKit::WebProcessProxy::shutDown):
856         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
857         (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData):
858         (WebKit::WebProcessProxy::didFinishLaunching):
859
860 2018-08-15  Alex Christensen  <achristensen@webkit.org>
861
862         Remove WKNavigationDelegatePrivate's canAuthenticateAgainstProtectionSpace
863         https://bugs.webkit.org/show_bug.cgi?id=188622
864
865         Reviewed by Timothy Hatcher.
866
867         It's been deprecated for a release now, nobody uses it, and it's a concept from NSURLConnection, which we don't use any more in WebKit2.
868
869         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
870         * UIProcess/Cocoa/NavigationState.h:
871         * UIProcess/Cocoa/NavigationState.mm:
872         (WebKit::NavigationState::setNavigationDelegate):
873         (WebKit::NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace):
874
875 2018-08-15  Tim Horton  <timothy_horton@apple.com>
876
877         Crashes in Quip under _dictionaryPopupInfoForRange, in setObject:forKey:
878         https://bugs.webkit.org/show_bug.cgi?id=188569
879         <rdar://problem/34201095>
880
881         Reviewed by Megan Gardner.
882
883         * WebProcess/WebPage/mac/WebPageMac.mm:
884         (WebKit::WebPage::dictionaryPopupInfoForRange):
885         Speculative fix; the crashes indicate font is null, but we just checked it,
886         so it must be getting made null by convertFont:toSize:. Check again!
887
888 2018-08-15  Ryan Haddad  <ryanhaddad@apple.com>
889
890         Unreviewed, rolling out r234870.
891
892         The test introduced with this change is a flaky failure.
893
894         Reverted changeset:
895
896         "NSURLAuthenticationMethodOAuth challenges are surfaced to
897         clients in -didReceiveAuthenticationChallenge as
898         NSURLAuthenticationMethodDefault"
899         https://bugs.webkit.org/show_bug.cgi?id=186870
900         https://trac.webkit.org/changeset/234870
901
902 2018-08-15  Alex Christensen  <achristensen@webkit.org>
903
904         NetworkCORSPreflightChecker should proceed in case of ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested even though the WebKit app is not implementing the didReceiveAuthenticationChallenge/didReceiveAuthenticationChallengeInFrame callback
905         https://bugs.webkit.org/show_bug.cgi?id=188592
906         <rdar://problem/43210331>
907
908         Reviewed by Youenn Fablet.
909
910         Do a canAuthenticateAgainstProtectionSpace check in NetworkCORSPreflightChecker like we do in NetworkLoad.
911         Use CompletionHandlers to make the now 3 different canAuthenticateAgainstProtectionSpace checks look the same from the NetworkProcess.
912
913         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
914         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
915         * NetworkProcess/NetworkCORSPreflightChecker.h:
916         * NetworkProcess/NetworkDataTask.h:
917         * NetworkProcess/NetworkLoad.cpp:
918         (WebKit::NetworkLoad::didReceiveChallenge):
919         * NetworkProcess/NetworkLoad.h:
920         * NetworkProcess/NetworkProcess.cpp:
921         (WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace):
922         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace):
923         * NetworkProcess/NetworkProcess.h:
924         * NetworkProcess/NetworkResourceLoader.cpp:
925         (WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
926         (WebKit::NetworkResourceLoader::continueCanAuthenticateAgainstProtectionSpace): Deleted.
927         * NetworkProcess/NetworkResourceLoader.h:
928         * NetworkProcess/PingLoad.cpp:
929         (WebKit::PingLoad::didReceiveChallenge):
930         * NetworkProcess/PingLoad.h:
931         * NetworkProcess/PreconnectTask.cpp:
932         (WebKit::PreconnectTask::canAuthenticateAgainstProtectionSpaceAsync):
933         (WebKit::PreconnectTask::continueCanAuthenticateAgainstProtectionSpace): Deleted.
934         * NetworkProcess/PreconnectTask.h:
935         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
936         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
937         (WebKit::NetworkDataTaskCocoa::didReceiveChallenge):
938
939 2018-08-15  Michael Catanzaro  <mcatanzaro@igalia.com>
940
941         [WPE][GTK] WaylandCompositor fails to properly remove surface from its page map
942         https://bugs.webkit.org/show_bug.cgi?id=188520
943
944         Reviewed by Alex Christensen.
945
946         willDestroySurface overwrites the surface pointer in the map's iterator in an attempt to
947         change the value of the surface pointer in the map, but it doesn't work because changing
948         the iterator does not change the map itself. There's no need to fix this function: it's
949         better to use WeakPtr instead.
950
951         * UIProcess/gtk/WaylandCompositor.cpp:
952         (WebKit::WaylandCompositor::getTexture):
953         (WebKit::WaylandCompositor::bindSurfaceToWebPage):
954         (WebKit::WaylandCompositor::unregisterWebPage):
955         (WebKit::WaylandCompositor::willDestroySurface): Deleted.
956         * UIProcess/gtk/WaylandCompositor.h:
957
958 2018-08-15  Wenson Hsieh  <wenson_hsieh@apple.com>
959
960         [Attachment SPI] Remove attachment display mode options
961         https://bugs.webkit.org/show_bug.cgi?id=188596
962
963         Reviewed by Dan Bernstein.
964
965         Remove attachment display mode from WebKit. Note that _WKAttachmentDisplayOptions needs to remain in the private
966         header for source compatibility with Mail.
967
968         * UIProcess/API/Cocoa/_WKAttachment.mm:
969         (-[_WKAttachmentDisplayOptions coreDisplayOptions]): Deleted.
970         * WebProcess/WebPage/WebPage.cpp:
971         (WebKit::WebPage::setAttachmentDisplayOptions):
972
973 2018-08-14 Sihui Liu <sihui_liu@apple.com>
974
975         Crash in WebKit::filterPreloadHSTSEntry via NetworkProcess::getHostNamesWithHSTSCache
976         https://bugs.webkit.org/show_bug.cgi?id=188576
977         <rdar://problem/43148977>
978
979         Reviewed by Alex Christensen.
980
981         * NetworkProcess/NetworkProcess.cpp:
982         (WebKit::NetworkProcess::fetchWebsiteData):
983
984 2018-08-14  Alex Christensen  <achristensen@webkit.org>
985
986         isValidCSSSelector is unsafe to be called from a non-main thread
987         https://bugs.webkit.org/show_bug.cgi?id=188581
988         <rdar://problem/40517358>
989
990         Reviewed by Sam Weinig.
991
992         * UIProcess/API/APIContentRuleListStore.cpp:
993         (API::compiledToFile):
994         (API::ContentRuleListStore::lookupContentRuleList):
995         (API::ContentRuleListStore::getAvailableContentRuleListIdentifiers):
996         (API::ContentRuleListStore::compileContentRuleList):
997         (API::ContentRuleListStore::removeContentRuleList):
998         (API::ContentRuleListStore::getContentRuleListSource):
999         * UIProcess/API/APIContentRuleListStore.h:
1000         * UIProcess/API/Cocoa/WKContentRuleListStore.mm:
1001
1002 2018-08-14  Ansh Shukla  <ansh_shukla@apple.com>
1003
1004         NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault
1005         https://bugs.webkit.org/show_bug.cgi?id=186870
1006         <rdar://problem/41314410>
1007
1008         Reviewed by Alex Christensen.
1009
1010         Correctly expose the OAuth protection space type in API.
1011
1012         * UIProcess/API/C/WKAPICast.h:
1013         (WebKit::toAPI):
1014         * UIProcess/API/C/WKProtectionSpaceTypes.h:
1015
1016 2018-08-14  Ben Richards  <benton_richards@apple.com>
1017
1018         Remove api misuse check so that custom webcontent service identifier can be set at runtime
1019         https://bugs.webkit.org/show_bug.cgi?id=188579
1020
1021         Reviewed by Ryosuke Niwa.
1022
1023         Changed API misuse check so that a custom bundle identifier can be set at runtime with a debug flag
1024
1025         * UIProcess/WebProcessPool.cpp:
1026         (WebKit::WebProcessPool::setCustomWebContentServiceBundleIdentifier):
1027         * UIProcess/WebProcessProxy.cpp:
1028         (WebKit::WebProcessProxy::getLaunchOptions):
1029
1030 2018-08-14  Antti Koivisto  <antti@apple.com>
1031
1032         RemoteLayerTreeTransaction should use OptionSet for change flags
1033         https://bugs.webkit.org/show_bug.cgi?id=188547
1034
1035         Reviewed by Simon Fraser.
1036
1037         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
1038         (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
1039         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
1040         (WebKit::RemoteLayerTreeTransaction::LayerProperties::notePropertiesChanged):
1041         (WebKit::RemoteLayerTreeTransaction::LayerProperties::resetChangedProperties):
1042
1043         Also remove unused everChangedProperties.
1044
1045         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
1046         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
1047         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode const):
1048         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
1049         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
1050         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
1051         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1052         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
1053
1054 2018-08-13  Wenson Hsieh  <wenson_hsieh@apple.com>
1055
1056         [WK2] [macOS] Implement a mechanism to test drag and drop
1057         https://bugs.webkit.org/show_bug.cgi?id=181898
1058         <rdar://problem/39181698>
1059
1060         Reviewed by Simon Fraser.
1061
1062         Adds a new SPI method, `-_doAfterProcessingAllPendingMouseEvents:`, to WKWebView. This invokes the given
1063         callback after all queued mouse events have been handled by the web process. See Tools/ChangeLog for more
1064         detail.
1065
1066         * UIProcess/API/Cocoa/WKWebView.mm:
1067         (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]):
1068         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1069         * UIProcess/API/gtk/PageClientImpl.h:
1070         * UIProcess/API/wpe/PageClientImpl.h:
1071         * UIProcess/Cocoa/WebViewImpl.h:
1072         * UIProcess/Cocoa/WebViewImpl.mm:
1073         (WebKit::WebViewImpl::processDidExit):
1074
1075         Invoke any outstanding callbacks for processing pending mouse events when the web process is terminated.
1076
1077         (WebKit::WebViewImpl::doAfterProcessingAllPendingMouseEvents):
1078
1079         Either invoke the callback immediately if there are no mouse events to be processed, or insert the callback in
1080         a queue that will be flushed once all mouse events have been handled.
1081
1082         (WebKit::WebViewImpl::didFinishProcessingAllPendingMouseEvents):
1083         (WebKit::WebViewImpl::flushPendingMouseEventCallbacks):
1084         * UIProcess/PageClient.h:
1085         (WebKit::PageClient::pinnedStateWillChange):
1086         (WebKit::PageClient::pinnedStateDidChange):
1087         (WebKit::PageClient::videoControlsManagerDidChange):
1088
1089         Drive-by tweaks: remove unnecessary semicolons after empty implementation stubs.
1090
1091         * UIProcess/WebPageProxy.cpp:
1092         (WebKit::WebPageProxy::didReceiveEvent):
1093
1094         Notify the page client when there are no remaining mouse events left in the queue.
1095
1096         * UIProcess/ios/PageClientImplIOS.h:
1097         * UIProcess/mac/PageClientImplMac.h:
1098         * UIProcess/mac/PageClientImplMac.mm:
1099         (WebKit::PageClientImpl::didFinishProcessingAllPendingMouseEvents):
1100
1101         Add some plumbing through PageClient, so that WebPageProxy can tell WebViewImpl when it is finished processing
1102         all mouse events.
1103
1104         * UIProcess/win/PageClientImpl.h:
1105
1106 2018-08-13  Alex Christensen  <achristensen@webkit.org>
1107
1108         Fix linux build after r234811
1109         https://bugs.webkit.org/show_bug.cgi?id=188501
1110
1111         * UIProcess/API/glib/WebKitWebsiteData.cpp:
1112         (recordContainsSupportedDataTypes):
1113
1114 2018-08-13  Commit Queue  <commit-queue@webkit.org>
1115
1116         Unreviewed, rolling out r234747.
1117         https://bugs.webkit.org/show_bug.cgi?id=188524
1118
1119         plugin processes crash on launch (Requested by smfr on
1120         #webkit).
1121
1122         Reverted changeset:
1123
1124         "We should cache the compiled sandbox profile in a data vault"
1125         https://bugs.webkit.org/show_bug.cgi?id=184991
1126         https://trac.webkit.org/changeset/234747
1127
1128 2018-08-13  Alex Christensen  <achristensen@webkit.org>
1129
1130         Use a 1-byte enum class for TextDirection
1131         https://bugs.webkit.org/show_bug.cgi?id=188350
1132
1133         Reviewed by Simon Fraser.
1134
1135         * Shared/WebPopupItem.cpp:
1136         (WebKit::WebPopupItem::WebPopupItem):
1137         * UIProcess/ios/WKContentViewInteraction.mm:
1138         (-[WKContentView webSelectionRectsForSelectionRects:]):
1139         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1140         (WebKit::WebPopupMenuProxyMac::populate):
1141         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
1142         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
1143         (WebKit::WebPopupMenu::show):
1144         * WebProcess/WebPage/ios/WebPageIOS.mm:
1145         (WebKit::WebPage::getAssistedNodeInformation):
1146
1147 2018-08-13  Michael Catanzaro  <mcatanzaro@igalia.com>
1148
1149         Unreviewed, silence "enumeral and non-enumeral type in conditional expression" warning
1150
1151         * UIProcess/WebPageProxy.cpp:
1152         (WebKit::WebPageProxy::dispatchActivityStateChange):
1153
1154 2018-08-12  Aditya Keerthi  <akeerthi@apple.com>
1155
1156         [macOS] Color wells should appear pressed when presenting a color picker
1157         https://bugs.webkit.org/show_bug.cgi?id=188477
1158
1159         Reviewed by Tim Horton.
1160
1161         In order for the color well to accurately reflect the state of the picker, it is
1162         necessary to ensure that the picker is destroyed at the appropriate time.
1163
1164         Added windowWillClose and didClosePopover delegate methods to destroy the picker
1165         it has been closed. Also added a call to WebColorPicker::endPicker in
1166         WebColorPickerMac's implementation of endPicker to ensure that the object is
1167         destroyed. Removed redundant calls to endPicker in the WebPageProxy.
1168
1169         The hitTest method was overridden in WKPopoverColorWell to ensure that AppKit's
1170         view does not block our drawn color well from receiving click events.
1171
1172         * UIProcess/WebColorPicker.cpp:
1173         (WebKit::WebColorPicker::endPicker):
1174         * UIProcess/WebColorPicker.h:
1175         * UIProcess/WebPageProxy.cpp:
1176         (WebKit::WebPageProxy::endColorPicker):
1177         (WebKit::WebPageProxy::didEndColorPicker):
1178         (WebKit::WebPageProxy::resetState):
1179         (WebKit::WebPageProxy::closeOverlayedViews):
1180         * UIProcess/mac/WebColorPickerMac.mm:
1181         (WebKit::WebColorPickerMac::~WebColorPickerMac):
1182         (WebKit::WebColorPickerMac::endPicker):
1183         (-[WKPopoverColorWell popoverDidClose:]):
1184         (-[WKPopoverColorWell hitTest:]):
1185         (-[WKColorPopoverMac setAndShowPicker:withColor:suggestions:]):
1186         (-[WKColorPopoverMac invalidate]):
1187         (-[WKColorPopoverMac windowWillClose:]):
1188         (-[WKColorPopoverMac didClosePopover]):
1189
1190 2018-08-10  David Kilzer  <ddkilzer@apple.com>
1191
1192         [Cocoa] WebKit::PlatformPopupMenuData should use member initialization
1193         <https://webkit.org/b/188478>
1194         <rdar://problem/43154363>
1195
1196         Reviewed by Joseph Pecoraro.
1197
1198         * Shared/PlatformPopupMenuData.cpp:
1199         (WebKit::PlatformPopupMenuData::PlatformPopupMenuData): Delete
1200         implementation.  This constructor caused the warning by never
1201         initializing its member variables.
1202         * Shared/PlatformPopupMenuData.h:
1203         (WebKit::PlatformPopupMenuData::PlatformPopupMenuData):
1204         - Use default constructor.
1205         (WebKit::PlatformPopupMenuData::shouldPopOver):
1206         (WebKit::PlatformPopupMenuData::hideArrows):
1207         (WebKit::PlatformPopupMenuData::menuSize):
1208         - Add struct member initialization.
1209
1210 2018-08-10  Chris Dumez  <cdumez@apple.com>
1211
1212         Crash under NetworkResourceLoader::convertToDownload()
1213         https://bugs.webkit.org/show_bug.cgi?id=188479
1214         <rdar://problem/42201724>
1215
1216         Reviewed by Alex Christensen.
1217
1218         In NetworkResourceLoader::convertToDownload(), if m_networkLoad is null then we're trying
1219         to convert a load that came from the disk cache. Since we do not currently support converting
1220         such a load, cancel the current load and start a fresh download.
1221
1222         * NetworkProcess/NetworkResourceLoader.cpp:
1223         (WebKit::NetworkResourceLoader::convertToDownload):
1224
1225 2018-08-10  Sihui Liu  <sihui_liu@apple.com>
1226
1227         Incorrect log message in NetworkSession when creating NetworkDataTask
1228         https://bugs.webkit.org/show_bug.cgi?id=188463
1229
1230         Reviewed by Chris Dumez.
1231
1232         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1233         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
1234
1235 2018-08-09  Ben Richards  <benton_richards@apple.com>
1236
1237         We should cache the compiled sandbox profile in a data vault
1238         https://bugs.webkit.org/show_bug.cgi?id=184991
1239
1240         Reviewed by Ryosuke Niwa.
1241
1242         This patch changes a few things (note: data vaults and sandbox entitlements are only used in internal builds):
1243         (1) Instead of compiling a sandbox every time a process is launched, processes now look for a cached sandbox
1244             in a process specific data vault on macOS platforms. (ChildProcessMac.mm)
1245         (2) If a valid cached sandbox is not found, a process will create the data vault (or ensure that it exists),
1246             compile a sandbox, and cache it.
1247         (3) In order to create process specific data vaults, each process now has their own <process name>-OSX-sandbox.entitlements
1248             file which contains an entitlement with a process specific "storage class" which ensures that each process
1249             can only ever access its own data vault. (See the article on confluence "Data Vaults and Restricted Files" for more info)
1250         (4) The sandbox entitlements file for the Network, WebContent and Plugin services are loaded dynamically
1251             through Scripts/<process name>-process-entitlements.sh which is triggered in a new build phase for each service.
1252             The Storage process sandbox entitlements are loaded directly in Configurations/StorageService.xcconfig.
1253             The reason that the sandbox entitlements are applied dynamically is so that these sandbox entitlements
1254             are only applied when WK_USE_RESTRICTED_ENTITLEMENTS is YES. This means that open source builds will still work.
1255
1256         * Configurations/Network-OSX-sandbox.entitlements: Added.
1257         * Configurations/Storage-OSX-sandbox.entitlements: Added.
1258         * Configurations/StorageService.xcconfig:
1259         * Configurations/WebContent-OSX-sandbox.entitlements: Added.
1260         * Configurations/WebKit.xcconfig:
1261         * NetworkProcess/NetworkProcess.h:
1262         * PluginProcess/PluginProcess.h:
1263         * Scripts/process-network-sandbox-entitlements.sh: Added.
1264         * Scripts/process-webcontent-sandbox-entitlements.sh: Added.
1265         * Shared/ChildProcess.h:
1266         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
1267         (WebKit::XPCServiceInitializer):
1268         * Shared/SandboxInitializationParameters.h:
1269         (WebKit::SandboxInitializationParameters::setOverrideSandboxProfilePath):
1270         (WebKit::SandboxInitializationParameters::overrideSandboxProfilePath const):
1271         (WebKit::SandboxInitializationParameters::setSandboxProfile):
1272         (WebKit::SandboxInitializationParameters::sandboxProfile const):
1273         (): Deleted.
1274         * Shared/mac/ChildProcessMac.mm:
1275         (WebKit::SandboxProfileDeleter::operator()):
1276         (WebKit::SandboxParametersDeleter::operator()):
1277         (WebKit::SandboxInfo::SandboxInfo):
1278         (WebKit::fileContents):
1279         (WebKit::processStorageClass):
1280         (WebKit::setAndSerializeSandboxParameters):
1281         (WebKit::sandboxDataVaultParentDirectory):
1282         (WebKit::sandboxDirectory):
1283         (WebKit::sandboxFilePath):
1284         (WebKit::ensureSandboxCacheDirectory):
1285         (WebKit::writeSandboxDataToCacheFile):
1286         (WebKit::compileAndCacheSandboxProfile):
1287         (WebKit::tryApplyCachedSandbox):
1288         (WebKit::webKit2Bundle):
1289         (WebKit::sandboxProfilePath):
1290         (WebKit::compileAndApplySandboxSlowCase):
1291         (WebKit::applySandbox):
1292         (WebKit::initializeSandboxParameters):
1293         (WebKit::ChildProcess::initializeSandbox):
1294         * Shared/mac/SandboxInitialiationParametersMac.mm:
1295         (WebKit::SandboxInitializationParameters::SandboxInitializationParameters):
1296         * StorageProcess/StorageProcess.h:
1297         * WebKit.xcodeproj/project.pbxproj:
1298         * WebProcess/WebProcess.h:
1299
1300 2018-08-09  Jer Noble  <jer.noble@apple.com>
1301
1302         Video playback is using more power
1303         https://bugs.webkit.org/show_bug.cgi?id=188452
1304
1305         Reviewed by Eric Carlson.
1306
1307         * UIProcess/API/Cocoa/WKPreferences.mm:
1308         (-[WKPreferences _setLowPowerVideoAudioBufferSizeEnabled:]):
1309         (-[WKPreferences _lowPowerVideoAudioBufferSizeEnabled]):
1310
1311 2018-08-09  Alex Christensen  <achristensen@webkit.org>
1312
1313         Fix URLSchemeHandler.SyncXHR API test after r234735.
1314         https://bugs.webkit.org/show_bug.cgi?id=188358
1315
1316         * UIProcess/WebURLSchemeTask.cpp:
1317         (WebKit::WebURLSchemeTask::didReceiveData):
1318         Return after appending data for synchronous loads.  We used to send unused messages.
1319
1320 2018-08-09  Alex Christensen  <achristensen@webkit.org>
1321
1322         REGRESSION(234640) Loading stalls in environments without SafariSafeBrowsing framework
1323         https://bugs.webkit.org/show_bug.cgi?id=188453
1324         <rdar://problem/43102553>
1325
1326         Reviewed by Chris Dumez.
1327
1328         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1329         (WebKit::WebPageProxy::beginSafeBrowsingCheck):
1330
1331 2018-08-09  Alex Christensen  <achristensen@webkit.org>
1332
1333         WKURLSchemeHandler crashes when sent errors with sync XHR
1334         https://bugs.webkit.org/show_bug.cgi?id=188358
1335
1336         Reviewed by Chris Dumez.
1337
1338         * UIProcess/WebURLSchemeTask.cpp:
1339         (WebKit::WebURLSchemeTask::didReceiveData):
1340         (WebKit::WebURLSchemeTask::didComplete):
1341         * UIProcess/WebURLSchemeTask.h:
1342
1343 2018-08-09  Sihui Liu  <sihui_liu@apple.com>
1344
1345         REGRESSION (r232083): WKWebView loses first-party cookies on iOS
1346         https://bugs.webkit.org/show_bug.cgi?id=188443
1347         <rdar://problem/42991584>
1348
1349         Reviewed by Chris Dumez.
1350
1351         Revert the change to set sharedCookieStorage for iOS as it is breaking Kayak.
1352
1353         * NetworkProcess/NetworkProcess.h:
1354         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1355         (WebKit::NetworkProcessCreationParameters::encode const):
1356         (WebKit::NetworkProcessCreationParameters::decode):
1357         * NetworkProcess/NetworkProcessCreationParameters.h:
1358         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1359         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1360         * Shared/WebProcessCreationParameters.cpp:
1361         (WebKit::WebProcessCreationParameters::encode const):
1362         (WebKit::WebProcessCreationParameters::decode):
1363         * Shared/WebProcessCreationParameters.h:
1364         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1365         (WebKit::WebProcessPool::platformInitializeWebProcess):
1366         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1367
1368 2018-08-09  Per Arne Vollan  <pvollan@apple.com>
1369
1370         DisplayRefreshMonitorMac should hold a weak pointer to WebPage.
1371         https://bugs.webkit.org/show_bug.cgi?id=186683
1372
1373         Reviewed by Brent Fulgham.
1374
1375         Instead of DisplayRefreshMonitorMac having a RefPtr to WebPage, it should have a weak pointer.
1376         Having a RefPtr could in theory create reference cycles. This potential problem has not been
1377         observed in practice, but it is safer to use a weak pointer.
1378
1379         * WebProcess/WebPage/WebPage.h:
1380         * WebProcess/WebPage/mac/DrawingAreaMac.cpp:
1381         (WebKit::DisplayRefreshMonitorMac::DisplayRefreshMonitorMac):
1382         (WebKit::DisplayRefreshMonitorMac::~DisplayRefreshMonitorMac):
1383         (WebKit::DisplayRefreshMonitorMac::requestRefreshCallback):
1384
1385 2018-08-09  Ali Juma  <ajuma@chromium.org>
1386
1387         Import WPTs for IntersectionObserver
1388         https://bugs.webkit.org/show_bug.cgi?id=188416
1389
1390         Reviewed by Simon Fraser.
1391
1392         Make IntersectionObserver an experimental feature, so that it is enabled in
1393         WebKitTestRunner.
1394
1395         * Shared/WebPreferences.yaml:
1396
1397 2018-08-08  Tim Horton  <timothy_horton@apple.com>
1398
1399         Yet more crashes in MobileSafari under -[WKFormInputSession setSuggestions:]
1400         https://bugs.webkit.org/show_bug.cgi?id=188427
1401         <rdar://problem/43064672>
1402
1403         Reviewed by Wenson Hsieh.
1404
1405         Speculatively fix more crashes seen under setSuggestions.
1406
1407         * UIProcess/ios/WKContentViewInteraction.mm:
1408         (-[WKFormInputSession isValid]):
1409         (-[WKFormInputSession setSuggestions:]):
1410         (-[WKFormInputSession invalidate]):
1411         Belt-and-suspenders fix: use WeakObjCPtr for WKFormInputSession's WKContentView reference.
1412
1413         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1414         Invalidate the WKFormInputSession before replacing it; we theorize that
1415         there is a path in which we get here without having previously called stopAssistingNode.
1416         Most of the code is OK with this, but this leaves WKFormInputSession
1417         with a raw reference to WKContentView which can later become stale.
1418
1419 2018-08-08  Don Olmstead  <don.olmstead@sony.com>
1420
1421         [Curl] Surface additional NetworkLoadMetrics
1422         https://bugs.webkit.org/show_bug.cgi?id=188391
1423
1424         Reviewed by Joseph Pecoraro.
1425
1426         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
1427         (WebKit::NetworkDataTaskCurl::curlDidReceiveResponse):
1428
1429 2018-08-08  Alex Christensen  <achristensen@webkit.org>
1430
1431         Fix possible null dereference in WebBackForwardList::restoreFromState
1432         https://bugs.webkit.org/show_bug.cgi?id=188418
1433         <rdar://problem/42531726>
1434
1435         Reviewed by Chris Dumez.
1436
1437         * UIProcess/WebBackForwardList.cpp:
1438         (WebKit::WebBackForwardList::restoreFromState):
1439         Null-check m_page like we do everywhere else in this file because it can be set to null when closing the page.
1440
1441 2018-08-08  Commit Queue  <commit-queue@webkit.org>
1442
1443         Unreviewed, rolling out r234314, r234320, and r234321.
1444         https://bugs.webkit.org/show_bug.cgi?id=188414
1445
1446         Caused email sign in issue (Requested by ryanhaddad on
1447         #webkit).
1448
1449         Reverted changesets:
1450
1451         "Remove unused WKNavigationDelegatePrivate
1452         decidePolicyForNavigationAction SPI"
1453         https://bugs.webkit.org/show_bug.cgi?id=188077
1454         https://trac.webkit.org/changeset/234314
1455
1456         "Fix API tests after r234314"
1457         https://bugs.webkit.org/show_bug.cgi?id=188077
1458         https://trac.webkit.org/changeset/234320
1459
1460         "Fix API tests after r234314"
1461         https://bugs.webkit.org/show_bug.cgi?id=188077
1462         https://trac.webkit.org/changeset/234321
1463
1464 2018-08-08  Simon Fraser  <simon.fraser@apple.com>
1465
1466         Add a WebKit2 logging channel for ActivityState
1467         https://bugs.webkit.org/show_bug.cgi?id=188411
1468
1469         Reviewed by Tim Horton.
1470         
1471         Add logging for ActivityState changes and the entrypoints that affect ActivityState.
1472
1473         * Platform/Logging.h:
1474         * UIProcess/Cocoa/WebViewImpl.mm:
1475         (WebKit::WebViewImpl::windowDidOrderOffScreen):
1476         (WebKit::WebViewImpl::windowDidOrderOnScreen):
1477         (WebKit::WebViewImpl::windowDidChangeOcclusionState):
1478         (WebKit::WebViewImpl::viewDidMoveToWindow):
1479         (WebKit::WebViewImpl::viewDidHide):
1480         (WebKit::WebViewImpl::viewDidUnhide):
1481         (WebKit::WebViewImpl::activeSpaceDidChange):
1482         * UIProcess/WebPageProxy.cpp:
1483         (WebKit::WebPageProxy::activityStateDidChange):
1484         (WebKit::WebPageProxy::dispatchActivityStateChange):
1485         * UIProcess/mac/PageClientImplMac.mm:
1486         (WebKit::PageClientImpl::isViewVisible):
1487         * WebProcess/WebPage/WebPage.cpp:
1488         (WebKit::WebPage::setActivityState):
1489
1490 2018-08-05  Darin Adler  <darin@apple.com>
1491
1492         [Cocoa] More tweaks and refactoring to prepare for ARC
1493         https://bugs.webkit.org/show_bug.cgi?id=188245
1494
1495         Reviewed by Dan Bernstein.
1496
1497         * Platform/cocoa/WKCrashReporter.mm:
1498         (WebKit::setCrashLogMessage): Refactor into a separate function for clarity.
1499         (WebKit::setCrashReportApplicationSpecificInformation): Use a bridging cast.
1500
1501         * Shared/mac/PasteboardTypes.mm:
1502         (WebKit::PasteboardTypes::forEditing): Use a bridging cast.
1503
1504         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
1505         (WebKit::convertToNPNNString): Added. Uses CFStringRef rather than NSString so we can
1506         manually manage the autoreleasing.
1507         (WebKit::initializeKeyboardEvent): Use convertToNPNNString.
1508         (WebKit::NetscapePlugin::sendComplexTextInput): Ditto.
1509
1510         * WebProcess/Plugins/PDF/PDFPlugin.mm: Use __unsafe_unretained explicitly
1511         for a parent pointer. We could consider moving to __weak after switching to ARC.
1512
1513 2018-08-07  Ben Richards  <benton_richards@apple.com>
1514
1515         Add SPI for launching WebContent process with pre-linked injected bundle
1516         https://bugs.webkit.org/show_bug.cgi?id=188367
1517
1518         Reviewed by Ryosuke Niwa.
1519
1520         Added SPI to allow applications to set a "customWebContentServiceBundleIdentifier" which will be launched instead of the default WebContent XPC service.
1521         The "customWebContentServiceBundleIdentifier" should be the bundle identifier for an XPC service that calls [WKProcessPool _webContentProcessXPCMain].
1522         The new XPC service should be hard linked to the application's injected bundle in order to receive the intended performance benefit.
1523
1524         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
1525         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
1526         (WebKit::XPCServiceMain):
1527         (main):
1528         * UIProcess/API/APIProcessPoolConfiguration.h:
1529         * UIProcess/API/C/WKContext.cpp:
1530         (WKContextSetCustomWebContentServiceBundleIdentifier):
1531         * UIProcess/API/C/WKContext.h:
1532         * UIProcess/API/Cocoa/WKProcessPool.mm:
1533         (+[WKProcessPool _webContentProcessXPCMain]):
1534         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1535         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1536         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1537         (-[_WKProcessPoolConfiguration customWebContentServiceBundleIdentifier]):
1538         (-[_WKProcessPoolConfiguration setCustomWebContentServiceBundleIdentifier:]):
1539         * UIProcess/Launcher/ProcessLauncher.h:
1540         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1541         (WebKit::ProcessLauncher::launchProcess):
1542         * UIProcess/WebProcessPool.cpp:
1543         (WebKit::WebProcessPool::setCustomWebContentServiceBundleIdentifier):
1544         * UIProcess/WebProcessPool.h:
1545         * UIProcess/WebProcessProxy.cpp:
1546         (WebKit::WebProcessProxy::getLaunchOptions):
1547         * WebKit.xcodeproj/project.pbxproj:
1548
1549 2018-08-07  Chris Dumez  <cdumez@apple.com>
1550
1551         StorageManager should stop ref'ing IPC::Connections as this is leak-prone
1552         https://bugs.webkit.org/show_bug.cgi?id=188380
1553
1554         Reviewed by Alex Christensen.
1555
1556         StorageManager should stop ref'ing IPC::Connections as this is leak-prone. Instead, assign a unique identifier
1557         to each IPC::Connection and store this identifier intead of a RefPtr<IPC::Connection>. When the StorageManager
1558         needs an actual IPC::Connection, it can look it up from the identifier.
1559
1560         * Platform/IPC/Connection.cpp:
1561         (IPC::Connection::Connection):
1562         (IPC::Connection::~Connection):
1563         (IPC::Connection::connection):
1564         * Platform/IPC/Connection.h:
1565         (IPC::Connection::uniqueID const):
1566         * UIProcess/WebStorage/StorageManager.cpp:
1567         (WebKit::StorageManager::StorageArea::addListener):
1568         (WebKit::StorageManager::StorageArea::removeListener):
1569         (WebKit::StorageManager::StorageArea::hasListener const):
1570         (WebKit::StorageManager::StorageArea::setItem):
1571         (WebKit::StorageManager::StorageArea::removeItem):
1572         (WebKit::StorageManager::StorageArea::clear):
1573         (WebKit::StorageManager::StorageArea::dispatchEvents const):
1574         (WebKit::StorageManager::SessionStorageNamespace::allowedConnection const):
1575         (WebKit::StorageManager::SessionStorageNamespace::setAllowedConnection):
1576         (WebKit::StorageManager::setAllowedSessionStorageNamespaceConnection):
1577         (WebKit::StorageManager::processDidCloseConnection):
1578         (WebKit::StorageManager::createLocalStorageMap):
1579         (WebKit::StorageManager::createTransientLocalStorageMap):
1580         (WebKit::StorageManager::createSessionStorageMap):
1581         (WebKit::StorageManager::destroyStorageMap):
1582         (WebKit::StorageManager::setItem):
1583         (WebKit::StorageManager::removeItem):
1584         (WebKit::StorageManager::clear):
1585         (WebKit::StorageManager::applicationWillTerminate):
1586         (WebKit::StorageManager::findStorageArea const):
1587         * UIProcess/WebStorage/StorageManager.h:
1588
1589 2018-08-07  Eric Carlson  <eric.carlson@apple.com>
1590
1591         NotReadableError when calling getUserMedia
1592         https://bugs.webkit.org/show_bug.cgi?id=188309
1593         <rdar://problem/42916838>
1594
1595         Reviewed by Brent Fulgham.
1596
1597         * UIProcess/UserMediaProcessManager.cpp:
1598         (WebKit::UserMediaProcessManager::willCreateMediaStream): Deal with audio and video sandbox
1599         extensions being issued at different times. Use new ProcessState methods.
1600         (WebKit::UserMediaProcessManager::endedCaptureSession): Use new ProcessState methods.
1601
1602 2018-08-07  Wenson Hsieh  <wenson_hsieh@apple.com>
1603
1604         REGRESSION (r233778): Text selection sometimes cannot be extended in iframes
1605         https://bugs.webkit.org/show_bug.cgi?id=188374
1606         <rdar://problem/42928657>
1607
1608         Reviewed by Simon Fraser.
1609
1610         rangeForPoint contains logic for converting a selection handle location in root view coordinates to an updated
1611         selection. In doing so, we first convert the selection handle location to content coordinates; however, the call
1612         site to EventHandler::hitTestResultAtPoint still hit-tests using the location in root view coordinates rather
1613         than content coordinates, which means that when the focused frame is a subframe, hit-testing will fail to find
1614         nodes within the subframe under the selection handle. This manifests in behaviors such as snapping to a single
1615         character when selecting text in subframes.
1616
1617         To fix this, we just need to pass in the point in the frame's content coordinates when hit-testing.
1618
1619         Tests:  editing/selection/ios/selection-handles-in-iframe.html
1620                 editing/selection/ios/selection-handles-in-readonly-input.html
1621
1622         * WebProcess/WebPage/ios/WebPageIOS.mm:
1623         (WebKit::rangeForPointInRootViewCoordinates):
1624
1625         Make a couple of other minor adjustments:
1626         1.  Take a Frame& instead of a Frame*, since Frame& is assumed to be non-null here.
1627         2.  Rename rangeForPoint to rangeForPointInRootViewCoordinates, as well as the point argument to
1628             pointInRootViewCoordinates.
1629
1630         (WebKit::WebPage::updateSelectionWithTouches):
1631         (WebKit::rangeForPoint): Deleted.
1632
1633 2018-08-07  Alex Christensen  <achristensen@webkit.org>
1634
1635         Fix things after r234640
1636         https://bugs.webkit.org/show_bug.cgi?id=188133
1637
1638         * UIProcess/WebFramePolicyListenerProxy.cpp:
1639         (WebKit::WebFramePolicyListenerProxy::use):
1640         (WebKit::WebFramePolicyListenerProxy::download):
1641         (WebKit::WebFramePolicyListenerProxy::ignore):
1642         Fix assertions as I had in r234552.  Also fix a possible race condition with fragment navigations by only keeping the first "use" response.
1643         * config.h:
1644         Fix IOSMAC build.
1645
1646 2018-08-07  Per Arne Vollan  <pvollan@apple.com>
1647
1648         [macOS] Scrollbars are not visible when using 3rd party mouse
1649         https://bugs.webkit.org/show_bug.cgi?id=188372
1650
1651         Reviewed by Simon Fraser.
1652
1653         The scrollbars are not visible because they are not updated with the recommended scroller style
1654         when a 3rd party mouse is used. They still have the overlay style, but the system is
1655         recommending the legacy style in this case. The UI process is currently notifying the WebProcess
1656         about changes in the scroller style, but the current style is not set in the WebProcess on
1657         startup. This patch sets the initial scroller style in the WebProcess by passing it as part of
1658         the WebProcess creation parameters. Also, to make sure hot-plugging of a 3rd party mouse is
1659         is visually changing the scroller style of the current page, a class method in NSScrollerImpPair
1660         is called to update all NSScrollerImpPairs with the new recommended style. This method was
1661         previously called by AppKit, but after blocking WindowServer access, AppKit is no longer calling
1662         this method. This has been manually tested by using a 3rd party mouse.
1663
1664         * Shared/WebProcessCreationParameters.cpp:
1665         (WebKit::WebProcessCreationParameters::encode const):
1666         (WebKit::WebProcessCreationParameters::decode):
1667         * Shared/WebProcessCreationParameters.h:
1668         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1669         (WebKit::WebProcessPool::platformInitializeWebProcess):
1670         * WebProcess/cocoa/WebProcessCocoa.mm:
1671         (WebKit::WebProcess::platformInitializeWebProcess):
1672         (WebKit::WebProcess::scrollerStylePreferenceChanged):
1673
1674 2018-08-06  Andy Estes  <aestes@apple.com>
1675
1676         [Wi-Fi Assertions] suspendWiFiAssertions() should be able to delay sending ProcessReadyToSuspend
1677         https://bugs.webkit.org/show_bug.cgi?id=188373
1678         <rdar://problem/42857398>
1679
1680         Reviewed by Tim Horton.
1681
1682         * NetworkProcess/NetworkProcess.cpp:
1683         (WebKit::NetworkProcess::actualPrepareToSuspend):
1684         * NetworkProcess/NetworkProcess.h:
1685         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1686         (WebKit::NetworkProcess::platformPrepareToSuspend):
1687         (WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
1688         * NetworkProcess/curl/NetworkProcessCurl.cpp:
1689         (WebKit::NetworkProcess::platformPrepareToSuspend):
1690         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1691         (WebKit::NetworkProcess::platformPrepareToSuspend):
1692
1693 2018-08-06  Alex Christensen  <achristensen@webkit.org>
1694
1695         Check with SafeBrowsing during navigation in WKWebView
1696         https://bugs.webkit.org/show_bug.cgi?id=188133
1697
1698         Reviewed by Chris Dumez.
1699
1700         This turns WebFramePolicyListenerProxy into an object that now listens for the results
1701         of two processes happening in parallel: the API::NavigationClient's decidePolicyForNavigation{Action, Response}
1702         (which it was already waiting for) and, on platforms that support it, the SafariSafeBrowsing framework's check.
1703         The first result is stored as it waits for the second result unless the first result is the API::NavigationClient
1704         saying to cancel or convert the navigation to a download, in which cases we don't care what the safe browsing
1705         framework results are because we won't show the URL in the browser.
1706
1707         Nothing is done with the safe browsing results yet.
1708
1709         * UIProcess/Cocoa/SafeBrowsingResultCocoa.mm: Added.
1710         (WebKit::SafeBrowsingResult::SafeBrowsingResult):
1711         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1712         (WebKit::WebPageProxy::beginSafeBrowsingCheck):
1713         * UIProcess/SafeBrowsingResult.h: Added.
1714         (WebKit::SafeBrowsingResult::provider const):
1715         (WebKit::SafeBrowsingResult::isPhishing const):
1716         (WebKit::SafeBrowsingResult::isMalware const):
1717         (WebKit::SafeBrowsingResult::isUnwantedSoftware const):
1718         (WebKit::SafeBrowsingResult::isKnownToBeUnsafe const):
1719         * UIProcess/WebFramePolicyListenerProxy.cpp:
1720         (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
1721         (WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
1722         (WebKit::WebFramePolicyListenerProxy::use):
1723         (WebKit::WebFramePolicyListenerProxy::download):
1724         (WebKit::WebFramePolicyListenerProxy::ignore):
1725         * UIProcess/WebFramePolicyListenerProxy.h:
1726         (WebKit::WebFramePolicyListenerProxy::create):
1727         * UIProcess/WebFrameProxy.cpp:
1728         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
1729         * UIProcess/WebFrameProxy.h:
1730         * UIProcess/WebPageProxy.cpp:
1731         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1732         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
1733         (WebKit::WebPageProxy::decidePolicyForResponse):
1734         * UIProcess/WebPageProxy.h:
1735         * WebKit.xcodeproj/project.pbxproj:
1736
1737 2018-08-06  Chris Dumez  <cdumez@apple.com>
1738
1739         Regression(NetworkLoadChecker): CORS preflights are no longer able to deal with client certificate authentication
1740         https://bugs.webkit.org/show_bug.cgi?id=188355
1741         <rdar://problem/42546319>
1742
1743         Reviewed by Alex Christensen.
1744
1745         Before we started using the NetworkLoadChecker to do CORS-preflighting in the Network process, challenges would
1746         use the NetworkLoad::completeAuthenticationChallenge() code path with isAllowedToAskUserForCredentials to set
1747         to false. This would call:
1748         1. completionHandler(AuthenticationChallengeDisposition::UseCredential, { }); for TLS handshakes (server trust
1749            evaluation & client certification authentication)
1750         2. NetworkProcess::singleton().authenticationManager().didReceiveAuthenticationChallenge() otherwise
1751
1752         However, NetworkCORSPreflightChecker::didReceiveChallenge() was behaving differently and calling:
1753         1. completionHandler(AuthenticationChallengeDisposition::RejectProtectionSpace, { }); for server trust evaluations
1754         2. completionHandler(AuthenticationChallengeDisposition::Cancel, { }); otherwise
1755
1756         Restore previous behavior by aligning NetworkCORSPreflightChecker::didReceiveChallenge() with
1757         NetworkLoad::completeAuthenticationChallenge() when isAllowedToAskUserForCredentials is set to false. This means
1758         we end up asking the AuthenticationManager for client certificate authentication instead or cancelling the
1759         preflight.
1760
1761         This fixes CORS-preflighting on some internal sites.
1762
1763         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
1764         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
1765         * NetworkProcess/NetworkCORSPreflightChecker.h:
1766         * NetworkProcess/NetworkLoadChecker.cpp:
1767         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
1768         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
1769         * NetworkProcess/NetworkLoadChecker.h:
1770         * NetworkProcess/NetworkResourceLoader.cpp:
1771         * NetworkProcess/PingLoad.cpp:
1772         (WebKit::PingLoad::PingLoad):
1773
1774 2018-08-06  Alex Christensen  <achristensen@webkit.org>
1775
1776         Use enum classes and OptionSets for PaintPhase and PaintBehavior
1777         https://bugs.webkit.org/show_bug.cgi?id=188323
1778
1779         Reviewed by Simon Fraser.
1780
1781         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
1782         (WebKit::imageForRect):
1783         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
1784         (WebKit::InjectedBundleRangeHandle::renderedImage):
1785         * WebProcess/Plugins/PluginView.cpp:
1786         (WebKit::PluginView::shouldCreateTransientPaintingSnapshot const):
1787
1788 2018-08-06  Ryan Haddad  <ryanhaddad@apple.com>
1789
1790         Unreviewed, rolling out r234552.
1791
1792         Introduced 2 layout test failures on High Sierra.
1793
1794         Reverted changeset:
1795
1796         "Check with SafeBrowsing during navigation in WKWebView"
1797         https://bugs.webkit.org/show_bug.cgi?id=188133
1798         https://trac.webkit.org/changeset/234552
1799
1800 2018-08-06  Ryan Haddad  <ryanhaddad@apple.com>
1801
1802         Unreviewed, rolling out r234569.
1803
1804         Breaks internal builds.
1805
1806         Reverted changeset:
1807
1808         "We should cache the compiled sandbox profile in a data vault"
1809         https://bugs.webkit.org/show_bug.cgi?id=184991
1810         https://trac.webkit.org/changeset/234569
1811
1812 2018-08-06  Chris Dumez  <cdumez@apple.com>
1813
1814         Fix IPC::Connection leak in StorageManager
1815         https://bugs.webkit.org/show_bug.cgi?id=188321
1816         <rdar://problem/42748485>
1817
1818         Reviewed by Alex Christensen.
1819
1820         When a StorageMap is destroyed on WebContent process side, StorageManager::destroyStorageMap()
1821         gets called via IPC with a (IPC::Connection, StorageMapID) pair. Normally, it removes this
1822         pair from m_storageAreasByConnection. However, if this is a *transient* StorageMap (sessionStorage),
1823         then we keep the pair in the map and we merely remove the StorageMapID as a listener from the
1824         StorageArea. We do this so that:
1825         1. The StorageArea stays alive so that it can be reused later on for the same security origin, on
1826            the same IPC::Connection (logic for this is in StorageManager::createTransientLocalStorageMap()
1827         2. Removing the StorageMapID as a listener from the StorageArea is important because
1828            StorageArea::m_eventListeners holds a strong reference to the IPC::Connection in a std::pair
1829            with the StorageMapID (HashSet<std::pair<RefPtr<IPC::Connection>, uint64_t>> m_eventListeners).
1830
1831         As mentioned in 1 above, in StorageManager::createTransientLocalStorageMap(), there is logic to
1832         check if there is already an existing StorageArea for the given IPC::Connection that is transient
1833         and is for the same security origin. In this case, we could avoid constructing a new StorageArea
1834         and we would:
1835         1. Add a new entry to m_storageAreasByConnection with the key (connection, newStorageMapID), using
1836            same same StorageArea as value.
1837         2. Remove the previous (connection, oldStorageMapID) key from m_storageAreasByConnection.
1838
1839         Step 2 here is wrong and is updated in this patch. It is only safe to remove the previous 
1840         (connection, oldStorageMapID) if this oldStorageMapID no longer exists (i.e. destroyStorageMap()
1841         was already called for it). This patch thus adds a check before removing (connection, oldStorageMapID)
1842         from the HashMap to make sure that the oldStorageMapID is no longer a listener of the StorageArea).
1843
1844         This would cause leaks in the following case:
1845         1. We construct a StorageArea for (connection1, storageMapId1)
1846         2. We ask for a StorageArea for (connection1, storageMapId2) and decide to reuse the existing StorageArea
1847            since it has the same SecurityOrigin.
1848         3. As a result of step2, we would remove (connection1, storageMapId1) from m_storageAreasByConnection
1849            and add (connection1, storageMapId2), even though there is still a StorageMap with storageMapId1
1850            on WebContent process side.
1851         4. Later on, we would try to call destroyStorageMap(connection1, storageMap1), it would fail to find
1852            it in m_storageAreasByConnection and return early. It would therefore fail to remove storageMapId1
1853            as a listener of the StorageArea which still exists.
1854         -> This would leak the IPC::Connection that there would be a std::pair<RefPtr<IPC::Connection>, StorageMapID>
1855            with value (connection1, storageMap1) which would get leaked and it would ref the IPC::Connection.
1856
1857         This code should really be refactored to be less leak prone but I have kept the patch minimal for now
1858         to facilitate cherry-picking.
1859
1860         Note that this would reproduce very easily on sina.com.cn, when clicking bold links at the top, which
1861         opens new tabs to different pages in the same WebContent process. When closing all Safari windows, the
1862         IPC::Connection for this WebContent process would stay alive.
1863
1864         * UIProcess/WebStorage/StorageManager.cpp:
1865         (WebKit::StorageManager::StorageArea::hasListener const):
1866         (WebKit::StorageManager::createTransientLocalStorageMap):
1867
1868 2018-08-06  Alex Christensen  <achristensen@webkit.org>
1869
1870         Make BlendMode an enum class
1871         https://bugs.webkit.org/show_bug.cgi?id=188325
1872
1873         Reviewed by Darin Adler.
1874
1875         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
1876         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
1877
1878 2018-08-06  Wenson Hsieh  <wenson_hsieh@apple.com>
1879
1880         [iOS] Caret disappears after resigning and becoming first responder if active focus state is retained
1881         https://bugs.webkit.org/show_bug.cgi?id=188322
1882         <rdar://problem/42455270>
1883
1884         Reviewed by Tim Horton.
1885
1886         Prior to r230745, when a user selects a word in non-editable web content without a prior selection, we would
1887         always try to activate the text interaction assistant, creating a selection view (a UITextSelectionView). After
1888         the long press is recognized, this text selection view is configured for "highlight mode", which is a special
1889         mode for presenting selection UI where the grabber handles at the start and end of the selection are suppressed.
1890         UIKit then prepares to show the selection by asking WKContentView for the number of selection rects; if this
1891         number is zero, the UITextSelectionView is removed from the superview, and state that keeps track of whether the
1892         selection view is in "highlight mode" is reset.
1893
1894         In the case where there's no prior selection, our cached EditorState in the UI process will not be up to date
1895         yet when the gesture is recognized. This means that when UIKit asks us for the number of selection rects, we'll
1896         return 0, which causes any state tracking "highlight mode" for the selection to be reset, subsequently resulting
1897         in selection handles showing up before the user has ended the initial loupe gesture.
1898
1899         r230745 addressed this bug by removing logic to activate the text selection when becoming first responder,
1900         instead deferring until the next `-_selectionChanged` call with post-layout editor state data to activate the
1901         selection. While this does ensure that selection handles don't erroneously appear, it also means that clients
1902         that call -becomeFirstResponder to show selection UI and the keyboard in a web view while an element is already
1903         focused will not have an active selection assistant (i.e. the selection view will still be hidden). One way this
1904         happens is when Safari uses `-_retainActiveFocusedState` in combination with `-resignFirstResponder` and
1905         `-becomeFirstResponder` to temporarily switch focus away from the web view when the URL bar is tapped.
1906
1907         To fix both the inactive selection after `-becomeFirstResponder` as well as the selection handles showing up
1908         when performing a loupe gesture, we simply make the check in `-becomeFirstResponderForWebView` more nuanced.
1909         Instead of always activating the selection or never activating the selection, only activate the selection if the
1910         current editor state has information about a selection to avoid causing the selection view to be immediately
1911         removed and "highlight mode" to be reset when selecting a word via loupe gesture for the first time.
1912
1913         Tests:  KeyboardInputTests.CaretSelectionRectAfterRestoringFirstResponder
1914                 KeyboardInputTests.RangedSelectionRectAfterRestoringFirstResponder
1915                 editing/selection/ios/selection-handles-after-touch-end.html
1916
1917         * UIProcess/ios/WKContentViewInteraction.mm:
1918         (-[WKContentView becomeFirstResponderForWebView]):
1919         (-[WKContentView canShowNonEmptySelectionView]):
1920
1921 2018-08-06  Zan Dobersek  <zdobersek@igalia.com>
1922
1923         [Nicosia] Add Nicosia::Scene
1924         https://bugs.webkit.org/show_bug.cgi?id=188340
1925
1926         Reviewed by Carlos Garcia Campos.
1927
1928         CompositingCoordinator spawns a Nicosia::Scene object that it shares
1929         with the CoordinatedGraphicsSceneState instance. All the
1930         Nicosia::CompositionLayer objects indirectly managed by
1931         CompositingCoordinator are now stored in a local Nicosia::Scene::State
1932         member object. Upon each flush that requires frame synchronization the
1933         Nicosia::Scene object is updated in a thread-safe manner, increasing
1934         the scene ID value as well as copying the local HashSet and root layer
1935         values into the shared Scene object, allowing for the consumer (which
1936         currently is the related CoordinatedGraphicsScene instance) to update
1937         its output accordingly.
1938
1939         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1940         (WebKit::CompositingCoordinator::CompositingCoordinator):
1941         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
1942         (WebKit::CompositingCoordinator::initializeRootCompositingLayerIfNeeded):
1943         (WebKit::CompositingCoordinator::createGraphicsLayer):
1944         (WebKit::CompositingCoordinator::detachLayer):
1945         (WebKit::CompositingCoordinator::attachLayer):
1946         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1947
1948 2018-08-05  Yusuke Suzuki  <utatane.tea@gmail.com>
1949
1950         Add support for microtasks in workers
1951         https://bugs.webkit.org/show_bug.cgi?id=188246
1952
1953         Reviewed by Darin Adler.
1954
1955         Rename JSMainThreadExecState.h to JSExecState.h.
1956
1957         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
1958         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.cpp:
1959         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
1960         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
1961         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
1962         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
1963         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
1964         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
1965         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
1966         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
1967         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
1968         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
1969         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:
1970         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
1971         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
1972         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
1973         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
1974         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
1975         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
1976         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
1977         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementGtk.cpp:
1978         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
1979         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
1980         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
1981         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
1982         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
1983         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
1984         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
1985         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
1986         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
1987         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
1988         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
1989         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
1990         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
1991         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
1992         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
1993         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
1994         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
1995         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
1996         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
1997         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
1998         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
1999         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
2000         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
2001         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
2002         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
2003         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
2004         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
2005         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
2006         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
2007         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
2008         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
2009         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
2010         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
2011         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
2012         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
2013         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
2014         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
2015         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
2016         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
2017         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
2018         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
2019         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
2020         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
2021         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp:
2022         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
2023         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
2024         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
2025         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
2026         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
2027         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
2028         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
2029         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
2030         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
2031         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
2032         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
2033         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
2034         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
2035         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
2036         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
2037         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
2038         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp:
2039         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
2040         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp:
2041         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
2042         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeGtk.cpp:
2043         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp:
2044         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp:
2045         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
2046         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
2047         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp:
2048         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp:
2049         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
2050         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp:
2051         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp:
2052         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
2053         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp:
2054         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolver.cpp:
2055         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
2056
2057 2018-08-03  Ben Richards  <benton_richards@apple.com>
2058
2059         We should cache the compiled sandbox profile in a data vault
2060         https://bugs.webkit.org/show_bug.cgi?id=184991
2061
2062         Reviewed by Ryosuke Niwa.
2063
2064         This patch changes a few things (note: data vaults and sandbox entitlements are only used in internal builds):
2065         (1) Instead of compiling a sandbox every time a process is launched, processes now look for a cached sandbox
2066             in a process specific data vault on macOS platforms. (ChildProcessMac.mm)
2067         (2) If a valid cached sandbox is not found, a process will create the data vault (or ensure that it exists),
2068             compile a sandbox, and cache it.
2069         (3) In order to create process specific data vaults, each process now has their own <process name>-OSX-sandbox.entitlements
2070             file which contains an entitlement with a process specific "storage class" which ensures that each process
2071             can only ever access its own data vault. (See the article on confluence "Data Vaults and Restricted Files" for more info)
2072         (4) The sandbox entitlements file for the Network, WebContent and Plugin services are loaded dynamically
2073             through Scripts/<process name>-process-entitlements.sh which is triggered in a new build phase for each service.
2074             The Storage process sandbox entitlements are loaded directly in Configurations/StorageService.xcconfig.
2075             The reason that the sandbox entitlements are applied dynamically is so that these sandbox entitlements
2076             are only applied when WK_USE_RESTRICTED_ENTITLEMENTS is YES. This means that open source builds will still work.
2077
2078         * Configurations/Network-OSX-sandbox.entitlements: Added.
2079         * Configurations/Plugin-OSX-sandbox.entitlements: Added.
2080         * Configurations/Storage-OSX-sandbox.entitlements: Added.
2081         * Configurations/StorageService.xcconfig:
2082         * Configurations/WebContent-OSX-sandbox.entitlements: Added.
2083         * Configurations/WebKit.xcconfig:
2084         * NetworkProcess/NetworkProcess.h:
2085         * PluginProcess/PluginProcess.h:
2086         * Scripts/process-network-entitlements.sh: Added.
2087         * Scripts/process-plugin-entitlements.sh: Added.
2088         * Scripts/process-webcontent-entitlements.sh:
2089         * Shared/ChildProcess.h:
2090         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
2091         (WebKit::XPCServiceInitializer):
2092         * Shared/SandboxInitializationParameters.h:
2093         (WebKit::SandboxInitializationParameters::setOverrideSandboxProfilePath):
2094         (WebKit::SandboxInitializationParameters::overrideSandboxProfilePath const):
2095         (WebKit::SandboxInitializationParameters::setSandboxProfile):
2096         (WebKit::SandboxInitializationParameters::sandboxProfile const):
2097         (): Deleted.
2098         * Shared/mac/ChildProcessMac.mm:
2099         (WebKit::SandboxProfileDeleter::operator()):
2100         (WebKit::SandboxParametersDeleter::operator()):
2101         (WebKit::SandboxInfo::SandboxInfo):
2102         (WebKit::fileContents):
2103         (WebKit::processStorageClass):
2104         (WebKit::setAndSerializeSandboxParameters):
2105         (WebKit::getUserCacheDirectory):
2106         (WebKit::sandboxDataVaultParentDirectory):
2107         (WebKit::sandboxDirectory):
2108         (WebKit::sandboxFilePath):
2109         (WebKit::ensureSandboxCacheDirectory):
2110         (WebKit::writeSandboxDataToCacheFile):
2111         (WebKit::compileAndCacheSandboxProfile):
2112         (WebKit::tryApplyCachedSandbox):
2113         (WebKit::webKit2Bundle):
2114         (WebKit::sandboxProfilePath):
2115         (WebKit::compileAndApplySandboxSlowCase):
2116         (WebKit::applySandbox):
2117         (WebKit::initializeSandboxParameters):
2118         (WebKit::ChildProcess::initializeSandbox):
2119         * Shared/mac/SandboxInitialiationParametersMac.mm:
2120         (WebKit::SandboxInitializationParameters::SandboxInitializationParameters):
2121         * StorageProcess/StorageProcess.h:
2122         * WebKit.xcodeproj/project.pbxproj:
2123         * WebProcess/WebProcess.h:
2124
2125 2018-08-03  Alex Christensen  <achristensen@webkit.org>
2126
2127         Fix spelling of "overridden"
2128         https://bugs.webkit.org/show_bug.cgi?id=188315
2129
2130         Reviewed by Darin Adler.
2131
2132         * Platform/IPC/mac/ConnectionMac.mm:
2133         (IPC::Connection::receiveSourceEventHandler):
2134         * Shared/WebPreferencesStore.cpp:
2135         (WebKit::WebPreferencesStore::encode const):
2136         (WebKit::WebPreferencesStore::decode):
2137         (WebKit::valueForKey):
2138         (WebKit::setValueForKey):
2139         (WebKit::WebPreferencesStore::setStringValueForKey):
2140         (WebKit::WebPreferencesStore::getStringValueForKey const):
2141         (WebKit::WebPreferencesStore::setBoolValueForKey):
2142         (WebKit::WebPreferencesStore::getBoolValueForKey const):
2143         (WebKit::WebPreferencesStore::setUInt32ValueForKey):
2144         (WebKit::WebPreferencesStore::getUInt32ValueForKey const):
2145         (WebKit::WebPreferencesStore::setDoubleValueForKey):
2146         (WebKit::WebPreferencesStore::getDoubleValueForKey const):
2147         (WebKit::WebPreferencesStore::setOverrideDefaultsStringValueForKey):
2148         (WebKit::WebPreferencesStore::setOverrideDefaultsBoolValueForKey):
2149         (WebKit::WebPreferencesStore::setOverrideDefaultsUInt32ValueForKey):
2150         (WebKit::WebPreferencesStore::setOverrideDefaultsDoubleValueForKey):
2151         * Shared/WebPreferencesStore.h:
2152         * UIProcess/ios/WKContentViewInteraction.mm:
2153         (-[WKContentView dragInteraction:previewForLiftingItem:session:]):
2154         (-[WKContentView dragInteraction:previewForCancellingItem:withDefault:]):
2155         * UIProcess/ios/WKScrollView.mm:
2156         (-[WKScrollView _systemContentInset]):
2157
2158 2018-08-03  David Fenton  <david_fenton@apple.com>
2159
2160         Unreviewed, rolling out r234517.
2161
2162         Caused API test failures on iOS
2163
2164         Reverted changeset:
2165
2166         "[Cocoa] setCookie API fails to set session cookies for
2167         defaultDataStore if processPool created but not used"
2168         https://bugs.webkit.org/show_bug.cgi?id=188209
2169         https://trac.webkit.org/changeset/234517
2170
2171 2018-08-03  Ben Richards  <benton_richards@apple.com>
2172
2173         Add configuration for automatic process pre-warming
2174         https://bugs.webkit.org/show_bug.cgi?id=187108
2175
2176         Reviewed by Ryosuke Niwa.
2177
2178         Added configurations to allow setting the maximum number of processes that should be automatically prewarmed.
2179
2180         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2181         (API::ProcessPoolConfiguration::copy):
2182         * UIProcess/API/APIProcessPoolConfiguration.h:
2183         * UIProcess/API/C/WKContext.cpp:
2184         (WKContextSetMaximumNumberOfPrewarmedProcesses):
2185         * UIProcess/API/C/WKContextPrivate.h:
2186         * UIProcess/API/Cocoa/WKProcessPool.mm:
2187         (-[WKProcessPool _setMaximumNumberOfPrewarmedProcesses:]):
2188         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2189         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2190         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2191         (-[_WKProcessPoolConfiguration setMaximumPrewarmedProcessCount:]):
2192         (-[_WKProcessPoolConfiguration maximumPrewarmedProcessCount]):
2193         * UIProcess/WebPageProxy.cpp:
2194         (WebKit::WebPageProxy::didFinishLoadForFrame): Moved call to notifyProcessPoolToPrewarm from didFirstVisuallyNonEmptyLayoutForFrame to here.
2195         This is to try to ensure that frame loading and prewarming don't happen at the same time as this would be heavy for some devices.
2196         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
2197         * UIProcess/WebProcessPool.cpp:
2198         (WebKit::WebProcessPool::setMaximumNumberOfProcesses): Condition changed so that calling setMaximumNumberOfProcesses after warmInitialProcess
2199         doesn't result in a crash.
2200         (WebKit::WebProcessPool::setMaximumNumberOfPrewarmedProcesses):
2201         (WebKit::WebProcessPool::warmInitialProcess):
2202         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
2203         * UIProcess/WebProcessPool.h:
2204
2205 2018-08-03  Alex Christensen  <achristensen@webkit.org>
2206
2207         Check with SafeBrowsing during navigation in WKWebView
2208         https://bugs.webkit.org/show_bug.cgi?id=188133
2209
2210         Reviewed by Chris Dumez.
2211
2212         This turns WebFramePolicyListenerProxy into an object that now listens for the results
2213         of two processes happening in parallel: the API::NavigationClient's decidePolicyForNavigation{Action, Response}
2214         (which it was already waiting for) and, on platforms that support it, the SafariSafeBrowsing framework's check.
2215         The first result is stored as it waits for the second result unless the first result is the API::NavigationClient
2216         saying to cancel or convert the navigation to a download, in which cases we don't care what the safe browsing
2217         framework results are because we won't show the URL in the browser.
2218
2219         Nothing is done with the safe browsing results yet.
2220
2221         * UIProcess/Cocoa/SafeBrowsingResultCocoa.mm: Added.
2222         (WebKit::SafeBrowsingResult::SafeBrowsingResult):
2223         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2224         (WebKit::WebPageProxy::beginSafeBrowsingCheck):
2225         * UIProcess/SafeBrowsingResult.h: Added.
2226         (WebKit::SafeBrowsingResult::provider const):
2227         (WebKit::SafeBrowsingResult::isPhishing const):
2228         (WebKit::SafeBrowsingResult::isMalware const):
2229         (WebKit::SafeBrowsingResult::isUnwantedSoftware const):
2230         (WebKit::SafeBrowsingResult::isKnownToBeUnsafe const):
2231         * UIProcess/WebFramePolicyListenerProxy.cpp:
2232         (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
2233         (WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
2234         (WebKit::WebFramePolicyListenerProxy::use):
2235         (WebKit::WebFramePolicyListenerProxy::download):
2236         (WebKit::WebFramePolicyListenerProxy::ignore):
2237         * UIProcess/WebFramePolicyListenerProxy.h:
2238         (WebKit::WebFramePolicyListenerProxy::create):
2239         * UIProcess/WebFrameProxy.cpp:
2240         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
2241         * UIProcess/WebFrameProxy.h:
2242         * UIProcess/WebPageProxy.cpp:
2243         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2244         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
2245         (WebKit::WebPageProxy::decidePolicyForResponse):
2246         * UIProcess/WebPageProxy.h:
2247         * WebKit.xcodeproj/project.pbxproj:
2248
2249 2018-08-03  Ryan Haddad  <ryanhaddad@apple.com>
2250
2251         Unreviewed, rolling out r234513.
2252
2253         14 API tests fail the assertions added in this change.
2254
2255         Reverted changeset:
2256
2257         "Check with SafeBrowsing during navigation in WKWebView"
2258         https://bugs.webkit.org/show_bug.cgi?id=188133
2259         https://trac.webkit.org/changeset/234513
2260
2261 2018-08-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2262
2263         [WPE] WebDriver: add support for action commands
2264         https://bugs.webkit.org/show_bug.cgi?id=188301
2265
2266         Reviewed by Žan Doberšek.
2267
2268         WPE doesn't support action commands because the platform specific code for handling events is not implemented.
2269
2270         * SourcesWPE.txt: Add new file to compilation.
2271         * UIProcess/API/glib/WebKitUIClient.cpp: Use the drawing area size as window size in WPE.
2272         * UIProcess/API/wpe/PageClientImpl.cpp:
2273         (WebKit::PageClientImpl::viewBackend): Return the WPE backend of the view.
2274         * UIProcess/API/wpe/PageClientImpl.h:
2275         * UIProcess/Automation/WebAutomationSession.cpp:
2276         (WebKit::WebAutomationSession::performMouseInteraction):
2277         (WebKit::WebAutomationSession::performKeyboardInteractions):
2278         (WebKit::WebAutomationSession::performInteractionSequence):
2279         (WebKit::WebAutomationSession::cancelInteractionSequence):
2280         * UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp: Added.
2281         (WebKit::modifiersToEventState):
2282         (WebKit::mouseButtonToWPEButton):
2283         (WebKit::stateModifierForWPEButton):
2284         (WebKit::doMouseEvent):
2285         (WebKit::doMotionEvent):
2286         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
2287         (WebKit::doKeyStrokeEvent):
2288         (WebKit::keyCodeForVirtualKey):
2289         (WebKit::modifiersForKeyCode):
2290         (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
2291         (WebKit::WebAutomationSession::platformSimulateKeySequence):
2292         * UIProcess/WebPageProxy.h:
2293         * UIProcess/wpe/WebPageProxyWPE.cpp:
2294         (WebKit::WebPageProxy::viewBackend): Return the WPE backend.
2295
2296 2018-08-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2297
2298         [WPE] Implement MouseEvent.buttons
2299         https://bugs.webkit.org/show_bug.cgi?id=187998
2300
2301         Reviewed by Žan Doberšek.
2302
2303         Pass buttons currently pressed to WebMouseEvent.
2304
2305         * Shared/wpe/WebEventFactory.cpp:
2306         (WebKit::pressedMouseButtons): Helper to get the pressed buttons mask for the WPE modifiers.
2307         (WebKit::WebEventFactory::createWebMouseEvent): Use pressedMouseButtons().
2308         * UIProcess/API/wpe/PageClientImpl.cpp:
2309         (WebKit::PageClientImpl::doneWithTouchEvent): Update the event modifiers.
2310
2311 2018-08-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2312
2313         [WPE] Use WPE key symbols and new API instead of xkbcommon and the key mapper
2314         https://bugs.webkit.org/show_bug.cgi?id=188093
2315
2316         Reviewed by Žan Doberšek.
2317
2318         * Shared/WebEvent.h: Add WebKeyboardEvent constructor for WPE.
2319         * Shared/WebKeyboardEvent.cpp:
2320         (WebKit::WebKeyboardEvent::WebKeyboardEvent): WebKeyboardEvent constructor for WPE.
2321         * Shared/wpe/WebEventFactory.cpp:
2322         (WebKit::isWPEKeyCodeFromKeyPad): Helper tpo check if a key symbols is from key pad.
2323         (WebKit::WebEventFactory::createWebKeyboardEvent): Use PlatformKeyboardEvent API to provide key code, hardware
2324         key code, key identifier and windows key code to WebKeyboardEvent.
2325         * UIProcess/API/wpe/WPEView.cpp:
2326         (WKWPE::m_backend): Use WPE key symbols.
2327
2328 2018-08-02  Tim Horton  <timothy_horton@apple.com>
2329
2330         PDFPlugin: Context menus in RTL are left-aligned
2331         https://bugs.webkit.org/show_bug.cgi?id=188292
2332         <rdar://problem/32293787>
2333
2334         Reviewed by Simon Fraser.
2335
2336         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
2337         Add some SPI.
2338
2339         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2340         (WebKit::PDFPlugin::handleContextMenuEvent):
2341         Translate UI layout direction back into the platform enum, and pass it to PDFKit.
2342
2343         * WebProcess/WebPage/WebPage.h:
2344         (WebKit::WebPage::userInterfaceLayoutDirection const):
2345         Add a getter for UI layout direction.
2346
2347 2018-08-02  Chris Dumez  <cdumez@apple.com>
2348
2349         Regression(r234486): assertion hit in ~CallbackAggregator()
2350         https://bugs.webkit.org/show_bug.cgi?id=188283
2351         <rdar://problem/42851342>
2352
2353         Reviewed by Alex Christensen.
2354
2355         [NSHTTPCookieStorage _saveCookies:] SPI may call its completion block on the background queue
2356         so we need to make sure we dispatch back to the main thread before calling our completion
2357         handler.
2358
2359         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2360         (WebKit::saveCookies):
2361         (WebKit::NetworkProcess::platformSyncAllCookies):
2362
2363 2018-08-02  Alex Christensen  <achristensen@webkit.org>
2364
2365         Fix some builds after r234516
2366         ​https://bugs.webkit.org/show_bug.cgi?id=188250
2367
2368         * Platform/IPC/ArgumentCoders.h:
2369         This assertion was comparing integers of different signs.
2370         Since we don't allow exception throwing in WebKit, valueless_by_exception won't be true,
2371         so this assertion will always be true.  I'll just remove it.
2372
2373 2018-08-02  Sihui Liu  <sihui_liu@apple.com>
2374
2375         httpCookieStore.getAllCookies() does not always call completion block
2376         https://bugs.webkit.org/show_bug.cgi?id=188242
2377
2378         Reviewed by Chris Dumez.
2379
2380         Take background assertion for network process to keep it alive during cookieStore API calls.
2381
2382         * UIProcess/GenericCallback.h:
2383         * UIProcess/WebCookieManagerProxy.cpp:
2384         (WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
2385         (WebKit::WebCookieManagerProxy::deleteCookie):
2386         (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince):
2387         (WebKit::WebCookieManagerProxy::setCookie):
2388         (WebKit::WebCookieManagerProxy::setCookies):
2389         (WebKit::WebCookieManagerProxy::getAllCookies):
2390         (WebKit::WebCookieManagerProxy::getCookies):
2391         (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
2392         (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
2393
2394 2018-08-02  Sihui Liu  <sihui_liu@apple.com>
2395
2396         [Cocoa] setCookie API fails to set session cookies for defaultDataStore if processPool created but not used
2397         https://bugs.webkit.org/show_bug.cgi?id=188209
2398
2399         Reviewed by Geoffrey Garen.
2400
2401         If defaultDataStore is already created when launching network process, it means user 
2402         probably set cookies for default session via API, so we should update m_websiteDataStore to 
2403         make sure pendingCookies is passed to network process.
2404
2405         * UIProcess/WebProcessPool.cpp:
2406         (WebKit::WebProcessPool::ensureNetworkProcess):
2407
2408 2018-08-02  Alex Christensen  <achristensen@webkit.org>
2409
2410         Use WTF::Variant for WebPreferencesStore::Value
2411         https://bugs.webkit.org/show_bug.cgi?id=188250
2412
2413         Reviewed by Sam Weinig.
2414
2415         It was conceptually a variant. This just uses an actual WTF::Variant.
2416         Since it's encoded and decoded, I wrote variadic template encoders and decoders
2417         like we have for other types (Expected, std::tuple, KeyValuePair, etc.)
2418
2419         * Platform/IPC/ArgumentCoders.h:
2420         (IPC::VariantCoder::encode):
2421         (IPC::VariantCoder::decode):
2422         Introduce ArgumentCoder<Variant>, which encodes which type the Variant currently
2423         holds followed by the encoding of the current type.
2424         * Platform/IPC/Decoder.cpp:
2425         (IPC::Decoder::Decoder):
2426         * Platform/IPC/Decoder.h:
2427         * Platform/IPC/mac/ConnectionMac.mm:
2428         (IPC::createMessageDecoder):
2429         Use move semantics to prevent an unnecessary copy of the Vector<Attachment>
2430         * Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb:
2431         * Shared/WebPreferencesStore.cpp:
2432         (WebKit::WebPreferencesStore::decode):
2433         Use modern std::optional-based decoding supported by the new Variant decoding.
2434         (WebKit::valueForKey):
2435         Use WTF::get and WTF::holds_alternative instead of custom type checks.
2436         (WebKit::WebPreferencesStore::Value::encode const): Deleted.
2437         (WebKit::WebPreferencesStore::Value::decode): Deleted.
2438         (WebKit::as<String>): Deleted.
2439         (WebKit::as<bool>): Deleted.
2440         (WebKit::as<uint32_t>): Deleted.
2441         (WebKit::as<double>): Deleted.
2442         * Shared/WebPreferencesStore.h:
2443         (WebKit::WebPreferencesStore::Value::Value): Deleted.
2444         (WebKit::WebPreferencesStore::Value::operator=): Deleted.
2445         (WebKit::WebPreferencesStore::Value::~Value): Deleted.
2446         (WebKit::WebPreferencesStore::Value::type const): Deleted.
2447         (WebKit::WebPreferencesStore::Value::asString const): Deleted.
2448         (WebKit::WebPreferencesStore::Value::asBool const): Deleted.
2449         (WebKit::WebPreferencesStore::Value::asUInt32 const): Deleted.
2450         (WebKit::WebPreferencesStore::Value::asDouble const): Deleted.
2451         (WebKit::WebPreferencesStore::Value::destroy): Deleted.
2452         (): Deleted.
2453         Use WTF::Variant instead of a custom type/union pair.
2454
2455 2018-08-02  Alex Christensen  <achristensen@webkit.org>
2456
2457         Check with SafeBrowsing during navigation in WKWebView
2458         https://bugs.webkit.org/show_bug.cgi?id=188133
2459
2460         Reviewed by Chris Dumez.
2461
2462         This turns WebFramePolicyListenerProxy into an object that now listens for the results
2463         of two processes happening in parallel: the API::NavigationClient's decidePolicyForNavigation{Action, Response}
2464         (which it was already waiting for) and, on platforms that support it, the SafariSafeBrowsing framework's check.
2465         The first result is stored as it waits for the second result unless the first result is the API::NavigationClient
2466         saying to cancel or convert the navigation to a download, in which cases we don't care what the safe browsing
2467         framework results are because we won't show the URL in the browser.
2468
2469         Nothing is done with the safe browsing results yet.
2470
2471         * UIProcess/Cocoa/SafeBrowsingResultCocoa.mm: Added.
2472         (WebKit::SafeBrowsingResult::SafeBrowsingResult):
2473         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2474         (WebKit::WebPageProxy::beginSafeBrowsingCheck):
2475         * UIProcess/SafeBrowsingResult.h: Added.
2476         (WebKit::SafeBrowsingResult::provider const):
2477         (WebKit::SafeBrowsingResult::isPhishing const):
2478         (WebKit::SafeBrowsingResult::isMalware const):
2479         (WebKit::SafeBrowsingResult::isUnwantedSoftware const):
2480         (WebKit::SafeBrowsingResult::isKnownToBeUnsafe const):
2481         * UIProcess/WebFramePolicyListenerProxy.cpp:
2482         (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
2483         (WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
2484         (WebKit::WebFramePolicyListenerProxy::use):
2485         (WebKit::WebFramePolicyListenerProxy::download):
2486         (WebKit::WebFramePolicyListenerProxy::ignore):
2487         * UIProcess/WebFramePolicyListenerProxy.h:
2488         (WebKit::WebFramePolicyListenerProxy::create):
2489         * UIProcess/WebFrameProxy.cpp:
2490         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
2491         * UIProcess/WebFrameProxy.h:
2492         * UIProcess/WebPageProxy.cpp:
2493         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2494         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
2495         (WebKit::WebPageProxy::decidePolicyForResponse):
2496         * UIProcess/WebPageProxy.h:
2497         * WebKit.xcodeproj/project.pbxproj:
2498
2499 2018-08-02  Wenson Hsieh  <wenson_hsieh@apple.com>
2500
2501         [iOS] Keyboard becomes unresponsive after pressing delete while pressing down on a character key with accents
2502         https://bugs.webkit.org/show_bug.cgi?id=188251
2503         <rdar://problem/37842108>
2504
2505         Reviewed by Tim Horton.
2506
2507         Fixes a bug in key event handling where invoking -handleKeyWebEvent:withCompletionHandler: from within the
2508         completion callback of a previous call to -handleKeyWebEvent:withCompletionHandler: would cause the completion
2509         callback to be cleared out prematurely. In some cases (as described in the title of this bug), UIKit exercises
2510         this codepath and subsequently hangs due to their completion block never getting invoked by WebKit.
2511
2512         Test: KeyboardInputTests.CanHandleKeyEventInCompletionHandler
2513
2514         * UIProcess/ios/WKContentViewInteraction.h:
2515         * UIProcess/ios/WKContentViewInteraction.mm:
2516         (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
2517         (-[WKContentView _didHandleKeyEvent:eventWasHandled:]):
2518
2519 2018-08-01  Dan Bernstein  <mitz@apple.com>
2520
2521         Optionally expose Attr::style to JavaScript
2522         https://bugs.webkit.org/show_bug.cgi?id=188226
2523         <rdar://problem/42818113>
2524
2525         Reviewed by Darin Adler.
2526
2527         * Shared/WebProcessCreationParameters.cpp:
2528         (WebKit::WebProcessCreationParameters::encode const): Encode new attrStyleEnabled member.
2529         (WebKit::WebProcessCreationParameters::decode): Decode new attrStyleEnabled member.
2530         * Shared/WebProcessCreationParameters.h: Define new attrStyleEnabled member, initialized to
2531           false.
2532
2533         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2534         (API::ProcessPoolConfiguration::copy): Copy new m_attrStyleEnabled member.
2535         * UIProcess/API/APIProcessPoolConfiguration.h: Define new m_attrStyleEnabled member.
2536
2537         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: Declare new attrStyleEnabled boolean
2538           property.
2539         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2540         (-[_WKProcessPoolConfiguration attrStyleEnabled]): New accessor.
2541         (-[_WKProcessPoolConfiguration setAttrStyleEnabled:]): Ditto.
2542
2543         * UIProcess/WebProcessPool.cpp:
2544         (WebKit::WebProcessPool::initializeNewWebProcess): Initialize parameters.attrStyleEnabled
2545           from the configuration.
2546
2547         * WebProcess/WebProcess.cpp:
2548         (WebKit::WebProcess::initializeWebProcess): Set the attrStyleEnabled runtime feature based
2549           on the creation parameters.
2550
2551 2018-08-02  David Fenton  <david_fenton@apple.com>
2552
2553         Unreviewed, rolling out r234489.
2554
2555         Caused 50+ crashes and 60+ API failures on iOS
2556
2557         Reverted changeset:
2558
2559         "[WTF] Rename String::format to String::deprecatedFormat"
2560         https://bugs.webkit.org/show_bug.cgi?id=188191
2561         https://trac.webkit.org/changeset/234489
2562
2563 2018-08-01  Tomas Popela  <tpopela@redhat.com>
2564
2565         [WTF] Rename String::format to String::deprecatedFormat
2566         https://bugs.webkit.org/show_bug.cgi?id=188191
2567
2568         Reviewed by Darin Adler.
2569
2570         It should be replaced with string concatenation.
2571
2572         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2573         (WebKit::buildAcceptLanguages):
2574         * Platform/IPC/win/ConnectionWin.cpp:
2575         (IPC::Connection::createServerAndClientIdentifiers):
2576         * Shared/WebMemorySampler.cpp:
2577         (WebKit::WebMemorySampler::writeHeaders):
2578         * Shared/win/WebEventFactory.cpp:
2579         (WebKit::keyIdentifierFromEvent):
2580         * Shared/wpe/WebEventFactory.cpp:
2581         (WebKit::identifierStringForKeyEvent):
2582         * UIProcess/API/APINavigation.cpp:
2583         (API::Navigation::loggingString const):
2584         * UIProcess/API/glib/IconDatabase.cpp:
2585         (WebKit::IconDatabase::performURLImport):
2586         * UIProcess/Cocoa/ViewGestureController.cpp:
2587         (WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog):
2588         * UIProcess/SuspendedPageProxy.cpp:
2589         (WebKit::SuspendedPageProxy::loggingString const):
2590         * UIProcess/WebBackForwardList.cpp:
2591         (WebKit::WebBackForwardList::loggingString):
2592         * UIProcess/WebInspectorUtilities.cpp:
2593         (WebKit::inspectorPageGroupIdentifierForPage):
2594         * UIProcess/WebProcessPool.cpp:
2595         (WebKit::WebProcessPool::processDidFinishLaunching):
2596         (WebKit::WebProcessPool::startMemorySampler):
2597         * UIProcess/gtk/InputMethodFilter.cpp:
2598         (WebKit::InputMethodFilter::logHandleKeyboardEventForTesting):
2599         (WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting):
2600         (WebKit::InputMethodFilter::logConfirmCompositionForTesting):
2601         (WebKit::InputMethodFilter::logSetPreeditForTesting):
2602
2603 2018-08-01  Tim Horton  <timothy_horton@apple.com>
2604
2605         Using the keyboard arrow keys to scroll a webpage is very slow, not smooth, takes too long
2606         https://bugs.webkit.org/show_bug.cgi?id=188239
2607         <rdar://problem/22997654>
2608
2609         Reviewed by Simon Fraser.
2610
2611         Instead of depending on key repeat to drive scrolling with arrow keys held down,
2612         run a display link that animates the scroll. We still do a single discrete scroll
2613         first (so that you can tap the key and shift by line/page), but then on the first
2614         repeat we ramp up to a constant velocity determined by the desired increment,
2615         stopping when the key is lifted or a different key is pressed.
2616
2617         * UIProcess/API/Cocoa/WKWebView.mm:
2618         (-[WKWebView _scrollByContentOffset:animated:]):
2619         (-[WKWebView _scrollByContentOffset:]): Deleted.
2620         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2621         Add animated parameter to scrollByContentOffset, and plumb it through to UIScrollView.
2622
2623         * UIProcess/ios/WKContentViewInteraction.h:
2624         Add a WKKeyboardScrollingAnimator member.
2625         Conform to WKKeyboardScrollable.
2626
2627         * UIProcess/ios/WKContentViewInteraction.mm:
2628         (-[WKContentView setupInteraction]):
2629         Install the WKKeyboardScrollingAnimator.
2630
2631         (-[WKContentView cleanupInteraction]):
2632         Uninstall the WKKeyboardScrollingAnimator.
2633
2634         (-[WKContentView unscaledView]):
2635         Fix a stupid style nit.
2636
2637         (-[WKContentView handleKeyWebEvent:]):
2638         Give WKKeyboardScrollingAnimator the first shot at incoming keyboard events.
2639         It will only consume events here if it's already performing a scrolling animation
2640         (because otherwise they should go straight through to the page).
2641
2642         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
2643         Give WKKeyboardScrollingAnimator a shot at handling keyboard events that
2644         the web content did not handle. We will only start a scrolling animation
2645         if the page did not handle an event that would start a scroll.
2646
2647         (-[WKContentView isKeyboardScrollable]):
2648         Part of WKKeyboardScrollable; only report ourselves as scrollable if
2649         we would previously have allowed scrolling from keyboard events (if
2650         we're not in contenteditable, and don't have a <select> focused).
2651
2652         (-[WKContentView distanceForScrollingIncrement:]):
2653         Part of WKKeyboardScrollable; compute the distance for each scrolling increment.
2654
2655         (-[WKContentView scrollByContentOffset:animated:]):
2656         Part of WKKeyboardScrollable; plumb scrolls up to WKWebView.
2657
2658         (-[WKContentView _scrollOffsetForEvent:]): Moved to WKKeyboardScrollingAnimator.mm.
2659
2660         * UIProcess/ios/WKKeyboardScrollingAnimator.h: Added.
2661         * UIProcess/ios/WKKeyboardScrollingAnimator.mm: Added.
2662         (-[WKKeyboardScrollingAnimator init]):
2663         (-[WKKeyboardScrollingAnimator initWithScrollable:]):
2664         (-[WKKeyboardScrollingAnimator invalidate]):
2665         (-[WKKeyboardScrollingAnimator _scrollOffsetForEvent:]):
2666         Compute the scroll offset given a particular event. This is moved from WKContentView;
2667         otherwise the primary change is that it now asks the WKKeyboardScrollable
2668         for the distance instead of computing it directly.
2669
2670         (-[WKKeyboardScrollingAnimator beginWithEvent:]):
2671         If we're currently in the initial state (WaitingForFirstEvent), and
2672         a given event should start a scroll, transition into WaitingForRepeat,
2673         and do a single animated scroll of the appropriate distance.
2674
2675         (-[WKKeyboardScrollingAnimator handleKeyEvent:]):
2676         If this key event should terminate a scroll (because it is either a keyup
2677         or a non-scrolling keydown), shut down any running animations.
2678
2679         If this is the first key repeat after the initial scroll, start a scrolling
2680         animation.
2681
2682         Eat the event if it either started or continued a scroll.
2683
2684         (-[WKKeyboardScrollingAnimator startAnimatedScroll]):
2685         (-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
2686         Helpers to start and stop the display link and do some bookkeeping.
2687
2688         (-[WKKeyboardScrollingAnimator displayLinkFired:]):
2689         Ask the WKKeyboardScrollable to scroll the content based on the frame time,
2690         an acceleration curve, and the current animation's scrolling increment.
2691
2692         * WebKit.xcodeproj/project.pbxproj:
2693
2694 2018-08-01  Chris Dumez  <cdumez@apple.com>
2695
2696         Make sure cookies get flushed to disk before exiting or suspending the network process
2697         https://bugs.webkit.org/show_bug.cgi?id=188241
2698         <rdar://problem/42831831>
2699
2700         Reviewed by Alex Christensen and Geoffrey Garen.
2701
2702         Make sure cookies get flushed to disk before exiting or suspending the network process,
2703         to make sure they do not get lost.
2704
2705         * NetworkProcess/NetworkProcess.cpp:
2706         (WebKit::NetworkProcess::didClose):
2707         (WebKit::NetworkProcess::actualPrepareToSuspend):
2708         (WebKit::NetworkProcess::platformSyncAllCookies):
2709         * NetworkProcess/NetworkProcess.h:
2710         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2711         (WebKit::NetworkProcess::syncAllCookies):
2712         (WebKit::NetworkProcess::platformSyncAllCookies):
2713         * Shared/ChildProcess.cpp:
2714         (WebKit::ChildProcess::didClose):
2715         (WebKit::callExitNow):
2716         (WebKit::callExitSoon):
2717         (WebKit::ChildProcess::initialize):
2718         (WebKit::didCloseOnConnectionWorkQueue): Deleted.
2719         * Shared/ChildProcess.h:
2720         (WebKit::ChildProcess::shouldCallExitWhenConnectionIsClosed const):
2721
2722 2018-08-01  Alex Christensen  <achristensen@webkit.org>
2723
2724         Move all calls to ResourceLoader::start to WebKitLegacy
2725         https://bugs.webkit.org/show_bug.cgi?id=184946
2726
2727         Reviewed by Andy Estes.
2728
2729         * WebProcess/Network/WebLoaderStrategy.cpp:
2730         (WebKit::WebLoaderStrategy::setDefersLoading):
2731         * WebProcess/Network/WebLoaderStrategy.h:
2732
2733 2018-08-01  Nan Wang  <n_wang@apple.com>
2734
2735         AX: AOM: Add ARIA IDL Attribute Reflection
2736         https://bugs.webkit.org/show_bug.cgi?id=184676
2737         <rdar://problem/39476882>
2738
2739         Added ARIA property string reflection on Element, behind
2740         a new runtime flag. 
2741         Spec: https://w3c.github.io/aria/#idl-interface
2742
2743         Reviewed by Chris Fleizach.
2744
2745         * Shared/WebPreferences.yaml:
2746         * UIProcess/API/C/WKPreferences.cpp:
2747         (WKPreferencesSetAriaReflectionEnabled):
2748         (WKPreferencesGetAriaReflectionEnabled):
2749         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2750
2751 2018-08-01  Alex Christensen  <achristensen@webkit.org>
2752
2753         Allow WebFramePolicyListenerProxy to be used multiple times
2754         https://bugs.webkit.org/show_bug.cgi?id=188229
2755
2756         Reviewed by Chris Dumez.
2757
2758         This fixes a regression from r234210 in clients that misuse the API.
2759
2760         * UIProcess/WebFramePolicyListenerProxy.cpp:
2761         (WebKit::WebFramePolicyListenerProxy::use):
2762         (WebKit::WebFramePolicyListenerProxy::download):
2763         (WebKit::WebFramePolicyListenerProxy::ignore):
2764
2765 2018-08-01  Aditya Keerthi  <akeerthi@apple.com>
2766
2767         [iOS] Color picker should have a border when presented in a popover
2768         https://bugs.webkit.org/show_bug.cgi?id=188207
2769
2770         Reviewed by Wenson Hsieh.
2771
2772         The color picker should have a border when presented in a popover. This matches
2773         the behavior of color pickers in other parts of iOS.
2774
2775         Since the popover will resize its view to fill its size, we first place the
2776         color picker in a container view. The container view can then fill the popover,
2777         while the smaller color picker is centered in it's container - creating the
2778         appearance of a border.
2779
2780         * UIProcess/ios/forms/WKFormColorControl.mm:
2781         (-[WKColorPopover initWithView:]):
2782         * UIProcess/ios/forms/WKFormColorPicker.mm:
2783
2784 2018-08-01  Commit Queue  <commit-queue@webkit.org>
2785
2786         Unreviewed, rolling out r234443 and r234445.
2787         https://bugs.webkit.org/show_bug.cgi?id=188224
2788
2789         Revision caused 3 api failures across all platforms.
2790         (Requested by Truitt on #webkit).
2791
2792         Reverted changesets:
2793
2794         "Add configuration for automatic process pre-warming"
2795         https://bugs.webkit.org/show_bug.cgi?id=187108
2796         https://trac.webkit.org/changeset/234443
2797
2798         "Add configuration for automatic process pre-warming"
2799         https://bugs.webkit.org/show_bug.cgi?id=187108
2800         https://trac.webkit.org/changeset/234445
2801
2802 2018-08-01  Aditya Keerthi  <akeerthi@apple.com>
2803
2804         [iOS] WKColorPicker's selection indicator doesn't always cover the selected swatch
2805         https://bugs.webkit.org/show_bug.cgi?id=188124
2806
2807         Reviewed by Wenson Hsieh.
2808
2809         - On iPhone, the size of an individual color swatch can change on rotation. In
2810         this case, we should resize the selection indicator along with the swatch. Added
2811         a new delegate method to WKColorMatrixViewDelegate to notify the color picker if
2812         the matrix was redrawn. We then resize the selection indicator to match the
2813         selected swatch's size.
2814
2815         - On iPad, the selection indicator should have rounded corners if it's at the
2816         corner of the color picker. Otherwise, part of the indicator will be hidden by
2817         the popover. The selected swatch's position is checked before drawing the
2818         indicator. If it's at one of the four corners of the picker, the appropriate mask
2819         is applied to the color selection indicator's border.
2820
2821         * UIProcess/ios/forms/WKFormColorPicker.h:
2822         * UIProcess/ios/forms/WKFormColorPicker.mm:
2823         (-[WKColorMatrixView layoutSubviews]):
2824         (-[WKColorPicker initWithView:]):
2825         (-[WKColorPicker drawSelectionIndicatorForColorButton:]):
2826         (-[WKColorPicker colorMatrixViewDidLayoutSubviews:]):
2827         (-[WKColorPicker colorMatrixView:didTapColorButton:]):
2828         (-[WKColorPicker didPanColors:]):
2829
2830 2018-08-01  Zan Dobersek  <zdobersek@igalia.com>
2831
2832         [CoordGraphics] Move CoordinatedBackingStore to WebCore
2833         https://bugs.webkit.org/show_bug.cgi?id=188158
2834
2835         Reviewed by Carlos Garcia Campos.
2836
2837         Move the CoordinatedBackingStore class from WebKit to WebCore. It has no
2838         dependency on anything in the WebKit layer, and it's more suitable to
2839         future needs to keep it in the WebCore layer.
2840
2841         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2842         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
2843         * SourcesGTK.txt:
2844         * SourcesWPE.txt:
2845
2846 2018-07-31  Alex Christensen  <achristensen@webkit.org>
2847
2848         REGRESSION (r231107): MoviStar+ launches to a blank black screen
2849         https://bugs.webkit.org/show_bug.cgi?id=188139
2850
2851         Reviewed by Brent Fulgham.
2852
2853         Add infrastructure to check UIProcess SDK from the WebProcess and NetworkProcess for linked-on-or-after checks.
2854
2855         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2856         (WebKit::NetworkProcessCreationParameters::encode const):
2857         (WebKit::NetworkProcessCreationParameters::decode):
2858         * NetworkProcess/NetworkProcessCreationParameters.h:
2859         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2860         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2861         * Shared/WebProcessCreationParameters.cpp:
2862         (WebKit::WebProcessCreationParameters::encode const):
2863         (WebKit::WebProcessCreationParameters::decode):
2864         * Shared/WebProcessCreationParameters.h:
2865         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2866         (WebKit::WebProcessPool::platformInitializeWebProcess):
2867         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2868         * WebProcess/cocoa/WebProcessCocoa.mm:
2869         (WebKit::WebProcess::platformInitializeWebProcess):
2870
2871 2018-07-31  Ryosuke Niwa  <rniwa@webkit.org>
2872
2873         Add configuration for automatic process pre-warming
2874         https://bugs.webkit.org/show_bug.cgi?id=187108
2875
2876         Reviewed by Ryosuke Niwa.
2877
2878         Added the missing availability macros.
2879
2880         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2881
2882 2018-07-31  Ben Richards  <benton_richards@apple.com>
2883
2884         Add configuration for automatic process pre-warming
2885         https://bugs.webkit.org/show_bug.cgi?id=187108
2886
2887         Reviewed by Ryosuke Niwa.
2888
2889         Added configurations to allow setting the maximum number of processes that should be automatically prewarmed.
2890
2891         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2892         (API::ProcessPoolConfiguration::copy):
2893         * UIProcess/API/APIProcessPoolConfiguration.h:
2894         * UIProcess/API/C/WKContext.cpp:
2895         (WKContextSetMaximumNumberOfPrewarmedProcesses):
2896         * UIProcess/API/C/WKContextPrivate.h:
2897         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2898         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2899         (-[_WKProcessPoolConfiguration setMaximumPrewarmedProcessCount:]):
2900         (-[_WKProcessPoolConfiguration maximumPrewarmedProcessCount]):
2901         * UIProcess/WebPageProxy.cpp:
2902         (WebKit::WebPageProxy::didFinishLoadForFrame): Moved call to notifyProcessPoolToPrewarm from didFirstVisuallyNonEmptyLayoutForFrame to here.
2903         This is to try to ensure that frame loading and prewarming don't happen at the same time as this would be heavy for some devices.
2904         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
2905         * UIProcess/WebProcessPool.cpp:
2906         (WebKit::WebProcessPool::setMaximumNumberOfProcesses): Condition changed so that calling setMaximumNumberOfProcesses after warmInitialProcess
2907         doesn't result in a crash.
2908         (WebKit::WebProcessPool::setMaximumNumberOfPrewarmedProcesses):
2909         (WebKit::WebProcessPool::warmInitialProcess):
2910         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
2911         * UIProcess/WebProcessPool.h:
2912
2913 2018-07-31  Stephan Szabo  <stephan.szabo@sony.com>
2914
2915         [WinCairo] <select> elements do not popup options
2916         https://bugs.webkit.org/show_bug.cgi?id=188172
2917
2918         Reviewed by Fujii Hironori.
2919
2920         * PlatformWin.cmake: Add WebPopupMenuProxyWin
2921         * Shared/PlatformPopupMenuData.cpp:
2922         (WebKit::PlatformPopupMenuData::encode const): Encode
2923         windows parameters
2924         (WebKit::PlatformPopupMenuData::decode): Decode windows
2925         parameters
2926         * Shared/PlatformPopupMenuData.h: Add the windows specific
2927         parameters (based on removed Windows implementation)
2928         * UIProcess/win/PageClientImpl.cpp:
2929         (WebKit::PageClientImpl::createPopupMenuProxy):
2930         * UIProcess/win/WebPopupMenuProxyWin.cpp: Added. (based on
2931         removed Windows implementation plus some fixes/api changes
2932         since the removal)
2933         (WebKit::isASCIIPrintable):
2934         (WebKit::translatePoint):
2935         (WebKit::WebPopupMenuProxyWin::WebPopupMenuProxyWndProc):
2936         (WebKit::WebPopupMenuProxyWin::wndProc):
2937         (WebKit::WebPopupMenuProxyWin::registerWindowClass):
2938         (WebKit::WebPopupMenuProxyWin::WebPopupMenuProxyWin):
2939         (WebKit::WebPopupMenuProxyWin::~WebPopupMenuProxyWin):
2940         (WebKit::WebPopupMenuProxyWin::showPopupMenu):
2941         (WebKit::WebPopupMenuProxyWin::hidePopupMenu):
2942         (WebKit::WebPopupMenuProxyWin::calculatePositionAndSize):
2943         (WebKit::WebPopupMenuProxyWin::clientRect const):
2944         (WebKit::WebPopupMenuProxyWin::invalidateItem):
2945         (WebKit::WebPopupMenuProxyWin::scrollSize const):
2946         (WebKit::WebPopupMenuProxyWin::setScrollOffset):
2947         (WebKit::WebPopupMenuProxyWin::visibleSize const):
2948         (WebKit::WebPopupMenuProxyWin::contentsSize const):
2949         (WebKit::WebPopupMenuProxyWin::scrollableAreaBoundingBox const):
2950         (WebKit::WebPopupMenuProxyWin::scrollTo):
2951         (WebKit::WebPopupMenuProxyWin::invalidateScrollbarRect):
2952         (WebKit::WebPopupMenuProxyWin::onMouseActivate):
2953         (WebKit::WebPopupMenuProxyWin::onSize):
2954         (WebKit::WebPopupMenuProxyWin::onKeyDown):
2955         (WebKit::WebPopupMenuProxyWin::onChar):
2956         (WebKit::WebPopupMenuProxyWin::onMouseMove):
2957         (WebKit::WebPopupMenuProxyWin::onLButtonDown):
2958         (WebKit::WebPopupMenuProxyWin::onLButtonUp):
2959         (WebKit::WebPopupMenuProxyWin::onMouseWheel):
2960         (WebKit::WebPopupMenuProxyWin::onPaint):
2961         (WebKit::WebPopupMenuProxyWin::onPrintClient):
2962         (WebKit::WebPopupMenuProxyWin::down):
2963         (WebKit::WebPopupMenuProxyWin::up):
2964         (WebKit::WebPopupMenuProxyWin::paint):
2965         (WebKit::WebPopupMenuProxyWin::setFocusedIndex):
2966         (WebKit::WebPopupMenuProxyWin::visibleItems const):
2967         (WebKit::WebPopupMenuProxyWin::listIndexAtPoint const):
2968         (WebKit::WebPopupMenuProxyWin::focusedIndex const):
2969         (WebKit::WebPopupMenuProxyWin::focusFirst):
2970         (WebKit::WebPopupMenuProxyWin::focusLast):
2971         (WebKit::WebPopupMenuProxyWin::incrementWheelDelta):
2972         (WebKit::WebPopupMenuProxyWin::reduceWheelDelta):
2973         (WebKit::WebPopupMenuProxyWin::scrollToRevealSelection):
2974         * UIProcess/win/WebPopupMenuProxyWin.h: Added. (based on
2975         removed Windows implementation plus some fixes/api changes
2976         since then)
2977         (WebKit::WebPopupMenuProxyWin::create):
2978         (WebKit::WebPopupMenuProxyWin::hide):
2979         (WebKit::WebPopupMenuProxyWin::scrollbar const):
2980         (WebKit::WebPopupMenuProxyWin::itemHeight const):
2981         (WebKit::WebPopupMenuProxyWin::windowRect const):
2982         (WebKit::WebPopupMenuProxyWin::wheelDelta const):
2983         (WebKit::WebPopupMenuProxyWin::setWasClicked):
2984         (WebKit::WebPopupMenuProxyWin::wasClicked const):
2985         (WebKit::WebPopupMenuProxyWin::scrollbarCapturingMouse const):
2986         (WebKit::WebPopupMenuProxyWin::setScrollbarCapturingMouse):
2987         * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp:
2988         (WebKit::WebPopupMenu::setUpPlatformData): Make the data to
2989         pass between processes.
2990
2991 2018-07-31  John Wilander  <wilander@apple.com>
2992
2993         Resource Load Statistics: Remove partitioned cookies for reduced complexity, lower memory footprint, and ability to support more platforms
2994         https://bugs.webkit.org/show_bug.cgi?id=188109
2995         <rdar://problem/42664391>
2996
2997         Reviewed by Brent Fulgham, Chris Dumez, and Alex Christensen.
2998
2999         This patch removes cookie partitioning which reduces the model to just
3000         blocked cookies (in third-party contexts) and first-party cookie access.
3001
3002         Several of the changes are renaming to reflect that there are no more
3003         cookie partitions. However, the compile-time check remains for now since
3004         this change is not ready to ship.
3005
3006         The API changes are mostly in C APIs used for layout tests. The slight
3007         change in Cocoa API is that there no longer is a functionality to
3008         "enable" cookie partitioning. The boolean member is still there but it
3009         no longer does anything.
3010
3011         The functional changes are in WebKit::ResourceLoadStatisticsMemoryStore
3012         and WebKit::NetworkDataTaskCocoa where cookie partitioning used to be
3013         managed and applied respectively. The IPC communication has changed to
3014         reflect this.
3015
3016         * NetworkProcess/NetworkProcess.cpp:
3017         (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
3018             Name change from updatePrevalentDomainsToPartitionOrBlockCookies().
3019             No longer supports the partitioned category.
3020         (WebKit::NetworkProcess::removeAllStorageAccess):
3021             Now supports a completion handler. This change was made to address
3022             flakiness that came after layout test changes that were needed because
3023             of the removal of partitioned cookies.
3024         (WebKit::NetworkProcess::updatePrevalentDomainsToPartitionOrBlockCookies): Deleted.
3025         * NetworkProcess/NetworkProcess.h:
3026         * NetworkProcess/NetworkProcess.messages.in:
3027             Partitioning removed from message name.
3028             RemoveAllStorageAccess message now supports a completion handler
3029             as explained above
3030         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3031         (WebKit::NetworkProcessCreationParameters::encode const):
3032             Removed parameter cookieStoragePartitioningEnabled.
3033         (WebKit::NetworkProcessCreationParameters::decode):
3034             Removed parameter cookieStoragePartitioningEnabled.
3035         * NetworkProcess/NetworkProcessCreationParameters.h:
3036         * NetworkProcess/NetworkResourceLoader.cpp:
3037         (WebKit::NetworkResourceLoader::logCookieInformation):
3038             No longer takes partitioning into account.
3039         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
3040         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3041         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
3042             Now only applies cookie blocking.
3043         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
3044             Now only applies cookie blocking.
3045         (WebKit::NetworkDataTaskCocoa::applyCookiePartitioningPolicy): Deleted.
3046         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3047         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3048             Removed the call to setCookieStoragePartitioningEnabled().
3049         (WebKit::NetworkProcess::setCookieStoragePartitioningEnabled): Deleted.
3050         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3051         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
3052         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
3053             WebCore::NetworkStorageSession::shouldBlockCookies() now takes a
3054             frame ID and page ID to resolve cookie access with the Storage
3055             Access API. This was previously handled by
3056             WebCore::NetworkStorageSession::cookieStoragePartition().
3057         * UIProcess/API/C/WKCookieManager.cpp:
3058         (WKCookieManagerSetCookieStoragePartitioningEnabled): Deleted.
3059         * UIProcess/API/C/WKCookieManager.h:
3060         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3061         (WKWebsiteDataStoreStatisticsUpdateCookieBlocking):
3062         (WKWebsiteDataStoreSetStatisticsHasHadNonRecentUserInteraction): Deleted.
3063             There is no longer a difference between recent and non-recent
3064             user interaction so this test function was removed.
3065         (WKWebsiteDataStoreSetStatisticsTimeToLiveCookiePartitionFree): Deleted.
3066         (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning): Deleted.
3067         (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost): Deleted.
3068             Deleted because partitioning is no longer a thing.
3069         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
3070         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3071             Deprecated _isCookieStoragePartitioningEnabled() and
3072             _setCookieStoragePartitioningEnabled() via WK_API_DEPRECATED.
3073         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
3074         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
3075             Removed support for ResourceLoadStatisticsTimeToLiveCookiePartitionFree.
3076         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3077         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3078             No longer sets a parameter based on cookieStoragePartitioningEnabled().
3079         (WebKit::WebProcessPool::setCookieStoragePartitioningEnabled):
3080             Added a FIXME comment that this setter no longer does anything meaningful.
3081             Removed the IPC call to the network process to propagate the setting.
3082         * UIProcess/Network/NetworkProcessProxy.cpp:
3083         (WebKit::NetworkProcessProxy::clearCallbackStates):
3084             Name change from m_updatePartitionOrBlockCookiesCallbackMap to
3085             m_updateBlockCookiesCallbackMap.
3086         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
3087             Name change plus it now just takes one vector of strings named domainsToBlock.
3088         (WebKit::NetworkProcessProxy::didUpdateBlockCookies):
3089             Name change from didUpdatePartitionOrBlockCookies().
3090         (WebKit::NetworkProcessProxy::storageAccessRequestResult):
3091             Just moved to its right place.
3092         (WebKit::NetworkProcessProxy::removeAllStorageAccess):
3093             Now take a completion handler.
3094         (WebKit::NetworkProcessProxy::didRemoveAllStorageAccess):
3095             To call the completion handler.
3096         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToPartitionOrBlockCookies): Deleted.
3097             Name change.
3098         (WebKit::NetworkProcessProxy::didUpdatePartitionOrBlockCookies): Deleted.
3099             Name change.
3100         * UIProcess/Network/NetworkProcessProxy.h:
3101         * UIProcess/Network/NetworkProcessProxy.messages.in:
3102             Name change and added completion handler message for removeAllStorageAccess().
3103         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
3104         (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
3105         (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
3106         (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener):
3107         (WebKit::ResourceLoadStatisticsMemoryStore::scheduleStatisticsProcessingRequestIfNecessary):
3108         (WebKit::ResourceLoadStatisticsMemoryStore::logUserInteraction):
3109         (WebKit::ResourceLoadStatisticsMemoryStore::mergeWithDataFromDecoder):
3110         (WebKit::ResourceLoadStatisticsMemoryStore::clear):
3111         (WebKit::ResourceLoadStatisticsMemoryStore::wasAccessedAsFirstPartyDueToUserInteraction const):
3112         (WebKit::ResourceLoadStatisticsMemoryStore::shouldBlockAndKeepCookies):
3113         (WebKit::ResourceLoadStatisticsMemoryStore::shouldBlockAndPurgeCookies):
3114         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
3115         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlockingForDomains):
3116         (WebKit::ResourceLoadStatisticsMemoryStore::clearBlockingStateForDomains):
3117         (WebKit::ResourceLoadStatisticsMemoryStore::resetCookieBlockingState):
3118         (WebKit::ResourceLoadStatisticsMemoryStore::removeAllStorageAccess):
3119         (WebKit::ResourceLoadStatisticsMemoryStore::logNonRecentUserInteraction): Deleted.
3120             There is no longer a difference between recent and non-recent
3121             user interaction so this test function was removed.
3122         (WebKit::ResourceLoadStatisticsMemoryStore::setTimeToLiveCookiePartitionFree): Deleted.
3123         (WebKit::ResourceLoadStatisticsMemoryStore::shouldPartitionCookies): Deleted.
3124         (WebKit::ResourceLoadStatisticsMemoryStore::shouldBlockCookies): Deleted.
3125             Now split into shouldBlockAndKeepCookies() and shouldBlockAndPurgeCookies().
3126         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookiePartitioning): Deleted.
3127         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookiePartitioningForDomains): Deleted.
3128         (WebKit::ResourceLoadStatisticsMemoryStore::clearPartitioningStateForDomains): Deleted.
3129         (WebKit::ResourceLoadStatisticsMemoryStore::resetCookiePartitioningState): Deleted.
3130         * UIProcess/ResourceLoadStatisticsMemoryStore.h:
3131         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
3132         (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk):
3133             Added an empty completion handler to the m_memoryStore.clear() call.
3134         * UIProcess/WebCookieManagerProxy.cpp:
3135         (WebKit::WebCookieManagerProxy::setCookieStoragePartitioningEnabled): Deleted.
3136         * UIProcess/WebCookieManagerProxy.h:
3137         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3138         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
3139         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
3140             Now has a completion handler.
3141         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdate):
3142         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdateForDomains):
3143         (WebKit::WebResourceLoadStatisticsStore::scheduleClearBlockingStateForDomains):
3144         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingStateReset):
3145         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory):
3146             Now supports a completion handler for removeAllStorageAccess().
3147         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
3148         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
3149         (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction): Deleted.
3150             There is no longer a difference between recent and non-recent
3151             user interaction so this test function was removed.
3152         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate): Deleted.
3153             Renamed to scheduleCookieBlockingUpdate().
3154         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains): Deleted.
3155             Renamed to scheduleCookieBlockingUpdateForDomains().
3156         (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains): Deleted.
3157             Renamed to scheduleClearBlockingStateForDomains().
3158         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningStateReset): Deleted.
3159             Renamed to scheduleCookieBlockingStateReset().
3160         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree): Deleted.
3161         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToPartitionOrBlockCookiesHandler): Deleted.
3162             Renamed callUpdatePrevalentDomainsToBlockCookiesForHandler().
3163         * UIProcess/WebResourceLoadStatisticsStore.h:
3164         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3165         (WebKit::WebsiteDataStore::updatePrevalentDomainsToBlockCookiesFor):
3166         (WebKit::WebsiteDataStore::removeAllStorageAccessHandler):
3167             Now supports a completion handler for removeAllStorageAccess().
3168         (WebKit::WebsiteDataStore::networkProcessDidCrash):
3169             Name change in function called to get rid of "partitioning."
3170         (WebKit::WebsiteDataStore::updatePrevalentDomainsToPartitionOrBlockCookies): Deleted.
3171             Renamed updatePrevalentDomainsToBlockCookiesFor().
3172         * UIProcess/WebsiteData/WebsiteDataStore.h:
3173
3174 2018-07-31  Rob Buis  <rbuis@igalia.com>
3175
3176         Remove ResourceResponse::cacheBodyKey API
3177         https://bugs.webkit.org/show_bug.cgi?id=188192
3178
3179         Reviewed by Frédéric Wang.
3180
3181         Remove unused API.
3182
3183         * NetworkProcess/cache/NetworkCacheEntry.cpp:
3184         (WebKit::NetworkCache::Entry::decodeStorageRecord):
3185
3186 2018-07-30  Sihui Liu  <sihui_liu@apple.com>
3187
3188         Add support for fetching and remove type  _WKWebsiteDataTypeHSTSCache
3189         https://bugs.webkit.org/show_bug.cgi?id=187379
3190         <rdar://problem/41879559>
3191
3192         WKWebsiteDataStore should support _WKWebsiteDataTypeHSTSCache so Safari could list HSTS cache entries
3193         and be able to remove them on a per-domain basis.
3194
3195         Reviewed by Geoffrey Garen.
3196
3197         * NetworkProcess/NetworkProcess.cpp:
3198         (WebKit::NetworkProcess::fetchWebsiteData):
3199         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
3200         * NetworkProcess/NetworkProcess.h:
3201         * NetworkProcess/NetworkProcess.messages.in:
3202         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3203         (WebKit::filterPreloadHSTSEntry):
3204         (WebKit::NetworkProcess::getHostNamesWithHSTSCache):
3205         (WebKit::NetworkProcess::deleteHSTSCacheForHostNames):
3206         * Shared/WebsiteData/WebsiteData.cpp:
3207         (WebKit::WebsiteData::encode const):
3208         (WebKit::WebsiteData::decode):
3209         * Shared/WebsiteData/WebsiteData.h:
3210         * UIProcess/Network/NetworkProcessProxy.cpp:
3211         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
3212         * UIProcess/Network/NetworkProcessProxy.h:
3213         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
3214         (WebKit::WebsiteDataRecord::displayNameForCookieHostName):
3215         (WebKit::WebsiteDataRecord::displayNameForHostName):
3216         (WebKit::WebsiteDataRecord::addHSTSCacheHostname):
3217         (WebKit::WebsiteDataRecord::displayNameForPluginDataHostName): Deleted.
3218         * UIProcess/WebsiteData/WebsiteDataRecord.h:
3219         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3220         (WebKit::WebsiteDataStore::fetchDataAndApply):
3221         (WebKit::WebsiteDataStore::removeData):
3222
3223 2018-07-30  Simon Fraser  <simon.fraser@apple.com>
3224
3225         Shrink GraphicsLayerCA
3226         https://bugs.webkit.org/show_bug.cgi?id=188141
3227
3228         Reviewed by Zalan Bujtas.
3229
3230         Shrink GraphicsLayerCA from 1040 to 880 bytes by:
3231         * moving all the clone-related stuff into the lazily-allocated m_layerClones
3232         * moving all the animation-related stuff into the lazily-allocated m_animations
3233         * making enums be 8-bit
3234         * re-ordering data members
3235
3236         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
3237         (WebKit::updateCustomAppearance):
3238         (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
3239         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
3240         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
3241         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
3242         (WebKit::PlatformCALayerRemote::requiresCustomAppearanceUpdateOnBoundsChange const):
3243
3244 2018-07-30  Wenson Hsieh  <wenson_hsieh@apple.com>
3245
3246         REGRESSION (r230817): Terrible performance when selecting text on Stash code review
3247         https://bugs.webkit.org/show_bug.cgi?id=188144
3248         <rdar://problem/42642489>
3249
3250         Reviewed by Darin Adler.
3251
3252         After r230817, mouse events were serially dispatched to the web process and handled before the subsequent mouse
3253         event. However, this resulted in rapid-fire mouse move events filling up the mouse event queue in the case where
3254         mouse move events were being handled by the web process at a slower rate than the UI process was enqueueing
3255         them. To mitigate this, r231511 introduced a mechanism for replacing the most recently enqueued mouse move event
3256         with an incoming mouse move event.
3257
3258         However, when a user with a force-click-enabled trackpad performs a mouse drag, a rapid stream of
3259         "mouseforcechanged" events is interleaved alongside the stream of "mousemove" events. This renders r231511
3260         ineffective, since the most recently queued event is often a "mouseforcechanged" event instead of a "mousemove".
3261         On the stash code review page, this can result in hundreds of mouse events being backed up in the mouse event
3262         queue, causing perceived slowness when selecting text.
3263
3264         To fix this, we extend the mechanism introduced in r231511, such that it is capable of replacing both
3265         "mouseforcechanged" and "mousemove" events in the queue. Rather than consider only the most recently queued
3266         item, we instead find the most recently queued event that matches the type of the incoming event, remove it from
3267         the queue, and then append the incoming event to the end of the queue. To avoid the risk of removing the only
3268         "mousemove" or "mouseforcechanged" event in the middle of a mouse down and mouse up, we also bail when searching
3269         backwards for an event to replace if we come across any event that is neither of these types.
3270
3271         This effectively throttles the rate at which mouseforcechanged or mousemove events are dispatched when a user
3272         with force-click-enabled hardware clicks and drags the mouse across the page.
3273
3274         * UIProcess/WebPageProxy.cpp:
3275         (WebKit::removeOldRedundantEvent):
3276         (WebKit::WebPageProxy::handleMouseEvent):
3277
3278 2018-07-30  Devin Rousso  <webkit@devinrousso.com>
3279
3280         Add missing CoreGraphics SPI
3281         https://bugs.webkit.org/show_bug.cgi?id=188177
3282
3283         Reviewed by Joseph Pecoraro.
3284
3285         * WebProcess/cocoa/WebProcessCocoa.mm:
3286
3287 2018-07-30  Rob Buis  <rbuis@igalia.com>
3288
3289         https://bugs.webkit.org/show_bug.cgi?id=188137
3290         Merge PlatformCookieJar functions into NetworkStorageSession
3291
3292         Adapt callsites to use NetworkStorageSession instead of CookieJar functions.
3293
3294         Reviewed by Alex Christensen.
3295
3296         * NetworkProcess/Cookies/WebCookieManager.cpp:
3297         (WebKit::WebCookieManager::getHostnamesWithCookies):
3298         (WebKit::WebCookieManager::deleteCookiesForHostname):
3299         (WebKit::WebCookieManager::deleteAllCookies):
3300         (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
3301         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3302         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
3303         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
3304         (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
3305         (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
3306         (WebKit::NetworkConnectionToWebProcess::getRawCookies):
3307         (WebKit::NetworkConnectionToWebProcess::deleteCookie):
3308         * NetworkProcess/NetworkProcess.cpp:
3309         (WebKit::NetworkProcess::fetchWebsiteData):
3310         (WebKit::NetworkProcess::deleteWebsiteData):
3311         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
3312         * NetworkProcess/NetworkResourceLoader.cpp:
3313         (WebKit::logCookieInformationInternal):
3314         * NetworkProcess/cache/NetworkCache.cpp:
3315         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3316
3317 2018-07-30  Alex Christensen  <achristensen@webkit.org>
3318
3319         Add RefCounted CompletionHandler wrapping abstraction for sending policy decisions back to WebProcess
3320         https://bugs.webkit.org/show_bug.cgi?id=188089
3321
3322         Reviewed by Geoffrey Garen and Said Abou-Hallawa.
3323
3324         This will be necessary for when I add an asynchronous parallel step to decidePolicyForNavigationAction.
3325         We will want to wait for that asynchronous step for decidePolicyForNavigationActionSync but not for a client.
3326
3327         No change in behavior.
3328
3329         * UIProcess/WebPageProxy.cpp:
3330         (WebKit::WebPageProxy::PolicyDecisionSender::create):
3331         (WebKit::WebPageProxy::PolicyDecisionSender::operator()):
3332         (WebKit::WebPageProxy::PolicyDecisionSender::PolicyDecisionSender):
3333         (WebKit::WebPageProxy::receivedPolicyDecision):
3334         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
3335         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3336         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
3337         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
3338         (WebKit::WebPageProxy::decidePolicyForResponse):
3339         * UIProcess/WebPageProxy.h:
3340         * UIProcess/WebPageProxy.messages.in:
3341         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3342         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3343
3344 2018-07-30  David Fenton  <david_fenton@apple.com>
3345
3346         Unreviewed, rolling out r234327.
3347
3348         Caused 2 crashes on macOS and iOS debug API tests
3349
3350         Reverted changeset:
3351
3352         "Add RefCounted CompletionHandler wrapping abstraction for
3353         sending policy decisions back to WebProcess"
3354         https://bugs.webkit.org/show_bug.cgi?id=188089
3355         https://trac.webkit.org/changeset/234327
3356
3357 2018-07-30  Chris Dumez  <cdumez@apple.com>
3358
3359         Potential null dereference under WebPage::applicationDidBecomeActive()
3360         https://bugs.webkit.org/show_bug.cgi?id=188170
3361         <rdar://problem/37493418>
3362
3363         Reviewed by Wenson Hsieh.
3364
3365         WebPage::m_page gets nulled out when the page is closed but the WebPage object may receive IPC
3366         until it gets destroyed. Therefore, we need to null-check m_page before using it in IPC message
3367         handlers.
3368
3369         * WebProcess/WebPage/ios/WebPageIOS.mm:
3370         (WebKit::WebPage::applicationDidEnterBackground):
3371         (WebKit::WebPage::applicationWillEnterForeground):
3372         (WebKit::WebPage::applicationDidBecomeActive):
3373
3374 2018-07-29  Wenson Hsieh  <wenson_hsieh@apple.com>
3375
3376         Fix incorrect guards around a method declaration in PageClient.h
3377         https://bugs.webkit.org/show_bug.cgi?id=188153
3378
3379         Reviewed by Tim Horton.
3380
3381         `WebCore::DragItem` is forward declared under `ENABLE(DRAG_SUPPORT)`, but `startDrag` is declared under
3382         `PLATFORM(COCOA)`. If `ENABLE(DRAG_SUPPORT)` is off but `PLATFORM(COCOA)` is on, the build breaks.
3383
3384         We fix this by moving `startDrag` under `ENABLE(DRAG_SUPPORT)`.
3385
3386         * UIProcess/PageClient.h:
3387         (WebKit::PageClient::startDrag):
3388
3389 2018-07-28  Andy Estes  <aestes@apple.com>
3390
3391         [Wi-Fi Assertions] Pass a ResumptionReason to resumeWiFiAssertions
3392         https://bugs.webkit.org/show_bug.cgi?id=188142
3393         <rdar://problem/42628842>
3394
3395         Reviewed by Darin Adler.
3396
3397         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3398         (WebKit::NetworkProcess::platformProcessDidResume):
3399         (WebKit::NetworkProcess::platformProcessDidTransitionToForeground):
3400
3401 2018-07-28  Darin Adler  <darin@apple.com>
3402
3403         [Cocoa] Update more WebCore Objective-C code to be ARC compatible
3404         https://bugs.webkit.org/show_bug.cgi?id=188140
3405
3406         Reviewed by Sam Weinig.
3407
3408         * UIProcess/mac/WKFullScreenWindowController.mm:
3409         (-[WKFullScreenWindowController enterFullScreen:]): Removed the call to
3410         setAction: since the full screen placeholder view now always uses the
3411         cancelOperation: method.
3412
3413         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3414         (WebKit::PDFPlugin::lookupTextAtLocation): Updated to use the new
3415         DictionaryLookup function that returns a tuple instead of using an out argument.
3416         * WebProcess/WebPage/mac/WebPageMac.mm:
3417         (WebKit::WebPage::performDictionaryLookupAtLocation): Ditto.
3418         (WebKit::WebPage::performDictionaryLookupForSelection): Ditto.
3419
3420 2018-07-27  Chris Dumez  <cdumez@apple.com>
3421
3422         Fix thread-safety issues related to RealtimeMediaSource::audioSamplesAvailable()
3423         https://bugs.webkit.org/show_bug.cgi?id=188097
3424         <rdar://problem/42558823>
3425
3426         Reviewed by Eric Carlson.
3427
3428         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
3429
3430 2018-07-27  Alex Christensen  <achristensen@webkit.org>
3431
3432         Don't include WebPageProxy.h just for UndoOrRedo
3433         https://bugs.webkit.org/show_bug.cgi?id=188086
3434
3435         Reviewed by Saam Barati.
3436
3437         * Shared/UndoOrRedo.h: Added.
3438         * UIProcess/Cocoa/WebViewImpl.h:
3439         * UIProcess/Cocoa/WebViewImpl.mm:
3440         (WebKit::WebViewImpl::registerEditCommand):
3441         * UIProcess/PageClient.h:
3442         * UIProcess/WebEditCommandProxy.cpp:
3443         (WebKit::WebEditCommandProxy::unapply):
3444         (WebKit::WebEditCommandProxy::reapply):
3445         * UIProcess/WebPageProxy.cpp:
3446         (WebKit::WebPageProxy::registerEditCommandForUndo):
3447         (WebKit::WebPageProxy::canUndoRedo):
3448         (WebKit::WebPageProxy::executeUndoRedo):
3449         (WebKit::WebPageProxy::canUndo):
3450         (WebKit::WebPageProxy::canRedo):
3451         * UIProcess/WebPageProxy.h:
3452         * UIProcess/WebPageProxy.messages.in:
3453         * UIProcess/ios/PageClientImplIOS.h:
3454         * UIProcess/ios/PageClientImplIOS.mm:
3455         (WebKit::PageClientImpl::registerEditCommand):
3456         (WebKit::PageClientImpl::canUndoRedo):
3457         (WebKit::PageClientImpl::executeUndoRedo):
3458         * UIProcess/mac/PageClientImplMac.h:
3459         * UIProcess/mac/PageClientImplMac.mm:
3460         (WebKit::PageClientImpl::registerEditCommand):
3461         (WebKit::PageClientImpl::canUndoRedo):
3462         (WebKit::PageClientImpl::executeUndoRedo):
3463         * UIProcess/mac/WebContextMenuProxyMac.mm:
3464         * WebKit.xcodeproj/project.pbxproj:
3465         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3466         (WebKit::WebEditorClient::canUndo const):
3467         (WebKit::WebEditorClient::canRedo const):
3468         (WebKit::WebEditorClient::undo):
3469         (WebKit::WebEditorClient::redo):
3470
3471 2018-07-27  Alex Christensen  <achristensen@webkit.org>
3472
3473         Make CompletionHandler more const correct
3474         https://bugs.webkit.org/show_bug.cgi?id=186543
3475
3476         Reviewed by Saam Barati.
3477
3478         * NetworkProcess/PingLoad.cpp:
3479         (WebKit::PingLoad::willPerformHTTPRedirection):
3480         * NetworkProcess/cache/CacheStorageEngine.cpp:
3481         (WebKit::CacheStorage::Engine::clearAllCaches):
3482         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
3483         (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
3484         * UIProcess/Automation/WebAutomationSession.cpp:
3485         (WebKit::WebAutomationSession::simulateMouseInteraction):
3486         (WebKit::WebAutomationSession::simulateKeyboardInteraction):
3487         * UIProcess/Cocoa/AutomationSessionClient.mm:
3488         (WebKit::AutomationSessionClient::requestNewPageWithOptions):
3489         (WebKit::AutomationSessionClient::requestSwitchToPage):
3490         (WebKit::AutomationSessionClient::requestHideWindowOfPage):
3491         (WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
3492         * UIProcess/Cocoa/UIDelegate.mm:
3493         (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
3494         (WebKit::UIDelegate::UIClient::createNewPage):
3495         (WebKit::UIDelegate::UIClient::runJavaScriptAlert):
3496         (WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
3497         (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
3498         (WebKit::UIDelegate::UIClient::requestStorageAccessConfirm):
3499         (WebKit::UIDelegate::UIClient::decidePolicyForGeolocationPermissionRequest):
3500         (WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel):
3501         (WebKit::UIDelegate::UIClient::decidePolicyForNotificationPermissionRequest):
3502         (WebKit::UIDelegate::UIClient::runOpenPanel):
3503         * UIProcess/WebPageProxy.cpp:
3504         (WebKit::WebPageProxy::createNewPage):
3505         (WebKit::WebPageProxy::webGLPolicyForURL):
3506         (WebKit::WebPageProxy::resolveWebGLPolicyForURL):
3507         (WebKit::WebPageProxy::getWindowFrame):
3508         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3509         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
3510         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
3511         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
3512         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
3513
3514 2018-07-27  Simon Fraser  <simon.fraser@apple.com>
3515
3516         Be more conservative with compositing layer creation when memory is low
3517         https://bugs.webkit.org/show_bug.cgi?id=187866
3518         rdar://problem/42366345
3519
3520         Reviewed by Zalan Bujtas.
3521         
3522         When process physical footprint is above a fraction of the jetsam limit, be more conservative in making
3523         compositing layers. We avoid compositing for these situations:
3524         1. Layers with 3D transforms which are affine (like translateZ(0)).
3525         2. Layers with will-change
3526         3. Layers for canvases (other than WebGL/WebGPU)
3527         
3528         We reuse some macOS code in MemoryPressureHandler() but choose different thresholds for iOS,
3529         falling into "conservative mode" at 50% of jetsam limit, and "strict mode" at 65%.
3530         Compositing chooses to be more conservative in either "conservative" or "strict" memory modes.
3531         
3532         Plumb through a "compositingPolicyOverride" both so that on-device testing isn't
3533         flakily falling into a different mode, and so that we can impose the conservative
3534         mode for testing.
3535
3536         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3537         (WKBundlePageSetCompositingPolicyOverride):
3538         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
3539
3540 2018-07-27  Alex Christensen  <achristensen@webkit.org>
3541
3542         Add RefCounted CompletionHandler wrapping abstraction for sending policy decisions back to WebProcess
3543         https://bugs.webkit.org/show_bug.cgi?id=188089
3544
3545         Reviewed by Geoffrey Garen.
3546
3547         This will be necessary for when I add an asynchronous parallel step to decidePolicyForNavigationAction.
3548         We will want to wait for that asynchronous step for decidePolicyForNavigationActionSync but not for a client.
3549
3550         No change in behavior.
3551
3552         * UIProcess/WebPageProxy.cpp:
3553         (WebKit::WebPageProxy::PolicyDecisionSender::create):
3554         (WebKit::WebPageProxy::PolicyDecisionSender::operator()):
3555         (WebKit::WebPageProxy::PolicyDecisionSender::PolicyDecisionSender):
3556         (WebKit::WebPageProxy::receivedPolicyDecision):
3557         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
3558         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3559         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
3560         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
3561         (WebKit::WebPageProxy::decidePolicyForResponse):
3562         * UIProcess/WebPageProxy.h:
3563         * UIProcess/WebPageProxy.messages.in:
3564         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3565         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3566
3567 2018-07-27  Saam Barati  <sbarati@apple.com>
3568
3569         Use SPI to compute the jetsam limit on iOS instead of hardcoding 840MB
3570         https://bugs.webkit.org/show_bug.cgi?id=188091
3571         <rdar://problem/42647697>
3572
3573         Reviewed by Simon Fraser.
3574
3575         Give the Network/Storage/WebContent process the com.apple.private.memorystatus
3576         entitlement. This allows them to read the process jetsam limit.
3577
3578         * Configurations/Databases-iOS.entitlements:
3579         * Configurations/Network-iOS.entitlements:
3580         * Configurations/WebContent-iOS.entitlements:
3581
3582 2018-07-03  David Fenton  <david_fenton@apple.com>
3583
3584         Unreviewed, rolling out r233461.
3585
3586         assertions triggered on ios11 Debug wk2
3587
3588         Reverted changeset:
3589
3590         "[iOS] Add assert to catch improper use of WebCore::Timer in
3591         UI Process"
3592         https://bugs.webkit.org/show_bug.cgi?id=185330
3593         https://trac.webkit.org/changeset/233461
3594
3595 2018-07-27  Alex Christensen  <achristensen@webkit.org>
3596
3597         Remove unused WKNavigationDelegatePrivate decidePolicyForNavigationAction SPI
3598         https://bugs.webkit.org/show_bug.cgi?id=188077
3599
3600         Reviewed by Darin Adler.
3601
3602         The one client has moved to the version with userInfo, and it never used the SPI
3603         on old operating systems.
3604
3605         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3606         * UIProcess/Cocoa/NavigationState.h:
3607         * UIProcess/Cocoa/NavigationState.mm:
3608         (WebKit::NavigationState::setNavigationDelegate):
3609         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
3610
3611 2018-07-27  Alex Christensen  <achristensen@webkit.org>
3612
3613         Begin making WKWebViewConfiguration a wrapper around an API::PageConfiguration
3614         https://bugs.webkit.org/show_bug.cgi?id=188030
3615
3616         Reviewed by Sam Weinig.
3617
3618         Eventually WKWebViewConfiguration should become just a API::ObjectStorage<API::PageConfiguration>.
3619         The transition includes adding fields that exist in WKWebViewConfiguration to API::PageConfiguration
3620         and making WKWebViewConfiguration's getters and setters just call API::PageConfiguration's corresponding methods
3621         instead of having an ivar for each value then copying it to an API::PageConfiguration we construct in
3622         the WKWebView constructor.  To transition incrementally, I've added a RefPtr<API::PageConfiguration> ivar to
3623         WKWebViewConfiguration and moved a few ivars to use the values stored in that API::PageConfiguration instead.
3624         I've arbitrarily chosen _treatsSHA1SignedCertificatesAsInsecure and _urlSchemeHandlers as the first two 
3625         properties to transition, and I'll continue transitioning each ivar in small, easy-to-review bunches.
3626
3627         * UIProcess/API/APIPageConfiguration.cpp:
3628         (API::PageConfiguration::copy const):
3629         (API::PageConfiguration::urlSchemeHandlerForURLScheme):
3630         (API::PageConfiguration::setURLSchemeHandlerForURLScheme):
3631         * UIProcess/API/APIPageConfiguration.h:
3632         (API::PageConfiguration::urlSchemeHandlers):
3633         * UIProcess/API/Cocoa/WKWebView.mm:
3634         (-[WKWebView _initializeWithConfiguration:]):
3635         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3636         (-[WKWebViewConfiguration init]):
3637         (-[WKWebViewConfiguration copyWithZone:]):
3638         (-[WKWebViewConfiguration setURLSchemeHandler:forURLScheme:]):
3639         (-[WKWebViewConfiguration urlSchemeHandlerForURLScheme:]):
3640         (-[WKWebViewConfiguration copyPageConfiguration]):
3641         (-[WKWebViewConfiguration _treatsSHA1SignedCertificatesAsInsecure]):
3642         (-[WKWebViewConfiguration _setTreatsSHA1SignedCertificatesAsInsecure:]):
3643         (-[WKWebViewConfiguration _urlSchemeHandlers]): Deleted.
3644         * UIProcess/API/Cocoa/WKWebViewConfigurationInternal.h:
3645
3646 2018-07-27  Chris Dumez  <cdumez@apple.com>
3647
3648         Loading a file URL and then issuing a reload right away causes the load to fail due to sandboxing
3649         https://bugs.webkit.org/show_bug.cgi?id=188078
3650         <rdar://problem/42562493>
3651
3652         Unreviewed, follow-up fix after r234290 to address assertion hits on the bots. Make the fix
3653         specific to reloads as we know the existing provisional sandbox extension is for the same
3654         URL then.
3655
3656         * WebProcess/WebPage/WebPage.cpp:
3657         (WebKit::WebPage::reload):
3658         (WebKit::WebPage::SandboxExtensionTracker::beginLoad):
3659         (WebKit::WebPage::SandboxExtensionTracker::beginReload):
3660         * WebProcess/WebPage/WebPage.h:
3661
3662 2018-07-26  Andy VanWagoner  <andy@vanwagoner.family>
3663
3664         [INTL] Remove INTL sub-feature compile flags
3665         https://bugs.webkit.org/show_bug.cgi?id=188081
3666
3667         Reviewed by Michael Catanzaro.
3668
3669         * Configurations/FeatureDefines.xcconfig:
3670
3671 2018-07-26  Chris Dumez  <cdumez@apple.com>
3672
3673         Loading a file URL and then issuing a reload right away causes the load to fail due to sandboxing
3674         https://bugs.webkit.org/show_bug.cgi?id=188078
3675         <rdar://problem/42562493>
3676
3677         Reviewed by Geoff Garen.
3678
3679         When WebPageProxy::loadFile() is called, we create a SandboxExtension::Handle for the resource path provided
3680         by the caller and pass it to the WebProcess. WebPage::loadRequest() then calls SandboxExtensionTracker::beginLoad()
3681         to store this handle in m_provisionalSandboxExtension for later consumption.
3682
3683         If a reload is issued before this sandbox extension has been consumed, then the following happens:
3684         1. WebPageProxy::reload() does NOT create a SandboxExtension::Handle because it has already issued one earlier.
3685            maybeInitializeSandboxExtensionHandle() returns early due to m_process->hasAssumedReadAccessToURL(url) check.
3686         2. WebPage::reload() then calls SandboxExtensionTracker::beginLoad() with a null handle, which overwrites the
3687            previous m_provisionalSandboxExtension its needs.
3688         3. The load fails because the WebContent process is missing the sandbox extension.
3689
3690         To address the issue, SandboxExtensionTracker::beginLoad() is updated to only overwrite m_provisionalSandboxExtension
3691         if the new handle is not null. This avoids inadvertently clearing a valid sandbox extension we may need for the load,
3692         since the UIProcess sends us a null handle if it previously sent us a sandbox extension for the path in question.
3693
3694         * WebProcess/WebPage/WebPage.cpp:
3695         (WebKit::WebPage::SandboxExtensionTracker::beginLoad):
3696
3697 2018-07-26  Chris Dumez  <cdumez@apple.com>
3698
3699         It should be possible to use WTF::CallbackAggregator from a background thread
3700         https://bugs.webkit.org/show_bug.cgi?id=188084
3701
3702         Reviewed by Alex Christensen.
3703
3704         This code was passing CallbackAggregator objects for background thread and not being
3705         careful on which thread the CallbackAggregator gets destroyed. This patch fixes this
3706         since the CallbackAggregator destructor no longer takes care of dispatching to the
3707         main thread.
3708
3709         * NetworkProcess/cache/CacheStorageEngine.cpp:
3710         (WebKit::CacheStorage::Engine::clearAllCaches):
3711         (WebKit::CacheStorage::Engine::clearCachesForOrigin):
3712
3713 2018-07-26  Ross Kirsling  <ross.kirsling@sony.com>
3714
3715         String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter
3716         https://bugs.webkit.org/show_bug.cgi?id=187963
3717
3718         Reviewed by Alex Christensen.
3719
3720         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
3721         (WebKit::CacheStorage::updateVaryInformation):
3722         * NetworkProcess/capture/NetworkCaptureManager.cpp:
3723         (WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
3724         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
3725         (WebKit::getPluginInfoFromPropertyLists):
3726         (WebKit::PluginVersion::parse):
3727         * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
3728         (WebKit::NetscapePluginModule::parseMIMEDescription):
3729         * Shared/Plugins/unix/PluginSearchPath.cpp:
3730         (WebKit::pluginsDirectories):
3731         * Shared/mac/ChildProcessMac.mm:
3732         (WebKit::ChildProcess::initializeSandbox):
3733         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
3734         * UIProcess/Automation/WebAutomationSession.cpp:
3735         (WebKit::fileCanBeAcceptedForUpload):
3736         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
3737         (WebKit::ProcessLauncher::launchProcess):
3738         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3739         (WebKit::ProcessLauncher::launchProcess):
3740         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
3741         (WebKit::PluginProcessProxy::scanPlugin):
3742         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
3743         (WebKit::isTransparentSilverlightBackgroundValue):
3744         Update split/splitAllowingEmptyEntries usage.
3745
3746 2018-07-26  Alex Christensen  <achristensen@webkit.org>
3747
3748         Fix assertions introduced in r234210
3749         https://bugs.webkit.org/show_bug.cgi?id=188074
3750
3751         Reviewed by Chris Dumez.
3752
3753         There is a client that uses WKFramePolicyListenerUseWithPolicies to send website policies as
3754         a response to the WKPageNavigationClient's decidePolicyForNavigationResponse.  That is wasting
3755         effort to generate policies that don't change anything. Once that client adopts WKWebView
3756         they won't be able to do this any more, so temporarily remove the assertion.
3757         Also, make the assertion about process swapping a release assert to prevent that client
3758         from adopting WKFramePolicyListenerUseInNewProcessWithPolicies for navigation responses.
3759         It should only be used for navigation actions.
3760
3761         * UIProcess/WebPageProxy.cpp:
3762         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
3763         (WebKit::WebPageProxy::decidePolicyForResponse):
3764
3765 2018-07-26  Commit Queue  <commit-queue@webkit.org>
3766
3767         Unreviewed, rolling out r234181 and r234189.
3768         https://bugs.webkit.org/show_bug.cgi?id=188075
3769
3770         These are not needed right now (Requested by thorton on
3771         #webkit).
3772
3773         Reverted changesets:
3774
3775         "Enable Web Content Filtering on watchOS"
3776         https://bugs.webkit.org/show_bug.cgi?id=187979
3777         https://trac.webkit.org/changeset/234181
3778
3779         "HAVE(PARENTAL_CONTROLS) should be true on watchOS"
3780         https://bugs.webkit.org/show_bug.cgi?id=187985
3781         https://trac.webkit.org/changeset/234189
3782
3783 2018-07-26  Chris Dumez  <cdumez@apple.com>
3784
3785         ERROR: Unhandled web process message 'WebPage:SetUseDarkAppearance' when browsing in dark mode
3786         https://bugs.webkit.org/show_bug.cgi?id=188028
3787
3788         Reviewed by Wenson Hsieh.
3789
3790         The issue was that the WebViewImpl constructor was calling setUseDarkAppearance() *before* calling
3791         initializeWebPage(), which would cause us to send IPC the WebContent process for a pageID that does
3792         not exist on WebProcess side yet.
3793
3794         To address the issue, the WebViewImpl constructor no longer calls setUseDarkAppearance() and WebPageProxy
3795         no longer holds a flag indicates is dark appearance is used. Instead, the WebPageProxy asks the WebView
3796         for the value whenever it needs to, via the PageClient.
3797
3798         * UIProcess/Cocoa/WebViewImpl.h:
3799         * UIProcess/Cocoa/WebViewImpl.mm:
3800         (WebKit::WebViewImpl::WebViewImpl):
3801         (WebKit::WebViewImpl::effectiveAppearanceDidChange):
3802         (WebKit::WebViewImpl::setUseDarkAppearance): Deleted.
3803         * UIProcess/PageClient.h:
3804         * UIProcess/WebPageProxy.cpp:
3805         (WebKit::WebPageProxy::creationParameters):
3806         (WebKit::WebPageProxy::useDarkAppearance const):
3807         (WebKit::WebPageProxy::effectiveAppearanceDidChange):
3808         (WebKit::WebPageProxy::showPlaybackTargetPicker):
3809         (WebKit::WebPageProxy::setUseDarkAppearance): Deleted.
3810         * UIProcess/WebPageProxy.h:
3811         (WebKit::WebPageProxy::useDarkAppearance const): Deleted.
3812         * UIProcess/mac/PageClientImplMac.h:
3813         * UIProcess/mac/PageClientImplMac.mm:
3814         (WebKit::PageClientImpl::effectiveAppearanceIsDark const):
3815
3816 2018-07-26  Sihui Liu  <sihui_liu@apple.com>
3817
3818         Remove a forward protocol declaration of '_WKWebViewPrintProvider'
3819         https://bugs.webkit.org/show_bug.cgi?id=188012
3820         <rdar://problem/42309526>
3821
3822         Reviewed by Darin Adler.
3823
3824         @procotol() expressions emit invalid protocol metadata when used with forward @protocol declarations. 
3825         Clang is going to make it an error for using a forward-declared protocol in a @protocol expression, so
3826         we need to stop doing this.
3827
3828         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3829
3830 2018-07-26  Chris Dumez  <cdumez@apple.com>
3831
3832         Disable Dark Mode in the Plugin process to avoid rendering issues
3833         https://bugs.webkit.org/show_bug.cgi?id=188059
3834         <rdar://problem/42369281>
3835
3836         Reviewed by Tim Horton.
3837
3838         Plugins generally do not support dark mode and this causes rendering issues so
3839         disable dark mode in the plugin process.
3840
3841         * PluginProcess/mac/PluginProcessMac.mm:
3842         (WebKit::PluginProcess::platformInitializePluginProcess):
3843
3844 2018-07-26  Chris Dumez  <cdumez@apple.com>
3845
3846         WebSiteData-related methods should take in CompletionHandlers instead of Functions
3847         https://bugs.webkit.org/show_bug.cgi?id=188027
3848
3849         Reviewed by Alex Christensen.
3850
3851         WebSiteData-related methods should take in CompletionHandlers instead of Functions since
3852         they are need to be called and are only called once.
3853
3854         * UIProcess/Network/NetworkProcessProxy.cpp:
3855         (WebKit::NetworkProcessProxy::fetchWebsiteData):
3856         (WebKit::NetworkProcessProxy::deleteWebsiteData):
3857         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
3858         * UIProcess/Network/NetworkProcessProxy.h:
3859         * UIProcess/Plugins/PluginProcessProxy.cpp:
3860         (WebKit::PluginProcessProxy::fetchWebsiteData):
3861         (WebKit::PluginProcessProxy::deleteWebsiteData):
3862         (WebKit::PluginProcessProxy::deleteWebsiteDataForHostNames):
3863         * UIProcess/Plugins/PluginProcessProxy.h:
3864         * UIProcess/Storage/StorageProcessProxy.cpp:
3865         (WebKit::StorageProcessProxy::fetchWebsiteData):
3866         (WebKit::StorageProcessProxy::deleteWebsiteData):
3867         (WebKit::StorageProcessProxy::deleteWebsiteDataForOrigins):
3868         * UIProcess/Storage/StorageProcessProxy.h:
3869         * UIProcess/WebProcessProxy.cpp:
3870         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
3871         (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData):
3872         (WebKit::WebProcessProxy::fetchWebsiteData):
3873         (WebKit::WebProcessProxy::deleteWebsiteData):
3874         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
3875         * UIProcess/WebProcessProxy.h:
3876
3877 2018-07-26  Miguel Gomez  <magomez@igalia.com>
3878
3879         [GTK][WPE] Improve the way request displayRefresh notifications
3880         https://bugs.webkit.org/show_bug.cgi?id=188005
3881
3882         Reviewed by Žan Doberšek.
3883
3884         Add a new interface ThreadedDisplayRefreshMonitor::Client and use it to pipe the the
3885         requestDisplayRefreshMonitorUpdate and handleDisplayRefreshMonitorUpdate to the
3886         ThreadedCoordinatedLayerTreeHost.
3887
3888         In response to requestDisplayRefreshMonitorUpdate, the LayerTreeHost will force a layer
3889         flush that in the end causes a repaint, which generates the requested display refresh
3890         event.
3891
3892         In response to handleDisplayRefreshMonitorUpdate, the call to renderNextFrame will happen,
3893         and if the DisplayRefreshMonitor has been rescheduled, renderNextFrame will also force
3894         a new layer flush, causing the repaint that will generate the display refreh event.
3895
3896         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3897         (WebKit::ThreadedCompositor::create):
3898         (WebKit::ThreadedCompositor::ThreadedCompositor):
3899         (WebKit::m_displayRefreshMonitor):
3900         (WebKit::ThreadedCompositor::handleDisplayRefreshMonitorUpdate):
3901         (WebKit::ThreadedCompositor::requestDisplayRefreshMonitorUpdate): Deleted.
3902         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
3903         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
3904         (WebKit::ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor):
3905         (WebKit::ThreadedDisplayRefreshMonitor::requestRefreshCallback):
3906         (WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback):
3907         (WebKit::ThreadedDisplayRefreshMonitor::invalidate):
3908         (WebKit::ThreadedDisplayRefreshMonitor::displayRefreshCallback):
3909         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h:
3910         (WebKit::ThreadedDisplayRefreshMonitor::create):
3911         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
3912         (WebKit::CoordinatedLayerTreeHost::renderNextFrame):
3913         (WebKit::CoordinatedLayerTreeHost::flushLayersAndForceRepaint):
3914         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
3915         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
3916         (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost):
3917         (WebKit::ThreadedCoordinatedLayerTreeHost::requestDisplayRefreshMonitorUpdate):
3918         (WebKit::ThreadedCoordinatedLayerTreeHost::handleDisplayRefreshMonitorUpdate):
3919         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
3920
3921 2018-07-25  Brent Fulgham  <bfulgham@apple.com>
3922
3923         [macOS] Update sandboxes for revised OpenCL calls and streaming media
3924         https://bugs.webkit.org/show_bug.cgi?id=188013
3925         <rdar://problem/42594262>
3926
3927         Reviewed by Eric Carlson.
3928
3929         Testing logs from recent Mojave builds shows that OpenCL is checking more CPU-specific values as part of WebKit
3930         painting operations. We need to allow these checks in the sandbox to support these more optimized drawing operations.
3931
3932         I also corrected some sandbox violations I found while investigating streaming media issues.
3933
3934         * WebProcess/com.apple.WebProcess.sb.in:
3935
3936 2018-07-25  Jeremy Jones  <jeremyj@apple.com>
3937
3938         Mask AVBackgroundView to the corner radius.
3939         https://bugs.webkit.org/show_bug.cgi?id=187976
3940         rdar://problem/41810866
3941
3942         Reviewed by Jon Lee.
3943
3944         This changes sets the appropriate mask to the layer so the corners look correct.
3945
3946         * UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
3947         (-[WKFullscreenStackView init]):
3948
3949 2018-07-25  Zalan Bujtas  <zalan@apple.com>
3950
3951         REGRESSION(r227577) Text on TV & Movies page doesn't wrap properly in iTunes
3952         https://bugs.webkit.org/show_bug.cgi?id=188018
3953         <rdar://problem/42517520>
3954
3955         Reviewed by Dean Jackson.
3956
3957         * WebProcess/WebPage/WebPage.cpp:
3958         (WebKit::m_credentialsMessenger):
3959
3960 2018-07-25  Tim Horton  <timothy_horton@apple.com>
3961
3962         Fix the build.
3963
3964         * UIProcess/mac/ServicesController.mm:
3965         (WebKit::hasCompatibleServicesForItems):
3966         I can't even.
3967
3968 2018-07-25  Tim Horton  <timothy_horton@apple.com>
3969
3970         Crashing on some builds that don't have async NSSharingService API
3971         https://bugs.webkit.org/show_bug.cgi?id=188015
3972         <rdar://problem/42593935>
3973