Clean out unused selection items from UIKitSPI
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2017-11-09  Megan Gardner  <megan_gardner@apple.com>
2
3         Clean out unused selection items from UIKitSPI
4         https://bugs.webkit.org/show_bug.cgi?id=179459
5
6         Reviewed by Tim Horton.
7
8         Many of these should have been removed from previous commits, but they were missed.
9         None of these enums or methods are being used by WebKit anymore, and removing them will keep things
10         clean and allow UIKit to remove things that are not used at all by anyone anymore.
11
12         * Platform/spi/ios/UIKitSPI.h:
13
14 2017-11-09  Christopher Reid  <chris.reid@sony.com>
15
16         Use enum classes within FileSystem
17         https://bugs.webkit.org/show_bug.cgi?id=175172
18
19         Reviewed by Darin Adler.
20
21         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
22         * NetworkProcess/NetworkDataTaskBlob.cpp:
23         * NetworkProcess/cache/NetworkCache.cpp:
24         * NetworkProcess/capture/NetworkCaptureManager.cpp:
25         * NetworkProcess/capture/NetworkCaptureRecorder.cpp:
26         * Shared/WebMemorySampler.cpp:
27         * UIProcess/API/APIContentRuleListStore.cpp:
28         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
29
30 2017-11-09  Youenn Fablet  <youenn@apple.com>
31
32         ServiceWorkerClientFetch should create not null ResourceError
33         https://bugs.webkit.org/show_bug.cgi?id=179485
34
35         Reviewed by Darin Adler.
36
37         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
38         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
39
40 2017-11-09  Andy Estes  <aestes@apple.com>
41
42         [iOS] Adopt UIPreviewDataAttachmentListIsContentManaged
43         https://bugs.webkit.org/show_bug.cgi?id=179458
44         <rdar://problem/35034691>
45
46         Reviewed by Dan Bernstein.
47
48         * Platform/spi/ios/UIKitSPI.h:
49         * UIProcess/ios/WKContentViewInteraction.mm:
50         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
51
52 2017-11-08  Joseph Pecoraro  <pecoraro@apple.com>
53
54         Include a more complete block signature in public headers to avoid potential -Wstrict-prototypes warnings
55         https://bugs.webkit.org/show_bug.cgi?id=179466
56
57         Reviewed by Dan Bernstein.
58
59         * UIProcess/API/Cocoa/WKHTTPCookieStore.h:
60         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
61         (-[WKHTTPCookieStore setCookie:completionHandler:]):
62         (-[WKHTTPCookieStore deleteCookie:completionHandler:]):
63
64 2017-11-08  Jeremy Jones  <jeremyj@apple.com>
65
66         Make WKFullScreenWidnowController more robust against modification by the embedding app.
67         https://bugs.webkit.org/show_bug.cgi?id=179413
68         rdar://problem/35408061
69
70         Reviewed by Darin Adler.
71
72         Present fullscreen UViewController in a separate UIWindow to prevent interaction with the embedding app's
73         UIViewController hierarchy.
74
75         Immediately tear down the fullscreen interface if the embedding app removes the WKWebView from the fullscreen window.
76         This prevents the fullscreen interface from getting into an invalid state.
77
78         Preserve scrollView.zoomScale because it is not effectively preserved by the more indirect _viewScale.
79
80         Use a custom root view controller to allow hiding of the status bar.
81
82         Remove the no-longer-necessary dispatch_after calls during enter and exit fullscreen.
83
84         * UIProcess/API/Cocoa/WKWebView.mm:
85         (-[WKWebView removeFromSuperview]):
86         * UIProcess/ios/WKFullScreenWindowControllerIOS.h:
87         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
88         (WebKit::WKWebViewState::applyTo):
89         (WebKit::WKWebViewState::store):
90         (-[_WKFullScreenViewController loadView]):
91         (-[_WKFullscreenRootViewController prefersStatusBarHidden]):
92         (-[WKFullScreenWindowController enterFullScreen]):
93         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
94         (-[WKFullScreenWindowController completedExitFullScreen]):
95         (-[WKFullScreenWindowController exitFullscreenImmediately]):
96         (-[WKFullScreenWindowController close]):
97         (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
98         (-[_WKFullScreenViewController viewDidDisappear:]): Deleted.
99
100 2017-11-08  Jeremy Jones  <jeremyj@apple.com>
101
102         HTMLMediaElement should not use element fullscreen on iOS
103         https://bugs.webkit.org/show_bug.cgi?id=179418
104         rdar://problem/35409277
105
106         Reviewed by Eric Carlson.
107
108         Add ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN to determine if HTMLMediaElement should use element full screen or not.
109
110         * Configurations/FeatureDefines.xcconfig:
111
112 2017-11-08  Wenson Hsieh  <wenson_hsieh@apple.com>
113
114         [Attachment Support] Implement delegate hooks for attachment element insertion and removal
115         https://bugs.webkit.org/show_bug.cgi?id=179016
116         <rdar://problem/35250890>
117
118         Reviewed by Tim Horton.
119
120         See WebCore/ChangeLog for more details.
121
122         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
123         * UIProcess/API/Cocoa/WKWebView.mm:
124         (-[WKWebView _didInsertAttachment:]):
125         (-[WKWebView _didRemoveAttachment:]):
126         * UIProcess/API/Cocoa/WKWebViewInternal.h:
127         * UIProcess/Cocoa/PageClientImplCocoa.h:
128         * UIProcess/Cocoa/PageClientImplCocoa.mm:
129         (WebKit::PageClientImplCocoa::didInsertAttachment):
130         (WebKit::PageClientImplCocoa::didRemoveAttachment):
131         * UIProcess/PageClient.h:
132         (WebKit::PageClient::didInsertAttachment):
133         (WebKit::PageClient::didRemoveAttachment):
134         * UIProcess/WebPageProxy.cpp:
135         (WebKit::WebPageProxy::didInsertAttachment):
136         (WebKit::WebPageProxy::didRemoveAttachment):
137         * UIProcess/WebPageProxy.h:
138         * UIProcess/WebPageProxy.messages.in:
139         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
140         (WebKit::WebEditorClient::didInsertAttachment):
141         (WebKit::WebEditorClient::didRemoveAttachment):
142         * WebProcess/WebCoreSupport/WebEditorClient.h:
143
144 2017-11-08  Carlos Garcia Campos  <cgarcia@igalia.com>
145
146         REGRESSION(r223773): [GTK] WebKitWebInspector bring-to-front signal is emitted right after open-window
147         https://bugs.webkit.org/show_bug.cgi?id=179365
148
149         Reviewed by Michael Catanzaro.
150
151         In the GTK+ API, open-window already implies presenting the window to bring it to the front, so it's not
152         expected that bring-to-front is emitted on open. This is happening since r223773 that moved common code from
153         platform specific inspector files to the main file, but in the case of open the mac implementation was not
154         exactly the same as the GTK+ one. This broke /webkit2/WebKitWebInspector/default and
155         /webkit2/WebKitWebInspector/manual-attach-detach.
156
157         * UIProcess/WebInspectorProxy.cpp:
158         (WebKit::WebInspectorProxy::open): Set m_isOpening for the scope of the function.
159         * UIProcess/WebInspectorProxy.h: Add m_isOpening.
160         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
161         (WebKit::WebInspectorProxy::platformBringToFront): Return early if m_isOpening is true.
162
163 2017-11-07  Carlos Garcia Campos  <cgarcia@igalia.com>
164
165         REGRESSION(r224179): [GTK] Several WebViewEditor tests are failing since r224179
166         https://bugs.webkit.org/show_bug.cgi?id=179366
167
168         Reviewed by Michael Catanzaro.
169
170         In r224179, webkit_web_view_can_execute_editing_command() was optimized to use the sync path for commands
171         supported by the WebViewEditorState, but the state requires a redraw to be up to date. We can't know if
172         WebViewEditorState is in sync, when webkit_web_view_can_execute_editing_command() is called, so we always need
173         to ask the web process.
174
175         * UIProcess/API/glib/WebKitWebView.cpp:
176         (webkit_web_view_can_execute_editing_command):
177
178 2017-11-07  Carlos Garcia Campos  <cgarcia@igalia.com>
179
180         [GTK][WPE] Build inspector resources using copy-user-interface-resources.pl script
181         https://bugs.webkit.org/show_bug.cgi?id=179317
182
183         Reviewed by Michael Catanzaro.
184
185         This is the script used by Apple and it has several advantages:
186
187           - It allows to combine and minify most of the js and css files, which improves performance and binary size.
188           - It removes the debug resources and assertions in production builds.
189           - It allows to remove the test resources in production builds.
190
191         The patch also moves the common cmake code to generate the resources to a new file InspectorGResources.cmake included
192         by GTK+ and WPE platform cmake files.
193
194         * InspectorGResources.cmake: Added.
195         * PlatformGTK.cmake:
196         * PlatformWPE.cmake:
197
198 2017-11-07  Jeremy Jones  <jeremyj@apple.com>
199
200         Add downcast support for FullscreenClient.
201         https://bugs.webkit.org/show_bug.cgi?id=178824
202
203         Reviewed by Simon Fraser.
204
205         Add SPECIALIZE_TYPE_TRAITS macros for API::FullscreenClient and WebKit::Fullscreen client so 
206         downcasts can be done safely.
207
208         * UIProcess/API/APIFullscreenClient.h:
209         (API::FullscreenClient::isType const):
210         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
211         (WKPageSetFullscreenDelegate):
212         (WKPageGetFullscreenDelegate):
213         * UIProcess/API/Cocoa/WKWebView.mm:
214         (-[WKWebView _setFullscreenDelegate:]):
215         (-[WKWebView _fullscreenDelegate]):
216         * UIProcess/Cocoa/FullscreenClient.h:
217         (isType):
218         * UIProcess/Cocoa/FullscreenClient.mm:
219
220 2017-11-07  Brady Eidson  <beidson@apple.com>
221
222         Implement "UpdateWorkerState" and use it
223         https://bugs.webkit.org/show_bug.cgi?id=179318
224
225         Reviewed by Chris Dumez.
226
227         * Scripts/webkit/messages.py:
228         (headers_for_type):
229         * Shared/WebCoreArgumentCoders.h:
230  
231        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
232         (WebKit::WebSWServerConnection::updateWorkerStateInClient):
233         (WebKit::WebSWServerConnection::installServiceWorkerContext):
234         (WebKit::WebSWServerConnection::setContextConnection):
235         (WebKit::WebSWServerConnection::updateServiceWorkerContext): Deleted.
236         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
237
238         * WebProcess/Storage/WebSWClientConnection.messages.in:
239
240         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
241         (WebKit::WebSWContextManagerConnection::installServiceWorker):
242         (WebKit::WebSWContextManagerConnection::updateServiceWorker): Deleted.
243         * WebProcess/Storage/WebSWContextManagerConnection.h:
244         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
245
246 2017-11-07  Commit Queue  <commit-queue@webkit.org>
247
248         Unreviewed, rolling out r224512 and r224521.
249         https://bugs.webkit.org/show_bug.cgi?id=179388
250
251         An API test added with this change is failing an assertion on
252         the bots. (Requested by ryanhaddad on #webkit).
253
254         Reverted changesets:
255
256         "[Attachment Support] Implement delegate hooks for attachment
257         element insertion and removal"
258         https://bugs.webkit.org/show_bug.cgi?id=179016
259         https://trac.webkit.org/changeset/224512
260
261         "Remove stray logging from a newly added API test"
262         https://trac.webkit.org/changeset/224521
263
264 2017-11-07  Chris Dumez  <cdumez@apple.com>
265
266         [Service Workers] Add support for "install" event
267         https://bugs.webkit.org/show_bug.cgi?id=179338
268
269         Reviewed by Youenn Fablet.
270
271         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
272         (WebKit::WebSWServerConnection::firePostInstallEvents):
273         (WebKit::WebSWServerConnection::fireInstallEvent):
274         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
275         * StorageProcess/StorageProcess.cpp:
276         (WebKit::StorageProcess::didFinishServiceWorkerInstall):
277         * StorageProcess/StorageProcess.h:
278         * StorageProcess/StorageProcess.messages.in:
279         * WebProcess/Storage/WebSWClientConnection.messages.in:
280         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
281         (WebKit::WebSWContextManagerConnection::fireInstallEvent):
282         (WebKit::WebSWContextManagerConnection::didFinishInstall):
283         * WebProcess/Storage/WebSWContextManagerConnection.h:
284         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
285
286 2017-11-07  Youenn Fablet  <youenn@apple.com>
287
288         Support the case of fetch events that are not responded
289         https://bugs.webkit.org/show_bug.cgi?id=179336
290
291         Reviewed by Chris Dumez.
292
293         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
294         (WebKit::WebServiceWorkerFetchTaskClient::didNotHandle):
295         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
296
297 2017-11-06  Alex Christensen  <achristensen@webkit.org>
298
299         Make ResourceLoader::willSendRequestInternal asynchronous
300         https://bugs.webkit.org/show_bug.cgi?id=179251
301
302         Reviewed by Andy Estes.
303
304         * WebProcess/Network/WebLoaderStrategy.cpp:
305         (WebKit::WebLoaderStrategy::loadResource):
306         (WebKit::WebLoaderStrategy::schedulePluginStreamLoad):
307         * WebProcess/Network/WebLoaderStrategy.h:
308         * WebProcess/Plugins/PluginView.cpp:
309         (WebKit::PluginView::Stream::start):
310
311 2017-11-06  Wenson Hsieh  <wenson_hsieh@apple.com>
312
313         [Attachment Support] Implement delegate hooks for attachment element insertion and removal
314         https://bugs.webkit.org/show_bug.cgi?id=179016
315         <rdar://problem/35250890>
316
317         Reviewed by Tim Horton.
318
319         Adds boilerplate plumbing to WebEditorClient, WebPage, and the usual machinery in the UI process to notify
320         WebKit2 clients when attachment elements have been inserted or removed from the document. See the WebCore
321         ChangeLog for more details about the implementation, or the Tools ChangeLog for more information about new API
322         tests.
323
324         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
325         * UIProcess/API/Cocoa/WKWebView.mm:
326         (-[WKWebView _didInsertAttachment:]):
327         (-[WKWebView _didRemoveAttachment:]):
328         * UIProcess/API/Cocoa/WKWebViewInternal.h:
329         * UIProcess/Cocoa/PageClientImplCocoa.h:
330         * UIProcess/Cocoa/PageClientImplCocoa.mm:
331         (WebKit::PageClientImplCocoa::didInsertAttachment):
332         (WebKit::PageClientImplCocoa::didRemoveAttachment):
333         * UIProcess/PageClient.h:
334         (WebKit::PageClient::didInsertAttachment):
335         (WebKit::PageClient::didRemoveAttachment):
336         * UIProcess/WebPageProxy.cpp:
337         (WebKit::WebPageProxy::didInsertAttachment):
338         (WebKit::WebPageProxy::didRemoveAttachment):
339         * UIProcess/WebPageProxy.h:
340         * UIProcess/WebPageProxy.messages.in:
341         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
342         (WebKit::WebEditorClient::didInsertAttachment):
343         (WebKit::WebEditorClient::didRemoveAttachment):
344         * WebProcess/WebCoreSupport/WebEditorClient.h:
345
346 2017-11-06  Jeremy Jones  <jeremyj@apple.com>
347
348         iOS element fullscreen should use a UIGestureRecognizer to detect user interaction.
349         https://bugs.webkit.org/show_bug.cgi?id=179029
350         rdar://problem/35307882
351
352         Reviewed by Simon Fraser.
353
354         Replace _WKTapDelegatingView with a UILongPressGestureRecognizer. When set with a duration of 0, it effectively
355         recognizes UITouchBegin events.
356
357         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
358         (-[_WKFullScreenViewController loadView]):
359         (-[_WKFullScreenViewController gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
360         (-[_WKTapDelegatingView setTarget:action:]): Deleted.
361         (-[_WKTapDelegatingView hitTest:withEvent:]): Deleted.
362
363 2017-11-06  Chris Dumez  <cdumez@apple.com>
364
365         [Service Workers] Add proper implementation for 'updatefound' event
366         https://bugs.webkit.org/show_bug.cgi?id=179302
367
368         Reviewed by Brady Eidson.
369
370         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
371         (WebKit::WebSWServerConnection::fireUpdateFoundEvent):
372         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
373         * WebProcess/Storage/WebSWClientConnection.messages.in:
374
375 2017-11-06  Christopher Reid  <chris.reid@sony.com>
376
377         Use enum classes within FileSystem
378         https://bugs.webkit.org/show_bug.cgi?id=175172
379
380         Reviewed by Myles C. Maxfield.
381
382         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
383         * NetworkProcess/NetworkDataTaskBlob.cpp:
384         * NetworkProcess/cache/NetworkCache.cpp:
385         * NetworkProcess/capture/NetworkCaptureManager.cpp:
386         * NetworkProcess/capture/NetworkCaptureRecorder.cpp:
387         * Shared/WebMemorySampler.cpp:
388         * UIProcess/API/APIContentRuleListStore.cpp:
389         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
390
391 2017-11-06  Michael Catanzaro  <mcatanzaro@igalia.com>
392
393         [WPE] Properly use SYSTEM_INCLUDE_DIRECTORIES for WebKit build target
394         https://bugs.webkit.org/show_bug.cgi?id=179097
395
396         Reviewed by Žan Doberšek.
397
398         * PlatformWPE.cmake:
399
400 2017-11-05  Yusuke Suzuki  <utatane.tea@gmail.com>
401
402         JIT call inline caches should cache calls to objects with getCallData/getConstructData traps
403         https://bugs.webkit.org/show_bug.cgi?id=144458
404
405         Reviewed by Saam Barati.
406
407         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
408         (WebKit::JSNPMethod::JSNPMethod):
409         (WebKit::JSNPMethod::getCallData): Deleted.
410         * WebProcess/Plugins/Netscape/JSNPMethod.h:
411         (WebKit::JSNPMethod::createStructure):
412
413 2017-11-04  Chris Dumez  <cdumez@apple.com>
414
415         REGRESSION(r223718): Leaking WebProcessPool after reconfiguration
416         https://bugs.webkit.org/show_bug.cgi?id=179123
417         <rdar://problem/35294685>
418
419         Reviewed by Geoff Garen.
420
421         Make sure we destroy the ServiceWorker WebProcess once all other WebProcesses
422         go away at there is no use keeping it running at this point. Also, this prevents
423         leaking the WebProcessPool since the WebProcessProxy holds a strong reference
424         to the WebProcessPool.
425
426         * UIProcess/WebProcessPool.cpp:
427         (WebKit::WebProcessPool::disconnectProcess):
428
429 2017-11-01  Darin Adler  <darin@apple.com>
430
431         Simplify event dispatch code and make it a bit more consistent
432         https://bugs.webkit.org/show_bug.cgi?id=178991
433
434         Reviewed by Chris Dumez.
435
436         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
437         (webkit_dom_event_get_src_element): Call target instead of srcElement.
438
439 2017-11-04  Aishwarya Nirmal  <anirmal@apple.com>
440
441         [Touch Bar Web API] Add support for menuitem tag
442         https://bugs.webkit.org/show_bug.cgi?id=179020
443
444         Reviewed by Ryosuke Niwa.
445
446         Adds in the MenuItemElementEnabled flag so that the menu item element is a runtime-
447         enabled feature. It has a default value of false.
448
449         * Shared/WebPreferences.yaml:
450         * UIProcess/API/C/WKPreferences.cpp:
451         (WKPreferencesSetMenuItemElementEnabled):
452         (WKPreferencesGetMenuItemElementEnabled):
453         * UIProcess/API/C/WKPreferencesRefPrivate.h:
454
455 2017-11-03  Chris Dumez  <cdumez@apple.com>
456
457         Unreviewed, rolling out r224438.
458
459         Has caused assertions on the bots
460
461         Reverted changeset:
462
463         "REGRESSION(r223718): Leaking WebProcessPool after
464         reconfiguration"
465         https://bugs.webkit.org/show_bug.cgi?id=179123
466         https://trac.webkit.org/changeset/224438
467
468 2017-11-03  Youenn Fablet  <youenn@apple.com>
469
470         Requests handled by Service Worker should not go through preflighting
471         https://bugs.webkit.org/show_bug.cgi?id=179250
472
473         Reviewed by Alex Christensen.
474
475         * WebProcess/Network/WebLoaderStrategy.cpp:
476         (WebKit::WebLoaderStrategy::scheduleLoad):
477         * WebProcess/Storage/WebSWClientConnection.cpp:
478         (WebKit::WebSWClientConnection::startFetch):
479         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
480         (WebKit::shouldHandleFetch):
481
482 2017-11-03  Chris Dumez  <cdumez@apple.com>
483
484         REGRESSION(r223718): Leaking WebProcessPool after reconfiguration
485         https://bugs.webkit.org/show_bug.cgi?id=179123
486         <rdar://problem/35294685>
487
488         Reviewed by Geoffrey Garen.
489
490         Make sure we destroy the ServiceWorker WebProcess once all other WebProcesses
491         go away at there is no use keeping it running at this point. Also, this prevents
492         leaking the WebProcessPool since the WebProcessProxy holds a strong reference
493         to the WebProcessPool.
494
495         * UIProcess/WebProcessPool.cpp:
496         (WebKit::WebProcessPool::disconnectProcess):
497
498 2017-11-03  Youenn Fablet  <youenn@apple.com>
499
500         Implement Service Worker Matching Registration algorithm
501         https://bugs.webkit.org/show_bug.cgi?id=178882
502
503         Reviewed by Chris Dumez.
504
505         Added IPC plumbery for matchRegistration request and response.
506         Added some limited clearing of workers and registrations.
507
508         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
509         (WebKit::WebSWServerConnection::matchRegistration):
510         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
511         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
512         * StorageProcess/StorageProcess.cpp:
513         (WebKit::StorageProcess::deleteWebsiteData):
514         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
515         * WebProcess/Storage/WebSWClientConnection.cpp:
516         (WebKit::WebSWClientConnection::didMatchRegistration):
517         (WebKit::WebSWClientConnection::matchRegistration):
518         * WebProcess/Storage/WebSWClientConnection.h:
519         * WebProcess/Storage/WebSWClientConnection.messages.in:
520         * WebProcess/Storage/WebServiceWorkerProvider.h:
521
522 2017-11-03  Jeremy Jones  <jeremyj@apple.com>
523
524         Element fullscreen should use FloatRects instead of IntRects in beganEnterFullScreenWithInitialFrame
525         https://bugs.webkit.org/show_bug.cgi?id=179033
526         rdar://problem/35309279
527         
528         Reviewed by Darin Adler.
529
530         Screen coordinates are floats, so use NSRect instead of IntRect on Mac.
531
532         * UIProcess/mac/WKFullScreenWindowController.h:
533         * UIProcess/mac/WKFullScreenWindowController.mm:
534         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
535         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
536
537 2017-11-03  Chris Dumez  <cdumez@apple.com>
538
539         Use a single identifier type to identify Service Workers
540         https://bugs.webkit.org/show_bug.cgi?id=179192
541
542         Reviewed by Brady Eidson.
543
544         Use a single identifier type to identify Service Workers. We had both a String
545         identifier and a uint64_t identifier for each service worker. We now consistently
546         use a ServiceWorkerIdentifier which is a strongly typed identifier backed by a
547         uint64_t.
548
549         * Scripts/webkit/messages.py:
550         (forward_declarations_and_headers):
551         (forward_declarations_and_headers.templates):
552         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
553         (WebKit::WebSWServerConnection::startFetch):
554         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
555         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
556         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
557         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
558         * StorageProcess/StorageProcess.cpp:
559         (WebKit::StorageProcess::serviceWorkerContextFailedToStart):
560         (WebKit::StorageProcess::serviceWorkerContextStarted):
561         (WebKit::StorageProcess::postMessageToServiceWorkerClient):
562         * StorageProcess/StorageProcess.h:
563         * StorageProcess/StorageProcess.messages.in:
564         * WebProcess/Storage/WebSWClientConnection.cpp:
565         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
566         (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
567         * WebProcess/Storage/WebSWClientConnection.h:
568         * WebProcess/Storage/WebSWClientConnection.messages.in:
569         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
570         (WebKit::WebSWContextManagerConnection::updateServiceWorker):
571         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
572         (WebKit::WebSWContextManagerConnection::startFetch):
573         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
574         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
575         * WebProcess/Storage/WebSWContextManagerConnection.h:
576         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
577
578 2017-11-03  Antti Koivisto  <antti@apple.com>
579
580         Enable display:contents by default as experimental feature
581         https://bugs.webkit.org/show_bug.cgi?id=179239
582         <rdar://problem/35334612>
583
584         Reviewed by Darin Adler.
585
586         We pass most of the WPT tests. What remains is mostly flexbox related edge cases.
587
588         * Shared/WebPreferences.yaml:
589
590 2017-11-03  Frederic Wang  <fwang@igalia.com>
591
592         Use WK_IOS_TBA instead of WK_MAC_TBA to indicate availability of private functions on iOS
593         https://bugs.webkit.org/show_bug.cgi?id=179238
594
595         Reviewed by Darin Adler.
596
597         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
598         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
599
600 2017-11-02  Maciej Stachowiak  <mjs@apple.com>
601
602         Don't try to guess plugin MIME type from a file extension in a URL (no observable effect)
603         https://bugs.webkit.org/show_bug.cgi?id=178333
604
605         Reviewed by Darin Adler.
606
607         * WebProcess/Plugins/PluginView.cpp:
608         (WebKit::PluginView::pluginDidReceiveUserInteraction): loadedMIMEType --> serviceType
609         * WebProcess/WebPage/WebPage.cpp:
610         (WebKit::WebPage::determinePrimarySnapshottedPlugIn): ditto
611
612 2017-11-02  Brady Eidson  <beidson@apple.com>
613
614         SW: Implement "Update Registration State" algorithm (unused for now)
615         https://bugs.webkit.org/show_bug.cgi?id=179186
616
617         Reviewed by Chris Dumez.
618
619         * Scripts/webkit/messages.py:
620         (headers_for_type):
621
622         * Shared/WebCoreArgumentCoders.h:
623
624         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
625         (WebKit::WebSWServerConnection::updateRegistrationStateInClient):
626         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
627         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
628
629         * WebProcess/Storage/WebSWClientConnection.cpp:
630         (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer):
631         (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):
632         * WebProcess/Storage/WebSWClientConnection.h:
633         * WebProcess/Storage/WebSWClientConnection.messages.in:
634
635 2017-11-02  Alex Christensen  <achristensen@webkit.org>
636
637         Use CompletionHandlers for redirects
638         https://bugs.webkit.org/show_bug.cgi?id=179163
639
640         Reviewed by Tim Horton.
641
642         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
643         (WebKit::BlobDownloadClient::willSendRequestAsync):
644         * NetworkProcess/Downloads/BlobDownloadClient.h:
645         * NetworkProcess/NetworkDataTask.h:
646         * NetworkProcess/NetworkLoad.cpp:
647         (WebKit::NetworkLoad::~NetworkLoad):
648         (WebKit::NetworkLoad::continueWillSendRequest):
649         (WebKit::NetworkLoad::willSendRequestAsync):
650         * NetworkProcess/NetworkLoad.h:
651         * NetworkProcess/NetworkLoadClient.h:
652         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
653         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
654         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
655         * UIProcess/API/APIDownloadClient.h:
656         (API::DownloadClient::willSendRequest):
657         * UIProcess/API/C/WKContext.cpp:
658         (WKContextSetDownloadClient):
659         * UIProcess/Cocoa/DownloadClient.h:
660         * UIProcess/Cocoa/DownloadClient.mm:
661         (WebKit::DownloadClient::willSendRequest):
662         * WebProcess/Network/WebResourceLoader.cpp:
663         (WebKit::WebResourceLoader::willSendRequest):
664         * WebProcess/Plugins/PluginView.cpp:
665         (WebKit::PluginView::Stream::~Stream):
666         (WebKit::PluginView::Stream::continueLoad):
667         (WebKit::PluginView::Stream::willSendRequest):
668         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
669
670 2017-11-02  Christopher Reid  <chris.reid@sony.com>
671
672         Add a FileSystem namespace to FileSystem.cpp
673         https://bugs.webkit.org/show_bug.cgi?id=179063
674
675         Reviewed by Darin Adler.
676
677         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
678         * NetworkProcess/Downloads/BlobDownloadClient.h:
679         * NetworkProcess/NetworkDataTaskBlob.cpp:
680         * NetworkProcess/NetworkDataTaskBlob.h:
681         * NetworkProcess/NetworkProcess.cpp:
682         * NetworkProcess/cache/CacheStorageEngine.cpp:
683         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
684         * NetworkProcess/cache/NetworkCache.cpp:
685         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
686         * NetworkProcess/cache/NetworkCacheData.cpp:
687         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
688         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
689         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
690         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
691         * NetworkProcess/cache/NetworkCacheStorage.cpp:
692         * NetworkProcess/capture/NetworkCaptureManager.cpp:
693         * NetworkProcess/capture/NetworkCaptureManager.h:
694         * NetworkProcess/capture/NetworkCaptureRecorder.cpp:
695         * NetworkProcess/capture/NetworkCaptureResource.h:
696         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
697         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
698         * NetworkProcess/soup/NetworkProcessSoup.cpp:
699         * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
700         * Shared/Plugins/unix/PluginSearchPath.cpp:
701         * Shared/WebMemorySampler.cpp:
702         * Shared/WebMemorySampler.h:
703         * Shared/gtk/ProcessExecutablePathGtk.cpp:
704         * Shared/ios/ChildProcessIOS.mm:
705         * Shared/mac/ChildProcessMac.mm:
706         * Shared/mac/SandboxExtensionMac.mm:
707         * Shared/wpe/ProcessExecutablePathWPE.cpp:
708         * StorageProcess/StorageProcess.cpp:
709         * UIProcess/API/APIContentRuleListStore.cpp:
710         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
711         * UIProcess/API/glib/IconDatabase.cpp:
712         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
713         * UIProcess/API/glib/WebKitFileChooserRequest.cpp:
714         * UIProcess/API/glib/WebKitWebContext.cpp:
715         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
716         * UIProcess/Automation/WebAutomationSession.cpp:
717         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
718         * UIProcess/Cocoa/WebViewImpl.mm:
719         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
720         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
721         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
722         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
723         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
724         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
725         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
726         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
727         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
728         * UIProcess/gtk/WebProcessPoolGtk.cpp:
729         * UIProcess/mac/WebPageProxyMac.mm:
730         * UIProcess/wpe/WebProcessPoolWPE.cpp:
731         * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp:
732         * WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp:
733         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
734         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
735         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
736         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
737
738 2017-11-02  Joseph Pecoraro  <pecoraro@apple.com>
739
740         Make ServiceWorker a Remote Inspector debuggable target
741         https://bugs.webkit.org/show_bug.cgi?id=179043
742         <rdar://problem/34126008>
743
744         Reviewed by Brian Burg.
745
746         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
747         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
748         (debuggableTypeString):
749         Provide a way to start a Remote Web Inspector frontend for a ServiceWorker target type.
750
751 2017-11-02  Ryan Haddad  <ryanhaddad@apple.com>
752
753         Unreviewed, rolling out r224353.
754
755         Breaks internal builds.
756
757         Reverted changeset:
758
759         "Ignore HSTS for partitioned, cross-origin subresource
760         requests"
761         https://bugs.webkit.org/show_bug.cgi?id=178993
762         https://trac.webkit.org/changeset/224353
763
764 2017-11-02  John Wilander  <wilander@apple.com>
765
766         Ignore HSTS for partitioned, cross-origin subresource requests
767         https://bugs.webkit.org/show_bug.cgi?id=178993
768         <rdar://problem/34962462>
769
770         Reviewed by Brent Fulgham and Alex Christensen.
771
772         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
773         (downgradeRequest):
774             Convenience function to downgrade a request if
775             CFNetwork as already upgraded it during
776             canonicalization. This allows the rest of 
777             WebKit's processing to function, such as UIR
778             and mixed content blocking.
779         (updateIgnoreStrictTransportSecuritySettingIfNecessary):
780             Adds and removed the ignore request accordingly.
781         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
782             Now asks CFNetwork to ignore HSTS on resource loads we
783             partition cookies for.
784         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
785             Now asks CFNetwork to ignore HSTS on resource loads we
786             partition cookies for.
787
788 2017-11-02  Yousuke Kimoto  <yousuke.kimoto@sony.com>
789
790         [WinCairo] Add IPC files for wincairo webkit
791         https://bugs.webkit.org/show_bug.cgi?id=177919
792
793         Reviewed by Alex Christensen.
794
795         * Platform/IPC/Attachment.cpp:
796         * Platform/IPC/Attachment.h:
797         (IPC::Attachment::Attachment):
798         (IPC::Attachment::handle):
799         * Platform/IPC/Connection.h:
800         (IPC::Connection::identifierIsNull):
801         (IPC::Connection::sendWithReply):
802         * Platform/IPC/win/AttachmentWin.cpp: Added.
803         (IPC::Attachment::encode const):
804         (IPC::getDuplicatedHandle):
805         (IPC::Attachment::decode):
806         * Platform/IPC/win/ConnectionWin.cpp: Added.
807         (IPC::Connection::createServerAndClientIdentifiers):
808         (IPC::Connection::platformInitialize):
809         (IPC::Connection::platformInvalidate):
810         (IPC::Connection::readEventHandler):
811         (IPC::Connection::writeEventHandler):
812         (IPC::Connection::open):
813         (IPC::Connection::platformCanSendOutgoingMessages const):
814         (IPC::Connection::sendOutgoingMessage):
815         (IPC::Connection::willSendSyncMessage):
816         (IPC::Connection::didReceiveSyncReply):
817         * PlatformWin.cmake:
818
819 2017-11-02  Megan Gardner  <megan_gardner@apple.com>
820
821         Early out selection update when data is not present
822         https://bugs.webkit.org/show_bug.cgi?id=179084
823
824         Reviewed by Ryosuke Niwa.
825
826         We should early out of a selection update when we do not have the data that is necessary to make that
827         update. This mostly helps avoid debug asserts, but will be helpful with the selection changes that are
828         ongoing.
829
830         * UIProcess/ios/WKContentViewInteraction.mm:
831         (-[WKContentView _updateChangedSelection:]):
832
833 2017-11-02  Eric Carlson  <eric.carlson@apple.com>
834
835         [MediaStream] audioTrack.label is always empty on macOS
836         https://bugs.webkit.org/show_bug.cgi?id=179175
837         <rdar://problem/35315438>
838
839         Reviewed by Youenn Fablet.
840
841         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
842         (WebKit::UserMediaCaptureManager::createCaptureSource): Pass settings.label to Source constructor.
843
844 2017-11-02  Frederic Wang  <fwang@igalia.com>
845
846         Add references to bug 179167 in FIXME comments
847         https://bugs.webkit.org/show_bug.cgi?id=179168
848
849         Reviewed by Daniel Bates.
850
851         * Configurations/FeatureDefines.xcconfig:
852
853 2017-11-01  Jeremy Jones  <jeremyj@apple.com>
854
855         Implement WKFullscreenWindowController for iOS.
856         https://bugs.webkit.org/show_bug.cgi?id=178924
857         rdar://problem/34697120
858
859         Reviewed by Simon Fraser.
860
861         Plumb relevant calls through WKWebView and PageClientImplIOS.
862
863         This forms the base implementation for element fullscreen. This will animate an element into fullscreen and back to inline.
864         It does this by replacing the WKWebView with a placeholder image and presenting the WKWebView with a fullscreen view controller.
865         This also attempts to preserve UI state of the WKWebView when it is placed back inline.
866
867         To enable _WKFullscreenDelegate for iOS, this adds an iOS version of the delegate methods that passes WKWebView instead of NSView.
868         The iOS version of these functions are renamed to be more specific and disambiguate them from the video fullscreen delegate methods.
869
870         This also adds an image asset for the done button.
871
872         * Configurations/FeatureDefines.xcconfig:
873         * UIProcess/API/Cocoa/WKWebView.mm:
874         (-[WKWebView hasFullScreenWindowController]):
875         (-[WKWebView fullScreenWindowController]):
876         (-[WKWebView closeFullScreenWindowController]):
877         (-[WKWebView fullScreenPlaceholderView]):
878         * UIProcess/API/Cocoa/WKWebViewInternal.h:
879         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h:
880         * UIProcess/Cocoa/FullscreenClient.h:
881         * UIProcess/Cocoa/FullscreenClient.mm:
882         (WebKit::FullscreenClient::FullscreenClient):
883         (WebKit::FullscreenClient::setDelegate):
884         (WebKit::FullscreenClient::willEnterFullscreen):
885         (WebKit::FullscreenClient::didEnterFullscreen):
886         (WebKit::FullscreenClient::willExitFullscreen):
887         (WebKit::FullscreenClient::didExitFullscreen):
888         * UIProcess/ios/PageClientImplIOS.mm:
889         (WebKit::PageClientImpl::closeFullScreenManager):
890         (WebKit::PageClientImpl::isFullScreen):
891         (WebKit::PageClientImpl::enterFullScreen):
892         (WebKit::PageClientImpl::exitFullScreen):
893         (WebKit::PageClientImpl::beganEnterFullScreen):
894         (WebKit::PageClientImpl::beganExitFullScreen):
895         * UIProcess/ios/WKContentView.mm:
896         * UIProcess/ios/WKFullScreenWindowControllerIOS.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKFullscreenDelegate.h.
897         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm: Added.
898         (WebKit::replaceViewWithView):
899         (WebKit::WKWebViewState::applyTo):
900         (WebKit::WKWebViewState::store):
901         (-[_WKTapDelgatingView setTarget:action:]):
902         (-[_WKTapDelgatingView hitTest:withEvent:]):
903         (-[_WKFullScreenViewController dealloc]):
904         (-[_WKFullScreenViewController viewWillTransitionToSize:withTransitionCoordinator:]):
905         (+[_WKFullScreenViewController configureView:withBackgroundFillOfColor:opacity:filter:]):
906         (-[_WKFullScreenViewController _updateTransparencyOfVisualEffectView:]):
907         (-[_WKFullScreenViewController createVisualEffectViewWithFrame:]):
908         (-[_WKFullScreenViewController loadView]):
909         (-[_WKFullScreenViewController viewWillAppear:]):
910         (-[_WKFullScreenViewController viewDidDisappear:]):
911         (-[_WKFullScreenViewController cancelAction:]):
912         (-[_WKFullScreenViewController hideCancelButton]):
913         (-[_WKFullScreenViewController showCancelButton]):
914         (-[_WKFullScreenViewController setTarget:action:]):
915         (-[_WKFullScreenViewController prefersStatusBarHidden]):
916         (-[WKFullscreenAnimationController transitionDuration:]):
917         (-[WKFullscreenAnimationController animateTransition:]):
918         (-[WKFullscreenAnimationController animationEnded:]):
919         (-[WKFullScreenWindowController initWithWebView:page:]):
920         (-[WKFullScreenWindowController dealloc]):
921         (-[WKFullScreenWindowController isFullScreen]):
922         (-[WKFullScreenWindowController webViewPlaceholder]):
923         (-[WKFullScreenWindowController enterFullScreen]):
924         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
925         (-[WKFullScreenWindowController completedEnterFullScreen]):
926         (-[WKFullScreenWindowController exitFullScreen]):
927         (-[WKFullScreenWindowController requestExitFullScreen]):
928         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
929         (-[WKFullScreenWindowController completedExitFullScreen]):
930         (-[WKFullScreenWindowController close]):
931         (-[WKFullScreenWindowController _manager]):
932         (-[WKFullScreenWindowController animationControllerForPresentedController:presentingController:sourceController:]):
933         (-[WKFullScreenWindowController animationControllerForDismissedController:]):
934         * WebKit.xcassets/Contents.json: Added.
935         * WebKit.xcassets/Done.imageset/Contents.json: Added.
936         * WebKit.xcassets/Done.imageset/Done.pdf: Added.
937         * WebKit.xcodeproj/project.pbxproj:
938         * WebProcess/FullScreen/WebFullScreenManager.cpp:
939         (WebKit::WebFullScreenManager::willEnterFullScreen):
940         (WebKit::WebFullScreenManager::willExitFullScreen):
941
942 2017-11-01  Daniel Bates  <dabates@apple.com>
943
944         XMLHttpRequest should not sniff content encoding
945         https://bugs.webkit.org/show_bug.cgi?id=175597
946         <rdar://problem/34912624>
947
948         Reviewed by Alex Christensen.
949
950         Fixes an issue where the body of an HTTP response with headers "Content-Type: application/octet-stream" and
951         "Content-Encoding: gzip" associated with an XHR request to a .gz file would not be automatically gzipped
952         decompressed. Specifically, such a response would be treated analogous to a response with headers
953         "Content-Type: application/gzip" and "Content-Encoding: identity". This behavior does not conform to the
954         behavior of the Content-Encoding header as defined in the HTTP 1.1 and later specs. Moreover this behavior
955         breaks the Epic Zen Garden demo: <https://s3.amazonaws.com/mozilla-games/ZenGarden/EpicZenGarden.html>.
956
957         On macOS 10.13.2 opt out of content encoding sniffing when making an XHR request. We likely can
958         selectively opt out of content encoding sniffing for other network requests. This will be done
959         in subsequent commits to make it straightforward to identify site breakage (if any).
960
961         * NetworkProcess/Downloads/Download.cpp:
962         (WebKit::Download::start): Enable content encoding sniff to match existing behavior.
963         (WebKit::Download::startWithHandle): Ditto.
964         * NetworkProcess/NetworkDataTask.cpp:
965         (WebKit::NetworkDataTask::create): Pass through the content encoding sniffing policy.
966         * NetworkProcess/NetworkLoad.cpp:
967         (WebKit::NetworkLoad::NetworkLoad): Ditto.
968         * NetworkProcess/NetworkLoadParameters.h:
969         * NetworkProcess/NetworkResourceLoadParameters.cpp:
970         (WebKit::NetworkResourceLoadParameters::encode const): Encode content encoding sniffing policy.
971         (WebKit::NetworkResourceLoadParameters::decode): Decode content encoding sniffing policy.
972         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
973         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad): Enable content encoding sniff to match existing
974         behavior. We should look to disable content encoding sniffing in a subsequent change.
975         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
976         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
977         (WebKit::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded): Added helper function
978         to apply sniffing policies and bind request to interface, if applicable.
979         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Modified to take the content encoding sniffing
980         policy. Calls applySniffingPoliciesAndBindRequestToInferfaceIfNeeded() to apply this policy. Also use
981         convenience function URL::isLocalFile() to determine if the URL is a file URL.
982         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
983         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup): Pass through the content encoding sniffing policy.
984         * NetworkProcess/soup/NetworkDataTaskSoup.h:
985         * WebProcess/Network/WebLoaderStrategy.cpp:
986         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): Pass through the content encoding sniffing policy.
987         (WebKit::WebLoaderStrategy::loadResourceSynchronously): Enable content encoding sniff to match existing
988         behavior.
989
990 2017-11-01  Brady Eidson  <beidson@apple.com>
991
992         Plumbing for handling SW scripts failing to evaluate
993         https://bugs.webkit.org/show_bug.cgi?id=178926
994
995         Reviewed by Chris Dumez.
996
997         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
998         (WebKit::WebSWServerConnection::updateServiceWorkerContext):
999         (WebKit::WebSWServerConnection::setContextConnection):
1000         (WebKit::WebSWServerConnection::startServiceWorkerContext): Deleted.
1001         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1002
1003         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1004         (WebKit::WebSWContextManagerConnection::updateServiceWorker):
1005         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
1006         (WebKit::WebSWContextManagerConnection::startServiceWorker): Deleted.
1007         * WebProcess/Storage/WebSWContextManagerConnection.h:
1008         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1009
1010 2017-11-01  Frederic Wang  <fwang@igalia.com>
1011
1012         Make iOS Find UI reveal matches in scrollable elements
1013         https://bugs.webkit.org/show_bug.cgi?id=178789
1014
1015         Reviewed by Tim Horton.
1016
1017         * WebProcess/WebPage/ios/FindControllerIOS.mm:
1018         (WebKit::FindController::didFindString): Reveal selection up to the main frame. The main frame
1019         is handled by the SmartMagnificationController.
1020
1021 2017-11-01  Michael Catanzaro  <mcatanzaro@igalia.com>
1022
1023         REGRESSION(r224192): [WPE] Fix WebEventFactory::createWebWheelEvent
1024         https://bugs.webkit.org/show_bug.cgi?id=179098
1025
1026         Reviewed by Sam Weinig.
1027
1028         * Shared/wpe/WebEventFactory.cpp:
1029         (WebKit::WebEventFactory::createWebWheelEvent):
1030
1031 2017-10-31  Tim Horton  <timothy_horton@apple.com>
1032
1033         Clean up some drag and drop feature flags
1034         https://bugs.webkit.org/show_bug.cgi?id=179082
1035
1036         Reviewed by Simon Fraser.
1037
1038         * Configurations/FeatureDefines.xcconfig:
1039
1040 2017-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
1041
1042         Followup to r224238: API::Attachment should generate a _WKAttachment ObjC wrapper
1043         https://bugs.webkit.org/show_bug.cgi?id=179080
1044
1045         Reviewed by Tim Horton.
1046
1047         Fixes a failing API test. The new Attachment object type added in r224238 was not actually being handled in
1048         Object::newObject, so a plain WKObject Objective C wrapper was being created; fix this by allocating a new
1049         _WKAttachment object for Type::Attachment.
1050
1051         * Shared/Cocoa/APIObject.mm:
1052         (API::Object::newObject):
1053
1054 2017-10-31  Tim Horton  <timothy_horton@apple.com>
1055
1056         Fix up some content filtering feature flags
1057         https://bugs.webkit.org/show_bug.cgi?id=179079
1058
1059         Reviewed by Simon Fraser.
1060
1061         * Configurations/FeatureDefines.xcconfig:
1062
1063 2017-10-31  Youenn Fablet  <youenn@apple.com>
1064
1065         rwt should allow service worker to load localhost HTTPS resources with any certificate
1066         https://bugs.webkit.org/show_bug.cgi?id=179018
1067
1068         Reviewed by Chris Dumez.
1069
1070         Allowing ServiceWorkerProcessProxy to handle authentication challenge.
1071         Temporarily adding a boolean flag through WebProcessPool to lower the SSL certificate verifications for service workers.
1072         This allows reducing flakiness in our layout tests for rwt.
1073         Future work should be done to expose a correct API for the application level to handle authentication challenges properly.
1074
1075         * UIProcess/API/C/WKContext.cpp:
1076         (WKContextSetAllowsAnySSLCertificateForServiceWorkerTesting):
1077         * UIProcess/API/C/WKContextPrivate.h:
1078         * UIProcess/API/Cocoa/WKProcessPool.mm:
1079         (-[WKProcessPool _setAllowsAnySSLCertificateForServiceWorker:]):
1080         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1081         * UIProcess/Network/NetworkProcessProxy.cpp:
1082         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
1083         (WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace):
1084         * UIProcess/ServiceWorkerProcessProxy.cpp:
1085         (WebKit::ServiceWorkerProcessProxy::didReceiveAuthenticationChallenge):
1086         * UIProcess/ServiceWorkerProcessProxy.h:
1087         * UIProcess/WebProcessPool.h:
1088
1089 2017-10-31  Joseph Pecoraro  <pecoraro@apple.com>
1090
1091         Web Inspector: UIProcess ASSERT in ~RemoteWebInspectorProxy when InspectorProcess crashes
1092         https://bugs.webkit.org/show_bug.cgi?id=179044
1093
1094         Reviewed by Alex Christensen.
1095
1096         * UIProcess/RemoteWebInspectorProxy.cpp:
1097         (WebKit::RemoteWebInspectorProxy::frontendDidClose):
1098         Add a protector to keep the proxy alive for the duration of this method.
1099
1100 2017-10-31  Youenn Fablet  <youenn@apple.com>
1101
1102         Crash in:  com.apple.WebKit: WebKit::CacheStorage::Caches::initializeSize(WTF::Function<void (std::optional<WebCore::DOMCacheEngine::Error>&&)>&&) + 30 (CacheStorageEngineCaches.cpp:163)
1103         https://bugs.webkit.org/show_bug.cgi?id=179037
1104
1105         Reviewed by Chris Dumez.
1106
1107         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1108         (WebKit::CacheStorage::Caches::initializeSize): the storage backend may be cleared when clearing caches by the UI Process.
1109         Returning early in that case. A web application will typically fail to open a cache in this case.
1110         On retry, the cache should be opened.
1111
1112 2017-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
1113
1114         [Attachment Support] Implement WKWebView SPI for inserting attachment elements
1115         https://bugs.webkit.org/show_bug.cgi?id=179013
1116         <rdar://problem/35249668>
1117
1118         Reviewed by Tim Horton.
1119
1120         Adds native SPI to insert attachment elements given a filename, an optional MIME type, and a data blob. See
1121         change-by-change comments below for more detail. Covered by a new API test.
1122
1123         * PlatformMac.cmake:
1124         * Shared/API/APIObject.h:
1125         * Shared/API/Cocoa/WebKitPrivate.h:
1126         * UIProcess/API/APIAttachment.cpp: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h.
1127         (API::Attachment::create):
1128         (API::Attachment::Attachment):
1129         (API::Attachment::~Attachment):
1130
1131         Introduce API::Attachment, which represents a platform-agnostic Attachment.
1132
1133         * UIProcess/API/APIAttachment.h: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h.
1134         * UIProcess/API/Cocoa/WKWebView.mm:
1135         (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]):
1136
1137         Adds support for inserting a new attachment element. Calls out to WebPageProxy to insert the attachment from the
1138         given data blob, and creates a new API-object-backed _WKAttachment.
1139
1140         (-[WKWebView _executeEditCommand:argument:completion:]):
1141
1142         Support passing in a nil completion block.
1143
1144         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1145         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1146         * UIProcess/API/Cocoa/_WKAttachment.h: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h.
1147         * UIProcess/API/Cocoa/_WKAttachment.mm: Copied from Source/WebCore/html/HTMLAttachmentElement.h.
1148
1149         Introduces _WKAttachment, an Objective C wrapper around the API::Attachment.
1150
1151         (-[_WKAttachment _apiObject]):
1152         (-[_WKAttachment isEqual:]):
1153         (-[_WKAttachment uniqueIdentifier]):
1154         (-[_WKAttachment hash]):
1155
1156         Add _WKAttachment, a WebKit SPI object that wraps an attachment element unique identifier. Also, allow
1157         _WKAttachment to be used as a hashable NSDictionary key.
1158
1159         (-[_WKAttachment description]):
1160         * UIProcess/API/Cocoa/_WKAttachmentInternal.h: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h.
1161         (API::wrapper):
1162         * UIProcess/WebPageProxy.cpp:
1163         (WebKit::WebPageProxy::insertAttachment):
1164
1165         Implement IPC support for inserting an attachment.
1166
1167         * UIProcess/WebPageProxy.h:
1168         * WebKit.xcodeproj/project.pbxproj:
1169         * WebProcess/WebPage/WebPage.cpp:
1170         (WebKit::WebPage::insertAttachment):
1171         * WebProcess/WebPage/WebPage.h:
1172         * WebProcess/WebPage/WebPage.messages.in:
1173
1174 2017-10-31  Alex Christensen  <achristensen@webkit.org>
1175
1176         Fix custom header field setting with reloads and asynchronous navigation action policy decisions
1177         https://bugs.webkit.org/show_bug.cgi?id=179064
1178
1179         Reviewed by Tim Horton.
1180
1181         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1182         (WebKit::WebFrameLoaderClient::applyToDocumentLoader):
1183         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1184         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1185         * WebProcess/WebPage/WebFrame.cpp:
1186         (WebKit::WebFrame::didReceivePolicyDecision):
1187         * WebProcess/WebPage/WebFrame.h:
1188         * WebProcess/WebPage/WebPage.cpp:
1189         (WebKit::WebPage::didReceivePolicyDecision):
1190
1191 2017-10-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1192
1193         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.1 release.
1194
1195         * gtk/NEWS: Add release notes for 2.19.1.
1196
1197 2017-10-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1198
1199         Unreviewed. Fix GTK+ make distcheck.
1200
1201         Include WebCore/TextEncodingRegistry.h to ensure the forwarding header is generated.
1202
1203         * UIProcess/API/glib/WebKitSettings.cpp:
1204
1205 2017-10-31  Commit Queue  <commit-queue@webkit.org>
1206
1207         Unreviewed, rolling out r223884.
1208         https://bugs.webkit.org/show_bug.cgi?id=179055
1209
1210         It broke GTK+ make distcheck (Requested by KaL on #webkit).
1211
1212         Reverted changeset:
1213
1214         "[GTK][WPE] generate-forwarding-headers.pl should also scan
1215         derived sources in WebKit framework"
1216         https://bugs.webkit.org/show_bug.cgi?id=178579
1217         https://trac.webkit.org/changeset/223884
1218
1219 2017-10-30  Fujii Hironori  <Hironori.Fujii@sony.com>
1220
1221         Use LazyNeverDestroyed instead of DEFINE_GLOBAL for XMLNames, HTMLNames, MathMLNames and SVGNames
1222         https://bugs.webkit.org/show_bug.cgi?id=175118
1223
1224         Reviewed by Alex Christensen.
1225
1226         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPrivate.cpp:
1227         (WebKit::wrap):
1228
1229 2017-10-27  Megan Gardner  <megan_gardner@apple.com>
1230
1231         Correctly determine affinity when inserting text via Keyboard Suggestions
1232         https://bugs.webkit.org/show_bug.cgi?id=178969
1233
1234         Reviewed by Ryosuke Niwa.
1235
1236         Use the logic of VisiblePosition to correctly determine cursor affinity. We were
1237         defaulting to upstream, but that in incorrect and resulted in hitting asserts that
1238         we should not. This should give us the correct affinity in all cases.
1239
1240         * WebProcess/WebPage/ios/WebPageIOS.mm:
1241         (WebKit::WebPage::syncApplyAutocorrection):
1242
1243 2017-10-30  Commit Queue  <commit-queue@webkit.org>
1244
1245         Unreviewed, rolling out r224078.
1246         https://bugs.webkit.org/show_bug.cgi?id=179026
1247
1248         MotionMark regression (Requested by shallawa on #webkit).
1249
1250         Reverted changeset:
1251
1252         "When navigating back to a page, compositing layers may not
1253         use accelerated drawing"
1254         https://bugs.webkit.org/show_bug.cgi?id=178749
1255         https://trac.webkit.org/changeset/224078
1256
1257 2017-10-30  Sam Weinig  <sam@webkit.org>
1258
1259         [Setting] Only expose experimental features that are compiled in
1260         https://bugs.webkit.org/show_bug.cgi?id=179023
1261
1262         Reviewed by Tim Horton.
1263
1264         * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
1265         
1266             Update template to conditionally expose experimental features based on their
1267             'condition' option in WebPreferences.yaml
1268
1269 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
1270
1271         [WPE] Fix build warnings
1272         https://bugs.webkit.org/show_bug.cgi?id=178899
1273
1274         Reviewed by Carlos Alberto Lopez Perez.
1275
1276         * PlatformWPE.cmake:
1277
1278 2017-10-30  Sam Weinig  <sam@webkit.org>
1279
1280         [Settings] Replace macro driven experimental features code with generated code
1281         https://bugs.webkit.org/show_bug.cgi?id=178994
1282
1283         Reviewed by Simon Fraser.
1284
1285         As a first step toward allowing experimental features to vary based on compile
1286         time flags, replace the macro driven implementation of the WebPreferences part
1287         of experimental features, with one generated from a template file.
1288
1289         * CMakeLists.txt:
1290         * DerivedSources.make:
1291         * Scripts/GeneratePreferences.rb:
1292         * WebKit.xcodeproj/project.pbxproj:
1293
1294             Generate the new template.
1295         
1296         * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb: Added.
1297         * UIProcess/WebPreferences.cpp:
1298         (WebKit::createExperimentalFeaturesVector): Deleted.
1299         (WebKit::WebPreferences::experimentalFeatures): Deleted.
1300         (WebKit::WebPreferences::isEnabledForFeature const): Deleted.
1301         (WebKit::WebPreferences::setEnabledForFeature): Deleted.
1302         (WebKit::WebPreferences::enableAllExperimentalFeatures): Deleted.
1303         
1304             Replace macro implementation with template generated one.
1305
1306 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
1307
1308         [WPE] Build more files under WebCore as unified sources and get rid of WebCorePlatformWPE build target
1309         https://bugs.webkit.org/show_bug.cgi?id=178964
1310
1311         Reviewed by Carlos Alberto Lopez Perez.
1312
1313         * PlatformWPE.cmake:
1314
1315 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
1316
1317         [WPE][GTK] Expose availability of certain editing commands in WebKitEditorState
1318         https://bugs.webkit.org/show_bug.cgi?id=168219
1319
1320         Reviewed by Ryosuke Niwa.
1321
1322         Expose canCut, canCopy, canPaste, canUndo, and canRedo in EditorState::PostLayouData.
1323
1324         Add corresponding new WPE/GTK API.
1325
1326         Remove allowsCopy from WebKitTestResultData. It's unused, does not work correctly in all
1327         circumstances, and irritates Ryosuke.
1328
1329         Also, remove a bunch of #ifs guarding post layout data, since it's now used on all ports.
1330
1331         * Shared/EditorState.cpp:
1332         (WebKit::EditorState::encode const):
1333         (WebKit::EditorState::decode):
1334         (WebKit::EditorState::PostLayoutData::encode const):
1335         (WebKit::EditorState::PostLayoutData::decode):
1336         * Shared/EditorState.h:
1337         (WebKit::EditorState::postLayoutData const const):
1338         * Shared/WebHitTestResultData.cpp:
1339         (WebKit::WebHitTestResultData::WebHitTestResultData):
1340         (WebKit::WebHitTestResultData::encode const):
1341         (WebKit::WebHitTestResultData::decode):
1342         * Shared/WebHitTestResultData.h:
1343         * UIProcess/API/APIHitTestResult.h:
1344         (API::HitTestResult::allowsCopy const): Deleted.
1345         * UIProcess/API/glib/WebKitEditorState.cpp:
1346         (webkitEditorStateChanged):
1347         (webkit_editor_state_is_cut_available):
1348         (webkit_editor_state_is_copy_available):
1349         (webkit_editor_state_is_paste_available):
1350         (webkit_editor_state_is_undo_available):
1351         (webkit_editor_state_is_redo_available):
1352         * UIProcess/API/glib/WebKitWebView.cpp:
1353         (webkit_web_view_can_execute_editing_command):
1354         * UIProcess/API/gtk/WebKitEditorState.h:
1355         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1356         * UIProcess/API/wpe/WebKitEditorState.h:
1357         * WebProcess/WebPage/WebPage.cpp:
1358         (WebKit::WebPage::editorState const):
1359         * WebProcess/WebPage/mac/WebPageMac.mm:
1360         (WebKit::WebPage::performImmediateActionHitTestAtLocation):
1361
1362 2017-10-27  Sam Weinig  <sam@webkit.org>
1363
1364         [Settings] Generate more of the WebKit preferences code
1365         https://bugs.webkit.org/show_bug.cgi?id=178945
1366
1367         Reviewed by Chris Dumez.
1368
1369         Generate WebPreferencesKeys.{h,cpp} and WebPreferencesStoreDefaultsMap.cpp
1370
1371         * CMakeLists.txt:
1372         * DerivedSources.make:
1373         * WebKit.xcodeproj/project.pbxproj:
1374         * Scripts/GeneratePreferences.rb:
1375         
1376             Generate new files.
1377         
1378         * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb:
1379         
1380             Update include.
1381         
1382         * Scripts/PreferencesTemplates/WebPreferencesKeys.cpp.erb: Added.
1383         * Scripts/PreferencesTemplates/WebPreferencesKeys.h.erb: Added.
1384         * Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb: Added.
1385
1386             Add template files for new generated files.
1387
1388         * Shared/WebPreferencesDefaultValues.h: Copied from Source/WebKit/Shared/WebPreferencesDefinitionsBase.h.
1389         * Shared/WebPreferencesDefinitionsBase.h:
1390         
1391             Renamed WebPreferencesDefinitionsBase.h to WebPreferencesDefaultValues.h to better indicate what it is.
1392         
1393         * Shared/WebPreferencesKeys.cpp: Removed.
1394         * Shared/WebPreferencesKeys.h: Removed.
1395         
1396             Replaced with generated versions.
1397
1398         * Shared/WebPreferencesStore.cpp:
1399         (WebKit::defaults): Deleted.
1400         * Shared/WebPreferencesStore.h:
1401         
1402             Replace macro driven defaults map with generated WebPreferencesStoreDefaultsMap.cpp.
1403
1404 2017-10-28  Chris Dumez  <cdumez@apple.com>
1405
1406         self.ExtendableEvent / Client / Clients / WindowClient do not exist in a Service Worker
1407         https://bugs.webkit.org/show_bug.cgi?id=178976
1408
1409         Reviewed by Sam Weinig.
1410
1411         Actually enable the Service Worker RuntimeEnabledFeature in the Service Worker
1412         WebProcess.
1413
1414         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1415         (WebKit::WebSWContextManagerConnection::updatePreferences):
1416
1417 2017-10-28  Joseph Pecoraro  <pecoraro@apple.com>
1418
1419         Make postprocess-framework-headers.sh a little easier to read
1420         https://bugs.webkit.org/show_bug.cgi?id=178971
1421
1422         Reviewed by Sam Weinig.
1423
1424         * mac/postprocess-framework-headers.sh:
1425
1426 2017-10-27  Daniel Bates  <dabates@apple.com>
1427
1428         Attempt to fix the Apple El Capitan build following <https://trac.webkit.org/changeset/224134>
1429         (https://bugs.webkit.org/show_bug.cgi?id=178919)
1430
1431         Move definition of NetworkLoad::isAllowedToAskUserForCredentials() outside of USE(NETWORK_SESSION)-guarded section.
1432
1433         * NetworkProcess/NetworkLoad.cpp:
1434         (WebKit::NetworkLoad::isAllowedToAskUserForCredentials const):
1435
1436 2017-10-27  Daniel Bates  <dabates@apple.com>
1437
1438         Only allow non-mixed content protected subresources to ask for credentials
1439         https://bugs.webkit.org/show_bug.cgi?id=178919
1440         <rdar://problem/35015245>
1441
1442         Reviewed by Alex Christensen.
1443
1444         Only allow non-mixed content protected subresources to ask for credentials. It is not meaningful
1445         to allow protected mixed-content subresources to ask for credentials.
1446
1447         * NetworkProcess/Downloads/PendingDownload.cpp:
1448         (WebKit::PendingDownload::PendingDownload): Initialize m_isAllowedToAskUserForCredentials based on
1449         the specified resource load parameters or NetworkLoad object.
1450         * NetworkProcess/Downloads/PendingDownload.h: Add override for NetworkLoadClient::isAllowedToAskUserForCredentials().
1451         * NetworkProcess/NetworkLoad.cpp:
1452         (WebKit::NetworkLoad::isAllowedToAskUserForCredentials const): Added.
1453         (WebKit::NetworkLoad::completeAuthenticationChallenge): Ask NetworkLoadClient whether the load is
1454         allowed to prompt for credentials.
1455         (WebKit::NetworkLoad::didReceiveAuthenticationChallenge): Ditto.
1456         * NetworkProcess/NetworkLoad.h:
1457         * NetworkProcess/NetworkLoadClient.h:
1458         * NetworkProcess/NetworkResourceLoader.cpp:
1459         (WebKit::NetworkResourceLoader::NetworkResourceLoader): Initialize m_isAllowedToAskUserForCredentials
1460         based on the specified resource load parameters.
1461         (WebKit::NetworkResourceLoader::willSendRedirectedRequest): We do not support prompting for credentials
1462         for synchronous loads.
1463         (WebKit::NetworkResourceLoader::continueWillSendRequest): Modified to take an argument as to whether the
1464         load is allowed to ask the user for credentials and updates state.
1465         * NetworkProcess/NetworkResourceLoader.h:
1466         * NetworkProcess/NetworkResourceLoader.messages.in: Modified message ContinueWillSendRequest to take a
1467         boolean as to whether the load is allowed to ask the user for credentials.
1468         * NetworkProcess/PreconnectTask.h: Override NetworkLoadClient::isAllowedToAskUserForCredentials()
1469         such that we never ask for credentials. This matches our current behavior.
1470         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: Ditto.
1471         * WebProcess/Network/WebResourceLoader.cpp:
1472         (WebKit::WebResourceLoader::willSendRequest): Query ResourceLoader as to whether the load is allowed to
1473         ask the user for credentials and pass this state to NetworkResourceLoader.
1474
1475 2017-10-27  Adrian Perez de Castro  <aperez@igalia.com>
1476
1477         [GTK][CMake] Incorrect conditional check when adding build dir to GIR runtime library path
1478         https://bugs.webkit.org/show_bug.cgi?id=178936
1479
1480         Reviewed by Michael Catanzaro.
1481
1482         * PlatformGTK.cmake: Fix spelling of variable used in conditional.
1483
1484 2017-10-27  Chris Dumez  <cdumez@apple.com>
1485
1486         Add initial support for serviceWorkerClient.postMessage()
1487         https://bugs.webkit.org/show_bug.cgi?id=178794
1488
1489         Reviewed by Youenn Fablet.
1490
1491         Add initial support for serviceWorkerClient.postMessage():
1492         - https://w3c.github.io/ServiceWorker/#client-postmessage
1493
1494         It is now possible to do bi-directional communication with a service worker
1495         via postMessage().
1496
1497         * Shared/WebCoreArgumentCoders.cpp:
1498         (IPC::ArgumentCoder<ServiceWorkerClientIdentifier>::encode):
1499         (IPC::ArgumentCoder<ServiceWorkerClientIdentifier>::decode):
1500         * Shared/WebCoreArgumentCoders.h:
1501         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1502         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
1503         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
1504         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1505         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1506         * StorageProcess/StorageProcess.cpp:
1507         (WebKit::StorageProcess::postMessageToServiceWorkerClient):
1508         * StorageProcess/StorageProcess.h:
1509         * StorageProcess/StorageProcess.messages.in:
1510         * WebProcess/Storage/WebSWClientConnection.cpp:
1511         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
1512         (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
1513         * WebProcess/Storage/WebSWClientConnection.h:
1514         * WebProcess/Storage/WebSWClientConnection.messages.in:
1515         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1516         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
1517         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
1518         * WebProcess/Storage/WebSWContextManagerConnection.h:
1519         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1520
1521 2017-10-27  David Kilzer  <ddkilzer@apple.com>
1522
1523         REGRESSION (r224077): DeprecatedGlobalSettings::setAVKitEnabled() not protected by HAVE(AVKIT)
1524
1525         Unreviewed build fix.
1526
1527         * WebProcess/WebPage/WebPage.cpp:
1528         (WebKit::WebPage::updatePreferences): Fix build.
1529
1530 2017-10-26  Jeremy Jones  <jeremyj@apple.com>
1531
1532         Implement seek tolerance methods in WebAVPlayerController.
1533         https://bugs.webkit.org/show_bug.cgi?id=178838
1534         rdar://problem/33781777
1535
1536         Reviewed by Eric Carlson.
1537
1538         This implementes additional methods on WebAVPlayerController that allows AVKit more control over seeking.
1539
1540         * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
1541         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
1542         (WebKit::PlaybackSessionModelContext::seekToTime):
1543         (WebKit::PlaybackSessionManagerProxy::seekToTime):
1544         * WebProcess/cocoa/PlaybackSessionManager.h:
1545         * WebProcess/cocoa/PlaybackSessionManager.messages.in:
1546         * WebProcess/cocoa/PlaybackSessionManager.mm:
1547         (WebKit::PlaybackSessionManager::seekToTime):
1548
1549 2017-10-26  Brian Burg  <bburg@apple.com>
1550
1551         Web Automation: denying user permission for getUserMedia doesn't work
1552         https://bugs.webkit.org/show_bug.cgi?id=178895
1553
1554         Reviewed by Youenn Fablet.
1555
1556         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1557         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1558         The ordering of special cases is incorrect. Safari configures its automation views to
1559         allow mock devices and never prompt for them. These checks were before the check for
1560         the automation session's getUserMedia permission. Switch these checks.
1561
1562         Also change the deny reason so that subsequent requests are also denied. This matches
1563         behavior when a user denies a permission request on a real dialog. With this change,
1564         the DOM error changes from SecurityError to NotAllowedError, which makes more sense.
1565
1566 2017-10-26  Michael Catanzaro  <mcatanzaro@igalia.com>
1567
1568         Unreviewed, fix GCC warning spam after r224077
1569         https://bugs.webkit.org/show_bug.cgi?id=178823
1570
1571         Need to leave a blank line at the bottom of the file.
1572
1573         * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb:
1574
1575 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
1576
1577         When navigating back to a page, compositing layers may not use accelerated drawing
1578         https://bugs.webkit.org/show_bug.cgi?id=178749
1579         rdar://problem/35158946
1580
1581         Reviewed by Dean Jackson.
1582
1583         Avoid assertions when a test enables accelerated drawing (which we can't support
1584         in the iOS simulator).
1585
1586         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
1587         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
1588
1589 2017-10-26  Sam Weinig  <sam@webkit.org>
1590
1591         [Settings] Generate the bulk of WebPage::updatePreferences(...)
1592         https://bugs.webkit.org/show_bug.cgi?id=178823
1593
1594         Reviewed by Tim Horton.
1595
1596         * CMakeLists.txt:
1597         * DerivedSources.make:
1598         * WebKit.xcodeproj/project.pbxproj:
1599
1600             Add new file generation.
1601
1602         * Scripts/GeneratePreferences.rb:
1603         
1604             Replace 'webkitOnly' boolean option with a new 'webcoreBinding' option.
1605             'webcoreBinding' supports the following values:
1606                 - none (same as webkit only)
1607                 - custom (means that you do bind to a webcore concept, but currently it must
1608                   be done in a custom manner)
1609                 - DeprecatedGlobalSettings (binds to a DeprecatedGlobalSettings setting)
1610                 - RuntimeEnabledFeatures (binds to a RuntimeEnabledFeatures setting)
1611             If 'webcoreBinding' is not provided, the preference binds to WebCore Setting
1612             of either the same name or the override name provided by the new 'webcoreName'
1613             option (we should try to remove the need for 'webcoreName' by unifying with 
1614             WebCore on preference/setting naming).
1615             
1616             A 'condition' option was also added to indicate that the preference is only available
1617             when that macro condition is true.
1618             
1619             Since we are generating most of WebPage::updatePreferences, we can simplify the
1620             macros in WebPreferencesDefinitions.h to only have normal/debug/experimental variants
1621             and remove the need for per-type macros, which were only used in WebPage::updatePreferences.
1622         
1623         * Scripts/PreferencesTemplates/WebPageUpdatePreferences.cpp.erb: Added.
1624         
1625             Generates bindings from WebPreferences to WebCore::Settings/DeprecatedGlobalSettings/RuntimeEnabledFeatures.
1626             Does not generate a binding if the 'webcoreBinding' option is set to either 'none' or 'custom'.
1627         
1628         * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb:
1629     
1630             Simplify down to just normal/debug/experimental macros.
1631         
1632         * Shared/WebPreferences.yaml:
1633         
1634             Annotate perferences with new optional 'webcoreBinding', 'webcoreName', and 'condition'
1635             options.
1636         
1637         * WebProcess/WebPage/WebPage.cpp:
1638         (WebKit::WebPage::updatePreferences):
1639         
1640             Replace a ton of hand written preference to settings bindings with a call to updatePreferencesGenerated().
1641         
1642         * WebProcess/WebPage/WebPage.h:
1643         
1644             Add declaration of updatePreferencesGenerated, remove platformPreferencesDidChange.
1645
1646         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
1647         (WebKit::WebPage::platformPreferencesDidChange): Deleted.
1648         * WebProcess/WebPage/ios/WebPageIOS.mm:
1649         (WebKit::WebPage::platformPreferencesDidChange): Deleted.
1650         * WebProcess/WebPage/mac/WebPageMac.mm:
1651         (WebKit::WebPage::platformPreferencesDidChange): Deleted.
1652         * WebProcess/WebPage/win/WebPageWin.cpp:
1653         (WebKit::WebPage::platformPreferencesDidChange): Deleted.
1654         * WebProcess/WebPage/wpe/WebPageWPE.cpp:
1655         (WebKit::WebPage::platformPreferencesDidChange): Deleted.
1656         
1657             Remove all the empty platformPreferencesDidChange functions.
1658
1659 2017-10-26  Alex Christensen  <achristensen@webkit.org>
1660
1661         Move WKWebViewConfiguration validation to WKWebView construction
1662         https://bugs.webkit.org/show_bug.cgi?id=178840
1663
1664         Reviewed by Tim Horton.
1665         
1666         I'm trying to remove WKWebViewConfigurationInternal methods so I can make WKWebViewConfiguration
1667         a wrapper around an APIObject like all the other API objects.  A small step towards making this easier
1668         is to remove the unnecessary method _validate and move its logic to its one callsite.  I added an API test
1669         that ensures no change in behavior.
1670
1671         * UIProcess/API/Cocoa/WKWebView.mm:
1672         (-[WKWebView _initializeWithConfiguration:]):
1673         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1674         (-[WKWebViewConfiguration _validate]): Deleted.
1675         * UIProcess/API/Cocoa/WKWebViewConfigurationInternal.h:
1676
1677 2017-10-26  Megan Gardner  <megan_gardner@apple.com>
1678
1679         Remove unneeded block selection calculation code
1680         https://bugs.webkit.org/show_bug.cgi?id=178889
1681
1682         Reviewed by Tim Horton.
1683
1684         Removing more block selection code. Much of this should have been removed
1685         before, as the only things that were using these functions were removed in the
1686         last patch. Also remove the code decided if you should move to block mode or not,
1687         as the answer now is always NO.
1688
1689         * WebProcess/WebPage/WebPage.h:
1690         * WebProcess/WebPage/ios/WebPageIOS.mm:
1691         (WebKit::WebPage::updateSelectionWithTouches):
1692         (WebKit::WebPage::rangeForBlockAtPoint): Deleted.
1693         (WebKit::distanceBetweenRectsForPosition): Deleted.
1694         (WebKit::rectsEssentiallyTheSame): Deleted.
1695         (WebKit::unionDOMRanges): Deleted.
1696         (WebKit::computeEdgeCenter): Deleted.
1697         (WebKit::WebPage::expandedRangeFromHandle): Deleted.
1698         (WebKit::WebPage::contractedRangeFromHandle): Deleted.
1699         (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle): Deleted.
1700         (WebKit::WebPage::switchToBlockSelectionAtPoint): Deleted.
1701         (WebKit::WebPage::shouldSwitchToBlockModeForHandle): Deleted.
1702
1703 2017-10-26  Jeremy Jones  <jeremyj@apple.com>
1704
1705         Call setFullscreenClient on iOS.
1706         https://bugs.webkit.org/show_bug.cgi?id=178089
1707
1708         Reviewed by Simon Fraser.
1709
1710         This was only being set for MacOS.
1711
1712         * UIProcess/ios/WKContentView.mm:
1713         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
1714
1715 2017-10-26  Eric Carlson  <eric.carlson@apple.com>
1716
1717         NowPlayingInfo should contain a unique identifier
1718         https://bugs.webkit.org/show_bug.cgi?id=178872
1719
1720         Reviewed by Jer Noble.
1721
1722         * UIProcess/API/Cocoa/WKWebView.mm:
1723         (-[WKWebView _requestActiveNowPlayingSessionInfo:]): Take a completion handler.
1724         (-[WKWebView _requestActiveNowPlayingSessionInfo]): Deleted.
1725         (-[WKWebView _handleActiveNowPlayingSessionInfoResponse:title:duration:elapsedTime:]): Deleted.
1726         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1727         * UIProcess/PageClient.h:
1728
1729         * UIProcess/WebPageProxy.cpp:
1730         (WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo): Ditto.
1731         (WebKit::WebPageProxy::nowPlayingInfoCallback): Lookup and call completion handler.
1732         (WebKit::WebPageProxy::handleActiveNowPlayingSessionInfoResponse const): Deleted.
1733         * UIProcess/WebPageProxy.h:
1734         * UIProcess/WebPageProxy.messages.in:
1735
1736         * UIProcess/ios/PageClientImplIOS.h:
1737         * UIProcess/ios/PageClientImplIOS.mm:
1738         (WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse): Deleted.
1739
1740         * UIProcess/mac/PageClientImplMac.h:
1741         * UIProcess/mac/PageClientImplMac.mm:
1742         (WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse): Deleted.
1743
1744         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
1745         (WebKit::WebPage::requestActiveNowPlayingSessionInfo): Take callback ID. Pass unique ID.
1746         * WebProcess/WebPage/WebPage.h:
1747         * WebProcess/WebPage/WebPage.messages.in:
1748
1749 2017-10-26  Andy Estes  <aestes@apple.com>
1750
1751         [Payment Request] Enable Payment Request whenever Apple Pay is enabled
1752         https://bugs.webkit.org/show_bug.cgi?id=178880
1753
1754         Reviewed by Tim Horton.
1755
1756         * Shared/WebPreferences.yaml:
1757         * UIProcess/API/C/WKPreferences.cpp:
1758         (WKPreferencesSetPaymentRequestEnabled): Deleted.
1759         (WKPreferencesGetPaymentRequestEnabled): Deleted.
1760         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1761         * WebProcess/WebPage/WebPage.cpp:
1762         (WebKit::WebPage::updatePreferences):
1763
1764 2017-10-26  Chris Dumez  <cdumez@apple.com>
1765
1766         Bring back SWContextManager abstraction in WebCore
1767         https://bugs.webkit.org/show_bug.cgi?id=178876
1768
1769         Reviewed by Geoffrey Garen.
1770
1771         Bring back SWContextManager abstraction in WebCore. It was killed in <https://trac.webkit.org/changeset/223718> but
1772         is actually useful when the ServiceWorker wants to message the storage process.
1773
1774         * CMakeLists.txt:
1775         * DerivedSources.make:
1776         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1777         (WebKit::WebSWServerConnection::startServiceWorkerContext):
1778         (WebKit::WebSWServerConnection::startFetch):
1779         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
1780         * WebKit.xcodeproj/project.pbxproj:
1781         * WebProcess/Storage/WebSWContextManagerConnection.cpp: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.cpp.
1782         (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
1783         (WebKit::WebSWContextManagerConnection::updatePreferences):
1784         (WebKit::WebSWContextManagerConnection::startServiceWorker):
1785         (WebKit::WebSWContextManagerConnection::startFetch):
1786         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
1787         * WebProcess/Storage/WebSWContextManagerConnection.h: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
1788         * WebProcess/Storage/WebSWContextManagerConnection.messages.in: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.messages.in.
1789         * WebProcess/WebProcess.cpp:
1790         (WebKit::WebProcess::didReceiveMessage):
1791         (WebKit::WebProcess::getWorkerContextConnection):
1792         * WebProcess/WebProcess.h:
1793
1794 2017-10-26  Alexey Proskuryakov  <ap@apple.com>
1795
1796         Remove deprecated WebKit symbols
1797         https://bugs.webkit.org/show_bug.cgi?id=178875
1798         rdar://problem/31139070
1799
1800         Reviewed by Dan Bernstein.
1801
1802         * PlatformMac.cmake:
1803         * Shared/API/c/WKDeprecatedFunctions.cpp:
1804         (WKContextSetProcessModel):
1805         (WKPageGroupCopyIdentifier): Deleted.
1806         (WKPageGroupAddUserContentFilter): Deleted.
1807         (WKPageGroupRemoveUserContentFilter): Deleted.
1808         * UIProcess/API/C/WKPageGroup.h:
1809         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm: Removed.
1810         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
1811         * WebKit.xcodeproj/project.pbxproj:
1812
1813 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
1814
1815         Unreviewed, rolling out r223984.
1816
1817         Caused LayoutTest assertion failures.
1818
1819         Reverted changeset:
1820
1821         "When navigating back to a page, compositing layers may not
1822         use accelerated drawing"
1823         https://bugs.webkit.org/show_bug.cgi?id=178749
1824         https://trac.webkit.org/changeset/223984
1825
1826 2017-10-26  Megan Gardner  <megan_gardner@apple.com>
1827
1828         Remove code to update block selection
1829         https://bugs.webkit.org/show_bug.cgi?id=178843
1830
1831         Reviewed by Tim Horton.
1832
1833         Removes code for updating block selection, which has been disabled.
1834         This code is being slowly pruned to avoid regressions and accidental removal of code that is being used.
1835
1836         * Platform/spi/ios/UIKitSPI.h:
1837         * UIProcess/PageClient.h:
1838         * UIProcess/WebPageProxy.h:
1839         * UIProcess/WebPageProxy.messages.in:
1840         * UIProcess/ios/PageClientImplIOS.h:
1841         * UIProcess/ios/PageClientImplIOS.mm:
1842         (WebKit::PageClientImpl::didUpdateBlockSelectionWithTouch): Deleted.
1843         * UIProcess/ios/WKContentViewInteraction.h:
1844         * UIProcess/ios/WKContentViewInteraction.mm:
1845         (toSelectionHandlePosition): Deleted.
1846         (-[WKContentView _didUpdateBlockSelectionWithTouch:withFlags:growThreshold:shrinkThreshold:]): Deleted.
1847         (-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]): Deleted.
1848         * UIProcess/ios/WebPageProxyIOS.mm:
1849         (WebKit::WebPageProxy::updateBlockSelectionWithTouch): Deleted.
1850         (WebKit::WebPageProxy::didUpdateBlockSelectionWithTouch): Deleted.
1851         * WebProcess/WebPage/WebPage.h:
1852         * WebProcess/WebPage/WebPage.messages.in:
1853         * WebProcess/WebPage/ios/WebPageIOS.mm:
1854         (WebKit::shouldExpand): Deleted.
1855         (WebKit::WebPage::changeBlockSelection): Deleted.
1856         (WebKit::WebPage::updateBlockSelectionWithTouch): Deleted.
1857
1858 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
1859
1860         Unreviewed, rolling out r223994.
1861
1862         The LayoutTest for this change is failing.
1863
1864         Reverted changeset:
1865
1866         "Add service worker handle fetch support for all subresource
1867         requests"
1868         https://bugs.webkit.org/show_bug.cgi?id=178769
1869         https://trac.webkit.org/changeset/223994
1870
1871 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
1872
1873         Unreviewed, rolling out r223908.
1874
1875         Causes LayoutTest crashes with newer SDKs.
1876
1877         Reverted changeset:
1878
1879         "Adopt new secure coding APIs"
1880         https://bugs.webkit.org/show_bug.cgi?id=178484
1881         https://trac.webkit.org/changeset/223908
1882
1883 2017-10-26  Christopher Reid  <chris.reid@sony.com>
1884
1885         Remove scopeguard from platform
1886         https://bugs.webkit.org/show_bug.cgi?id=178681
1887
1888         Reviewed by Brady Eidson.
1889
1890         * Shared/mac/ChildProcessMac.mm:
1891
1892 2017-10-25  Per Arne Vollan  <pvollan@apple.com>
1893
1894         Network process crash under WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge.
1895         https://bugs.webkit.org/show_bug.cgi?id=160234
1896         rdar://problem/30675510
1897
1898         Reviewed by Geoffrey Garen.
1899
1900         An exception is raised because we call the method rejectProtectionSpaceAndContinueWithChallenge on the CFNetwork
1901         challenge sender, which does not implement this optional method. The methods on the authentication challenge
1902         sender are deprecated when network session is used, so we should not call them in that case.
1903
1904         * Shared/Authentication/AuthenticationManager.cpp:
1905         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
1906         (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
1907         (WebKit::AuthenticationManager::cancelSingleChallenge):
1908         (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
1909         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
1910         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
1911         (WebKit::AuthenticationManager::receivedCredential):
1912         (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
1913         (WebKit::AuthenticationManager::receivedCancellation):
1914         (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
1915         (WebKit::AuthenticationManager::receivedChallengeRejection):
1916         * Shared/Authentication/soup/AuthenticationManagerSoup.cpp:
1917
1918 2017-10-25  Youenn Fablet  <youenn@apple.com>
1919
1920         Move DNS resolution outside of NetworkRTCProvider
1921         https://bugs.webkit.org/show_bug.cgi?id=178796
1922
1923         Reviewed by Geoffrey Garen.
1924
1925        Tested through manual testing on external STUN servers.
1926        Moving NetworkRTCProvider::Resolver into NetworkRTCResolver.
1927        Updating the implementation to use a completion handler.
1928
1929         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
1930         (WebKit::NetworkRTCProvider::createResolver):
1931         * NetworkProcess/webrtc/NetworkRTCProvider.h:
1932         * NetworkProcess/webrtc/NetworkRTCResolver.cpp:
1933         (WebKit::NetworkRTCResolver::NetworkRTCResolver):
1934         (WebKit::NetworkRTCResolver::~NetworkRTCResolver):
1935         (WebKit::NetworkRTCResolver::start):
1936         (WebKit::NetworkRTCResolver::stop):
1937         (WebKit::NetworkRTCResolver::completed):
1938         (WebKit::NetworkRTCProvider::Resolver::~Resolver): Deleted.
1939         (WebKit::NetworkRTCProvider::stop): Deleted.
1940         (WebKit::NetworkRTCProvider::resolutionCompleted): Deleted.
1941         * NetworkProcess/webrtc/NetworkRTCResolver.h:
1942         * WebKit.xcodeproj/project.pbxproj:
1943
1944 2017-10-25  Eric Carlson  <eric.carlson@apple.com>
1945
1946         [MediaStream] Clear cached gUM prompt state
1947         https://bugs.webkit.org/show_bug.cgi?id=178754
1948         <rdar://problem/32742356>
1949
1950         Reviewed by Youenn Fablet.
1951
1952         * Shared/WebPreferences.yaml: Define new settings.
1953
1954         * Shared/WebPreferencesDefinitionsBase.h: New default values.
1955
1956         * UIProcess/API/C/WKPreferences.cpp:
1957         (WKPreferencesSetInactiveMediaCaptureSteamRepromptIntervalInMinutes): New.
1958         (WKPreferencesGetInactiveMediaCaptureSteamRepromptIntervalInMinutes): Ditto.
1959         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1960
1961         * UIProcess/API/Cocoa/WKPreferences.mm:
1962         (-[WKPreferences _inactiveMediaCaptureSteamRepromptIntervalInMinutes]): Ditto.
1963         (-[WKPreferences _setInactiveMediaCaptureSteamRepromptIntervalInMinutes:]): Ditto.
1964         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1965
1966         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1967         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Initialize
1968         the timer.
1969         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): Remove unneeded namespace.
1970         (WebKit::toWebCore): Remove unneeded breaks.
1971         (WebKit::UserMediaPermissionRequestManagerProxy::searchForGrantedRequest const): Remove unneeded namespace.
1972         (WebKit::UserMediaPermissionRequestManagerProxy::wasRequestDenied): Ditto.
1973         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Ditto.
1974         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Ditto.
1975         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Ditto.
1976         (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs const): Ditto.
1977         (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged): Set the watchdog timer
1978         to the correct interval based on capture state.
1979         (WebKit::UserMediaPermissionRequestManagerProxy::watchdogTimerFired): Clear cached state.
1980         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1981
1982 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
1983
1984         When navigating back to a page, compositing layers may not use accelerated drawing
1985         https://bugs.webkit.org/show_bug.cgi?id=178749
1986         rdar://problem/35158946
1987
1988         Reviewed by Dean Jackson.
1989
1990         Avoid assertions when a test enables accelerated drawing (which we can't support
1991         in the iOS simulator).
1992
1993         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
1994         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
1995
1996 2017-10-25  Youenn Fablet  <youenn@apple.com>
1997
1998         Enable ServiceWorker to fetch resources
1999         https://bugs.webkit.org/show_bug.cgi?id=178673
2000
2001         Reviewed by Brady Eidson.
2002
2003         ServiceWorkerContextManager makes use of the new ServiceWorkerThreadProxy.
2004         It creates the necessary environment for the thread to make use of network loads, web sockets and cache storage.
2005         Fetch is functional with these changes.
2006
2007         ServiceWorkerProcessProxy is introduced as a UIProcess proxy to the service worker process.
2008         This process proxy is responsible to give the pageID used by all service worker thread instances for network loads.
2009         ServiceWorkerContextManager is responsible to give a unique frameID for all service worker threads.
2010         This is necessary as these two ids are currently needed for any network load.
2011
2012         ServiceWorkerThreadProxy creates its own FrameLoaderClient which is now used to get pageID, frameID and sessionID.
2013
2014         * UIProcess/ServiceWorkerProcessProxy.cpp: Added.
2015         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
2016         (WebKit::m_serviceWorkerPageID):
2017         (WebKit::ServiceWorkerProcessProxy::~ServiceWorkerProcessProxy):
2018         (WebKit::ServiceWorkerProcessProxy::start):
2019         * UIProcess/ServiceWorkerProcessProxy.h: Added.
2020         * UIProcess/WebProcessPool.cpp:
2021         (WebKit::WebProcessPool::getWorkerContextProcessConnection):
2022         (WebKit::WebProcessPool::createNewWebProcess):
2023         (WebKit::WebProcessPool::initializeNewWebProcess):
2024         (WebKit::WebProcessPool::disconnectProcess):
2025         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
2026         (WebKit::WebProcessPool::createWebPage):
2027         * UIProcess/WebProcessPool.h:
2028         * UIProcess/WebProcessProxy.cpp:
2029         (WebKit::WebProcessProxy::generatePageID):
2030         * UIProcess/WebProcessProxy.h:
2031         * WebKit.xcodeproj/project.pbxproj:
2032         * WebProcess/Network/WebLoaderStrategy.cpp:
2033         (WebKit::WebLoaderStrategy::scheduleLoad):
2034         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
2035         (WebKit::WebLoaderStrategy::startPingLoad):
2036         * WebProcess/Network/WebLoaderStrategy.h:
2037         * WebProcess/Storage/ServiceWorkerContextManager.cpp:
2038         (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager):
2039         (WebKit::ServiceWorkerContextManager::startServiceWorker):
2040         (WebKit::ServiceWorkerContextManager::startFetch):
2041         * WebProcess/Storage/ServiceWorkerContextManager.h:
2042         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2043         (WebKit::WebFrameLoaderClient::pageID const):
2044         (WebKit::WebFrameLoaderClient::frameID const):
2045         (WebKit::WebFrameLoaderClient::sessionID const):
2046         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2047         * WebProcess/WebProcess.cpp:
2048         (WebKit::WebProcess::getWorkerContextConnection):
2049         * WebProcess/WebProcess.h:
2050         * WebProcess/WebProcess.messages.in:
2051
2052 2017-10-25  Yousuke Kimoto  <yousuke.kimoto@sony.com>
2053
2054         [WinCairo] Add WebKit platform files for wincairo webkit
2055         https://bugs.webkit.org/show_bug.cgi?id=178000
2056
2057         Reviewed by Alex Christensen.
2058
2059         * Platform/Module.h:
2060         * Platform/SharedMemory.h:
2061         (WebKit::SharedMemory::handle const):
2062         * Platform/win/LoggingWin.cpp: Added. It is based on Source/WebCore/platform/win/LoggingWin.cpp
2063         (WebKit::logLevelString):
2064         * Platform/win/ModuleWin.cpp: Added.
2065         (WebKit::Module::load):
2066         (WebKit::Module::unload):
2067         (WebKit::Module::platformFunctionPointer const):
2068         * Platform/win/SharedMemoryWin.cpp: Added.
2069         (WebKit::SharedMemory::Handle::Handle):
2070         (WebKit::SharedMemory::Handle::~Handle):
2071         (WebKit::SharedMemory::Handle::isNull const):
2072         (WebKit::SharedMemory::Handle::encode const):
2073         (WebKit::SharedMemory::Handle::clear):
2074         (WebKit::getDuplicatedHandle):
2075         (WebKit::SharedMemory::Handle::decode):
2076         (WebKit::protectAttribute):
2077         (WebKit::SharedMemory::allocate):
2078         (WebKit::SharedMemory::create):
2079         (WebKit::accessRights):
2080         (WebKit::SharedMemory::map):
2081         (WebKit::SharedMemory::adopt):
2082         (WebKit::SharedMemory::~SharedMemory):
2083         (WebKit::SharedMemory::createHandle):
2084         (WebKit::SharedMemory::systemPageSize):
2085         * PlatformWin.cmake:
2086
2087 2017-10-25  Chris Dumez  <cdumez@apple.com>
2088
2089         Add support for unregistering a service worker
2090         https://bugs.webkit.org/show_bug.cgi?id=178735
2091
2092         Reviewed by Brady Eidson.
2093
2094         Add support for unregistering a service worker:
2095         - https://w3c.github.io/ServiceWorker/#navigator-service-worker-unregister
2096
2097         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2098         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
2099         (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
2100         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2101         * WebProcess/Storage/WebSWClientConnection.messages.in:
2102
2103 2017-10-25  Chris Dumez  <cdumez@apple.com>
2104
2105         Make SharedStringHashTable less error prone
2106         https://bugs.webkit.org/show_bug.cgi?id=178764
2107
2108         Reviewed by Youenn Fablet.
2109
2110         SharedStringHashTable is backed by SharedMemory and this SharedMemory
2111         may be readonly (and is when used in the WebContent process). As a result,
2112         some of the operations on SharedStringHashTable that write to this shared
2113         memory will crash if called and the SharedMemory is readonly.
2114
2115         To make this less error prone, introduce a new SharedStringHashTableReadOnly
2116         base class for SharedStringHashTable and only keep the operations that
2117         write to the shared memory on SharedStringHashTableReadOnly (namely, add() /
2118         remove() / clear(). Update VisitedLinkTableController and WebSWOriginTable
2119         to use SharedStringHashTableReadOnly since they are instantiated in the
2120         WebContent process and use readonly shared memory.
2121
2122         * Shared/SharedStringHashTable.cpp:
2123         (WebKit::SharedStringHashTableReadOnly::SharedStringHashTableReadOnly):
2124         (WebKit::SharedStringHashTableReadOnly::~SharedStringHashTableReadOnly):
2125         (WebKit::SharedStringHashTableReadOnly::setSharedMemory):
2126         (WebKit::doubleHash):
2127         (WebKit::SharedStringHashTableReadOnly::contains const):
2128         (WebKit::SharedStringHashTableReadOnly::findSlot const):
2129         (WebKit::SharedStringHashTable::SharedStringHashTable):
2130         (WebKit::SharedStringHashTable::~SharedStringHashTable):
2131         (WebKit::SharedStringHashTable::add):
2132         (WebKit::SharedStringHashTable::remove):
2133         (WebKit::SharedStringHashTable::clear):
2134         * Shared/SharedStringHashTable.h:
2135         * WebProcess/Storage/WebSWOriginTable.h:
2136         * WebProcess/WebPage/VisitedLinkTableController.cpp:
2137         (WebKit::VisitedLinkTableController::removeAllVisitedLinks):
2138         * WebProcess/WebPage/VisitedLinkTableController.h:
2139
2140 2017-10-25  Adrian Perez de Castro  <aperez@igalia.com>
2141
2142         [WPE] Remove GLib API functions which use Cairo
2143         https://bugs.webkit.org/show_bug.cgi?id=178205
2144
2145         Reviewed by Michael Catanzaro.
2146
2147         Add PLATFORM(GTK) guards for the parts of of the GLib API which use cairo_surface_t (web
2148         page snapshots and favicons), and remove the affected function prototypes from public API
2149         headers. This way, the WPE version of the API is not tied to Cairo.
2150
2151         * PlatformWPE.cmake:
2152         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
2153         * UIProcess/API/glib/WebKitFaviconDatabasePrivate.h:
2154         * UIProcess/API/glib/WebKitInjectedBundleClient.cpp:
2155         * UIProcess/API/glib/WebKitWebView.cpp:
2156         (webkitWebViewConstructed):
2157         (webkitWebViewGetProperty):
2158         (webkitWebViewDispose):
2159         (webkit_web_view_class_init):
2160         (webkitWebViewLoadChanged):
2161         * UIProcess/API/glib/WebKitWebViewPrivate.h:
2162         * UIProcess/API/wpe/WebKitFaviconDatabase.h:
2163         * UIProcess/API/wpe/WebKitWebView.h:
2164         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
2165         (webkitWebPageDidReceiveMessage):
2166
2167 2017-10-25  Zan Dobersek  <zdobersek@igalia.com>
2168
2169         Make SERVICE_WORKER feature buildable on GTK, WPE
2170         https://bugs.webkit.org/show_bug.cgi?id=178574
2171
2172         Reviewed by Carlos Garcia Campos.
2173
2174         * CMakeLists.txt: Add missing files to the build.
2175         * StorageProcess/StorageProcess.cpp:
2176         (WebKit::StorageProcess::didGetWorkerContextProcessConnection):
2177         IPC::Attachment object should be accessed through an rvalue reference,
2178         making it mutable and enabling releasing the file descriptor.
2179         * StorageProcess/StorageProcess.h: Adjust the method signature.
2180         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2181         Explicitly include the ResourceError header from WebCore (using a forwarding header).
2182         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
2183         Include the CachedResource header from WebCore (again using a forwarding header).
2184         * WebProcess/Storage/WebServiceWorkerProvider.h: Forward-declare the WebCore::CachedResource type.
2185
2186 2017-10-24  Youenn Fablet  <youenn@apple.com>
2187
2188         ServiceWorkerClientFetch should return an error that is not null in case of failure
2189         https://bugs.webkit.org/show_bug.cgi?id=178761
2190
2191         Reviewed by Geoffrey Garen.
2192
2193         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2194         (WebKit::ServiceWorkerClientFetch::didFail): Generating a General error.
2195
2196 2017-10-24  Youenn Fablet  <youenn@apple.com>
2197
2198         Enable service worker to use cache storage api
2199         https://bugs.webkit.org/show_bug.cgi?id=178684
2200
2201         Reviewed by Brady Eidson.
2202
2203         Passing the WebPreferences store of the default page group of the WebProcessPool to its ServiceWorker process.
2204         ServiceWorkerContextManager then uses it to initialize the preferences accordingly.
2205         Patch is covered by new test which is using cache api previously disabled and now enabled through the store.
2206
2207         Made use of the new ServiceWorkerThreadProxy in ServiceWorkerContextManager to enable a cache storage connection.
2208         Fixed the default size of quota in WebsiteDataStore.
2209
2210         * UIProcess/WebProcessPool.cpp:
2211         (WebKit::WebProcessPool::getWorkerContextProcessConnection):
2212         * UIProcess/WebsiteData/WebsiteDataStore.h:
2213         * WebProcess/Storage/ServiceWorkerContextManager.cpp:
2214         (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager):
2215         (WebKit::ServiceWorkerContextManager::updatePreferences):
2216         (WebKit::ServiceWorkerContextManager::startServiceWorker):
2217         (WebKit::ServiceWorkerContextManager::startFetch):
2218         * WebProcess/Storage/ServiceWorkerContextManager.h:
2219         (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager): Deleted.
2220         * WebProcess/WebProcess.cpp:
2221         (WebKit::WebProcess::getWorkerContextConnection):
2222         * WebProcess/WebProcess.h:
2223         * WebProcess/WebProcess.messages.in:
2224
2225 2017-10-24  Alex Christensen  <achristensen@webkit.org>
2226
2227         Selecting and right-clicking URL-like strings with IDNA-disallowed characters in host or authority causes rendering engine crash
2228         https://bugs.webkit.org/show_bug.cgi?id=174267
2229
2230         Reviewed by Tim Horton.
2231
2232         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2233         (WKBundlePageCanHandleRequest):
2234
2235 2017-10-24  Chris Dumez  <cdumez@apple.com>
2236
2237         Add initial implementation for serviceWorker.postMessage()
2238         https://bugs.webkit.org/show_bug.cgi?id=178534
2239
2240         Reviewed by Youenn Fablet.
2241
2242         Add initial implementation for serviceWorker.postMessage():
2243         - https://w3c.github.io/ServiceWorker/#service-worker-postmessage
2244
2245         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2246         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
2247         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2248         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2249         * WebProcess/Storage/ServiceWorkerContextManager.cpp:
2250         (WebKit::ServiceWorkerContextManager::postMessageToServiceWorkerGlobalScope):
2251         * WebProcess/Storage/ServiceWorkerContextManager.h:
2252         * WebProcess/Storage/ServiceWorkerContextManager.messages.in:
2253         * WebProcess/Storage/WebSWClientConnection.cpp:
2254         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
2255         * WebProcess/Storage/WebSWClientConnection.h:
2256
2257 2017-10-24  Brent Fulgham  <bfulgham@apple.com>
2258
2259         Adopt new secure coding APIs
2260         https://bugs.webkit.org/show_bug.cgi?id=178484
2261         <rdar://problem/34837193>
2262
2263         Reviewed by Tim Horton.
2264
2265         Switch to new NSKeyed[Un]Archiver methods that active and use
2266         NSSecureCoding by default.
2267
2268         * Platform/ios/AccessibilityIOS.mm:
2269         (WebKit::newAccessibilityRemoteToken): Use secure-by-default API.
2270         * Shared/Cocoa/DataDetectionResult.mm:
2271         (WebKit::DataDetectionResult::encode const): Ditto.
2272         (WebKit::DataDetectionResult::decode): Ditto.
2273         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2274         (IPC::ArgumentCoder<WebCore::Payment>::encode): Ditto.
2275         (IPC::ArgumentCoder<WebCore::Payment>::decode): Ditto.
2276         (IPC::ArgumentCoder<WebCore::PaymentContact>::encode): Ditto.
2277         (IPC::ArgumentCoder<WebCore::PaymentContact>::decode): Ditto.
2278         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode): Ditto.
2279         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::decode): Ditto.
2280         (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode): Ditto.
2281         (IPC::ArgumentCoder<WebCore::PaymentMethod>::decode): Ditto.
2282         * Shared/ios/InteractionInformationAtPosition.mm:
2283         (WebKit::InteractionInformationAtPosition::encode const): Ditto.
2284         (WebKit::InteractionInformationAtPosition::decode): Ditto.
2285         * Shared/mac/WebCoreArgumentCodersMac.mm:
2286         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Ditto.
2287         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Ditto.
2288         (IPC::ArgumentCoder<Credential>::encodePlatformData): Ditto.
2289         (IPC::ArgumentCoder<Credential>::decodePlatformData): Ditto.
2290         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode): Ditto.
2291         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode): Ditto.
2292         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): Ditto.
2293         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): Ditto.
2294         * Shared/mac/WebHitTestResultData.mm:
2295         (WebKit::WebHitTestResultData::platformEncode const): Ditto.
2296         (WebKit::WebHitTestResultData::platformDecode): Ditto.
2297         * UIProcess/API/Cocoa/WKProcessPool.mm:
2298         (-[WKProcessPool _setObject:forBundleParameter:]): Ditto.
2299         (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]): Ditto.
2300         * UIProcess/API/Cocoa/WKWebView.mm:
2301         (-[WKWebView _setInputDelegate:]): Ditto.
2302         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2303         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
2304         * UIProcess/ios/PageClientImplIOS.mm:
2305         (WebKit::PageClientImpl::startAssistingNode): Ditto.
2306         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2307         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Ditto.
2308         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
2309         (WebKit::InjectedBundle::initialize): Ditto.
2310         (WebKit::InjectedBundle::setBundleParameter): Ditto.
2311         (WebKit::InjectedBundle::setBundleParameters): Ditto.
2312
2313 2017-10-24  Sam Weinig  <sam@webkit.org>
2314
2315         [Settings] Add initial support for generating preferences related code
2316         https://bugs.webkit.org/show_bug.cgi?id=178656
2317
2318         Reviewed by Dean Jackson.
2319
2320         As a first step towards getting off the macros in WebPreferencesDefinitions.h
2321         and reducing the overhead of adding a preference, this change generates adds
2322         WebPreferences.yaml where preference changes will go, and generates much of
2323         WebPreferencesDefinitions.h from it (all the custom defaults moved to 
2324         WebPreferencesDefinitionsBase.h). Subsequent changes will remove the need for 
2325         the macros in WebPreferencesDefinitions.h entirely.
2326
2327         * CMakeLists.txt:
2328         * DerivedSources.make:
2329         * WebKit.xcodeproj/project.pbxproj:
2330         
2331             Add new files / rules to generate WebPreferencesDefinitions.h.
2332         
2333         * Scripts/GeneratePreferences.rb: Added.
2334         * Scripts/PreferencesTemplates: Added.
2335         * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb: Added.
2336         
2337             Add scripts and template to generate WebPreferencesDefinitions.h from
2338             WebPreferences.yaml.
2339
2340         * Shared/WebPreferences.yaml: Added.
2341         
2342             Configuration file for preferences.
2343         
2344         * Shared/WebPreferencesDefinitions.h: Removed.
2345         * Shared/WebPreferencesDefinitionsBase.h: Copied from Source/WebKit/Shared/WebPreferencesDefinitions.h.
2346         
2347             Moved custom defaults to new WebPreferencesDefinitionsBase.h. Removed the need for 
2348             FOR_EACH_WEBKIT_STRING_PREFERENCE by using custom defaults for the font family values.
2349
2350 2017-10-24  Matt Lewis  <jlewis3@apple.com>
2351
2352         Unreviewed, rolling out r223889.
2353
2354         This caused multiple crashes on all platforms
2355
2356         Reverted changeset:
2357
2358         "Adopt new secure coding APIs"
2359         https://bugs.webkit.org/show_bug.cgi?id=178484
2360         https://trac.webkit.org/changeset/223889
2361
2362 2017-10-24  Youenn Fablet  <youenn@apple.com>
2363
2364         ASSERTION FAILED: !m_serviceWorkerManager in WebProcess::getWorkerContextConnection() on API tests
2365         https://bugs.webkit.org/show_bug.cgi?id=178586
2366         <rdar://problem/35115902>
2367
2368         Reviewed by Brady Eidson.
2369
2370        Covered by API tests no longer crashing.
2371
2372         * UIProcess/WebProcessPool.cpp:
2373         (WebKit::WebProcessPool::getWorkerContextProcessConnection): Sending a worker context process connection message only at creation of the service worker process.
2374
2375 2017-10-24  Brent Fulgham  <bfulgham@apple.com>
2376
2377         Adopt new secure coding APIs
2378         https://bugs.webkit.org/show_bug.cgi?id=178484
2379         <rdar://problem/34837193>
2380
2381         Reviewed by Tim Horton.
2382
2383         Switch to new NSKeyed[Un]Archiver methods that active and use
2384         NSSecureCoding by default.
2385
2386         * Platform/ios/AccessibilityIOS.mm:
2387         (WebKit::newAccessibilityRemoteToken): Use secure-by-default API.
2388         * Shared/Cocoa/DataDetectionResult.mm:
2389         (WebKit::DataDetectionResult::encode const): Ditto.
2390         (WebKit::DataDetectionResult::decode): Ditto.
2391         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2392         (IPC::ArgumentCoder<WebCore::Payment>::encode): Ditto.
2393         (IPC::ArgumentCoder<WebCore::Payment>::decode): Ditto.
2394         (IPC::ArgumentCoder<WebCore::PaymentContact>::encode): Ditto.
2395         (IPC::ArgumentCoder<WebCore::PaymentContact>::decode): Ditto.
2396         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode): Ditto.
2397         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::decode): Ditto.
2398         (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode): Ditto.
2399         (IPC::ArgumentCoder<WebCore::PaymentMethod>::decode): Ditto.
2400         * Shared/ios/InteractionInformationAtPosition.mm:
2401         (WebKit::InteractionInformationAtPosition::encode const): Ditto.
2402         (WebKit::InteractionInformationAtPosition::decode): Ditto.
2403         * Shared/mac/WebCoreArgumentCodersMac.mm:
2404         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Ditto.
2405         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Ditto.
2406         (IPC::ArgumentCoder<Credential>::encodePlatformData): Ditto.
2407         (IPC::ArgumentCoder<Credential>::decodePlatformData): Ditto.
2408         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode): Ditto.
2409         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode): Ditto.
2410         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): Ditto.
2411         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): Ditto.
2412         * Shared/mac/WebHitTestResultData.mm:
2413         (WebKit::WebHitTestResultData::platformEncode const): Ditto.
2414         (WebKit::WebHitTestResultData::platformDecode): Ditto.
2415         * UIProcess/API/Cocoa/WKProcessPool.mm:
2416         (-[WKProcessPool _setObject:forBundleParameter:]): Ditto.
2417         (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]): Ditto.
2418         * UIProcess/API/Cocoa/WKWebView.mm:
2419         (-[WKWebView _setInputDelegate:]): Ditto.
2420         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2421         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
2422         * UIProcess/ios/PageClientImplIOS.mm:
2423         (WebKit::PageClientImpl::startAssistingNode): Ditto.
2424         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2425         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Ditto.
2426         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
2427         (WebKit::InjectedBundle::initialize): Ditto.
2428         (WebKit::InjectedBundle::setBundleParameter): Ditto.
2429         (WebKit::InjectedBundle::setBundleParameters): Ditto.
2430
2431 2017-10-24  Zan Dobersek  <zdobersek@igalia.com>
2432
2433         [GTK][WPE] generate-forwarding-headers.pl should also scan derived sources in WebKit framework
2434         https://bugs.webkit.org/show_bug.cgi?id=178579
2435
2436         Reviewed by Carlos Garcia Campos.
2437
2438         * PlatformGTK.cmake: When generating forwarding headers, derived sources
2439         should be scanned as well. The DERIVED_SOURCES_WEBKIT_DIR value has to
2440         be passed as an include path to the generate-forward-headers.pl script
2441         to achieve that. This target then also has to depend on all the derived
2442         source files to be generated before this can be performed.
2443         * PlatformWPE.cmake: Ditto.
2444
2445 2017-10-23  Brian Burg  <bburg@apple.com>
2446
2447         [Cocoa] Web Automation: add SPI to tell whether the automation session is currently simulating user interactions
2448         https://bugs.webkit.org/show_bug.cgi?id=178616
2449
2450         Reviewed by Joseph Pecoraro.
2451
2452         This is needed to disambiguate whether an action (such as selectAll:) came from
2453         a user clicking on "Edit > Select All" in a menu or whether it was produced by
2454         simulating the keystrokes to produce the chord for "Command + a". Some clients,
2455         such as Safari, would allow the latter but not the former during automation.
2456
2457         * UIProcess/API/Cocoa/_WKAutomationSession.h:
2458         * UIProcess/API/Cocoa/_WKAutomationSession.mm:
2459         (-[_WKAutomationSession isSimulatingUserInteraction]):
2460         Add new SPI property that's backed by the same WebAutomationSession method.
2461
2462         * UIProcess/Automation/WebAutomationSession.h:
2463         * UIProcess/Automation/WebAutomationSession.cpp:
2464         (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
2465         (WebKit::WebAutomationSession::performMouseInteraction):
2466         (WebKit::WebAutomationSession::performKeyboardInteractions):
2467         Set m_simulatingUserInteraction prior to sending the synthesized events. It will
2468         be cleared when keyboardEventsFlushedForPage() is called by WebPageProxy.
2469
2470         * UIProcess/WebPageProxy.cpp:
2471         (WebKit::WebPageProxy::didReceiveEvent):
2472         Notify the automation session that the key event queue was flushed *after* giving
2473         delegates a chance to do something with the key event. This is necessary so that
2474         any actions that are created from the NSEvent by the delegates are handled prior
2475         to the automation session finishing its keyboard interaction command.
2476
2477 2017-10-23  Brian Burg  <bburg@apple.com>
2478
2479         [Mac] Web Automation: key modifiers for synthesized NSEvents are incorrect
2480         https://bugs.webkit.org/show_bug.cgi?id=178615
2481
2482         Reviewed by Joseph Pecoraro.
2483
2484         In both PLATFORM(MAC) platform methods for simulating keyboard interactions,
2485         we errantly relied on +[NSEvent modifierFlags] to get the current state of
2486         sticky modifiers when creating synthesized events. This is incorrect for two reasons:
2487         modifierFlags is never updated when simulating a sequence of events (because
2488         all the events are synthesized before any are delivered); and the NSEvent class
2489         method only reflects the modifier state of the primary physical keyboard, which
2490         is not affected by synthesized NSEvents that happen to have modifier flags.
2491
2492         Instead, just keep our own m_currentModifiers state in the session and compute
2493         the necessary NSEventModifierFlags to put on each synthesized event. This aligns
2494         the implementation with the treatment of sticky keys in the iOS and GTK platform methods.
2495
2496         * UIProcess/Automation/WebAutomationSession.h: Every port gets this variable now.
2497         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
2498         (WebKit::WebAutomationSession::platformSimulateKeyStroke):
2499         (WebKit::WebAutomationSession::platformSimulateKeySequence):
2500         Use and update m_currentModifiers.
2501
2502 2017-10-23  Alex Christensen  <achristensen@webkit.org>
2503
2504         Fix ASAN test after r222824
2505         https://bugs.webkit.org/show_bug.cgi?id=178688
2506         <rdar://problem/35104706>
2507
2508         Reviewed by Tim Horton.
2509
2510         * UIProcess/WebBackForwardList.cpp:
2511         (WebKit::WebBackForwardList::clear):
2512         Resizing a list of Ref<T> after we've WTFMoved all the elements doesn't make ASAN happy.
2513
2514 2017-10-23  Tim Horton  <timothy_horton@apple.com>
2515
2516         Stop using _UIApplicationUsesLegacyUI()
2517         https://bugs.webkit.org/show_bug.cgi?id=178680
2518         <rdar://problem/35131949>
2519
2520         Reviewed by Dan Bernstein.
2521
2522         * Platform/spi/ios/UIKitSPI.h:
2523         * UIProcess/ios/forms/WKFormSelectPopover.mm:
2524         (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
2525         (-[WKSelectPopover initWithView:hasGroups:]):
2526         Resolve _UIApplicationUsesLegacyUI to false and simplify.
2527
2528 2017-10-23  Ryan Haddad  <ryanhaddad@apple.com>
2529
2530         Unreviewed, suppress deprecation warnings to fix the build.
2531         <rdar://problem/35131949>
2532
2533         * UIProcess/ios/forms/WKFormSelectPopover.mm:
2534         (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
2535         (-[WKSelectPopover initWithView:hasGroups:]):
2536
2537 2017-10-23  Youenn Fablet  <youenn@apple.com>
2538
2539         TestController should clear all fetch caches when resetting its state
2540         https://bugs.webkit.org/show_bug.cgi?id=178486
2541         <rdar://problem/35066305>
2542
2543         Reviewed by Chris Dumez.
2544
2545         Adding a new DidNotHandle message to disambiguate with the DidFail fetch case.
2546         With DidNotHandle, the loading should go the network process.
2547         With DidFail, the loading should return a network error.
2548
2549         On receiving an order to start a fetch, ServiceWorkerThread will dispatch a fetch event.
2550         The client of this event will retrieve the response and return it to the WebProcess through IPC.
2551
2552         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2553         (WebKit::WebSWServerConnection::didNotHandleFetch):
2554         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2555         * StorageProcess/StorageProcess.cpp:
2556         (WebKit::StorageProcess::didNotHandleFetch):
2557         * StorageProcess/StorageProcess.h:
2558         * StorageProcess/StorageProcess.messages.in:
2559         * WebKit.xcodeproj/project.pbxproj:
2560         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2561         (WebKit::ServiceWorkerClientFetch::didFail):
2562         (WebKit::ServiceWorkerClientFetch::didNotHandle):
2563         * WebProcess/Storage/ServiceWorkerClientFetch.h:
2564         * WebProcess/Storage/ServiceWorkerClientFetch.messages.in:
2565         * WebProcess/Storage/ServiceWorkerContextManager.cpp:
2566         (WebKit::ServiceWorkerContextManager::startFetch):
2567         * WebProcess/Storage/ServiceWorkerContextManager.h:
2568         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: Added.
2569         (WebKit::WebServiceWorkerFetchTaskClient::~WebServiceWorkerFetchTaskClient):
2570         (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
2571         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveResponse):
2572         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
2573         (WebKit::WebServiceWorkerFetchTaskClient::didFail):
2574         (WebKit::WebServiceWorkerFetchTaskClient::didFinish):
2575         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h: Added.
2576         * WebProcess/WebProcess.cpp:
2577         (WebKit::WebProcess::startFetchInServiceWorker):
2578         * WebProcess/WebProcess.h:
2579
2580 2017-10-22  Wenson Hsieh  <wenson_hsieh@apple.com>
2581
2582         [iOS] WebProcess::initializeWebProcess spends ~150ms spinning up AVSystemController on some devices
2583         https://bugs.webkit.org/show_bug.cgi?id=178640
2584         <rdar://problem/35113105>
2585
2586         Reviewed by Youenn Fablet.
2587
2588         In r213933, we added a mechanism to allow the web process to drive media capture, by setting an attribute on the
2589         shared AVSystemController. This requires us to fault in the Celestial framework, which is a slight performance
2590         hit on some hardware. Instead of doing this at the start of every web process launch, we can just do this work
2591         lazily, the first time the web process requests permissions for user media access.
2592
2593         * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
2594         (WebKit::WebUserMediaClient::requestUserMediaAccess):
2595         * WebProcess/WebPage/WebPage.cpp:
2596         (WebKit::WebPage::prepareToSendUserMediaPermissionRequest):
2597         * WebProcess/WebPage/WebPage.h:
2598         * WebProcess/WebPage/ios/WebPageIOS.mm:
2599         (WebKit::WebPage::prepareToSendUserMediaPermissionRequest):
2600         * WebProcess/cocoa/WebProcessCocoa.mm:
2601         (WebKit::WebProcess::platformInitializeWebProcess):
2602
2603 2017-10-21  Michael Catanzaro  <mcatanzaro@igalia.com>
2604
2605         Unreviewed, silence a -Wunused-but-set-variable warning
2606
2607         * WebProcess/WebPage/EventDispatcher.cpp:
2608         (WebKit::EventDispatcher::wheelEvent):
2609
2610 2017-10-20  Alex Christensen  <achristensen@webkit.org>
2611
2612         Add FIXME comment after r223803
2613         https://bugs.webkit.org/show_bug.cgi?id=178418
2614
2615         * UIProcess/WebProcessPool.cpp:
2616         (WebKit::WebProcessPool::ensureNetworkProcess):
2617         We need some work to better support customized persistent data stores.  Add a comment indicating such.
2618
2619 2017-10-20  Alex Christensen  <achristensen@webkit.org>
2620
2621         Fix API tests after r223791.
2622         https://bugs.webkit.org/show_bug.cgi?id=178418
2623
2624         * UIProcess/WebProcessPool.cpp:
2625         (WebKit::WebProcessPool::ensureNetworkProcess):
2626         Whatever NetworkSessionInitializationParameters we send with the NetworkProcess initialization message,
2627         that's the default session.  This is needed for WebKit.WebsiteDataStoreCustomPaths.
2628         (WebKit::WebProcessPool::createNewWebProcess):
2629         Don't change behavior or NetworkProcess initialization like I did in r223791.
2630
2631 2017-10-20  Alex Christensen  <achristensen@webkit.org>
2632
2633         Fix download tests on El Capitan after r223730
2634         https://bugs.webkit.org/show_bug.cgi?id=178547
2635
2636         * UIProcess/Downloads/DownloadProxy.cpp:
2637         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
2638         Revert to original behavior.  This uses suggestedFilename, which may have come from places like
2639         the download attribute, instead of always using the filename from CFNetwork.
2640
2641 2017-10-20  Alex Christensen  <achristensen@webkit.org>
2642
2643         Expose _boundInterfaceIdentifier and _allowsCellularAccess to WKWebsiteDataStorePrivate
2644         https://bugs.webkit.org/show_bug.cgi?id=178418
2645         <rdar://problem/29599569>
2646
2647         Reviewed by Tim Horton.
2648         
2649         In r213747 I introduced allowsCellularAccess to _WKProcessPoolConfiguration because there
2650         was no way to add parameters to the default (and other) NetworkSession constructors.  Since
2651         clients have not adopted this SPI, we can introduce such a way in NetworkSessionCreationParameters
2652         and move the SPI to WKWebsiteDataStore, which is where it and other NetworkSession properties
2653         ought to be instead of making them WKProcessPool global.
2654
2655         We also need to expose access to NSURLRequest.boundInterfaceIdentifier.  Instead of serializing and
2656         deserializing that property for each NSURLRequest and then having subresources mysteriously jump back
2657         to having no bound interface identifiers, I'm adding this to WKWebsiteDataStore, too, to make it a
2658         session networking property.
2659         
2660         I manually verified that these properties are being set properly with a custom test app and added logs.
2661         Unfortunately, these properties don't do anything under circumstances anywhere close to what we test.
2662         The architecture change of having NetworkSessionCreationParameters is verified to not have a change in
2663         behavior by existing tests, such as any test that uses TestProtocol (which we should eventually remove).
2664
2665         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2666         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
2667         * NetworkProcess/NetworkProcess.cpp:
2668         (WebKit::NetworkProcess::NetworkProcess):
2669         (WebKit::NetworkProcess::initializeNetworkProcess):
2670         (WebKit::NetworkProcess::clearCachedCredentials):
2671         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2672         (WebKit::NetworkProcessCreationParameters::encode const):
2673         (WebKit::NetworkProcessCreationParameters::decode):
2674         * NetworkProcess/NetworkProcessCreationParameters.h:
2675         * NetworkProcess/NetworkSession.cpp:
2676         (WebKit::NetworkSession::create):
2677         (WebKit::NetworkSession::defaultSession): Deleted.
2678         * NetworkProcess/NetworkSession.h:
2679         * NetworkProcess/NetworkSessionCreationParameters.h: Added.
2680         (WebKit::NetworkSessionCreationParameters::encode const):
2681         (WebKit::NetworkSessionCreationParameters::decode):
2682         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2683         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
2684         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2685         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
2686         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2687         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2688         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
2689         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2690         (WebKit::NetworkSessionCocoa::setSourceApplicationSecondaryIdentifier):
2691         (WebKit::NetworkSessionCocoa::create):
2692         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2693         (WebKit::NetworkSessionCocoa::setLegacyCustomProtocolManager): Deleted.
2694         (WebKit::NetworkSessionCocoa::setAllowsCellularAccess): Deleted.
2695         (WebKit::NetworkSessionCocoa::defaultSession): Deleted.
2696         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2697         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
2698         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
2699         * Shared/SessionTracker.cpp:
2700         (WebKit::SessionTracker::networkSession):
2701         (WebKit::SessionTracker::setSession):
2702         * Shared/WebsiteDataStoreParameters.cpp:
2703         (WebKit::WebsiteDataStoreParameters::encode const):
2704         (WebKit::WebsiteDataStoreParameters::decode):
2705         * Shared/WebsiteDataStoreParameters.h:
2706         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2707         (API::ProcessPoolConfiguration::copy):
2708         * UIProcess/API/APIProcessPoolConfiguration.h:
2709         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2710         (-[WKWebsiteDataStore _setBoundInterfaceIdentifier:]):
2711         (-[WKWebsiteDataStore _boundInterfaceIdentifier]):
2712         (-[WKWebsiteDataStore _setAllowsCellularAccess:]):
2713         (-[WKWebsiteDataStore _allowsCellularAccess]):
2714         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2715         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2716         (-[_WKProcessPoolConfiguration allowsCellularAccess]):
2717         (-[_WKProcessPoolConfiguration setAllowsCellularAccess:]):
2718         * UIProcess/WebProcessPool.cpp:
2719         (WebKit::WebProcessPool::ensureNetworkProcess):
2720         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
2721         * UIProcess/WebsiteData/WebsiteDataStore.h:
2722         (WebKit::WebsiteDataStore::setBoundInterfaceIdentifier):
2723         (WebKit::WebsiteDataStore::boundInterfaceIdentifier):
2724         (WebKit::WebsiteDataStore::setAllowsCellularAccess):
2725         (WebKit::WebsiteDataStore::allowsCellularAccess):
2726         * WebKit.xcodeproj/project.pbxproj:
2727         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2728         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
2729         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
2730         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
2731         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
2732         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
2733         * WebProcess/WebProcess.cpp:
2734         (WebKit::WebProcess::ensurePrivateBrowsingSession):
2735         (WebKit::WebProcess::clearCachedCredentials):
2736
2737 2017-10-20  Alex Christensen  <achristensen@webkit.org>
2738
2739         Add ObjC SPI to _WKDownloadDelegate missing from WKContextDownloadClient
2740         https://bugs.webkit.org/show_bug.cgi?id=178566
2741         <rdar://problem/23041906>
2742
2743         Reviewed by Brady Eidson.
2744
2745         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
2746         * UIProcess/Cocoa/DownloadClient.h:
2747         * UIProcess/Cocoa/DownloadClient.mm:
2748         (WebKit::DownloadClient::DownloadClient):
2749         (WebKit::DownloadClient::didReceiveAuthenticationChallenge):
2750         (WebKit::DownloadClient::shouldDecodeSourceDataOfMIMEType):
2751         (WebKit::DownloadClient::didCreateDestination):
2752         (WebKit::DownloadClient::processDidCrash):
2753
2754 2017-10-20  Youenn Fablet  <youenn@apple.com>
2755
2756         ResourceResponse should have a ServiceWorker source
2757         https://bugs.webkit.org/show_bug.cgi?id=178593
2758
2759         Reviewed by Alex Christensen.
2760
2761         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2762         (WebKit::ServiceWorkerClientFetch::didReceiveResponse): setting response source to ServiceWorker.
2763         * WebProcess/Storage/ServiceWorkerClientFetch.h:
2764
2765 2017-10-20  Antoine Quint  <graouts@apple.com>
2766
2767         [Web Animations] Provide basic timeline and animation interfaces
2768         https://bugs.webkit.org/show_bug.cgi?id=178526
2769
2770         Reviewed by Dean Jackson.
2771
2772         Remove the WEB_ANIMATIONS compile-time flag.
2773
2774         * Configurations/FeatureDefines.xcconfig:
2775         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2776         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2777         (WebKit::InjectedBundle::setWebAnimationsEnabled):
2778         * WebProcess/WebPage/WebPage.cpp:
2779         (WebKit::WebPage::updatePreferences):
2780
2781 2017-10-02  Brian Burg  <bburg@apple.com>
2782
2783         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
2784         https://bugs.webkit.org/show_bug.cgi?id=177661
2785         <rdar://problem/34740286>
2786
2787         Reviewed by Joseph Pecoraro.
2788
2789         Move setup and delegates of the inspector frontend page into implementations of
2790         WebInspectorProxy::platformCreateFrontendPage. The Mac implementation
2791         will be subsumed by WKInspectorViewController, while the GTK implementation
2792         is inherited from the cross-platform version that uses C API. Eventually the
2793         GTK version should use GTK API rather than the soon to be deprecated C API.
2794
2795         * UIProcess/WebInspectorProxy.cpp:
2796         (WebKit::WebInspectorProxy::createFrontendPage):
2797         (WebKit::webProcessDidCrash): Deleted.
2798         (WebKit::decidePolicyForNavigationAction): Deleted.
2799         (WebKit::getContextMenuFromProposedMenu): Deleted.
2800         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2801         (WebKit::exceededDatabaseQuota):
2802         (WebKit::webProcessDidCrash):
2803         (WebKit::decidePolicyForNavigationAction):
2804         (WebKit::getContextMenuFromProposedMenu):
2805         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
2806         * UIProcess/mac/WebInspectorProxyMac.mm:
2807         (WebKit::exceededDatabaseQuota):
2808         (WebKit::webProcessDidCrash):
2809         (WebKit::decidePolicyForNavigationAction):
2810         (WebKit::getContextMenuFromProposedMenu):
2811         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
2812
2813 2017-10-02  Brian Burg  <bburg@apple.com>
2814
2815         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
2816         https://bugs.webkit.org/show_bug.cgi?id=177661
2817         <rdar://problem/34740286>
2818
2819         Reviewed by Joseph Pecoraro.
2820
2821         Adopt WKInspectorViewController in WebInspectorProxyMac to set up the
2822         frontend's web view.
2823
2824         * UIProcess/WebInspectorProxy.cpp:
2825         (WebKit::WebInspectorProxy::invalidate):
2826         (WebKit::WebInspectorProxy::close):
2827         (WebKit::WebInspectorProxy::didClose):
2828         (WebKit::WebInspectorProxy::closeFrontendPageAndWindow):
2829         Make closeFrontendPageAndWindow into the method that does work.
2830         Only use didClose() as the IPC message entry point.
2831
2832         * UIProcess/WebInspectorProxy.h:
2833         (WebKit::WebInspectorProxy::isUnderTest const): Make public.
2834
2835         * UIProcess/mac/WKInspectorViewController.h:
2836         * UIProcess/mac/WKInspectorViewController.mm:
2837         (+[WKInspectorViewController viewIsInspectorWebView:]):
2838         Abstract away the -isInstanceOfClass: check for WKInspectorWKWebView.
2839         Clients shouldn't need to know whether we use a subclass or what its name is.
2840
2841         * UIProcess/mac/WebInspectorProxyMac.mm:
2842         (-[WKWebInspectorProxyObjCAdapter inspectorViewControllerInspectorDidCrash:]):
2843         (-[WKWebInspectorProxyObjCAdapter inspectorViewControllerInspectorIsUnderTest:]):
2844         Hook up view controller delegates.
2845
2846         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
2847         (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
2848         (WebKit::WebInspectorProxy::closeFrontendPage):
2849         New implementation based on the view controller.
2850
2851         (WebKit::WebInspectorProxy::platformBringToFront):
2852         (WebKit::WebInspectorProxy::platformIsFront):
2853         (WebKit::WebInspectorProxy::platformCanAttach):
2854         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
2855         (WebKit::WebInspectorProxy::platformAttach):
2856         (WebKit::WebInspectorProxy::platformDetach):
2857         (WebKit::WebInspectorProxy::platformStartWindowDrag):
2858         Adjust to get the WKWebView out of the view controller for code that needs
2859         to do something with the NSView, such as get/set the frame.
2860
2861         (WebKit::WebInspectorProxy::createFrontendConfiguration): Deleted.
2862         (WebKit::exceededDatabaseQuota): Deleted.
2863         (WebKit::webProcessDidCrash): Deleted.
2864         (WebKit::decidePolicyForNavigationAction): Deleted.
2865         (WebKit::getContextMenuFromProposedMenu): Deleted.
2866
2867 2017-10-02  Brian Burg  <bburg@apple.com>
2868
2869         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
2870         https://bugs.webkit.org/show_bug.cgi?id=177661
2871         <rdar://problem/34740286>
2872
2873         Reviewed by Joseph Pecoraro.
2874
2875         Introduce new platform methods to open and close the frontend page and window.
2876         This matches how RemoteWebInspectorProxy divides work up into platform methods.
2877         Move existing code from platformDidClose, platformOpen, and other methods into
2878         the new platform methods. Move some identical platform code into WebInspectorProxy.cpp.
2879
2880         * UIProcess/WebInspectorProxy.h:
2881         * UIProcess/WebInspectorProxy.cpp:
2882         (WebKit::WebInspectorProxy::connect):
2883         (WebKit::WebInspectorProxy::showConsole):
2884         (WebKit::WebInspectorProxy::showResources):
2885         (WebKit::WebInspectorProxy::showTimelines):
2886         (WebKit::WebInspectorProxy::showMainResourceForFrame):
2887         (WebKit::WebInspectorProxy::createFrontendPage):
2888         (WebKit::WebInspectorProxy::createInspectorPage):
2889         (WebKit::WebInspectorProxy::open):
2890         (WebKit::WebInspectorProxy::didClose):
2891         (WebKit::WebInspectorProxy::eagerlyCreateInspectorPage): Renamed.
2892
2893         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2894         (WebKit::WebInspectorProxy::updateInspectorWindowTitle const):
2895         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
2896         Do everything necessary to set up the frontend page WebView.
2897
2898         (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
2899         Do everything necessary to set up the detached NSWindow for the frontend.
2900
2901         (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
2902         (WebKit::WebInspectorProxy::platformDetach):
2903         (WebKit::WebInspectorProxy::platformCreateInspectorPage): Deleted.
2904         (WebKit::WebInspectorProxy::createInspectorWindow): Deleted.
2905         (WebKit::WebInspectorProxy::platformOpen): Deleted.
2906         (WebKit::WebInspectorProxy::platformDidClose): Deleted.
2907
2908         * UIProcess/mac/WebInspectorProxyMac.mm:
2909         (WebKit::WebInspectorProxy::updateInspectorWindowTitle const):
2910         (WebKit::WebInspectorProxy::platformCreateFrontendPage): Added.
2911         Do everything necessary to set up the frontend page WebView.
2912
2913         (WebKit::WebInspectorProxy::platformCreateFrontendWindow): Added.
2914         Do everything necessary to set up the detached NSWindow for the frontend.
2915
2916         (WebKit::WebInspectorProxy::closeFrontendPage):
2917         (WebKit::WebInspectorProxy::closeFrontendAfterInactivityTimerFired):
2918         (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
2919         (WebKit::WebInspectorProxy::platformDidCloseForCrash):
2920         (WebKit::WebInspectorProxy::platformInvalidate):
2921         (WebKit::WebInspectorProxy::platformBringToFront): Carry through renamings.
2922
2923         (WebKit::WebInspectorProxy::platformDetach):
2924         Defer to the general open() method to create a window if needed and bring it to front.
2925
2926         (WebKit::WebInspectorProxy::platformCanAttach): Move this below open/close code.
2927
2928         (WebKit::WebInspectorProxy::closeFrontend): Deleted.
2929         (WebKit::WebInspectorProxy::createInspectorWindow): Deleted.
2930         (WebKit::WebInspectorProxy::platformCreateInspectorPage): Deleted.
2931         (WebKit::WebInspectorProxy::platformOpen): Deleted.
2932         (WebKit::WebInspectorProxy::platformDidClose): Deleted.
2933         Defer to the general open() method to create a window if needed and bring it to front.
2934
2935         * UIProcess/wpe/WebInspectorProxyWPE.cpp:
2936         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
2937         (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
2938         (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
2939         (WebKit::WebInspectorProxy::platformCreateInspectorPage): Deleted.
2940         (WebKit::WebInspectorProxy::createInspectorWindow): Deleted.
2941         (WebKit::WebInspectorProxy::platformOpen): Deleted.
2942         (WebKit::WebInspectorProxy::platformDidClose): Deleted.
2943         Update stubs.
2944
2945 2017-10-02  Brian Burg  <bburg@apple.com>
2946
2947         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
2948         https://bugs.webkit.org/show_bug.cgi?id=177661
2949         <rdar://problem/34740286>
2950
2951         Reviewed by Joseph Pecoraro.
2952
2953         This patch refactors some Cocoa code pathas.
2954         Rename the timer that closes the WebView so it's more obvious what it is for.
2955         Extract the common code to close the frontend window so its not implemented by
2956         the timer callback.
2957
2958         In later patches, this will be extracted further into platform methods to open/close
2959         the frontend and window, like how it is for RemoteWebInspectorProxy.
2960
2961         * UIProcess/WebInspectorProxy.cpp:
2962         (WebKit::WebInspectorProxy::WebInspectorProxy):
2963         * UIProcess/WebInspectorProxy.h:
2964         * UIProcess/mac/WebInspectorProxyMac.mm:
2965         (WebKit::WebInspectorProxy::closeFrontendAfterInactivityTimerFired):
2966         (WebKit::WebInspectorProxy::closeFrontend):
2967         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2968         (WebKit::WebInspectorProxy::platformDidClose):
2969         (WebKit::WebInspectorProxy::platformDidCloseForCrash):
2970         (WebKit::WebInspectorProxy::platformInvalidate):
2971         (WebKit::WebInspectorProxy::closeTimerFired): Deleted.
2972
2973 2017-09-30  Brian Burg  <bburg@apple.com>
2974
2975         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
2976         https://bugs.webkit.org/show_bug.cgi?id=177661
2977         <rdar://problem/34740286>
2978
2979         Reviewed by Joseph Pecoraro.
2980
2981         Modernize the ObjC adapter and related code a bit before it is hooked
2982         into WKInspectorViewController.
2983
2984         * UIProcess/API/C/mac/WKInspectorPrivateMac.h: No need for the
2985         ivar to be declared here, move to @implementation.
2986
2987         * UIProcess/WebInspectorProxy.h: Simplify the name to match modern convention.
2988
2989         * UIProcess/mac/WebInspectorProxyMac.mm:
2990         (-[WKWebInspectorProxyObjCAdapter inspectorRef]):
2991         (-[WKWebInspectorProxyObjCAdapter initWithWebInspectorProxy:]):
2992         (-[WKWebInspectorProxyObjCAdapter invalidate]):
2993         (-[WKWebInspectorProxyObjCAdapter windowDidMove:]):
2994         (-[WKWebInspectorProxyObjCAdapter windowDidResize:]):
2995         (-[WKWebInspectorProxyObjCAdapter windowWillClose:]):
2996         (-[WKWebInspectorProxyObjCAdapter windowDidEnterFullScreen:]):
2997         (-[WKWebInspectorProxyObjCAdapter windowDidExitFullScreen:]):
2998         (-[WKWebInspectorProxyObjCAdapter inspectedViewFrameDidChange:]):
2999         Remove unnecessary casts to and from void*.
3000
3001         (WebKit::WebInspectorProxy::attachmentViewDidChange):
3002         (WebKit::WebInspectorProxy::setInspectorWindowFrame):
3003         (WebKit::WebInspectorProxy::closeTimerFired):
3004         (WebKit::WebInspectorProxy::createInspectorWindow):
3005         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3006         Fix uses of member variable m_objCAdapter.
3007
3008         (-[WKWebInspectorProxyObjCAdapter close]): Deleted.
3009         Rename this to invalidate to match modern convention. In this context,
3010         'close' might trick someone into thinking that this closes a window/page.
3011
3012 2017-09-30  Brian Burg  <bburg@apple.com>
3013
3014         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
3015         https://bugs.webkit.org/show_bug.cgi?id=177661
3016         <rdar://problem/34740286>
3017
3018         Reviewed by Joseph Pecoraro.
3019
3020         Move code that sets up and controls the inspector WebView into WKInspectorViewController.
3021         This will be shared between RemoteWebInspectorProxy and WebInspectorProxy eventually,
3022         but for now just pull out code from RemoteWebInspectorProxy. The next patch will move
3023         over WebInspectorProxy.
3024
3025         WKInspectorViewController uses the ObjC API for setting up the WKWebView's delegates.
3026         Previously, a WKWebView was used but the delegates were set up using the C API. In
3027         a few cases it uses delegate methods to ask the owning [Remote]WebInspectorProxy some
3028         things. In general, WKInspectorViewController doesn't dig into any internals of
3029         WebPageProxy or WebInspectorProxy; that is delegated to the client.
3030
3031         * UIProcess/RemoteWebInspectorProxy.h:
3032         (WebKit::RemoteWebInspectorProxy::isUnderTest const): Add a method stub for now.
3033         We might want to enable tests for a _WKRemoteWebInspectorViewController-based UI
3034         in the future, and WebInspectorProxy has the same method. Add this and connect it
3035         to the view controller delegate method.
3036
3037         (WebKit::RemoteWebInspectorProxy::webView const):
3038         This returns a plain WKWebView type now.
3039
3040         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
3041         (-[WKRemoteWebInspectorProxyObjCAdapter inspectorViewControllerInspectorDidCrash:]):
3042         (-[WKRemoteWebInspectorProxyObjCAdapter inspectorViewControllerInspectorIsUnderTest:]):
3043         (-[WKRemoteWebInspectorProxyObjCAdapter webViewWebContentProcessDidTerminate:]): Deleted.
3044         (-[WKRemoteWebInspectorProxyObjCAdapter webView:decidePolicyForNavigationAction:decisionHandler:]): Deleted.
3045         Make the ObjCAdapter forward view controller delegate calls to the C++ class.
3046         It no longer needs to be the delegate of the WebView, as the view controller handles that.
3047
3048         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
3049         Clean up and move WKWebView setup code into the view controller.
3050
3051         (WebKit::RemoteWebInspectorProxy::platformCloseFrontendPageAndWindow):
3052         The m_inspectorPage is closed by the caller before calling this method, so we don't need to do it here.
3053
3054         (WebKit::RemoteWebInspectorProxy::platformBringToFront):
3055         (WebKit::RemoteWebInspectorProxy::platformSave):
3056         (WebKit::RemoteWebInspectorProxy::platformAppend):
3057         (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag):
3058         Use webView() instead of m_webView.
3059
3060         * UIProcess/mac/WKInspectorViewController.h: Added.
3061         * UIProcess/mac/WKInspectorViewController.mm: Added.
3062         (-[WKInspectorWKWebView tag]):
3063         (-[WKInspectorViewController initWithInspectedPage:]):
3064         (-[WKInspectorViewController dealloc]):
3065         (-[WKInspectorViewController delegate]):
3066         (-[WKInspectorViewController webView]):
3067         (-[WKInspectorViewController setDelegate:]):
3068         (-[WKInspectorViewController configuration]):
3069         (-[WKInspectorViewController _webView:getWindowFrameWithCompletionHandler:]):
3070         (-[WKInspectorViewController _webView:setWindowFrame:]):
3071         (-[WKInspectorViewController webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:]):
3072         (-[WKInspectorViewController _webView:decideDatabaseQuotaForSecurityOrigin:currentQuota:currentOriginUsage:currentDatabaseUsage:expectedUsage:decisionHandler:]):
3073         (-[WKInspectorViewController webViewWebContentProcessDidTerminate:]):
3074         (-[WKInspectorViewController webView:decidePolicyForNavigationAction:decisionHandler:]):
3075         Move code from RemoteWebInspectorProxyMac into here.
3076
3077         * UIProcess/mac/WebInspectorProxyMac.mm:
3078         (WebKit::WebInspectorProxy::createFrontendWindow):
3079         Remove commented out code left over from the last time that this method got moved around.
3080
3081         * WebKit.xcodeproj/project.pbxproj:
3082         Add new class.
3083
3084 2017-10-20  Zan Dobersek  <zdobersek@igalia.com>
3085
3086         [WK2] Drop 'CoordinatedGraphics' as a platform prefix from generate-forwarding-headers.pl
3087         https://bugs.webkit.org/show_bug.cgi?id=178575
3088
3089         Reviewed by Carlos Garcia Campos.
3090
3091         * Scripts/generate-forwarding-headers.pl: Remove CoordinatedGraphics as
3092         a supported platform prefix. No one invokes the script with this
3093         argument anymore.
3094
3095 2017-10-19  Alex Christensen  <achristensen@webkit.org>
3096
3097         Introduce completionHandler-based SPI for _WKDownloadDelegate.decideDestinationWithSuggestedFilename
3098         https://bugs.webkit.org/show_bug.cgi?id=178560
3099
3100         Reviewed by Tim Horton.
3101
3102         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
3103         * UIProcess/Cocoa/DownloadClient.h:
3104         * UIProcess/Cocoa/DownloadClient.mm:
3105         (WebKit::DownloadClient::DownloadClient):
3106         (WebKit::DownloadClient::didStart):
3107         (WebKit::DownloadClient::didReceiveResponse):
3108         (WebKit::DownloadClient::didReceiveData):
3109         (WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
3110         (WebKit::DownloadClient::didFinish):
3111         (WebKit::DownloadClient::didFail):
3112         (WebKit::DownloadClient::didCancel):
3113         (WebKit::DownloadClient::willSendRequest):
3114
3115 2017-10-19  Chris Dumez  <cdumez@apple.com>
3116
3117         ServiceWorkerContextManager should be an IPC::MessageReceiver
3118         https://bugs.webkit.org/show_bug.cgi?id=178552
3119
3120         Reviewed by Youenn Fablet.
3121
3122         ServiceWorkerContextManager should be an IPC::MessageReceiver, to avoid putting too many
3123         ServiceWorker related methods on WebProcess class.
3124
3125         * DerivedSources.make:
3126         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3127         (WebKit::WebSWServerConnection::startServiceWorkerContext):
3128         (WebKit::WebSWServerConnection::startFetch):
3129         * WebKit.xcodeproj/project.pbxproj:
3130         * WebProcess/Storage/ServiceWorkerContextManager.cpp:
3131         (WebKit::ServiceWorkerContextManager::startFetchInServiceWorker):
3132         (WebKit::ServiceWorkerContextManager::startFetch): Deleted.
3133         * WebProcess/Storage/ServiceWorkerContextManager.h:
3134         * WebProcess/Storage/ServiceWorkerContextManager.messages.in: Added.
3135         * WebProcess/WebProcess.cpp:
3136         (WebKit::WebProcess::didReceiveMessage):
3137         (WebKit::WebProcess::getWorkerContextConnection):
3138         (WebKit::WebProcess::startServiceWorkerContext): Deleted.
3139         (WebKit::WebProcess::startFetchInServiceWorker): Deleted.
3140         * WebProcess/WebProcess.h:
3141         * WebProcess/WebProcess.messages.in:
3142
3143 2017-10-19  Alex Christensen  <achristensen@webkit.org>
3144
3145         Modernize authentication challenge handling in WebKit
3146         https://bugs.webkit.org/show_bug.cgi?id=178555
3147
3148         Reviewed by Tim Horton.
3149
3150         * UIProcess/API/APILoaderClient.h:
3151         (API::LoaderClient::didReceiveAuthenticationChallengeInFrame):
3152         * UIProcess/API/APINavigationClient.h:
3153         (API::NavigationClient::didReceiveAuthenticationChallenge):
3154         * UIProcess/API/C/WKPage.cpp:
3155         (WKPageSetPageLoaderClient):
3156         (WKPageSetPageNavigationClient):
3157         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3158         * UIProcess/Cocoa/NavigationState.h:
3159         * UIProcess/Cocoa/NavigationState.mm:
3160         (WebKit::NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace):
3161         (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
3162         * UIProcess/WebPageProxy.cpp:
3163         (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
3164
3165 2017-10-19  Alex Christensen  <achristensen@webkit.org>
3166
3167         Modernize API::DownloadClient
3168         https://bugs.webkit.org/show_bug.cgi?id=178547
3169
3170         Reviewed by Andy Estes.
3171
3172         Use more C++ references instead of pointers because they're never null.
3173
3174         Remove canAuthenticateAgainstProtectionSpace because there are no implementations
3175         except the default implementation which always returns true and we don't intend to
3176         add this to the SPI because that's just a legacy call anyways from when NSURLConnection
3177         hadn't fully evolved, and we're moving away from NSURLConnection, especially in our API design.
3178
3179         Separate the NetworkSession-only and pre-NetworkSession-only callbacks.  All the synchronous
3180         IPC messages are only used in the pre-NetworkSession code, so once we remove it we can remove them!
3181
3182         Make API::DownloadClient calls that NetworkSession uses use a completion handler so we will be able to
3183         design an asynchronous API.
3184
3185         * NetworkProcess/Downloads/DownloadManager.cpp:
3186         (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace): Deleted.
3187         * NetworkProcess/Downloads/DownloadManager.h:
3188         * NetworkProcess/Downloads/PendingDownload.cpp:
3189         (WebKit::PendingDownload::canAuthenticateAgainstProtectionSpaceAsync):
3190         (WebKit::PendingDownload::continueCanAuthenticateAgainstProtectionSpace): Deleted.
3191         * NetworkProcess/Downloads/PendingDownload.h:
3192         * NetworkProcess/NetworkProcess.cpp:
3193         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpaceDownload): Deleted.
3194         * NetworkProcess/NetworkProcess.h:
3195         * NetworkProcess/NetworkProcess.messages.in:
3196         * UIProcess/API/APIDownloadClient.h:
3197         (API::DownloadClient::didStart):
3198         (API::DownloadClient::didReceiveAuthenticationChallenge):
3199         (API::DownloadClient::didReceiveResponse):
3200         (API::DownloadClient::didReceiveData):
3201         (API::DownloadClient::shouldDecodeSourceDataOfMIMEType):
3202         (API::DownloadClient::decideDestinationWithSuggestedFilename):
3203         (API::DownloadClient::didCreateDestination):
3204         (API::DownloadClient::didFinish):
3205         (API::DownloadClient::didFail):
3206         (API::DownloadClient::didCancel):
3207         (API::DownloadClient::processDidCrash):
3208         (API::DownloadClient::willSendRequest):
3209         (API::DownloadClient::canAuthenticateAgainstProtectionSpace): Deleted.
3210         * UIProcess/API/C/WKContext.cpp:
3211         (WKContextSetDownloadClient):
3212         * UIProcess/API/glib/WebKitDownloadClient.cpp:
3213         * UIProcess/Cocoa/DownloadClient.h:
3214         * UIProcess/Cocoa/DownloadClient.mm:
3215         (WebKit::DownloadClient::didStart):
3216         (WebKit::DownloadClient::didReceiveResponse):
3217         (WebKit::DownloadClient::didReceiveData):
3218         (WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
3219         (WebKit::DownloadClient::didFinish):
3220         (WebKit::DownloadClient::didFail):
3221         (WebKit::DownloadClient::didCancel):
3222         (WebKit::DownloadClient::willSendRequest):
3223         * UIProcess/Downloads/DownloadProxy.cpp:
3224         (WebKit::DownloadProxy::processDidClose):
3225         (WebKit::DownloadProxy::didStart):
3226         (WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
3227         (WebKit::DownloadProxy::willSendRequest):
3228         (WebKit::DownloadProxy::didReceiveResponse):
3229         (WebKit::DownloadProxy::didReceiveData):
3230         (WebKit::DownloadProxy::shouldDecodeSourceDataOfMIMEType):
3231         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
3232         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
3233         (WebKit::DownloadProxy::didCreateDestination):
3234         (WebKit::DownloadProxy::didFinish):
3235         (WebKit::DownloadProxy::didFail):
3236         (WebKit::DownloadProxy::didCancel):
3237         (WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace): Deleted.
3238         * UIProcess/Downloads/DownloadProxy.h:
3239         * UIProcess/Downloads/DownloadProxy.messages.in:
3240
3241 2017-10-19  Nan Wang  <n_wang@apple.com>
3242
3243         AX: Provide a way for Accessibility to cache the selection while retrieving rects for speak selection
3244         https://bugs.webkit.org/show_bug.cgi?id=176247
3245         <rdar://problem/34217143>
3246
3247         Reviewed by Ryosuke Niwa.
3248
3249         When getting the rects for highlighting the spoken text within a selection range on iOS, we can get a
3250         list of totally wrong rects if the user changed the selection to some other text. This is because the
3251         calculation is based on the current selection range. Therefore, we need to provide a way for accessibility
3252         codepath to store the selection during a speaking session.
3253
3254         * UIProcess/API/Cocoa/WKWebView.mm:
3255         (-[WKWebView _accessibilityStoreSelection]):
3256         (-[WKWebView _accessibilityClearSelection]):
3257         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3258         * UIProcess/WebPageProxy.h:
3259         * UIProcess/ios/WKContentViewInteraction.h:
3260         * UIProcess/ios/WKContentViewInteraction.mm:
3261         (-[WKContentView _accessibilityStoreSelection]):
3262         (-[WKContentView _accessibilityClearSelection]):
3263         * UIProcess/ios/WebPageProxyIOS.mm:
3264         (WebKit::WebPageProxy::storeSelectionForAccessibility):
3265         * WebProcess/WebPage/WebPage.h:
3266         * WebProcess/WebPage/WebPage.messages.in:
3267         * WebProcess/WebPage/ios/WebPageIOS.mm:
3268         (WebKit::WebPage::getRectsForGranularityWithSelectionOffset):
3269         (WebKit::WebPage::storeSelectionForAccessibility):
3270         (WebKit::WebPage::getRectsAtSelectionOffsetWithText):
3271
3272 2017-10-19  Sam Weinig  <sam@webkit.org>
3273
3274         [Settings] Move global settings into their own file
3275         https://bugs.webkit.org/show_bug.cgi?id=178512
3276
3277         Reviewed by Darin Adler.
3278
3279         Moves all global settigns out of SettingsBase and into the new DeprecatedGlobalSettings.
3280
3281         * NetworkProcess/NetworkProcess.cpp:
3282         (WebKit::NetworkProcess::setAllowsAnySSLCertificateForWebSocket):
3283         * Shared/WebPreferencesDefinitions.h:
3284         * Shared/WebPreferencesStore.cpp:
3285         * WebProcess/WebPage/WebPage.cpp:
3286         (WebKit::m_cpuLimit):
3287         (WebKit::WebPage::updatePreferences):
3288         * WebProcess/WebProcess.cpp:
3289         (WebKit::WebProcess::setResourceLoadStatisticsEnabled):
3290         * WebProcess/cocoa/VideoFullscreenManager.mm:
3291         (WebKit::VideoFullscreenManager::supportsVideoFullscreen const):
3292
3293 2017-10-19  Andy Estes  <aestes@apple.com>
3294
3295         [iOS] Conditionally rename DatabaseProcess to StorageProcess when building for iOS devices
3296         https://bugs.webkit.org/show_bug.cgi?id=178181
3297         <rdar://problem/33660282>
3298
3299         Reviewed by Dan Bernstein.
3300
3301         * Configurations/BaseTarget.xcconfig:
3302         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3303         (WebKit::serviceName):
3304         * WebKit.xcodeproj/project.pbxproj:
3305
3306 2017-10-19  Youenn Fablet  <youenn@apple.com>
3307
3308         Add preliminary support for ServiceWorker Handle Fetch
3309         https://bugs.webkit.org/show_bug.cgi?id=178475
3310         <rdar://problem/35066424>
3311
3312         Reviewed by Chris Dumez.
3313
3314         Relanding now that underlying issue is fixed in https://bugs.webkit.org/show_bug.cgi?id=178527.
3315
3316         Preliminary support of Handle Fetch algorithm and integration with fetch spec.
3317         Adding ServiceWorkerClientFetch as the class responsible to do the load through ServiceWorker.
3318         It is similar to WebResourceLoader that do the load through NetworkProcess.
3319         In case ServiceWorkerClientFetch is not able to load through ServiceWorker,
3320         it will fallback to WebResourceLoader through a fallback callback.
3321
3322         Loading through Service Worker is done currently if:
3323         - There is a service worker registered for that origin
3324         - Request is a subresource
3325         - service workers mode is all
3326         There will be cases where the service worker will not do the loading, for instance when fetch event handler is not set.
3327         Future work should try to reduce the cases where the IPC dance is done unnecessarily.
3328
3329         ServiceWorkerClientFetch is responsible to adapt the ServiceWorker response to ResourceLoader.
3330         In particular, it is calling ResourceLoader error callback if response is of type error.
3331         It should call ResourceLoader redirection callback if response is a redirection response.
3332         This will be done as a follow-up.
3333
3334         Implementing the IPC communication dedicated to fetch between WebProcess and ServiceWorker through StorageProcess.
3335         In the future, WebProcess should create a direct IPC communication to the ServiceWorker process.
3336
3337         Moved SWContextManager from WebCore to WebKit and renamed it to ServiceWorkerContextManager.
3338         This class is moved to WebKit as it will have to handle IPC and having a separation will add some unnecessary boilerplate.
3339
3340         * CMakeLists.txt:
3341         * DerivedSources.make:
3342         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3343         (WebKit::WebSWServerConnection::startFetch):
3344         (WebKit::WebSWServerConnection::didReceiveFetchResponse):
3345         (WebKit::WebSWServerConnection::didReceiveFetchData):
3346         (WebKit::WebSWServerConnection::didFinishFetch):
3347         (WebKit::WebSWServerConnection::didFailFetch):
3348         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3349         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
3350         * StorageProcess/StorageProcess.cpp:
3351         (WebKit::StorageProcess::didFailFetch):
3352         (WebKit::StorageProcess::didReceiveFetchResponse):
3353         (WebKit::StorageProcess::didReceiveFetchData):
3354         (WebKit::StorageProcess::didFinishFetch):
3355         * StorageProcess/StorageProcess.h:
3356         * StorageProcess/StorageProcess.messages.in:
3357         * WebKit.xcodeproj/project.pbxproj:
3358         * WebProcess/Network/WebLoaderStrategy.cpp:
3359         (WebKit::WebLoaderStrategy::scheduleLoad):
3360         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
3361         (WebKit::WebLoaderStrategy::remove):
3362         * WebProcess/Network/WebLoaderStrategy.h:
3363         * WebProcess/Storage/ServiceWorkerClientFetch.cpp: Added.
3364         (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch):
3365         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
3366         (WebKit::ServiceWorkerClientFetch::didReceiveData):
3367         (WebKit::ServiceWorkerClientFetch::didFinish):
3368         (WebKit::ServiceWorkerClientFetch::didFail):
3369         (WebKit::ServiceWorkerClientFetch::cancel):
3370         * WebProcess/Storage/ServiceWorkerClientFetch.h: Copied from Source/WebKit/WebProcess/Storage/WebSWClientConnection.h.
3371         * WebProcess/Storage/ServiceWorkerClientFetch.messages.in: Copied from Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.messages.in.
3372         * WebProcess/Storage/ServiceWorkerContextManager.cpp: Added.
3373         (WebKit::ServiceWorkerContextManager::startServiceWorkerContext):
3374         (WebKit::ServiceWorkerContextManager::startFetch):
3375         * WebProcess/Storage/ServiceWorkerContextManager.h: Renamed from Source/WebCore/workers/service/context/SWContextManager.h.
3376         (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager):
3377         * WebProcess/Storage/WebSWClientConnection.cpp:
3378         (WebKit::WebSWClientConnection::startFetch):
3379         * WebProcess/Storage/WebSWClientConnection.h:
3380         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
3381         (WebKit::shouldHandleFetch):
3382         (WebKit::WebServiceWorkerProvider::handleFetch):
3383         (WebKit::WebServiceWorkerProvider::cancelFetch):
3384         (WebKit::WebServiceWorkerProvider::fetchFinished):
3385         (WebKit::WebServiceWorkerProvider::didReceiveServiceWorkerClientFetchMessage):
3386         * WebProcess/Storage/WebServiceWorkerProvider.h:
3387         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
3388         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
3389         * WebProcess/WebProcess.cpp:
3390         (WebKit::WebProcess::getWorkerContextConnection):
3391         (WebKit::WebProcess::startServiceWorkerContext):
3392         (WebKit::WebProcess::startFetchInServiceWorker):
3393         * WebProcess/WebProcess.h:
3394         * WebProcess/WebProcess.messages.in:
3395
3396 2017-10-19  Youenn Fablet  <youenn@apple.com>
3397
3398         Service Worker process should not be selected to open WebView on it
3399         https://bugs.webkit.org/show_bug.cgi?id=178527
3400
3401         Reviewed by Chris Dumez.
3402
3403         Selection of process to open a page will no longer use an existing web process if it is the service worker process.
3404
3405         * UIProcess/WebProcessPool.cpp:
3406         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
3407
3408 2017-10-19  Tim Horton  <timothy_horton@apple.com>
3409
3410         Display link bringup can block the main thread for ~150ms during WKWebView init
3411         https://bugs.webkit.org/show_bug.cgi?id=178524
3412
3413         Reviewed by Dean Jackson.
3414
3415         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
3416         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
3417         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
3418         (WebKit::RemoteLayerTreeDrawingAreaProxy::displayLinkHandler):
3419         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
3420         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
3421         Lazily initialize the display link at first use.
3422
3423 2017-10-19  Tim Horton  <timothy_horton@apple.com>
3424
3425         Expand r209943 to suppress paste during provisional navigation as well
3426         https://bugs.webkit.org/show_bug.cgi?id=178429
3427         <rdar://problem/33952830>
3428
3429         Reviewed by Dean Jackson.
3430
3431         * Shared/WebPreferencesDefinitions.h:
3432         * UIProcess/API/C/WKPreferences.cpp:
3433         (WKPreferencesSetShouldSuppressKeyboardInputDuringProvisionalNavigation):
3434         (WKPreferencesGetShouldSuppressKeyboardInputDuringProvisionalNavigation):
3435         * UIProcess/API/Cocoa/WKPreferences.mm:
3436         (-[WKPreferences _shouldSuppressKeyboardInputDuringProvisionalNavigation]):
3437         (-[WKPreferences _setShouldSuppressKeyboardInputDuringProvisionalNavigation:]):
3438         * WebProcess/WebPage/WebPage.cpp:
3439         (WebKit::WebPage::updatePreferences):
3440         Adjust to the changed preference name, except at the SPI level.
3441
3442 2017-10-19  Youenn Fablet  <youenn@apple.com>
3443
3444         Add API to clean CacheStorage data
3445         https://bugs.webkit.org/show_bug.cgi?id=178034
3446
3447         Unreviewed.
3448
3449         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h: Using WK_IOS_TBA instead of WK_MAC_TBA for iOS.
3450
3451 2017-10-19  Chris Dumez  <cdumez@apple.com>
3452
3453         Unreviewed build fix after r223692.
3454
3455         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3456
3457 2017-10-19  Chris Dumez  <cdumez@apple.com>
3458
3459         Unreviewed, revert r223650 as it caused crashes on the bots.
3460
3461         * CMakeLists.txt:
3462         * DerivedSources.make:
3463         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3464         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3465         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
3466         * StorageProcess/StorageProcess.cpp:
3467         * StorageProcess/StorageProcess.h:
3468         * StorageProcess/StorageProcess.messages.in:
3469         * WebKit.xcodeproj/project.pbxproj:
3470         * WebProcess/Network/WebLoaderStrategy.cpp:
3471         (WebKit::WebLoaderStrategy::scheduleLoad):
3472         (WebKit::WebLoaderStrategy::remove):
3473         * WebProcess/Network/WebLoaderStrategy.h:
3474         * WebProcess/Storage/ServiceWorkerClientFetch.cpp: Removed.
3475         * WebProcess/Storage/ServiceWorkerClientFetch.h: Removed.
3476         * WebProcess/Storage/ServiceWorkerClientFetch.messages.in: Removed.
3477         * WebProcess/Storage/ServiceWorkerContextManager.cpp: Removed.
3478         * WebProcess/Storage/WebSWClientConnection.cpp:
3479         * WebProcess/Storage/WebSWClientConnection.h:
3480         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
3481         * WebProcess/Storage/WebServiceWorkerProvider.h:
3482         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
3483         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
3484         * WebProcess/WebProcess.cpp:
3485         (WebKit::WebProcess::getWorkerContextConnection):
3486         (WebKit::WebProcess::startServiceWorkerContext):
3487         * WebProcess/WebProcess.h:
3488         * WebProcess/WebProcess.messages.in:
3489
3490 2017-10-19  Chris Dumez  <cdumez@apple.com>
3491
3492         http/tests/workers/service/basic-register.html is a flaky failure.
3493         https://bugs.webkit.org/show_bug.cgi?id=178494
3494         <rdar://problem/35065315>
3495
3496         Reviewed by Youenn Fablet.
3497
3498         In WebSWServerConnection::resolveJobInClient(), when a service worker is
3499         registered, we:
3500         1. Add the origin to the WebSWOriginStore
3501         2. Send the IPC to the WebProcess to notify it that the registration succeeded.
3502
3503         The assumption was that step 1 would be synchronous and would therefore send
3504         the shared memory handle to the WebProcess (if the SharedMemory was invalidated)
3505         *before* step 2.
3506
3507         The issue is that step 1 was scheduling a zero-timer to schedule the addition.
3508         As a result, there was a race and the WebContent process could check the
3509         the WebSWOriginTable *after* being notified that a service worker was registered
3510         but *before* it received the SharedMemory handle for the WebSWOriginTable. This
3511         could lead to false negatives and was causing the layout test to be flaky.
3512
3513         To address the issue, step 1 is now synchronous.
3514
3515         * Shared/SharedStringHashStore.cpp:
3516         (WebKit::SharedStringHashStore::SharedStringHashStore):
3517         (WebKit::SharedStringHashStore::scheduleAddition):
3518         (WebKit::SharedStringHashStore::scheduleRemoval):
3519         (WebKit::SharedStringHashStore::contains):
3520         (WebKit::SharedStringHashStore::flushPendingChanges):
3521         (WebKit::SharedStringHashStore::processPendingOperations):
3522         * Shared/SharedStringHashStore.h:
3523         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
3524         (WebKit::WebSWOriginStore::add):
3525         (WebKit::WebSWOriginStore::addAll):
3526         (WebKit::WebSWOriginStore::remove):
3527         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
3528         * UIProcess/VisitedLinkStore.cpp:
3529         (WebKit::VisitedLinkStore::addVisitedLinkHash):
3530         (WebKit::VisitedLinkStore::removeVisitedLinkHash):
3531
3532 2017-10-18  Ryosuke Niwa  <rniwa@webkit.org>
3533
3534         Don't expose raw HTML in pasteboard to the web content
3535         https://bugs.webkit.org/show_bug.cgi?id=178422
3536
3537         Reviewed by Wenson Hsieh.
3538
3539         Encode & decode the origin string of the copied content written into the system pasteboard.
3540
3541         * Shared/WebCoreArgumentCoders.cpp:
3542         (IPC::ArgumentCoder<PasteboardWebContent>::encode):
3543         (IPC::ArgumentCoder<PasteboardWebContent>::decode):
3544
3545 2017-10-18  Chris Dumez  <cdumez@apple.com>
3546
3547         Implement ServiceWorkerRegistration.scope / updateViaCache
3548         https://bugs.webkit.org/show_bug.cgi?id=178497
3549
3550         Reviewed by Youenn Fablet.
3551
3552         * Shared/WebCoreArgumentCoders.h:
3553         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3554
3555 2017-10-18  Youenn Fablet  <youenn@apple.com>
3556
3557         Add preliminary support for ServiceWorker Handle Fetch
3558         https://bugs.webkit.org/show_bug.cgi?id=178475
3559
3560         Reviewed by Chris Dumez.
3561
3562         Preliminary support of Handle Fetch algorithm and integration with fetch spec.
3563         Adding ServiceWorkerClientFetch as the class responsible to do the load through ServiceWorker.
3564         It is similar to WebResourceLoader that do the load through NetworkProcess.
3565         In case ServiceWorkerClientFetch is not able to load through ServiceWorker,
3566         it will fallback to WebResourceLoader through a fallback callback.
3567
3568         Loading through Service Worker is done currently if:
3569         - There is a service worker registered for that origin
3570         - Request is a subresource
3571         - service workers mode is all
3572         There will be cases where the service worker will not do the loading, for instance when fetch event handler is not set.
3573         Future work should try to reduce the cases where the IPC dance is done unnecessarily.
3574
3575         ServiceWorkerClientFetch is responsible to adapt the ServiceWorker response to ResourceLoader.
3576         In particular, it is calling ResourceLoader error callback if response is of type error.
3577         It should call ResourceLoader redirection callback if response is a redirection response.
3578         This will be done as a follow-up.
3579
3580         Implementing the IPC communication dedicated to fetch between WebProcess and ServiceWorker through StorageProcess.
3581         In the future, WebProcess should create a direct IPC communication to the ServiceWorker process.
3582
3583         Moved SWContextManager from WebCore to WebKit and renamed it to ServiceWorkerContextManager.
3584         This class is moved to WebKit as it will have to handle IPC and having a separation will add some unnecessary boilerplate.
3585
3586         * DerivedSources.make:
3587         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3588         (WebKit::WebSWServerConnection::startFetch):
3589         (WebKit::WebSWServerConnection::didReceiveFetchResponse):
3590         (WebKit::WebSWServerConnection::didReceiveFetchData):
3591         (WebKit::WebSWServerConnection::didFinishFetch):
3592         (WebKit::WebSWServerConnection::failedFetch):
3593         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3594         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
3595         * StorageProcess/StorageProcess.cpp:
3596         (WebKit::StorageProcess::failedFetch):
3597         (WebKit::StorageProcess::didReceiveFetchResponse):
3598         (WebKit::StorageProcess::didReceiveFetchData):
3599         (WebKit::StorageProcess::didFinishFetch):
3600         * StorageProcess/StorageProcess.h:
3601         * StorageProcess/StorageProcess.messages.in:
3602         * WebKit.xcodeproj/project.pbxproj:
3603         * WebProcess/Network/WebLoaderStrategy.cpp:
3604         (WebKit::WebLoaderStrategy::scheduleLoad):
3605         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
3606         * WebProcess/Network/WebLoaderStrategy.h:
3607         * WebProcess/Storage/ServiceWorkerClientFetch.cpp: Added.
3608         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
3609         (WebKit::ServiceWorkerClientFetch::didReceiveData):
3610         (WebKit::ServiceWorkerClientFetch::didFinishFetch):
3611         (WebKit::ServiceWorkerClientFetch::didFail):
3612         * WebProcess/Storage/ServiceWorkerClientFetch.h: Added.
3613         * WebProcess/Storage/ServiceWorkerClientFetch.messages.in: Added.
3614         * WebProcess/Storage/ServiceWorkerContextManager.cpp: Renamed from Source/WebCore/workers/service/context/SWContextManager.cpp.
3615         (WebKit::ServiceWorkerContextManager::startServiceWorkerContext):
3616         (WebKit::ServiceWorkerContextManager::startFetch):
3617         * WebProcess/Storage/ServiceWorkerContextManager.h: Renamed from Source/WebCore/workers/service/context/SWContextManager.h.
3618         (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager):
3619         * WebProcess/Storage/WebSWClientConnection.cpp:
3620         (WebKit::WebSWClientConnection::startFetch):
3621         * WebProcess/Storage/WebSWClientConnection.h:
3622         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
3623         (WebKit::shouldHandleFetch):
3624         (WebKit::WebServiceWorkerProvider::handleFetch):
3625         (WebKit::WebServiceWorkerProvider::didReceiveServiceWorkerClientFetchMessage):
3626         * WebProcess/Storage/WebServiceWorkerProvider.h:
3627         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
3628         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
3629         * WebProcess/WebProcess.cpp:
3630         (WebKit::WebProcess::getWorkerContextConnection):
3631         (WebKit::WebProcess::startServiceWorkerContext):
3632         (WebKit::WebProcess::startFetchInServiceWorker):
3633         * WebProcess/WebProcess.h:
3634         * WebProcess/WebProcess.messages.in:
3635
3636 2017-10-18  Chelsea Pugh  <cpugh@apple.com>
3637
3638         [iOS] Use new class name from UIKit when checking UITextSuggestion type
3639         https://bugs.webkit.org/show_bug.cgi?id=178416
3640         <rdar://problem/35010840>
3641
3642         Reviewed by Tim Horton.
3643
3644         Here we start using UITextAutofillSuggestion instead of the old name that was being used for
3645         AutoFill text suggestions.
3646
3647         * Platform/spi/ios/UIKitSPI.h:
3648         * UIProcess/ios/WKContentViewInteraction.mm:
3649         (-[WKContentView insertTextSuggestion:]): Use UITextAutofillSuggestion when checking the class
3650         and when casting instead of UIKeyboardLoginCredentialsSuggestion.
3651
3652 2017-10-17  Jiewen Tan  <jiewen_tan@apple.com>
3653
3654         Replace some stack raw pointers with RefPtrs within WebCore/html
3655         https://bugs.webkit.org/show_bug.cgi?id=178201
3656         <rdar://problem/34841692>
3657
3658         Reviewed by Ryosuke Niwa.
3659
3660         Change the type of node as toNode() is changed to return RefPtr.
3661
3662         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp:
3663         (WebKit::wrap):
3664         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
3665         (WebKit::WebEditorClient::handleKeyboardEvent):
3666         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
3667         (WebKit::WebEditorClient::handleKeyboardEvent):
3668         * WebProcess/WebPage/WebPage.cpp:
3669         (WebKit::WebPage::handleEditingKeyboardEvent):
3670         * WebProcess/WebPage/mac/WebPageMac.mm:
3671         (WebKit::frameForEvent):
3672
3673 2017-10-18  Chris Dumez  <cdumez@apple.com>
3674
3675         [Service Worker] Add stubs for Client / WindowClient / Clients
3676         https://bugs.webkit.org/show_bug.cgi?id=178469
3677
3678         Reviewed by Youenn Fablet.
3679
3680         Rename PageVisibilityState to VisibilityState.
3681
3682         * Shared/API/c/WKSharedAPICast.h:
3683         (WebKit::toVisibilityState):
3684         * WebProcess/WebPage/WebPage.h:
3685
3686 2017-10-18  John Wilander  <wilander@apple.com>
3687
3688         Check notifyPagesWhenTelemetryWasCaptured before notifying pages if there is no WebPageProxy
3689         https://bugs.webkit.org/show_bug.cgi?id=178470
3690         <rdar://problem/34417518>
3691
3692         Reviewed by Brian Burg.
3693
3694         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
3695         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
3696             Add a missing check of notifyPagesWhenTelemetryWasCaptured.
3697             The page notification is only for testing purposes.
3698
3699 2017-10-18  Chris Dumez  <cdumez@apple.com>
3700
3701         Unreviewed, fix build error after r223608 with some SDKs.
3702
3703         * StorageProcess/StorageProcess.cpp:
3704         (WebKit::StorageProcess::ensureSWOriginStoreForSession):
3705
3706 2017-10-18  Chris Dumez  <cdumez@apple.com>
3707
3708         Add an efficient data structure for WebCore to query if there is a Service Worker registered for a given origin
3709         https://bugs.webkit.org/show_bug.cgi?id=177876
3710         <rdar://problem/34813129>
3711
3712         Reviewed by Ryosuke Niwa.
3713
3714         Introduce a Service Worker origin store which gets populated / updated on the StorageProcess side
3715         and queried on the WebContent process side via the WebSWOriginTable so that the WebProcess can
3716         efficiently check if there is a ServiceWorker registered for a given origin without actually doing
3717         an IPC to the StorageProcess.
3718
3719         For efficiency, the hash table is backed by SharedMemory so we only pass shared memory handles
3720         between the StorageProcess and the WebProcesses.
3721
3722         We currently add entries to the WebSWOriginStore whenever a service worker registration succeeds
3723         on the StorageProcess side. We also clear this store whenever the API to clear service worker
3724         registrations is called. Code to query the WebSWOriginTable from the WebContent process side is
3725         there but currently only used by Internals for testing. We will later leverage this code when
3726         integrating with Fetch API.
3727
3728         * CMakeLists.txt:
3729         * Shared/SharedStringHashStore.h:
3730         (WebKit::SharedStringHashStore::Client::didUpdateSharedStringHashes):
3731         * Shared/SharedStringHashTable.cpp:
3732         (WebKit::SharedStringHashTable::clear):
3733         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp.
3734         (WebKit::WebSWOriginStore::WebSWOriginStore):
3735         (WebKit::WebSWOriginStore::add):
3736         (WebKit::WebSWOriginStore::remove):
3737         (WebKit::WebSWOriginStore::clear):
3738         (WebKit::WebSWOriginStore::registerSWServerConnection):
3739         (WebKit::WebSWOriginStore::unregisterSWServerConnection):
3740         (WebKit::WebSWOriginStore::sendStoreHandle):
3741         (WebKit::WebSWOriginStore::didInvalidateSharedMemory):
3742         * StorageProcess/ServiceWorker/WebSWOriginStore.h: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h.
3743         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3744         (WebKit::WebSWServerConnection::WebSWServerConnection):
3745         (WebKit::WebSWServerConnection::resolveJobInClient):
3746         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3747         (WebKit::WebSWServerConnection::sessionID const):
3748         * StorageProcess/StorageProcess.cpp:
3749         (WebKit::StorageProcess::deleteWebsiteData):
3750         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
3751         (WebKit::StorageProcess::ensureSWOriginStoreForSession):
3752         (WebKit::StorageProcess::swOriginStoreForSession const):
3753         (WebKit::StorageProcess::serviceWorkerContextStarted):
3754         (WebKit::StorageProcess::registerSWServerConnection):
3755         (WebKit::StorageProcess::unregisterSWServerConnection):
3756         * StorageProcess/StorageProcess.h:
3757         * StorageProcess/StorageProcess.messages.in:
3758         * WebKit.xcodeproj/project.pbxproj:
3759         * WebProcess/Storage/WebSWClientConnection.cpp:
3760         (WebKit::WebSWClientConnection::WebSWClientConnection):
3761         (WebKit::WebSWClientConnection::hasServiceWorkerRegisteredForOrigin const):
3762         (WebKit::WebSWClientConnection::setSWOriginTableSharedMemory):
3763         * WebProcess/Storage/WebSWClientConnection.h:
3764         * WebProcess/Storage/WebSWClientConnection.messages.in:
3765         * WebProcess/Storage/WebSWOriginTable.cpp: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h.
3766         (WebKit::WebSWOriginTable::contains const):
3767         (WebKit::WebSWOriginTable::setSharedMemory):
3768         * WebProcess/Storage/WebSWOriginTable.h: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h.
3769         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
3770         (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
3771         * WebProcess/Storage/WebServiceWorkerProvider.h:
3772         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
3773         (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):
3774         * WebProcess/Storage/WebToStorageProcessConnection.h:
3775         * WebProcess/WebProcess.cpp:
3776         (WebKit::WebProcess::startServiceWorkerContext):
3777
3778 2017-10-16  Andy Estes  <aestes@apple.com>
3779
3780         [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError
3781         https://bugs.webkit.org/show_bug.cgi?id=178191
3782         <rdar://problem/34906367>
3783
3784         Reviewed by Tim Horton.
3785
3786         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3787         (WebKit::toNSError):
3788
3789 2017-10-17  Sam Weinig  <sam@webkit.org>
3790
3791         [Settings] Generate Settings.h/cpp
3792         https://bugs.webkit.org/show_bug.cgi?id=178361
3793
3794         Reviewed by Dean Jackson.
3795
3796         * PlatformGTK.cmake:
3797         * PlatformWPE.cmake:
3798
3799             Delete the old Settings.h from the forwarding 
3800             headers directory to allow the build to work.
3801
3802 2017-10-17  John Wilander  <wilander@apple.com>
3803
3804         Add and remove cookie partition accordingly in intermediary redirect requests
3805         https://bugs.webkit.org/show_bug.cgi?id=178369
3806         <rdar://problem/34467603>
3807
3808         Reviewed by Brent Fulgham.
3809
3810         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3811         (WebKit::shouldChangePartition):
3812             Convenience function. Comment documents the logic.
3813         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
3814             Now adds and removes cookie partition based on the
3815             redirect-to URL's domain.
3816         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3817         (WKBundleResourceLoadStatisticsNotifyObserver):
3818             Test infrastructure.
3819         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
3820
3821 2017-10-17  Youenn Fablet  <youenn@apple.com>
3822
3823         Cache API implementation should be able to compute storage size for WebKit client applications.
3824         https://bugs.webkit.org/show_bug.cgi?id=178350
3825
3826         Reviewed by Chris Dumez.
3827
3828         When gathering data from DOM Cache, we compute the size as follows:
3829         - If Caches object is not persistent, size is zero
3830         - If Caches object is persistent, we use the size computed by NetworkCache::Storage. 
3831         Covered by updated tests.
3832
3833         * NetworkProcess/cache/CacheStorageEngine.cpp:
3834         (WebKit::CacheStorage::ReadOriginsTaskCounter::create):
3835         (WebKit::CacheStorage::ReadOriginsTaskCounter::addOrigin):
3836         (WebKit::CacheStorage::Engine::fetchEntries):
3837         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3838         (WebKit::CacheStorage::Caches::storageSize const):
3839         * NetworkProcess/cache/CacheStorageEngineCaches.h:
3840         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3841         (WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
3842         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
3843
3844 2017-10-17  Keith Miller  <keith_miller@apple.com>
3845
3846         Change WebCore sources to work with unified source builds
3847         https://bugs.webkit.org/show_bug.cgi?id=178229
3848
3849         Rubber stamped by Tim Horton.
3850
3851         * Configurations/FeatureDefines.xcconfig:
3852
3853 2017-10-16  Wenson Hsieh  <wenson_hsieh@apple.com>
3854
3855         Unreviewed, fix the iOS build after r223431
3856
3857         Remove an unused variable captured in a lambda.
3858
3859         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3860         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
3861
3862 2017-10-12  Matt Rajca  <mrajca@apple.com>
3863
3864         Add API support for quirk that lets an arbitrary click allow auto-play.
3865         https://bugs.webkit.org/show_bug.cgi?id=178227
3866
3867         Reviewed by Alex Christensen.
3868
3869         Instead of hardcoding sites in WebCore, let API clients control which websites opt into the quirk that lets
3870         an arbitrary click allow auto-play via website policies.
3871
3872         * Shared/WebsitePolicies.h:
3873         * UIProcess/API/C/WKWebsitePolicies.cpp:
3874         (WKWebsitePoliciesSetAllowedAutoplayQuirks):
3875         (WKWebsitePoliciesGetAllowedAutoplayQuirks):
3876         * UIProcess/API/C/WKWebsitePolicies.h:
3877         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
3878         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
3879         (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]):
3880         (-[_WKWebsitePolicies allowedAutoplayQuirks]):
3881         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3882         (WebKit::WebFrameLoaderClient::applyToDocumentLoader):
3883         * WebProcess/WebPage/WebPage.cpp:
3884         (WebKit::WebPage::updateWebsitePolicies):
3885
3886 2017-10-16  Andy Estes  <aestes@apple.com>
3887
3888         [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError
3889         https://bugs.webkit.org/show_bug.cgi?id=178191
3890         <rdar://problem/34906367>
3891
3892         Reviewed by Tim Horton.
3893
3894         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3895         (WebKit::toNSError):
3896
3897 2017-10-16  Tim Horton  <timothy_horton@apple.com>
3898
3899         Safari crashes after searching PDF (under [WKPDFView zoom:to:atPoint:kind:])
3900         https://bugs.webkit.org/show_bug.cgi?id=178358
3901         <rdar://problem/34676899>
3902
3903         Reviewed by Wenson Hsieh.
3904
3905         * UIProcess/ios/WKPDFView.mm:
3906         (-[WKPDFView _didFindMatch:]):
3907         UIPDFSelection can return a null rect as the selection's bounds.
3908         We can't zoom to a null rect (and doing so results in CA throwing an
3909         exception later).
3910
3911 2017-10-16  Alex Christensen  <achristensen@webkit.org>
3912
3913         Add a _WKThumbnailView initializer with a WKWebView
3914         https://bugs.webkit.org/show_bug.cgi?id=178351
3915         <rdar://problem/34979453>
3916
3917         Reviewed by Tim Horton.
3918
3919         * UIProcess/API/Cocoa/WKWebView.mm:
3920         (-[WKWebView _page]):
3921         (-[WKWebView _setThumbnailView:]):
3922         (-[WKWebView _thumbnailView]):
3923         (-[WKWebView _setIgnoresAllEvents:]):
3924         (-[WKWebView _ignoresAllEvents]):
3925         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3926         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3927         * UIProcess/API/Cocoa/_WKThumbnailView.h:
3928         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
3929         (-[_WKThumbnailView initWithFrame:fromWKWebView:]):
3930         (-[_WKThumbnailView _viewWasUnparented]):
3931         (-[_WKThumbnailView _viewWasParented]):
3932
3933 2017-10-16  Alex Christensen  <achristensen@webkit.org>
3934
3935         Expose more WKView properties as WKWebViewPrivate SPI
3936         https://bugs.webkit.org/show_bug.cgi?id=178349
3937         <rdar://problem/34980919>
3938
3939         Reviewed by Tim Horton.
3940
3941         _backgroundExtendsBeyondPage was already exposed on iOS, but we need it on Mac, too.
3942         A few other properties also need exposing.
3943
3944         * UIProcess/API/Cocoa/WKWebView.mm:
3945         (toAPIScrollbarStyle):
3946         (toCoreScrollbarStyle):
3947         (-[WKWebView _setBackgroundExtendsBeyondPage:]):
3948         (-[WKWebView _backgroundExtendsBeyondPage]):
3949         (-[WKWebView _setOverlayScrollbarStyle:]):
3950         (-[WKWebView _overlayScrollbarStyle]):
3951         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3952
3953 2017-10-16  Chris Dumez  <cdumez@apple.com>
3954
3955         Log using differential privacy domains where the WebContent process crashes
3956         https://bugs.webkit.org/show_bug.cgi?id=178346
3957         <rdar://problem/33293830>
3958
3959         Reviewed by Alex Christensen.
3960
3961         * UIProcess/WebPageProxy.cpp:
3962         (WebKit::WebPageProxy::reload):
3963         (WebKit::WebPageProxy::currentURL const):
3964         (WebKit::WebPageProxy::processDidTerminate):
3965         * UIProcess/WebPageProxy.h:
3966         * UIProcess/WebProcessProxy.cpp:
3967         (WebKit::WebProcessProxy::didClose):
3968
3969 2017-10-16  Youenn Fablet  <youenn@apple.com>
3970
3971         Activate Cache API by default
3972         https://bugs.webkit.org/show_bug.cgi?id=178186
3973
3974         Reviewed by Chris Dumez.
3975
3976         * Shared/WebPreferencesDefinitions.h:
3977
3978 2017-10-16  Sam Weinig  <sam@webkit.org>
3979
3980         [Settings] Remove all custom code from Settings.h/cpp
3981         https://bugs.webkit.org/show_bug.cgi?id=178330
3982
3983         Reviewed by Simon Fraser.
3984
3985         * Shared/WebPreferencesDefinitions.h:
3986         * UIProcess/API/C/WKPreferences.cpp:
3987         (WKPreferencesSetFrameFlatteningEnabled):
3988         (WKPreferencesGetFrameFlatteningEnabled):
3989         * UIProcess/API/glib/WebKitSettings.cpp:
3990         (webkit_settings_get_enable_frame_flattening):
3991         (webkit_settings_set_enable_frame_flattening):
3992         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3993         (WebKit::InjectedBundle::setFrameFlatteningEnabled):
3994         
3995             Update for naming changes of FrameFlattening now that it is an enum class.
3996
3997         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3998         (WebKit::WebChromeClient::contentsSizeChanged const):
3999
4000             Ge the effectiveFrameFlattening from the FrameView, rather than the Settings.
4001
4002 2017-10-16  Chris Dumez  <cdumez@apple.com>
4003
4004         [WK2][NetworkSession] Add support for resuming downloads
4005         https://bugs.webkit.org/show_bug.cgi?id=177625
4006         <rdar://problem/34345975>
4007
4008         Reviewed by Alex Christensen.
4009
4010         Add support for resuming downloads for the WK2 NETWORK_SESSION code path.
4011
4012         This was tested manually. I was unable to write an API test because our tests
4013         do not run an HTTP server and CFNetwork does not seem to generate resume data
4014         when cancelling a download over non-HTTP.
4015
4016         * NetworkProcess/Downloads/Download.cpp:
4017         (WebKit::Download::didReceiveChallenge):
4018         (WebKit::Download::continueCanAuthenticateAgainstProtectionSpace):
4019         * NetworkProcess/Downloads/Download.h:
4020     &n