24a03c1e4aeff3662c73fe31ebac5ee9443fbc75
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-07-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
2
3         [iOS] When bringing MobileSafari to the foreground, images, which are pending decoding, won't be drawn into the immediate-paint transaction
4         https://bugs.webkit.org/show_bug.cgi?id=187375
5
6         Reviewed by Simon Fraser.
7
8         For immediate-paint transaction, we should force all the images which are 
9         pending decoding to be repainted before building this transaction.
10
11         * WebProcess/Plugins/PDF/PDFPlugin.mm:
12         (WebKit::PDFPlugin::updateControlTints):
13         * WebProcess/Plugins/PluginView.cpp:
14         (WebKit::PluginView::paint):
15         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
16         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
17
18 2018-07-11  Dean Jackson  <dino@apple.com>
19
20         Allow removal of white backgrounds
21         https://bugs.webkit.org/show_bug.cgi?id=187574
22         <rdar://problem/41146792>
23
24         Reviewed by Simon Fraser.
25
26         Add a new WebPreference for punching out white backgrounds.
27
28         * Shared/WebPreferences.yaml:
29         * UIProcess/API/C/WKPreferences.cpp:
30         (WKPreferencesSetPunchOutWhiteBackgroundsInDarkMode):
31         (WKPreferencesGetPunchOutWhiteBackgroundsInDarkMode):
32         * UIProcess/API/C/WKPreferencesRefPrivate.h:
33         * UIProcess/API/Cocoa/WKWebView.mm:
34         (-[WKWebView _initializeWithConfiguration:]):
35         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
36         (-[WKWebViewConfiguration init]):
37         (-[WKWebViewConfiguration copyWithZone:]):
38         (-[WKWebViewConfiguration _punchOutWhiteBackgroundsInDarkMode]):
39         (-[WKWebViewConfiguration _setPunchOutWhiteBackgroundsInDarkMode:]):
40         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
41
42 2018-07-16  Aditya Keerthi  <akeerthi@apple.com>
43
44         [Datalist][macOS] Add suggestions UI for TextFieldInputTypes
45         https://bugs.webkit.org/show_bug.cgi?id=186531
46
47         Reviewed by Tim Horton.
48
49         Created WebDataListSuggestionsDropdownMac as a wrapper around the suggestions
50         view. The suggestions for TextFieldInputTypes are displayed using an NSTableView
51         in it's own child window. This is done so that suggestions can be presented
52         outside of the page if the parent window's size is too small. The maximum number
53         of suggestions that are visible at one time is 6, with additional suggestions made
54         available by scrolling.
55
56         Suggestions in the view can be selected via click or by using arrow keys. If the
57         input element associated with the suggestions is blurred, or the page is moved in
58         any way, the suggestions view is hidden.
59
60         Added IPC messages to the UIProcess to enable the display of the suggestions view.
61         This required a new ArgumentCoder for DataListSuggestionInformation.
62
63         * Shared/WebCoreArgumentCoders.cpp:
64         (IPC::ArgumentCoder<DataListSuggestionInformation>::encode):
65         (IPC::ArgumentCoder<DataListSuggestionInformation>::decode):
66         * Shared/WebCoreArgumentCoders.h:
67         * UIProcess/PageClient.h:
68         * UIProcess/WebDataListSuggestionsDropdown.cpp: Copied from Source/WebKit/WebProcess/WebCoreSupport/WebDataListSuggestionPicker.h.
69         (WebKit::WebDataListSuggestionsDropdown::WebDataListSuggestionsDropdown):
70         (WebKit::WebDataListSuggestionsDropdown::~WebDataListSuggestionsDropdown):
71         (WebKit::WebDataListSuggestionsDropdown::close):
72         * UIProcess/WebDataListSuggestionsDropdown.h: Copied from Source/WebKit/WebProcess/WebCoreSupport/WebDataListSuggestionPicker.h.
73         (WebKit::WebDataListSuggestionsDropdown::Client::~Client):
74         * UIProcess/WebPageProxy.cpp:
75         (WebKit::WebPageProxy::viewWillStartLiveResize):
76         (WebKit::WebPageProxy::viewDidLeaveWindow):
77         (WebKit::WebPageProxy::handleWheelEvent):
78         (WebKit::WebPageProxy::setPageZoomFactor):
79         (WebKit::WebPageProxy::setPageAndTextZoomFactors):
80         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
81         (WebKit::WebPageProxy::pageDidScroll):
82         (WebKit::WebPageProxy::showDataListSuggestions):
83         (WebKit::WebPageProxy::handleKeydownInDataList):
84         (WebKit::WebPageProxy::endDataListSuggestions):
85         (WebKit::WebPageProxy::didCloseSuggestions):
86         (WebKit::WebPageProxy::didSelectOption):
87         (WebKit::WebPageProxy::resetState):
88         (WebKit::WebPageProxy::closeOverlayedViews):
89         * UIProcess/WebPageProxy.h:
90         * UIProcess/WebPageProxy.messages.in:
91         * UIProcess/ios/PageClientImplIOS.h:
92         * UIProcess/ios/PageClientImplIOS.mm:
93         (WebKit::PageClientImpl::createDataListSuggestionsDropdown):
94         * UIProcess/mac/PageClientImplMac.h:
95         * UIProcess/mac/PageClientImplMac.mm:
96         (WebKit::PageClientImpl::createDataListSuggestionsDropdown):
97         * UIProcess/mac/WebDataListSuggestionsDropdownMac.h: Copied from Source/WebKit/WebProcess/WebCoreSupport/WebDataListSuggestionPicker.h.
98         * UIProcess/mac/WebDataListSuggestionsDropdownMac.mm: Added.
99         (WebKit::WebDataListSuggestionsDropdownMac::create):
100         (WebKit::WebDataListSuggestionsDropdownMac::~WebDataListSuggestionsDropdownMac):
101         (WebKit::WebDataListSuggestionsDropdownMac::WebDataListSuggestionsDropdownMac):
102         (WebKit::WebDataListSuggestionsDropdownMac::show):
103         (WebKit::WebDataListSuggestionsDropdownMac::didSelectOption):
104         (WebKit::WebDataListSuggestionsDropdownMac::selectOption):
105         (WebKit::WebDataListSuggestionsDropdownMac::handleKeydownWithIdentifier):
106         (WebKit::WebDataListSuggestionsDropdownMac::close):
107         (-[WKDataListSuggestionCell initWithFrame:]):
108         (-[WKDataListSuggestionCell setText:]):
109         (-[WKDataListSuggestionCell setActive:]):
110         (-[WKDataListSuggestionCell drawRect:]):
111         (-[WKDataListSuggestionCell mouseEntered:]):
112         (-[WKDataListSuggestionCell mouseExited:]):
113         (-[WKDataListSuggestionCell acceptsFirstResponder]):
114         (-[WKDataListSuggestionTable initWithElementRect:]):
115         (-[WKDataListSuggestionTable setVisibleRect:]):
116         (-[WKDataListSuggestionTable currentActiveRow]):
117         (-[WKDataListSuggestionTable setActiveRow:]):
118         (-[WKDataListSuggestionTable reload]):
119         (-[WKDataListSuggestionTable acceptsFirstResponder]):
120         (-[WKDataListSuggestionTable enclosingScrollView]):
121         (-[WKDataListSuggestionTable removeFromSuperviewWithoutNeedingDisplay]):
122         (-[WKDataListSuggestionsView initWithInformation:inView:]):
123         (-[WKDataListSuggestionsView currentSelectedString]):
124         (-[WKDataListSuggestionsView updateWithInformation:]):
125         (-[WKDataListSuggestionsView moveSelectionByDirection:]):
126         (-[WKDataListSuggestionsView invalidate]):
127         (-[WKDataListSuggestionsView dropdownRectForElementRect:]):
128         (-[WKDataListSuggestionsView showSuggestionsDropdown:]):
129         (-[WKDataListSuggestionsView selectedRow:]):
130         (-[WKDataListSuggestionsView numberOfRowsInTableView:]):
131         (-[WKDataListSuggestionsView tableView:heightOfRow:]):
132         (-[WKDataListSuggestionsView tableView:viewForTableColumn:row:]):
133         * WebKit.xcodeproj/project.pbxproj:
134         * WebProcess/WebCoreSupport/WebDataListSuggestionPicker.cpp:
135         (WebKit::WebDataListSuggestionPicker::handleKeydownWithIdentifier):
136         (WebKit::WebDataListSuggestionPicker::didSelectOption):
137         (WebKit::WebDataListSuggestionPicker::didCloseSuggestions):
138         (WebKit::WebDataListSuggestionPicker::close):
139         (WebKit::WebDataListSuggestionPicker::displayWithActivationType):
140         * WebProcess/WebCoreSupport/WebDataListSuggestionPicker.h:
141
142 2018-07-16  Jeremy Jones  <jeremyj@apple.com>
143
144         Fullscreen requires active document.
145         https://bugs.webkit.org/show_bug.cgi?id=186226
146         rdar://problem/36187413
147
148         Reviewed by Jer Noble.
149
150         This change guarantees the document to be visible for both element fullscreen and video fullscreen.
151
152         User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
153         because JavaScript can spin wait before initiating fullscreen. During that spin the page or window might
154         be hidden.
155
156         Document::hidden() can't be relied upon because it won't update while JavaScript spins.
157
158         This change adds a sync call to the UI process to get the current UI visibility state.
159
160         * UIProcess/WebPageProxy.cpp:
161         (WebKit::WebPageProxy::getIsViewVisible):
162         * UIProcess/WebPageProxy.h:
163         * UIProcess/WebPageProxy.messages.in:
164         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
165         (WebKit::WebChromeClient::isViewVisible):
166         * WebProcess/WebCoreSupport/WebChromeClient.h:
167
168 2018-07-16  Tim Horton  <timothy_horton@apple.com>
169
170         REGRESSION (r233502): Camera in <input type=file> becomes unresponsive after attempting to dismiss it
171         https://bugs.webkit.org/show_bug.cgi?id=187706
172         <rdar://problem/42137088>
173
174         Reviewed by Wenson Hsieh.
175
176         * UIProcess/ios/forms/WKFileUploadPanel.mm:
177         Remove an unused member.
178
179         (-[WKFileUploadPanel _dismissDisplayAnimated:]):
180         Allow us to dismiss the camera view controller in addition to the menu.
181
182 2018-07-16  Alex Christensen  <achristensen@webkit.org>
183
184         Reduce size of NetworkLoadMetrics and therefore ResourceResponse
185         https://bugs.webkit.org/show_bug.cgi?id=187671
186
187         Reviewed by Darin Adler.
188
189         * Shared/WebCoreArgumentCoders.h:
190
191 2018-07-16  Sihui Liu  <sihui_liu@apple.com>
192
193         IndexedDB: closeAndDeleteDatabasesForOrigins should remove all databases for those origins
194         https://bugs.webkit.org/show_bug.cgi?id=187631
195         <rdar://problem/42164227>
196
197         Reviewed by Brady Eidson.
198
199         We need to return all origins, both openingOrigin and mainFrameOrigin, of IndexedDB so users
200         could be better aware of which origins are using databases and decide what they want to 
201         remove.
202
203         * StorageProcess/StorageProcess.cpp:
204         (WebKit::StorageProcess::indexedDatabaseOrigins):
205         * StorageProcess/StorageProcess.h:
206
207 2018-07-15  Carlos Garcia Campos  <cgarcia@igalia.com>
208
209         [SOUP] http/tests/misc/bubble-drag-events.html crashes
210         https://bugs.webkit.org/show_bug.cgi?id=182352
211
212         Reviewed by Youenn Fablet.
213
214         PingLoad is not refcounted and deletes itself when the load finishes. The problem is that the network data
215         task can also finish the load, causing the PingLoad to be deleted early. We tried to fix it in r233032 in the
216         network data task soup implementation, but it caused regressions.
217
218         * NetworkProcess/PingLoad.cpp:
219         (WebKit::PingLoad::didReceiveChallenge): Create a weak ref for the ping load before calling the operation completion
220         handler and return early after the completion handler if it was deleted.
221         (WebKit::PingLoad::didReceiveResponseNetworkSession): Ditto.
222         * NetworkProcess/PingLoad.h:
223         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
224         (WebKit::NetworkDataTaskSoup::continueAuthenticate): Revert r233032.
225
226 2018-07-13  Timothy Hatcher  <timothy@apple.com>
227
228         Add _drawsBackground to WKWebViewConfiguration.
229         https://bugs.webkit.org/show_bug.cgi?id=187665
230         rdar://problem/42182268
231
232         Reviewed by Tim Horton.
233
234         * UIProcess/API/APIPageConfiguration.cpp:
235         (API::PageConfiguration::copy const): Copy m_drawsBackground, and some missing values.
236         * UIProcess/API/APIPageConfiguration.h:
237         (API::PageConfiguration::drawsBackground const): Added.
238         (API::PageConfiguration::setDrawsBackground): Added.
239         * UIProcess/API/Cocoa/WKWebView.mm:
240         (-[WKWebView _initializeWithConfiguration:]): Transfer _drawsBackground to page config.
241         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
242         (-[WKWebViewConfiguration init]): Set _drawsBackground to YES.
243         (-[WKWebViewConfiguration encodeWithCoder:]): Encode _drawsBackground.
244         (-[WKWebViewConfiguration initWithCoder:]): Decode _drawsBackground.
245         (-[WKWebViewConfiguration copyWithZone:]): Copy _drawsBackground.
246         (-[WKWebViewConfiguration _drawsBackground]): Added.
247         (-[WKWebViewConfiguration _setDrawsBackground:]): Added.
248         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
249         * UIProcess/WebPageProxy.cpp: Set m_drawsBackground based on configuration.
250
251 2018-07-13  Tim Horton  <timothy_horton@apple.com>
252
253         WebKit sometimes holds WiFi/BT assertions while the Networking process is suspended
254         https://bugs.webkit.org/show_bug.cgi?id=187662
255         <rdar://problem/41999448>
256
257         Reviewed by Chris Dumez.
258
259         Inform WiFiAssertions when the Networking process is first going into the background,
260         so it has a chance of dropping its assertions even in cases where the system
261         suspends the process before we receive prepareToSuspend.
262
263         * NetworkProcess/NetworkProcess.cpp:
264         (WebKit::NetworkProcess::processDidTransitionToForeground):
265         (WebKit::NetworkProcess::processDidTransitionToBackground):
266         * NetworkProcess/NetworkProcess.h:
267         * NetworkProcess/NetworkProcess.messages.in:
268         * NetworkProcess/curl/NetworkProcessCurl.cpp:
269         (WebKit::NetworkProcess::platformProcessDidTransitionToForeground):
270         (WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
271         * NetworkProcess/soup/NetworkProcessSoup.cpp:
272         (WebKit::NetworkProcess::platformProcessDidTransitionToForeground):
273         (WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
274         * UIProcess/Network/NetworkProcessProxy.cpp:
275         (WebKit::NetworkProcessProxy::sendProcessDidTransitionToForeground):
276         (WebKit::NetworkProcessProxy::sendProcessDidTransitionToBackground):
277         * UIProcess/Network/NetworkProcessProxy.h:
278         * UIProcess/WebProcessPool.cpp:
279         (WebKit::WebProcessPool::updateProcessAssertions):
280         Plumb the foreground/background transition to NetworkProcess.
281
282         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
283         (WebKit::NetworkProcess::platformPrepareToSuspend):
284         (WebKit::NetworkProcess::platformProcessDidTransitionToBackground):
285         (WebKit::NetworkProcess::platformProcessDidTransitionToForeground):
286         Make use of SuspensionReason to explain to WiFiAssertions the
287         difference between prepareToSuspend and didTransitionToBackground,
288         so that it can adjust the timing of dropping the assertion.
289
290 2018-07-13  Tim Horton  <timothy_horton@apple.com>
291
292         REGRESSION (r231676): watchOS WebKit usually doesn't load in the background
293         https://bugs.webkit.org/show_bug.cgi?id=187663
294         <rdar://problem/42181185>
295
296         Reviewed by Chris Dumez.
297
298         * UIProcess/ios/WebPageProxyIOS.mm:
299         (WebKit::WebPageProxy::applicationDidEnterBackground):
300         "Screen lock" is very aggressive on watchOS; we want to do our usual
301         30 seconds of loading in the background when you drop your wrist,
302         so disable this power optimization on that platform.
303
304 2018-07-13  Chris Dumez  <cdumez@apple.com>
305
306         WebResourceLoader may try to send a IPC with a destination ID that is 0
307         https://bugs.webkit.org/show_bug.cgi?id=187654
308         <rdar://problem/39265927>
309
310         Reviewed by Brady Eidson.
311
312         WebResourceLoader may try to send a IPC with a destination ID that is 0 according to release
313         assertion hits we see in the wild. This can lead to HashMap corruption on recipient side when
314         trying to lookup a key that is 0.
315
316         As per the crash traces, we see it starts from WebLoaderStrategy::internallyFailedLoadTimerFired()
317         which is likely due to the Network process crashing. WebLoaderStrategy::networkProcessCrashed()
318         calls scheduleInternallyFailedLoad() on each ResourceLoader and clears the WebResourceLoaders in
319         m_webResourceLoaders. When a ResourceLoader is cancelled (marked as failed), we clear its identifier
320         and we normally null out the WebLoaderStrategy's coreLoader. However, if we cannot find the
321         WebResourceLoader in m_webResourceLoaders (because that map was already cleared) then the
322         WebResourceLoader's coreLoader may not get nulled out, even if the coreLoader's identifier has
323         been reset. We have 2 lambdas in WebResourceLoader which keep the WebResourceLoader alive and
324         try to send IPC and are merely doing a null check on the coreLoader before trying to send the
325         IPC.
326
327         To address the issue, we now clear the WebResourceLoader's coreLoader in
328         WebLoaderStrategy::networkProcessCrashed(). For robustness, we also check that a coreLoader's
329         identifier is not 0 before trying to send IPC.
330
331         * WebProcess/Network/WebLoaderStrategy.cpp:
332         (WebKit::WebLoaderStrategy::networkProcessCrashed):
333         * WebProcess/Network/WebResourceLoader.cpp:
334         (WebKit::WebResourceLoader::willSendRequest):
335         (WebKit::WebResourceLoader::didReceiveResponse):
336
337 2018-07-13  Zach Li  <zachli@apple.com>
338
339         Allow BOCOM and ABC plug-ins to run unsandboxed
340         https://bugs.webkit.org/show_bug.cgi?id=187652
341         rdar://problem/42149182
342
343         Reviewed by Youenn Fablet.
344
345         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
346         (WebKit::PluginInfoStore::shouldAllowPluginToRunUnsandboxed):
347
348 2018-07-13  Chris Dumez  <cdumez@apple.com>
349
350         Add more threading release assertions
351         https://bugs.webkit.org/show_bug.cgi?id=187647
352
353         Reviewed by Alex Christensen.
354
355         Add more threading release assertions to help debug <rdar://problem/39265927>.
356
357         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
358         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
359         (WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess):
360         * UIProcess/WebProcessProxy.cpp:
361         (WebKit::m_isInPrewarmedPool):
362         (WebKit::WebProcessProxy::~WebProcessProxy):
363         (WebKit::WebProcessProxy::shutDown):
364         (WebKit::WebProcessProxy::didFinishLaunching):
365
366 2018-07-13  Christopher Reid  <chris.reid@sony.com>
367
368         [WinCairo] Add windows storage process connection implementation
369         https://bugs.webkit.org/show_bug.cgi?id=187531
370
371         Reviewed by Fujii Hironori.
372
373         * NetworkProcess/NetworkProcess.cpp:
374         * Platform/IPC/Attachment.h:
375         * StorageProcess/StorageProcess.cpp:
376         * UIProcess/Storage/StorageProcessProxy.cpp:
377
378 2018-07-13  Dan Bernstein  <mitz@apple.com>
379
380         [macOS] REGRESSION (r233536): Development WebContent service got opted back into Library Validation
381         https://bugs.webkit.org/show_bug.cgi?id=187640
382
383         Reviewed by Daniel Bates.
384
385         * Scripts/process-webcontent-entitlements.sh: Add the
386           com.apple.security.cs.disable-library-validation to the Development service regardless of
387           whether restricted entitlements are to be used, because that entitlement is not restricted.
388
389 2018-07-13  Chris Dumez  <cdumez@apple.com>
390
391         NetworkConnectionToWebProcess::m_networkResourceLoaders should use Ref<> for its values
392         https://bugs.webkit.org/show_bug.cgi?id=187629
393
394         Reviewed by Youenn Fablet.
395
396         NetworkConnectionToWebProcess::m_networkResourceLoaders should use Ref<> for its values
397         since they cannot be null.
398
399         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
400         (WebKit::NetworkConnectionToWebProcess::didClose):
401         (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
402         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
403         * NetworkProcess/NetworkConnectionToWebProcess.h:
404
405 2018-07-12  Alex Christensen  <achristensen@webkit.org>
406
407         Reduce size of WebCore::URL
408         https://bugs.webkit.org/show_bug.cgi?id=186820
409
410         Reviewed by Yusuke Suzuki and Youenn Fablet.
411
412         * NetworkProcess/cache/NetworkCacheStorage.h:
413         Increment cache version because of URL encoding change.
414
415 2018-07-12  Chris Dumez  <cdumez@apple.com>
416
417         [Cocoa] Make sure NetworkProcess::createNetworkConnectionToWebProcess() returns a valid mach port
418         https://bugs.webkit.org/show_bug.cgi?id=187625
419
420         Reviewed by Youenn Fablet.
421
422         Make sure NetworkProcess::createNetworkConnectionToWebProcess() returns a valid mach port to help
423         debug <rdar://problem/41995022>.
424
425         * NetworkProcess/NetworkProcess.cpp:
426         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
427         * UIProcess/Network/NetworkProcessProxy.cpp:
428         (WebKit::NetworkProcessProxy::didCreateNetworkConnectionToWebProcess):
429
430 2018-07-12  Chris Dumez  <cdumez@apple.com>
431
432         PingLoad does not need to ref the NetworkConnectionToWebProcess
433         https://bugs.webkit.org/show_bug.cgi?id=187624
434
435         Reviewed by Youenn Fablet.
436
437         PingLoad does not need to ref the NetworkConnectionToWebProcess and keep it alive longer than it needs to be.
438         Instead, ref the IPC::Connection which is lighter weight and gets invalidated when the NetworkConnectionToWebProcess
439         is destroyed.
440
441         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
442         (WebKit::NetworkConnectionToWebProcess::loadPing):
443         (WebKit::NetworkConnectionToWebProcess::didFinishPingLoad): Deleted.
444         * NetworkProcess/NetworkConnectionToWebProcess.h:
445
446 2018-07-12  Brady Eidson  <beidson@apple.com>
447
448         Make process-swap-on-navigation an experimental feature.
449         <rdar://problem/41995053> and https://bugs.webkit.org/show_bug.cgi?id=187558
450
451         Reviewed by Chris Dumez.
452
453         * Shared/WebPreferences.yaml:
454         
455         * UIProcess/API/C/WKPreferences.cpp:
456         (WKPreferencesSetProcessSwapOnNavigationEnabled):
457         (WKPreferencesGetProcessSwapOnNavigationEnabled):
458         * UIProcess/API/C/WKPreferencesRef.h:
459         
460         * UIProcess/WebPreferences.cpp:
461         (WebKit::WebPreferences::updateBoolValueForExperimentalFeatureKey):
462         
463         * UIProcess/WebProcessPool.cpp:
464         (WebKit::WebProcessPool::createWebPage): If the new web page has PSON enabled via WebPreferences,
465           absorb that setting into this process pool's configuration.
466
467 2018-07-12  Chris Dumez  <cdumez@apple.com>
468
469         Simplify code in NetworkConnectionToWebProcess::didReceiveMessage()
470         https://bugs.webkit.org/show_bug.cgi?id=187621
471
472         Reviewed by Youenn Fablet.
473
474         Simplify code in NetworkConnectionToWebProcess::didReceiveMessage() by not using HashMap iterators and
475         calling get() directly.
476
477         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
478         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
479
480 2018-07-12  Chris Dumez  <cdumez@apple.com>
481
482         Make sure WebProcess::ensureNetworkProcessConnection() is always called on the main thread
483         https://bugs.webkit.org/show_bug.cgi?id=187607
484
485         Reviewed by Alex Christensen.
486
487         Add release assertion to make sure that ensureNetworkProcessConnection() is always called on the main
488         thread. Calling it on a background thread would not be safe. It would not be safe because:
489         1. We check if we have a network process connection and then create one if we don't without any locking.
490         2. It is not safe to construct or use a NetworkProcessConnection object from a non-main thread
491
492         * WebProcess/WebProcess.cpp:
493         (WebKit::WebProcess::ensureNetworkProcessConnection):
494
495 2018-07-12  Chris Dumez  <cdumez@apple.com>
496
497         Assert that the IPC::Connection is valid in Connection::dispatchMessage(Decoder&)
498         https://bugs.webkit.org/show_bug.cgi?id=187617
499
500         Reviewed by Youenn Fablet.
501
502         Assert that the IPC::Connection is valid in Connection::dispatchMessage(Decoder&) as
503         m_client would be stale otherwise.
504
505         * Platform/IPC/Connection.cpp:
506         (IPC::Connection::dispatchMessage):
507
508 2018-07-12  Youenn Fablet  <youenn@apple.com>
509
510         Add a FrameLoaderClient willInjectUserScriptForFrame callback
511         https://bugs.webkit.org/show_bug.cgi?id=187565
512
513         Reviewed by Alex Christensen.
514
515         Introduce a new WKBundlePageLoaderClient callback that is called everytime a user script is injected.
516         Implement WebFrameLoaderClient::willInjectUserScript by calling this new callback.
517
518         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
519         (API::InjectedBundle::PageLoaderClient::willInjectUserScriptForFrame):
520         * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
521         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
522         (setUpPageLoaderClient):
523         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
524         (WebKit::InjectedBundlePageLoaderClient::globalObjectIsAvailableForFrame):
525         (WebKit::InjectedBundlePageLoaderClient::willInjectUserScriptForFrame):
526         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
527         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
528         (WebKit::WebFrameLoaderClient::willInjectUserScript):
529         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
530
531 2018-07-12  Said Abou-Hallawa  <sabouhallawa@apple.com>
532
533         [iOS] When bringing MobileSafari to the foreground, images are drawn asynchronously after removing a snapshot that included them
534         https://bugs.webkit.org/show_bug.cgi?id=187374
535         <rdar://problem/41249545>
536
537         Reviewed by Tim Horton.
538
539         UIProcess should block committing all the layer tree transactions for 
540         immediate update until it receives a one whose activityStateChangeID is
541         greater than or equal to the one it sends with SetActivityState message.
542
543         * Scripts/webkit/messages.py:
544         Fix the messages code generator to include DrawingAreaInfo.h for the WebKit
545         typedef ActivityStateChangeID.
546
547         * Shared/DrawingAreaInfo.h:
548         Define ActivityStateChangeID to be uint64_t. Add a definition for the case
549         when the UIProcess won't be blocked for a reply back from the WebProcess.
550
551         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
552         (WebKit::RemoteLayerTreeTransaction::activityStateChangeID const):
553         (WebKit::RemoteLayerTreeTransaction::setActivityStateChangeID):
554         Add a member for activityStateChangeID in the LayerTreeTransaction.
555
556         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
557         (WebKit::RemoteLayerTreeTransaction::encode const):
558         (WebKit::RemoteLayerTreeTransaction::decode):
559         Make LayerTreeTransaction know how to encode and decode activityStateChangeID.
560
561         * UIProcess/DrawingAreaProxy.h:
562         (WebKit::DrawingAreaProxy::waitForDidUpdateActivityState):
563         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
564         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
565         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
566         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
567         Make the DrawingArea in the UIProcess wait the layer tree with a certain
568         activityStateChangeID.
569
570         * UIProcess/WebPageProxy.cpp:
571         (WebKit::WebPageProxy::dispatchActivityStateChange):
572         (WebKit::WebPageProxy::waitForDidUpdateActivityState):
573         If m_activityStateChangeWantsSynchronousReply is true, generate a new 
574         activityStateChangeID and send it in the SetActivityState message.
575
576         * UIProcess/WebPageProxy.h:
577         (WebKit::WebPageProxy::takeNextActivityStateChangeID):
578         A simple way to generate a new activityStateChangeID.
579
580         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
581         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
582         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
583         Fix the UIProcess functions' prototype for Mac.
584
585         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
586         (WebKit::AcceleratedDrawingArea::activityStateDidChange):
587         * WebProcess/WebPage/AcceleratedDrawingArea.h:
588         Fix the UIProcess functions' prototype for GTK.
589
590         * WebProcess/WebPage/DrawingArea.h:
591         (WebKit::DrawingArea::activityStateDidChange):
592         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
593         Replace wantsDidUpdateActivityState with activityStateChangeID. Treat
594         activityStateChangeID == ActivityStateChangeAsynchronous as if 
595         wantsDidUpdateActivityState == false.
596
597         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
598         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
599         Make the WebPrcess pass the activityStateChangeID which it receives from
600         the SetActivityState message to the LayerTreeTransaction.
601
602         (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):
603         When receiving the SetActivityState, treat activityStateChangeID !=
604         ActivityStateChangeAsynchronous as if wantsDidUpdateActivityState == true.
605
606         * WebProcess/WebPage/WebPage.cpp:
607         (WebKit::WebPage::reinitializeWebPage):
608         (WebKit::WebPage::setActivityState):
609         * WebProcess/WebPage/WebPage.h:
610         * WebProcess/WebPage/WebPage.messages.in:
611         Replace the boolean wantsDidUpdateActivityState with activityStateChangeID
612         in the SetActivityState message.
613
614         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
615         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
616         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
617         (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange):
618         (WebKit::TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired):
619         Fix the WebProcess functions' prototype for Mac.
620
621 2018-07-12  Antti Koivisto  <antti@apple.com>
622
623         REGRESSION (r232356): After zooming a page in and out, it's possible to temporarily have missing tiles (google.com, apple.com)
624         https://bugs.webkit.org/show_bug.cgi?id=187553
625         <rdar://problem/41863803>
626
627         Reviewed by Simon Fraser.
628
629         We ignore zoom scale from UI process if it doesn't match the last remote layer tree transaction. However nothing
630         guarantees that we receive the real scale again until user interacts with the page. This means the web process
631         scale and the UI process scale can be wildly out of sync.
632
633         This problem becomes more likely to be visible when
634         - we are under memory pressure so we don't update tiles during zooming and rely on the one final update afterwards
635         - the page generates lots of layer tree transactions
636
637         * WebProcess/WebPage/WebPage.cpp:
638         (WebKit::WebPage::willCommitLayerTree):
639
640         Remember the last transaction where we actually changed the page scale.
641
642         * WebProcess/WebPage/WebPage.h:
643         * WebProcess/WebPage/ios/WebPageIOS.mm:
644         (WebKit::WebPage::scaleFromUIProcess const):
645
646         Only reject the UI process scale if there has been a scale changing transaction meanwhile.
647         The transaction id test was added in r218149 and the problem it fixed remains fixed. This change also matches better
648         what it was purpoted to implement.
649
650 2018-07-12  Megan Gardner  <megan_gardner@apple.com>
651
652         Keep Selections within Shadow DOM boundaries
653         https://bugs.webkit.org/show_bug.cgi?id=187556
654         <rdar://problem/41664567>
655
656         Reviewed by Ryosuke Niwa.
657
658         Update rangeForPosition to take into account both editing and shadow DOM boundries.
659
660         * WebProcess/WebPage/ios/WebPageIOS.mm:
661         (WebKit::rangeForPoint):
662         (WebKit::WebPage::updateSelectionWithTouches):
663         (WebKit::rangeForPosition): Deleted.
664         
665 2018-07-12  Jer Noble  <jer.noble@apple.com>
666
667         REGRESSION (r230163): Videos cannot be seen full screen in Complete Anatomy app
668         https://bugs.webkit.org/show_bug.cgi?id=187527
669         <rdar://problem/40511527>
670
671         Reviewed by Ryosuke Niwa.
672
673         Do not enable element fullscreen mode unless apps specifically opt-in. The Fullscreen API is
674         an experimental feature on iOS, but not on Mac, but we can't simply not return the ExperimentalFeature
675         object from the list of experimental features, as this keeps Safari from being able to apply a
676         NSUserDefault value for that feature. Instead, add a property to API::ExperimentalFeature and
677         _WKExperimentalFeature called "hidden", which signals to clients whether to display the feature
678         in their UI.
679
680         * Scripts/GeneratePreferences.rb:
681         * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
682         * Shared/WebPreferences.yaml:
683         * Shared/WebPreferencesDefaultValues.h:
684         * UIProcess/API/APIExperimentalFeature.cpp:
685         (API::ExperimentalFeature::create):
686         (API::ExperimentalFeature::ExperimentalFeature):
687         * UIProcess/API/APIExperimentalFeature.h:
688         * UIProcess/API/Cocoa/_WKExperimentalFeature.h:
689         * UIProcess/API/Cocoa/_WKExperimentalFeature.mm:
690         (-[_WKExperimentalFeature isHidden]):
691
692 2018-07-12  Alexey Proskuryakov  <ap@apple.com>
693
694         [Mac] Run Unlock Keychain more reliably
695         https://bugs.webkit.org/show_bug.cgi?id=187604
696
697         Reviewed by Dan Bernstein.
698
699         Move unlocking to a separate target, and make it a dependency for all targets that
700         produce binaries.
701         
702         This is more than strictly required to fix the build, but this way, we won't need
703         to remember about keychain when project structure changes. Another consideration that
704         wasn't initially apparent to me is that is should be possible to build any target,
705         not just "All", so projects aren't necessarily built in the same order even now.
706
707         * WebKit.xcodeproj/project.pbxproj: 
708
709 2018-07-12  Per Arne Vollan  <pvollan@apple.com>
710
711         Add compile guard for enabling NSRunLoop in the WebContent process.
712         https://bugs.webkit.org/show_bug.cgi?id=187563
713
714         Reviewed by Chris Dumez.
715
716         Also, replace __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 with ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) where appropriate.
717
718         * Platform/mac/LayerHostingContext.mm:
719         (WebKit::LayerHostingContext::createForExternalHostingProcess):
720         * Shared/ChildProcess.h:
721         * Shared/mac/ChildProcessMac.mm:
722         * Shared/mac/HangDetectionDisablerMac.mm:
723         (WebKit::setClientsMayIgnoreEvents):
724         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
725         (WebKit::WebProcessPool::registerNotificationObservers):
726         (WebKit::WebProcessPool::unregisterNotificationObservers):
727         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
728         (WebKit::shouldLeakBoost):
729         * UIProcess/WebProcessPool.h:
730         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
731         * WebProcess/Plugins/PDF/PDFPlugin.mm:
732         (WebKit::PDFPlugin::PDFPlugin):
733         * WebProcess/WebProcess.h:
734         * WebProcess/WebProcess.messages.in:
735         * WebProcess/cocoa/WebProcessCocoa.mm:
736         (WebKit::WebProcess::platformInitializeWebProcess):
737         (WebKit::WebProcess::stopRunLoop):
738
739 2018-07-11  Carlos Garcia Campos  <cgarcia@igalia.com>
740
741         [WPE] Pass the backend library name as command line parameter to the web process
742         https://bugs.webkit.org/show_bug.cgi?id=186841
743
744         Reviewed by Žan Doberšek.
745
746         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
747         (WebKit::ProcessLauncher::launchProcess): Add --backend-library parameter when launching the web process.
748         * WebProcess/wpe/WebProcessMainWPE.cpp: Call wpe_loader_init() with the library passed as --backend-library parameter.
749
750 2018-07-11  Jon Lee  <jonlee@apple.com>
751
752         Update iOS fullscreen alert text
753         https://bugs.webkit.org/show_bug.cgi?id=187576
754         rdar://problem/42052284
755
756         Reviewed by Ryosuke Niwa.
757
758         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
759         (-[WKFullScreenViewController _showPhishingAlert]): Update text and string keys.
760
761 2018-07-11  Aditya Keerthi  <akeerthi@apple.com>
762
763         REGRESSION (231276): Attempting to copy an image fails
764         https://bugs.webkit.org/show_bug.cgi?id=187212
765         <rdar://problem/41540074>
766
767         Reviewed by Ryosuke Niwa.
768
769         r210683 introduced logic to prevent file URLs from being copied to the clipboard
770         in unexpected cases. In order to achieve this functionality,
771         checkURLReceivedFromWebProcess was called on all items in the pathnames array
772         passed into WebPasteboardProxy::setPasteboardPathnamesForType. However, this
773         method is a misnomer, as the pathnames array always contains exactly one URL and
774         one title for the URL.
775
776         Renamed methods to make it clear that one URL and one title are being passed in
777         and updated logic to ensure that checkURLReceivedFromWebProcess is only called
778         on the URL and not the title.
779
780         * Shared/WebCoreArgumentCoders.cpp:
781         (IPC::ArgumentCoder<PasteboardURL>::encode):
782         (IPC::ArgumentCoder<PasteboardURL>::decode):
783         * Shared/WebCoreArgumentCoders.h:
784         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
785         (WebKit::WebPasteboardProxy::setPasteboardURL):
786         * UIProcess/WebPasteboardProxy.h:
787         * UIProcess/WebPasteboardProxy.messages.in:
788         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
789         (WebKit::WebPlatformStrategies::setURL):
790         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
791
792 2018-07-11  Alex Christensen  <achristensen@webkit.org>
793
794         Add SPI for immediate injection of user scripts
795         https://bugs.webkit.org/show_bug.cgi?id=173342
796         <rdar://problem/29202285>
797
798         Reviewed by Brady Eidson, Youenn Fablet, and Geoff Garen.
799
800         * UIProcess/API/C/WKPageGroup.cpp:
801         (WKPageGroupAddUserScript):
802         * UIProcess/API/C/WKUserContentControllerRef.cpp:
803         (WKUserContentControllerAddUserScript):
804         * UIProcess/API/Cocoa/WKUserContentController.mm:
805         (-[WKUserContentController addUserScript:]):
806         (-[WKUserContentController _addUserScriptImmediately:]):
807         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
808         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
809         (WebKit::WebUserContentControllerProxy::addUserScript):
810         * UIProcess/UserContent/WebUserContentControllerProxy.h:
811         * WebProcess/UserContent/WebUserContentController.cpp:
812         (WebKit::WebUserContentController::addUserScripts):
813         (WebKit::WebUserContentController::addUserScriptInternal):
814         If we are to inject the script internally, inject it into the appropriate pages.
815         If we're injecting into the top frame only, there's no need to traverse the frame tree.
816         (WebKit::WebUserContentController::addUserScript):
817         * WebProcess/UserContent/WebUserContentController.h:
818         * WebProcess/UserContent/WebUserContentController.messages.in:
819         * WebProcess/WebPage/WebPage.cpp:
820         (WebKit::m_cpuLimit):
821
822 2018-07-11  Simon Fraser  <simon.fraser@apple.com>
823
824         [iOS WK2] Address a possible cause of missing tiles
825         https://bugs.webkit.org/show_bug.cgi?id=187570
826         rdar://problem/40941118
827
828         Reviewed by Tim Horton.
829         
830         If the web process crashes, it's possible for the user to trigger a scroll before
831         the process is re-launched. The pre-commit handler will bail early on the _isValid
832         check without clearing _hasScheduledVisibleRectUpdate, so that remains YES and we
833         get stuck doing no more visible content rect updates.
834         
835         Fix by adding -[WKWebView _didRelaunchProcess] (WKContentView got this already), and
836         in that clear state that could have been set in the UI process while the web process
837         connection was invalid.
838         
839         Also add more release logging around process termination, crash and relaunch.
840
841         * UIProcess/API/Cocoa/WKWebView.mm:
842         (-[WKWebView _processDidExit]):
843         (-[WKWebView _didRelaunchProcess]):
844         (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
845         (-[WKWebView _updateVisibleContentRects]):
846         * UIProcess/API/Cocoa/WKWebViewInternal.h:
847         * UIProcess/WebPageProxy.cpp:
848         (WebKit::WebPageProxy::reattachToWebProcess):
849         (WebKit::WebPageProxy::processDidTerminate):
850         * UIProcess/WebProcessProxy.cpp:
851         (WebKit::WebProcessProxy::didClose):
852         (WebKit::WebProcessProxy::didFinishLaunching):
853         * UIProcess/ios/PageClientImplIOS.mm:
854         (WebKit::PageClientImpl::didRelaunchProcess):
855
856 2018-07-11  Wenson Hsieh  <wenson_hsieh@apple.com>
857
858         Release logging dumps "Cleaning up dragging state…" every time gesture recognizers are reset in WKContentView
859         https://bugs.webkit.org/show_bug.cgi?id=187562
860
861         Reviewed by Tim Horton.
862
863         Tweaks up a release logging statement, such that it only logs when performing a drag or drop.
864
865         * UIProcess/ios/WKContentViewInteraction.mm:
866         (-[WKContentView cleanUpDragSourceSessionState]):
867
868 2018-07-11  Commit Queue  <commit-queue@webkit.org>
869
870         Unreviewed, rolling out r233741.
871         https://bugs.webkit.org/show_bug.cgi?id=187568
872
873         "WKTR vs exp features, booooooo" (Requested by bradee-oh on
874         #webkit).
875
876         Reverted changeset:
877
878         "Make process-swap-on-navigation an experimental feature."
879         https://bugs.webkit.org/show_bug.cgi?id=187558
880         https://trac.webkit.org/changeset/233741
881
882 2018-07-11  Brady Eidson  <beidson@apple.com>
883
884         Make process-swap-on-navigation an experimental feature.
885         <rdar://problem/41995053> and https://bugs.webkit.org/show_bug.cgi?id=187558
886
887         Reviewed by Geoff Garen.
888
889         * Shared/WebPreferences.yaml:
890
891         * UIProcess/WebPreferences.cpp:
892         (WebKit::WebPreferences::updateBoolValueForExperimentalFeatureKey):
893
894         * UIProcess/WebProcessPool.cpp:
895         (WebKit::WebProcessPool::createWebPage): If the new web page has PSON enabled via WebPreferences,
896           absorb that setting into this process pool's configuration.
897
898 2018-07-11  Jer Noble  <jer.noble@apple.com>
899
900         Disable all network caching for HLS streams.
901         https://bugs.webkit.org/show_bug.cgi?id=187544
902         <rdar://problem/41863600>
903
904         Reviewed by Chris Dumez.
905
906         Revert the behavior added in r215263 where Media responses are cached if they are from
907         a resource whose expected content length is <4MB.
908
909         * NetworkProcess/cache/NetworkCache.cpp:
910         (WebKit::NetworkCache::makeStoreDecision):
911         (WebKit::NetworkCache::expectedTotalResourceSizeFromContentRange): Deleted.
912
913 2018-07-11  Zan Dobersek  <zdobersek@igalia.com>
914
915         [WPE] AC for fixed-position elements is not enabled
916         https://bugs.webkit.org/show_bug.cgi?id=187514
917
918         Reviewed by Carlos Garcia Campos.
919
920         Enable accelerated compositing for fixed-position elements when using
921         AcceleratedDrawingArea and AC is force-enabled. This effectively enables
922         this option for the WPE port which is using the AcceleratedDrawingArea
923         implementation and not DrawingAreaImpl like the GTK+ port.
924
925         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
926         (WebKit::AcceleratedDrawingArea::updatePreferences):
927
928 2018-07-11  Christopher Reid  <chris.reid@sony.com>
929
930         [Win][WebKit] Disable accelerated compositing until it is supported
931         https://bugs.webkit.org/show_bug.cgi?id=187503
932
933         Reviewed by Žan Doberšek.
934
935         * UIProcess/win/WebView.cpp:
936
937 2018-07-10  Tim Horton  <timothy_horton@apple.com>
938
939         REGRESSION (r233480): Mail contents flash black when activating
940         https://bugs.webkit.org/show_bug.cgi?id=187504
941         <rdar://problem/41752351>
942
943         Reviewed by Simon Fraser.
944
945         The sequence of events to reproduce the bug originally fixed in r203371
946         is either:
947
948         A) the simple background/foreground case
949
950         1] app begins to suspend
951         2] app suspension snapshots are taken
952         3] WKWebView's surfaces are marked volatile
953         4] app completes suspension
954             ... time goes by ...
955         5] WKWebView's volatile surfaces are purged
956             ... time goes by ...
957         6] app begins to resume, shows (good) suspension snapshot
958         7] app removes suspension snapshot
959         8] WKWebView has sublayers with purged (black) surfaces
960         9] WKWebView sublayers are repaired by a new commit with nonvolatile surfaces
961
962         B) the re-snapshot while in the background case
963
964         1] app begins to suspend
965         2] app suspension snapshots are taken
966         3] WKWebView's surfaces are marked volatile
967         4] app completes suspension
968         ... time goes by ...
969         5] WKWebView's volatile surfaces are purged
970         ... time goes by ...
971         6] app wakes up in the background to update its snapshots
972         7] in the updated snapshots, WKWebView has sublayers with purged (black) surfaces
973         ... time goes by ...
974         8] app begins to resume, shows (bad) suspension snapshot
975         9] WKWebView presents layers with purged (black) surfaces until new commit fixes them
976         10] WKWebView sublayers are repaired by a new commit with nonvolatile surfaces
977
978         WebKit's current approach to fix this problem is simply to hide the
979         WKWebView's sublayers at some point after A2/B2 (suspension snapshots),
980         but before A8/B7 (the first time the empty layers would be presented
981         or snapshotted).
982
983         Previously, we did this by hiding the layers when the window's CAContext
984         was created, which happened early enough in both cases (at A6/B6).
985         However, that notification was removed underneath us at some point.
986
987         However, in looking at the timelines, there's a better place to do this:
988         immediately after marking the surfaces volatile (A3/B3), which is always
989         strictly after the app suspension snapshots are taken, and also always
990         before the freshly-made-volatile layers could be presented or snapshotted.
991
992         * UIProcess/ApplicationStateTracker.h:
993         * UIProcess/ApplicationStateTracker.mm:
994         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
995         (WebKit::ApplicationStateTracker::~ApplicationStateTracker):
996         (WebKit::ApplicationStateTracker::applicationDidCreateWindowContext): Deleted.
997         * UIProcess/ios/WKApplicationStateTrackingView.h:
998         * UIProcess/ios/WKApplicationStateTrackingView.mm:
999         (-[WKApplicationStateTrackingView didMoveToWindow]):
1000         (-[WKApplicationStateTrackingView _applicationDidCreateWindowContext]): Deleted.
1001         * UIProcess/ios/WKContentView.mm:
1002         (-[WKContentView _applicationDidCreateWindowContext]): Deleted.
1003         * UIProcess/ios/WebPageProxyIOS.mm:
1004         (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
1005         Remove the didCreateWindowContext notification, and hide content after
1006         snapshotting after entering the background.
1007
1008 2018-07-10  Youenn Fablet  <youenn@apple.com>
1009
1010         Make fetch() use "same-origin" credentials by default
1011         https://bugs.webkit.org/show_bug.cgi?id=176023
1012
1013         Reviewed by Chris Dumez.
1014
1015         Before the patch, when changing the credential mode in case of redirection,
1016         we were not waiting for WebProcess response to restart the load.
1017         This patch updates the implementation to ask the WebProcess whether to proceed as for other regular asynchronous loads.
1018         This requires some refactoring in particular we now pass request, redirectRequest and redirectResponse to NetworkLoadChecker
1019         that will send them back as part of the completion handler.
1020
1021         To do so, we change manual redirection handling and make it a successful case and not an error case as before.
1022
1023         * NetworkProcess/NetworkLoadChecker.cpp:
1024         (WebKit::redirectionError):
1025         (WebKit::NetworkLoadChecker::checkRedirection):
1026         * NetworkProcess/NetworkLoadChecker.h:
1027         * NetworkProcess/NetworkResourceLoader.cpp:
1028         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
1029         (WebKit::NetworkResourceLoader::restartNetworkLoad):
1030         (WebKit::NetworkResourceLoader::continueWillSendRequest):
1031         * NetworkProcess/NetworkResourceLoader.h:
1032         * NetworkProcess/PingLoad.cpp:
1033         (WebKit::PingLoad::willPerformHTTPRedirection):
1034
1035 2018-07-10  Chris Dumez  <cdumez@apple.com>
1036
1037         [IOS] We should prevent WebProcess suspension while the UIProcess is waiting for a reply from its injected bundle
1038         https://bugs.webkit.org/show_bug.cgi?id=187536
1039         <rdar://problem/41931912>
1040
1041         Reviewed by Brady Eidson.
1042
1043         Update RemoteObjectRegistry to take a background process assertion for each pending reply on the
1044         UIProcess side. Otherwise, the destination web process may get suspended and the reply block would
1045         not get called. We already do this in WebPageProxy for callbacks waiting for an IPC from the
1046         WebProcess.
1047
1048         * Shared/API/Cocoa/RemoteObjectRegistry.h:
1049         * Shared/API/Cocoa/RemoteObjectRegistry.mm:
1050         (WebKit::RemoteObjectRegistry::RemoteObjectRegistry):
1051         (WebKit::RemoteObjectRegistry::sendInvocation):
1052         (WebKit::RemoteObjectRegistry::callReplyBlock):
1053         (WebKit::RemoteObjectRegistry::releaseUnusedReplyBlock):
1054         * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
1055         (-[_WKRemoteObjectRegistry _initWithWebPage:]):
1056         (-[_WKRemoteObjectRegistry _initWithWebPageProxy:]):
1057         (-[_WKRemoteObjectRegistry _initWithMessageSender:]): Deleted.
1058         * Shared/API/Cocoa/_WKRemoteObjectRegistryInternal.h:
1059         * UIProcess/API/Cocoa/WKWebView.mm:
1060         (-[WKWebView _remoteObjectRegistry]):
1061         * UIProcess/Cocoa/WebViewImpl.mm:
1062         (WebKit::WebViewImpl::remoteObjectRegistry):
1063         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1064         (-[WKWebProcessPlugInBrowserContextController _remoteObjectRegistry]):
1065
1066 2018-07-09  Brian Burg  <bburg@apple.com>
1067
1068         WebDriver: hang when running Selenium test correct_event_firing_tests.py::testShouldEmitOnChangeEventsWhenSelectingElements[Safari]
1069         https://bugs.webkit.org/show_bug.cgi?id=187486
1070         <rdar://problem/41987110>
1071
1072         Reviewed by Tim Horton.
1073
1074         This test takes the unusual step of doing Element Click directly on a <select> element,
1075         despite the specification supporting clicking on <option> elements directly. It hangs
1076         because we fire a nested run loop when the Carbon popup menu appears, and the nested runloop
1077         is not exited until the popup menu is clicked or dismissed.
1078
1079         If a click is being simulated on the <select> via WebDriver, we should just not show
1080         the popup menu but still deliver all of the events that are fired when clicking the element.
1081
1082         * UIProcess/WebPageProxy.cpp:
1083         (WebKit::WebPageProxy::showPopupMenu):
1084
1085 2018-07-10  Tim Horton  <timothy_horton@apple.com>
1086
1087         Try to fix the build
1088
1089         * UIProcess/API/Cocoa/WKWebView.mm:
1090         (-[WKWebView _internalDoAfterNextPresentationUpdate:withoutWaitingForPainting:withoutWaitingForAnimatedResize:]):
1091
1092 2018-07-10  Tim Horton  <timothy_horton@apple.com>
1093
1094         doAfterNextPresentationUpdate should not be called while content is hidden due to animated resize
1095         https://bugs.webkit.org/show_bug.cgi?id=187500
1096         <rdar://problem/41294139>
1097
1098         Reviewed by Simon Fraser.
1099
1100         Clients generally expect that after doAfterNextPresentationUpdate, there's
1101         something vaguely sensible on the screen. They use this to remove snapshots,
1102         unhide web views, etc.
1103
1104         During some kinds of resize/rotation, we will hide the WKContentView,
1105         and asynchronously hide it when the resize/rotation is complete. This
1106         can cause clients to prematurely expose a blank WKWebView.
1107
1108         To fix this, avoid calling doAfterNextPresentationUpdate until the
1109         animated resize completes. Add a variant that does not wait for this
1110         (to be used for testing purposes).
1111
1112         * UIProcess/API/Cocoa/WKWebView.mm:
1113         (-[WKWebView _didCompleteAnimatedResize]):
1114         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
1115         Rename the vector of blocks that we call after animated resize completes
1116         to be generic rather than just about snapshots.
1117
1118         (-[WKWebView _internalDoAfterNextPresentationUpdate:withoutWaitingForPainting:withoutWaitingForAnimatedResize:]):
1119         Add this _internal variant of _doAfterNextPresentationUpdate that takes bits determining
1120         which waits to perform or avoid, to reduce duplication.
1121
1122         (-[WKWebView _doAfterNextPresentationUpdate:]):
1123         (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForAnimatedResizeForTesting:]):
1124         (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForPainting:]):
1125         Call _internalDoAfterNextPresentationUpdate with the appropriate bits set for each situation.
1126
1127         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1128         Add _doAfterNextPresentationUpdateWithoutWaitingForAnimatedResizeForTesting to WKWebView(WKTesting).
1129
1130 2018-07-10  Tim Horton  <timothy_horton@apple.com>
1131
1132         REGRESSION (r231510): Dismissing PDFPlugin context menu automatically clicks the first item
1133         https://bugs.webkit.org/show_bug.cgi?id=187507
1134         <rdar://problem/42007155>
1135
1136         Reviewed by Per Arne Vollan.
1137
1138         WebPageProxy::showPDFContextMenu, introduced in r213510, assumes that
1139         the user always chooses some item from the menu; it does not handle
1140         the case where the context menu is dismissed without selecting anything.
1141
1142         * UIProcess/WebPageProxy.h:
1143         * UIProcess/WebPageProxy.messages.in:
1144         * UIProcess/mac/WebPageProxyMac.mm:
1145         (-[WKPDFMenuTarget selectedMenuItem]):
1146         (-[WKPDFMenuTarget contextMenuAction:]):
1147         (WebKit::WebPageProxy::showPDFContextMenu):
1148         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1149         (WebKit::PDFPlugin::handleContextMenuEvent):
1150         Make showPDFContextMenu return an optional index, instead of always
1151         returning an index. Don't perform any action if it is nullopt.
1152
1153 2018-07-10  Stephan Szabo  <stephan.szabo@sony.com>
1154
1155         [WinCairo] Support display of webinspector ui on non-legacy minibrowser
1156         https://bugs.webkit.org/show_bug.cgi?id=187415
1157
1158         Reviewed by Brian Burg.
1159
1160         * UIProcess/WebInspectorProxy.h:
1161         * UIProcess/win/WebInspectorProxyWin.cpp:
1162         (WebKit::getInspectedWindowInfo):
1163         (WebKit::WebInspectorProxy::windowReceivedMessage):
1164         (WebKit::WebInspectorProxy::wndProc):
1165         (WebKit::WebInspectorProxy::registerWindowClass):
1166         (WebKit::decidePolicyForNavigationAction):
1167         (WebKit::webProcessDidCrash):
1168         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
1169         (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
1170         (WebKit::WebInspectorProxy::inspectorPageURL):
1171         (WebKit::WebInspectorProxy::inspectorTestPageURL):
1172         (WebKit::WebInspectorProxy::inspectorBaseURL):
1173         (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
1174         (WebKit::WebInspectorProxy::platformInspectedWindowWidth):
1175         (WebKit::WebInspectorProxy::platformAttach):
1176         (WebKit::WebInspectorProxy::platformDetach):
1177         (WebKit::WebInspectorProxy::platformSetAttachedWindowHeight):
1178         (WebKit::WebInspectorProxy::platformSetAttachedWindowWidth):
1179         (WebKit::WebInspectorProxy::platformIsFront):
1180         (WebKit::WebInspectorProxy::platformHide):
1181         (WebKit::WebInspectorProxy::platformBringToFront):
1182         (WebKit::WebInspectorProxy::platformBringInspectedPageToFront):
1183         (WebKit::WebInspectorProxy::platformInspectedURLChanged):
1184         (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
1185         (WebKit::WebInspectorProxy::platformDidCloseForCrash):
1186         (WebKit::WebInspectorProxy::platformInvalidate):
1187         (WebKit::WebInspectorProxy::platformStartWindowDrag):
1188         * WebProcess/WebPage/WebInspector.cpp:
1189         (WebKit::WebInspector::openFrontendConnection):
1190         * WebProcess/WebPage/win/WebInspectorUIWin.cpp:
1191         (WebKit::WebInspectorUI::localizedStringsURL):
1192         (WebKit::RemoteWebInspectorUI::localizedStringsURL):
1193
1194 2018-07-10  John Wilander  <wilander@apple.com>
1195
1196         Resource Load Statistics: Make testRunner.statisticsResetToConsistentState() take a completion handler
1197         https://bugs.webkit.org/show_bug.cgi?id=187499
1198         <rdar://problem/41999431>
1199
1200         Reviewed by Chris Dumez.
1201
1202         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1203         (WKWebsiteDataStoreStatisticsResetToConsistentState):
1204             Now uses a WTF::CallbackAggregator to call its
1205             completion handler when both the call to
1206             WebResourceLoadStatisticsStore::scheduleClearInMemory()
1207             and to
1208             WebResourceLoadStatisticsStore::resetParametersToDefaultValues()
1209             are complete.
1210         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1211         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1212         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory):
1213             Now takes a WTF::CompletionHandler so that it can support the
1214             completion handler in
1215             WKWebsiteDataStoreStatisticsResetToConsistentState().
1216         (WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
1217             Now takes a WTF::CompletionHandler so that it can support the
1218             completion handler in
1219             WKWebsiteDataStoreStatisticsResetToConsistentState().
1220         * UIProcess/WebResourceLoadStatisticsStore.h:
1221
1222 2018-07-10  Ryosuke Niwa  <rniwa@webkit.org>
1223
1224         Disable cross-origin-window-policy by default
1225         https://bugs.webkit.org/show_bug.cgi?id=187509
1226
1227         Reviewed by Chris Dumez.
1228
1229         * Shared/WebPreferences.yaml:
1230         * UIProcess/API/C/WKPreferences.cpp:
1231         (WKPreferencesSetCrossOriginWindowPolicyEnabled):
1232         (WKPreferencesGetCrossOriginWindowPolicyEnabled):
1233         * UIProcess/API/C/WKPreferencesRef.h:
1234
1235 2018-07-09  Tim Horton  <timothy_horton@apple.com>
1236
1237         REGRESSION (r232416): Flickering when going back to Google search results on back swipe
1238         https://bugs.webkit.org/show_bug.cgi?id=187506
1239         <rdar://problem/41939594>
1240
1241         Reviewed by Chris Dumez.
1242
1243         Same document navigations won't have a preceding didStartProvisionalLoadForMainFrame,
1244         so the code introduced in r232416 would immediately remove the snapshot
1245         upon any same document navigation.
1246
1247         Instead, adjust r232416 slightly to start tracking snapshot removal events
1248         after didStartProvisionalLoad OR didSameDocumentNavigation. Call the block
1249         that starts tracking, then immediately fire the same-document navigation event.
1250
1251         * UIProcess/Cocoa/ViewGestureController.cpp:
1252         (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
1253         (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
1254         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
1255         (WebKit::ViewGestureController::SnapshotRemovalTracker::stopWaitingForEvent):
1256         * UIProcess/Cocoa/ViewGestureController.h:
1257         * UIProcess/ios/ViewGestureControllerIOS.mm:
1258         (WebKit::ViewGestureController::endSwipeGesture):
1259         * UIProcess/mac/ViewGestureControllerMac.mm:
1260         (WebKit::ViewGestureController::endSwipeGesture):
1261
1262 2018-07-09  Youenn Fablet  <youenn@apple.com>
1263
1264         Remove cfca.com.npCryptoKit.CGB.MAC.sb and cfca.com.npP11CertEnroll.MAC.CGB.sb
1265         https://bugs.webkit.org/show_bug.cgi?id=187487
1266         <rdar://problem/41991584>
1267
1268         Reviewed by Alexey Proskuryakov.
1269
1270         * Resources/PlugInSandboxProfiles/cfca.com.npCryptoKit.CGB.MAC.sb: Removed.
1271         * Resources/PlugInSandboxProfiles/cfca.com.npP11CertEnroll.MAC.CGB.sb: Removed.
1272         * WebKit.xcodeproj/project.pbxproj:
1273
1274 2018-07-09  Youenn Fablet  <youenn@apple.com>
1275
1276         Add the possibility to run unsandboxed plug-ins
1277         https://bugs.webkit.org/show_bug.cgi?id=187310
1278         <rdar://problem/41798808>
1279
1280         Reviewed by Alexey Proskuryakov.
1281
1282         Add a utility method to know which plug-ins are allowed to run unsandboxed.
1283         For such plug-ins, we skip the sandboxing done when starting the plug-in process.
1284
1285         * PluginProcess/mac/PluginProcessMac.mm:
1286         (WebKit::PluginProcess::initializeSandbox):
1287         * Shared/WebPreferences.yaml:
1288         * UIProcess/Plugins/PluginInfoStore.cpp:
1289         (WebKit::PluginInfoStore::shouldRunPluginUnsandboxed):
1290         * UIProcess/Plugins/PluginInfoStore.h:
1291         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
1292         (WebKit::PluginInfoStore::shouldRunPluginUnsandboxed):
1293         (WebKit::PluginInfoStore::shouldUsePlugin):
1294
1295 2018-07-09  Dean Jackson  <dino@apple.com>
1296
1297         Remove fullscreen-auto-hide-delay
1298         https://bugs.webkit.org/show_bug.cgi?id=187493
1299         <rdar://problem/41830852>
1300
1301         Reviewed by Antoine Quint.
1302
1303         Now there is no delay, rename setFullscreenAutoHideTiming to setFullscreenAutoHideDuration,
1304         and only send that value over to the Web Process.
1305
1306         * UIProcess/WebFullScreenManagerProxy.cpp:
1307         (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideDuration):
1308         (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideTiming): Deleted.
1309         * UIProcess/WebFullScreenManagerProxy.h:
1310         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
1311         (-[WKFullScreenViewController viewWillAppear:]):
1312         * WebProcess/FullScreen/WebFullScreenManager.cpp:
1313         (WebKit::WebFullScreenManager::didExitFullScreen):
1314         (WebKit::WebFullScreenManager::setFullscreenAutoHideDuration):
1315         (WebKit::WebFullScreenManager::setFullscreenAutoHideTiming): Deleted.
1316         * WebProcess/FullScreen/WebFullScreenManager.h:
1317         * WebProcess/FullScreen/WebFullScreenManager.messages.in:
1318
1319 2018-07-09  Timothy Hatcher  <timothy@apple.com>
1320
1321         Semantic colors don't update when accessibility Increase Contrast mode is enabled.
1322         https://bugs.webkit.org/show_bug.cgi?id=187425
1323         rdar://problem/39948240
1324
1325         Reviewed by Tim Horton.
1326
1327         * UIProcess/API/Cocoa/WKWebView.mm:
1328         (-[WKWebView _initializeWithConfiguration:]): Moved call to setUseDarkAppearance to WebViewImpl.
1329         (-[WKWebView _setUseSystemAppearance:]): No need to call setUseDarkAppearance here anymore.
1330         (-[WKWebView viewDidChangeEffectiveAppearance]): Added. This is the proper NSView method to use.
1331         (-[WKWebView _effectiveAppearanceIsDark]): Deleted.
1332         (-[WKWebView effectiveAppearanceDidChange]): Deleted. This method is a deprecated name.
1333         * UIProcess/API/mac/WKView.mm:
1334         (-[WKView viewDidChangeEffectiveAppearance]): Added. This is the proper NSView method to use.
1335         (-[WKView _setUseSystemAppearance:]): No need to call setUseDarkAppearance here anymore.
1336         (-[WKView _effectiveAppearanceIsDark]): Deleted.
1337         (-[WKView effectiveAppearanceDidChange]): Deleted. This method is a deprecated name.
1338         * UIProcess/Cocoa/WebViewImpl.h:
1339         * UIProcess/Cocoa/WebViewImpl.mm:
1340         (WebKit::WebViewImpl::WebViewImpl): Call setUseDarkAppearance before page config is sent in initializeWebPage.
1341         (WebKit::WebViewImpl::effectiveAppearanceDidChange): Added.
1342         * WebProcess/WebPage/WebPage.cpp:
1343         (WebKit::WebPage::setUseDarkAppearance): WebCore::Page::setUseDarkAppearance now handles the style changes.
1344         The RenderTheme color caches also don't need cleared with platformColorsDidChange(), since we cache light
1345         and dark colors seperatly in RenderThemeMac.
1346
1347 2018-07-09  Simon Fraser  <simon.fraser@apple.com>
1348
1349         Shrink various loading-related enums to shrink CachedResource
1350         https://bugs.webkit.org/show_bug.cgi?id=187443
1351
1352         Reviewed by Chris Dumez.
1353
1354         * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm:
1355         (WebKit::LegacyCustomProtocolManager::wasRedirectedToRequest):
1356         * NetworkProcess/NetworkLoad.cpp:
1357         (WebKit::NetworkLoad::continueWillSendRequest):
1358         * NetworkProcess/NetworkLoadParameters.h:
1359         * NetworkProcess/NetworkResourceLoader.cpp:
1360         (WebKit::NetworkResourceLoader::canUseCache const):
1361         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
1362         * NetworkProcess/cache/NetworkCache.cpp:
1363         (WebKit::NetworkCache::cachePolicyAllowsExpired):
1364         (WebKit::NetworkCache::makeRetrieveDecision):
1365         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1366         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
1367         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1368         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
1369         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1370         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
1371         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
1372         * Shared/API/c/mac/WKURLRequestNS.mm:
1373         (WKURLRequestCopyNSURLRequest):
1374         * Shared/Cocoa/WKNSURLRequest.mm:
1375         (-[WKNSURLRequest _web_createTarget]):
1376         * Shared/mac/WebCoreArgumentCodersMac.mm:
1377         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
1378         * UIProcess/API/Cocoa/WKFrameInfo.mm:
1379         (-[WKFrameInfo request]):
1380         * UIProcess/API/Cocoa/WKNavigation.mm:
1381         (-[WKNavigation _request]):
1382         * UIProcess/API/Cocoa/WKNavigationAction.mm:
1383         (-[WKNavigationAction request]):
1384         * UIProcess/API/Cocoa/WKNavigationData.mm:
1385         (-[WKNavigationData originalRequest]):
1386         * UIProcess/API/Cocoa/WKNavigationResponse.mm:
1387         (-[WKNavigationResponse _request]):
1388         * UIProcess/API/Cocoa/WKURLSchemeTask.mm:
1389         (-[WKURLSchemeTaskImpl request]):
1390         * UIProcess/API/Cocoa/_WKDownload.mm:
1391         (-[_WKDownload request]):
1392         * UIProcess/Cocoa/LegacyCustomProtocolManagerClient.mm:
1393         (WebKit::LegacyCustomProtocolManagerClient::startLoading):
1394         * WebProcess/Network/WebLoaderStrategy.cpp:
1395         (WebKit::maximumBufferingTime):
1396         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
1397         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
1398         * WebProcess/WebPage/mac/WebPageMac.mm:
1399         (WebKit::WebPage::platformCanHandleRequest):
1400
1401 2018-07-09  Chris Dumez  <cdumez@apple.com>
1402
1403         WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData() fails to protect the page in its lambda
1404         https://bugs.webkit.org/show_bug.cgi?id=187478
1405         <rdar://problem/41975998>
1406
1407         Reviewed by Youenn Fablet.
1408
1409         Make sure we protect the WebPageProxy when we capture it in the lambda or it might go away by the
1410         time the lambda gets called.
1411
1412         * UIProcess/WebProcessProxy.cpp:
1413         (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData):
1414
1415 2018-07-09  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1416
1417         [Curl] Remove unused AuthenticationManager static methods.
1418         https://bugs.webkit.org/show_bug.cgi?id=187419
1419
1420         Reviewed by Yusuke Suzuki.
1421
1422         The file for curl port was added without implementation and never called from anyware.
1423         Also interfaces only used by the curl port were removed from the shared header file.
1424
1425         * PlatformWin.cmake:
1426         * Shared/Authentication/AuthenticationManager.h:
1427         * Shared/Authentication/curl/AuthenticationManagerCurl.cpp: Removed.
1428
1429 2018-07-09  Stephan Szabo  <stephan.szabo@sony.com>
1430
1431         Check that LayerTreeHost was created before use
1432         https://bugs.webkit.org/show_bug.cgi?id=187404
1433
1434         Reviewed by Žan Doberšek.
1435
1436         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1437         (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
1438
1439 2018-07-09  Commit Queue  <commit-queue@webkit.org>
1440
1441         Unreviewed, rolling out r233612.
1442         https://bugs.webkit.org/show_bug.cgi?id=187475
1443
1444         Revision caused the api test LinkColorWithSystemAppearance to
1445         fail on all systems. (Requested by Truitt on #webkit).
1446
1447         Reverted changeset:
1448
1449         "Semantic colors don't update when accessibility Increase
1450         Contrast mode is enabled."
1451         https://bugs.webkit.org/show_bug.cgi?id=187425
1452         https://trac.webkit.org/changeset/233612
1453
1454 2018-07-09  Brian Burg  <bburg@apple.com>
1455
1456         WebDriver: hang in Selenium test alerts_tests.py::testShouldHandleAlertOnPageBeforeUnload
1457         https://bugs.webkit.org/show_bug.cgi?id=187418
1458         <rdar://problem/41909520>
1459
1460         Unreviewed build fix for Sierra.
1461
1462         * UIProcess/WebPageProxy.cpp:
1463         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
1464         According to some compilers, the local 'automationSession' is unused. Change this
1465         to just convert the return value to boolean rather than assign to an unused local.
1466
1467 2018-07-07  Wenson Hsieh  <wenson_hsieh@apple.com>
1468
1469         Introduce a layout milestone to track when the document contains a large number of rendered characters
1470         https://bugs.webkit.org/show_bug.cgi?id=187412
1471         <rdar://problem/41744338>
1472
1473         Reviewed by Ryosuke Niwa.
1474
1475         Add plumbing for the new significant rendered text layout milestone in the modern WebKit client layer. See
1476         WebCore/ChangeLog for more details.
1477
1478         * Shared/API/Cocoa/_WKRenderingProgressEvents.h:
1479         * Shared/API/Cocoa/_WKRenderingProgressEventsInternal.h:
1480         (renderingProgressEvents):
1481         * Shared/API/c/WKPageLoadTypes.h:
1482         * Shared/API/c/WKSharedAPICast.h:
1483         (WebKit::toWKLayoutMilestones):
1484         (WebKit::toLayoutMilestones):
1485         * UIProcess/API/Cocoa/WKWebView.mm:
1486         (layoutMilestones):
1487
1488 2018-07-07  Simon Fraser  <simon.fraser@apple.com>
1489
1490         REGRESSION (r233561): MobileMail crashes when replying to an email
1491         https://bugs.webkit.org/show_bug.cgi?id=187436
1492         rdar://problem/41931915
1493
1494         Reviewed by Alan Bujtas.
1495         
1496         r233561 added a RELEASE_ASSERT(isMainThread()) in this function. This is fine most of the time,
1497         until Mail spawns a WebThread for mail compose, at which point the meaning of isMainThread changes
1498         and the RELEASE_ASSERT fires.
1499         
1500         For now, just remove the RELEASE_ASSERT.
1501
1502         * UIProcess/API/Cocoa/WKWebView.mm:
1503         (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
1504
1505 2018-07-06  Timothy Hatcher  <timothy@apple.com>
1506
1507         Semantic colors don't update when accessibility Increase Contrast mode is enabled.
1508         https://bugs.webkit.org/show_bug.cgi?id=187425
1509         rdar://problem/39948240
1510
1511         Reviewed by Tim Horton.
1512
1513         * UIProcess/API/Cocoa/WKWebView.mm:
1514         (-[WKWebView _initializeWithConfiguration:]): Moved call to setUseDarkAppearance to WebViewImpl.
1515         (-[WKWebView _setUseSystemAppearance:]): No need to call setUseDarkAppearance here anymore.
1516         (-[WKWebView viewDidChangeEffectiveAppearance]): Added. This is the proper NSView method to use.
1517         (-[WKWebView _effectiveAppearanceIsDark]): Deleted.
1518         (-[WKWebView effectiveAppearanceDidChange]): Deleted. This method is a deprecated name.
1519         * UIProcess/API/mac/WKView.mm:
1520         (-[WKView viewDidChangeEffectiveAppearance]): Added. This is the proper NSView method to use.
1521         (-[WKView _setUseSystemAppearance:]): No need to call setUseDarkAppearance here anymore.
1522         (-[WKView _effectiveAppearanceIsDark]): Deleted.
1523         (-[WKView effectiveAppearanceDidChange]): Deleted. This method is a deprecated name.
1524         * UIProcess/Cocoa/WebViewImpl.h:
1525         * UIProcess/Cocoa/WebViewImpl.mm:
1526         (WebKit::WebViewImpl::WebViewImpl): Call setUseDarkAppearance before page config is sent in initializeWebPage.
1527         (WebKit::WebViewImpl::effectiveAppearanceDidChange): Added.
1528         * WebProcess/WebPage/WebPage.cpp:
1529         (WebKit::WebPage::setUseDarkAppearance): WebCore::Page::setUseDarkAppearance now handles the style changes.
1530         The RenderTheme color caches also don't need cleared with platformColorsDidChange(), since we cache light
1531         and dark colors seperatly in RenderThemeMac.
1532
1533 2018-07-06  Chris Dumez  <cdumez@apple.com>
1534
1535         Add release assertions to try and catch a possible HashMap corruption in NetworkConnectionToWebProcess
1536         https://bugs.webkit.org/show_bug.cgi?id=187417
1537
1538         Reviewed by Ryosuke Niwa.
1539
1540         Add assertions to make sure we:
1541         - Always use NetworkConnectionToWebProcess::m_networkResourceLoaders from the main thread
1542         - Never use a 0 identifier as key for NetworkConnectionToWebProcess::m_networkResourceLoaders
1543
1544         We see crashes (rdar://problem/39265927) that only seem to make sense if this HashMap was
1545         somehow getting corrupted. Let's try and catch the most common reasons for HashMap corruption.
1546
1547         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1548         (WebKit::NetworkConnectionToWebProcess::didCleanupResourceLoader):
1549         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
1550         (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
1551         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
1552         (WebKit::NetworkConnectionToWebProcess::removeLoadIdentifier):
1553         (WebKit::NetworkConnectionToWebProcess::setDefersLoading):
1554         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
1555         * WebProcess/Network/WebResourceLoader.cpp:
1556         (WebKit::WebResourceLoader::messageSenderDestinationID):
1557
1558 2018-07-06  Brian Burg  <bburg@apple.com>
1559
1560         WebDriver: hang in Selenium test alerts_tests.py::testShouldHandleAlertOnPageBeforeUnload
1561         https://bugs.webkit.org/show_bug.cgi?id=187418
1562         <rdar://problem/41909520>
1563
1564         Reviewed by Timothy Hatcher.
1565
1566         Per the W3C specification, “User prompts that are spawned from beforeunload event handlers,
1567         are dismissed implicitly upon navigation or close window, regardless of the defined user prompt handler.”
1568
1569         This behavior differs from legacy Selenium behavior where (as in the test) it's expected that
1570         a test can accept or dismiss a beforeunload alert manually.
1571
1572         Prior to this patch, beforeunload alerts hang because Safari uses a nested modal run loop, which does
1573         not process incoming Automation messages, so there was no way for the test to manually dismiss
1574         the alert.
1575
1576         * UIProcess/WebPageProxy.cpp:
1577         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
1578         Don't show beforeunload alerts for pages being controlled by automation.
1579
1580
1581 2018-07-06  Chris Dumez  <cdumez@apple.com>
1582
1583         ASSERTION FAILED: contextConnection under WebCore::SWServer::terminateWorkerInternal
1584         https://bugs.webkit.org/show_bug.cgi?id=187348
1585         <rdar://problem/41853270>
1586
1587         Reviewed by Youenn Fablet.
1588
1589         Make sure we mark corresponding SWServerWorkers as terminated when we terminate a
1590         Service Worker context connection once it is no longer needed.
1591
1592         * StorageProcess/StorageProcess.cpp:
1593         (WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
1594
1595 2018-07-06  Andy Estes  <aestes@apple.com>
1596
1597         [iOS] WKPDFView should show the Data Detectors sheet when long-pressing a URL that Data Detectors can handle
1598         https://bugs.webkit.org/show_bug.cgi?id=187396
1599         <rdar://problem/41786980>
1600
1601         Reviewed by Dan Bernstein.
1602
1603         If a URL can be presented by Data Detectors, show the Data Detectors sheet instead
1604         of the link sheet. Also implement the optional WKActionSheetAssistantDelegate
1605         method that asks the UI delegate for its data detection context.
1606
1607         * UIProcess/ios/WKPDFView.mm:
1608         (-[WKPDFView _showActionSheetForURL:atLocation:withAnnotationRect:]):
1609         (-[WKPDFView dataDetectionContextForActionSheetAssistant:]):
1610
1611 2018-07-06  Chris Dumez  <cdumez@apple.com>
1612
1613         WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler() should take in a CompletionHandler
1614         https://bugs.webkit.org/show_bug.cgi?id=187392
1615
1616         Reviewed by Youenn Fablet.
1617
1618         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1619         (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
1620         * UIProcess/WebResourceLoadStatisticsStore.h:
1621
1622 2018-07-06  Chris Dumez  <cdumez@apple.com>
1623
1624         [iOS] Assertion failure in WebProcessProxy::allProcesses() (isMainThread())
1625         https://bugs.webkit.org/show_bug.cgi?id=187394
1626
1627         Reviewed by Dan Bernstein.
1628
1629         Use RunLoop::isMain() instead of isMainThread() in the assertion to fix issues for
1630         applications using both WebKit and WebKitLegacy.
1631
1632         * UIProcess/WebProcessProxy.cpp:
1633
1634 2018-07-06  Daniel Bates  <dabates@apple.com>
1635
1636         Remove Strong Confirmation Password button
1637         https://bugs.webkit.org/show_bug.cgi?id=187306
1638         <rdar://problem/41795185>
1639
1640         Reviewed by Sam Weinig.
1641
1642         Remove support for the Strong Confirmation Password button because we never made use of it.
1643
1644         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
1645         (toAutoFillButtonType):
1646         (toWKAutoFillButtonType):
1647         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
1648         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
1649         (toAutoFillButtonType):
1650         (toWKAutoFillButtonType):
1651         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
1652
1653 2018-07-05  Youenn Fablet  <youenn@apple.com>
1654
1655         REGRESSION (r230843): Flash doesn't work; Produces blue box on page
1656         https://bugs.webkit.org/show_bug.cgi?id=187346
1657         <rdar://problem/41773974>
1658
1659         Reviewed by Ryosuke Niwa.
1660
1661         Reset page plugins when the load client policies are updated.
1662         This will ensure that pages will rebuild their plugin lists based on the new policies.
1663
1664         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
1665         (WebKit::WebPluginInfoProvider::setPluginLoadClientPolicy):
1666         (WebKit::WebPluginInfoProvider::clearPluginClientPolicies):
1667
1668 2018-07-05  Brady Eidson  <beidson@apple.com>
1669
1670         IndexedDB operations in a Page fail after a StorageProcess crash.
1671         <rdar://problem/41626526> and https://bugs.webkit.org/show_bug.cgi?id=187123
1672
1673         Reviewed by Alex Christensen.
1674
1675         When the connection to a StorageProcess goes away, explicitly tell all of the WebPages
1676         in the WebProcess about it.
1677         
1678         This puts Documents/Workers in an error mode where requests fail instead of timeout.
1679         It also clears the Page's connection so *new* Documents and Workers will get a fresh 
1680         new connection that works.
1681         
1682         * UIProcess/API/C/WKContext.cpp:
1683         (WKContextTerminateStorageProcess):
1684         
1685         * UIProcess/API/Cocoa/WKProcessPool.mm:
1686         (-[WKProcessPool _terminateStorageProcess]):
1687         
1688         * UIProcess/Storage/StorageProcessProxy.cpp:
1689         (WebKit::StorageProcessProxy::terminateForTesting):
1690         * UIProcess/Storage/StorageProcessProxy.h:
1691         
1692         * UIProcess/WebProcessPool.cpp:
1693         (WebKit::WebProcessPool::terminateStorageProcessForTesting):
1694         (WebKit::WebProcessPool::terminateStorageProcess): Deleted.
1695         * UIProcess/WebProcessPool.h:
1696         
1697         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
1698         (WebKit::WebToStorageProcessConnection::didClose):
1699         * WebProcess/Storage/WebToStorageProcessConnection.h:
1700         (WebKit::WebToStorageProcessConnection::existingIDBConnectionToServerForIdentifier):
1701         
1702         * WebProcess/WebProcess.cpp:
1703         (WebKit::WebProcess::webToStorageProcessConnectionClosed):
1704
1705 2018-07-05  Simon Fraser  <simon.fraser@apple.com>
1706
1707         Address two possible causes of missing tiles in iOS Safari, and add logging to gather more data about other possible causes
1708         https://bugs.webkit.org/show_bug.cgi?id=187376
1709         rdar://problem/40941118
1710
1711         Reviewed by Tim Horton.
1712         
1713         We have continual reports of users experiencing missing tiles in MobileSafari, where loading a page
1714         shows the tiles at the top, but we don't render new tiles as the user scrolls down. This is consistent
1715         with failing to dispatch visible content rect updates via -[WKWebView _updateVisibleContentRects].
1716         
1717         This patch addresses two possible (but unlikely) causes. First, it resets _currentlyAdjustingScrollViewInsetsForKeyboard
1718         after a web process crash. Second, it catches exceptions thrown by [webView _updateVisibleContentRects]
1719         and resets _hasScheduledVisibleRectUpdate.
1720         
1721         This patch also adds release logging that fires if over 1s has elapsed between scheduling
1722         a visible content rect update and trying to re-schedule, and logging for all reasons that
1723         -_updateVisibleContentRects returns early.
1724
1725         * UIProcess/API/Cocoa/WKWebView.mm:
1726         (-[WKWebView _initializeWithConfiguration:]):
1727         (-[WKWebView _processDidExit]):
1728         (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]):
1729         (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
1730         (-[WKWebView _updateVisibleContentRects]):
1731
1732 2018-07-05  Olivia Barnett  <obarnett@apple.com>
1733
1734         iPad: Scrolling with hardware keyboard while SELECT popover is visible scrolls the page, detaches popover
1735         https://bugs.webkit.org/show_bug.cgi?id=187363
1736         <rdar://problem/41106306>
1737
1738         Reviewed by Tim Horton.
1739
1740         Added extra check to prevent keyboard scrolling when the select box is open.
1741
1742         * UIProcess/ios/WKContentViewInteraction.mm:
1743         (-[WKContentView _scrollOffsetForEvent:]):
1744
1745 2018-07-05  Timothy Hatcher  <timothy@apple.com>
1746
1747         Rename and flip the meaning of defaultAppearance to be useDarkAppearance.
1748         https://bugs.webkit.org/show_bug.cgi?id=187369
1749         rdar://problem/41870420
1750
1751         Reviewed by Tim Horton.
1752
1753         * Shared/WebPageCreationParameters.cpp:
1754         (WebKit::WebPageCreationParameters::encode const):
1755         (WebKit::WebPageCreationParameters::decode):
1756         * Shared/WebPageCreationParameters.h:
1757         * UIProcess/API/Cocoa/WKWebView.mm:
1758         (-[WKWebView _effectiveAppearanceIsDark]):
1759         (-[WKWebView _initializeWithConfiguration:]):
1760         (-[WKWebView _setUseSystemAppearance:]):
1761         (-[WKWebView effectiveAppearanceDidChange]):
1762         (-[WKWebView _defaultAppearance]): Deleted.
1763         * UIProcess/API/mac/WKView.mm:
1764         (-[WKView _effectiveAppearanceIsDark]):
1765         (-[WKView effectiveAppearanceDidChange]):
1766         (-[WKView _setUseSystemAppearance:]):
1767         (-[WKView _defaultAppearance]): Deleted.
1768         (-[WKView _setDefaultAppearance:]): Deleted.
1769         * UIProcess/Cocoa/WebViewImpl.h:
1770         * UIProcess/Cocoa/WebViewImpl.mm:
1771         (WebKit::WebViewImpl::effectiveAppearanceIsDark):
1772         (WebKit::WebViewImpl::setUseDarkAppearance):
1773         (WebKit::WebViewImpl::useDefaultAppearance): Deleted.
1774         (WebKit::WebViewImpl::setDefaultAppearance): Deleted.
1775         * UIProcess/WebPageProxy.cpp:
1776         (WebKit::WebPageProxy::creationParameters):
1777         (WebKit::WebPageProxy::setUseDarkAppearance):
1778         (WebKit::WebPageProxy::showPlaybackTargetPicker):
1779         (WebKit::WebPageProxy::setDefaultAppearance): Deleted.
1780         * UIProcess/WebPageProxy.h:
1781         (WebKit::WebPageProxy::useDarkAppearance const):
1782         (WebKit::WebPageProxy::defaultAppearance const): Deleted.
1783         * UIProcess/mac/WKPrintingView.mm:
1784         (-[WKPrintingView drawRect:]):
1785         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
1786         (WebKit::InjectedBundleRangeHandle::renderedImage):
1787         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1788         (WebKit::PDFPlugin::paintControlForLayerInContext):
1789         * WebProcess/WebPage/WebPage.cpp:
1790         (WebKit::m_credentialsMessenger):
1791         (WebKit::WebPage::drawRect):
1792         (WebKit::WebPage::setUseDarkAppearance):
1793         (WebKit::WebPage::setDefaultAppearance): Deleted.
1794         * WebProcess/WebPage/WebPage.h:
1795         * WebProcess/WebPage/WebPage.messages.in:
1796
1797 2018-07-05  Brian Burg  <bburg@apple.com>
1798
1799         REGRESSION: ASSERT under WebAutomationSessionProxy::computeElementLayout when elementInViewClientCenterPoint returns nullopt
1800         https://bugs.webkit.org/show_bug.cgi?id=187367
1801         <rdar://problem/41861346>
1802
1803         Reviewed by Timothy Hatcher.
1804
1805         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1806         (WebKit::WebAutomationSessionProxy::computeElementLayout):
1807         There's no reason to unwrap this optional, as the IPC argument type is std::optional<IntPoint>.
1808
1809 2018-07-05  Tim Horton  <timothy_horton@apple.com>
1810
1811         Upstream hover gesture implementation
1812         https://bugs.webkit.org/show_bug.cgi?id=187366
1813
1814         Reviewed by Wenson Hsieh.
1815
1816         * UIProcess/ios/WKContentViewInteraction.h:
1817         * UIProcess/ios/WKContentViewInteraction.mm:
1818         (-[WKContentView setupInteraction]):
1819         (-[WKContentView cleanupInteraction]):
1820         (-[WKContentView _removeDefaultGestureRecognizers]):
1821         (-[WKContentView _addDefaultGestureRecognizers]):
1822         (-[WKContentView _hoverGestureRecognizerChanged:]):
1823
1824 2018-07-05  Tim Horton  <timothy_horton@apple.com>
1825
1826         Fix some -Wdocumentation warnings in WebKit
1827         https://bugs.webkit.org/show_bug.cgi?id=187318
1828
1829         Reviewed by Dan Bernstein.
1830
1831         Fix most of the -Wdocumentation warnings in WebKit. The remaining
1832         ones are slightly mysterious, so we can't turn the warning on yet.
1833
1834         * Configurations/BaseTarget.xcconfig:
1835         Define U_HIDE_DEPRECATED_API. It's defined in all other WebKit projects,
1836         and the doc comments in the deprecated ICU API have some errors.
1837
1838         * UIProcess/API/Cocoa/WKUIDelegate.h:
1839         * UIProcess/API/Cocoa/WKWebView.h:
1840         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
1841         Adjust comments or parameter names to be consistent with each other.
1842
1843 2018-07-05  Chris Dumez  <cdumez@apple.com>
1844
1845         Regression(r232886): WebsiteDataStore objects may get destroyed on a background thread
1846         https://bugs.webkit.org/show_bug.cgi?id=187356
1847         <rdar://problem/41854555>
1848
1849         Reviewed by Geoffrey Garen.
1850
1851         As of r232886, CallbackAggregators in WebsiteDataStore hold a Ref<> to their WebsiteDataStore. This
1852         is an issue because CallbackAggregator objects can get destroyed on a background thread and may be
1853         the last ones holding a ref to the data store. When this happens, the WebsiteDataStore would get
1854         destroyed on a background store and potentially cause crashes. Note that even if the callback
1855         aggregator would not be the last one to hold a ref to the store, it still would not be safe to deref
1856         the store on the background thread since WebsiteDataStore is not ThreadSafeRefCounted.
1857
1858         To address the issue, this patch updates the CallbackAggregators' destructor to deref their data
1859         store member on the main thread. Note that we could also have WebsiteDataStore subclass
1860         ThreadSafeRefCounted<T, DestructionThread::Main> but the data store technically does not need to
1861         be ThreadSafeRefCounted at the moment.
1862
1863         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1864         (WebKit::WebsiteDataStore::WebsiteDataStore):
1865         (WebKit::WebsiteDataStore::~WebsiteDataStore):
1866         (WebKit::WebsiteDataStore::fetchDataAndApply):
1867         (WebKit::WebsiteDataStore::removeData):
1868
1869 2018-07-05  Dan Bernstein  <mitz@apple.com>
1870
1871         [macOS] REGRESSION: Development WebContent service has restricted entitlements, rendering it useless for development
1872         https://bugs.webkit.org/show_bug.cgi?id=187355
1873
1874         Reviewed by Anders Carlsson.
1875
1876         * Configurations/WebContentService.Development.xcconfig: Set WK_USE_RESTRICTED_ENTITLEMENTS
1877           to NO for the Development service.
1878
1879 2018-07-05  Rob Buis  <rbuis@igalia.com>
1880
1881         [GTK] Remove soup/DownloadSoupErrors.h
1882         https://bugs.webkit.org/show_bug.cgi?id=187339
1883
1884         This header is not used anymore.
1885
1886         Reviewed by Frédéric Wang.
1887
1888         * NetworkProcess/Downloads/soup/DownloadSoupErrors.h: Removed.
1889         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1890         * PlatformGTK.cmake:
1891
1892 2018-07-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1893
1894         REGRESSION(r233325): [GTK] Broke 40 animations tests
1895         https://bugs.webkit.org/show_bug.cgi?id=187264
1896
1897         Reviewed by Žan Doberšek.
1898
1899         Use a different PlatformDisplayID for compositing in the GTK port. This way, when entering AC a window screen
1900         changed is emitted and the GTK default display refresh monitor is destroyed, ensuring the one created by the
1901         threaded compositor is used.
1902
1903         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1904         (WebKit::ThreadedCompositor::create): Remove unused WebPage parameter and add PlatformDisplayID.
1905         (WebKit::ThreadedCompositor::ThreadedCompositor): Create the display refresh monitor with the given displayID.
1906         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1907         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
1908         (WebKit::ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor): Pass the given displayID to the parent constructor.
1909         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h:
1910         (WebKit::ThreadedDisplayRefreshMonitor::create): Add PlatformDisplayID parameter.
1911         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
1912         (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): Use compositingDisplayID when
1913         creating the threaded compositor and notify about the window screen change.
1914         (WebKit::ThreadedCoordinatedLayerTreeHost::setIsDiscardable): Use primaryDisplayID when leaving AC and
1915         compositingDisplayID when re-entering.
1916
1917 2018-07-04  Olivia Barnett  <obarnett@apple.com>
1918
1919         A WKWebView in a UIViewController that is presented modally and uses a file picker will be incorrectly dismissed by the system
1920         https://bugs.webkit.org/show_bug.cgi?id=185257
1921         <rdar://problem/40819252>
1922
1923         Reviewed by Tim Horton.
1924
1925         Call to dismiss the presented modal was being called on the parent and not the child, which caused the file picker to be incorrectly dismissed along with the modal. A test for this bug-fix could not be completed without additional tools as TestWebKitAPI is not a UI application.
1926
1927         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1928         (-[WKFileUploadPanel _dismissDisplayAnimated:]):
1929
1930 2018-07-04  Tim Horton  <timothy_horton@apple.com>
1931
1932         Introduce PLATFORM(IOSMAC)
1933         https://bugs.webkit.org/show_bug.cgi?id=187315
1934
1935         Reviewed by Dan Bernstein.
1936
1937         * Configurations/Base.xcconfig:
1938         * Configurations/FeatureDefines.xcconfig:
1939         * Configurations/NetworkService.xcconfig:
1940         * Configurations/WebContentService.xcconfig:
1941         * Configurations/WebKit.xcconfig:
1942         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1943         (WebKit::NetworkProcess::sourceApplicationAuditData const):
1944         * NetworkProcess/ios/NetworkProcessIOS.mm:
1945         * NetworkProcess/mac/NetworkProcessMac.mm:
1946         (WebKit::NetworkProcess::initializeProcessName):
1947         (WebKit::overrideSystemProxies):
1948         * Platform/mac/LayerHostingContext.mm:
1949         (WebKit::LayerHostingContext::createForExternalHostingProcess):
1950         * Platform/spi/ios/UIKitSPI.h:
1951         * Shared/ios/ChildProcessIOS.mm:
1952         (WebKit::ChildProcess::initializeSandbox):
1953         * Shared/ios/InteractionInformationAtPosition.h:
1954         * Shared/ios/InteractionInformationAtPosition.mm:
1955         (WebKit::InteractionInformationAtPosition::encode const):
1956         (WebKit::InteractionInformationAtPosition::decode):
1957         * Shared/mac/ChildProcessMac.mm:
1958         (WebKit::ChildProcess::setApplicationIsDaemon):
1959         (WebKit::enableSandboxStyleFileQuarantine):
1960         * Shared/mac/CodeSigning.mm:
1961         * UIProcess/API/Cocoa/WKWebView.mm:
1962         (-[WKWebView _webViewPrintFormatter]):
1963         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1964         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
1965         (WebKit::RemoteLayerTreeHost::updateLayerTree):
1966         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
1967         (-[WKRemoteView initWithFrame:contextID:]):
1968         * UIProcess/_WKWebViewPrintFormatter.mm:
1969         * UIProcess/_WKWebViewPrintFormatterInternal.h:
1970         * UIProcess/ios/WKContentView.mm:
1971         (-[WKContentView _didExitStableState]):
1972         * UIProcess/ios/WKContentViewInteraction.mm:
1973         (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
1974         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
1975         (-[WKContentView canPerformActionForWebView:withSender:]):
1976         (-[WKContentView _defineForWebView:]):
1977         (-[WKContentView setSelectedTextRange:]):
1978         (-[WKContentView closestPositionToPoint:]):
1979         (-[WKContentView _updateChangedSelection:]):
1980         * UIProcess/ios/WKLegacyPDFView.mm:
1981         * UIProcess/ios/WKPDFView.mm:
1982         * WebKit.xcodeproj/project.pbxproj:
1983         * WebProcess/WebPage/ios/WebPageIOS.mm:
1984         (WebKit::WebPage::selectWithGesture):
1985         (WebKit::WebPage::getPositionInformation):
1986         * WebProcess/cocoa/WebProcessCocoa.mm:
1987         (WebKit::WebProcess::initializeSandbox):
1988         * config.h:
1989
1990 2018-07-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1991
1992         50 failing WebDriver tests after r233417
1993         https://bugs.webkit.org/show_bug.cgi?id=187263
1994
1995         Reviewed by Frédéric Wang.
1996
1997         A std::optional value is used while being std::nullopt. This is because the wrong input source is used when
1998         transitioning keyboard input states.
1999
2000         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
2001         (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
2002
2003 2018-07-03  Youenn Fablet  <youenn@apple.com>
2004
2005         Remove quarantine for Webex plugin
2006         https://bugs.webkit.org/show_bug.cgi?id=187050
2007         rdar://problem/41478189
2008
2009         Reviewed by Brent Fulgham.
2010
2011         Update the Plugin Info.plist to not do quarantine of downloaded files by default.
2012         Update PluginProcess implementation to reenable quarantine for all plug-ins except cisco webex plug-in.
2013
2014         * Platform/spi/mac/QuarantineSPI.h: Add qtn_proc_init.
2015         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
2016         * PluginProcess/PluginProcess.h:
2017         * PluginProcess/mac/PluginProcessMac.mm:
2018         (WebKit::PluginProcess::shouldOverrideQuarantine):
2019         * Shared/ChildProcess.h:
2020         (WebKit::ChildProcess::shouldOverrideQuarantine):
2021         * Shared/mac/ChildProcessMac.mm:
2022         (WebKit::ChildProcess::initializeSandbox):
2023
2024 2018-07-03  Youenn Fablet  <youenn@apple.com>
2025
2026         Crash in  WebKit::CacheStorage::Cache::toRecordInformation when running http/tests/cache-storage/cache-persistency.https.html
2027         https://bugs.webkit.org/show_bug.cgi?id=187243
2028
2029         Reviewed by Chris Dumez.
2030
2031         In case a caches object has an engine, it uses the engine to get the salt.
2032         In case engine/caches are non persistent, no salt was set for the engine, hence the crashes.
2033         Add an empty salt whenever initializing a non-persistent engine to remove the crash.
2034
2035         Covered by updated expectations for two tests.
2036
2037         * NetworkProcess/cache/CacheStorageEngine.cpp:
2038         (WebKit::CacheStorage::Engine::initialize):
2039
2040 2018-07-03  Youenn Fablet  <youenn@apple.com>
2041
2042         Fix regression introduced in r233335
2043         https://bugs.webkit.org/show_bug.cgi?id=187282
2044
2045         Reviewed by Chris Dumez.
2046
2047         When checking for navigation loads, we need to return whether the request URL matches the service worker URL.
2048         Before this patch, if the request URL was not matching the service worker URL, we were using the origin/referrer
2049         which should only be used for subresource loads.
2050
2051         Covered by imported/w3c/web-platform-tests/service-workers/service-worker/claim-with-redirect.https.html
2052         being no longer flaky.
2053
2054         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2055         (WebKit::isValidFetch):
2056
2057 2018-07-03  Chris Dumez  <cdumez@apple.com>
2058
2059         Make CallbackMap::invalidate() safe to re-enter
2060         https://bugs.webkit.org/show_bug.cgi?id=187298
2061         <rdar://problem/41057167>
2062
2063         Reviewed by Geoffrey Garen.
2064
2065         Made it safe to re-enter CallbackMap::invalidate(), GenericCallback::performCallbackWithReturnValue(),
2066         GenericCallback::invalidate() & invalidateCallbackMap() since those execute client blocks which may
2067         re-enter WebKit.
2068
2069         * UIProcess/GenericCallback.h:
2070         (WebKit::GenericCallback::performCallbackWithReturnValue):
2071         (WebKit::invalidateCallbackMap):
2072
2073 2018-07-03  Brent Fulgham  <bfulgham@apple.com>
2074
2075         [iOS] Clean up sandbox warnings found during Public Beta
2076         https://bugs.webkit.org/show_bug.cgi?id=187308
2077         <rdar://problem/41203914>
2078
2079         Reviewed by Eric Carlson.
2080
2081         I made our sandbox overly restrictive during our iOS 12.0 development cycle, and have found a number of missing items.
2082
2083         This patch adds the missing IOKit properties, and removes a duplicate call to (play-media).
2084
2085         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2086
2087 2018-07-03  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2088
2089         [Curl] Embed certificate information into ResourceResponse.
2090         https://bugs.webkit.org/show_bug.cgi?id=187102
2091
2092         Reviewed by Youenn Fablet.
2093
2094         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
2095         (WebKit::NetworkDataTaskCurl::curlDidComplete):.
2096
2097 2018-07-03  Simon Fraser  <simon.fraser@apple.com>
2098
2099         [iOS WK2] We fail to make surfaces volatile when suspending, increasing memory impact
2100         https://bugs.webkit.org/show_bug.cgi?id=187285
2101         rdar://problem/41732391
2102
2103         Reviewed by Tim Horton.
2104         
2105         The "Mach port as layer contents" code path used in iOS WK2 relies on replacing the 
2106         Mach port layer contents with the actual IOSurface on suspension (otherwise the
2107         live Mach port will keep the surface in use). However, we were never hitting this
2108         RemoteLayerTreeHost::mapAllIOSurfaceBackingStore() code path on iOS 11 and later
2109         because UIKit stopped firing the notification we relied on.
2110         
2111         To fix this, use the _UIApplicationDidFinishSuspensionSnapshotNotification notification
2112         which is fired on UIApp.
2113
2114         * Platform/spi/ios/UIKitSPI.h:
2115         * UIProcess/ApplicationStateTracker.mm:
2116         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
2117
2118 2018-07-02  Simon Fraser  <simon.fraser@apple.com>
2119
2120         Clean up the layer volatility code and logging
2121         https://bugs.webkit.org/show_bug.cgi?id=187286
2122
2123         Reviewed by Tim Horton.
2124         
2125         Fix the layer volatility logging so it doesn't say "succeeded" when it actually failed
2126         and gave up.
2127         
2128         Use a couple of lambda functions in RemoteLayerBackingStore::setBufferVolatility() to
2129         make the code easier to read.
2130
2131         * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
2132         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
2133         (WebKit::RemoteLayerBackingStore::setBufferVolatility):
2134         * WebProcess/WebPage/WebPage.cpp:
2135         (WebKit::WebPage::callVolatilityCompletionHandlers):
2136         (WebKit::WebPage::layerVolatilityTimerFired):
2137         (WebKit::WebPage::markLayersVolatile):
2138         * WebProcess/WebPage/WebPage.h:
2139         (WebKit::WebPage::markLayersVolatile):
2140         * WebProcess/WebProcess.cpp:
2141         (WebKit::WebProcess::actualPrepareToSuspend):
2142         (WebKit::WebProcess::markAllLayersVolatile):
2143         * WebProcess/WebProcess.h:
2144
2145 2018-07-03  John Wilander  <wilander@apple.com>
2146
2147         Resource Load Statistics: Make WebsiteDataStore::getAllStorageAccessEntries() call the right network process instead of iterating over the process pools
2148         https://bugs.webkit.org/show_bug.cgi?id=187277
2149         <rdar://problem/41745510>
2150
2151         Reviewed by Chris Dumez.
2152
2153         Existing tests use this code. The change is for correctness.
2154
2155         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2156         (-[WKWebsiteDataStore _getAllStorageAccessEntriesFor:completionHandler:]):
2157             Now receives a WKWebView from its caller and gets the page ID from it.
2158         (-[WKWebsiteDataStore _getAllStorageAccessEntries:]): Deleted.
2159         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2160         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2161         (WebKit::WebsiteDataStore::getAllStorageAccessEntries):
2162             Now gets a page ID from its caller and gets the right network process
2163             through it.
2164         * UIProcess/WebsiteData/WebsiteDataStore.h:
2165
2166 2018-07-03  Jonathan Bedard  <jbedard@apple.com>
2167
2168         Unreviewed, rolling out r233461.
2169
2170         Assertions triggered during iOS 11 debug layout and API tests
2171
2172         Reverted changeset:
2173
2174         "[iOS] Add assert to catch improper use of WebCore::Timer in
2175         UI Process"
2176         https://bugs.webkit.org/show_bug.cgi?id=185330
2177         https://trac.webkit.org/changeset/233461
2178
2179 2018-07-03  Youenn Fablet  <youenn@apple.com>
2180
2181         Update com.cmbchina.CMBSecurity.sb to make it functional
2182         https://bugs.webkit.org/show_bug.cgi?id=187278
2183
2184         Reviewed by Brent Fulgham.
2185
2186         * Resources/PlugInSandboxProfiles/com.cmbchina.CMBSecurity.sb:
2187
2188 2018-07-03  Jer Noble  <jer.noble@apple.com>
2189
2190         Update Fullscreen anti-phishing alert text
2191         https://bugs.webkit.org/show_bug.cgi?id=187199
2192         <rdar://problem/41162543>
2193
2194         Reviewed by Brent Fulgham.
2195
2196         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
2197         (-[WKFullScreenViewController _showPhishingAlert]):
2198
2199 2018-07-03  David Kilzer  <ddkilzer@apple.com>
2200
2201         [iOS] Add assert to catch improper use of WebCore::Timer in UI Process
2202         <https://webkit.org/b/185330>
2203         <rdar://problem/32816079>
2204
2205         Reviewed by Darin Adler.
2206
2207         * NetworkProcess/NetworkProcess.cpp:
2208         (WebKit::NetworkProcess::NetworkProcess):
2209         * StorageProcess/StorageProcess.cpp:
2210         (WebKit::StorageProcess::StorageProcess):
2211         * WebProcess/WebProcess.cpp:
2212         (WebKit::m_nonVisibleProcessCleanupTimer):
2213         - Call setWebKitProcessType() to se the global for the current
2214           process.
2215
2216 2018-07-03  Frederic Wang  <fred.wang@free.fr>
2217
2218         [iOS] Animations with Bézier timing function not suspended on UI process when animation-play-state is set to "paused"
2219         https://bugs.webkit.org/show_bug.cgi?id=170784
2220
2221         Reviewed by Antoine Quint.
2222
2223         In order to pause a running animation, GraphicsLayerCA::pauseCAAnimationOnLayer calls
2224         PlatformCALayer::addAnimationForKey, assuming it will replace the current animation.
2225         This patch fixes PlatformCALayerRemote::addAnimationForKey to ensure this assumption holds.
2226
2227         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
2228         (WebKit::PlatformCALayerRemote::addAnimationForKey): If the animation was already sent to
2229         the UI process, make sure it is properly updated.
2230
2231 2018-07-02  Youenn Fablet  <youenn@apple.com>
2232
2233         Add sandbox to microdone plugin
2234         https://bugs.webkit.org/show_bug.cgi?id=187149
2235         <rdar://problem/41538057>
2236
2237         Unreviewed.
2238
2239         * Resources/PlugInSandboxProfiles/cn.microdone.cmb.safari.sb: Renamed from Source/WebKit/Resources/PlugInSandboxProfiles/cn.microdone.cmb.safari.
2240         * WebKit.xcodeproj/project.pbxproj:
2241
2242 2018-07-02  Tim Horton  <timothy_horton@apple.com>
2243
2244         Adjust now-incorrect animated resize logging after r232544
2245         https://bugs.webkit.org/show_bug.cgi?id=187281
2246         <rdar://problem/41645347>
2247
2248         Reviewed by Simon Fraser.
2249
2250         * UIProcess/API/Cocoa/WKWebView.mm:
2251         (-[WKWebView _didCommitLayerTree:]):
2252         (-[WKWebView _didCompleteAnimatedResize]):
2253         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
2254         _beginAnimatedResizeWithUpdate: and _didCompleteAnimatedResize are
2255         not strictly paired; we could instead track the SPI, but it's a bit
2256         tricky since resizeWithContentHidden has an implicit endAnimatedResize.
2257         Instead, just log if we still have a resizeAnimationView when we're
2258         committing outside of an animated resize, which seems to be the original concern,
2259         and point toward the possibility of unpaired begin/end.
2260         Also fix logging that has the wrong method name.
2261
2262 2018-07-02  Youenn Fablet  <youenn@apple.com>
2263
2264         Update com.apple.NPSafeInput.sb to make it functional
2265         https://bugs.webkit.org/show_bug.cgi?id=187276
2266
2267         Reviewed by Brent Fulgham.
2268
2269         * Resources/PlugInSandboxProfiles/com.apple.NPSafeInput.sb:
2270
2271 2018-07-02  Youenn Fablet  <youenn@apple.com>
2272
2273         Update com.cfca.npSecEditCtl.MAC.BOC.plugin.sb to make it functional
2274         https://bugs.webkit.org/show_bug.cgi?id=187261
2275
2276         Reviewed by Brent Fulgham.
2277
2278         * Resources/PlugInSandboxProfiles/com.cfca.npSecEditCtl.MAC.BOC.plugin.sb:
2279
2280 2018-07-02  Brady Eidson  <beidson@apple.com>
2281
2282         Crash notifying observers of responsiveness state change
2283         <rdar://problem/41267796> and https://bugs.webkit.org/show_bug.cgi?id=187262
2284
2285         Reviewed by Tim Horton.
2286
2287         * UIProcess/PageLoadState.cpp:
2288         (WebKit::PageLoadState::callObserverCallback): Copy the container ahead of time.
2289
2290 2018-07-02  Sihui Liu  <sihui_liu@apple.com>
2291
2292         Remove InitWebCoreThreadSystemInterface() in WKProcessPool _initWithConfiguration
2293         https://bugs.webkit.org/show_bug.cgi?id=187252
2294
2295         Reviewed by Dan Bernstein.
2296
2297         Clean up after <rdar://problem/15256572>.
2298
2299         * UIProcess/API/Cocoa/WKProcessGroup.mm:
2300         (-[WKProcessGroup initWithInjectedBundleURL:]):
2301         * UIProcess/API/Cocoa/WKProcessPool.mm:
2302         (-[WKProcessPool _initWithConfiguration:]):
2303
2304 2018-07-02  Zan Dobersek  <zdobersek@igalia.com>
2305
2306         REGRESSION(r233381): Double WebResourceLoadStatisticsStore destructor invocation
2307         https://bugs.webkit.org/show_bug.cgi?id=187247
2308
2309         Reviewed by Chris Dumez.
2310
2311         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2312         (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
2313         Don't call postTask() to dispatch this task, as that keeps a reference
2314         to this WebResourceLoadStatisticsStore object and thus causes problems
2315         when invoked from the destructor in the form of a second destructor
2316         invocation that ends up crashing the process. Blocking nature of this
2317         call should be enough to avoid WebResourceLoadStatisticsStore lifetime
2318         issues.
2319
2320 2018-07-02  Per Arne Vollan  <pvollan@apple.com>
2321
2322         Delete display link when closing page or the WebContent process has crashed.
2323         https://bugs.webkit.org/show_bug.cgi?id=186895
2324
2325         Reviewed by Brent Fulgham.
2326
2327         If there is a running display link in the UI process, there is no need to keep it around if the
2328         page is being closed or the WebContent process has crashed.
2329
2330         * UIProcess/WebPageProxy.cpp:
2331         (WebKit::WebPageProxy::close):
2332         (WebKit::WebPageProxy::resetStateAfterProcessExited):
2333
2334 2018-06-23  Darin Adler  <darin@apple.com>
2335
2336         [Cocoa] Improve ARC compatibility of more code in JavaScriptCore
2337         https://bugs.webkit.org/show_bug.cgi?id=186973
2338
2339         Reviewed by Dan Bernstein.
2340
2341         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
2342         (WebKit::XPCServiceInitializerDelegate::hasEntitlement): Use WTF::hasEntitlement.
2343
2344         * Shared/mac/SandboxUtilities.h: Removed connectedProcessHasEntitlement since
2345         we can now use WTF::hasEntitlement instead.
2346         * Shared/mac/SandboxUtilities.mm: Ditto.
2347
2348         * StorageProcess/ios/StorageProcessIOS.mm:
2349         (WebKit::StorageProcess::parentProcessHasServiceWorkerEntitlement): Use
2350         WTF::hasEntitlement.
2351         * WebProcess/WebPage/ios/WebPageIOS.mm:
2352         (WebKit::WebPage::parentProcessHasServiceWorkerEntitlement): Ditto.
2353
2354 2018-06-30  David Kilzer  <ddkilzer@apple.com>
2355
2356         Fix clang static analyzer warnings: Garbage return value
2357         <https://webkit.org/b/187224>
2358
2359         Reviewed by Eric Carlson.
2360
2361         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2362         (WebKit::WebPlatformStrategies::changeCount):
2363         (WebKit::WebPlatformStrategies::addTypes):
2364         (WebKit::WebPlatformStrategies::setTypes):
2365         (WebKit::WebPlatformStrategies::setBufferForType):
2366         (WebKit::WebPlatformStrategies::setPathnamesForType):
2367         (WebKit::WebPlatformStrategies::setStringForType):
2368         (WebKit::WebPlatformStrategies::getNumberOfFiles):
2369         (WebKit::WebPlatformStrategies::getPasteboardItemsCount):
2370         (WebKit::WebPlatformStrategies::writeCustomData):
2371         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
2372         (WebKit::WebEditorClient::substitutionsPanelIsShowing):
2373         - Use brace initialization for local variables.
2374
2375 2018-06-30  Michael Catanzaro  <mcatanzaro@igalia.com>
2376
2377         Unreviewed, add missing PLATFORM(COCOA) guard after r233207
2378         https://bugs.webkit.org/show_bug.cgi?id=186788
2379         <rdar://problem/41094167>
2380
2381         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2382         (WKBundleExtendClassesForParameterCoder):
2383
2384 2018-06-30  Dan Bernstein  <mitz@apple.com>
2385
2386         Added a missing availability attribute.
2387
2388         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
2389
2390 2018-06-29  John Wilander  <wilander@apple.com>
2391
2392         Resource Load Statistics: Make network process calls only for the process pool that the page belongs to
2393         https://bugs.webkit.org/show_bug.cgi?id=187206
2394         <rdar://problem/41659160>
2395
2396         Reviewed by Chris Dumez.
2397
2398         Instead of iterating over all process pools, we should resolve which
2399         process pool the page belongs to and call the network process only for
2400         that pool. This is especially important since we use WTFMove for the
2401         completion handlers.
2402
2403         This patch also renames "callback" to "completionHandler" for
2404         the functions touched.
2405
2406         A FIXME comment is added to WebsiteDataStore::getAllStorageAccessEntries()
2407         where we currently don't have a page ID to do the lookup with.
2408
2409         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2410         (WebKit::WebsiteDataStore::updatePrevalentDomainsToPartitionOrBlockCookies):
2411         (WebKit::WebsiteDataStore::hasStorageAccessForFrameHandler):
2412         (WebKit::WebsiteDataStore::getAllStorageAccessEntries):
2413         (WebKit::WebsiteDataStore::grantStorageAccessHandler):
2414         (WebKit::WebsiteDataStore::hasStorageAccess):
2415         (WebKit::WebsiteDataStore::requestStorageAccess):
2416         (WebKit::WebsiteDataStore::grantStorageAccess):
2417
2418 2018-06-29  Chris Dumez  <cdumez@apple.com>
2419
2420         Add utility methods to WebResourceLoadStatisticsStore to hop back and forth between threads
2421         https://bugs.webkit.org/show_bug.cgi?id=187200
2422
2423         Reviewed by Brent Fulgham.
2424
2425         Add utility methods to WebResourceLoadStatisticsStore to hop back and forth between threads,
2426         in order the simplify the code a little bit.
2427
2428         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
2429         (WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
2430         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2431         (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
2432         (WebKit::WebResourceLoadStatisticsStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
2433         (WebKit::WebResourceLoadStatisticsStore::setShouldSubmitTelemetry):
2434         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2435         (WebKit::WebResourceLoadStatisticsStore::postTask):
2436         (WebKit::WebResourceLoadStatisticsStore::postTaskReply):
2437         (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
2438         (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
2439         (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
2440         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
2441         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
2442         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
2443         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
2444         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
2445         (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
2446         (WebKit::WebResourceLoadStatisticsStore::submitTelemetry):
2447         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
2448         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
2449         (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
2450         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
2451         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
2452         (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
2453         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
2454         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
2455         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
2456         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
2457         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
2458         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
2459         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
2460         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
2461         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
2462         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
2463         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
2464         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
2465         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
2466         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
2467         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
2468         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
2469         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
2470         (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
2471         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningStateReset):
2472         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory):
2473         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
2474         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
2475         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
2476         (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
2477         (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime):
2478         (WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries):
2479         (WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo):
2480         (WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
2481         * UIProcess/WebResourceLoadStatisticsStore.h:
2482
2483 2018-06-29  Aditya Keerthi  <akeerthi@apple.com>
2484
2485         [macOS] Do not crash if there is an attempt to copy a file URL to the clipboard
2486         https://bugs.webkit.org/show_bug.cgi?id=187183
2487
2488         Reviewed by Wenson Hsieh.
2489
2490         r210683 introduced logic to prevent file URLs from being copied to the clipboard
2491         in unexpected cases. The current logic always crashes the WebProcess if
2492         webProcessProxy->checkURLReceivedFromWebProcess returns false. Instead of
2493         crashing, we can fail silently and not copy anything to the clipboard.
2494
2495         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2496         (WebKit::WebPasteboardProxy::setPasteboardPathnamesForType): Removed call to markCurrentlyDispatchedMessageAsInvalid() which was causing the process to crash.
2497
2498 2018-06-29  Chris Dumez  <cdumez@apple.com>
2499
2500         Regression(r233359): Caused ITP tests to be flaky
2501         https://bugs.webkit.org/show_bug.cgi?id=187189
2502
2503         Reviewed by Youenn Fablet.
2504
2505         r233359 started using m_resolvedConfiguration.resourceLoadStatisticsDirectory instead of
2506         m_configuration.resourceLoadStatisticsDirectory for the ITP path. This is consistent
2507         with what we do for other database paths so that things like '~' in paths get resolved.
2508
2509         This introduced flakiness because the resourceLoadStatisticsDirectory was never getting
2510         resolved and m_resolvedConfiguration.resourceLoadStatisticsDirectory was not set.
2511         Update the WebsiteDataStore so that m_resolvedConfiguration.resourceLoadStatisticsDirectory
2512         properly gets set to the resolved version of m_configuration.resourceLoadStatisticsDirectory.
2513
2514         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2515         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
2516         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
2517
2518 2018-06-29  John Wilander  <wilander@apple.com>
2519
2520         Resource Load Statistics: Don't create a WebResourceLoadStatisticsStore for ephemeral sessions
2521         https://bugs.webkit.org/show_bug.cgi?id=187154
2522         <rdar://problem/41487250>
2523
2524         Reviewed by Brent Fulgham and Chris Dumez.
2525
2526         Most of the changes in this patch remove the boolean parameter for tracking
2527         ephemeral sessions and the IsReadOnly enum.
2528
2529         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2530         (-[WKWebsiteDataStore _setResourceLoadStatisticsTestingCallback:]):
2531             Now returns early for ephemeral sessions.
2532         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
2533         (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
2534         (WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk):
2535         (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
2536         * UIProcess/ResourceLoadStatisticsPersistentStorage.h:
2537         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2538         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2539         * UIProcess/WebResourceLoadStatisticsStore.h:
2540         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2541         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
2542             Now returns early for ephemeral sessions.
2543         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
2544
2545 2018-06-29  Chris Dumez  <cdumez@apple.com>
2546
2547         Stop using lambdas for WebResourceLoadStatisticsStore to interact with its WebsiteDataStore
2548         https://bugs.webkit.org/show_bug.cgi?id=187165
2549
2550         Reviewed by Brent Fulgham.
2551
2552         Stop using lambdas for WebResourceLoadStatisticsStore to interact with its WebsiteDataStore. Instead,
2553         WebResourceLoadStatisticsStore now holds a weak pointer to its WebsiteDataStore and is able to call
2554         methods on it directly. Reducing the indirection makes the code less complex and more understandable.
2555
2556         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2557         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2558         (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
2559         (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
2560         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
2561         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToPartitionOrBlockCookiesHandler):
2562         (WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
2563         * UIProcess/WebResourceLoadStatisticsStore.h:
2564         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2565         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
2566
2567 2018-06-29  Miguel Gomez  <magomez@igalia.com>
2568
2569         [WPE] Some frames are dropped when using rAF to animate an element
2570         https://bugs.webkit.org/show_bug.cgi?id=187175
2571
2572         Always call renderNextFrame in ThreadedCompositor::requestDisplayRefreshMonitorUpdate()
2573         so we have to process any pending layer flush request.
2574
2575         Reviewed by Žan Doberšek.
2576
2577         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2578         (WebKit::ThreadedCompositor::handleDisplayRefreshMonitorUpdate):
2579
2580 2018-06-28  Chris Dumez  <cdumez@apple.com>
2581
2582         Make sure the WebResourceLoadStatisticsStore gets destroyed on the main thread
2583         https://bugs.webkit.org/show_bug.cgi?id=187143
2584
2585         Reviewed by Youenn Fablet.
2586
2587         Have WebResourceLoadStatisticsStore subclass ThreadSafeRefCounted<WebResourceLoadStatisticsStore, WTF::DestructionThread::Main>
2588         instead of IPC::Connection::WorkQueueMessageReceiver. This makes sure that the WebResourceLoadStatisticsStore
2589         objects get destroyed on the main thread, even if the last ref was held by a background thread.
2590
2591         Also, methods called by IPC are now called on the main thread instead of the background queue. I think it is clearer for all
2592         of WebResourceLoadStatisticsStore usage to be on the main thread. Expensive work is still done on the background queue, inside
2593         the persistent / memory store classes.
2594
2595         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2596         (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
2597         (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
2598         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
2599         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
2600         (WebKit::WebResourceLoadStatisticsStore::processWillOpenConnection):
2601         (WebKit::WebResourceLoadStatisticsStore::processDidCloseConnection):
2602         * UIProcess/WebResourceLoadStatisticsStore.h:
2603
2604 2018-06-28  Jiewen Tan  <jiewen_tan@apple.com>
2605
2606         Add nullptr check for xpc_connection_t in AuthenticationManager::initializeConnection
2607         https://bugs.webkit.org/show_bug.cgi?id=187110
2608         <rdar://problem/41536815>
2609
2610         Reviewed by Brent Fulgham.
2611
2612         In some rare cases as shown by crash tracers that the passed xpc_connection_t object could be nullptr,
2613         and xpc_connection_set_event_handler won't do the nullptr check on its parameters. Therefore, we should
2614         do it by ourselves.
2615
2616         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
2617         (WebKit::AuthenticationManager::initializeConnection):
2618         * UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm:
2619         (WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc const):
2620
2621 2018-06-28  Wenson Hsieh  <wenson_hsieh@apple.com>
2622
2623         [iOS] DataTransfer.getData always returns the empty string when dropping text
2624         https://bugs.webkit.org/show_bug.cgi?id=187130
2625         <rdar://problem/41014117>
2626
2627         Reviewed by Ryosuke Niwa.
2628
2629         Add plumbing to grab information for each item in the pasteboard. See WebCore ChangeLog for more detail.
2630
2631         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2632         (WebKit::WebPasteboardProxy::allPasteboardItemInfo):
2633         * UIProcess/WebPasteboardProxy.h:
2634         * UIProcess/WebPasteboardProxy.messages.in:
2635         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2636         (WebKit::WebPlatformStrategies::allPasteboardItemInfo):
2637         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2638
2639 2018-06-28  Youenn Fablet  <youenn@apple.com>
2640
2641         Early return when handling fetch event in case service worker origin does not match origin of a subresource load
2642         https://bugs.webkit.org/show_bug.cgi?id=187153
2643         <rdar://problem/41329832>
2644
2645         Reviewed by Chris Dumez.
2646
2647         Stop crashing the service worker process in case a subresource load origin is not matching a service worker origin.
2648         Instead, just return early so that the load will be handled by the network process.
2649
2650         Keep crashing in case a navigation load is not matching its service worker origin.
2651         Add more logging to help with the debugging.
2652
2653         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2654         (WebKit::logValidFetchError):
2655         (WebKit::isValidFetch):
2656         (WebKit::WebSWContextManagerConnection::startFetch):
2657
2658 2018-06-28  Jeremy Jones  <jeremyj@apple.com>
2659
2660         Fullscreen exits when placeholder is removed then added during a single runloop.
2661         https://bugs.webkit.org/show_bug.cgi?id=187079
2662
2663         Reviewed by Jer Noble.
2664
2665         Instead of closing fullscreen as soon as the placeholder is removed from the view hierarchy,
2666         give the placeholder until the next runloop to be re-added to the view hierarchy.
2667
2668         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
2669         (-[WKFullScreenWindowController placeholderWillMoveToSuperview:]):
2670
2671 2018-06-28  Youenn Fablet  <youenn@apple.com>
2672
2673         Handle the case of registerMDNSNameCallback called several times
2674         https://bugs.webkit.org/show_bug.cgi?id=187150
2675         <rdar://problem/41329832>
2676
2677         Reviewed by Eric Carlson.
2678
2679         This is a speculative fix on the basis that registerMDNSNameCallback may be called several times.
2680         In that case, we would have freed the context after the first call and would reuse it for the second call.
2681
2682         Instead, keep a map of pending requests and pass to registerMDNSNameCallback an identifier to that map.
2683         If the map has no value for that identifier, return early.
2684
2685         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
2686         (WebKit::NetworkMDNSRegister::~NetworkMDNSRegister):
2687         (WebKit::pendingRegistrationRequests):
2688         (WebKit::registerMDNSNameCallback):
2689         (WebKit::NetworkMDNSRegister::clearPendingRequests):
2690         (WebKit::NetworkMDNSRegister::registerMDNSName):
2691         * NetworkProcess/webrtc/NetworkMDNSRegister.h:
2692         (): Deleted.
2693
2694 2018-06-28  Chris Dumez  <cdumez@apple.com>
2695
2696         Unreviewed attempt to fix Win Cairo build after r233310.
2697
2698         * UIProcess/WebResourceLoadStatisticsStore.h:
2699
2700 2018-06-28  Chris Dumez  <cdumez@apple.com>
2701
2702         Unreviewed attempt to fix Win Cairo build after r233310.
2703
2704         * UIProcess/WebResourceLoadStatisticsStore.h:
2705
2706 2018-06-28  Chris Dumez  <cdumez@apple.com>
2707
2708         Split memory store logic out of WebResourceLoadStatisticsStore to clarify threading model
2709         https://bugs.webkit.org/show_bug.cgi?id=187055
2710         <rdar://problem/41584026>
2711
2712         Unreviewed, temporarily disable main thread assertion added to flushAndDestroyPersistentStore()
2713         in r233310, until Bug 187143 is fixed.
2714
2715         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2716         (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
2717
2718 2018-06-28  Youenn Fablet  <youenn@apple.com>
2719
2720         Add sandbox to microdone plugin
2721         https://bugs.webkit.org/show_bug.cgi?id=187149
2722         rdar://problem/41538057
2723
2724         Reviewed by Brent Fulgham.
2725
2726         * Resources/PlugInSandboxProfiles/cn.microdone.cmb.safari: Added.
2727         * WebKit.xcodeproj/project.pbxproj:
2728
2729 2018-06-28  Brian Burg  <bburg@apple.com>
2730
2731         Web Inspector: REGRESSION(r223770): "Open Link" context menu action on a linkified URL doesn't work
2732         https://bugs.webkit.org/show_bug.cgi?id=187146
2733         <rdar://problem/41369591>
2734
2735         Reviewed by Joseph Pecoraro.
2736
2737         When Web Inspector's page receives a navigation request, it's supposed to redirect any
2738         non-Inspector navigations to be loaded in the inspected page. When I refactored to use
2739         modern a policy delegate, the one line that redirects the loads was left out.
2740
2741         No new tests, because inspector tests can't navigate the inspector or inspected pages.
2742
2743         * UIProcess/mac/WKInspectorViewController.mm:
2744         (-[WKInspectorViewController webView:decidePolicyForNavigationAction:decisionHandler:]):
2745
2746 2018-06-28  Jeremy Jones  <jeremyj@apple.com>
2747
2748         Crash when _topConstraint is null in element fullscreen.
2749         https://bugs.webkit.org/show_bug.cgi?id=187075
2750
2751         Reviewed by Eric Carlson.
2752
2753         NSArray can't contain a null pointer, so check for null before creating an array from a pointer.
2754         Use the recommended +deactivateConstraints: instead of -removeConstraints:.
2755
2756         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
2757         (-[WKFullScreenViewController showUI]):
2758         (-[WKFullScreenViewController hideUI]):
2759
2760 2018-06-28  Chris Dumez  <cdumez@apple.com>
2761
2762         Split memory store logic out of WebResourceLoadStatisticsStore to clarify threading model
2763         https://bugs.webkit.org/show_bug.cgi?id=187055
2764         <rdar://problem/41584026>
2765
2766         Reviewed by Brent Fulgham.
2767
2768         Split memory store logic out of WebResourceLoadStatisticsStore and into a ResourceLoadStatisticsMemoryStore class
2769         to clarify the threading model. Previously, some of the methods of the WebResourceLoadStatisticsStore had to be
2770         called on the main thread and some of them on the background queue, which was confusing and error prone. Now,
2771         all WebResourceLoadStatisticsStore methods (except for IPC ones which will be addressed in a follow-up) are called
2772         on the main thread. The ResourceLoadStatisticsMemoryStore objects is constructed / used and destroyed on the
2773         background queue, similarly to the ResourceLoadStatisticsPersistentStore. The WebResourceLoadStatisticsStore
2774         objects merely proxies calls from WebKit to those persistent / memory stores and takes care of hopping back and
2775         forth between the background thread and the work queue.
2776
2777         While spliting code code, I found several instances where we were calling completion handlers on the wrong thread.
2778         I fixed those in this patch now that the model is clearer.
2779
2780         We can likely clean up (organize the code a bit better) in a follow-up). This patch takes care of splitting the
2781         code as it was. Code that was called on the background queue was moved to ResourceLoadStatisticsMemoryStore class
2782         and code that was called on the main thread stays in WebResourceLoadStatisticsStore.
2783
2784         * CMakeLists.txt:
2785         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm: Renamed from Source/WebKit/UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm.
2786         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
2787         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp: Added.
2788         (WebKit::appendWithDelimiter):
2789         (WebKit::OperatingDate::fromWallTime):
2790         (WebKit::OperatingDate::today):
2791         (WebKit::OperatingDate::secondsSinceEpoch const):
2792         (WebKit::OperatingDate::operator== const):
2793         (WebKit::OperatingDate::operator< const):
2794         (WebKit::OperatingDate::operator<= const):
2795         (WebKit::OperatingDate::OperatingDate):
2796         (WebKit::mergeOperatingDates):
2797         (WebKit::pruneResources):
2798         (WebKit::computeImportance):
2799         (WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
2800         (WebKit::ResourceLoadStatisticsMemoryStore::~ResourceLoadStatisticsMemoryStore):
2801         (WebKit::ResourceLoadStatisticsMemoryStore::setPersistentStorage):
2802         (WebKit::ResourceLoadStatisticsMemoryStore::calculateAndSubmitTelemetry):
2803         (WebKit::ResourceLoadStatisticsMemoryStore::setNotifyPagesWhenDataRecordsWereScanned):
2804         (WebKit::ResourceLoadStatisticsMemoryStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
2805         (WebKit::ResourceLoadStatisticsMemoryStore::setShouldSubmitTelemetry):
2806         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
2807         (WebKit::ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain):
2808         (WebKit::ResourceLoadStatisticsMemoryStore::markAsPrevalentIfHasRedirectedToPrevalent):
2809         (WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):
2810         (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
2811         (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
2812         (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener):
2813         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
2814         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
2815         (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData):
2816         (WebKit::ResourceLoadStatisticsMemoryStore::setResourceLoadStatisticsDebugMode):
2817         (WebKit::ResourceLoadStatisticsMemoryStore::scheduleStatisticsProcessingRequestIfNecessary):
2818         (WebKit::ResourceLoadStatisticsMemoryStore::cancelPendingStatisticsProcessingRequest):
2819         (WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
2820         (WebKit::ResourceLoadStatisticsMemoryStore::logUserInteraction):
2821         (WebKit::ResourceLoadStatisticsMemoryStore::logNonRecentUserInteraction):
2822         (WebKit::ResourceLoadStatisticsMemoryStore::clearUserInteraction):
2823         (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUserInteraction):
2824         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResource):
2825         (WebKit::ResourceLoadStatisticsMemoryStore::isPrevalentResource const):
2826         (WebKit::ResourceLoadStatisticsMemoryStore::isVeryPrevalentResource const):
2827         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubFrameUnder):
2828         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsRedirectingTo):
2829         (WebKit::ResourceLoadStatisticsMemoryStore::clearPrevalentResource):
2830         (WebKit::ResourceLoadStatisticsMemoryStore::setGrandfathered):
2831         (WebKit::ResourceLoadStatisticsMemoryStore::isGrandfathered const):
2832         (WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameOrigin):
2833         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameOrigin):
2834         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectTo):
2835         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectFrom):
2836         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectTo):
2837         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectFrom):
2838         (WebKit::ResourceLoadStatisticsMemoryStore::setTimeToLiveUserInteraction):
2839         (WebKit::ResourceLoadStatisticsMemoryStore::setTimeToLiveCookiePartitionFree):
2840         (WebKit::ResourceLoadStatisticsMemoryStore::setMinimumTimeBetweenDataRecordsRemoval):
2841         (WebKit::ResourceLoadStatisticsMemoryStore::setGrandfatheringTime):
2842         (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveDataRecords const):
2843         (WebKit::ResourceLoadStatisticsMemoryStore::setDataRecordsBeingRemoved):
2844         (WebKit::ResourceLoadStatisticsMemoryStore::ensureResourceStatisticsForPrimaryDomain):
2845         (WebKit::ResourceLoadStatisticsMemoryStore::createEncoderFromData const):
2846         (WebKit::ResourceLoadStatisticsMemoryStore::mergeWithDataFromDecoder):
2847         (WebKit::ResourceLoadStatisticsMemoryStore::clear):
2848         (WebKit::ResourceLoadStatisticsMemoryStore::wasAccessedAsFirstPartyDueToUserInteraction):
2849         (WebKit::ResourceLoadStatisticsMemoryStore::mergeStatistics):
2850         (WebKit::ResourceLoadStatisticsMemoryStore::shouldPartitionCookies):
2851         (WebKit::ResourceLoadStatisticsMemoryStore::shouldBlockCookies):
2852         (WebKit::ResourceLoadStatisticsMemoryStore::hasUserGrantedStorageAccessThroughPrompt):
2853         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookiePartitioning):
2854         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookiePartitioningForDomains):
2855         (WebKit::ResourceLoadStatisticsMemoryStore::clearPartitioningStateForDomains):
2856         (WebKit::ResourceLoadStatisticsMemoryStore::resetCookiePartitioningState):
2857         (WebKit::ResourceLoadStatisticsMemoryStore::processStatistics const):
2858         (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUnexpiredRecentUserInteraction const):
2859         (WebKit::ResourceLoadStatisticsMemoryStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
2860         (WebKit::ResourceLoadStatisticsMemoryStore::includeTodayAsOperatingDateIfNecessary):
2861         (WebKit::ResourceLoadStatisticsMemoryStore::hasStatisticsExpired const):
2862         (WebKit::ResourceLoadStatisticsMemoryStore::setMaxStatisticsEntries):
2863         (WebKit::ResourceLoadStatisticsMemoryStore::setPruneEntriesDownTo):
2864         (WebKit::ResourceLoadStatisticsMemoryStore::pruneStatisticsIfNeeded):
2865         (WebKit::ResourceLoadStatisticsMemoryStore::resetParametersToDefaultValues):
2866         (WebKit::ResourceLoadStatisticsMemoryStore::logTestingEvent):
2867         (WebKit::ResourceLoadStatisticsMemoryStore::setLastSeen):
2868         (WebKit::ResourceLoadStatisticsMemoryStore::setVeryPrevalentResource):
2869         (WebKit::ResourceLoadStatisticsMemoryStore::removeAllStorageAccess):
2870         * UIProcess/ResourceLoadStatisticsMemoryStore.h: Added.
2871         (WebKit::ResourceLoadStatisticsMemoryStore::isEmpty const):
2872         (WebKit::ResourceLoadStatisticsMemoryStore::setStorageAccessPromptsEnabled):
2873         (WebKit::ResourceLoadStatisticsMemoryStore::setDebugLogggingEnabled):
2874         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
2875         (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
2876         (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk):
2877         (WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
2878         (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
2879         * UIProcess/ResourceLoadStatisticsPersistentStorage.h:
2880         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2881         (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
2882         (WebKit::WebResourceLoadStatisticsStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
2883         (WebKit::WebResourceLoadStatisticsStore::setShouldSubmitTelemetry):
2884         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2885         (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
2886         (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
2887         (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
2888         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
2889         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
2890         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
2891         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
2892         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
2893         (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
2894         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
2895         (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
2896         (WebKit::WebResourceLoadStatisticsStore::submitTelemetry):
2897         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
2898         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
2899         (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
2900         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
2901         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
2902         (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
2903         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
2904         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
2905         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
2906         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
2907         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
2908         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
2909         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
2910         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
2911         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
2912         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
2913         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
2914         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
2915         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
2916         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
2917         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
2918         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
2919         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
2920         (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
2921         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningStateReset):
2922         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory):
2923         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
2924         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
2925         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
2926         (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
2927         (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime):
2928         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToPartitionOrBlockCookiesHandler):
2929         (WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
2930         (WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries):
2931         (WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo):
2932         (WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
2933         (WebKit::WebResourceLoadStatisticsStore::logTestingEvent):
2934         * UIProcess/WebResourceLoadStatisticsStore.h:
2935         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
2936         (WebKit::sortedPrevalentResourceTelemetry):
2937         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
2938         * UIProcess/WebResourceLoadStatisticsTelemetry.h:
2939         * WebKit.xcodeproj/project.pbxproj:
2940
2941 2018-06-28  Michael Catanzaro  <mcatanzaro@igalia.com>
2942
2943         [GTK] ASSERTION FAILED: !HashTranslator::equal(KeyTraits::emptyValue(), key) when dragging file into webview
2944         https://bugs.webkit.org/show_bug.cgi?id=175602
2945
2946         Reviewed by Carlos Garcia Campos.
2947
2948         We check using the GdkDragContext to ensure the DroppingContext is still alive (present in
2949         m_droppingContexts), but access it via the pointer to the DroppingContext that could be
2950         dangling. This happens on every drag. I can't actually reproduce the original assertion
2951         since I'm currently working with an asan build, but I imagine it's probably the same issue
2952         that I'm fixing here.
2953
2954         * UIProcess/gtk/DragAndDropHandler.cpp:
2955         (WebKit::DragAndDropHandler::dragLeave):
2956
2957 2018-06-27  Timothy Hatcher  <timothy@apple.com>
2958
2959         Don't expose new semantic -apple-system color keywords on iOS.
2960         https://bugs.webkit.org/show_bug.cgi?id=187080
2961         rdar://problem/41505699
2962
2963         Reviewed by Tim Horton.
2964
2965         * DerivedSources.make: Use gnu++14, since gnu++17 is giving errors on macOS 10.12.
2966
2967 2018-06-27  Megan Gardner  <megan_gardner@apple.com>
2968
2969         Fix IBeam issues with iPad apps on Mac
2970         https://bugs.webkit.org/show_bug.cgi?id=186900
2971
2972         Reviewed by Wenson Hsieh.
2973
2974         * Shared/ios/InteractionInformationAtPosition.h:
2975         * Shared/ios/InteractionInformationAtPosition.mm:
2976         (WebKit::InteractionInformationAtPosition::encode const):
2977         (WebKit::InteractionInformationAtPosition::decode):
2978
2979         Add functionality to determine what a caret rect should be, but as it is
2980         expensive, it should only be done for this platform.
2981         
2982         * Shared/ios/InteractionInformationRequest.cpp:
2983         (WebKit::InteractionInformationRequest::isApproximateForRequest):
2984         * Shared/ios/InteractionInformationRequest.h:
2985
2986         As there is no way to premptively request information on hover, we need to use 
2987         the last cached information, but only if it is close to the point we are about
2988         to request information for. So having a way to determine if a point is very close
2989         to a previous point is a good idea.
2990
2991         * UIProcess/ios/WKContentViewInteraction.mm:
2992         (-[WKContentView _currentPositionInformationIsApproximateForRequest:]):
2993         (-[WKContentView closestPositionToPoint:]):
2994
2995         UIKit is using this function to determine if we should show an Ibeam or not.
2996         So we need to implement it, at least for this platform. 
2997
2998         * WebProcess/WebPage/ios/WebPageIOS.mm:
2999         (WebKit::WebPage::getPositionInformation):
3000
3001         Pass up the calculated caret rect, but only for iPad apps on Mac.
3002
3003 2018-06-27  Yusuke Suzuki  <utatane.tea@gmail.com>
3004
3005         [GTK][WPE] Use LazyNeverDestroyed<XErrorTrapper> to remove static initializers
3006         https://bugs.webkit.org/show_bug.cgi?id=187089
3007
3008         Reviewed by Michael Catanzaro.
3009
3010         Use LazyNeverDestroyed<XErrorTrapper> instead of global std::unique_ptr<XErrorTrapper>.
3011         Since this variable's exit time destructor is not important in this code, using
3012         LazyNeverDestroyed<XErrorTrapper> is fine. This removes the last static initializer
3013         of libwebkit2gtk.so.
3014
3015         * PluginProcess/unix/PluginProcessMainUnix.cpp:
3016
3017 2018-06-27  Youenn Fablet  <youenn@apple.com>
3018
3019         Add a sandbox profile for some additional bank plugins
3020         https://bugs.webkit.org/show_bug.cgi?id=187105
3021
3022         Reviewed by Brent Fulgham.
3023
3024         * Resources/PlugInSandboxProfiles/cfca.com.npCryptoKit.CGB.MAC.sb: Added.
3025         * Resources/PlugInSandboxProfiles/cfca.com.npP11CertEnroll.MAC.CGB.sb: Added.
3026         * Resources/PlugInSandboxProfiles/com.apple.BocomSubmitCtrl.sb: Added.
3027         * Resources/PlugInSandboxProfiles/com.apple.NPSafeInput.sb: Added.
3028         * Resources/PlugInSandboxProfiles/com.apple.NPSafeSubmit.sb: Added.
3029         * Resources/PlugInSandboxProfiles/com.cfca.npSecEditCtl.MAC.BOC.plugin.sb: Added.
3030         * Resources/PlugInSandboxProfiles/com.cmbchina.CMBSecurity.sb: Added.
3031         * Resources/PlugInSandboxProfiles/com.ftsafe.NPAPI-Core-Safe-SoftKeybaord.plugin.rfc1034identifier.sb: Added.
3032         * WebKit.xcodeproj/project.pbxproj:
3033
3034 2018-06-27  Youenn Fablet  <youenn@apple.com>
3035
3036         NetworkLoadChecker should not need to hard ref NetworkConnectionToWebProcess
3037         https://bugs.webkit.org/show_bug.cgi?id=186551
3038
3039         Reviewed by Daniel Bates.
3040
3041         Removed the need for NetworkLoadChecker to reference a NetworkConnectionToWebProcess.
3042         Instead a CSP client is given to NetworkLoadChecker when needed.
3043
3044         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3045         (WebKit::NetworkConnectionToWebProcess::loadPing):
3046         * NetworkProcess/NetworkLoadChecker.cpp:
3047         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
3048         (WebKit::NetworkLoadChecker::check):
3049         (WebKit::NetworkLoadChecker::checkRedirection):
3050         (WebKit::NetworkLoadChecker::checkRequest):
3051         (WebKit::NetworkLoadChecker::contentSecurityPolicy):
3052         (WebKit::NetworkLoadChecker::addConsoleMessage): Deleted.
3053         (WebKit::NetworkLoadChecker::sendCSPViolationReport): Deleted.
3054         (WebKit::NetworkLoadChecker::enqueueSecurityPolicyViolationEvent): Deleted.
3055         * NetworkProcess/NetworkLoadChecker.h:
3056         * NetworkProcess/NetworkResourceLoader.cpp:
3057         (WebKit::NetworkResourceLoader::start):
3058         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
3059         * NetworkProcess/PingLoad.cpp:
3060         (WebKit::PingLoad::PingLoad):
3061         (WebKit::PingLoad::willPerformHTTPRedirection):
3062         * NetworkProcess/PingLoad.h:
3063
3064 2018-06-27  Stephan Szabo  <stephan.szabo@sony.com>
3065
3066         [Wincairo] Add support for context menus to non-legacy minibrowser
3067         https://bugs.webkit.org/show_bug.cgi?id=186815.
3068
3069         Reviewed by Ryosuke Niwa.
3070
3071         * UIProcess/WebPageProxy.h:
3072         * UIProcess/win/PageClientImpl.cpp:
3073         (WebKit::PageClientImpl::viewWidget):
3074         * UIProcess/win/PageClientImpl.h:
3075         * UIProcess/win/WebContextMenuProxyWin.cpp:
3076         (WebKit::WebContextMenuProxyWin::show):
3077         (WebKit::createMenu):
3078         (WebKit::createMenuItem):
3079         (WebKit::populate):
3080         (WebKit::WebContextMenuProxyWin::showContextMenuWithItems):
3081         (WebKit::WebContextMenuProxyWin::WebContextMenuProxyWin):
3082         (WebKit::WebContextMenuProxyWin::~WebContextMenuProxyWin):
3083         * UIProcess/win/WebContextMenuProxyWin.h:
3084         * UIProcess/win/WebPageProxyWin.cpp:
3085         (WebKit::WebPageProxy::viewWidget):
3086         * UIProcess/win/WebView.cpp:
3087         (WebKit::WebView::wndProc):
3088         (WebKit::WebView::onMenuCommand):
3089         * UIProcess/win/WebView.h:
3090
3091 2018-06-27  Youenn Fablet  <youenn@apple.com>
3092
3093         Disable content blockers in NetworkLoadChecker except for ping loads
3094         https://bugs.webkit.org/show_bug.cgi?id=187083
3095         <rdar://problem/41440083>
3096
3097         Reviewed by Chris Dumez.
3098
3099         * NetworkProcess/NetworkLoadChecker.cpp:
3100         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
3101         * NetworkProcess/NetworkLoadChecker.h:
3102         (WebKit::NetworkLoadChecker::enableContentExtensionsCheck):
3103         * NetworkProcess/PingLoad.cpp:
3104
3105 2018-06-27  Simon Fraser  <simon.fraser@apple.com>
3106
3107         https://hackernoon.com/ uses lots of layer backing store
3108         https://bugs.webkit.org/show_bug.cgi?id=186909
3109         rdar://problem/40257540
3110
3111         Reviewed by Tim Horton.
3112         
3113         PlatformCALayerRemote was actually holding onto backing stores for layers with
3114         backing store detached, which could increase memory use. When told that backing stores
3115         are not attached, explicitly throw away the backing, and re-create it (via setNeedsDisplay)
3116         when attached. This is now similar to what PlatformLayerCACocoa does.
3117
3118         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
3119         (WebKit::PlatformCALayerRemote::setNeedsDisplayInRect):
3120         (WebKit::PlatformCALayerRemote::setNeedsDisplay):
3121         (WebKit::PlatformCALayerRemote::hasContents const):
3122         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
3123
3124 2018-06-27  Jonathan Bedard  <jbedard@apple.com>
3125
3126         Enable WebKit iOS 12 build
3127         https://bugs.webkit.org/show_bug.cgi?id=187024
3128         <rdar://problem/39759057>
3129
3130         Reviewed by David Kilzer.
3131
3132         * Platform/spi/ios/PDFKitSPI.h: Added PDFKit SPI.
3133         * Platform/spi/ios/UIKitSPI.h: Add new UIKit SPI and UICompositingMode enumeration.
3134         * UIProcess/ios/WKPDFView.mm: Use PDFKitSPI header.
3135         * UIProcess/ios/WKSystemPreviewView.mm: Use CoreGraphicsSPI.h.
3136         * UIProcess/ios/fullscreen/WKFullscreenStackView.mm: Use QuartzCoreSPI.h.
3137
3138 2018-06-27  Timothy Horton  <timothy_horton@apple.com>
3139
3140         CSS Animation Triggers is not an experimental feature, should be globally off by default
3141
3142         Reviewed by Dean Jackson.
3143
3144         * Shared/WebPreferences.yaml:
3145
3146 2018-06-27  Timothy Horton  <timothy_horton@apple.com>
3147
3148         Promote the Secure Context API feature from experimental-yet-on-by-default to always-on
3149
3150         Reviewed by Dan Bates.
3151
3152         * Shared/WebPreferences.yaml:
3153         Secure Context API is on by default, it's not experimental anymore.
3154
3155 2018-06-27  Timothy Horton  <timothy_horton@apple.com>
3156
3157         Make Link Preload an on-by-default feature
3158         https://bugs.webkit.org/show_bug.cgi?id=187104
3159
3160         Reviewed by Ryosuke Niwa.
3161
3162         * Shared/WebPreferences.yaml:
3163         This should be on, not experimental. It already shipped on in the past.
3164
3165 2018-06-27  Chris Dumez  <cdumez@apple.com>
3166
3167         Regression(r233208): Completion handler does not get called on GTK port
3168         https://bugs.webkit.org/show_bug.cgi?id=187099
3169
3170         Reviewed by Antti Koivisto.
3171
3172         Make sure UpdatePrevalentDomainsToPartitionOrBlockCookiesHandler's completion handler
3173         gets called on non-COCOA ports.
3174
3175         * UIProcess/WebResourceLoadStatisticsStore.h:
3176
3177 2018-06-27  Tim Horton  <timothy_horton@apple.com>
3178
3179         When trying to print a very long email on iOS, the print preview is blank
3180         https://bugs.webkit.org/show_bug.cgi?id=187077
3181         <rdar://problem/41107013>
3182
3183         Reviewed by Timothy Hatcher.
3184
3185         * UIProcess/ios/WebPageProxyIOS.mm:
3186         (WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF):
3187         ChildProcessProxy::sendSync has a (surprising) default timeout of 1 second,
3188         (as opposed to Connection::sendSync's default timeout of ∞ seconds).
3189         The printing path already waits ∞ seconds for the final PDF, but currently
3190         uses the default 1 second timeout for page count computation. If page
3191         count computation takes more than 1 second, the preview will be blank.
3192         Since the print preview is generated asynchronously, we really want
3193         to wait until it's done, and not give up after 1 second.
3194
3195 2018-06-26  Wenson Hsieh  <wenson_hsieh@apple.com>
3196
3197         [iPad apps on macOS] Unable to interact with video elements that have started playing
3198         https://bugs.webkit.org/show_bug.cgi?id=187073
3199         <rdar://problem/40591107>
3200
3201         Reviewed by Tim Horton.
3202
3203         On iOS, we currently force remote hosting contexts to be non-interactive by passing in `kCAContextIgnoresHitTest`
3204         when creating the CAContext. However, this flag is not respected by CoreAnimation when running iOS apps on macOS.
3205         This means all HID events dispatched over a video that has been played (which causes WebKit to insert a
3206         CALayerHost-backed WKRemoteView in the view hierarchy) will be routed to the context ID of the video's CAContext
3207         rather than the context ID of the key window containing the WKWebView.
3208
3209         This subsequently causes all gesture recognizers (hover, touch, tap, long press) to fail recognition when
3210         running iOS apps on macOS. To address this, we set a flag on WKRemoteView's CALayerHost to prevent hit-testing
3211         to the remote layer. This allows us to avoid routing HID events to the wrong context, and instead target the
3212         main UIWindow.
3213
3214         Manually verified that click, touch, and mouseenter/mouseleave events are dispatched when interacting over a
3215         video element.
3216
3217         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
3218         (-[WKRemoteView initWithFrame:contextID:]):
3219
3220 2018-06-26  Commit Queue  <commit-queue@webkit.org>
3221
3222         Unreviewed, rolling out r233232.
3223         https://bugs.webkit.org/show_bug.cgi?id=187081
3224
3225         "This is breaking launching some plugins" (Requested by youenn
3226         on #webkit).
3227
3228         Reverted changeset:
3229
3230         "Remove quarantine for Webex plugin"
3231         https://bugs.webkit.org/show_bug.cgi?id=187050
3232         https://trac.webkit.org/changeset/233232
3233
3234 2018-06-26  Timothy Horton  <timothy_horton@apple.com>
3235
3236         Rearrange some WebPreferences; move two experimental prefs into the experimental section
3237
3238         * Shared/WebPreferences.yaml:
3239
3240 2018-06-26  Chris Dumez  <cdumez@apple.com>
3241
3242         Deal better with the network process crashing on startup
3243         https://bugs.webkit.org/show_bug.cgi?id=187065
3244         <rdar://problem/41451622>
3245
3246         Reviewed by Geoffrey Garen.
3247
3248         When a network process crashes on startup, we would not attempt to relaunch it. If there were web
3249         processes waiting for a connection to this network process, we would send them an invalid connection
3250         identifier which would cause them to forcefully crash.
3251
3252         Instead, we now apply the same policy whether a network process crashes on startup or later:
3253         - We attempt to relaunch the network process
3254         - If there were pending connections from WebContent processes, we ask the new Network process instead.
3255
3256         As a result, WebContent processes no longer crash in this case. Instead, they wait for a valid
3257         connection to the network process.
3258
3259         * UIProcess/API/Cocoa/WKProcessPool.mm:
3260         (-[WKProcessPool _makeNextNetworkProcessLaunchFailForTesting]):
3261         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3262         * UIProcess/Network/NetworkProcessProxy.cpp:
3263         (WebKit::NetworkProcessProxy::getLaunchOptions):
3264         (WebKit::NetworkProcessProxy::didFinishLaunching):
3265         * UIProcess/Network/NetworkProcessProxy.h:
3266         * UIProcess/WebProcessPool.cpp:
3267         (WebKit::WebProcessPool::networkProcessCrashed):
3268         * UIProcess/WebProcessPool.h:
3269
3270 2018-06-26  Daniel Bates  <dabates@apple.com>
3271
3272         REGRESSION (r231479): Unable to buy Odeon cinema tickets in STP (bogus 'X-Frame-Options' to 'SAMEORIGIN')
3273         https://bugs.webkit.org/show_bug.cgi?id=186090
3274         <rdar://problem/40692595>
3275
3276         Reviewed by Andy Estes.
3277
3278         Fixes an issue where a page P delivered with "X-Frame-Options: SAMEORIGIN" loaded in a sub-
3279         frame would be blocked if we were redirected to it in response to the cross-origin POST
3280         request regardless of whether P is same-origin with its parent document.
3281
3282         * NetworkProcess/NetworkResourceLoader.cpp:
3283         (WebKit::NetworkResourceLoader::shouldInterruptLoadForXFrameOptions): Compare the origin
3284         of the top frame's document as opposed to the source origin. The latter represents the
3285         origin of the document that initiated the navigation, which can be cross-origin, and
3286         should not be considered when applying "X-Frame-Options: SAMEORIGIN". This check exists
3287         as a performance optimization to avoid traversing over all frame ancestors only to find
3288         out that the innermost frame (the one that made this request) is cross-origin with the
3289         top-most frame.
3290         * NetworkProcess/NetworkResourceLoader.h:
3291         * WebProcess/Network/WebLoaderStrategy.cpp:
3292         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): Exclude the origin of the
3293         frame that is making the load request from the list of ancestor origins. This makes the
3294         X-Frame-Options algorithm in WebKit2 match the logic we do in FrameLoader::shouldInterruptLoadForXFrameOptions().
3295
3296 2018-06-26  Youenn Fablet  <youenn@apple.com>
3297
3298         Remove quarantine for Webex plugin
3299         https://bugs.webkit.org/show_bug.cgi?id=187050
3300         rdar://problem/41478189
3301
3302         Reviewed by Brent Fulgham.
3303
3304         Update the Plugin Info.plist to not do quarantine of downloaded files by default.
3305         Update PluginProcess implementation to reenable quarantine for all plug-ins except cisco webex plug-in.
3306
3307         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
3308         * PluginProcess/PluginProcess.h:
3309         * PluginProcess/mac/PluginProcessMac.mm:
3310         (WebKit::PluginProcess::shouldOverrideQuarantine):
3311         * Shared/ChildProcess.h:
3312         (WebKit::ChildProcess::shouldOverrideQuarantine):
3313         * Shared/mac/ChildProcessMac.mm:
3314         (WebKit::ChildProcess::initializeSandbox):
3315
3316 2018-06-26  Jeremy Jones  <jeremyj@apple.com>
3317
3318         Ensure element fullscreen animation is always visible.
3319         https://bugs.webkit.org/show_bug.cgi?id=187068
3320         rdar://problem/36187369
3321
3322         Reviewed by Eric Carlson.
3323
3324         The fullscreen animation is important for communicating to users that they are no longer in inline mode.
3325         If fullscreen animation's inline rect is not visible, animate from a point in the middle of the screen.
3326
3327         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
3328         (WebKit::safeInlineRect):
3329         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
3330         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
3331
3332 2018-06-26  Youenn Fablet  <youenn@apple.com>
3333
3334         Add a sandbox profile for com.google.o1dbrowserplugin plugin
3335         https://bugs.webkit.org/show_bug.cgi?id=187067
3336
3337         Reviewed by Brent Fulgham.
3338
3339         * Resources/PlugInSandboxProfiles/com.google.o1dbrowserplugin.sb: Added.
3340         * WebKit.xcodeproj/project.pbxproj:
3341
3342 2018-06-26  Tim Horton  <timothy_horton@apple.com>
3343
3344         Promote two more experimental features to traditional features
3345         https://bugs.webkit.org/show_bug.cgi?id=187063
3346
3347         Reviewed by Dean Jackson.
3348
3349         * Shared/WebPreferences.yaml:
3350         Promote some shipped/default-on features to non-experimental.
3351
3352 2018-06-26  Jiewen Tan  <jiewen_tan@apple.com>
3353
3354         Rollout macOS sandbox change in r232276
3355         https://bugs.webkit.org/show_bug.cgi?id=186904
3356         <rdar://problem/41350969>
3357
3358         Reviewed by Brent Fulgham.
3359
3360         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
3361
3362 2018-06-26  Aditya Keerthi  <akeerthi@apple.com>
3363
3364         Tap highlight displayed when tapping a field that is already focussed
3365         https://bugs.webkit.org/show_bug.cgi?id=187004
3366         <rdar://problem/41428008>
3367         Reviewed by Tim Horton.
3368
3369         In the case where fast-clicking is enabled, _singleTapCommited: could be invoked
3370         before the tap highlight request, causing _potentialTapInProgress to be set to NO.
3371         This results in the early return for preventing multiple tap highlights on an
3372         assisted node to be skipped. Since a tap highlight should never be shown for an
3373         input field that is already focussed, _potentialTapInProgress can be removed from
3374         the early return condition.
3375
3376         * UIProcess/ios/WKContentViewInteraction.mm:
3377         (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):
3378
3379 2018-06-26  Timothy Horton  <timothy_horton@apple.com>
3380
3381         Rearrange some WebPreferences; move two non-experimental prefs out of the experimental section
3382
3383         * Shared/WebPreferences.yaml:
3384
3385 2018-06-26  Tim Horton  <timothy_horton@apple.com>
3386
3387         Promote some experimental features to traditional features
3388         https://bugs.webkit.org/show_bug.cgi?id=187047
3389
3390         Reviewed by Simon Fraser.
3391
3392         * Shared/WebPreferences.yaml:
3393         Reindent.
3394         Promote some shipped/default-on features to non-experimental.
3395
3396 2018-06-26  Eric Carlson  <eric.carlson@apple.com>
3397
3398         [Mac] AirPlay picker uses incorrect theme in Dark mode
3399         https://bugs.webkit.org/show_bug.cgi?id=187054
3400         <rdar://problem/41291093>
3401
3402         Reviewed by Timothy Hatcher.
3403
3404         * UIProcess/WebPageProxy.cpp:
3405         (WebKit::WebPageProxy::showPlaybackTargetPicker): Pass m_defaultAppearance.
3406
3407 2018-06-26  Chris Dumez  <cdumez@apple.com>
3408
3409         Resource Load Statistics: Make WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains() wait for the network process before calling its callback
3410         https://bugs.webkit.org/show_bug.cgi?id=186903
3411         <rdar://problem/41350182>
3412
3413         Reviewed by Brady Eidson.
3414
3415         Follow-up fix after r233180 to address an API test crash. We need to keep the
3416         NetworkProcessProxy alive during the async updatePrevalentDomainsToPartitionOrBlockCookies
3417         request to make sure it completes.
3418
3419         * UIProcess/Network/NetworkProcessProxy.cpp:
3420         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToPartitionOrBlockCookies):
3421
3422 2018-06-26  Brent Fulgham  <bfulgham@apple.com>
3423
3424         Provide a way for Injected Bundles to indicate classes approved for NSSecureCoding
3425         https://bugs.webkit.org/show_bug.cgi?id=186788
3426         <rdar://problem/41094167>
3427
3428         Reviewed by Chris Dumez.
3429
3430         InjectedBundles support a mechanism to serialize data between the UIProcess and the
3431         WebContent process hosting the bundle. In some cases, we want to be able to serialize
3432         a custom data object that is not part of WebKit's native data types.
3433
3434         After switching to strict NSSecureCoding, WebKit clients attempting to serialize these
3435         custom objects trigger a failure.
3436
3437         This patch makes it possible for the InjectedBundle author to specify one (or more) data
3438         classes that are allowed to be serialized between the two processes.
3439         
3440         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3441         (WKBundleExtendClassesForParameterCoder): Added.
3442         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
3443         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
3444         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
3445         (createWKArray): Added.
3446         (-[WKWebProcessPlugInController extendClassesForParameterCoder:]): Added.
3447         * WebProcess/InjectedBundle/InjectedBundle.h:
3448         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
3449         (WebKit::InjectedBundle::extendClassesForParameterCoder): Added.
3450         (WebKit::InjectedBundle::classesForCoder): New helper function.
3451         (WebKit::InjectedBundle::setBundleParameter): Modified to use the new set of valid
3452         classes for NSSecureCoding.
3453
3454 2018-06-26  Eric Carlson  <eric.carlson@apple.com>
3455
3456         Enable mock capture devices on the iOS simulator
3457         https://bugs.webkit.org/show_bug.cgi?id=186846
3458         <rdar://problem/41289134>
3459
3460         Reviewed by Youenn Fablet.
3461
3462         * Shared/WebPreferences.yaml: Use DEFAULT_MOCK_CAPTURE_DEVICES_ENABLED.
3463         * Shared/WebPreferencesDefaultValues.h: Define DEFAULT_MOCK_CAPTURE_DEVICES_ENABLED, set to
3464         true in the iOS simulator only.
3465
3466 2018-06-26  Fujii Hironori  <Hironori.Fujii@sony.com>
3467
3468         [Win] 'deref': is not a member of 'WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains::<lambda_9d761a6dc12d95db7fa2d6f3f5aa26fa>'
3469         https://bugs.webkit.org/show_bug.cgi?id=187035
3470
3471         Unreviewed build fix.
3472
3473         MSVC can't compile the code using `this` in a generalized lambda
3474         capture in another lambda.
3475
3476         In this case, there is no need to copy `protectedThis` for the
3477         inner lambda. Move `protectedThis` of the outer lambda to the
3478         inner as well as `completionHandler`.
3479
3480         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3481         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
3482         Moved `protectedThis` from the outer lambda to the inner.
3483         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
3484         Ditto.
3485
3486 2018-06-26  Miguel Gomez  <magomez@igalia.com>
3487
3488         [GTK] Many webpages can crash the browser in WebCore::CoordinatedGraphicsLayer::transformedVisibleRect
3489         https://bugs.webkit.org/show_bug.cgi?id=179304
3490
3491         Reviewed by Michael Catanzaro.
3492
3493         Add a way to attach to the CompositingCoordinator layers that were not created by it.
3494
3495         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
3496         (WebKit::CompositingCoordinator::attachLayer):
3497         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
3498
3499 2018-06-25  Tim Horton  <timothy_horton@apple.com>
3500
3501         WKThumbnailView fallback background is blindingly bright in Dark Mode
3502         https://bugs.webkit.org/show_bug.cgi?id=187017
3503         <rdar://problem/41036209>
3504
3505         Reviewed by Simon Fraser.
3506
3507         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
3508         (-[_WKThumbnailView initWithFrame:]):
3509         (-[_WKThumbnailView wantsUpdateLayer]):
3510         (-[_WKThumbnailView updateLayer]):
3511         Use a semantic color for the WKThumbnailView background color
3512         instead of flat white.
3513
3514 2018-06-25  John Wilander  <wilander@apple.com>
3515
3516         Resource Load Statistics: Make WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains() wait for the network process before calling its callback
3517         https://bugs.webkit.org/show_bug.cgi?id=186903
3518         <rdar://problem/41350182>
3519
3520         Reviewed by Chris Dumez.
3521
3522         This patch stores the callback sent to
3523         WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains(),
3524         sets up a context ID, and sends that ID to the network process when
3525         asking it to update cookie partitioning and blocking. The network
3526         process then tells the UI process when it's done, at which point the
3527         callback is called.
3528
3529         This change is meant to address layout test flakiness.
3530
3531         * NetworkProcess/NetworkProcess.cpp:
3532         (WebKit::NetworkProcess::updatePrevalentDomainsToPartitionOrBlockCookies):
3533         * NetworkProcess/NetworkProcess.h:
3534         * NetworkProcess/NetworkProcess.messages.in:
3535         * UIProcess/Network/NetworkProcessProxy.cpp:
3536         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToPartitionOrBlockCookies):
3537         (WebKit::NetworkProcessProxy::didUpdatePartitionOrBlockCookies):
3538         * UIProcess/Network/NetworkProcessProxy.h:
3539         * UIProcess/Network/NetworkProcessProxy.messages.in:
3540         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3541         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
3542         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
3543         * UIProcess/WebResourceLoadStatisticsStore.h:
3544         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3545         (WebKit::WebsiteDataStore::updatePrevalentDomainsToPartitionOrBlockCookies):
3546         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
3547         * UIProcess/WebsiteData/WebsiteDataStore.h:
3548
3549 2018-06-25  Brent Fulgham  <bfulgham@apple.com>
3550
3551         Allow access to APTDevice in iOS WebContent process
3552         https://bugs.webkit.org/show_bug.cgi?id=187021
3553         <rdar://problem/41339769>
3554
3555         Reviewed by Youenn Fablet.
3556
3557         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3558
3559 2018-06-25  Keith Rollin  <krollin@apple.com>
3560         Unreviewed, rolling out r233087.
3561
3562         Causes 5% Mac PLT regression.
3563
3564         Reverted changeset:
3565
3566         "Recalc styles every time defaultAppearance changes."
3567         https://bugs.webkit.org/show_bug.cgi?id=186866
3568         https://trac.webkit.org/changeset/233087
3569
3570 2018-06-25  Youenn Fablet  <youenn@apple.com>
3571
3572         Add a sandbox profile to Hangout plug-in
3573         https://bugs.webkit.org/show_bug.cgi?id=187005
3574         <rdar://problem/41428391>
3575
3576         Reviewed by Brent Fulgham.
3577
3578         Add a sandbox profile so that this plug-in can be run when UIProcess is sandboxed.
3579
3580         * Resources/PlugInSandboxProfiles/com.google.googletalkbrowserplugin.sb: Added.
3581         * WebKit.xcodeproj/project.pbxproj:
3582
3583 2018-06-25  Youenn Fablet  <youenn@apple.com>
3584
3585         NetworkLoadChecker should not check CORS for 304 responses triggered by WebProcess revalidation
3586         https://bugs.webkit.org/show_bug.cgi?id=186939
3587         <rdar://problem/40941725>
3588
3589         Reviewed by Chris Dumez.
3590
3591         * NetworkProcess/NetworkLoadChecker.cpp:
3592         (WebKit::NetworkLoadChecker::validateResponse):
3593
3594 2018-06-25  Keith Rollin  <krollin@apple.com>
3595
3596         Adjust UNEXPORTED_SYMBOL_LDFLAGS for LTO
3597         https://bugs.webkit.org/show_bug.cgi?id=186949
3598         <rdar://problem/41386438>
3599
3600         Reviewed by David Kilzer.
3601
3602         When building with LTO, WebKit's
3603         'check-for-weak-vtables-and-externals' script reports weak external
3604         symbols:
3605
3606         ERROR: WebKit has a weak external symbol in it (.../OpenSource/WebKitBuild/Release/WebKit.framework/Versions/A/WebKit)
3607         ERROR: A weak external symbol is generated when a symbol is defined in multiple compilation units and is also marked as being exported from the library.
3608         ERROR: A common cause of weak external symbols is when an inline function is listed in the linker export file.
3609         ERROR: symbol __ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_13basic_istreamIcS2_EE
3610         ERROR: symbol __ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_14basic_iostreamIcS2_EE
3611         ERROR: symbol __ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE16_NS_13basic_ostreamIcS2_EE
3612         ERROR: symbol __ZTTNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
3613         ERROR: symbol __ZTVNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE
3614         ERROR: symbol __ZTVNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
3615         Command /bin/sh failed with exit code 1
3616
3617         Address these by adding those symbols to UNEXPORTED_SYMBOL_LDFLAGS in
3618         WebKit.xcconfig.
3619
3620         * Configurations/WebKit.xcconfig:
3621
3622 2018-06-25  Chris Dumez  <cdumez@apple.com>
3623
3624         Make sure API::IconLoadingClient::getLoadDecisionForIcon()'s completion handler gets called
3625         https://bugs.webkit.org/show_bug.cgi?id=187007
3626         <rdar://problem/41293989>
3627
3628         Reviewed by Brady Eidson.
3629
3630         Make sure API::IconLoadingClient::getLoadDecisionForIcon()'s completion handler gets called by
3631         switching its type to WTF::CompletionHandler instead of WTF::Function. This also has the benefit
3632         of destroying our captured objects when the completion handler gets called by the client on the
3633         main thread instead of whatever thread the ObjC block gets released on.
3634
3635         * UIProcess/API/APIIconLoadingClient.h:
3636         (API::IconLoadingClient::getLoadDecisionForIcon):
3637         * UIProcess/API/glib/WebKitIconLoadingClient.cpp:
3638         * UIProcess/API/mac/WKView.mm:
3639         (-[WKView maybeInstallIconLoadingClient]):
3640         * UIProcess/Cocoa/IconLoadingDelegate.h:
3641         * UIProcess/Cocoa/IconLoadingDelegate.mm:
3642         (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):
3643
3644 2018-06-25  Youenn Fablet  <youenn@apple.com>
3645
3646         Add API to control mock media devices
3647         https://bugs.webkit.org/show_bug.cgi?id=186958
3648
3649         Reviewed by Eric Carlson.
3650
3651         Add API to clear, set, remove and reset mock media devices.
3652         The mock media center of UIProcess and all WebProcesses are updated.
3653
3654         * CMakeLists.txt:
3655         * UIProcess/API/C/WKMockMediaDevice.cpp: Added.
3656         (typeFromString):
3657         (WKAddMockMediaDevice):
3658         (WKClearMockMediaDevices):
3659         (WKRemoveMockMediaDevice):
3660         (WKResetMockMediaDevices):
3661         * UIProcess/API/C/WKMockMediaDevice.h: Added.
3662         * UIProcess/WebProcessPool.cpp:
3663         (WebKit::WebProcessPool::addMockMediaDevice):
3664         (WebKit::WebProcessPool::clearMockMediaDevices):
3665         (WebKit::WebProcessPool::removeMockMediaDevice):
3666         (WebKit::WebProcessPool::resetMockMediaDevices):
3667         * UIProcess/WebProcessPool.h:
3668         * WebKit.xcodeproj/project.pbxproj:
3669         * WebProcess/WebProcess.cpp:
3670         (WebKit::WebProcess::addMockMediaDevice):
3671         (WebKit::WebProcess::clearMockMediaDevices):
3672         (WebKit::WebProcess::removeMockMediaDevice):
3673         (WebKit::WebProcess::resetMockMediaDevices):
3674         * WebProcess/WebProcess.h:
3675         * WebProcess/WebProcess.messages.in:
3676
3677 2018-06-25  Wenson Hsieh  <wenson_hsieh@apple.com>
3678
3679         [iPad apps on macOS] Click events are broken in WKWebView
3680         https://bugs.webkit.org/show_bug.cgi?id=186964
3681         <rdar://problem/41369145>
3682
3683         Reviewed by Tim Horton.
3684
3685         Tapping in WKWebView currently does not dispatch click events to the page. This is because the long press loupe
3686         gesture (in the text interaction assistant) has a delay of 0 when running iOS apps on macOS, but on iOS, it's
3687         0.5. The zero delay on macOS means that the loupe gesture will be recognized before the synthetic click gesture;
3688         this, in turn, causes the synthetic click gesture to be excluded by the loupe gesture. To address this, we
3689         simply allow the click and loupe gesture to recognize simultaneously.
3690
3691         Additionally, a new hover gesture was added recently to handle macOS cursor types when hovering over selectable
3692         text. This patch also allows other gestures to recognize alongside hover gestures, which matches macOS behavior.
3693
3694         We don't have the capacity to write automated tests for this yet; I manually tested text selection, editing in
3695         some text form controls, as well as clicking on links, buttons, and other elements with click event handlers.
3696
3697         * UIProcess/ios/WKContentViewInteraction.mm:
3698         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
3699
3700 2018-06-23  Brian Burg  <bburg@apple.com>
3701
3702         [Mac] Web Automation: include correct key code with synthesized NSEvents used for keystrokes
3703         https://bugs.webkit.org/show_bug.cgi?id=186937
3704
3705         Reviewed by Timothy Hatcher.
3706
3707         In some cases, a missing keyCode for an ASCII letter/number can cause synthesized
3708         NSEvents to not be converted into a key equivalent action like copy: or paste:.
3709
3710         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
3711         Drive by, always initialize keyCode.
3712
3713         (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
3714         (WebKit::keyCodeForCharKey): Compute the keyCode as defined by HLTB headers.
3715         This only needs to be computed for characters with physical keys, excluding the
3716         number pad and some traditional virtual keys that do not usually have glyphs.
3717
3718 2018-06-24  Michael Catanzaro  <mcatanzaro@igalia.com>
3719
3720         Unreviewed, fix GTK debug build after r233131
3721         https://bugs.webkit.org/show_bug.cgi?id=186899
3722         <rdar://problem/38222248>
3723
3724         This assertion was intended to be removed.
3725
3726         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
3727         (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
3728
3729 2018-06-21  Brian Burg  <bburg@apple.com>
3730
3731         Web Automation: key actions should support multiple pressed virtual keys
3732         https://bugs.webkit.org/show_bug.cgi?id=186899
3733         <rdar://problem/38222248>
3734
3735         Reviewed by Timothy Hatcher.
3736
3737         This patch changes the protocol to allow multiple virtual keys per input source state.
3738         Chords like Cmd-Shift-A and Shift-F12 must be represented this way as they are encoded
3739         in the VirtualKey enum rather than as an ASCII char.
3740
3741         * UIProcess/Automation/Automation.json:
3742         * UIProcess/Automation/SimulatedInputDispatcher.h:
3743         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
3744         (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
3745         * UIProcess/Automation/WebAutomationSession.cpp:
3746         (WebKit::WebAutomationSession::simulateKeyboardInteraction):
3747         (WebKit::WebAutomationSession::performKeyboardInteractions):
3748         (WebKit::WebAutomationSession::performInteractionSequence):
3749
3750         * UIProcess/Automation/WebAutomationSession.h:
3751         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
3752         (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
3753         * UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
3754         (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
3755         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
3756         (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
3757         Also clean up the signature of WebAutomationSession::platformSimulateKeyboardInteraction
3758         to use a variant instead of mutually exclusive optional values with different types.
3759
3760 2018-06-23  Yusuke Suzuki  <utatane.tea@gmail.com>
3761
3762         [WTF] Add user-defined literal for ASCIILiteral
3763         https://bugs.webkit.org/show_bug.cgi?id=186839
3764
3765         Reviewed by Darin Adler.
3766
3767         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
3768         (WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection):
3769         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
3770         (WebKit::NetworkCORSPreflightChecker::wasBlocked):
3771         (WebKit::NetworkCORSPreflightChecker::cannotShowURL):
3772         * NetworkProcess/NetworkDataTaskBlob.cpp:
3773         (WebKit::NetworkDataTaskBlob::suggestedFilename const):
3774         * NetworkProcess/NetworkLoadChecker.cpp:
3775         (WebKit::NetworkLoadChecker::checkRedirection):
3776         (WebKit::NetworkLoadChecker::checkRequest):
3777         * NetworkProcess/NetworkResourceLoader.cpp:
3778         (WebKit::NetworkResourceLoader::continueWillSendRequest):
3779         * NetworkProcess/PingLoad.cpp:
3780         (WebKit::PingLoad::willPerformHTTPRedirection):
3781         (WebKit::PingLoad::didReceiveChallenge):
3782         (WebKit::PingLoad::timeoutTimerFired):
3783         * NetworkProcess/PreconnectTask.cpp:
3784         (WebKit::PreconnectTask::PreconnectTask):
3785         * NetworkProcess/cache/CacheStorageEngine.cpp:
3786         (WebKit::CacheStorage::Engine::initialize):
3787         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
3788         (WebKit::CacheStorage::Cache::toRecordInformation):
3789         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3790         (WebKit::CacheStorage::cachesListFilename):
3791         (WebKit::CacheStorage::cachesOriginFilename):
3792         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
3793         (WebKit::NetworkCache::Statistics::initialize):
3794         (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
3795         (WebKit::NetworkCache::Statistics::queryWasEverRequested):
3796         (WebKit::NetworkCache::Statistics::clear):
3797         (WebKit::NetworkCache::Statistics::addHashesToDatabase):
3798         (WebKit::NetworkCache::Statistics::addStoreDecisionsToDatabase):
3799         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
3800         (WebKit::XPCServiceInitializer):
3801         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
3802         (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
3803         * Shared/Plugins/Netscape/PluginInformation.cpp:
3804         (WebKit::pluginInformationBundleIdentifierKey):
3805         (WebKit::pluginInformationBundleVersionKey):
3806         (WebKit::pluginInformationBundleShortVersionKey):
3807         (WebKit::pluginInformationPathKey):
3808         (WebKit::pluginInformationDisplayNameKey):
3809         (WebKit::pluginInformationDefaultLoadPolicyKey):
3810         (WebKit::pluginInformationUpdatePastLastBlockedVersionIsKnownAvailableKey):
3811         (WebKit::pluginInformationHasSandboxProfileKey):
3812         (WebKit::pluginInformationFrameURLKey):
3813         (WebKit::pluginInformationMIMETypeKey):
3814         (WebKit::pluginInformationPageURLKey):
3815         (WebKit::pluginInformationPluginspageAttributeURLKey):
3816         (WebKit::pluginInformationPluginURLKey):
3817         (WebKit::plugInInformationReplacementObscuredKey):
3818         * Shared/ios/WebIOSEventFactory.mm:
3819         (WebIOSEventFactory::createWebKeyboardEvent):
3820         * Shared/linux/WebMemorySamplerLinux.cpp:
3821         (WebKit::WebMemorySampler::sampleWebKit const):
3822         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
3823         (debuggableTypeString):
3824         * UIProcess/API/glib/WebKitWebContext.cpp:
3825         (webkit_web_context_set_preferred_languages):
3826         * UIProcess/Automation/WebAutomationSession.cpp:
3827         (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):
3828         (WebKit::WebAutomationSession::addSingleCookie):
3829         (WebKit::WebAutomationSession::setSessionPermissions):
3830         (WebKit::WebAutomationSession::performMouseInteraction):
3831         (WebKit::WebAutomationSession::performKeyboardInteractions):
3832         (WebKit::WebAutomationSession::performInteractionSequence):
3833         * UIProcess/Automation/WebAutomationSession.h:
3834         * UIProcess/ChildProcessProxy.cpp:
3835         (WebKit::ChildProcessProxy::getLaunchOptions):
3836         * UIProcess/Cocoa/DownloadClient.mm:
3837         (WebKit::DownloadClient::didStart):
3838         * UIProcess/Cocoa/WebViewImpl.mm:
3839         (WebKit::selectorExceptionMap):
3840         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
3841         (WebKit::WebCredentialsMessengerProxy::makeCredential):
3842         (WebKit::WebCredentialsMessengerProxy::getAssertion):
3843         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
3844         (WebKit::PluginInfoStore::pluginsDirectories):
3845         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
3846         (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
3847         * UIProcess/ServiceWorkerProcessProxy.cpp:
3848         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
3849         (WebKit::ServiceWorkerProcessProxy::didReceiveAuthenticationChallenge):
3850         * UIProcess/UserMediaProcessManager.cpp:
3851         (WebKit::UserMediaProcessManager::willCreateMediaStream):
3852         (WebKit::UserMediaProcessManager::endedCaptureSession):
3853         * UIProcess/WebBackForwardList.cpp:
3854         (WebKit::WebBackForwardList::goToItem):
3855         * UIProcess/WebPageProxy.cpp:
3856         (WebKit::WebPageProxy::loadFile):
3857         (WebKit::WebPageProxy::loadHTMLString):
3858         (WebKit::WebPageProxy::loadPlainTextString):
3859         (WebKit::WebPageProxy::loadWebArchiveData):
3860         (WebKit::WebPageProxy::savePDFToFileInDownloadsFolder):
3861         * UIProcess/WebProcessProxy.cpp:
3862         (WebKit::WebProcessProxy::getLaunchOptions):
3863         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3864         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
3865         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
3866         (WebKit::notifyPages):
3867         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
3868         * UIProcess/ios/WKContentViewInteraction.mm:
3869         (-[WKContentView copyForWebView:]):
3870         (-[WKContentView cutForWebView:]):
3871         (-[WKContentView pasteForWebView:]):
3872         (-[WKContentView selectAllForWebView:]):
3873         (-[WKContentView deleteBackward]):
3874         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
3875         * UIProcess/ios/WKLegacyPDFView.mm:
3876         (-[WKLegacyPDFView _URLForLinkAnnotation:]):
3877         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
3878         (WebKit::WebAutomationSessionProxy::elementForNodeHandle):
3879         (WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame):
3880         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
3881         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
3882         (WebKit::WebIDBConnectionToServer::connectionToServerLost):
3883         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
3884         (webkit_dom_document_get_ready_state):
3885         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
3886         (WebKit::uniqueWorldName):
3887         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
3888         (WebKit::WebMediaKeyStorageManager::getMediaKeyOrigins):
3889         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3890         (WebKit::PDFPlugin::pluginInfo):
3891         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
3892         (WebKit::ServiceWorkerClientFetch::validateResponse):
3893         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
3894         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
3895         (WebKit::WebContextMenuClient::searchWithGoogle):
3896         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
3897         (WebKit::WebInspectorClient::showPaintRect):
3898         * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
3899         (WebKit::RemoteWebInspectorUI::initialize):
3900         (WebKit::RemoteWebInspectorUI::didSave):
3901         (WebKit::RemoteWebInspectorUI::didAppend):
3902         (WebKit::RemoteWebInspectorUI::frontendLoaded):
3903         * WebProcess/WebPage/WebInspector.cpp:
3904         (WebKit::WebInspector::openInNewTab):
3905         * WebProcess/WebPage/WebInspectorUI.cpp:
3906         (WebKit::WebInspectorUI::setDockSide):
3907         (WebKit::WebInspectorUI::setDockingUnavailable):
3908         (WebKit::WebInspectorUI::setIsVisible):
3909         (WebKit::WebInspectorUI::showConsole):
3910         (WebKit::WebInspectorUI::showResources):
3911         (WebKit::WebInspectorUI::showTimelines):
3912         (WebKit::WebInspectorUI::showMainResourceForFrame):
3913         (WebKit::WebInspectorUI::startPageProfiling):
3914         (WebKit::WebInspectorUI::stopPageProfiling):
3915         (WebKit::WebInspectorUI::startElementSelection):
3916         (WebKit::WebInspectorUI::stopElementSelection):
3917         (WebKit::WebInspectorUI::didSave):
3918         (WebKit::WebInspectorUI::didAppend):
3919         * WebProcess/WebPage/WebPage.cpp:
3920         (WebKit::WebPage::loadStringImpl):
3921         (WebKit::WebPage::loadAlternateHTMLString):
3922         * WebProcess/WebPage/ios/WebPageIOS.mm:
3923         (WebKit::computeAutocorrectionContext):
3924         * WebProcess/WebProcess.cpp:
3925         (WebKit::getWebCoreMemoryCacheStatistics):
3926         (WebKit::WebProcess::getWebCoreStatistics):
3927         * WebProcess/cocoa/WebProcessCocoa.mm:
3928         (WebKit::WebProcess::initializeProcessName):
3929
3930 2018-06-22  Chris Dumez  <cdumez@apple.com>
3931
3932         Regression(r230211): Crash under WebInspectorClient::~WebInspectorClient()
3933         https://bugs.webkit.org/show_bug.cgi?id=186950
3934         <rdar://problem/40602069>
3935
3936         Reviewed by Darin Adler.
3937
3938         Re-introduce null-check that was accidentally dropped in r230211.
3939
3940         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
3941         (WebKit::WebInspectorClient::~WebInspectorClient):
3942
3943 2018-06-22  Timothy Hatcher  <timothy@apple.com>
3944
3945         Corner of two scroll bars is white with dark mode enabled.
3946         https://bugs.webkit.org/show_bug.cgi?id=186819
3947         rdar://problem/40434350
3948
3949         Reviewed by Tim Horton.
3950
3951         * UIProcess/mac/WKPrintingView.mm:
3952         (-[WKPrintingView drawRect:]): Added LocalDefaultSystemAppearance.
3953         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
3954         (WebKit::InjectedBundleRangeHandle::renderedImage): Ditto.
3955         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3956         (WebKit::PDFPlugin::paintControlForLayerInContext): Ditto. Dropped ScrollView argument.
3957         * WebProcess/WebPage/WebPage.cpp:
3958         (WebKit::WebPage::drawRect): Added LocalDefaultSystemAppearance.
3959
3960 2018-06-22  Tim Horton  <timothy_horton@apple.com>
3961
3962         Make it possible to add a border around loading or failed-to-load images
3963         https://bugs.webkit.org/show_bug.cgi?id=186614
3964         <rdar://problem/39050152>
3965
3966         Reviewed by Zalan Bujtas.
3967
3968         * Shared/WebPreferences.yaml:
3969         * UIProcess/API/Cocoa/WKWebView.mm:
3970         (-[WKWebView _initializeWithConfiguration:]):
3971         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3972         (-[WKWebViewConfiguration init]):
3973         (-[WKWebViewConfiguration copyWithZone:]):
3974         (-[WKWebViewConfiguration _setColorFilterEnabled:]):
3975         (-[WKWebViewConfiguration _incompleteImageBorderEnabled]):
3976         (-[WKWebViewConfiguration _setIncompleteImageBorderEnabled:]):
3977         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3978         Plumb the setting to WebKit2.
3979
3980 2018-06-22  Brady Eidson  <beidson@apple.com>
3981
3982         WKURLSchemeHandler doesn't handle sync XHR.
3983         <rdar://problem/40955884> and https://bugs.webkit.org/show_bug.cgi?id=186902
3984
3985         Reviewed by Chris Dumez.
3986
3987         This patch allows WebProcesses to block on sync loads to a custom scheme,
3988         and teaches WebURLSchemeTasks how to buffer up data and the response if 
3989         operating synchronously.
3990
3991         * Shared/WebErrors.cpp:
3992         (WebKit::failedCustomProtocolSyncLoad):
3993         * Shared/WebErrors.h:
3994
3995         * UIProcess/WebPageProxy.cpp:
3996         (WebKit::WebPageProxy::startURLSchemeTask):
3997         (WebKit::WebPageProxy::loadSynchronousURLSchemeTask):
3998         * UIProcess/WebPageProxy.h:
3999         * UIProcess/WebPageProxy.messages.in:
4000
4001         * UIProcess/WebURLSchemeHandler.cpp:
4002         (WebKit::WebURLSchemeHandler::startTask):
4003         * UIProcess/WebURLSchemeHandler.h:
4004
4005         * UIProcess/WebURLSchemeTask.cpp:
4006         (WebKit::WebURLSchemeTask::create):
4007         (WebKit::WebURLSchemeTask::WebURLSchemeTask):
4008         (WebKit::WebURLSchemeTask::didPerformRedirection):
4009         (WebKit::WebURLSchemeTask::didReceiveResponse)