03dc48cb65899ee0e6693e07c01fb13653510737
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-07-03  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2
3         [Curl] Embed certificate information into ResourceResponse.
4         https://bugs.webkit.org/show_bug.cgi?id=187102
5
6         Reviewed by Youenn Fablet.
7
8         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
9         (WebKit::NetworkDataTaskCurl::curlDidComplete):.
10
11 2018-07-03  Simon Fraser  <simon.fraser@apple.com>
12
13         [iOS WK2] We fail to make surfaces volatile when suspending, increasing memory impact
14         https://bugs.webkit.org/show_bug.cgi?id=187285
15         rdar://problem/41732391
16
17         Reviewed by Tim Horton.
18         
19         The "Mach port as layer contents" code path used in iOS WK2 relies on replacing the 
20         Mach port layer contents with the actual IOSurface on suspension (otherwise the
21         live Mach port will keep the surface in use). However, we were never hitting this
22         RemoteLayerTreeHost::mapAllIOSurfaceBackingStore() code path on iOS 11 and later
23         because UIKit stopped firing the notification we relied on.
24         
25         To fix this, use the _UIApplicationDidFinishSuspensionSnapshotNotification notification
26         which is fired on UIApp.
27
28         * Platform/spi/ios/UIKitSPI.h:
29         * UIProcess/ApplicationStateTracker.mm:
30         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
31
32 2018-07-02  Simon Fraser  <simon.fraser@apple.com>
33
34         Clean up the layer volatility code and logging
35         https://bugs.webkit.org/show_bug.cgi?id=187286
36
37         Reviewed by Tim Horton.
38         
39         Fix the layer volatility logging so it doesn't say "succeeded" when it actually failed
40         and gave up.
41         
42         Use a couple of lambda functions in RemoteLayerBackingStore::setBufferVolatility() to
43         make the code easier to read.
44
45         * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
46         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
47         (WebKit::RemoteLayerBackingStore::setBufferVolatility):
48         * WebProcess/WebPage/WebPage.cpp:
49         (WebKit::WebPage::callVolatilityCompletionHandlers):
50         (WebKit::WebPage::layerVolatilityTimerFired):
51         (WebKit::WebPage::markLayersVolatile):
52         * WebProcess/WebPage/WebPage.h:
53         (WebKit::WebPage::markLayersVolatile):
54         * WebProcess/WebProcess.cpp:
55         (WebKit::WebProcess::actualPrepareToSuspend):
56         (WebKit::WebProcess::markAllLayersVolatile):
57         * WebProcess/WebProcess.h:
58
59 2018-07-03  John Wilander  <wilander@apple.com>
60
61         Resource Load Statistics: Make WebsiteDataStore::getAllStorageAccessEntries() call the right network process instead of iterating over the process pools
62         https://bugs.webkit.org/show_bug.cgi?id=187277
63         <rdar://problem/41745510>
64
65         Reviewed by Chris Dumez.
66
67         Existing tests use this code. The change is for correctness.
68
69         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
70         (-[WKWebsiteDataStore _getAllStorageAccessEntriesFor:completionHandler:]):
71             Now receives a WKWebView from its caller and gets the page ID from it.
72         (-[WKWebsiteDataStore _getAllStorageAccessEntries:]): Deleted.
73         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
74         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
75         (WebKit::WebsiteDataStore::getAllStorageAccessEntries):
76             Now gets a page ID from its caller and gets the right network process
77             through it.
78         * UIProcess/WebsiteData/WebsiteDataStore.h:
79
80 2018-07-03  Jonathan Bedard  <jbedard@apple.com>
81
82         Unreviewed, rolling out r233461.
83
84         Assertions triggered during iOS 11 debug layout and API tests
85
86         Reverted changeset:
87
88         "[iOS] Add assert to catch improper use of WebCore::Timer in
89         UI Process"
90         https://bugs.webkit.org/show_bug.cgi?id=185330
91         https://trac.webkit.org/changeset/233461
92
93 2018-07-03  Youenn Fablet  <youenn@apple.com>
94
95         Update com.cmbchina.CMBSecurity.sb to make it functional
96         https://bugs.webkit.org/show_bug.cgi?id=187278
97
98         Reviewed by Brent Fulgham.
99
100         * Resources/PlugInSandboxProfiles/com.cmbchina.CMBSecurity.sb:
101
102 2018-07-03  Jer Noble  <jer.noble@apple.com>
103
104         Update Fullscreen anti-phishing alert text
105         https://bugs.webkit.org/show_bug.cgi?id=187199
106         <rdar://problem/41162543>
107
108         Reviewed by Brent Fulgham.
109
110         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
111         (-[WKFullScreenViewController _showPhishingAlert]):
112
113 2018-07-03  David Kilzer  <ddkilzer@apple.com>
114
115         [iOS] Add assert to catch improper use of WebCore::Timer in UI Process
116         <https://webkit.org/b/185330>
117         <rdar://problem/32816079>
118
119         Reviewed by Darin Adler.
120
121         * NetworkProcess/NetworkProcess.cpp:
122         (WebKit::NetworkProcess::NetworkProcess):
123         * StorageProcess/StorageProcess.cpp:
124         (WebKit::StorageProcess::StorageProcess):
125         * WebProcess/WebProcess.cpp:
126         (WebKit::m_nonVisibleProcessCleanupTimer):
127         - Call setWebKitProcessType() to se the global for the current
128           process.
129
130 2018-07-03  Frederic Wang  <fred.wang@free.fr>
131
132         [iOS] Animations with Bézier timing function not suspended on UI process when animation-play-state is set to "paused"
133         https://bugs.webkit.org/show_bug.cgi?id=170784
134
135         Reviewed by Antoine Quint.
136
137         In order to pause a running animation, GraphicsLayerCA::pauseCAAnimationOnLayer calls
138         PlatformCALayer::addAnimationForKey, assuming it will replace the current animation.
139         This patch fixes PlatformCALayerRemote::addAnimationForKey to ensure this assumption holds.
140
141         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
142         (WebKit::PlatformCALayerRemote::addAnimationForKey): If the animation was already sent to
143         the UI process, make sure it is properly updated.
144
145 2018-07-02  Youenn Fablet  <youenn@apple.com>
146
147         Add sandbox to microdone plugin
148         https://bugs.webkit.org/show_bug.cgi?id=187149
149         <rdar://problem/41538057>
150
151         Unreviewed.
152
153         * Resources/PlugInSandboxProfiles/cn.microdone.cmb.safari.sb: Renamed from Source/WebKit/Resources/PlugInSandboxProfiles/cn.microdone.cmb.safari.
154         * WebKit.xcodeproj/project.pbxproj:
155
156 2018-07-02  Tim Horton  <timothy_horton@apple.com>
157
158         Adjust now-incorrect animated resize logging after r232544
159         https://bugs.webkit.org/show_bug.cgi?id=187281
160         <rdar://problem/41645347>
161
162         Reviewed by Simon Fraser.
163
164         * UIProcess/API/Cocoa/WKWebView.mm:
165         (-[WKWebView _didCommitLayerTree:]):
166         (-[WKWebView _didCompleteAnimatedResize]):
167         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
168         _beginAnimatedResizeWithUpdate: and _didCompleteAnimatedResize are
169         not strictly paired; we could instead track the SPI, but it's a bit
170         tricky since resizeWithContentHidden has an implicit endAnimatedResize.
171         Instead, just log if we still have a resizeAnimationView when we're
172         committing outside of an animated resize, which seems to be the original concern,
173         and point toward the possibility of unpaired begin/end.
174         Also fix logging that has the wrong method name.
175
176 2018-07-02  Youenn Fablet  <youenn@apple.com>
177
178         Update com.apple.NPSafeInput.sb to make it functional
179         https://bugs.webkit.org/show_bug.cgi?id=187276
180
181         Reviewed by Brent Fulgham.
182
183         * Resources/PlugInSandboxProfiles/com.apple.NPSafeInput.sb:
184
185 2018-07-02  Youenn Fablet  <youenn@apple.com>
186
187         Update com.cfca.npSecEditCtl.MAC.BOC.plugin.sb to make it functional
188         https://bugs.webkit.org/show_bug.cgi?id=187261
189
190         Reviewed by Brent Fulgham.
191
192         * Resources/PlugInSandboxProfiles/com.cfca.npSecEditCtl.MAC.BOC.plugin.sb:
193
194 2018-07-02  Brady Eidson  <beidson@apple.com>
195
196         Crash notifying observers of responsiveness state change
197         <rdar://problem/41267796> and https://bugs.webkit.org/show_bug.cgi?id=187262
198
199         Reviewed by Tim Horton.
200
201         * UIProcess/PageLoadState.cpp:
202         (WebKit::PageLoadState::callObserverCallback): Copy the container ahead of time.
203
204 2018-07-02  Sihui Liu  <sihui_liu@apple.com>
205
206         Remove InitWebCoreThreadSystemInterface() in WKProcessPool _initWithConfiguration
207         https://bugs.webkit.org/show_bug.cgi?id=187252
208
209         Reviewed by Dan Bernstein.
210
211         Clean up after <rdar://problem/15256572>.
212
213         * UIProcess/API/Cocoa/WKProcessGroup.mm:
214         (-[WKProcessGroup initWithInjectedBundleURL:]):
215         * UIProcess/API/Cocoa/WKProcessPool.mm:
216         (-[WKProcessPool _initWithConfiguration:]):
217
218 2018-07-02  Zan Dobersek  <zdobersek@igalia.com>
219
220         REGRESSION(r233381): Double WebResourceLoadStatisticsStore destructor invocation
221         https://bugs.webkit.org/show_bug.cgi?id=187247
222
223         Reviewed by Chris Dumez.
224
225         * UIProcess/WebResourceLoadStatisticsStore.cpp:
226         (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
227         Don't call postTask() to dispatch this task, as that keeps a reference
228         to this WebResourceLoadStatisticsStore object and thus causes problems
229         when invoked from the destructor in the form of a second destructor
230         invocation that ends up crashing the process. Blocking nature of this
231         call should be enough to avoid WebResourceLoadStatisticsStore lifetime
232         issues.
233
234 2018-07-02  Per Arne Vollan  <pvollan@apple.com>
235
236         Delete display link when closing page or the WebContent process has crashed.
237         https://bugs.webkit.org/show_bug.cgi?id=186895
238
239         Reviewed by Brent Fulgham.
240
241         If there is a running display link in the UI process, there is no need to keep it around if the
242         page is being closed or the WebContent process has crashed.
243
244         * UIProcess/WebPageProxy.cpp:
245         (WebKit::WebPageProxy::close):
246         (WebKit::WebPageProxy::resetStateAfterProcessExited):
247
248 2018-06-23  Darin Adler  <darin@apple.com>
249
250         [Cocoa] Improve ARC compatibility of more code in JavaScriptCore
251         https://bugs.webkit.org/show_bug.cgi?id=186973
252
253         Reviewed by Dan Bernstein.
254
255         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
256         (WebKit::XPCServiceInitializerDelegate::hasEntitlement): Use WTF::hasEntitlement.
257
258         * Shared/mac/SandboxUtilities.h: Removed connectedProcessHasEntitlement since
259         we can now use WTF::hasEntitlement instead.
260         * Shared/mac/SandboxUtilities.mm: Ditto.
261
262         * StorageProcess/ios/StorageProcessIOS.mm:
263         (WebKit::StorageProcess::parentProcessHasServiceWorkerEntitlement): Use
264         WTF::hasEntitlement.
265         * WebProcess/WebPage/ios/WebPageIOS.mm:
266         (WebKit::WebPage::parentProcessHasServiceWorkerEntitlement): Ditto.
267
268 2018-06-30  David Kilzer  <ddkilzer@apple.com>
269
270         Fix clang static analyzer warnings: Garbage return value
271         <https://webkit.org/b/187224>
272
273         Reviewed by Eric Carlson.
274
275         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
276         (WebKit::WebPlatformStrategies::changeCount):
277         (WebKit::WebPlatformStrategies::addTypes):
278         (WebKit::WebPlatformStrategies::setTypes):
279         (WebKit::WebPlatformStrategies::setBufferForType):
280         (WebKit::WebPlatformStrategies::setPathnamesForType):
281         (WebKit::WebPlatformStrategies::setStringForType):
282         (WebKit::WebPlatformStrategies::getNumberOfFiles):
283         (WebKit::WebPlatformStrategies::getPasteboardItemsCount):
284         (WebKit::WebPlatformStrategies::writeCustomData):
285         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
286         (WebKit::WebEditorClient::substitutionsPanelIsShowing):
287         - Use brace initialization for local variables.
288
289 2018-06-30  Michael Catanzaro  <mcatanzaro@igalia.com>
290
291         Unreviewed, add missing PLATFORM(COCOA) guard after r233207
292         https://bugs.webkit.org/show_bug.cgi?id=186788
293         <rdar://problem/41094167>
294
295         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
296         (WKBundleExtendClassesForParameterCoder):
297
298 2018-06-30  Dan Bernstein  <mitz@apple.com>
299
300         Added a missing availability attribute.
301
302         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
303
304 2018-06-29  John Wilander  <wilander@apple.com>
305
306         Resource Load Statistics: Make network process calls only for the process pool that the page belongs to
307         https://bugs.webkit.org/show_bug.cgi?id=187206
308         <rdar://problem/41659160>
309
310         Reviewed by Chris Dumez.
311
312         Instead of iterating over all process pools, we should resolve which
313         process pool the page belongs to and call the network process only for
314         that pool. This is especially important since we use WTFMove for the
315         completion handlers.
316
317         This patch also renames "callback" to "completionHandler" for
318         the functions touched.
319
320         A FIXME comment is added to WebsiteDataStore::getAllStorageAccessEntries()
321         where we currently don't have a page ID to do the lookup with.
322
323         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
324         (WebKit::WebsiteDataStore::updatePrevalentDomainsToPartitionOrBlockCookies):
325         (WebKit::WebsiteDataStore::hasStorageAccessForFrameHandler):
326         (WebKit::WebsiteDataStore::getAllStorageAccessEntries):
327         (WebKit::WebsiteDataStore::grantStorageAccessHandler):
328         (WebKit::WebsiteDataStore::hasStorageAccess):
329         (WebKit::WebsiteDataStore::requestStorageAccess):
330         (WebKit::WebsiteDataStore::grantStorageAccess):
331
332 2018-06-29  Chris Dumez  <cdumez@apple.com>
333
334         Add utility methods to WebResourceLoadStatisticsStore to hop back and forth between threads
335         https://bugs.webkit.org/show_bug.cgi?id=187200
336
337         Reviewed by Brent Fulgham.
338
339         Add utility methods to WebResourceLoadStatisticsStore to hop back and forth between threads,
340         in order the simplify the code a little bit.
341
342         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
343         (WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
344         * UIProcess/WebResourceLoadStatisticsStore.cpp:
345         (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
346         (WebKit::WebResourceLoadStatisticsStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
347         (WebKit::WebResourceLoadStatisticsStore::setShouldSubmitTelemetry):
348         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
349         (WebKit::WebResourceLoadStatisticsStore::postTask):
350         (WebKit::WebResourceLoadStatisticsStore::postTaskReply):
351         (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
352         (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
353         (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
354         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
355         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
356         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
357         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
358         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
359         (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
360         (WebKit::WebResourceLoadStatisticsStore::submitTelemetry):
361         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
362         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
363         (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
364         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
365         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
366         (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
367         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
368         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
369         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
370         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
371         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
372         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
373         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
374         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
375         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
376         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
377         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
378         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
379         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
380         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
381         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
382         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
383         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
384         (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
385         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningStateReset):
386         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory):
387         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
388         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
389         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
390         (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
391         (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime):
392         (WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries):
393         (WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo):
394         (WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
395         * UIProcess/WebResourceLoadStatisticsStore.h:
396
397 2018-06-29  Aditya Keerthi  <akeerthi@apple.com>
398
399         [macOS] Do not crash if there is an attempt to copy a file URL to the clipboard
400         https://bugs.webkit.org/show_bug.cgi?id=187183
401
402         Reviewed by Wenson Hsieh.
403
404         r210683 introduced logic to prevent file URLs from being copied to the clipboard
405         in unexpected cases. The current logic always crashes the WebProcess if
406         webProcessProxy->checkURLReceivedFromWebProcess returns false. Instead of
407         crashing, we can fail silently and not copy anything to the clipboard.
408
409         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
410         (WebKit::WebPasteboardProxy::setPasteboardPathnamesForType): Removed call to markCurrentlyDispatchedMessageAsInvalid() which was causing the process to crash.
411
412 2018-06-29  Chris Dumez  <cdumez@apple.com>
413
414         Regression(r233359): Caused ITP tests to be flaky
415         https://bugs.webkit.org/show_bug.cgi?id=187189
416
417         Reviewed by Youenn Fablet.
418
419         r233359 started using m_resolvedConfiguration.resourceLoadStatisticsDirectory instead of
420         m_configuration.resourceLoadStatisticsDirectory for the ITP path. This is consistent
421         with what we do for other database paths so that things like '~' in paths get resolved.
422
423         This introduced flakiness because the resourceLoadStatisticsDirectory was never getting
424         resolved and m_resolvedConfiguration.resourceLoadStatisticsDirectory was not set.
425         Update the WebsiteDataStore so that m_resolvedConfiguration.resourceLoadStatisticsDirectory
426         properly gets set to the resolved version of m_configuration.resourceLoadStatisticsDirectory.
427
428         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
429         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
430         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
431
432 2018-06-29  John Wilander  <wilander@apple.com>
433
434         Resource Load Statistics: Don't create a WebResourceLoadStatisticsStore for ephemeral sessions
435         https://bugs.webkit.org/show_bug.cgi?id=187154
436         <rdar://problem/41487250>
437
438         Reviewed by Brent Fulgham and Chris Dumez.
439
440         Most of the changes in this patch remove the boolean parameter for tracking
441         ephemeral sessions and the IsReadOnly enum.
442
443         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
444         (-[WKWebsiteDataStore _setResourceLoadStatisticsTestingCallback:]):
445             Now returns early for ephemeral sessions.
446         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
447         (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
448         (WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk):
449         (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
450         * UIProcess/ResourceLoadStatisticsPersistentStorage.h:
451         * UIProcess/WebResourceLoadStatisticsStore.cpp:
452         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
453         * UIProcess/WebResourceLoadStatisticsStore.h:
454         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
455         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
456             Now returns early for ephemeral sessions.
457         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
458
459 2018-06-29  Chris Dumez  <cdumez@apple.com>
460
461         Stop using lambdas for WebResourceLoadStatisticsStore to interact with its WebsiteDataStore
462         https://bugs.webkit.org/show_bug.cgi?id=187165
463
464         Reviewed by Brent Fulgham.
465
466         Stop using lambdas for WebResourceLoadStatisticsStore to interact with its WebsiteDataStore. Instead,
467         WebResourceLoadStatisticsStore now holds a weak pointer to its WebsiteDataStore and is able to call
468         methods on it directly. Reducing the indirection makes the code less complex and more understandable.
469
470         * UIProcess/WebResourceLoadStatisticsStore.cpp:
471         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
472         (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
473         (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
474         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
475         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToPartitionOrBlockCookiesHandler):
476         (WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
477         * UIProcess/WebResourceLoadStatisticsStore.h:
478         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
479         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
480
481 2018-06-29  Miguel Gomez  <magomez@igalia.com>
482
483         [WPE] Some frames are dropped when using rAF to animate an element
484         https://bugs.webkit.org/show_bug.cgi?id=187175
485
486         Always call renderNextFrame in ThreadedCompositor::requestDisplayRefreshMonitorUpdate()
487         so we have to process any pending layer flush request.
488
489         Reviewed by Žan Doberšek.
490
491         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
492         (WebKit::ThreadedCompositor::handleDisplayRefreshMonitorUpdate):
493
494 2018-06-28  Chris Dumez  <cdumez@apple.com>
495
496         Make sure the WebResourceLoadStatisticsStore gets destroyed on the main thread
497         https://bugs.webkit.org/show_bug.cgi?id=187143
498
499         Reviewed by Youenn Fablet.
500
501         Have WebResourceLoadStatisticsStore subclass ThreadSafeRefCounted<WebResourceLoadStatisticsStore, WTF::DestructionThread::Main>
502         instead of IPC::Connection::WorkQueueMessageReceiver. This makes sure that the WebResourceLoadStatisticsStore
503         objects get destroyed on the main thread, even if the last ref was held by a background thread.
504
505         Also, methods called by IPC are now called on the main thread instead of the background queue. I think it is clearer for all
506         of WebResourceLoadStatisticsStore usage to be on the main thread. Expensive work is still done on the background queue, inside
507         the persistent / memory store classes.
508
509         * UIProcess/WebResourceLoadStatisticsStore.cpp:
510         (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
511         (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
512         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
513         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
514         (WebKit::WebResourceLoadStatisticsStore::processWillOpenConnection):
515         (WebKit::WebResourceLoadStatisticsStore::processDidCloseConnection):
516         * UIProcess/WebResourceLoadStatisticsStore.h:
517
518 2018-06-28  Jiewen Tan  <jiewen_tan@apple.com>
519
520         Add nullptr check for xpc_connection_t in AuthenticationManager::initializeConnection
521         https://bugs.webkit.org/show_bug.cgi?id=187110
522         <rdar://problem/41536815>
523
524         Reviewed by Brent Fulgham.
525
526         In some rare cases as shown by crash tracers that the passed xpc_connection_t object could be nullptr,
527         and xpc_connection_set_event_handler won't do the nullptr check on its parameters. Therefore, we should
528         do it by ourselves.
529
530         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
531         (WebKit::AuthenticationManager::initializeConnection):
532         * UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm:
533         (WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc const):
534
535 2018-06-28  Wenson Hsieh  <wenson_hsieh@apple.com>
536
537         [iOS] DataTransfer.getData always returns the empty string when dropping text
538         https://bugs.webkit.org/show_bug.cgi?id=187130
539         <rdar://problem/41014117>
540
541         Reviewed by Ryosuke Niwa.
542
543         Add plumbing to grab information for each item in the pasteboard. See WebCore ChangeLog for more detail.
544
545         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
546         (WebKit::WebPasteboardProxy::allPasteboardItemInfo):
547         * UIProcess/WebPasteboardProxy.h:
548         * UIProcess/WebPasteboardProxy.messages.in:
549         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
550         (WebKit::WebPlatformStrategies::allPasteboardItemInfo):
551         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
552
553 2018-06-28  Youenn Fablet  <youenn@apple.com>
554
555         Early return when handling fetch event in case service worker origin does not match origin of a subresource load
556         https://bugs.webkit.org/show_bug.cgi?id=187153
557         <rdar://problem/41329832>
558
559         Reviewed by Chris Dumez.
560
561         Stop crashing the service worker process in case a subresource load origin is not matching a service worker origin.
562         Instead, just return early so that the load will be handled by the network process.
563
564         Keep crashing in case a navigation load is not matching its service worker origin.
565         Add more logging to help with the debugging.
566
567         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
568         (WebKit::logValidFetchError):
569         (WebKit::isValidFetch):
570         (WebKit::WebSWContextManagerConnection::startFetch):
571
572 2018-06-28  Jeremy Jones  <jeremyj@apple.com>
573
574         Fullscreen exits when placeholder is removed then added during a single runloop.
575         https://bugs.webkit.org/show_bug.cgi?id=187079
576
577         Reviewed by Jer Noble.
578
579         Instead of closing fullscreen as soon as the placeholder is removed from the view hierarchy,
580         give the placeholder until the next runloop to be re-added to the view hierarchy.
581
582         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
583         (-[WKFullScreenWindowController placeholderWillMoveToSuperview:]):
584
585 2018-06-28  Youenn Fablet  <youenn@apple.com>
586
587         Handle the case of registerMDNSNameCallback called several times
588         https://bugs.webkit.org/show_bug.cgi?id=187150
589         <rdar://problem/41329832>
590
591         Reviewed by Eric Carlson.
592
593         This is a speculative fix on the basis that registerMDNSNameCallback may be called several times.
594         In that case, we would have freed the context after the first call and would reuse it for the second call.
595
596         Instead, keep a map of pending requests and pass to registerMDNSNameCallback an identifier to that map.
597         If the map has no value for that identifier, return early.
598
599         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
600         (WebKit::NetworkMDNSRegister::~NetworkMDNSRegister):
601         (WebKit::pendingRegistrationRequests):
602         (WebKit::registerMDNSNameCallback):
603         (WebKit::NetworkMDNSRegister::clearPendingRequests):
604         (WebKit::NetworkMDNSRegister::registerMDNSName):
605         * NetworkProcess/webrtc/NetworkMDNSRegister.h:
606         (): Deleted.
607
608 2018-06-28  Chris Dumez  <cdumez@apple.com>
609
610         Unreviewed attempt to fix Win Cairo build after r233310.
611
612         * UIProcess/WebResourceLoadStatisticsStore.h:
613
614 2018-06-28  Chris Dumez  <cdumez@apple.com>
615
616         Unreviewed attempt to fix Win Cairo build after r233310.
617
618         * UIProcess/WebResourceLoadStatisticsStore.h:
619
620 2018-06-28  Chris Dumez  <cdumez@apple.com>
621
622         Split memory store logic out of WebResourceLoadStatisticsStore to clarify threading model
623         https://bugs.webkit.org/show_bug.cgi?id=187055
624         <rdar://problem/41584026>
625
626         Unreviewed, temporarily disable main thread assertion added to flushAndDestroyPersistentStore()
627         in r233310, until Bug 187143 is fixed.
628
629         * UIProcess/WebResourceLoadStatisticsStore.cpp:
630         (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
631
632 2018-06-28  Youenn Fablet  <youenn@apple.com>
633
634         Add sandbox to microdone plugin
635         https://bugs.webkit.org/show_bug.cgi?id=187149
636         rdar://problem/41538057
637
638         Reviewed by Brent Fulgham.
639
640         * Resources/PlugInSandboxProfiles/cn.microdone.cmb.safari: Added.
641         * WebKit.xcodeproj/project.pbxproj:
642
643 2018-06-28  Brian Burg  <bburg@apple.com>
644
645         Web Inspector: REGRESSION(r223770): "Open Link" context menu action on a linkified URL doesn't work
646         https://bugs.webkit.org/show_bug.cgi?id=187146
647         <rdar://problem/41369591>
648
649         Reviewed by Joseph Pecoraro.
650
651         When Web Inspector's page receives a navigation request, it's supposed to redirect any
652         non-Inspector navigations to be loaded in the inspected page. When I refactored to use
653         modern a policy delegate, the one line that redirects the loads was left out.
654
655         No new tests, because inspector tests can't navigate the inspector or inspected pages.
656
657         * UIProcess/mac/WKInspectorViewController.mm:
658         (-[WKInspectorViewController webView:decidePolicyForNavigationAction:decisionHandler:]):
659
660 2018-06-28  Jeremy Jones  <jeremyj@apple.com>
661
662         Crash when _topConstraint is null in element fullscreen.
663         https://bugs.webkit.org/show_bug.cgi?id=187075
664
665         Reviewed by Eric Carlson.
666
667         NSArray can't contain a null pointer, so check for null before creating an array from a pointer.
668         Use the recommended +deactivateConstraints: instead of -removeConstraints:.
669
670         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
671         (-[WKFullScreenViewController showUI]):
672         (-[WKFullScreenViewController hideUI]):
673
674 2018-06-28  Chris Dumez  <cdumez@apple.com>
675
676         Split memory store logic out of WebResourceLoadStatisticsStore to clarify threading model
677         https://bugs.webkit.org/show_bug.cgi?id=187055
678         <rdar://problem/41584026>
679
680         Reviewed by Brent Fulgham.
681
682         Split memory store logic out of WebResourceLoadStatisticsStore and into a ResourceLoadStatisticsMemoryStore class
683         to clarify the threading model. Previously, some of the methods of the WebResourceLoadStatisticsStore had to be
684         called on the main thread and some of them on the background queue, which was confusing and error prone. Now,
685         all WebResourceLoadStatisticsStore methods (except for IPC ones which will be addressed in a follow-up) are called
686         on the main thread. The ResourceLoadStatisticsMemoryStore objects is constructed / used and destroyed on the
687         background queue, similarly to the ResourceLoadStatisticsPersistentStore. The WebResourceLoadStatisticsStore
688         objects merely proxies calls from WebKit to those persistent / memory stores and takes care of hopping back and
689         forth between the background thread and the work queue.
690
691         While spliting code code, I found several instances where we were calling completion handlers on the wrong thread.
692         I fixed those in this patch now that the model is clearer.
693
694         We can likely clean up (organize the code a bit better) in a follow-up). This patch takes care of splitting the
695         code as it was. Code that was called on the background queue was moved to ResourceLoadStatisticsMemoryStore class
696         and code that was called on the main thread stays in WebResourceLoadStatisticsStore.
697
698         * CMakeLists.txt:
699         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm: Renamed from Source/WebKit/UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm.
700         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
701         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp: Added.
702         (WebKit::appendWithDelimiter):
703         (WebKit::OperatingDate::fromWallTime):
704         (WebKit::OperatingDate::today):
705         (WebKit::OperatingDate::secondsSinceEpoch const):
706         (WebKit::OperatingDate::operator== const):
707         (WebKit::OperatingDate::operator< const):
708         (WebKit::OperatingDate::operator<= const):
709         (WebKit::OperatingDate::OperatingDate):
710         (WebKit::mergeOperatingDates):
711         (WebKit::pruneResources):
712         (WebKit::computeImportance):
713         (WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
714         (WebKit::ResourceLoadStatisticsMemoryStore::~ResourceLoadStatisticsMemoryStore):
715         (WebKit::ResourceLoadStatisticsMemoryStore::setPersistentStorage):
716         (WebKit::ResourceLoadStatisticsMemoryStore::calculateAndSubmitTelemetry):
717         (WebKit::ResourceLoadStatisticsMemoryStore::setNotifyPagesWhenDataRecordsWereScanned):
718         (WebKit::ResourceLoadStatisticsMemoryStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
719         (WebKit::ResourceLoadStatisticsMemoryStore::setShouldSubmitTelemetry):
720         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
721         (WebKit::ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain):
722         (WebKit::ResourceLoadStatisticsMemoryStore::markAsPrevalentIfHasRedirectedToPrevalent):
723         (WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):
724         (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
725         (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
726         (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener):
727         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
728         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
729         (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData):
730         (WebKit::ResourceLoadStatisticsMemoryStore::setResourceLoadStatisticsDebugMode):
731         (WebKit::ResourceLoadStatisticsMemoryStore::scheduleStatisticsProcessingRequestIfNecessary):
732         (WebKit::ResourceLoadStatisticsMemoryStore::cancelPendingStatisticsProcessingRequest):
733         (WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
734         (WebKit::ResourceLoadStatisticsMemoryStore::logUserInteraction):
735         (WebKit::ResourceLoadStatisticsMemoryStore::logNonRecentUserInteraction):
736         (WebKit::ResourceLoadStatisticsMemoryStore::clearUserInteraction):
737         (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUserInteraction):
738         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResource):
739         (WebKit::ResourceLoadStatisticsMemoryStore::isPrevalentResource const):
740         (WebKit::ResourceLoadStatisticsMemoryStore::isVeryPrevalentResource const):
741         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubFrameUnder):
742         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsRedirectingTo):
743         (WebKit::ResourceLoadStatisticsMemoryStore::clearPrevalentResource):
744         (WebKit::ResourceLoadStatisticsMemoryStore::setGrandfathered):
745         (WebKit::ResourceLoadStatisticsMemoryStore::isGrandfathered const):
746         (WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameOrigin):
747         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameOrigin):
748         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectTo):
749         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectFrom):
750         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectTo):
751         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectFrom):
752         (WebKit::ResourceLoadStatisticsMemoryStore::setTimeToLiveUserInteraction):
753         (WebKit::ResourceLoadStatisticsMemoryStore::setTimeToLiveCookiePartitionFree):
754         (WebKit::ResourceLoadStatisticsMemoryStore::setMinimumTimeBetweenDataRecordsRemoval):
755         (WebKit::ResourceLoadStatisticsMemoryStore::setGrandfatheringTime):
756         (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveDataRecords const):
757         (WebKit::ResourceLoadStatisticsMemoryStore::setDataRecordsBeingRemoved):
758         (WebKit::ResourceLoadStatisticsMemoryStore::ensureResourceStatisticsForPrimaryDomain):
759         (WebKit::ResourceLoadStatisticsMemoryStore::createEncoderFromData const):
760         (WebKit::ResourceLoadStatisticsMemoryStore::mergeWithDataFromDecoder):
761         (WebKit::ResourceLoadStatisticsMemoryStore::clear):
762         (WebKit::ResourceLoadStatisticsMemoryStore::wasAccessedAsFirstPartyDueToUserInteraction):
763         (WebKit::ResourceLoadStatisticsMemoryStore::mergeStatistics):
764         (WebKit::ResourceLoadStatisticsMemoryStore::shouldPartitionCookies):
765         (WebKit::ResourceLoadStatisticsMemoryStore::shouldBlockCookies):
766         (WebKit::ResourceLoadStatisticsMemoryStore::hasUserGrantedStorageAccessThroughPrompt):
767         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookiePartitioning):
768         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookiePartitioningForDomains):
769         (WebKit::ResourceLoadStatisticsMemoryStore::clearPartitioningStateForDomains):
770         (WebKit::ResourceLoadStatisticsMemoryStore::resetCookiePartitioningState):
771         (WebKit::ResourceLoadStatisticsMemoryStore::processStatistics const):
772         (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUnexpiredRecentUserInteraction const):
773         (WebKit::ResourceLoadStatisticsMemoryStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
774         (WebKit::ResourceLoadStatisticsMemoryStore::includeTodayAsOperatingDateIfNecessary):
775         (WebKit::ResourceLoadStatisticsMemoryStore::hasStatisticsExpired const):
776         (WebKit::ResourceLoadStatisticsMemoryStore::setMaxStatisticsEntries):
777         (WebKit::ResourceLoadStatisticsMemoryStore::setPruneEntriesDownTo):
778         (WebKit::ResourceLoadStatisticsMemoryStore::pruneStatisticsIfNeeded):
779         (WebKit::ResourceLoadStatisticsMemoryStore::resetParametersToDefaultValues):
780         (WebKit::ResourceLoadStatisticsMemoryStore::logTestingEvent):
781         (WebKit::ResourceLoadStatisticsMemoryStore::setLastSeen):
782         (WebKit::ResourceLoadStatisticsMemoryStore::setVeryPrevalentResource):
783         (WebKit::ResourceLoadStatisticsMemoryStore::removeAllStorageAccess):
784         * UIProcess/ResourceLoadStatisticsMemoryStore.h: Added.
785         (WebKit::ResourceLoadStatisticsMemoryStore::isEmpty const):
786         (WebKit::ResourceLoadStatisticsMemoryStore::setStorageAccessPromptsEnabled):
787         (WebKit::ResourceLoadStatisticsMemoryStore::setDebugLogggingEnabled):
788         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
789         (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
790         (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk):
791         (WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
792         (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
793         * UIProcess/ResourceLoadStatisticsPersistentStorage.h:
794         * UIProcess/WebResourceLoadStatisticsStore.cpp:
795         (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
796         (WebKit::WebResourceLoadStatisticsStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
797         (WebKit::WebResourceLoadStatisticsStore::setShouldSubmitTelemetry):
798         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
799         (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
800         (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
801         (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
802         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
803         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
804         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
805         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
806         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
807         (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
808         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
809         (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
810         (WebKit::WebResourceLoadStatisticsStore::submitTelemetry):
811         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
812         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
813         (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
814         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
815         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
816         (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
817         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
818         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
819         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
820         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
821         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
822         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
823         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
824         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
825         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
826         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
827         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
828         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
829         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
830         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
831         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
832         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
833         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
834         (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
835         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningStateReset):
836         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory):
837         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
838         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
839         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
840         (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
841         (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime):
842         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToPartitionOrBlockCookiesHandler):
843         (WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
844         (WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries):
845         (WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo):
846         (WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
847         (WebKit::WebResourceLoadStatisticsStore::logTestingEvent):
848         * UIProcess/WebResourceLoadStatisticsStore.h:
849         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
850         (WebKit::sortedPrevalentResourceTelemetry):
851         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
852         * UIProcess/WebResourceLoadStatisticsTelemetry.h:
853         * WebKit.xcodeproj/project.pbxproj:
854
855 2018-06-28  Michael Catanzaro  <mcatanzaro@igalia.com>
856
857         [GTK] ASSERTION FAILED: !HashTranslator::equal(KeyTraits::emptyValue(), key) when dragging file into webview
858         https://bugs.webkit.org/show_bug.cgi?id=175602
859
860         Reviewed by Carlos Garcia Campos.
861
862         We check using the GdkDragContext to ensure the DroppingContext is still alive (present in
863         m_droppingContexts), but access it via the pointer to the DroppingContext that could be
864         dangling. This happens on every drag. I can't actually reproduce the original assertion
865         since I'm currently working with an asan build, but I imagine it's probably the same issue
866         that I'm fixing here.
867
868         * UIProcess/gtk/DragAndDropHandler.cpp:
869         (WebKit::DragAndDropHandler::dragLeave):
870
871 2018-06-27  Timothy Hatcher  <timothy@apple.com>
872
873         Don't expose new semantic -apple-system color keywords on iOS.
874         https://bugs.webkit.org/show_bug.cgi?id=187080
875         rdar://problem/41505699
876
877         Reviewed by Tim Horton.
878
879         * DerivedSources.make: Use gnu++14, since gnu++17 is giving errors on macOS 10.12.
880
881 2018-06-27  Megan Gardner  <megan_gardner@apple.com>
882
883         Fix IBeam issues with iPad apps on Mac
884         https://bugs.webkit.org/show_bug.cgi?id=186900
885
886         Reviewed by Wenson Hsieh.
887
888         * Shared/ios/InteractionInformationAtPosition.h:
889         * Shared/ios/InteractionInformationAtPosition.mm:
890         (WebKit::InteractionInformationAtPosition::encode const):
891         (WebKit::InteractionInformationAtPosition::decode):
892
893         Add functionality to determine what a caret rect should be, but as it is
894         expensive, it should only be done for this platform.
895         
896         * Shared/ios/InteractionInformationRequest.cpp:
897         (WebKit::InteractionInformationRequest::isApproximateForRequest):
898         * Shared/ios/InteractionInformationRequest.h:
899
900         As there is no way to premptively request information on hover, we need to use 
901         the last cached information, but only if it is close to the point we are about
902         to request information for. So having a way to determine if a point is very close
903         to a previous point is a good idea.
904
905         * UIProcess/ios/WKContentViewInteraction.mm:
906         (-[WKContentView _currentPositionInformationIsApproximateForRequest:]):
907         (-[WKContentView closestPositionToPoint:]):
908
909         UIKit is using this function to determine if we should show an Ibeam or not.
910         So we need to implement it, at least for this platform. 
911
912         * WebProcess/WebPage/ios/WebPageIOS.mm:
913         (WebKit::WebPage::getPositionInformation):
914
915         Pass up the calculated caret rect, but only for iPad apps on Mac.
916
917 2018-06-27  Yusuke Suzuki  <utatane.tea@gmail.com>
918
919         [GTK][WPE] Use LazyNeverDestroyed<XErrorTrapper> to remove static initializers
920         https://bugs.webkit.org/show_bug.cgi?id=187089
921
922         Reviewed by Michael Catanzaro.
923
924         Use LazyNeverDestroyed<XErrorTrapper> instead of global std::unique_ptr<XErrorTrapper>.
925         Since this variable's exit time destructor is not important in this code, using
926         LazyNeverDestroyed<XErrorTrapper> is fine. This removes the last static initializer
927         of libwebkit2gtk.so.
928
929         * PluginProcess/unix/PluginProcessMainUnix.cpp:
930
931 2018-06-27  Youenn Fablet  <youenn@apple.com>
932
933         Add a sandbox profile for some additional bank plugins
934         https://bugs.webkit.org/show_bug.cgi?id=187105
935
936         Reviewed by Brent Fulgham.
937
938         * Resources/PlugInSandboxProfiles/cfca.com.npCryptoKit.CGB.MAC.sb: Added.
939         * Resources/PlugInSandboxProfiles/cfca.com.npP11CertEnroll.MAC.CGB.sb: Added.
940         * Resources/PlugInSandboxProfiles/com.apple.BocomSubmitCtrl.sb: Added.
941         * Resources/PlugInSandboxProfiles/com.apple.NPSafeInput.sb: Added.
942         * Resources/PlugInSandboxProfiles/com.apple.NPSafeSubmit.sb: Added.
943         * Resources/PlugInSandboxProfiles/com.cfca.npSecEditCtl.MAC.BOC.plugin.sb: Added.
944         * Resources/PlugInSandboxProfiles/com.cmbchina.CMBSecurity.sb: Added.
945         * Resources/PlugInSandboxProfiles/com.ftsafe.NPAPI-Core-Safe-SoftKeybaord.plugin.rfc1034identifier.sb: Added.
946         * WebKit.xcodeproj/project.pbxproj:
947
948 2018-06-27  Youenn Fablet  <youenn@apple.com>
949
950         NetworkLoadChecker should not need to hard ref NetworkConnectionToWebProcess
951         https://bugs.webkit.org/show_bug.cgi?id=186551
952
953         Reviewed by Daniel Bates.
954
955         Removed the need for NetworkLoadChecker to reference a NetworkConnectionToWebProcess.
956         Instead a CSP client is given to NetworkLoadChecker when needed.
957
958         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
959         (WebKit::NetworkConnectionToWebProcess::loadPing):
960         * NetworkProcess/NetworkLoadChecker.cpp:
961         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
962         (WebKit::NetworkLoadChecker::check):
963         (WebKit::NetworkLoadChecker::checkRedirection):
964         (WebKit::NetworkLoadChecker::checkRequest):
965         (WebKit::NetworkLoadChecker::contentSecurityPolicy):
966         (WebKit::NetworkLoadChecker::addConsoleMessage): Deleted.
967         (WebKit::NetworkLoadChecker::sendCSPViolationReport): Deleted.
968         (WebKit::NetworkLoadChecker::enqueueSecurityPolicyViolationEvent): Deleted.
969         * NetworkProcess/NetworkLoadChecker.h:
970         * NetworkProcess/NetworkResourceLoader.cpp:
971         (WebKit::NetworkResourceLoader::start):
972         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
973         * NetworkProcess/PingLoad.cpp:
974         (WebKit::PingLoad::PingLoad):
975         (WebKit::PingLoad::willPerformHTTPRedirection):
976         * NetworkProcess/PingLoad.h:
977
978 2018-06-27  Stephan Szabo  <stephan.szabo@sony.com>
979
980         [Wincairo] Add support for context menus to non-legacy minibrowser
981         https://bugs.webkit.org/show_bug.cgi?id=186815.
982
983         Reviewed by Ryosuke Niwa.
984
985         * UIProcess/WebPageProxy.h:
986         * UIProcess/win/PageClientImpl.cpp:
987         (WebKit::PageClientImpl::viewWidget):
988         * UIProcess/win/PageClientImpl.h:
989         * UIProcess/win/WebContextMenuProxyWin.cpp:
990         (WebKit::WebContextMenuProxyWin::show):
991         (WebKit::createMenu):
992         (WebKit::createMenuItem):
993         (WebKit::populate):
994         (WebKit::WebContextMenuProxyWin::showContextMenuWithItems):
995         (WebKit::WebContextMenuProxyWin::WebContextMenuProxyWin):
996         (WebKit::WebContextMenuProxyWin::~WebContextMenuProxyWin):
997         * UIProcess/win/WebContextMenuProxyWin.h:
998         * UIProcess/win/WebPageProxyWin.cpp:
999         (WebKit::WebPageProxy::viewWidget):
1000         * UIProcess/win/WebView.cpp:
1001         (WebKit::WebView::wndProc):
1002         (WebKit::WebView::onMenuCommand):
1003         * UIProcess/win/WebView.h:
1004
1005 2018-06-27  Youenn Fablet  <youenn@apple.com>
1006
1007         Disable content blockers in NetworkLoadChecker except for ping loads
1008         https://bugs.webkit.org/show_bug.cgi?id=187083
1009         <rdar://problem/41440083>
1010
1011         Reviewed by Chris Dumez.
1012
1013         * NetworkProcess/NetworkLoadChecker.cpp:
1014         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
1015         * NetworkProcess/NetworkLoadChecker.h:
1016         (WebKit::NetworkLoadChecker::enableContentExtensionsCheck):
1017         * NetworkProcess/PingLoad.cpp:
1018
1019 2018-06-27  Simon Fraser  <simon.fraser@apple.com>
1020
1021         https://hackernoon.com/ uses lots of layer backing store
1022         https://bugs.webkit.org/show_bug.cgi?id=186909
1023         rdar://problem/40257540
1024
1025         Reviewed by Tim Horton.
1026         
1027         PlatformCALayerRemote was actually holding onto backing stores for layers with
1028         backing store detached, which could increase memory use. When told that backing stores
1029         are not attached, explicitly throw away the backing, and re-create it (via setNeedsDisplay)
1030         when attached. This is now similar to what PlatformLayerCACocoa does.
1031
1032         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
1033         (WebKit::PlatformCALayerRemote::setNeedsDisplayInRect):
1034         (WebKit::PlatformCALayerRemote::setNeedsDisplay):
1035         (WebKit::PlatformCALayerRemote::hasContents const):
1036         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
1037
1038 2018-06-27  Jonathan Bedard  <jbedard@apple.com>
1039
1040         Enable WebKit iOS 12 build
1041         https://bugs.webkit.org/show_bug.cgi?id=187024
1042         <rdar://problem/39759057>
1043
1044         Reviewed by David Kilzer.
1045
1046         * Platform/spi/ios/PDFKitSPI.h: Added PDFKit SPI.
1047         * Platform/spi/ios/UIKitSPI.h: Add new UIKit SPI and UICompositingMode enumeration.
1048         * UIProcess/ios/WKPDFView.mm: Use PDFKitSPI header.
1049         * UIProcess/ios/WKSystemPreviewView.mm: Use CoreGraphicsSPI.h.
1050         * UIProcess/ios/fullscreen/WKFullscreenStackView.mm: Use QuartzCoreSPI.h.
1051
1052 2018-06-27  Timothy Horton  <timothy_horton@apple.com>
1053
1054         CSS Animation Triggers is not an experimental feature, should be globally off by default
1055
1056         Reviewed by Dean Jackson.
1057
1058         * Shared/WebPreferences.yaml:
1059
1060 2018-06-27  Timothy Horton  <timothy_horton@apple.com>
1061
1062         Promote the Secure Context API feature from experimental-yet-on-by-default to always-on
1063
1064         Reviewed by Dan Bates.
1065
1066         * Shared/WebPreferences.yaml:
1067         Secure Context API is on by default, it's not experimental anymore.
1068
1069 2018-06-27  Timothy Horton  <timothy_horton@apple.com>
1070
1071         Make Link Preload an on-by-default feature
1072         https://bugs.webkit.org/show_bug.cgi?id=187104
1073
1074         Reviewed by Ryosuke Niwa.
1075
1076         * Shared/WebPreferences.yaml:
1077         This should be on, not experimental. It already shipped on in the past.
1078
1079 2018-06-27  Chris Dumez  <cdumez@apple.com>
1080
1081         Regression(r233208): Completion handler does not get called on GTK port
1082         https://bugs.webkit.org/show_bug.cgi?id=187099
1083
1084         Reviewed by Antti Koivisto.
1085
1086         Make sure UpdatePrevalentDomainsToPartitionOrBlockCookiesHandler's completion handler
1087         gets called on non-COCOA ports.
1088
1089         * UIProcess/WebResourceLoadStatisticsStore.h:
1090
1091 2018-06-27  Tim Horton  <timothy_horton@apple.com>
1092
1093         When trying to print a very long email on iOS, the print preview is blank
1094         https://bugs.webkit.org/show_bug.cgi?id=187077
1095         <rdar://problem/41107013>
1096
1097         Reviewed by Timothy Hatcher.
1098
1099         * UIProcess/ios/WebPageProxyIOS.mm:
1100         (WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF):
1101         ChildProcessProxy::sendSync has a (surprising) default timeout of 1 second,
1102         (as opposed to Connection::sendSync's default timeout of ∞ seconds).
1103         The printing path already waits ∞ seconds for the final PDF, but currently
1104         uses the default 1 second timeout for page count computation. If page
1105         count computation takes more than 1 second, the preview will be blank.
1106         Since the print preview is generated asynchronously, we really want
1107         to wait until it's done, and not give up after 1 second.
1108
1109 2018-06-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1110
1111         [iPad apps on macOS] Unable to interact with video elements that have started playing
1112         https://bugs.webkit.org/show_bug.cgi?id=187073
1113         <rdar://problem/40591107>
1114
1115         Reviewed by Tim Horton.
1116
1117         On iOS, we currently force remote hosting contexts to be non-interactive by passing in `kCAContextIgnoresHitTest`
1118         when creating the CAContext. However, this flag is not respected by CoreAnimation when running iOS apps on macOS.
1119         This means all HID events dispatched over a video that has been played (which causes WebKit to insert a
1120         CALayerHost-backed WKRemoteView in the view hierarchy) will be routed to the context ID of the video's CAContext
1121         rather than the context ID of the key window containing the WKWebView.
1122
1123         This subsequently causes all gesture recognizers (hover, touch, tap, long press) to fail recognition when
1124         running iOS apps on macOS. To address this, we set a flag on WKRemoteView's CALayerHost to prevent hit-testing
1125         to the remote layer. This allows us to avoid routing HID events to the wrong context, and instead target the
1126         main UIWindow.
1127
1128         Manually verified that click, touch, and mouseenter/mouseleave events are dispatched when interacting over a
1129         video element.
1130
1131         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
1132         (-[WKRemoteView initWithFrame:contextID:]):
1133
1134 2018-06-26  Commit Queue  <commit-queue@webkit.org>
1135
1136         Unreviewed, rolling out r233232.
1137         https://bugs.webkit.org/show_bug.cgi?id=187081
1138
1139         "This is breaking launching some plugins" (Requested by youenn
1140         on #webkit).
1141
1142         Reverted changeset:
1143
1144         "Remove quarantine for Webex plugin"
1145         https://bugs.webkit.org/show_bug.cgi?id=187050
1146         https://trac.webkit.org/changeset/233232
1147
1148 2018-06-26  Timothy Horton  <timothy_horton@apple.com>
1149
1150         Rearrange some WebPreferences; move two experimental prefs into the experimental section
1151
1152         * Shared/WebPreferences.yaml:
1153
1154 2018-06-26  Chris Dumez  <cdumez@apple.com>
1155
1156         Deal better with the network process crashing on startup
1157         https://bugs.webkit.org/show_bug.cgi?id=187065
1158         <rdar://problem/41451622>
1159
1160         Reviewed by Geoffrey Garen.
1161
1162         When a network process crashes on startup, we would not attempt to relaunch it. If there were web
1163         processes waiting for a connection to this network process, we would send them an invalid connection
1164         identifier which would cause them to forcefully crash.
1165
1166         Instead, we now apply the same policy whether a network process crashes on startup or later:
1167         - We attempt to relaunch the network process
1168         - If there were pending connections from WebContent processes, we ask the new Network process instead.
1169
1170         As a result, WebContent processes no longer crash in this case. Instead, they wait for a valid
1171         connection to the network process.
1172
1173         * UIProcess/API/Cocoa/WKProcessPool.mm:
1174         (-[WKProcessPool _makeNextNetworkProcessLaunchFailForTesting]):
1175         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1176         * UIProcess/Network/NetworkProcessProxy.cpp:
1177         (WebKit::NetworkProcessProxy::getLaunchOptions):
1178         (WebKit::NetworkProcessProxy::didFinishLaunching):
1179         * UIProcess/Network/NetworkProcessProxy.h:
1180         * UIProcess/WebProcessPool.cpp:
1181         (WebKit::WebProcessPool::networkProcessCrashed):
1182         * UIProcess/WebProcessPool.h:
1183
1184 2018-06-26  Daniel Bates  <dabates@apple.com>
1185
1186         REGRESSION (r231479): Unable to buy Odeon cinema tickets in STP (bogus 'X-Frame-Options' to 'SAMEORIGIN')
1187         https://bugs.webkit.org/show_bug.cgi?id=186090
1188         <rdar://problem/40692595>
1189
1190         Reviewed by Andy Estes.
1191
1192         Fixes an issue where a page P delivered with "X-Frame-Options: SAMEORIGIN" loaded in a sub-
1193         frame would be blocked if we were redirected to it in response to the cross-origin POST
1194         request regardless of whether P is same-origin with its parent document.
1195
1196         * NetworkProcess/NetworkResourceLoader.cpp:
1197         (WebKit::NetworkResourceLoader::shouldInterruptLoadForXFrameOptions): Compare the origin
1198         of the top frame's document as opposed to the source origin. The latter represents the
1199         origin of the document that initiated the navigation, which can be cross-origin, and
1200         should not be considered when applying "X-Frame-Options: SAMEORIGIN". This check exists
1201         as a performance optimization to avoid traversing over all frame ancestors only to find
1202         out that the innermost frame (the one that made this request) is cross-origin with the
1203         top-most frame.
1204         * NetworkProcess/NetworkResourceLoader.h:
1205         * WebProcess/Network/WebLoaderStrategy.cpp:
1206         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): Exclude the origin of the
1207         frame that is making the load request from the list of ancestor origins. This makes the
1208         X-Frame-Options algorithm in WebKit2 match the logic we do in FrameLoader::shouldInterruptLoadForXFrameOptions().
1209
1210 2018-06-26  Youenn Fablet  <youenn@apple.com>
1211
1212         Remove quarantine for Webex plugin
1213         https://bugs.webkit.org/show_bug.cgi?id=187050
1214         rdar://problem/41478189
1215
1216         Reviewed by Brent Fulgham.
1217
1218         Update the Plugin Info.plist to not do quarantine of downloaded files by default.
1219         Update PluginProcess implementation to reenable quarantine for all plug-ins except cisco webex plug-in.
1220
1221         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
1222         * PluginProcess/PluginProcess.h:
1223         * PluginProcess/mac/PluginProcessMac.mm:
1224         (WebKit::PluginProcess::shouldOverrideQuarantine):
1225         * Shared/ChildProcess.h:
1226         (WebKit::ChildProcess::shouldOverrideQuarantine):
1227         * Shared/mac/ChildProcessMac.mm:
1228         (WebKit::ChildProcess::initializeSandbox):
1229
1230 2018-06-26  Jeremy Jones  <jeremyj@apple.com>
1231
1232         Ensure element fullscreen animation is always visible.
1233         https://bugs.webkit.org/show_bug.cgi?id=187068
1234         rdar://problem/36187369
1235
1236         Reviewed by Eric Carlson.
1237
1238         The fullscreen animation is important for communicating to users that they are no longer in inline mode.
1239         If fullscreen animation's inline rect is not visible, animate from a point in the middle of the screen.
1240
1241         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
1242         (WebKit::safeInlineRect):
1243         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
1244         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
1245
1246 2018-06-26  Youenn Fablet  <youenn@apple.com>
1247
1248         Add a sandbox profile for com.google.o1dbrowserplugin plugin
1249         https://bugs.webkit.org/show_bug.cgi?id=187067
1250
1251         Reviewed by Brent Fulgham.
1252
1253         * Resources/PlugInSandboxProfiles/com.google.o1dbrowserplugin.sb: Added.
1254         * WebKit.xcodeproj/project.pbxproj:
1255
1256 2018-06-26  Tim Horton  <timothy_horton@apple.com>
1257
1258         Promote two more experimental features to traditional features
1259         https://bugs.webkit.org/show_bug.cgi?id=187063
1260
1261         Reviewed by Dean Jackson.
1262
1263         * Shared/WebPreferences.yaml:
1264         Promote some shipped/default-on features to non-experimental.
1265
1266 2018-06-26  Jiewen Tan  <jiewen_tan@apple.com>
1267
1268         Rollout macOS sandbox change in r232276
1269         https://bugs.webkit.org/show_bug.cgi?id=186904
1270         <rdar://problem/41350969>
1271
1272         Reviewed by Brent Fulgham.
1273
1274         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1275
1276 2018-06-26  Aditya Keerthi  <akeerthi@apple.com>
1277
1278         Tap highlight displayed when tapping a field that is already focussed
1279         https://bugs.webkit.org/show_bug.cgi?id=187004
1280         <rdar://problem/41428008>
1281         Reviewed by Tim Horton.
1282
1283         In the case where fast-clicking is enabled, _singleTapCommited: could be invoked
1284         before the tap highlight request, causing _potentialTapInProgress to be set to NO.
1285         This results in the early return for preventing multiple tap highlights on an
1286         assisted node to be skipped. Since a tap highlight should never be shown for an
1287         input field that is already focussed, _potentialTapInProgress can be removed from
1288         the early return condition.
1289
1290         * UIProcess/ios/WKContentViewInteraction.mm:
1291         (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):
1292
1293 2018-06-26  Timothy Horton  <timothy_horton@apple.com>
1294
1295         Rearrange some WebPreferences; move two non-experimental prefs out of the experimental section
1296
1297         * Shared/WebPreferences.yaml:
1298
1299 2018-06-26  Tim Horton  <timothy_horton@apple.com>
1300
1301         Promote some experimental features to traditional features
1302         https://bugs.webkit.org/show_bug.cgi?id=187047
1303
1304         Reviewed by Simon Fraser.
1305
1306         * Shared/WebPreferences.yaml:
1307         Reindent.
1308         Promote some shipped/default-on features to non-experimental.
1309
1310 2018-06-26  Eric Carlson  <eric.carlson@apple.com>
1311
1312         [Mac] AirPlay picker uses incorrect theme in Dark mode
1313         https://bugs.webkit.org/show_bug.cgi?id=187054
1314         <rdar://problem/41291093>
1315
1316         Reviewed by Timothy Hatcher.
1317
1318         * UIProcess/WebPageProxy.cpp:
1319         (WebKit::WebPageProxy::showPlaybackTargetPicker): Pass m_defaultAppearance.
1320
1321 2018-06-26  Chris Dumez  <cdumez@apple.com>
1322
1323         Resource Load Statistics: Make WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains() wait for the network process before calling its callback
1324         https://bugs.webkit.org/show_bug.cgi?id=186903
1325         <rdar://problem/41350182>
1326
1327         Reviewed by Brady Eidson.
1328
1329         Follow-up fix after r233180 to address an API test crash. We need to keep the
1330         NetworkProcessProxy alive during the async updatePrevalentDomainsToPartitionOrBlockCookies
1331         request to make sure it completes.
1332
1333         * UIProcess/Network/NetworkProcessProxy.cpp:
1334         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToPartitionOrBlockCookies):
1335
1336 2018-06-26  Brent Fulgham  <bfulgham@apple.com>
1337
1338         Provide a way for Injected Bundles to indicate classes approved for NSSecureCoding
1339         https://bugs.webkit.org/show_bug.cgi?id=186788
1340         <rdar://problem/41094167>
1341
1342         Reviewed by Chris Dumez.
1343
1344         InjectedBundles support a mechanism to serialize data between the UIProcess and the
1345         WebContent process hosting the bundle. In some cases, we want to be able to serialize
1346         a custom data object that is not part of WebKit's native data types.
1347
1348         After switching to strict NSSecureCoding, WebKit clients attempting to serialize these
1349         custom objects trigger a failure.
1350
1351         This patch makes it possible for the InjectedBundle author to specify one (or more) data
1352         classes that are allowed to be serialized between the two processes.
1353         
1354         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1355         (WKBundleExtendClassesForParameterCoder): Added.
1356         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1357         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
1358         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
1359         (createWKArray): Added.
1360         (-[WKWebProcessPlugInController extendClassesForParameterCoder:]): Added.
1361         * WebProcess/InjectedBundle/InjectedBundle.h:
1362         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
1363         (WebKit::InjectedBundle::extendClassesForParameterCoder): Added.
1364         (WebKit::InjectedBundle::classesForCoder): New helper function.
1365         (WebKit::InjectedBundle::setBundleParameter): Modified to use the new set of valid
1366         classes for NSSecureCoding.
1367
1368 2018-06-26  Eric Carlson  <eric.carlson@apple.com>
1369
1370         Enable mock capture devices on the iOS simulator
1371         https://bugs.webkit.org/show_bug.cgi?id=186846
1372         <rdar://problem/41289134>
1373
1374         Reviewed by Youenn Fablet.
1375
1376         * Shared/WebPreferences.yaml: Use DEFAULT_MOCK_CAPTURE_DEVICES_ENABLED.
1377         * Shared/WebPreferencesDefaultValues.h: Define DEFAULT_MOCK_CAPTURE_DEVICES_ENABLED, set to
1378         true in the iOS simulator only.
1379
1380 2018-06-26  Fujii Hironori  <Hironori.Fujii@sony.com>
1381
1382         [Win] 'deref': is not a member of 'WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains::<lambda_9d761a6dc12d95db7fa2d6f3f5aa26fa>'
1383         https://bugs.webkit.org/show_bug.cgi?id=187035
1384
1385         Unreviewed build fix.
1386
1387         MSVC can't compile the code using `this` in a generalized lambda
1388         capture in another lambda.
1389
1390         In this case, there is no need to copy `protectedThis` for the
1391         inner lambda. Move `protectedThis` of the outer lambda to the
1392         inner as well as `completionHandler`.
1393
1394         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1395         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
1396         Moved `protectedThis` from the outer lambda to the inner.
1397         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
1398         Ditto.
1399
1400 2018-06-26  Miguel Gomez  <magomez@igalia.com>
1401
1402         [GTK] Many webpages can crash the browser in WebCore::CoordinatedGraphicsLayer::transformedVisibleRect
1403         https://bugs.webkit.org/show_bug.cgi?id=179304
1404
1405         Reviewed by Michael Catanzaro.
1406
1407         Add a way to attach to the CompositingCoordinator layers that were not created by it.
1408
1409         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1410         (WebKit::CompositingCoordinator::attachLayer):
1411         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1412
1413 2018-06-25  Tim Horton  <timothy_horton@apple.com>
1414
1415         WKThumbnailView fallback background is blindingly bright in Dark Mode
1416         https://bugs.webkit.org/show_bug.cgi?id=187017
1417         <rdar://problem/41036209>
1418
1419         Reviewed by Simon Fraser.
1420
1421         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
1422         (-[_WKThumbnailView initWithFrame:]):
1423         (-[_WKThumbnailView wantsUpdateLayer]):
1424         (-[_WKThumbnailView updateLayer]):
1425         Use a semantic color for the WKThumbnailView background color
1426         instead of flat white.
1427
1428 2018-06-25  John Wilander  <wilander@apple.com>
1429
1430         Resource Load Statistics: Make WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains() wait for the network process before calling its callback
1431         https://bugs.webkit.org/show_bug.cgi?id=186903
1432         <rdar://problem/41350182>
1433
1434         Reviewed by Chris Dumez.
1435
1436         This patch stores the callback sent to
1437         WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains(),
1438         sets up a context ID, and sends that ID to the network process when
1439         asking it to update cookie partitioning and blocking. The network
1440         process then tells the UI process when it's done, at which point the
1441         callback is called.
1442
1443         This change is meant to address layout test flakiness.
1444
1445         * NetworkProcess/NetworkProcess.cpp:
1446         (WebKit::NetworkProcess::updatePrevalentDomainsToPartitionOrBlockCookies):
1447         * NetworkProcess/NetworkProcess.h:
1448         * NetworkProcess/NetworkProcess.messages.in:
1449         * UIProcess/Network/NetworkProcessProxy.cpp:
1450         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToPartitionOrBlockCookies):
1451         (WebKit::NetworkProcessProxy::didUpdatePartitionOrBlockCookies):
1452         * UIProcess/Network/NetworkProcessProxy.h:
1453         * UIProcess/Network/NetworkProcessProxy.messages.in:
1454         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1455         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
1456         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
1457         * UIProcess/WebResourceLoadStatisticsStore.h:
1458         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1459         (WebKit::WebsiteDataStore::updatePrevalentDomainsToPartitionOrBlockCookies):
1460         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
1461         * UIProcess/WebsiteData/WebsiteDataStore.h:
1462
1463 2018-06-25  Brent Fulgham  <bfulgham@apple.com>
1464
1465         Allow access to APTDevice in iOS WebContent process
1466         https://bugs.webkit.org/show_bug.cgi?id=187021
1467         <rdar://problem/41339769>
1468
1469         Reviewed by Youenn Fablet.
1470
1471         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1472
1473 2018-06-25  Keith Rollin  <krollin@apple.com>
1474         Unreviewed, rolling out r233087.
1475
1476         Causes 5% Mac PLT regression.
1477
1478         Reverted changeset:
1479
1480         "Recalc styles every time defaultAppearance changes."
1481         https://bugs.webkit.org/show_bug.cgi?id=186866
1482         https://trac.webkit.org/changeset/233087
1483
1484 2018-06-25  Youenn Fablet  <youenn@apple.com>
1485
1486         Add a sandbox profile to Hangout plug-in
1487         https://bugs.webkit.org/show_bug.cgi?id=187005
1488         <rdar://problem/41428391>
1489
1490         Reviewed by Brent Fulgham.
1491
1492         Add a sandbox profile so that this plug-in can be run when UIProcess is sandboxed.
1493
1494         * Resources/PlugInSandboxProfiles/com.google.googletalkbrowserplugin.sb: Added.
1495         * WebKit.xcodeproj/project.pbxproj:
1496
1497 2018-06-25  Youenn Fablet  <youenn@apple.com>
1498
1499         NetworkLoadChecker should not check CORS for 304 responses triggered by WebProcess revalidation
1500         https://bugs.webkit.org/show_bug.cgi?id=186939
1501         <rdar://problem/40941725>
1502
1503         Reviewed by Chris Dumez.
1504
1505         * NetworkProcess/NetworkLoadChecker.cpp:
1506         (WebKit::NetworkLoadChecker::validateResponse):
1507
1508 2018-06-25  Keith Rollin  <krollin@apple.com>
1509
1510         Adjust UNEXPORTED_SYMBOL_LDFLAGS for LTO
1511         https://bugs.webkit.org/show_bug.cgi?id=186949
1512         <rdar://problem/41386438>
1513
1514         Reviewed by David Kilzer.
1515
1516         When building with LTO, WebKit's
1517         'check-for-weak-vtables-and-externals' script reports weak external
1518         symbols:
1519
1520         ERROR: WebKit has a weak external symbol in it (.../OpenSource/WebKitBuild/Release/WebKit.framework/Versions/A/WebKit)
1521         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.
1522         ERROR: A common cause of weak external symbols is when an inline function is listed in the linker export file.
1523         ERROR: symbol __ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_13basic_istreamIcS2_EE
1524         ERROR: symbol __ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE0_NS_14basic_iostreamIcS2_EE
1525         ERROR: symbol __ZTCNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE16_NS_13basic_ostreamIcS2_EE
1526         ERROR: symbol __ZTTNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
1527         ERROR: symbol __ZTVNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE
1528         ERROR: symbol __ZTVNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
1529         Command /bin/sh failed with exit code 1
1530
1531         Address these by adding those symbols to UNEXPORTED_SYMBOL_LDFLAGS in
1532         WebKit.xcconfig.
1533
1534         * Configurations/WebKit.xcconfig:
1535
1536 2018-06-25  Chris Dumez  <cdumez@apple.com>
1537
1538         Make sure API::IconLoadingClient::getLoadDecisionForIcon()'s completion handler gets called
1539         https://bugs.webkit.org/show_bug.cgi?id=187007
1540         <rdar://problem/41293989>
1541
1542         Reviewed by Brady Eidson.
1543
1544         Make sure API::IconLoadingClient::getLoadDecisionForIcon()'s completion handler gets called by
1545         switching its type to WTF::CompletionHandler instead of WTF::Function. This also has the benefit
1546         of destroying our captured objects when the completion handler gets called by the client on the
1547         main thread instead of whatever thread the ObjC block gets released on.
1548
1549         * UIProcess/API/APIIconLoadingClient.h:
1550         (API::IconLoadingClient::getLoadDecisionForIcon):
1551         * UIProcess/API/glib/WebKitIconLoadingClient.cpp:
1552         * UIProcess/API/mac/WKView.mm:
1553         (-[WKView maybeInstallIconLoadingClient]):
1554         * UIProcess/Cocoa/IconLoadingDelegate.h:
1555         * UIProcess/Cocoa/IconLoadingDelegate.mm:
1556         (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):
1557
1558 2018-06-25  Youenn Fablet  <youenn@apple.com>
1559
1560         Add API to control mock media devices
1561         https://bugs.webkit.org/show_bug.cgi?id=186958
1562
1563         Reviewed by Eric Carlson.
1564
1565         Add API to clear, set, remove and reset mock media devices.
1566         The mock media center of UIProcess and all WebProcesses are updated.
1567
1568         * CMakeLists.txt:
1569         * UIProcess/API/C/WKMockMediaDevice.cpp: Added.
1570         (typeFromString):
1571         (WKAddMockMediaDevice):
1572         (WKClearMockMediaDevices):
1573         (WKRemoveMockMediaDevice):
1574         (WKResetMockMediaDevices):
1575         * UIProcess/API/C/WKMockMediaDevice.h: Added.
1576         * UIProcess/WebProcessPool.cpp:
1577         (WebKit::WebProcessPool::addMockMediaDevice):
1578         (WebKit::WebProcessPool::clearMockMediaDevices):
1579         (WebKit::WebProcessPool::removeMockMediaDevice):
1580         (WebKit::WebProcessPool::resetMockMediaDevices):
1581         * UIProcess/WebProcessPool.h:
1582         * WebKit.xcodeproj/project.pbxproj:
1583         * WebProcess/WebProcess.cpp:
1584         (WebKit::WebProcess::addMockMediaDevice):
1585         (WebKit::WebProcess::clearMockMediaDevices):
1586         (WebKit::WebProcess::removeMockMediaDevice):
1587         (WebKit::WebProcess::resetMockMediaDevices):
1588         * WebProcess/WebProcess.h:
1589         * WebProcess/WebProcess.messages.in:
1590
1591 2018-06-25  Wenson Hsieh  <wenson_hsieh@apple.com>
1592
1593         [iPad apps on macOS] Click events are broken in WKWebView
1594         https://bugs.webkit.org/show_bug.cgi?id=186964
1595         <rdar://problem/41369145>
1596
1597         Reviewed by Tim Horton.
1598
1599         Tapping in WKWebView currently does not dispatch click events to the page. This is because the long press loupe
1600         gesture (in the text interaction assistant) has a delay of 0 when running iOS apps on macOS, but on iOS, it's
1601         0.5. The zero delay on macOS means that the loupe gesture will be recognized before the synthetic click gesture;
1602         this, in turn, causes the synthetic click gesture to be excluded by the loupe gesture. To address this, we
1603         simply allow the click and loupe gesture to recognize simultaneously.
1604
1605         Additionally, a new hover gesture was added recently to handle macOS cursor types when hovering over selectable
1606         text. This patch also allows other gestures to recognize alongside hover gestures, which matches macOS behavior.
1607
1608         We don't have the capacity to write automated tests for this yet; I manually tested text selection, editing in
1609         some text form controls, as well as clicking on links, buttons, and other elements with click event handlers.
1610
1611         * UIProcess/ios/WKContentViewInteraction.mm:
1612         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
1613
1614 2018-06-23  Brian Burg  <bburg@apple.com>
1615
1616         [Mac] Web Automation: include correct key code with synthesized NSEvents used for keystrokes
1617         https://bugs.webkit.org/show_bug.cgi?id=186937
1618
1619         Reviewed by Timothy Hatcher.
1620
1621         In some cases, a missing keyCode for an ASCII letter/number can cause synthesized
1622         NSEvents to not be converted into a key equivalent action like copy: or paste:.
1623
1624         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
1625         Drive by, always initialize keyCode.
1626
1627         (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
1628         (WebKit::keyCodeForCharKey): Compute the keyCode as defined by HLTB headers.
1629         This only needs to be computed for characters with physical keys, excluding the
1630         number pad and some traditional virtual keys that do not usually have glyphs.
1631
1632 2018-06-24  Michael Catanzaro  <mcatanzaro@igalia.com>
1633
1634         Unreviewed, fix GTK debug build after r233131
1635         https://bugs.webkit.org/show_bug.cgi?id=186899
1636         <rdar://problem/38222248>
1637
1638         This assertion was intended to be removed.
1639
1640         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
1641         (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
1642
1643 2018-06-21  Brian Burg  <bburg@apple.com>
1644
1645         Web Automation: key actions should support multiple pressed virtual keys
1646         https://bugs.webkit.org/show_bug.cgi?id=186899
1647         <rdar://problem/38222248>
1648
1649         Reviewed by Timothy Hatcher.
1650
1651         This patch changes the protocol to allow multiple virtual keys per input source state.
1652         Chords like Cmd-Shift-A and Shift-F12 must be represented this way as they are encoded
1653         in the VirtualKey enum rather than as an ASCII char.
1654
1655         * UIProcess/Automation/Automation.json:
1656         * UIProcess/Automation/SimulatedInputDispatcher.h:
1657         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
1658         (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
1659         * UIProcess/Automation/WebAutomationSession.cpp:
1660         (WebKit::WebAutomationSession::simulateKeyboardInteraction):
1661         (WebKit::WebAutomationSession::performKeyboardInteractions):
1662         (WebKit::WebAutomationSession::performInteractionSequence):
1663
1664         * UIProcess/Automation/WebAutomationSession.h:
1665         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
1666         (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
1667         * UIProcess/Automation/ios/WebAutomationSessionIOS.mm:
1668         (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
1669         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
1670         (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction):
1671         Also clean up the signature of WebAutomationSession::platformSimulateKeyboardInteraction
1672         to use a variant instead of mutually exclusive optional values with different types.
1673
1674 2018-06-23  Yusuke Suzuki  <utatane.tea@gmail.com>
1675
1676         [WTF] Add user-defined literal for ASCIILiteral
1677         https://bugs.webkit.org/show_bug.cgi?id=186839
1678
1679         Reviewed by Darin Adler.
1680
1681         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
1682         (WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection):
1683         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
1684         (WebKit::NetworkCORSPreflightChecker::wasBlocked):
1685         (WebKit::NetworkCORSPreflightChecker::cannotShowURL):
1686         * NetworkProcess/NetworkDataTaskBlob.cpp:
1687         (WebKit::NetworkDataTaskBlob::suggestedFilename const):
1688         * NetworkProcess/NetworkLoadChecker.cpp:
1689         (WebKit::NetworkLoadChecker::checkRedirection):
1690         (WebKit::NetworkLoadChecker::checkRequest):
1691         * NetworkProcess/NetworkResourceLoader.cpp:
1692         (WebKit::NetworkResourceLoader::continueWillSendRequest):
1693         * NetworkProcess/PingLoad.cpp:
1694         (WebKit::PingLoad::willPerformHTTPRedirection):
1695         (WebKit::PingLoad::didReceiveChallenge):
1696         (WebKit::PingLoad::timeoutTimerFired):
1697         * NetworkProcess/PreconnectTask.cpp:
1698         (WebKit::PreconnectTask::PreconnectTask):
1699         * NetworkProcess/cache/CacheStorageEngine.cpp:
1700         (WebKit::CacheStorage::Engine::initialize):
1701         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
1702         (WebKit::CacheStorage::Cache::toRecordInformation):
1703         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1704         (WebKit::CacheStorage::cachesListFilename):
1705         (WebKit::CacheStorage::cachesOriginFilename):
1706         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
1707         (WebKit::NetworkCache::Statistics::initialize):
1708         (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
1709         (WebKit::NetworkCache::Statistics::queryWasEverRequested):
1710         (WebKit::NetworkCache::Statistics::clear):
1711         (WebKit::NetworkCache::Statistics::addHashesToDatabase):
1712         (WebKit::NetworkCache::Statistics::addStoreDecisionsToDatabase):
1713         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
1714         (WebKit::XPCServiceInitializer):
1715         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
1716         (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
1717         * Shared/Plugins/Netscape/PluginInformation.cpp:
1718         (WebKit::pluginInformationBundleIdentifierKey):
1719         (WebKit::pluginInformationBundleVersionKey):
1720         (WebKit::pluginInformationBundleShortVersionKey):
1721         (WebKit::pluginInformationPathKey):
1722         (WebKit::pluginInformationDisplayNameKey):
1723         (WebKit::pluginInformationDefaultLoadPolicyKey):
1724         (WebKit::pluginInformationUpdatePastLastBlockedVersionIsKnownAvailableKey):
1725         (WebKit::pluginInformationHasSandboxProfileKey):
1726         (WebKit::pluginInformationFrameURLKey):
1727         (WebKit::pluginInformationMIMETypeKey):
1728         (WebKit::pluginInformationPageURLKey):
1729         (WebKit::pluginInformationPluginspageAttributeURLKey):
1730         (WebKit::pluginInformationPluginURLKey):
1731         (WebKit::plugInInformationReplacementObscuredKey):
1732         * Shared/ios/WebIOSEventFactory.mm:
1733         (WebIOSEventFactory::createWebKeyboardEvent):
1734         * Shared/linux/WebMemorySamplerLinux.cpp:
1735         (WebKit::WebMemorySampler::sampleWebKit const):
1736         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
1737         (debuggableTypeString):
1738         * UIProcess/API/glib/WebKitWebContext.cpp:
1739         (webkit_web_context_set_preferred_languages):
1740         * UIProcess/Automation/WebAutomationSession.cpp:
1741         (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):
1742         (WebKit::WebAutomationSession::addSingleCookie):
1743         (WebKit::WebAutomationSession::setSessionPermissions):
1744         (WebKit::WebAutomationSession::performMouseInteraction):
1745         (WebKit::WebAutomationSession::performKeyboardInteractions):
1746         (WebKit::WebAutomationSession::performInteractionSequence):
1747         * UIProcess/Automation/WebAutomationSession.h:
1748         * UIProcess/ChildProcessProxy.cpp:
1749         (WebKit::ChildProcessProxy::getLaunchOptions):
1750         * UIProcess/Cocoa/DownloadClient.mm:
1751         (WebKit::DownloadClient::didStart):
1752         * UIProcess/Cocoa/WebViewImpl.mm:
1753         (WebKit::selectorExceptionMap):
1754         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
1755         (WebKit::WebCredentialsMessengerProxy::makeCredential):
1756         (WebKit::WebCredentialsMessengerProxy::getAssertion):
1757         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
1758         (WebKit::PluginInfoStore::pluginsDirectories):
1759         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
1760         (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
1761         * UIProcess/ServiceWorkerProcessProxy.cpp:
1762         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
1763         (WebKit::ServiceWorkerProcessProxy::didReceiveAuthenticationChallenge):
1764         * UIProcess/UserMediaProcessManager.cpp:
1765         (WebKit::UserMediaProcessManager::willCreateMediaStream):
1766         (WebKit::UserMediaProcessManager::endedCaptureSession):
1767         * UIProcess/WebBackForwardList.cpp:
1768         (WebKit::WebBackForwardList::goToItem):
1769         * UIProcess/WebPageProxy.cpp:
1770         (WebKit::WebPageProxy::loadFile):
1771         (WebKit::WebPageProxy::loadHTMLString):
1772         (WebKit::WebPageProxy::loadPlainTextString):
1773         (WebKit::WebPageProxy::loadWebArchiveData):
1774         (WebKit::WebPageProxy::savePDFToFileInDownloadsFolder):
1775         * UIProcess/WebProcessProxy.cpp:
1776         (WebKit::WebProcessProxy::getLaunchOptions):
1777         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1778         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
1779         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
1780         (WebKit::notifyPages):
1781         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
1782         * UIProcess/ios/WKContentViewInteraction.mm:
1783         (-[WKContentView copyForWebView:]):
1784         (-[WKContentView cutForWebView:]):
1785         (-[WKContentView pasteForWebView:]):
1786         (-[WKContentView selectAllForWebView:]):
1787         (-[WKContentView deleteBackward]):
1788         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
1789         * UIProcess/ios/WKLegacyPDFView.mm:
1790         (-[WKLegacyPDFView _URLForLinkAnnotation:]):
1791         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1792         (WebKit::WebAutomationSessionProxy::elementForNodeHandle):
1793         (WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame):
1794         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
1795         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1796         (WebKit::WebIDBConnectionToServer::connectionToServerLost):
1797         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp:
1798         (webkit_dom_document_get_ready_state):
1799         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
1800         (WebKit::uniqueWorldName):
1801         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
1802         (WebKit::WebMediaKeyStorageManager::getMediaKeyOrigins):
1803         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1804         (WebKit::PDFPlugin::pluginInfo):
1805         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1806         (WebKit::ServiceWorkerClientFetch::validateResponse):
1807         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
1808         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
1809         (WebKit::WebContextMenuClient::searchWithGoogle):
1810         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
1811         (WebKit::WebInspectorClient::showPaintRect):
1812         * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
1813         (WebKit::RemoteWebInspectorUI::initialize):
1814         (WebKit::RemoteWebInspectorUI::didSave):
1815         (WebKit::RemoteWebInspectorUI::didAppend):
1816         (WebKit::RemoteWebInspectorUI::frontendLoaded):
1817         * WebProcess/WebPage/WebInspector.cpp:
1818         (WebKit::WebInspector::openInNewTab):
1819         * WebProcess/WebPage/WebInspectorUI.cpp:
1820         (WebKit::WebInspectorUI::setDockSide):
1821         (WebKit::WebInspectorUI::setDockingUnavailable):
1822         (WebKit::WebInspectorUI::setIsVisible):
1823         (WebKit::WebInspectorUI::showConsole):
1824         (WebKit::WebInspectorUI::showResources):
1825         (WebKit::WebInspectorUI::showTimelines):
1826         (WebKit::WebInspectorUI::showMainResourceForFrame):
1827         (WebKit::WebInspectorUI::startPageProfiling):
1828         (WebKit::WebInspectorUI::stopPageProfiling):
1829         (WebKit::WebInspectorUI::startElementSelection):
1830         (WebKit::WebInspectorUI::stopElementSelection):
1831         (WebKit::WebInspectorUI::didSave):
1832         (WebKit::WebInspectorUI::didAppend):
1833         * WebProcess/WebPage/WebPage.cpp:
1834         (WebKit::WebPage::loadStringImpl):
1835         (WebKit::WebPage::loadAlternateHTMLString):
1836         * WebProcess/WebPage/ios/WebPageIOS.mm:
1837         (WebKit::computeAutocorrectionContext):
1838         * WebProcess/WebProcess.cpp:
1839         (WebKit::getWebCoreMemoryCacheStatistics):
1840         (WebKit::WebProcess::getWebCoreStatistics):
1841         * WebProcess/cocoa/WebProcessCocoa.mm:
1842         (WebKit::WebProcess::initializeProcessName):
1843
1844 2018-06-22  Chris Dumez  <cdumez@apple.com>
1845
1846         Regression(r230211): Crash under WebInspectorClient::~WebInspectorClient()
1847         https://bugs.webkit.org/show_bug.cgi?id=186950
1848         <rdar://problem/40602069>
1849
1850         Reviewed by Darin Adler.
1851
1852         Re-introduce null-check that was accidentally dropped in r230211.
1853
1854         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
1855         (WebKit::WebInspectorClient::~WebInspectorClient):
1856
1857 2018-06-22  Timothy Hatcher  <timothy@apple.com>
1858
1859         Corner of two scroll bars is white with dark mode enabled.
1860         https://bugs.webkit.org/show_bug.cgi?id=186819
1861         rdar://problem/40434350
1862
1863         Reviewed by Tim Horton.
1864
1865         * UIProcess/mac/WKPrintingView.mm:
1866         (-[WKPrintingView drawRect:]): Added LocalDefaultSystemAppearance.
1867         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
1868         (WebKit::InjectedBundleRangeHandle::renderedImage): Ditto.
1869         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1870         (WebKit::PDFPlugin::paintControlForLayerInContext): Ditto. Dropped ScrollView argument.
1871         * WebProcess/WebPage/WebPage.cpp:
1872         (WebKit::WebPage::drawRect): Added LocalDefaultSystemAppearance.
1873
1874 2018-06-22  Tim Horton  <timothy_horton@apple.com>
1875
1876         Make it possible to add a border around loading or failed-to-load images
1877         https://bugs.webkit.org/show_bug.cgi?id=186614
1878         <rdar://problem/39050152>
1879
1880         Reviewed by Zalan Bujtas.
1881
1882         * Shared/WebPreferences.yaml:
1883         * UIProcess/API/Cocoa/WKWebView.mm:
1884         (-[WKWebView _initializeWithConfiguration:]):
1885         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1886         (-[WKWebViewConfiguration init]):
1887         (-[WKWebViewConfiguration copyWithZone:]):
1888         (-[WKWebViewConfiguration _setColorFilterEnabled:]):
1889         (-[WKWebViewConfiguration _incompleteImageBorderEnabled]):
1890         (-[WKWebViewConfiguration _setIncompleteImageBorderEnabled:]):
1891         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1892         Plumb the setting to WebKit2.
1893
1894 2018-06-22  Brady Eidson  <beidson@apple.com>
1895
1896         WKURLSchemeHandler doesn't handle sync XHR.
1897         <rdar://problem/40955884> and https://bugs.webkit.org/show_bug.cgi?id=186902
1898
1899         Reviewed by Chris Dumez.
1900
1901         This patch allows WebProcesses to block on sync loads to a custom scheme,
1902         and teaches WebURLSchemeTasks how to buffer up data and the response if 
1903         operating synchronously.
1904
1905         * Shared/WebErrors.cpp:
1906         (WebKit::failedCustomProtocolSyncLoad):
1907         * Shared/WebErrors.h:
1908
1909         * UIProcess/WebPageProxy.cpp:
1910         (WebKit::WebPageProxy::startURLSchemeTask):
1911         (WebKit::WebPageProxy::loadSynchronousURLSchemeTask):
1912         * UIProcess/WebPageProxy.h:
1913         * UIProcess/WebPageProxy.messages.in:
1914
1915         * UIProcess/WebURLSchemeHandler.cpp:
1916         (WebKit::WebURLSchemeHandler::startTask):
1917         * UIProcess/WebURLSchemeHandler.h:
1918
1919         * UIProcess/WebURLSchemeTask.cpp:
1920         (WebKit::WebURLSchemeTask::create):
1921         (WebKit::WebURLSchemeTask::WebURLSchemeTask):
1922         (WebKit::WebURLSchemeTask::didPerformRedirection):
1923         (WebKit::WebURLSchemeTask::didReceiveResponse):
1924         (WebKit::WebURLSchemeTask::didReceiveData):
1925         (WebKit::WebURLSchemeTask::didComplete):
1926         (WebKit::WebURLSchemeTask::pageDestroyed):
1927         (WebKit::WebURLSchemeTask::stop):
1928         * UIProcess/WebURLSchemeTask.h:
1929         (WebKit::WebURLSchemeTask::isSync const):
1930
1931         * WebProcess/Network/WebLoaderStrategy.cpp:
1932         (WebKit::WebLoaderStrategy::tryLoadingSynchronouslyUsingURLSchemeHandler):
1933         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
1934         * WebProcess/Network/WebLoaderStrategy.h:
1935
1936         * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp:
1937         (WebKit::WebURLSchemeHandlerProxy::loadSynchronously):
1938         * WebProcess/WebPage/WebURLSchemeHandlerProxy.h:
1939
1940 2018-06-22  Chris Dumez  <cdumez@apple.com>
1941
1942         Implement IPC throttling to keep the main thread responsive when a process misbehaves
1943         https://bugs.webkit.org/show_bug.cgi?id=186607
1944         <rdar://problem/41073205>
1945
1946         Reviewed by Geoff Garen and Brady Eidson.
1947
1948         Implement IPC throttling to keep the main thread responsive when a process misbehaves.
1949         Instead of doing one main runloop dispatch per incoming message, we now do a single
1950         runloop dispatch and process incoming messages in batch. We put a limit on the number
1951         of messages to be processed in a batch (600). If the queue is larger that this limit,
1952         we'll schedule a 0-timer to process remaining messages, giving the main runloop a chance
1953         to process other events. Additionally, if an IPC connection keeps hitting this maximum
1954         batch size limit, we implement back off and we'll further decrease the number of messages
1955         we process in each batch (going as low as 60). This keeps Safari responsive enough to
1956         allow the user to close the bad tab (even on older devices such as iPhone 5s).
1957
1958         Finally, if the incoming message queue becomes too large (50000), we go one step further
1959         and kill the IPC connection in order to maintain performance / battery life.
1960
1961         Every time we apply throttling or terminate a connection due to throttling, we do a
1962         RELEASE_LOG_ERROR() with useful information in order to help diagnose potential issues
1963         in the future.
1964
1965         For now, incoming IPC messages throttling is only enabled on the UIProcess' connections
1966         to the WebProcesses.
1967
1968         * Platform/IPC/Connection.cpp:
1969         (IPC::Connection::Connection):
1970         (IPC::Connection::enqueueIncomingMessage):
1971         (IPC::Connection::MessagesThrottler::MessagesThrottler):
1972         (IPC::Connection::MessagesThrottler::scheduleMessagesDispatch):
1973         (IPC::Connection::MessagesThrottler::numberOfMessagesToProcess):
1974         (IPC::Connection::dispatchIncomingMessages):
1975         * Platform/IPC/Connection.h:
1976         * Platform/IPC/mac/ConnectionMac.mm:
1977         (IPC::Connection::kill):
1978
1979 2018-06-22  Sihui Liu  <sihui_liu@apple.com>
1980
1981         REGRESSION (r231850): Cookie file cannot be read or written by network process
1982         https://bugs.webkit.org/show_bug.cgi?id=186806
1983         <rdar://problem/41113791>
1984
1985         Unreviewed. Fix failure after r233084 by adding missing initialization.
1986
1987         * UIProcess/WebProcessPool.cpp:
1988         (WebKit::WebProcessPool::ensureNetworkProcess):
1989
1990 2018-06-22  Jer Noble  <jer.noble@apple.com>
1991
1992         [Fullscreen] Home indicator should show and hide with status bar
1993         https://bugs.webkit.org/show_bug.cgi?id=186942
1994         <rdar://problem/41302190>
1995
1996         Reviewed by Tim Horton.
1997
1998         * UIProcess/ios/fullscreen/WKFullScreenViewController.h:
1999         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
2000         (-[WKFullScreenViewController showUI]):
2001         (-[WKFullScreenViewController hideUI]):
2002         (-[WKFullScreenViewController setPrefersHomeIndicatorAutoHidden:]):
2003
2004 2018-06-22  Jer Noble  <jer.noble@apple.com>
2005
2006         [Fullscreen] Add a pinch-to-exit gesture
2007         https://bugs.webkit.org/show_bug.cgi?id=186821
2008
2009         Reviewed by Tim Horton.
2010
2011         Add a pinch gesture recognizer that overrides the pan gesture recognizer when active. Hide the
2012         WKFullscreenViewController's controls while a dismiss gesture is active.
2013
2014         * UIProcess/ios/fullscreen/WKFullScreenViewController.h:
2015         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
2016         (-[WKFullScreenViewController setAnimating:]):
2017         (-[WKFullScreenViewController prefersStatusBarHidden]):
2018         (-[WKFullScreenViewController gestureRecognizer:shouldReceiveTouch:]):
2019         (-[WKFullScreenViewController _touchDetected:]):
2020         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
2021         (-[WKFullscreenAnimationController context]):
2022         (-[WKFullscreenAnimationController updateWithProgress:scale:translation:anchor:]):
2023         (-[WKFullScreenInteractiveTransition animator]):
2024         (-[WKFullScreenInteractiveTransition updateInteractiveTransition:withScale:andTranslation:]):
2025         (-[WKFullScreenWindowController enterFullScreen]):
2026         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
2027         (-[WKFullScreenWindowController interactionControllerForDismissal:]):
2028         (-[WKFullScreenWindowController _startToDismissFullscreenChanged:]):
2029         (-[WKFullScreenWindowController _dismissFullscreenViewController]):
2030         (-[WKFullScreenWindowController _interactiveDismissChanged:]):
2031         (-[WKFullScreenWindowController _interactivePinchDismissChanged:]):
2032
2033 2018-06-22  Brian Burg  <bburg@apple.com>
2034
2035         [Cocoa] REGRESSION(W3C): actions for key equivalents are not respected
2036         https://bugs.webkit.org/show_bug.cgi?id=186936
2037
2038         Reviewed by Timothy Hatcher.
2039
2040         * UIProcess/Automation/WebAutomationSession.cpp:
2041         (WebKit::WebAutomationSession::isSimulatingUserInteraction const):
2042         This erroneously reported false unless there was both a mouse and key interaction
2043         being dispatched, which is not possible in the current serial event simulation model.
2044         As a result, Safari could not tell whether the action came from a simulated event
2045         or the user, and thus rejected all key equivalents like Cmd-A,V,C,X.
2046
2047 2018-06-22  Jer Noble  <jer.noble@apple.com>
2048
2049         [Fullscreen] Exit fullscreen when opening a new tab
2050         https://bugs.webkit.org/show_bug.cgi?id=186826
2051         <rdar://problem/40853211>
2052
2053         Reviewed by Brent Fulgham.
2054
2055         Make the fullscreen placeholder view a custom UIView, and exit fullscreen when the
2056         placeholder is removed from its superview.
2057
2058         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
2059         (-[WKFullScreenPlaceholderView willMoveToSuperview:]):
2060         (-[WKFullScreenWindowController enterFullScreen]):
2061         (-[WKFullScreenWindowController _completedExitFullScreen]):
2062         (-[WKFullScreenWindowController placeholderWillMoveToSuperview:]):
2063         (-[WKFullScreenWindowController _exitFullscreenImmediately]):
2064
2065 2018-06-22  Timothy Horton  <timothy_horton@apple.com>
2066
2067         Fix the build after r233089
2068
2069         * UIProcess/API/Cocoa/WKPreferences.mm:
2070         (-[WKPreferences _setColorFilterEnabled:]):
2071         (-[WKPreferences _colorFilterEnabled]):
2072
2073 2018-06-22  Chris Dumez  <cdumez@apple.com>
2074
2075         Crash under WebResourceLoadStatisticsStore::mergeStatistics(WTF::Vector<WebCore::ResourceLoadStatistics, 0ul, WTF::CrashOnOverflow, 16ul>&&)
2076         https://bugs.webkit.org/show_bug.cgi?id=186905
2077         <rdar://problem/41266775>
2078
2079         Reviewed by Brent Fulgham.
2080
2081         I believe the crash was caused by the WebResourceLoadStatisticsStore object being dead
2082         when mergeStatistics() is called. In particular, the crash was happening when the
2083         ResourceLoadStatisticsPersistentStorage's FileMonitor would detect a file change and
2084         we would re-sync statistics from the disk. The FileMonitor's lambda function was
2085         capturing |this| without ref'ing it, and the FileMonitor monitors the disk and
2086         calls the lambda on the background queue, while it gets destroyed on the main thread.
2087
2088         To make lifetime management less complex, the following changes were made:
2089         - The ResourceLoadStatisticsPersistentStorage object is now always constructed / used
2090           and destroyed on the background queue. We no longer have to worry about being on
2091           the right thread in a given method.
2092         - Now that ResourceLoadStatisticsPersistentStorage is always used from the background
2093           queue and no longer needs to be thread-safe, drop its ref() / deref() methods and
2094           use weak pointers instead to make sure the ResourceLoadStatisticsPersistentStorage
2095           is still alive when a lamdba gets called on the background queue.
2096         - For write scheduling use WorkQueue::dispatchAfter() and a WeakPtr instead of a
2097           RunLoop::Timer. This is more convenient to use as the RunLoop::Timer has to be used
2098           on the main thread.
2099
2100         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
2101         (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
2102         (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage):
2103         (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk):
2104         (WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
2105         (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
2106         * UIProcess/ResourceLoadStatisticsPersistentStorage.h:
2107         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2108         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2109         (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
2110         (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
2111         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
2112         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
2113         (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
2114         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
2115         * UIProcess/WebResourceLoadStatisticsStore.h:
2116
2117 2018-06-21  Jer Noble  <jer.noble@apple.com>
2118
2119         CRASH in WebCore::VideoFullscreenInterfaceMac::~VideoFullscreenInterfaceMac()
2120         https://bugs.webkit.org/show_bug.cgi?id=186892
2121
2122         Reviewed by Eric Carlson.
2123
2124         Protect against m_contentMap being mutated while its contents are being invalidated
2125         by moving the map into a local variable and iterating over it instead.
2126
2127         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
2128         (WebKit::PlaybackSessionManagerProxy::invalidate):
2129         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
2130         (WebKit::VideoFullscreenManagerProxy::invalidate):
2131
2132 2018-06-22  Luming Yin  <luming_yin@apple.com>
2133
2134         Expose colorFilterEnabled SPI in WKPreferencesPrivate.h
2135         https://bugs.webkit.org/show_bug.cgi?id=186935
2136         <rdar://problem/41109387>
2137
2138         Reviewed by Tim Horton.
2139
2140         * UIProcess/API/Cocoa/WKPreferences.mm:
2141         (-[WKPreferences _setColorFilterEnabled:]):
2142         (-[WKPreferences _colorFilterEnabled]):
2143         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2144
2145 2018-06-22  Timothy Hatcher  <timothy@apple.com>
2146
2147         Recalc styles every time defaultAppearance changes.
2148         https://bugs.webkit.org/show_bug.cgi?id=186866
2149         rdar://problem/41309805
2150
2151         Reviewed by Tim Horton.
2152
2153         * UIProcess/WebPageProxy.cpp:
2154         (WebKit::WebPageProxy::setDefaultAppearance):
2155         * WebProcess/WebPage/WebPage.cpp:
2156         (WebKit::WebPage::setDefaultAppearance):
2157
2158 2018-06-22  Sihui Liu  <sihui_liu@apple.com>
2159
2160         REGRESSION (r231850): Cookie file cannot be read or written by network process
2161         https://bugs.webkit.org/show_bug.cgi?id=186806
2162         <rdar://problem/41113791>
2163
2164         Reviewed by Geoffrey Garen.
2165
2166         Add defaultSessionPendingCookies to NetworkProcessCreationParameters, so pending cookies of default session 
2167         can be added right after default session is set. This improves the fix r231850 as it does not send additional 
2168         message and avoids the regression.
2169
2170         * NetworkProcess/NetworkProcess.cpp:
2171         (WebKit::NetworkProcess::initializeNetworkProcess):
2172         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2173         (WebKit::NetworkProcessCreationParameters::encode const):
2174         (WebKit::NetworkProcessCreationParameters::decode):
2175         * NetworkProcess/NetworkProcessCreationParameters.h:
2176         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2177         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
2178         * UIProcess/Network/NetworkProcessProxy.cpp:
2179         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
2180         * UIProcess/WebProcessPool.cpp:
2181         (WebKit::WebProcessPool::ensureNetworkProcess):
2182
2183 2018-06-22  Brent Fulgham  <bfulgham@apple.com>
2184
2185         [iOS Debug] Multiple resourceLoadStatistics redirect tests are flaky timeouts
2186         https://bugs.webkit.org/show_bug.cgi?id=183216
2187         <rdar://problem/37992317>
2188
2189         Reviewed by Chris Dumez.
2190
2191         Improve consistency of test results by make sure that completion handlers written to run
2192         on the main thread are only called on the main thread. Add additional assertions to help
2193         catch any cases where this invariant is not being honored.
2194
2195         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2196         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess): Use Completion handler and assert
2197         we are on the right thread.
2198         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess): Ditto.
2199         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess): Ditto.
2200         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction): Ditto.
2201         (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction): Ditto.
2202         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction): Ditto.
2203         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction): Ditto.
2204         (WebKit::WebResourceLoadStatisticsStore::setLastSeen): Ditto.
2205         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource): Ditto.
2206         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource): Ditto.
2207         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource): Ditto.
2208         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder): Ditto.
2209         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo): Ditto.
2210         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource): Ditto.
2211         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered): Ditto.
2212         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered): Ditto.
2213         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): Ditto.
2214         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): Ditto.
2215         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo): Ditto.
2216         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom): Ditto.
2217         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo): Ditto.
2218         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom): Ditto.
2219         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate): 
2220         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
2221         (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
2222         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningStateReset):
2223         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent): Update to perform callbacks
2224         on the main thread (as intended). This function was doing them on a work queue.
2225         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning): Ditto.
2226         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains): Ditto.
2227         (WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains): Ditto.
2228         * UIProcess/WebResourceLoadStatisticsStore.h:
2229
2230 2018-06-22  Michael Catanzaro  <mcatanzaro@igalia.com>
2231
2232         REGRESSION(r230950): [GTK] WebKit::CoordinatedBackingStoreTile::setBackBuffer(): WebKitWebProcess killed by SIGSEGV (ASSERTION FAILED: it != m_tiles.end())
2233         https://bugs.webkit.org/show_bug.cgi?id=186206
2234
2235         Unreviewed manual rollout of r230950
2236
2237         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2238         (WebKit::layerShouldHaveBackingStore):
2239
2240 2018-06-20  Darin Adler  <darin@apple.com>
2241
2242         [Cocoa] Use the isDirectory: variants of NSURL methods more to eliminate unnecessary file system activity
2243         https://bugs.webkit.org/show_bug.cgi?id=186875
2244
2245         Reviewed by Anders Carlsson.
2246
2247         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2248         (API::WebsiteDataStore::tempDirectoryFileSystemRepresentation): Use isDirectory:YES to create a URL
2249         to the temporary directory.
2250         * UIProcess/Cocoa/WebViewImpl.mm:
2251         (WebKit::WebViewImpl::namesOfPromisedFilesDroppedAtDestination): Use isDirectory:NO to create a URL
2252         pointing to the write location.
2253         * UIProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm:
2254         (WebKit::LocalStorageDatabaseTracker::platformMaybeExcludeFromBackup const): Use isDirectory:YES to
2255         create a URL for the local storage directory.
2256         * UIProcess/ios/ResourceLoadStatisticsPersistentStorageIOS.mm:
2257         (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup const): Use isDirectory:NO to
2258         create a URL for the storage directory.
2259         * UIProcess/ios/WKContentViewInteraction.mm:
2260         (-[WKContentView _prepareToDragPromisedBlob:]): Use isDirectory:NO to create a URL for the temporary
2261         file location.
2262         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2263         (-[WKFileUploadPanel _uploadItemForImageData:imageName:successBlock:failureBlock:]): Use isDirectory:NO
2264         to create a URL for the image file to upload.
2265         * UIProcess/mac/WebInspectorProxyMac.mm:
2266         (WebKit::WebInspectorProxy::inspectorPageURL): Use isDirectory:NO to create a URL for the HTML file.
2267         (WebKit::WebInspectorProxy::inspectorTestPageURL): Ditto.
2268         (WebKit::WebInspectorProxy::inspectorBaseURL): Ditto.
2269         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
2270         (WebKit::WebChromeClient::createIconForFiles): Use isDirectory:NO to create a URL for the image file.
2271         * WebProcess/WebPage/mac/WebInspectorUIMac.mm:
2272         (WebKit::webInspectorUILocalizedStringsURL): Use isDirectory:NO to create a URL for the localized
2273         strings file.
2274
2275 2018-06-21  Chris Dumez  <cdumez@apple.com>
2276
2277         Unreviewed, rolling out r232995.
2278
2279         Seems to have caused flakiness
2280
2281         Reverted changeset:
2282
2283         "Implement IPC throttling to keep the main thread responsive
2284         when a process misbehaves"
2285         https://bugs.webkit.org/show_bug.cgi?id=186607
2286         https://trac.webkit.org/changeset/232995
2287
2288 2018-06-15  Jer Noble  <jer.noble@apple.com>
2289
2290         Address fullscreen api CSS env feedback
2291         https://bugs.webkit.org/show_bug.cgi?id=186684
2292
2293         Reviewed by Simon Fraser.
2294
2295         + Update the phishing alert text to be more explicit about the specific threats
2296           phishing sites represent.
2297         + Make the top inset static, rather than dynamic.
2298         + Add bottom, left, and right insets for completeness.
2299         + Set the fullscreen animation duration as well as delay.
2300         + Notify the page when the controls show and hide.
2301
2302         * UIProcess/WebFullScreenManagerProxy.cpp:
2303         (WebKit::WebFullScreenManagerProxy::setFullscreenInsets):
2304         (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideTiming):
2305         (WebKit::WebFullScreenManagerProxy::setFullscreenControlsHidden):
2306         (WebKit::WebFullScreenManagerProxy::setFullscreenInsetTop): Deleted.
2307         (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideDelay): Deleted.
2308         * UIProcess/WebFullScreenManagerProxy.h:
2309         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
2310         (-[WKFullScreenViewController showUI]):
2311         (-[WKFullScreenViewController hideUI]):
2312         (-[WKFullScreenViewController viewWillAppear:]):
2313         (-[WKFullScreenViewController _effectiveFullscreenInsets]):
2314         (-[WKFullScreenViewController _updateWebViewFullscreenInsets]):
2315         (-[WKFullScreenViewController _showPhishingAlert]):
2316         (-[WKFullScreenViewController _effectiveFullscreenInsetTop]): Deleted.
2317         * WebProcess/FullScreen/WebFullScreenManager.cpp:
2318         (WebKit::WebFullScreenManager::didExitFullScreen):
2319         (WebKit::WebFullScreenManager::setFullscreenInsets):
2320         (WebKit::WebFullScreenManager::setFullscreenAutoHideTiming):
2321         (WebKit::WebFullScreenManager::setFullscreenControlsHidden):
2322         (WebKit::WebFullScreenManager::setFullscreenInsetTop): Deleted.
2323         (WebKit::WebFullScreenManager::setFullscreenAutoHideDelay): Deleted.
2324         * WebProcess/FullScreen/WebFullScreenManager.h:
2325         * WebProcess/FullScreen/WebFullScreenManager.messages.in:
2326
2327 2018-06-21  Commit Queue  <commit-queue@webkit.org>
2328
2329         Unreviewed, rolling out r232884.
2330         https://bugs.webkit.org/show_bug.cgi?id=186891
2331
2332         "Introduced assertion failure in ~DisplayRefreshMonitorMac()."
2333         (Requested by perarne on #webkit).
2334
2335         Reverted changeset:
2336
2337         "DisplayRefreshMonitorMac should hold a weak pointer to
2338         WebPage."
2339         https://bugs.webkit.org/show_bug.cgi?id=186683
2340         https://trac.webkit.org/changeset/232884
2341
2342 2018-06-21  Jer Noble  <jer.noble@apple.com>
2343
2344         [Fullscreen] Page sometimes ends up with an incorrect zoom level after entering fullscreen
2345         https://bugs.webkit.org/show_bug.cgi?id=186822
2346
2347         Reviewed by Simon Fraser.
2348
2349         Set the minimum zoom, maximum zoom, zoom bouncing, and user scalability settings of the
2350         WKWebView's UIScrollView upon entering fullscreen, and restore those same settings upon
2351         exit. Override the viewport arguments upon entering fullscreen, restore them upon exit.
2352
2353         * Platform/IPC/ArgumentCoder.h:
2354         * Shared/WebCoreArgumentCoders.cpp:
2355         (IPC::ArgumentCoder<ViewportArguments>::decode):
2356         * Shared/WebCoreArgumentCoders.h:
2357         * UIProcess/WebPageProxy.h:
2358         (WebKit::WebPageProxy::forceAlwaysUserScalable const):
2359         * UIProcess/ios/WebPageProxyIOS.mm:
2360         (WebKit::WebPageProxy::setOverrideViewportArguments):
2361         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
2362         (WebKit::WKWebViewState::applyTo):
2363         (WebKit::WKWebViewState::store):
2364         (-[WKFullScreenWindowController enterFullScreen]):
2365         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
2366         * WebProcess/WebPage/WebPage.h:
2367         (WebKit::WebPage::forceAlwaysUserScalable const):
2368         * WebProcess/WebPage/WebPage.messages.in:
2369         * WebProcess/WebPage/ios/WebPageIOS.mm:
2370         (WebKit::WebPage::setOverrideViewportArguments):
2371
2372 2018-06-21  Jer Noble  <jer.noble@apple.com>
2373
2374         [Fullscreen] Use secondary glyph style for fullscreen controls
2375         https://bugs.webkit.org/show_bug.cgi?id=186862
2376         <rdar://problem/41212210>
2377
2378         Reviewed by Tim Horton.
2379
2380         Adopt AVBackgroundView, and use its predefined enums to set the material and tint styles for
2381         the fullscreen controls.
2382
2383         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
2384         (-[WKFullScreenViewController loadView]):
2385         * UIProcess/ios/fullscreen/WKFullscreenStackView.h:
2386         * UIProcess/ios/fullscreen/WKFullscreenStackView.mm:
2387         (-[WKFullscreenStackView init]):
2388         (-[WKFullscreenStackView dealloc]):
2389         (-[WKFullscreenStackView addArrangedSubview:applyingMaterialStyle:tintEffectStyle:]):
2390         (-[WKFullscreenStackView layoutSubviews]):
2391         (+[WKFullscreenStackView baseEffects]): Deleted.
2392         (+[WKFullscreenStackView configureView:forTintEffectWithColor:filterType:]): Deleted.
2393         (+[WKFullscreenStackView configureView:withBackgroundFillOfColor:opacity:filter:]): Deleted.
2394         (+[WKFullscreenStackView secondaryMaterialOverlayView]): Deleted.
2395         (+[WKFullscreenStackView applyPrimaryGlyphTintToView:]): Deleted.
2396         (+[WKFullscreenStackView applySecondaryGlyphTintToView:]): Deleted.
2397         (-[WKFullscreenStackView initWithArrangedSubviews:axis:]): Deleted.
2398         (-[WKFullscreenStackView setTargetViewForSecondaryMaterialOverlay:]): Deleted.
2399         (-[WKFullscreenStackView contentView]): Deleted.
2400         (-[WKFullscreenStackView _setArrangedSubviews:axis:]): Deleted.
2401         (-[WKFullscreenStackView setBounds:]): Deleted.
2402         (-[WKFullscreenStackView updateConstraints]): Deleted.
2403
2404 2018-06-21  Jer Noble  <jer.noble@apple.com>
2405
2406         [Fullscreen] Suspend page (and pause video) while phishing warning is presented
2407         https://bugs.webkit.org/show_bug.cgi?id=186856
2408         <rdar://problem/41212444>
2409
2410         Reviewed by Tim Horton.
2411
2412         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
2413         (-[WKFullScreenViewController _showPhishingAlert]):
2414
2415 2018-06-21  David Fenton  <david_fenton@apple.com>
2416
2417         Unreviewed, rolling out r232989.
2418
2419         Causes API regressions on macOS
2420
2421         Reverted changeset:
2422
2423         "REGRESSION (r231850): Cookie file cannot be read or written
2424         by network process"
2425         https://bugs.webkit.org/show_bug.cgi?id=186806
2426         https://trac.webkit.org/changeset/232989
2427
2428 2018-06-21  Zan Dobersek  <zdobersek@igalia.com>
2429
2430         [GTK] WebDriver: allow applying host-specific TLS certificates for automated sessions
2431         https://bugs.webkit.org/show_bug.cgi?id=186884
2432
2433         Reviewed by Carlos Garcia Campos.
2434
2435         * UIProcess/API/glib/WebKitAutomationSession.cpp:
2436         (webkitAutomationSessionCreate): Handle any host-certificate pair that's
2437         been set for this session, creating a GTlsCertificate object through
2438         loading from the specified certificate path and marking that certificate
2439         as allowed for the specified host through the
2440         webkit_web_context_allow_tls_certificate_for_host() API.
2441
2442 2018-06-21  Chris Dumez  <cdumez@apple.com>
2443
2444         Regression(r226990) : Crash under WebCore::Page::applicationWillResignActive
2445         https://bugs.webkit.org/show_bug.cgi?id=186850
2446         <rdar://problem/37394469>
2447
2448         Reviewed by Eric Carlson.
2449
2450         Make sure m_page is not null before calling applicationWillResignActive(). m_page
2451         gets nulled out when WebPage::close() is called. The crash trace seems to indicate
2452         we're calling applicationWillResignActive() on a Page that is dead since we crash
2453         accessing Page::mainFrame().
2454
2455         * WebProcess/WebPage/ios/WebPageIOS.mm:
2456         (WebKit::WebPage::applicationWillResignActive):
2457
2458 2018-06-21  Fujii Hironori  <Hironori.Fujii@sony.com>
2459
2460         [GTK] http/tests/misc/bubble-drag-events.html crashes
2461         https://bugs.webkit.org/show_bug.cgi?id=182352
2462
2463         Reviewed by Carlos Garcia Campos.
2464
2465         PingLoad::didFinish was called twice if it is used with
2466         NetworkDataTaskSoup. PingLoad is not a ref-counted object. It is
2467         destructed when PingLoad::didFinish is called.
2468
2469         PingLoad::didReceiveChallenge calls the ChallengeCompletionHandler
2470         with AuthenticationChallengeDisposition::Cancel to cancel the
2471         challenge and calls PingLoad::didFinish.
2472
2473         NetworkDataTaskSoup::continueAuthenticate calls
2474         didReceiveChallenge with a ChallengeCompletionHandler which calls
2475         didCompleteWithError. PingLoad::didCompleteWithError calls
2476         PingLoad::didFinish.
2477
2478         didCompleteWithError callback should not be called in the
2479         ChallengeCompletionHandler.
2480
2481         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2482         (WebKit::NetworkDataTaskSoup::continueAuthenticate): Do not call
2483         didFail() in the ChallengeCompletionHandler. Call
2484         invalidateAndCancel() instead.
2485
2486 2018-06-20  Wenson Hsieh  <wenson_hsieh@apple.com>
2487
2488         [WebKit on watchOS] Fixed position elements sometimes flicker when scrolling
2489         https://bugs.webkit.org/show_bug.cgi?id=186860
2490         <rdar://problem/39953563>
2491
2492         Reviewed by Tim Horton.
2493
2494         Remove conditional guards that are no longer necessary, now that the oldest iOS version our builders support is
2495         iOS 11. Conditionalizing this logic only for iOS 11+ meant that on watchOS, we're always falling down the path
2496         where we don't schedule a visible content rect update until the next runloop, which makes it possible for a
2497         remote layer tree transaction to arrive and cause us to update the scrolling tree with stale viewport geometry.
2498
2499         Test: WKScrollViewTests.PositionFixedLayerAfterScrolling
2500
2501         * UIProcess/API/Cocoa/WKWebView.mm:
2502         (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
2503
2504 2018-06-20  Megan Gardner  <megan_gardner@apple.com>
2505
2506         Restrict Selection in contenteditable the extent of that contenteditable
2507         https://bugs.webkit.org/show_bug.cgi?id=186792
2508
2509         Reviewed by Wenson Hsieh.
2510
2511         We have not been checking to make sure that when we make a selection that it is restricted to 
2512         a single content editable on iOS. There is functionality to ensure this on mac, so it has been
2513         exposed and utilized for restricting the extent of a selection.
2514
2515         * WebProcess/WebPage/ios/WebPageIOS.mm:
2516         (WebKit::WebPage::updateSelectionWithTouches):
2517
2518 2018-06-19  Dean Jackson  <dino@apple.com>
2519
2520         Blank viewer comes up and then auto-dismisses when device is not connected to Internet
2521         https://bugs.webkit.org/show_bug.cgi?id=186825
2522         <rdar://problem/40294170>
2523
2524         Reviewed by Tim Horton.
2525
2526         Handle the case where the network load fails, and send that
2527         error onto QuickLook.
2528
2529         * UIProcess/Cocoa/DownloadClient.mm:
2530         (WebKit::DownloadClient::didReceiveResponse): Check for success.
2531         (WebKit::DownloadClient::processDidCrash): Cancel in the case of a crash.
2532         (WebKit::DownloadClient::didFail): Propagate the error onto QuickLook.
2533         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
2534         (-[_WKPreviewControllerDataSource failWithError:]): New method that calls
2535         the completion handler with the error data.
2536         (WebKit::SystemPreviewController::fail): New API method.
2537         * UIProcess/SystemPreviewController.h:
2538
2539 2018-06-19  Chris Dumez  <cdumez@apple.com>
2540
2541         Implement IPC throttling to keep the main thread responsive when a process misbehaves
2542         https://bugs.webkit.org/show_bug.cgi?id=186607
2543         <rdar://problem/41073205>
2544
2545         Reviewed by Geoffrey Garen.
2546
2547         Implement IPC throttling to keep the main thread responsive when a process misbehaves.
2548         Instead of doing one main runloop dispatch per incoming message, we now do a single
2549         runloop dispatch and process incoming messages in batch. We put a limit on the number
2550         of messages to be processed in a batch (600). If the queue is larger that this limit,
2551         we'll schedule a 0-timer to process remaining messages, giving the main runloop a chance
2552         to process other events. Additionally, if an IPC connection keeps hitting this maximum
2553         batch size limit, we implement back off and we'll further decrease the number of messages
2554         we process in each batch (going as low as 60). This keeps Safari responsive enough to
2555         allow the user to close the bad tab (even on older devices such as iPhone 5s).
2556
2557         Finally, if the incoming message queue becomes too large (50000), we go one step further
2558         and kill the IPC connection in order to maintain performance / battery life.
2559
2560         Every time we apply throttling or terminate a connection due to throttling, we do a
2561         RELEASE_LOG_ERROR() with useful information in order to help diagnose potential issues
2562         in the future.
2563
2564         * Platform/IPC/Connection.cpp:
2565         (IPC::Connection::Connection):
2566         (IPC::Connection::enqueueIncomingMessage):
2567         (IPC::Connection::MessagesThrottler::MessagesThrottler):
2568         (IPC::Connection::MessagesThrottler::scheduleMessagesDispatch):
2569         (IPC::Connection::MessagesThrottler::numberOfMessagesToProcess):
2570         (IPC::Connection::dispatchIncomingMessages):
2571         * Platform/IPC/Connection.h:
2572         * Platform/IPC/mac/ConnectionMac.mm:
2573         (IPC::Connection::kill):
2574
2575 2018-06-18  Jiewen Tan  <jiewen_tan@apple.com>
2576
2577         Make SecItemShim to not send return value for SecItemAdd
2578         https://bugs.webkit.org/show_bug.cgi?id=186789
2579         <rdar://problem/40892596>
2580
2581         Reviewed by Brent Fulgham.
2582
2583         Return value of SecItemAdd is often ignored. Even if it isn't, we don't have the ability to serialize SecKeychainItemRef.
2584         Otherwise, it would go through the weird route of serializing SecKeychainItemRef by asking Keychain for its persistent
2585         reference. This route contradicts the purpose of SecItemShim, which is to proxy all Keychain operations to UIProcess.
2586
2587         Also, this patch removes the release assertion on encode(Encoder&, SecAccessControlRef) and decode(Decoder&, RetainPtr<SecAccessControlRef>&)
2588         as they don't query Keychain.
2589
2590         * Shared/cf/ArgumentCodersCF.cpp:
2591         (IPC::encode):
2592         (IPC::decode):
2593         * Shared/mac/SecItemShim.cpp:
2594         (WebKit::sendSecItemRequest):
2595         (WebKit::webSecItemAdd):
2596         * UIProcess/mac/SecItemShimProxy.cpp:
2597         (WebKit::SecItemShimProxy::secItemRequest):
2598         * UIProcess/mac/SecItemShimProxy.h:
2599         * UIProcess/mac/SecItemShimProxy.messages.in:
2600
2601 2018-06-19  Sihui Liu  <sihui_liu@apple.com>
2602
2603         REGRESSION (r231850): Cookie file cannot be read or written by network process
2604         https://bugs.webkit.org/show_bug.cgi?id=186806
2605         <rdar://problem/41113791>
2606
2607         Reviewed by Geoffrey Garen.
2608
2609         Default websiteDataStore may be added wrongly to network process before default session was 
2610         set, as messages were asynchronous, so the cookie storage could be improperly set.   
2611
2612         * NetworkProcess/NetworkProcess.cpp:
2613         (WebKit::NetworkProcess::initializeNetworkProcess):
2614         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2615         (WebKit::NetworkProcessCreationParameters::encode const):
2616         (WebKit::NetworkProcessCreationParameters::decode):
2617         * NetworkProcess/NetworkProcessCreationParameters.h:
2618         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2619         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
2620         * UIProcess/WebProcessPool.cpp:
2621         (WebKit::WebProcessPool::ensureNetworkProcess):
2622
2623 2018-06-19  Don Olmstead  <don.olmstead@sony.com>
2624
2625         Use getCurrentProcessID over getpid
2626         https://bugs.webkit.org/show_bug.cgi?id=186813
2627
2628         Reviewed by Alex Christensen.
2629
2630         * Shared/WebMemorySampler.cpp:
2631         (WebKit::WebMemorySampler::initializeTimers):
2632         (WebKit::WebMemorySampler::stop):
2633         (WebKit::WebMemorySampler::writeHeaders):
2634         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2635         (WebKit::WebSWContextManagerConnection::installServiceWorker):
2636
2637 2018-06-19  Don Olmstead  <don.olmstead@sony.com>
2638
2639         WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations does not invoke callback when Service Workers disabled
2640         https://bugs.webkit.org/show_bug.cgi?id=186809
2641
2642         Reviewed by Chris Dumez.
2643
2644         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2645         (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):
2646
2647 2018-06-19  Wenson Hsieh  <wenson_hsieh@apple.com>
2648
2649         [WebKit on watchOS] Vend username text content type when using scribble in login fields
2650         https://bugs.webkit.org/show_bug.cgi?id=186791
2651         <rdar://problem/41226935>
2652
2653         Reviewed by Beth Dakin.
2654
2655         Vend additional context to Quickboard when focusing an element that is likely to be a username field.
2656
2657         Test: fast/forms/watchos/username-text-content-type.html
2658
2659         * Shared/AssistedNodeInformation.cpp:
2660         (WebKit::AssistedNodeInformation::encode const):
2661         (WebKit::AssistedNodeInformation::decode):
2662         * Shared/AssistedNodeInformation.h:
2663
2664         Add a new flag to tell the UI process when the currently focused element is an autofillable username input
2665         field (using existing app autofill heuristics).
2666
2667         * UIProcess/API/Cocoa/WKWebView.mm:
2668         (-[WKWebView textContentTypeForTesting]):
2669         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2670
2671         Add new testing SPI to grab the computed text content type for the focused element.
2672
2673         * UIProcess/ios/WKContentViewInteraction.h:
2674         * UIProcess/ios/WKContentViewInteraction.mm:
2675         (contentTypeFromFieldName):
2676
2677         If `autocomplete="username"` is specified, return a username text content type. This was not originally added in
2678         r197626 because UITextContentTypeUsername was only introduced later, in iOS 11.
2679
2680         (-[WKContentView textContentTypeForListViewController:]):
2681         (-[WKContentView textContentTypeForTesting]):
2682         * WebProcess/WebPage/ios/WebPageIOS.mm:
2683         (WebKit::WebPage::getAssistedNodeInformation):
2684
2685 2018-06-19  Chris Dumez  <cdumez@apple.com>
2686
2687         Unreviewed, rolling out r232947.
2688
2689         Caused an API test to time out
2690
2691         Reverted changeset:
2692
2693         "Implement IPC throttling to keep the main thread responsive
2694         when a process misbehaves"
2695         https://bugs.webkit.org/show_bug.cgi?id=186607
2696         https://trac.webkit.org/changeset/232947
2697
2698 2018-06-19  Chris Dumez  <cdumez@apple.com>
2699
2700         HTTPHeaderMap wastes 226KB of HashTable capacity on cnn.com
2701         https://bugs.webkit.org/show_bug.cgi?id=186735
2702         <rdar://problem/41189164>
2703
2704         Reviewed by Geoffrey Garen.
2705
2706         * NetworkProcess/cache/NetworkCacheCoders.cpp:
2707         (WTF::Persistence::Coder<WebCore::HTTPHeaderMap>::decode):
2708
2709 2018-06-19  Youenn Fablet  <youenn@apple.com>
2710
2711         Network Preflights do not show in WebInspector after moving CORS checks to NetworkProcess
2712         https://bugs.webkit.org/show_bug.cgi?id=186312
2713         <rdar://problem/40495434>
2714
2715         Reviewed by Chris Dumez.
2716
2717         Add buffering of all request/response of a given load, including redirections and preflights.
2718         This buffering is switched on/off by a boolean which is switched on in case Web Inspector is launched.
2719
2720         Buffering is done in NetworkLoadChecker.
2721         We add ways to retrieve preflight information from NetworkCORSPreflightChecker.
2722
2723         Implement LoaderStrategy new methods through sync IPC.
2724
2725         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
2726         (WebKit::NetworkCORSPreflightChecker::NetworkCORSPreflightChecker):
2727         (WebKit::NetworkCORSPreflightChecker::startPreflight):
2728         (WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection):
2729         (WebKit::NetworkCORSPreflightChecker::didReceiveResponseNetworkSession):
2730         (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
2731         (WebKit::NetworkCORSPreflightChecker::takeInformation):
2732         * NetworkProcess/NetworkCORSPreflightChecker.h:
2733         * NetworkProcess/NetworkConnectionToWebProcess.h:
2734         (WebKit::NetworkConnectionToWebProcess::takeNetworkLoadInformationRequest):
2735         (WebKit::NetworkConnectionToWebProcess::takeNetworkLoadIntermediateInformation):
2736         (WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformation):
2737         (WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationMetrics):
2738         (WebKit::NetworkConnectionToWebProcess::addNetworkLoadInformationResponse): Deleted.
2739         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2740         * NetworkProcess/NetworkLoadChecker.cpp:
2741         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
2742         (WebKit::NetworkLoadChecker::check):
2743         (WebKit::NetworkLoadChecker::checkRedirection):
2744         (WebKit::NetworkLoadChecker::checkResponse):
2745         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
2746         (WebKit::NetworkLoadChecker::storeRedirection):
2747         * NetworkProcess/NetworkLoadChecker.h:
2748         (WebKit::NetworkLoadChecker::takeNetworkLoadInformation):
2749         * NetworkProcess/NetworkResourceLoader.cpp:
2750         (WebKit::NetworkResourceLoader::didReceiveResponse):
2751         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
2752         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
2753         * NetworkProcess/PingLoad.cpp:
2754         (WebKit::PingLoad::PingLoad):
2755         * Scripts/webkit/messages.py:
2756         * WebProcess/Network/WebLoaderStrategy.cpp:
2757         (WebKit::WebLoaderStrategy::intermediateLoadInformationFromResourceLoadIdentifier):
2758         * WebProcess/Network/WebLoaderStrategy.h:
2759
2760 2018-06-19  Brent Fulgham  <bfulgham@apple.com>
2761
2762         MAP_JIT is not present for minimal simulator builds
2763         https://bugs.webkit.org/show_bug.cgi?id=186608
2764
2765         Reviewed by Darin Adler.
2766
2767         * Configurations/WebContent-iOS-minimalsimulator.entitlements:
2768
2769 2018-06-18  John Wilander  <wilander@apple.com>
2770
2771         Resource Load Statistics: Make sure to call callbacks even if there is no store (test infrastructure)
2772         https://bugs.webkit.org/show_bug.cgi?id=186777
2773         <rdar://problem/41216181>
2774
2775         Reviewed by Chris Dumez.
2776
2777         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2778         (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
2779         (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
2780         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
2781         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
2782
2783 2018-06-18  Chris Dumez  <cdumez@apple.com>
2784
2785         Crash under WebProcessPool::networkProcessFailedToLaunch():
2786         https://bugs.webkit.org/show_bug.cgi?id=186784
2787         <rdar://problem/33535377>
2788
2789         Reviewed by Brady Eidson.
2790
2791         * UIProcess/API/Cocoa/WKProcessPool.mm:
2792         (+[WKProcessPool _allProcessPoolsForTesting]):
2793         Add SPI to retrieve all WebProcessPool for testing purposes.
2794
2795         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2796         * UIProcess/Network/NetworkProcessProxy.cpp:
2797         (WebKit::NetworkProcessProxy::clearCallbackStates):
2798         Make iteration over completion handlers robust against completion handlers
2799         getting removed while we iterate.
2800
2801         (WebKit::NetworkProcessProxy::didClose):
2802         Ref the WebProcessPool (which keeps the NetworkProcessProxy alive too)
2803         as several calls within this method might cause the WebProcessPool /
2804         NetworkProcessProxy to get destroyed.
2805
2806 2018-06-18  Chris Dumez  <cdumez@apple.com>
2807
2808         Implement IPC throttling to keep the main thread responsive when a process misbehaves
2809         https://bugs.webkit.org/show_bug.cgi?id=186607
2810
2811         Reviewed by Geoffrey Garen.
2812
2813         Implement IPC throttling to keep the main thread responsive when a process misbehaves.
2814         Instead of doing one main runloop dispatch per incoming message, we now do a single
2815         runloop dispatch and process incoming messages in batch. We put a limit on the number
2816         of messages to be processed in a batch (600). If the queue is larger that this limit,
2817         we'll schedule a 0-timer to process remaining messages, giving the main runloop a chance
2818         to process other events. Additionally, if an IPC connection keeps hitting this maximum
2819         batch size limit, we implement back off and we'll further decrease the number of messages
2820         we process in each batch (going as low as 60). This keeps Safari responsive enough to
2821         allow the user to close the bad tab (even on older devices such as iPhone 5s).
2822
2823         Finally, if the incoming message queue becomes too large (50000), we go one step further
2824         and kill the IPC connection in order to maintain performance / battery life.
2825
2826         Every time we apply throttling or terminate a connection due to throttling, we do a
2827         RELEASE_LOG_ERROR() with useful information in order to help diagnose potential issues
2828         in the future.
2829
2830         * Platform/IPC/Connection.cpp:
2831         (IPC::Connection::Connection):
2832         (IPC::Connection::enqueueIncomingMessage):
2833         (IPC::Connection::MessagesThrottler::MessagesThrottler):
2834         (IPC::Connection::MessagesThrottler::scheduleMessagesDispatch):
2835         (IPC::Connection::MessagesThrottler::numberOfMessagesToProcess):
2836         (IPC::Connection::dispatchIncomingMessages):
2837         * Platform/IPC/Connection.h:
2838         * Platform/IPC/mac/ConnectionMac.mm:
2839         (IPC::Connection::kill):
2840
2841 2018-06-18  Jiewen Tan  <jiewen_tan@apple.com>
2842
2843         Add a graceful exit for AuthenticationManager::initializeConnection
2844         https://bugs.webkit.org/show_bug.cgi?id=186632
2845         <rdar://problem/41041033>
2846
2847         Reviewed by Brent Fulgham.
2848
2849         Add a graceful exit for AuthenticationManager::initializeConnection when the provided IPC connection
2850         is null or the underlying xpc connection is null.
2851
2852         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
2853         (WebKit::AuthenticationManager::initializeConnection):
2854
2855 2018-06-18  Youenn Fablet  <youenn@apple.com>
2856
2857         Validate Cross-Origin-Resource-Policy for resources cached in the MemoryCache
2858         https://bugs.webkit.org/show_bug.cgi?id=186639
2859         <rdar://problem/41106984>
2860
2861         Reviewed by Geoffrey Garen.
2862
2863         Make use of WebCore method to check CORP.
2864
2865         * NetworkProcess/NetworkLoadChecker.cpp:
2866         (WebKit::NetworkLoadChecker::validateResponse):
2867         * NetworkProcess/NetworkLoadChecker.h:
2868
2869 2018-06-18  Karl Leplat  <karl.leplat_ext@softathome.com>
2870
2871         [Threaded paintingEngine] Fix rendering glitches
2872         https://bugs.webkit.org/show_bug.cgi?id=186764
2873
2874         Reviewed by Žan Doberšek.
2875
2876         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
2877         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
2878         We call Nicosia::Buffer function waitUntilPaintingComplete()
2879         in order to synchronize of using Nicosia:buffer between MainThread
2880         and ThreadedCompositor.
2881
2882
2883 2018-06-17  Chris Dumez  <cdumez@apple.com>
2884
2885         Crash under SuspendedPageProxy::~SuspendedPageProxy()
2886         https://bugs.webkit.org/show_bug.cgi?id=186688
2887         <rdar://problem/41060769>
2888
2889         Reviewed by Darin Adler.
2890
2891         Ref the WebProcessProxy before calling suspendedPageWasDestroyed() on it as this
2892         might cause the WebProcessProxy / WebProcessPool to get destroyed otherwise, and
2893         we would crash trying to call unregisterSuspendedPageProxy() on the WebProcessPool
2894         on the next line.
2895
2896         * UIProcess/SuspendedPageProxy.cpp:
2897         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
2898
2899 2018-06-17  Wenson Hsieh  <wenson_hsieh@apple.com>
2900
2901         [WebKit on watchOS] Upstream watchOS source additions to OpenSource (Part 3)
2902         https://bugs.webkit.org/show_bug.cgi?id=186442
2903         <rdar://problem/40879364>
2904
2905         Reviewed by Darin Adler.
2906
2907         Rename a category referencing "Extra zoom mode".
2908
2909         * UIProcess/ios/WKContentViewInteraction.mm:
2910
2911 2018-06-12  Darin Adler  <darin@apple.com>
2912
2913         [Cocoa] Make some RetainPtr refinements to get more ready for ARC
2914         https://bugs.webkit.org/show_bug.cgi?id=186526
2915
2916         Reviewed by Anders Carlsson.
2917
2918         * Platform/cf/ModuleCF.cpp:
2919         (WebKit::Module::load): Use move assignment instead of adoptCF/leakRef.
2920
2921         * Shared/Cocoa/WKNSURLExtras.mm:
2922         (+[NSURL _web_URLWithWTFString:]): Cast to NSURL * instead of doing the autorelease
2923         here, since the NSURL * operator already does what we want.
2924         (+[NSURL _web_URLWithWTFString:relativeToURL:]): Ditto.
2925
2926         * UIProcess/ios/WKContentView.mm:
2927         (-[WKContentView _wk_printedDocument]): Get rid of incorrect use of
2928         RetainPtr::autorelease. We don't want to null out _printedDocument each time this
2929         function is called.
2930
2931         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
2932         (collectIcons): Get rid of unnecessary use of RetainPtr::autorelease in a function
2933         that returns a RetainPtr.
2934
2935 2018-06-15  Chris Dumez  <cdumez@apple.com>
2936
2937         Add API test coverage for SW RegistrationDatabase destruction and fix issues found by the test
2938         https://bugs.webkit.org/show_bug.cgi?id=186681
2939
2940         Reviewed by Brady Eidson.
2941
2942         Make sure StorageProcess::unregisterSWServerConnection() does not unnecessarily
2943         create a SWServer. Otherwise, we were in quick session destroying the SWServer
2944         and then re-constructing it for the same sessionID, merely to try ot unregister
2945         a SWServerConnection.
2946
2947         * StorageProcess/StorageProcess.cpp:
2948         (WebKit::StorageProcess::existingSWOriginStoreForSession const):
2949         (WebKit::StorageProcess::unregisterSWServerConnection):
2950         * StorageProcess/StorageProcess.h:
2951
2952 2018-06-15  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2953
2954         [WinCairo] Move unrelated features of WorkQueueWin into IPC::Connection
2955         https://bugs.webkit.org/show_bug.cgi?id=186582
2956
2957         Add EventListener private class to handle signaled tasks for I/O.
2958         Originally they were in WTF::WorkQueueWin, but those features were not related
2959         to WorkQueue and only used in IPC::ConnectionWin. Moved logic is more specialized
2960         than old generalized logic. That was unneeded generalization.
2961
2962         Reviewed by Brent Fulgham.
2963
2964         * Platform/IPC/Connection.h:
2965         (IPC::Connection::EventListener::state):
2966         * Platform/IPC/win/ConnectionWin.cpp:
2967         (IPC::Connection::platformInitialize):
2968         (IPC::Connection::platformInvalidate):
2969         (IPC::Connection::readEventHandler):
2970         (IPC::Connection::writeEventHandler):
2971         (IPC::Connection::invokeReadEventHandler):
2972         (IPC::Connection::invokeWriteEventHandler):
2973         (IPC::Connection::open):
2974         (IPC::Connection::sendOutgoingMessage):
2975         (IPC::Connection::EventListener::open):
2976         (IPC::Connection::EventListener::callback):
2977         (IPC::Connection::EventListener::close):
2978
2979 2018-06-15  Brady Eidson  <beidson@apple.com>
2980
2981         Crash in both StorageProcess and UIProcess when using custom WKWebsiteDataStores for data management.
2982         <rdar://problem/41019893> and https://bugs.webkit.org/show_bug.cgi?id=186682
2983
2984         Reviewed by Chris Dumez.
2985
2986         * UIProcess/Storage/StorageProcessProxy.cpp:
2987         (WebKit::StorageProcessProxy::didClose): Protect this and the process pool as the cleanup that follows
2988           might cause either to get destroyed.
2989
2990         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2991         (WebKit::WebsiteDataStore::fetchDataAndApply): Protect the operating WebsiteDataStore while async operations
2992           are in flight. Otherwise if the data store is destroyed, the SessionIDs for those operations will get
2993           destroyed before they complete.
2994         (WebKit::WebsiteDataStore::removeData): Ditto.
2995
2996 2018-06-15  Per Arne Vollan  <pvollan@apple.com>
2997
2998         Unreviewed build fix after r232634.
2999
3000         * WebProcess/WebPage/DrawingArea.h:
3001         * WebProcess/WebPage/DrawingArea.messages.in:
3002
3003 2018-06-15  Per Arne Vollan  <pvollan@apple.com>
3004
3005         DisplayRefreshMonitorMac should hold a weak pointer to WebPage.
3006         https://bugs.webkit.org/show_bug.cgi?id=186683
3007
3008         Reviewed by Brent Fulgham.
3009
3010         Instead of DisplayRefreshMonitorMac having a RefPtr to WebPage, it should have a weak pointer.
3011         Having a RefPtr could in theory create reference cycles. This potential problem has not been
3012         observed in practice, but it is safer to use a weak pointer.
3013
3014         * WebProcess/WebPage/WebPage.h:
3015         * WebProcess/WebPage/mac/DrawingAreaMac.cpp:
3016         (WebKit::DisplayRefreshMonitorMac::DisplayRefreshMonitorMac):
3017         (WebKit::DisplayRefreshMonitorMac::~DisplayRefreshMonitorMac):
3018         (WebKit::DisplayRefreshMonitorMac::requestRefreshCallback):
3019
3020 2018-06-15  Carlos Alberto Lopez Perez  <clopez@igalia.com>
3021
3022         [GTK][WKE] Disable memory pressure handling when running layout tests (WTR)
3023         https://bugs.webkit.org/show_bug.cgi?id=186663
3024
3025         Reviewed by Michael Catanzaro.
3026
3027         r196943 added a mechanism to disable the memory pressure handling
3028         on Mac. This patch enables using that mechanism also for GTK/WPE.
3029         To do that the environment variable WEBKIT_DISABLE_MEMORY_PRESSURE_MONITOR
3030         should bet set to 1.
3031         We want to use this on the layout tests to avoid flaky tests caused
3032         by accumulated leaks on the WebProcess by different tests.
3033
3034         * UIProcess/gtk/WebProcessPoolGtk.cpp:
3035         (WebKit::WebProcessPool::platformInitializeWebProcess):
3036         * UIProcess/wpe/WebProcessPoolWPE.cpp:
3037         (WebKit::WebProcessPool::platformInitializeWebProcess):
3038
3039 2018-06-15  Per Arne Vollan  <pvollan@apple.com>
3040
3041         Rollout r231818, as it introduced regression on tickets.com.
3042         https://bugs.webkit.org/show_bug.cgi?id=186675
3043
3044         Unreviewed, rolling out.
3045
3046         * UIProcess/WebPageProxy.cpp:
3047         (WebKit::WebPageProxy::dispatchActivityStateChange):
3048         * UIProcess/mac/DisplayLink.cpp:
3049         (WebKit::DisplayLink::pause): Deleted.
3050         (WebKit::DisplayLink::resume): Deleted.
3051         * UIProcess/mac/DisplayLink.h:
3052
3053 2018-06-15  Thibault Saunier  <tsaunier@igalia.com>
3054
3055         [GTK][WPE]: Avoid using uninitialized launchOptions in getLaunchOptions
3056         https://bugs.webkit.org/show_bug.cgi?id=185611
3057
3058         Reviewed by Chris Dumez.
3059
3060         Otherwise we might segfault.
3061
3062         * UIProcess/Plugins/PluginProcessProxy.cpp:
3063         (WebKit::PluginProcessProxy::getLaunchOptions):
3064
3065 2018-06-14  Youenn Fablet  <youenn@apple.com>
3066
3067         Make NetworkProcess get cache storage parameters at creation of the CacheStorage engine
3068         https://bugs.webkit.org/show_bug.cgi?id=186166
3069
3070         Reviewed by Alex Christensen.
3071
3072         Make CacheStorage::Engine creation asynchronous.
3073         Update Engine public methods be static methods taking a SessionID, which will be used to create the engine.
3074
3075         Add IPC methods to retrieve cache storage parameters from NetworkProcess to UIProcess.
3076
3077         Add NetworkProcessProxy ability to compute the cache storage parameters based on the SessionID.
3078         For that purpose, make NetworkProcessProxy store a map of SessionID-to-WebsiteDataStore.
3079
3080         * NetworkProcess/NetworkProcess.cpp:
3081         (WebKit::NetworkProcess::deleteWebsiteData):
3082         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
3083         (WebKit::NetworkProcess::cacheStorageParameters):
3084         (WebKit::NetworkProcess::setCacheStorageParameters):
3085         (WebKit::NetworkProcess::cacheStorageDirectory const): Deleted.
3086         (WebKit::NetworkProcess::cacheStoragePerOriginQuota const): Deleted.
3087         * NetworkProcess/NetworkProcess.h:
3088         * NetworkProcess/NetworkProcess.messages.in:
3089         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3090         (WebKit::NetworkProcessCreationParameters::encode const):
3091         (WebKit::NetworkProcessCreationParameters::decode):
3092         * NetworkProcess/NetworkProcessCreationParameters.h:
3093         * NetworkProcess/cache/CacheStorageEngine.cpp:
3094         (WebKit::CacheStorage::Engine::from):
3095         (WebKit::CacheStorage::Engine::fetchEntries):
3096         (WebKit::CacheStorage::Engine::open):
3097         (WebKit::CacheStorage::Engine::remove):
3098         (WebKit::CacheStorage::Engine::retrieveCaches):
3099         (WebKit::CacheStorage::Engine::retrieveRecords):
3100         (WebKit::CacheStorage::Engine::putRecords):
3101         (WebKit::CacheStorage::Engine::deleteMatchingRecords):
3102         (WebKit::CacheStorage::Engine::lock):
3103         (WebKit::CacheStorage::Engine::unlock):
3104         (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
3105         (WebKit::CacheStorage::Engine::representation):
3106         (WebKit::CacheStorage::Engine::clearAllCaches):
3107         (WebKit::CacheStorage::Engine::clearCachesForOrigin):
3108         (WebKit::CacheStorage::Engine::Engine):
3109         (WebKit::CacheStorage::Engine::readCachesFromDisk):
3110         (WebKit::CacheStorage::Engine::defaultEngine): Deleted.
3111         * NetworkProcess/cache/CacheStorageEngine.h:
3112         (WebKit::CacheStorage::Engine::shouldPersist const):
3113         (WebKit::CacheStorage::Engine::weakPtrFactory):
3114         (WebKit::CacheStorage::Engine::create): Deleted.
3115         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
3116         (WebKit::CacheStorageEngineConnection::~CacheStorageEngineConnection):
3117         (WebKit::CacheStorageEngineConnection::open):
3118         (WebKit::CacheStorageEngineConnection::remove):
3119         (WebKit::CacheStorageEngineConnection::caches):
3120         (WebKit::CacheStorageEngineConnection::retrieveRecords):
3121         (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
3122         (WebKit::CacheStorageEngineConnection::putRecords):
3123         (WebKit::CacheStorageEngineConnection::reference):
3124         (WebKit::CacheStorageEngineConnection::dereference):
3125         (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
3126         (WebKit::CacheStorageEngineConnection::engineRepresentation):
3127         * NetworkProcess/cache/CacheStorageEngineConnection.h:
3128         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3129         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3130         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3131         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
3132         * Shared/WebsiteDataStoreParameters.cpp:
3133         (WebKit::WebsiteDataStoreParameters::encode const):
3134         (WebKit::WebsiteDataStoreParameters::decode):
3135         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
3136         * Shared/WebsiteDataStoreParameters.h:
3137         (): Deleted.
3138         * UIProcess/Network/NetworkProcessProxy.cpp:
3139         (WebKit::NetworkProcessProxy::addSession):
3140         (WebKit::NetworkProcessProxy::removeSession):
3141         (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
3142         * UIProcess/Network/NetworkProcessProxy.h:
3143         * UIProcess/Network/NetworkProcessProxy.messages.in:
3144         * UIProcess/WebProcessPool.cpp:
3145         (WebKit::WebProcessPool::ensureNetworkProcess):
3146         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
3147         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
3148         (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
3149         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3150         (WebKit::WebsiteDataStore::parameters):
3151         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3152         (WebKit::WebsiteDataStore::~WebsiteDataStore):
3153
3154 2018-06-14  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3155
3156         [Win] Add IPC error case for broken pipe
3157         https://bugs.webkit.org/show_bug.cgi?id=186445
3158
3159         Add error handling for ERROR_BROKEN_PIPE on IPC::Connection::readEventHandler.
3160
3161         Reviewed by Ryosuke Niwa.
3162
3163         * Platform/IPC/win/ConnectionWin.cpp:
3164         (IPC::Connection::readEventHandler):
3165
3166 2018-06-14  John Wilander  <wilander@apple.com>
3167
3168         Resource Load Statistics: Shortcut classification for redirect to prevalent resource
3169         https://bugs.webkit.org/show_bug.cgi?id=186627
3170         <rdar://problem/41132308>
3171
3172         Reviewed by Brent Fulgham.
3173
3174         This patch shortcuts classification of redirect collusion so that we more seldom
3175         have to rely on the recursive backtrace of the redirect graph. The initial
3176         implementation of Resource Load Statistics actually had this classification method.
3177
3178         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3179         (WebKit::WebResourceLoadStatisticsStore::markAsPrevalentIfHasRedirectedToPrevalent):
3180             Iterates through a non-classified resource's data for where it has redirected
3181             and classifies it as prevalent if has redirected to 
3182         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
3183             Now calls WebResourceLoadStatisticsStore::markAsPrevalentIfHasRedirectedToPrevalent()
3184             before regular classification steps. 
3185         * UIProcess/WebResourceLoadStatisticsStore.h:
3186
3187 2018-06-14  Youenn Fablet  <youenn@apple.com>
3188
3189         Apply CSP checks before Content blocker checks in NetworkLoadChecker as done by CachedResourceLoader
3190         https://bugs.webkit.org/show_bug.cgi?id=186550
3191
3192         Reviewed by Alex Christensen.
3193
3194         Do CSP checks and URL upgrade before content blocker checks.
3195
3196         * NetworkProcess/NetworkLoadChecker.cpp:
3197         (WebKit::NetworkLoadChecker::checkRequest):
3198         (WebKit::NetworkLoadChecker::continueCheckingRequest):
3199
3200 2018-06-14  Brent Fulgham  <bfulgham@apple.com>
3201
3202         Plug-in Process crashing on Mojave (affects Flash, others)
3203         https://bugs.webkit.org/show_bug.cgi?id=186628
3204         <rdar://problem/41120462>
3205
3206         Reviewed by Eric Carlson.
3207
3208         Add the missing “com.apple.security.cs.allow-unsigned-executable-memory” entitlement. Also alphabetize
3209         the entitlements file to make it easier to read.
3210
3211         * Configurations/PluginService.entitlements:
3212
3213 2018-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3214
3215         [GTK][WPE] WebDriver: handle acceptInsecureCertificates capability
3216         https://bugs.webkit.org/show_bug.cgi?id=186560
3217
3218         Reviewed by Brian Burg.
3219
3220         * UIProcess/API/glib/WebKitAutomationSession.cpp:
3221         (webkitAutomationSessionCreate): Check the acceptInsecureCertificates capability and set the TLS error policy in
3222         the WebContext accordingly if needed.
3223         * UIProcess/API/glib/WebKitAutomationSessionPrivate.h:
3224         * UIProcess/API/glib/WebKitWebContext.cpp:
3225         * UIProcess/Cocoa/AutomationClient.h:
3226         * UIProcess/Cocoa/AutomationClient.mm:
3227         (WebKit::AutomationClient::requestAutomationSession): Use SessionCapabilities to fill the session configuration.
3228         (WebKit::AutomationClient::requestAutomationSessionWithCapabilities): Deleted.
3229
3230 2018-06-13  Adrian Perez de Castro  <aperez@igalia.com>
3231
3232         [WPE] Trying to access the remote inspector hits an assertion in the UIProcess
3233         https://bugs.webkit.org/show_bug.cgi?id=186588
3234
3235         Reviewed by Carlos Garcia Campos.
3236
3237         Make both the WPE and GTK+ ports use /org/webkit/inspector as base prefix
3238         for resource paths, which avoids needing a switcheroo depending on the port.
3239
3240         * UIProcess/API/wpe/WebKit2InspectorGResourceBundle.xml:
3241         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3242         (WebKit::WebInspectorProxy::inspectorPageURL):
3243         (WebKit::WebInspectorProxy::inspectorTestPageURL):
3244         (WebKit::WebInspectorProxy::inspectorBaseURL):
3245         * UIProcess/wpe/WebInspectorProxyWPE.cpp:
3246         (WebKit::WebInspectorProxy::inspectorPageURL):
3247         (WebKit::WebInspectorProxy::inspectorTestPageURL):
3248         (WebKit::WebInspectorProxy::inspectorBaseURL):
3249         * WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp:
3250         (WebKit::WebInspectorUI::localizedStringsURL):
3251         (WebKit::RemoteWebInspectorUI::localizedStringsURL):
3252
3253 2018-06-13  Chris Dumez  <cdumez@apple.com>
3254
3255         Crash under SWServer::unregisterConnection(Connection&)
3256         https://bugs.webkit.org/show_bug.cgi?id=186584
3257         <rdar://problem/40931680>
3258
3259         Reviewed by Youenn Fablet.
3260
3261         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3262         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3263         * StorageProcess/StorageToWebProcessConnection.cpp:
3264         (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection):
3265         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
3266         (WebKit::StorageToWebProcessConnection::didReceiveSyncMessage):
3267         (WebKit::StorageToWebProcessConnection::didClose):
3268         (WebKit::StorageToWebProcessConnection::unregisterSWConnections):
3269         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
3270         * StorageProcess/StorageToWebProcessConnection.h:
3271
3272 2018-06-13  Dean Jackson  <dino@apple.com>
3273
3274         Disable AR support in WKWebView clients
3275         https://bugs.webkit.org/show_bug.cgi?id=186611
3276         <rdar://problem/39544684>
3277
3278         Reviewed by Jon Lee.
3279
3280         Since it hasn't been adequately tested, System Preview (AR) should
3281         be disabled by default for WKWebViews.
3282
3283         Add a new WebPreference, and SPI into WKWebViewConfiguration. Also
3284         don't register the WebViewContentProvider if the feature is
3285         disabled.
3286
3287         * Shared/WebPreferences.yaml:
3288         * UIProcess/API/Cocoa/WKWebView.mm:
3289         (-[WKWebView _initializeWithConfiguration:]):
3290         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3291         (-[WKWebViewConfiguration init]):
3292         (-[WKWebViewConfiguration encodeWithCoder:]):
3293         (-[WKWebViewConfiguration initWithCoder:]):
3294         (-[WKWebViewConfiguration copyWithZone:]):
3295         (-[WKWebViewConfiguration _contentProviderRegistry]):
3296         (-[WKWebViewConfiguration _systemPreviewEnabled]):
3297         (-[WKWebViewConfiguration _setSystemPreviewEnabled:]):
3298         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3299         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.h:
3300         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
3301         (-[WKWebViewContentProviderRegistry initWithConfiguration:]):
3302         (-[WKWebViewContentProviderRegistry init]): Deleted.
3303
3304 2018-06-13  Youenn Fablet  <youenn@apple.com>
3305
3306         Supported plugin check should be based on plugin identifier
3307         https://bugs.webkit.org/show_bug.cgi?id=186578
3308         <rdar://problem/40523828>
3309
3310         Reviewed by Darin Adler.
3311
3312         Refactoring to move from Plugin name to Plugin identifier.
3313         Set built-in pdf plugin identifier.
3314         This allows making sure that the PDF plug-in check might not change according localization.
3315
3316         * Scripts/webkit/messages.py:
3317         * Shared/WebCoreArgumentCoders.cpp:
3318         (IPC::ArgumentCoder<PluginInfo>::encode):
3319         (IPC::ArgumentCoder<PluginInfo>::decode):
3320         * UIProcess/Plugins/PluginInfoStore.cpp:
3321         (WebKit::PluginInfoStore::supportedPluginIdentifiers):
3322         (WebKit::PluginInfoStore::addSupportedPlugin):
3323         (WebKit::PluginInfoStore::supportedPluginNames): Deleted.
3324         * UIProcess/Plugins/PluginInfoStore.h:
3325         * UIProcess/WebProcessProxy.cpp:
3326         (WebKit::WebProcessProxy::getPlugins):
3327         * UIProcess/WebProcessProxy.h:
3328         * UIProcess/WebProcessProxy.messages.in:
3329         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3330         (WebKit::PDFPlugin::pluginInfo):
3331         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
3332         (WebKit::WebPluginInfoProvider::pluginInfo):
3333         (WebKit::WebPluginInfoProvider::webVisiblePluginInfo):
3334         (WebKit::WebPluginInfoProvider::populatePluginCache):
3335         * WebProcess/Plugins/WebPluginInfoProvider.h:
3336
3337 2018-06-13  Chris Dumez  <cdumez@apple.com>
3338
3339         PSON: http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html ASSERTS with process swap enabled
3340         https://bugs.webkit.org/show_bug.cgi?id=186545
3341
3342         Reviewed by Brady Eidson.
3343
3344         Move frame navigation logging for ITP purposes from the WebProcess to the UIProcess.
3345         This information was previously logged in DocumentLoader::willSendRequest() and was getting
3346         sync'd to the UIProcess at regular intervals or when the layout tests call testRunner's
3347         statisticsNotifyObserver(). We now do the logging directly in the UIProcess, in
3348         WebPageProxy::decidePolicyForNavigationAction (which was getting called via IPC from
3349         DocumentLoader::willSendRequest()).
3350
3351         This is more efficient and will also be needed soon due to the way process swap on navigation 
3352         deals with cross-origin redirects. On cross-origin redirect of the main frame, PSON cancels
3353         the load and started a new load to the redirected to URL in the new WebProcess. As a result,
3354         the new WebProcess is not aware that the load is a redirect, which is information that ITP
3355         requires. By moving the ITP logging to the UIProcess, we still have access to this
3356         information.
3357
3358         * UIProcess/WebPageProxy.cpp:
3359         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3360         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
3361         * UIProcess/WebPageProxy.h:
3362         * UIProcess/WebPageProxy.messages.in:
3363         - We now pass the full redirect response the the delegate method instead of a simple
3364         isRedirect boolean.
3365         - Log the navigation in the WebResourceLoadStatisticsStore for ITP purposes.
3366
3367         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3368         (WebKit::areDomainsAssociated):
3369         Equivalent of ResourceLoadObserver's areDomainsAssociated(). Most of the logic was moved
3370         to ResourceLoadStatistics::areDomainsAssociated() to avoid code duplication.
3371
3372         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
3373         This is called whenever a WebProcess sends new resource load statistics to the UIProcess.
3374         Whenever this happens, we call processStatisticsAndDataRecords() right away, which is
3375         sometimes the tests currently rely on. As a result, we can cancels any pending statistics
3376         processing request that was scheduled by logFrameNavigation().
3377
3378         (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsProcessingRequestIfNecessary):
3379         (WebKit::WebResourceLoadStatisticsStore::cancelPendingStatisticsProcessingRequest):
3380         Whenever a navigation is logged and statistics have been updated, we need to make sure we
3381         schedule a "timer" to process the new data. We do this at most every 5 seconds for performance
3382         reasons. This 5 second interval matches what the ResourceLoadObserver is using in the WebProcess
3383         to notify the UIProcess of new data.
3384
3385         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
3386         This code was moved from ResourceLoadObserver to WebResourceLoadStatisticsStore now that we
3387         do this logging in the UIProcess instead of the WebProcess. One difference with WebCore is
3388         that we use WebPageProxy::pageLoadState().url() as mainFrameURL instead of
3389         WebPageProxy::mainFrame().url(). The reason for that is that WebPageProxy::mainFrame().url()
3390         becomes empty in case of process swap but ITP still needs the actual main frame URL when the
3391         navigation was triggered. WebPageProxy::pageLoadState().url() gives us this information.
3392
3393         * UIProcess/WebResourceLoadStatisticsStore.h:
3394
3395         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3396         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3397         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3398         We now pass the full redirect response the the delegate method instead of a simple
3399         isRedirect boolean.
3400
3401 2018-06-13  Brent Fulgham  <bfulgham@apple.com>
3402
3403         Crash during interrupted process termination
3404         https://bugs.webkit.org/show_bug.cgi?id=185373
3405         <rdar://problem/40019480>
3406
3407         Reviewed by Alex Christensen.
3408
3409         It's possible to encounter a crash if a user agent feature (such as Safari's responsiveness timer) decides
3410         to kill a Web Process around the same time that a user decides to trigger a new page load. One of the two
3411         termination operations may attempt to call methods on a nulled process pointer.
3412
3413         We can avoid this by holding our own reference to the terminating process until the termination steps have
3414         been completed.
3415
3416         * UIProcess/API/C/WKPage.cpp:
3417         (WKPageTerminate): Ref<> the active process while the termination call is performed.
3418         * UIProcess/API/Cocoa/WKWebView.mm:
3419         ([WKWebView _killWebContentProcessAndResetState]): Ditto.
3420
3421 2018-06-13  Brian Burg  <bburg@apple.com>
3422
3423         [Cocoa] Web Automation: wrong modifiers sent for 'Help' virtual key
3424         https://bugs.webkit.org/show_bug.cgi?id=186600
3425         <rdar://problem/41088912>
3426
3427         Reviewed by Timothy Hatcher.
3428
3429         This fixes a hang when running W3C test:
3430
3431             special_keys.py::test_webdriver_special_key_sends_keydown[HELP-expected2]
3432
3433         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
3434         (WebKit::eventModifierFlagsForVirtualKey):
3435         The help modifier doesn't seem to be used when pressing the Help key.
3436         I verified this using the Help key on the Keyboard Viewer, since no
3437         keyboards from the past decade actually have this physical button.
3438
3439 2018-06-13  Thibault Saunier  <tsaunier@igalia.com>
3440
3441         [WPE] Build getUserMedia support
3442         https://bugs.webkit.org/show_bug.cgi?id=186547
3443
3444         Reviewed by Alejandro G. Castro.
3445
3446         * SourcesWPE.txt: Compile files necessary for MediaStream/webrtc.
3447
3448 2018-06-13  Andy Estes  <aestes@apple.com>
3449
3450         [iOS] Synchronize PDF resizing with device rotation
3451         https://bugs.webkit.org/show_bug.cgi?id=186587
3452         <rdar://problem/40922462>
3453
3454         Reviewed by Darin Adler.
3455
3456         Both -beginPDFViewRotation and -endPDFViewRotation need to be called as part of
3457         the transition coordinator's -animateAlongsideTransition: block to be synchronized
3458         with rotation. Additionally, updateBlock needs to be invoked between the two calls
3459         so that PDFKit can capture the frame geometry before and after the update.
3460
3461         * UIProcess/API/Cocoa/WKWebView.mm:
3462         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
3463         * UIProcess/Cocoa/WKWebViewContentProvider.h:
3464         * UIProcess/ios/WKPDFView.mm:
3465         (-[WKPDFView web_beginAnimatedResizeWithUpdates:]):
3466         (-[WKPDFView web_beginAnimatedResize]): Renamed to web_beginAnimatedResizeWithUpdates:.
3467         (-[WKPDFView web_endAnimatedResize]): Deleted.
3468
3469 2018-06-12  Brent Fulgham  <bfulgham@apple.com>
3470
3471         Turn CSS Spring Animations and Link Preload off by default for production builds.
3472         https://bugs.webkit.org/show_bug.cgi?id=186548
3473         <rdar://problem/41023774>
3474
3475         Reviewed by Eric Carlson.
3476
3477         * Shared/WebPreferences.yaml: Switch these features from 'on' to
3478         DEFAULT_EXPERIMENTAL_FEATURES_ENABLED.
3479
3480 2018-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>
3481
3482         [WebKit on watchOS] Upstream watchOS source additions to OpenSource (Part 2)
3483         https://bugs.webkit.org/show_bug.cgi?id=186442
3484         <rdar://problem/40879364>
3485
3486         Reviewed by Tim Horton.
3487
3488         Upstream most of the work around form controls on watchOS. Also, rename WKFormControlListViewController.* to
3489         its intended name, WKQuickboardListViewController.*.
3490
3491         * UIProcess/ios/WKContentViewInteraction.mm:
3492         * UIProcess/ios/forms/WKDatePickerViewController.h:
3493         * UIProcess/ios/forms/WKDatePickerViewController.mm:
3494         (datePickerSetButtonHeight):
3495         (datePickerVerticalMargin):
3496         (-[WKDatePickerWheelLabel initWithFrame:]):
3497         (-[WKDatePickerWheelLabel lastSelectedDate]):
3498         (-[WKDatePickerWheelLabel setLastSelectedDate:]):
3499         (-[WKDatePickerWheelLabel needsUpdateForIndex:selectedDate:]):
3500         (-[WKDatePickerWheel initWithStyle:]):
3501         (-[WKDatePickerWheel initWithController:style:]):
3502         (-[WKDatePickerWheel gestureRecognized:]):
3503         (-[WKDatePickerWheel setDrawsFocusOutline:]):
3504         (-[WKDatePickerWheel drawsFocusOutline]):
3505         (-[WKDatePickerWheel gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
3506         (-[WKDatePickerViewController initWithDelegate:]):
3507         (-[WKDatePickerViewController viewDidLoad]):
3508         (-[WKDatePickerViewController prefersStatusBarHidden]):
3509         (-[WKDatePickerViewController viewWillAppear:]):
3510         (-[WKDatePickerViewController viewDidAppear:]):
3511         (-[WKDatePickerViewController viewDidDisappear:]):
3512         (-[WKDatePickerViewController _handleStatusBarNavigation]):
3513         (-[WKDatePickerViewController viewWillLayoutSubviews]):
3514         (-[WKDatePickerViewController becomeFirstResponder]):
3515         (-[WKDatePickerViewController defaultMinimumDate]):
3516         (-[WKDatePickerViewController defaultMaximumDate]):
3517         (-[WKDatePickerViewController _valueForInput]):
3518         (-[WKDatePickerViewController _dateFromInitialText]):
3519         (-[WKDatePickerViewController _setButtonPressed]):
3520         (-[WKDatePickerViewController _updateSelectedPickerViewIndices]):
3521         (-[WKDatePickerViewController _configurePickerView:]):
3522         (-[WKDatePickerViewController setMinimumDate:]):
3523         (-[WKDatePickerViewController minimumDate]):
3524         (-[WKDatePickerViewController setMaximumDate:]):
3525         (-[WKDatePickerViewController maximumDate]):
3526         (-[WKDatePickerViewController setDate:]):
3527         (-[WKDatePickerViewController setDateFromComponents:]):
3528         (-[WKDatePickerViewController setDay:month:year:era:]):
3529         (-[WKDatePickerViewController date]):
3530         (-[WKDatePickerViewController _dateComponentForDay:month:year:era:]):
3531         (-[WKDatePickerViewController _adjustDateToValidDateIfNecessary]):
3532         (-[WKDatePickerViewController _createAndConfigureGranularityLabelWithText:]):
3533         (-[WKDatePickerViewController _canonicalizeAndUpdateSelectedDate]):
3534         (-[WKDatePickerViewController numberOfItemsInPickerView:]):
3535         (-[WKDatePickerViewController pickerView:viewForItemAtIndex:]):
3536         (-[WKDatePickerViewController didBeginInteractingWithDatePicker:]):
3537         (-[WKDatePickerViewController pickerView:didSelectItemAtIndex:]):
3538         (-[WKDatePickerViewController pickerViewWillBeginSelection:]):
3539         (-[WKDatePickerViewController pickerViewDidEndSelection:]):
3540         (-[WKDatePickerViewController _dayFromIndex:]):
3541         (-[WKDatePickerViewController _eraAndYearFromIndex:]):
3542         (-[WKDatePickerViewController _monthFromIndex:]):
3543         (-[WKDatePickerViewController _indexFromDay:]):
3544         (-[WKDatePickerViewController _indexFromYear:era:]):
3545         (-[WKDatePickerViewController _indexFromMonth:]):
3546         * UIProcess/ios/forms/WKFormControlListViewController.h: Removed.
3547         * UIProcess/ios/forms/WKFormControlListViewController.mm: Removed.
3548         * UIProcess/ios/forms/WKNumberPadViewController.h:
3549         * UIProcess/ios/forms/WKNumberPadViewController.mm:
3550         (inputLabelFontSize):
3551         (-[WKNumberPadViewController initWithDelegate:initialText:inputMode:]):
3552         (-[WKNumberPadViewController dealloc]):
3553         (-[WKNumberPadViewController viewDidLoad]):
3554         (-[WKNumberPadViewController viewWillDisappear:]):
3555         (-[WKNumberPadViewController viewWillLayoutSubviews]):
3556         (-[WKNumberPadViewController _reloadHeaderViewFromInputText]):
3557         (-[WKNumberPadViewController didSelectKey:]):
3558         (-[WKNumberPadViewController _handleKeyPress:]):
3559         (-[WKNumberPadViewController _cancelInput]):
3560         (-[WKNumberPadViewController _deleteLastInputCharacter]):
3561         (-[WKNumberPadViewController _deleteButtonPressed]):
3562         (-[WKNumberPadViewController _cancelDeletionTimers]):
3563         (-[WKNumberPadViewController _startDeletionTimer]):
3564         (-[WKNumberPadViewController _deletionTimerFired]):
3565         (-[WKNumberPadViewController addContentViewAnimations:]):
3566         * UIProcess/ios/forms/WKQuickboardListViewController.h: Added.
3567         * UIProcess/ios/forms/WKQuickboardListViewController.mm: Added.
3568         (-[WKQuickboardListItemCell topToLabelBaselineSpecValue]):
3569         (-[WKQuickboardListItemCell baselineToBottomSpecValue]):
3570         (-[WKQuickboardListViewController initWithDelegate:]):
3571         (-[WKQuickboardListViewController updateContextViewIfNeeded]):
3572         (-[WKQuickboardListViewController prefersStatusBarHidden]):
3573         (-[WKQuickboardListViewController viewDidLoad]):
3574         (-[WKQuickboardListViewController viewWillAppear:]):
3575         (-[WKQuickboardListViewController viewDidDisappear:]):
3576         (-[WKQuickboardListViewController _handleStatusBarNavigation]):
3577         (-[WKQuickboardListViewController reloadContextView]):
3578         (-[WKQuickboardListViewController actionController]):
3579         (-[WKQuickboardListViewController languageControllerDidChangePrimaryLanguage:]):
3580         (-[WKQuickboardListViewController headerContentViewHeight]):
3581         (-[WKQuickboardListViewController headerContentView]):
3582         (configureStatusBarForController):
3583         * UIProcess/ios/forms/WKSelectMenuListViewController.h:
3584         * UIProcess/ios/forms/WKSelectMenuListViewController.mm:
3585         (-[WKSelectMenuItemCell initWithStyle:reuseIdentifier:]):
3586         (-[WKSelectMenuItemCell imageView]):
3587         (-[WKSelectMenuListViewController initWithDelegate:]):
3588         (-[WKSelectMenuListViewController viewDidLoad]):
3589         (-[WKSelectMenuListViewController acceptButtonTappedWithCompletion:]):
3590         (-[WKSelectMenuListViewController shouldShowTrayView]):
3591         (-[WKSelectMenuListViewController didSelectListItem:]):
3592         (-[WKSelectMenuListViewController numberOfListItems]):
3593         (-[WKSelectMenuListViewController heightForListItem:width:]):
3594         (-[WKSelectMenuListViewController cellForListItem:]):
3595         (-[WKSelectMenuListViewController selectItemAtIndex:]):
3596         * UIProcess/ios/forms/WKTimePickerViewController.h:
3597         * UIProcess/ios/forms/WKTimePickerViewController.mm:
3598         (-[WKTimePickerViewController initWithDelegate:]):
3599         (-[WKTimePickerViewController dateFormatter]):
3600         (-[WKTimePickerViewController timeValueForFormControls]):
3601         (-[WKTimePickerViewController dateComponentsFromInitialValue]):
3602         (-[WKTimePickerViewController viewDidAppear:]):
3603         (-[WKTimePickerViewController viewDidLoad]):
3604         (-[WKTimePickerViewController becomeFirstResponder]):
3605         (-[WKTimePickerViewController setHour:minute:]):
3606         (-[WKTimePickerViewController leftButtonWOTAction]):
3607         (-[WKTimePickerViewController rightButtonWOTAction]):
3608         * WebKit.xcodeproj/project.pbxproj:
3609
3610 2018-06-12  Jer Noble  <jer.noble@apple.com>
3611
3612         Make Modern EME An Experimental Feature Again
3613         https://bugs.webkit.org/show_bug.cgi?id=186569
3614         <rdar://problem/41054402>
3615
3616         Reviewed by Eric Carlson.
3617
3618         * Shared/WebPreferences.yaml:
3619
3620 2018-06-12  Andy Estes  <aestes@apple.com>
3621
3622         [watchOS] Enable NetworkActivityTracker
3623         https://bugs.webkit.org/show_bug.cgi?id=186568
3624         <rdar://problem/41050624>
3625
3626         Reviewed by Tim Horton.
3627
3628         * NetworkProcess/NetworkActivityTracker.h:
3629
3630 2018-06-12  Antti Koivisto  <antti@apple.com>
3631
3632         Add performance logging for slow cache retrieves
3633         https://bugs.webkit.org/show_bug.cgi?id=186520
3634         <rdar://problem/41002070>
3635
3636         Reviewed by Chris Dumez.
3637
3638         We sometimes see slow cache retrieves in logs. Add some more logging to better analyze these cases.
3639
3640         This patch adds timings to all cache storage retrieve operations and passes them up to the client.
3641         We then log the timings on NetworkResourceLoader levels if needed. Items logged include
3642
3643         - total retrieve time
3644         - dispatch delay and number of resources dispatched before this one
3645         - record I/O time
3646         - blob I/O time
3647         - whether cache shrink was in progress
3648         - whether cache synchronization was in progress
3649         - cancellation
3650
3651         * NetworkProcess/NetworkResourceLoader.cpp:
3652         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
3653         (WebKit::NetworkResourceLoader::logSlowCacheRetrieveIfNeeded):
3654
3655         Log if the retrieve took more than 1s.
3656
3657         * NetworkProcess/NetworkResourceLoader.h:
3658         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3659         (WebKit::CacheStorage::Caches::readRecord):
3660         * NetworkProcess/cache/NetworkCache.cpp:
3661         (WebKit::NetworkCache::Cache::retrieve):
3662         (WebKit::NetworkCache::Cache::completeRetrieve):
3663         (WebKit::NetworkCache::Cache::retrieveData):
3664         * NetworkProcess/cache/NetworkCache.h:
3665         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
3666         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage):
3667         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
3668
3669         SpeculativeLoadManager does not records specific timings yet but at least we do log when they occur.
3670
3671         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3672         (WebKit::NetworkCache::Storage::ReadOperation::cancel):
3673         (WebKit::NetworkCache::Storage::ReadOperation::finish):
3674
3675         Record timing info in ReadOperations.
3676
3677         (WebKit::NetworkCache::Storage::dispatchReadOperation):
3678         (WebKit::NetworkCache::retrieveFromMemory):
3679         (WebKit::NetworkCache::Storage::retrieve):
3680         * NetworkProcess/cache/NetworkCacheStorage.h:
3681
3682 2018-06-11  Carlos Garcia Campos  <cgarcia@igalia.com>
3683
3684         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.21.4 release.
3685
3686         * gtk/NEWS: Add release notes for 2.21.4.
3687
3688 2018-06-11  Youenn Fablet  <youenn@apple.com>
3689
3690         Improve error messages in case FetchEvent.respondWith has a rejected promise
3691         https://bugs.webkit.org/show_bug.cgi?id=186368
3692
3693         Reviewed by Chris Dumez.
3694
3695         Log in JS console in case of failures.
3696         Rely on ThreadableLoader to log which client actually failed.
3697
3698         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
3699         (WebKit::ServiceWorkerClientFetch::didFail):
3700
3701 2018-06-11  Chris Dumez  <cdumez@apple.com>
3702
3703         http/tests/security/xss-DENIED-script-inject-into-inactive-window2.html times out with PSON enabled
3704         https://bugs.webkit.org/show_bug.cgi?id=186546
3705
3706         Reviewed by Brady Eidson.
3707
3708         Disable process swap on navigation in frames that have opened other frames via
3709         window.open(). These new windows may have a WindowProxy to their opener, and it
3710         would therefore be unsafe to process swap at this point.
3711
3712         * Shared/NavigationActionData.cpp:
3713         (WebKit::NavigationActionData::encode const):
3714         (WebKit::NavigationActionData::decode):
3715         * Shared/NavigationActionData.h:
3716         * UIProcess/API/APINavigation.h:
3717         (API::Navigation::setHasOpenedFrames):
3718         (API::Navigation::hasOpenedFrames const):
3719         * UIProcess/WebPageProxy.cpp:
3720         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3721         * UIProcess/WebProcessPool.cpp:
3722         (WebKit::WebProcessPool::processForNavigationInternal):
3723         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3724         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3725
3726 2018-06-11  Keith Rollin  <krollin@apple.com>
3727
3728         Add logging around internalError(const URL&)
3729         https://bugs.webkit.org/show_bug.cgi?id=186369
3730         <rdar://problem/40872046>
3731
3732         Reviewed by Brent Fulgham.
3733
3734         There are times when we receive bug reports where the user says that
3735         they are simply shown a page saying an internal error occurred. To
3736         help understand the circumstances of that error, add some logging to
3737         internalError() in WebErrors.cpp. This logging logs at the Error level
3738         that internalError() was called and then logs a backtrace.
3739
3740         * Shared/WebErrors.cpp:
3741         (WebKit::internalError):
3742
3743 2018-06-11  Tim Horton  <timothy_horton@apple.com>
3744
3745         Link drag image is inconsistently unreadable in dark mode
3746         https://bugs.webkit.org/show_bug.cgi?id=186472
3747
3748         Reviewed by Timothy Hatcher.
3749
3750         * UIProcess/Cocoa/WebViewImpl.mm:
3751         (WebKit::WebViewImpl::useDefaultAppearance):
3752         Make defaultAppearance accurate even if useSystemAppearance is false.
3753         Some parts of WebKit (like the link drag image, but also context menus)
3754         want to be able to follow the system appearance regardless of whether
3755         the view or content has opted in.
3756
3757 2018-06-11  Chris Dumez  <cdumez@apple.com>
3758
3759         http/tests/security/cors-post-redirect-307.html fails with PSON enabled
3760         https://bugs.webkit.org/show_bug.cgi?id=186441
3761
3762         Reviewed by Brady Eidson.
3763
3764         Rename existing flag to something a bit more generic, now that it is used for
3765         more things than bypassing the navigation policy check.
3766
3767         * Shared/LoadParameters.cpp:
3768         (WebKit::LoadParameters::encode const):
3769         (WebKit::LoadParameters::decode):
3770         * Shared/LoadParameters.h:
3771         * UIProcess/WebPageProxy.cpp:
3772         (WebKit::WebPageProxy::reattachToWebProcessForReload):
3773         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
3774         (WebKit::WebPageProxy::loadRequest):
3775         (WebKit::WebPageProxy::loadRequestWithNavigation):
3776         (WebKit::WebPageProxy::goToBackForwardItem):
3777         (WebKit::WebPageProxy::continueNavigationInNewProcess):
3778         * UIProcess/WebPageProxy.h:
3779         * WebProcess/WebPage/WebPage.cpp:
3780         (WebKit::WebPage::loadRequest):
3781         (WebKit::WebPage::goToBackForwardItem):
3782         * WebProcess/WebPage/WebPage.h:
3783         * WebProcess/WebPage/WebPage.messages.in:
3784
3785 2018-06-11  Nan Wang  <n_wang@apple.com>
3786
3787         AX: [iOS] accessibility sometimes doesn't know process suspension is canceled
3788         https://bugs.webkit.org/show_bug.cgi?id=186450
3789
3790         Reviewed by Chris Fleizach.
3791
3792         There's some early return condition in WebProcess::cancelPrepareToSuspend() which
3793         could lead to accessibility failing to post process status notificaiton. Fixed it
3794         by moving the accessibility notification before the early return condition.
3795
3796         * WebProcess/WebProcess.cpp:
3797         (WebKit::WebProcess::cancelPrepareToSuspend):
3798
3799 2018-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3800
3801         [GTK][WPE] Add API run run javascript from a WebKitWebView in an isolated world
3802         https://bugs.webkit.org/show_bug.cgi?id=186192
3803
3804         Reviewed by Michael Catanzaro.
3805
3806         Add webkit_web_view_run_javascript_in_world() that receives a world name. Also add
3807         webkit_script_world_new_with_name() to create an isolated world with a name and webkit_script_world_get_name()
3808         to get the name of a WebKitScriptWorld.
3809
3810         * UIProcess/API/glib/WebKitWebView.cpp:
3811         (webkit_web_view_run_javascript):
3812         (webkit_web_view_run_javascript_finish):
3813         (webkit_web_view_run_javascript_in_world):
3814         (webkit_web_view_run_javascript_in_world_finish):
3815         * UIProcess/API/gtk/WebKitWebView.h:
3816         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
3817         * UIProcess/API/wpe/WebKitWebView.h:
3818         * UIProcess/WebPageProxy.cpp:
3819         (WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld): Send RunJavaScriptInMainFrameScriptWorld message to
3820         the WebProcess.
3821         * UIProcess/WebPageProxy.h:
3822         * WebProcess/InjectedBundle/API/glib/WebKitScriptWorld.cpp:
3823         (webkitScriptWorldCreate):
3824         (webkit_script_world_new_with_name):
3825         (webkit_script_world_get_name):
3826         * WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.h:
3827         * WebProcess/InjectedBundle/API/wpe/WebKitScriptWorld.h:
3828         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
3829         (WebKit::InjectedBundleScriptWorld::find): Find an InjectedBundleScriptWorld by its name.
3830         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
3831         * WebProcess/WebPage/WebPage.cpp:
3832         (WebKit::WebPage::runJavaScriptInMainFrameScriptWorld): Find the InjectedBundleScriptWorld for the given name
3833         and run the script in its js context.
3834         * WebProcess/WebPage/WebPage.h:
3835         * WebProcess/WebPage/WebPage.messages.in: Add RunJavaScriptInMainFrameScriptWorld message.
3836
3837 2018-06-10  Chris Dumez  <cdumez@apple.com>
3838
3839         Reload the Web view in case of crash if the client does not implement webViewWebContentProcessDidTerminate delegate
3840         https://bugs.webkit.org/show_bug.cgi?id=186468
3841
3842         Reviewed by Geoffrey Garen.
3843
3844         We now attempt to reload the Web view if the web content process crashes and the client
3845         does not implement the webViewWebContentProcessDidTerminate delegate (or any of the similar
3846         delegates in our SPI).
3847
3848         * UIProcess/API/APILoaderClient.h:
3849         (API::LoaderClient::processDidCrash):
3850         * UIProcess/API/APINavigationClient.h:
3851         (API::NavigationClient::processDidTerminate):
3852         * UIProcess/API/C/WKPage.cpp:
3853         (WKPageSetPageLoaderClient):
3854         (WKPageSetPageNavigationClient):
3855         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3856         * UIProcess/API/glib/WebKitNavigationClient.cpp:
3857         * UIProcess/Cocoa/NavigationState.h:
3858         * UIProcess/Cocoa/NavigationState.mm:
3859         (WebKit::NavigationState::NavigationClient::processDidTerminate):
3860         * UIProcess/WebPageProxy.cpp:
3861         (WebKit::m_resetRecentCrashCountTimer):
3862         (WebKit::WebPageProxy::didFinishLoadForFrame):
3863         (WebKit::shouldReloadAfterProcessTermination):
3864         (WebKit::WebPageProxy::dispatchProcessDidTerminate):
3865         (WebKit::WebPageProxy::tryReloadAfterProcessTermination):
3866         (WebKit::WebPageProxy::resetRecentCrashCountSoon):
3867         (WebKit::WebPageProxy::resetRecentCrashCount):
3868         (WebKit::m_configurationPreferenceValues): Deleted.
3869         * UIProcess/WebPageProxy.h:
3870
3871 2018-06-09  Dan Bernstein  <mitz@apple.com>
3872
3873         [Xcode] Clean up and modernize some build setting definitions
3874         https://bugs.webkit.org/show_bug.cgi?id=186463
3875
3876         Reviewed by Sam Weinig.
3877
3878         * Configurations/Base.xcconfig: Removed definition for macOS 10.11.
3879         * Configurations/BaseTarget.xcconfig: Simplified the definition of WK_PRIVATE_FRAMEWORKS_DIR
3880           now that WK_XCODE_SUPPORTS_TEXT_BASED_STUBS is true for all supported Xcode versions.
3881         * Configurations/DebugRelease.xcconfig: Removed definition for macOS 10.11.
3882         * Configurations/FeatureDefines.xcconfig: Simplified the definitions of ENABLE_APPLE_PAY and
3883           ENABLE_VIDEO_PRESENTATION_MODE now macOS 10.12 is the earliest supported version.
3884         * Configurations/Version.xcconfig: Removed definition for macOS 10.11.
3885         * Configurations/WebKitTargetConditionals.xcconfig: Removed definitions for macOS 10.11.
3886
3887 2018-06-09  Dan Bernstein  <mitz@apple.com>
3888
3889         Added missing file references to the Configuration group.
3890
3891         * WebKit.xcodeproj/project.pbxproj:
3892
3893 2018-06-08  Wenson Hsieh  <wenson_hsieh@apple.com>
3894
3895         [WebKit on watchOS] Upstream watchOS source additions to OpenSource (Part 1)
3896         https://bugs.webkit.org/show_bug.cgi?id=186442
3897         <rdar://problem/40879364>
3898
3899         Reviewed by Tim Horton.
3900
3901         * Configurations/FeatureDefines.xcconfig:
3902         * UIProcess/ios/WKContentViewInteraction.mm:
3903         (-[WKContentView dismissQuickboardViewControllerAndRevealFocusedFormOverlayIfNecessary:]):
3904         (-[WKContentView quickboard:textEntered:]):
3905         (-[WKContentView quickboardInputCancelled:]):
3906         (-[WKContentView viewController:inputContextViewHeightForSize:]):
3907         (-[WKContentView allowsLanguageSelectionMenuForListViewController:]):
3908         (-[WKContentView inputContextViewForViewController:]):
3909         (-[WKContentView inputLabelTextForViewController:]):
3910         (-[WKContentView initialValueForViewController:]):
3911         (-[WKContentView shouldDisplayInputContextViewForListViewController:]):
3912         (-[WKContentView numericInputModeForListViewController:]):
3913         (-[WKContentView textContentTypeForListViewController:]):
3914         (-[WKContentView textSuggestionsForListViewController:]):
3915         (-[WKContentView listViewController:didSelectTextSuggestion:]):
3916         (-[WKContentView allowsDictationInputForListViewController:]):
3917         * UIProcess/ios/WKScrollView.mm:
3918         (-[WKScrollView initWithFrame:]):
3919         (-[WKScrollView addGestureRecognizer:]):
3920         (-[WKScrollView _configureDigitalCrownScrolling]):
3921         (-[WKScrollView _puic_contentOffsetForCrownInputSequencerOffset:]):
3922         * UIProcess/ios/forms/WKFocusedFormControlView.h:
3923         * UIProcess/ios/forms/WKFocusedFormControlView.mm:
3924         (pathWithRoundedRectInFrame):
3925         (-[WKFocusedFormControlView initWithFrame:delegate:]):
3926         (-[WKFocusedFormControlView handleWheelEvent:]):
3927         (-[WKFocusedFormControlView show:]):
3928         (-[WKFocusedFormControlView hide:]):
3929         (-[WKFocusedFormControlView delegate]):
3930         (-[WKFocusedFormControlView setDelegate:]):
3931         (-[WKFocusedFormControlView dimmingMaskLayer]):
3932         (-[WKFocusedFormControlView handleTap]):
3933         (-[WKFocusedFormControlView _wheelChangedWithEvent:]):
3934         (-[WKFocusedFormControlView didDismiss]):
3935         (-[WKFocusedFormControlView didSubmit]):
3936         (-[WKFocusedFormControlView layoutSubviews]):
3937         (-[WKFocusedFormControlView setHighlightedFrame:]):
3938         (-[WKFocusedFormControlView computeDimmingViewCutoutPath]):
3939         (-[WKFocusedFormControlView disengageFocusedFormControlNavigation]):
3940         (-[WKFocusedFormControlView engageFocusedFormControlNavigation]):
3941         (-[WKFocusedFormControlView reloadData:]):
3942         (-[WKFocusedFormControlView setMaskLayerPosition:animated:]):
3943         (-[WKFocusedFormControlView setHighlightedFrame:animated:]):
3944         (-[WKFocusedFormControlView submitActionName]):
3945         (submitActionNameFontAttributes):
3946         (-[WKFocusedFormControlView setSubmitActionName:]):
3947         (-[WKFocusedFormControlView scrollViewForCrownInputSequencer]):
3948         (-[WKFocusedFormControlView updateViewForCurrentCrownInputSequencerState]):
3949         (-[WKFocusedFormControlView scrollOffsetForCrownInputOffset:]):
3950         (-[WKFocusedFormControlView _crownInputSequencerTimerFired]):
3951         (-[WKFocusedFormControlView cancelPendingCrownInputSequencerUpdate]):
3952         (-[WKFocusedFormControlView scheduleCrownInputSequencerUpdate]):
3953         (-[WKFocusedFormControlView crownInputSequencerOffsetDidChange:]):
3954         (-[WKFocusedFormControlView crownInputSequencerDidBecomeIdle:willDecelerate:]):
3955         (-[WKFocusedFormControlView crownInputSequencerIdleDidChange:]):
3956         (-[WKFocusedFormControlView suggestions]):
3957         (-[WKFocusedFormControlView setSuggestions:]):
3958         (-[WKFocusedFormControlView handleWebViewCredentialsSaveForWebsiteURL:user:password:passwordIsAutoGenerated:]):
3959         (-[WKFocusedFormControlView selectionWillChange:]):
3960         (-[WKFocusedFormControlView selectionDidChange:]):
3961         (-[WKFocusedFormControlView textWillChange:]):
3962         (-[WKFocusedFormControlView textDidChange:]):
3963
3964 2018-06-08  Per Arne Vollan  <pvollan@apple.com>
3965
3966         Only display refresh monitors having requested display refresh callback should get notified on screen updates.
3967         https://bugs.webkit.org/show_bug.cgi?id=186397
3968         <rdar://problem/40897835>
3969
3970         Reviewed by Brent Fulgham.
3971
3972         Since all display refresh monitors in the WebContent process share a single UI process display link,
3973         we should make sure that only the monitors having requested callback are getting notified on screen
3974         updates. I have not been able to reproduce a case where a monitor is being notified without having
3975         requested updates, but we should safeguard the code for future code changes.
3976
3977         * WebProcess/WebPage/mac/DrawingAreaMac.cpp:
3978
3979 2018-06-08  Aditya Keerthi  <akeerthi@apple.com>
3980
3981         [Datalist] Allow TextFieldInputType to show and hide suggestions
3982         https://bugs.webkit.org/show_bug.cgi?id=186151
3983
3984         Reviewed by Tim Horton.
3985
3986         Added WebDataListSuggestionPicker to send messages to the UIProcess in order to update the suggestions view.
3987         This object is also responsible for forwarding messages from WebKit into the DataListSuggestionsClient, which
3988         is the TextFieldInputType in this case. The client needs to know when the suggestions are hidden or if an
3989         suggestion has been selected.
3990
3991         * WebKit.xcodeproj/project.pbxproj:
3992         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3993         (WebKit::WebChromeClient::createDataListSuggestionPicker): Responsible for creating WebDataListSuggestionPicker to send/receive messages.
3994         * WebProcess/WebCoreSupport/WebChromeClient.h:
3995         * WebProcess/WebCoreSupport/WebDataListSuggestionPicker.cpp: Added. Responsible for sending messages to UIProcess and updating the DataListSuggestionsClient.
3996         (WebKit::WebDataListSuggestionPicker::WebDataListSuggestionPicker):
3997         (WebKit::WebDataListSuggestionPicker::~WebDataListSuggestionPicker):
3998         (WebKit::WebDataListSuggestionPicker::handleKeydownWithIdentifier):