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