Add logging to CacheStorageEngineConnection
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-02-05  Youenn Fablet  <youenn@apple.com>
2
3         Add logging to CacheStorageEngineConnection
4         https://bugs.webkit.org/show_bug.cgi?id=182456
5
6         Reviewed by Chris Dumez.
7
8         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
9         (WebKit::CacheStorageEngineConnection::open):
10         (WebKit::CacheStorageEngineConnection::remove):
11         (WebKit::CacheStorageEngineConnection::caches):
12         (WebKit::CacheStorageEngineConnection::retrieveRecords):
13         (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
14         (WebKit::CacheStorageEngineConnection::putRecords):
15         (WebKit::CacheStorageEngineConnection::reference):
16         (WebKit::CacheStorageEngineConnection::dereference):
17         * Platform/Logging.h:
18
19 2018-02-05  Daniel Bates  <dabates@apple.com>
20
21         REGRESSION (r222795): Nike app "Refused to set unsafe header" when adding and viewing cart
22         https://bugs.webkit.org/show_bug.cgi?id=182491
23         <rdar://problem/36533447>
24
25         Reviewed by Brent Fulgham.
26
27         Exempt Nike from the XHR header restrictions in r222795.
28
29         Following r222795 only Dashboard widgets are allowed to set arbitrary XHR headers.
30         However Nike also depends on such functionality.
31
32         * UIProcess/API/Cocoa/WKWebView.mm:
33         (shouldAllowSettingAnyXHRHeaderFromFileURLs):
34
35 2018-02-02  Brent Fulgham  <bfulgham@apple.com>
36
37         Improve NetworkResourceLoader logging so it can be used for 'setCookiesFromDOM'
38         https://bugs.webkit.org/show_bug.cgi?id=182455
39         <rdar://problem/36626601>
40
41         Reviewed by Chris Dumez.
42
43         Refactor "logCookieInformation" so that it can be used for resource loads and DOM cookie
44         manipulation. Place the generally useful logic in a static method that can be invoked
45         from other places in the NetworkProcess.
46
47         Call the new refactored method from NetworkConnectionToWebProcess::setCookiesFromDOM so
48         we can perform logging there as well.
49
50         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
51         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM): Call the new logging method
52         (when enabled).
53         * NetworkProcess/NetworkResourceLoader.cpp:
54         (WebKit::NetworkResourceLoader::shouldLogCookieInformation): Changed to static method.
55         (WebKit::escapeForJSON): Made a static function so it could be shared between multiple
56         methods.
57         (WebKit::NetworkResourceLoader::logCookieInformation const): Refactor into two methods.
58         (WebKit::NetworkResourceLoader::logCookieInformation): Ditto.
59         (WebKit::NetworkResourceLoader::shouldLogCookieInformation const): Deleted.
60         * NetworkProcess/NetworkResourceLoader.h:
61         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
62         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Switch to user-enabled release logging
63         to track partitioning and blocking behavior.
64
65 2018-02-05  John Wilander  <wilander@apple.com>
66
67         Storage Access API: Add testRunner.getAllStorageAccessEntries() to make testing easier and more explicit
68         https://bugs.webkit.org/show_bug.cgi?id=181601
69         <rdar://problem/36475837>
70
71         Reviewed by Alex Christensen.
72
73         http/tests/storageAccess/request-and-grant-access-then-detach-should-not-have-access.html
74         was found to be flaky. With the testRunner.hasStorageAccessEntry() getter
75         it's possible to check access even if a frame doesn't respond timely to
76         postMessage after detach and attach.
77
78         * NetworkProcess/NetworkProcess.cpp:
79         (WebKit::NetworkProcess::getAllStorageAccessEntries):
80         * NetworkProcess/NetworkProcess.h:
81         * NetworkProcess/NetworkProcess.messages.in:
82         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
83         (-[WKWebsiteDataStore _getAllStorageAccessEntries:]):
84         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
85         * UIProcess/Network/NetworkProcessProxy.cpp:
86         (WebKit::NetworkProcessProxy::getAllStorageAccessEntries):
87         (WebKit::NetworkProcessProxy::allStorageAccessEntriesResult):
88         * UIProcess/Network/NetworkProcessProxy.h:
89         * UIProcess/Network/NetworkProcessProxy.messages.in:
90         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
91         (WebKit::WebsiteDataStore::getAllStorageAccessEntries):
92         * UIProcess/WebsiteData/WebsiteDataStore.h:
93
94 2018-02-05  Daniel Bates  <dabates@apple.com>
95
96         Disallow evaluating JavaScript from NPP_Destroy() in WebKit
97         https://bugs.webkit.org/show_bug.cgi?id=181889
98         <rdar://problem/36674701>
99
100         Reviewed by Brent Fulgham.
101
102         Make the behavior of WebKit match the behavior of WebKitLegacy on Mac.
103
104         * Shared/Plugins/NPObjectMessageReceiver.cpp:
105         (WebKit::NPObjectMessageReceiver::hasMethod):
106         (WebKit::NPObjectMessageReceiver::invoke):
107         (WebKit::NPObjectMessageReceiver::invokeDefault):
108         (WebKit::NPObjectMessageReceiver::hasProperty):
109         (WebKit::NPObjectMessageReceiver::getProperty):
110         (WebKit::NPObjectMessageReceiver::setProperty):
111         (WebKit::NPObjectMessageReceiver::removeProperty):
112         (WebKit::NPObjectMessageReceiver::enumerate):
113         (WebKit::NPObjectMessageReceiver::construct):
114         Bail out if the plugin is executing NPP_Destroy().
115
116         * WebProcess/Plugins/Plugin.cpp:
117         (WebKit::Plugin::destroyPlugin):
118         * WebProcess/Plugins/Plugin.h:
119         (WebKit::Plugin::isBeingDestroyed const):
120         Move bookkeeping of whether the plugin is being destroyed from PluginView
121         to here. This makes it straightforward for NPObjectMessageReceiver to query
122         this information.
123
124         * WebProcess/Plugins/PluginView.cpp:
125         (WebKit::PluginView::~PluginView):
126         (WebKit::PluginView::destroyPluginAndReset):
127         (WebKit::PluginView::recreateAndInitialize):
128         (WebKit::PluginView::protectPluginFromDestruction):
129         (WebKit::PluginView::unprotectPluginFromDestruction):
130         Move bookkeeping of whether the plugin is being destroyed from here
131         to Plugin.
132
133         * WebProcess/Plugins/PluginView.h:
134         (WebKit::PluginView::isBeingDestroyed const): Turn around and ask the plugin if it
135         is being destroyed, if we have one.
136
137 2018-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>
138
139         WebDriver: addCookie command should prepend a dot to domain if missing
140         https://bugs.webkit.org/show_bug.cgi?id=182328
141         <rdar://problem/37116398>
142
143         Reviewed by Michael Catanzaro.
144
145         RFC 2965: If an explicitly specified value does not start with a dot, the user agent supplies a leading dot.
146
147         Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie
148
149         * UIProcess/Automation/WebAutomationSession.cpp:
150         (WebKit::WebAutomationSession::addSingleCookie):
151
152 2018-02-03  Tim Horton  <timothy_horton@apple.com>
153
154         UI process sometimes crashes under -[WKContentView _lookupForWebView:]
155         https://bugs.webkit.org/show_bug.cgi?id=182460
156         <rdar://problem/33260602>
157
158         Reviewed by Wenson Hsieh.
159
160         * UIProcess/ios/WKContentViewInteraction.mm:
161         (-[WKContentView _lookupForWebView:]):
162         If you have a range selection, but no rects for the selection, retrieving
163         the 0th element of selectionRects will crash the UI process. To fix, in
164         this case, use the rect for the starting caret instead.
165
166         It doesn't seem like the presentationRect is actually currently used for
167         the Lookup service, so the only impact is that we shouldn't crash anymore.
168
169 2018-02-02  Michael Catanzaro  <mcatanzaro@igalia.com>
170
171         Remove remaining dead !USE(NETWORK_SESSION) code
172         https://bugs.webkit.org/show_bug.cgi?id=182451
173
174         Reviewed by Alex Christensen.
175
176         DownloadCurl.cpp and AuthenticationManagerSoup.cpp have been dead code since NETWORK_SESSION
177         became mandatory.
178
179         * NetworkProcess/Downloads/curl/DownloadCurl.cpp: Removed.
180         * PlatformGTK.cmake:
181         * PlatformWPE.cmake:
182         * PlatformWin.cmake:
183         * Shared/Authentication/soup/AuthenticationManagerSoup.cpp: Removed.
184
185 2018-02-02  Youenn Fablet  <youenn@apple.com>
186
187         CacheStorage should check for origin file presence when computing the origin of a folder
188         https://bugs.webkit.org/show_bug.cgi?id=182454
189
190         Reviewed by Chris Dumez.
191
192         In case caches is opened for an origin but no cache is added, we do not have a caches name file but we do have an origin filename.
193         We should be checking the origin filename anyway since we will be reading it afterwards.
194
195         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
196         (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory):
197
198 2018-02-02  Youenn Fablet  <youenn@apple.com>
199
200         Configure serviceWorkerRegistrationDirectory on the web site data store and move it to a Caches subfolder as a default
201         https://bugs.webkit.org/show_bug.cgi?id=182403
202         <rdar://problem/36673358>
203
204         Reviewed by Alex Christensen.
205
206         * UIProcess/WebProcessPool.cpp:
207         (WebKit::legacyWebsiteDataStoreConfiguration): Setting serviceWorkerRegistrationDirectory for legacy stores.
208
209 2018-02-02  Youenn Fablet  <youenn@apple.com>
210
211         Clearing all service worker registrations should wait for importing service worker registration to finish
212         https://bugs.webkit.org/show_bug.cgi?id=182407
213
214         Reviewed by Chris Dumez.
215
216         Updating API to take a completion handler.
217
218         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
219         (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):
220         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
221
222 2018-02-02  Fujii Hironori  <Hironori.Fujii@sony.com>
223
224         [Win] MSVC doesn't seem to like "friend class NeverDestroyed<Foo>"
225         https://bugs.webkit.org/show_bug.cgi?id=182081
226
227         Reviewed by Yusuke Suzuki.
228
229         The template friend class, which belongs to a different namespace,
230         can't access private member if its friend declaration is specified
231         without the namespace and with class keyword.
232
233         Replaced "friend class NeverDestroyed<Foo>" with "friend NeverDestroyed<Foo>".
234
235         * NetworkProcess/NetworkProcess.h:
236         * NetworkProcess/capture/NetworkCaptureManager.h:
237         * PluginProcess/PluginProcess.h:
238         * Shared/CallbackID.h:
239         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
240         * StorageProcess/StorageProcess.h:
241         * UIProcess/Plugins/PluginProcessManager.h:
242         * UIProcess/Plugins/gtk/PluginInfoCache.h:
243         * UIProcess/WebPageProxy.cpp:
244         * UIProcess/WebPasteboardProxy.h:
245         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
246         * UIProcess/gtk/HardwareAccelerationManager.h:
247         * UIProcess/gtk/WaylandCompositor.h:
248         * UIProcess/linux/MemoryPressureMonitor.h:
249         * UIProcess/mac/ServicesController.h:
250         * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.h:
251         * WebProcess/Plugins/WebPluginInfoProvider.h:
252         * WebProcess/WebCoreSupport/WebPasteboardOverrides.h:
253         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
254
255 2018-02-02  Youenn Fablet  <youenn@apple.com>
256
257         Configure serviceWorkerRegistrationDirectory on the web site data store and move it to a Caches subfolder as a default
258         https://bugs.webkit.org/show_bug.cgi?id=182403
259
260         Reviewed by Alex Christensen.
261
262         WebsiteDataStore is the place to set configuration information such as service worker registration path.
263         This patch updates WebKit code accordingly.
264         By default, the service worker registration path is in a Caches subfolder, similarly to cache API path.
265
266         * UIProcess/API/APIProcessPoolConfiguration.cpp:
267         (API::ProcessPoolConfiguration::createWithLegacyOptions):
268         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
269         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
270         (API::ProcessPoolConfiguration::copy):
271         * UIProcess/API/APIProcessPoolConfiguration.h:
272         * UIProcess/API/C/WKContextConfigurationRef.cpp:
273         (WKContextConfigurationCopyServiceWorkerDatabaseDirectory): Deleted.
274         (WKContextConfigurationSetServiceWorkerDatabaseDirectory): Deleted.
275         * UIProcess/API/C/WKContextConfigurationRef.h:
276         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
277         (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
278         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
279         (-[WKWebsiteDataStore _serviceWorkerRegistrationDirectory]):
280         (-[WKWebsiteDataStore _setServiceWorkerRegistrationDirectory:]):
281         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
282         * UIProcess/WebProcessPool.cpp:
283         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
284         (WebKit::WebProcessPool::initializeNewWebProcess):
285         * UIProcess/WebsiteData/WebsiteDataStore.h:
286         (WebKit::WebsiteDataStore::serviceWorkerRegistrationDirectory const):
287         (WebKit::WebsiteDataStore::setServiceWorkerRegistrationDirectory):
288         * UIProcess/gtk/WebProcessPoolGtk.cpp:
289         * UIProcess/gtk/WebProcessPoolWPE.cpp:
290
291 2018-02-02  Wenson Hsieh  <wenson_hsieh@apple.com>
292
293         [Extra Zoom Mode] Implement support for indirect mainframe scrolling
294         https://bugs.webkit.org/show_bug.cgi?id=182421
295         <rdar://problem/35142694>
296
297         Reviewed by Tim Horton.
298
299         Makes a few small adjustments to WKScrollView to improve mainframe scrolling, and disable the pinch gesture for
300         zooming. See below for more details.
301
302         * UIProcess/API/Cocoa/WKWebView.mm:
303
304         Remove a now-unneeded WebKitAdditions import.
305
306         * UIProcess/ios/WKScrollView.mm:
307         (-[WKScrollView initWithFrame:]):
308
309         Add imports for -Before and -After versions of WKScrollViewAdditions.
310
311         (-[WKScrollView addGestureRecognizer:]):
312
313         Override -addGestureRecognizer here to prevent touches on the pinch gesture recognizer from being recognized.
314         I chose this approach instead of just disabling the gesture in -initWithFrame: because (1) the pinch gesture
315         recognizer is lazily created when setting minimum or maximum zoom scales, rather than immediately in
316         -initWithFrame:, and (2) even if we set the -enabled to NO, UIKit later resets it to YES in other codepaths.
317
318 2018-02-01  Tim Horton  <timothy_horton@apple.com>
319
320         WebKit fails to build (_startAssistingNode has conflicting parameters)
321         https://bugs.webkit.org/show_bug.cgi?id=182417
322         <rdar://problem/36965318>
323
324         Reviewed by Dan Bernstein.
325
326         * UIProcess/ios/WKContentViewInteraction.h:
327         Use Big BOOL like in the implementation.
328
329 2018-02-01  Brent Fulgham  <bfulgham@apple.com>
330
331         Improve NetworkResourceLogger to report blocked (versus non-partitioned) cookies
332         https://bugs.webkit.org/show_bug.cgi?id=182408
333         <rdar://problem/36918028>
334
335         Reviewed by Chris Dumez.
336
337         Update the logging method to report blocked origins, rather than logging them as non-partitioned
338         loads that have no cookies or other content.
339
340         * NetworkProcess/NetworkResourceLoader.cpp:
341         (WebKit::NetworkResourceLoader::logCookieInformation const):
342
343 2018-02-01  David Kilzer  <ddkilzer@apple.com>
344
345         REGRESSION (r222824): UI process crashes in WebKit::WebBackForwardList::backItem const
346         <https://webkit.org/b/182409>
347         <rdar://problem/35495094>
348
349         Reviewed by Alex Christensen.
350
351         * UIProcess/WebBackForwardList.cpp:
352         (WebKit::WebBackForwardList::goToItem): Fix typo so the for loop
353         actually checks each value in m_entries.
354
355 2018-02-01  Youenn Fablet  <youenn@apple.com>
356
357         Delay service worker process creation until actually needed by SWServer
358         https://bugs.webkit.org/show_bug.cgi?id=182301
359
360         Reviewed by Chris Dumez.
361
362         Do not create a service worker process at creation of the first SWServerConnection.
363         Wait for a WebProcess message that needs it:
364         - postMessage message
365         - fetchEvent message
366         - job scheduling.
367
368         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
369         (WebKit::WebSWServerConnection::startFetch):
370         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
371         (WebKit::WebSWServerConnection::scheduleJobInServer):
372         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
373         * StorageProcess/StorageToWebProcessConnection.cpp:
374         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
375
376 2018-02-01  Wenson Hsieh  <wenson_hsieh@apple.com>
377
378         [Extra zoom mode] Implement basic support for interacting with text form controls
379         https://bugs.webkit.org/show_bug.cgi?id=182401
380         <rdar://problem/35143035>
381
382         Reviewed by Tim Horton.
383
384         Add UI support for interacting with and editing text form controls when extra zoom mode is enabled. See below
385         for more details.
386
387         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
388         (-[WKWebViewConfiguration init]):
389         (-[WKWebViewConfiguration encodeWithCoder:]):
390         (-[WKWebViewConfiguration initWithCoder:]):
391         (-[WKWebViewConfiguration copyWithZone:]):
392         (-[WKWebViewConfiguration _textInteractionGesturesEnabled]):
393         (-[WKWebViewConfiguration _setTextInteractionGesturesEnabled:]):
394         (-[WKWebViewConfiguration _longPressActionsEnabled]):
395         (-[WKWebViewConfiguration _setLongPressActionsEnabled:]):
396
397         Introduce two new web view configuration flags: `textInteractionGesturesEnabled` and `longPressActionsEnabled`.
398         The former determines whether text interaction gestures (i.e. text selection, moving the caret, showing UI for
399         IME, etc.) are enabled. The latter determines whether or not long press actions (i.e. touch callout, share
400         sheet, etc.) are enabled. These are disabled by default only in extra zoom mode.
401
402         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
403         * UIProcess/WebPageProxy.cpp:
404         (WebKit::WebPageProxy::setTextAsync):
405
406         Add a way to set the text value of a currently edited text form control. This will either set the text value of
407         an input, a. la. autofill, or overwrite the contents of a contenteditable area by selecting everything and
408         inserting the given text.
409
410         * UIProcess/WebPageProxy.h:
411         (WebKit::WebPageProxy::focusNextAssistedNode):
412
413         Add a default argument for the completion callback.
414
415         * UIProcess/ios/WKContentViewInteraction.h:
416         * UIProcess/ios/WKContentViewInteraction.mm:
417         (-[WKContentView setupInteraction]):
418         (-[WKContentView _displayFormNodeInputView]):
419         (-[WKContentView _actionForLongPressFromPositionInformation:]):
420         (-[WKContentView hasSelectablePositionAtPoint:]):
421         (-[WKContentView pointIsNearMarkedText:]):
422         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
423         (-[WKContentView insertionPointColor]):
424
425         Respect the web view configuration flags above by bailing early from text interaction and long press action
426         sheet methods.
427
428         (-[WKContentView _startAssistingKeyboard]):
429         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
430
431         Add a flag indicating whether we are in the process of changing focus from one node to another. We use this to
432         decide whether or not we want to present the text input view controller right away, or just reload the focused
433         form control overlay. When we stop "assisting" a node, we also keep the focused form control overlay up if we're
434         only changing focus to another form control.
435
436         (-[WKContentView _stopAssistingNode]):
437         (-[WKContentView presentFocusedFormControlViewController:]):
438         (-[WKContentView dismissFocusedFormControlViewController:]):
439         (-[WKContentView shouldPresentTextInputViewController:]):
440         (-[WKContentView presentTextInputViewController:]):
441         (-[WKContentView dismissTextInputViewController:]):
442
443         Introduce helpers for managing presentation of the focused form control overlay and text input view controller.
444         All -present and -dismiss helpers here are idempotent. These view controllers are presented from the content
445         view's view controller for fullscreen presentation.
446
447         (-[WKContentView textInputController:didCommitText:]):
448         (-[WKContentView textInputController:didRequestDismissalWithAction:]):
449         (-[WKContentView focusedFormControlControllerDidSubmit:]):
450         (-[WKContentView focusedFormControlControllerDidCancel:]):
451         (-[WKContentView focusedFormControlControllerDidBeginEditing:]):
452         (-[WKContentView highlightedRectForFocusedFormControlController:inCoordinateSpace:]):
453         (-[WKContentView actionNameForFocusedFormControlController:]):
454         (-[WKContentView focusedFormControlControllerDidRequestNextNode:]):
455         (-[WKContentView focusedFormControlControllerDidRequestPreviousNode:]):
456         (-[WKContentView hasNextNodeForFocusedFormControlController:]):
457         (-[WKContentView hasPreviousNodeForFocusedFormControlController:]):
458
459         Implement delegate methods for the focused form control and text input view controllers. This mainly involves
460         straightforward plumbing of pieces of AssistedNodeInformation on the content view.
461
462         (-[WKContentView pointIsInAssistedNode:]): Deleted.
463
464         Remove a method that was still implemented only for binary compatibility with iOS 10.
465
466         * WebProcess/WebPage/WebPage.cpp:
467         (WebKit::WebPage::setTextAsync):
468         * WebProcess/WebPage/WebPage.h:
469         * WebProcess/WebPage/WebPage.messages.in:
470
471 2018-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
472
473         [GTK] Shift + mouse scroll should scroll horizontally
474         https://bugs.webkit.org/show_bug.cgi?id=181629
475
476         Reviewed by Michael Catanzaro.
477
478         Swap scroll direction when Shift is pressed for consistency with GtkScrolledWindow.
479
480         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
481         (webkitWebViewBaseScrollEvent):
482
483 2018-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
484
485         REGRESSION(r227893): fast/events/touch/touch-stale-node-crash.html and other tests crash
486         https://bugs.webkit.org/show_bug.cgi?id=182350
487
488         Reviewed by Carlos Alberto Lopez Perez.
489
490         Ensure events synthesized from touch gestures have a valid window, screen and device.
491
492         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
493         * UIProcess/gtk/GestureController.h: Add virtual destructor to GestureControllerclient.
494
495 2018-01-31  Simon Fraser  <simon.fraser@apple.com>
496
497         Use different debug red colors for different contexts
498         https://bugs.webkit.org/show_bug.cgi?id=182362
499
500         Reviewed by Tim Horton.
501         
502         Pure red is used elsehwere in the system as a debug color indicator, so use different
503         shades of red for WebKit in the two places where we paint a reddish wash in debug builds,
504         so they are identifiable.
505
506         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
507         (WebKit::RemoteLayerBackingStore::drawInContext):
508
509 2018-01-31  Don Olmstead  <don.olmstead@sony.com>
510
511         [CMake] Make JavaScriptCore headers copies
512         https://bugs.webkit.org/show_bug.cgi?id=182303
513
514         Reviewed by Alex Christensen.
515
516         * CMakeLists.txt:
517         * Scripts/generate-forwarding-headers.pl:
518
519 2018-01-31  Alex Christensen  <achristensen@webkit.org>
520
521         Unreviewed, rolling out r227942.
522
523         r227875 should not have been rolled out.
524
525         Reverted changeset:
526
527         "Unreviewed, rolling out r227875."
528         https://bugs.webkit.org/show_bug.cgi?id=182357
529         https://trac.webkit.org/changeset/227942
530
531 2018-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
532
533         Unreviewed, rolling out r227875.
534         https://bugs.webkit.org/show_bug.cgi?id=182357
535
536         Missing cross-platform TestController implementation
537
538         Reverted changeset:
539
540         "Add callbacks to testRunner.statisticsSetShouldPartitionCookiesForHost() and testRunner.statisticsUpdateCookiePartitioning()"
541         https://bugs.webkit.org/show_bug.cgi?id=181958
542         https://trac.webkit.org/changeset/227875
543
544         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
545         (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
546         (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
547         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
548         (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]):
549         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
550         (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning:]): Deleted.
551         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:completionHandler:]): Deleted.
552         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
553         * UIProcess/WebResourceLoadStatisticsStore.cpp:
554         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
555         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
556         (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
557         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
558         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
559         (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
560         (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
561         (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
562         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
563         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
564         (WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains):
565         * UIProcess/WebResourceLoadStatisticsStore.h:
566
567 2018-01-31  Brent Fulgham  <bfulgham@apple.com>
568
569         Follow-up to r227939.
570         https://bugs.webkit.org/show_bug.cgi?id=182354
571         <rdar://problem/37046844>
572
573         Make sure the correct sandbox is used on iOS as well.
574
575         * StorageProcess/ios/StorageProcessIOS.mm:
576         (WebKit::StorageProcess::initializeSandbox):
577
578 2018-01-31  Brent Fulgham  <bfulgham@apple.com>
579
580         REGRESSION(r220094): com.apple.WebKit.Storage lost its sandbox
581         https://bugs.webkit.org/show_bug.cgi?id=182354
582         <rdar://problem/37046844>
583
584         Reviewed by Ryosuke Niwa.
585
586         The Database process was renamed to Storage, but it's sandbox was not updated.
587
588         * Configurations/WebKit.xcconfig: Update for sandbox rename.
589         * DerivedSources.make: Ditto.
590         * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb: Removed.
591         * Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb: Copied from Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb.
592         * StorageProcess/mac/com.apple.WebKit.Databases.sb.in: Removed.
593         * StorageProcess/mac/com.apple.WebKit.Storage.sb.in: Copied from StorageProcess/mac/com.apple.WebKit.Databases.sb.in.
594         * WebKit.xcodeproj/project.pbxproj: Update for sandbox rename.
595
596 2018-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
597
598         REGRESSION(r227223): http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour.html, http/tests/resourceLoadStatistics/grandfathering.html timing out on GTK, WPE
599         https://bugs.webkit.org/show_bug.cgi?id=182222
600
601         Reviewed by Alex Christensen.
602
603         Add callbacks to notify when resource load statistics deletion is complete.
604
605         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
606         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
607         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
608         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
609
610 2018-01-31  Tim Horton  <timothy_horton@apple.com>
611
612         Occasional null deref under WebPageProxy::updateBackingStoreDiscardableState()
613         https://bugs.webkit.org/show_bug.cgi?id=182349
614         <rdar://problem/27822258>
615
616         Reviewed by Simon Fraser.
617
618         * UIProcess/WebPageProxy.cpp:
619         (WebKit::WebPageProxy::updateBackingStoreDiscardableState):
620         m_drawingArea can be null during process launch and relaunch.
621
622         Cocoa ports don't use the result of setBackingStoreIsDiscardable(),
623         but they do run this code to keep it up to date.
624
625 2018-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
626
627         [GTK] Move gir and typelib generation into ENABLE_INTROSPECTION conditional
628         https://bugs.webkit.org/show_bug.cgi?id=182308
629
630         Reviewed by Carlos Garcia Campos.
631
632         * PlatformGTK.cmake:
633
634 2018-01-31  Youenn Fablet  <youenn@apple.com>
635
636         Remove StorageToWebProcessConnection::removeSWServerConnection
637         https://bugs.webkit.org/show_bug.cgi?id=182305
638
639         Reviewed by Chris Dumez.
640
641         * StorageProcess/StorageToWebProcessConnection.cpp:
642         (WebKit::StorageToWebProcessConnection::removeSWServerConnection): Deleted.
643         * StorageProcess/StorageToWebProcessConnection.h:
644         * StorageProcess/StorageToWebProcessConnection.messages.in:
645
646 2018-01-31  Carlos Garcia Campos  <cgarcia@igalia.com>
647
648         REGRESSION(r227544): [GTK] contextMenuEvent is NULL on CONTEXT_MENU call
649         https://bugs.webkit.org/show_bug.cgi?id=182224
650
651         Reviewed by Michael Catanzaro.
652
653         Move the gestures handling to WebKitWebViewBase. This patch adds GestureControllerClient class, created and
654         implemented by WebKitWebViewBase and used by GestureController instead of the WebPageProxy. This way we ensure
655         events are handled consistently.
656
657         * UIProcess/API/gtk/PageClientImpl.cpp:
658         (WebKit::PageClientImpl::doneWithTouchEvent): Cast the GdkEvent since GestureController no longer works wirth
659         const GdkEvents.
660         (WebKit::PageClientImpl::zoom): Use webkit_web_view_set_zoom_level() in case of WebKitWebView or
661         WebPageProxy::setPageZoomFactor() otherwise.
662         * UIProcess/API/gtk/PageClientImpl.h:
663         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
664         (ClickCounter::currentClickCountForGdkButtonEvent): Receive a GdkEvent to avoid casts.
665         (webkitWebViewBaseHandleMouseEvent): Helper function to handle mouse events.
666         (webkitWebViewBaseButtonPressEvent): Use webkitWebViewBaseHandleMouseEvent.
667         (webkitWebViewBaseButtonReleaseEvent): Ditto.
668         (webkitWebViewBaseHandleWheelEvent): Helper function to handle wheel events.
669         (webkitWebViewBaseScrollEvent): Use webkitWebViewBaseHandleWheelEvent.
670         (webkitWebViewBaseMotionNotifyEvent): Use webkitWebViewBaseHandleMouseEvent.
671         (webkitWebViewBaseCrossingNotifyEvent): Ditto.
672         (webkitWebViewBaseGestureController): Pass the widget and client to GestureController.
673         * UIProcess/gtk/GestureController.cpp:
674         (WebKit::GestureController::GestureController): Receives a widget and client now.
675         (WebKit::GestureController::handleEvent): Remove the const.
676         (WebKit::GestureController::Gesture::Gesture): Initialize client.
677         (WebKit::GestureController::Gesture::handleEvent): Remove the const.
678         (WebKit::GestureController::DragGesture::startDrag): Use the client instead of WebPageProxy.
679         (WebKit::GestureController::DragGesture::handleDrag): Ditto.
680         (WebKit::GestureController::DragGesture::handleTap): Ditto.
681         (WebKit::GestureController::DragGesture::begin): Ignore the const returned by gtk_gesture_get_last_event().
682         (WebKit::GestureController::DragGesture::update): Ditto.
683         (WebKit::GestureController::DragGesture::end): Ditto.
684         (WebKit::GestureController::DragGesture::DragGesture): Receives a widget and client now.
685         (WebKit::GestureController::SwipeGesture::startMomentumScroll): Use the client instead of WebPageProxy.
686         (WebKit::GestureController::SwipeGesture::swipe): Ignore the const returned by gtk_gesture_get_last_event().
687         (WebKit::GestureController::SwipeGesture::SwipeGesture): Receives a widget and client now.
688         (WebKit::GestureController::ZoomGesture::begin): Start the zoom.
689         (WebKit::GestureController::ZoomGesture::startZoom): Use the client instead of WebPageProxy.
690         (WebKit::GestureController::ZoomGesture::handleZoom): Ditto.
691         (WebKit::GestureController::ZoomGesture::ZoomGesture): Receives a widget and client now.
692         (WebKit::GestureController::LongPressGesture::longPressed): Use the client instead of WebKitWebView.
693         (WebKit::GestureController::LongPressGesture::pressed): Ignore the const returned by gtk_gesture_get_last_event().
694         (WebKit::GestureController::LongPressGesture::LongPressGesture): Receives a widget and client now.
695         (WebKit::GestureController::Gesture::simulateMouseClick): Deleted.
696         (WebKit::createScrollEvent): Deleted.
697         * UIProcess/gtk/GestureController.h:
698
699 2018-01-31  Carlos Garcia Campos  <cgarcia@igalia.com>
700
701         Web Automation: cookies returned by automation should have expiry time in seconds
702         https://bugs.webkit.org/show_bug.cgi?id=182293
703
704         Reviewed by Brian Burg.
705
706         When creating a WebCore::Cookie from a WebDriver object we convert the given expiry time to milliseconds, but
707         when creating a WebDriver object from a WebCore::Cookie we are keeping the milliseconds. We should convert to
708         seconds for consistency, so that the WebDriver always handles seconds.
709
710         Fixes: imported/w3c/webdriver/tests/cookies/get_named_cookie.py::test_get_named_cookie
711
712         * UIProcess/Automation/WebAutomationSession.cpp:
713         (WebKit::buildObjectForCookie): Convert expiry to seconds.
714
715 2018-01-31  Ryosuke Niwa  <rniwa@webkit.org>
716
717         Unreviewed iOS build fix.
718
719         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
720
721 2018-01-30  John Wilander  <wilander@apple.com>
722
723         Add callbacks to testRunner.statisticsSetShouldPartitionCookiesForHost() and testRunner.statisticsUpdateCookiePartitioning()
724         https://bugs.webkit.org/show_bug.cgi?id=181958
725         https://bugs.webkit.org/show_bug.cgi?id=182072
726         <rdar://problem/36801804>
727         <rdar://problem/36845795>
728
729         Reviewed by Brent Fulgham.
730
731         Because of the asynchronous nature of XPC and cookies,
732         we need callbacks in these TestRunner functions so that
733         the layout tests can wait for state changes to finish
734         before checking test conditions.
735
736         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
737         (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
738         (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
739         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
740         (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]):
741         (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning:]):
742         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
743         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:completionHandler:]):
744         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
745         * UIProcess/WebResourceLoadStatisticsStore.cpp:
746         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
747         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
748         (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
749         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
750         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
751         (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
752         (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
753         (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
754         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
755         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
756         (WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains):
757         * UIProcess/WebResourceLoadStatisticsStore.h:
758
759 2018-01-30  Ryosuke Niwa  <rniwa@webkit.org>
760
761         REGRESSION(r227550): Resource timing API is disabled on macOS
762         https://bugs.webkit.org/show_bug.cgi?id=182318
763
764         Reviewed by Chris Dumez.
765
766         Resource timing API should be enabled by default all versions of macOS we support now.
767
768         * Shared/WebPreferences.yaml:
769         * Shared/WebPreferencesDefaultValues.h:
770
771 2018-01-30  Tim Horton  <timothy_horton@apple.com>
772
773         WKWebView layout is sometimes wrong after rotation on iPhone X
774         https://bugs.webkit.org/show_bug.cgi?id=182304
775         <rdar://problem/34158671>
776
777         Reviewed by Simon Fraser.
778
779         * Platform/spi/ios/UIKitSPI.h:
780         * UIProcess/API/Cocoa/WKWebView.mm:
781         (-[WKWebView _computedContentInset]):
782         (-[WKWebView _scrollViewSystemContentInset]):
783         (activeMinimumLayoutSize):
784         It turns out that it is not always safe to look at the safe area insets of
785         children from inside layoutSubviews, even after the call to super.
786
787         Instead, make use of the fact that WKScrollView and WKWebView have identical
788         coordinate spaces, and map WKWebView's safe area insets into the WKScrollView.
789         It's safe to use the scroll view's affected-edges and contentScrollInset,
790         because those aren't updated at the same outside-of-layout time that
791         safe area insets are.
792
793         We could alternatively move all calls to activeMinimumLayoutSize outside
794         of layoutSubviews, but that seems like a larger and riskier change.
795
796         All attempts to write a test have failed; this depends heavily on use of
797         autolayout and the mechanism by which the system updates system-owned
798         safe area insets during device rotation.
799
800 2018-01-30  Don Olmstead  <don.olmstead@sony.com>
801
802         JSExports.h should be included as <JavaScriptCore/JSExportMacros.h>
803         https://bugs.webkit.org/show_bug.cgi?id=182312
804
805         Reviewed by Michael Catanzaro.
806
807         * config.h:
808
809 2018-01-30  Brent Fulgham  <bfulgham@apple.com>
810
811         Add telemetry to track storage access API adoption
812         https://bugs.webkit.org/show_bug.cgi?id=182197
813         <rdar://problem/35803309>
814
815         Reviewed by Chris Dumez.
816
817         Part 2: Add telemetry for the Storage Access API case
818
819         This change increments a counter when an origin is loaded in a first part context because
820         it was granted Storage Access API permissions.
821
822         * NetworkProcess/NetworkResourceLoader.cpp:
823         (WebKit::NetworkResourceLoader::logCookieInformation const): Add logging to indicate
824         loads that happened with the Storage Access API enabled.
825         * UIProcess/WebResourceLoadStatisticsStore.cpp:
826         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess): Increment counter for
827         loads using the new API.
828
829 2018-01-30  Megan Gardner  <megan_gardner@apple.com>
830
831         Make preserve and restore focus more likely to be symmetrical
832         https://bugs.webkit.org/show_bug.cgi?id=182264
833         <rdar://problem/36948473>
834         
835         Reviewed by Tim Horton.
836
837         Keep a stack of if we actually increment the focusState, so that
838         changes to the web content do not result in asymmetric decrements to the focus state. 
839         To work around problems associated with <rdar://problem/37000122>.
840
841         * UIProcess/ios/WKContentViewInteraction.h:
842         * UIProcess/ios/WKContentViewInteraction.mm:
843         (-[WKContentView _restoreFocusWithToken:]):
844         (-[WKContentView _preserveFocusWithToken:destructively:]):
845
846 2018-01-30  Brent Fulgham  <bfulgham@apple.com>
847
848         Add telemetry to track storage access API adoption
849         https://bugs.webkit.org/show_bug.cgi?id=182197
850         <rdar://problem/35803309>
851
852         Reviewed by Chris Dumez.
853         
854         This patch also handled aggregating the counts in the UIProcess, which has access to
855         the right data.
856
857         The original patch assumed the WebContent process kept track of user interaction. This is
858         only tracked in the UIProcess, so we can get rid of some of the logging code adding in
859         r227755.
860
861         * Shared/WebProcessCreationParameters.cpp:
862         (WebKit::WebProcessCreationParameters::encode const): Rollout of r227755 changes not
863         needed to track the statistics.
864         (WebKit::WebProcessCreationParameters::decode): Ditto.
865         * Shared/WebProcessCreationParameters.h:
866         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
867         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
868         * UIProcess/WebResourceLoadStatisticsStore.cpp:
869         (WebKit::WebResourceLoadStatisticsStore::wasAccessedAsFirstPartyDueToUserInteraction): Moved from
870         the WebContent process, which does not keep track of user interaction.
871         (WebKit::WebResourceLoadStatisticsStore::mergeStatistics): Aggregate counts while processing
872         the statistics.
873         * UIProcess/WebResourceLoadStatisticsStore.h:
874         * WebProcess/WebProcess.cpp:
875         (WebKit::WebProcess::initializeWebProcess):
876
877 2018-01-30  Chris Dumez  <cdumez@apple.com>
878
879         Make sure we never create a WebSWClientConnection with an invalid sessionID
880         https://bugs.webkit.org/show_bug.cgi?id=182276
881         <rdar://problem/36582633>
882
883         Reviewed by Alex Christensen.
884
885         Make sure we never create a WebSWClientConnection with an invalid sessionID as this
886         could corrupt our hash tables.
887
888         * StorageProcess/StorageProcess.cpp:
889         (WebKit::StorageProcess::swServerForSession):
890         * UIProcess/WebProcessPool.cpp:
891         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
892         * WebProcess/Storage/WebSWClientConnection.cpp:
893         (WebKit::WebSWClientConnection::WebSWClientConnection):
894         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
895         (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
896         (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
897         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
898         (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):
899
900 2018-01-30  Basuke Suzuki  <Basuke.Suzuki@sony.com>
901
902         [WinCairo] Fix forwarding header conflict of WebKit on WinCairo
903         https://bugs.webkit.org/show_bug.cgi?id=177202
904
905         Reviewed by Alex Christensen.
906
907         * PlatformWin.cmake:
908
909 2018-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
910
911         WebDriver: evaluateJavaScriptFunction should return null when return value is undefined
912         https://bugs.webkit.org/show_bug.cgi?id=180350
913
914         Reviewed by Carlos Alberto Lopez Perez.
915
916         undefined can't be converted to JSON string, in which case JSON.stringify() returns undefined and we handle that
917         case to return an empty string. We currently handle this case for execute script commands, but not in all other
918         cases where we use evaluateJavaScriptFunction. It would be simpler if evaluateJavaScriptFunction returned null,
919         because in that case we wouldn't need to handle it as a special case.
920
921         15.2 Executing Script
922         https://w3c.github.io/webdriver/webdriver-spec.html#dfn-json-clone
923
924         Fixes: imported/w3c/webdriver/tests/state/get_element_property.py::test_element_non_existent
925
926         * WebProcess/Automation/WebAutomationSessionProxy.js:
927         (let.AutomationSessionProxy.prototype._jsonStringify): Return "null" instead of "" when undefined is given.
928
929 2018-01-29  Ryosuke Niwa  <rniwa@webkit.org>
930
931         Release assert in updateLayout while waiting for sync reply to WebPageProxy::HasInsecureContent
932         https://bugs.webkit.org/show_bug.cgi?id=182273
933
934         Reviewed by Chris Dumez.
935
936         The assertion was caused by unrelated sync IPCs being processed while WebContent process is waiting for
937         the reply to WebPageProxy::HasInsecureContent. Since this IPC can be used while creating CachedFrame,
938         it's not safe to execute arbitrary code.
939
940         Fixed the bug by using DoNotProcessIncomingMessagesWhenWaitingForSyncReply added in r227566.
941
942         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
943         (WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame):
944
945 2018-01-29  Wenson Hsieh  <wenson_hsieh@apple.com>
946
947         Add a build step to copy resources from WebKitAdditions as bundle resources in WebKit
948         https://bugs.webkit.org/show_bug.cgi?id=182268
949         <rdar://problem/37003784>
950
951         Reviewed by Tim Horton and Dan Bernstein.
952
953         Adds a "Copy Additional Resources" phase when building WebKit. This phase copies resources from
954         usr/local/include/WebKitAdditions/WebKit/AdditionalResources in the build directory into the
955         unlocalized resources directory. If the AdditionalResources directory does not exist in the build
956         directory, we fall back to searching the SDK.
957
958         * WebKit.xcodeproj/project.pbxproj:
959
960 2018-01-29  Youenn Fablet  <youenn@apple.com>
961
962         ServiceWorkerClientFetch should not consider responses without Location headers as redirection responses
963         https://bugs.webkit.org/show_bug.cgi?id=182134
964
965         Reviewed by Chris Dumez.
966
967         As per fetch spec, a response with a redirection status code but no Location header should not be considered as a redirection.
968         This is also consistent with SubresourceLoader::didReceiveResponse.
969
970         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
971         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
972
973 2018-01-29  Youenn Fablet  <youenn@apple.com>
974
975         Cache API should make sure to resolve caches.open promises in the same order as called
976         https://bugs.webkit.org/show_bug.cgi?id=182193
977         <rdar://problem/36930363>
978
979         Reviewed by Chris Dumez.
980
981         Covered by added test.
982         Whenever opening/removing a cache requires writing to disk, wait to finish the task
983         until any disk writing task is done.
984         Applying this strategy when clearing data so that we also clear data that is pending to be written.
985         For removing cache, we now return whether a cache was actually deleted by returning zero as removed cache identifier.
986         WebCore uses that information to return true/false as promise resolution value.
987
988         * NetworkProcess/cache/CacheStorageEngine.cpp:
989         (WebKit::CacheStorage::Engine::retrieveCaches):
990         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
991         (WebKit::CacheStorage::Caches::clear):
992         (WebKit::CacheStorage::Caches::open):
993         (WebKit::CacheStorage::Caches::remove):
994         (WebKit::CacheStorage::Caches::writeCachesToDisk):
995         (WebKit::CacheStorage::Caches::cacheInfos):
996         (WebKit::CacheStorage::Caches::cacheInfos const): Deleted.
997         * NetworkProcess/cache/CacheStorageEngineCaches.h:
998         (WebKit::CacheStorage::Caches::createWeakPtr):
999
1000 2018-01-29  Alex Christensen  <achristensen@webkit.org>
1001
1002         Clean up API after bugs 178240 and 176474
1003         https://bugs.webkit.org/show_bug.cgi?id=182259
1004
1005         Reviewed by Dan Bernstein.
1006
1007         NS_OPTIONS should be NSUInteger, not NSInteger.  This is how all other NS_OPTIONS in WebKit are,
1008         and it's necessary if we get really big numbers as options.  Changing them won't cause binary
1009         incompatibility unless someone does signed integer comparison with currently invalid values.
1010
1011         Added availability macros I forgot to add earlier.
1012
1013         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1014         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1015
1016 2018-01-29  Jiewen Tan  <jiewen_tan@apple.com>
1017
1018         [WebAuthN] Add a compile-time feature flag
1019         https://bugs.webkit.org/show_bug.cgi?id=182211
1020         <rdar://problem/36936365>
1021
1022         Reviewed by Brent Fulgham.
1023
1024         * Configurations/FeatureDefines.xcconfig:
1025
1026 2018-01-29  John Wilander  <wilander@apple.com>
1027
1028         Resource Load Statistics: Introduce debug mode as experimental feature
1029         https://bugs.webkit.org/show_bug.cgi?id=182199
1030         <rdar://problem/36930364>
1031
1032         Reviewed by Alex Christensen.
1033
1034         The only changes to default behavior are:
1035         - Increased resolution on timestamps which is needed to be able to set shorter
1036           timeouts in debug mode.
1037         - Only update partitioning and blocking table when needed. This is an optimization
1038           which pays off in less XPC with shorter timeouts.
1039
1040         * Shared/WebPreferences.yaml:
1041         * UIProcess/API/APIWebsiteDataStore.cpp:
1042         (API::WebsiteDataStore::resourceLoadStatisticsDebugMode const):
1043         (API::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
1044         * UIProcess/API/APIWebsiteDataStore.h:
1045         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1046         (WKWebsiteDataStoreSetResourceLoadStatisticsDebugMode):
1047         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1048         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1049         (-[WKWebsiteDataStore _resourceLoadStatisticsDebugMode]):
1050         (-[WKWebsiteDataStore _setResourceLoadStatisticsDebugMode:]):
1051         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1052         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1053         (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
1054         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
1055         * UIProcess/WebResourceLoadStatisticsStore.h:
1056         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1057         (WebKit::WebsiteDataStore::resourceLoadStatisticsDebugMode const):
1058         (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
1059         * UIProcess/WebsiteData/WebsiteDataStore.h:
1060
1061 2018-01-29  Andy Estes  <aestes@apple.com>
1062
1063         [iOS] Restrict synthetic clicks to the origin that handled the underlying touch event
1064         https://bugs.webkit.org/show_bug.cgi?id=182252
1065         <rdar://problem/21555881>
1066
1067         Reviewed by Tim Horton.
1068
1069         * WebProcess/WebPage/WebPage.cpp:
1070         (WebKit::WebPage::dispatchTouchEvent):
1071         (WebKit::WebPage::updatePotentialTapSecurityOrigin):
1072
1073         Record the target frame origin of touch events that are potential taps, are
1074         TouchStart events, are targeted in frames that have touch event listeners, and are not
1075         handled by those listeners.
1076
1077         * WebProcess/WebPage/WebPage.h:
1078         * WebProcess/WebPage/ios/WebPageIOS.mm:
1079         (WebKit::WebPage::potentialTapAtPosition):
1080         (WebKit::WebPage::commitPotentialTap):
1081         (WebKit::WebPage::cancelPotentialTapInFrame):
1082
1083         Passed the target frame origin to Frame::nodeRespondingToClickEvents() then cleared it.
1084
1085 2018-01-29  Alex Christensen  <achristensen@webkit.org>
1086
1087         Make policy checks more robust against null pointer dereferencing
1088         https://bugs.webkit.org/show_bug.cgi?id=182263
1089         <rdar://problem/34895714>
1090
1091         Reviewed by Tim Horton.
1092
1093         We're still dereferencing null.  Check everything.
1094
1095         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1096         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1097
1098 2018-01-29  Brent Fulgham  <bfulgham@apple.com>
1099
1100         Add telemetry to track storage access API adoption
1101         https://bugs.webkit.org/show_bug.cgi?id=182197
1102         <rdar://problem/35803309>
1103
1104         Reviewed by Chris Dumez.
1105
1106         Part 1: Add telemetry for the user interaction case
1107         
1108         This patch adds telemetry to track how frequently third-party cookies are
1109         used in a first party context due to user interaction. This will help
1110         understand cases where the new Storage Access API can help, and to help
1111         us understand if we have considered relevant use cases in its design.
1112
1113         * Shared/WebProcessCreationParameters.cpp:
1114         (WebKit::WebProcessCreationParameters::encode const):
1115         (WebKit::WebProcessCreationParameters::decode):
1116         * Shared/WebProcessCreationParameters.h:
1117         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1118         (WebKit::WebProcessPool::platformInitializeWebProcess):
1119         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
1120         (WebKit::sortedPrevalentResourceTelemetry): Update for new telemetry.
1121         (WebKit::submitTopList): Update for new data types.
1122         * WebProcess/WebProcess.cpp:
1123         (WebKit::WebProcess::initializeWebProcess): Handle the partitioning time
1124         passed from the UIProcess.
1125
1126 2018-01-29  Alex Christensen  <achristensen@webkit.org>
1127
1128         Fix crash when during canAuthenticateAgainstProtectionSpace
1129         https://bugs.webkit.org/show_bug.cgi?id=182260
1130         <rdar://problem/34911343>
1131
1132         Reviewed by Chris Dumez.
1133
1134         If we have a valid network load with no challenge completion handler and we are
1135         telling it to continue with the challenge handling, something has gone wrong.
1136         Maybe we've just recovered from a crashed network process.  If this happens, do nothing.
1137
1138         * NetworkProcess/NetworkLoad.cpp:
1139         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
1140
1141 2018-01-29  Zach Li  <zacharyli323@gmail.com>
1142
1143         Warning in 32-bit WebKit build when trying to link to SafariSafeBrowsing
1144         https://bugs.webkit.org/show_bug.cgi?id=182251
1145         rdar://problem/36964995
1146
1147         Reviewed by Alex Christensen.
1148
1149         * Configurations/WebKit.xcconfig:
1150         Only link against SafariSafeBrowsing framework in 64-bit architecture.
1151
1152         * Platform/spi/Cocoa/SafeBrowsingSPI.h:
1153         Guard the Safe Browsing code with WK_API_ENABLED.
1154
1155 2018-01-29  Chris Dumez  <cdumez@apple.com>
1156
1157         Make sure we do not re-enter Webcore during StorageToWebProcessConnection::EstablishSWServerConnection Sync IPC
1158         https://bugs.webkit.org/show_bug.cgi?id=182256
1159         <rdar://problem/36689233>
1160
1161         Reviewed by Simon Fraser.
1162
1163         Make sure we do not re-enter Webcore during StorageToWebProcessConnection::EstablishSWServerConnection Sync IPC as
1164         this can lead to crashes such as the one in <rdar://problem/36689233>.
1165
1166         * WebProcess/Storage/WebSWClientConnection.cpp:
1167         (WebKit::WebSWClientConnection::WebSWClientConnection):
1168
1169 2018-01-29  Jan-Michael Brummer  <jan.brummer@tabos.org>
1170
1171         [GTK] Zooming gesture incorrectly uses scale instead of zoom 
1172         https://bugs.webkit.org/show_bug.cgi?id=182174
1173
1174         Reviewed by Michael Catanzaro.
1175
1176         Switch zooming gesture to use zoom instead of scale function.
1177
1178         * UIProcess/gtk/GestureController.cpp:
1179         (WebKit::GestureController::ZoomGesture::begin):
1180         (WebKit::GestureController::ZoomGesture::handleZoom):
1181
1182 2018-01-29  Brady Eidson  <beidson@apple.com>
1183
1184         Make it possible for apps that use both WK1 and WK2 to use MessagePorts.
1185         https://bugs.webkit.org/show_bug.cgi?id=182229
1186
1187         Reviewed by Chris Dumez.
1188
1189         * UIProcess/UIMessagePortChannelProvider.cpp:
1190         (WebKit::UIMessagePortChannelProvider::UIMessagePortChannelProvider):
1191
1192         * UIProcess/WebPageProxy.cpp:
1193         (WebKit::m_configurationPreferenceValues): The UI process does not need to override the 
1194           global singleton provider. It can remain the default ProviderImpl to allow WK1 views 
1195           to work fine, too.
1196
1197 2018-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
1198
1199         WebDriver: ASSERTION FAILED: !m_loadTimer.isActive()
1200         https://bugs.webkit.org/show_bug.cgi?id=182237
1201
1202         Reviewed by Carlos Alberto Lopez Perez.
1203
1204         We should stop the load timer when we dispatch the pending navigation callbacks due to an alert open.
1205
1206         * UIProcess/Automation/WebAutomationSession.cpp:
1207         (WebKit::WebAutomationSession::willShowJavaScriptDialog):
1208
1209 2018-01-29  Zan Dobersek  <zdobersek@igalia.com>
1210
1211         [Cairo] Add GraphicsContextImplCairo::createFactory() helpers
1212         https://bugs.webkit.org/show_bug.cgi?id=182238
1213
1214         Reviewed by Carlos Garcia Campos.
1215
1216         Use GraphicsContextImplCairo::createFactory() helpers throughout the
1217         Cairo-specific GraphicsContext constructors in the WebKit layer.
1218
1219         * Shared/cairo/ShareableBitmapCairo.cpp:
1220         (WebKit::ShareableBitmap::createGraphicsContext):
1221         * UIProcess/cairo/BackingStoreCairo.cpp:
1222         (WebKit::BackingStore::incorporateUpdate):
1223         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
1224         (WebKit::WebPrintOperationGtk::renderPage):
1225
1226 2018-01-29  Zan Dobersek  <zdobersek@igalia.com>
1227
1228         [Cairo] Remove the GraphicsContext(cairo_t*) constructor
1229         https://bugs.webkit.org/show_bug.cgi?id=182234
1230
1231         Reviewed by Carlos Garcia Campos.
1232
1233         Call sites of the GraphicsContext(cairo_t*) constructor are adjusted to
1234         instead provide a factory function that returns a fresh
1235         GraphicsContextImplCairo object, passing that cairo_t object to its
1236         constructor.
1237
1238         * Shared/cairo/ShareableBitmapCairo.cpp:
1239         (WebKit::ShareableBitmap::createGraphicsContext):
1240         * UIProcess/cairo/BackingStoreCairo.cpp:
1241         (WebKit::BackingStore::incorporateUpdate):
1242         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
1243         (WebKit::WebPrintOperationGtk::renderPage):
1244
1245 2018-01-26  Megan Gardner  <megan_gardner@apple.com>
1246
1247         Don't retain focus for input peripheral views
1248         https://bugs.webkit.org/show_bug.cgi?id=182204
1249
1250         Reviewed by Tim Horton.
1251
1252         Retaining focus on input peripheral views makes it so they cannot dismiss themselves with
1253         the current architecture. This should probably be fixed in UIKit, as there is no reason for
1254         focus to be retained on these views anyways, as they don't have keyboard input, but this
1255         guards against over-aggressive retain requests.
1256
1257         * UIProcess/ios/WKContentViewInteraction.mm:
1258         (-[WKContentView _restoreFocusWithToken:]):
1259         (-[WKContentView _preserveFocusWithToken:destructively:]):
1260
1261 2018-01-26  Chris Dumez  <cdumez@apple.com>
1262
1263         Make sure service worker code does not launch a StorageProcess unnecessarily
1264         https://bugs.webkit.org/show_bug.cgi?id=182192
1265         <rdar://problem/36927427>
1266
1267         Reviewed by Geoffrey Garen.
1268
1269         When calling WebProcess::existingWebToStorageProcessConnection(), make sure we do not
1270         force the creation of a WebProcess connection to the StorageProcess. If there is
1271         no WebProcess, just return false right away.
1272
1273         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
1274         (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
1275         * WebProcess/WebProcess.h:
1276
1277 2018-01-26  Alex Christensen  <achristensen@webkit.org>
1278
1279         Allow cellular access for default-created ephemeral sessions
1280         https://bugs.webkit.org/show_bug.cgi?id=182179
1281         <rdar://problem/36572023>
1282
1283         Reviewed by Andy Estes.
1284
1285         This makes it so when we recover from a NetworkProcess crash (see r227590) on iOS, we will
1286         be able to continue browsing using cell data.
1287
1288         * Shared/WebsiteDataStoreParameters.cpp:
1289         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
1290         * UIProcess/WebProcessPool.cpp:
1291         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
1292         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1293         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
1294
1295 2018-01-26  Alex Christensen  <achristensen@webkit.org>
1296
1297         Clean up more networking code
1298         https://bugs.webkit.org/show_bug.cgi?id=182161
1299
1300         Reviewed by Anders Carlsson.
1301
1302         Two cleanups:
1303         1. The WebProcess doesn't need to initialize NetworkSessions.
1304         2. WebFrameNetworkingContext doesn't need to have the NetworkingContext functions to support ResourceHandles in WebKit any more.
1305
1306         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1307         * NetworkProcess/NetworkLoad.h:
1308         * NetworkProcess/RemoteNetworkingContext.h:
1309         (): Deleted.
1310         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1311         * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp:
1312         (WebKit::RemoteNetworkingContext::~RemoteNetworkingContext): Deleted.
1313         (WebKit::RemoteNetworkingContext::isValid const): Deleted.
1314         (WebKit::RemoteNetworkingContext::storageSession const): Deleted.
1315         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1316         (WebKit::RemoteNetworkingContext::~RemoteNetworkingContext): Deleted.
1317         (WebKit::RemoteNetworkingContext::isValid const): Deleted.
1318         (WebKit::RemoteNetworkingContext::localFileContentSniffingEnabled const): Deleted.
1319         (WebKit::RemoteNetworkingContext::storageSession const): Deleted.
1320         (WebKit::RemoteNetworkingContext::sourceApplicationAuditData const): Deleted.
1321         (WebKit::RemoteNetworkingContext::sourceApplicationIdentifier const): Deleted.
1322         (WebKit::RemoteNetworkingContext::blockedError const): Deleted.
1323         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
1324         (WebKit::RemoteNetworkingContext::~RemoteNetworkingContext): Deleted.
1325         (WebKit::RemoteNetworkingContext::isValid const): Deleted.
1326         (WebKit::RemoteNetworkingContext::storageSession const): Deleted.
1327         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
1328         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
1329         * WebProcess/WebProcess.cpp:
1330         (WebKit::WebProcess::initializeWebProcess):
1331         (WebKit::WebProcess::clearCachedCredentials):
1332
1333 2018-01-26  Jan-Michael Brummer  <jan.brummer@tabos.org>
1334
1335         [GTK] Support using long-tap gesture to open context menu
1336         https://bugs.webkit.org/show_bug.cgi?id=140747
1337
1338         Reviewed by Carlos Garcia Campos.
1339
1340         Add long press gesture which simulates a secondary mouse press to open context menu.
1341
1342         * UIProcess/gtk/GestureController.cpp:
1343         (WebKit::GestureController::GestureController):
1344         (WebKit::GestureController::handleEvent):
1345         (WebKit::GestureController::isProcessingGestures const):
1346         (WebKit::GestureController::Gesture::simulateMousePress):
1347         (WebKit::GestureController::DragGesture::handleTap):
1348         (WebKit::GestureController::LongPressGesture::longPressed):
1349         (WebKit::GestureController::LongPressGesture::pressed):
1350         (WebKit::GestureController::LongPressGesture::LongPressGesture):
1351         * UIProcess/gtk/GestureController.h:
1352         (WebKit::GestureController::reset):
1353
1354 2018-01-26  Carlos Garcia Campos  <cgarcia@igalia.com>
1355
1356         Unreviewed. REGRESSION(r227647): window.open() is broken in GTK and WPE after r227647.
1357
1358         In r227647, API::UIClient::createNewPage() was changed to use CompletionHandler instead of Function. All
1359         implementations were updated expect the GLib one, and we didn't notice it because the method doesn't have the
1360         final/override mark.
1361
1362         * UIProcess/API/glib/WebKitUIClient.cpp:
1363         (UIClient::createNewPage):
1364
1365 2018-01-25  Sergio Villar Senin  <svillar@igalia.com>
1366
1367         [WebVR] Make WebVR available by default for developer builds
1368         https://bugs.webkit.org/show_bug.cgi?id=182101
1369
1370         Reviewed by Michael Catanzaro.
1371
1372         Moved WebVR setting to the experimental features section and make it
1373         available by default for developer builds for GTK and WPE.
1374
1375         * Shared/WebPreferences.yaml:
1376
1377 2018-01-25  Alex Christensen  <achristensen@webkit.org>
1378
1379         REGRESSION (r221899): Web Content process hangs when webpage tries to make a new window if the WKWebView doesn’t have a UI delegate
1380         https://bugs.webkit.org/show_bug.cgi?id=182152
1381
1382         Reviewed by Joseph Pecoraro.
1383
1384         Call the completion handler of the default API::UIClient::createNewPage.
1385
1386         * UIProcess/API/APIUIClient.h:
1387         (API::UIClient::createNewPage):
1388         * UIProcess/API/C/WKPage.cpp:
1389         (WKPageSetPageUIClient):
1390         * UIProcess/Cocoa/UIDelegate.h:
1391         * UIProcess/Cocoa/UIDelegate.mm:
1392         (WebKit::UIDelegate::UIClient::createNewPage):
1393
1394 2018-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
1395
1396         [iOS] [WK2] Introduce new views and view controllers to support extra-zoomed text form controls
1397         https://bugs.webkit.org/show_bug.cgi?id=182000
1398         <rdar://problem/35143035>
1399
1400         Reviewed by Tim Horton.
1401
1402         Add new files to support text form control editing while extra-zoomed.
1403
1404         * UIProcess/ios/forms/WKFocusedFormControlView.h: Added.
1405         * UIProcess/ios/forms/WKFocusedFormControlView.mm: Added.
1406         * UIProcess/ios/forms/WKFocusedFormControlViewController.h: Added.
1407         * UIProcess/ios/forms/WKFocusedFormControlViewController.mm: Added.
1408         * UIProcess/ios/forms/WKTextFormControlViewController.h: Added.
1409         * UIProcess/ios/forms/WKTextFormControlViewController.mm: Added.
1410         * UIProcess/ios/forms/WKTextInputViewController.h: Added.
1411         * UIProcess/ios/forms/WKTextInputViewController.mm: Added.
1412         * UIProcess/ios/forms/WKTextSuggestionButton.h: Added.
1413         * UIProcess/ios/forms/WKTextSuggestionButton.mm: Added.
1414         * WebKit.xcodeproj/project.pbxproj:
1415
1416 2018-01-25  Chris Dumez  <cdumez@apple.com>
1417
1418         Clients.get(id) should only returns clients in the service worker's origin
1419         https://bugs.webkit.org/show_bug.cgi?id=182149
1420         <rdar://problem/36882310>
1421
1422         Reviewed by Youenn Fablet.
1423
1424         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1425         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
1426
1427 2018-01-25  Youenn Fablet  <youenn@apple.com>
1428
1429         WebPluginInfoProvider should handle null host queries
1430         https://bugs.webkit.org/show_bug.cgi?id=182112
1431
1432         Reviewed by Chris Dumez.
1433
1434         Return early if host is null.
1435
1436         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
1437         (WebKit::WebPluginInfoProvider::populatePluginCache):
1438
1439 2018-01-25  Simon Fraser  <simon.fraser@apple.com>
1440
1441         ASSERT(CGSizeEqualToSize(m_resizeScrollOffset, CGSizeZero)) in WebViewImpl::setFrameAndScrollBy()
1442         https://bugs.webkit.org/show_bug.cgi?id=182082
1443         rdar://problem/13971838
1444
1445         Reviewed by Tim Horton.
1446
1447         Safari could call WebViewImpl::setFrameAndScrollBy() multiple times with different scroll offsets,
1448         triggering this assertion.
1449
1450         Rename to m_resizeScrollOffset to m_scrollOffsetAdjustment to reduce confusion with actual scroll offsets.
1451         This parameter has no effect on macOS, but is used by the -[WKWebView setFrame:andScrollBy:] so at some point
1452         needs to be hooked up to allow synchronous view resize and scroll adjustment (e.g. for the Find bar animation).
1453         
1454         Remove DrawingAreaProxy's m_layerPosition which was unused, and remove the parameters from the UpdateGeometry message.
1455
1456         * UIProcess/API/Cocoa/WKWebView.mm:
1457         (-[WKWebView _frameOrBoundsChanged]):
1458         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1459         * UIProcess/Cocoa/WebViewImpl.h:
1460         * UIProcess/Cocoa/WebViewImpl.mm:
1461         (WebKit::WebViewImpl::setFrameAndScrollBy):
1462         (WebKit::WebViewImpl::setDrawingAreaSize):
1463         * UIProcess/DrawingAreaProxy.cpp:
1464         (WebKit::DrawingAreaProxy::setSize):
1465         * UIProcess/DrawingAreaProxy.h:
1466         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
1467         (WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
1468         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
1469         (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
1470         * WebProcess/WebPage/DrawingArea.h:
1471         (WebKit::DrawingArea::updateGeometry):
1472         * WebProcess/WebPage/DrawingArea.messages.in:
1473         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
1474         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1475         (WebKit::RemoteLayerTreeDrawingArea::updateGeometry):
1476         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1477         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1478         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
1479
1480 2018-01-25  Keith Rollin  <krollin@apple.com>
1481
1482         Add logging to facilitate binding of WebContent and Network processes to UI process
1483         https://bugs.webkit.org/show_bug.cgi?id=182066
1484
1485         Reviewed by Brent Fulgham.
1486
1487         When examining sysdiagnose logs and tracing events from one process to
1488         another, it would be helpful to know which WebKit processes were
1489         related to each other. When Safari, Mail, Messages, etc. are all
1490         running at the same time, it may otherwise be difficult to know if a
1491         particular Network process, for example was associated with Safari or
1492         some other application. Add some logging to the creation of WebContent
1493         and Network processes to identify their "presenting process" (parent
1494         application).
1495
1496         * NetworkProcess/NetworkProcess.cpp:
1497         (WebKit::NetworkProcess::initializeNetworkProcess):
1498         * Platform/Logging.h:
1499         * WebProcess/WebProcess.cpp:
1500         (WebKit::WebProcess::initializeWebProcess):
1501
1502 2018-01-25  Youenn Fablet  <youenn@apple.com>
1503
1504         DocumentLoader should interrupt ongoing load when getting a redirection from network that matches a service worker
1505         https://bugs.webkit.org/show_bug.cgi?id=182115
1506
1507         Reviewed by Alex Christensen.
1508
1509         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1510         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
1511
1512 2018-01-25  Alex Christensen  <achristensen@webkit.org>
1513
1514         Fix crash when preconnecting while closing private browsing
1515         https://bugs.webkit.org/show_bug.cgi?id=182114
1516         <rdar://problem/35637284>
1517
1518         Reviewed by Joseph Pecoraro.
1519
1520         * NetworkProcess/PreconnectTask.cpp:
1521         There is a race condition when destroying a session while a page is initiating a preconnect.
1522         If this happens, fail gracefully instead of trying to preconnect with a null session.
1523
1524 2018-01-25  Dan Bernstein  <mitz@apple.com>
1525
1526         [Mac] Enable library validation for Networking & Storage XPC services
1527         https://bugs.webkit.org/show_bug.cgi?id=173424
1528         <rdar://problem/32386565>
1529
1530         Reviewed by Joseph Pecoraro.
1531
1532         * Configurations/BaseXPCService.xcconfig: Moved the definitions of
1533           WK_LIBRARY_VALIDATION_ENABLED and WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS from
1534           WebContentService.xcconfig to here and made them Mac-only at this level.
1535         * Configurations/NetworkService.xcconfig: Also set OTHER_CODE_SIGN_FLAGS to
1536           WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS.
1537         * Configurations/StorageService.xcconfig: Ditto.
1538         * Configurations/WebContentService.xcconfig: Moved definitions from here to
1539           BaseXPCService.xcconfig.
1540
1541 2018-01-25  David Hyatt  <hyatt@apple.com>
1542
1543         Enable lines clamp support for Apple Mail by default
1544         https://bugs.webkit.org/show_bug.cgi?id=182113
1545
1546         Reviewed by Dean Jackson.
1547
1548         * Shared/WebPageCreationParameters.cpp:
1549         (WebKit::WebPageCreationParameters::encode const):
1550         (WebKit::WebPageCreationParameters::decode):
1551         * Shared/WebPageCreationParameters.h:
1552         * UIProcess/WebPageProxy.cpp:
1553         (WebKit::WebPageProxy::creationParameters):
1554         * UIProcess/WebPageProxy.h:
1555         * UIProcess/mac/WebPageProxyMac.mm:
1556         (WebKit::WebPageProxy::appleMailLinesClampEnabled):
1557         * WebProcess/WebPage/WebPage.cpp:
1558         (WebKit::m_cpuLimit):
1559
1560 2018-01-25  Sergio Villar Senin  <svillar@igalia.com>
1561
1562         [WebVR][GTK][WPE] Remove the WebVR public API added in r227518
1563         https://bugs.webkit.org/show_bug.cgi?id=182102
1564
1565         Reviewed by Carlos Garcia Campos.
1566
1567         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1568
1569 2018-01-25  Sergio Villar Senin  <svillar@igalia.com>
1570
1571         [WebVR][GTK][WPE] Remove the WebVR public API added in r227518
1572         https://bugs.webkit.org/show_bug.cgi?id=182102
1573
1574         Reviewed by Carlos Garcia Campos.
1575
1576         This new public API was not supposed to be included in the patch
1577         that added OpenVR to the tree and to the build.
1578
1579         * UIProcess/API/glib/WebKitSettings.cpp:
1580         (webKitSettingsSetProperty):
1581         (webKitSettingsGetProperty):
1582         (webkit_settings_class_init):
1583         (webkit_settings_get_enable_webvr): Deleted.
1584         (webkit_settings_set_enable_webvr): Deleted.
1585         * UIProcess/API/gtk/WebKitSettings.h:
1586         * UIProcess/API/wpe/WebKitSettings.h:
1587
1588 2018-01-25  Claudio Saavedra  <csaavedra@igalia.com>
1589
1590         [GTK] Fix build with touch events disabled
1591
1592         Unreviewed build fix.
1593
1594         Explicitly include gtk.h in files that were indirectly getting it
1595         only when touch events were enabled.
1596         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
1597         * UIProcess/gtk/WaylandCompositor.h:
1598
1599 2018-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1600
1601         WebDriver: test imported/selenium/py/test/selenium/webdriver/common/alerts_tests.py crashes in debug
1602         https://bugs.webkit.org/show_bug.cgi?id=182096
1603
1604         Reviewed by Carlos Alberto Lopez Perez.
1605
1606         It's an assert in HashTable iterators checkValidity(). The problem is that we get the keys to iterate the values
1607         and the map is modified inside the loop. We need to use copyToVector to copy the keys.
1608
1609         * UIProcess/Automation/WebAutomationSession.cpp:
1610         (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout):
1611         (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout):
1612         (WebKit::WebAutomationSession::willShowJavaScriptDialog):
1613
1614 2018-01-24  Alex Christensen  <achristensen@webkit.org>
1615
1616         Gracefully recover from NetworkProcess crashes in private browsing
1617         https://bugs.webkit.org/show_bug.cgi?id=182073
1618         <rdar://problem/36572023>
1619
1620         Reviewed by Geoff Garen.
1621
1622         If we're using a non-persistent WKWebsiteDataStore and the NetworkProcess crashes and we try to do a load,
1623         then the WebProcess restarts the NetworkProcess but doesn't recreate the ephemeral session in the NetworkProcess.
1624         When this happens, we've already lost the browsing state in memory in the NetworkProcess, but we don't want to hang.
1625         If this is the problem, then just recreate the ephemeral session and continue loading.
1626
1627         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1628         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
1629         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage):
1630         * NetworkProcess/NetworkResourceLoader.cpp:
1631         (WebKit::NetworkResourceLoader::startNetworkLoad):
1632         * Shared/WebsiteDataStoreParameters.cpp:
1633         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
1634         (WebKit::WebsiteDataStoreParameters::legacyPrivateSessionParameters): Deleted.
1635         * Shared/WebsiteDataStoreParameters.h:
1636         (WebKit::WebsiteDataStoreParameters::legacyPrivateSessionParameters):
1637
1638 2018-01-24  Dan Bernstein  <mitz@apple.com>
1639
1640         Enable library validation on the Web Content service
1641         Part 1 of https://bugs.webkit.org/show_bug.cgi?id=172365
1642         <rdar://problem/26470661>
1643
1644         Reviewed by David Kilzer.
1645
1646         This makes the Web Content process signed with the Library Validation flag in production
1647         builds. Because doing so would prevent engineering builds of Apple apps that use an
1648         injected bundle from working, this also adds a Development version of the service, which
1649         does not enforce Library Validation. The UI process chooses to use the Development service
1650         iff it would need to load an injected bundle that is not part of the OS.
1651
1652         * Configurations/DebugRelease.xcconfig: Disable Library Validation in engineering builds.
1653
1654         * Configurations/WebContentService.Development.xcconfig: Added. Like the normal service, but
1655           only installed when WebKit is installed in the OS, and uses a Development variant.
1656
1657         * Configurations/WebContentService.xcconfig: For the Development variant, append
1658           ".Development" to the product name, which is also the service identifier. Enable Library
1659           Validation for the Normal variant of the service when WK_LIBRARY_VALIDATION_ENABLED allows
1660           it.
1661
1662         * UIProcess/Launcher/ProcessLauncher.h: Add nonValidInjectedCodeAllowed member to
1663           LaunchOptions, false by default.
1664
1665         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1666         (WebKit::serviceName): Use the Development variant if nonValidInjectedCodeAllowed is true.
1667
1668         * UIProcess/WebProcessProxy.cpp:
1669         (WebKit::WebProcessProxy::getLaunchOptions): Initialize nonValidInjectedCodeAllowed using
1670            the new shouldAllowNonValidInjectedCode().
1671         (WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Generic implementation
1672           that returns false.
1673         * UIProcess/WebProcessProxy.h: Declared shouldAllowNonValidInjectedCode.
1674         * UIProcess/mac/WebProcessProxyMac.mm:
1675         (WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Return true if this is
1676           system WebKit with a non-system injected bundle.
1677
1678         * WebKit.xcodeproj/project.pbxproj: Added new service target.
1679
1680 2018-01-24  Chris Dumez  <cdumez@apple.com>
1681
1682         Add a IPC::SendSyncOption indicating we should not process incoming IPC while waiting for the sync reply
1683         https://bugs.webkit.org/show_bug.cgi?id=182021
1684         <rdar://problem/21629943>
1685
1686         Reviewed by Ryosuke Niwa.
1687
1688         Add a new DoNotProcessIncomingMessagesWhenWaitingForSyncReply SendSyncOption that the caller can
1689         set when calling sendSync(). This indicates that the sendSync() should return only when we receive
1690         the response to our sync IPC message, and that we should not process ANY incoming IPC in the meantime.
1691
1692         This patch also starts using this flag in 3 places where we know processing incoming IPC is an issue
1693         and is causing crashes.
1694
1695         * Platform/IPC/Connection.cpp:
1696         (IPC::Connection::sendSyncMessage):
1697         When DoNotProcessIncomingMessagesWhenWaitingForSyncReply SendSyncOption is set, make sure
1698         we set the ShouldDispatchMessageWhenWaitingForSyncReply flag on the encoder. If we did not set this
1699         flag then it could cause deadlocks when the destination process is also waiting on a synchronous
1700         IPC from us. Normally, this flag already gets set for sync messages because sendSyncMessage() calls
1701         sendMessage() with DispatchMessageEvenWhenWaitingForSyncReply SyncOption. However, sendMessage()
1702         ignores the DispatchMessageEvenWhenWaitingForSyncReply flag if the
1703         m_onlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage flag is set on the
1704         connection. Note that this flag is set on the connection from the WebProcess to the UIProcess at
1705         the moment, which is why we saw deadlocks on the previous iteration of this patch.
1706
1707         (IPC::Connection::waitForSyncReply):
1708         If DoNotProcessIncomingMessagesWhenWaitingForSyncReply SendSyncOption is set, do not
1709         process incoming IPC messages while waiting for our sync IPC reply.
1710
1711         * Platform/IPC/Connection.h:
1712         Add new SendSyncOption.
1713
1714         * UIProcess/WebProcessProxy.cpp:
1715         (WebKit::WebProcessProxy::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
1716         * UIProcess/WebProcessProxy.h:
1717         * UIProcess/WebProcessProxy.messages.in:
1718         Testing infrastructure.
1719
1720         * WebProcess/Network/WebLoaderStrategy.cpp:
1721         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
1722         Use new flag.
1723
1724         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1725         (WebKit::WebChromeClient::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
1726         * WebProcess/WebCoreSupport/WebChromeClient.h:
1727         Testing infrastructure.
1728
1729         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1730         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
1731         Use new flag.
1732
1733         * WebProcess/WebProcess.cpp:
1734         (WebKit::WebProcess::syncIPCMessageWhileWaitingForSyncReplyForTesting):
1735         Testing infrastructure.
1736
1737         (WebKit::WebProcess::ensureNetworkProcessConnection):
1738         Use new flag.
1739
1740         * WebProcess/WebProcess.h:
1741         * WebProcess/WebProcess.messages.in:
1742         Testing infrastructure.
1743
1744 2018-01-24  Joseph Pecoraro  <pecoraro@apple.com>
1745
1746         Web Inspector: Remove duplicate preference update for WebAuthentication value
1747         https://bugs.webkit.org/show_bug.cgi?id=182058
1748
1749         Reviewed by Brian Burg.
1750
1751         * WebProcess/WebPage/WebPage.cpp:
1752         (WebKit::WebPage::updatePreferences):
1753         An identical update already happens in generated code.
1754
1755 2018-01-24  Alex Christensen  <achristensen@webkit.org>
1756
1757         Remove WebProcess access to QTKit
1758         https://bugs.webkit.org/show_bug.cgi?id=182035
1759
1760         Reviewed by Alexey Proskuryakov.
1761
1762         * WebProcess/com.apple.WebProcess.sb.in:
1763         This isn't needed any more.  We only have a little bit of code that uses QTKit which we should remove,
1764         and it's only used for fullscreen controls in WebKitLegacy.  Let's tighten up the sandbox!
1765
1766 2018-01-24  Alex Christensen  <achristensen@webkit.org>
1767
1768         Remove pre-Sierra-OS-specific code in WebKit
1769         https://bugs.webkit.org/show_bug.cgi?id=182024
1770
1771         Reviewed by Tim Horton.
1772
1773         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1774         * Shared/Cocoa/DataDetectionResult.mm:
1775         (WebKit::DataDetectionResult::encode const):
1776         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
1777         (IPC::ArgumentCoder<WebCore::Payment>::encode):
1778         (IPC::ArgumentCoder<WebCore::PaymentContact>::encode):
1779         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode):
1780         (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode):
1781         * Shared/WebPreferencesDefaultValues.h:
1782         * Shared/cg/ShareableBitmapCG.cpp:
1783         (WebKit::wantsExtendedRange):
1784         * Shared/ios/InteractionInformationAtPosition.mm:
1785         (WebKit::InteractionInformationAtPosition::encode const):
1786         * Shared/mac/CodeSigning.mm:
1787         (WebKit::codeSigningIdentifier):
1788         (WebKit::codeSigningIdentifierForCurrentProcess):
1789         * Shared/mac/ColorSpaceData.mm:
1790         (WebKit::ColorSpaceData::encode const):
1791         * Shared/mac/PasteboardTypes.mm:
1792         (WebKit::PasteboardTypes::forURL):
1793         * Shared/mac/WebCoreArgumentCodersMac.mm:
1794         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
1795         (IPC::ArgumentCoder<Credential>::encodePlatformData):
1796         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode):
1797         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData):
1798         * Shared/mac/WebHitTestResultData.mm:
1799         (WebKit::WebHitTestResultData::platformEncode const):
1800         * UIProcess/API/Cocoa/WKProcessPool.mm:
1801         (-[WKProcessPool _setObject:forBundleParameter:]):
1802         (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]):
1803         * UIProcess/API/Cocoa/WKWebView.mm:
1804         (-[WKWebView _handleAcceptedCandidate:]):
1805         * UIProcess/Cocoa/WebViewImpl.h:
1806         * UIProcess/Cocoa/WebViewImpl.mm:
1807         (WebKit::WebViewImpl::handleAcceptedCandidate):
1808         (WebKit::WebViewImpl::performDragOperation):
1809         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1810         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
1811         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1812         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]):
1813         * WebProcess/com.apple.WebProcess.sb.in:
1814
1815 2018-01-24  Alex Christensen  <achristensen@webkit.org>
1816
1817         Stop using AuthenticationClient in WebKit
1818         https://bugs.webkit.org/show_bug.cgi?id=182016
1819
1820         Reviewed by Brady Eidson.
1821
1822         It was necessary to support ResourceHandle use in WebKit, but now we're using NetworkSession everywhere in WebKit.
1823
1824         * Shared/Authentication/AuthenticationManager.cpp:
1825         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
1826         (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
1827         (WebKit::AuthenticationManager::cancelSingleChallenge):
1828         (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
1829         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
1830
1831 2018-01-24  Alex Christensen  <achristensen@webkit.org>
1832
1833         Remove WebProcess authentication code
1834         https://bugs.webkit.org/show_bug.cgi?id=182020
1835
1836         Reviewed by Brady Eidson.
1837
1838         * Shared/Authentication/AuthenticationManager.cpp:
1839         * Shared/Authentication/AuthenticationManager.h:
1840         * UIProcess/WebPageProxy.cpp:
1841         (WebKit::WebPageProxy::didReceiveAuthenticationChallenge): Deleted.
1842         * UIProcess/WebPageProxy.h:
1843         * UIProcess/WebPageProxy.messages.in:
1844         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1845         (WebKit::WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge):
1846         * WebProcess/WebProcess.cpp:
1847         (WebKit::m_webSQLiteDatabaseTracker):
1848
1849 2018-01-24  Jan-Michael Brummer  <jan.brummer@tabos.org>
1850
1851         [GTK] Page crash after swipe gesture running GNOME3 under wayland
1852         https://bugs.webkit.org/show_bug.cgi?id=181996
1853
1854         Reviewed by Michael Catanzaro.
1855
1856         Add missing GDK_TOUCH_CANCEL support which fixes page crashes due to cancelled gestures.
1857         * Shared/gtk/WebEventFactory.cpp:
1858         (WebKit::WebEventFactory::createWebTouchEvent):
1859         * UIProcess/API/gtk/PageClientImpl.cpp:
1860         (WebKit::PageClientImpl::doneWithTouchEvent):
1861         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1862         (touchPointStateForEvents):
1863         (webkitWebViewBaseGetTouchPointsForEvent):
1864         (webkitWebViewBaseTouchEvent):
1865         * UIProcess/gtk/GestureController.cpp:
1866         (WebKit::GestureController::handleEvent):
1867
1868 2018-01-24  Alex Christensen  <achristensen@webkit.org>
1869
1870         Remove unused QTKit preference
1871         https://bugs.webkit.org/show_bug.cgi?id=181968
1872
1873         Reviewed by Alexey Proskuryakov.
1874
1875         * Shared/API/c/WKDeprecatedFunctions.cpp:
1876         (WKPreferencesSetQTKitEnabled):
1877         (WKPreferencesGetQTKitEnabled):
1878         * Shared/WebPreferences.yaml:
1879         * UIProcess/API/C/WKPreferences.cpp:
1880         (WKPreferencesSetQTKitEnabled): Deleted.
1881         (WKPreferencesGetQTKitEnabled): Deleted.
1882         * UIProcess/API/Cocoa/WKPreferences.mm:
1883         (-[WKPreferences _setQTKitEnabled:]): Deleted.
1884         (-[WKPreferences _qtKitEnabled]): Deleted.
1885         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1886
1887 2018-01-24  Youenn Fablet  <youenn@apple.com>
1888
1889         Fetch response should copy its url from the request if null
1890         https://bugs.webkit.org/show_bug.cgi?id=182048
1891
1892         Reviewed by Chris Dumez.
1893
1894         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1895         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
1896
1897 2018-01-24  Sergio Villar Senin  <svillar@igalia.com>
1898
1899         Unreviewed build fix after r227518. I forgot to add the function declarations to the WPE
1900         header.
1901
1902         * UIProcess/API/wpe/WebKitSettings.h: Added webkit_settings_get/set_enable_webvr.
1903
1904 2018-01-24  Youenn Fablet  <youenn@apple.com>
1905
1906         Add Cache Storage engine assertion following on bug 181887
1907         https://bugs.webkit.org/show_bug.cgi?id=181925
1908
1909         Reviewed by Alex Christensen.
1910
1911         In a normal environment, the folderPath should be the same as the path computed from the ClientOrigin.
1912         Add assertion to verify this.
1913
1914         * NetworkProcess/cache/CacheStorageEngine.cpp:
1915         (WebKit::CacheStorage::Engine::clearCachesForOrigin):
1916
1917 2018-01-24  Michael Catanzaro  <mcatanzaro@igalia.com>
1918
1919         [GTK] Use GDK_EVENT_PROPAGATE and GDK_EVENT_STOP in WebKitWebViewBase.cpp
1920         https://bugs.webkit.org/show_bug.cgi?id=182031
1921
1922         Reviewed by Carlos Garcia Campos.
1923
1924         No functional changes, this just replaces TRUE with GDK_EVENT_STOP and FALSE with
1925         GDK_EVENT_PROPAGATE, to improve readability.
1926
1927         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1928         (webkitWebViewBaseKeyPressEvent):
1929         (webkitWebViewBaseKeyReleaseEvent):
1930         (webkitWebViewBaseButtonPressEvent):
1931         (webkitWebViewBaseButtonReleaseEvent):
1932         (webkitWebViewBaseScrollEvent):
1933         (webkitWebViewBaseMotionNotifyEvent):
1934         (webkitWebViewBaseCrossingNotifyEvent):
1935         (webkitWebViewBaseTouchEvent):
1936
1937 2018-01-23  Eric Carlson  <eric.carlson@apple.com>
1938
1939         Resign NowPlaying status when no media element is eligible
1940         https://bugs.webkit.org/show_bug.cgi?id=181914
1941         <rdar://problem/35294116>
1942
1943         Reviewed by Jer Noble.
1944
1945         * UIProcess/API/Cocoa/WKWebView.mm:
1946         (-[WKWebView _requestActiveNowPlayingSessionInfo:]): Return registeredAsNowPlayingApplication
1947         status.
1948         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1949
1950         * UIProcess/WebPageProxy.cpp:
1951         (WebKit::WebPageProxy::nowPlayingInfoCallback): Ditto.
1952         * UIProcess/WebPageProxy.h:
1953         * UIProcess/WebPageProxy.messages.in:
1954         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
1955         (WebKit::WebPage::requestActiveNowPlayingSessionInfo): Ditto.
1956
1957 2018-01-23  Alex Christensen  <achristensen@webkit.org>
1958
1959         Use CompletionHandlers for ResourceHandleClient::didReceiveResponseAsync
1960         https://bugs.webkit.org/show_bug.cgi?id=181961
1961
1962         Reviewed by Michael Catanzaro.
1963
1964         * NetworkProcess/Downloads/Download.h:
1965         * NetworkProcess/NetworkLoad.cpp:
1966         * NetworkProcess/NetworkLoad.h:
1967         * NetworkProcess/NetworkResourceLoadParameters.h:
1968         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1969         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1970         * WebProcess/WebPage/mac/WebPageMac.mm:
1971         * WebProcess/WebProcess.cpp:
1972
1973 2018-01-23  Chris Dumez  <cdumez@apple.com>
1974
1975         Unreviewed, rollout r227216 as it seems to be causing deadlocks
1976         https://bugs.webkit.org/show_bug.cgi?id=182013
1977
1978         * Platform/IPC/Connection.cpp:
1979         (IPC::Connection::waitForSyncReply):
1980         * Platform/IPC/Connection.h:
1981         (IPC::Connection::setShouldProcessIncomingMessagesWhileWaitingForSyncReply): Deleted.
1982         * UIProcess/WebProcessProxy.cpp:
1983         (WebKit::WebProcessProxy::testIncomingSyncIPCMessageWhileWaitingForSyncReply): Deleted.
1984         * UIProcess/WebProcessProxy.h:
1985         * UIProcess/WebProcessProxy.messages.in:
1986         * WebProcess/Network/NetworkProcessConnection.cpp:
1987         (WebKit::NetworkProcessConnection::NetworkProcessConnection):
1988         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
1989         (WebKit::WebToStorageProcessConnection::WebToStorageProcessConnection):
1990         * WebProcess/WebConnectionToUIProcess.cpp:
1991         (WebKit::WebConnectionToUIProcess::WebConnectionToUIProcess):
1992         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1993         (WebKit::WebChromeClient::testIncomingSyncIPCMessageWhileWaitingForSyncReply): Deleted.
1994         * WebProcess/WebCoreSupport/WebChromeClient.h:
1995         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1996         (WebKit::WebEditorClient::undo):
1997         (WebKit::WebEditorClient::redo):
1998         * WebProcess/WebProcess.cpp:
1999         (WebKit::WebProcess::syncIPCMessageWhileWaitingForSyncReplyForTesting): Deleted.
2000         * WebProcess/WebProcess.h:
2001         * WebProcess/WebProcess.messages.in:
2002
2003 2018-01-23  Commit Queue  <commit-queue@webkit.org>
2004
2005         Unreviewed, rolling out r227437.
2006         https://bugs.webkit.org/show_bug.cgi?id=182011
2007
2008         broke build (Requested by alexchristensen on #webkit).
2009
2010         Reverted changeset:
2011
2012         "Remove unused QTKit preference"
2013         https://bugs.webkit.org/show_bug.cgi?id=181968
2014         https://trac.webkit.org/changeset/227437
2015
2016 2018-01-23  Alex Christensen  <achristensen@webkit.org>
2017
2018         Remove compile guard around beacon API
2019         https://bugs.webkit.org/show_bug.cgi?id=182002
2020
2021         Reviewed by Sam Weinig.
2022
2023         It's enabled everywhere now.
2024
2025         * Shared/WebPreferences.yaml:
2026         * UIProcess/API/C/WKPreferences.cpp:
2027         (WKPreferencesSetBeaconAPIEnabled):
2028         (WKPreferencesGetBeaconAPIEnabled):
2029         * config.h:
2030
2031 2018-01-23  Alex Christensen  <achristensen@webkit.org>
2032
2033         Remove unused QTKit preference
2034         https://bugs.webkit.org/show_bug.cgi?id=181968
2035
2036         Reviewed by Alexey Proskuryakov.
2037
2038         * Shared/API/c/WKDeprecatedFunctions.cpp:
2039         (WKPreferencesSetQTKitEnabled):
2040         (WKPreferencesGetQTKitEnabled):
2041         * Shared/WebPreferences.yaml:
2042         * UIProcess/API/C/WKPreferences.cpp:
2043         (WKPreferencesSetQTKitEnabled): Deleted.
2044         (WKPreferencesGetQTKitEnabled): Deleted.
2045         * UIProcess/API/Cocoa/WKPreferences.mm:
2046         (-[WKPreferences _setQTKitEnabled:]): Deleted.
2047         (-[WKPreferences _qtKitEnabled]): Deleted.
2048         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2049
2050 2018-01-23  Brent Fulgham  <bfulgham@apple.com>
2051
2052         [macOS] WebProcess needs TCC entitlements for media capture
2053         https://bugs.webkit.org/show_bug.cgi?id=181995
2054         <rdar://problem/36674649>
2055
2056         Reviewed by Eric Carlson.
2057
2058         * Configurations/WebContent-OSX.entitlements: Add delegated services needed to support media
2059         capture features.
2060
2061 2018-01-23  Dan Bernstein  <mitz@apple.com>
2062
2063         [Cocoa] Disable header postprocessing when building for macOS High Sierra
2064         https://bugs.webkit.org/show_bug.cgi?id=181972
2065
2066         Reviewed by Anders Carlsson.
2067
2068         * Configurations/WebKit.xcconfig: Adopt macOSTargetConditionals.xcconfig helpers and disable postprocessing
2069           when building for macOS 10.13.
2070
2071 2018-01-23  Joseph Pecoraro  <pecoraro@apple.com>
2072
2073         Web Inspector: Window resizing is broken after detaching to separate window
2074         https://bugs.webkit.org/show_bug.cgi?id=181992
2075         <rdar://problem/36714840>
2076
2077         Reviewed by Brian Burg.
2078
2079         * UIProcess/mac/WebInspectorProxyMac.mm:
2080         (WebKit::WebInspectorProxy::platformDetach):
2081         Restore the inspector view's autoresizingMask to the initial value
2082         that works with a detached window. This gets changed when the view
2083         gets attached to bottom/side, so we need to revert it on detaching.
2084
2085 2018-01-23  Brady Eidson  <beidson@apple.com>
2086
2087         Allow passing MessagePorts across processes (e.g. ServiceWorkers).
2088         https://bugs.webkit.org/show_bug.cgi?id=181178
2089
2090         Reviewed by Andy Estes.
2091
2092         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2093         (WebKit::WebSWServerConnection::postMessageToServiceWorker):
2094         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
2095         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2096         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2097
2098         * StorageProcess/StorageProcess.cpp:
2099         (WebKit::StorageProcess::postMessageToServiceWorkerClient):
2100         * StorageProcess/StorageProcess.h:
2101         * StorageProcess/StorageProcess.messages.in:
2102
2103         * UIProcess/WebProcessProxy.cpp:
2104         (WebKit::WebProcessProxy::entangleLocalPortInThisProcessToRemote):
2105         (WebKit::WebProcessProxy::postMessageToRemote):
2106
2107         * WebProcess/Storage/WebSWClientConnection.cpp:
2108         (WebKit::WebSWClientConnection::postMessageToServiceWorker):
2109         (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
2110         * WebProcess/Storage/WebSWClientConnection.h:
2111         * WebProcess/Storage/WebSWClientConnection.messages.in:
2112
2113         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2114         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorker):
2115         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
2116         * WebProcess/Storage/WebSWContextManagerConnection.h:
2117         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2118
2119 2018-01-23  Commit Queue  <commit-queue@webkit.org>
2120
2121         Unreviewed, rolling out r227279 and r227373.
2122         https://bugs.webkit.org/show_bug.cgi?id=181988
2123
2124         The LayoutTest crash fix introduced an API test failure.
2125         (Requested by ryanhaddad on #webkit).
2126
2127         Reverted changesets:
2128
2129         "Resign NowPlaying status when no media element is eligible"
2130         https://bugs.webkit.org/show_bug.cgi?id=181914
2131         https://trac.webkit.org/changeset/227279
2132
2133         "Resign NowPlaying status when no media element is eligible"
2134         https://bugs.webkit.org/show_bug.cgi?id=181914
2135         https://trac.webkit.org/changeset/227373
2136
2137 2018-01-23  Youenn Fablet  <youenn@apple.com>
2138
2139         REGRESSION (r227348): ASSERT_NOT_REACHED in WebKit::ServiceWorkerClientFetch::didFinish()
2140         https://bugs.webkit.org/show_bug.cgi?id=181956
2141         <rdar://problem/36755492>
2142
2143         Reviewed by Chris Dumez.
2144
2145         Covered by test no longer crashing in Debug builds.
2146         Reset m_redirectionStatus to None when starting an SW fetch.
2147
2148         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2149         (WebKit::ServiceWorkerClientFetch::start):
2150         (WebKit::ServiceWorkerClientFetch::didFinish):
2151
2152 2018-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
2153
2154         [WPE] TestWebKitFindController asserts
2155         https://bugs.webkit.org/show_bug.cgi?id=181472
2156
2157         Reviewed by Carlos Garcia Campos.
2158
2159         Let's fix this in two independent ways.
2160
2161         First, use a GRefPtr to hold ownership of the WebKitWebViewBackend. This way, we don't need
2162         to change the order in which WebKitWebView destroys its priv struct members from what is
2163         used in WebKitGTK+, which can lead to odd bugs.
2164
2165         Additionally, just for good measure, stop resetting the find client when disposing
2166         WebKitFindController. This is unnecessary because it will never be destroyed before the
2167         WebKitWebView.
2168
2169         * UIProcess/API/glib/WebKitFindController.cpp:
2170         (webkit_find_controller_class_init):
2171         (webkitFindControllerDispose): Deleted.
2172         * UIProcess/API/glib/WebKitWebView.cpp:
2173         (_WebKitWebViewPrivate::~_WebKitWebViewPrivate):
2174         (webkitWebViewSetProperty):
2175         (webkitWebViewGetProperty):
2176         (webkitWebViewCreatePage):
2177         (webkit_web_view_get_backend):
2178         * UIProcess/API/wpe/WebKitWebViewBackend.cpp:
2179         (webkitWebViewBackendCreateDefault):
2180         (WTF::refGPtr):
2181         (WTF::derefGPtr):
2182         * UIProcess/API/wpe/WebKitWebViewBackendPrivate.h:
2183
2184 2018-01-22  Jon Lee  <jonlee@apple.com>
2185
2186         Update title label size
2187         https://bugs.webkit.org/show_bug.cgi?id=181962
2188         rdar://problem/36754744
2189
2190         Reviewed by Simon Fraser.
2191
2192         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
2193         (-[_WKFullScreenViewController setLocation:secure:trustedName:trustedSite:]): Move titleLabel properties into
2194         createSubviews.
2195         (-[_WKFullScreenViewController createSubviews]): Set the title label for both the cancel and location buttons.
2196         Refer to a const CGFloat for the font size.
2197
2198 2018-01-22  Megan Gardner  <megan_gardner@apple.com>
2199
2200         Temporarily restore block selection code conditionally
2201         https://bugs.webkit.org/show_bug.cgi?id=181895
2202         <rdar://problem/36567325>
2203
2204         Reviewed by Tim Horton.
2205
2206         We need to restore this code temporarily to avoid a crash.
2207
2208         * Platform/spi/ios/UIKitSPI.h:
2209         * UIProcess/ios/WKContentViewInteraction.mm:
2210         (-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]):
2211
2212 2018-01-22  Zach Li  <zacharyli323@gmail.com>
2213
2214         We should not try to link against the Safe Browsing framework on watchOS and tvOS.
2215         https://bugs.webkit.org/show_bug.cgi?id=181965.
2216
2217         Reviewed by Tim Horton.
2218
2219         * Configurations/WebKit.xcconfig:
2220
2221 2018-01-22  Alex Christensen  <achristensen@webkit.org>
2222
2223         Remove pre-NetworkSession loading code
2224         https://bugs.webkit.org/show_bug.cgi?id=181944
2225
2226         Reviewed by Tim Horton.
2227
2228         We were keeping it around for El Capitan.
2229
2230         * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm:
2231         (WebKit::LegacyCustomProtocolManager::registerProtocolClass):
2232         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.cpp:
2233         (WebKit::LegacyCustomProtocolManager::initialize):
2234         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h:
2235         * NetworkProcess/Downloads/BlobDownloadClient.cpp: Removed.
2236         * NetworkProcess/Downloads/BlobDownloadClient.h: Removed.
2237         * NetworkProcess/Downloads/Download.cpp:
2238         (WebKit::Download::~Download):
2239         (WebKit::Download::cancel):
2240         (WebKit::Download::didReceiveChallenge):
2241         (WebKit::Download::didFinish):
2242         (WebKit::Download::isAlwaysOnLoggingAllowed const):
2243         (WebKit::Download::start): Deleted.
2244         (WebKit::Download::startWithHandle): Deleted.
2245         (WebKit::Download::didStart): Deleted.
2246         (WebKit::Download::willSendRedirectedRequest): Deleted.
2247         (WebKit::Download::didReceiveAuthenticationChallenge): Deleted.
2248         (WebKit::Download::didReceiveResponse): Deleted.
2249         (WebKit::Download::shouldDecodeSourceDataOfMIMEType): Deleted.
2250         (WebKit::Download::decideDestinationWithSuggestedFilename): Deleted.
2251         (WebKit::Download::decideDestinationWithSuggestedFilenameAsync): Deleted.
2252         (WebKit::Download::didDecideDownloadDestination): Deleted.
2253         (WebKit::Download::continueDidReceiveResponse): Deleted.
2254         * NetworkProcess/Downloads/Download.h:
2255         (WebKit::Download::setBlobFileReferences): Deleted.
2256         (WebKit::Download::request const): Deleted.
2257         * NetworkProcess/Downloads/DownloadManager.cpp:
2258         (WebKit::DownloadManager::startDownload):
2259         (WebKit::DownloadManager::willDecidePendingDownloadDestination):
2260         (WebKit::DownloadManager::convertNetworkLoadToDownload):
2261         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
2262         (WebKit::DownloadManager::resumeDownload):
2263         (WebKit::DownloadManager::cancelDownload):
2264         * NetworkProcess/Downloads/DownloadManager.h:
2265         (WebKit::DownloadManager::startDownload):
2266         * NetworkProcess/Downloads/PendingDownload.cpp:
2267         * NetworkProcess/Downloads/PendingDownload.h:
2268         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
2269         * NetworkProcess/Downloads/ios/DownloadIOS.mm: Removed.
2270         * NetworkProcess/Downloads/mac/DownloadMac.mm: Removed.
2271         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
2272         * NetworkProcess/NetworkCORSPreflightChecker.h:
2273         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2274         (WebKit::NetworkConnectionToWebProcess::loadPing):
2275         * NetworkProcess/NetworkDataTask.cpp:
2276         * NetworkProcess/NetworkDataTask.h:
2277         * NetworkProcess/NetworkDataTaskBlob.cpp:
2278         * NetworkProcess/NetworkDataTaskBlob.h:
2279         * NetworkProcess/NetworkLoad.cpp:
2280         (WebKit::NetworkLoad::~NetworkLoad):
2281         (WebKit::NetworkLoad::setDefersLoading):
2282         (WebKit::NetworkLoad::cancel):
2283         (WebKit::NetworkLoad::continueWillSendRequest):
2284         (WebKit::NetworkLoad::continueDidReceiveResponse):
2285         (WebKit::NetworkLoad::shouldCaptureExtraNetworkLoadMetrics const):
2286         (WebKit::NetworkLoad::didReceiveResponseAsync): Deleted.
2287         (WebKit::NetworkLoad::didReceiveBuffer): Deleted.
2288         (WebKit::NetworkLoad::didFinishLoading): Deleted.
2289         (WebKit::NetworkLoad::didFail): Deleted.
2290         (WebKit::NetworkLoad::willSendRequestAsync): Deleted.
2291         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
2292         (WebKit::NetworkLoad::shouldUseCredentialStorage): Deleted.
2293         (WebKit::NetworkLoad::didReceiveAuthenticationChallenge): Deleted.
2294         (WebKit::NetworkLoad::receivedCancellation): Deleted.
2295         * NetworkProcess/NetworkLoad.h:
2296         * NetworkProcess/NetworkLoadParameters.h:
2297         * NetworkProcess/NetworkProcess.cpp:
2298         (WebKit::NetworkProcess::initializeNetworkProcess):
2299         (WebKit::NetworkProcess::clearCachedCredentials):
2300         (WebKit::NetworkProcess::findPendingDownloadLocation):
2301         * NetworkProcess/NetworkProcess.h:
2302         * NetworkProcess/NetworkProcess.messages.in:
2303         * NetworkProcess/NetworkResourceLoader.cpp:
2304         (WebKit::NetworkResourceLoader::startNetworkLoad):
2305         * NetworkProcess/NetworkSession.cpp:
2306         * NetworkProcess/NetworkSession.h:
2307         * NetworkProcess/PingLoad.cpp:
2308         * NetworkProcess/PingLoad.h:
2309         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2310         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
2311         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2312         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2313         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2314         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2315         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
2316         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2317         * NetworkProcess/mac/NetworkLoadMac.mm: Removed.
2318         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2319         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
2320         * Shared/Authentication/AuthenticationManager.cpp:
2321         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
2322         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
2323         (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
2324         (WebKit::AuthenticationManager::cancelSingleChallenge):
2325         (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
2326         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
2327         * Shared/Authentication/AuthenticationManager.h:
2328         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm: Removed.
2329         * Shared/SessionTracker.cpp:
2330         (WebKit::SessionTracker::setSession):
2331         (WebKit::SessionTracker::destroySession):
2332         * Shared/SessionTracker.h:
2333         * Shared/mac/CookieStorageShim.h: Removed.
2334         * Shared/mac/CookieStorageShim.mm: Removed.
2335         * UIProcess/API/APIDownloadClient.h:
2336         (API::DownloadClient::didReceiveData):
2337         (API::DownloadClient::shouldDecodeSourceDataOfMIMEType): Deleted.
2338         * UIProcess/API/C/WKContext.cpp:
2339         (WKContextSetDownloadClient):
2340         * UIProcess/Cocoa/DownloadClient.h:
2341         * UIProcess/Cocoa/DownloadClient.mm:
2342         (WebKit::DownloadClient::shouldDecodeSourceDataOfMIMEType): Deleted.
2343         * UIProcess/Downloads/DownloadProxy.cpp:
2344         (WebKit::DownloadProxy::willSendRequest):
2345         (WebKit::DownloadProxy::didReceiveResponse):
2346         (WebKit::DownloadProxy::shouldDecodeSourceDataOfMIMEType): Deleted.
2347         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename): Deleted.
2348         * UIProcess/Downloads/DownloadProxy.h:
2349         * UIProcess/Downloads/DownloadProxy.messages.in:
2350         * WebKit.xcodeproj/project.pbxproj:
2351         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
2352         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
2353         * WebProcess/WebProcess.cpp:
2354         (WebKit::WebProcess::initializeWebProcess):
2355         (WebKit::WebProcess::clearCachedCredentials):
2356         * config.h:
2357
2358 2018-01-22  Youenn Fablet  <youenn@apple.com>
2359
2360         SW: Make sure ServiceWorker loading and requests are correctly cleared by ITP
2361         https://bugs.webkit.org/show_bug.cgi?id=181942
2362         <rdar://problem/35132091>
2363
2364         Reviewed by Chris Dumez.
2365
2366         Add ServiceWorkerRegistrations and DOMCache as persistent data to be cleared according ITP decisions.
2367
2368         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2369         (WebKit::WebResourceLoadStatisticsStore::monitoredDataTypes):
2370
2371 2018-01-22  Chris Dumez  <cdumez@apple.com>
2372
2373         Add release logging to help debug issues related to service workers
2374         https://bugs.webkit.org/show_bug.cgi?id=181935
2375         <rdar://problem/36735900>
2376
2377         Reviewed by Brady Eidson.
2378
2379         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2380         (WebKit::WebSWServerConnection::startFetch):
2381         (WebKit::WebSWServerConnection::didFinishFetch):
2382         (WebKit::WebSWServerConnection::didFailFetch):
2383         (WebKit::WebSWServerConnection::didNotHandleFetch):
2384
2385 2018-01-22  Brent Fulgham  <bfulgham@apple.com>
2386
2387         [iOS] REGRESSION (r225763): Allow access to power logging features
2388         https://bugs.webkit.org/show_bug.cgi?id=181938
2389         <rdar://problem/36442803>
2390
2391         Reviewed by Eric Carlson.
2392
2393         I denied access to the powerlog facility in r225763, not realizing that it
2394         gets activated in certain logging scenarios. This patch reverts this change.
2395
2396         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2397
2398 2018-01-22  Brent Fulgham  <bfulgham@apple.com>
2399
2400         [macOS, iOS] Allow accss to AVFoundation preference
2401         https://bugs.webkit.org/show_bug.cgi?id=181937
2402         <rdar://problem/33137029>
2403
2404         Reviewed by Eric Carlson.
2405
2406         Grant access to the 'com.apple.avfoundation.frecents' preference.
2407
2408         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2409         * WebProcess/com.apple.WebProcess.sb.in:
2410
2411 2018-01-22  Brady Eidson  <beidson@apple.com>
2412
2413         In WebKit2, make the MessagePortChannelRegistry live in the UI process.
2414         https://bugs.webkit.org/show_bug.cgi?id=181922
2415
2416         Reviewed by Andy Estes.
2417
2418         With all of the work that went into making MessagePorts be fully asynchronous
2419         and to be process-aware, formally moving them out-of-process is just a matter
2420         of adding WebKit IPC layers.
2421         
2422         The basic unit of asynchronicity is "MessagePortChannelProvider", and this patch
2423         adds both a WebMessagePortChannelProvider and UIMessagePortChannelProvider for
2424         each side of the process divide.
2425         
2426         * UIProcess/UIMessagePortChannelProvider.cpp: Added.
2427         (WebKit::UIMessagePortChannelProvider::singleton):
2428         (WebKit::UIMessagePortChannelProvider::UIMessagePortChannelProvider):
2429         (WebKit::UIMessagePortChannelProvider::~UIMessagePortChannelProvider):
2430         (WebKit::UIMessagePortChannelProvider::createNewMessagePortChannel):
2431         (WebKit::UIMessagePortChannelProvider::entangleLocalPortInThisProcessToRemote):
2432         (WebKit::UIMessagePortChannelProvider::messagePortDisentangled):
2433         (WebKit::UIMessagePortChannelProvider::messagePortClosed):
2434         (WebKit::UIMessagePortChannelProvider::takeAllMessagesForPort):
2435         (WebKit::UIMessagePortChannelProvider::postMessageToRemote):
2436         (WebKit::UIMessagePortChannelProvider::checkRemotePortForActivity):
2437         (WebKit::UIMessagePortChannelProvider::checkProcessLocalPortForActivity):
2438         * UIProcess/UIMessagePortChannelProvider.h: Added.
2439         (WebKit::UIMessagePortChannelProvider::registry):
2440
2441         * UIProcess/WebPageProxy.cpp:
2442         (WebKit::m_configurationPreferenceValues):
2443
2444         * UIProcess/WebProcessProxy.cpp:
2445         (WebKit::WebProcessProxy::processForIdentifier):
2446         (WebKit::m_userMediaCaptureManagerProxy):
2447         (WebKit::WebProcessProxy::~WebProcessProxy):
2448         (WebKit::WebProcessProxy::shutDown):
2449         (WebKit::WebProcessProxy::createNewMessagePortChannel):
2450         (WebKit::WebProcessProxy::entangleLocalPortInThisProcessToRemote):
2451         (WebKit::WebProcessProxy::messagePortDisentangled):
2452         (WebKit::WebProcessProxy::messagePortClosed):
2453         (WebKit::WebProcessProxy::takeAllMessagesForPort):
2454         (WebKit::WebProcessProxy::didDeliverMessagePortMessages):
2455         (WebKit::WebProcessProxy::postMessageToRemote):
2456         (WebKit::WebProcessProxy::checkRemotePortForActivity):
2457         (WebKit::WebProcessProxy::checkProcessLocalPortForActivity):
2458         (WebKit::WebProcessProxy::didCheckProcessLocalPortForActivity):
2459         * UIProcess/WebProcessProxy.h:
2460         * UIProcess/WebProcessProxy.messages.in:
2461
2462         * WebKit.xcodeproj/project.pbxproj:
2463
2464         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp: Added.
2465         (WebKit::WebMessagePortChannelProvider::singleton):
2466         (WebKit::WebMessagePortChannelProvider::WebMessagePortChannelProvider):
2467         (WebKit::WebMessagePortChannelProvider::~WebMessagePortChannelProvider):
2468         (WebKit::WebMessagePortChannelProvider::createNewMessagePortChannel):
2469         (WebKit::WebMessagePortChannelProvider::entangleLocalPortInThisProcessToRemote):
2470         (WebKit::WebMessagePortChannelProvider::messagePortDisentangled):
2471         (WebKit::WebMessagePortChannelProvider::messagePortClosed):
2472         (WebKit::WebMessagePortChannelProvider::takeAllMessagesForPort):
2473         (WebKit::WebMessagePortChannelProvider::didTakeAllMessagesForPort):
2474         (WebKit::WebMessagePortChannelProvider::didCheckRemotePortForActivity):
2475         (WebKit::WebMessagePortChannelProvider::postMessageToRemote):
2476         (WebKit::WebMessagePortChannelProvider::checkProcessLocalPortForActivity):
2477         (WebKit::WebMessagePortChannelProvider::checkRemotePortForActivity):
2478         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h: Added.
2479
2480         * WebProcess/WebProcess.cpp:
2481         (WebKit::WebProcess::initializeProcess):
2482         (WebKit::WebProcess::didTakeAllMessagesForPort):
2483         (WebKit::WebProcess::checkProcessLocalPortForActivity):
2484         (WebKit::WebProcess::didCheckRemotePortForActivity):
2485         (WebKit::WebProcess::messagesAvailableForPort):
2486         * WebProcess/WebProcess.h:
2487         * WebProcess/WebProcess.messages.in:
2488
2489 2018-01-22  Youenn Fablet  <youenn@apple.com>
2490
2491         Bump default cache storage quota to 50MB
2492         https://bugs.webkit.org/show_bug.cgi?id=181924
2493
2494         Reviewed by Chris Dumez.
2495
2496         Existing web sites use more than 20 MB.
2497
2498         * UIProcess/WebsiteData/WebsiteDataStore.h:
2499
2500 2018-01-22  Zan Dobersek  <zdobersek@igalia.com>
2501
2502         Unreviewed build fix after r227292. Fixing a bad copy-paste that broke
2503         the GTK+ debug builds.
2504
2505         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
2506         (WebKit::convertCairoSurfaceToShareableBitmap):
2507
2508 2018-01-22  Zan Dobersek  <zdobersek@igalia.com>
2509
2510         [Cairo] Refactor PlatformContextCairo::drawSurfaceToContext() into a Cairo operation
2511         https://bugs.webkit.org/show_bug.cgi?id=181930
2512
2513         Reviewed by Carlos Garcia Campos.
2514
2515         Call sites of the PlatformContextCairo::drawSurfaceToContext() method
2516         are adjusted to now call Cairo::drawSurface() and properly pass the
2517         PlatformContextCairo object to the function.
2518
2519         * Shared/cairo/ShareableBitmapCairo.cpp:
2520         (WebKit::ShareableBitmap::paint):
2521         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
2522         (WebKit::convertCairoSurfaceToShareableBitmap):
2523
2524 2018-01-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2525
2526         Unreviewed. Fix compile warning.
2527
2528         Use #include instead of #import in cross-platform code.
2529
2530         * Shared/WebPreferencesDefaultValues.cpp:
2531
2532 2018-01-21  Ryosuke Niwa  <rniwa@webkit.org>
2533
2534         Turning off custom pasteboard data doesn't actually turn it off in WK2
2535         https://bugs.webkit.org/show_bug.cgi?id=181920
2536         <rdar://problem/36686429>
2537
2538         Reviewed by Wenson Hsieh.
2539
2540         Moved the code to decide when to enable custom pasteboard data from WebCore
2541         since we never enable this feature in WebKit1.
2542
2543         * Shared/WebPreferences.yaml:
2544         * Shared/WebPreferencesDefaultValues.cpp:
2545         (defaultCustomPasteboardDataEnabled): Added.
2546         * Shared/WebPreferencesDefaultValues.h:
2547
2548 2018-01-21  Wenson Hsieh  <wenson_hsieh@apple.com>
2549
2550         Add a new feature flag for EXTRA_ZOOM_MODE and reintroduce AdditionalFeatureDefines.h
2551         https://bugs.webkit.org/show_bug.cgi?id=181918
2552
2553         Reviewed by Tim Horton.
2554
2555         Add EXTRA_ZOOM_MODE to FeatureDefines.xconfig (off by default).
2556
2557         * Configurations/FeatureDefines.xcconfig:
2558
2559 2018-01-21  Eric Carlson  <eric.carlson@apple.com>
2560
2561         Resign NowPlaying status when no media element is eligible
2562         https://bugs.webkit.org/show_bug.cgi?id=181914
2563         <rdar://problem/35294116>
2564
2565         Reviewed by Jer Noble.
2566
2567         * UIProcess/API/Cocoa/WKWebView.mm:
2568         (-[WKWebView _requestActiveNowPlayingSessionInfo:]): Return registeredAsNowPlayingApplication
2569         status.
2570         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2571
2572         * UIProcess/WebPageProxy.cpp:
2573         (WebKit::WebPageProxy::nowPlayingInfoCallback): Ditto.
2574         * UIProcess/WebPageProxy.h:
2575         * UIProcess/WebPageProxy.messages.in:
2576         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
2577         (WebKit::WebPage::requestActiveNowPlayingSessionInfo): Ditto.
2578
2579 2018-01-20  Andy Estes  <aestes@apple.com>
2580
2581         [Apple Pay] Stop eagerly loading PassKit.framework
2582         https://bugs.webkit.org/show_bug.cgi?id=181911
2583         <rdar://problem/36555369>
2584
2585         Reviewed by Tim Horton.
2586
2587         * Shared/WebPageCreationParameters.cpp:
2588         (WebKit::WebPageCreationParameters::encode const):
2589         (WebKit::WebPageCreationParameters::decode):
2590         * Shared/WebPageCreationParameters.h:
2591
2592         Removed availablePaymentNetworks from WebPageCreationParameters.
2593
2594         * UIProcess/API/C/WKPreferences.cpp:
2595         (WKPreferencesSetApplePayEnabled):
2596         * UIProcess/API/Cocoa/WKWebView.mm:
2597         (-[WKWebView _initializeWithConfiguration:]):
2598
2599         Stopped calling WebPaymentCoordinatorProxy::platformSupportsPayments().
2600
2601         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
2602         (WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks):
2603         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
2604         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
2605
2606         Added message AvailablePaymentNetworks, which synchronously returns a Vector of payment
2607         networks.
2608
2609         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2610         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
2611
2612         Returned false if PassKitLibrary() fails.
2613
2614         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
2615         (WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup):
2616
2617         Called completionHandler with false if PassKitLibrary() fails.
2618
2619         (WebKit::WebPaymentCoordinatorProxy::platformAvailablePaymentNetworks):
2620         (WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks):
2621
2622         Renamed availablePaymentNetworks to platformAvailablePaymentNetworks
2623
2624         (WebKit::WebPaymentCoordinatorProxy::platformSupportsPayments): Deleted.
2625
2626         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
2627         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
2628
2629         Called completionHandler with false if PassKitLibrary() fails.
2630
2631         * UIProcess/WebPageProxy.cpp:
2632         (WebKit::WebPageProxy::creationParameters):
2633
2634         Stopped calling WebPaymentCoordinatorProxy::availablePaymentNetworks().
2635
2636         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
2637         (WebKit::WebPaymentCoordinator::availablePaymentNetworks):
2638         (WebKit::WebPaymentCoordinator::validatedPaymentNetwork):
2639         * WebProcess/ApplePay/WebPaymentCoordinator.h:
2640
2641         Implemented PaymentCoordinatorClient::validatedPaymentNetwork(). m_availablePaymentNetworks
2642         starts off as std::nullopt, but is initialized by sending the AvailablePaymentNetworks sync
2643         message the first time it's accessed.
2644
2645         * WebProcess/WebPage/WebPage.cpp:
2646         (WebKit::WebPage::WebPage):
2647
2648         Stopped setting PageConfiguration::availablePaymentNetworks.
2649
2650 2018-01-20  Jer Noble  <jer.noble@apple.com>
2651
2652         Release ASSERT when reloading Vimeo page @ WebCore: WebCore::Document::updateLayout
2653         https://bugs.webkit.org/show_bug.cgi?id=181840
2654         <rdar://problem/36186214>
2655
2656         Reviewed by Simon Fraser.
2657
2658         Updating layout while the document is suspended or stopped is unsafe.
2659
2660         * WebProcess/cocoa/VideoFullscreenManager.mm:
2661         (WebKit::inlineVideoFrame):
2662
2663 2018-01-20  Chris Dumez  <cdumez@apple.com>
2664
2665         DOMCache data sometimes not properly removed when clearing data for a given origin
2666         https://bugs.webkit.org/show_bug.cgi?id=181887
2667         <rdar://problem/36671239>
2668
2669         Reviewed by Youenn Fablet.
2670
2671         * NetworkProcess/cache/CacheStorageEngine.cpp:
2672         (WebKit::CacheStorage::Engine::clearCachesForOrigin):
2673         This code was iterating through folders on disk, then reading the folder's origin
2674         from the origin file on disk. Then, if the origin would match the one we want to
2675         delete, it would regenerate the folder path using cachesRootPath(*folderOrigin).
2676         I don't know how but on my machine, I was ended up in a state where the path
2677         generated by cachesRootPath(*folderOrigin) differed from the actual folder path
2678         we read the origin from (Likely a different salt?). To make the code more robust,
2679         I updated the code to delete "folderPath", which is the path we read the origin
2680         from.
2681
2682 2018-01-19  Zach Li  <zacharyli323@gmail.com>
2683
2684         Expose Safe Browsing SPI
2685         https://bugs.webkit.org/show_bug.cgi?id=181804
2686         <rdar://problem/36626946>
2687
2688         Reviewed by Dan Bernstein.
2689
2690         If client is using Apple internal SDK, then we can just import the header; if not,
2691         then we declare necessary symbols that client will need.
2692
2693         * Configurations/WebKit.xcconfig:
2694         Only link against SafariSafeBrowsing framework on macOS High Sierra
2695         and iOS 11 and above. Weak link against SafariSafeBrowsing framework
2696         because it is not present on the Base system.
2697
2698         * Platform/spi/Cocoa/SafeBrowsingSPI.h: Added.
2699
2700         * WebKit.xcodeproj/project.pbxproj:
2701         Added SafeBrowsingSPI.h.
2702
2703         * WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/11/SafariSafeBrowsing.framework/SafariSafeBrowsing.tbd:
2704         Added.
2705
2706 2018-01-19  Ryan Haddad  <ryanhaddad@apple.com>
2707
2708         Unreviewed build fix, removed unused lambda capture.
2709
2710         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2711         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
2712
2713 2018-01-19  John Wilander  <wilander@apple.com>
2714
2715         Resource Load Statistics: Remove unused calls to WebResourceLoadStatisticsStore:logTestingEvent() to fix API test
2716         https://bugs.webkit.org/show_bug.cgi?id=181890
2717         <rdar://problem/36674772>
2718
2719         Unreviewed API test fix.
2720
2721         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2722         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
2723
2724 2018-01-19  Youenn Fablet  <youenn@apple.com>
2725
2726         Do not go to the storage process when registering a service worker client if there is no service worker registered
2727         https://bugs.webkit.org/show_bug.cgi?id=181740
2728         <rdar://problem/36650400>
2729
2730         Reviewed by Chris Dumez.
2731
2732         UIProcess notifies all web processes to register their service worker clients when spinning the service worker process.
2733         Add private API to set the number of web processes for testing purposes.
2734
2735         * UIProcess/API/Cocoa/WKProcessPool.mm:
2736         (-[WKProcessPool _setMaximumNumberOfProcesses:]):
2737         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2738         * UIProcess/WebProcessPool.cpp:
2739         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
2740         * WebProcess/WebProcess.cpp:
2741         (WebKit::WebProcess::registerServiceWorkerClients):
2742         * WebProcess/WebProcess.h:
2743         * WebProcess/WebProcess.messages.in:
2744
2745 2018-01-19  Dean Jackson  <dino@apple.com>
2746
2747         REGRESSION (r221092): Swipe actions are hard to perform in FastMail app
2748         https://bugs.webkit.org/show_bug.cgi?id=181817
2749         <rdar://problem/35274055>
2750
2751         Reviewed by Simon Fraser.
2752
2753         Add a linked-on-or-after check to set passive touch listeners on document in WebCore.
2754
2755         * CMakeLists.txt:
2756         * Shared/WebPreferences.yaml:
2757         * Shared/WebPreferencesDefaultValues.cpp: Copied from Source/WebKit/UIProcess/Cocoa/VersionChecks.h.
2758         (defaultPassiveTouchListenersAsDefaultOnDocument):
2759         * Shared/WebPreferencesDefaultValues.h:
2760         * UIProcess/Cocoa/VersionChecks.h:
2761         * WebKit.xcodeproj/project.pbxproj:
2762
2763 2018-01-19  Joseph Pecoraro  <pecoraro@apple.com>
2764
2765         [Cocoa] _WKNSWindowExtras.h: Add missing availability annotation
2766         https://bugs.webkit.org/show_bug.cgi?id=181868
2767
2768         Reviewed by Dan Bernstein.
2769
2770         * Shared/API/Cocoa/_WKNSWindowExtras.h:
2771
2772 2018-01-19  John Wilander  <wilander@apple.com>
2773
2774         Resource Load Statistics: Add void to argument list to fix build with -Wstrict-prototypes
2775         https://bugs.webkit.org/show_bug.cgi?id=181870
2776         <rdar://problem/36666750>
2777
2778         Unreviewed build fix.
2779
2780         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2781
2782 2018-01-19  Ryan Haddad  <ryanhaddad@apple.com>
2783
2784         Unreviewed, rolling out r227211.
2785
2786         Breaks iOS Simulator tests.
2787
2788         Reverted changeset:
2789
2790         "Expose Safe Browsing SPI"
2791         https://bugs.webkit.org/show_bug.cgi?id=181804
2792         https://trac.webkit.org/changeset/227211
2793
2794 2018-01-19  John Wilander  <wilander@apple.com>
2795
2796         Resource Load Statistics: Implement callback support for removal of WebsiteDataType::ResourceLoadStatistics
2797         https://bugs.webkit.org/show_bug.cgi?id=181822
2798         https://bugs.webkit.org/show_bug.cgi?id=175263
2799         https://bugs.webkit.org/show_bug.cgi?id=178536
2800         https://bugs.webkit.org/show_bug.cgi?id=181223
2801         https://bugs.webkit.org/show_bug.cgi?id=181482
2802         <rdar://problem/33491222>
2803         <rdar://problem/33805293>
2804         <rdar://problem/36332683>
2805         <rdar://problem/36549026>
2806
2807         Reviewed by Alex Christensen.
2808
2809         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2810         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
2811         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
2812         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2813         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore]):
2814             Calls the new API with no-op completion handler.
2815         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore:]):
2816             New API with completion handler.
2817         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]):
2818             Calls the new API with no-op completion handler.
2819         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:completionHandler:]):
2820             New API with completion handler.
2821         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2822         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
2823         (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
2824         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2825         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
2826         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
2827         * UIProcess/WebResourceLoadStatisticsStore.h:
2828         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2829         (WebKit::WebsiteDataStore::removeData):
2830         (WebKit::WebsiteDataStore::clearResourceLoadStatisticsInWebProcesses):
2831         * UIProcess/WebsiteData/WebsiteDataStore.h:
2832
2833 2018-01-19  Daniel Bates  <dabates@apple.com>
2834
2835         REGRESSION (r223149): Ref WebPageProxy objects before calling their functionality
2836         https://bugs.webkit.org/show_bug.cgi?id=181863
2837         <rdar://problem/36662452>
2838
2839         Reviewed by Chris Dumez.
2840
2841         More fix ups following r223149. When notifying all pages of a process state change we need to
2842         take care to ref all the pages before iterating over them and notifying them of the change.
2843         Notifying a page of such a state change may ultimately delegate to the embedding client. And
2844         the embedding client can do anything, including deallocating one or more pages.
2845
2846         * UIProcess/WebProcessProxy.cpp:
2847         (WebKit::WebProcessProxy::didBecomeUnresponsive):
2848         (WebKit::WebProcessProxy::didBecomeResponsive):
2849         (WebKit::WebProcessProxy::willChangeIsResponsive):
2850         (WebKit::WebProcessProxy::didChangeIsResponsive):
2851         (WebKit::WebProcessProxy::requestTermination):
2852
2853 2018-01-19  Chris Dumez  <cdumez@apple.com>
2854
2855         The WebContent process should not process incoming IPC while waiting for a sync IPC reply
2856         https://bugs.webkit.org/show_bug.cgi?id=181560
2857
2858         Reviewed by Ryosuke Niwa.
2859
2860         The WebContent process should not process incoming IPC while waiting for a sync IPC reply.
2861         This is causing hard-to-debug crashes because developers often assume the state does not
2862         change during a sendSync() call.
2863
2864         * Platform/IPC/Connection.cpp:
2865         (IPC::Connection::waitForSyncReply):
2866         * Platform/IPC/Connection.h:
2867         (IPC::Connection::setShouldProcessIncomingMessagesWhileWaitingForSyncReply):
2868         * UIProcess/WebProcessProxy.cpp:
2869         (WebKit::WebProcessProxy::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
2870         * UIProcess/WebProcessProxy.h:
2871         * UIProcess/WebProcessProxy.messages.in:
2872         * WebProcess/Network/NetworkProcessConnection.cpp:
2873         (WebKit::NetworkProcessConnection::NetworkProcessConnection):
2874         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
2875         (WebKit::WebToStorageProcessConnection::WebToStorageProcessConnection):
2876         * WebProcess/WebConnectionToUIProcess.cpp:
2877         (WebKit::WebConnectionToUIProcess::WebConnectionToUIProcess):
2878         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2879         (WebKit::WebChromeClient::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
2880         * WebProcess/WebCoreSupport/WebChromeClient.h:
2881         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2882         (WebKit::WebEditorClient::undo):
2883         (WebKit::WebEditorClient::redo):
2884         * WebProcess/WebProcess.cpp:
2885         (WebKit::WebProcess::syncIPCMessageWhileWaitingForSyncReplyForTesting):
2886         * WebProcess/WebProcess.h:
2887         * WebProcess/WebProcess.messages.in:
2888
2889 2018-01-19  Keith Miller  <keith_miller@apple.com>
2890
2891         HaveInternalSDK includes should be "#include?"
2892         https://bugs.webkit.org/show_bug.cgi?id=179670
2893
2894         Reviewed by Dan Bernstein.
2895
2896         * Configurations/Base.xcconfig:
2897
2898 2018-01-19  Daniel Bates  <dabates@apple.com>
2899
2900         Fix misspelling; substitute willDetachRenderer for willDetatchRenderer.
2901
2902         * WebProcess/Plugins/PDF/PDFPlugin.h:
2903         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2904         (WebKit::PDFPlugin::willDetachRenderer):
2905         (WebKit::PDFPlugin::willDetatchRenderer): Deleted.
2906         * WebProcess/Plugins/Plugin.h:
2907         (WebKit::Plugin::willDetachRenderer):
2908         (WebKit::Plugin::willDetatchRenderer): Deleted.
2909         * WebProcess/Plugins/PluginView.cpp:
2910         (WebKit::PluginView::willDetachRenderer):
2911         (WebKit::PluginView::willDetatchRenderer): Deleted.
2912         * WebProcess/Plugins/PluginView.h:
2913
2914 2018-01-19  Zach Li  <zacharyli323@gmail.com>
2915
2916         Expose Safe Browsing SPI
2917         https://bugs.webkit.org/show_bug.cgi?id=181804
2918         <rdar://problem/36626946>
2919
2920         Reviewed by Alex Christensen.
2921
2922         If client is using Apple internal SDK, then we can just import the header; if not,
2923         then we declare necessary symbols that client will need.
2924
2925         * Configurations/WebKit.xcconfig:
2926         Only link against SafariSafeBrowsing framework on macOS High Sierra
2927         and iOS 11 and above. Weak link against SafariSafeBrowsing framework
2928         because it is not present on the Base system.
2929
2930         * Platform/spi/Cocoa/SafeBrowsingSPI.h: Added.
2931
2932         * WebKit.xcodeproj/project.pbxproj:
2933         Added SafeBrowsingSPI.h.
2934
2935         * WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/11/SafariSafeBrowsing.framework/SafariSafeBrowsing.tbd:
2936         Added.
2937
2938 2018-01-18  Chris Dumez  <cdumez@apple.com>
2939
2940         We should be able to terminate service workers that are unresponsive
2941         https://bugs.webkit.org/show_bug.cgi?id=181563
2942         <rdar://problem/35280031>
2943
2944         Reviewed by Alex Christensen.
2945
2946         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2947         (WebKit::WebSWContextManagerConnection::terminateWorker):
2948         Use a 10 second timeout for forcefully exiting the service worker process when
2949         the service worker in question fails to terminate.
2950
2951         (WebKit::WebSWContextManagerConnection::syncTerminateWorker):
2952         Use a 100ms timeout for forcefully exiting the service worker process when
2953         the service worker in question fails to terminate. This method is only called
2954         from the layout tests, which is why we use a very short timeout.
2955
2956 2018-01-18  Ryan Haddad  <ryanhaddad@apple.com>
2957
2958         Unreviewed, suppress deprecation warnings to fix the build with a newer SDK.
2959
2960         * UIProcess/ios/WKPDFPageNumberIndicator.mm:
2961         (-[WKPDFPageNumberIndicator _makeRoundedCorners]):
2962
2963 2018-01-18  Youenn Fablet  <youenn@apple.com>
2964
2965         Do not go to the storage process when loading a main resource if there is no service worker registered
2966         https://bugs.webkit.org/show_bug.cgi?id=181395
2967
2968         Reviewed by Chris Dumez.
2969
2970         Add a new web process creation parameter to know whether there is any service worker registered at web process creation time.
2971         If there is none, the web process will then start to load HTTP resources from the network.
2972         The connection to the storage process is then executed when receiving the first bytes of the main resource.
2973         This connection is needed as other web processes may create service workers at any given time.
2974         If there is one registered service worker, the web process will wait for its connection to the storage process to be active.
2975
2976         * Shared/WebProcessCreationParameters.cpp:
2977         (WebKit::WebProcessCreationParameters::encode const):
2978         (WebKit::WebProcessCreationParameters::decode):
2979         * Shared/WebProcessCreationParameters.h:
2980         * UIProcess/ServiceWorkerProcessProxy.cpp:
2981         (WebKit::ServiceWorkerProcessProxy::hasRegisteredServiceWorkers):
2982         * UIProcess/ServiceWorkerProcessProxy.h:
2983         * UIProcess/WebProcessPool.cpp:
2984         (WebKit::WebProcessPool::initializeNewWebProcess):
2985         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
2986         (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
2987         * WebProcess/Storage/WebServiceWorkerProvider.h:
2988         * WebProcess/Storage/WebToStorageProcessConnection.h:
2989         (WebKit::WebToStorageProcessConnection::existingServiceWorkerConnectionForSession):
2990         * WebProcess/WebProcess.cpp:
2991         (WebKit::WebProcess::initializeWebProcess):
2992
2993 2018-01-18  Chris Dumez  <cdumez@apple.com>
2994
2995         Regression(r223149): WebProcessProxy::didClose() no longer refs WebPageProxy objects
2996         https://bugs.webkit.org/show_bug.cgi?id=181771
2997         <rdar://problem/36566237>
2998
2999         Reviewed by Brady Eidson.
3000
3001         * UIProcess/WebProcessProxy.cpp:
3002         (WebKit::WebProcessProxy::didClose):
3003         Use copyToVectorOf<RefPtr<WebPageProxy>>() to maintain pre-r223149 behavior
3004         and ref the pages.
3005
3006 2018-01-18  Dan Bernstein  <mitz@apple.com>
3007
3008         [Xcode] Streamline and future-proof target-macOS-version-dependent build setting definitions
3009         https://bugs.webkit.org/show_bug.cgi?id=181803
3010
3011         Reviewed by Tim Horton.
3012
3013         * Configurations/Base.xcconfig: Updated.
3014         * Configurations/DebugRelease.xcconfig: Ditto.
3015         * Configurations/FeatureDefines.xcconfig: Adopted macOSTargetConditionals helpers.
3016         * Configurations/Version.xcconfig: Updated.
3017         * Configurations/macOSTargetConditionals.xcconfig: Added.  Defines helper build settings
3018           useful for defining settings that depend on the target macOS version.
3019
3020 2018-01-18  Chris Dumez  <cdumez@apple.com>
3021
3022         Service Workers restored from persistent storage have 'redundant' state
3023         https://bugs.webkit.org/show_bug.cgi?id=181749
3024         <rdar://problem/36556486>
3025
3026         Reviewed by Youenn Fablet.
3027
3028         Allow service workers to intercept custom protocol loads as this is useful for
3029         API testing.
3030
3031         * WebProcess/Network/WebLoaderStrategy.cpp:
3032         (WebKit::WebLoaderStrategy::scheduleLoad):
3033         (WebKit::WebLoaderStrategy::tryLoadingUsingURLSchemeHandler):
3034         * WebProcess/Network/WebLoaderStrategy.h:
3035
3036 2018-01-18  Brent Fulgham  <bfulgham@apple.com>
3037
3038         REGRESSION(r225858): Sandbox violations due to blocked access to Spotlight search preferences
3039         https://bugs.webkit.org/show_bug.cgi?id=181797
3040         <rdar://problem/36546412>
3041
3042         Reviewed by Eric Carlson.
3043
3044         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Add the read permission for
3045         'com.apple.lookup.shared' to support DataDetectors.
3046
3047 2018-01-17  John Wilander  <wilander@apple.com>
3048
3049         Resource Load Statistics: Block cookies for prevalent resources without user interaction
3050         https://bugs.webkit.org/show_bug.cgi?id=177394
3051         <rdar://problem/34613960>
3052
3053         Reviewed by Alex Christensen.
3054
3055         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
3056             Now has m_hasBeenSetToUseStatelessCookieStorage to handle
3057             cookie blocking.
3058         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3059         (WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
3060             Returns singleton empty, deny-all cookie storage for cookie blocking.
3061             The ugly pragma instructions for clang are because the NSString
3062             parameter for _initWithIdentifier was not marked nullable pre-Sierra.
3063         (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
3064             Instead of just decision making, this now applies the policy.
3065         (WebKit::NetworkDataTaskCocoa::applyCookiePartitioningPolicy):
3066             New method.
3067         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
3068             Now blocks cookies for domains where cookies will be purged anyway.
3069         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
3070             Now blocks cookies for domains where cookies will be purged anyway.
3071         (WebKit::shouldChangePartition): Deleted.
3072         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3073         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
3074             Now downgrades for blocked cookies instead of partitioned cookies.
3075         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
3076             Now downgrades for blocked cookies instead of partitioned cookies.
3077
3078
3079 2018-01-17  Stephan Szabo  <stephan.szabo@sony.com>
3080
3081         [Curl] Use ResourceRequest::encodeWithPlatformData()
3082         https://bugs.webkit.org/show_bug.cgi?id=181768
3083
3084         Reviewed by Alex Christensen.
3085
3086         * Shared/curl/WebCoreArgumentCodersCurl.cpp:
3087         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
3088         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
3089
3090 2018-01-17  Matt Lewis  <jlewis3@apple.com>
3091
3092         Unreviewed, rolling out r227076.
3093
3094         This breaks internal builds
3095
3096         Reverted changeset:
3097
3098         "Resource Load Statistics: Block cookies for prevalent
3099         resources without user interaction"
3100         https://bugs.webkit.org/show_bug.cgi?id=177394
3101         https://trac.webkit.org/changeset/227076
3102
3103 2018-01-17  Michael Catanzaro  <mcatanzaro@igalia.com>
3104
3105         WEBKIT_FRAMEWORK should not modify file-global include directories
3106         https://bugs.webkit.org/show_bug.cgi?id=181656
3107
3108         Reviewed by Konstantin Tokarev.
3109
3110         * PlatformGTK.cmake:
3111         * PlatformWPE.cmake:
3112
3113 2018-01-17  Youenn Fablet  <youenn@apple.com>
3114
3115         Put fetch request keepAlive behind a runtime flag
3116         https://bugs.webkit.org/show_bug.cgi?id=181592
3117
3118         Reviewed by Chris Dumez.
3119
3120         * Shared/WebPreferences.yaml:
3121         * UIProcess/API/C/WKPreferences.cpp:
3122         (WKPreferencesSetFetchAPIKeepAliveEnabled):
3123         (WKPreferencesGetFetchAPIKeepAliveEnabled):
3124         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3125
3126 2018-01-17  John Wilander  <wilander@apple.com>
3127
3128         Resource Load Statistics: Block cookies for prevalent resources without user interaction
3129         https://bugs.webkit.org/show_bug.cgi?id=177394
3130         <rdar://problem/34613960>
3131
3132         Reviewed by Alex Christensen.
3133
3134         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
3135             Now has m_hasBeenSetToUseStatelessCookieStorage to handle
3136             cookie blocking.
3137         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3138         (WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
3139             Returns singleton empty, deny-all cookie storage for cookie blocking.
3140         (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
3141             Instead of just decision making, this now applies the policy.
3142         (WebKit::NetworkDataTaskCocoa::applyCookiePartitioningPolicy):
3143             New method.
3144         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
3145             Now blocks cookies for domains where cookies will be purged anyway.
3146         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
3147             Now blocks cookies for domains where cookies will be purged anyway.
3148         (WebKit::shouldChangePartition): Deleted.
3149         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3150         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
3151             Now downgrades for blocked cookies instead of partitioned cookies.
3152         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
3153             Now downgrades for blocked cookies instead of partitioned cookies.
3154
3155 2018-01-17  Daniel Bates  <dabates@apple.com>
3156
3157         REGRESSION (r222795): Cardiogram never signs in
3158         https://bugs.webkit.org/show_bug.cgi?id=181693
3159         <rdar://problem/36286293>
3160
3161         Reviewed by Ryosuke Niwa.
3162
3163         Exempt Cardiogram from the XHR header restrictions in r222795.
3164
3165         Following r222795 only Dashboard widgets are allowed to set arbitrary XHR headers.
3166         However Cardiogram also depends on such functionality.
3167
3168         * Shared/WebPreferences.yaml:
3169         * UIProcess/API/Cocoa/WKWebView.mm:
3170         (shouldAllowSettingAnyXHRHeaderFromFileURLs):
3171         (-[WKWebView _initializeWithConfiguration:]):
3172         * UIProcess/Cocoa/VersionChecks.h:
3173
3174 2018-01-17  Wenson Hsieh  <wenson_hsieh@apple.com>
3175
3176         Add injected bundle SPI to replace subresource URLs when dropping or pasting rich content
3177         https://bugs.webkit.org/show_bug.cgi?id=181637
3178         <rdar://problem/36508471>
3179
3180         Reviewed by Tim Horton.
3181
3182         Add new injected bundle SPI, replacementURLForResource, which clients may use to provide a replacement URL to
3183         represent an archive resource, given the resource's data and MIME type.
3184
3185         * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
3186         (API::InjectedBundle::EditorClient::replacementURLForResource):
3187         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
3188         * WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h:
3189
3190         Add replacementURLForResource, and also bump the current injected bundle editor client version to 2.
3191
3192         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3193         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
3194         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
3195         (WebKit::InjectedBundlePageEditorClient::replacementURLForResource):
3196         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
3197         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3198         (WebKit::WebEditorClient::replacementURLForResource):
3199         * WebProcess/WebCoreSupport/WebEditorClient.h:
3200
3201 2018-01-17  Zan Dobersek  <zdobersek@igalia.com>
3202
3203         [Cairo] Don't mirror global alpha and image interpolation quality state values in PlatformContextCairo
3204         https://bugs.webkit.org/show_bug.cgi?id=181725
3205
3206         Reviewed by Carlos Garcia Campos.
3207
3208         * Shared/cairo/ShareableBitmapCairo.cpp:
3209         (WebKit::ShareableBitmap::paint):
3210         Adjust the PlatformContextCairo::drawSurfaceToContext() invocation.
3211         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
3212         (WebKit::convertCairoSurfaceToShareableBitmap): Ditto.
3213
3214 2018-01-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3215
3216         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.6 release.
3217
3218         * gtk/NEWS: Add release notes for 2.19.6.
3219
3220 2018-01-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3221
3222         [GTK] Duplicated symbols in libjavascriptcoregtk and libwebkit2gtk can cause crashes in production builds
3223         https://bugs.webkit.org/show_bug.cgi?id=179914
3224
3225         Reviewed by Žan Doberšek.
3226
3227         Add symbols detected by check-for-global-bss-symbols-in-webkigtk-libs to the version script.
3228
3229         * webkitglib-symbols.map:
3230
3231 2018-01-17  Youenn Fablet  <youenn@apple.com>
3232
3233         Clear Caches volatile storage as a memory optimization.
3234         https://bugs.webkit.org/show_bug.cgi?id=181643
3235
3236         Reviewed by Chris Dumez.
3237
3238         clearMemoryRepresentation clears m_caches which exposes data potentially stored in m_volatileStorage.
3239         Clearing m_volatileStorage allows releasing some memory.
3240
3241         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3242         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
3243
3244 2018-01-17  Zan Dobersek  <zdobersek@igalia.com>
3245
3246         [Cairo] Use one-time ShadowBlur objects when performing shadowing
3247         https://bugs.webkit.org/show_bug.cgi?id=181720
3248
3249         Reviewed by Carlos Garcia Campos.
3250
3251         * Shared/cairo/ShareableBitmapCairo.cpp:
3252         (WebKit::ShareableBitmap::paint):
3253         Adjust the PlatformContextCairo::drawSurfaceToContext() invocation.
3254         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
3255         (WebKit::convertCairoSurfaceToShareableBitmap): Ditto.
3256
3257 2018-01-16  Fujii Hironori  <Hironori.Fujii@sony.com>
3258
3259         [CMake] Remove WebCoreDerivedSources library target
3260         https://bugs.webkit.org/show_bug.cgi?id=181664
3261
3262         Reviewed by Carlos Garcia Campos.
3263
3264         * CMakeLists.txt: Do not link WebCoreDerivedSources.
3265         * PlatformGTK.cmake: Appended WebCore after WebCorePlatformGTK in WebKit_LIBRARIES.
3266         * PlatformWin.cmake: Ditto.
3267
3268 2018-01-16  Alex Christensen  <achristensen@webkit.org>
3269
3270         Merge sync and async code paths for getting context menus
3271         https://bugs.webkit.org/show_bug.cgi?id=181423
3272
3273         Reviewed by Joseph Pecoraro.
3274
3275         What a mess.  We had a code path for asynchronous context menu generation and a different one for synchronous context menu generation.
3276         This makes it so there is just one.  At the API level we see if there is an asynchronous delegate to call, then synchronous.
3277         There is a subtle theoretical change in behaviour because m_page.contextMenuClient().showContextMenu is now called for the asynchronous
3278         case and it wasn't before, but the one C API client that uses this has nullptr as it's WKPageShowContextMenuCallback, so we won't break anything!
3279
3280         * UIProcess/API/APIContextMenuClient.h:
3281         (API::ContextMenuClient::getContextMenuFromProposedMenu):
3282         (API::ContextMenuClient::getContextMenuFromProposedMenuAsync): Deleted.
3283         * UIProcess/API/C/WKPage.cpp:
3284         (WKPageSetPageContextMenuClient):
3285         * UIProcess/API/glib/WebKitContextMenuClient.cpp:
3286         * UIProcess/WebContextMenuProxy.h:
3287         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
3288         (WebKit::WebContextMenuProxyGtk::show):
3289         (WebKit::WebContextMenuProxyGtk::showContextMenuWithItems):
3290         * UIProcess/gtk/WebContextMenuProxyGtk.h:
3291         * UIProcess/mac/WebContextMenuProxyMac.h:
3292         * UIProcess/mac/WebContextMenuProxyMac.mm:
3293         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
3294         (WebKit::WebContextMenuProxyMac::showContextMenu):
3295         * UIProcess/wpe/WebContextMenuProxyWPE.h:
3296
3297 2018-01-16  Michael Catanzaro  <mcatanzaro@igalia.com>
3298
3299         Don't link WebKit target directly to JavaScriptCore
3300         https://bugs.webkit.org/show_bug.cgi?id=181688
3301
3302         Reviewed by Alex Christensen.
3303
3304         It's safer if we only link to the next lower-layered lib in the stack, so let's just link
3305         directly to WebCore instead.
3306
3307         And WPE doesn't need to specify it twice.
3308
3309         * CMakeLists.txt:
3310         * PlatformMac.cmake:
3311         * PlatformWPE.cmake:
3312
3313 2018-01-16  Eric Carlson  <eric.carlson@apple.com>
3314
3315         AVSampleBufferDisplayLayer should be flushed when application activates
3316         https://bugs.webkit.org/show_bug.cgi?id=181623
3317         <rdar://problem/36487738>
3318
3319         Reviewed by Darin Adler.
3320
3321         * WebProcess/WebPage/ios/WebPageIOS.mm:
3322         (WebKit::WebPage::applicationWillResignActive): Call page.
3323         (WebKit::WebPage::applicationDidEnterBackground): Ditto, let it call libWebRTCProvider.
3324         (WebKit::WebPage::applicationWillEnterForeground): Call page.
3325         (WebKit::WebPage::applicationDidBecomeActive): Ditto, let it call libWebRTCProvider.
3326
3327 2018-01-16  Zach Li  <zachli@apple.com>
3328
3329         Add pop-up policy support in website policies.
3330         https://bugs.webkit.org/show_bug.cgi?id=181544.
3331         rdar://problem/30521400.
3332
3333         Reviewed by Alex Christensen.
3334
3335         * Shared/WebsitePoliciesData.cpp: Encode and decode
3336         pop-up policy.
3337         (WebKit::WebsitePoliciesData::encode const):
3338         (WebKit::WebsitePoliciesData::decode):
3339         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
3340         Apply the pop-up policy from website policies to the
3341         document loader.
3342
3343         * Shared/WebsitePoliciesData.h:
3344
3345         * Shared/WebsitePopUpPolicy.h:
3346         Added for declaring enum WebsitePopUpPolicy.
3347
3348         * UIProcess/API/APIWforebsitePolicies.cpp:
3349         Include pop-up policy in website policies.
3350         (API::WebsitePolicies::WebsitePolicies):
3351         (API::WebsitePolicies::data):
3352         * UIProcess/API/APIWebsitePolicies.h:
3353
3354         * UIProcess/API/C/WKWebsitePolicies.cpp:
3355         Added C API to get and set pop-up policy on
3356         website policies.
3357         (WKWebsitePoliciesGetPopUpPolicy):
3358         (WKWebsitePoliciesSetPopUpPolicy):
3359         * UIProcess/API/C/WKWebsitePolicies.h:
3360
3361         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
3362         Added Obj-C API to get and set pop-up policy
3363         on website policies.
3364         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
3365         (-[_WKWebsitePolicies setPopUpPolicy:]):
3366         (-[_WKWebsitePolicies popUpPolicy]):
3367
3368         * WebKit.xcodeproj/project.pbxproj:
3369         Added WebsitePopUpPolicy.h.
3370
3371 2018-01-16  Fujii Hironori  <Hironori.Fujii@sony.com>
3372
3373         [CMake][Mac] Fix the build errors
3374         https://bugs.webkit.org/show_bug.cgi?id=181665
3375
3376         Reviewed by Alex Christensen.
3377
3378         * CMakeLists.txt: Added TouchBarMenuData.cpp and TouchBarMenuItemData.cpp to compile.
3379         * PlatformMac.cmake: Added _WKApplicationManifest.mm, WKInspectorWKWebView.mm and WKInspectorWindow.mm to compile.
3380         * UIProcess/API/Cocoa/WKProcessPool.mm:
3381         (-[WKProcessPool _webPageContentProcessCount]): Call WebProcessPool::serviceWorkerProxy() only if ENABLE(SERVICE_WORKER).
3382
3383 2018-01-16  Wenson Hsieh  <wenson_hsieh@apple.com>
3384
3385         [Attachment Support] Provide the `src` of an attachment to the UI delegate when an attachment is inserted
3386         https://bugs.webkit.org/show_bug.cgi?id=181638
3387         <rdar://problem/36508702>
3388
3389         Reviewed by Dan Bernstein.
3390
3391         Add a `source` parameter to the `didInsertAttachment` codepath for notifying WebKit2 clients when attachment
3392         elements are inserted into the document.
3393
3394         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3395         * UIProcess/API/Cocoa/WKWebView.mm:
3396         (-[WKWebView _didInsertAttachment:withSource:]):
3397         (-[WKWebView _didInsertAttachment:]): Deleted.
3398         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3399         * UIProcess/Cocoa/PageClientImplCocoa.h:
3400         * UIProcess/Cocoa/PageClientImplCocoa.mm:
3401         (WebKit::PageClientImplCocoa::didInsertAttachment):
3402         * UIProcess/PageClient.h:
3403         (WebKit::PageClient::didInsertAttachment):
3404         * UIProcess/WebPageProxy.cpp:
3405         (WebKit::WebPageProxy::didInsertAttachment):
3406         * UIProcess/WebPageProxy.h:
3407         * UIProcess/WebPageProxy.messages.in:
3408         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3409         (WebKit::WebEditorClient::didInsertAttachment):
3410         * WebProcess/WebCoreSupport/WebEditorClient.h:
3411
3412 2018-01-15  Youenn Fablet  <youenn@apple.com>
3413
3414         ASSERTION FAILED: m_ptr under WebKit::CacheStorage::Caches::writeRecord
3415         https://bugs.webkit.org/show_bug.cgi?id=181401
3416         <rdar://problem/36379022>
3417
3418         Reviewed by Darin Adler.
3419
3420         m_isInitialized is true but m_storage is set to nullptr when calling writeRecord.
3421         The only case seems to be if:
3422         - We are doing persistent storage
3423         - We are traversing the storage to do the initialization. At that point m_storage is set to a correct value.
3424         - clearMemoryRepresentation is called, thus setting m_storage to nullptr and m_isInitialized to false.
3425         We fix this by making clearMemoryRepresentation a no-op if we are initializing the caches.
3426         clearMemoryRepresentation is about cleaning the in-memory information of the caches and the memory representation is empty at init time.
3427         Nullifying m_storage is a memory consumption optimization.
3428
3429         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3430         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
3431
3432 2018-01-12  Wenson Hsieh  <wenson_hsieh@apple.com>
3433
3434         Unreviewed, speculative build fix after r226899.
3435
3436         Add an empty implementation for PageClient::startDrag.
3437
3438         * UIProcess/PageClient.h:
3439         (WebKit::PageClient::startDrag):
3440
3441 2018-01-12  Brent Fulgham  <bfulgham@apple.com>
3442
3443         [iOS] Remove unneeded accessibility-related sandbox rules
3444         https://bugs.webkit.org/show_bug.cgi?id=181619
3445         <rdar://problem/36485356>
3446
3447         Reviewed by Eric Carlson.
3448
3449         Remove a number of sandbox exceptions that were in place for accessibility support. These are
3450         not needed in the WebContent process, since Safari (not WebKit) handles the accessibility
3451         interactions.
3452
3453         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3454
3455 2018-01-12  Keith Rollin  <krollin@apple.com>
3456
3457         Logged JSON should escape "'s and \'s in strings.
3458         https://bugs.webkit.org/show_bug.cgi?id=181608
3459
3460         Reviewed by Brent Fulgham.
3461
3462         * NetworkProcess/NetworkResourceLoader.cpp:
3463         (WebKit::NetworkResourceLoader::logCookieInformation const):
3464
3465 2018-01-12  Megan Gardner  <megan_gardner@apple.com>
3466
3467         Unreviewed, fixing error in UIKitSPI.h.
3468
3469         * Platform/spi/ios/UIKitSPI.h:
3470         
3471 2018-01-12  Megan Gardner  <megan_gardner@apple.com>
3472
3473         Implement MultiDocument protocol for restoring focus to a WKWebView
3474         https://bugs.webkit.org/show_bug.cgi?id=181510
3475
3476         Reviewed by Dan Bernstein.
3477
3478         Support the UIKit protocol for restoring focus to a what previously had focus.
3479         WebKit already knows what node was previously being focused by the DOM, we merely
3480         need to be asked to turn the focus on again.
3481         Resubmitting https://trac.webkit.org/changeset/226826 as it broke internal builds
3482
3483         * Platform/spi/ios/UIKitSPI.h:
3484         * UIProcess/ios/WKContentViewInteraction.h:
3485         * UIProcess/ios/WKContentViewInteraction.mm:
3486         (-[WKContentView _restoreFocusWithToken:]):
3487         (-[WKContentView _preserveFocusWithToken:destructively:]):