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