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