76a11fc426e7b9b9e0573ae3fb21358bd9078795
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-03-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2
3         REGRESSION(r229998): WebDriver: MiniBrowser is crashing in a lot of tests after r229998
4         https://bugs.webkit.org/show_bug.cgi?id=184075
5
6         Reviewed by Žan Doberšek.
7
8         This is because we are using a value after it has been moved.
9
10         * UIProcess/Automation/WebAutomationSession.cpp:
11         (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext): Save a reference to page in a local variable
12         before using it when it's also going to be moved in the lambda capture.
13
14 2018-03-27  Michael Catanzaro  <mcatanzaro@igalia.com>
15
16         Unreviewed, fix typo in variable name
17
18         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
19         (webkitWebViewBaseCrossingNotifyEvent):
20
21 2018-03-27  Per Arne Vollan  <pvollan@apple.com>
22
23         The layout test fast/canvas/webgl/read-pixels-test.html is timing out.
24         https://bugs.webkit.org/show_bug.cgi?id=183923
25         <rdar://problem/38756869>
26
27         Reviewed by Brent Fulgham.
28
29         Send OpenGL display mask to the WebContent process when the display ID is changing.
30
31         * UIProcess/WebPageProxy.cpp:
32         (WebKit::WebPageProxy::windowScreenDidChange):
33         * WebProcess/WebPage/WebPage.h:
34         * WebProcess/WebPage/WebPage.messages.in:
35         * WebProcess/WebPage/mac/WebPageMac.mm:
36         (WebKit::WebPage::openGLDisplayMaskChanged):
37
38 2018-03-27  Youenn Fablet  <youenn@apple.com>
39
40         Move request checking out of PingLoad for future reuse in NetworkLoad
41         https://bugs.webkit.org/show_bug.cgi?id=183865
42
43         Reviewed by Chris Dumez.
44
45         Introduce NetworkLoadChecker as a way to validate requests before sending them in the network process.
46         Validation encompasses: CORS checks, CSP and Content Extensions on both main request and redirected requests if any.
47
48         Make PingLoad use NetworkLoadChecker. Future patch should make NetworkLoad to use it as well whenever needed.
49
50         Make NetworkCORSPreflightChecker takes a CompletionHandler instead of a Function.
51         Ensure this callback is called even if preflight is not completed by returning a Canceled error.
52
53         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
54         (WebKit::NetworkCORSPreflightChecker::~NetworkCORSPreflightChecker):
55         (WebKit::NetworkCORSPreflightChecker::returnResult):
56         (WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection):
57         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
58         (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
59         * NetworkProcess/NetworkCORSPreflightChecker.h:
60         * NetworkProcess/NetworkLoadChecker.cpp: Added.
61         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
62         (WebKit::NetworkLoadChecker::check):
63         (WebKit::NetworkLoadChecker::checkRedirection):
64         (WebKit::NetworkLoadChecker::returnError):
65         (WebKit::NetworkLoadChecker::checkRequest):
66         (WebKit::NetworkLoadChecker::checkCORSRequest):
67         (WebKit::NetworkLoadChecker::checkCORSRedirectedRequest):
68         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
69         (WebKit::NetworkLoadChecker::doesNotNeedCORSCheck const):
70         (WebKit::NetworkLoadChecker::contentSecurityPolicy const):
71         (WebKit::NetworkLoadChecker::contentExtensionsBackend):
72         (WebKit::NetworkLoadChecker::processContentExtensionRulesForLoad):
73         * NetworkProcess/NetworkLoadChecker.h: Added.
74         (WebKit::NetworkLoadChecker::setCSPResponseHeaders):
75         (WebKit::NetworkLoadChecker::setContentExtensionRuleLists):
76         (WebKit::NetworkLoadChecker::url const):
77         (WebKit::NetworkLoadChecker::storedCredentialsPolicy const):
78         (WebKit::NetworkLoadChecker::isChecking const):
79         (WebKit::NetworkLoadChecker::isRedirected const):
80         * NetworkProcess/PingLoad.cpp:
81         (WebKit::PingLoad::PingLoad):
82         (WebKit::PingLoad::~PingLoad):
83         (WebKit::PingLoad::willPerformHTTPRedirection):
84         (WebKit::PingLoad::didReceiveChallenge):
85         (WebKit::PingLoad::wasBlocked):
86         (WebKit::PingLoad::cannotShowURL):
87         (WebKit::PingLoad::timeoutTimerFired):
88         (WebKit::PingLoad::currentURL const):
89         * NetworkProcess/PingLoad.h:
90         * WebKit.xcodeproj/project.pbxproj:
91
92 2018-03-27  Jiewen Tan  <jiewen_tan@apple.com>
93
94         [WebAuthN] Implement authenticatorGetAssertion
95         https://bugs.webkit.org/show_bug.cgi?id=183881
96         <rdar://problem/37258628>
97
98         Reviewed by Brent Fulgham.
99
100         * Shared/WebPreferences.yaml:
101         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
102         (WebKit::WebCredentialsMessengerProxy::makeCredential):
103         (WebKit::WebCredentialsMessengerProxy::getAssertion):
104         (WebKit::WebCredentialsMessengerProxy::getAssertionReply):
105         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
106         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in:
107         * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp:
108         (WebKit::WebCredentialsMessenger::getAssertion):
109         (WebKit::WebCredentialsMessenger::getAssertionReply):
110         * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in:
111
112 2018-03-27  Chris Dumez  <cdumez@apple.com>
113
114         Avoid constructing SecurityOrigin objects from non-main threads
115         https://bugs.webkit.org/show_bug.cgi?id=184024
116
117         Reviewed by Youenn Fablet.
118
119         Avoid constructing SecurityOrigin objects from non-main threads as much as possible.
120
121         * WebProcess/Storage/WebSWClientConnection.cpp:
122         (WebKit::WebSWClientConnection::mayHaveServiceWorkerRegisteredForOrigin const):
123         (WebKit::WebSWClientConnection::matchRegistration):
124         (WebKit::WebSWClientConnection::getRegistrations):
125         * WebProcess/Storage/WebSWClientConnection.h:
126         * WebProcess/Storage/WebSWOriginTable.cpp:
127         (WebKit::WebSWOriginTable::contains const):
128         * WebProcess/Storage/WebSWOriginTable.h:
129
130 2018-03-27  Chris Dumez  <cdumez@apple.com>
131
132         Move online state detection from the WebProcess to the NetworkProcess
133         https://bugs.webkit.org/show_bug.cgi?id=183989
134         <rdar://problem/37093299>
135
136         Reviewed by Youenn Fablet.
137
138         Move online state detection from the WebProcess to the NetworkProcess. This avoid executing the same (expensive) code in
139         EACH web process whenever a network interface's state changes. Now, the Network Process monitors network interfaces
140         and determines the online state whenever an interface's state changes. If the onLine state changes, it notifies all
141         its connected WebProcesses via IPC.
142
143         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
144         (WebKit::NetworkConnectionToWebProcess::setOnLineState):
145         * NetworkProcess/NetworkConnectionToWebProcess.h:
146         * NetworkProcess/NetworkProcess.cpp:
147         (WebKit::NetworkProcess::NetworkProcess):
148         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
149         * WebProcess/Network/NetworkProcessConnection.cpp:
150         (WebKit::NetworkProcessConnection::setOnLineState):
151         * WebProcess/Network/NetworkProcessConnection.h:
152         * WebProcess/Network/NetworkProcessConnection.messages.in:
153         * WebProcess/Network/WebLoaderStrategy.cpp:
154         (WebKit::WebLoaderStrategy::isOnLine const):
155         (WebKit::WebLoaderStrategy::addOnlineStateChangeListener):
156         (WebKit::WebLoaderStrategy::setOnLineState):
157         * WebProcess/Network/WebLoaderStrategy.h:
158
159 2018-03-27  Wenson Hsieh  <wenson_hsieh@apple.com>
160
161         [Extra zoom mode] Add support for new focused form control overlay behaviors
162         https://bugs.webkit.org/show_bug.cgi?id=184043
163         <rdar://problem/38758727>
164
165         Reviewed by Tim Horton.
166
167         See below for more details.
168
169         * UIProcess/ios/WKContentViewInteraction.mm:
170         (-[WKContentView _willStartScrollingOrZooming]):
171         (-[WKContentView _didEndScrollingOrZooming]):
172
173         Suppress focused form control navigation while the scroll view is undergoing a scroll or zoom animation (e.g.,
174         when moving from one focused form control to another).
175
176         (-[WKContentView textInputController:didCommitText:withSuggestion:]):
177
178         When dismissing an input view controller, allow focused form control navigation only after updating assisted
179         node information to ensure that focus rects aren't stale as the user begins to navigate between forms.
180
181         (-[WKContentView rectForFocusedFormControlController:inCoordinateSpace:]):
182         (-[WKContentView nextRectForFocusedFormControlController:inCoordinateSpace:]):
183         (-[WKContentView previousRectForFocusedFormControlController:inCoordinateSpace:]):
184         (-[WKContentView scrollViewForFocusedFormControlController:]):
185         (-[WKContentView highlightedRectForFocusedFormControlController:inCoordinateSpace:]): Deleted.
186
187         Implement some new focused form overlay delegate hooks to vend the scroll view, as well as the rects of next and
188         previous focusable form controls.
189
190 2018-03-27  Brent Fulgham  <bfulgham@apple.com>
191
192         Further refine cookie read/write logging
193         https://bugs.webkit.org/show_bug.cgi?id=184044
194         <rdar://problem/38915610>
195
196         Reviewed by Chris Dumez.
197
198         Cookie logging was passing the partition, rather than the first party, when logging, which
199         prevented logging in cases where partitioning or blocking was active. This patch corrects
200         these calls so that logging is generated in these cases, too.
201
202         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
203         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM): Call log routines if needed.
204         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): Ditto.
205         * NetworkProcess/NetworkResourceLoader.cpp:
206         (WebKit::escapeIDForJSON): Make available to use in multiple functions.
207         (WebKit::NetworkResourceLoader::logCookieInformation const): Revise to use shared
208         convenience functions.
209         (WebKit::logBlockedCookieInformation): Added.
210         (WebKit::logCookieInformationInternal): Added.
211         (WebKit::NetworkResourceLoader::logCookieInformation): Revise to use shared
212         convenience functions.
213         * NetworkProcess/NetworkResourceLoader.h:
214
215 2018-03-27  Brian Burg  <bburg@apple.com>
216
217         Web Automation: support enter/exit fullscreen and hide/restore window operations
218         https://bugs.webkit.org/show_bug.cgi?id=182837
219         <rdar://problem/37580732>
220
221         Reviewed by Tim Horton.
222
223         The W3C specification is more explicit about when to exit fullscreen and
224         restore the window for a browsing context. So, WebKit needs to have support
225         for performing these operations on behalf of a driver.
226
227         Based on prototyping, it is sufficient to use a JavaScript atom to enter
228         fullscreen mode. This is included in the patch as EnterFullscreen.js and
229         can be used to implement the §10.7.5 Fullscreen Window command.
230
231         Other window operations cannot be peformed from JavaScript, so we need to
232         delegate these operations to the session client (i.e., Safari).
233         This patch adds session client callouts for restoring, minimizing, and
234         switching to a browsing context.
235
236         Exiting fullscreen happens implicitly (per specification) when setting a
237         window frame without an actual frame, or when switching/restoring/minimizing a window.
238         If needed, a driver can call Set Window Rect in this way to unfullscreen a context.
239         Similarly, a driver can restore a minimized window using Set Window Rect.
240
241         * UIProcess/API/APIAutomationSessionClient.h:
242         (API::AutomationSessionClient::requestHideWindowOfPage):
243         (API::AutomationSessionClient::requestRestoreWindowOfPage):
244         (API::AutomationSessionClient::requestSwitchToPage):
245         Add new API client methods.
246
247         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
248         Add new Cocoa API delegate methods.
249
250         * UIProcess/Automation/Automation.json:
251         Make the switch to browsing context command asynchronous, since this functionality
252         is not always synchronous, and we prefer to use completion handlers in the delegates.
253
254         Add new protocol method for hiding the window of a browsing context.
255         This is expected to minimize/miniaturize a window for desktop window managers.
256
257         * UIProcess/Automation/WebAutomationSession.h:
258         * UIProcess/Automation/WebAutomationSession.cpp:
259         (WebKit::WebAutomationSession::switchToBrowsingContext):
260         Make this function asynchronous. Call out to the session client.
261
262         (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):
263         Follow the steps in the specification to restore window and exit fullscreen.
264
265         (WebKit::WebAutomationSession::hideWindowOfBrowsingContext):
266         Exit fullscreen and call out to the session client.
267
268         (WebKit::WebAutomationSession::exitFullscreenWindowForPage):
269         This is a little strange. Because there is no async API for exiting fullscreen
270         from C++ code, we hook into willEnterFullScreen and didExitFullScreen and send
271         out the response if the page exited fullscreen after we requested it to do so.
272         Because the W3C specification mandates that drivers only process one command at
273         a time, there will only ever be one callback installed by this method at a time.
274
275         (WebKit::WebAutomationSession::restoreWindowForPage):
276         (WebKit::WebAutomationSession::hideWindowForPage):
277         Call out to the session client.
278
279         (WebKit::WebAutomationSession::didEnterFullScreenForPage):
280         (WebKit::WebAutomationSession::didExitFullScreenForPage):
281         Add methods to be called by instrumentation hooks in WebFullScreenManagerProxy.
282
283         * UIProcess/Automation/atoms/EnterFullscreen.js: Added.
284         (enterFullscreen):
285
286         * UIProcess/Cocoa/AutomationSessionClient.h:
287         * UIProcess/Cocoa/AutomationSessionClient.mm:
288         (WebKit::AutomationSessionClient::AutomationSessionClient):
289         (WebKit::AutomationSessionClient::requestSwitchToPage):
290         (WebKit::AutomationSessionClient::requestHideWindowOfPage):
291         (WebKit::AutomationSessionClient::requestRestoreWindowOfPage):
292         (WebKit::AutomationSessionClient::isShowingJavaScriptDialogOnPage):
293         Add boilerplate to convert C++ API client to Objective-C delegate methods.
294
295         * UIProcess/WebFullScreenManagerProxy.cpp:
296         (WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
297         (WebKit::WebFullScreenManagerProxy::didExitFullScreen):
298         Notify the automation session if the page is under automation and
299         enters or exits fullscreen.
300
301         * WebKit.xcodeproj/project.pbxproj:
302         Add EnterFullscreen.js to the list of WebDriver atoms. These are copied
303         as WebKit2 private headers and used by driver implementations.
304
305 2018-03-27  Eric Carlson  <eric.carlson@apple.com>
306
307         Make AVFoundationEnabled preference available on iOS
308         https://bugs.webkit.org/show_bug.cgi?id=183876
309         <rdar://problem/38726459>
310
311         Reviewed by Youenn Fablet.
312
313         * Shared/WebPreferences.yaml: Set AVFoundationEnabled with DEFAULT_AVFOUNDATION_ENABLED.
314         * Shared/WebPreferencesDefaultValues.h:
315
316         * UIProcess/API/Cocoa/WKPreferences.mm:
317         (-[WKPreferences _setAVFoundationEnabled:]): Enable for iOS.
318         (-[WKPreferences _avFoundationEnabled]): Ditto.
319         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
320
321 2018-03-26  Tim Horton  <timothy_horton@apple.com>
322
323         Adopt WK_ALTERNATE_FRAMEWORKS_DIR in WebKit
324         https://bugs.webkit.org/show_bug.cgi?id=184030
325         <rdar://problem/38895281>
326
327         Reviewed by Dan Bernstein.
328
329         * Configurations/Base.xcconfig:
330         * Configurations/BaseTarget.xcconfig:
331         * Configurations/WebKit.xcconfig:
332
333 2018-03-26  Tim Horton  <timothy_horton@apple.com>
334
335         Add and adopt HAVE(CORE_ANIMATION_RENDER_SERVER)
336         https://bugs.webkit.org/show_bug.cgi?id=184026
337         <rdar://problem/38883321>
338
339         Reviewed by Sam Weinig.
340
341         * UIProcess/API/Cocoa/WKWebView.mm:
342         (-[WKWebView _takeViewSnapshot]):
343         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
344
345 2018-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
346
347         [Extra zoom mode] Refactor input view controller presentation and dismissal helpers
348         https://bugs.webkit.org/show_bug.cgi?id=184020
349         Work towards <rdar://problem/38758727>
350
351         Reviewed by Tim Horton.
352
353         We currently have separate presentation and dismissal helpers for each type of view controller corresponding to
354         a focused element type. This is excessive, considering that all of these helpers are only invoked from one place
355         (either -presentViewControllerForCurrentAssistedNode or -dismissAllInputViewControllers), with the exception of
356         the focused form control overlay.
357
358         This refactoring allows us to then adjust the timing of first responder restoration logic, such that the focused
359         form control view controller can receive forwarded events from the web view. See below for more detail.
360
361         * UIProcess/ios/WKContentViewInteraction.mm:
362         (-[WKContentView presentFocusedFormControlViewController:]):
363         (-[WKContentView dismissFocusedFormControlViewController:]):
364
365         Remove logic to restore the web view as first responder.
366
367         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
368         (-[WKContentView dismissAllInputViewControllers]):
369
370         Restore first responder after dismissing a view controller that was presented when focusing a form control, only
371         if the web view was first responder before presentation.
372
373         (-[WKContentView presentDatePickerViewController:]): Deleted.
374         (-[WKContentView dismissDatePickerViewController:]): Deleted.
375         (-[WKContentView presentTimePickerViewController:]): Deleted.
376         (-[WKContentView dismissTimePickerViewController:]): Deleted.
377         (-[WKContentView presentSelectMenuViewController:]): Deleted.
378         (-[WKContentView dismissSelectMenuViewController:]): Deleted.
379         (-[WKContentView dismissNumberPadViewController:]): Deleted.
380         (-[WKContentView presentNumberPadViewController:]): Deleted.
381         (-[WKContentView presentTextInputViewController:]): Deleted.
382         (-[WKContentView dismissTextInputViewController:]): Deleted.
383
384 2018-03-06  Brian Burg  <bburg@apple.com>
385
386         Web Automation: provide a way to ask clients for a new tab or window
387         https://bugs.webkit.org/show_bug.cgi?id=183381
388         <rdar://problem/38167301>
389
390         Reviewed by Timothy Hatcher.
391
392         Add support for specifying browsing context options when requesting
393         a new browsing context from the automation session client/delegate.
394         This is currently just used for specifying tab vs window, but could
395         also be used for things like toggling certain browser chrome or features.
396
397         There is no guarantee that the client has a notion of tabs vs windows,
398         so this option is purely advisory and should not cause the command to
399         fail if it cannot be honored.
400
401         This behavior caused by specifying this option is client-specific, so no
402         new tests are included in WebKit for this change.
403
404         * UIProcess/API/APIAutomationSessionClient.h:
405         (API::AutomationSessionClient::didRequestNewPageWithOptions):
406         (API::AutomationSessionClient::didRequestNewWindow): Deleted.
407         Add options parameter.
408
409         * UIProcess/API/glib/WebKitAutomationSession.cpp:
410         Adjust to new signature. More work is needed to plumb this information
411         to the public API for GTK/WPE and support it in WebKitGTK driver.
412
413         * UIProcess/Automation/Automation.json: Add new optional parameter.
414
415         * UIProcess/Automation/WebAutomationSession.h:
416         * UIProcess/Automation/WebAutomationSession.cpp:
417         (WebKit::WebAutomationSession::createBrowsingContext):
418         Convert the protocol option to an API option.
419
420         * UIProcess/Cocoa/AutomationSessionClient.h:
421         * UIProcess/Cocoa/AutomationSessionClient.mm:
422         (WebKit::AutomationSessionClient::AutomationSessionClient):
423         (WebKit::toAPI):
424         (WebKit::AutomationSessionClient::didRequestNewPageWithOptions):
425         (WebKit::AutomationSessionClient::didRequestNewWindow): Deleted.
426         Convert the internal option to a Cocoa SPI option and pass it along.
427
428         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
429         Adjust delegate methods to include options. Clients need to adopt the new signature(s).
430
431 2018-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
432
433         [Extra zoom mode] Add plumbing for next and previous focusable element rects
434         https://bugs.webkit.org/show_bug.cgi?id=184016
435         Work towards <rdar://problem/38758727>
436
437         Reviewed by Tim Horton.
438
439         When building up AssistedNodeInformation, we currently compute the element rect of the current focused element,
440         as well as flags indicating whether or not there are next or previous focusable elements. For
441         <rdar://problem/38758727>, we additionally send the rects of the next or previous focusable elements as well.
442
443         * Shared/AssistedNodeInformation.cpp:
444         (WebKit::AssistedNodeInformation::encode const):
445         (WebKit::AssistedNodeInformation::decode):
446
447         IPC support for nextNodeRect and previousNodeRect.
448
449         * Shared/AssistedNodeInformation.h:
450         * WebProcess/WebPage/ios/WebPageIOS.mm:
451         (WebKit::elementRectInRootViewCoordinates):
452
453         Add a helper to compute an element's rect in root view coordinates. We use this to compute the rects of the
454         current focused element as well as those of the next and previous elements, if any.
455
456         (WebKit::WebPage::getAssistedNodeInformation):
457         (WebKit::hasAssistableElement): Deleted.
458
459         Since we need the next or previous focusable element to get its rect, we don't need this helper anymore.
460
461 2018-03-26  Chris Dumez  <cdumez@apple.com>
462
463         Use SecurityOriginData more consistently in Service Worker code
464         https://bugs.webkit.org/show_bug.cgi?id=183969
465
466         Reviewed by Darin Adler.
467
468         Use SecurityOriginData more consistently in Service Worker code to avoid constructing
469         SecurityOrigin objects unnecessarily.
470
471         * NetworkProcess/NetworkResourceLoadParameters.cpp:
472         (WebKit::NetworkResourceLoadParameters::encode const):
473         * Shared/API/c/WKSecurityOriginRef.cpp:
474         (WKSecurityOriginCopyDatabaseIdentifier):
475         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
476         (WebKit::WebSWOriginStore::addToStore):
477         (WebKit::WebSWOriginStore::removeFromStore):
478         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
479         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
480         (WebKit::WebSWServerConnection::scheduleJobInServer):
481         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
482         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
483         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
484         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
485         * StorageProcess/StorageProcess.cpp:
486         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
487         (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
488         (WebKit::StorageProcess::createStorageToWebProcessConnection):
489         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
490         (WebKit::StorageProcess::serverToContextConnectionForOrigin):
491         (WebKit::StorageProcess::createServerToContextConnection):
492         (WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
493         * StorageProcess/StorageProcess.h:
494         * UIProcess/API/APIFrameInfo.cpp:
495         (API::FrameInfo::create):
496         * UIProcess/API/C/WKApplicationCacheManager.cpp:
497         (WKApplicationCacheManagerDeleteEntriesForOrigin):
498         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
499         (WKKeyValueStorageManagerDeleteEntriesForOrigin):
500         * UIProcess/API/C/WKResourceCacheManager.cpp:
501         (WKResourceCacheManagerClearCacheForOrigin):
502         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
503         (WKWebsiteDataStoreRemoveFetchCacheForOrigin):
504         (WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
505         * UIProcess/ServiceWorkerProcessProxy.cpp:
506         (WebKit::ServiceWorkerProcessProxy::create):
507         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
508         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
509         * UIProcess/ServiceWorkerProcessProxy.h:
510         * UIProcess/Storage/StorageProcessProxy.cpp:
511         (WebKit::StorageProcessProxy::getStorageProcessConnection):
512         * UIProcess/WebProcessPool.cpp:
513         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
514         (WebKit::WebProcessPool::disconnectProcess):
515         (WebKit::WebProcessPool::updateProcessAssertions):
516         * UIProcess/WebProcessPool.h:
517         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
518         (WebKit::WebsiteDataStore::fetchDataAndApply):
519         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
520         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
521         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
522         (WKBundlePageCopyOriginsWithApplicationCache):
523         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
524         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
525         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
526         * WebProcess/Storage/WebSWClientConnection.cpp:
527         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
528         (WebKit::WebSWClientConnection::matchRegistration):
529         (WebKit::WebSWClientConnection::whenRegistrationReady):
530         (WebKit::WebSWClientConnection::getRegistrations):
531         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
532         (WebKit::WebChromeClient::exceededDatabaseQuota):
533         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
534         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
535         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
536         * WebProcess/WebProcess.cpp:
537         (WebKit::WebProcess::fetchWebsiteData):
538         * WebProcess/WebStorage/StorageAreaImpl.cpp:
539         (WebKit::StorageAreaImpl::securityOrigin const):
540         * WebProcess/WebStorage/StorageAreaImpl.h:
541         * WebProcess/WebStorage/StorageAreaMap.cpp:
542         (WebKit::StorageAreaMap::StorageAreaMap):
543         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
544         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
545         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
546         (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):
547
548 2018-03-26  Brent Fulgham  <bfulgham@apple.com>
549
550         Warn against cookie access in the WebContent process using ProcessPrivilege assertions
551         https://bugs.webkit.org/show_bug.cgi?id=183911
552         <rdar://problem/38762306>
553
554         Reviewed by Youenn Fablet.
555
556         Add a set of ProcessPrivilege assertions to enforce the rule that the WebContent process
557         should never call Cookie API directly. That should only happen in the Networking or
558         UIProcess. 
559
560         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
561         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
562         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
563         * NetworkProcess/NetworkProcess.cpp:
564         (WebKit::NetworkProcess::initializeNetworkProcess):
565         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
566         (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
567         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
568         (WebKit::NetworkProcess::setSharedHTTPCookieStorage):
569         (WebKit::NetworkProcess::syncAllCookies):
570         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
571         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
572         * NetworkProcess/mac/RemoteNetworkingContext.mm:
573         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
574         * PluginProcess/PluginProcess.cpp:
575         (WebKit::PluginProcess::initializeProcess):
576         * Shared/cf/CookieStorageUtilsCF.mm:
577         (WebKit::cookieStorageFromIdentifyingData):
578         (WebKit::identifyingDataFromCookieStorage):
579         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
580         (WebKit::WebProcessPool::platformInitializeWebProcess):
581         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
582         (WebKit::privateBrowsingSession):
583         * UIProcess/WebProcessPool.cpp:
584         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
585         (WebKit::WebsiteDataStore::parameters):
586         * UIProcess/mac/WebCookieManagerProxyMac.mm:
587         (WebKit::WebCookieManagerProxy::persistHTTPCookieAcceptPolicy):
588         * WebProcess/InjectedBundle/InjectedBundle.cpp:
589         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
590         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
591         (WebKit::WebFrameLoaderClient::createNetworkingContext):
592         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
593         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
594         (WebKit::WebFrameNetworkingContext::storageSession const):
595         * WebProcess/WebProcess.cpp:
596         (WebKit::WebProcess::initializeProcess):
597
598 2018-03-26  Alex Christensen  <achristensen@webkit.org>
599
600         Merge ResourceHandleClient::willCacheResponseAsync with ResourceHandleClient::willCacheResponse
601         https://bugs.webkit.org/show_bug.cgi?id=183965
602
603         Reviewed by Chris Dumez.
604
605         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
606         (WebKit::WebFrameLoaderClient::willCacheResponse const):
607         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
608
609 2018-03-25  Carlos Garcia Campos  <cgarcia@igalia.com>
610
611         [GTK][WPE] Add API to convert between DOM and JSCValue
612         https://bugs.webkit.org/show_bug.cgi?id=183448
613
614         Reviewed by Michael Catanzaro.
615
616         Add methods to get a JSCValue for a WebKitDOMObject and to create a WebKitDOMNode from a JSCValue. Deprecate
617         most of the GTK+ DOM bindings API and move the non-deprecated parts to glib dir to be exposed by WPE too.
618
619         * PlatformGTK.cmake:
620         * PlatformWPE.cmake:
621         * SourcesGTK.txt:
622         * SourcesWPE.txt:
623         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
624         * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.cpp.
625         * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.h.
626         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMDocument.cpp: Added.
627         (WebKit::kit):
628         (WebKit::core):
629         (WebKit::wrapDocument):
630         (webkit_dom_document_class_init):
631         (webkit_dom_document_init):
632         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMDocumentPrivate.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h.
633         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElement.cpp: Added.
634         (WebKit::kit):
635         (WebKit::core):
636         (WebKit::wrapElement):
637         (webkit_dom_element_class_init):
638         (webkit_dom_element_init):
639         (webkit_dom_element_html_input_element_is_user_edited):
640         (webkit_dom_element_html_input_element_get_auto_filled):
641         (webkit_dom_element_html_input_element_set_auto_filled):
642         (webkit_dom_element_html_input_element_set_editing_value):
643         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMElementPrivate.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementPrivate.h.
644         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNode.cpp: Added.
645         (_WebKitDOMNodePrivate::~_WebKitDOMNodePrivate):
646         (WebKit::kit):
647         (WebKit::core):
648         (WebKit::wrapNode):
649         (webkitDOMNodeConstructor):
650         (webkitDOMNodeFinalize):
651         (webkit_dom_node_init):
652         (webkit_dom_node_class_init):
653         (webkitDOMNodeSetCoreObject):
654         (webkitDOMNodeGetCoreObject):
655         (webkit_dom_node_for_js_value):
656         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMNodePrivate.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodePrivate.h.
657         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMObject.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.cpp.
658         (webkitDOMObjectSetProperty):
659         (webkit_dom_object_class_init):
660         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMPrivate.cpp: Added.
661         (WebKit::wrap):
662         * WebProcess/InjectedBundle/API/glib/DOM/WebKitDOMPrivate.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/DOMObjectCache.h.
663         * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
664         (webkit_frame_get_js_value_for_dom_object):
665         (webkit_frame_get_js_value_for_dom_object_in_script_world):
666         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
667         (webkit_web_page_class_init):
668         (webkitWebPageCreate):
669         (webkit_web_page_get_dom_document):
670         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectEventListener.cpp:
671         (WebKit::GObjectEventListener::handleEvent):
672         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectNodeFilterCondition.cpp:
673         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectXPathNSResolver.cpp:
674         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
675         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.h:
676         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.cpp:
677         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.h:
678         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
679         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.h:
680         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
681         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.h:
682         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
683         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.h:
684         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
685         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.h:
686         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
687         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.h:
688         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
689         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.h:
690         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
691         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.h:
692         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
693         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.h:
694         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
695         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.h:
696         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
697         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.h:
698         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:
699         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.h:
700         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
701         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.h:
702         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
703         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.h:
704         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
705         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.h:
706         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
707         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h:
708         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
709         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.h:
710         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp.
711         (webkitDOMDocumentDOMEventTargetInit):
712         (webkitDOMDocumentInstallProperties):
713         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
714         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.h:
715         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
716         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp.
717         (webkitDOMElementDOMEventTargetInit):
718         (webkitDOMElementInstallProperties):
719         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
720         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.h:
721         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventTarget.cpp:
722         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventTarget.h:
723         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
724         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.h:
725         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
726         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.h:
727         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
728         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.h:
729         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
730         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.h:
731         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
732         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.h:
733         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
734         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.h:
735         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
736         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.h:
737         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
738         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.h:
739         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
740         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.h:
741         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
742         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.h:
743         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
744         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.h:
745         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
746         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.h:
747         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
748         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.h:
749         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
750         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.h:
751         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
752         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.h:
753         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
754         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.h:
755         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
756         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.h:
757         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
758         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.h:
759         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
760         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.h:
761         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
762         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.h:
763         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
764         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.h:
765         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
766         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.h:
767         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
768         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.h:
769         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
770         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.h:
771         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
772         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.h:
773         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
774         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.h:
775         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
776         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.h:
777         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
778         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.h:
779         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
780         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.h:
781         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
782         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.h:
783         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
784         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.h:
785         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
786         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.h:
787         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
788         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.h:
789         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
790         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.h:
791         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
792         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.h:
793         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
794         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.h:
795         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
796         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.h:
797         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
798         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.h:
799         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
800         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.h:
801         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
802         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.h:
803         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
804         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.h:
805         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
806         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.h:
807         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp:
808         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.h:
809         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
810         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.h:
811         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
812         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.h:
813         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
814         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.h:
815         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPrivate.cpp:
816         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
817         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.h:
818         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
819         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.h:
820         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
821         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.h:
822         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
823         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.h:
824         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
825         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.h:
826         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
827         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.h:
828         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
829         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.h:
830         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
831         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.h:
832         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
833         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.h:
834         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
835         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.h:
836         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
837         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.h:
838         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
839         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.h:
840         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
841         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.h:
842         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp:
843         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.h:
844         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
845         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.h:
846         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp:
847         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.h:
848         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
849         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.h:
850         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.h:
851         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.cpp:
852         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.h:
853         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp.
854         (webkitDOMNodeDOMEventTargetInit):
855         (webkitDOMNodeInstallProperties):
856         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp:
857         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.h:
858         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp:
859         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.h:
860         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.h:
861         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivateGtk.cpp: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp.
862         (WebKit::wrapNodeGtk):
863         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivateGtk.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.h.
864         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
865         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.h:
866         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
867         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.h:
868         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp:
869         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.h:
870         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp:
871         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.h:
872         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
873         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.h:
874         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp:
875         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.h:
876         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp:
877         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.h:
878         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
879         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.h:
880         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp:
881         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.h:
882         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolver.cpp:
883         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolver.h:
884         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
885         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.h:
886         * WebProcess/InjectedBundle/API/gtk/DOM/docs/webkitdomgtk-4.0-sections.txt:
887         * WebProcess/InjectedBundle/API/gtk/WebKitFrame.h:
888         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMDefines.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h.
889         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMDocument.h: Added.
890         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMElement.h: Added.
891         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMNode.h: Added.
892         * WebProcess/InjectedBundle/API/wpe/DOM/WebKitDOMObject.h: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObject.h.
893         * WebProcess/InjectedBundle/API/wpe/DOM/webkitdom.h: Renamed from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodePrivate.h.
894         * WebProcess/InjectedBundle/API/wpe/WebKitFrame.h:
895         * WebProcess/InjectedBundle/API/wpe/WebKitWebHitTestResult.h: Added.
896         * WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h:
897         * WebProcess/InjectedBundle/API/wpe/WebKitWebProcessEnumTypes.cpp.template: Added.
898         * WebProcess/InjectedBundle/API/wpe/WebKitWebProcessEnumTypes.h.template: Copied from Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMObjectPrivate.h.
899         * WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h:
900
901 2018-03-26  Zan Dobersek  <zdobersek@igalia.com>
902
903         [CoordGraphics] Clean up CoordinatedGraphicsScene construct-time initializations
904         https://bugs.webkit.org/show_bug.cgi?id=184002
905
906         Reviewed by Carlos Garcia Campos.
907
908         Move the CoordinatedGraphicsScene constant-expression initializations
909         from constructor to the point of declaration.
910
911         Default the CoordinatedGraphicsScene destructor.
912
913         The m_scrollPosition member variable is unused in this class, while the
914         similarly-named m_renderedContentsScrollPosition tracks scroll position
915         of the scene. Remove the latter and use m_scrollPosition in its place.
916
917         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
918         (WebKit::CoordinatedGraphicsScene::CoordinatedGraphicsScene):
919         (WebKit::CoordinatedGraphicsScene::adjustPositionForFixedLayers):
920         (WebKit::CoordinatedGraphicsScene::commitSceneState):
921         (WebKit::CoordinatedGraphicsScene::~CoordinatedGraphicsScene): Deleted.
922         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
923
924 2018-03-25  Michael Catanzaro  <mcatanzaro@igalia.com>
925
926         [GTK] WebKitWebProcessEnumTypes.h missing from webkit-web-extension.h
927         https://bugs.webkit.org/show_bug.cgi?id=183998
928
929         Reviewed by Carlos Garcia Campos.
930
931         * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:
932
933 2018-03-25  Carlos Garcia Campos  <cgarcia@igalia.com>
934
935         [GTK] Unresolved type warnings when generating gir
936         https://bugs.webkit.org/show_bug.cgi?id=183926
937
938         Reviewed by Michael Catanzaro.
939
940         Skip deprecated functions using JSC C API from introspection.
941
942         * UIProcess/API/glib/WebKitJavascriptResult.cpp:
943         * UIProcess/API/glib/WebKitWebView.cpp:
944         * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
945
946 2018-03-25  Commit Queue  <commit-queue@webkit.org>
947
948         Unreviewed, rolling out r229954.
949         https://bugs.webkit.org/show_bug.cgi?id=184000
950
951         Caused many layout tests to crash on Apple High Sierra,
952         Sierra, iOS Simulator and GTK Linux Debug test bots (Requested
953         by dydz on #webkit).
954
955         Reverted changeset:
956
957         "Use SecurityOriginData more consistently in Service Worker
958         code"
959         https://bugs.webkit.org/show_bug.cgi?id=183969
960         https://trac.webkit.org/changeset/229954
961
962 2018-03-23  Brian Burg  <bburg@apple.com>
963
964         Web Automation: remove unnecessary member variable WebAutomationSession
965         https://bugs.webkit.org/show_bug.cgi?id=183971
966
967         Reviewed by Timothy Hatcher.
968
969         The concept of the "active" browsing context is something in the WebDriver
970         specification, but we were a bit too literal when first implementing this.
971         There's no actual need for this on the browser side since most commands
972         require implicitly switching to the target window passed in with the
973         Automation command. The driver, however, still needs to track the current
974         browsing context and current top-level browsing context.
975
976         For returning whether a browsing context is active,  we can just look at
977         the page's activity state to know whether the page is active or not. For
978         a normal browser, only one page is going to be visible and focused at a time.
979
980         * UIProcess/Automation/WebAutomationSession.h:
981         * UIProcess/Automation/WebAutomationSession.cpp:
982         (WebKit::WebAutomationSession::buildBrowsingContextForPage):
983         Consult the page's activity state to determine whether it's active.
984
985         (WebKit::WebAutomationSession::createBrowsingContext):
986         (WebKit::WebAutomationSession::closeBrowsingContext):
987         (WebKit::WebAutomationSession::switchToBrowsingContext):
988         (WebKit::WebAutomationSession::handleRunOpenPanel):
989         Stop reading and writing the current browsing context handle.
990
991         * UIProcess/WebPageProxy.h:
992         (WebKit::WebPageProxy::isViewFocused const):
993         (WebKit::WebPageProxy::isViewWindowActive const):
994         Add new accessor.
995
996 2018-03-25  Tim Horton  <timothy_horton@apple.com>
997
998         Add and adopt ENABLE(AIRPLAY_PICKER)
999         https://bugs.webkit.org/show_bug.cgi?id=183992
1000
1001         Reviewed by Daniel Bates.
1002
1003         * UIProcess/ios/WKContentViewInteraction.h:
1004         * UIProcess/ios/WKContentViewInteraction.mm:
1005         (-[WKContentView _showPlaybackTargetPicker:fromRect:]):
1006         * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
1007         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
1008
1009 2018-03-25  Tim Horton  <timothy_horton@apple.com>
1010
1011         Move WKAnimationDelegate to its own header
1012         https://bugs.webkit.org/show_bug.cgi?id=183976
1013         <rdar://problem/38822299>
1014
1015         Reviewed by Dan Bernstein.
1016
1017         * Shared/RemoteLayerTree/WKAnimationDelegate.h: Added.
1018         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
1019         * WebKit.xcodeproj/project.pbxproj:
1020         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
1021         RemoteLayerTreeHost uses a forward declaration of WKAnimationDelegate,
1022         so we're just getting lucky that an -invalidate method exists on
1023         some other object. Instead, move WKAnimationDelegate to its own
1024         header, and include it in the places we use it.
1025
1026 2018-03-24  Tim Horton  <timothy_horton@apple.com>
1027
1028         Adopt WK_PLATFORM_NAME in WebKit
1029         https://bugs.webkit.org/show_bug.cgi?id=183978
1030
1031         Reviewed by Dan Bernstein.
1032
1033         * Configurations/WebKit.xcconfig:
1034         * WebKit.xcodeproj/project.pbxproj:
1035         * mac/MigrateHeadersFromWebKitLegacy.make:
1036         * mac/postprocess-framework-headers.sh:
1037
1038 2018-03-24  Tim Horton  <timothy_horton@apple.com>
1039
1040         Ignore sandbox_init_with_parameters deprecation warnings
1041         https://bugs.webkit.org/show_bug.cgi?id=183979
1042
1043         Reviewed by Dan Bernstein.
1044
1045         * Shared/ios/ChildProcessIOS.mm:
1046         (WebKit::ChildProcess::initializeSandbox):
1047
1048 2018-03-24  Chris Dumez  <cdumez@apple.com>
1049
1050         Use SecurityOriginData more consistently in Service Worker code
1051         https://bugs.webkit.org/show_bug.cgi?id=183969
1052
1053         Reviewed by Darin Adler.
1054
1055         Use SecurityOriginData more consistently in Service Worker code to avoid constructing
1056         SecurityOrigin objects unnecessarily.
1057
1058         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1059         (WebKit::NetworkResourceLoadParameters::encode const):
1060         * Shared/API/c/WKSecurityOriginRef.cpp:
1061         (WKSecurityOriginCopyDatabaseIdentifier):
1062         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
1063         (WebKit::WebSWOriginStore::addToStore):
1064         (WebKit::WebSWOriginStore::removeFromStore):
1065         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
1066         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1067         (WebKit::WebSWServerConnection::scheduleJobInServer):
1068         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
1069         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
1070         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
1071         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
1072         * StorageProcess/StorageProcess.cpp:
1073         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
1074         (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
1075         (WebKit::StorageProcess::createStorageToWebProcessConnection):
1076         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
1077         (WebKit::StorageProcess::serverToContextConnectionForOrigin):
1078         (WebKit::StorageProcess::createServerToContextConnection):
1079         (WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
1080         * StorageProcess/StorageProcess.h:
1081         * UIProcess/API/APIFrameInfo.cpp:
1082         (API::FrameInfo::create):
1083         * UIProcess/API/C/WKApplicationCacheManager.cpp:
1084         (WKApplicationCacheManagerDeleteEntriesForOrigin):
1085         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
1086         (WKKeyValueStorageManagerDeleteEntriesForOrigin):
1087         * UIProcess/API/C/WKResourceCacheManager.cpp:
1088         (WKResourceCacheManagerClearCacheForOrigin):
1089         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1090         (WKWebsiteDataStoreRemoveFetchCacheForOrigin):
1091         (WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
1092         * UIProcess/ServiceWorkerProcessProxy.cpp:
1093         (WebKit::ServiceWorkerProcessProxy::create):
1094         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
1095         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
1096         * UIProcess/ServiceWorkerProcessProxy.h:
1097         * UIProcess/Storage/StorageProcessProxy.cpp:
1098         (WebKit::StorageProcessProxy::getStorageProcessConnection):
1099         * UIProcess/WebProcessPool.cpp:
1100         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
1101         (WebKit::WebProcessPool::disconnectProcess):
1102         (WebKit::WebProcessPool::updateProcessAssertions):
1103         * UIProcess/WebProcessPool.h:
1104         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1105         (WebKit::WebsiteDataStore::fetchDataAndApply):
1106         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
1107         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
1108         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1109         (WKBundlePageCopyOriginsWithApplicationCache):
1110         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1111         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
1112         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
1113         * WebProcess/Storage/WebSWClientConnection.cpp:
1114         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
1115         (WebKit::WebSWClientConnection::matchRegistration):
1116         (WebKit::WebSWClientConnection::whenRegistrationReady):
1117         (WebKit::WebSWClientConnection::getRegistrations):
1118         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1119         (WebKit::WebChromeClient::exceededDatabaseQuota):
1120         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
1121         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1122         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1123         * WebProcess/WebProcess.cpp:
1124         (WebKit::WebProcess::fetchWebsiteData):
1125         * WebProcess/WebStorage/StorageAreaImpl.cpp:
1126         (WebKit::StorageAreaImpl::securityOrigin const):
1127         * WebProcess/WebStorage/StorageAreaImpl.h:
1128         * WebProcess/WebStorage/StorageAreaMap.cpp:
1129         (WebKit::StorageAreaMap::StorageAreaMap):
1130         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
1131         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
1132         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
1133         (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):
1134
1135 2018-03-24  Tim Horton  <timothy_horton@apple.com>
1136
1137         Fix the !ENABLE(MEDIA_STREAM) build
1138         https://bugs.webkit.org/show_bug.cgi?id=183977
1139
1140         Reviewed by Wenson Hsieh.
1141
1142         * UIProcess/Cocoa/UIDelegate.mm:
1143         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
1144         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
1145         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1146         * WebProcess/cocoa/UserMediaCaptureManager.messages.in:
1147
1148 2018-03-24  Tim Horton  <timothy_horton@apple.com>
1149
1150         WKFileUploadPanel shouldn't depend on WebKitLegacy
1151         https://bugs.webkit.org/show_bug.cgi?id=183981
1152
1153         Reviewed by Wenson Hsieh.
1154
1155         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1156         (-[WKFileUploadPanel _uploadItemForImageData:imageName:successBlock:failureBlock:]):
1157         Just use the underlying WebCore function instead of the
1158         unnecessary NSFileManager category method.
1159
1160 2018-03-23  Tim Horton  <timothy_horton@apple.com>
1161
1162         Fix the build with no pasteboard
1163         https://bugs.webkit.org/show_bug.cgi?id=183973
1164
1165         Reviewed by Dan Bernstein.
1166
1167         * Configurations/FeatureDefines.xcconfig:
1168
1169 2018-03-23  Megan Gardner  <megan_gardner@apple.com>
1170
1171         Enable unified text selection in select cases for gradual testing
1172         https://bugs.webkit.org/show_bug.cgi?id=183967
1173         <rdar://problem/38815328>
1174
1175         Reviewed by Tim Horton.
1176         
1177         Enable in select places for a more gradual switch, as this is a big change and we want to make sure
1178         it works before switching completely.
1179
1180         * UIProcess/ios/WKContentViewInteraction.mm:
1181         (-[WKContentView useSelectionAssistantWithGranularity:]):
1182
1183 2018-03-23  John Wilander  <wilander@apple.com>
1184
1185         Resource Load Statistics: Pick up ITP debug mode flag from defaults
1186         https://bugs.webkit.org/show_bug.cgi?id=183956
1187         <rdar://problem/38559574>
1188
1189         Reviewed by Brent Fulgham.
1190
1191         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
1192         (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
1193
1194 2018-03-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1195
1196         [Extra zoom mode] Adopt list view controller UI for select menus
1197         https://bugs.webkit.org/show_bug.cgi?id=183944
1198         <rdar://problem/38799062>
1199
1200         Reviewed by Tim Horton.
1201
1202         Move UIProcess/WKSelectMenuListViewController.* to UIProcess/ios/forms, where it was intended to go.
1203
1204         * UIProcess/ios/forms/WKSelectMenuListViewController.h: Renamed from Source/WebKit/UIProcess/WKSelectMenuListViewController.h.
1205         * UIProcess/ios/forms/WKSelectMenuListViewController.mm: Renamed from Source/WebKit/UIProcess/WKSelectMenuListViewController.mm.
1206         * WebKit.xcodeproj/project.pbxproj:
1207
1208 2018-03-23  Chris Dumez  <cdumez@apple.com>
1209
1210         Promptly terminate service worker processes when they are no longer needed
1211         https://bugs.webkit.org/show_bug.cgi?id=183873
1212         <rdar://problem/38676995>
1213
1214         Reviewed by Youenn Fablet.
1215
1216         The StorageProcess now keeps track of service worker clients for each security
1217         origin. When there is no longer any clients for a given security origin, the
1218         StorageProcess asks the service worker process for the given origin to terminate
1219         and severs its connection to it.
1220
1221         * Shared/Storage/StorageProcessCreationParameters.h:
1222         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
1223         (WebKit::WebSWServerToContextConnection::connectionMayNoLongerBeNeeded):
1224         (WebKit::WebSWServerToContextConnection::terminate):
1225         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
1226         * StorageProcess/StorageProcess.cpp:
1227         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
1228         (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
1229         (WebKit::StorageProcess::initializeWebsiteDataStore):
1230         (WebKit::StorageProcess::swServerForSession):
1231         (WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
1232         (WebKit::StorageProcess::disableServiceWorkerProcessTerminationDelay):
1233         * StorageProcess/StorageProcess.h:
1234         * StorageProcess/StorageProcess.messages.in:
1235         * UIProcess/API/Cocoa/WKProcessPool.mm:
1236         (-[WKProcessPool _disableServiceWorkerProcessTerminationDelay]):
1237         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1238         * UIProcess/WebProcessPool.cpp:
1239         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
1240         (WebKit::WebProcessPool::disableServiceWorkerProcessTerminationDelay):
1241         * UIProcess/WebProcessPool.h:
1242         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1243         (WebKit::WebSWContextManagerConnection::terminateProcess):
1244         * WebProcess/Storage/WebSWContextManagerConnection.h:
1245         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1246
1247 2018-03-23  Brady Eidson  <beidson@apple.com>
1248
1249         Go to back/forward list items after a process-swapped navigation.
1250         <rdar://problem/38690544> and https://bugs.webkit.org/show_bug.cgi?id=183920
1251
1252         Reviewed by Andy Estes.
1253
1254         This takes the initial work of "process swap a normal navigation" and extends it to
1255         process swapping for back/forward item navigations.
1256
1257         * Scripts/webkit/messages.py:
1258
1259         Make sure state objects are serialized to the UI Process back/forward list items, as otherwise
1260         they will be lost in process-swap scenarios:
1261         * Shared/SessionState.cpp:
1262         (WebKit::PageState::encode const):
1263         (WebKit::PageState::decode):
1264         * Shared/SessionState.h:
1265
1266         Make a new variant of APINavigation specifically for back/forward list items.
1267         * UIProcess/API/APINavigation.cpp:
1268         (API::Navigation::Navigation):
1269         (API::Navigation::loggingURL const):
1270         * UIProcess/API/APINavigation.h:
1271         (API::Navigation::create):
1272         (API::Navigation::backForwardListItem):
1273         (API::Navigation::backForwardFrameLoadType const):
1274
1275         * UIProcess/API/C/WKPage.cpp:
1276         (WKPageGoToBackForwardListItem):
1277
1278         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
1279         (-[WKBrowsingContextController goToBackForwardListItem:]):
1280
1281         * UIProcess/API/Cocoa/WKWebView.mm:
1282         (-[WKWebView goToBackForwardListItem:]):
1283
1284         * UIProcess/WebNavigationState.cpp:
1285         (WebKit::WebNavigationState::createLoadRequestNavigation):
1286         (WebKit::WebNavigationState::createBackForwardNavigation):
1287         * UIProcess/WebNavigationState.h:
1288
1289         * UIProcess/WebPageProxy.cpp:
1290         (WebKit::WebPageProxy::reattachToWebProcessForReload):
1291         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
1292         (WebKit::WebPageProxy::goForward):
1293         (WebKit::WebPageProxy::goBack):
1294         (WebKit::WebPageProxy::goToBackForwardItem):
1295         (WebKit::WebPageProxy::receivedPolicyDecision):
1296         (WebKit::WebPageProxy::continueNavigationInNewProcess): Handle back/forward navigations differently than others.
1297         (WebKit::WebPageProxy::restoreFromSessionState):
1298         * UIProcess/WebPageProxy.h:
1299
1300         * UIProcess/WebProcessProxy.cpp:
1301         (WebKit::WebProcessProxy::addOrUpdateBackForwardItem): Renamed from "addBackForwardItem" for clarity
1302         (WebKit::WebProcessProxy::addBackForwardItem): Deleted.
1303         * UIProcess/WebProcessProxy.h:
1304         * UIProcess/WebProcessProxy.messages.in:
1305
1306         * UIProcess/ios/ViewGestureControllerIOS.mm:
1307         (WebKit::ViewGestureController::endSwipeGesture):
1308
1309         * UIProcess/mac/ViewGestureControllerMac.mm:
1310         (WebKit::ViewGestureController::endSwipeGesture):
1311
1312         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
1313         (WebKit::toPageState):
1314         (WebKit::toHistoryItem):
1315
1316         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1317         (WebKit::updateBackForwardItem):
1318
1319         * WebProcess/WebPage/WebPage.cpp:
1320         (WebKit::WebPage::goToBackForwardItem): Combined "goBack" and "goForward" with this method,
1321           passing the appropriate FrameLoadType around as needed to remember the specific type.
1322         (WebKit::WebPage::goForward): Deleted.
1323         (WebKit::WebPage::goBack): Deleted.
1324         * WebProcess/WebPage/WebPage.h:
1325         * WebProcess/WebPage/WebPage.messages.in:
1326
1327 2018-03-23  Megan Gardner  <megan_gardner@apple.com>
1328
1329         Don't use the presence of a textSelectionAssistant as a proxy for if we are in content editable.
1330         https://bugs.webkit.org/show_bug.cgi?id=183804
1331
1332         Reviewed by Tim Horton.
1333
1334         We need to stop using the presence of a textSelectionAssistant as a proxy for if we are selecting in a content editable
1335         or not. As we are planning on switching to only using a textSelectionAssistant for selection, these checks need to 
1336         be more direct in checking what we actually need to know i.e. are we selecting in a content editable.
1337
1338         * Platform/spi/ios/UIKitSPI.h:
1339         * UIProcess/ios/WKContentViewInteraction.mm:
1340         (hasAssistedNode):
1341         (-[WKContentView inputView]):
1342         (-[WKContentView _selectionClipRect]):
1343         (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
1344         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
1345         (-[WKContentView gestureRecognizerShouldBegin:]):
1346         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
1347         (-[WKContentView webSelectionRects]):
1348         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1349         (-[WKContentView _autofillContext]):
1350
1351 2018-03-23  Youenn Fablet  <youenn@apple.com>
1352
1353         WebProcessPool should not ask to register all clients for each service worker process creation
1354         https://bugs.webkit.org/show_bug.cgi?id=183941
1355
1356         Reviewed by Chris Dumez.
1357
1358         Call registerServiceWorkerClients when there is no service worker process.
1359         Update service worker clients to register all of them no matter the session ID.
1360
1361         * UIProcess/WebProcessPool.cpp:
1362         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
1363         * WebProcess/WebProcess.cpp:
1364         (WebKit::WebProcess::registerServiceWorkerClients):
1365         * WebProcess/WebProcess.h:
1366         * WebProcess/WebProcess.messages.in:
1367
1368 2018-03-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1369
1370         [Extra zoom mode] Adopt list view controller UI for select menus
1371         https://bugs.webkit.org/show_bug.cgi?id=183944
1372         <rdar://problem/38799062>
1373
1374         Reviewed by Andy Estes.
1375
1376         Rename WKSelectMenuViewController to WKSelectMenuListViewController, and also rename the relevant
1377         WebKitAdditions harness files. See corresponding changes for more details.
1378
1379         * UIProcess/WKSelectMenuListViewController.h: Renamed from Source/WebKit/UIProcess/ios/forms/WKSelectMenuViewController.h.
1380         * UIProcess/WKSelectMenuListViewController.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKSelectMenuViewController.mm.
1381         * UIProcess/ios/WKContentViewInteraction.h:
1382         * UIProcess/ios/WKContentViewInteraction.mm:
1383         (-[WKContentView presentSelectMenuViewController:]):
1384         (-[WKContentView dismissSelectMenuViewController:]):
1385         (-[WKContentView selectMenu:didSelectItemAtIndex:]):
1386         (-[WKContentView numberOfItemsInSelectMenu:]):
1387         (-[WKContentView selectMenu:displayTextForItemAtIndex:]):
1388         (-[WKContentView selectMenu:didCheckItemAtIndex:checked:]):
1389         (-[WKContentView selectMenuUsesMultipleSelection:]):
1390         (-[WKContentView selectMenu:hasSelectedOptionAtIndex:]):
1391         (-[WKContentView _wheelChangedWithEvent:]):
1392
1393         Overriding wheel events and re-dispatching them is no longer needed after r229437, so we can just remove special
1394         handling for select menus here.
1395
1396         (-[WKContentView didCancelSelectionInSelectMenu:]): Deleted.
1397         (-[WKContentView selectMenuSupportsMultipleSelection:]): Deleted.
1398         (-[WKContentView selectMenu:hasCheckedOptionAtIndex:]): Deleted.
1399         (-[WKContentView startingIndexForSelectMenu:]): Deleted.
1400
1401         The starting index for a select menu is no longer relevant when using list view controllers for input, so we can
1402         just remove this delegate hook altogether.
1403
1404         * WebKit.xcodeproj/project.pbxproj:
1405
1406 2018-03-23  Youenn Fablet  <youenn@apple.com>
1407
1408         CacheStorage::Caches should clear m_caches when clearing its representation even though it is not yet initialized
1409         https://bugs.webkit.org/show_bug.cgi?id=183945
1410
1411         Reviewed by Chris Dumez.
1412
1413         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1414         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
1415         In case we clear Caches in the middle of the initialization, m_caches might not be empty
1416         but m_isInitialized is not yet set to true since we are computing the Caches size.
1417         Update the assertion and clear m_caches in that case.
1418
1419 2018-03-23  David Kilzer  <ddkilzer@apple.com>
1420
1421         Stop using dispatch_set_target_queue()
1422         <https://webkit.org/b/183908>
1423         <rdar://problem/33553533>
1424
1425         Reviewed by Daniel Bates.
1426
1427         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1428         (WebKit::NetworkCache::IOChannel::IOChannel): Remove the call to
1429         dispatch_set_target_queue() since this is handled in the
1430         dispatch_io_create() call above.
1431
1432 2018-03-23  Youenn Fablet  <youenn@apple.com>
1433
1434         CacheStorage::Engine should not ref itself when hopping to a background thread
1435         https://bugs.webkit.org/show_bug.cgi?id=183925
1436         <rdar://problem/38580483>
1437
1438         Reviewed by Chris Dumez.
1439
1440         Add support for weak pointers to CacheStorage Engine.
1441         Use weak pointer when hopping to background threads.
1442         Store callbacks in CacheStorage::Engine maps to keep them being destroyed in the main thread only.
1443         Made some callbacks CompletionHandler as a bonus.
1444
1445         Made sure to use just one Engine for all private sessions.
1446
1447         * NetworkProcess/cache/CacheStorageEngine.cpp:
1448         (WebKit::CacheStorage::Engine::~Engine):
1449         (WebKit::CacheStorage::Engine::from):
1450         (WebKit::CacheStorage::Engine::initialize):
1451         (WebKit::CacheStorage::Engine::writeFile):
1452         (WebKit::CacheStorage::Engine::readFile):
1453         * NetworkProcess/cache/CacheStorageEngine.h:
1454         (WebKit::CacheStorage::Engine::weakPtrFactory):
1455
1456 2018-03-23  Ryan Haddad  <ryanhaddad@apple.com>
1457
1458         Unreviewed build fix.
1459
1460         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1461
1462 2018-03-23  Miguel Gomez  <magomez@igalia.com>
1463
1464         [GTK][WPE] Avoid software color conversion inside BitmapTextureGL
1465         https://bugs.webkit.org/show_bug.cgi?id=183892
1466
1467         Remove the UpdateContentsFlag parameter when calling BitmapTexture::updateContents().
1468
1469         Reviewed by Žan Doberšek.
1470
1471         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
1472         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
1473
1474 2018-03-23  Michael Catanzaro  <mcatanzaro@igalia.com>
1475
1476         [WPE][GTK] Fix -Wswitch warnings after r229778
1477         https://bugs.webkit.org/show_bug.cgi?id=183927
1478
1479         Reviewed by Carlos Garcia Campos.
1480
1481         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1482         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): Log a warning if Suspend is
1483         received as a PolicyAction
1484         * UIProcess/API/glib/WebKitNavigationClient.cpp: Ignore the ProcessSwap termination reason,
1485         which should be invisible to WebKit clients
1486
1487 2018-03-22  Chris Dumez  <cdumez@apple.com>
1488
1489         Include security origin in the service worker process name
1490         https://bugs.webkit.org/show_bug.cgi?id=183913
1491
1492         Reviewed by Youenn Fablet.
1493
1494         Include security origin in the service worker process name to facilitate debugging. This way, we
1495         can differentiate which service worker process is used for which origin in activity monitor.
1496
1497         * Shared/ChildProcess.h:
1498         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
1499         (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
1500         * UIProcess/ServiceWorkerProcessProxy.cpp:
1501         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
1502         * WebProcess/cocoa/WebProcessCocoa.mm:
1503         (WebKit::WebProcess::initializeProcessName):
1504
1505 2018-03-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1506
1507         Unreviewed, silence unused variable warning
1508
1509         * UIProcess/WebPageProxy.cpp:
1510         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1511
1512 2018-03-22  Dan Bernstein  <mitz@apple.com>
1513
1514         WKWebView doesn’t expose its spellCheckerDocumentTag
1515         https://bugs.webkit.org/show_bug.cgi?id=183797
1516         <rdar://problem/38678089>
1517
1518         Reviewed by Tim Horton.
1519
1520         * UIProcess/API/Cocoa/WKWebView.mm:
1521         (-[WKWebView _spellCheckerDocumentTag]): Added this getter which calls through to the WebViewImpl.
1522         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared _spellCheckerDocumentTag property.
1523
1524 2018-03-22  Chris Dumez  <cdumez@apple.com>
1525
1526         Use the same SWServer for all ephemeral sessions
1527         https://bugs.webkit.org/show_bug.cgi?id=183921
1528         <rdar://problem/36873075>
1529
1530         Reviewed by Youenn Fablet.
1531
1532         Use the same SWServer for all ephemeral sessions. SWServers never go away and we create
1533         one per sessionID. When browsing doing private browsing in Safari (and other fetching
1534         favorite icons), the sessionID is ephemeral and keeps changing. This means that we kept
1535         constructing new SWServers that would never go away. Each SWServer has a thread so we
1536         would eventually hit the thread limit for the storage process.
1537
1538         * StorageProcess/StorageProcess.cpp:
1539         (WebKit::StorageProcess::swServerForSession):
1540
1541 2018-03-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1542
1543         Unreviewed, fix format string warnings in service worker code
1544
1545         On Linux x86_64, uint64_t is unsigned long, not unsigned long long.
1546
1547         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1548         (WebKit::WebSWServerConnection::startFetch):
1549         (WebKit::WebSWServerConnection::didFinishFetch):
1550         (WebKit::WebSWServerConnection::didFailFetch):
1551         (WebKit::WebSWServerConnection::didNotHandleFetch):
1552
1553 2018-03-22  Daniel Bates  <dabates@apple.com>
1554
1555         Expose SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest() as WebKit SPI
1556         https://bugs.webkit.org/show_bug.cgi?id=183907
1557         <rdar://problem/38759127>
1558
1559         Reviewed by Alex Christensen.
1560
1561         Adds both modern Objective-C SPI and C SPI to allow an embedding client to register a scheme
1562         whose content should be displayed/loaded if and only if it can be requested. Disregarding an
1563         app that enables universal access, by using this SPI WebKit will refuse to display cross-origin
1564         content for the registered schemes.
1565
1566         We need to add C SPI for embedding clients that have not transitioned to the modern Objective-
1567         C API/SPI.
1568
1569         * Shared/WebProcessCreationParameters.cpp:
1570         (WebKit::WebProcessCreationParameters::encode const):
1571         (WebKit::WebProcessCreationParameters::decode):
1572         * Shared/WebProcessCreationParameters.h:
1573         * UIProcess/API/C/WKContext.cpp:
1574         (WKContextRegisterURLSchemeAsCanDisplayOnlyIfCanRequest):
1575         * UIProcess/API/C/WKContextPrivate.h:
1576         * UIProcess/API/Cocoa/WKProcessPool.mm:
1577         (-[WKProcessPool _registerURLSchemeAsCanDisplayOnlyIfCanRequest:]):
1578         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1579         * UIProcess/WebProcessPool.cpp:
1580         (WebKit::WebProcessPool::initializeNewWebProcess):
1581         (WebKit::WebProcessPool::registerURLSchemeAsCanDisplayOnlyIfCanRequest):
1582         * UIProcess/WebProcessPool.h:
1583         * WebProcess/WebProcess.cpp:
1584         (WebKit::WebProcess::initializeWebProcess):
1585         (WebKit::WebProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const):
1586         * WebProcess/WebProcess.h:
1587         * WebProcess/WebProcess.messages.in:
1588
1589 2018-03-22  Tim Horton  <timothy_horton@apple.com>
1590
1591         Improve readability of WebCore's OTHER_LDFLAGS
1592         https://bugs.webkit.org/show_bug.cgi?id=183909
1593         <rdar://problem/38760992>
1594
1595         Reviewed by Dan Bernstein.
1596
1597         * Configurations/Base.xcconfig:
1598         * Configurations/FeatureDefines.xcconfig:
1599
1600 2018-03-22  Zan Dobersek  <zdobersek@igalia.com>
1601
1602         [TexMap] Make TextureMapperContextAttributes thread-specific
1603         https://bugs.webkit.org/show_bug.cgi?id=183895
1604
1605         Reviewed by Carlos Garcia Campos.
1606
1607         CoordinatedGraphicsScene, as an implementor of the
1608         TextureMapperPlatformLayerProxy::Compositor interface, doesn't have to
1609         implement the texmapGL() method anymore.
1610
1611         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1612         (WebKit::CoordinatedGraphicsScene::onNewBufferAvailable):
1613         (WebKit::CoordinatedGraphicsScene::texmapGL): Deleted.
1614         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1615
1616 2018-03-21  Frederic Wang  <fwang@igalia.com>
1617
1618         Unreviewed, update comment added in r229801.
1619
1620         * WebProcess/WebPage/ios/FindControllerIOS.mm:
1621         (WebKit::FindController::didFindString): Remove "On Mobile" and mention bug 183889.
1622
1623 2018-03-21  Chris Dumez  <cdumez@apple.com>
1624
1625         Regression(r229831): ProcessSwap.Basic API test is crashing
1626         https://bugs.webkit.org/show_bug.cgi?id=183884
1627
1628         Reviewed by Brady Eidson.
1629
1630         This code should only be called for navigation policy decisions.
1631         It used to work without this check because of an early return, which
1632         was dropped in r229831.
1633
1634         * UIProcess/WebPageProxy.cpp:
1635         (WebKit::WebPageProxy::receivedPolicyDecision):
1636
1637 2018-03-21  Wenson Hsieh  <wenson_hsieh@apple.com>
1638
1639         [Extra zoom mode] Add new SPI hooks for clients to vend an input session context view
1640         https://bugs.webkit.org/show_bug.cgi?id=183866
1641         <rdar://problem/38692256>
1642
1643         Reviewed by Tim Horton.
1644
1645         Add new SPI hooks to _WKInputDelegate allowing internal clients to provide a view that gives additional context
1646         when editing form controls, on top of the default label or placeholder text displayed by WebKit. The height
1647         delegate is invoked first, giving the client an opportunity to lay out the context view to fit the given size;
1648         the actual view is then queried.
1649
1650         If the view changes, clients may tell WebKit to reload the context view via SPI on WKFormInputSession; this call
1651         to reload is plumbed through to the currently presented list view controller (at the moment, this is only the
1652         text input list view controller).
1653
1654         * UIProcess/API/Cocoa/_WKFormInputSession.h:
1655         * UIProcess/API/Cocoa/_WKInputDelegate.h:
1656
1657         Add the new SPI hooks, described above.
1658
1659         * UIProcess/ios/WKContentViewInteraction.h:
1660         * UIProcess/ios/WKContentViewInteraction.mm:
1661         (-[WKFormInputSession reloadFocusedElementContextView]):
1662
1663         Plumb the context view reload hook through WKContentView to WKTextInputListViewController.
1664
1665         (-[WKContentView setupInteraction]):
1666         (-[WKContentView _stopAssistingNode]):
1667         (-[WKContentView reloadContextViewForPresentedListViewController]):
1668         (-[WKContentView focusedFormControllerDidUpdateSuggestions:]):
1669
1670         Slight tweak to only reload text suggestions if we are not blurring the focused element. Without this extra
1671         condition, the list view controller's inner table view would get reloaded when the form input session's text
1672         suggestions are set to nil when the list view controller is dismissed, causing a visible stutter in the
1673         dismissal animation of view controller.
1674
1675 2018-03-21  Chris Dumez  <cdumez@apple.com>
1676
1677         WebKitTestRunner crashed in com.apple.WebKit: WebKit::WebProcessPool::terminateServiceWorkerProcesses
1678         https://bugs.webkit.org/show_bug.cgi?id=183875
1679
1680         Reviewed by Brent Fulgham.
1681
1682         Protect |this| while we're iterating over m_serviceWorkerProcesses and terminating
1683         each service worker process. It is possible for the WebProcess pool to get destroyed
1684         as a result of terminating a service worker process.
1685
1686         This change is covered by layout tests that are currently crashing on the ASAN bots.
1687
1688         * UIProcess/WebProcessPool.cpp:
1689         (WebKit::WebProcessPool::terminateServiceWorkerProcesses):
1690
1691 2018-03-21  Eric Carlson  <eric.carlson@apple.com>
1692
1693         Fix typo in inactive media stream timeout default value
1694         https://bugs.webkit.org/show_bug.cgi?id=183872
1695         <rdar://problem/38723903>
1696
1697         Reviewed by Jer Noble.
1698
1699         * Shared/WebPreferences.yaml: Fix typo.
1700         * Shared/WebPreferencesDefaultValues.h: Ditto.
1701
1702 2018-03-21  Chris Dumez  <cdumez@apple.com>
1703
1704         Make policy decisions asynchronous
1705         https://bugs.webkit.org/show_bug.cgi?id=180568
1706         <rdar://problem/37131297>
1707
1708         Reviewed by Alex Christensen.
1709
1710         Get rid of synchronous IPC and synchronous code paths for policy delegates.
1711         Policy decisions are now all made asynchronously and rely on asynchronous
1712         IPC.
1713
1714         This code change is based on work by Alex Christensen.
1715
1716         * UIProcess/WebPageProxy.cpp:
1717         (WebKit::WebPageProxy::receivedPolicyDecision):
1718         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1719         (WebKit::WebPageProxy::decidePolicyForResponse):
1720         * UIProcess/WebPageProxy.h:
1721         * UIProcess/WebPageProxy.messages.in:
1722         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1723         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1724         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1725
1726 2018-03-21  Chris Dumez  <cdumez@apple.com>
1727
1728         ScrollViewInsetTests.RestoreInitialContentOffsetAfterCrash API test is failing with async delegates
1729         https://bugs.webkit.org/show_bug.cgi?id=183787
1730
1731         Reviewed by Wenson Hsieh.
1732
1733         Without asynchronous policy delegates, when the client requests a navigation, we would:
1734         1. Do a synchronous navigation policy check
1735         2. If the client allows the navigation, start the provisional load
1736
1737         Starting the provisional load would freeze the layer tree until first meaningful
1738         layout via WebFrameLoaderClient::provisionalLoadStarted() -> WebPage::didStartPageTransition().
1739
1740         When constructing a WebView and then requesting a load right away. This would make sure
1741         we do not commit a layer tree for the initial about:blank page because the layer tree
1742         would be frozen until we have something meaningful to show for the following load.
1743
1744         However, with asynchronous policy delegates, we are able to do a layer tree commit
1745         during the asynchronous navigation policy check because the layer tree is not frozen
1746         yet (provisional load has not started) and the process is not stuck on synchronous
1747         IPC. When constructing a WebView and then requesting a load right away, this would
1748         allow a layer tree commit for about:blank to happen before we've even started the
1749         load. This would cause some API tests to fail on iOS.
1750
1751         To address the issue, we try and maintain pre-existing behavior by freezing the
1752         layer tree during navigation policy decision.
1753
1754         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1755         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1756         (WebKit::WebFrameLoaderClient::didDecidePolicyForNavigationAction):
1757         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1758         * WebProcess/WebPage/WebPage.cpp:
1759         (WebKit::WebPage::didStartNavigationPolicyCheck):
1760         (WebKit::WebPage::didCompleteNavigationPolicyCheck):
1761         * WebProcess/WebPage/WebPage.h:
1762
1763 2018-03-21  Brent Fulgham  <bfulgham@apple.com>
1764
1765         Allow the WebContent process to read ViewBridge preferences
1766         https://bugs.webkit.org/show_bug.cgi?id=183862
1767         <rdar://problem/38459456>
1768
1769         Reviewed by Eric Carlson.
1770
1771         * WebProcess/com.apple.WebProcess.sb.in:
1772
1773 2018-03-21  Frederic Wang  <fwang@igalia.com>
1774
1775         [iOS] Text highlighted by the Find UI overlaps with NBC news header on google.com
1776         https://bugs.webkit.org/show_bug.cgi?id=183658
1777
1778         Reviewed by Tim Horton.
1779
1780         On Mobile, many sites have overlay headers or footers that may overlap with the highlighted
1781         text inside a scrollable overflow node. To workaround that issue, this commit changes the
1782         behavior so that the text is revealed at the center of the overflow node.
1783
1784         * WebProcess/WebPage/ios/FindControllerIOS.mm:
1785         (WebKit::FindController::didFindString): Use alignCenterAlways instead of alignToEdgeIfNeeded.
1786
1787 2018-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1788
1789         [GTK][WPE] JSC bindings not introspectable
1790         https://bugs.webkit.org/show_bug.cgi?id=136989
1791
1792         Reviewed by Michael Catanzaro.
1793
1794         Deprecate the functions that are not introspectable due to JSC C API in GTK+ port and remove them in WPE
1795         port. Add alternative functions using the new JSC GLib API. We no longer need to keep a global context attached
1796         to every view. We can simply create a temporary global context on demand and release it after 1 second. This
1797         also allows us to remove WebPageProxy::javascriptGlobalContext() and all the related code.
1798
1799         * PlatformGTK.cmake:
1800         * PlatformWPE.cmake:
1801         * UIProcess/API/glib/WebKitJavascriptResult.cpp:
1802         (_WebKitJavascriptResult::_WebKitJavascriptResult):
1803         (webkitJavascriptResultCreate):
1804         (webkit_javascript_result_get_global_context):
1805         (webkit_javascript_result_get_value):
1806         (webkit_javascript_result_get_js_value):
1807         * UIProcess/API/glib/WebKitJavascriptResultPrivate.h:
1808         (SharedJavascriptContext::singleton):
1809         (SharedJavascriptContext::SharedJavascriptContext):
1810         (SharedJavascriptContext::getOrCreateContext):
1811         (SharedJavascriptContext::releaseContext):
1812         * UIProcess/API/glib/WebKitUserContentManager.cpp:
1813         * UIProcess/API/glib/WebKitWebView.cpp:
1814         (webkit_web_view_get_javascript_global_context):
1815         (webkitWebViewRunJavaScriptCallback):
1816         * UIProcess/API/gtk/PageClientImpl.cpp:
1817         * UIProcess/API/gtk/PageClientImpl.h:
1818         * UIProcess/API/gtk/WebKitJavascriptResult.h:
1819         * UIProcess/API/gtk/WebKitWebView.h:
1820         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1821         * UIProcess/API/wpe/APIViewClient.h:
1822         (API::ViewClient::handleDownloadRequest):
1823         * UIProcess/API/wpe/PageClientImpl.cpp:
1824         * UIProcess/API/wpe/PageClientImpl.h:
1825         * UIProcess/API/wpe/WPEView.cpp:
1826         * UIProcess/API/wpe/WPEView.h:
1827         * UIProcess/API/wpe/WebKitJavascriptResult.h:
1828         * UIProcess/API/wpe/WebKitWebView.h:
1829         * UIProcess/PageClient.h:
1830         * UIProcess/WebPageProxy.h:
1831         * UIProcess/gtk/WebPageProxyGtk.cpp:
1832         * UIProcess/wpe/WebPageProxyWPE.cpp:
1833         * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp:
1834         (webkit_frame_get_js_context):
1835         (webkit_frame_get_js_context_for_script_world):
1836         * WebProcess/InjectedBundle/API/gtk/WebKitFrame.h:
1837         * WebProcess/InjectedBundle/API/wpe/WebKitFrame.h:
1838
1839 2018-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1840
1841         [GTK][WPE] Initial implementation of JavaScriptCore glib bindings
1842         https://bugs.webkit.org/show_bug.cgi?id=164061
1843
1844         Reviewed by Michael Catanzaro.
1845
1846         Set decorator and deprecation_guard options in API docs config files, since they are no longer common to all
1847         libraries.
1848
1849         * PlatformGTK.cmake:
1850
1851 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
1852
1853         [CoordGraphics] Simplify CoordinatedGraphicsScene activation
1854         https://bugs.webkit.org/show_bug.cgi?id=183772
1855
1856         Reviewed by Carlos Garcia Campos.
1857
1858         Simplify CoordinatedGraphicsScene::setActive() into a simple setter of
1859         the m_isActive member variable. We don't have to call renderNextFrame()
1860         anymore as that was only necessary to unblock CoordinatedLayerTreeHost,
1861         but that can be avoided if m_isWaitingForRenderer in that class is
1862         initialized to false.
1863
1864         CoordinatedGraphicsSceneClient::renderNextFrame() virtual method and its
1865         ThreadedCompositor implementation are removed. renderNextFrame() in the
1866         CoordinatedGraphicsScene class can also be removed, along with the
1867         unused dispatchOnMainThread() and dispatchOnClientRunLoop() methods and
1868         the associated m_clientRunLoop member variable.
1869
1870         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1871         (WebKit::CoordinatedGraphicsScene::CoordinatedGraphicsScene):
1872         (WebKit::CoordinatedGraphicsScene::dispatchOnMainThread): Deleted.
1873         (WebKit::CoordinatedGraphicsScene::dispatchOnClientRunLoop): Deleted.
1874         (WebKit::CoordinatedGraphicsScene::renderNextFrame): Deleted.
1875         (WebKit::CoordinatedGraphicsScene::setActive): Deleted.
1876         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1877         (WebKit::CoordinatedGraphicsSceneClient::~CoordinatedGraphicsSceneClient):
1878         (WebKit::CoordinatedGraphicsScene::setActive):
1879         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1880         (WebKit::m_displayRefreshMonitor):
1881         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing):
1882         (WebKit::ThreadedCompositor::renderNextFrame): Deleted.
1883         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1884         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1885
1886 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
1887
1888         [TexMap] Have TextureMapperLayer::applyAnimationsRecursively() return running animation status
1889         https://bugs.webkit.org/show_bug.cgi?id=183771
1890
1891         Reviewed by Carlos Garcia Campos.
1892
1893         In CoordinatedGraphicsScene::paintToCurrentGLContext(), retrieve
1894         information about any running animation in the scene via the
1895         TextureMapperLayer::applyAnimationsRecursively() call. Use that boolean
1896         value at the end up the method, instead of again traversing the
1897         TextureMapperLayer tree to determine whether any running animations are
1898         present.
1899
1900         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1901         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
1902
1903 2018-03-20  Tim Horton  <timothy_horton@apple.com>
1904
1905         Enable the minimal simulator feature flag when appropriate
1906         https://bugs.webkit.org/show_bug.cgi?id=183807
1907
1908         Reviewed by Dan Bernstein.
1909
1910         * Configurations/FeatureDefines.xcconfig:
1911
1912 2018-03-19  Ryosuke Niwa  <rniwa@webkit.org>
1913
1914         Expose content attributes on _WKLinkIconParameters
1915         https://bugs.webkit.org/show_bug.cgi?id=183768
1916
1917         Reviewed by Alex Christensen.
1918
1919         Added _WKLinkIconParameters.attributes to expose content attributes of a link element
1920         which defined a favicon, touch icon, or pre-compressed touch icon.
1921
1922         * UIProcess/API/Cocoa/_WKLinkIconParameters.h:
1923         (_WKLinkIconParameters.attributes): Added.
1924         * UIProcess/API/Cocoa/_WKLinkIconParameters.mm:
1925         (_WKLinkIconParameters._attributes): Added.
1926         (-[_WKLinkIconParameters _initWithLinkIcon:]): Convert the hash map from WebCore to a NSDictionary.
1927         (-[_WKLinkIconParameters attributes]): Added.
1928
1929 2018-03-20  Wenson Hsieh  <wenson_hsieh@apple.com>
1930
1931         Add AssistedNodeInformation plumbing for form control placeholder text and label text
1932         https://bugs.webkit.org/show_bug.cgi?id=183802
1933         <rdar://problem/38686273>
1934
1935         Reviewed by Tim Horton.
1936
1937         Surfaces some additional information about the currently focused element to the input delegate in the UI process.
1938         See comments below for more details.
1939
1940         Test: WebKit.FocusedElementInfo
1941
1942         * Shared/AssistedNodeInformation.cpp:
1943         (WebKit::AssistedNodeInformation::encode const):
1944         (WebKit::AssistedNodeInformation::decode):
1945         * Shared/AssistedNodeInformation.h:
1946
1947         Add `placeholder` and `label` to AssistedNodeInformation, which capture the value of the placeholder attribute
1948         and the text of the first associated label element for the focused form control. Also add boilerplate encoder/
1949         decoder support for these members.
1950
1951         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
1952
1953         Augment _WKFocusedElementInfo to include placeholder and label.
1954
1955         * UIProcess/ios/WKContentViewInteraction.mm:
1956         (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
1957         (-[WKFocusedElementInfo label]):
1958         (-[WKFocusedElementInfo placeholder]):
1959         * WebProcess/WebPage/ios/WebPageIOS.mm:
1960         (WebKit::WebPage::getAssistedNodeInformation):
1961
1962         For input elements and textareas, set the placeholder to the value of the placeholder attribute. For all
1963         elements with associated labels, grab the inner text of the first label that is not empty, ignoring all labels
1964         that are `display: none` (i.e. not being rendered).
1965
1966 2018-03-20  Brady Eidson  <beidson@apple.com>
1967
1968         First piece of process swapping on navigation.
1969         https://bugs.webkit.org/show_bug.cgi?id=183665
1970
1971         Reviewed by Andy Estes.
1972
1973         This patch adds the first pieces of the following feature:
1974         "When a navigation originating inside a WKWebView goes to a different origin,
1975          swap to a new WebProcess for that navigation"
1976
1977         There are significant bugs to be resolved and significant optimizations to be made.
1978         Which is why the feature is disabled by default.
1979
1980         Besides the core logic implementing the feature, this patch does a lot of related 
1981         work such as:
1982         - Removing some now-invalid ASSERTs
1983         - Adding some ASSERTs
1984         - Update various switch states to handle the new "Suspend" policy and "NavigationSwap"
1985           process termination reason
1986
1987         * NetworkProcess/NetworkDataTaskBlob.cpp:
1988         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
1989
1990         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
1991         (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):
1992
1993         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1994         (toNSURLSessionResponseDisposition):
1995
1996         * Platform/Logging.h:
1997
1998         * Shared/LoadParameters.cpp:
1999         (WebKit::LoadParameters::encode const):
2000         (WebKit::LoadParameters::decode):
2001         * Shared/LoadParameters.h:
2002
2003         * Shared/ProcessTerminationReason.h: Add "NavigationSwap" as a process termination reason.
2004
2005         * UIProcess/API/APINavigation.h:
2006
2007         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2008         (API::ProcessPoolConfiguration::copy):
2009
2010         * UIProcess/API/C/WKAPICast.h:
2011         (WebKit::toAPI):
2012
2013         * UIProcess/Cocoa/NavigationState.mm:
2014         (WebKit::wkProcessTerminationReason):
2015
2016         * UIProcess/WebFramePolicyListenerProxy.cpp:
2017         (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
2018         * UIProcess/WebFramePolicyListenerProxy.h:
2019         (WebKit::WebFramePolicyListenerProxy::create):
2020         (WebKit::WebFramePolicyListenerProxy::policyListenerType const):
2021
2022         * UIProcess/WebFrameProxy.cpp:
2023         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
2024         (WebKit::WebFrameProxy::activePolicyListenerProxy):
2025         * UIProcess/WebFrameProxy.h:
2026
2027         * UIProcess/WebNavigationState.cpp:
2028         (WebKit::WebNavigationState::navigation):
2029         (WebKit::WebNavigationState::takeNavigation):
2030
2031         * UIProcess/WebPageProxy.cpp:
2032         (WebKit::WebPageProxy::reattachToWebProcess):
2033         (WebKit::WebPageProxy::attachToProcessForNavigation): Pretend that the existing process 
2034           terminated using the new "NavigationSwap" reason, then manually start the next load.
2035         (WebKit::WebPageProxy::loadRequest):
2036         (WebKit::WebPageProxy::loadRequestWithNavigation):
2037         (WebKit::WebPageProxy::receivedPolicyDecision):
2038         (WebKit::WebPageProxy::continueNavigationInNewProcess):
2039         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2040         (WebKit::WebPageProxy::decidePolicyForResponse):
2041         (WebKit::WebPageProxy::processDidTerminate):
2042         (WebKit::WebPageProxy::resetState):
2043         (WebKit::WebPageProxy::resetStateAfterProcessExited):
2044         * UIProcess/WebPageProxy.h:
2045
2046         * UIProcess/WebProcessPool.cpp:
2047         (WebKit::WebProcessPool::processForNavigation): Determine which process should be used
2048           for a proposed navigation, creating a new one if necessary.
2049         * UIProcess/WebProcessPool.h:
2050
2051         * UIProcess/WebStorage/StorageManager.cpp:
2052         (WebKit::StorageManager::SessionStorageNamespace::setAllowedConnection):
2053
2054         * WebProcess/WebPage/WebPage.cpp:
2055         (WebKit::WebPage::loadRequest):
2056
2057 2018-03-20  Youenn Fablet  <youenn@apple.com>
2058
2059         ServiceWorkerClientFetch::didReceiveData should check for m_encodedDataLength
2060         https://bugs.webkit.org/show_bug.cgi?id=183668
2061
2062         Reviewed by Chris Dumez.
2063
2064         Crash happens when releasing a RefPtr<SharedBuffer> buffer that is null.
2065         It happens because ServiceWorkerClientFetch can call m_loader->didReceiveBuffer at two different places.
2066         Either when receiving an IPC call or as part of completion handler for the response validation check.
2067         At each call site, we release the buffer to pass it to the loader and we set m_encodedLength to zero.
2068         The fix is to add the m_encodedLength check like done in the case of response validation check completion handler.
2069
2070         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2071         (WebKit::ServiceWorkerClientFetch::didReceiveData):
2072
2073 2018-03-20  Jeff Miller  <jeffm@apple.com>
2074
2075         Expose aggressiveTileRetentionEnabled in WKPreferences SPI to match C SPI
2076         https://bugs.webkit.org/show_bug.cgi?id=183790
2077
2078         Reviewed by Alex Christensen.
2079         
2080         Expose this property on macOS only.
2081
2082         * UIProcess/API/Cocoa/WKPreferences.mm:
2083         (-[WKPreferences _setAggressiveTileRetentionEnabled:]):
2084         (-[WKPreferences _aggressiveTileRetentionEnabled]):
2085         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2086
2087 2018-03-20  Tim Horton  <timothy_horton@apple.com>
2088
2089         Add and adopt WK_PLATFORM_NAME and adjust default feature defines
2090         https://bugs.webkit.org/show_bug.cgi?id=183758
2091         <rdar://problem/38017644>
2092
2093         Reviewed by Dan Bernstein.
2094
2095         * Configurations/FeatureDefines.xcconfig:
2096
2097 2018-03-20  Chris Dumez  <cdumez@apple.com>
2098
2099         Unreviewed, rolling out r229726 and r229763.
2100
2101         Caused some API test failures on iOS
2102
2103         Reverted changesets:
2104
2105         "Make policy decisions asynchronous"
2106         https://bugs.webkit.org/show_bug.cgi?id=180568
2107         https://trac.webkit.org/changeset/229726
2108
2109         "Rebaseline three webarchive tests for WK2 after r229726."
2110         https://bugs.webkit.org/show_bug.cgi?id=180568
2111         https://trac.webkit.org/changeset/229763
2112
2113 2018-03-20  Brent Fulgham  <bfulgham@apple.com>
2114
2115         [iOS] Grant IOKit preference access for the Home button
2116         https://bugs.webkit.org/show_bug.cgi?id=183754
2117         <rdar://problem/38179704>
2118
2119         Reviewed by Eric Carlson.
2120
2121         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2122
2123 2018-03-20  Wenson Hsieh  <wenson_hsieh@apple.com>
2124
2125         [Extra zoom mode] Adopt updated input view controller machinery for text input
2126         https://bugs.webkit.org/show_bug.cgi?id=183765
2127         <rdar://problem/36926269>
2128
2129         Reviewed by Tim Horton.
2130
2131         Adopt new classes for extra zoomed text inputs. Massage WKTextInputViewController into WKTextInputListView-
2132         Controller and introduce WKFormControlListViewController, the eventual replacement for the base class
2133         WKTextFormControlViewController that will act as the base class of all list-view-controller-based input UI in
2134         extra zoom mode.
2135
2136         * UIProcess/ios/WKContentViewInteraction.h:
2137         * UIProcess/ios/WKContentViewInteraction.mm:
2138         (-[WKContentView presentTextInputViewController:]):
2139         (-[WKContentView dismissTextInputViewController:]):
2140         (-[WKContentView focusedFormControllerDidUpdateSuggestions:]):
2141         (-[WKContentView _wheelChangedWithEvent:]):
2142         * UIProcess/ios/forms/WKFormControlListViewController.h: Copied from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.h.
2143         * UIProcess/ios/forms/WKFormControlListViewController.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.mm.
2144         * UIProcess/ios/forms/WKTextInputListViewController.h: Copied from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.h.
2145         * UIProcess/ios/forms/WKTextInputListViewController.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKTextInputViewController.h.
2146         * WebKit.xcodeproj/project.pbxproj:
2147
2148 2018-03-19  Megan Gardner  <megan_gardner@apple.com>
2149
2150         Clear style colors when setting default appearance
2151         https://bugs.webkit.org/show_bug.cgi?id=183759
2152
2153         Reviewed by Tim Horton.
2154
2155         Colors are cached and need to be cleared and recalculated.
2156
2157         * WebProcess/WebPage/WebPage.cpp:
2158         (WebKit::WebPage::setDefaultAppearance):
2159
2160 2018-03-19  Chris Dumez  <cdumez@apple.com>
2161
2162         WKWebView.ClearAppCache is a flaky API test failure on High Sierra.
2163         https://bugs.webkit.org/show_bug.cgi?id=181546
2164         <rdar://problem/36444327>
2165
2166         Reviewed by Ryosuke Niwa.
2167
2168         in LocalStorageDatabaseTracker::deleteDatabasesModifiedSince(), add origin
2169         to originIdentifiersToDelete if we cannot determine the last modification
2170         time of the database file. This likely means the database file does not
2171         exist. However, we still needs to make sure the origin gets removed from
2172         the origins database and there may be *.wal / *.shm variants of the database
2173         that are still on disk and need to be deleted.
2174
2175         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
2176         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
2177
2178 2018-03-19  Chris Dumez  <cdumez@apple.com>
2179
2180         Have one service worker process per security origin
2181         https://bugs.webkit.org/show_bug.cgi?id=183600
2182         <rdar://problem/35280128>
2183
2184         Reviewed by Brady Eidson.
2185
2186         Split service workers from different origins into their own processes
2187         for security reasons.
2188
2189         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2190         (WebKit::WebSWServerConnection::startFetch):
2191         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
2192         (WebKit::WebSWServerConnection::scheduleJobInServer):
2193         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
2194         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
2195         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
2196         * StorageProcess/StorageProcess.cpp:
2197         (WebKit::StorageProcess::connectionToContextProcessFromIPCConnection):
2198         (WebKit::StorageProcess::didClose):
2199         (WebKit::StorageProcess::connectionToContextProcessWasClosed):
2200         (WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
2201         (WebKit::StorageProcess::didReceiveMessage):
2202         (WebKit::StorageProcess::createStorageToWebProcessConnection):
2203         (WebKit::StorageProcess::serverToContextConnectionForOrigin):
2204         (WebKit::StorageProcess::createServerToContextConnection):
2205         * StorageProcess/StorageProcess.h:
2206         * StorageProcess/StorageProcess.messages.in:
2207         * StorageProcess/StorageToWebProcessConnection.cpp:
2208         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
2209         (WebKit::StorageToWebProcessConnection::didClose):
2210         * StorageProcess/StorageToWebProcessConnection.h:
2211         * UIProcess/API/C/WKContext.cpp:
2212         (WKContextTerminateServiceWorkerProcess):
2213         * UIProcess/API/Cocoa/WKProcessPool.mm:
2214         (-[WKProcessPool _terminateServiceWorkerProcesses]):
2215         (-[WKProcessPool _webPageContentProcessCount]):
2216         (-[WKProcessPool _serviceWorkerProcessCount]):
2217         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2218         * UIProcess/Network/NetworkProcessProxy.cpp:
2219         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
2220         (WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace):
2221         * UIProcess/ServiceWorkerProcessProxy.cpp:
2222         (WebKit::ServiceWorkerProcessProxy::create):
2223         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
2224         * UIProcess/ServiceWorkerProcessProxy.h:
2225         (isType):
2226         * UIProcess/Storage/StorageProcessProxy.cpp:
2227         (WebKit::StorageProcessProxy::getStorageProcessConnection):
2228         (WebKit::StorageProcessProxy::didFinishLaunching):
2229         (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcess):
2230         (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcessForExplicitSession):
2231         * UIProcess/Storage/StorageProcessProxy.h:
2232         * UIProcess/Storage/StorageProcessProxy.messages.in:
2233         * UIProcess/WebProcessPool.cpp:
2234         (WebKit::WebProcessPool::getStorageProcessConnection):
2235         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
2236         (WebKit::WebProcessPool::createNewWebProcess):
2237         (WebKit::WebProcessPool::disconnectProcess):
2238         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
2239         (WebKit::WebProcessPool::createWebPage):
2240         (WebKit::WebProcessPool::updateServiceWorkerUserAgent):
2241         (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
2242         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
2243         (WebKit::WebProcessPool::terminateServiceWorkerProcesses):
2244         (WebKit::WebProcessPool::updateProcessAssertions):
2245         (WebKit::WebProcessPool::serviceWorkerProcessProxyFromPageID const):
2246         * UIProcess/WebProcessPool.h:
2247         * UIProcess/WebProcessProxy.cpp:
2248         (WebKit::WebProcessProxy::getStorageProcessConnection):
2249
2250 2018-03-19  Jiewen Tan  <jiewen_tan@apple.com>
2251
2252         Unreviewed, another quick fix for r229699
2253
2254         Restricts ENABLE_WEB_AUTHN to only macOS and iOS.
2255
2256         * Configurations/FeatureDefines.xcconfig:
2257
2258 2018-03-19  Chris Dumez  <cdumez@apple.com>
2259
2260         Make policy decisions asynchronous
2261         https://bugs.webkit.org/show_bug.cgi?id=180568
2262         <rdar://problem/37131297>
2263
2264         Reviewed by Alex Christensen.
2265
2266         Get rid of synchronous IPC and synchronous code paths for policy delegates.
2267         Policy decisions are now all made asynchronously and rely on asynchronous
2268         IPC.
2269
2270         This code change is based on work by Alex Christensen.
2271
2272         * UIProcess/WebPageProxy.cpp:
2273         (WebKit::WebPageProxy::receivedPolicyDecision):
2274         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2275         (WebKit::WebPageProxy::decidePolicyForResponse):
2276         * UIProcess/WebPageProxy.h:
2277         * UIProcess/WebPageProxy.messages.in:
2278         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2279         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2280         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2281
2282 2018-03-19  Brian Burg  <bburg@apple.com>
2283
2284         Web Inspector: clean up WKWebView configuration code
2285         https://bugs.webkit.org/show_bug.cgi?id=183747
2286         <rdar://problem/38629343>
2287
2288         Reviewed by Timothy Hatcher.
2289
2290         * UIProcess/mac/WKInspectorViewController.mm:
2291         (-[WKInspectorViewController webView]): Always use system
2292         appearance for Inspector's web content.
2293
2294 2018-03-19  Eric Carlson  <eric.carlson@apple.com>
2295
2296         [Extra zoom mode] Require fullscreen for video playback
2297         https://bugs.webkit.org/show_bug.cgi?id=183742
2298         <rdar://problem/38235862>
2299
2300         Reviewed by Jer Noble.
2301
2302         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
2303         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
2304         (-[WKVideoFullScreenViewController initWithAVPlayerViewController:]):
2305         (-[WKVideoFullScreenViewController viewDidLoad]):
2306         (-[WKVideoFullScreenViewController prefersStatusBarHidden]):
2307         (WebKit::VideoFullscreenModelContext::presentingViewController):
2308         (WebKit::VideoFullscreenModelContext::createVideoFullscreenViewController):
2309         * WebProcess/cocoa/VideoFullscreenManager.mm:
2310         (WebKit::VideoFullscreenManager::didEnterFullscreen):
2311
2312 2018-03-19  Daniel Bates  <dabates@apple.com>
2313
2314         test-webkitpy no longer runs WebKit2 tests
2315         https://bugs.webkit.org/show_bug.cgi?id=183724
2316
2317         Reviewed by Alexey Proskuryakov.
2318
2319         Fixes an issue where Python emits errors "global name reset_results is not defined" when
2320         running tests in messages_unittest.py using test-webkitpy.
2321
2322         Currently messages_unittest.py conditionally defines the global variable reset_results
2323         when run as the main program (i.e. __name__ == "__main__"). When messages_unittest.py is
2324         imported as a module as test-webkitpy does then it is not considered the main program
2325         ;=> the top-level script environment is not __main__ ;=> we do not define the global
2326         variable reset_results. Instead we should unconditionally define the global variable
2327         reset_results.
2328
2329         * Scripts/webkit/messages_unittest.py:
2330
2331 2018-03-19  Per Arne Vollan  <pvollan@apple.com>
2332
2333         When the WebContent process is blocked from accessing the WindowServer, the call CVDisplayLinkCreateWithCGDisplay will fail.
2334         https://bugs.webkit.org/show_bug.cgi?id=183604
2335         <rdar://problem/38305109>
2336
2337         Reviewed by Brent Fulgham.
2338
2339         * UIProcess/WebPageProxy.h:
2340         * UIProcess/WebPageProxy.messages.in:
2341         * UIProcess/mac/DisplayLink.cpp: Added.
2342         (WebKit::DisplayLink::DisplayLink):
2343         (WebKit::DisplayLink::~DisplayLink):
2344         (WebKit::DisplayLink::displayLinkCallback):
2345         * UIProcess/mac/DisplayLink.h: Added.
2346         * UIProcess/mac/WebPageProxyMac.mm:
2347         (WebKit::WebPageProxy::startDisplayRefreshMonitor):
2348         (WebKit::WebPageProxy::stopDisplayRefreshMonitor):
2349         * WebKit.xcodeproj/project.pbxproj:
2350         * WebProcess/WebPage/DrawingArea.cpp:
2351         (WebKit::DrawingArea::createDisplayRefreshMonitor):
2352         * WebProcess/WebPage/DrawingArea.h:
2353         * WebProcess/WebPage/DrawingArea.messages.in:
2354         * WebProcess/WebPage/mac/DrawingAreaMac.cpp: Added.
2355         (WebKit::DisplayRefreshMonitorMac::create):
2356         (WebKit::DisplayRefreshMonitorMac::DisplayRefreshMonitorMac):
2357         (WebKit::DisplayRefreshMonitorMac::~DisplayRefreshMonitorMac):
2358         (WebKit::DisplayRefreshMonitorMac::requestRefreshCallback):
2359         (WebKit::DisplayRefreshMonitorMac::displayLinkFired):
2360         (WebKit::DrawingArea::screenWasRefreshed):
2361         (WebKit::DrawingArea::createDisplayRefreshMonitor):
2362
2363 2018-03-17  Jiewen Tan  <jiewen_tan@apple.com>
2364
2365         [WebAuthN] Implement authenticatorMakeCredential
2366         https://bugs.webkit.org/show_bug.cgi?id=183527
2367         <rdar://problem/35275886>
2368
2369         Reviewed by Brent Fulgham.
2370
2371         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
2372         (WebKit::WebCredentialsMessengerProxy::WebCredentialsMessengerProxy):
2373         (WebKit::WebCredentialsMessengerProxy::makeCredential):
2374         (WebKit::WebCredentialsMessengerProxy::getAssertion):
2375         (WebKit::WebCredentialsMessengerProxy::isUserVerifyingPlatformAuthenticatorAvailable):
2376         (WebKit::WebCredentialsMessengerProxy::exceptionReply):
2377         (WebKit::WebCredentialsMessengerProxy::makeCredentialReply):
2378         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
2379         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in:
2380         * UIProcess/CredentialManagement/cocoa/WebCredentialsMessengerProxyCocoa.mm: Removed.
2381         * WebKit.xcodeproj/project.pbxproj:
2382         * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp:
2383         (WebKit::WebCredentialsMessenger::makeCredential):
2384         (WebKit::WebCredentialsMessenger::makeCredentialReply):
2385         * WebProcess/CredentialManagement/WebCredentialsMessenger.h:
2386         * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in:
2387
2388 2018-03-17  Daniel Bates  <dabates@apple.com>
2389
2390         Tests fail in messages_unittest.py
2391         https://bugs.webkit.org/show_bug.cgi?id=183725
2392
2393         Partial revert of r222113. The messages generator machinery does not know when
2394         it is sufficient to emit an include for wtf/Forward.h as opposed to a concrete
2395         header.
2396
2397         * Scripts/webkit/LegacyMessages-expected.h:
2398         * Scripts/webkit/Messages-expected.h:
2399
2400 2018-03-16  Wenson Hsieh  <wenson_hsieh@apple.com>
2401
2402         Unreviewed, rolling out r229688.
2403
2404         There's a solution that doesn't require this SPI.
2405
2406         Reverted changeset:
2407
2408         "Add SPI to expose width and height anchors for WKWebView's
2409         content view"
2410         https://bugs.webkit.org/show_bug.cgi?id=183711
2411         https://trac.webkit.org/changeset/229688
2412
2413 2018-03-16  Wenson Hsieh  <wenson_hsieh@apple.com>
2414
2415         Add SPI to expose width and height anchors for WKWebView's content view
2416         https://bugs.webkit.org/show_bug.cgi?id=183711
2417         <rdar://problem/38562899>
2418
2419         Reviewed by Tim Horton.
2420
2421         Add _contentWidthAnchor and _contentHeightAnchor SPI to WKWebView for internal clients to be able to reason
2422         about the size of the content view on iOS using autolayout.
2423
2424         Test: WebKit.AutoLayoutPositionHeaderAndFooterViewsInScrollView.
2425
2426         * UIProcess/API/Cocoa/WKWebView.mm:
2427         (-[WKWebView _contentWidthAnchor]):
2428         (-[WKWebView _contentHeightAnchor]):
2429         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2430
2431 2018-03-16  Megan Gardner  <megan_gardner@apple.com>
2432
2433         Add _useSystemAppearance to WKView
2434         https://bugs.webkit.org/show_bug.cgi?id=183706
2435         <rdar://problem/38516584>
2436
2437         Reviewed by Tim Horton.
2438
2439         Plumb useSystemAppearance and other supporting functions to WKView
2440
2441         * UIProcess/API/Cocoa/WKViewPrivate.h:
2442         * UIProcess/API/Cocoa/WKWebView.mm:
2443         (-[WKWebView _initializeWithConfiguration:]):
2444         (-[WKWebView _useSystemAppearance]):
2445         (-[WKWebView _setUseSystemAppearance:]):
2446         (-[WKWebView effectiveAppearanceDidChange]):
2447         * UIProcess/API/mac/WKView.mm:
2448         (-[WKView effectiveAppearanceDidChange]):
2449         (-[WKView _setUseSystemAppearance:]):
2450         (-[WKView _useSystemAppearance]):
2451         (-[WKView _setDefaultAppearance:]):
2452         * UIProcess/Cocoa/WebViewImpl.h:
2453         * UIProcess/Cocoa/WebViewImpl.mm:
2454         (WebKit::WebViewImpl::setUseSystemAppearance):
2455         (WebKit::WebViewImpl::useSystemAppearance):
2456         (WebKit::WebViewImpl::setDefaultAppearance):
2457
2458 2018-03-16  Brent Fulgham  <bfulgham@apple.com>
2459
2460         Set a trap to catch an infrequent form-related nullptr crash
2461         https://bugs.webkit.org/show_bug.cgi?id=183704
2462         <rdar://problem/37579354>
2463
2464         Reviewed by Ryosuke Niwa.
2465
2466         Add a RELEASE_ASSERT to see if we ever encounter a nullptr WebCore frame.
2467
2468         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2469         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
2470
2471 2018-03-16  Jer Noble  <jer.noble@apple.com>
2472
2473         Make Fullscreen API an Experimental Feature
2474         https://bugs.webkit.org/show_bug.cgi?id=183662
2475
2476         Reviewed by Jon Lee.
2477
2478         Add the ability to have a conditional for whether an Experimental Feature is "visible", separate from
2479         whether the preference is available, for definining platform-specific Experimental Features.
2480
2481         * Scripts/GeneratePreferences.rb:
2482         * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
2483         * Shared/WebPreferences.yaml:
2484
2485 2018-03-16  Megan Gardner  <megan_gardner@apple.com>
2486
2487         Ensure that style is updated when the effective appearance changes
2488         https://bugs.webkit.org/show_bug.cgi?id=183690
2489         <rdar://problem/38385900>
2490
2491         Reviewed by Tim Horton and Wenson Hsieh.
2492
2493         Respond to and respect the effective appearance changing.
2494
2495         * UIProcess/API/Cocoa/WKWebView.mm:
2496         (-[WKWebView effectiveAppearanceDidChange]):
2497         * WebProcess/WebPage/WebPage.cpp:
2498         (WebKit::WebPage::setDefaultAppearance):
2499
2500 2018-03-16  Chris Dumez  <cdumez@apple.com>
2501
2502         URLSchemeHandler.Basic API test fails with async policy delegates
2503         https://bugs.webkit.org/show_bug.cgi?id=183678
2504
2505         Reviewed by Alex Christensen.
2506
2507         The issue is that the client calls _didPerformRedirection / didReceiveResponse / didReceiveData / didFinish
2508         on the URLScheme task one after the one, synchronously. However, redirects and responses can be processed
2509         asynchronously. To address the issue, we now queue operations requested by the client if we're waiting
2510         for an async policy delegate.
2511
2512         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
2513         (WebKit::WebURLSchemeTaskProxy::didPerformRedirection):
2514         (WebKit::WebURLSchemeTaskProxy::didReceiveResponse):
2515         (WebKit::WebURLSchemeTaskProxy::didReceiveData):
2516         (WebKit::WebURLSchemeTaskProxy::didComplete):
2517         (WebKit::WebURLSchemeTaskProxy::processNextPendingTask):
2518         * WebProcess/WebPage/WebURLSchemeTaskProxy.h:
2519         (WebKit::WebURLSchemeTaskProxy::queueTask):
2520
2521 2018-03-16  Claudio Saavedra  <csaavedra@igalia.com>
2522
2523         Suppress GCC warnings by using #include instead of #import
2524
2525         Unreviewed.
2526         * UIProcess/SystemPreviewController.cpp:
2527
2528 2018-03-15  Keith Rollin  <krollin@apple.com>
2529
2530         Telemetry for stalled webpage loads
2531         https://bugs.webkit.org/show_bug.cgi?id=183221
2532         <rdar://problem/36549013>
2533
2534         Reviewed by Chris Dumez.
2535
2536         Add telemetry for page loads, tracking the pages that succeed, fail,
2537         or are canceled. This information will be used to track the overall
2538         health of our page loading as time goes on.
2539
2540         * UIProcess/WebPageProxy.cpp:
2541         (WebKit::WebPageProxy::close):
2542         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
2543         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
2544         (WebKit::WebPageProxy::didFinishLoadForFrame):
2545         (WebKit::WebPageProxy::didFailLoadForFrame):
2546         (WebKit::WebPageProxy::reportPageLoadResult):
2547         * UIProcess/WebPageProxy.h:
2548         (WebKit::WebPageProxy::reportPageLoadResult):
2549
2550 2018-03-15  Wenson Hsieh  <wenson_hsieh@apple.com>
2551
2552         [iOS WK2] Hit-testing fails when specifying a large top content inset
2553         https://bugs.webkit.org/show_bug.cgi?id=183648
2554         <rdar://problem/38421894>
2555
2556         Reviewed by Tim Horton.
2557
2558         Currently, in the process of computing unobscured content rect in the UI process on iOS, we subtract away parts
2559         of the view that are obscured by insets (e.g. MobileSafari's chrome). The helper method -[WKWebView
2560         _computeContentInset] is intended to compute these obscuring insets around the view, but it takes scroll view
2561         insets into account. This means that if WKWebView's inner scroll view has content insets, we'll end up shrinking
2562         the unobscured content rect as if the insetted region obscures the viewport; this causes visible content on the
2563         page to be uninteractible, since WKWebView erroneously thinks it's obscured.
2564
2565         To address this, we rename _computeContentInset to _computeObscuredInset, and make it _not_ affected by the
2566         scroll view's content insets. From code inspection and testing, all but one of the former call sites of
2567         _computeContentInset really need the obscured inset instead (see below). The one exception, -[WKWebView
2568         _adjustedContentOffset:], takes a scroll position from the page and maps it to a content offset in the inner
2569         UIScrollView (see below for more details).
2570
2571         Tests:  ScrollViewInsetTests.InnerHeightWithLargeTopContentInset
2572                 ScrollViewInsetTests.InnerHeightWithLargeBottomContentInset
2573                 ScrollViewInsetTests.RestoreInitialContentOffsetAfterCrash
2574                 ScrollViewInsetTests.RestoreInitialContentOffsetAfterNavigation
2575
2576         * UIProcess/API/Cocoa/WKWebView.mm:
2577         (-[WKWebView _setHasCustomContentView:loadedMIMEType:]):
2578         (-[WKWebView _initialContentOffsetForScrollView]):
2579
2580         See -_contentOffsetAdjustedForObscuredInset: below.
2581
2582         (-[WKWebView _contentOffsetAdjustedForObscuredInset:]):
2583
2584         Formerly -_adjustedContentOffset:. -_contentOffsetAdjustedForObscuredInset: no longer takes scroll view content
2585         inset into account, and only cares about insets that obscure the view. This means that the scroll position
2586         (0, 0) in the document now maps to the content offset in the inner UIScrollView, such that the top of the page
2587         is aligned with the top of the viewport.
2588
2589         However, many call sites of -_adjustedContentOffset: were intended to compute the initial, top-left-most content
2590         offset in the scroll view to scroll to when resetting the web view (i.e., they pass in CGPointZero for the
2591         scroll position). An example of this is the scroll position to jump to after web content process termination, or
2592         the scroll position after main frame navigation. In these cases, we actually want to jump to the top of the
2593         scroll view, so we do want to use the version of the computed content insets that accounts for scroll view
2594         insets.
2595
2596         Since these cases are limited to finding the top-left-most scroll position, we pull this out into a separate
2597         helper method (-_initialContentOffsetForScrollView) and replace calls to
2598         `-[self _adjustedContentOffset:CGPointZero]` with this instead.
2599
2600         (-[WKWebView _computedObscuredInset]):
2601
2602         A version of -_computeContentInset that doesn't care about scroll view insets. Used whereever we need to account
2603         for obscured insets rather than the combination of content insets and unobscured insets (e.g.
2604         -_initialContentOffsetForScrollView).
2605
2606         (-[WKWebView _processDidExit]):
2607         (-[WKWebView _didCommitLayerTree:]):
2608         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
2609         (-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]):
2610         (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
2611         (-[WKWebView _updateVisibleContentRects]):
2612         (-[WKWebView _navigationGestureDidBegin]):
2613
2614         In all these places where we inset the view bounds to compute the unobscured region of the viewport, it doesn't
2615         make sense to additionally inset by the scroll view's content insets, since (1) the scroll view's content insets
2616         don't obscure the viewport, and (2) it's perfectly valid for the inner scroll view to have arbitrarily large
2617         content insets.
2618
2619         (-[WKWebView _adjustedContentOffset:]): Deleted.
2620
2621         Renamed to -_contentOffsetAdjustedForObscuredInset:.
2622
2623         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2624         * UIProcess/ios/WKPDFView.mm:
2625         (-[WKPDFView _offsetForPageNumberIndicator]):
2626
2627         Similar to -_scrollToFragment: (see below).
2628
2629         (-[WKPDFView _scrollToFragment:]):
2630
2631         This helper figures out which content offset to scroll to, given the y-origin of a page in a PDF document. If
2632         insets are added to the scroll view, we end up scrolling to the wrong content offset since we'll add the height
2633         of the top content inset (imagine that the top content inset is enormous — then we'll scroll an amount equal to
2634         the top content inset _past_ the point where the y-origin of the page is at the top of the viewport).
2635
2636 2018-03-15  Brent Fulgham  <bfulgham@apple.com>
2637
2638         [macOS] Correct sandbox violations during Flash playback under ToT WebKit
2639         https://bugs.webkit.org/show_bug.cgi?id=183672
2640         <rdar://problem/38510839>
2641
2642         Reviewed by Eric Carlson.
2643
2644         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2645         * WebProcess/com.apple.WebProcess.sb.in:
2646
2647 2018-03-15  Brent Fulgham  <bfulgham@apple.com>
2648
2649         REGRESSION(r229484): Plugins often require CGS Connections to draw
2650         https://bugs.webkit.org/show_bug.cgi?id=183663
2651         <rdar://problem/38439218>
2652
2653         Reviewed by Per Arne Vollan.
2654
2655         Flash requires an active CGSConnection to work properly. Since we don't want the WebContent
2656         process to have on, create a new plugin process-specific layer host creation method that
2657         gives this access.
2658
2659         * Platform/mac/LayerHostingContext.h:
2660         * Platform/mac/LayerHostingContext.mm:
2661         (WebKit::LayerHostingContext::createForExternalPluginHostingProcess): Added.
2662         * PluginProcess/mac/PluginControllerProxyMac.mm:
2663         (WebKit::PluginControllerProxy::updateLayerHostingContext): Use the new creation
2664         method.
2665
2666 2018-03-15  Zan Dobersek  <zdobersek@igalia.com>
2667
2668         [TexMap] Remove TextureMapperLayer::texture()
2669         https://bugs.webkit.org/show_bug.cgi?id=183635
2670
2671         Reviewed by Michael Catanzaro.
2672
2673         Remove the CoordinatedBackingStore::texture() override since the virtual
2674         method is also being removed.
2675
2676         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
2677         (WebKit::CoordinatedBackingStore::texture const): Deleted.
2678         * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
2679
2680 2018-03-14  John Wilander  <wilander@apple.com>
2681
2682         Resource Load Statistics: Add clearing of storage access to WebResourceLoadStatisticsStore::clearInMemory()
2683         https://bugs.webkit.org/show_bug.cgi?id=183641
2684         <rdar://problem/38469497>
2685
2686         Reviewed by Brent Fulgham and Chris Dumez.
2687
2688         This change is to stabilize existing layout tests by removing
2689         all storage access entries on a call to 
2690         WebResourceLoadStatisticsStore::clearInMemory().
2691         See Ryan Haddad's comment in https://bugs.webkit.org/show_bug.cgi?id=183620.
2692
2693         Almost all of the code changes are piping to get this
2694         call from the WebResourceLoadStatisticsStore to
2695         WebCore::NetworkStorageSession where entries reside.
2696
2697         * NetworkProcess/NetworkProcess.cpp:
2698         (WebKit::NetworkProcess::removeAllStorageAccess):
2699         * NetworkProcess/NetworkProcess.h:
2700         * NetworkProcess/NetworkProcess.messages.in:
2701         * UIProcess/Network/NetworkProcessProxy.cpp:
2702         (WebKit::NetworkProcessProxy::removeAllStorageAccess):
2703         * UIProcess/Network/NetworkProcessProxy.h:
2704         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2705         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2706         (WebKit::WebResourceLoadStatisticsStore::removeAllStorageAccess):
2707         (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
2708             Now also clears all storage access entries in the network process.
2709         * UIProcess/WebResourceLoadStatisticsStore.h:
2710         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2711         (WebKit::WebsiteDataStore::removeAllStorageAccessHandler):
2712         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
2713         * UIProcess/WebsiteData/WebsiteDataStore.h:
2714
2715 2018-03-14  Ryan Haddad  <ryanhaddad@apple.com>
2716
2717         Unreviewed, rolling out r229613.
2718
2719         Caused API test failures
2720
2721         Reverted changeset:
2722
2723         "Make policy decisions asynchronous"
2724         https://bugs.webkit.org/show_bug.cgi?id=180568
2725         https://trac.webkit.org/changeset/229613
2726
2727 2018-03-14  Chris Dumez  <cdumez@apple.com>
2728
2729         Reduce use of SWServerToContextConnection::globalServerToContextConnection()
2730         https://bugs.webkit.org/show_bug.cgi?id=183626
2731
2732         Reviewed by Youenn Fablet.
2733
2734         Reduce use of SWServerToContextConnection::globalServerToContextConnection() as we are moving
2735         towards having multiple context connections.
2736
2737         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2738         (WebKit::WebSWServerConnection::startFetch):
2739         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
2740
2741 2018-03-14  Chris Dumez  <cdumez@apple.com>
2742
2743         Make policy decisions asynchronous
2744         https://bugs.webkit.org/show_bug.cgi?id=180568
2745         <rdar://problem/37131297>
2746
2747         Reviewed by Alex Christensen.
2748
2749         Get rid of synchronous IPC and synchronous code paths for policy delegates.
2750         Policy decisions are now all made asynchronously and rely on asynchronous
2751         IPC.
2752
2753         This code change is based on work by Alex Christensen.
2754
2755         * UIProcess/WebPageProxy.cpp:
2756         (WebKit::WebPageProxy::receivedPolicyDecision):
2757         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2758         (WebKit::WebPageProxy::decidePolicyForResponse):
2759         * UIProcess/WebPageProxy.h:
2760         * UIProcess/WebPageProxy.messages.in:
2761         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2762         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2763         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2764
2765 2018-03-14  Chris Dumez  <cdumez@apple.com>
2766
2767         Drop unnecessary StorageToWebProcessConnection::workerContextProcessConnectionCreated()
2768         https://bugs.webkit.org/show_bug.cgi?id=183624
2769
2770         Reviewed by Youenn Fablet.
2771
2772         Drop unnecessary StorageToWebProcessConnection::workerContextProcessConnectionCreated()
2773         since it was going through all SWServers. Calling workerContextProcessConnectionCreated()
2774         on every StorageToWebProcessConnection was thus doing redundant work.
2775
2776         * StorageProcess/StorageProcess.cpp:
2777         (WebKit::StorageProcess::createStorageToWebProcessConnection):
2778         * StorageProcess/StorageToWebProcessConnection.cpp:
2779         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
2780         (WebKit::StorageToWebProcessConnection::workerContextProcessConnectionCreated): Deleted.
2781         * StorageProcess/StorageToWebProcessConnection.h:
2782
2783 2018-03-14  Tim Horton  <timothy_horton@apple.com>
2784
2785         Fix the build after r229567
2786
2787         * Configurations/FeatureDefines.xcconfig:
2788
2789 2018-03-13  John Wilander  <wilander@apple.com>
2790
2791         Resource Load Statistics: Immediately forward cookie access for domains with previous user interaction when there's an opener document
2792         https://bugs.webkit.org/show_bug.cgi?id=183620
2793         <rdar://problem/38431469>
2794
2795         Reviewed by Brent Fulgham.
2796
2797         It turns out the fix in https://bugs.webkit.org/show_bug.cgi?id=183577
2798         wasn't enough to address the compatibility issues with popups. Some of
2799         them just detect their unpartitioned cookies, auto-dismiss themselves,
2800         and expect their unpartitioned cookies to be available under the opener
2801         afterwards. We should grant them access if the popup's domain has had
2802         user interaction _previously_.
2803
2804         Note that we still need https://bugs.webkit.org/show_bug.cgi?id=183577
2805         because if the popup's domain has not received user interaction
2806         previously, we will not grant it storage access on just the window open.
2807
2808         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2809         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
2810         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessUnderOpener): Deleted.
2811             Renamed WebResourceLoadStatisticsStore::grantStorageAccessUnderOpener()
2812             to WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener()
2813             since there is now a case where access will not be granted, i.e. when
2814             the popup domain has not had user interaction previously.
2815         * UIProcess/WebResourceLoadStatisticsStore.h:
2816         * UIProcess/WebResourceLoadStatisticsStore.messages.in:
2817              Similar renaming.
2818         * WebProcess/WebProcess.cpp:
2819         (WebProcess::WebProcess):
2820              Similar renaming.
2821
2822 2018-03-13  Jer Noble  <jer.noble@apple.com>
2823
2824         Add missing artwork for fullscreen mode.
2825         https://bugs.webkit.org/show_bug.cgi?id=183618
2826
2827         Reviewed by Jon Lee.
2828
2829         * Resources/ios/iOS.xcassets/Done.imageset/Contents.json: Added.
2830         * Resources/ios/iOS.xcassets/Done.imageset/Done.pdf: Added.
2831         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/Contents.json: Added.
2832         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@1x.png: Added.
2833         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@2x.png: Added.
2834         * Resources/ios/iOS.xcassets/StartPictureInPictureButton.imageset/StartPictureInPictureButton@3x.png: Added.
2835         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/Contents.json: Added.
2836         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@1x.png: Added.
2837         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@2x.png: Added.
2838         * Resources/ios/iOS.xcassets/StopPictureInPictureButton.imageset/StopPictureInPictureButton@3x.png: Added.
2839
2840 2018-03-13  Brian Burg  <bburg@apple.com>
2841
2842         [WK2] Web Inspector: NavigationAction for opening a link in a new tab should have a UserGestureIndicator
2843         https://bugs.webkit.org/show_bug.cgi?id=183612
2844         <rdar://problem/38388641>
2845
2846         Reviewed by Timothy Hatcher.
2847
2848         The current gesture token will be attached to the NavigationAction at construction time,
2849         so set up a UserGestureIndicator when creating the action and sending it out.
2850
2851         * WebProcess/WebPage/WebInspector.cpp:
2852         (WebKit::WebInspector::openInNewTab):
2853
2854 2018-03-13  Dean Jackson  <dino@apple.com>
2855
2856         WKSystemPreviewView needs to implement some of UIScrollViewDelegate
2857         https://bugs.webkit.org/show_bug.cgi?id=183607
2858         <rdar://problem/38427622>
2859
2860         Reviewed by Antoine Quint.
2861
2862         Add an empty implementation of scrollViewDidScroll.
2863
2864         * UIProcess/ios/WKSystemPreviewView.mm:
2865         (-[WKSystemPreviewView scrollViewDidScroll:]):
2866
2867 2018-03-13  Jiewen Tan  <jiewen_tan@apple.com>
2868
2869         Soft-link LocalAuthentication.Framework
2870         https://bugs.webkit.org/show_bug.cgi?id=183587
2871         <rdar://problem/38219763>
2872
2873         Reviewed by Brian Burg.
2874
2875         * UIProcess/CredentialManagement/cocoa/WebCredentialsMessengerProxyCocoa.mm:
2876         (WebKit::WebCredentialsMessengerProxy::platformIsUserVerifyingPlatformAuthenticatorAvailable):
2877         * WebKit.xcodeproj/project.pbxproj:
2878
2879 2018-03-12  Dean Jackson  <dino@apple.com>
2880
2881         Add a WKWebViewContentProvider for system previews
2882         https://bugs.webkit.org/show_bug.cgi?id=183582
2883         <rdar://problem/38393569>
2884
2885         Reviewed by Tim Horton.
2886
2887         Implement WKSystemPreviewView, which conforms to WKWebViewContentProvider, in
2888         order to view content as a "system preview". This effectively replaces the
2889         SystemPreviewController, which will be removed soon.
2890
2891         Some of the required methods of WKWebViewContentProvider are not necessary on
2892         this instance, so a follow-up patch will clean the protocol up a bit.
2893
2894         * UIProcess/Cocoa/NavigationState.mm: Don't trigger a SystemPreview when downloading.
2895         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
2896
2897         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
2898         (-[WKWebViewContentProviderRegistry init]): Register the WKSystemPreviewView for
2899         MIME types retrieved from WebKitAdditions.
2900
2901         * UIProcess/ios/WKSystemPreviewView.h: Added.
2902         * UIProcess/ios/WKSystemPreviewView.mm: Added.
2903
2904         (-[WKSystemPreviewView web_initWithFrame:webView:]):
2905         (-[WKSystemPreviewView web_setContentProviderData:suggestedFilename:]): This is the
2906         method that actually creates a QuickLook preview and provides the data.
2907         (-[WKSystemPreviewView web_setMinimumSize:]):
2908         (-[WKSystemPreviewView web_setOverlaidAccessoryViewsInset:]):
2909         (-[WKSystemPreviewView web_computedContentInsetDidChange]):
2910         (-[WKSystemPreviewView web_setFixedOverlayView:]):
2911         (-[WKSystemPreviewView web_didSameDocumentNavigation:]):
2912         (-[WKSystemPreviewView web_countStringMatches:options:maxCount:]):
2913         (-[WKSystemPreviewView web_findString:options:maxCount:]):
2914         (-[WKSystemPreviewView web_hideFindUI]):
2915
2916         (-[WKSystemPreviewView numberOfPreviewItemsInPreviewController:]): QuickLook delegates.
2917         (-[WKSystemPreviewView previewController:previewItemAtIndex:]):
2918         (-[WKSystemPreviewView provideDataForItem:]):
2919         (-[WKSystemPreviewView previewControllerWillDismiss:]):
2920
2921         * WebKit.xcodeproj/project.pbxproj: Add new files.
2922
2923 2018-03-12  John Wilander  <wilander@apple.com>
2924
2925         Resource Load Statistics: Immediately forward cookie access at user interaction when there's an opener document
2926         https://bugs.webkit.org/show_bug.cgi?id=183577
2927         <rdar://problem/38266987>
2928
2929         Reviewed by Brent Fulgham.
2930
2931         * NetworkProcess/NetworkProcess.cpp:
2932         (WebKit::NetworkProcess::hasStorageAccessForFrame):
2933             Now also checks for general page access.
2934         (WebKit::NetworkProcess::grantStorageAccess):
2935             Renamed from grantStorageAccessForFrame since the frameID now is optional.
2936         (WebKit::NetworkProcess::grantStorageAccessForFrame): Deleted.
2937             Renamed since the frameID now is optional.
2938         * NetworkProcess/NetworkProcess.h:
2939             Renaming since the frameID now is optional.
2940         * NetworkProcess/NetworkProcess.messages.in:
2941             Renaming since the frameID now is optional.
2942         * NetworkProcess/NetworkResourceLoader.cpp:
2943         (WebKit::NetworkResourceLoader::logCookieInformation):
2944             Consequence of function renaming.
2945         * UIProcess/Network/NetworkProcessProxy.cpp:
2946         (WebKit::NetworkProcessProxy::grantStorageAccess):
2947         (WebKit::NetworkProcessProxy::grantStorageAccessForFrame): Deleted.
2948             Renaming since the frameID now is optional.
2949         * UIProcess/Network/NetworkProcessProxy.h:
2950         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2951         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2952             Renaming since the frameID now is optional.
2953         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
2954             Handler renaming since the frameID now is optional.
2955         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccessUnderOpener):
2956             New function for that grants cookie access under a whole page.
2957         * UIProcess/WebResourceLoadStatisticsStore.h:
2958             Member renaming since the frameID now is optional.
2959         * UIProcess/WebResourceLoadStatisticsStore.messages.in:
2960             New message received straight from WebCore::ResourceLoadObserver.
2961         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2962         (WebKit::WebsiteDataStore::grantStorageAccessHandler):
2963             Renamed and made frameID optional.
2964         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
2965             Consequence of renaming and making frameID optional.
2966         (WebKit::WebsiteDataStore::grantStorageAccessForFrameHandler): Deleted.
2967             Renamed and made frameID optional.
2968         * UIProcess/WebsiteData/WebsiteDataStore.h:
2969         * WebProcess/WebProcess.cpp:
2970         (WebProcess::WebProcess):
2971             Now calls setGrantStorageAccessUnderOpenerCallback() on the shared
2972             WebCore::ResourceLoadObserver.
2973
2974 2018-03-12  Tim Horton  <timothy_horton@apple.com>
2975
2976         Stop using SDK conditionals to control feature definitions
2977         https://bugs.webkit.org/show_bug.cgi?id=183430
2978         <rdar://problem/38251619>
2979
2980         Reviewed by Dan Bernstein.
2981
2982         * Configurations/FeatureDefines.xcconfig:
2983         * Configurations/WebKitTargetConditionals.xcconfig: Renamed.
2984
2985 2018-03-12  Yoav Weiss  <yoav@yoav.ws>
2986
2987         Runtime flag for link prefetch and remove link subresource.
2988         https://bugs.webkit.org/show_bug.cgi?id=183540
2989
2990         Reviewed by Chris Dumez.
2991
2992         Remove the LINK_PREFETCH build time flag.
2993
2994         * Configurations/FeatureDefines.xcconfig:
2995         * WebProcess/Network/WebLoaderStrategy.cpp:
2996         (WebKit::maximumBufferingTime):
2997
2998 2018-03-12  Chris Dumez  <cdumez@apple.com>
2999
3000         Load may get committed before receiving policy for the resource response
3001         https://bugs.webkit.org/show_bug.cgi?id=183579
3002         <rdar://problem/38268780>
3003
3004         Reviewed by Youenn Fablet.
3005
3006         r228852 updated WebResourceLoader::didReceiveResponse to only send the
3007         ContinueDidReceiveResponse IPC back to the Networkprocess *after* the
3008         policy decision for the resource response has been made. This is necessary
3009         now that policy decisions can be made asynchronously.
3010
3011         However, one of the 2 code paths in NetworkProcess side (code path when
3012         the resource is already in the HTTP disk cache) failed to wait for the
3013         ContinueDidReceiveResponse IPC before sending over the data to the WebProcess.
3014         As a result, the WebProcess could commit the load before even receiving the
3015         policy response from the client.        
3016
3017         * NetworkProcess/NetworkResourceLoader.cpp:
3018         (WebKit::NetworkResourceLoader::continueDidReceiveResponse):
3019         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
3020         (WebKit::NetworkResourceLoader::continueProcessingCachedEntryAfterDidReceiveResponse):
3021         * NetworkProcess/NetworkResourceLoader.h:
3022         Make sure NetworkResourceLoader::didRetrieveCacheEntry() does not start sending the data
3023         until the network process gets the ContinueDidReceiveResponse IPC back from the WebProcess.
3024
3025         * WebProcess/Network/WebResourceLoader.cpp:
3026         (WebKit::WebResourceLoader::didReceiveResponse):
3027         (WebKit::WebResourceLoader::didReceiveData):
3028         * WebProcess/Network/WebResourceLoader.h:
3029         Add assertion to make sure didReceiveData() never gets called before didReceiveResponse's
3030         completion handler has been called. If this hits, then the load may get committed even
3031         though the client did not reply to the policy for the resource response yet.
3032
3033 2018-03-12  Ali Juma  <ajuma@chromium.org>
3034
3035         http/tests/workers/service/service-worker-download.https.html times out with async policy delegates
3036         https://bugs.webkit.org/show_bug.cgi?id=183479
3037
3038         Reviewed by Youenn Fablet.
3039
3040         Ensure that ServiceWorkerFetchClient::m_isCheckingResponse is set before code that depends on it
3041         executes. This bit was set by code that's posted to the runloop using 'callOnMainThread' in
3042         ServiceWorkerFetchClient::didReceiveResponse. But when didReceiveResponse is executing, tasks for
3043         handling didReceiveData, didFail, or didFinish may already have been posted to the runloop, and in
3044         that case would execute before m_isCheckingResponse gets set, and then incorrectly fail to 
3045         early-out. Fix this by directly setting m_isCheckingResponse in didReceiveResponse.
3046
3047         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
3048         (WebKit::ServiceWorkerClientFetch::start):
3049         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
3050
3051 2018-03-12  Wenson Hsieh  <wenson_hsieh@apple.com>
3052
3053         REGRESSION(r211643): Dismissing WKActionSheet should not also dismiss its presenting view controller
3054         https://bugs.webkit.org/show_bug.cgi?id=183549
3055         <rdar://problem/34960698>
3056
3057         Reviewed by Andy Estes.
3058
3059         Fixes the bug by dismissing the presented view controller (i.e. the action sheet or the view controller being
3060         presented during rotation) rather than the presenting view controller.
3061
3062         Test: ActionSheetTests.DismissingActionSheetShouldNotDismissPresentingViewController
3063
3064         * UIProcess/ios/WKActionSheet.mm:
3065         (-[WKActionSheet doneWithSheet:]):
3066
3067 2018-03-12  Javier Fernandez  <jfernandez@igalia.com>
3068
3069         Remove GridLayout runtime flag
3070         https://bugs.webkit.org/show_bug.cgi?id=183484
3071
3072         Reviewed by Myles C. Maxfield.
3073
3074         The Grid Layout feature has been enabled by default for almost a
3075         year, so I think it's time to remove the runtime flag and the
3076         codepath run when the feature is disabled.
3077
3078         * Shared/WebPreferences.yaml:
3079         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3080         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3081
3082 2018-03-11  Wenson Hsieh  <wenson_hsieh@apple.com>
3083
3084         Fix the internal iOS build after r229512
3085         https://bugs.webkit.org/show_bug.cgi?id=183550
3086
3087         Reviewed by Zalan Bujtas.
3088
3089         Fixes a typo in a header import, as well as a nullability error. `SecTrustEvaluate()` takes in a nonnull outparam,
3090         which was removed in r229512; this adds the outparam back, but does not consult its value when setting the
3091         `infoDictionary`.
3092
3093         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
3094         (-[WKFullScreenWindowController _EVOrganizationName]):
3095
3096 2018-03-10  Jer Noble  <jer.noble@apple.com>
3097
3098         Improvements to fullscreen; new UI and security features
3099         https://bugs.webkit.org/show_bug.cgi?id=183503
3100
3101         Reviewed by Dean Jackson.
3102
3103         Now that the iOS Fullscreen code has more than one major class, move it into an ios/
3104         directory.
3105
3106         Clean up the WKFullScreenWindowControllerIOS class to more clearly separate external
3107         facing API from purely internal functions.
3108
3109         Move the WKFullScreenViewController out into its own file. Add support for fullscreen
3110         top inset and fullscreen autohide duration CSS constants.
3111
3112         Add a heuristic to distinguish between media control related touches and ones that look
3113         more keyboard interactions.
3114
3115         Add a new UIStackView based control to hold the fullscreen controls.
3116
3117         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm: Removed.
3118         * UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.cpp: Added.
3119         (WebKit::FullscreenTouchSecheuristic::scoreOfNextTouch):
3120         (WebKit::FullscreenTouchSecheuristic::reset):
3121         (WebKit::FullscreenTouchSecheuristic::distanceScore):
3122         (WebKit::FullscreenTouchSecheuristic::attenuationFactor):
3123         * UIProcess/ios/fullscreen/FullscreenTouchSecheuristic.h: 
3124         (WebKit::FullscreenTouchSecheuristic::setRampUpSpeed):
3125         (WebKit::FullscreenTouchSecheuristic::setRampDownSpeed):
3126         (WebKit::FullscreenTouchSecheuristic::setXWeight):
3127         (WebKit::FullscreenTouchSecheuristic::setYWeight):
3128         (WebKit::FullscreenTouchSecheuristic::setSize):
3129         (WebKit::FullscreenTouchSecheuristic::setGamma):
3130         (WebKit::FullscreenTouchSecheuristic::setGammaCutoff):
3131         * UIProcess/ios/fullscreen/WKFullScreenViewController.h:
3132         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm: Added.
3133         (WKFullScreenViewControllerPlaybackSessionModelClient::setParent):
3134         (WKFullScreenViewControllerPlaybackSessionModelClient::setInterface):
3135         (-[_WKExtrinsicButton setExtrinsicContentSize:]):
3136         (-[_WKExtrinsicButton intrinsicContentSize]):
3137         (-[WKFullScreenViewController initWithWebView:]):
3138         (-[WKFullScreenViewController dealloc]):
3139         (-[WKFullScreenViewController showUI]):
3140         (-[WKFullScreenViewController hideUI]):
3141         (-[WKFullScreenViewController videoControlsManagerDidChange]):
3142         (-[WKFullScreenViewController setPrefersStatusBarHidden:]):
3143         (-[WKFullScreenViewController setPlaying:]):
3144         (-[WKFullScreenViewController setPictureInPictureActive:]):
3145         (-[WKFullScreenViewController loadView]):
3146         (-[WKFullScreenViewController viewWillAppear:]):
3147         (-[WKFullScreenViewController viewDidLayoutSubviews]):
3148         (-[WKFullScreenViewController viewWillTransitionToSize:withTransitionCoordinator:]):
3149         (-[WKFullScreenViewController preferredStatusBarStyle]):
3150         (-[WKFullScreenViewController prefersStatusBarHidden]):
3151         (-[WKFullScreenViewController gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
3152         (-[WKFullScreenViewController gestureRecognizer:shouldReceiveTouch:]):
3153         (-[WKFullScreenViewController _manager]):
3154         (-[WKFullScreenViewController _effectiveFullscreenInsetTop]):
3155         (-[WKFullScreenViewController _cancelAction:]):
3156         (-[WKFullScreenViewController _togglePiPAction:]):
3157         (-[WKFullScreenViewController _touchDetected:]):
3158         (-[WKFullScreenViewController _statusBarFrameDidChange:]):
3159         (-[WKFullScreenViewController _updateWebViewFullscreenInsets]):
3160         (-[WKFullScreenViewController _showPhishingAlert]):
3161         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.h: Copied from Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.h.
3162         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm: Added.
3163         (WebKit::replaceViewWithView):
3164         (WebKit::WKWebViewState::applyTo):
3165         (WebKit::WKWebViewState::store):
3166         (-[WKFullscreenAnimationController transitionDuration:]):
3167         (-[WKFullscreenAnimationController configureInitialAndFinalStatesForTransition:]):
3168         (-[WKFullscreenAnimationController animateTransition:]):
3169         (-[WKFullscreenAnimationController animationEnded:]):
3170         (-[WKFullscreenAnimationController startInteractiveTransition:]):
3171         (-[WKFullscreenAnimationController updateWithPercent:]):
3172         (-[WKFullscreenAnimationController updateWithPercent:translation:anchor:]):
3173         (-[WKFullscreenAnimationController end:]):
3174         (-[WKFullScreenInteractiveTransition initWithAnimator:anchor:]):
3175         (-[WKFullScreenInteractiveTransition wantsInteractiveStart]):
3176         (-[WKFullScreenInteractiveTransition startInteractiveTransition:]):
3177         (-[WKFullScreenInteractiveTransition updateInteractiveTransition:withTranslation:]):
3178         (-[WKFullScreenInteractiveTransition cancelInteractiveTransition]):
3179         (-[WKFullScreenInteractiveTransition finishInteractiveTransition]):
3180         (-[WKFullScreenWindowController initWithWebView:]):
3181         (-[WKFullScreenWindowController dealloc]):
3182         (-[WKFullScreenWindowController isFullScreen]):
3183         (-[WKFullScreenWindowController webViewPlaceholder]):
3184         (-[WKFullScreenWindowController enterFullScreen]):
3185         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
3186         (-[WKFullScreenWindowController requestExitFullScreen]):
3187         (-[WKFullScreenWindowController exitFullScreen]):
3188         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
3189         (-[WKFullScreenWindowController _completedExitFullScreen]):
3190         (-[WKFullScreenWindowController close]):
3191         (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
3192         (-[WKFullScreenWindowController videoControlsManagerDidChange]):
3193         (-[WKFullScreenWindowController gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
3194         (-[WKFullScreenWindowController animationControllerForPresentedController:presentingController:sourceController:]):
3195         (-[WKFullScreenWindowController animationControllerForDismissedController:]):
3196         (-[WKFullScreenWindowController interactionControllerForDismissal:]):
3197         (-[WKFullScreenWindowController _exitFullscreenImmediately]):
3198         (-[WKFullScreenWindowController _invalidateEVOrganizationName]):
3199         (-[WKFullScreenWindowController _isSecure]):
3200         (-[WKFullScreenWindowController _serverTrust]):
3201         (-[WKFullScreenWindowController _EVOrganizationName]):
3202         (-[WKFullScreenWindowController _updateLocationInfo]):
3203         (-[WKFullScreenWindowController _manager]):
3204         (-[WKFullScreenWindowController _startToDismissFullscreenChanged:]):
3205         (-[WKFullScreenWindowController _interactiveDismissChanged:]):
3206         * UIProcess/ios/fullscreen/WKFullscreenStackView.h: Renamed from Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.h.
3207         * UIProcess/ios/fullscreen/WKFullscreenStackView.mm: Added.
3208         (+[WKFullscreenStackView baseEffects]):
3209         (+[WKFullscreenStackView configureView:forTintEffectWithColor:filterType:]):
3210         (+[WKFullscreenStackView configureView:withBackgroundFillOfColor:opacity:filter:]):
3211         (+[WKFullscreenStackView secondaryMaterialOverlayView]):
3212         (+[WKFullscreenStackView applyPrimaryGlyphTintToView:]):
3213         (+[WKFullscreenStackView applySecondaryGlyphTintToView:]):
3214         (-[WKFullscreenStackView initWithArrangedSubviews:axis:]):
3215         (-[WKFullscreenStackView setTargetViewForSecondaryMaterialOverlay:]):
3216         (-[WKFullscreenStackView contentView]):
3217         (-[WKFullscreenStackView _setArrangedSubviews:axis:]):
3218         (-[WKFullscreenStackView setBounds:]):
3219         (-[WKFullscreenStackView updateConstraints]):
3220         * WebKit.xcodeproj/project.pbxproj:
3221
3222 2018-03-10  Megan Gardner  <megan_gardner@apple.com>
3223
3224         Media query for default appearance
3225         https://bugs.webkit.org/show_bug.cgi?id=183539
3226         <rdar://problem/38326388>
3227
3228         Reviewed by Tim Horton.
3229
3230         Write a media query to evaluate appearance.
3231
3232         * Shared/WebPageCreationParameters.cpp:
3233         (WebKit::WebPageCreationParameters::encode const):
3234         (WebKit::WebPageCreationParameters::decode):
3235         * Shared/WebPageCreationParameters.h:
3236         * UIProcess/API/Cocoa/WKWebView.mm:
3237         (-[WKWebView _initializeWithConfiguration:]):
3238         (-[WKWebView _setUseSystemAppearance:]):
3239         * UIProcess/WebPageProxy.cpp:
3240         (WebKit::WebPageProxy::creationParameters):
3241         (WebKit::WebPageProxy::setDefaultAppearance):
3242         * UIProcess/WebPageProxy.h:
3243         (WebKit::WebPageProxy::defaultAppearance const):
3244         * WebProcess/WebPage/WebPage.cpp:
3245         (WebKit::m_credentialsMessenger):
3246         (WebKit::WebPage::setDefaultAppearance):
3247         * WebProcess/WebPage/WebPage.h:
3248         * WebProcess/WebPage/WebPage.messages.in:
3249
3250 2018-03-09  Jer Noble  <jer.noble@apple.com>
3251
3252         Unconditionalize more methods in VideoFullscreenInterface (and related classes)
3253         https://bugs.webkit.org/show_bug.cgi?id=183501
3254         <rdar://problem/38312038>
3255
3256         Unreviewed build fix; add correct pragmas to code referencing m_playbackSessionManager.
3257
3258         * UIProcess/WebPageProxy.cpp:
3259         (WebKit::WebPageProxy::hasActiveVideoForControlsManager const):
3260         (WebKit::WebPageProxy::requestControlledElementID const):
3261         (WebKit::WebPageProxy::isPlayingVideoInEnhancedFullscreen const):
3262
3263 2018-03-09  Brian Burg  <bburg@apple.com>
3264
3265         Web Inspector: there should only be one way for async backend commands to send failure
3266         https://bugs.webkit.org/show_bug.cgi?id=183524
3267
3268         Reviewed by Timothy Hatcher.
3269
3270         Remove useless ErrorString argument from async commands.
3271
3272         For Automation protocol, introduce sync and async macros for filling
3273         in and sending a failure response. Now that async commands don't have
3274         an ErrorString and sync commands don't have a callback, trying to send
3275         an error with the wrong macro is a compile-time error.
3276
3277         * UIProcess/Automation/WebAutomationSession.cpp:
3278         (WebKit::WebAutomationSession::getBrowsingContexts):
3279         (WebKit::WebAutomationSession::getBrowsingContext):
3280         (WebKit::WebAutomationSession::createBrowsingContext):
3281         (WebKit::WebAutomationSession::closeBrowsingContext):
3282         (WebKit::WebAutomationSession::switchToBrowsingContext):
3283         (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):
3284         (WebKit::WebAutomationSession::waitForNavigationToComplete):
3285         (WebKit::WebAutomationSession::navigateBrowsingContext):
3286         (WebKit::WebAutomationSession::goBackInBrowsingContext):
3287         (WebKit::WebAutomationSession::goForwardInBrowsingContext):
3288         (WebKit::WebAutomationSession::reloadBrowsingContext):
3289         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
3290         (WebKit::WebAutomationSession::resolveChildFrameHandle):
3291         (WebKit::WebAutomationSession::resolveParentFrameHandle):
3292         (WebKit::WebAutomationSession::computeElementLayout):
3293         (WebKit::WebAutomationSession::selectOptionElement):
3294         (WebKit::WebAutomationSession::isShowingJavaScriptDialog):
3295         (WebKit::WebAutomationSession::dismissCurrentJavaScriptDialog):
3296         (WebKit::WebAutomationSession::acceptCurrentJavaScriptDialog):
3297         (WebKit::WebAutomationSession::messageOfCurrentJavaScriptDialog):
3298         (WebKit::WebAutomationSession::setUserInputForCurrentJavaScriptPrompt):
3299         (WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
3300         (WebKit::WebAutomationSession::getAllCookies):
3301         (WebKit::WebAutomationSession::deleteSingleCookie):
3302         (WebKit::WebAutomationSession::addSingleCookie):
3303         (WebKit::WebAutomationSession::deleteAllCookies):
3304         (WebKit::WebAutomationSession::setSessionPermissions):
3305         (WebKit::WebAutomationSession::performMouseInteraction):
3306         (WebKit::WebAutomationSession::performKeyboardInteractions):
3307         (WebKit::WebAutomationSession::takeScreenshot):
3308         (WebKit::WebAutomationSession::didTakeScreenshot):
3309         * UIProcess/Automation/WebAutomationSession.h:
3310         * UIProcess/Automation/WebAutomationSessionMacros.h:
3311         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
3312         (WebKit::WebAutomationSession::inspectBrowsingContext):
3313
3314 2018-03-09  Jer Noble  <jer.noble@apple.com>
3315
3316         Don't pass NULL to the result parameter of SecTrustEvaluate()
3317         https://bugs.webkit.org/show_bug.cgi?id=183495
3318         <rdar://problem/38185688>
3319
3320         Reviewed by Andy Estes.
3321
3322         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
3323         (-[WKFullScreenWindowController _EVOrganizationName]):
3324
3325 2018-03-09  Dean Jackson  <dino@apple.com>
3326
3327         Allow NavigationState to intercept requests and send them to SystemPreviewController
3328         https://bugs.webkit.org/show_bug.cgi?id=183526
3329         <rdar://problem/37801140>
3330
3331         Reviewed by Tim Horton.
3332
3333         Implement a bit more of SystemPreviewController, such that it can be used
3334         from NavigationState to identify and handle content that can be previewed.
3335
3336         * UIProcess/Cocoa/NavigationState.mm:
3337         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
3338             If we'd in a download response policy, then check if SystemPreviewController
3339             can show the content. We ignore the download, but pass the original URL onto
3340             the preview. Ultimately, we'd want to avoid the navigation
3341             but use the download destination URL for preview.
3342
3343         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
3344         (-[_WKPreviewControllerDataSource initWithURL:]):
3345             Move the URL to property, to help use a single datasource object for all previews.
3346         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
3347         (-[_WKPreviewControllerDelegate initWithSystemPreviewController:]):
3348             Add a delegate object, so we can detect when the preview is dismissed and return
3349             to the previous page.
3350         (-[_WKPreviewControllerDelegate previewControllerWillDismiss:]):
3351         (WebKit::SystemPreviewController::showPreview):
3352             Use single instances of the QLPreviewController, its datasource and delegate.
3353
3354         * UIProcess/SystemPreviewController.cpp:
3355             Add a helper to navigate back.
3356         (WebKit::SystemPreviewController::SystemPreviewController):
3357         (WebKit::SystemPreviewController::sendPageBack):
3358         * UIProcess/SystemPreviewController.h:
3359
3360 2018-03-09  Jer Noble  <jer.noble@apple.com>
3361
3362         webkitfullscreenchange event not fired at the same time as :-webkit-full-screen pseudo selector changes; causes glitchiness
3363         https://bugs.webkit.org/show_bug.cgi?id=183383
3364         <rdar://problem/38197028>
3365
3366         Reviewed by Eric Carlson.
3367
3368         Follow-up patch: now that the 'fullscreenchange' event is being fired slightly earlier, the
3369         Fullscreen.TopContentInset tests triggers what appears to be an existing behavior: if you
3370         exit in the middle of an enter fullscreen animation, the exit never happens, because the
3371         NSWindow never starts the exit animation. The solution is to store the exit fullscreen
3372         request, and only act upon it when the enter animation completes.
3373
3374         * UIProcess/mac/WKFullScreenWindowController.h:
3375         * UIProcess/mac/WKFullScreenWindowController.mm:
3376         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
3377         (-[WKFullScreenWindowController exitFullScreen]):
3378
3379 2018-03-09  Jer Noble  <jer.noble@apple.com>
3380
3381         Unconditionalize more methods in VideoFullscreenInterface (and related classes)
3382         https://bugs.webkit.org/show_bug.cgi?id=183501
3383
3384         Reviewed by Eric Carlson.
3385
3386         No reason for these methods to be PLATFORM(MAC) only.
3387
3388         * UIProcess/API/Cocoa/WKWebView.mm:
3389         (-[WKWebView _videoControlsManagerDidChange]):
3390         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3391         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
3392         (WebKit::PlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID):
3393         (WebKit::PlaybackSessionManagerProxy::clearPlaybackControlsManager):
3394         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
3395         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
3396         * UIProcess/PageClient.h:
3397         * UIProcess/WebPageProxy.cpp:
3398         (WebKit::WebPageProxy::isPlayingMediaDidChange):
3399         (WebKit::WebPageProxy::handleControlledElementIDResponse const):
3400         (WebKit::WebPageProxy::isPlayingVideoInEnhancedFullscreen const):
3401         * UIProcess/WebPageProxy.h:
3402         * UIProcess/ios/PageClientImplIOS.h:
3403         * UIProcess/ios/PageClientImplIOS.mm:
3404         (WebKit::PageClientImpl::videoControlsManagerDidChange):
3405         * UIProcess/ios/WKFullScreenWindowControllerIOS.h:
3406         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
3407         (-[WKFullScreenWindowController videoControlsManagerDidChange]):
3408         * WebProcess/cocoa/PlaybackSessionManager.mm:
3409         (WebKit::PlaybackSessionManager::setUpPlaybackControlsManager):
3410
3411 2018-03-09  Per Arne Vollan  <pvollan@apple.com>
3412
3413         Create CA layer contexts with +remoteContextWithOptions.
3414         https://bugs.webkit.org/show_bug.cgi?id=182747
3415
3416         Reviewed by Brent Fulgham.
3417
3418         CA layer contexts (CAContext) are currently created with +contextWithCGSConnection, which is
3419         using the main WindowServer connection to create the context. Instead, the contexts can be
3420         created with +remoteContextWithOptions, which does not use the main WindowServer connection.
3421         This is a step towards limiting the access the WebContent process has to the window server.
3422         To make the +remoteContextWithOptions call succeed, the sandbox has to be modified to allow
3423         access to CARenderServer. Also, access to the WindowServer should be denied by calling
3424         CGSSetDenyWindowServerConnections(true) before entering the sandbox. This is planned to do
3425         in a follow-up patch. The call to +remoteContextWithOptions will open up WindowServer
3426         connections, since the WindowServer is the system default CA render server, but these
3427         connections come with limited WindowServer exposure. In addition, we need to open up the
3428         sandbox for accessing some IOKit properties.
3429
3430         * Platform/mac/LayerHostingContext.mm:
3431         (WebKit::LayerHostingContext::createForExternalHostingProcess):
3432         * Shared/mac/HangDetectionDisablerMac.mm:
3433         (WebKit::setClientsMayIgnoreEvents):
3434         * WebProcess/com.apple.WebProcess.sb.in:
3435
3436 2018-03-09  Brent Fulgham  <bfulgham@apple.com>
3437
3438         Remove cookie API access from WebContent Process
3439         https://bugs.webkit.org/show_bug.cgi?id=183519
3440         <rdar://problem/35368802>
3441
3442         Reviewed by Alex Christensen.
3443
3444         All cookie access is now handled in the Network Process. However, there are vestiges of the original logic that used CFNetwork APIs in the WebContent process.
3445
3446         This patch removes CFNetwork calls from the WebProcess code paths, since they serve no purpose in modern WebKit.
3447
3448         No tests because this is a code cleanup with no expected change in behavior.
3449
3450         * NetworkProcess/Cookies/mac/WebCookieManagerMac.mm:
3451         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy): Moved from WebFrameNetworkingContext.
3452         * NetworkProcess/NetworkProcess.h:
3453         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3454         (WebKit::NetworkProcess::setSharedHTTPCookieStorage): Moved from ChildProcess, since this should only be
3455         called in the NetworkProcess.
3456         * Shared/ChildProcess.h:
3457         * Shared/mac/ChildProcessMac.mm:
3458         (WebKit::ChildProcess::setSharedHTTPCookieStorage): Deleted.
3459         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
3460         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
3461         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): Remove CFNetwork code. This version of
3462         'ensureWebsiteDataStoreSession' is needed to maintain a dictionary on the WebProcess side so we can refer to
3463         the same network session in both the WebContent and Network processes.
3464         (WebKit::WebFrameNetworkingContext::webFrameLoaderClient const):
3465         (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts): Deleted.
3466         * WebProcess/cocoa/WebProcessCocoa.mm:
3467         (WebKit::WebProcess::platformInitializeWebProcess): Remove calls to CFNetwork.
3468
3469 2018-03-09  Youenn Fablet  <youenn@apple.com>
3470
3471         ServiceWorkerClientFetch should send data to its resource loader once the didReceiveResponse completion handler is called
3472         https://bugs.webkit.org/show_bug.cgi?id=183110
3473
3474         Reviewed by Chris Dumez.
3475
3476         Buffering data/finish event/fail event until the response completion handler is called.
3477
3478         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
3479         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
3480         (WebKit::ServiceWorkerClientFetch::didReceiveData):
3481         (WebKit::ServiceWorkerClientFetch::didFinish):
3482         (WebKit::ServiceWorkerClientFetch::didFail):
3483         (WebKit::ServiceWorkerClientFetch::didNotHandle):
3484         (WebKit::ServiceWorkerClientFetch::cancel):
3485         (WebKit::ServiceWorkerClientFetch::continueLoadingAfterCheckingResponse):
3486         * WebProcess/Storage/ServiceWorkerClientFetch.h:
3487
3488 2018-03-09  Jer Noble  <jer.noble@apple.com>
3489
3490         Add new CSS env constants for use with fullscreen
3491         https://bugs.webkit.org/show_bug.cgi?id=183498
3492
3493         Reviewed by Dean Jackson.
3494
3495         Pass the values given to WebFullScreenManagerProxy through the process boundary and
3496         into WebCore.
3497
3498         * UIProcess/WebFullScreenManagerProxy.cpp:
3499         (WebKit::WebFullScreenManagerProxy::setFullscreenInsetTop):
3500         (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideDelay):
3501         * UIProcess/WebFullScreenManagerProxy.h:
3502         * WebProcess/FullScreen/WebFullScreenManager.cpp:
3503         (WebKit::WebFullScreenManager::didExitFullScreen):
3504         (WebKit::WebFullScreenManager::setFullscreenInsetTop):
3505         (WebKit::WebFullScreenManager::setFullscreenAutoHideDelay):
3506         * WebProcess/FullScreen/WebFullScreenManager.h:
3507         * WebProcess/FullScreen/WebFullScreenManager.messages.in:
3508
3509 2018-03-09  Jer Noble  <jer.noble@apple.com>
3510
3511         Add isPictureInPictureActive messaging across WebKit process boundary
3512         https://bugs.webkit.org/show_bug.cgi?id=183499
3513
3514         Reviewed by Eric Carlson.
3515
3516         * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
3517         * UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in:
3518         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
3519         (WebKit::PlaybackSessionModelContext::pictureInPictureActiveChanged):
3520         (WebKit::PlaybackSessionManagerProxy::pictureInPictureActiveChanged):
3521
3522 2018-03-09  Stephan Szabo  <stephan.szabo@sony.com>
3523
3524         Add guard for wtf/glib include
3525         https://bugs.webkit.org/show_bug.cgi?id=183521
3526
3527         Reviewed by Alex Christensen.
3528
3529         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
3530
3531 2018-03-09  Andy Estes  <aestes@apple.com>
3532
3533         [Mac] WebKit fails to receive file promises when the embedding app is sandboxed
3534         https://bugs.webkit.org/show_bug.cgi?id=183489
3535         <rdar://problem/38267517>
3536
3537         WebKit calls -[NSFilePromiseReceiver receivePromisedFilesAtDestination:...] with
3538         NSTemporaryDirectory() as the destination for receiving file promise drops. AppKit attempts
3539         to issue a sandbox extension for this directory, but for security reasons App Sandbox
3540         refuses to do so for NSTemporaryDirectory() itself. As a result, AppKit will call our reader
3541         block with a nil error and a valid file URL, but no file will actually exist at that URL.
3542
3543         In order for App Sandbox to grant issuing the sandbox extension needed by AppKit, we need to
3544         use some other destination directory. This patch uses FileSystem::createTemporaryDirectory()
3545         to securely create a unique temporary directory inside NSTemporaryDirectory() for use as the
3546         drop destination.
3547
3548         Reviewed by Wenson Hsieh.
3549
3550         * UIProcess/Cocoa/WebViewImpl.mm:
3551         (WebKit::WebViewImpl::performDragOperation):
3552
3553 2018-03-09  Carlos Garcia Campos  <cgarcia@igalia.com>
3554
3555         [GTK] Do not use WebKitDOMHTMLFormElement as argument of signal WebKitWebPage::will-submit-form
3556         https://bugs.webkit.org/show_bug.cgi?id=183510
3557
3558         Reviewed by Michael Catanzaro.
3559
3560         In 2.22 WebKitDOMHTMLFormElement will be deprecated in GTK+ port and won't still exist in WPE. The new
3561         JavaScript GLib API will be used to replace most of the DOM API, but a few classes will remain with a minimal
3562         API for things that can't be done with JavaScript. WebKitDOMElement will stay and will be added to WPE as well,
3563         so if we change the signal parameter to WebKitDOMElement we will be able to keep using
3564         WebKitWebPage::will-submit-form without any changes. WPE will gain this signal and the rest of the API that uses
3565         DOM.
3566
3567         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
3568         (webkit_web_page_class_init):
3569
3570 2018-03-09  Carlos Garcia Campos  <cgarcia@igalia.com>
3571
3572         Unreviewed. [GTK][WPE] Bump Since tags of resource load stats API.
3573
3574         The functionality hasn't been properly tested to be released in WebKitGTK+ 2.20.
3575
3576         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
3577         (webkit_website_data_manager_class_init):
3578         * UIProcess/API/gtk/WebKitWebsiteData.h:
3579         * UIProcess/API/wpe/WebKitWebsiteData.h:
3580
3581 2018-03-08  Zan Dobersek  <zdobersek@igalia.com>
3582
3583         Unreviewed. Suppress GCC warnings in SystemPreviewController.cpp by
3584         using the cross-platform #include directives for header inclusion,
3585         instead of #import.
3586
3587         * UIProcess/SystemPreviewController.cpp:
3588
3589 2018-03-08  Megan Gardner  <megan_gardner@apple.com>
3590
3591         Allow WebViews to disable system appearance
3592         https://bugs.webkit.org/show_bug.cgi?id=183418
3593         <rdar://problem/36975642>
3594
3595         Reviewed by Tim Horton.
3596         
3597         Allow webviews to choose whether or not to follow the default system appearance.
3598
3599         * Shared/WebPageCreationParameters.cpp:
3600         (WebKit::WebPageCreationParameters::encode const):
3601         (WebKit::WebPageCreationParameters::decode):
3602         * Shared/WebPageCreationParameters.h:
3603         * UIProcess/API/Cocoa/WKWebView.mm:
3604         (-[WKWebView _useSystemAppearance]):
3605         (-[WKWebView _setUseSystemAppearance:]):
3606         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3607         * UIProcess/WebPageProxy.cpp:
3608         (WebKit::WebPageProxy::creationParameters):
3609         (WebKit::WebPageProxy::setUseSystemAppearance):
3610         * UIProcess/WebPageProxy.h:
3611         (WebKit::WebPageProxy::useSystemAppearance const):
3612         * WebProcess/WebPage/WebPage.cpp:
3613         (WebKit::WebPage::setUseSystemAppearance):
3614         * WebProcess/WebPage/WebPage.h:
3615         * WebProcess/WebPage/WebPage.messages.in:
3616
3617 2018-03-08  Michael Catanzaro  <mcatanzaro@igalia.com>
3618
3619         Unreviewed, speculative attempt to fix CMake build after r229426
3620         https://bugs.webkit.org/show_bug.cgi?id=183382
3621         <rdar://problem/38191450>
3622
3623         * CMakeLists.txt:
3624
3625 2018-03-08  Wenson Hsieh  <wenson_hsieh@apple.com>
3626
3627         [Extra zoom mode] Support resigning first responder status when focusing a form control
3628         https://bugs.webkit.org/show_bug.cgi?id=183477
3629         <rdar://problem/38225994>
3630
3631         Reviewed by Tim Horton.
3632
3633         Currently, when presenting an input view controller in extra zoom mode, if the web view loses first responder
3634         status, we will blur the focused element, which dismisses all focused form control UI. For certain types of form
3635         controls, this prevents the user from using key pieces of functionality.
3636
3637         To address this, disconnect the notion of first responder status from DOM element focus while the form control
3638         overlay is shown. Later, when the active input session ends, if the web content view was first responder before
3639         upon focusing the element, restore first responder status on the web view. This extra tweak is needed to ensure
3640         that certain UI affordances which require first responder status on the web view continue to work after
3641         interacting with a form control that changes the first responder.
3642
3643         * UIProcess/ios/WKContentViewInteraction.h:
3644         * UIProcess/ios/WKContentViewInteraction.mm:
3645         (-[WKContentView presentFocusedFormControlViewController:]):
3646         (-[WKContentView dismissFocusedFormControlViewController:]):
3647
3648 2018-03-08  John Wilander  <wilander@apple.com>
3649
3650         Resource Load Statistics: Revert defaults read of zero values
3651         https://bugs.webkit.org/show_bug.cgi?id=183476
3652
3653         Unreviewed revert of three small changes landed in r229427.
3654
3655         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
3656         (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
3657             Reverted back to strict check of greater than zero for defaults reads.
3658
3659 2018-03-08  Tim Horton  <timothy_horton@apple.com>
3660
3661         Don't have SafariServices in minimal simulator build
3662         https://bugs.webkit.org/show_bug.cgi?id=183436
3663         <rdar://problem/38254778>
3664
3665         Reviewed by Dan Bernstein.
3666
3667         * config.h:
3668
3669 2018-03-08  John Wilander  <wilander@apple.com>
3670
3671         Resource Load Statistics: Make debug mode always partition prevalent resources
3672         https://bugs.webkit.org/show_bug.cgi?id=183468
3673         <rdar://problem/38269437>
3674
3675         Reviewed by Brent Fulgham.
3676
3677         After some testing we decided that a 30 second timeout in ITP debug mode just makes
3678         it confusing. We should instead always partition prevalent resources in debug mode
3679         to make it easy to understand. The partitioned state is what developers want to test
3680         anyway.
3681
3682         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
3683         (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
3684             Minor change to include 0 as valid setting.
3685         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3686         (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
3687             Now just stores the setting of debug mode instead of changing the timeout.
3688         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
3689             Now does not disable partitioning under debug mode.
3690         (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies const):
3691             Now returns true for prevalent resources with user interaction under debug mode.            
3692         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
3693             Removed duplicate debug logging statement.
3694         * UIProcess/WebResourceLoadStatisticsStore.h:
3695             Added member m_debugModeEnabled.
3696
3697 2018-03-08  Brent Fulgham  <bfulgham@apple.com>
3698
3699         Remove WebCookieManager and messaging from WebContent process.
3700         https://bugs.webkit.org/show_bug.cgi?id=183382
3701         <rdar://problem/38191450>
3702
3703         Reviewed by Alex Christensen.
3704
3705         Networking access was fully removed from the WebContent process in Bug 183192 (and related bugs). The
3706         UIProcess no longer needs to ask the WebContent process about networking-related things, and shouldn't
3707         waste everyone's time doing so.
3708
3709         This bug removes some left-over WebCookieManager API stuff, and is a first step in purging the
3710         WebContent Process from accessing cookie data.
3711
3712         * NetworkProcess/Cookies: Copied from WebProcess/Cookies.
3713         * NetworkProcess/Cookies/WebCookieManager.h:
3714         * WebKit.xcodeproj/project.pbxproj:
3715         * WebProcess/Cookies: Removed.
3716         * WebProcess/Cookies/WebCookieManager.cpp: Removed.
3717         * WebProcess/Cookies/WebCookieManager.h: Removed.
3718         * WebProcess/Cookies/WebCookieManager.messages.in: Removed.
3719         * WebProcess/Cookies/curl: Removed.
3720         * WebProcess/Cookies/curl/WebCookieManagerCurl.cpp: Removed.
3721         * WebProcess/Cookies/mac: Removed.
3722         * WebProcess/Cookies/mac/WebCookieManagerMac.mm: Removed.
3723         * WebProcess/Cookies/soup: Removed.
3724         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp: Removed.
3725         * WebProcess/InjectedBundle/InjectedBundle.cpp: Remove 'WebCookieManager.h" header.
3726         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: Ditto.
3727         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: Ditto.
3728         * WebProcess/WebProcess.cpp:
3729         (WebKit::WebProcess::WebProcess): Remove call to add WebCookieManager as a
3730         WebProcessSupplement.
3731         * CMakeLists.txt: Revised paths.
3732         * DerivedSources.make: Ditto.
3733         * PlatformMac.cmake: Ditto.
3734         * PlatformWin.cmake: Ditto.
3735         * SourcesGTK.txt: Ditto.
3736         * SourcesWPE.txt: Ditto.
3737
3738 2018-03-08  Youenn Fablet  <youenn@apple.com>
3739
3740         libwebrtc update broke internal builds
3741         https://bugs.webkit.org/show_bug.cgi?id=183454
3742
3743         Reviewed by Eric Carlson.
3744
3745         * Configurations/BaseTarget.xcconfig:
3746
3747 2018-03-08  Youenn Fablet  <youenn@apple.com>
3748
3749         PluginInfoStore::isSupportedPlugin should check for empty mime type
3750         https://bugs.webkit.org/show_bug.cgi?id=183457
3751         <rdar://problem/38159575>
3752
3753         Reviewed by Chris Dumez.
3754
3755         * UIProcess/Plugins/PluginInfoStore.cpp:
3756         (WebKit::PluginInfoStore::isSupportedPlugin):
3757
3758 2018-03-08  Yusuke Suzuki  <utatane.tea@gmail.com>
3759
3760         [JSC][WebCore] Extend jsDynamicCast for WebCore types in WebCore and remove jsDynamicDowncast
3761         https://bugs.webkit.org/show_bug.cgi?id=183449
3762
3763         Reviewed by Mark Lam.
3764
3765         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
3766         (WebKit::WebAutomationSessionProxy::elementForNodeHandle):
3767         * WebProcess/WebPage/WebFrame.cpp:
3768         (WebKit::WebFrame::frameForContext):
3769
3770 2018-03-08  Yusuke Suzuki  <utatane.tea@gmail.com>
3771
3772         [JSC] Add inherits<T>(VM&) leveraging JSCast fast path
3773         https://bugs.webkit.org/show_bug.cgi?id=183429
3774
3775         Reviewed by Mark Lam.
3776
3777         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
3778         (WebKit::callMethod):
3779         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
3780         (WebKit::callNPJSObject):
3781         (WebKit::constructWithConstructor):
3782         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
3783         (WebKit::NPJSObject::create):
3784         * WebProcess/WebPage/WebFrame.cpp:
3785         (WebKit::WebFrame::counterValue):
3786
3787 2018-03-08  Zan Dobersek  <zdobersek@igalia.com>
3788
3789         Remove WebCore::TextureMapperAnimation as a special case in WebKit IPC
3790         generation. Values of this type aren't being transferred across IPC.
3791
3792         Rubber-stamped by Carlos Garcia Campos.
3793
3794         * Scripts/webkit/messages.py:
3795
3796 2018-03-08  Tim Horton  <timothy_horton@apple.com>
3797
3798         Stop linking ApplicationServices directly
3799         https://bugs.webkit.org/show_bug.cgi?id=182867
3800         <rdar://problem/38252142>
3801
3802         Reviewed by Alex Christensen.
3803
3804         The frameworks that we use that live inside ApplicationServices
3805         have mostly moved out, so import them directly.
3806
3807         * Configurations/WebKit.xcconfig:
3808
3809 2018-03-08  Wenson Hsieh  <wenson_hsieh@apple.com>
3810
3811         [Extra zoom mode] Specify password mode as needed when inputting text
3812         https://bugs.webkit.org/show_bug.cgi?id=183428
3813         <rdar://problem/37609386>
3814
3815         Reviewed by Tim Horton.
3816
3817         If the focused element is a password field, or the input delegate has forced secure text entry, set a flag on
3818         the text input view controller to opt in to password text input mode.
3819
3820         * UIProcess/ios/WKContentViewInteraction.mm:
3821         (-[WKContentView presentTextInputViewController:]):
3822
3823 2018-03-07  Tim Horton  <timothy_horton@apple.com>
3824
3825         Sort and separate FeatureDefines.xcconfig
3826         https://bugs.webkit.org/show_bug.cgi?id=183427
3827
3828         Reviewed by Dan Bernstein.
3829
3830         * Configurations/FeatureDefines.xcconfig:
3831         Sort and split FeatureDefines into paragraphs
3832         (to make it easier to sort later).
3833
3834 2018-03-07  Carlos Garcia Campos  <cgarcia@igalia.com>
3835
3836         REGRESSION(r218089): [GTK] webkit_web_view_get_inspector() needs to be called, otherwise inspector does not close
3837         https://bugs.webkit.org/show_bug.cgi?id=181126
3838
3839         Reviewed by Carlos Alberto Lopez Perez.
3840
3841         Fix the condition to decide whether to detach the inspector view ourselves.
3842
3843         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3844         (WebKit::WebInspectorProxy::platformDetach): Remove the inspector view from its parent if we don't have a client
3845         or the client didn't detach it.
3846
3847 2018-03-07  Carlos Garcia Campos  <cgarcia@igalia.com>
3848
3849         [GTK][WPE] Leak checker is not working in WebKitGLib web process tests
3850         https://bugs.webkit.org/show_bug.cgi?id=183404
3851
3852         Reviewed by Michael Catanzaro.
3853
3854         Add private helper for testing to do a garbage collection when the page is closing.
3855
3856         * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp:
3857         (webkitWebExtensionSetGarbageCollectOnPageDestroy):
3858         * WebProcess/InjectedBundle/API/glib/WebKitWebExtensionPrivate.h:
3859         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.h: Fix annotation of
3860         webkit_dom_client_rect_list_item(), it should be transfer full.
3861
3862 2018-03-07  Youenn Fablet  <youenn@apple.com>
3863
3864         Match unsupported plugins based on domains and not origin
3865         https://bugs.webkit.org/show_bug.cgi?id=183384
3866
3867         Reviewed by Chris Dumez.
3868
3869         Moved from a HashMap of plugins to a Vector of plugins since we cannot match exactly based on the origin.
3870
3871         * Scripts/webkit/messages.py:
3872         * UIProcess/API/C/WKContext.cpp:
3873         (WKContextAddSupportedPlugin):
3874         * UIProcess/API/Cocoa/WKProcessPool.mm:
3875         (-[WKProcessPool _addSupportedPlugin:named:withMimeTypes:withExtensions:]):
3876         * UIProcess/Plugins/PluginInfoStore.cpp:
3877         (WebKit::PluginInfoStore::isSupportedPlugin):
3878         (WebKit::PluginInfoStore::supportedPluginNames):
3879         (WebKit::PluginInfoStore::addSupportedPlugin):
3880         * UIProcess/Plugins/PluginInfoStore.h:
3881         * UIProcess/WebProcessPool.cpp:
3882         (WebKit::WebProcessPool::addSupportedPlugin):
3883         * UIProcess/WebProcessPool.h:
3884         * UIProcess/WebProcessProxy.cpp:
3885         (WebKit::WebProcessProxy::getPlugins):
3886         * UIProcess/WebProcessProxy.h:
3887         * UIProcess/WebProcessProxy.messages.in:
3888         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
3889         (WebKit::WebPluginInfoProvider::getPluginInfo):
3890         (WebKit::WebPluginInfoProvider::getWebVisiblePluginInfo):
3891         * WebProcess/Plugins/WebPluginInfoProvider.h:
3892
3893 2018-03-07  Brent Fulgham  <bfulgham@apple.com>
3894
3895         REGRESSION (r229093): Media playback on Facebook and Hulu require mDNSResponder access
3896         https://bugs.webkit.org/show_bug.cgi?id=183421
3897         <rdar://problem/38191574>
3898
3899         Reviewed by Dean Jackson.
3900
3901         CoreMedia fails to properly play back media on Facebook and Hulu if access to the
3902         mDNSResponder is blocked by the sandbox. This Bug unblocks that access while we
3903         investigate the underlying issue.
3904
3905         * WebProcess/com.apple.WebProcess.sb.in:
3906
3907 2018-03-07  Dean Jackson  <dino@apple.com>
3908
3909         Try to fix build for watchOS and tvOS.
3910
3911         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
3912         * UIProcess/SystemPreviewController.cpp:
3913
3914 2018-03-07  Dean Jackson  <dino@apple.com>
3915
3916         Add SystemPreviewController for showing system-level views of special file types
3917         https://bugs.webkit.org/show_bug.cgi?id=183413
3918         <rdar://problem/37800834>
3919
3920         Reviewed by Tim Horton.
3921
3922         Add a new controller class that hangs off WebPageProxy, with the goal
3923         of providing system-level viewing of some some file types. Specifically
3924         those that can't be shown by WebKit.
3925
3926         This is the initial implementation which is quite simple. The controller
3927         can be queried about whether it supports a MIME type, then it can be
3928         asked to show a URL.
3929
3930         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Added.
3931         (-[_WKPreviewControllerDataSource initWithURL:]):
3932         (-[_WKPreviewControllerDataSource numberOfPreviewItemsInPreviewController:]):
3933         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
3934         (WebKit::SystemPreviewController::canPreview const):
3935         (WebKit::SystemPreviewController::showPreview):
3936         * UIProcess/SystemPreviewController.cpp: Added.
3937         (WebKit::SystemPreviewController::SystemPreviewController):
3938         (WebKit::SystemPreviewController::canPreview const):
3939         (WebKit::SystemPreviewController::showPreview):
3940         * UIProcess/SystemPreviewController.h: Added.
3941         * UIProcess/WebPageProxy.cpp:
3942         (WebKit::m_configurationPreferenceValues):
3943         (WebKit::WebPageProxy::reattachToWebProcess):
3944         (WebKit::WebPageProxy::resetState):
3945         * UIProcess/WebPageProxy.h:
3946         (WebKit::WebPageProxy::systemPreviewController):
3947         * WebKit.xcodeproj/project.pbxproj:
3948
3949 2018-03-07  Alejandro G. Castro  <alex@igalia.com>
3950
3951         Make NetworkRTCResolver port agnostic
3952         https://bugs.webkit.org/show_bug.cgi?id=178855
3953
3954         Reviewed by Youenn Fablet.
3955
3956         Create a specific Cocoa class to isolate the generic code in the base class, make the base implementation port
3957         agnostic and dependent on DNS API in the platform directory which encapsulates the platform specific details.
3958
3959         * NetworkProcess/webrtc/NetworkRTCProvider.cpp: Create an alias class name defined per platform to instantiate the resolver.
3960         (WebKit::NetworkRTCProvider::createResolver): Used the alias class name and receive a new IPAddress class that is not
3961         dependent on rtc libwebrtc library.
3962         * NetworkProcess/webrtc/NetworkRTCResolver.cpp: Remove the platform specific code. Use the DNS API to implement the
3963         platform specific code in the default start and stop methods. Add the identifier of the resolve operation to the class.
3964         (WebKit::NetworkRTCResolver::NetworkRTCResolver): Add the identifier in the initialization.
3965         (WebKit::NetworkRTCResolver::~NetworkRTCResolver): Remove the platform specific code.
3966         (WebKit::NetworkRTCResolver::completed): Ditto.
3967         (WebKit::NetworkRTCResolver::start): Add a new implementation using the DNS API.
3968         (WebKit::NetworkRTCResolver::stop): Ditto
3969         * NetworkProcess/webrtc/NetworkRTCResolver.h: Remove the platform specific code and use the DNSResolveQueue for a general
3970         solution to implement the platform specific code. Avoid using the IPAddress class that depends on libwertc classes to make
3971         it more general regarding DNS name resolution.
3972         (WebKit::NetworkRTCResolver::start): Make this class virtual.
3973         (WebKit::NetworkRTCResolver::stop): Ditto.
3974         * NetworkProcess/webrtc/NetworkRTCResolverCocoa.cpp: Copied Cocoa code from Source/WebKit/NetworkProcess/webrtc/NetworkRTCResolver.cpp.
3975         Now this class overrides the start and stop methods that use DNS, cocoa implementation should use the DNS methods in the future and
3976         remove this class, making sure all the platform specific class is in the platform directory.
3977         * NetworkProcess/webrtc/NetworkRTCResolverCocoa.h: Copied Cocoa code from Source/WebKit/NetworkProcess/webrtc/NetworkRTCResolver.h.
3978         * PlatformGTK.cmake: Add NetworkRTCResolver compilation for GTK.
3979         * WebKit.xcodeproj/project.pbxproj: Add the NetworkRTCResolverCocoa class to the compilation.
3980
3981 2018-03-06  Brent Fulgham  <bfulgham@apple.com>
3982
3983         NetworkDataTask should enable logging for automation clients
3984         https://bugs.webkit.org/show_bug.cgi?id=183378
3985         <rdar://problem/38189556>
3986
3987         Reviewed by Brian