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