Add UIDelegatePrivate SPI corresponding to WKPageUIClient.showPage
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2017-08-22  Alex Christensen  <achristensen@webkit.org>
2
3         Add UIDelegatePrivate SPI corresponding to WKPageUIClient.showPage
4         https://bugs.webkit.org/show_bug.cgi?id=175797
5         <rdar://problem/29270035>
6
7         Reviewed by Geoffrey Garen.
8
9         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
10         * UIProcess/Cocoa/UIDelegate.h:
11         * UIProcess/Cocoa/UIDelegate.mm:
12         (WebKit::UIDelegate::setDelegate):
13         (WebKit::UIDelegate::UIClient::showPage):
14         * WebProcess/WebPage/WebPage.cpp:
15         (WebKit::WebPage::registerURLSchemeHandler):
16         window.open, createWebViewWithConfiguration, and WKURLSchemeHandlers all used together
17         make it so that URLSchemeHandlers are added to WebPages that already have them.  The
18         assertions are no longer valid.
19
20 2017-08-22  Youenn Fablet  <youenn@apple.com>
21
22         [Cache API] Add support for overwriting responses with put on an existing record
23         https://bugs.webkit.org/show_bug.cgi?id=175825
24
25         Reviewed by Geoffrey Garen.
26
27         Add support for encoding/decoding the update counter.
28         Incrementing it when overwriting an existing response.
29         Storing the new body in addition to the new response.
30
31         * NetworkProcess/cache/CacheStorageEngine.cpp:
32         (WebKit::CacheStorageEngine::putRecords):
33         * Shared/WebCoreArgumentCoders.cpp:
34         (IPC::ArgumentCoder<CacheStorageConnection::Record>::encode):
35         (IPC::ArgumentCoder<CacheStorageConnection::Record>::decode):
36
37 2017-08-22  Alex Christensen  <achristensen@webkit.org>
38
39         Remove ChromeClient::hasOpenedPopup
40         https://bugs.webkit.org/show_bug.cgi?id=175804
41
42         Reviewed by Sam Weinig.
43
44         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
45         (WebKit::WebChromeClient::hasOpenedPopup const): Deleted.
46         * WebProcess/WebCoreSupport/WebChromeClient.h:
47
48 2017-08-22  Brent Fulgham  <bfulgham@apple.com> and Pranjal Jumde  <pjumde@apple.com>
49
50         Disable access to secure cookies if an HTTPS site loads mixed content
51         https://bugs.webkit.org/show_bug.cgi?id=157053
52         <rdar://problem/11290808>
53
54         Reviewed by Dan Bates.
55
56         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
57         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM): Pass new arguments needed by WebCore.
58         * NetworkProcess/NetworkConnectionToWebProcess.h:
59         * NetworkProcess/NetworkConnectionToWebProcess.messages.in: Updated the CookiesForDOM message with the new foundMixedContent
60         argument and the new didAccessSecureCookies reply.
61         * Shared/mac/CookieStorageShim.mm:
62         (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL): Drive-by fix to use the right message.
63         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
64         (WebKit::WebPlatformStrategies::cookiesForDOM): Check and return whether secure cookies were accessed. Accept a new argument
65         indicating whether secure cookies should be included in the response.
66         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
67
68 2017-08-22  Zan Dobersek  <zdobersek@igalia.com>
69
70         [GTK][WPE] Rename StorageProcessMainGtk.cpp to StorageProcessMainGLib.cpp
71         https://bugs.webkit.org/show_bug.cgi?id=175814
72
73         Reviewed by Gyuyoung Kim.
74
75         Both GTK+ and WPE ports already compile the StorageProcessMainGtk.cpp
76         file, but it should be renamed to StorageProcessMainGLib and moved into
77         the StorageProcess/glib/ directory.
78
79         * PlatformGTK.cmake:
80         * PlatformWPE.cmake:
81         * StorageProcess/glib/StorageProcessMainGLib.cpp: Renamed from Source/WebKit/StorageProcess/gtk/StorageProcessMainGtk.cpp.
82
83 2017-08-21  Zan Dobersek  <zdobersek@igalia.com>
84
85         [WK] Add missing ENABLE(NETWORK_CACHE) build guards
86         https://bugs.webkit.org/show_bug.cgi?id=175769
87
88         Reviewed by Carlos Alberto Lopez Perez.
89
90         Given that the build guard exists, it should be possible to
91         compile the WebKit layer with the feature disabled. Missing
92         guards are added in order to achieve that.
93
94         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
95         * NetworkProcess/NetworkConnectionToWebProcess.h:
96         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
97         * NetworkProcess/NetworkProcess.h:
98         * NetworkProcess/NetworkResourceLoader.cpp:
99         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
100         * NetworkProcess/soup/NetworkProcessSoup.cpp:
101         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
102         (WebKit::NetworkProcess::clearDiskCache):
103         * UIProcess/soup/WebProcessPoolSoup.cpp:
104         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
105         * WebProcess/Network/WebLoaderStrategy.cpp:
106         (WebKit::WebLoaderStrategy::storeDerivedDataToCache):
107
108 2017-08-21  Chris Dumez  <cdumez@apple.com>
109
110         [Beacon] Content extensions should be able to intercept Beacon / Ping redirects
111         https://bugs.webkit.org/show_bug.cgi?id=175746
112         <rdar://problem/33946050>
113
114         Reviewed by Alex Christensen.
115
116         Update PingLoad to process content extension rules upon redirect. This allows content
117         extensions to block and upgrade to HTTPS beacon / ping loads.
118
119         Because ping loads can outlive the WebProcess, the content extensions rules are passed
120         to the NetworkProcess when starting the Ping load. The PingLoad can then consult those
121         rules upon redirect, on the NetworkProcess side.
122
123         * NetworkProcess/NetworkResourceLoadParameters.cpp:
124         (WebKit::NetworkResourceLoadParameters::encode const):
125         (WebKit::NetworkResourceLoadParameters::decode):
126         * NetworkProcess/NetworkResourceLoadParameters.h:
127         * NetworkProcess/PingLoad.cpp:
128         (WebKit::PingLoad::willPerformHTTPRedirection):
129         (WebKit::PingLoad::contentExtensionsBackend):
130         (WebKit::PingLoad::processContentExtensionRulesForLoad):
131         * NetworkProcess/PingLoad.h:
132         * WebProcess/Network/WebLoaderStrategy.cpp:
133         (WebKit::WebLoaderStrategy::startPingLoad):
134
135 2017-08-21  Adrian Perez de Castro  <aperez@igalia.com>
136
137         [WPE][GTK] Unused variables in UserMediaProcessManager.cpp
138         https://bugs.webkit.org/show_bug.cgi?id=175799
139
140         Reviewed by Alex Christensen.
141
142         The code which uses the "audioExtensionPath" and "videoExtensionPath" variables is guarded
143         with "#if ENABLE(SANDBOX_EXTENSIONS)”, so do the same for the variables themselves.
144
145         * UIProcess/UserMediaProcessManager.cpp: Add missing guards.
146
147 2017-08-21  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
148
149         [PAL] Move spi/mac directory into PAL
150         https://bugs.webkit.org/show_bug.cgi?id=175649
151
152         Reviewed by Myles C. Maxfield.
153
154         * Platform/mac/MenuUtilities.mm:
155         * Shared/mac/WebCoreArgumentCodersMac.mm:
156         * Shared/mac/WebEventFactory.mm:
157         * Shared/mac/WebHitTestResultData.mm:
158         * UIProcess/API/Cocoa/WKWebView.mm:
159         * UIProcess/Cocoa/WebViewImpl.mm:
160         * UIProcess/mac/ServicesController.mm:
161         * UIProcess/mac/TextCheckerMac.mm:
162         * UIProcess/mac/ViewGestureControllerMac.mm:
163         * UIProcess/mac/WKImmediateActionController.h:
164         * UIProcess/mac/WKImmediateActionController.mm:
165         * UIProcess/mac/WKSharingServicePickerDelegate.mm:
166         * UIProcess/mac/WKTextFinderClient.mm:
167         * UIProcess/mac/WebContextMenuProxyMac.mm:
168         * UIProcess/mac/WebPageProxyMac.mm:
169         * WebProcess/cocoa/WebProcessCocoa.mm:
170
171 2017-08-21  Brady Eidson  <beidson@apple.com>
172
173         Split the one SWServer::Connection into SWClientConnection and SWServer::Connection.
174         https://bugs.webkit.org/show_bug.cgi?id=175745
175
176         Reviewed by Andy Estes.
177
178         * CMakeLists.txt:
179         * DerivedSources.make:
180         * WebKit.xcodeproj/project.pbxproj:
181
182         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: Renamed from Source/WebKit/WebProcess/Storage/WebSWServerConnection.cpp.
183         (WebKit::WebSWServerConnection::WebSWServerConnection):
184         (WebKit::WebSWServerConnection::~WebSWServerConnection):
185         (WebKit::WebSWServerConnection::disconnectedFromWebProcess):
186         (WebKit::WebSWServerConnection::rejectJobInClient):
187         * StorageProcess/ServiceWorker/WebSWServerConnection.h: Copied from Source/WebKit/WebProcess/Storage/WebSWServerConnection.h.
188         (WebKit::WebSWServerConnection::identifier const):
189         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: Copied from Source/WebKit/WebProcess/Storage/WebSWServerConnection.messages.in.
190
191         * StorageProcess/StorageToWebProcessConnection.cpp:
192         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
193         (WebKit::StorageToWebProcessConnection::didClose):
194         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
195         (WebKit::StorageToWebProcessConnection::removeSWServerConnection):
196         * StorageProcess/StorageToWebProcessConnection.h:
197
198         * WebProcess/Storage/WebSWClientConnection.cpp: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp.
199         (WebKit::WebSWClientConnection::WebSWClientConnection):
200         (WebKit::WebSWClientConnection::~WebSWClientConnection):
201         (WebKit::WebSWClientConnection::scheduleJobInServer):
202         * WebProcess/Storage/WebSWClientConnection.h: Renamed from Source/WebKit/WebProcess/Storage/WebSWServerConnection.h.
203         (WebKit::WebSWClientConnection::identifier const):
204         * WebProcess/Storage/WebSWClientConnection.messages.in: Renamed from Source/WebKit/WebProcess/Storage/WebSWServerConnection.messages.in.
205
206         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
207         (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
208         * WebProcess/Storage/WebServiceWorkerProvider.h:
209
210         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
211         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
212         (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):
213         * WebProcess/Storage/WebToStorageProcessConnection.h:
214
215 2017-08-21  Charlie Turner  <cturner@igalia.com>
216
217         MemoryCache::setCapacities assertion failure maxDeadBytes <= totalBytes
218         https://bugs.webkit.org/show_bug.cgi?id=175571
219
220         Reviewed by Antti Koivisto.
221
222         * Shared/CacheModel.cpp:
223         (WebKit::calculateMemoryCacheSizes): Ensure cacheTotalCapacity is
224         set to a reasonable value even in low-memory environments.
225
226 2017-08-20  Chris Dumez  <cdumez@apple.com>
227
228         Simplify calls to LoaderStrategy::startPingLoad()
229         https://bugs.webkit.org/show_bug.cgi?id=175756
230
231         Reviewed by Sam Weinig.
232
233         * WebProcess/Network/WebLoaderStrategy.cpp:
234         (WebKit::WebLoaderStrategy::startPingLoad):
235         * WebProcess/Network/WebLoaderStrategy.h:
236
237 2017-08-18  Chris Dumez  <cdumez@apple.com>
238
239         [Beacon] Improve error reporting
240         https://bugs.webkit.org/show_bug.cgi?id=175723
241
242         Reviewed by Darin Adler.
243
244         Have Ping loads such as beacons report errors via their completion handler.
245         The Beacon API is using this error to log a console message when beacon loads
246         fail, provided that the page is still alive.
247
248         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
249         (WebKit::NetworkConnectionToWebProcess::loadPing):
250         (WebKit::NetworkConnectionToWebProcess::didFinishPingLoad):
251         * NetworkProcess/NetworkConnectionToWebProcess.h:
252         * NetworkProcess/PingLoad.cpp:
253         (WebKit::PingLoad::~PingLoad):
254         (WebKit::PingLoad::didFinish):
255         (WebKit::PingLoad::willPerformHTTPRedirection):
256         (WebKit::PingLoad::didReceiveChallenge):
257         (WebKit::PingLoad::didReceiveResponseNetworkSession):
258         (WebKit::PingLoad::didCompleteWithError):
259         (WebKit::PingLoad::wasBlocked):
260         (WebKit::PingLoad::cannotShowURL):
261         (WebKit::PingLoad::timeoutTimerFired):
262         (WebKit::PingLoad::currentRequest const):
263         (WebKit::PingLoad::makeCrossOriginAccessRequestWithPreflight):
264         * NetworkProcess/PingLoad.h:
265         * WebProcess/Network/NetworkProcessConnection.cpp:
266         (WebKit::NetworkProcessConnection::didFinishPingLoad):
267         * WebProcess/Network/NetworkProcessConnection.h:
268         * WebProcess/Network/NetworkProcessConnection.messages.in:
269         * WebProcess/Network/WebLoaderStrategy.cpp:
270         (WebKit::WebLoaderStrategy::networkProcessCrashed):
271         (WebKit::WebLoaderStrategy::startPingLoad):
272         (WebKit::WebLoaderStrategy::didFinishPingLoad):
273         * WebProcess/Network/WebLoaderStrategy.h:
274
275 2017-08-18  Chris Dumez  <cdumez@apple.com>
276
277         REGRESSION (r220601): Crash when closing google doc after switching the order of tabs in safari
278         https://bugs.webkit.org/show_bug.cgi?id=175721
279         <rdar://problem/33928369>
280
281         Reviewed by Geoffrey Garen.
282
283         Make sure WebProcess::markAllLayersVolatile() does not call WTFMove() multiple times
284         on the same completion handler. Use a RefCounter to hold on to the completion handler
285         and make sure the handler gets called when the RefCounter's value becomes 0.
286
287         * WebProcess/WebProcess.cpp:
288         (WebKit::WebProcess::cancelPrepareToSuspend):
289         (WebKit::WebProcess::markAllLayersVolatile):
290         (WebKit::WebProcess::cancelMarkAllLayersVolatile):
291         * WebProcess/WebProcess.h:
292
293 2017-08-18  Youenn Fablet  <youenn@apple.com>
294
295         [Cache API] Add response body storage
296         https://bugs.webkit.org/show_bug.cgi?id=175658
297
298         Reviewed by Alex Christensen.
299
300         Added IPC serialization of Record response body.
301         Updated CacheStorageEngine implementation as Record has no longer a copy constructor.
302
303         * NetworkProcess/cache/CacheStorageEngine.cpp:
304         (WebKit::CacheStorageEngine::retrieveRecords):
305         (WebKit::CacheStorageEngine::deleteMatchingRecords):
306         * Shared/WebCoreArgumentCoders.cpp:
307         (IPC::encodeSharedBuffer):
308         (IPC::decodeSharedBuffer):
309         (IPC::ArgumentCoder<CacheStorageConnection::Record>::encode):
310         (IPC::ArgumentCoder<CacheStorageConnection::Record>::decode):
311
312 2017-08-18  Brady Eidson  <beidson@apple.com>
313
314         Bounce ServiceWorker jobs to the Storage Process.
315         https://bugs.webkit.org/show_bug.cgi?id=175650
316
317         Reviewed by Andy Estes.
318
319         * CMakeLists.txt:
320         * DerivedSources.make:
321         * WebKit.xcodeproj/project.pbxproj:
322
323         * Platform/Logging.h:
324
325         * StorageProcess/StorageToWebProcessConnection.cpp:
326         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
327         (WebKit::StorageToWebProcessConnection::didClose):
328         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
329         (WebKit::StorageToWebProcessConnection::removeSWServerConnection):
330         (WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer):
331         * StorageProcess/StorageToWebProcessConnection.h:
332         * StorageProcess/StorageToWebProcessConnection.messages.in:
333
334         * WebProcess/Storage/WebSWServerConnection.cpp: Added.
335         (WebKit::WebSWServerConnection::WebSWServerConnection):
336         (WebKit::WebSWServerConnection::~WebSWServerConnection):
337         (WebKit::WebSWServerConnection::disconnectedFromWebProcess):
338         (WebKit::WebSWServerConnection::scheduleJob):
339         (WebKit::WebSWServerConnection::scheduleStorageJob):
340         * WebProcess/Storage/WebSWServerConnection.h: Copied from Source/WebCore/workers/service/ServiceWorkerJob.h.
341         (WebKit::WebSWServerConnection::create):
342         (WebKit::WebSWServerConnection::identifier const):
343         * WebProcess/Storage/WebSWServerConnection.messages.in: Copied from Source/WebKit/StorageProcess/StorageToWebProcessConnection.messages.in.
344
345         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
346         (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
347         (WebKit::WebServiceWorkerProvider::scheduleJob): Deleted.
348         * WebProcess/Storage/WebServiceWorkerProvider.h:
349
350         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
351         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
352         (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):
353         * WebProcess/Storage/WebToStorageProcessConnection.h:
354
355 2017-08-18  Chris Dumez  <cdumez@apple.com>
356
357         [Beacon] Add support for quota limitation
358         https://bugs.webkit.org/show_bug.cgi?id=175443
359         <rdar://problem/33729002>
360
361         Reviewed by Youenn Fablet.
362
363         WebLoaderStrategy now generates an identifier for ping loads and keep
364         the completion handler in a local HashMap. Once the ping load is done,
365         the network process sends an IPC message back to the WebContent process
366         so that WebLoaderStrategy can look up the completion handler for the
367         ping load and call it.
368
369         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
370         (WebKit::NetworkConnectionToWebProcess::loadPing):
371         (WebKit::NetworkConnectionToWebProcess::didFinishPingLoad):
372         * NetworkProcess/NetworkConnectionToWebProcess.h:
373         * NetworkProcess/PingLoad.cpp:
374         (WebKit::PingLoad::PingLoad):
375         (WebKit::PingLoad::~PingLoad):
376         * NetworkProcess/PingLoad.h:
377         * WebProcess/Network/NetworkProcessConnection.cpp:
378         (WebKit::NetworkProcessConnection::didFinishPingLoad):
379         * WebProcess/Network/NetworkProcessConnection.h:
380         * WebProcess/Network/NetworkProcessConnection.messages.in:
381         * WebProcess/Network/WebLoaderStrategy.cpp:
382         (WebKit::generatePingLoadIdentifier):
383         (WebKit::WebLoaderStrategy::startPingLoad):
384         (WebKit::WebLoaderStrategy::didFinishPingLoad):
385         * WebProcess/Network/WebLoaderStrategy.h:
386
387 2017-08-18  Youenn Fablet  <youenn@apple.com>
388
389         [Cache API] Add a WK2 implementation of CacheStorageConnection
390         https://bugs.webkit.org/show_bug.cgi?id=175640
391
392         Reviewed by Alex Christensen & Chris Dumez.
393
394         Adding WebCacheStorageConnection as an implementation of CacheStorageConnection.
395         Making WebCacheStorageProvider instantiates such class.
396         One WebCacheStorageConnection is created for each session of a given WebProcess.
397
398         WebCacheStorageConnection is sending IPC calls to the network process.
399         Main implementation of the cache API is done in the network process by CacheStorageEngineConnection and CacheStorageEngine.
400         There is one WebCacheStorageConnection per session.
401         WebCacheStorageConnection is passing the session ID for each call to the network process to ensure the right cache storage engine is used.
402
403         CacheStorageEngineConnection mirrors WebCacheStorageConnection on the network process.
404         There is one CacheStorageEngine per session and CacheStorageEngineConnection will select the right CacheStorageEngine using the given session ID.
405
406         CacheStorageEngine is responsible of storing and matching cache API records.
407         Current implementation only keeps in memory the cached objects.
408
409         CacheStorageEngine is keeping (for each different origin) caches and records as a Vector as the order of insertion is important as per spec.
410         It also keeps a list of removed caches. These caches should remain functional until the last web page having access to these is gone.
411         The mechanism to fully remove these caches is not implemented yet.
412
413         Adding IPC encodings for WTF::Expected, CacheQueryOptions, FetchOptions, CacheStorageConnection Record and CacheInfo.
414
415         * CMakeLists.txt:
416         * DerivedSources.make:
417         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
418         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
419         (WebKit::generateCacheStorageConnectionIdentifier):
420         (WebKit::NetworkConnectionToWebProcess::createCacheStorageConnection):
421         (WebKit::NetworkConnectionToWebProcess::closeCacheStorageConnection):
422         * NetworkProcess/NetworkConnectionToWebProcess.h:
423         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
424         * NetworkProcess/cache/CacheStorageEngine.cpp: Added.
425         (WebKit::defaultCacheStorageEngine):
426         (WebKit::globalEngineMap):
427         (WebKit::CacheStorageEngine::from):
428         (WebKit::CacheStorageEngine::destroyEngine):
429         (WebKit::CacheStorageEngine::defaultEngine):
430         (WebKit::CacheStorageEngine::open):
431         (WebKit::CacheStorageEngine::remove):
432         (WebKit::CacheStorageEngine::retrieveCaches):
433         (WebKit::CacheStorageEngine::retrieveRecords):
434         (WebKit::CacheStorageEngine::putRecords):
435         (WebKit::CacheStorageEngine::deleteMatchingRecords):
436         (WebKit::CacheStorageEngine::writeCachesToDisk):
437         (WebKit::CacheStorageEngine::readCachesFromDisk):
438         (WebKit::CacheStorageEngine::readCache):
439         (WebKit::CacheStorageEngine::writeCacheRecords):
440         (WebKit::CacheStorageEngine::removeCacheRecords):
441         (WebKit::CacheStorageEngine::cache):
442         (WebKit::CacheStorageEngine::caches const):
443         (WebKit::CacheStorageEngine::records):
444         (WebKit::CacheStorageEngine::queryCache):
445         * NetworkProcess/cache/CacheStorageEngine.h: Added.
446         * NetworkProcess/cache/CacheStorageEngineConnection.cpp: Added.
447         (WebKit::CacheStorageEngineConnection::CacheStorageEngineConnection):
448         (WebKit::CacheStorageEngineConnection::open):
449         (WebKit::CacheStorageEngineConnection::remove):
450         (WebKit::CacheStorageEngineConnection::caches):
451         (WebKit::CacheStorageEngineConnection::records):
452         (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
453         (WebKit::CacheStorageEngineConnection::putRecords):
454         * NetworkProcess/cache/CacheStorageEngineConnection.h: Added.
455         (WebKit::CacheStorageEngineConnection::create):
456         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in: Added.
457         * Platform/IPC/ArgumentCoders.h:
458         * Shared/WebCoreArgumentCoders.cpp:
459         (IPC::ArgumentCoder<CacheQueryOptions>::encode):
460         (IPC::ArgumentCoder<CacheQueryOptions>::decode):
461         (IPC::ArgumentCoder<FetchOptions>::encode):
462         (IPC::ArgumentCoder<FetchOptions>::decode):
463         (IPC::ArgumentCoder<CacheStorageConnection::CacheInfo>::encode):
464         (IPC::ArgumentCoder<CacheStorageConnection::CacheInfo>::decode):
465         (IPC::ArgumentCoder<CacheStorageConnection::Record>::encode):
466         (IPC::ArgumentCoder<CacheStorageConnection::Record>::decode):
467         * Shared/WebCoreArgumentCoders.h:
468         * WebKit.xcodeproj/project.pbxproj:
469         * WebProcess/Cache/WebCacheStorageConnection.cpp: Added.
470         (WebKit::WebCacheStorageConnection::WebCacheStorageConnection):
471         (WebKit::WebCacheStorageConnection::~WebCacheStorageConnection):
472         (WebKit::WebCacheStorageConnection::messageSenderConnection):
473         (WebKit::WebCacheStorageConnection::doOpen):
474         (WebKit::WebCacheStorageConnection::doRemove):
475         (WebKit::WebCacheStorageConnection::doRetrieveCaches):
476         (WebKit::WebCacheStorageConnection::doRetrieveRecords):
477         (WebKit::WebCacheStorageConnection::doBatchDeleteOperation):
478         (WebKit::WebCacheStorageConnection::doBatchPutOperation):
479         (WebKit::WebCacheStorageConnection::openCompleted):
480         (WebKit::WebCacheStorageConnection::removeCompleted):
481         (WebKit::WebCacheStorageConnection::updateCaches):
482         (WebKit::WebCacheStorageConnection::updateRecords):
483         (WebKit::WebCacheStorageConnection::deleteRecordsCompleted):
484         (WebKit::WebCacheStorageConnection::putRecordsCompleted):
485         * WebProcess/Cache/WebCacheStorageConnection.h: Added.
486         * WebProcess/Cache/WebCacheStorageConnection.messages.in: Added.
487         * WebProcess/Cache/WebCacheStorageProvider.cpp: Copied from Source/WebKit/WebProcess/Cache/WebCacheStorageProvider.h.
488         (WebKit::WebCacheStorageProvider::createCacheStorageConnection):
489         * WebProcess/Cache/WebCacheStorageProvider.h:
490         * WebProcess/Network/NetworkProcessConnection.cpp:
491         (WebKit::NetworkProcessConnection::didReceiveMessage):
492
493 2017-08-18  Commit Queue  <commit-queue@webkit.org>
494
495         Unreviewed, rolling out r220854.
496         https://bugs.webkit.org/show_bug.cgi?id=175716
497
498         I'm not sure we really need this (Requested by KaL on
499         #webkit).
500
501         Reverted changeset:
502
503         "[GTK][WPE] Add NTLM authentication enabled API"
504         https://bugs.webkit.org/show_bug.cgi?id=122952
505         http://trac.webkit.org/changeset/220854
506
507 2017-08-15  Megan Gardner  <megan_gardner@apple.com>
508
509         Update to changeSelectionWithTouchAt:baseIsStart:withFlags:
510         https://bugs.webkit.org/show_bug.cgi?id=175615
511
512         Update calls to use the flag versions, as they are used for passing state.
513         Leave old calls, but set them up to be removed next cycle.
514
515         Reviewed by Tim Horton.
516
517         * Platform/spi/ios/UIKitSPI.h:
518         * UIProcess/ios/WKContentViewInteraction.mm:
519         (selectionChangedWithTouch):
520         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:]):
521         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
522         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]):
523         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:withFlags:]):
524
525 2017-08-17  Chris Dumez  <cdumez@apple.com>
526
527         Regression(r220817): We should only copy the original request headers for Ping loads
528         https://bugs.webkit.org/show_bug.cgi?id=175679
529
530         Reviewed by Youenn Fablet.
531
532         For performance reason, we should only copy the original request headers for Ping loads
533         (Beacon at the moment), not for all CachedResourceRequests.
534
535         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
536         (WebKit::NetworkConnectionToWebProcess::loadPing):
537         * NetworkProcess/NetworkConnectionToWebProcess.h:
538         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
539         * NetworkProcess/NetworkResourceLoadParameters.cpp:
540         (WebKit::NetworkResourceLoadParameters::encode const):
541         (WebKit::NetworkResourceLoadParameters::decode):
542         * NetworkProcess/NetworkResourceLoadParameters.h:
543         * NetworkProcess/PingLoad.cpp:
544         (WebKit::PingLoad::PingLoad):
545         (WebKit::PingLoad::willPerformHTTPRedirection):
546         (WebKit::PingLoad::makeCrossOriginAccessRequest):
547         (WebKit::PingLoad::makeSimpleCrossOriginAccessRequest):
548         (WebKit::PingLoad::originalRequestHeaders const): Deleted.
549         * NetworkProcess/PingLoad.h:
550         * WebProcess/Network/WebLoaderStrategy.cpp:
551         (WebKit::WebLoaderStrategy::createPingHandle):
552         * WebProcess/Network/WebLoaderStrategy.h:
553
554 2017-08-17  Don Olmstead  <don.olmstead@sony.com>
555
556         [PAL] Relocate SessionID to root
557         https://bugs.webkit.org/show_bug.cgi?id=175684
558
559         Reviewed by Alex Christensen.
560
561         * NetworkProcess/Downloads/Download.h:
562         * NetworkProcess/Downloads/DownloadManager.cpp:
563         * NetworkProcess/NetworkCORSPreflightChecker.h:
564         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
565         * NetworkProcess/NetworkLoad.cpp:
566         * NetworkProcess/NetworkLoadParameters.h:
567         * NetworkProcess/NetworkProcess.cpp:
568         * NetworkProcess/NetworkProcess.h:
569         * NetworkProcess/NetworkResourceLoadParameters.h:
570         * NetworkProcess/NetworkSession.h:
571         * NetworkProcess/NetworkSocketStream.h:
572         * NetworkProcess/RemoteNetworkingContext.h:
573         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
574         * Scripts/webkit/messages.py:
575         (forward_declarations_and_headers.templates): Deleted.
576         (class_template_headers.template): Deleted.
577         * Shared/ChildProcess.cpp:
578         * Shared/SessionTracker.h:
579         * Shared/Storage/StorageProcessCreationParameters.h:
580         * Shared/WebCoreArgumentCoders.cpp:
581         * Shared/WebPageCreationParameters.h:
582         * Shared/WebProcessCreationParameters.h:
583         * Shared/WebsiteDataStoreParameters.h:
584         * Shared/mac/CookieStorageShim.mm:
585         * StorageProcess/IndexedDB/WebIDBConnectionToClient.h:
586         * StorageProcess/StorageProcess.cpp:
587         * StorageProcess/StorageProcess.h:
588         * StorageProcess/StorageToWebProcessConnection.h:
589         * UIProcess/API/APIPageConfiguration.h:
590         * UIProcess/API/APIWebsiteDataStore.h:
591         * UIProcess/API/glib/WebKitCookieManager.cpp:
592         * UIProcess/Plugins/PlugInAutoStartProvider.h:
593         * UIProcess/WebCookieManagerProxy.h:
594         * UIProcess/WebProcessPool.cpp:
595         * UIProcess/WebProcessPool.h:
596         * UIProcess/WebProcessProxy.h:
597         * UIProcess/WebsiteData/WebsiteDataStore.h:
598         * WebProcess/Cookies/WebCookieManager.h:
599         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
600         * WebProcess/Databases/WebDatabaseProvider.cpp:
601         * WebProcess/InjectedBundle/InjectedBundle.cpp:
602         * WebProcess/Network/NetworkProcessConnection.cpp:
603         * WebProcess/Network/WebLoaderStrategy.cpp:
604         * WebProcess/Network/WebSocketStream.cpp:
605         * WebProcess/Network/WebSocketStream.h:
606         * WebProcess/Storage/WebToStorageProcessConnection.h:
607         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
608         * WebProcess/WebCoreSupport/WebPlugInClient.h:
609         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
610         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
611         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
612         * WebProcess/WebPage/WebPage.cpp:
613         * WebProcess/WebProcess.h:
614
615 2017-08-17  Chris Dumez  <cdumez@apple.com>
616
617         REGRESSION (r220601): Crash under ProcessAssertion::markAsInvalidated()
618         https://bugs.webkit.org/show_bug.cgi?id=175685
619         <rdar://problem/33868623>
620
621         Reviewed by Sam Weinig.
622
623         After r220601, it is no longer safe to call a default-initialized WTF::Function.
624
625         * UIProcess/ios/ProcessAssertionIOS.mm:
626         (WebKit::ProcessAssertion::markAsInvalidated):
627
628 2017-08-17  Andreas Kling  <akling@apple.com>
629
630         Disable CSS regions at compile time
631         https://bugs.webkit.org/show_bug.cgi?id=175630
632
633         Reviewed by Antti Koivisto.
634
635         * Configurations/FeatureDefines.xcconfig:
636
637 2017-08-17  Wenson Hsieh  <wenson_hsieh@apple.com>
638
639         [iOS] Respect type fidelities when copying image elements to the pasteboard
640         https://bugs.webkit.org/show_bug.cgi?id=175638
641         <rdar://problem/26556043>
642
643         Reviewed by Ryosuke Niwa.
644
645         Currently, we treat the case when copying an image enclosed by a link by only writing a URL to the pasteboard.
646         This patch tweaks logic in WebPage::performActionOnElement to write both an image and a link to the pasteboard
647         if the hit-tested image element is enclosed by an anchor.
648
649         * Platform/spi/ios/UIKitSPI.h:
650         * WebProcess/WebPage/ios/WebPageIOS.mm:
651         (WebKit::containingLinkElement):
652
653         Tweak this helper to be more restrictive when finding an enclosing 'link' -- only return an element if isLink()
654         is true, and it is an HTMLAnchorElement. Currently, the isLink() also matches HTMLLinkElements, but this isn't
655         the intention here.
656
657         (WebKit::WebPage::performActionOnElement):
658
659 2017-08-17  Jacobo Aragunde Pérez  <jaragunde@igalia.com>
660
661         [WPE][GTK] Ensure proper casting of data in gvariants
662         https://bugs.webkit.org/show_bug.cgi?id=175667
663
664         Reviewed by Michael Catanzaro.
665
666         g_variant_builder_add requires data to have the correct width for their types, using
667         casting if necessary. Corrected a call where a single precision float was being put
668         into a double precision parameter without a cast.
669
670         * UIProcess/API/glib/WebKitWebViewSessionState.cpp:
671         (encodeFrameState):
672
673 2017-08-17  Don Olmstead  <don.olmstead@sony.com>
674
675         [PAL] Move SessionID into PAL
676         https://bugs.webkit.org/show_bug.cgi?id=174192
677
678         Reviewed by Antti Koivisto.
679
680         * NetworkProcess/Downloads/Download.cpp:
681         (WebKit::Download::Download):
682         * NetworkProcess/Downloads/Download.h:
683         (WebKit::Download::Download):
684         * NetworkProcess/Downloads/DownloadManager.cpp:
685         (WebKit::DownloadManager::startDownload):
686         (WebKit::DownloadManager::resumeDownload):
687         * NetworkProcess/Downloads/DownloadManager.h:
688         (WebKit::DownloadManager::startDownload):
689         * NetworkProcess/NetworkCORSPreflightChecker.h:
690         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
691         (WebKit::NetworkConnectionToWebProcess::createSocketStream):
692         (WebKit::storageSession):
693         (WebKit::NetworkConnectionToWebProcess::startDownload):
694         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
695         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
696         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
697         (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
698         (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
699         (WebKit::NetworkConnectionToWebProcess::getRawCookies):
700         (WebKit::NetworkConnectionToWebProcess::deleteCookie):
701         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
702         * NetworkProcess/NetworkConnectionToWebProcess.h:
703         (WebKit::NetworkConnectionToWebProcess::startDownload):
704         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
705         * NetworkProcess/NetworkLoad.cpp:
706         * NetworkProcess/NetworkLoadParameters.h:
707         * NetworkProcess/NetworkProcess.cpp:
708         (WebKit::NetworkProcess::initializeNetworkProcess):
709         (WebKit::NetworkProcess::destroySession):
710         (WebKit::fetchDiskCacheEntries):
711         (WebKit::NetworkProcess::fetchWebsiteData):
712         (WebKit::NetworkProcess::deleteWebsiteData):
713         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
714         (WebKit::NetworkProcess::downloadRequest):
715         (WebKit::NetworkProcess::resumeDownload):
716         * NetworkProcess/NetworkProcess.h:
717         * NetworkProcess/NetworkProcess.messages.in:
718         * NetworkProcess/NetworkResourceLoadParameters.h:
719         * NetworkProcess/NetworkResourceLoader.h:
720         * NetworkProcess/NetworkSession.cpp:
721         (WebKit::NetworkSession::create):
722         (WebKit::NetworkSession::defaultSession):
723         (WebKit::NetworkSession::NetworkSession):
724         * NetworkProcess/NetworkSession.h:
725         (WebKit::NetworkSession::sessionID const):
726         * NetworkProcess/NetworkSocketStream.cpp:
727         (WebKit::NetworkSocketStream::create):
728         (WebKit::NetworkSocketStream::NetworkSocketStream):
729         * NetworkProcess/NetworkSocketStream.h:
730         * NetworkProcess/RemoteNetworkingContext.h:
731         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
732         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
733         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
734         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
735         (WebKit::configurationForSessionID):
736         (WebKit::NetworkSessionCocoa::create):
737         (WebKit::NetworkSessionCocoa::defaultSession):
738         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
739         * NetworkProcess/soup/NetworkSessionSoup.cpp:
740         (WebKit::NetworkSessionSoup::NetworkSessionSoup):
741         * NetworkProcess/soup/NetworkSessionSoup.h:
742         * Scripts/webkit/messages.py:
743         (forward_declarations_and_headers.templates): Deleted.
744         (class_template_headers.template): Deleted.
745         * Shared/ChildProcess.cpp:
746         (WebKit::ChildProcess::initialize):
747         * Shared/SessionTracker.cpp:
748         (WebKit::staticSessionMap):
749         (WebKit::SessionTracker::networkSession):
750         (WebKit::SessionTracker::setSession):
751         (WebKit::SessionTracker::destroySession):
752         * Shared/SessionTracker.h:
753         * Shared/Storage/StorageProcessCreationParameters.h:
754         * Shared/WebCoreArgumentCoders.cpp:
755         * Shared/WebCoreArgumentCoders.h:
756         * Shared/WebPageCreationParameters.h:
757         * Shared/WebProcessCreationParameters.h:
758         * Shared/WebsiteDataStoreParameters.h:
759         * Shared/mac/CookieStorageShim.mm:
760         (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL):
761         * StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp:
762         (WebKit::WebIDBConnectionToClient::create):
763         (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
764         * StorageProcess/IndexedDB/WebIDBConnectionToClient.h:
765         * StorageProcess/StorageProcess.cpp:
766         (WebKit::StorageProcess::idbServer):
767         (WebKit::StorageProcess::fetchWebsiteData):
768         (WebKit::StorageProcess::deleteWebsiteData):
769         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
770         * StorageProcess/StorageProcess.h:
771         * StorageProcess/StorageProcess.messages.in:
772         * StorageProcess/StorageToWebProcessConnection.cpp:
773         (WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer):
774         * StorageProcess/StorageToWebProcessConnection.h:
775         * StorageProcess/StorageToWebProcessConnection.messages.in:
776         * UIProcess/API/APIPageConfiguration.cpp:
777         (API::PageConfiguration::setWebsiteDataStore):
778         (API::PageConfiguration::sessionID):
779         (API::PageConfiguration::setSessionID):
780         * UIProcess/API/APIPageConfiguration.h:
781         * UIProcess/API/APIWebsiteDataStore.cpp:
782         (API::WebsiteDataStore::defaultDataStore):
783         (API::WebsiteDataStore::createLegacy):
784         (API::WebsiteDataStore::WebsiteDataStore):
785         * UIProcess/API/APIWebsiteDataStore.h:
786         * UIProcess/API/C/WKCookieManager.cpp:
787         (WKCookieManagerGetHostnamesWithCookies):
788         (WKCookieManagerDeleteCookiesForHostname):
789         (WKCookieManagerDeleteAllCookies):
790         (WKCookieManagerDeleteAllCookiesModifiedAfterDate):
791         (WKCookieManagerSetHTTPCookieAcceptPolicy):
792         (WKCookieManagerGetHTTPCookieAcceptPolicy):
793         (WKCookieManagerStartObservingCookieChanges):
794         (WKCookieManagerStopObservingCookieChanges):
795         * UIProcess/API/Cocoa/WKProcessPool.mm:
796         (-[WKProcessPool _setCookieAcceptPolicy:]):
797         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
798         (-[WKWebsiteDataStore _initWithConfiguration:]):
799         * UIProcess/API/glib/WebKitCookieManager.cpp:
800         (webkit_cookie_manager_set_accept_policy):
801         (webkit_cookie_manager_get_accept_policy):
802         * UIProcess/Network/NetworkProcessProxy.cpp:
803         (WebKit::NetworkProcessProxy::fetchWebsiteData):
804         (WebKit::NetworkProcessProxy::deleteWebsiteData):
805         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
806         * UIProcess/Network/NetworkProcessProxy.h:
807         * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
808         (WebKit::PlugInAutoStartProvider::PlugInAutoStartProvider):
809         (WebKit::PlugInAutoStartProvider::addAutoStartOriginHash):
810         (WebKit::PlugInAutoStartProvider::autoStartOriginsTableCopy const):
811         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest):
812         (WebKit::PlugInAutoStartProvider::didReceiveUserInteraction):
813         * UIProcess/Plugins/PlugInAutoStartProvider.h:
814         * UIProcess/Storage/StorageProcessProxy.cpp:
815         (WebKit::StorageProcessProxy::fetchWebsiteData):
816         (WebKit::StorageProcessProxy::deleteWebsiteData):
817         (WebKit::StorageProcessProxy::deleteWebsiteDataForOrigins):
818         * UIProcess/Storage/StorageProcessProxy.h:
819         * UIProcess/WebCookieManagerProxy.cpp:
820         (WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
821         (WebKit::WebCookieManagerProxy::deleteCookiesForHostname):
822         (WebKit::WebCookieManagerProxy::deleteAllCookies):
823         (WebKit::WebCookieManagerProxy::deleteCookie):
824         (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince):
825         (WebKit::WebCookieManagerProxy::setCookie):
826         (WebKit::WebCookieManagerProxy::setCookies):
827         (WebKit::WebCookieManagerProxy::getAllCookies):
828         (WebKit::WebCookieManagerProxy::getCookies):
829         (WebKit::WebCookieManagerProxy::startObservingCookieChanges):
830         (WebKit::WebCookieManagerProxy::stopObservingCookieChanges):
831         (WebKit::WebCookieManagerProxy::setCookieObserverCallback):
832         (WebKit::WebCookieManagerProxy::registerObserver):
833         (WebKit::WebCookieManagerProxy::unregisterObserver):
834         (WebKit::WebCookieManagerProxy::cookiesDidChange):
835         (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
836         (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
837         * UIProcess/WebCookieManagerProxy.h:
838         * UIProcess/WebCookieManagerProxy.messages.in:
839         * UIProcess/WebPageProxy.h:
840         (WebKit::WebPageProxy::sessionID const):
841         * UIProcess/WebProcessPool.cpp:
842         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
843         (WebKit::WebProcessPool::createNewWebProcess):
844         (WebKit::WebProcessPool::createWebPage):
845         (WebKit::WebProcessPool::pageAddedToProcess):
846         (WebKit::WebProcessPool::pageRemovedFromProcess):
847         (WebKit::WebProcessPool::download):
848         (WebKit::WebProcessPool::resumeDownload):
849         (WebKit::WebProcessPool::addPlugInAutoStartOriginHash):
850         (WebKit::WebProcessPool::plugInDidReceiveUserInteraction):
851         * UIProcess/WebProcessPool.h:
852         * UIProcess/WebProcessPool.messages.in:
853         * UIProcess/WebProcessProxy.cpp:
854         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
855         (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData):
856         (WebKit::WebProcessProxy::fetchWebsiteData):
857         (WebKit::WebProcessProxy::deleteWebsiteData):
858         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
859         * UIProcess/WebProcessProxy.h:
860         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
861         (WebKit::WebsiteDataStore::createNonPersistent):
862         (WebKit::WebsiteDataStore::create):
863         (WebKit::WebsiteDataStore::WebsiteDataStore):
864         (WebKit::WebsiteDataStore::~WebsiteDataStore):
865         * UIProcess/WebsiteData/WebsiteDataStore.h:
866         (WebKit::WebsiteDataStore::sessionID const):
867         * WebProcess/Cookies/WebCookieManager.cpp:
868         (WebKit::WebCookieManager::getHostnamesWithCookies):
869         (WebKit::WebCookieManager::deleteCookiesForHostname):
870         (WebKit::WebCookieManager::deleteAllCookies):
871         (WebKit::WebCookieManager::deleteCookie):
872         (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
873         (WebKit::WebCookieManager::getAllCookies):
874         (WebKit::WebCookieManager::getCookies):
875         (WebKit::WebCookieManager::setCookie):
876         (WebKit::WebCookieManager::setCookies):
877         (WebKit::WebCookieManager::notifyCookiesDidChange):
878         (WebKit::WebCookieManager::startObservingCookieChanges):
879         (WebKit::WebCookieManager::stopObservingCookieChanges):
880         * WebProcess/Cookies/WebCookieManager.h:
881         * WebProcess/Cookies/WebCookieManager.messages.in:
882         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
883         (WebKit::WebIDBConnectionToServer::create):
884         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
885         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
886         * WebProcess/Databases/WebDatabaseProvider.cpp:
887         (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
888         * WebProcess/Databases/WebDatabaseProvider.h:
889         * WebProcess/InjectedBundle/InjectedBundle.cpp:
890         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
891         * WebProcess/Network/NetworkProcessConnection.cpp:
892         (WebKit::NetworkProcessConnection::didCacheResource):
893         * WebProcess/Network/NetworkProcessConnection.h:
894         * WebProcess/Network/NetworkProcessConnection.messages.in:
895         * WebProcess/Network/WebLoaderStrategy.cpp:
896         (WebKit::WebLoaderStrategy::scheduleLoad):
897         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
898         (WebKit::WebLoaderStrategy::createPingHandle):
899         * WebProcess/Network/WebSocketProvider.cpp:
900         (WebKit::WebSocketProvider::createSocketStreamHandle):
901         * WebProcess/Network/WebSocketProvider.h:
902         * WebProcess/Network/WebSocketStream.cpp:
903         (WebKit::WebSocketStream::create):
904         (WebKit::WebSocketStream::WebSocketStream):
905         * WebProcess/Network/WebSocketStream.h:
906         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
907         (WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession):
908         * WebProcess/Storage/WebToStorageProcessConnection.h:
909         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
910         (WebKit::WebFrameLoaderClient::convertMainResourceLoadToDownload):
911         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
912         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
913         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
914         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
915         * WebProcess/WebCoreSupport/WebPlugInClient.cpp:
916         (WebKit::WebPlugInClient::didStartFromOrigin):
917         * WebProcess/WebCoreSupport/WebPlugInClient.h:
918         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
919         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
920         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
921         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
922         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
923         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
924         * WebProcess/WebPage/WebFrame.cpp:
925         (WebKit::WebFrame::startDownload):
926         (WebKit::WebFrame::convertMainResourceLoadToDownload):
927         * WebProcess/WebPage/WebFrame.h:
928         * WebProcess/WebPage/WebPage.cpp:
929         (WebKit::WebPage::setSessionID):
930         (WebKit::WebPage::updatePreferences):
931         * WebProcess/WebPage/WebPage.h:
932         (WebKit::WebPage::sessionID const):
933         * WebProcess/WebProcess.cpp:
934         (WebKit::m_webSQLiteDatabaseTracker):
935         (WebKit::WebProcess::ensurePrivateBrowsingSession):
936         (WebKit::WebProcess::destroySession):
937         (WebKit::WebProcess::isPlugInAutoStartOriginHash):
938         (WebKit::WebProcess::plugInDidStartFromOrigin):
939         (WebKit::WebProcess::didAddPlugInAutoStartOriginHash):
940         (WebKit::WebProcess::resetPlugInAutoStartOriginDefaultHashes):
941         (WebKit::WebProcess::resetPlugInAutoStartOriginHashes):
942         (WebKit::WebProcess::plugInDidReceiveUserInteraction):
943         (WebKit::WebProcess::fetchWebsiteData):
944         (WebKit::WebProcess::deleteWebsiteData):
945         (WebKit::WebProcess::deleteWebsiteDataForOrigins):
946         * WebProcess/WebProcess.h:
947         * WebProcess/WebProcess.messages.in:
948
949 2017-08-17  Joseph Pecoraro  <pecoraro@apple.com>
950
951         Fix typo: setUpInectedBundleClient
952         https://bugs.webkit.org/show_bug.cgi?id=175655
953
954         Reviewed by Andreas Kling.
955
956         * UIProcess/API/Cocoa/WKProcessGroup.mm:
957         (setUpInjectedBundleClient):
958         (-[WKProcessGroup initWithInjectedBundleURL:]):
959
960 2017-08-17  Carlos Garcia Campos  <cgarcia@igalia.com>
961
962         [GTK][WPE] Add NTLM authentication enabled API
963         https://bugs.webkit.org/show_bug.cgi?id=122952
964
965         Reviewed by Michael Catanzaro.
966
967         Add API to WebKitWebContext to enable/disable NTLM authentication.
968
969         * NetworkProcess/NetworkProcess.h:
970         * NetworkProcess/NetworkProcess.messages.in:
971         * NetworkProcess/NetworkProcessCreationParameters.cpp:
972         (WebKit::NetworkProcessCreationParameters::encode const):
973         (WebKit::NetworkProcessCreationParameters::decode):
974         * NetworkProcess/NetworkProcessCreationParameters.h:
975         * NetworkProcess/soup/NetworkProcessSoup.cpp:
976         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
977         (WebKit::NetworkProcess::setNTLMAuthenticationEnabled):
978         * UIProcess/API/glib/WebKitWebContext.cpp:
979         (webkit_web_context_get_ntlm_authentication_enabled):
980         (webkit_web_context_set_ntlm_authentication_enabled):
981         * UIProcess/API/gtk/WebKitWebContext.h:
982         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
983         * UIProcess/API/wpe/WebKitWebContext.h:
984         * UIProcess/WebProcessPool.h:
985         * UIProcess/soup/WebProcessPoolSoup.cpp:
986         (WebKit::WebProcessPool::setNTLMAuthenticationEnabled):
987
988 2017-08-16  Andy Estes  <aestes@apple.com>
989
990         [Apple Pay] Rename PaymentRequest to ApplePaySessionPaymentRequest
991         https://bugs.webkit.org/show_bug.cgi?id=175648
992
993         Reviewed by Tim Horton.
994
995         * Scripts/webkit/messages.py:
996         (headers_for_type):
997         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
998         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::encode):
999         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode):
1000         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ContactFields>::encode):
1001         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ContactFields>::decode):
1002         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::encode):
1003         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::decode):
1004         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::MerchantCapabilities>::encode):
1005         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::MerchantCapabilities>::decode):
1006         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ShippingMethod>::encode):
1007         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ShippingMethod>::decode):
1008         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::TotalAndLineItems>::encode):
1009         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::TotalAndLineItems>::decode):
1010         (IPC::ArgumentCoder<PaymentRequest>::encode): Deleted.
1011         (IPC::ArgumentCoder<PaymentRequest>::decode): Deleted.
1012         (IPC::ArgumentCoder<PaymentRequest::ContactFields>::encode): Deleted.
1013         (IPC::ArgumentCoder<PaymentRequest::ContactFields>::decode): Deleted.
1014         (IPC::ArgumentCoder<PaymentRequest::LineItem>::encode): Deleted.
1015         (IPC::ArgumentCoder<PaymentRequest::LineItem>::decode): Deleted.
1016         (IPC::ArgumentCoder<PaymentRequest::MerchantCapabilities>::encode): Deleted.
1017         (IPC::ArgumentCoder<PaymentRequest::MerchantCapabilities>::decode): Deleted.
1018         (IPC::ArgumentCoder<PaymentRequest::ShippingMethod>::encode): Deleted.
1019         (IPC::ArgumentCoder<PaymentRequest::ShippingMethod>::decode): Deleted.
1020         (IPC::ArgumentCoder<PaymentRequest::TotalAndLineItems>::encode): Deleted.
1021         (IPC::ArgumentCoder<PaymentRequest::TotalAndLineItems>::decode): Deleted.
1022         * Shared/WebCoreArgumentCoders.h:
1023         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
1024         (WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
1025         (WebKit::WebPaymentCoordinatorProxy::didSelectShippingMethod):
1026         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
1027         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
1028         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
1029         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1030         (toShippingMethod):
1031         (WebKit::toPKContactFields):
1032         (WebKit::toPKAddressField):
1033         (WebKit::toPKPaymentSummaryItemType):
1034         (WebKit::toPKPaymentSummaryItem):
1035         (WebKit::toPKPaymentSummaryItems):
1036         (WebKit::toPKMerchantCapabilities):
1037         (WebKit::toPKShippingType):
1038         (WebKit::toPKShippingMethod):
1039         (WebKit::toPKPaymentRequest):
1040         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
1041         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
1042         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
1043         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
1044         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
1045         (WebKit::WebPaymentCoordinator::showPaymentUI):
1046         (WebKit::WebPaymentCoordinator::didSelectShippingMethod):
1047         * WebProcess/ApplePay/WebPaymentCoordinator.h:
1048         * WebProcess/ApplePay/WebPaymentCoordinator.messages.in:
1049
1050 2017-08-16  Chris Dumez  <cdumez@apple.com>
1051
1052         Cross origin Beacon requests with a ArrayBuffer / ArrayBufferView payload should not do a CORS preflight
1053         https://bugs.webkit.org/show_bug.cgi?id=175628
1054         <rdar://problem/33919278>
1055
1056         Reviewed by Geoffrey Garen.
1057
1058         Cross origin Beacon requests with a ArrayBuffer / ArrayBufferView payload should not do a CORS preflight.
1059         To achieve this, the following changes were made:
1060         1. Revert r220779 which caused us to use a non CORS-safelisted Content-Type header for such payload
1061         2. Teach PingLoad how to deal with "simple" cross origin requests (i.e. Don't assume we need a CORS
1062            preflight merely because the fetch mode is set to "cors").
1063
1064         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
1065         (WebKit::NetworkCORSPreflightChecker::startPreflight):
1066         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1067         (WebKit::NetworkResourceLoadParameters::encode const):
1068         (WebKit::NetworkResourceLoadParameters::decode):
1069         * NetworkProcess/NetworkResourceLoadParameters.h:
1070         * NetworkProcess/PingLoad.cpp:
1071         (WebKit::PingLoad::PingLoad):
1072         (WebKit::PingLoad::loadRequest):
1073         (WebKit::PingLoad::originalRequestHeaders const):
1074         (WebKit::PingLoad::willPerformHTTPRedirection):
1075         (WebKit::PingLoad::isAllowedRedirect const):
1076         (WebKit::PingLoad::makeCrossOriginAccessRequest):
1077         (WebKit::PingLoad::makeSimpleCrossOriginAccessRequest):
1078         (WebKit::PingLoad::makeCrossOriginAccessRequestWithPreflight):
1079         (WebKit::PingLoad::preflightSuccess):
1080         * NetworkProcess/PingLoad.h:
1081         * WebProcess/Network/WebLoaderStrategy.cpp:
1082         (WebKit::WebLoaderStrategy::createPingHandle):
1083         * WebProcess/Network/WebLoaderStrategy.h:
1084
1085 2017-08-16  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
1086
1087         [PAL] Move spi/ios and spi/win directories into PAL
1088         https://bugs.webkit.org/show_bug.cgi?id=175171
1089
1090         Reviewed by Antti Koivisto.
1091
1092         * UIProcess/Cocoa/NavigationState.mm:
1093         * UIProcess/ios/WKActionSheetAssistant.h:
1094         * UIProcess/ios/WKActionSheetAssistant.mm:
1095         * UIProcess/ios/WKContentViewInteraction.mm:
1096         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
1097         * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
1098         * WebProcess/cocoa/WebProcessCocoa.mm:
1099
1100 2017-08-16  Miguel Gomez  <magomez@igalia.com>
1101
1102         [GTK] Crash of WebProcess with on-demand AC
1103         https://bugs.webkit.org/show_bug.cgi?id=171161
1104
1105         Reviewed by Carlos Garcia Campos.
1106
1107         Set the viewOverlayRootLayer to the previous layerTreeHost if it exists. This avoids a
1108         crash when reusing the previous layerTreeHost, because it would keep a reference to an
1109         already destroyed viewOverlayRootLayer.
1110
1111         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1112         (WebKit::AcceleratedDrawingArea::attachViewOverlayGraphicsLayer):
1113
1114 2017-08-16  Zan Dobersek  <zdobersek@igalia.com>
1115
1116         [CoordGraphics] Simplify CoordinatedGraphicsScene state updates
1117         https://bugs.webkit.org/show_bug.cgi?id=175528
1118         <rdar://problem/33876795>
1119
1120         Reviewed by Carlos Garcia Campos.
1121
1122         Hold the information about state updates in ThreadedCompositor, in the
1123         m_attributes struct. This way we don't need to store the updates in
1124         functors and accumulate them in the CoordinatedGraphicsScene class, but
1125         instead just apply any pending state update or atlas removal before the
1126         scene is rendered.
1127
1128         This removes the need to update the CoordinatedGraphicsScene object from
1129         the main thread with data that ultimately has to be handled on the
1130         composition thread. Similarly, when updating CoordinatedGraphicsScene, we
1131         only need to synchronize on the m_attributes lock object once in order to
1132         retrieve the scene update information, instead of having each functor do
1133         that repeatedly.
1134
1135         Outside of CoordinatedGraphicsScene and ThreadedCompositor classes, the
1136         CompositingCoordinator class now passes the atlases-to-remove Vector by
1137         a const lvalue reference down to ThreadedCompositor, and then manually
1138         clears the Vector. Before the Vector was passed as an rvalue reference,
1139         depending on the ThreadedCompositor code to clear out the original Vector
1140         object by moving its resources into the functor object. This doesn't occur
1141         anymore because the Vector object is now appended to another Vector.
1142
1143         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1144         (WebKit::CoordinatedGraphicsScene::applyStateChanges):
1145         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
1146         (WebKit::CoordinatedGraphicsScene::detach):
1147         (WebKit::CoordinatedGraphicsScene::setActive):
1148         (WebKit::CoordinatedGraphicsScene::syncRemoteContent): Deleted.
1149         (WebKit::CoordinatedGraphicsScene::appendUpdate): Deleted.
1150         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1151         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1152         (WebKit::ThreadedCompositor::renderLayerTree):
1153         (WebKit::ThreadedCompositor::updateSceneState):
1154         (WebKit::ThreadedCompositor::releaseUpdateAtlases):
1155         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1156         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1157         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
1158         (WebKit::CompositingCoordinator::releaseAtlases):
1159         (WebKit::CompositingCoordinator::clearUpdateAtlases):
1160         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1161         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1162         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
1163         (WebKit::ThreadedCoordinatedLayerTreeHost::releaseUpdateAtlases):
1164         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
1165
1166 2017-08-16  Andy Estes  <aestes@apple.com>
1167
1168         [Payment Request] Add an ENABLE flag and an experimental feature preference
1169         https://bugs.webkit.org/show_bug.cgi?id=175622
1170
1171         Reviewed by Tim Horton.
1172
1173         * Configurations/FeatureDefines.xcconfig:
1174         * Shared/WebPreferencesDefinitions.h:
1175         * UIProcess/API/C/WKPreferences.cpp:
1176         (WKPreferencesSetPaymentRequestEnabled):
1177         (WKPreferencesGetPaymentRequestEnabled):
1178         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1179         * WebProcess/WebPage/WebPage.cpp:
1180         (WebKit::WebPage::updatePreferences):
1181
1182 2017-08-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1183
1184         [GTK][WPE] WebKitAutomationSession should set session client to nullptr on dispose
1185         https://bugs.webkit.org/show_bug.cgi?id=175564
1186
1187         Reviewed by Carlos Alberto Lopez Perez.
1188
1189         WebAutomationSession expects its client to be nullptr in the destructor.
1190
1191         * UIProcess/API/glib/WebKitAutomationSession.cpp:
1192         (webkitAutomationSessionDispose):
1193
1194 2017-08-15  Tim Horton  <timothy_horton@apple.com>
1195
1196         WKSnapshotConfiguration is missing from the WebKit umbrella header
1197         https://bugs.webkit.org/show_bug.cgi?id=175614
1198         <rdar://problem/33812691>
1199
1200         Reviewed by Dan Bernstein.
1201
1202         * Shared/API/Cocoa/WebKit.h:
1203         Add WKSnapshotConfiguration, which is a public header.
1204
1205 2017-08-15  Simon Fraser  <simon.fraser@apple.com>
1206
1207         Allow WebCore logging channels to be set from the UI process
1208         https://bugs.webkit.org/show_bug.cgi?id=175608
1209
1210         Reviewed by Tim Horton.
1211
1212         The UI process can now read the "WebCoreLogging" default, and pass it to the web process
1213         via WebProcessCreationParameters, where WebProcess::platformInitializeWebProcess() uses
1214         it to set up WebCore logging channels. Note that these will override channels read from
1215         the web process user defaults domain (but those are hard to set anyway).
1216
1217         * Shared/WebProcessCreationParameters.cpp:
1218         (WebKit::WebProcessCreationParameters::encode const):
1219         (WebKit::WebProcessCreationParameters::decode):
1220         * Shared/WebProcessCreationParameters.h:
1221         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1222         (WebKit::WebProcessPool::platformInitializeWebProcess):
1223         * WebProcess/cocoa/WebProcessCocoa.mm:
1224         (WebKit::WebProcess::platformInitializeWebProcess):
1225
1226 2017-08-15  Don Olmstead  <don.olmstead@sony.com>
1227
1228         [PAL] Move Sleep classes into PAL
1229         https://bugs.webkit.org/show_bug.cgi?id=175456
1230
1231         Reviewed by Ryosuke Niwa.
1232
1233         * UIProcess/mac/WKFullScreenWindowController.h:
1234         * UIProcess/mac/WKFullScreenWindowController.mm:
1235
1236 2017-08-15  Youenn Fablet  <youenn@apple.com>
1237
1238         [Cache API] Adding generic support for CacheStorage and Cache methods
1239         https://bugs.webkit.org/show_bug.cgi?id=175455
1240
1241         Reviewed by Chris Dumez.
1242
1243         * WebKit.xcodeproj/project.pbxproj:
1244         * WebProcess/Cache/WebCacheStorageProvider.h: Added.
1245         * WebProcess/WebPage/WebPage.cpp:
1246         (WebKit::m_cpuLimit):
1247         * WebProcess/WebProcess.cpp:
1248         (WebKit::WebProcess::WebProcess):
1249         * WebProcess/WebProcess.h:
1250         (WebKit::WebProcess::cacheStorageProvider):
1251
1252 2017-08-15  Michael Catanzaro  <mcatanzaro@igalia.com>
1253
1254         Unreviewed, rolling out r220700.
1255
1256         Broke debug bot
1257
1258         Reverted changeset:
1259
1260         "[CoordGraphics] Simplify CoordinatedGraphicsScene state
1261         updates"
1262         https://bugs.webkit.org/show_bug.cgi?id=175528
1263         http://trac.webkit.org/changeset/220700
1264
1265 2017-08-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1266
1267         WebDriver: timeout when JavaScript alert is shown in onload handler
1268         https://bugs.webkit.org/show_bug.cgi?id=175315
1269         <rdar://problem/33788294>
1270
1271         Reviewed by Brian Burg.
1272
1273         When a JavaScript alert is shown in an onload handler, the alert prevents the load from finishing in case of
1274         normal page load strategy, so navigation commands or any other command for which we wait for navigation to
1275         complete end up timing out. There are two selenium tests covering this that are currently timing out:
1276         testShouldHandleAlertOnPageLoad and testShouldHandleAlertOnPageLoadUsingGet. The spec says that in case of page
1277         load timeout we should only fail with timeout error when there isn't an active alert dialog. If the next command
1278         expects an alert it will just work, otherwise it will fail with UnexpectedAlertOpen error when trying to handle
1279         user prompts.
1280
1281         9 Navigation.
1282         https://w3c.github.io/webdriver/webdriver-spec.html#dfn-wait-for-navigation-to-complete
1283
1284         * UIProcess/Automation/WebAutomationSession.cpp:
1285         (WebKit::WebAutomationSession::waitForNavigationToComplete): Do not wait for the timeout when the page is
1286         loading and there's an active alert in case of normal page load strategy.
1287         (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout): Respond with timeout unless
1288         the page is showing a JavaScript dialog.
1289         (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout): Ditto.
1290         (WebKit::WebAutomationSession::loadTimerFired): Use respondToPendingPageNavigationCallbacksWithTimeout() and
1291         respondToPendingFrameNavigationCallbacksWithTimeout().
1292         (WebKit::WebAutomationSession::willShowJavaScriptDialog): The page is about to show a JavaScript dialog, so
1293         we wait until the next run loop iteration to give time for the client to show the dialog, then check if page is
1294         loading and the dialog is still present. If that's the case we finish all normal strategy pending navigations.
1295         * UIProcess/Automation/WebAutomationSession.h:
1296         * UIProcess/WebPageProxy.cpp:
1297         (WebKit::WebPageProxy::runJavaScriptAlert): If controlled by automation, notify the session.
1298         (WebKit::WebPageProxy::runJavaScriptConfirm): Ditto.
1299         (WebKit::WebPageProxy::runJavaScriptPrompt): Ditto.
1300         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): Ditto.
1301
1302 2017-08-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1303
1304         WebDriver: handle click events on option elements
1305         https://bugs.webkit.org/show_bug.cgi?id=174710
1306         <rdar://problem/33459305>
1307
1308         Reviewed by Brian Burg.
1309
1310         Add selectOptionElement method to automation to select an option element according to the WebDriver
1311         specification.
1312
1313         14.1 Element Click.
1314         https://w3c.github.io/webdriver/webdriver-spec.html#element-click
1315
1316         * UIProcess/Automation/Automation.json: Add selectOptionElement method and ElementNotSelectable error.
1317         * UIProcess/Automation/WebAutomationSession.cpp:
1318         (WebKit::WebAutomationSession::selectOptionElement):Send SelectOptionElement message to the web process.
1319         (WebKit::WebAutomationSession::didSelectOptionElement): Notify the driver.
1320         * UIProcess/Automation/WebAutomationSession.h:
1321         * UIProcess/Automation/WebAutomationSession.messages.in: Add DidSelectOptionElement message.
1322         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1323         (WebKit::elementContainer): Helper to get the container of an element according to the spec.
1324         (WebKit::WebAutomationSessionProxy::computeElementLayout): Use the container element to scroll the view and
1325         compute the in-view center point.
1326         (WebKit::WebAutomationSessionProxy::selectOptionElement): Use HTMLSelectElement::optionSelectedByUser().
1327         * WebProcess/Automation/WebAutomationSessionProxy.h:
1328         * WebProcess/Automation/WebAutomationSessionProxy.messages.in: Add SelectOptionElement message.
1329
1330 2017-08-14  Simon Fraser  <simon.fraser@apple.com>
1331
1332         Remove Proximity Events and related code
1333         https://bugs.webkit.org/show_bug.cgi?id=175545
1334
1335         Reviewed by Daniel Bates.
1336
1337         No platform enables Proximity Events, so remove code inside ENABLE(PROXIMITY_EVENTS)
1338         and other related code.
1339
1340         * CMakeLists.txt:
1341         * Configurations/FeatureDefines.xcconfig:
1342         * WebProcess/WebCoreSupport/WebDeviceProximityClient.cpp: Removed.
1343         * WebProcess/WebCoreSupport/WebDeviceProximityClient.h: Removed.
1344         * WebProcess/WebPage/WebPage.cpp:
1345         (WebKit::m_cpuLimit):
1346
1347 2017-08-14  Simon Fraser  <simon.fraser@apple.com>
1348
1349         Remove ENABLE(REQUEST_AUTOCOMPLETE) code, which was disabled everywhere
1350         https://bugs.webkit.org/show_bug.cgi?id=175504
1351
1352         Reviewed by Sam Weinig.
1353
1354         * Configurations/FeatureDefines.xcconfig:
1355         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1356         (WebKit::WebFrameLoaderClient::didRequestAutocomplete): Deleted.
1357         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1358
1359 2017-08-14  Simon Fraser  <simon.fraser@apple.com>
1360
1361         Remove ENABLE_VIEW_MODE_CSS_MEDIA and related code
1362         https://bugs.webkit.org/show_bug.cgi?id=175557
1363
1364         Reviewed by Jon Lee.
1365
1366         No port cares about the ENABLE(VIEW_MODE_CSS_MEDIA) feature, so remove it.
1367
1368         * Configurations/FeatureDefines.xcconfig:
1369
1370 2017-08-14  Andy Estes  <aestes@apple.com>
1371
1372         [Apple Pay] Add support for phonetic contact names
1373         https://bugs.webkit.org/show_bug.cgi?id=175537
1374         <rdar://problem/32002644>
1375
1376         Reviewed by Tim Horton.
1377
1378         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: Soft-linked PKContactFieldPhoneticName.
1379         (WebKit::toPKContactFields): Added code to append PKContactFieldPhoneticName to result if
1380         contactFields.phoneticName is true.
1381         (WebKit::toNSError): Specified PKContactFieldPhoneticName as the contact field for
1382         PaymentError::ContactField::PhoneticName.
1383
1384 2017-08-14  Tim Horton  <timothy_horton@apple.com>
1385
1386         Only create directory and sandbox extension handle for storage directories if they are set
1387         https://bugs.webkit.org/show_bug.cgi?id=175522
1388
1389         Reviewed by Brady Eidson.
1390
1391         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1392         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
1393         If using a non-persistent WebsiteDataStore, all the storage directories
1394         are unset, but we still try to create them and make sandbox extensions
1395         for them. This has no effect except a ton of noisy logging, but that
1396         is reason enough to stop.
1397
1398         This is similar to r216053, but for more directories.
1399
1400 2017-08-14  Zan Dobersek  <zdobersek@igalia.com>
1401
1402         [CoordGraphics] Simplify CoordinatedGraphicsScene state updates
1403         https://bugs.webkit.org/show_bug.cgi?id=175528
1404
1405         Reviewed by Carlos Garcia Campos.
1406
1407         Hold the information about state updates in ThreadedCompositor, in the
1408         m_attributes struct. This way we don't need to store the updates in
1409         functors and accumulate them in the CoordinatedGraphicsScene class, but
1410         instead just apply any pending state update or atlas removal before the
1411         scene is rendered.
1412
1413         This removes the need to update the CoordinatedGraphicsScene object from
1414         the main thread with data that ultimately has to be handled on the
1415         composition thread. Similarly, when updating CoordinatedGraphicsScene, we
1416         only need to synchronize on the m_attributes lock object once in order to
1417         retrieve the scene update information, instead of having each functor do
1418         that repeatedly.
1419
1420         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1421         (WebKit::CoordinatedGraphicsScene::applyStateChanges):
1422         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
1423         (WebKit::CoordinatedGraphicsScene::detach):
1424         (WebKit::CoordinatedGraphicsScene::setActive):
1425         (WebKit::CoordinatedGraphicsScene::syncRemoteContent): Deleted.
1426         (WebKit::CoordinatedGraphicsScene::appendUpdate): Deleted.
1427         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1428         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1429         (WebKit::ThreadedCompositor::renderLayerTree):
1430         (WebKit::ThreadedCompositor::updateSceneState):
1431         (WebKit::ThreadedCompositor::releaseUpdateAtlases):
1432         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1433
1434 2017-08-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1435
1436         [GTK][WPE] Avoid emitting WebKitFaviconDatabase::favicon-changed multiple times while setting an icon
1437         https://bugs.webkit.org/show_bug.cgi?id=175531
1438
1439         Reviewed by Michael Catanzaro.
1440
1441         When webkitFaviconDatabaseSetIconForPageURL() is called, both setIconURLForPageURL() and setIconDataForIconURL()
1442         might notify the client, which ends up emitting the WebKitFaviconDatabase::favicon-changed signal and calling
1443         webkitFaviconDatabaseSetIconURLForPageURL(). Both things are already done by
1444         webkitFaviconDatabaseSetIconForPageURL() itself, so we can just ignore the client notification while setting a
1445         new icon.
1446
1447         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
1448         (webkitFaviconDatabaseSetIconURLForPageURL): Return early if isSettingIcon is true.
1449         (webkitFaviconDatabaseSetIconForPageURL): Set isSettingIcon to true for the scope.
1450
1451 2017-08-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1452
1453         [GTK][WPE] Crash in IconDatabase::IconRecord::setImageData()
1454         https://bugs.webkit.org/show_bug.cgi?id=175527
1455
1456         Reviewed by Žan Doberšek.
1457
1458         The problem is that when setImageData() is called from IconDatabase::readFromDatabase() the shared buffer might
1459         be nullptr, because getImageDataForIconURLFromSQLDatabase() returns nullptr if the icon data is not in the database.
1460
1461         * UIProcess/API/glib/IconDatabase.cpp:
1462         (WebKit::IconDatabase::IconRecord::setImageData): Return early if passed in buffer is nullptr.
1463
1464 2017-08-14  Zan Dobersek  <zdobersek@igalia.com>
1465
1466         [ThreadedCompositor] Improve composition and update state handling
1467         https://bugs.webkit.org/show_bug.cgi?id=172448
1468
1469         Reviewed by Carlos Garcia Campos.
1470
1471         In the ThreadedCompositor and related classes, we now track composition
1472         and scene update states separately. This enables properly piping in the
1473         DisplayRefreshMonitor object, leveraging it for both display refresh
1474         notifications and signalling to the client that the scene update is
1475         completed.
1476
1477         In CompositingRunLoop, two separate states are now used, one for
1478         compositing and the other for scene update. Access to both should be done
1479         while the related Lock object is held. The pending update state is also
1480         tracked in order to schedule any required updates as soon as the current
1481         state update is completed.
1482
1483         In ThreadedCompositor, the information about client notification and
1484         update completion coordination is now also kept under a Lock object,
1485         moving away from atomics. DisplayRefreshMonitor can now utilize just
1486         two methods in order to either schedule an update or report that update
1487         as finished.
1488
1489         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
1490         (WebKit::CompositingRunLoop::CompositingRunLoop):
1491         (WebKit::CompositingRunLoop::scheduleUpdate):
1492         (WebKit::CompositingRunLoop::stopUpdates):
1493         (WebKit::CompositingRunLoop::compositionCompleted):
1494         (WebKit::CompositingRunLoop::updateCompleted):
1495         (WebKit::CompositingRunLoop::updateTimerFired):
1496         (WebKit::CompositingRunLoop::isActive): Deleted.
1497         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
1498         (WebKit::CompositingRunLoop::stateLock):
1499         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1500         (WebKit::m_displayRefreshMonitor):
1501         (WebKit::ThreadedCompositor::sceneUpdateFinished):
1502         (WebKit::ThreadedCompositor::updateSceneState):
1503         (WebKit::ThreadedCompositor::requestDisplayRefreshMonitorUpdate):
1504         (WebKit::ThreadedCompositor::handleDisplayRefreshMonitorUpdate):
1505         (WebKit::ThreadedCompositor::renderNextFrameIfNeeded): Deleted.
1506         (WebKit::ThreadedCompositor::completeCoordinatedUpdateIfNeeded): Deleted.
1507         (WebKit::ThreadedCompositor::coordinateUpdateCompletionWithClient): Deleted.
1508         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1509         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
1510         (WebKit::ThreadedDisplayRefreshMonitor::requestRefreshCallback):
1511         (WebKit::ThreadedDisplayRefreshMonitor::displayRefreshCallback):
1512
1513 2017-08-13  Manuel Rego Casasnovas  <rego@igalia.com>
1514
1515         Composition underline color is always black
1516         https://bugs.webkit.org/show_bug.cgi?id=174675
1517
1518         Reviewed by Ryosuke Niwa.
1519
1520         This patch uses the current color of the text instead of black
1521         for the composition underline marker.
1522         This makes it visible in the case we have a black/dark background.
1523
1524         * UIProcess/Cocoa/WebViewImpl.mm:
1525         (WebKit::extractUnderlines): If NSUnderlineColorAttributeName
1526         is not present use text color for composition underline.
1527         (WebKit::WebViewImpl::setMarkedText): Use text color
1528         for composition underline in the plain text case.
1529         * UIProcess/gtk/InputMethodFilter.cpp:
1530         (WebKit::InputMethodFilter::handleKeyboardEventWithCompositionResults):
1531         Use text color for composition underline.
1532         (WebKit::InputMethodFilter::updatePreedit): Ditto.
1533         * WebProcess/WebPage/WebPage.cpp:
1534         (WebKit::WebPage::setCompositionForTesting): Ditto.
1535
1536 2017-08-13  Adrian Perez de Castro  <aperez@igalia.com>
1537
1538         [WPE] Implement WebCore::standardUserAgent()
1539         https://bugs.webkit.org/show_bug.cgi?id=175507
1540
1541         Reviewed by Carlos Alberto Lopez Perez.
1542
1543         Implement missing User-Agent handling for the WPE port by sharing the code with the GTK+ port.
1544
1545         * UIProcess/API/glib/WebKitSettings.cpp: Remove preprocessor conditionals for the WPE port.
1546         (webkit_settings_set_user_agent):
1547         (webkit_settings_set_user_agent_with_application_details):
1548         * UIProcess/wpe/WebPageProxyWPE.cpp:
1549         (WebKit::WebPageProxy::standardUserAgent): Remove hardcoded value and make use of WebCore::standardUserAgent().
1550
1551 2017-08-11  Ryosuke Niwa  <rniwa@webkit.org>
1552
1553         Replace DATA_TRANSFER_ITEMS by a runtime flag and add a stub implementation
1554         https://bugs.webkit.org/show_bug.cgi?id=175474
1555         <rdar://problem/33844628>
1556
1557         Reviewed by Wenson Hsieh.
1558
1559         Replaced the build flag by a runtime flag and disabled the feature by default.
1560
1561         * Configurations/FeatureDefines.xcconfig:
1562         * Shared/WebPreferencesDefinitions.h:
1563         * UIProcess/API/C/WKPreferences.cpp:
1564         (WKPreferencesSetDataTransferItemsEnabled): Added to be used by WebKitTestRunner.
1565         (WKPreferencesGetDataTransferItemsEnabled): Ditto.
1566         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1567         * WebProcess/WebPage/WebPage.cpp:
1568         (WebKit::WebPage::updatePreferences):
1569
1570 2017-08-10  Sam Weinig  <sam@webkit.org>
1571
1572         WTF::Function does not allow for reference / non-default constructible return types
1573         https://bugs.webkit.org/show_bug.cgi?id=175244
1574
1575         Reviewed by Chris Dumez.
1576
1577         * UIProcess/WebResourceLoadStatisticsStore.h:
1578         Update the default value for the updateCookiePartitioningForDomainsHandler parameter to be an 
1579         empty lambda, rather than default initialization, which leads to a null WTF::Function. This allows
1580         us to remove support for calling null WTF::Function. No change in behavior.
1581
1582 2017-08-11  Adrian Perez de Castro  <aperez@igalia.com>
1583
1584         [WPE] Build failure with Clang 4.0.1: no matching conversion for functional-style cast from 'pointer' (aka 'unsigned short *') to 'WTF::String'
1585         https://bugs.webkit.org/show_bug.cgi?id=175477
1586
1587         Reviewed by Žan Doberšek.
1588
1589         * Shared/wpe/WebEventFactory.cpp:
1590         (WebKit::singleCharacterStringForKeyEvent): Cast to UChar* to make
1591         compiler choose the correct WTF::String constructor.
1592
1593 2017-08-11  Carlos Garcia Campos  <cgarcia@igalia.com>
1594
1595         [Soup] Cannot access HTTPS sites using a HTTP proxy that requires authentication
1596         https://bugs.webkit.org/show_bug.cgi?id=175378
1597
1598         Reviewed by Sergio Villar Senin.
1599
1600         In case of HTTPS resource with a proxy, libsoup uses a tunnel internally, that uses its own SoupMessage during
1601         the proxy authentication. We were ignoring authentication requests for other messages.
1602
1603         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1604         (WebKit::NetworkDataTaskSoup::authenticateCallback): Only return early if the message does't match and it's not
1605         HTTPS resource over a proxy.
1606         (WebKit::NetworkDataTaskSoup::authenticate): Use the soup message from the authentication challenge.
1607         (WebKit::NetworkDataTaskSoup::continueAuthenticate): Ditto.
1608
1609 2017-08-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1610
1611         [Soup] Do not spawn the network process to setup cookie persistent storage
1612         https://bugs.webkit.org/show_bug.cgi?id=175424
1613
1614         Reviewed by Sergio Villar Senin.
1615
1616         The persistent storage configuration is saved and passed to network process as creation parameters, so we don't
1617         need to spawn the network process to configure it, when it's created eventually it will use the configuration.
1618
1619         * UIProcess/soup/WebCookieManagerProxySoup.cpp:
1620         (WebKit::WebCookieManagerProxy::setCookiePersistentStorage): Use sendToNetworkingProcess() instead of
1621         endToNetworkingProcessRelaunchingIfNecessary().
1622
1623 2017-08-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1624
1625         [GTK][WPE] Assertion failure in TimerBase inside WebCore::IconRecord::setImageData
1626         https://bugs.webkit.org/show_bug.cgi?id=173866
1627         <rdar://problem/33122050>
1628
1629         Reviewed by Michael Catanzaro.
1630
1631         IconDatabase creates and destroys IconRecord objects in both database and main thread. If the IconRecord has a
1632         valid icon, its Image could be created in one thread and destroyed in another, something that is not expected to
1633         happen, because Image has a Timer member. Since we have all the data and we are decoding it right after creating
1634         the Image, we don't really need to keep the Image object around, we could simply take a reference of the encoded
1635         data and the decoded native image to be returned by synchronousIconForPageURL().
1636
1637         * UIProcess/API/glib/IconDatabase.cpp:
1638         (WebKit::IconDatabase::IconRecord::image): Return NativeImagePtr now.
1639         (WebKit::IconDatabase::IconRecord::setImageData): Create a BitmapImage to decode it and keep a reference to the
1640         encoded data and decoded native image.
1641         (WebKit::IconDatabase::IconRecord::snapshot const): Use m_imageData to get the encoded data.
1642         (WebKit::IconDatabase::synchronousIconForPageURL): Return the native image and whether the icon is known or not.
1643         (WebKit::IconDatabase::IconRecord::loadImageFromResource): Deleted.
1644         * UIProcess/API/glib/IconDatabase.h:
1645         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
1646         (getIconSurfaceSynchronously): Use new API.
1647
1648 2017-08-10  Dan Bernstein  <mitz@apple.com>
1649
1650         Restored svn:ignore values that went missing when the project got renamed.
1651
1652         * WebKit.xcodeproj: Added property svn:ignore.
1653
1654 2017-08-10  Brady Eidson  <beidson@apple.com>
1655
1656         Rename the source files for the WTF persistent coders.
1657         https://bugs.webkit.org/show_bug.cgi?id=175441
1658
1659         Reviewed by Tim Horton.
1660
1661         * NetworkProcess/cache/NetworkCacheCoders.h:
1662         * NetworkProcess/cache/NetworkCacheKey.cpp:
1663         * NetworkProcess/cache/NetworkCacheKey.h:
1664         * UIProcess/API/APIContentRuleListStore.cpp:
1665
1666 2017-08-10  John Wilander  <wilander@apple.com>
1667
1668         Resource Load Statistics: Increase grandfathering time to 7 days
1669         https://bugs.webkit.org/show_bug.cgi?id=175414
1670         <rdar://problem/33818046>
1671
1672         Reviewed by Brent Fulgham.
1673
1674         * UIProcess/WebResourceLoadStatisticsStore.h:
1675
1676 2017-08-10  John Wilander  <wilander@apple.com>
1677
1678         Resource Load Statistics: Add significant figures to telemetry calls
1679         https://bugs.webkit.org/show_bug.cgi?id=175442
1680         <rdar://problem/33834834>
1681
1682         Reviewed by Brent Fulgham.
1683
1684         With this change, logged values are allowed to have 3 significant figures
1685         as opposed to today's 0 which is wrong.
1686
1687         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
1688         (WebKit::submitTopList):
1689         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
1690
1691 2017-08-10  Mark Lam  <mark.lam@apple.com>
1692
1693         Apply the UNLIKELY macro to some unlikely things.
1694         https://bugs.webkit.org/show_bug.cgi?id=175440
1695         <rdar://problem/33834767>
1696
1697         Reviewed by Yusuke Suzuki.
1698
1699         * WebProcess/WebPage/WebPage.cpp:
1700         (WebKit::WebPage::getBytecodeProfile):
1701
1702 2017-08-10  Chris Dumez  <cdumez@apple.com>
1703
1704         Turn on support for Beacon API by default in STP
1705         https://bugs.webkit.org/show_bug.cgi?id=175445
1706         <rdar://problem/33836379>
1707
1708         Reviewed by Youenn Fablet.
1709
1710         * Shared/WebPreferencesDefinitions.h:
1711
1712 2017-08-10  Ross Kirsling  <ross.kirsling@sony.com>
1713
1714         Fix iOS simulator build after change "[WTF] Move TextStream into WTF"
1715         https://bugs.webkit.org/show_bug.cgi?id=175211
1716
1717         Reviewed by Myles C. Maxfield.
1718
1719         * UIProcess/API/Cocoa/WKWebView.mm:
1720         (-[WKWebView _scrollByContentOffset:]):
1721         (-[WKWebView _navigationGestureDidBegin]):
1722
1723 2017-08-10  Chris Dumez  <cdumez@apple.com>
1724
1725         [Beacon] Do connect-src CSP check on redirects as well
1726         https://bugs.webkit.org/show_bug.cgi?id=175410
1727         <rdar://problem/33815470>
1728
1729         Reviewed by Youenn Fablet.
1730
1731         Pass CSP Response headers to the NetworkProcess via NetworkResourceLoadParameters
1732         when doing a PingLoad. This allows PingLoad to do CSP checks (in particular
1733         connect-src ones) in case the ping load gets redirected. Those checks need to be
1734         done on the NetworkProcess side at this point because there is no guarantee the
1735         WebContent process is still around.
1736
1737         To do the CSP checks, PingLoad lazily reconstructs a ContentSecurityPolicy object
1738         from the CSP response headers.
1739
1740         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1741         (WebKit::NetworkResourceLoadParameters::encode const):
1742         (WebKit::NetworkResourceLoadParameters::decode):
1743         * NetworkProcess/NetworkResourceLoadParameters.h:
1744         * NetworkProcess/PingLoad.cpp:
1745         (WebKit::PingLoad::willPerformHTTPRedirection):
1746         (WebKit::PingLoad::contentSecurityPolicy):
1747         * NetworkProcess/PingLoad.h:
1748         * WebProcess/Network/WebLoaderStrategy.cpp:
1749         (WebKit::WebLoaderStrategy::createPingHandle):
1750         * WebProcess/Network/WebLoaderStrategy.h:
1751
1752 2017-08-10  Brian Burg  <bburg@apple.com>
1753
1754         WKPreferences should conform to NSCopying
1755         https://bugs.webkit.org/show_bug.cgi?id=175303
1756         <rdar://problem/33764939>
1757
1758         Reviewed by Dan Bernstein.
1759
1760         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1761         Add conformance in the private header, as there is not consensus that this
1762         needs to be API.
1763
1764         * UIProcess/API/Cocoa/WKPreferences.mm:
1765         (-[WKPreferences copyWithZone:]):
1766         Copy the wrapped WebPreferences instance and return its wrapper.
1767
1768 2017-08-10  Michael Catanzaro  <mcatanzaro@igalia.com>
1769
1770         REGRESSION(r220515) [GTK][CMake] Build with ENABLE_GEOLOCATION fails on Debian Jessie
1771         https://bugs.webkit.org/show_bug.cgi?id=175426
1772
1773         Reviewed by Carlos Alberto Lopez Perez.
1774
1775         * PlatformGTK.cmake:
1776
1777 2017-08-10  Brady Eidson  <beidson@apple.com>
1778
1779         Add ServiceWorkerJob.
1780         https://bugs.webkit.org/show_bug.cgi?id=175241
1781
1782         Reviewed by Tim Horton.
1783
1784         * CMakeLists.txt:
1785         * WebKit.xcodeproj/project.pbxproj:
1786
1787         * WebProcess/Storage/WebServiceWorkerProvider.cpp: Added.
1788         (WebKit::WebServiceWorkerProvider::singleton):
1789         (WebKit::WebServiceWorkerProvider::WebServiceWorkerProvider):
1790         (WebKit::WebServiceWorkerProvider::scheduleJob):
1791         * WebProcess/Storage/WebServiceWorkerProvider.h: Added.
1792
1793         * WebProcess/WebProcess.cpp:
1794         (WebKit::WebProcess::initializeWebProcess):
1795
1796 2017-08-10  Tim Horton  <timothy_horton@apple.com>
1797
1798         Remove some unused lambda captures so that WebKit builds with -Wunused-lambda-capture
1799         https://bugs.webkit.org/show_bug.cgi?id=175436
1800         <rdar://problem/33667497>
1801
1802         Reviewed by Simon Fraser.
1803
1804         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1805         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1806         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1807         (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData):
1808
1809 2017-08-10  Michael Catanzaro  <mcatanzaro@igalia.com>
1810
1811         Remove ENABLE_GAMEPAD_DEPRECATED
1812         https://bugs.webkit.org/show_bug.cgi?id=175361
1813
1814         Reviewed by Carlos Garcia Campos.
1815
1816         * Configurations/FeatureDefines.xcconfig:
1817
1818 2017-08-10  Zan Dobersek  <zdobersek@igalia.com>
1819
1820         [GTK] Don't use --whole-archive linking flags for the WebKit2 target libraries
1821         https://bugs.webkit.org/show_bug.cgi?id=175416
1822
1823         Reviewed by Carlos Garcia Campos.
1824
1825         * PlatformGTK.cmake: Drop the ADD_WHOLE_ARCHIVE_TO_LIBRARIES instruction
1826         for the WebKit2 target. This unnecessarily bundles complete archive
1827         files both into the main .so library as well as single executables that
1828         are linked against the WebKit2 target.
1829
1830 2017-08-09  Chris Dumez  <cdumez@apple.com>
1831
1832         Disable Beacon API on WK1 DRT and WK2 when not using NETWORK_SESSION
1833         https://bugs.webkit.org/show_bug.cgi?id=175401
1834
1835         Reviewed by Brady Eidson.
1836
1837         * UIProcess/API/C/WKPreferences.cpp:
1838         (WKPreferencesSetBeaconAPIEnabled):
1839         (WKPreferencesGetBeaconAPIEnabled):
1840         * WebProcess/WebPage/WebPage.cpp:
1841         (WebKit::WebPage::updatePreferences):
1842         * config.h:
1843
1844 2017-08-09  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
1845
1846         [PAL] Move spi/cocoa and spi/cg directories into PAL
1847         https://bugs.webkit.org/show_bug.cgi?id=175175
1848
1849         Reviewed by Myles C. Maxfield.
1850
1851         * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm:
1852         * NetworkProcess/Downloads/mac/DownloadMac.mm:
1853         * Platform/cocoa/SharedMemoryCocoa.cpp:
1854         * Platform/mac/LayerHostingContext.mm:
1855         * Shared/Cocoa/DataDetectionResult.mm:
1856         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
1857         * Shared/cf/CookieStorageUtilsCF.mm:
1858         * Shared/ios/InteractionInformationAtPosition.mm:
1859         * Shared/mac/HangDetectionDisablerMac.mm:
1860         * Shared/mac/RemoteLayerBackingStore.mm:
1861         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
1862         * UIProcess/API/Cocoa/WKWebView.mm:
1863         * UIProcess/API/mac/WKView.mm:
1864         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
1865         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1866         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
1867         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
1868         * UIProcess/Cocoa/WebViewImpl.h:
1869         * UIProcess/Cocoa/WebViewImpl.mm:
1870         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1871         * UIProcess/ios/ViewGestureControllerIOS.mm:
1872         * UIProcess/ios/WKContentView.mm:
1873         * UIProcess/ios/WKContentViewInteraction.mm:
1874         * UIProcess/ios/WKPDFPageNumberIndicator.mm:
1875         * UIProcess/ios/WKScrollView.mm:
1876         * UIProcess/mac/RemoteLayerTreeHost.mm:
1877         * UIProcess/mac/ServicesController.mm:
1878         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
1879         * UIProcess/mac/ViewGestureControllerMac.mm:
1880         * UIProcess/mac/ViewSnapshotStore.mm:
1881         * UIProcess/mac/WKViewLayoutStrategy.mm:
1882         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1883         * WebProcess/WebPage/WebPage.cpp:
1884         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
1885         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1886         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1887         * WebProcess/cocoa/WebProcessCocoa.mm:
1888
1889 2017-08-09  John Wilander  <wilander@apple.com>
1890
1891         Resource Load Statistics: Increase grandfathering time to 3 days
1892         https://bugs.webkit.org/show_bug.cgi?id=175414
1893         <rdar://problem/33818046>
1894
1895         Reviewed by Brent Fulgham.
1896
1897         * UIProcess/WebResourceLoadStatisticsStore.h:
1898
1899 2017-08-09  Jeremy Jones  <jeremyj@apple.com>
1900
1901         Invalidate PlaybackSessionManager in same fashion as VideoFullscreenManager.
1902         https://bugs.webkit.org/show_bug.cgi?id=175399
1903         rdar://problem/33663344
1904
1905         Reviewed by Eric Carlson.
1906
1907         Invalidate PlaybackSessionManager when WebPage is destructed.
1908
1909         * WebProcess/WebPage/WebPage.cpp:
1910         (WebKit::WebPage::~WebPage):
1911         * WebProcess/cocoa/PlaybackSessionManager.h:
1912         * WebProcess/cocoa/PlaybackSessionManager.mm:
1913         (WebKit::PlaybackSessionManager::~PlaybackSessionManager):
1914         (WebKit::PlaybackSessionManager::invalidate):
1915
1916 2017-08-09  Don Olmstead  <don.olmstead@sony.com>
1917
1918         [WTF] Move TextStream into WTF
1919         https://bugs.webkit.org/show_bug.cgi?id=175211
1920
1921         Reviewed by Myles C. Maxfield.
1922
1923         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
1924         * Shared/VisibleContentRectUpdateInfo.cpp:
1925         * Shared/VisibleContentRectUpdateInfo.h:
1926         * Shared/mac/RemoteLayerTreeTransaction.mm:
1927         * UIProcess/API/Cocoa/WKWebView.mm:
1928         * UIProcess/ios/WKContentView.mm:
1929         * UIProcess/ios/WKContentViewInteraction.h:
1930         * UIProcess/ios/WKContentViewInteraction.mm:
1931         (WebKit::operator<<):
1932         * UIProcess/ios/WebPageProxyIOS.mm:
1933         * WebProcess/WebPage/ios/WebPageIOS.mm:
1934         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
1935         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
1936
1937 2017-08-09  Andy Estes  <aestes@apple.com>
1938
1939         Part 3 of: Rename DatabaseProcess to StorageProcess
1940         https://bugs.webkit.org/show_bug.cgi?id=175034
1941
1942         Reviewed by Brady Eidson.
1943
1944         We tried renaming com.apple.WebKit.Databases to com.apple.WebKit.Storage in r219986, but
1945         this prevented trunk WebKit from running on iOS 11 devices. This is because launchd keeps a
1946         codesigned cache of XPC services, and refuses to launch services that aren't in the cache.
1947
1948         It's not possibe for us to rebuild the cache with the new service name (only Apple's
1949         production build system can do this), and disabling the cache or opting WebKit's XPC
1950         services out of the cache might have a negative impact on our performance testing.
1951
1952         For now we'll retain the name "com.apple.WebKit.Databases" on iOS 11 devices to work around
1953         this issue. If we find a way to allow the new service to run without impacting performance,
1954         we can revert this change.
1955
1956         We will rename the service to "com.apple.WebKit.Storage" on macOS and iOS Simulator, and in
1957         a follow-up patch we'll use the new service name on post-iOS 11 device builds.
1958
1959         * Configurations/BaseTarget.xcconfig: Defined WK_STORAGE_SERVICE_PRODUCT_NAME to be
1960         com.apple.WebKit.Databases by default, and overrode it to com.apple.WebKit.Storage on macOS
1961         and iOS Simulator.
1962         * Configurations/StorageService.xcconfig: Changed PRODUCT_NAME to $(WK_STORAGE_SERVICE_PRODUCT_NAME).
1963         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1964         (WebKit::serviceName): Changed to return "com.apple.WebKit.Storage" on macOS and
1965         iOS Simulator platforms.
1966         * WebKit.xcodeproj/project.pbxproj: Updated the "Copy XPC services for engineering builds"
1967         build phase to use WK_STORAGE_SERVICE_PRODUCT_NAME.
1968
1969 2017-08-09  Commit Queue  <commit-queue@webkit.org>
1970
1971         Unreviewed, rolling out r220466, r220477, and r220487.
1972         https://bugs.webkit.org/show_bug.cgi?id=175411
1973
1974         This change broke existing API tests and follow up fixes did
1975         not resolve all the issues. (Requested by ryanhaddad on
1976         #webkit).
1977
1978         Reverted changesets:
1979
1980         https://bugs.webkit.org/show_bug.cgi?id=175244
1981         http://trac.webkit.org/changeset/220466
1982
1983         "WTF::Function does not allow for reference / non-default
1984         constructible return types"
1985         https://bugs.webkit.org/show_bug.cgi?id=175244
1986         http://trac.webkit.org/changeset/220477
1987
1988         https://bugs.webkit.org/show_bug.cgi?id=175244
1989         http://trac.webkit.org/changeset/220487
1990
1991 2017-08-09  Chris Dumez  <cdumez@apple.com>
1992
1993         [Beacon][NetworkSession] Support CORS-preflighting on redirects
1994         https://bugs.webkit.org/show_bug.cgi?id=175386
1995         <rdar://problem/33801370>
1996
1997         Reviewed by Youenn Fablet.
1998
1999         Add support to Beacon for doing CORS-preflighting upon redirect to a different
2000         domain.
2001
2002         * NetworkProcess/NetworkCORSPreflightChecker.h:
2003         * NetworkProcess/PingLoad.cpp:
2004         (WebKit::PingLoad::PingLoad):
2005         (WebKit::PingLoad::~PingLoad):
2006         (WebKit::PingLoad::loadRequest):
2007         (WebKit::PingLoad::securityOrigin const):
2008         (WebKit::PingLoad::willPerformHTTPRedirection):
2009         (WebKit::PingLoad::didReceiveResponseNetworkSession):
2010         (WebKit::PingLoad::needsCORSPreflight const):
2011         (WebKit::PingLoad::doCORSPreflight):
2012         * NetworkProcess/PingLoad.h:
2013
2014 2017-08-09  Jeremy Jones  <jeremyj@apple.com>
2015
2016         Use MPAVRoutingController instead of deprecated versions.
2017         https://bugs.webkit.org/show_bug.cgi?id=175063
2018         rdar://problem/33301230
2019
2020         Reviewed by Tim Horton.
2021
2022         Remove dependence on deprecated classes MPAVRoutingSheet and MPAudioVideoRoutingPopoverController.
2023
2024         * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
2025         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
2026         (-[WKAirPlayRoutePicker dealloc]):
2027         (-[WKAirPlayRoutePicker show:fromRect:]):
2028         (-[WKAirPlayRoutePicker popoverControllerDidDismissPopover:]): Deleted.
2029         (-[WKAirPlayRoutePicker _presentAirPlayPopoverAnimated:fromRect:]): Deleted.
2030         (-[WKAirPlayRoutePicker _windowWillRotate:]): Deleted.
2031         (-[WKAirPlayRoutePicker _windowDidRotate:]): Deleted.
2032         (-[WKAirPlayRoutePicker _dismissAirPlayRoutePickerIPad]): Deleted.
2033         (-[WKAirPlayRoutePicker showAirPlayPickerIPad:fromRect:]): Deleted.
2034         (-[WKAirPlayRoutePicker showAirPlayPickerIPhone:]): Deleted.
2035
2036 2017-08-09  Sam Weinig  <sam@webkit.org>
2037
2038         WTF::Function does not allow for reference / non-default constructible return types
2039         https://bugs.webkit.org/show_bug.cgi?id=175244
2040
2041         Reviewed by Chris Dumez.
2042
2043         * UIProcess/WebResourceLoadStatisticsStore.h:
2044         Update the default value for the updateCookiePartitioningForDomainsHandler parameter to be an 
2045         empty lambda, rather than default initialization, which leads to a null WTF::Function. This allows
2046         us to remove support for calling null WTF::Function. No change in behavior.
2047
2048 2017-08-09  Wenson Hsieh  <wenson_hsieh@apple.com>
2049
2050         [iOS DnD] ENABLE_DRAG_SUPPORT should be turned off for iOS 10 and enabled by default
2051         https://bugs.webkit.org/show_bug.cgi?id=175392
2052         <rdar://problem/33783207>
2053
2054         Reviewed by Tim Horton and Megan Gardner.
2055
2056         Tweak FeatureDefines to enable drag and drop by default, and disable only on unsupported platforms (i.e. iOS 10).
2057
2058         * Configurations/FeatureDefines.xcconfig:
2059
2060 2017-08-09  Brady Eidson  <beidson@apple.com>
2061
2062         ServiceWorker experimental feature should not be on by default (definitely not ready).
2063         https://bugs.webkit.org/show_bug.cgi?id=175389
2064
2065         Rubberstamped by Andy Estes.
2066
2067         * Shared/WebPreferencesDefinitions.h: false, not DEFAULT_EXPERIMENTAL_FEATURES_ENABLED
2068
2069 2017-08-09  Ryan Haddad  <ryanhaddad@apple.com>
2070
2071         Unreviewed, rolling out r220457.
2072
2073         This change introduced API test failures.
2074
2075         Reverted changeset:
2076
2077         "WTF::Function does not allow for reference / non-default
2078         constructible return types"
2079         https://bugs.webkit.org/show_bug.cgi?id=175244
2080         http://trac.webkit.org/changeset/220457
2081
2082 2017-08-09  Daniel Bates  <dabates@apple.com>
2083
2084         REGRESSION (r219013): OAuth flows are broken when redirecting back to application after authentication
2085         https://bugs.webkit.org/show_bug.cgi?id=175247
2086         <rdar://problem/33679804>
2087
2088         Reviewed by Brady Eidson.
2089
2090         Add SPI WKNavigationAction._isRedirect to query whether the navigation was in response to receiving
2091         a redirect response. The majority of the WebKit change is plumbing this knowledge through to connect
2092         it with the SPI.
2093
2094         * Shared/NavigationActionData.cpp:
2095         (WebKit::NavigationActionData::encode const):
2096         (WebKit::NavigationActionData::decode):
2097         Encode and decode the boolean NavigationActionData::isRedirect.
2098         * Shared/NavigationActionData.h:
2099         * UIProcess/API/APINavigationAction.h:
2100         * UIProcess/API/Cocoa/WKNavigationAction.mm:
2101         (-[WKNavigationAction _isRedirect]): Added.
2102         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
2103         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2104         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Set NavigationActionData::isRedirect
2105         depending on whether the navigation is in response to receiving a redirect response.
2106         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2107
2108 2017-08-09  Sam Weinig  <sam@webkit.org>
2109
2110         WTF::Function does not allow for reference / non-default constructible return types
2111         https://bugs.webkit.org/show_bug.cgi?id=175244
2112
2113         Reviewed by Chris Dumez.
2114
2115         * UIProcess/WebResourceLoadStatisticsStore.h:
2116         Update the default value for the updateCookiePartitioningForDomainsHandler parameter to be an 
2117         empty lambda, rather than default initialization, which leads to a null WTF::Function. This allows
2118         us to remove support for calling null WTF::Function. No change in behavior.
2119
2120 2017-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2121
2122         Unreviewed, rolling out r220393.
2123
2124         This patch regresses the performance of WebPage::editorState.
2125
2126         Reverted changeset:
2127
2128         "[iOS WK2] WKWebView schedules nonstop layout after pressing
2129         cmb+b,i,u inside a contenteditable div"
2130         https://bugs.webkit.org/show_bug.cgi?id=175116
2131         http://trac.webkit.org/changeset/220393
2132
2133 2017-08-08  Chris Dumez  <cdumez@apple.com>
2134
2135         [Beacon] Add support for CORS-preflighting for WK2 / NETWORK_SESSION
2136         https://bugs.webkit.org/show_bug.cgi?id=175264
2137         <rdar://problem/33547793>
2138
2139         Reviewed by Youenn Fablet.
2140
2141         Implement CORS-preflighting for beacons with a payload that has a non
2142         safelisted MIME type, as per:
2143         - https://w3c.github.io/beacon/#privacy
2144         - https://www.w3.org/TR/beacon/#sec-processing-model
2145
2146         CORS-preflighting is completely handled on Network Process side because
2147         a beacon request can outlive its page and therefore its WebContent
2148         process. This requires us to pass a little more information to the
2149         Network process, in particular the source origin and the corsMode.
2150
2151         The current implementation does not currently deal with CORS preflights
2152         needed upon a redirect. This will be added in a follow-up.
2153
2154         * CMakeLists.txt:
2155         * NetworkProcess/NetworkCORSPreflightChecker.cpp: Added.
2156         (WebKit::NetworkCORSPreflightChecker::NetworkCORSPreflightChecker):
2157         (WebKit::NetworkCORSPreflightChecker::~NetworkCORSPreflightChecker):
2158         (WebKit::NetworkCORSPreflightChecker::startPreflight):
2159         (WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection):
2160         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
2161         (WebKit::NetworkCORSPreflightChecker::didReceiveResponseNetworkSession):
2162         (WebKit::NetworkCORSPreflightChecker::didReceiveData):
2163         (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
2164         (WebKit::NetworkCORSPreflightChecker::didSendData):
2165         (WebKit::NetworkCORSPreflightChecker::wasBlocked):
2166         (WebKit::NetworkCORSPreflightChecker::cannotShowURL):
2167         * NetworkProcess/NetworkCORSPreflightChecker.h: Added.
2168         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2169         (WebKit::NetworkConnectionToWebProcess::loadPing):
2170         * NetworkProcess/NetworkConnectionToWebProcess.h:
2171         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2172         (WebKit::NetworkResourceLoadParameters::encode const):
2173         (WebKit::NetworkResourceLoadParameters::decode):
2174         * NetworkProcess/NetworkResourceLoadParameters.h:
2175         * NetworkProcess/PingLoad.cpp: Added.
2176         (WebKit::PingLoad::PingLoad):
2177         (WebKit::PingLoad::~PingLoad):
2178         (WebKit::PingLoad::startNetworkLoad):
2179         (WebKit::PingLoad::willPerformHTTPRedirection):
2180         (WebKit::PingLoad::didReceiveChallenge):
2181         (WebKit::PingLoad::didReceiveResponseNetworkSession):
2182         (WebKit::PingLoad::didReceiveData):
2183         (WebKit::PingLoad::didCompleteWithError):
2184         (WebKit::PingLoad::didSendData):
2185         (WebKit::PingLoad::wasBlocked):
2186         (WebKit::PingLoad::cannotShowURL):
2187         (WebKit::PingLoad::timeoutTimerFired):
2188         (WebKit::PingLoad::needsCORSPreflight const):
2189         (WebKit::PingLoad::doCORSPreflight):
2190         * NetworkProcess/PingLoad.h:
2191         * WebKit.xcodeproj/project.pbxproj:
2192         * WebProcess/Network/WebLoaderStrategy.cpp:
2193         (WebKit::WebLoaderStrategy::createPingHandle):
2194         * WebProcess/Network/WebLoaderStrategy.h:
2195
2196 2017-08-08  Megan Gardner  <megan_gardner@apple.com>
2197
2198         Remove old and unused pointIsInAssistedNode definition
2199         https://bugs.webkit.org/show_bug.cgi?id=175335
2200
2201         Stage removal here to allow removal from UIKit.
2202         Replaced by textInteractionGesture:shouldBeginAtPoint:
2203
2204         Reviewed by Tim Horton.
2205
2206         * Platform/spi/ios/UIKitSPI.h:
2207         * UIProcess/ios/WKContentViewInteraction.mm:
2208         (-[WKContentView pointIsInAssistedNode:]): Deleted.
2209
2210 2017-08-08  Michael Catanzaro  <mcatanzaro@igalia.com>
2211
2212         Unreviewed, fix Ubuntu LTS build
2213         https://bugs.webkit.org/show_bug.cgi?id=174490
2214
2215         * UIProcess/glib/RemoteInspectorClient.cpp:
2216         (WebKit::RemoteInspectorClient::RemoteInspectorClient):
2217
2218 2017-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2219
2220         Unreviewed, fix the Mac debug build after r220418.
2221
2222         * UIProcess/Cocoa/WebViewImpl.mm:
2223         (WebKit::WebViewImpl::prepareForMoveToWindow):
2224
2225 2017-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2226
2227         [Mac WK2] WebViewImpl should hold a weak pointer to its WKWebView or WKView
2228         https://bugs.webkit.org/show_bug.cgi?id=175302
2229         <rdar://problem/33762116>
2230
2231         Reviewed by Tim Horton.
2232
2233         Refactor WebViewImpl's m_view from a raw pointer to a WeakObjCPtr to ensure that it is automatically cleared out
2234         when the WKWebView or WKView are destroyed, and also changes several places where we implicitly block capture
2235         the WebViewImpl to only capture a WeakPtr to the WebViewImpl. Most of the changes here are boilerplate
2236         adjustments for how m_view is now a weak pointer.
2237
2238         Test: WKWebViewMacEditingTests.DoNotCrashWhenInterpretingKeyEventWhileDeallocatingView.
2239
2240         * Shared/mac/WeakObjCPtr.h:
2241         (WebKit::WeakObjCPtr::operator ValueType * const):
2242         * UIProcess/Cocoa/WebViewImpl.h:
2243         * UIProcess/Cocoa/WebViewImpl.mm:
2244         (WebKit::WebViewImpl::updateTouchBar):
2245         (WebKit::WebViewImpl::updateMediaTouchBar):
2246         (WebKit::WebViewImpl::WebViewImpl):
2247         (WebKit::WebViewImpl::~WebViewImpl):
2248         (WebKit::WebViewImpl::window):
2249         (WebKit::WebViewImpl::resignFirstResponder):
2250         (WebKit::WebViewImpl::isFocused const):
2251         (WebKit::WebViewImpl::renewGState):
2252         (WebKit::WebViewImpl::setFrameAndScrollBy):
2253         (WebKit::WebViewImpl::updateWindowAndViewFrames):
2254         (WebKit::WebViewImpl::updateLayer):
2255         (WebKit::WebViewImpl::printOperationWithPrintInfo):
2256         (WebKit::WebViewImpl::updateContentInsetsIfAutomatic):
2257         (WebKit::WebViewImpl::setLayoutMode):
2258         (WebKit::WebViewImpl::intrinsicDeviceScaleFactor const):
2259         (WebKit::WebViewImpl::windowDidBecomeKey):
2260         (WebKit::WebViewImpl::windowDidResignKey):
2261         (WebKit::WebViewImpl::windowDidChangeScreen):
2262         (WebKit::WebViewImpl::mightBeginDragWhileInactive):
2263         (WebKit::WebViewImpl::acceptsFirstMouse):
2264         (WebKit::WebViewImpl::shouldDelayWindowOrderingForEvent):
2265         (WebKit::WebViewImpl::windowResizeMouseLocationIsInVisibleScrollerThumb):
2266         (WebKit::WebViewImpl::viewWillMoveToWindow):
2267         (WebKit::WebViewImpl::viewDidMoveToWindow):
2268         (WebKit::WebViewImpl::viewDidChangeBackingProperties):
2269         (WebKit::WebViewImpl::hitTest):
2270         (WebKit::WebViewImpl::postFakeMouseMovedEventForFlagsChangedEvent):
2271         (WebKit::WebViewImpl::colorSpace):
2272         (WebKit::WebViewImpl::prepareForMoveToWindow):
2273         (WebKit::WebViewImpl::notifyInputContextAboutDiscardedComposition):
2274         (WebKit::WebViewImpl::pressureChangeWithEvent):
2275         (WebKit::WebViewImpl::fullScreenWindowController):
2276         (WebKit::WebViewImpl::executeSavedCommandBySelector):
2277         (WebKit::WebViewImpl::validRequestorForSendAndReturnTypes):
2278         (WebKit::WebViewImpl::handleRequestedCandidates):
2279         (WebKit::WebViewImpl::preferencesDidChange):
2280         (WebKit::WebViewImpl::setTextIndicator):
2281         (WebKit::WebViewImpl::dismissContentRelativeChildWindowsFromViewOnly):
2282         (WebKit::WebViewImpl::accessibilityRegisterUIProcessTokens):
2283         (WebKit::WebViewImpl::sendToolTipMouseExited):
2284         (WebKit::WebViewImpl::sendToolTipMouseEntered):
2285         (WebKit::WebViewImpl::toolTipChanged):
2286         (WebKit::WebViewImpl::setAcceleratedCompositingRootLayer):
2287         (WebKit::WebViewImpl::updateThumbnailViewLayer):
2288         (WebKit::WebViewImpl::setInspectorAttachmentView):
2289         (WebKit::WebViewImpl::inspectorAttachmentView):
2290         (WebKit::WebViewImpl::draggedImage):
2291         (WebKit::WebViewImpl::draggingEntered):
2292         (WebKit::WebViewImpl::draggingUpdated):
2293         (WebKit::WebViewImpl::draggingExited):
2294         (WebKit::WebViewImpl::performDragOperation):
2295         (WebKit::WebViewImpl::hitTestForDragTypes):
2296         (WebKit::WebViewImpl::startWindowDrag):
2297         (WebKit::WebViewImpl::dragImageForView):
2298         (WebKit::WebViewImpl::setPromisedDataForImage):
2299         (WebKit::WebViewImpl::setPromisedDataForAttachment):
2300         (WebKit::WebViewImpl::takeViewSnapshot):
2301         (WebKit::WebViewImpl::scrollWheel):
2302         (WebKit::WebViewImpl::magnifyWithEvent):
2303         (WebKit::WebViewImpl::rotateWithEvent):
2304         (WebKit::WebViewImpl::doneWithKeyEvent):
2305         (WebKit::WebViewImpl::interpretKeyEvent):
2306         (WebKit::WebViewImpl::firstRectForCharacterRange):
2307         (WebKit::WebViewImpl::characterIndexForPoint):
2308         (WebKit::WebViewImpl::performKeyEquivalent):
2309         (WebKit::WebViewImpl::keyUp):
2310         (WebKit::WebViewImpl::keyDown):
2311         (WebKit::WebViewImpl::mouseMoved):
2312         (WebKit::WebViewImpl::windowIsFrontWindowUnderMouse):
2313         (WebKit::WebViewImpl::userInterfaceLayoutDirection):
2314
2315 2017-08-08  Filip Pizlo  <fpizlo@apple.com>
2316
2317         Baseline JIT should do caging
2318         https://bugs.webkit.org/show_bug.cgi?id=175037
2319
2320         Reviewed by Mark Lam.
2321         
2322         Use a better API to disable disabling the primitive gigacage.
2323
2324         * WebProcess/WebProcess.cpp:
2325         (WebKit::m_webSQLiteDatabaseTracker):
2326         (WebKit::primitiveGigacageDisabled): Deleted.
2327
2328 2017-08-08  John Wilander  <wilander@apple.com>
2329
2330         Resource Load Statistics: Clear web processes' state on history removal
2331         https://bugs.webkit.org/show_bug.cgi?id=175271
2332         <rdar://problem/33756560>
2333
2334         Reviewed by Chris Dumez.
2335
2336         https://bugs.webkit.org/show_bug.cgi?id=175090 introduced state
2337         in the web process and that state needs to be cleared when the
2338         UI process' statistics are cleared as part of history removal.
2339
2340         * UIProcess/WebProcessPool.cpp:
2341         (WebKit::WebProcessPool::clearResourceLoadStatistics):
2342         * UIProcess/WebProcessPool.h:
2343         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2344         (WebKit::WebsiteDataStore::removeData):
2345         (WebKit::WebsiteDataStore::clearResourceLoadStatisticsInWebProcesses):
2346         * UIProcess/WebsiteData/WebsiteDataStore.h:
2347         * WebProcess/WebProcess.cpp:
2348         (WebKit::WebProcess::clearResourceLoadStatistics):
2349         * WebProcess/WebProcess.h:
2350         * WebProcess/WebProcess.messages.in:
2351
2352 2017-08-08  Adrian Perez de Castro  <aperez@igalia.com>
2353
2354         [WPE] Implement WebsiteDataStore::defaultApplicationCacheDirectory() and friends
2355         https://bugs.webkit.org/show_bug.cgi?id=175322
2356
2357         Reviewed by Carlos Garcia Campos.
2358
2359         This makes WPE use the same implementation as the GTK+ port, with a preprocessor switch to choose the name of
2360         the base directory inside the user XDG cache directory.
2361
2362         * PlatformGTK.cmake: Add APIWebsiteDataStoreGLib.cpp to the build sources and remove APIWebsiteDataStoreGtk.cpp.
2363         * PlatformWPE.cmake: Add APIWebsiteDataStoreGLib.cpp to the built sources.
2364         * UIProcess/API/APIWebsiteDataStore.cpp: Remove now dead code.
2365         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: Renamed from Source/WebKit/UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp.
2366         (API::WebsiteDataStore::defaultApplicationCacheDirectory):
2367         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
2368         (API::WebsiteDataStore::defaultLocalStorageDirectory):
2369         (API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
2370         (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
2371         (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
2372
2373 2017-08-08  Ryan Haddad  <ryanhaddad@apple.com>
2374
2375         Unreviewed, rolling out r220368.
2376
2377         This change caused WK1 tests to exit early with crashes.
2378
2379         Reverted changeset:
2380
2381         "Baseline JIT should do caging"
2382         https://bugs.webkit.org/show_bug.cgi?id=175037
2383         http://trac.webkit.org/changeset/220368
2384
2385 2017-08-08  Michael Catanzaro  <mcatanzaro@igalia.com>
2386
2387         [CMake] Properly test if compiler supports compiler flags
2388         https://bugs.webkit.org/show_bug.cgi?id=174490
2389
2390         Reviewed by Konstantin Tokarev.
2391
2392         * CMakeLists.txt:
2393         * PlatformGTK.cmake:
2394
2395 2017-08-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2396
2397         Web Automation: setUserInputForCurrentJavaScriptPrompt should fail if current dialog is not a prompt
2398         https://bugs.webkit.org/show_bug.cgi?id=175261
2399
2400         Reviewed by Brian Burg.
2401
2402         According to the spec, send alert text command should fail if the current dialog is not a prompt. This patch
2403         adds JavaScriptDialogType enum to API::AutomationSessionClient and a new virtual method to ask the client about
2404         the type of the current dialog. WebAutomationSession::setUserInputForCurrentJavaScriptPrompt() uses the new
2405         client method to check the type of the current dialog and fail in case it's not a prompt. Cocoa needs an
2406         implementation, for now it always returns Prompt as the type to keep compatibility.
2407
2408         18.4 Send Alert Text.
2409         https://w3c.github.io/webdriver/webdriver-spec.html#send-alert-text
2410
2411         This fixes selenium test testSettingTheValueOfAnAlertThrows.
2412
2413         * UIProcess/API/APIAutomationSessionClient.h:
2414         (API::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage):
2415         * UIProcess/API/glib/WebKitAutomationSession.cpp:
2416         * UIProcess/API/glib/WebKitWebView.cpp:
2417         (webkitWebViewGetCurrentScriptDialogType):
2418         * UIProcess/API/glib/WebKitWebViewPrivate.h:
2419         * UIProcess/Automation/Automation.json:
2420         * UIProcess/Automation/WebAutomationSession.cpp:
2421         (WebKit::WebAutomationSession::setUserInputForCurrentJavaScriptPrompt):
2422         * UIProcess/Cocoa/AutomationSessionClient.h:
2423         * UIProcess/Cocoa/AutomationSessionClient.mm:
2424         (WebKit::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage):
2425
2426 2017-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2427
2428         [iOS WK2] WKWebView schedules nonstop layout after pressing cmb+b,i,u inside a contenteditable div
2429         https://bugs.webkit.org/show_bug.cgi?id=175116
2430         <rdar://problem/28279301>
2431
2432         Reviewed by Darin Adler and Ryosuke Niwa.
2433
2434         Refactors WebPage::editorState to only use the StyleProperties derived from EditingStyle, instead of inserting
2435         and removing a temporary node to figure out the style. Also adds hooks to notify the UI delegate of EditorState
2436         changes.
2437
2438         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2439         * UIProcess/API/Cocoa/WKWebView.mm:
2440         (nsTextAlignment):
2441         (dictionaryRepresentationForEditorState):
2442         (-[WKWebView _didChangeEditorState]):
2443
2444         Alerts the private UI delegate of UI-side EditorState updates.
2445
2446         (-[WKWebView _web_editorStateDidChange]):
2447         (-[WKWebView _executeEditCommand:argument:completion:]):
2448         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2449         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2450         * UIProcess/API/mac/WKView.mm:
2451         (-[WKView _web_editorStateDidChange]):
2452         * UIProcess/Cocoa/WebViewImpl.h:
2453         * UIProcess/Cocoa/WebViewImpl.mm:
2454         (WebKit::WebViewImpl::selectionDidChange):
2455         * UIProcess/WebPageProxy.cpp:
2456         (WebKit::WebPageProxy::executeEditCommand):
2457
2458         Change executeEditCommand(name, callback) to executeEditCommand(name, argument, callback) and lift out of iOS
2459         platform code and into WebPage.cpp.
2460
2461         * UIProcess/WebPageProxy.h:
2462         * UIProcess/ios/WKContentViewInteraction.mm:
2463         (-[WKContentView executeEditCommandWithCallback:]):
2464         (-[WKContentView _selectionChanged]):
2465         * UIProcess/ios/WebPageProxyIOS.mm:
2466         (WebKit::WebPageProxy::executeEditCommand): Deleted.
2467
2468         Move the iOS-specific implementation of executeEditCommand that invokes a callback when the web process responds
2469         out of WebPageProxyIOS, and into cross-platform WebPageProxy code. Additionally, add a parameter for the edit
2470         command's argument.
2471
2472         * WebProcess/WebPage/WebPage.cpp:
2473         (WebKit::WebPage::editorState const):
2474
2475         Use EditingStyle::styleAtSelectionStart instead of Editor::styleForSelectionStart when computing an EditorState.
2476         Tweak bold, italic and underline to use EditingStyle TriStates.
2477
2478         (WebKit::shouldEnsureEditorStateUpdateAfterExecutingCommand):
2479         (WebKit::WebPage::executeEditCommandWithCallback):
2480         * WebProcess/WebPage/WebPage.h:
2481         * WebProcess/WebPage/WebPage.messages.in:
2482         * WebProcess/WebPage/ios/WebPageIOS.mm:
2483         (WebKit::WebPage::executeEditCommandWithCallback): Deleted.
2484
2485 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
2486
2487         [TexMap] Don't expose GraphicsContext3D object
2488         https://bugs.webkit.org/show_bug.cgi?id=175310
2489
2490         Reviewed by Carlos Garcia Campos.
2491
2492         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2493         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
2494         Stop using GraphicsContext3D directly and instead use the
2495         TextureMapper::clearColor() method to achieve the same result.
2496
2497 2017-08-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2498
2499         [GTK] Implement JavaScript dialog methods of API::AutomationSessionClient
2500         https://bugs.webkit.org/show_bug.cgi?id=175259
2501
2502         Reviewed by Michael Catanzaro.
2503
2504         Move the default implementation of WebKitScriptDialog from WebKitWebView platform specific files to their own
2505         files. Implement all JavaScript dialog methods of API::AutomationSessionClient in WebKitAutomationSession. For
2506         now it only works when the user doesn't override WebKitWebView::script-dialog signal and default implementation
2507         is used.
2508
2509         * PlatformGTK.cmake: Add new files to compilation.
2510         * PlatformWPE.cmake: Ditto.
2511         * UIProcess/API/glib/WebKitAutomationSession.cpp:
2512         (webkitAutomationSessionCreate): Pass the WebKitWebContext to the constructor and keep a pointer to it in session.
2513         * UIProcess/API/glib/WebKitAutomationSessionPrivate.h:
2514         * UIProcess/API/glib/WebKitScriptDialogPrivate.h:
2515         * UIProcess/API/glib/WebKitWebContext.cpp:
2516         * UIProcess/API/glib/WebKitWebView.cpp:
2517         (webkitWebViewRunJavaScriptAlert): Set the currently script dialog for the scope of the function.
2518         (webkitWebViewRunJavaScriptConfirm): Ditto.
2519         (webkitWebViewRunJavaScriptPrompt): Ditto.
2520         (webkitWebViewRunJavaScriptBeforeUnloadConfirm): Ditto.
2521         (webkitWebViewIsShowingScriptDialog): Ask current dialog if there's one.
2522         (webkitWebViewGetCurrentScriptDialogMessage): Ditto.
2523         (webkitWebViewSetCurrentScriptDialogUserInput): Ditto.
2524         (webkitWebViewAcceptCurrentScriptDialog): Ditto.
2525         (webkitWebViewDismissCurrentScriptDialog): Ditto.
2526         * UIProcess/API/glib/WebKitWebViewPrivate.h:
2527         * UIProcess/API/gtk/WebKitScriptDialogGtk.cpp: Added.
2528         (webkitWebViewCreateJavaScriptDialog): Moved from WebKitWebViewGtk.cpp.
2529         (webkitScriptDialogRun): Run the dialog, this code is moved from WebKitWebViewGtk.cpp.
2530         (webkitScriptDialogIsRunning): Return true if the script dialog has a native dialog running.
2531         (webkitScriptDialogAccept): Send Ok or Close response to the native dialog depending on the dialog type.
2532         (webkitScriptDialogDismiss): Send Close response to the native dialog.
2533         (webkitScriptDialogSetUserInput): Set the given text on the prompt dialog entry.
2534         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
2535         (webkitWebViewScriptDialog): Simply call webkitScriptDialogRun() now.
2536         * UIProcess/API/wpe/WebKitScriptDialogWPE.cpp: Copied from Source/WebKit/UIProcess/API/glib/WebKitAutomationSessionPrivate.h.
2537         (webkitScriptDialogRun):
2538         (webkitScriptDialogIsRunning):
2539         (webkitScriptDialogAccept):
2540         (webkitScriptDialogDismiss):
2541         (webkitScriptDialogSetUserInput):
2542
2543 2017-08-07  Devin Rousso  <drousso@apple.com>
2544
2545         Web Inspector: Preview Canvas path when viewing a recording
2546         https://bugs.webkit.org/show_bug.cgi?id=174967
2547
2548         Reviewed by Brian Burg.
2549
2550         * Shared/WebPreferencesDefinitions.h:
2551         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2552         * UIProcess/API/C/WKPreferences.cpp:
2553         (WKPreferencesSetInspectorAdditionsEnabled):
2554         (WKPreferencesGetInspectorAdditionsEnabled):
2555         * WebProcess/WebPage/WebPage.cpp:
2556         (WebKit::WebPage::updatePreferences):
2557         Add plumbing for new InspectorAdditions runtime flag.
2558
2559         * WebProcess/WebPage/WebInspectorUI.cpp:
2560         (WebKit::WebInspectorUI::WebInspectorUI):
2561         Enable InspectorAdditions by default in the WebInspector page.
2562
2563 2017-08-07  Filip Pizlo  <fpizlo@apple.com>
2564
2565         Baseline JIT should do caging
2566         https://bugs.webkit.org/show_bug.cgi?id=175037
2567
2568         Reviewed by Mark Lam.
2569         
2570         Use a better API to disable disabling the primitive gigacage.
2571
2572         * WebProcess/WebProcess.cpp:
2573         (WebKit::m_webSQLiteDatabaseTracker):
2574         (WebKit::primitiveGigacageDisabled): Deleted.
2575
2576 2017-08-06  Filip Pizlo  <fpizlo@apple.com>
2577
2578         Primitive auxiliaries and JSValue auxiliaries should have separate gigacages
2579         https://bugs.webkit.org/show_bug.cgi?id=174919
2580
2581         Reviewed by Keith Miller.
2582         
2583         The disable callback is all about the primitive gigacage.
2584
2585         * WebProcess/WebProcess.cpp:
2586         (WebKit::primitiveGigacageDisabled):
2587         (WebKit::m_webSQLiteDatabaseTracker):
2588         (WebKit::gigacageDisabled): Deleted.
2589
2590 2017-08-07  Brian Burg  <bburg@apple.com>
2591
2592         Remove CANVAS_PATH compilation guard
2593         https://bugs.webkit.org/show_bug.cgi?id=175207
2594
2595         Reviewed by Sam Weinig.
2596
2597         * Configurations/FeatureDefines.xcconfig:
2598
2599 2017-08-07  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2600
2601         [WPE][CMake] Only pass pkg-config CFLAGS from (E)GL when not using libepoxy.
2602         https://bugs.webkit.org/show_bug.cgi?id=175125
2603
2604         Reviewed by Michael Catanzaro.
2605
2606         * CMakeLists.txt: When using libepoxy avoid passing the CFLAGS from (E)GL,
2607         and instead pass the libepoxy ones.
2608
2609 2017-08-07  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2610
2611         [GTK][WPE] CFLAGS from pkg-config for (E)GL are not passed to WebKit
2612         https://bugs.webkit.org/show_bug.cgi?id=175125
2613
2614         Unreviewed follow-up fix after r220326.
2615
2616         * CMakeLists.txt: Move the block appending to WebKit2_LIBRARIES
2617         below where the list itself is created.
2618
2619 2017-08-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2620
2621         [GTK][WPE] Add API to provide browser information required by automation
2622         https://bugs.webkit.org/show_bug.cgi?id=175130
2623
2624         Reviewed by Michael Catanzaro.
2625
2626         When a new automation session is started, the web driver receives some required capabilities from the client,
2627         like browser name and version. The session should be rejected if those required capabilities don't match with
2628         the actual browser that is launched. We don't know that information in WebKit, so we need to add API so that
2629         users can provide it when a new session request is made. This patch adds boxed object WebKitApplicationInfo that
2630         can be used to set the application name and version. This object can be set to a WebKitAutomationSession when
2631         WebKitWebContext::automation-started signal is emitted.
2632
2633         * PlatformGTK.cmake:
2634         * PlatformWPE.cmake:
2635         * UIProcess/API/glib/WebKitApplicationInfo.cpp: Added.
2636         (webkit_application_info_new):
2637         (webkit_application_info_ref):
2638         (webkit_application_info_unref):
2639         (webkit_application_info_set_name):
2640         (webkit_application_info_get_name):
2641         (webkit_application_info_set_version):
2642         (webkit_application_info_get_version):
2643         * UIProcess/API/glib/WebKitAutomationSession.cpp:
2644         (webkitAutomationSessionDispose):
2645         (webkit_automation_session_class_init):
2646         (webkitAutomationSessionGetBrowserName):
2647         (webkitAutomationSessionGetBrowserVersion):
2648         (webkit_automation_session_set_application_info):
2649         (webkit_automation_session_get_application_info):
2650         * UIProcess/API/glib/WebKitAutomationSessionPrivate.h:
2651         * UIProcess/API/glib/WebKitWebContext.cpp:
2652         * UIProcess/API/gtk/WebKitApplicationInfo.h: Added.
2653         * UIProcess/API/gtk/WebKitAutomationSession.h:
2654         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2655         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
2656         * UIProcess/API/gtk/webkit2.h:
2657         * UIProcess/API/wpe/WebKitApplicationInfo.h: Added.
2658         * UIProcess/API/wpe/WebKitAutomationSession.h:
2659         * UIProcess/API/wpe/webkit.h:
2660
2661 2017-08-06  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2662
2663         [GTK][WPE] CFLAGS from pkg-config for (E)GL are not passed to WebKit
2664         https://bugs.webkit.org/show_bug.cgi?id=175125
2665
2666         Reviewed by Michael Catanzaro.
2667
2668         Some platforms define cflags on the (E)GL pkg-config files that we
2669         need to pass to the build system when including the (E)GL headers.
2670         And we are already doing this when building WebCore (after r184954).
2671
2672         But now we need to do this also on WebKit (former WebKit2) because
2673         we include (E)GL headers (and make use of them) on the UIProcess.
2674
2675         * CMakeLists.txt:
2676
2677 2017-08-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2678
2679         WebDriver: Implement page load strategy
2680         https://bugs.webkit.org/show_bug.cgi?id=175183
2681
2682         Reviewed by Brian Burg.
2683
2684         Split pending navigation maps into normal and eager, and use one or the other depending on the received page
2685         load strategy. We need to keep different maps for every page load strategy because every command could use a
2686         different strategy.
2687
2688         * UIProcess/Automation/WebAutomationSession.cpp:
2689         (WebKit::WebAutomationSession::waitForNavigationToComplete): Extract page load strategy from parameter and pass
2690         it to waitForNavigationToCompleteOnPage() and waitForNavigationToCompleteOnFrame().
2691         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage): Return early if page load strategy is
2692         none. Otherwise at the pening callback to the normal or eager map depeding on the page load straegy.
2693         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame): Ditto.
2694         (WebKit::respondToPendingNavigationCallbacksWithTimeout): Helper to send pening navigation callback in case of
2695         timeout failure.
2696         (WebKit::WebAutomationSession::loadTimerFired): Call finishPendingNavigationsWithTimeoutFailure() with all the maps.
2697         (WebKit::WebAutomationSession::navigateBrowsingContext): Extract page load strategy from parameter and pass it
2698         to waitForNavigationToCompleteOnPage().
2699         (WebKit::WebAutomationSession::goBackInBrowsingContext): Ditto.
2700         (WebKit::WebAutomationSession::goForwardInBrowsingContext): Ditto.
2701         (WebKit::WebAutomationSession::reloadBrowsingContext): Ditto.
2702         (WebKit::WebAutomationSession::navigationOccurredForFrame): Use the normal maps.
2703         (WebKit::WebAutomationSession::documentLoadedForFrame): Stop timeout timer and dispatch eager pending navigations.
2704         * UIProcess/Automation/WebAutomationSession.h:
2705         * UIProcess/WebPageProxy.cpp:
2706         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame): Notify the automation session.
2707
2708 2017-08-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2709
2710         WebDriver: use in-view center point for clicks instead of bounding box center point
2711         https://bugs.webkit.org/show_bug.cgi?id=174863
2712
2713         Reviewed by Simon Fraser.
2714
2715         Change computeElementLayout to also return the in-view center point and whether it's obscured by another
2716         element.
2717
2718         * UIProcess/Automation/Automation.json: Add optional inViewCenterPoint to the result and isObscured.
2719         * UIProcess/Automation/WebAutomationSession.cpp:
2720         (WebKit::WebAutomationSession::didComputeElementLayout): Handle inViewCenterPoint and isObscured.
2721         * UIProcess/Automation/WebAutomationSession.h:
2722         * UIProcess/Automation/WebAutomationSession.messages.in:
2723         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2724         (WebKit::elementInViewClientCenterPoint): Get the client in-view center point and whether it's obscured
2725         according to the spec.
2726         (WebKit::WebAutomationSessionProxy::computeElementLayout): Pass inViewCenterPoint and isObscured to
2727         DidComputeElementLayout message.
2728
2729 2017-08-05  Brian Burg  <bburg@apple.com>
2730
2731         Web Automation: files selected for upload should be matched against 'accept' attribute values case-insensitively
2732         https://bugs.webkit.org/show_bug.cgi?id=175191
2733         <rdar://problem/33725790>
2734
2735         Reviewed by Carlos Garcia Campos.
2736
2737         Values of the "accept" attribute are to be compared in a case-insensitive manner, per
2738         https://html.spec.whatwg.org/multipage/input.html#file-upload-state-(type=file)
2739
2740         Except for converting MIME types and extensions to lowercase, most of these changes
2741         were lost in a rebase prior to landing the patch.
2742
2743         * UIProcess/Automation/WebAutomationSession.cpp:
2744         (WebKit::fileCanBeAcceptedForUpload): Fix some issues:
2745         - Handle a file ending in a period.
2746         - Handle MIME type inference failing.
2747         - Convert extensions and MIMEs to lower case, per specification.
2748
2749         (WebKit::WebAutomationSession::handleRunOpenPanel):
2750         - Strip the leading period from file extensions.
2751         - These range converters crash unless the API::Array is retained by a local variable.
2752
2753 2017-08-04  Youenn Fablet  <youenn@apple.com>
2754
2755         [Cache API] Add Cache and CacheStorage IDL definitions
2756         https://bugs.webkit.org/show_bug.cgi?id=175201
2757
2758         Reviewed by Brady Eidson.
2759
2760         * Shared/WebPreferencesDefinitions.h:
2761         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2762         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2763         * WebProcess/WebPage/WebPage.cpp:
2764         (WebKit::WebPage::updatePreferences):
2765
2766 2017-08-04  Brian Burg  <bburg@apple.com>
2767
2768         Expose WKPreferences SPI for toggling mock capture devices prompt
2769         https://bugs.webkit.org/show_bug.cgi?id=175227
2770         <rdar://problem/33734528>
2771
2772         Reviewed by Youenn Fablet.
2773
2774         * UIProcess/API/Cocoa/WKPreferences.mm:
2775         (-[WKPreferences _mockCaptureDevicesPromptEnabled]):
2776         (-[WKPreferences _setMockCaptureDevicesPromptEnabled:]):
2777         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2778
2779 2017-08-04  Brian Burg  <bburg@apple.com>
2780
2781         Fix typo in WKPreferences _iceCandidateFiltertingEnabled property
2782         https://bugs.webkit.org/show_bug.cgi?id=175224
2783
2784         Reviewed by Tim Horton.
2785
2786         * UIProcess/API/Cocoa/WKPreferences.mm:
2787         (-[WKPreferences _iceCandidateFilteringEnabled]):
2788         (-[WKPreferences _iceCandidateFiltertingEnabled]): Deleted.
2789         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2790
2791 2017-08-04  Chris Dumez  <cdumez@apple.com>
2792
2793         [Beacon] Update sendBeacon to use the CachedResourceLoader
2794         https://bugs.webkit.org/show_bug.cgi?id=175192
2795         <rdar://problem/33725923>
2796
2797         Reviewed by Youenn Fablet.
2798
2799         Deal with new Beacon CachedResource type.
2800
2801         * WebProcess/Network/WebLoaderStrategy.cpp:
2802         (WebKit::maximumBufferingTime):
2803
2804 2017-08-04  John Wilander  <wilander@apple.com>
2805
2806         Resource Load Statistics: Report user interaction immediately, but only when needed
2807         https://bugs.webkit.org/show_bug.cgi?id=175090
2808         <rdar://problem/33685546>
2809
2810         Reviewed by Chris Dumez.
2811
2812         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2813         (WKBundleClearResourceLoadStatistics):
2814             Test infrastructure. Ends up calling
2815             WebCore::ResourceLoadObserver::clearState().
2816         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
2817
2818 2017-08-04  Matt Lewis  <jlewis3@apple.com>
2819
2820         Unreviewed, rolling out r220288.
2821
2822         This broke multiple builds.
2823
2824         Reverted changeset:
2825
2826         "Use MPAVRoutingController instead of deprecated versions."
2827         https://bugs.webkit.org/show_bug.cgi?id=175063
2828         http://trac.webkit.org/changeset/220288
2829
2830 2017-08-04  Jeremy Jones  <jeremyj@apple.com>
2831
2832         Use MPAVRoutingController instead of deprecated versions.
2833         https://bugs.webkit.org/show_bug.cgi?id=175063
2834         rdar://problem/33301230
2835
2836         Reviewed by Tim Horton.
2837
2838         Remove dependence on deprecated classes MPAVRoutingSheet and MPAudioVideoRoutingPopoverController.
2839
2840         * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
2841         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
2842         (-[WKAirPlayRoutePicker dealloc]):
2843         (-[WKAirPlayRoutePicker show:fromRect:]):
2844         (-[WKAirPlayRoutePicker popoverControllerDidDismissPopover:]): Deleted.
2845         (-[WKAirPlayRoutePicker _presentAirPlayPopoverAnimated:fromRect:]): Deleted.
2846         (-[WKAirPlayRoutePicker _windowWillRotate:]): Deleted.
2847         (-[WKAirPlayRoutePicker _windowDidRotate:]): Deleted.
2848         (-[WKAirPlayRoutePicker _dismissAirPlayRoutePickerIPad]): Deleted.
2849         (-[WKAirPlayRoutePicker showAirPlayPickerIPad:fromRect:]): Deleted.
2850         (-[WKAirPlayRoutePicker showAirPlayPickerIPhone:]): Deleted.
2851
2852 2017-08-04  Tim Horton  <timothy_horton@apple.com>
2853
2854         viewport-fit changes during animated resize can cause layout size to get stuck
2855         https://bugs.webkit.org/show_bug.cgi?id=175169
2856         <rdar://problem/33684697>
2857
2858         Reviewed by Simon Fraser.
2859
2860         If we get a commit that changes viewport-fit state while an animated
2861         resize is underway, and that change causes the client to push a new
2862         minimumLayoutSizeOverride, the new size will be lost forever, and we
2863         will get stuck laying out at the wrong size.
2864
2865         This is because we unconditionally apply avoidsUnsafeArea for every commit,
2866         while most other changes that come in from a commit are ignored if we're
2867         inside animated resize. To fix, also ignore avoidsUnsafeArea changes during
2868         animated resize, by moving the code that keeps track of it into WKWebView
2869         like all of the rest, and read it out of the commit in didCommitLayerTree
2870         *after* the animated-resize early-return.
2871
2872         Also, fix the associated layout tests by adding a missing assignment
2873         in _computedContentInset, which was broken in r220138.
2874
2875         * UIProcess/API/Cocoa/WKWebView.mm:
2876         (-[WKWebView _initializeWithConfiguration:]):
2877         (-[WKWebView _setHasCustomContentView:loadedMIMEType:]):
2878         (-[WKWebView _processDidExit]):
2879         (-[WKWebView _didCommitLayerTree:]):
2880         (-[WKWebView _setAvoidsUnsafeArea:]):
2881         (-[WKWebView _safeAreaShouldAffectObscuredInsets]):
2882         (-[WKWebView _didChangeAvoidsUnsafeArea:]): Deleted.
2883         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2884         * UIProcess/PageClient.h:
2885         * UIProcess/WebPageProxy.cpp:
2886         (WebKit::WebPageProxy::resetState):
2887         (WebKit::WebPageProxy::setAvoidsUnsafeArea): Deleted.
2888         * UIProcess/WebPageProxy.h:
2889         (WebKit::WebPageProxy::avoidsUnsafeArea const): Deleted.
2890         * UIProcess/ios/PageClientImplIOS.h:
2891         * UIProcess/ios/PageClientImplIOS.mm:
2892         (WebKit::PageClientImpl::didChangeAvoidsUnsafeArea): Deleted.
2893         * UIProcess/ios/WebPageProxyIOS.mm:
2894         (WebKit::WebPageProxy::didCommitLayerTree):
2895
2896 2017-08-04  Matt Lewis  <jlewis3@apple.com>
2897
2898         Unreviewed, rolling out r220271.
2899
2900         Rolling out due to Layout Test failing on iOS Simulator.
2901
2902         Reverted changeset:
2903
2904         "Remove STREAMS_API compilation guard"
2905         https://bugs.webkit.org/show_bug.cgi?id=175165
2906         http://trac.webkit.org/changeset/220271
2907
2908 2017-08-03  Sam Weinig  <sam@webkit.org>
2909
2910         [Cleanup] Remove ScriptGlobalObject
2911         https://bugs.webkit.org/show_bug.cgi?id=175173
2912
2913         Reviewed by Darin Adler.
2914
2915         * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
2916         (WebKit::RemoteWebInspectorUI::windowObjectCleared):
2917         * WebProcess/WebPage/WebInspectorUI.cpp:
2918         (WebKit::WebInspectorUI::windowObjectCleared):
2919         Remove call to ScriptGlobalObject::set and use addSelfToGlobalObjectInWorld instead.
2920
2921 2017-08-03  Brian Burg  <bburg@apple.com>
2922
2923         [Cocoa] Web Automation: copy JavaScript atoms to WebKit.framework private headers
2924         https://bugs.webkit.org/show_bug.cgi?id=175088
2925         <rdar://problem/33685818>
2926
2927         Reviewed by Joseph Pecoraro.
2928
2929         * WebKit.xcodeproj/project.pbxproj:
2930         - Add a Copy Files phase to WebKit.framework.
2931         - Copy atoms to the atoms/ directory in WebKit.framework/PrivateHeaders/.
2932
2933 2017-08-04  Ryan Haddad  <ryanhaddad@apple.com>
2934
2935         Unreviewed, rolling out r220268.
2936
2937         This change caused assertion failures on macOS and iOS Debug
2938         WK2.
2939
2940         Reverted changeset:
2941
2942         "Resource Load Statistics: Report user interaction
2943         immediately, but only when needed"
2944         https://bugs.webkit.org/show_bug.cgi?id=175090
2945         http://trac.webkit.org/changeset/220268
2946
2947 2017-08-04  Andreas Kling  <akling@apple.com>
2948
2949         NetworkLoad should always invoke its redirect completion handler
2950         https://bugs.webkit.org/show_bug.cgi?id=175179
2951         <rdar://problem/33464999>
2952
2953         Reviewed by Chris Dumez.
2954
2955         Make sure the redirect completion handler is always invoked,
2956         just like we already did for the response completion handler.
2957
2958         * NetworkProcess/NetworkLoad.cpp:
2959         (WebKit::NetworkLoad::~NetworkLoad):
2960
2961 2017-08-04  Youenn Fablet  <youenn@apple.com>
2962
2963         Remove STREAMS_API compilation guard
2964         https://bugs.webkit.org/show_bug.cgi?id=175165
2965
2966         Reviewed by Darin Adler.
2967
2968         * Configurations/FeatureDefines.xcconfig:
2969         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2970         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2971
2972 2017-08-04  Brady Eidson  <beidson@apple.com>
2973
2974         Enable ServiceWorkers at runtime for WebKitTestRunner.
2975         https://bugs.webkit.org/show_bug.cgi?id=175174
2976
2977         Reviewed by Youenn Fablet.
2978
2979         * UIProcess/WebPreferences.cpp:
2980         (WebKit::WebPreferences::enableAllExperimentalFeatures):
2981
2982 2017-08-04  John Wilander  <wilander@apple.com>
2983
2984         Resource Load Statistics: Report user interaction immediately, but only when needed
2985         https://bugs.webkit.org/show_bug.cgi?id=175090
2986         <rdar://problem/33685546>
2987
2988         Reviewed by Chris Dumez.
2989
2990         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2991         (WKBundleClearResourceLoadStatistics):
2992             Test infrastructure. Ends up calling
2993             WebCore::ResourceLoadObserver::clearState().
2994         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
2995
2996 2017-08-04  Antti Koivisto  <antti@apple.com>
2997
2998         Network cache should be usable as non-singleton
2999         https://bugs.webkit.org/show_bug.cgi?id=175139
3000
3001         Reviewed by Sam Weinig.
3002
3003         We might want to use it as a non-singleton in the future (for example as a backend for the cache API).
3004
3005         This patch makes NetworkCache::Cache and NetworkCache::Storage refcounted objects and takes
3006         care to ref them properly during asynchronous operations.
3007
3008         The patch doesn't actually create any non-shared instances, it just adds the capability.
3009
3010         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3011         (WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache):
3012         * NetworkProcess/NetworkProcess.cpp:
3013         (WebKit::fetchDiskCacheEntries):
3014         (WebKit::clearDiskCacheEntries):
3015         (WebKit::NetworkProcess::setCacheModel):
3016         * NetworkProcess/NetworkProcess.h:
3017         (WebKit::NetworkProcess::cache):
3018
3019             Move the shared cache instance to the network process singleton.
3020
3021         * NetworkProcess/NetworkResourceLoader.cpp:
3022         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
3023
3024             Include shared cache as a reffed member for non-ephemeral instances.
3025
3026         (WebKit::NetworkResourceLoader::canUseCache const):
3027         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
3028         (WebKit::NetworkResourceLoader::abort):
3029         (WebKit::NetworkResourceLoader::didReceiveResponse):
3030         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
3031         (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
3032         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
3033         * NetworkProcess/NetworkResourceLoader.h:
3034         * NetworkProcess/cache/NetworkCache.cpp:
3035         (WebKit::NetworkCache::Cache::open):
3036
3037             Open now returns null if it fails.
3038             Add RegisterNotify option to set up notify trigger for the shared instance.
3039
3040         (WebKit::NetworkCache::Cache::Cache):
3041         (WebKit::NetworkCache::Cache::~Cache):
3042
3043             Add destructor.
3044
3045         (WebKit::NetworkCache::dumpFileChanged):
3046         (WebKit::NetworkCache::Cache::setCapacity):
3047         (WebKit::NetworkCache::Cache::retrieve):
3048
3049             Protect the cache instance during asynchronous operations.
3050
3051         (WebKit::NetworkCache::Cache::store):
3052         (WebKit::NetworkCache::Cache::storeRedirect):
3053         (WebKit::NetworkCache::Cache::remove):
3054         (WebKit::NetworkCache::Cache::traverse):
3055         (WebKit::NetworkCache::Cache::dumpContentsToFile):
3056         (WebKit::NetworkCache::Cache::clear):
3057         (WebKit::NetworkCache::Cache::recordsPath const):
3058         (WebKit::NetworkCache::Cache::retrieveData):
3059         (WebKit::NetworkCache::Cache::storeData):
3060         (WebKit::NetworkCache::singleton): Deleted.
3061         (WebKit::NetworkCache::Cache::initialize): Deleted.
3062         * NetworkProcess/cache/NetworkCache.h:
3063         (WebKit::NetworkCache::Cache::canUseSharedMemoryForBodyData const):
3064         (WebKit::NetworkCache::Cache::isEnabled const): Deleted.
3065
3066             Remove isEnabled() state as a cache object now always represents an enabled cache.
3067
3068         * NetworkProcess/cache/NetworkCacheEntry.cpp:
3069         (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord const):
3070         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
3071         (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
3072         (WebKit::NetworkCache::SpeculativeLoad::didReceiveResponse):
3073         (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
3074         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
3075         (WebKit::NetworkCache::Statistics::initialize):
3076         (WebKit::NetworkCache::Statistics::shrinkIfNeeded):
3077         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3078         (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation):
3079         (WebKit::NetworkCache::Storage::WriteOperation::WriteOperation):
3080         (WebKit::NetworkCache::Storage::TraverseOperation::TraverseOperation):
3081
3082             Operations now ref the storage. They are already deleted in the main thread so
3083             proper destruction is taken care of.
3084
3085         (WebKit::NetworkCache::Storage::open):
3086         (WebKit::NetworkCache::Storage::~Storage):
3087         (WebKit::NetworkCache::Storage::synchronize):
3088
3089             This and other asynchronous methods now protect the Storage instance.
3090
3091         (WebKit::NetworkCache::Storage::remove):
3092         (WebKit::NetworkCache::Storage::retrieve):
3093         (WebKit::NetworkCache::Storage::store):
3094         (WebKit::NetworkCache::Storage::traverse):
3095         (WebKit::NetworkCache::Storage::clear):
3096         (WebKit::NetworkCache::Storage::shrink):
3097         (WebKit::NetworkCache::Storage::deleteOldVersions):
3098         * NetworkProcess/cache/NetworkCacheStorage.h:
3099         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3100         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3101         (WebKit::NetworkProcess::clearDiskCache):
3102         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3103         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3104         * NetworkProcess/soup/NetworkProcessSoup.cpp:
3105         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
3106         (WebKit::NetworkProcess::clearDiskCache):
3107
3108 2017-08-04  Frederic Wang  <fwang@igalia.com>
3109
3110         ScrollingTreeOverflowScrollingNodeIOS uses the wrong fixed position rectangle
3111         https://bugs.webkit.org/show_bug.cgi?id=175135
3112
3113         Reviewed by Simon Fraser.
3114
3115         This patch modifies ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll so
3116         that it uses the fixed position rectangle relative of the first frame ancestor instead of
3117         the one of the main frame. This makes it consistent with ScrollingTreeFrameScrollingNodeIOS
3118         and RenderLayerCompositor. This fixes some flickering issues on iOS.
3119
3120         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
3121         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll): Use the fixed
3122         position rect of a non-main frame if there is one.
3123
3124 2017-08-03  Brian Burg  <bburg@apple.com>
3125
3126         Remove ENABLE(WEB_SOCKET) guards
3127         https://bugs.webkit.org/show_bug.cgi?id=167044
3128
3129         Reviewed by Joseph Pecoraro.
3130
3131         * Configurations/FeatureDefines.xcconfig:
3132         * WebProcess/Network/WebSocketProvider.cpp:
3133         * WebProcess/Network/WebSocketProvider.h:
3134
3135 2017-08-03  Chris Dumez  <cdumez@apple.com>
3136
3137         Multiple Layout tests from web-platform-tests/beacon/ are timing out.
3138         https://bugs.webkit.org/show_bug.cgi?id=175076
3139         <rdar://problem/33704752>
3140
3141         Reviewed by Alexey Proskuryakov.
3142
3143         * NetworkProcess/NetworkLoad.cpp:
3144         (WebKit::NetworkLoad::completeAuthenticationChallenge):
3145         In the NETWORK_SESSION code path, we did not ask the client about server trust evaluation
3146         when the clientCredentialPolicy was CannotAskClientForCredentials. This is because the
3147         same delegate is used for HTTP authentication and server trust evaluation in the
3148         NETWORK_SESSION code path. To align both code paths, we now ask the client about server
3149         trust evaluation even if the policy CannotAskClientForCredentials. This allows WKTR
3150         to trust certificates for localhost / 127.0.0.1 unconditionally and consistently.
3151
3152 2017-08-03  Yoshiaki Jitsukawa  <jitsu@rd.scei.sony.co.jp>
3153
3154         [PAL] Move spi/cf directory into PAL
3155         https://bugs.webkit.org/show_bug.cgi?id=175057
3156
3157         Reviewed by Antti Koivisto.
3158
3159         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3160         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3161         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3162         * NetworkProcess/ios/NetworkProcessIOS.mm:
3163         * NetworkProcess/mac/NetworkLoadMac.mm:
3164         * NetworkProcess/mac/NetworkProcessMac.mm:
3165         * Shared/cf/CookieStorageUtilsCF.h:
3166         * Shared/mac/ChildProcessMac.mm:
3167         * Shared/mac/CookieStorageShim.mm:
3168         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
3169         * UIProcess/API/Cocoa/WKProcessPool.mm:
3170         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3171         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
3172         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3173         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
3174         * UIProcess/WebsiteData/WebsiteDataStore.h:
3175         * UIProcess/mac/WebCookieManagerProxyMac.mm:
3176         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
3177         * WebProcess/cocoa/WebProcessCocoa.mm:
3178
3179 2017-08-03  Youenn Fablet  <youenn@apple.com>
3180
3181         Remove FETCH_API compilation guard
3182         https://bugs.webkit.org/show_bug.cgi?id=175154
3183
3184         Reviewed by Chris Dumez.
3185
3186         * Configurations/FeatureDefines.xcconfig:
3187         * WebProcess/WebPage/WebPage.cpp:
3188         (WebKit::WebPage::updatePreferences):
3189
3190 2017-08-03  Matt Lewis  <jlewis3@apple.com>
3191
3192         Unreviewed, rolling out r220209.
3193
3194         This caused internal build failures.
3195
3196         Reverted changeset:
3197
3198         "Use MPAVRoutingController instead of deprecated versions."
3199         https://bugs.webkit.org/show_bug.cgi?id=175063
3200         http://trac.webkit.org/changeset/220209
3201
3202 2017-08-02  Brian Burg  <bburg@apple.com>
3203
3204         Web Automation: consider file extensions in the "accept" attribute when deciding if a file can be uploaded
3205         https://bugs.webkit.org/show_bug.cgi?id=175081
3206
3207         Reviewed by Joseph Pecoraro.
3208
3209         * UIProcess/Automation/WebAutomationSession.cpp:
3210         (WebKit::fileCanBeAcceptedForUpload):
3211         (WebKit::WebAutomationSession::handleRunOpenPanel):
3212         In cases where a file has an extension, try to match it against the
3213         accepted extensions list. Give up if there's no extension. Otherwise,
3214         proceed as normal to infer a MIME type based on the extension.
3215         In cases where extension-less files are inside hidden folders, the MIME
3216         inference will fail as well.
3217
3218 2017-08-03  Brady Eidson  <beidson@apple.com>
3219
3220         Add SW IDLs and stub out basic functionality.
3221         https://bugs.webkit.org/show_bug.cgi?id=175115
3222
3223         Reviewed by Chris Dumez.
3224
3225         * Configurations/FeatureDefines.xcconfig:
3226         
3227         * Shared/WebPreferencesDefinitions.h:
3228         
3229         * UIProcess/WebPreferences.cpp:
3230         (WebKit::WebPreferences::enableAllExperimentalFeatures): Explicitly skip SW for now.
3231           The ramifications to layouttests are complicated, and we'd like to follow up in a
3232           separate patch.
3233         
3234         * WebProcess/WebPage/WebPage.cpp:
3235         (WebKit::WebPage::updatePreferences):
3236
3237 2017-08-03  Yoshiaki Jitsukawa  <jitsu@rd.scei.sony.co.jp>
3238
3239         [WebKit] Sort Xcode project file
3240         https://bugs.webkit.org/show_bug.cgi?id=175122
3241
3242         Reviewed by Antti Koivisto.
3243
3244         * WebKit.xcodeproj/project.pbxproj:
3245
3246 2017-08-02  Sam Weinig  <sam@webkit.org>
3247
3248         [WebIDL] Convert MutationCallback to be a normal generated callback
3249         https://bugs.webkit.org/show_bug.cgi?id=174140
3250
3251         Reviewed by Darin Adler.
3252
3253         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
3254         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.cpp:
3255         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilterPrivate.h:
3256         Pass, now necessary, Document to NativeNodeFilter constructor.
3257
3258 2017-08-03  Jeremy Jones  <jeremyj@apple.com>
3259
3260         Use MPAVRoutingController instead of deprecated versions.
3261         https://bugs.webkit.org/show_bug.cgi?id=175063
3262         rdar://problem/33301230
3263
3264         Reviewed by Tim Horton.
3265
3266         Remove dependence on deprecated classes MPAVRoutingSheet and MPAudioVideoRoutingPopoverController.
3267
3268         * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
3269         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
3270         (-[WKAirPlayRoutePicker dealloc]):
3271         (-[WKAirPlayRoutePicker show:fromRect:]):
3272         (-[WKAirPlayRoutePicker popoverControllerDidDismissPopover:]): Deleted.
3273         (-[WKAirPlayRoutePicker _presentAirPlayPopoverAnimated:fromRect:]): Deleted.
3274         (-[WKAirPlayRoutePicker _windowWillRotate:]): Deleted.
3275         (-[WKAirPlayRoutePicker _windowDidRotate:]): Deleted.
3276         (-[WKAirPlayRoutePicker _dismissAirPlayRoutePickerIPad]): Deleted.
3277         (-[WKAirPlayRoutePicker showAirPlayPickerIPad:fromRect:]): Deleted.
3278         (-[WKAirPlayRoutePicker showAirPlayPickerIPhone:]): Deleted.
3279
3280 2017-08-03  Chris Dumez  <cdumez@apple.com>
3281
3282         Improve our support for referrer policies
3283         https://bugs.webkit.org/show_bug.cgi?id=175069
3284         <rdar://problem/33677313>
3285
3286         Reviewed by Darin Adler.
3287
3288         * WebProcess/Network/WebLoaderStrategy.cpp:
3289         (WebKit::WebLoaderStrategy::loadResource):
3290         (WebKit::WebLoaderStrategy::schedulePluginStreamLoad):
3291
3292 2017-08-02  Chris Dumez  <cdumez@apple.com>
3293
3294         NetworkResourceLoader::setDefersLoading() may cause start() to be called multiple times
3295         https://bugs.webkit.org/show_bug.cgi?id=175109
3296         <rdar://problem/33363169>
3297
3298         Reviewed by Brady Eidson.
3299
3300         If NetworkResourceLoader::setDefersLoading(false) is called by the client while m_networkLoad is null
3301         then we call NetworkResourceLoader::start() to start the load. This is needed in the case where
3302         a NetworkResourceLoader is constructed in deferred mode so that the load can later be started via
3303         setDefersLoading(). However, it is possible for setDefersLoading(false) to be called when start()
3304         has already been called, which causes start() to be called multiple times and leads to an assertion
3305         hit in debug.
3306
3307         Normally, setDefersLoading(false) returns without calling start() if m_networkLoad is not null. It
3308         relies on m_networkLoad being non-null to determine if start() should be called. This is bad because
3309         start() checks the disk cache asynchronously *before* calling startNetworkLoad() and initializing
3310         m_networkLoad. Therefore, if setDefersLoading(false) is called *while* we are checking the cache,
3311         then we will call incorrectly call start() again.
3312
3313         In the case of the radar, this happens when we:
3314         1. Call start() and check the disk cache
3315         2. Retrieve a cached redirect from the cache, which causes a WillSendRequest IPC to be sent to the
3316            WebProcess
3317         3. The WebProcess calls setDefersLoading(true), sends the ContinueWillSendRequest IPC back and
3318            then calls setDefersLoading(false)
3319
3320         The call to continueWillSendRequest() causes us to retrieve the redirected entry from the cache,
3321         asynchronously, which will return no entry and start a load.
3322         The later call to setDefersLoading(false) causes us to call start() again and we end up back to step 1.
3323
3324         * NetworkProcess/NetworkResourceLoader.cpp:
3325         (WebKit::NetworkResourceLoader::start):
3326         (WebKit::NetworkResourceLoader::setDefersLoading):
3327         * NetworkProcess/NetworkResourceLoader.h:
3328
3329 2017-08-02  Andreas Kling  <akling@apple.com>
3330
3331         NetworkRTCProvider::createResolver() leaks CFHost objects
3332         https://bugs.webkit.org/show_bug.cgi?id=175103
3333         <rdar://problem/33690347>
3334
3335         Reviewed by Youenn Fablet.
3336
3337         Add a missing adoptCF() so we don't leak the CFHost.
3338
3339         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
3340         (WebKit::NetworkRTCProvider::createResolver):
3341
3342 2017-08-02  Jeremy Jones  <jeremyj@apple.com>
3343
3344         Remove unused and obsolete setting mediaDocumentEntersFullscreenAutomatically
3345         https://bugs.webkit.org/show_bug.cgi?id=175080
3346
3347         Reviewed by Jon Lee.
3348
3349         This is obsolete because of the alternate solution in
3350         https://bugs.webkit.org/show_bug.cgi?id=174850
3351
3352         * Shared/WebPreferencesDefinitions.h:
3353         * UIProcess/API/Cocoa/WKPreferences.mm:
3354         (-[WKPreferences _setMediaDocumentEntersFullscreenAutomatically:]): Deleted.
3355         (-[WKPreferences _mediaDocumentEntersFullscreenAutomatically]): Deleted.
3356         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3357         * WebProcess/WebPage/WebPage.cpp:
3358         (WebKit::WebPage::updatePreferences):
3359
3360 2017-08-02  Filip Pizlo  <fpizlo@apple.com>
3361
3362         We should be OK with the gigacage being disabled on gmalloc
3363         https://bugs.webkit.org/show_bug.cgi?id=175082
3364
3365         Reviewed by Michael Saboff.
3366
3367         * WebProcess/WebProcess.cpp:
3368         (WebKit::m_webSQLiteDatabaseTracker):
3369
3370 2017-08-02  Brian Burg  <bburg@apple.com>
3371
3372         Web Automation: files selected for upload should be checked against values of the 'accept' attribute
3373         https://bugs.webkit.org/show_bug.cgi?id=174803
3374         <rdar://problem/33514190>
3375
3376         Reviewed by Carlos Garcia Campos.
3377
3378         Use the parsed values of the file input element's "accept" attribute to reject
3379         files that don't match the specified values. This is normally done by Safari
3380         using NSOpenPanel, but since a real open panel isn't shown during automation,
3381         it needs to be done here.
3382
3383         Support for limiting accepted files by file extensions will be added when the
3384         same is implemented in the normal code path for the C and Objective-C APIs.
3385
3386         This change is covered by internal WebDriver tests that will be rewritten for the
3387         public Webdriver W3C test suite someday, when safaridriver runs those tests itself.
3388
3389         * UIProcess/Automation/WebAutomationSession.cpp:
3390         (WebKit::WebAutomationSession::handleRunOpenPanel):
3391         Since we already have the proposed files, there's no need to compute a list of
3392         supported extensions based on wildcard MIME types. First check the extension,
3393         then the inferred MIME type for the extension, and then the wildcard MIME type
3394         if the inferred type is not an exact match.
3395
3396 2017-08-02  Tim Horton  <timothy_horton@apple.com>
3397
3398         WKPDFView doesn't respect safe area insets
3399         https://bugs.webkit.org/show_bug.cgi?id=175046
3400         <rdar://problem/33558386>
3401
3402         Reviewed by Wenson Hsieh.
3403
3404         * Platform/spi/ios/UIKitSPI.h:
3405         Add some SPI.
3406
3407         * UIProcess/API/Cocoa/WKWebView.mm:
3408         (-[WKWebView _setHasCustomContentView:loadedMIMEType:]):
3409         Drive-by fix two small custom content view issues:
3410
3411         - Reset _scrollViewBackgroundColor; it is used to early-return from
3412         updating the background color if it hasn't changed, but if you go from a
3413         site with (for example) a white background, to a PDF, to another site
3414         with a white background, we will early-return and not reset the background
3415         color from the grey WKPDFView background.
3416
3417         - When installing a custom content view, scroll to the origin. We miss
3418         the usual mechanism for scrolling to the origin when custom content views
3419         are installed, so do it here.
3420
3421         (-[WKWebView _effectiveObscuredInsetEdgesAffectedBySafeArea]):
3422         Ignore _obscuredInsetEdgesAffectedBySafeArea for custom content views.
3423         This is fairly arbitrary, and we should find a different way to
3424         express different edge sets for different kinds of content (perhaps
3425         bake this into default viewports?), but for now this works.
3426
3427         (-[WKWebView _computedContentInset]):
3428         Use _effectiveObscuredInsetEdgesAffectedBySafeArea instead of the ivar directly.
3429
3430         (-[WKWebView _safeAreaShouldAffectObscuredInsets]):
3431         Force safe areas to not affect obscured insets for custom content views,
3432         so that it's up to every custom content view to take safe areas into
3433         account themselves.
3434
3435         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3436         Expose _computedUnobscuredSafeAreaInset for WKPDFView's use.
3437
3438         * UIProcess/ios/WKPDFView.mm:
3439         (-[WKPDFView web_setMinimumSize:]):
3440         Avoid rebuilding the WKPDFView if the minimum size didn't change.
3441
3442         (-[WKPDFView _offsetForPageNumberIndicator]):
3443         Take unobscured safe area insets into account when insetting
3444         the page number indicator.
3445
3446         (-[WKPDFView web_computedContentInsetDidChange]):
3447         Watch for unobscured safe area inset changes, and apply them to the
3448         layout of the WKPDFView.
3449
3450         (-[WKPDFView _computePageAndDocumentFrames]):
3451         Make it possible to only update the WKPDFView's size and position, without
3452         rebuilding its subviews, if the width did not change. This prevents lots
3453         of flashing of the child UIPDFPageViews when the unobscured safe area