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