Replace DATA_TRANSFER_ITEMS by a runtime flag and add a stub implementation
[WebKit.git] / Source / WebKit / ChangeLog
1 2017-08-11  Ryosuke Niwa  <rniwa@webkit.org>
2
3         Replace DATA_TRANSFER_ITEMS by a runtime flag and add a stub implementation
4         https://bugs.webkit.org/show_bug.cgi?id=175474
5         <rdar://problem/33844628>
6
7         Reviewed by Wenson Hsieh.
8
9         Replaced the build flag by a runtime flag and disabled the feature by default.
10
11         * Configurations/FeatureDefines.xcconfig:
12         * Shared/WebPreferencesDefinitions.h:
13         * UIProcess/API/C/WKPreferences.cpp:
14         (WKPreferencesSetDataTransferItemsEnabled): Added to be used by WebKitTestRunner.
15         (WKPreferencesGetDataTransferItemsEnabled): Ditto.
16         * UIProcess/API/C/WKPreferencesRefPrivate.h:
17         * WebProcess/WebPage/WebPage.cpp:
18         (WebKit::WebPage::updatePreferences):
19
20 2017-08-10  Sam Weinig  <sam@webkit.org>
21
22         WTF::Function does not allow for reference / non-default constructible return types
23         https://bugs.webkit.org/show_bug.cgi?id=175244
24
25         Reviewed by Chris Dumez.
26
27         * UIProcess/WebResourceLoadStatisticsStore.h:
28         Update the default value for the updateCookiePartitioningForDomainsHandler parameter to be an 
29         empty lambda, rather than default initialization, which leads to a null WTF::Function. This allows
30         us to remove support for calling null WTF::Function. No change in behavior.
31
32 2017-08-11  Adrian Perez de Castro  <aperez@igalia.com>
33
34         [WPE] Build failure with Clang 4.0.1: no matching conversion for functional-style cast from 'pointer' (aka 'unsigned short *') to 'WTF::String'
35         https://bugs.webkit.org/show_bug.cgi?id=175477
36
37         Reviewed by Žan Doberšek.
38
39         * Shared/wpe/WebEventFactory.cpp:
40         (WebKit::singleCharacterStringForKeyEvent): Cast to UChar* to make
41         compiler choose the correct WTF::String constructor.
42
43 2017-08-11  Carlos Garcia Campos  <cgarcia@igalia.com>
44
45         [Soup] Cannot access HTTPS sites using a HTTP proxy that requires authentication
46         https://bugs.webkit.org/show_bug.cgi?id=175378
47
48         Reviewed by Sergio Villar Senin.
49
50         In case of HTTPS resource with a proxy, libsoup uses a tunnel internally, that uses its own SoupMessage during
51         the proxy authentication. We were ignoring authentication requests for other messages.
52
53         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
54         (WebKit::NetworkDataTaskSoup::authenticateCallback): Only return early if the message does't match and it's not
55         HTTPS resource over a proxy.
56         (WebKit::NetworkDataTaskSoup::authenticate): Use the soup message from the authentication challenge.
57         (WebKit::NetworkDataTaskSoup::continueAuthenticate): Ditto.
58
59 2017-08-10  Carlos Garcia Campos  <cgarcia@igalia.com>
60
61         [Soup] Do not spawn the network process to setup cookie persistent storage
62         https://bugs.webkit.org/show_bug.cgi?id=175424
63
64         Reviewed by Sergio Villar Senin.
65
66         The persistent storage configuration is saved and passed to network process as creation parameters, so we don't
67         need to spawn the network process to configure it, when it's created eventually it will use the configuration.
68
69         * UIProcess/soup/WebCookieManagerProxySoup.cpp:
70         (WebKit::WebCookieManagerProxy::setCookiePersistentStorage): Use sendToNetworkingProcess() instead of
71         endToNetworkingProcessRelaunchingIfNecessary().
72
73 2017-08-10  Carlos Garcia Campos  <cgarcia@igalia.com>
74
75         [GTK][WPE] Assertion failure in TimerBase inside WebCore::IconRecord::setImageData
76         https://bugs.webkit.org/show_bug.cgi?id=173866
77         <rdar://problem/33122050>
78
79         Reviewed by Michael Catanzaro.
80
81         IconDatabase creates and destroys IconRecord objects in both database and main thread. If the IconRecord has a
82         valid icon, its Image could be created in one thread and destroyed in another, something that is not expected to
83         happen, because Image has a Timer member. Since we have all the data and we are decoding it right after creating
84         the Image, we don't really need to keep the Image object around, we could simply take a reference of the encoded
85         data and the decoded native image to be returned by synchronousIconForPageURL().
86
87         * UIProcess/API/glib/IconDatabase.cpp:
88         (WebKit::IconDatabase::IconRecord::image): Return NativeImagePtr now.
89         (WebKit::IconDatabase::IconRecord::setImageData): Create a BitmapImage to decode it and keep a reference to the
90         encoded data and decoded native image.
91         (WebKit::IconDatabase::IconRecord::snapshot const): Use m_imageData to get the encoded data.
92         (WebKit::IconDatabase::synchronousIconForPageURL): Return the native image and whether the icon is known or not.
93         (WebKit::IconDatabase::IconRecord::loadImageFromResource): Deleted.
94         * UIProcess/API/glib/IconDatabase.h:
95         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
96         (getIconSurfaceSynchronously): Use new API.
97
98 2017-08-10  Dan Bernstein  <mitz@apple.com>
99
100         Restored svn:ignore values that went missing when the project got renamed.
101
102         * WebKit.xcodeproj: Added property svn:ignore.
103
104 2017-08-10  Brady Eidson  <beidson@apple.com>
105
106         Rename the source files for the WTF persistent coders.
107         https://bugs.webkit.org/show_bug.cgi?id=175441
108
109         Reviewed by Tim Horton.
110
111         * NetworkProcess/cache/NetworkCacheCoders.h:
112         * NetworkProcess/cache/NetworkCacheKey.cpp:
113         * NetworkProcess/cache/NetworkCacheKey.h:
114         * UIProcess/API/APIContentRuleListStore.cpp:
115
116 2017-08-10  John Wilander  <wilander@apple.com>
117
118         Resource Load Statistics: Increase grandfathering time to 7 days
119         https://bugs.webkit.org/show_bug.cgi?id=175414
120         <rdar://problem/33818046>
121
122         Reviewed by Brent Fulgham.
123
124         * UIProcess/WebResourceLoadStatisticsStore.h:
125
126 2017-08-10  John Wilander  <wilander@apple.com>
127
128         Resource Load Statistics: Add significant figures to telemetry calls
129         https://bugs.webkit.org/show_bug.cgi?id=175442
130         <rdar://problem/33834834>
131
132         Reviewed by Brent Fulgham.
133
134         With this change, logged values are allowed to have 3 significant figures
135         as opposed to today's 0 which is wrong.
136
137         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
138         (WebKit::submitTopList):
139         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
140
141 2017-08-10  Mark Lam  <mark.lam@apple.com>
142
143         Apply the UNLIKELY macro to some unlikely things.
144         https://bugs.webkit.org/show_bug.cgi?id=175440
145         <rdar://problem/33834767>
146
147         Reviewed by Yusuke Suzuki.
148
149         * WebProcess/WebPage/WebPage.cpp:
150         (WebKit::WebPage::getBytecodeProfile):
151
152 2017-08-10  Chris Dumez  <cdumez@apple.com>
153
154         Turn on support for Beacon API by default in STP
155         https://bugs.webkit.org/show_bug.cgi?id=175445
156         <rdar://problem/33836379>
157
158         Reviewed by Youenn Fablet.
159
160         * Shared/WebPreferencesDefinitions.h:
161
162 2017-08-10  Ross Kirsling  <ross.kirsling@sony.com>
163
164         Fix iOS simulator build after change "[WTF] Move TextStream into WTF"
165         https://bugs.webkit.org/show_bug.cgi?id=175211
166
167         Reviewed by Myles C. Maxfield.
168
169         * UIProcess/API/Cocoa/WKWebView.mm:
170         (-[WKWebView _scrollByContentOffset:]):
171         (-[WKWebView _navigationGestureDidBegin]):
172
173 2017-08-10  Chris Dumez  <cdumez@apple.com>
174
175         [Beacon] Do connect-src CSP check on redirects as well
176         https://bugs.webkit.org/show_bug.cgi?id=175410
177         <rdar://problem/33815470>
178
179         Reviewed by Youenn Fablet.
180
181         Pass CSP Response headers to the NetworkProcess via NetworkResourceLoadParameters
182         when doing a PingLoad. This allows PingLoad to do CSP checks (in particular
183         connect-src ones) in case the ping load gets redirected. Those checks need to be
184         done on the NetworkProcess side at this point because there is no guarantee the
185         WebContent process is still around.
186
187         To do the CSP checks, PingLoad lazily reconstructs a ContentSecurityPolicy object
188         from the CSP response headers.
189
190         * NetworkProcess/NetworkResourceLoadParameters.cpp:
191         (WebKit::NetworkResourceLoadParameters::encode const):
192         (WebKit::NetworkResourceLoadParameters::decode):
193         * NetworkProcess/NetworkResourceLoadParameters.h:
194         * NetworkProcess/PingLoad.cpp:
195         (WebKit::PingLoad::willPerformHTTPRedirection):
196         (WebKit::PingLoad::contentSecurityPolicy):
197         * NetworkProcess/PingLoad.h:
198         * WebProcess/Network/WebLoaderStrategy.cpp:
199         (WebKit::WebLoaderStrategy::createPingHandle):
200         * WebProcess/Network/WebLoaderStrategy.h:
201
202 2017-08-10  Brian Burg  <bburg@apple.com>
203
204         WKPreferences should conform to NSCopying
205         https://bugs.webkit.org/show_bug.cgi?id=175303
206         <rdar://problem/33764939>
207
208         Reviewed by Dan Bernstein.
209
210         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
211         Add conformance in the private header, as there is not consensus that this
212         needs to be API.
213
214         * UIProcess/API/Cocoa/WKPreferences.mm:
215         (-[WKPreferences copyWithZone:]):
216         Copy the wrapped WebPreferences instance and return its wrapper.
217
218 2017-08-10  Michael Catanzaro  <mcatanzaro@igalia.com>
219
220         REGRESSION(r220515) [GTK][CMake] Build with ENABLE_GEOLOCATION fails on Debian Jessie
221         https://bugs.webkit.org/show_bug.cgi?id=175426
222
223         Reviewed by Carlos Alberto Lopez Perez.
224
225         * PlatformGTK.cmake:
226
227 2017-08-10  Brady Eidson  <beidson@apple.com>
228
229         Add ServiceWorkerJob.
230         https://bugs.webkit.org/show_bug.cgi?id=175241
231
232         Reviewed by Tim Horton.
233
234         * CMakeLists.txt:
235         * WebKit.xcodeproj/project.pbxproj:
236
237         * WebProcess/Storage/WebServiceWorkerProvider.cpp: Added.
238         (WebKit::WebServiceWorkerProvider::singleton):
239         (WebKit::WebServiceWorkerProvider::WebServiceWorkerProvider):
240         (WebKit::WebServiceWorkerProvider::scheduleJob):
241         * WebProcess/Storage/WebServiceWorkerProvider.h: Added.
242
243         * WebProcess/WebProcess.cpp:
244         (WebKit::WebProcess::initializeWebProcess):
245
246 2017-08-10  Tim Horton  <timothy_horton@apple.com>
247
248         Remove some unused lambda captures so that WebKit builds with -Wunused-lambda-capture
249         https://bugs.webkit.org/show_bug.cgi?id=175436
250         <rdar://problem/33667497>
251
252         Reviewed by Simon Fraser.
253
254         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
255         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
256         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
257         (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData):
258
259 2017-08-10  Michael Catanzaro  <mcatanzaro@igalia.com>
260
261         Remove ENABLE_GAMEPAD_DEPRECATED
262         https://bugs.webkit.org/show_bug.cgi?id=175361
263
264         Reviewed by Carlos Garcia Campos.
265
266         * Configurations/FeatureDefines.xcconfig:
267
268 2017-08-10  Zan Dobersek  <zdobersek@igalia.com>
269
270         [GTK] Don't use --whole-archive linking flags for the WebKit2 target libraries
271         https://bugs.webkit.org/show_bug.cgi?id=175416
272
273         Reviewed by Carlos Garcia Campos.
274
275         * PlatformGTK.cmake: Drop the ADD_WHOLE_ARCHIVE_TO_LIBRARIES instruction
276         for the WebKit2 target. This unnecessarily bundles complete archive
277         files both into the main .so library as well as single executables that
278         are linked against the WebKit2 target.
279
280 2017-08-09  Chris Dumez  <cdumez@apple.com>
281
282         Disable Beacon API on WK1 DRT and WK2 when not using NETWORK_SESSION
283         https://bugs.webkit.org/show_bug.cgi?id=175401
284
285         Reviewed by Brady Eidson.
286
287         * UIProcess/API/C/WKPreferences.cpp:
288         (WKPreferencesSetBeaconAPIEnabled):
289         (WKPreferencesGetBeaconAPIEnabled):
290         * WebProcess/WebPage/WebPage.cpp:
291         (WebKit::WebPage::updatePreferences):
292         * config.h:
293
294 2017-08-09  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
295
296         [PAL] Move spi/cocoa and spi/cg directories into PAL
297         https://bugs.webkit.org/show_bug.cgi?id=175175
298
299         Reviewed by Myles C. Maxfield.
300
301         * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm:
302         * NetworkProcess/Downloads/mac/DownloadMac.mm:
303         * Platform/cocoa/SharedMemoryCocoa.cpp:
304         * Platform/mac/LayerHostingContext.mm:
305         * Shared/Cocoa/DataDetectionResult.mm:
306         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
307         * Shared/cf/CookieStorageUtilsCF.mm:
308         * Shared/ios/InteractionInformationAtPosition.mm:
309         * Shared/mac/HangDetectionDisablerMac.mm:
310         * Shared/mac/RemoteLayerBackingStore.mm:
311         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
312         * UIProcess/API/Cocoa/WKWebView.mm:
313         * UIProcess/API/mac/WKView.mm:
314         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
315         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
316         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
317         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
318         * UIProcess/Cocoa/WebViewImpl.h:
319         * UIProcess/Cocoa/WebViewImpl.mm:
320         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
321         * UIProcess/ios/ViewGestureControllerIOS.mm:
322         * UIProcess/ios/WKContentView.mm:
323         * UIProcess/ios/WKContentViewInteraction.mm:
324         * UIProcess/ios/WKPDFPageNumberIndicator.mm:
325         * UIProcess/ios/WKScrollView.mm:
326         * UIProcess/mac/RemoteLayerTreeHost.mm:
327         * UIProcess/mac/ServicesController.mm:
328         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
329         * UIProcess/mac/ViewGestureControllerMac.mm:
330         * UIProcess/mac/ViewSnapshotStore.mm:
331         * UIProcess/mac/WKViewLayoutStrategy.mm:
332         * WebProcess/Plugins/PDF/PDFPlugin.mm:
333         * WebProcess/WebPage/WebPage.cpp:
334         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
335         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
336         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
337         * WebProcess/cocoa/WebProcessCocoa.mm:
338
339 2017-08-09  John Wilander  <wilander@apple.com>
340
341         Resource Load Statistics: Increase grandfathering time to 3 days
342         https://bugs.webkit.org/show_bug.cgi?id=175414
343         <rdar://problem/33818046>
344
345         Reviewed by Brent Fulgham.
346
347         * UIProcess/WebResourceLoadStatisticsStore.h:
348
349 2017-08-09  Jeremy Jones  <jeremyj@apple.com>
350
351         Invalidate PlaybackSessionManager in same fashion as VideoFullscreenManager.
352         https://bugs.webkit.org/show_bug.cgi?id=175399
353         rdar://problem/33663344
354
355         Reviewed by Eric Carlson.
356
357         Invalidate PlaybackSessionManager when WebPage is destructed.
358
359         * WebProcess/WebPage/WebPage.cpp:
360         (WebKit::WebPage::~WebPage):
361         * WebProcess/cocoa/PlaybackSessionManager.h:
362         * WebProcess/cocoa/PlaybackSessionManager.mm:
363         (WebKit::PlaybackSessionManager::~PlaybackSessionManager):
364         (WebKit::PlaybackSessionManager::invalidate):
365
366 2017-08-09  Don Olmstead  <don.olmstead@sony.com>
367
368         [WTF] Move TextStream into WTF
369         https://bugs.webkit.org/show_bug.cgi?id=175211
370
371         Reviewed by Myles C. Maxfield.
372
373         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
374         * Shared/VisibleContentRectUpdateInfo.cpp:
375         * Shared/VisibleContentRectUpdateInfo.h:
376         * Shared/mac/RemoteLayerTreeTransaction.mm:
377         * UIProcess/API/Cocoa/WKWebView.mm:
378         * UIProcess/ios/WKContentView.mm:
379         * UIProcess/ios/WKContentViewInteraction.h:
380         * UIProcess/ios/WKContentViewInteraction.mm:
381         (WebKit::operator<<):
382         * UIProcess/ios/WebPageProxyIOS.mm:
383         * WebProcess/WebPage/ios/WebPageIOS.mm:
384         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
385         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
386
387 2017-08-09  Andy Estes  <aestes@apple.com>
388
389         Part 3 of: Rename DatabaseProcess to StorageProcess
390         https://bugs.webkit.org/show_bug.cgi?id=175034
391
392         Reviewed by Brady Eidson.
393
394         We tried renaming com.apple.WebKit.Databases to com.apple.WebKit.Storage in r219986, but
395         this prevented trunk WebKit from running on iOS 11 devices. This is because launchd keeps a
396         codesigned cache of XPC services, and refuses to launch services that aren't in the cache.
397
398         It's not possibe for us to rebuild the cache with the new service name (only Apple's
399         production build system can do this), and disabling the cache or opting WebKit's XPC
400         services out of the cache might have a negative impact on our performance testing.
401
402         For now we'll retain the name "com.apple.WebKit.Databases" on iOS 11 devices to work around
403         this issue. If we find a way to allow the new service to run without impacting performance,
404         we can revert this change.
405
406         We will rename the service to "com.apple.WebKit.Storage" on macOS and iOS Simulator, and in
407         a follow-up patch we'll use the new service name on post-iOS 11 device builds.
408
409         * Configurations/BaseTarget.xcconfig: Defined WK_STORAGE_SERVICE_PRODUCT_NAME to be
410         com.apple.WebKit.Databases by default, and overrode it to com.apple.WebKit.Storage on macOS
411         and iOS Simulator.
412         * Configurations/StorageService.xcconfig: Changed PRODUCT_NAME to $(WK_STORAGE_SERVICE_PRODUCT_NAME).
413         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
414         (WebKit::serviceName): Changed to return "com.apple.WebKit.Storage" on macOS and
415         iOS Simulator platforms.
416         * WebKit.xcodeproj/project.pbxproj: Updated the "Copy XPC services for engineering builds"
417         build phase to use WK_STORAGE_SERVICE_PRODUCT_NAME.
418
419 2017-08-09  Commit Queue  <commit-queue@webkit.org>
420
421         Unreviewed, rolling out r220466, r220477, and r220487.
422         https://bugs.webkit.org/show_bug.cgi?id=175411
423
424         This change broke existing API tests and follow up fixes did
425         not resolve all the issues. (Requested by ryanhaddad on
426         #webkit).
427
428         Reverted changesets:
429
430         https://bugs.webkit.org/show_bug.cgi?id=175244
431         http://trac.webkit.org/changeset/220466
432
433         "WTF::Function does not allow for reference / non-default
434         constructible return types"
435         https://bugs.webkit.org/show_bug.cgi?id=175244
436         http://trac.webkit.org/changeset/220477
437
438         https://bugs.webkit.org/show_bug.cgi?id=175244
439         http://trac.webkit.org/changeset/220487
440
441 2017-08-09  Chris Dumez  <cdumez@apple.com>
442
443         [Beacon][NetworkSession] Support CORS-preflighting on redirects
444         https://bugs.webkit.org/show_bug.cgi?id=175386
445         <rdar://problem/33801370>
446
447         Reviewed by Youenn Fablet.
448
449         Add support to Beacon for doing CORS-preflighting upon redirect to a different
450         domain.
451
452         * NetworkProcess/NetworkCORSPreflightChecker.h:
453         * NetworkProcess/PingLoad.cpp:
454         (WebKit::PingLoad::PingLoad):
455         (WebKit::PingLoad::~PingLoad):
456         (WebKit::PingLoad::loadRequest):
457         (WebKit::PingLoad::securityOrigin const):
458         (WebKit::PingLoad::willPerformHTTPRedirection):
459         (WebKit::PingLoad::didReceiveResponseNetworkSession):
460         (WebKit::PingLoad::needsCORSPreflight const):
461         (WebKit::PingLoad::doCORSPreflight):
462         * NetworkProcess/PingLoad.h:
463
464 2017-08-09  Jeremy Jones  <jeremyj@apple.com>
465
466         Use MPAVRoutingController instead of deprecated versions.
467         https://bugs.webkit.org/show_bug.cgi?id=175063
468         rdar://problem/33301230
469
470         Reviewed by Tim Horton.
471
472         Remove dependence on deprecated classes MPAVRoutingSheet and MPAudioVideoRoutingPopoverController.
473
474         * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
475         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
476         (-[WKAirPlayRoutePicker dealloc]):
477         (-[WKAirPlayRoutePicker show:fromRect:]):
478         (-[WKAirPlayRoutePicker popoverControllerDidDismissPopover:]): Deleted.
479         (-[WKAirPlayRoutePicker _presentAirPlayPopoverAnimated:fromRect:]): Deleted.
480         (-[WKAirPlayRoutePicker _windowWillRotate:]): Deleted.
481         (-[WKAirPlayRoutePicker _windowDidRotate:]): Deleted.
482         (-[WKAirPlayRoutePicker _dismissAirPlayRoutePickerIPad]): Deleted.
483         (-[WKAirPlayRoutePicker showAirPlayPickerIPad:fromRect:]): Deleted.
484         (-[WKAirPlayRoutePicker showAirPlayPickerIPhone:]): Deleted.
485
486 2017-08-09  Sam Weinig  <sam@webkit.org>
487
488         WTF::Function does not allow for reference / non-default constructible return types
489         https://bugs.webkit.org/show_bug.cgi?id=175244
490
491         Reviewed by Chris Dumez.
492
493         * UIProcess/WebResourceLoadStatisticsStore.h:
494         Update the default value for the updateCookiePartitioningForDomainsHandler parameter to be an 
495         empty lambda, rather than default initialization, which leads to a null WTF::Function. This allows
496         us to remove support for calling null WTF::Function. No change in behavior.
497
498 2017-08-09  Wenson Hsieh  <wenson_hsieh@apple.com>
499
500         [iOS DnD] ENABLE_DRAG_SUPPORT should be turned off for iOS 10 and enabled by default
501         https://bugs.webkit.org/show_bug.cgi?id=175392
502         <rdar://problem/33783207>
503
504         Reviewed by Tim Horton and Megan Gardner.
505
506         Tweak FeatureDefines to enable drag and drop by default, and disable only on unsupported platforms (i.e. iOS 10).
507
508         * Configurations/FeatureDefines.xcconfig:
509
510 2017-08-09  Brady Eidson  <beidson@apple.com>
511
512         ServiceWorker experimental feature should not be on by default (definitely not ready).
513         https://bugs.webkit.org/show_bug.cgi?id=175389
514
515         Rubberstamped by Andy Estes.
516
517         * Shared/WebPreferencesDefinitions.h: false, not DEFAULT_EXPERIMENTAL_FEATURES_ENABLED
518
519 2017-08-09  Ryan Haddad  <ryanhaddad@apple.com>
520
521         Unreviewed, rolling out r220457.
522
523         This change introduced API test failures.
524
525         Reverted changeset:
526
527         "WTF::Function does not allow for reference / non-default
528         constructible return types"
529         https://bugs.webkit.org/show_bug.cgi?id=175244
530         http://trac.webkit.org/changeset/220457
531
532 2017-08-09  Daniel Bates  <dabates@apple.com>
533
534         REGRESSION (r219013): OAuth flows are broken when redirecting back to application after authentication
535         https://bugs.webkit.org/show_bug.cgi?id=175247
536         <rdar://problem/33679804>
537
538         Reviewed by Brady Eidson.
539
540         Add SPI WKNavigationAction._isRedirect to query whether the navigation was in response to receiving
541         a redirect response. The majority of the WebKit change is plumbing this knowledge through to connect
542         it with the SPI.
543
544         * Shared/NavigationActionData.cpp:
545         (WebKit::NavigationActionData::encode const):
546         (WebKit::NavigationActionData::decode):
547         Encode and decode the boolean NavigationActionData::isRedirect.
548         * Shared/NavigationActionData.h:
549         * UIProcess/API/APINavigationAction.h:
550         * UIProcess/API/Cocoa/WKNavigationAction.mm:
551         (-[WKNavigationAction _isRedirect]): Added.
552         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
553         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
554         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Set NavigationActionData::isRedirect
555         depending on whether the navigation is in response to receiving a redirect response.
556         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
557
558 2017-08-09  Sam Weinig  <sam@webkit.org>
559
560         WTF::Function does not allow for reference / non-default constructible return types
561         https://bugs.webkit.org/show_bug.cgi?id=175244
562
563         Reviewed by Chris Dumez.
564
565         * UIProcess/WebResourceLoadStatisticsStore.h:
566         Update the default value for the updateCookiePartitioningForDomainsHandler parameter to be an 
567         empty lambda, rather than default initialization, which leads to a null WTF::Function. This allows
568         us to remove support for calling null WTF::Function. No change in behavior.
569
570 2017-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>
571
572         Unreviewed, rolling out r220393.
573
574         This patch regresses the performance of WebPage::editorState.
575
576         Reverted changeset:
577
578         "[iOS WK2] WKWebView schedules nonstop layout after pressing
579         cmb+b,i,u inside a contenteditable div"
580         https://bugs.webkit.org/show_bug.cgi?id=175116
581         http://trac.webkit.org/changeset/220393
582
583 2017-08-08  Chris Dumez  <cdumez@apple.com>
584
585         [Beacon] Add support for CORS-preflighting for WK2 / NETWORK_SESSION
586         https://bugs.webkit.org/show_bug.cgi?id=175264
587         <rdar://problem/33547793>
588
589         Reviewed by Youenn Fablet.
590
591         Implement CORS-preflighting for beacons with a payload that has a non
592         safelisted MIME type, as per:
593         - https://w3c.github.io/beacon/#privacy
594         - https://www.w3.org/TR/beacon/#sec-processing-model
595
596         CORS-preflighting is completely handled on Network Process side because
597         a beacon request can outlive its page and therefore its WebContent
598         process. This requires us to pass a little more information to the
599         Network process, in particular the source origin and the corsMode.
600
601         The current implementation does not currently deal with CORS preflights
602         needed upon a redirect. This will be added in a follow-up.
603
604         * CMakeLists.txt:
605         * NetworkProcess/NetworkCORSPreflightChecker.cpp: Added.
606         (WebKit::NetworkCORSPreflightChecker::NetworkCORSPreflightChecker):
607         (WebKit::NetworkCORSPreflightChecker::~NetworkCORSPreflightChecker):
608         (WebKit::NetworkCORSPreflightChecker::startPreflight):
609         (WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection):
610         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
611         (WebKit::NetworkCORSPreflightChecker::didReceiveResponseNetworkSession):
612         (WebKit::NetworkCORSPreflightChecker::didReceiveData):
613         (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
614         (WebKit::NetworkCORSPreflightChecker::didSendData):
615         (WebKit::NetworkCORSPreflightChecker::wasBlocked):
616         (WebKit::NetworkCORSPreflightChecker::cannotShowURL):
617         * NetworkProcess/NetworkCORSPreflightChecker.h: Added.
618         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
619         (WebKit::NetworkConnectionToWebProcess::loadPing):
620         * NetworkProcess/NetworkConnectionToWebProcess.h:
621         * NetworkProcess/NetworkResourceLoadParameters.cpp:
622         (WebKit::NetworkResourceLoadParameters::encode const):
623         (WebKit::NetworkResourceLoadParameters::decode):
624         * NetworkProcess/NetworkResourceLoadParameters.h:
625         * NetworkProcess/PingLoad.cpp: Added.
626         (WebKit::PingLoad::PingLoad):
627         (WebKit::PingLoad::~PingLoad):
628         (WebKit::PingLoad::startNetworkLoad):
629         (WebKit::PingLoad::willPerformHTTPRedirection):
630         (WebKit::PingLoad::didReceiveChallenge):
631         (WebKit::PingLoad::didReceiveResponseNetworkSession):
632         (WebKit::PingLoad::didReceiveData):
633         (WebKit::PingLoad::didCompleteWithError):
634         (WebKit::PingLoad::didSendData):
635         (WebKit::PingLoad::wasBlocked):
636         (WebKit::PingLoad::cannotShowURL):
637         (WebKit::PingLoad::timeoutTimerFired):
638         (WebKit::PingLoad::needsCORSPreflight const):
639         (WebKit::PingLoad::doCORSPreflight):
640         * NetworkProcess/PingLoad.h:
641         * WebKit.xcodeproj/project.pbxproj:
642         * WebProcess/Network/WebLoaderStrategy.cpp:
643         (WebKit::WebLoaderStrategy::createPingHandle):
644         * WebProcess/Network/WebLoaderStrategy.h:
645
646 2017-08-08  Megan Gardner  <megan_gardner@apple.com>
647
648         Remove old and unused pointIsInAssistedNode definition
649         https://bugs.webkit.org/show_bug.cgi?id=175335
650
651         Stage removal here to allow removal from UIKit.
652         Replaced by textInteractionGesture:shouldBeginAtPoint:
653
654         Reviewed by Tim Horton.
655
656         * Platform/spi/ios/UIKitSPI.h:
657         * UIProcess/ios/WKContentViewInteraction.mm:
658         (-[WKContentView pointIsInAssistedNode:]): Deleted.
659
660 2017-08-08  Michael Catanzaro  <mcatanzaro@igalia.com>
661
662         Unreviewed, fix Ubuntu LTS build
663         https://bugs.webkit.org/show_bug.cgi?id=174490
664
665         * UIProcess/glib/RemoteInspectorClient.cpp:
666         (WebKit::RemoteInspectorClient::RemoteInspectorClient):
667
668 2017-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>
669
670         Unreviewed, fix the Mac debug build after r220418.
671
672         * UIProcess/Cocoa/WebViewImpl.mm:
673         (WebKit::WebViewImpl::prepareForMoveToWindow):
674
675 2017-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>
676
677         [Mac WK2] WebViewImpl should hold a weak pointer to its WKWebView or WKView
678         https://bugs.webkit.org/show_bug.cgi?id=175302
679         <rdar://problem/33762116>
680
681         Reviewed by Tim Horton.
682
683         Refactor WebViewImpl's m_view from a raw pointer to a WeakObjCPtr to ensure that it is automatically cleared out
684         when the WKWebView or WKView are destroyed, and also changes several places where we implicitly block capture
685         the WebViewImpl to only capture a WeakPtr to the WebViewImpl. Most of the changes here are boilerplate
686         adjustments for how m_view is now a weak pointer.
687
688         Test: WKWebViewMacEditingTests.DoNotCrashWhenInterpretingKeyEventWhileDeallocatingView.
689
690         * Shared/mac/WeakObjCPtr.h:
691         (WebKit::WeakObjCPtr::operator ValueType * const):
692         * UIProcess/Cocoa/WebViewImpl.h:
693         * UIProcess/Cocoa/WebViewImpl.mm:
694         (WebKit::WebViewImpl::updateTouchBar):
695         (WebKit::WebViewImpl::updateMediaTouchBar):
696         (WebKit::WebViewImpl::WebViewImpl):
697         (WebKit::WebViewImpl::~WebViewImpl):
698         (WebKit::WebViewImpl::window):
699         (WebKit::WebViewImpl::resignFirstResponder):
700         (WebKit::WebViewImpl::isFocused const):
701         (WebKit::WebViewImpl::renewGState):
702         (WebKit::WebViewImpl::setFrameAndScrollBy):
703         (WebKit::WebViewImpl::updateWindowAndViewFrames):
704         (WebKit::WebViewImpl::updateLayer):
705         (WebKit::WebViewImpl::printOperationWithPrintInfo):
706         (WebKit::WebViewImpl::updateContentInsetsIfAutomatic):
707         (WebKit::WebViewImpl::setLayoutMode):
708         (WebKit::WebViewImpl::intrinsicDeviceScaleFactor const):
709         (WebKit::WebViewImpl::windowDidBecomeKey):
710         (WebKit::WebViewImpl::windowDidResignKey):
711         (WebKit::WebViewImpl::windowDidChangeScreen):
712         (WebKit::WebViewImpl::mightBeginDragWhileInactive):
713         (WebKit::WebViewImpl::acceptsFirstMouse):
714         (WebKit::WebViewImpl::shouldDelayWindowOrderingForEvent):
715         (WebKit::WebViewImpl::windowResizeMouseLocationIsInVisibleScrollerThumb):
716         (WebKit::WebViewImpl::viewWillMoveToWindow):
717         (WebKit::WebViewImpl::viewDidMoveToWindow):
718         (WebKit::WebViewImpl::viewDidChangeBackingProperties):
719         (WebKit::WebViewImpl::hitTest):
720         (WebKit::WebViewImpl::postFakeMouseMovedEventForFlagsChangedEvent):
721         (WebKit::WebViewImpl::colorSpace):
722         (WebKit::WebViewImpl::prepareForMoveToWindow):
723         (WebKit::WebViewImpl::notifyInputContextAboutDiscardedComposition):
724         (WebKit::WebViewImpl::pressureChangeWithEvent):
725         (WebKit::WebViewImpl::fullScreenWindowController):
726         (WebKit::WebViewImpl::executeSavedCommandBySelector):
727         (WebKit::WebViewImpl::validRequestorForSendAndReturnTypes):
728         (WebKit::WebViewImpl::handleRequestedCandidates):
729         (WebKit::WebViewImpl::preferencesDidChange):
730         (WebKit::WebViewImpl::setTextIndicator):
731         (WebKit::WebViewImpl::dismissContentRelativeChildWindowsFromViewOnly):
732         (WebKit::WebViewImpl::accessibilityRegisterUIProcessTokens):
733         (WebKit::WebViewImpl::sendToolTipMouseExited):
734         (WebKit::WebViewImpl::sendToolTipMouseEntered):
735         (WebKit::WebViewImpl::toolTipChanged):
736         (WebKit::WebViewImpl::setAcceleratedCompositingRootLayer):
737         (WebKit::WebViewImpl::updateThumbnailViewLayer):
738         (WebKit::WebViewImpl::setInspectorAttachmentView):
739         (WebKit::WebViewImpl::inspectorAttachmentView):
740         (WebKit::WebViewImpl::draggedImage):
741         (WebKit::WebViewImpl::draggingEntered):
742         (WebKit::WebViewImpl::draggingUpdated):
743         (WebKit::WebViewImpl::draggingExited):
744         (WebKit::WebViewImpl::performDragOperation):
745         (WebKit::WebViewImpl::hitTestForDragTypes):
746         (WebKit::WebViewImpl::startWindowDrag):
747         (WebKit::WebViewImpl::dragImageForView):
748         (WebKit::WebViewImpl::setPromisedDataForImage):
749         (WebKit::WebViewImpl::setPromisedDataForAttachment):
750         (WebKit::WebViewImpl::takeViewSnapshot):
751         (WebKit::WebViewImpl::scrollWheel):
752         (WebKit::WebViewImpl::magnifyWithEvent):
753         (WebKit::WebViewImpl::rotateWithEvent):
754         (WebKit::WebViewImpl::doneWithKeyEvent):
755         (WebKit::WebViewImpl::interpretKeyEvent):
756         (WebKit::WebViewImpl::firstRectForCharacterRange):
757         (WebKit::WebViewImpl::characterIndexForPoint):
758         (WebKit::WebViewImpl::performKeyEquivalent):
759         (WebKit::WebViewImpl::keyUp):
760         (WebKit::WebViewImpl::keyDown):
761         (WebKit::WebViewImpl::mouseMoved):
762         (WebKit::WebViewImpl::windowIsFrontWindowUnderMouse):
763         (WebKit::WebViewImpl::userInterfaceLayoutDirection):
764
765 2017-08-08  Filip Pizlo  <fpizlo@apple.com>
766
767         Baseline JIT should do caging
768         https://bugs.webkit.org/show_bug.cgi?id=175037
769
770         Reviewed by Mark Lam.
771         
772         Use a better API to disable disabling the primitive gigacage.
773
774         * WebProcess/WebProcess.cpp:
775         (WebKit::m_webSQLiteDatabaseTracker):
776         (WebKit::primitiveGigacageDisabled): Deleted.
777
778 2017-08-08  John Wilander  <wilander@apple.com>
779
780         Resource Load Statistics: Clear web processes' state on history removal
781         https://bugs.webkit.org/show_bug.cgi?id=175271
782         <rdar://problem/33756560>
783
784         Reviewed by Chris Dumez.
785
786         https://bugs.webkit.org/show_bug.cgi?id=175090 introduced state
787         in the web process and that state needs to be cleared when the
788         UI process' statistics are cleared as part of history removal.
789
790         * UIProcess/WebProcessPool.cpp:
791         (WebKit::WebProcessPool::clearResourceLoadStatistics):
792         * UIProcess/WebProcessPool.h:
793         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
794         (WebKit::WebsiteDataStore::removeData):
795         (WebKit::WebsiteDataStore::clearResourceLoadStatisticsInWebProcesses):
796         * UIProcess/WebsiteData/WebsiteDataStore.h:
797         * WebProcess/WebProcess.cpp:
798         (WebKit::WebProcess::clearResourceLoadStatistics):
799         * WebProcess/WebProcess.h:
800         * WebProcess/WebProcess.messages.in:
801
802 2017-08-08  Adrian Perez de Castro  <aperez@igalia.com>
803
804         [WPE] Implement WebsiteDataStore::defaultApplicationCacheDirectory() and friends
805         https://bugs.webkit.org/show_bug.cgi?id=175322
806
807         Reviewed by Carlos Garcia Campos.
808
809         This makes WPE use the same implementation as the GTK+ port, with a preprocessor switch to choose the name of
810         the base directory inside the user XDG cache directory.
811
812         * PlatformGTK.cmake: Add APIWebsiteDataStoreGLib.cpp to the build sources and remove APIWebsiteDataStoreGtk.cpp.
813         * PlatformWPE.cmake: Add APIWebsiteDataStoreGLib.cpp to the built sources.
814         * UIProcess/API/APIWebsiteDataStore.cpp: Remove now dead code.
815         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: Renamed from Source/WebKit/UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp.
816         (API::WebsiteDataStore::defaultApplicationCacheDirectory):
817         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
818         (API::WebsiteDataStore::defaultLocalStorageDirectory):
819         (API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
820         (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
821         (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
822
823 2017-08-08  Ryan Haddad  <ryanhaddad@apple.com>
824
825         Unreviewed, rolling out r220368.
826
827         This change caused WK1 tests to exit early with crashes.
828
829         Reverted changeset:
830
831         "Baseline JIT should do caging"
832         https://bugs.webkit.org/show_bug.cgi?id=175037
833         http://trac.webkit.org/changeset/220368
834
835 2017-08-08  Michael Catanzaro  <mcatanzaro@igalia.com>
836
837         [CMake] Properly test if compiler supports compiler flags
838         https://bugs.webkit.org/show_bug.cgi?id=174490
839
840         Reviewed by Konstantin Tokarev.
841
842         * CMakeLists.txt:
843         * PlatformGTK.cmake:
844
845 2017-08-07  Carlos Garcia Campos  <cgarcia@igalia.com>
846
847         Web Automation: setUserInputForCurrentJavaScriptPrompt should fail if current dialog is not a prompt
848         https://bugs.webkit.org/show_bug.cgi?id=175261
849
850         Reviewed by Brian Burg.
851
852         According to the spec, send alert text command should fail if the current dialog is not a prompt. This patch
853         adds JavaScriptDialogType enum to API::AutomationSessionClient and a new virtual method to ask the client about
854         the type of the current dialog. WebAutomationSession::setUserInputForCurrentJavaScriptPrompt() uses the new
855         client method to check the type of the current dialog and fail in case it's not a prompt. Cocoa needs an
856         implementation, for now it always returns Prompt as the type to keep compatibility.
857
858         18.4 Send Alert Text.
859         https://w3c.github.io/webdriver/webdriver-spec.html#send-alert-text
860
861         This fixes selenium test testSettingTheValueOfAnAlertThrows.
862
863         * UIProcess/API/APIAutomationSessionClient.h:
864         (API::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage):
865         * UIProcess/API/glib/WebKitAutomationSession.cpp:
866         * UIProcess/API/glib/WebKitWebView.cpp:
867         (webkitWebViewGetCurrentScriptDialogType):
868         * UIProcess/API/glib/WebKitWebViewPrivate.h:
869         * UIProcess/Automation/Automation.json:
870         * UIProcess/Automation/WebAutomationSession.cpp:
871         (WebKit::WebAutomationSession::setUserInputForCurrentJavaScriptPrompt):
872         * UIProcess/Cocoa/AutomationSessionClient.h:
873         * UIProcess/Cocoa/AutomationSessionClient.mm:
874         (WebKit::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage):
875
876 2017-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>
877
878         [iOS WK2] WKWebView schedules nonstop layout after pressing cmb+b,i,u inside a contenteditable div
879         https://bugs.webkit.org/show_bug.cgi?id=175116
880         <rdar://problem/28279301>
881
882         Reviewed by Darin Adler and Ryosuke Niwa.
883
884         Refactors WebPage::editorState to only use the StyleProperties derived from EditingStyle, instead of inserting
885         and removing a temporary node to figure out the style. Also adds hooks to notify the UI delegate of EditorState
886         changes.
887
888         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
889         * UIProcess/API/Cocoa/WKWebView.mm:
890         (nsTextAlignment):
891         (dictionaryRepresentationForEditorState):
892         (-[WKWebView _didChangeEditorState]):
893
894         Alerts the private UI delegate of UI-side EditorState updates.
895
896         (-[WKWebView _web_editorStateDidChange]):
897         (-[WKWebView _executeEditCommand:argument:completion:]):
898         * UIProcess/API/Cocoa/WKWebViewInternal.h:
899         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
900         * UIProcess/API/mac/WKView.mm:
901         (-[WKView _web_editorStateDidChange]):
902         * UIProcess/Cocoa/WebViewImpl.h:
903         * UIProcess/Cocoa/WebViewImpl.mm:
904         (WebKit::WebViewImpl::selectionDidChange):
905         * UIProcess/WebPageProxy.cpp:
906         (WebKit::WebPageProxy::executeEditCommand):
907
908         Change executeEditCommand(name, callback) to executeEditCommand(name, argument, callback) and lift out of iOS
909         platform code and into WebPage.cpp.
910
911         * UIProcess/WebPageProxy.h:
912         * UIProcess/ios/WKContentViewInteraction.mm:
913         (-[WKContentView executeEditCommandWithCallback:]):
914         (-[WKContentView _selectionChanged]):
915         * UIProcess/ios/WebPageProxyIOS.mm:
916         (WebKit::WebPageProxy::executeEditCommand): Deleted.
917
918         Move the iOS-specific implementation of executeEditCommand that invokes a callback when the web process responds
919         out of WebPageProxyIOS, and into cross-platform WebPageProxy code. Additionally, add a parameter for the edit
920         command's argument.
921
922         * WebProcess/WebPage/WebPage.cpp:
923         (WebKit::WebPage::editorState const):
924
925         Use EditingStyle::styleAtSelectionStart instead of Editor::styleForSelectionStart when computing an EditorState.
926         Tweak bold, italic and underline to use EditingStyle TriStates.
927
928         (WebKit::shouldEnsureEditorStateUpdateAfterExecutingCommand):
929         (WebKit::WebPage::executeEditCommandWithCallback):
930         * WebProcess/WebPage/WebPage.h:
931         * WebProcess/WebPage/WebPage.messages.in:
932         * WebProcess/WebPage/ios/WebPageIOS.mm:
933         (WebKit::WebPage::executeEditCommandWithCallback): Deleted.
934
935 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
936
937         [TexMap] Don't expose GraphicsContext3D object
938         https://bugs.webkit.org/show_bug.cgi?id=175310
939
940         Reviewed by Carlos Garcia Campos.
941
942         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
943         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
944         Stop using GraphicsContext3D directly and instead use the
945         TextureMapper::clearColor() method to achieve the same result.
946
947 2017-08-07  Carlos Garcia Campos  <cgarcia@igalia.com>
948
949         [GTK] Implement JavaScript dialog methods of API::AutomationSessionClient
950         https://bugs.webkit.org/show_bug.cgi?id=175259
951
952         Reviewed by Michael Catanzaro.
953
954         Move the default implementation of WebKitScriptDialog from WebKitWebView platform specific files to their own
955         files. Implement all JavaScript dialog methods of API::AutomationSessionClient in WebKitAutomationSession. For
956         now it only works when the user doesn't override WebKitWebView::script-dialog signal and default implementation
957         is used.
958
959         * PlatformGTK.cmake: Add new files to compilation.
960         * PlatformWPE.cmake: Ditto.
961         * UIProcess/API/glib/WebKitAutomationSession.cpp:
962         (webkitAutomationSessionCreate): Pass the WebKitWebContext to the constructor and keep a pointer to it in session.
963         * UIProcess/API/glib/WebKitAutomationSessionPrivate.h:
964         * UIProcess/API/glib/WebKitScriptDialogPrivate.h:
965         * UIProcess/API/glib/WebKitWebContext.cpp:
966         * UIProcess/API/glib/WebKitWebView.cpp:
967         (webkitWebViewRunJavaScriptAlert): Set the currently script dialog for the scope of the function.
968         (webkitWebViewRunJavaScriptConfirm): Ditto.
969         (webkitWebViewRunJavaScriptPrompt): Ditto.
970         (webkitWebViewRunJavaScriptBeforeUnloadConfirm): Ditto.
971         (webkitWebViewIsShowingScriptDialog): Ask current dialog if there's one.
972         (webkitWebViewGetCurrentScriptDialogMessage): Ditto.
973         (webkitWebViewSetCurrentScriptDialogUserInput): Ditto.
974         (webkitWebViewAcceptCurrentScriptDialog): Ditto.
975         (webkitWebViewDismissCurrentScriptDialog): Ditto.
976         * UIProcess/API/glib/WebKitWebViewPrivate.h:
977         * UIProcess/API/gtk/WebKitScriptDialogGtk.cpp: Added.
978         (webkitWebViewCreateJavaScriptDialog): Moved from WebKitWebViewGtk.cpp.
979         (webkitScriptDialogRun): Run the dialog, this code is moved from WebKitWebViewGtk.cpp.
980         (webkitScriptDialogIsRunning): Return true if the script dialog has a native dialog running.
981         (webkitScriptDialogAccept): Send Ok or Close response to the native dialog depending on the dialog type.
982         (webkitScriptDialogDismiss): Send Close response to the native dialog.
983         (webkitScriptDialogSetUserInput): Set the given text on the prompt dialog entry.
984         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
985         (webkitWebViewScriptDialog): Simply call webkitScriptDialogRun() now.
986         * UIProcess/API/wpe/WebKitScriptDialogWPE.cpp: Copied from Source/WebKit/UIProcess/API/glib/WebKitAutomationSessionPrivate.h.
987         (webkitScriptDialogRun):
988         (webkitScriptDialogIsRunning):
989         (webkitScriptDialogAccept):
990         (webkitScriptDialogDismiss):
991         (webkitScriptDialogSetUserInput):
992
993 2017-08-07  Devin Rousso  <drousso@apple.com>
994
995         Web Inspector: Preview Canvas path when viewing a recording
996         https://bugs.webkit.org/show_bug.cgi?id=174967
997
998         Reviewed by Brian Burg.
999
1000         * Shared/WebPreferencesDefinitions.h:
1001         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1002         * UIProcess/API/C/WKPreferences.cpp:
1003         (WKPreferencesSetInspectorAdditionsEnabled):
1004         (WKPreferencesGetInspectorAdditionsEnabled):
1005         * WebProcess/WebPage/WebPage.cpp:
1006         (WebKit::WebPage::updatePreferences):
1007         Add plumbing for new InspectorAdditions runtime flag.
1008
1009         * WebProcess/WebPage/WebInspectorUI.cpp:
1010         (WebKit::WebInspectorUI::WebInspectorUI):
1011         Enable InspectorAdditions by default in the WebInspector page.
1012
1013 2017-08-07  Filip Pizlo  <fpizlo@apple.com>
1014
1015         Baseline JIT should do caging
1016         https://bugs.webkit.org/show_bug.cgi?id=175037
1017
1018         Reviewed by Mark Lam.
1019         
1020         Use a better API to disable disabling the primitive gigacage.
1021
1022         * WebProcess/WebProcess.cpp:
1023         (WebKit::m_webSQLiteDatabaseTracker):
1024         (WebKit::primitiveGigacageDisabled): Deleted.
1025
1026 2017-08-06  Filip Pizlo  <fpizlo@apple.com>
1027
1028         Primitive auxiliaries and JSValue auxiliaries should have separate gigacages
1029         https://bugs.webkit.org/show_bug.cgi?id=174919
1030
1031         Reviewed by Keith Miller.
1032         
1033         The disable callback is all about the primitive gigacage.
1034
1035         * WebProcess/WebProcess.cpp:
1036         (WebKit::primitiveGigacageDisabled):
1037         (WebKit::m_webSQLiteDatabaseTracker):
1038         (WebKit::gigacageDisabled): Deleted.
1039
1040 2017-08-07  Brian Burg  <bburg@apple.com>
1041
1042         Remove CANVAS_PATH compilation guard
1043         https://bugs.webkit.org/show_bug.cgi?id=175207
1044
1045         Reviewed by Sam Weinig.
1046
1047         * Configurations/FeatureDefines.xcconfig:
1048
1049 2017-08-07  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1050
1051         [WPE][CMake] Only pass pkg-config CFLAGS from (E)GL when not using libepoxy.
1052         https://bugs.webkit.org/show_bug.cgi?id=175125
1053
1054         Reviewed by Michael Catanzaro.
1055
1056         * CMakeLists.txt: When using libepoxy avoid passing the CFLAGS from (E)GL,
1057         and instead pass the libepoxy ones.
1058
1059 2017-08-07  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1060
1061         [GTK][WPE] CFLAGS from pkg-config for (E)GL are not passed to WebKit
1062         https://bugs.webkit.org/show_bug.cgi?id=175125
1063
1064         Unreviewed follow-up fix after r220326.
1065
1066         * CMakeLists.txt: Move the block appending to WebKit2_LIBRARIES
1067         below where the list itself is created.
1068
1069 2017-08-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1070
1071         [GTK][WPE] Add API to provide browser information required by automation
1072         https://bugs.webkit.org/show_bug.cgi?id=175130
1073
1074         Reviewed by Michael Catanzaro.
1075
1076         When a new automation session is started, the web driver receives some required capabilities from the client,
1077         like browser name and version. The session should be rejected if those required capabilities don't match with
1078         the actual browser that is launched. We don't know that information in WebKit, so we need to add API so that
1079         users can provide it when a new session request is made. This patch adds boxed object WebKitApplicationInfo that
1080         can be used to set the application name and version. This object can be set to a WebKitAutomationSession when
1081         WebKitWebContext::automation-started signal is emitted.
1082
1083         * PlatformGTK.cmake:
1084         * PlatformWPE.cmake:
1085         * UIProcess/API/glib/WebKitApplicationInfo.cpp: Added.
1086         (webkit_application_info_new):
1087         (webkit_application_info_ref):
1088         (webkit_application_info_unref):
1089         (webkit_application_info_set_name):
1090         (webkit_application_info_get_name):
1091         (webkit_application_info_set_version):
1092         (webkit_application_info_get_version):
1093         * UIProcess/API/glib/WebKitAutomationSession.cpp:
1094         (webkitAutomationSessionDispose):
1095         (webkit_automation_session_class_init):
1096         (webkitAutomationSessionGetBrowserName):
1097         (webkitAutomationSessionGetBrowserVersion):
1098         (webkit_automation_session_set_application_info):
1099         (webkit_automation_session_get_application_info):
1100         * UIProcess/API/glib/WebKitAutomationSessionPrivate.h:
1101         * UIProcess/API/glib/WebKitWebContext.cpp:
1102         * UIProcess/API/gtk/WebKitApplicationInfo.h: Added.
1103         * UIProcess/API/gtk/WebKitAutomationSession.h:
1104         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1105         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
1106         * UIProcess/API/gtk/webkit2.h:
1107         * UIProcess/API/wpe/WebKitApplicationInfo.h: Added.
1108         * UIProcess/API/wpe/WebKitAutomationSession.h:
1109         * UIProcess/API/wpe/webkit.h:
1110
1111 2017-08-06  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1112
1113         [GTK][WPE] CFLAGS from pkg-config for (E)GL are not passed to WebKit
1114         https://bugs.webkit.org/show_bug.cgi?id=175125
1115
1116         Reviewed by Michael Catanzaro.
1117
1118         Some platforms define cflags on the (E)GL pkg-config files that we
1119         need to pass to the build system when including the (E)GL headers.
1120         And we are already doing this when building WebCore (after r184954).
1121
1122         But now we need to do this also on WebKit (former WebKit2) because
1123         we include (E)GL headers (and make use of them) on the UIProcess.
1124
1125         * CMakeLists.txt:
1126
1127 2017-08-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1128
1129         WebDriver: Implement page load strategy
1130         https://bugs.webkit.org/show_bug.cgi?id=175183
1131
1132         Reviewed by Brian Burg.
1133
1134         Split pending navigation maps into normal and eager, and use one or the other depending on the received page
1135         load strategy. We need to keep different maps for every page load strategy because every command could use a
1136         different strategy.
1137
1138         * UIProcess/Automation/WebAutomationSession.cpp:
1139         (WebKit::WebAutomationSession::waitForNavigationToComplete): Extract page load strategy from parameter and pass
1140         it to waitForNavigationToCompleteOnPage() and waitForNavigationToCompleteOnFrame().
1141         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage): Return early if page load strategy is
1142         none. Otherwise at the pening callback to the normal or eager map depeding on the page load straegy.
1143         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame): Ditto.
1144         (WebKit::respondToPendingNavigationCallbacksWithTimeout): Helper to send pening navigation callback in case of
1145         timeout failure.
1146         (WebKit::WebAutomationSession::loadTimerFired): Call finishPendingNavigationsWithTimeoutFailure() with all the maps.
1147         (WebKit::WebAutomationSession::navigateBrowsingContext): Extract page load strategy from parameter and pass it
1148         to waitForNavigationToCompleteOnPage().
1149         (WebKit::WebAutomationSession::goBackInBrowsingContext): Ditto.
1150         (WebKit::WebAutomationSession::goForwardInBrowsingContext): Ditto.
1151         (WebKit::WebAutomationSession::reloadBrowsingContext): Ditto.
1152         (WebKit::WebAutomationSession::navigationOccurredForFrame): Use the normal maps.
1153         (WebKit::WebAutomationSession::documentLoadedForFrame): Stop timeout timer and dispatch eager pending navigations.
1154         * UIProcess/Automation/WebAutomationSession.h:
1155         * UIProcess/WebPageProxy.cpp:
1156         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame): Notify the automation session.
1157
1158 2017-08-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1159
1160         WebDriver: use in-view center point for clicks instead of bounding box center point
1161         https://bugs.webkit.org/show_bug.cgi?id=174863
1162
1163         Reviewed by Simon Fraser.
1164
1165         Change computeElementLayout to also return the in-view center point and whether it's obscured by another
1166         element.
1167
1168         * UIProcess/Automation/Automation.json: Add optional inViewCenterPoint to the result and isObscured.
1169         * UIProcess/Automation/WebAutomationSession.cpp:
1170         (WebKit::WebAutomationSession::didComputeElementLayout): Handle inViewCenterPoint and isObscured.
1171         * UIProcess/Automation/WebAutomationSession.h:
1172         * UIProcess/Automation/WebAutomationSession.messages.in:
1173         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1174         (WebKit::elementInViewClientCenterPoint): Get the client in-view center point and whether it's obscured
1175         according to the spec.
1176         (WebKit::WebAutomationSessionProxy::computeElementLayout): Pass inViewCenterPoint and isObscured to
1177         DidComputeElementLayout message.
1178
1179 2017-08-05  Brian Burg  <bburg@apple.com>
1180
1181         Web Automation: files selected for upload should be matched against 'accept' attribute values case-insensitively
1182         https://bugs.webkit.org/show_bug.cgi?id=175191
1183         <rdar://problem/33725790>
1184
1185         Reviewed by Carlos Garcia Campos.
1186
1187         Values of the "accept" attribute are to be compared in a case-insensitive manner, per
1188         https://html.spec.whatwg.org/multipage/input.html#file-upload-state-(type=file)
1189
1190         Except for converting MIME types and extensions to lowercase, most of these changes
1191         were lost in a rebase prior to landing the patch.
1192
1193         * UIProcess/Automation/WebAutomationSession.cpp:
1194         (WebKit::fileCanBeAcceptedForUpload): Fix some issues:
1195         - Handle a file ending in a period.
1196         - Handle MIME type inference failing.
1197         - Convert extensions and MIMEs to lower case, per specification.
1198
1199         (WebKit::WebAutomationSession::handleRunOpenPanel):
1200         - Strip the leading period from file extensions.
1201         - These range converters crash unless the API::Array is retained by a local variable.
1202
1203 2017-08-04  Youenn Fablet  <youenn@apple.com>
1204
1205         [Cache API] Add Cache and CacheStorage IDL definitions
1206         https://bugs.webkit.org/show_bug.cgi?id=175201
1207
1208         Reviewed by Brady Eidson.
1209
1210         * Shared/WebPreferencesDefinitions.h:
1211         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1212         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1213         * WebProcess/WebPage/WebPage.cpp:
1214         (WebKit::WebPage::updatePreferences):
1215
1216 2017-08-04  Brian Burg  <bburg@apple.com>
1217
1218         Expose WKPreferences SPI for toggling mock capture devices prompt
1219         https://bugs.webkit.org/show_bug.cgi?id=175227
1220         <rdar://problem/33734528>
1221
1222         Reviewed by Youenn Fablet.
1223
1224         * UIProcess/API/Cocoa/WKPreferences.mm:
1225         (-[WKPreferences _mockCaptureDevicesPromptEnabled]):
1226         (-[WKPreferences _setMockCaptureDevicesPromptEnabled:]):
1227         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1228
1229 2017-08-04  Brian Burg  <bburg@apple.com>
1230
1231         Fix typo in WKPreferences _iceCandidateFiltertingEnabled property
1232         https://bugs.webkit.org/show_bug.cgi?id=175224
1233
1234         Reviewed by Tim Horton.
1235
1236         * UIProcess/API/Cocoa/WKPreferences.mm:
1237         (-[WKPreferences _iceCandidateFilteringEnabled]):
1238         (-[WKPreferences _iceCandidateFiltertingEnabled]): Deleted.
1239         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1240
1241 2017-08-04  Chris Dumez  <cdumez@apple.com>
1242
1243         [Beacon] Update sendBeacon to use the CachedResourceLoader
1244         https://bugs.webkit.org/show_bug.cgi?id=175192
1245         <rdar://problem/33725923>
1246
1247         Reviewed by Youenn Fablet.
1248
1249         Deal with new Beacon CachedResource type.
1250
1251         * WebProcess/Network/WebLoaderStrategy.cpp:
1252         (WebKit::maximumBufferingTime):
1253
1254 2017-08-04  John Wilander  <wilander@apple.com>
1255
1256         Resource Load Statistics: Report user interaction immediately, but only when needed
1257         https://bugs.webkit.org/show_bug.cgi?id=175090
1258         <rdar://problem/33685546>
1259
1260         Reviewed by Chris Dumez.
1261
1262         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1263         (WKBundleClearResourceLoadStatistics):
1264             Test infrastructure. Ends up calling
1265             WebCore::ResourceLoadObserver::clearState().
1266         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1267
1268 2017-08-04  Matt Lewis  <jlewis3@apple.com>
1269
1270         Unreviewed, rolling out r220288.
1271
1272         This broke multiple builds.
1273
1274         Reverted changeset:
1275
1276         "Use MPAVRoutingController instead of deprecated versions."
1277         https://bugs.webkit.org/show_bug.cgi?id=175063
1278         http://trac.webkit.org/changeset/220288
1279
1280 2017-08-04  Jeremy Jones  <jeremyj@apple.com>
1281
1282         Use MPAVRoutingController instead of deprecated versions.
1283         https://bugs.webkit.org/show_bug.cgi?id=175063
1284         rdar://problem/33301230
1285
1286         Reviewed by Tim Horton.
1287
1288         Remove dependence on deprecated classes MPAVRoutingSheet and MPAudioVideoRoutingPopoverController.
1289
1290         * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
1291         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
1292         (-[WKAirPlayRoutePicker dealloc]):
1293         (-[WKAirPlayRoutePicker show:fromRect:]):
1294         (-[WKAirPlayRoutePicker popoverControllerDidDismissPopover:]): Deleted.
1295         (-[WKAirPlayRoutePicker _presentAirPlayPopoverAnimated:fromRect:]): Deleted.
1296         (-[WKAirPlayRoutePicker _windowWillRotate:]): Deleted.
1297         (-[WKAirPlayRoutePicker _windowDidRotate:]): Deleted.
1298         (-[WKAirPlayRoutePicker _dismissAirPlayRoutePickerIPad]): Deleted.
1299         (-[WKAirPlayRoutePicker showAirPlayPickerIPad:fromRect:]): Deleted.
1300         (-[WKAirPlayRoutePicker showAirPlayPickerIPhone:]): Deleted.
1301
1302 2017-08-04  Tim Horton  <timothy_horton@apple.com>
1303
1304         viewport-fit changes during animated resize can cause layout size to get stuck
1305         https://bugs.webkit.org/show_bug.cgi?id=175169
1306         <rdar://problem/33684697>
1307
1308         Reviewed by Simon Fraser.
1309
1310         If we get a commit that changes viewport-fit state while an animated
1311         resize is underway, and that change causes the client to push a new
1312         minimumLayoutSizeOverride, the new size will be lost forever, and we
1313         will get stuck laying out at the wrong size.
1314
1315         This is because we unconditionally apply avoidsUnsafeArea for every commit,
1316         while most other changes that come in from a commit are ignored if we're
1317         inside animated resize. To fix, also ignore avoidsUnsafeArea changes during
1318         animated resize, by moving the code that keeps track of it into WKWebView
1319         like all of the rest, and read it out of the commit in didCommitLayerTree
1320         *after* the animated-resize early-return.
1321
1322         Also, fix the associated layout tests by adding a missing assignment
1323         in _computedContentInset, which was broken in r220138.
1324
1325         * UIProcess/API/Cocoa/WKWebView.mm:
1326         (-[WKWebView _initializeWithConfiguration:]):
1327         (-[WKWebView _setHasCustomContentView:loadedMIMEType:]):
1328         (-[WKWebView _processDidExit]):
1329         (-[WKWebView _didCommitLayerTree:]):
1330         (-[WKWebView _setAvoidsUnsafeArea:]):
1331         (-[WKWebView _safeAreaShouldAffectObscuredInsets]):
1332         (-[WKWebView _didChangeAvoidsUnsafeArea:]): Deleted.
1333         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1334         * UIProcess/PageClient.h:
1335         * UIProcess/WebPageProxy.cpp:
1336         (WebKit::WebPageProxy::resetState):
1337         (WebKit::WebPageProxy::setAvoidsUnsafeArea): Deleted.
1338         * UIProcess/WebPageProxy.h:
1339         (WebKit::WebPageProxy::avoidsUnsafeArea const): Deleted.
1340         * UIProcess/ios/PageClientImplIOS.h:
1341         * UIProcess/ios/PageClientImplIOS.mm:
1342         (WebKit::PageClientImpl::didChangeAvoidsUnsafeArea): Deleted.
1343         * UIProcess/ios/WebPageProxyIOS.mm:
1344         (WebKit::WebPageProxy::didCommitLayerTree):
1345
1346 2017-08-04  Matt Lewis  <jlewis3@apple.com>
1347
1348         Unreviewed, rolling out r220271.
1349
1350         Rolling out due to Layout Test failing on iOS Simulator.
1351
1352         Reverted changeset:
1353
1354         "Remove STREAMS_API compilation guard"
1355         https://bugs.webkit.org/show_bug.cgi?id=175165
1356         http://trac.webkit.org/changeset/220271
1357
1358 2017-08-03  Sam Weinig  <sam@webkit.org>
1359
1360         [Cleanup] Remove ScriptGlobalObject
1361         https://bugs.webkit.org/show_bug.cgi?id=175173
1362
1363         Reviewed by Darin Adler.
1364
1365         * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
1366         (WebKit::RemoteWebInspectorUI::windowObjectCleared):
1367         * WebProcess/WebPage/WebInspectorUI.cpp:
1368         (WebKit::WebInspectorUI::windowObjectCleared):
1369         Remove call to ScriptGlobalObject::set and use addSelfToGlobalObjectInWorld instead.
1370
1371 2017-08-03  Brian Burg  <bburg@apple.com>
1372
1373         [Cocoa] Web Automation: copy JavaScript atoms to WebKit.framework private headers
1374         https://bugs.webkit.org/show_bug.cgi?id=175088
1375         <rdar://problem/33685818>
1376
1377         Reviewed by Joseph Pecoraro.
1378
1379         * WebKit.xcodeproj/project.pbxproj:
1380         - Add a Copy Files phase to WebKit.framework.
1381         - Copy atoms to the atoms/ directory in WebKit.framework/PrivateHeaders/.
1382
1383 2017-08-04  Ryan Haddad  <ryanhaddad@apple.com>
1384
1385         Unreviewed, rolling out r220268.
1386
1387         This change caused assertion failures on macOS and iOS Debug
1388         WK2.
1389
1390         Reverted changeset:
1391
1392         "Resource Load Statistics: Report user interaction
1393         immediately, but only when needed"
1394         https://bugs.webkit.org/show_bug.cgi?id=175090
1395         http://trac.webkit.org/changeset/220268
1396
1397 2017-08-04  Andreas Kling  <akling@apple.com>
1398
1399         NetworkLoad should always invoke its redirect completion handler
1400         https://bugs.webkit.org/show_bug.cgi?id=175179
1401         <rdar://problem/33464999>
1402
1403         Reviewed by Chris Dumez.
1404
1405         Make sure the redirect completion handler is always invoked,
1406         just like we already did for the response completion handler.
1407
1408         * NetworkProcess/NetworkLoad.cpp:
1409         (WebKit::NetworkLoad::~NetworkLoad):
1410
1411 2017-08-04  Youenn Fablet  <youenn@apple.com>
1412
1413         Remove STREAMS_API compilation guard
1414         https://bugs.webkit.org/show_bug.cgi?id=175165
1415
1416         Reviewed by Darin Adler.
1417
1418         * Configurations/FeatureDefines.xcconfig:
1419         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1420         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1421
1422 2017-08-04  Brady Eidson  <beidson@apple.com>
1423
1424         Enable ServiceWorkers at runtime for WebKitTestRunner.
1425         https://bugs.webkit.org/show_bug.cgi?id=175174
1426
1427         Reviewed by Youenn Fablet.
1428
1429         * UIProcess/WebPreferences.cpp:
1430         (WebKit::WebPreferences::enableAllExperimentalFeatures):
1431
1432 2017-08-04  John Wilander  <wilander@apple.com>
1433
1434         Resource Load Statistics: Report user interaction immediately, but only when needed
1435         https://bugs.webkit.org/show_bug.cgi?id=175090
1436         <rdar://problem/33685546>
1437
1438         Reviewed by Chris Dumez.
1439
1440         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1441         (WKBundleClearResourceLoadStatistics):
1442             Test infrastructure. Ends up calling
1443             WebCore::ResourceLoadObserver::clearState().
1444         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1445
1446 2017-08-04  Antti Koivisto  <antti@apple.com>
1447
1448         Network cache should be usable as non-singleton
1449         https://bugs.webkit.org/show_bug.cgi?id=175139
1450
1451         Reviewed by Sam Weinig.
1452
1453         We might want to use it as a non-singleton in the future (for example as a backend for the cache API).
1454
1455         This patch makes NetworkCache::Cache and NetworkCache::Storage refcounted objects and takes
1456         care to ref them properly during asynchronous operations.
1457
1458         The patch doesn't actually create any non-shared instances, it just adds the capability.
1459
1460         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1461         (WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache):
1462         * NetworkProcess/NetworkProcess.cpp:
1463         (WebKit::fetchDiskCacheEntries):
1464         (WebKit::clearDiskCacheEntries):
1465         (WebKit::NetworkProcess::setCacheModel):
1466         * NetworkProcess/NetworkProcess.h:
1467         (WebKit::NetworkProcess::cache):
1468
1469             Move the shared cache instance to the network process singleton.
1470
1471         * NetworkProcess/NetworkResourceLoader.cpp:
1472         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
1473
1474             Include shared cache as a reffed member for non-ephemeral instances.
1475
1476         (WebKit::NetworkResourceLoader::canUseCache const):
1477         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
1478         (WebKit::NetworkResourceLoader::abort):
1479         (WebKit::NetworkResourceLoader::didReceiveResponse):
1480         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
1481         (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
1482         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
1483         * NetworkProcess/NetworkResourceLoader.h:
1484         * NetworkProcess/cache/NetworkCache.cpp:
1485         (WebKit::NetworkCache::Cache::open):
1486
1487             Open now returns null if it fails.
1488             Add RegisterNotify option to set up notify trigger for the shared instance.
1489
1490         (WebKit::NetworkCache::Cache::Cache):
1491         (WebKit::NetworkCache::Cache::~Cache):
1492
1493             Add destructor.
1494
1495         (WebKit::NetworkCache::dumpFileChanged):
1496         (WebKit::NetworkCache::Cache::setCapacity):
1497         (WebKit::NetworkCache::Cache::retrieve):
1498
1499             Protect the cache instance during asynchronous operations.
1500
1501         (WebKit::NetworkCache::Cache::store):
1502         (WebKit::NetworkCache::Cache::storeRedirect):
1503         (WebKit::NetworkCache::Cache::remove):
1504         (WebKit::NetworkCache::Cache::traverse):
1505         (WebKit::NetworkCache::Cache::dumpContentsToFile):
1506         (WebKit::NetworkCache::Cache::clear):
1507         (WebKit::NetworkCache::Cache::recordsPath const):
1508         (WebKit::NetworkCache::Cache::retrieveData):
1509         (WebKit::NetworkCache::Cache::storeData):
1510         (WebKit::NetworkCache::singleton): Deleted.
1511         (WebKit::NetworkCache::Cache::initialize): Deleted.
1512         * NetworkProcess/cache/NetworkCache.h:
1513         (WebKit::NetworkCache::Cache::canUseSharedMemoryForBodyData const):
1514         (WebKit::NetworkCache::Cache::isEnabled const): Deleted.
1515
1516             Remove isEnabled() state as a cache object now always represents an enabled cache.
1517
1518         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1519         (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord const):
1520         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1521         (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
1522         (WebKit::NetworkCache::SpeculativeLoad::didReceiveResponse):
1523         (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
1524         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
1525         (WebKit::NetworkCache::Statistics::initialize):
1526         (WebKit::NetworkCache::Statistics::shrinkIfNeeded):
1527         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1528         (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation):
1529         (WebKit::NetworkCache::Storage::WriteOperation::WriteOperation):
1530         (WebKit::NetworkCache::Storage::TraverseOperation::TraverseOperation):
1531
1532             Operations now ref the storage. They are already deleted in the main thread so
1533             proper destruction is taken care of.
1534
1535         (WebKit::NetworkCache::Storage::open):
1536         (WebKit::NetworkCache::Storage::~Storage):
1537         (WebKit::NetworkCache::Storage::synchronize):
1538
1539             This and other asynchronous methods now protect the Storage instance.
1540
1541         (WebKit::NetworkCache::Storage::remove):
1542         (WebKit::NetworkCache::Storage::retrieve):
1543         (WebKit::NetworkCache::Storage::store):
1544         (WebKit::NetworkCache::Storage::traverse):
1545         (WebKit::NetworkCache::Storage::clear):
1546         (WebKit::NetworkCache::Storage::shrink):
1547         (WebKit::NetworkCache::Storage::deleteOldVersions):
1548         * NetworkProcess/cache/NetworkCacheStorage.h:
1549         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1550         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1551         (WebKit::NetworkProcess::clearDiskCache):
1552         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1553         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1554         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1555         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
1556         (WebKit::NetworkProcess::clearDiskCache):
1557
1558 2017-08-04  Frederic Wang  <fwang@igalia.com>
1559
1560         ScrollingTreeOverflowScrollingNodeIOS uses the wrong fixed position rectangle
1561         https://bugs.webkit.org/show_bug.cgi?id=175135
1562
1563         Reviewed by Simon Fraser.
1564
1565         This patch modifies ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll so
1566         that it uses the fixed position rectangle relative of the first frame ancestor instead of
1567         the one of the main frame. This makes it consistent with ScrollingTreeFrameScrollingNodeIOS
1568         and RenderLayerCompositor. This fixes some flickering issues on iOS.
1569
1570         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1571         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll): Use the fixed
1572         position rect of a non-main frame if there is one.
1573
1574 2017-08-03  Brian Burg  <bburg@apple.com>
1575
1576         Remove ENABLE(WEB_SOCKET) guards
1577         https://bugs.webkit.org/show_bug.cgi?id=167044
1578
1579         Reviewed by Joseph Pecoraro.
1580
1581         * Configurations/FeatureDefines.xcconfig:
1582         * WebProcess/Network/WebSocketProvider.cpp:
1583         * WebProcess/Network/WebSocketProvider.h:
1584
1585 2017-08-03  Chris Dumez  <cdumez@apple.com>
1586
1587         Multiple Layout tests from web-platform-tests/beacon/ are timing out.
1588         https://bugs.webkit.org/show_bug.cgi?id=175076
1589         <rdar://problem/33704752>
1590
1591         Reviewed by Alexey Proskuryakov.
1592
1593         * NetworkProcess/NetworkLoad.cpp:
1594         (WebKit::NetworkLoad::completeAuthenticationChallenge):
1595         In the NETWORK_SESSION code path, we did not ask the client about server trust evaluation
1596         when the clientCredentialPolicy was CannotAskClientForCredentials. This is because the
1597         same delegate is used for HTTP authentication and server trust evaluation in the
1598         NETWORK_SESSION code path. To align both code paths, we now ask the client about server
1599         trust evaluation even if the policy CannotAskClientForCredentials. This allows WKTR
1600         to trust certificates for localhost / 127.0.0.1 unconditionally and consistently.
1601
1602 2017-08-03  Yoshiaki Jitsukawa  <jitsu@rd.scei.sony.co.jp>
1603
1604         [PAL] Move spi/cf directory into PAL
1605         https://bugs.webkit.org/show_bug.cgi?id=175057
1606
1607         Reviewed by Antti Koivisto.
1608
1609         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1610         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1611         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1612         * NetworkProcess/ios/NetworkProcessIOS.mm:
1613         * NetworkProcess/mac/NetworkLoadMac.mm:
1614         * NetworkProcess/mac/NetworkProcessMac.mm:
1615         * Shared/cf/CookieStorageUtilsCF.h:
1616         * Shared/mac/ChildProcessMac.mm:
1617         * Shared/mac/CookieStorageShim.mm:
1618         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
1619         * UIProcess/API/Cocoa/WKProcessPool.mm:
1620         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1621         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1622         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1623         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
1624         * UIProcess/WebsiteData/WebsiteDataStore.h:
1625         * UIProcess/mac/WebCookieManagerProxyMac.mm:
1626         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
1627         * WebProcess/cocoa/WebProcessCocoa.mm:
1628
1629 2017-08-03  Youenn Fablet  <youenn@apple.com>
1630
1631         Remove FETCH_API compilation guard
1632         https://bugs.webkit.org/show_bug.cgi?id=175154
1633
1634         Reviewed by Chris Dumez.
1635
1636         * Configurations/FeatureDefines.xcconfig:
1637         * WebProcess/WebPage/WebPage.cpp:
1638         (WebKit::WebPage::updatePreferences):
1639
1640 2017-08-03  Matt Lewis  <jlewis3@apple.com>
1641
1642         Unreviewed, rolling out r220209.
1643
1644         This caused internal build failures.
1645
1646         Reverted changeset:
1647
1648         "Use MPAVRoutingController instead of deprecated versions."
1649         https://bugs.webkit.org/show_bug.cgi?id=175063
1650         http://trac.webkit.org/changeset/220209
1651
1652 2017-08-02  Brian Burg  <bburg@apple.com>
1653
1654         Web Automation: consider file extensions in the "accept" attribute when deciding if a file can be uploaded
1655         https://bugs.webkit.org/show_bug.cgi?id=175081
1656
1657         Reviewed by Joseph Pecoraro.
1658
1659         * UIProcess/Automation/WebAutomationSession.cpp:
1660         (WebKit::fileCanBeAcceptedForUpload):
1661         (WebKit::WebAutomationSession::handleRunOpenPanel):
1662         In cases where a file has an extension, try to match it against the
1663         accepted extensions list. Give up if there's no extension. Otherwise,
1664         proceed as normal to infer a MIME type based on the extension.
1665         In cases where extension-less files are inside hidden folders, the MIME
1666         inference will fail as well.
1667
1668 2017-08-03  Brady Eidson  <beidson@apple.com>
1669
1670         Add SW IDLs and stub out basic functionality.
1671         https://bugs.webkit.org/show_bug.cgi?id=175115
1672
1673         Reviewed by Chris Dumez.
1674
1675         * Configurations/FeatureDefines.xcconfig:
1676         
1677         * Shared/WebPreferencesDefinitions.h:
1678         
1679         * UIProcess/WebPreferences.cpp:
1680         (WebKit::WebPreferences::enableAllExperimentalFeatures): Explicitly skip SW for now.
1681           The ramifications to layouttests are complicated, and we'd like to follow up in a
1682           separate patch.
1683         
1684         * WebProcess/WebPage/WebPage.cpp:
1685         (WebKit::WebPage::updatePreferences):
1686
1687 2017-08-03  Yoshiaki Jitsukawa  <jitsu@rd.scei.sony.co.jp>
1688
1689         [WebKit] Sort Xcode project file
1690         https://bugs.webkit.org/show_bug.cgi?id=175122
1691
1692         Reviewed by Antti Koivisto.
1693
1694         * WebKit.xcodeproj/project.pbxproj:
1695
1696 2017-08-02  Sam Weinig  <sam@webkit.org>
1697
1698         [WebIDL] Convert MutationCallback to be a normal generated callback
1699         https://bugs.webkit.org/show_bug.cgi?id=174140
1700
1701         Reviewed by Darin Adler.
1702
1703         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
1704         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.cpp:
1705         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilterPrivate.h:
1706         Pass, now necessary, Document to NativeNodeFilter constructor.
1707
1708 2017-08-03  Jeremy Jones  <jeremyj@apple.com>
1709
1710         Use MPAVRoutingController instead of deprecated versions.
1711         https://bugs.webkit.org/show_bug.cgi?id=175063
1712         rdar://problem/33301230
1713
1714         Reviewed by Tim Horton.
1715
1716         Remove dependence on deprecated classes MPAVRoutingSheet and MPAudioVideoRoutingPopoverController.
1717
1718         * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
1719         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
1720         (-[WKAirPlayRoutePicker dealloc]):
1721         (-[WKAirPlayRoutePicker show:fromRect:]):
1722         (-[WKAirPlayRoutePicker popoverControllerDidDismissPopover:]): Deleted.
1723         (-[WKAirPlayRoutePicker _presentAirPlayPopoverAnimated:fromRect:]): Deleted.
1724         (-[WKAirPlayRoutePicker _windowWillRotate:]): Deleted.
1725         (-[WKAirPlayRoutePicker _windowDidRotate:]): Deleted.
1726         (-[WKAirPlayRoutePicker _dismissAirPlayRoutePickerIPad]): Deleted.
1727         (-[WKAirPlayRoutePicker showAirPlayPickerIPad:fromRect:]): Deleted.
1728         (-[WKAirPlayRoutePicker showAirPlayPickerIPhone:]): Deleted.
1729
1730 2017-08-03  Chris Dumez  <cdumez@apple.com>
1731
1732         Improve our support for referrer policies
1733         https://bugs.webkit.org/show_bug.cgi?id=175069
1734         <rdar://problem/33677313>
1735
1736         Reviewed by Darin Adler.
1737
1738         * WebProcess/Network/WebLoaderStrategy.cpp:
1739         (WebKit::WebLoaderStrategy::loadResource):
1740         (WebKit::WebLoaderStrategy::schedulePluginStreamLoad):
1741
1742 2017-08-02  Chris Dumez  <cdumez@apple.com>
1743
1744         NetworkResourceLoader::setDefersLoading() may cause start() to be called multiple times
1745         https://bugs.webkit.org/show_bug.cgi?id=175109
1746         <rdar://problem/33363169>
1747
1748         Reviewed by Brady Eidson.
1749
1750         If NetworkResourceLoader::setDefersLoading(false) is called by the client while m_networkLoad is null
1751         then we call NetworkResourceLoader::start() to start the load. This is needed in the case where
1752         a NetworkResourceLoader is constructed in deferred mode so that the load can later be started via
1753         setDefersLoading(). However, it is possible for setDefersLoading(false) to be called when start()
1754         has already been called, which causes start() to be called multiple times and leads to an assertion
1755         hit in debug.
1756
1757         Normally, setDefersLoading(false) returns without calling start() if m_networkLoad is not null. It
1758         relies on m_networkLoad being non-null to determine if start() should be called. This is bad because
1759         start() checks the disk cache asynchronously *before* calling startNetworkLoad() and initializing
1760         m_networkLoad. Therefore, if setDefersLoading(false) is called *while* we are checking the cache,
1761         then we will call incorrectly call start() again.
1762
1763         In the case of the radar, this happens when we:
1764         1. Call start() and check the disk cache
1765         2. Retrieve a cached redirect from the cache, which causes a WillSendRequest IPC to be sent to the
1766            WebProcess
1767         3. The WebProcess calls setDefersLoading(true), sends the ContinueWillSendRequest IPC back and
1768            then calls setDefersLoading(false)
1769
1770         The call to continueWillSendRequest() causes us to retrieve the redirected entry from the cache,
1771         asynchronously, which will return no entry and start a load.
1772         The later call to setDefersLoading(false) causes us to call start() again and we end up back to step 1.
1773
1774         * NetworkProcess/NetworkResourceLoader.cpp:
1775         (WebKit::NetworkResourceLoader::start):
1776         (WebKit::NetworkResourceLoader::setDefersLoading):
1777         * NetworkProcess/NetworkResourceLoader.h:
1778
1779 2017-08-02  Andreas Kling  <akling@apple.com>
1780
1781         NetworkRTCProvider::createResolver() leaks CFHost objects
1782         https://bugs.webkit.org/show_bug.cgi?id=175103
1783         <rdar://problem/33690347>
1784
1785         Reviewed by Youenn Fablet.
1786
1787         Add a missing adoptCF() so we don't leak the CFHost.
1788
1789         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
1790         (WebKit::NetworkRTCProvider::createResolver):
1791
1792 2017-08-02  Jeremy Jones  <jeremyj@apple.com>
1793
1794         Remove unused and obsolete setting mediaDocumentEntersFullscreenAutomatically
1795         https://bugs.webkit.org/show_bug.cgi?id=175080
1796
1797         Reviewed by Jon Lee.
1798
1799         This is obsolete because of the alternate solution in
1800         https://bugs.webkit.org/show_bug.cgi?id=174850
1801
1802         * Shared/WebPreferencesDefinitions.h:
1803         * UIProcess/API/Cocoa/WKPreferences.mm:
1804         (-[WKPreferences _setMediaDocumentEntersFullscreenAutomatically:]): Deleted.
1805         (-[WKPreferences _mediaDocumentEntersFullscreenAutomatically]): Deleted.
1806         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1807         * WebProcess/WebPage/WebPage.cpp:
1808         (WebKit::WebPage::updatePreferences):
1809
1810 2017-08-02  Filip Pizlo  <fpizlo@apple.com>
1811
1812         We should be OK with the gigacage being disabled on gmalloc
1813         https://bugs.webkit.org/show_bug.cgi?id=175082
1814
1815         Reviewed by Michael Saboff.
1816
1817         * WebProcess/WebProcess.cpp:
1818         (WebKit::m_webSQLiteDatabaseTracker):
1819
1820 2017-08-02  Brian Burg  <bburg@apple.com>
1821
1822         Web Automation: files selected for upload should be checked against values of the 'accept' attribute
1823         https://bugs.webkit.org/show_bug.cgi?id=174803
1824         <rdar://problem/33514190>
1825
1826         Reviewed by Carlos Garcia Campos.
1827
1828         Use the parsed values of the file input element's "accept" attribute to reject
1829         files that don't match the specified values. This is normally done by Safari
1830         using NSOpenPanel, but since a real open panel isn't shown during automation,
1831         it needs to be done here.
1832
1833         Support for limiting accepted files by file extensions will be added when the
1834         same is implemented in the normal code path for the C and Objective-C APIs.
1835
1836         This change is covered by internal WebDriver tests that will be rewritten for the
1837         public Webdriver W3C test suite someday, when safaridriver runs those tests itself.
1838
1839         * UIProcess/Automation/WebAutomationSession.cpp:
1840         (WebKit::WebAutomationSession::handleRunOpenPanel):
1841         Since we already have the proposed files, there's no need to compute a list of
1842         supported extensions based on wildcard MIME types. First check the extension,
1843         then the inferred MIME type for the extension, and then the wildcard MIME type
1844         if the inferred type is not an exact match.
1845
1846 2017-08-02  Tim Horton  <timothy_horton@apple.com>
1847
1848         WKPDFView doesn't respect safe area insets
1849         https://bugs.webkit.org/show_bug.cgi?id=175046
1850         <rdar://problem/33558386>
1851
1852         Reviewed by Wenson Hsieh.
1853
1854         * Platform/spi/ios/UIKitSPI.h:
1855         Add some SPI.
1856
1857         * UIProcess/API/Cocoa/WKWebView.mm:
1858         (-[WKWebView _setHasCustomContentView:loadedMIMEType:]):
1859         Drive-by fix two small custom content view issues:
1860
1861         - Reset _scrollViewBackgroundColor; it is used to early-return from
1862         updating the background color if it hasn't changed, but if you go from a
1863         site with (for example) a white background, to a PDF, to another site
1864         with a white background, we will early-return and not reset the background
1865         color from the grey WKPDFView background.
1866
1867         - When installing a custom content view, scroll to the origin. We miss
1868         the usual mechanism for scrolling to the origin when custom content views
1869         are installed, so do it here.
1870
1871         (-[WKWebView _effectiveObscuredInsetEdgesAffectedBySafeArea]):
1872         Ignore _obscuredInsetEdgesAffectedBySafeArea for custom content views.
1873         This is fairly arbitrary, and we should find a different way to
1874         express different edge sets for different kinds of content (perhaps
1875         bake this into default viewports?), but for now this works.
1876
1877         (-[WKWebView _computedContentInset]):
1878         Use _effectiveObscuredInsetEdgesAffectedBySafeArea instead of the ivar directly.
1879
1880         (-[WKWebView _safeAreaShouldAffectObscuredInsets]):
1881         Force safe areas to not affect obscured insets for custom content views,
1882         so that it's up to every custom content view to take safe areas into
1883         account themselves.
1884
1885         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1886         Expose _computedUnobscuredSafeAreaInset for WKPDFView's use.
1887
1888         * UIProcess/ios/WKPDFView.mm:
1889         (-[WKPDFView web_setMinimumSize:]):
1890         Avoid rebuilding the WKPDFView if the minimum size didn't change.
1891
1892         (-[WKPDFView _offsetForPageNumberIndicator]):
1893         Take unobscured safe area insets into account when insetting
1894         the page number indicator.
1895
1896         (-[WKPDFView web_computedContentInsetDidChange]):
1897         Watch for unobscured safe area inset changes, and apply them to the
1898         layout of the WKPDFView.
1899
1900         (-[WKPDFView _computePageAndDocumentFrames]):
1901         Make it possible to only update the WKPDFView's size and position, without
1902         rebuilding its subviews, if the width did not change. This prevents lots
1903         of flashing of the child UIPDFPageViews when the unobscured safe area
1904         insets change dynamically.
1905
1906         Take the safe area insets into account when determining what width
1907         to lay out to.
1908
1909         (-[WKPDFView _updateDocumentFrame]):
1910         Take the safe area insets into account when positioning the WKPDFView
1911         inside the WKScrollView.
1912
1913 2017-08-02  John Wilander  <wilander@apple.com>
1914
1915         ResourceLoadStatisticsClassifierCocoa::singletonPredictionModel() should check the return value of storagePath()
1916         https://bugs.webkit.org/show_bug.cgi?id=175055
1917         <rdar://problem/32671352>
1918
1919         Reviewed by David Kilzer.
1920
1921         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp:
1922         (WebKit::ResourceLoadStatisticsClassifierCocoa::singletonPredictionModel):
1923             Now uses dispatch_once() instead of NeverDestroyed and checks the
1924             return value of storagePath() before using it to load the model.
1925
1926 2017-08-01  Brian Burg  <bburg@apple.com>
1927
1928         HTML file input elements do not support file extensions in the "accept" attribute
1929         https://bugs.webkit.org/show_bug.cgi?id=95698
1930         <rdar://problem/12231850>
1931
1932         Reviewed by Darin Adler.
1933
1934         Plumb accepted file extensions out to the C API.
1935         The Cocoa API will be improved in a later patch.
1936
1937         * Shared/WebCoreArgumentCoders.cpp:
1938         (IPC::ArgumentCoder<FileChooserSettings>::encode):
1939         (IPC::ArgumentCoder<FileChooserSettings>::decode):
1940         * UIProcess/API/APIOpenPanelParameters.cpp:
1941         (API::OpenPanelParameters::acceptFileExtensions const):
1942         * UIProcess/API/APIOpenPanelParameters.h:
1943         * UIProcess/API/C/WKOpenPanelParametersRef.cpp:
1944         (WKOpenPanelParametersCopyAcceptedFileExtensions):
1945         * UIProcess/API/C/WKOpenPanelParametersRef.h:
1946
1947 2017-08-02  Fujii Hironori  <Hironori.Fujii@sony.com>
1948
1949         Use LazyNeverDestroyed instead of DEFINE_GLOBAL for QualifiedName
1950         https://bugs.webkit.org/show_bug.cgi?id=175010
1951         <rdar://problem/33647818>
1952
1953         Reviewed by Alex Christensen.
1954
1955         * UIProcess/API/APIContentRuleListStore.cpp:
1956         (API::ContentRuleListStore::compileContentRuleList):
1957         Call QualifiedName::init().
1958
1959 2017-08-01  Chris Dumez  <cdumez@apple.com>
1960
1961         Add initial support for navigator.sendBeacon
1962         https://bugs.webkit.org/show_bug.cgi?id=175007
1963         <rdar://problem/33547728>
1964
1965         Reviewed by Sam Weinig.
1966
1967         Add experimental feature flag for the Beacon API, disabled by default.
1968
1969         * Shared/WebPreferencesDefinitions.h:
1970         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1971         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1972         * WebProcess/WebPage/WebPage.cpp:
1973         (WebKit::WebPage::updatePreferences):
1974
1975 2017-08-01  Filip Pizlo  <fpizlo@apple.com>
1976
1977         Bmalloc and GC should put auxiliaries (butterflies, typed array backing stores) in a gigacage (separate multi-GB VM region)
1978         https://bugs.webkit.org/show_bug.cgi?id=174727
1979
1980         Reviewed by Mark Lam.
1981         
1982         The WebProcess should never disable the Gigacage by allocating typed arrays outside the Gigacage. So,
1983         we add a callback that crashes the process.
1984
1985         * WebProcess/WebProcess.cpp:
1986         (WebKit::gigacageDisabled):
1987         (WebKit::m_webSQLiteDatabaseTracker):
1988
1989 2017-08-01  Brian Burg  <bburg@apple.com>
1990
1991         Web Automation: add event to notify service when a page's main frame window object has cleared
1992         https://bugs.webkit.org/show_bug.cgi?id=174987
1993         <rdar://problem/36602634>
1994
1995         Reviewed by Carlos Garcia Campos.
1996
1997         * UIProcess/Automation/Automation.json: Add new event.
1998
1999         * UIProcess/Automation/WebAutomationSession.h:
2000         * UIProcess/Automation/WebAutomationSession.cpp:
2001         (WebKit::WebAutomationSession::navigationOccurredForFrame):
2002         (WebKit::WebAutomationSession::willClosePage):
2003         When a WebPage navigates or closes, send the browsingContextCleared event.
2004         Any element handles for elements in the browsing context are no longer valid.
2005
2006         * UIProcess/WebPageProxy.cpp:
2007         (WebKit::WebPageProxy::close):
2008         Add a new hook into the active automation session so it is notified when a page closes.
2009
2010 2017-08-01  Brady Eidson  <beidson@apple.com>
2011
2012         API test URLSchemeHandler.Exceptions is Exiting out early on macOS Debug..
2013         https://bugs.webkit.org/show_bug.cgi?id=175030
2014
2015         Reviewed by Andy Estes.
2016
2017         * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm:
2018         (WebKit::WebURLSchemeHandlerCocoa::platformTaskCompleted): Release the API wrapped on the next
2019           spin of the runloop.
2020
2021 2017-08-01  Brady Eidson  <beidson@apple.com>
2022
2023         Part 2 of: Rename DatabaseProcess to StorageProcess.
2024         https://bugs.webkit.org/show_bug.cgi?id=174880
2025
2026         Reviewed by Andy Estes.
2027
2028         Rename some more variables, classes, etc. to reflect the change.
2029
2030         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2031         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
2032
2033         * NetworkProcess/NetworkProcess.cpp:
2034         (WebKit::NetworkProcess::grantSandboxExtensionsToStorageProcessForBlobs):
2035         (WebKit::NetworkProcess::didGrantSandboxExtensionsToStorageProcessForBlobs):
2036         (WebKit::NetworkProcess::grantSandboxExtensionsToDatabaseProcessForBlobs): Deleted.
2037         (WebKit::NetworkProcess::didGrantSandboxExtensionsToDatabaseProcessForBlobs): Deleted.
2038         * NetworkProcess/NetworkProcess.h:
2039         * NetworkProcess/NetworkProcess.messages.in:
2040
2041         * Shared/ProcessExecutablePath.h:
2042         * Shared/gtk/ProcessExecutablePathGtk.cpp:
2043         (WebKit::executablePathOfStorageProcess):
2044         (WebKit::executablePathOfDatabaseProcess): Deleted.
2045         * Shared/wpe/ProcessExecutablePathWPE.cpp:
2046         (WebKit::executablePathOfStorageProcess):
2047         (WebKit::executablePathOfDatabaseProcess): Deleted.
2048
2049         * StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2050         (WebKit::WebIDBConnectionToClient::putOrAdd):
2051
2052         * StorageProcess/StorageProcess.cpp:
2053         (WebKit::StorageProcess::initializeWebsiteDataStore):
2054         (WebKit::StorageProcess::postStorageTask):
2055         (WebKit::StorageProcess::performNextStorageTask):
2056         (WebKit::StorageProcess::createStorageToWebProcessConnection):
2057         (WebKit::StorageProcess::fetchWebsiteData):
2058         (WebKit::StorageProcess::postDatabaseTask): Deleted.
2059         (WebKit::StorageProcess::performNextDatabaseTask): Deleted.
2060         (WebKit::StorageProcess::createDatabaseToWebProcessConnection): Deleted.
2061         * StorageProcess/StorageProcess.h:
2062         * StorageProcess/StorageProcess.messages.in:
2063         * StorageProcess/mac/StorageProcessMac.mm:
2064         (WebKit::StorageProcess::initializeProcessName):
2065
2066         * UIProcess/API/C/WKContext.cpp:
2067         (WKContextGetDatabaseProcessIdentifier):
2068
2069         * UIProcess/API/Cocoa/WKProcessPool.mm:
2070         (-[WKProcessPool _terminateStorageProcess]):
2071         (-[WKProcessPool _storageProcessIdentifier]):
2072         (-[WKProcessPool _terminateDatabaseProcess]): Deleted.
2073         (-[WKProcessPool _databaseProcessIdentifier]): Deleted.
2074         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2075
2076         * UIProcess/ChildProcessProxy.cpp:
2077         (WebKit::ChildProcessProxy::getLaunchOptions):
2078
2079         * UIProcess/Launcher/ProcessLauncher.h:
2080         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
2081         (WebKit::ProcessLauncher::launchProcess):
2082         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2083         (WebKit::serviceName):
2084         * UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp:
2085         (WebKit::ProcessLauncher::launchProcess):
2086
2087         * UIProcess/Network/NetworkProcessProxy.cpp:
2088         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs):
2089         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs): Deleted.
2090         * UIProcess/Network/NetworkProcessProxy.h:
2091         * UIProcess/Network/NetworkProcessProxy.messages.in:
2092
2093         * UIProcess/Storage/StorageProcessProxy.cpp:
2094         (WebKit::StorageProcessProxy::getLaunchOptions):
2095         (WebKit::StorageProcessProxy::getStorageProcessConnection):
2096         (WebKit::StorageProcessProxy::didClose):
2097         (WebKit::StorageProcessProxy::didCreateStorageToWebProcessConnection):
2098         (WebKit::StorageProcessProxy::didFinishLaunching):
2099         (WebKit::StorageProcessProxy::getDatabaseProcessConnection): Deleted.
2100         (WebKit::StorageProcessProxy::didCreateDatabaseToWebProcessConnection): Deleted.
2101         * UIProcess/Storage/StorageProcessProxy.h:
2102         * UIProcess/Storage/StorageProcessProxy.messages.in:
2103
2104         * UIProcess/WebContextClient.cpp:
2105         (WebKit::WebContextClient::storageProcessDidCrash):
2106         (WebKit::WebContextClient::databaseProcessDidCrash): Deleted.
2107         * UIProcess/WebContextClient.h:
2108
2109         * UIProcess/WebProcessPool.cpp:
2110         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
2111         (WebKit::WebProcessPool::getStorageProcessConnection):
2112         (WebKit::WebProcessPool::storageProcessCrashed):
2113         (WebKit::WebProcessPool::pageAddedToProcess):
2114         (WebKit::WebProcessPool::storageProcessIdentifier):
2115         (WebKit::WebProcessPool::terminateStorageProcess):
2116         (WebKit::WebProcessPool::ensureDatabaseProcessAndWebsiteDataStore): Deleted.
2117         (WebKit::WebProcessPool::getDatabaseProcessConnection): Deleted.
2118         (WebKit::WebProcessPool::databaseProcessCrashed): Deleted.
2119         (WebKit::WebProcessPool::databaseProcessIdentifier): Deleted.
2120         (WebKit::WebProcessPool::terminateDatabaseProcess): Deleted.
2121         * UIProcess/WebProcessPool.h:
2122         (WebKit::WebProcessPool::sendToStorageProcessRelaunchingIfNecessary):
2123         (WebKit::WebProcessPool::sendToDatabaseProcessRelaunchingIfNecessary): Deleted.
2124
2125         * UIProcess/WebProcessProxy.cpp:
2126         (WebKit::WebProcessProxy::getStorageProcessConnection):
2127         (WebKit::WebProcessProxy::getDatabaseProcessConnection): Deleted.
2128         * UIProcess/WebProcessProxy.h:
2129         * UIProcess/WebProcessProxy.messages.in:
2130
2131         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2132         (WebKit::WebsiteDataStore::fetchDataAndApply):
2133         (WebKit::WebsiteDataStore::removeData):
2134         (WebKit::WebsiteDataStore::storageProcessParameters):
2135         (WebKit::WebsiteDataStore::databaseProcessParameters): Deleted.
2136         * UIProcess/WebsiteData/WebsiteDataStore.h:
2137
2138         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2139         (WebKit::WebIDBConnectionToServer::messageSenderConnection):
2140         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
2141
2142         * WebProcess/Databases/WebDatabaseProvider.cpp:
2143         (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
2144
2145         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
2146         (WebKit::WebToStorageProcessConnection::WebToStorageProcessConnection):
2147         (WebKit::WebToStorageProcessConnection::~WebToStorageProcessConnection):
2148         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
2149         (WebKit::WebToStorageProcessConnection::didClose):
2150         (WebKit::WebToStorageProcessConnection::didReceiveInvalidMessage):
2151         (WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession):
2152         (WebKit::WebToDatabaseProcessConnection::WebToDatabaseProcessConnection): Deleted.
2153         (WebKit::WebToDatabaseProcessConnection::~WebToDatabaseProcessConnection): Deleted.
2154         (WebKit::WebToDatabaseProcessConnection::didReceiveMessage): Deleted.
2155         (WebKit::WebToDatabaseProcessConnection::didClose): Deleted.
2156         (WebKit::WebToDatabaseProcessConnection::didReceiveInvalidMessage): Deleted.
2157         (WebKit::WebToDatabaseProcessConnection::idbConnectionToServerForSession): Deleted.
2158         * WebProcess/Storage/WebToStorageProcessConnection.h:
2159         (WebKit::WebToStorageProcessConnection::create):
2160         (WebKit::WebToDatabaseProcessConnection::create): Deleted.
2161         (WebKit::WebToDatabaseProcessConnection::connection): Deleted.
2162
2163         * WebProcess/WebProcess.cpp:
2164         (WebKit::WebProcess::webToStorageProcessConnectionClosed):
2165         (WebKit::WebProcess::webToStorageProcessConnection):
2166         (WebKit::WebProcess::ensureWebToStorageProcessConnection):
2167         (WebKit::WebProcess::webToDatabaseProcessConnectionClosed): Deleted.
2168         (WebKit::WebProcess::webToDatabaseProcessConnection): Deleted.
2169         (WebKit::WebProcess::ensureWebToDatabaseProcessConnection): Deleted.
2170         * WebProcess/WebProcess.h:
2171
2172 2017-08-01  Brady Eidson  <beidson@apple.com>
2173
2174         Part 1 of: Rename DatabaseProcess to StorageProcess.
2175         https://bugs.webkit.org/show_bug.cgi?id=174879
2176
2177         Reviewed by Andy Estes.
2178
2179         This patch is all about renaming source files and renaming the process itself (touching build system files, etc etc).
2180
2181         Some renaming in actual code did result (Some class/struct names, method names, etc)
2182
2183         Part 2 (174880) will go through and update all references in code itself from "Database" to "Storage"
2184
2185         * CMakeLists.txt:
2186         * DerivedSources.make:
2187         * PlatformGTK.cmake:
2188         * PlatformMac.cmake:
2189         * PlatformWPE.cmake:
2190         * WebKit.xcodeproj/project.pbxproj:
2191
2192         * Configurations/StorageService.xcconfig: Renamed from Source/WebKit/Configurations/DatabaseService.xcconfig.
2193         * StorageProcess/EntryPoint/mac/XPCService/StorageService/Info.plist: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist.
2194         * StorageProcess/mac/com.apple.WebKit.Databases.sb.in: Renamed from Source/WebKit/DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in.
2195
2196         * Shared/Storage/StorageProcessCreationParameters.cpp: Renamed from Source/WebKit/Shared/Databases/DatabaseProcessCreationParameters.cpp.
2197         * Shared/Storage/StorageProcessCreationParameters.h: Renamed from Source/WebKit/Shared/Databases/DatabaseProcessCreationParameters.h.
2198
2199         * StorageProcess/EntryPoint/mac/XPCService/StorageServiceEntryPoint.mm: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm.
2200         * StorageProcess/EntryPoint/unix/StorageProcessMain.cpp: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp.
2201
2202         * StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp.
2203         * StorageProcess/IndexedDB/WebIDBConnectionToClient.h: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h.
2204         * StorageProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in.
2205
2206         * StorageProcess/StorageProcess.cpp: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.cpp.
2207         * StorageProcess/StorageProcess.h: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.h.
2208         * StorageProcess/StorageProcess.messages.in: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.messages.in.
2209
2210         * StorageProcess/StorageToWebProcessConnection.cpp: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.cpp.
2211         * StorageProcess/StorageToWebProcessConnection.h: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.h.
2212         * StorageProcess/StorageToWebProcessConnection.messages.in: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.messages.in.
2213
2214         * StorageProcess/gtk/StorageProcessMainGtk.cpp: Renamed from Source/WebKit/DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp.
2215         * StorageProcess/ios/StorageProcessIOS.mm: Renamed from Source/WebKit/DatabaseProcess/ios/DatabaseProcessIOS.mm.
2216         * StorageProcess/mac/StorageProcessMac.mm: Renamed from Source/WebKit/DatabaseProcess/mac/DatabaseProcessMac.mm.
2217         * StorageProcess/unix/StorageProcessMainUnix.h: Renamed from Source/WebKit/DatabaseProcess/unix/DatabaseProcessMainUnix.h.
2218         * UIProcess/Network/NetworkProcessProxy.cpp:
2219
2220         * UIProcess/Storage/StorageProcessProxy.cpp: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.cpp.
2221         * UIProcess/Storage/StorageProcessProxy.h: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.h.
2222         * UIProcess/Storage/StorageProcessProxy.messages.in: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.messages.in.
2223
2224         * UIProcess/WebContextSupplement.h:
2225         * UIProcess/WebProcessPool.cpp:
2226         * UIProcess/WebProcessPool.h:
2227         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2228         * UIProcess/WebsiteData/WebsiteDataStore.h:
2229         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2230         * WebProcess/Databases/WebDatabaseProvider.cpp:
2231
2232         * WebProcess/Storage/WebToStorageProcessConnection.cpp: Renamed from Source/WebKit/WebProcess/Databases/WebToDatabaseProcessConnection.cpp.
2233         * WebProcess/Storage/WebToStorageProcessConnection.h: Renamed from Source/WebKit/WebProcess/Databases/WebToDatabaseProcessConnection.h.
2234
2235         * WebProcess/WebProcess.cpp:
2236
2237 2017-08-01  Michael Catanzaro  <mcatanzaro@igalia.com>
2238
2239         [CMake] WebKitFS.cmake depends on options set in Option cmake files that are included later
2240         https://bugs.webkit.org/show_bug.cgi?id=174855
2241
2242         Reviewed by Carlos Garcia Campos.
2243
2244         Don't create derived sources directory here anymore.
2245
2246         * PlatformGTK.cmake:
2247         * PlatformMac.cmake:
2248         * PlatformWPE.cmake:
2249
2250 2017-07-31  Daniel Bates  <dabates@apple.com>
2251
2252         WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction() may not be able to
2253         determine page that initiated navigation
2254         https://bugs.webkit.org/show_bug.cgi?id=174531
2255
2256         Remove a comment from WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction()
2257         about determining the originating page independently from the originating frame. There
2258         does not seem to be much value to fixing this. We can always revisit this issue if we
2259         discover a strong motivating example. See <https://bugs.webkit.org/show_bug.cgi?id=174531#c1>
2260         for more details.
2261
2262         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2263         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2264
2265 2017-07-31  Sam Weinig  <sam@webkit.org>
2266
2267         Remove unnecessary exceptions from storage code
2268         https://bugs.webkit.org/show_bug.cgi?id=174572
2269
2270         Reviewed by Chris Dumez.
2271
2272         * WebProcess/Storage/StorageAreaImpl.cpp:
2273         (WebKit::StorageAreaImpl::canAccessStorage): Deleted.
2274         * WebProcess/Storage/StorageAreaImpl.h:
2275         * WebProcess/Storage/StorageNamespaceImpl.cpp:
2276         Remove canAccessStorage. It is no longer called.
2277
2278 2017-07-30  Brady Eidson  <beidson@apple.com>
2279
2280         Add URLSchemeHandler API tests that verify the lack of URLSchemeTask object leaks.
2281         https://bugs.webkit.org/show_bug.cgi?id=174958
2282
2283         Reviewed by Darin Adler.
2284
2285         * UIProcess/API/APIURLSchemeTask.h:
2286
2287         * UIProcess/API/C/WKTestingSupport.cpp:
2288         (WKGetAPIURLSchemeTaskInstanceCount):
2289         (WKGetWebURLSchemeTaskInstanceCount):
2290         * UIProcess/API/C/WKTestingSupport.h:
2291
2292         * UIProcess/WebURLSchemeTask.h:
2293
2294         * WebKit.xcodeproj/project.pbxproj:
2295
2296 2017-07-29  Yusuke Suzuki  <utatane.tea@gmail.com>
2297
2298         Unreviewed, build fix for GTK and WPE about StorageProcess renaming
2299
2300         * CMakeLists.txt:
2301         * PlatformGTK.cmake:
2302         * PlatformMac.cmake:
2303         * PlatformWPE.cmake:
2304
2305 2017-07-28  Brent Fulgham  <bfulgham@apple.com>
2306
2307         [Mac][WebKit2] WebKit sandbox errors while streaming Netflix
2308         https://bugs.webkit.org/show_bug.cgi?id=174955
2309         <rdar://problem/33583994>
2310
2311         Reviewed by Alex Christensen.
2312
2313         Wider testing with the stricter sandboxing rules identified three more IOKit properties we need to expose:
2314         - CEAModeID
2315         - CEAPixelRepetition
2316         - IOFBHDMIDongleROM
2317
2318         * WebProcess/com.apple.WebProcess.sb.in:
2319
2320 2017-07-28  Commit Queue  <commit-queue@webkit.org>
2321
2322         Unreviewed, rolling out r219986.
2323         https://bugs.webkit.org/show_bug.cgi?id=174962
2324
2325         "broke PLT on iOS (rdar://problem/33602751)" (Requested by
2326         estes on #webkit).
2327
2328         Reverted changeset:
2329
2330         "Part 1 of: Rename DatabaseProcess to StorageProcess."
2331         https://bugs.webkit.org/show_bug.cgi?id=174879
2332         http://trac.webkit.org/changeset/219986
2333
2334 2017-07-28  Commit Queue  <commit-queue@webkit.org>
2335
2336         Unreviewed, rolling out r219990.
2337         https://bugs.webkit.org/show_bug.cgi?id=174961
2338
2339         "broke PLT on iOS (rdar://problem/33602751)" (Requested by
2340         estes on #webkit).
2341
2342         Reverted changeset:
2343
2344         "Part 2 of: Rename DatabaseProcess to StorageProcess."
2345         https://bugs.webkit.org/show_bug.cgi?id=174880
2346         http://trac.webkit.org/changeset/219990
2347
2348 2017-07-28  Brady Eidson  <beidson@apple.com>
2349
2350         API tests that use URLSchemeHandler are failing.
2351         https://bugs.webkit.org/show_bug.cgi?id=174950
2352
2353         Reviewed by Alex Christensen.
2354
2355         Make sure that in all cases where we remove the last task from the page->task map...
2356         ...We also remove the map itself.
2357
2358         * UIProcess/WebURLSchemeHandler.cpp:
2359         (WebKit::WebURLSchemeHandler::stopTask):
2360         (WebKit::WebURLSchemeHandler::taskCompleted):
2361         (WebKit::WebURLSchemeHandler::removeTaskFromPageMap):
2362         * UIProcess/WebURLSchemeHandler.h:
2363
2364 2017-07-28  Brady Eidson  <beidson@apple.com>
2365
2366         WKURLSchemeTaskImpl instances are being abandoned (except if the task is stopped).
2367         <rdar://problem/33568276> and https://bugs.webkit.org/show_bug.cgi?id=174895
2368
2369         Reviewed by Alex Christensen.
2370
2371         There was a lot going on here:
2372         - There was an unbroken cycle between URLSchemeHandlers and URLSchemeTasks 
2373         - WKURLSchemeTasks were not destroying their API::URLSchemeTask implementation object
2374         - When a WKWebView was dealloc'ed, it was not cleaning up the related UIProcess tasks
2375         - If the NetworkingProcess crashed, WebProcesses were not cleaning up their tasks
2376           (and therefore the UIProcess tasks were also not getting cleaned up)
2377         - If a WebProcess crashed, the UIProcess was not cleaning up the related tasks
2378         
2379         * UIProcess/API/Cocoa/WKURLSchemeTask.mm:
2380         (-[WKURLSchemeTaskImpl dealloc]): Call API::~URLSchemeTask
2381         
2382         * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.h:
2383         * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm:
2384         (WebKit::WebURLSchemeHandlerCocoa::platformTaskCompleted): Clear out the API wrapper map
2385           so the wrapper and implementation object can both be destroyed.
2386         
2387         * UIProcess/WebPageProxy.cpp:
2388         (WebKit::WebPageProxy::close): Call stopAllURLSchemeTasks.
2389         (WebKit::WebPageProxy::processDidTerminate): Call stopAllURLSchemeTasks.
2390         (WebKit::WebPageProxy::stopAllURLSchemeTasks):
2391         * UIProcess/WebPageProxy.h:
2392         
2393         * UIProcess/WebURLSchemeHandler.cpp:
2394         (WebKit::WebURLSchemeHandler::startTask):
2395         (WebKit::WebURLSchemeHandler::stopAllTasksForPage):
2396         (WebKit::WebURLSchemeHandler::stopTask):
2397         (WebKit::WebURLSchemeHandler::taskCompleted):
2398         * UIProcess/WebURLSchemeHandler.h:
2399         
2400         * UIProcess/WebURLSchemeTask.cpp:
2401         (WebKit::WebURLSchemeTask::WebURLSchemeTask):
2402         * UIProcess/WebURLSchemeTask.h:
2403         (WebKit::WebURLSchemeTask::pageID): Store separate from the WebPage so messaging
2404           is possible even after the WebPage* has been cleared.
2405         
2406         * WebProcess/WebPage/WebPage.cpp:
2407         (WebKit::WebPage::stopAllURLSchemeTasks):
2408         * WebProcess/WebPage/WebPage.h:
2409         
2410         * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp:
2411         (WebKit::WebURLSchemeHandlerProxy::stopAllTasks):
2412         (WebKit::WebURLSchemeHandlerProxy::taskDidComplete):
2413         (WebKit::WebURLSchemeHandlerProxy::taskDidStopLoading):
2414         (WebKit::WebURLSchemeHandlerProxy::removeTask):
2415         * WebProcess/WebPage/WebURLSchemeHandlerProxy.h:
2416         
2417         * WebProcess/WebProcess.cpp:
2418         (WebKit::WebProcess::networkProcessConnectionClosed): Call stopAllURLSchemeTasks 
2419           for each WebPage.
2420
2421 2017-07-28  Frederic Wang  <fwang@igalia.cpm>
2422
2423         Fix typo in scrollPositionChangedViaDelegatedScrolling
2424         https://bugs.webkit.org/show_bug.cgi?id=174937
2425
2426         Reviewed by Wenson Hsieh.
2427
2428         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2429         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2430         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll):
2431
2432 2017-07-28  Jeremy Jones  <jeremyj@apple.com>
2433
2434         Remove Web prefix from WebVideoFullscreen and WebPlaybackSession classes.
2435         https://bugs.webkit.org/show_bug.cgi?id=174437
2436
2437         Reviewed by Darin Adler.
2438
2439         Remove redundant Web- prefix from classes in WebKit namespace.
2440
2441         * DerivedSources.make:
2442         * UIProcess/API/Cocoa/WKWebView.mm:
2443         * UIProcess/Cocoa/PlaybackSessionManagerProxy.h: Renamed from Source/WebKit/UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h.
2444         * UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in: Renamed from Source/WebKit/UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in.
2445         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm: Added.
2446         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h: Renamed from Source/WebKit/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h.
2447         * UIProcess/Cocoa/VideoFullscreenManagerProxy.messages.in: Renamed from Source/WebKit/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in.
2448         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm: Renamed from Source/WebKit/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm.
2449         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: Removed.
2450         * UIProcess/Cocoa/WebViewImpl.mm:
2451         (WebKit::WebViewImpl::updateMediaTouchBar):
2452         * UIProcess/WebPageProxy.cpp:
2453         (WebKit::m_weakPtrFactory):
2454         (WebKit::WebPageProxy::reattachToWebProcess):
2455         (WebKit::WebPageProxy::playbackSessionManager):
2456         (WebKit::WebPageProxy::videoFullscreenManager):
2457         * UIProcess/WebPageProxy.h:
2458         * UIProcess/ios/WebPageProxyIOS.mm:
2459         * WebKit.xcodeproj/project.pbxproj:
2460         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2461         * WebProcess/WebPage/WebPage.cpp:
2462         (WebKit::WebPage::playbackSessionManager):
2463         (WebKit::WebPage::videoFullscreenManager):
2464         * WebProcess/WebPage/WebPage.h:
2465         * WebProcess/cocoa/PlaybackSessionManager.h: Renamed from Source/WebKit/WebProcess/cocoa/WebPlaybackSessionManager.h.
2466         * WebProcess/cocoa/PlaybackSessionManager.messages.in: Renamed from Source/WebKit/WebProcess/cocoa/WebPlaybackSessionManager.messages.in.
2467         * WebProcess/cocoa/PlaybackSessionManager.mm: Added.
2468         * WebProcess/cocoa/VideoFullscreenManager.h: Renamed from Source/WebKit/WebProcess/cocoa/WebVideoFullscreenManager.h.
2469         (WebKit::VideoFullscreenInterfaceContext::create):
2470         * WebProcess/cocoa/VideoFullscreenManager.messages.in: Renamed from Source/WebKit/WebProcess/cocoa/WebVideoFullscreenManager.messages.in.
2471         * WebProcess/cocoa/VideoFullscreenManager.mm: Renamed from Source/WebKit/WebProcess/cocoa/WebVideoFullscreenManager.mm.
2472         * WebProcess/cocoa/WebPlaybackSessionManager.mm: Removed.
2473
2474 2017-07-27  Zan Dobersek  <zdobersek@igalia.com>
2475
2476         [CMake] Re-add the StorageProcess executable target
2477         https://bugs.webkit.org/show_bug.cgi?id=174929
2478
2479         Reviewed by Carlos Garcia Campos.
2480
2481         Re-add the StorageProcess executable target that was removed in r219960.
2482         Back then it was still named DatabaseProcess, but the name changed in
2483         the following patches.
2484
2485         * CMakeLists.txt:
2486
2487 2017-07-27  Brady Eidson  <beidson@apple.com>
2488
2489         Part 2 of: Rename DatabaseProcess to StorageProcess.
2490         https://bugs.webkit.org/show_bug.cgi?id=174880
2491
2492         Reviewed by Andy Estes.
2493
2494         Rename some more variables, classes, etc. to reflect the change.
2495
2496         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2497         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
2498
2499         * NetworkProcess/NetworkProcess.cpp:
2500         (WebKit::NetworkProcess::grantSandboxExtensionsToStorageProcessForBlobs):
2501         (WebKit::NetworkProcess::didgrantSandboxExtensionsToStorageProcessForBlobs):
2502         (WebKit::NetworkProcess::grantSandboxExtensionsToDatabaseProcessForBlobs): Deleted.
2503         (WebKit::NetworkProcess::didGrantSandboxExtensionsToDatabaseProcessForBlobs): Deleted.
2504         * NetworkProcess/NetworkProcess.h:
2505         * NetworkProcess/NetworkProcess.messages.in:
2506
2507         * Shared/ProcessExecutablePath.h:
2508         * Shared/gtk/ProcessExecutablePathGtk.cpp:
2509         (WebKit::executablePathOfStorageProcess):
2510         (WebKit::executablePathOfDatabaseProcess): Deleted.
2511         * Shared/wpe/ProcessExecutablePathWPE.cpp:
2512         (WebKit::executablePathOfStorageProcess):
2513         (WebKit::executablePathOfDatabaseProcess): Deleted.
2514
2515         * StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2516         (WebKit::WebIDBConnectionToClient::putOrAdd):
2517
2518         * StorageProcess/StorageProcess.cpp:
2519         (WebKit::StorageProcess::initializeWebsiteDataStore):
2520         (WebKit::StorageProcess::postStorageTask):
2521         (WebKit::StorageProcess::performNextStorageTask):
2522         (WebKit::StorageProcess::createStorageToWebProcessConnection):
2523         (WebKit::StorageProcess::fetchWebsiteData):
2524         (WebKit::StorageProcess::postDatabaseTask): Deleted.
2525         (WebKit::StorageProcess::performNextDatabaseTask): Deleted.
2526         (WebKit::StorageProcess::createDatabaseToWebProcessConnection): Deleted.
2527         * StorageProcess/StorageProcess.h:
2528         * StorageProcess/StorageProcess.messages.in:
2529         * StorageProcess/mac/StorageProcessMac.mm:
2530         (WebKit::StorageProcess::initializeProcessName):
2531
2532         * UIProcess/API/C/WKContext.cpp:
2533         (WKContextGetDatabaseProcessIdentifier):
2534
2535         * UIProcess/API/Cocoa/WKProcessPool.mm:
2536         (-[WKProcessPool _terminateStorageProcess]):
2537         (-[WKProcessPool _storageProcessIdentifier]):
2538         (-[WKProcessPool _terminateDatabaseProcess]): Deleted.
2539         (-[WKProcessPool _databaseProcessIdentifier]): Deleted.
2540         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2541
2542         * UIProcess/Launcher/ProcessLauncher.h:
2543         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
2544         (WebKit::ProcessLauncher::launchProcess):
2545         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2546         (WebKit::serviceName):
2547         * UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp:
2548         (WebKit::ProcessLauncher::launchProcess):
2549
2550         * UIProcess/Network/NetworkProcessProxy.cpp:
2551         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs):
2552         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs): Deleted.
2553         * UIProcess/Network/NetworkProcessProxy.h:
2554         * UIProcess/Network/NetworkProcessProxy.messages.in:
2555
2556         * UIProcess/Storage/StorageProcessProxy.cpp:
2557         (WebKit::StorageProcessProxy::getLaunchOptions):
2558         (WebKit::StorageProcessProxy::getStorageProcessConnection):
2559         (WebKit::StorageProcessProxy::didClose):
2560         (WebKit::StorageProcessProxy::didCreateStorageToWebProcessConnection):
2561         (WebKit::StorageProcessProxy::didFinishLaunching):
2562         (WebKit::StorageProcessProxy::getDatabaseProcessConnection): Deleted.
2563         (WebKit::StorageProcessProxy::didCreateDatabaseToWebProcessConnection): Deleted.
2564         * UIProcess/Storage/StorageProcessProxy.h:
2565         * UIProcess/Storage/StorageProcessProxy.messages.in:
2566
2567         * UIProcess/WebContextClient.cpp:
2568         (WebKit::WebContextClient::storageProcessDidCrash):
2569         (WebKit::WebContextClient::databaseProcessDidCrash): Deleted.
2570         * UIProcess/WebContextClient.h:
2571
2572         * UIProcess/WebProcessPool.cpp:
2573         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
2574         (WebKit::WebProcessPool::getStorageProcessConnection):
2575         (WebKit::WebProcessPool::storageProcessCrashed):
2576         (WebKit::WebProcessPool::pageAddedToProcess):
2577         (WebKit::WebProcessPool::storageProcessIdentifier):
2578         (WebKit::WebProcessPool::terminateStorageProcess):
2579         (WebKit::WebProcessPool::ensureDatabaseProcessAndWebsiteDataStore): Deleted.
2580         (WebKit::WebProcessPool::getDatabaseProcessConnection): Deleted.
2581         (WebKit::WebProcessPool::databaseProcessCrashed): Deleted.
2582         (WebKit::WebProcessPool::databaseProcessIdentifier): Deleted.
2583         (WebKit::WebProcessPool::terminateDatabaseProcess): Deleted.
2584         * UIProcess/WebProcessPool.h:
2585         (WebKit::WebProcessPool::sendToStorageProcessRelaunchingIfNecessary):
2586         (WebKit::WebProcessPool::sendToDatabaseProcessRelaunchingIfNecessary): Deleted.
2587
2588         * UIProcess/WebProcessProxy.cpp:
2589         (WebKit::WebProcessProxy::getStorageProcessConnection):
2590         (WebKit::WebProcessProxy::getDatabaseProcessConnection): Deleted.
2591         * UIProcess/WebProcessProxy.h:
2592         * UIProcess/WebProcessProxy.messages.in:
2593
2594         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2595         (WebKit::WebsiteDataStore::fetchDataAndApply):
2596         (WebKit::WebsiteDataStore::removeData):
2597         (WebKit::WebsiteDataStore::storageProcessParameters):
2598         (WebKit::WebsiteDataStore::databaseProcessParameters): Deleted.
2599         * UIProcess/WebsiteData/WebsiteDataStore.h:
2600
2601         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2602         (WebKit::WebIDBConnectionToServer::messageSenderConnection):
2603         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
2604
2605         * WebProcess/Databases/WebDatabaseProvider.cpp:
2606         (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
2607
2608         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
2609         (WebKit::WebToStorageProcessConnection::WebToStorageProcessConnection):
2610         (WebKit::WebToStorageProcessConnection::~WebToStorageProcessConnection):
2611         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
2612         (WebKit::WebToStorageProcessConnection::didClose):
2613         (WebKit::WebToStorageProcessConnection::didReceiveInvalidMessage):
2614         (WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession):
2615         (WebKit::WebToDatabaseProcessConnection::WebToDatabaseProcessConnection): Deleted.
2616         (WebKit::WebToDatabaseProcessConnection::~WebToDatabaseProcessConnection): Deleted.
2617         (WebKit::WebToDatabaseProcessConnection::didReceiveMessage): Deleted.
2618         (WebKit::WebToDatabaseProcessConnection::didClose): Deleted.
2619         (WebKit::WebToDatabaseProcessConnection::didReceiveInvalidMessage): Deleted.
2620         (WebKit::WebToDatabaseProcessConnection::idbConnectionToServerForSession): Deleted.
2621         * WebProcess/Storage/WebToStorageProcessConnection.h:
2622         (WebKit::WebToStorageProcessConnection::create):
2623         (WebKit::WebToDatabaseProcessConnection::create): Deleted.
2624         (WebKit::WebToDatabaseProcessConnection::connection): Deleted.
2625
2626         * WebProcess/WebProcess.cpp:
2627         (WebKit::WebProcess::webToStorageProcessConnectionClosed):
2628         (WebKit::WebProcess::webToStorageProcessConnection):
2629         (WebKit::WebProcess::ensureWebToStorageProcessConnection):
2630         (WebKit::WebProcess::webToDatabaseProcessConnectionClosed): Deleted.
2631         (WebKit::WebProcess::webToDatabaseProcessConnection): Deleted.
2632         (WebKit::WebProcess::ensureWebToDatabaseProcessConnection): Deleted.
2633         * WebProcess/WebProcess.h:
2634
2635 2017-07-27  Nan Wang  <n_wang@apple.com>
2636
2637         AX: A11Y: Zoom no longer follows keyboard insertion point in safari
2638         https://bugs.webkit.org/show_bug.cgi?id=174869
2639
2640         Reviewed by David Kilzer.
2641
2642         There was a recent change by denying XPC services access by default. 
2643         In UAZoomChangeFocus we need to send message to HIServices, so let's
2644         allow the connection to XPC services for that. 
2645
2646         * WebProcess/com.apple.WebProcess.sb.in:
2647
2648 2017-07-27  Brady Eidson  <beidson@apple.com>
2649
2650         Part 1 of: Rename DatabaseProcess to StorageProcess.
2651         https://bugs.webkit.org/show_bug.cgi?id=174879
2652
2653         Reviewed by Andy Estes.
2654
2655         This patch is all about renaming source files and renaming the process itself (touching build system files, etc etc).
2656
2657         Some renaming in actual code did result (Some class/struct names, method names, etc)
2658
2659         Part 2 (174880) will go through and update all references in code itself from "Database" to "Storage"
2660
2661         * CMakeLists.txt:
2662         * Configurations/Storage-iOS.entitlements: Renamed from Source/WebKit/Configurations/Databases-iOS.entitlements.
2663         * Configurations/StorageService.xcconfig: Renamed from Source/WebKit/Configurations/DatabaseService.xcconfig.
2664         * Configurations/WebKit.xcconfig:
2665         * DerivedSources.make:
2666         * Platform/ExtraPrivateSymbolsForTAPI.h:
2667         * PlatformGTK.cmake:
2668         * PlatformMac.cmake:
2669         * PlatformWPE.cmake:
2670
2671         * Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb: Renamed from Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb.
2672
2673         * Shared/Storage/StorageProcessCreationParameters.cpp: Renamed from Source/WebKit/Shared/Databases/DatabaseProcessCreationParameters.cpp.
2674         (WebKit::StorageProcessCreationParameters::StorageProcessCreationParameters):
2675         (WebKit::StorageProcessCreationParameters::encode):
2676         (WebKit::StorageProcessCreationParameters::decode):
2677         * Shared/Storage/StorageProcessCreationParameters.h: Renamed from Source/WebKit/Shared/Databases/DatabaseProcessCreationParameters.h.
2678
2679         * StorageProcess/EntryPoint/mac/XPCService/StorageService/Info.plist: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist.
2680         * StorageProcess/EntryPoint/mac/XPCService/StorageServiceEntryPoint.mm: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm.
2681         (StorageServiceInitializer):
2682         * StorageProcess/EntryPoint/unix/StorageProcessMain.cpp: Renamed from Source/WebKit/DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp.
2683         (main):
2684
2685         * StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp.
2686         * StorageProcess/IndexedDB/WebIDBConnectionToClient.h: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h.
2687         * StorageProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Renamed from Source/WebKit/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in.
2688         
2689         * StorageProcess/StorageProcess.cpp: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.cpp.
2690         * StorageProcess/StorageProcess.h: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.h.
2691         * StorageProcess/StorageProcess.messages.in: Renamed from Source/WebKit/DatabaseProcess/DatabaseProcess.messages.in.
2692
2693         * StorageProcess/StorageToWebProcessConnection.cpp: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.cpp.
2694         * StorageProcess/StorageToWebProcessConnection.h: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.h.
2695         * StorageProcess/StorageToWebProcessConnection.messages.in: Renamed from Source/WebKit/DatabaseProcess/DatabaseToWebProcessConnection.messages.in.
2696
2697         * StorageProcess/gtk/StorageProcessMainGtk.cpp: Renamed from Source/WebKit/DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp.
2698         (WebKit::StorageProcessMainUnix):
2699         * StorageProcess/ios/StorageProcessIOS.mm: Renamed from Source/WebKit/DatabaseProcess/ios/DatabaseProcessIOS.mm.
2700         (WebKit::StorageProcess::initializeProcess):
2701         (WebKit::StorageProcess::initializeProcessName):
2702         (WebKit::StorageProcess::initializeSandbox):
2703         * StorageProcess/mac/StorageProcessMac.mm: Renamed from Source/WebKit/DatabaseProcess/mac/DatabaseProcessMac.mm.
2704         (WebKit::StorageProcess::initializeProcess):
2705         (WebKit::StorageProcess::initializeProcessName):
2706         (WebKit::StorageProcess::initializeSandbox):
2707
2708         * StorageProcess/mac/com.apple.WebKit.Databases.sb.in: Copied from Source/WebKit/DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in.
2709         * StorageProcess/mac/com.apple.WebKit.Storage.sb.in: Renamed from Source/WebKit/DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in.
2710
2711         * StorageProcess/unix/StorageProcessMainUnix.h: Renamed from Source/WebKit/DatabaseProcess/unix/DatabaseProcessMainUnix.h.
2712
2713         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2714         (WebKit::serviceName):
2715
2716         * UIProcess/Network/NetworkProcessProxy.cpp:
2717         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs):
2718
2719         * UIProcess/Storage/StorageProcessProxy.cpp: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.cpp.
2720         * UIProcess/Storage/StorageProcessProxy.h: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.h.
2721         * UIProcess/Storage/StorageProcessProxy.messages.in: Renamed from Source/WebKit/UIProcess/Databases/DatabaseProcessProxy.messages.in.
2722
2723         * UIProcess/WebContextSupplement.h:
2724         (WebKit::WebContextSupplement::processDidClose):
2725
2726         * UIProcess/WebProcessPool.cpp:
2727         (WebKit::WebProcessPool::ensureDatabaseProcessAndWebsiteDataStore):
2728         (WebKit::WebProcessPool::databaseProcessCrashed):
2729         (WebKit::WebProcessPool::pageAddedToProcess):
2730         * UIProcess/WebProcessPool.h:
2731
2732         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2733         (WebKit::WebsiteDataStore::databaseProcessParameters):
2734         * UIProcess/WebsiteData/WebsiteDataStore.h:
2735
2736         * WebKit.xcodeproj/project.pbxproj:
2737
2738         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2739         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
2740         (WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
2741         * WebProcess/Databases/WebDatabaseProvider.cpp:
2742
2743         * WebProcess/Storage/WebToStorageProcessConnection.cpp: Renamed from Source/WebKit/WebProcess/Databases/WebToDatabaseProcessConnection.cpp.
2744         * WebProcess/Storage/WebToStorageProcessConnection.h: Renamed from Source/WebKit/WebProcess/Databases/WebToDatabaseProcessConnection.h.
2745
2746         * WebProcess/WebProcess.cpp:
2747
2748 2017-07-27  Tim Horton  <timothy_horton@apple.com>
2749
2750         PDF page number indicator is very flashy when scrolling
2751         https://bugs.webkit.org/show_bug.cgi?id=174882
2752         <rdar://problem/23760981>
2753
2754         Reviewed by Andy Estes.
2755
2756         * Platform/spi/ios/UIKitSPI.h:
2757         * UIProcess/ios/WKPDFPageNumberIndicator.mm:
2758         (-[WKPDFPageNumberIndicator initWithFrame:]):
2759         Increase the backdrop rendering resolution to reduce flashiness.
2760         It's still not perfect, but it's quite visibly better.
2761
2762 2017-07-26  Brady Eidson  <beidson@apple.com>
2763
2764         ResourceLoadStatistics API tests fail on El Capitan.
2765         https://bugs.webkit.org/show_bug.cgi?id=174877
2766
2767         Reviewed by Chris Dumez.
2768
2769         Always install the testing callback.
2770
2771         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2772         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
2773
2774 2017-07-26  Tim Horton  <timothy_horton@apple.com>
2775
2776         REGRESSION (r211160): Can't pinch to zoom unlocked encrypted PDFs in WKWebView
2777         https://bugs.webkit.org/show_bug.cgi?id=174881
2778         <rdar://problem/33556312>
2779
2780         Reviewed by Andy Estes.
2781
2782         * UIProcess/API/Cocoa/WKWebView.mm:
2783         (-[WKWebView _hidePasswordView]):
2784         WKPasswordView saves and restores a bunch of scroll view properties, including
2785         those relating to zoom limits. The restoration happens in -[WKPasswordView hide],
2786         which is never called. Instead, the code added in r211160 just calls
2787         removeFromSuperview after unlocking, never restoring the old zoom limits,
2788         causing the then fully unlocked PDF to not be zoomable. Fix this by calling
2789         -hide instead of -removeFromSuperview (which -hide also calls).
2790
2791 2017-07-26  Brady Eidson  <beidson@apple.com>
2792
2793         Rename {Web/UI}Process/Storage to {Web/UI}Process/WebStorage.
2794         https://bugs.webkit.org/show_bug.cgi?id=174871
2795
2796         Reviewed by Chris Dumez.
2797
2798         The standard these directories help implement is the "Web Storage" standard.
2799         "Storage" is too general of a word that we have plans to start using in other contexts soon.
2800
2801         * CMakeLists.txt:
2802         * DerivedSources.make:
2803         * PlatformGTK.cmake:
2804         * PlatformMac.cmake:
2805         * PlatformWPE.cmake:
2806         * WebKit.xcodeproj/project.pbxproj:
2807
2808         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp: Renamed from Source/WebKit/UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp.
2809         * UIProcess/ResourceLoadStatisticsPersistentStorage.h: Renamed from Source/WebKit/UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h.
2810         * UIProcess/WebStorage/LocalStorageDatabase.cpp: Renamed from Source/WebKit/UIProcess/Storage/LocalStorageDatabase.cpp.
2811         * UIProcess/WebStorage/LocalStorageDatabase.h: Renamed from Source/WebKit/UIProcess/Storage/LocalStorageDatabase.h.
2812         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp: Renamed from Source/WebKit/UIProcess/Storage/LocalStorageDatabaseTracker.cpp.
2813         * UIProcess/WebStorage/LocalStorageDatabaseTracker.h: Renamed from Source/WebKit/UIProcess/Storage/LocalStorageDatabaseTracker.h.
2814         * UIProcess/WebStorage/StorageManager.cpp: Renamed from Source/WebKit/UIProcess/Storage/StorageManager.cpp.
2815         * UIProcess/WebStorage/StorageManager.h: Renamed from Source/WebKit/UIProcess/Storage/StorageManager.h.
2816         * UIProcess/WebStorage/StorageManager.messages.in: Renamed from Source/WebKit/UIProcess/Storage/StorageManager.messages.in.
2817         * UIProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm: Renamed from Source/WebKit/UIProcess/Storage/ios/LocalStorageDatabaseTrackerIOS.mm.
2818         * UIProcess/ios/ResourceLoadStatisticsPersistentStorageIOS.mm: Renamed from Source/WebKit/UIProcess/Storage/ios/ResourceLoadStatisticsPersistentStorageIOS.mm.
2819
2820         * WebProcess/WebStorage/StorageAreaImpl.cpp: Renamed from Source/WebKit/WebProcess/Storage/StorageAreaImpl.cpp.
2821         * WebProcess/WebStorage/StorageAreaImpl.h: Renamed from Source/WebKit/WebProcess/Storage/StorageAreaImpl.h.
2822         * WebProcess/WebStorage/StorageAreaMap.cpp: Renamed from Source/WebKit/WebProcess/Storage/StorageAreaMap.cpp.
2823         * WebProcess/WebStorage/StorageAreaMap.h: Renamed from Source/WebKit/WebProcess/Storage/StorageAreaMap.h.
2824         * WebProcess/WebStorage/StorageAreaMap.messages.in: Renamed from Source/WebKit/WebProcess/Storage/StorageAreaMap.messages.in.
2825         * WebProcess/WebStorage/StorageNamespaceImpl.cpp: Renamed from Source/WebKit/WebProcess/Storage/StorageNamespaceImpl.cpp.
2826         * WebProcess/WebStorage/StorageNamespaceImpl.h: Renamed from Source/WebKit/WebProcess/Storage/StorageNamespaceImpl.h.
2827         * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp: Renamed from Source/WebKit/WebProcess/Storage/WebStorageNamespaceProvider.cpp.
2828         * WebProcess/WebStorage/WebStorageNamespaceProvider.h: Renamed from Source/WebKit/WebProcess/Storage/WebStorageNamespaceProvider.h.
2829
2830 2017-07-26  Brady Eidson  <beidson@apple.com>
2831
2832         Remove DATABASE_PROCESS build flag.
2833         https://bugs.webkit.org/show_bug.cgi?id=174868
2834
2835         Reviewed by Andy Estes.
2836
2837         * CMakeLists.txt:
2838         * DatabaseProcess/DatabaseProcess.cpp:
2839         * DatabaseProcess/DatabaseProcess.h:
2840         * DatabaseProcess/DatabaseProcess.messages.in:
2841         * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
2842         * DatabaseProcess/DatabaseToWebProcessConnection.h:
2843         * DatabaseProcess/DatabaseToWebProcessConnection.messages.in:
2844         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
2845         * DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp:
2846         * DatabaseProcess/ios/DatabaseProcessIOS.mm:
2847         * DatabaseProcess/mac/DatabaseProcessMac.mm:
2848         * DatabaseProcess/unix/DatabaseProcessMainUnix.h:
2849         * Shared/Databases/DatabaseProcessCreationParameters.cpp:
2850         * Shared/Databases/DatabaseProcessCreationParameters.h:
2851         * Shared/ProcessExecutablePath.h:
2852         * Shared/gtk/ProcessExecutablePathGtk.cpp:
2853         (WebKit::executablePathOfDatabaseProcess):
2854         * Shared/wpe/ProcessExecutablePathWPE.cpp:
2855         (WebKit::executablePathOfDatabaseProcess):
2856         * UIProcess/ChildProcessProxy.cpp:
2857         (WebKit::ChildProcessProxy::getLaunchOptions):
2858         * UIProcess/Databases/DatabaseProcessProxy.cpp:
2859         * UIProcess/Databases/DatabaseProcessProxy.h:
2860         * UIProcess/Databases/DatabaseProcessProxy.messages.in:
2861         * UIProcess/Launcher/ProcessLauncher.h:
2862         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
2863         (WebKit::ProcessLauncher::launchProcess):
2864         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2865         (WebKit::serviceName):
2866         * UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp:
2867         (WebKit::ProcessLauncher::launchProcess):
2868         * UIProcess/Network/NetworkProcessProxy.cpp:
2869         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs):
2870         * UIProcess/WebProcessPool.cpp:
2871         (WebKit::WebProcessPool::databaseProcessCrashed):
2872         (WebKit::WebProcessPool::databaseProcessIdentifier):
2873         (WebKit::WebProcessPool::terminateDatabaseProcess):
2874         * UIProcess/WebProcessPool.h:
2875         (WebKit::WebProcessPool::sendToDatabaseProcessRelaunchingIfNecessary):
2876         * UIProcess/WebProcessProxy.cpp:
2877         (WebKit::WebProcessProxy::getDatabaseProcessConnection):
2878         * UIProcess/WebProcessProxy.h:
2879         * UIProcess/WebProcessProxy.messages.in:
2880         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2881         (WebKit::WebsiteDataStore::fetchDataAndApply):
2882         (WebKit::WebsiteDataStore::removeData):
2883         * WebKit2Prefix.h:
2884         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
2885         * WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
2886         * WebProcess/Databases/WebToDatabaseProcessConnection.h:
2887         * WebProcess/WebProcess.cpp:
2888         * WebProcess/WebProcess.h:
2889
2890 2017-07-26  Brady Eidson  <beidson@apple.com>
2891
2892         Add test to verify certain child processes are not launched as a side effect of enabling ResourceLoadStatistics.
2893         https://bugs.webkit.org/show_bug.cgi?id=174851
2894
2895         Reviewed by Chris Dumez.
2896
2897         * UIProcess/API/Cocoa/WKProcessPool.mm:
2898         (-[WKProcessPool _databaseProcessIdentifier]):
2899         (-[WKProcessPool _pluginProcessCount]):
2900         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2901
2902         * UIProcess/Plugins/PluginProcessManager.h:
2903         (WebKit::PluginProcessManager::pluginProcesses):
2904
2905 2017-07-26  Brian Burg  <bburg@apple.com>
2906
2907         Remove WEB_TIMING feature flag
2908         https://bugs.webkit.org/show_bug.cgi?id=174795
2909
2910         Reviewed by Alex Christensen.
2911
2912         * Configurations/FeatureDefines.xcconfig:
2913         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2914         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
2915         (WebKit::NetworkDataTaskSoup::createRequest):
2916         (WebKit::NetworkDataTaskSoup::didSendRequest):
2917         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
2918         (WebKit::NetworkDataTaskSoup::dispatchDidCompleteWithError):
2919         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
2920         (WebKit::NetworkDataTaskSoup::didGetHeaders):
2921         (WebKit::NetworkDataTaskSoup::didRestart):
2922         * NetworkProcess/soup/NetworkDataTaskSoup.h:
2923
2924 2017-07-26  Brian Burg  <bburg@apple.com>
2925
2926         Use SandboxExtension::HandleArray when sending extensions for file uploads to the web process
2927         https://bugs.webkit.org/show_bug.cgi?id=174828
2928
2929         Reviewed by Tim Horton.
2930
2931         In the previous change I forgot to hoist the HandleArray and message-send out of the
2932         loop, so the code wasn't actually sending fewer messages. That's fixed now.
2933
2934         * UIProcess/WebPageProxy.cpp:
2935         (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
2936         (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
2937
2938 2017-07-26  Zan Dobersek  <zdobersek@igalia.com>
2939
2940         Unreviewed. Fix a compiler warning that springs up when
2941         building the WPE port with Clang.
2942
2943         * UIProcess/API/wpe/ScrollGestureController.h:
2944         Let ScrollGestureController be a class, and not a struct.
2945         This fits the usual pattern, and also matches the forward
2946         declaration used in WPE's PageClientImpl.h.
2947
2948 2017-07-26  Carlos Garcia Campos  <cgarcia@igalia.com>
2949
2950         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.5 release.
2951
2952         * gtk/NEWS: Add release notes for 2.17.5.
2953
2954 2017-07-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2955
2956         Icon loader error on startup
2957         https://bugs.webkit.org/show_bug.cgi?id=174787
2958
2959         Reviewed by Brady Eidson.
2960
2961         Ignore non HTTP favicons in glib API.
2962
2963         * UIProcess/API/glib/WebKitIconLoadingClient.cpp:
2964
2965 2017-07-25  Brady Eidson  <beidson@apple.com>
2966
2967         ResourceLoadStatistics grandfathering happens much too often.
2968         <rdar://problem/32655834> and https://bugs.webkit.org/show_bug.cgi?id=174825
2969
2970         Reviewed by Chris Dumez.
2971
2972         The ResourceLoadStatistics grandfathering procedure happens too often.
2973         - With an empty memory store, even though an empty memory store is a perfectly valid state.
2974         - On each launch, even if grandfathering happened on the last launch - because grandfathering
2975           data would not automatically be saved to disk.
2976         - After clearing all website data, at which point no grandfathering can possibly be relevant
2977           because there is no data to grandfather.
2978
2979         This patch fixes those cases and adds API tests to verify they remain fixed.
2980
2981         * Shared/WebsiteData/WebsiteDataType.h:
2982
2983         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2984         (+[WKWebsiteDataStore _allWebsiteDataTypesIncludingPrivate]): allWebsiteDataTypes, but even with the private ones.
2985         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore]): If the types being cleared cover all of 
2986           the types that ResourceLoadStatistics care about, don't grandfather afterwards.
2987         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]): Ditto.
2988         (-[WKWebsiteDataStore _setResourceLoadStatisticsTestingCallback:]):
2989         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2990
2991         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp:
2992         (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk): Don't grandfather if the store read from 
2993           disk is empty (as being empty is perfectly fine), and also log the event of "populated without grandfathering".
2994         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h:
2995
2996         * UIProcess/WebProcessProxy.cpp:
2997         (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData):
2998
2999         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3000         (WebKit::WebResourceLoadStatisticsStore::monitoredDataTypes):
3001         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
3002         (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
3003         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): 
3004         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): Schedule a write right away so we don't re-grandfather
3005           on next launch, and also log the grandfathering event.
3006         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent): Takes a ShouldGrandfather flag
3007           to tell whether or not data should be re-grandfathered after the store is cleared.
3008         (WebKit::WebResourceLoadStatisticsStore::logTestingEvent): Log the event to the testing client.
3009         (WebKit::dataTypesToRemove): Deleted.
3010         * UIProcess/WebResourceLoadStatisticsStore.h:
3011
3012         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3013         (WebKit::WebsiteDataStore::removeData):
3014         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
3015         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback): Handles enabling ResourceLoadStatistics both
3016           with and without a testing callback.
3017         * UIProcess/WebsiteData/WebsiteDataStore.h:
3018
3019 2017-07-25  Andy Estes  <aestes@apple.com>
3020
3021         [Apple Pay] Add "carteBancaire" as a supported payment network
3022         https://bugs.webkit.org/show_bug.cgi?id=174841
3023         <rdar://problem/31935596>
3024
3025         Reviewed by Alex Christensen.
3026
3027         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3028         (WebKit::toSupportedNetwork):
3029
3030 2017-07-25  Brian Burg  <bburg@apple.com>
3031
3032         Use SandboxExtension::HandleArray when sending extensions for file uploads to the web process
3033         https://bugs.webkit.org/show_bug.cgi?id=174828
3034
3035         Reviewed by Tim Horton.
3036
3037         Send all of the sandbox extension handles in a single message, rather than
3038         one message per extension. Update message name and parameter types to match.
3039
3040         * UIProcess/WebPageProxy.cpp:
3041         (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
3042         (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
3043         * WebProcess/WebPage/WebPage.cpp:
3044         (WebKit::WebPage::extendSandboxForFilesFromOpenPanel):
3045         (WebKit::WebPage::extendSandboxForFileFromOpenPanel): Deleted.
3046         * WebProcess/WebPage/WebPage.h:
3047         * WebProcess/WebPage/WebPage.messages.in:
3048
3049 2017-07-25  Alex Christensen  <achristensen@webkit.org>
3050
3051         Fix API tests after r219871.
3052         https://bugs.webkit.org/show_bug.cgi?id=174807
3053
3054         WebKit2.OpenAndCloseWindowAsync and WebKit2.OpenAsyncWithNil API tests are fixed.
3055
3056         * UIProcess/WebPageProxy.cpp:
3057         (WebKit::WebPageProxy::createNewPage):
3058         createNewPageAsync or createNewPage should be called, not both.
3059
3060 2017-07-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
3061
3062         Async image decoding for large images should be disabled after the first time a tile is painted
3063         https://bugs.webkit.org/show_bug.cgi?id=174451
3064         <rdar://problem/31246421>
3065
3066         Reviewed by Simon Fraser.
3067
3068         * Shared/mac/RemoteLayerBackingStore.mm:
3069         (WebKit::RemoteLayerBackingStore::drawInContext):
3070         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
3071         (WebKit::imageForRect):
3072         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
3073         (WebKit::InjectedBundleRangeHandle::renderedImage):
3074         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
3075         (WebKit::CompositingCoordinator::paintContents):
3076         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
3077
3078 2017-07-25  Brian Burg  <bburg@apple.com>
3079
3080         Web Automation: add support for uploading files
3081         https://bugs.webkit.org/show_bug.cgi?id=174797
3082         <rdar://problem/28485063>
3083
3084         Reviewed by Joseph Pecoraro.
3085
3086         The general strategy is to have automation clients set the list of files they want
3087         to select ahead of time. Then, the client simulates a click on the <input type="file"> element.
3088         When that causes WebPageProxy to ask the UI delegate to runOpenPanel, it instead
3089         gives WebAutomationSession a chance to select files if the page is under control of
3090         automation. WebAutomationSession validates its file list and selects the files if valid.
3091
3092         * CMakeLists.txt: Add frontend dispatcher files.
3093         * DerivedSources.make:
3094         Add frontend dispatcher code generator scripts as dependencies of the generated code.
3095         Add generated frontend dispatcher files to the list of output files.
3096
3097         * UIProcess/Automation/Automation.json:
3098         Add a command to set the canned list of files that should be selected when prompted.
3099         If no files are selected, then the effect is as if the user had clicked "cancel" in
3100         the file chooser dialog.
3101
3102         Add an event to signal to the WebDriver service that the file selection request has
3103         been either fulfilled or cancelled. This event is necessary because otherwise remotes
3104         cannot distinguish whether selecting the files failed for some reason, or if the
3105         UIProcess has not yet selected the files and sent them to the web content process.
3106         In either case, the input element's "files" attribute would return an empty FileList.
3107
3108         * UIProcess/Automation/WebAutomationSession.h:
3109         * UIProcess/Automation/WebAutomationSession.cpp:
3110         (WebKit::WebAutomationSession::WebAutomationSession):
3111         Add the frontend dispatcher for Automation domain. This is named m_domainNotifier since
3112         m_domainDispatcher is already being used for the backend command dispatcher.
3113
3114         (WebKit::WebAutomationSession::handleRunOpenPanel):
3115         Validate that the files-to-select list has valid entries and select the files if so.
3116         If anything goes wrong, pretend to cancel out of the file chooser. Either way, notify the
3117         frontend with an event that the file chooser was dismissed due to selecting files or cancelling.
3118         Automation protocol clients may implement additional strategies to further restrict
3119         the conditions upon which local files can be uploaded.
3120
3121         (WebKit::WebAutomationSession::setFilesToSelectForFileUpload): Added.
3122         Store the list of files as a vector of strings. The file list is always replaced.
3123
3124         * UIProcess/WebPageProxy.cpp:
3125         (WebKit::WebPageProxy::runOpenPanel):
3126         If the page is under automation, delegating the runOpenPanel is likely to hang
3127         because WebDriver cannot interact directly with the file chooser dialog. Instead,
3128         give WebAutomationSession a chance to select files and don't tell the delegate.
3129
3130         * WebKit.xcodeproj/project.pbxproj:
3131         Add frontend dispatcher files to "Derived Sources" group.
3132
3133 2017-07-25  Alex Christensen  <achristensen@webkit.org>
3134
3135         Modernize NavigationAction code
3136         https://bugs.webkit.org/show_bug.cgi?id=174807
3137
3138         Reviewed by Darin Adler.
3139
3140         Mostly just use more move semantics.
3141
3142         * Platform/IPC/HandleMessage.h:
3143         (IPC::callMemberFunctionImpl):
3144         * Shared/API/APIURLRequest.h:
3145         * Shared/NavigationActionData.h:
3146         * UIProcess/API/APINavigation.cpp:
3147         (API::Navigation::Navigation):
3148         * UIProcess/API/APINavigation.h:
3149         (API::Navigation::create):
3150         * UIProcess/API/APINavigationAction.h:
3151         * UIProcess/API/APINavigationClient.h:
3152         (API::NavigationClient::decidePolicyForNavigationAction):
3153         * UIProcess/API/APIPolicyClient.h:
3154         * UIProcess/API/APIUIClient.h:
3155         (API::UIClient::createNewPage):
3156         (API::UIClient::createNewPageAsync):
3157         (API::UIClient::canCreateNewPageAsync):
3158         * UIProcess/API/C/WKPage.cpp:
3159         (WKPageLoadURLRequest):
3160         (WKPageLoadURLRequestWithUserData):
3161         (WKPageSetPageUIClient):
3162         (WKPageSetPageNavigationClient):
3163         * UIProcess/Cocoa/NavigationState.h:
3164         * UIProcess/Cocoa/NavigationState.mm:
3165         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
3166         * UIProcess/Cocoa/UIDelegate.h:
3167         * UIProcess/Cocoa/UIDelegate.mm:
3168         (WebKit::UIDelegate::UIClient::createNewPageCommon):
3169         (WebKit::UIDelegate::UIClient::createNewPage):
3170         (WebKit::UIDelegate::UIClient::canCreateNewPageAsync):
3171         (WebKit::UIDelegate::UIClient::createNewPageAsync):
3172         * UIProcess/WebInspectorProxy.cpp:
3173         (WebKit::decidePolicyForNavigationAction):
3174         * UIProcess/WebNavigationState.cpp:
3175         (WebKit::WebNavigationState::createLoadRequestNavigation):
3176         * UIProcess/WebNavigationState.h:
3177         * UIProcess/WebPageProxy.cpp:
3178         (WebKit::WebPageProxy::loadRequest):
3179         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3180         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
3181         (WebKit::WebPageProxy::createNewPage):
3182         * UIProcess/WebPageProxy.h:
3183
3184 2017-07-25  Carlos Garcia Campos  <cgarcia@igalia.com>
3185
3186         REGRESSION(r218629): [GTK] ASSERTION FAILED: m_eglDisplay == EGL_NO_DISPLAY in WebCore::PlatformDisplay::~PlatformDisplay
3187         https://bugs.webkit.org/show_bug.cgi?id=174789
3188
3189         Reviewed by Žan Doberšek.
3190
3191         Before r218629, the wayland nested compositor display was a singleton created on demand by
3192         AcceleratedSurfaceWayland, but now it's created unconditionally on web process creation when a valid display
3193         name is received from the UI process. The side effect of this is that now the shared display is created after
3194         the nested compositor display that is not a singleton anymore. The atexit used by PlatformDisplay to shutdown
3195         egl display assumes that it will be registered by the shared display. Since we switched to on demand AC mode,
3196         the shared display is only used in the web process when entering AC mode, that's why it only crashes when we
3197         have entered AC at least once. We just need to ensure that the shared display is created before the nested
3198         compositor display.
3199
3200         * WebProcess/gtk/WaylandCompositorDisplay.cpp:
3201         (WebKit::WaylandCompositorDisplay::create): Check we are under wayland before creating the WaylandCompositorDisplay.
3202
3203 2017-07-24  Michael Catanzaro  <mcatanzaro@igalia.com>
3204
3205         [GTK] ASSERTION FAILED: client in WebKit::IconDatabase::setClient
3206         https://bugs.webkit.org/show_bug.cgi?id=174788
3207
3208         Reviewed by Carlos Garcia Campos.
3209
3210         IconDatabase ensures that setClient is never called with nullptr, but WebKitFaviconDatabase
3211         does exactly that. First, ensure it's safe to unset the client. Next, we can either remove
3212         the assertions from setClient or else automatically unset the client in IconDatabase::close.
3213         I opted to do both.
3214
3215         * UIProcess/API/glib/IconDatabase.cpp:
3216         (WebKit::IconDatabase::close):
3217         (WebKit::IconDatabase::setIconDataForIconURL):
3218         (WebKit::IconDatabase::setIconURLForPageURL):
3219         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
3220         (_WebKitFaviconDatabasePrivate::~_WebKitFaviconDatabasePrivate): Deleted.
3221         (webkitFaviconDatabaseDispose): Deleted.
3222
3223 2017-07-24  Michael Catanzaro  <mcatanzaro@igalia.com>
3224
3225         [GTK][WPE] Remove useless conditional in IconDatabase::setIconDataForIconURL
3226         https://bugs.webkit.org/show_bug.cgi?id=174792
3227
3228         Reviewed by Carlos Garcia Campos.
3229
3230         We have in IconDatabase::setIconDataForIconURL some code in a conditional to check if it's
3231         not being executed on the icon sync thread. But at the top of the function is an assertion
3232         to ensure the code is never executed on the icon sync thread. The condition is therefore
3233         useless and the code should be executed unconditionally.
3234
3235         * UIProcess/API/glib/IconDatabase.cpp:
3236         (WebKit::IconDatabase::setIconDataForIconURL):
3237
3238 2017-07-24  Carlos Garcia Campos  <cgarcia@igalia.com>
3239
3240         [GTK] Icon database error and crash
3241         https://bugs.webkit.org/show_bug.cgi?id=174760
3242
3243         Reviewed by Michael Catanzaro.
3244
3245         The crash is a debug ASSERT that happens when the IconRecord image is created in one thread and destroyed in
3246         another one. IconDatabase creates and destroys IconRecord objects in both database and main thread. The
3247         IconRecord is destroyed when the icon is no longer retained, and we only release icons when we fail to get the
3248         image data (including pages that don't have a favicon). We can prevent this crash from happening if we ensure we
3249         never create an Image for an IconRecord when the given image data is nullptr.
3250
3251         * UIProcess/API/glib/IconDatabase.cpp:
3252         (WebKit::IconDatabase::IconRecord::setImageData):
3253
3254 2017-07-24  Chris Dumez  <cdumez@apple.com>
3255
3256         [WK2][Cocoa] Allow overriding the ITP data removal internal using a default
3257         https://bugs.webkit.org/show_bug.cgi?id=174802
3258         <rdar://problem/33497898>
3259
3260         Reviewed by Sam Weinig.
3261
3262         Allow overriding the ITP data removal internal using a default to facilitate testing.
3263         Can be used like so:
3264         defaults write -g ResourceLoadStatisticsMinimumTimeBetweenDataRecordsRemoval 60
3265
3266         Will cause us to write every 60 seconds instead of 3600.
3267
3268         * Shared/WebPreferencesDefinitions.h:
3269         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
3270         (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
3271
3272 2017-07-24  Simon Fraser  <simon.fraser@apple.com>
3273
3274         [iOS WK2] Crash under PageOverlayController::uninstallPageOverlay when doing multiple finds
3275         https://bugs.webkit.org/show_bug.cgi?id=174806
3276         rdar://problem/33501664
3277
3278         Reviewed by Tim Horton.
3279         
3280         Calling TextIndicator::createWithSelectionInFrame can trigger layout via VisibleSelection code,
3281         which can re-enter FindController::updateFindIndicator which has by now removed m_findIndicatorOverlay
3282         from pageOverlayController's map, but not deleted it. The second call to uninstallPageOverlay()
3283         thus crashes at m_overlayGraphicsLayers.take(&overlay)->removeFromParent().
3284         
3285         Fix by nulling out m_findIndicatorOverlay as soon as we uninstall it.
3286
3287         * WebProcess/WebPage/ios/FindControllerIOS.mm:
3288         (WebKit::FindController::updateFindIndicator):
3289
3290 2017-07-24  Chris Dumez  <cdumez@apple.com>
3291
3292         Fix lifetime management issue in ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore()
3293         https://bugs.webkit.org/show_bug.cgi?id=174790
3294
3295         Reviewed by Brady Eidson.
3296
3297         Fix lifetime management issue in ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore().
3298         WorkQueue::dispatchAfter() keeps the WorkQueue alive because its implementation keeps a strong ref to
3299         |this|. As a result, the lambda passed to dispatchAfter(), which calls writeMemoryStoreToDisk(), can
3300         get executed after the store is gone.
3301
3302         To address the issue, we now use a RunLoop::Timer to schedule the write, instead of a
3303         WorkQueue::dispatchAfter() call. This way, we are guaranteed that the callback will not get called
3304         after the store has been destroyed.
3305
3306         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp:
3307         (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
3308         (WebKit::ResourceLoadStatisticsPersistentStorage::asyncWriteTimerFired):
3309         (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
3310         (WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously):
3311         (WebKit::ResourceLoadStatisticsPersistentStorage::ref):
3312         (WebKit::ResourceLoadStatisticsPersistentStorage::deref):
3313         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h:
3314
3315 2017-07-24  Chris Dumez  <cdumez@apple.com>
3316
3317         Unreviewed, rolling out r219828.
3318
3319         Causes debug assertions to be hit on iOS
3320
3321         Reverted changeset:
3322
3323         "Fix lifetime management issue in
3324         ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore()"
3325         https://bugs.webkit.org/show_bug.cgi?id=174790
3326         http://trac.webkit.org/changeset/219828
3327
3328 2017-07-24  Michael Catanzaro  <mcatanzaro@igalia.com>
3329
3330         [GTK][WPE] Stop using AutodrainedPool in IconDatabase
3331         https://bugs.webkit.org/show_bug.cgi?id=174791
3332
3333         Reviewed by Alex Christensen.
3334
3335         AutodrainedPool seems to be some NS garbage collection thing that has no implementation on
3336         other platforms. Now that IconDatabase is used only by GTK and WPE, we can stop using it.
3337
3338         * UIProcess/API/glib/IconDatabase.cpp:
3339         (WebKit::IconDatabase::setIconDataForIconURL):
3340         (WebKit::IconDatabase::setIconURLForPageURL):
3341         (WebKit::IconDatabase::iconDatabaseSyncThread):
3342         (WebKit::IconDatabase::performURLImport):
3343         (WebKit::IconDatabase::readFromDatabase):
3344
3345 2017-07-24  Chris Dumez  <cdumez@apple.com>
3346
3347         Fix lifetime management issue in ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore()
3348         https://bugs.webkit.org/show_bug.cgi?id=174790
3349
3350         Reviewed by Brady Eidson.
3351
3352         Fix lifetime management issue in ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore().
3353         WorkQueue::dispatchAfter() keeps the WorkQueue alive because its implementation keeps a strong ref to
3354         |this|. As a result, the lambda passed to dispatchAfter(), which calls writeMemoryStoreToDisk(), can
3355         get executed after the store is gone.
3356
3357         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp:
3358         (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
3359         (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
3360         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h:
3361         (WebKit::ResourceLoadStatisticsPersistentStorage::createWeakPtr):
3362
3363 2017-07-23  Carlos Garcia Campos  <cgarcia@igalia.com>
3364
3365         Unreviewed. REGRESSION(r219713): [GTK][WPE] Fix default favicon database patch.
3366
3367         When nullptr is passed to webkit_web_context_set_favicon_database_directory() the default database directory was
3368         taken from WebProcessPool::platformDefaultIconDatabasePath(), that has been removed in r219713 without properly
3369         replacing it, now it uses an empty string. This causes that the current directory is used to create the favicon
3370         database.
3371
3372         * UIProcess/API/glib/WebKitWebContext.cpp:
3373         (webkit_web_context_set_favicon_database_directory): Use the default icon database directory instead of an empty
3374         string when nullptr is passed.
3375
3376 2017-07-23  Wenson Hsieh  <wenson_hsieh@apple.com>
3377
3378         [iOS WK2] 5 DataInteractionTests are failing: observed selection rects after dropping don't match expected values
3379         https://bugs.webkit.org/show_bug.cgi?id=174769
3380         <rdar://problem/33478864>
3381
3382         Reviewed by Tim Horton.
3383
3384         Fixes several API tests in the DataInteractionTests suite. See Source/WebCore/ChangeLog for more details.
3385
3386         * WebProcess/WebPage/WebPage.cpp:
3387         (WebKit::WebPage::performDragControllerAction):
3388
3389 2017-07-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3390
3391         WebDriver: implement page load timeout
3392         https://bugs.webkit.org/show_bug.cgi?id=174672
3393
3394         Reviewed by Brian Burg.
3395
3396         Always start a timer when waiting for a navigation to complete. When the timer fires, pending callbacks for
3397         navigations are removed and invoked with a timeout error. If navigation completes before the timer is fired,
3398         then the timer is stopped. All navigation commands now receive the page load strategy and timeout as optional
3399         parameters, when not provided the default timeout (300 seconds) is used.
3400
3401         * UIProcess/Automation/Automation.json:
3402         * UIProcess/Automation/WebAutomationSession.cpp:
3403         (WebKit::WebAutomationSession::WebAutomationSession):
3404         (WebKit::WebAutomationSession::waitForNavigationToComplete):
3405         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage):
3406         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame):
3407         (WebKit::WebAutomationSession::loadTimerFired):
3408         (WebKit::WebAutomationSession::navigateBrowsingContext):
3409         (WebKit::WebAutomationSession::goBackInBrowsingContext):
3410         (WebKit::WebAutomationSession::goForwardInBrowsingContext):
3411         (WebKit::WebAutomationSession::reloadBrowsingContext):
3412         (WebKit::WebAutomationSession::navigationOccurredForFrame):
3413         * UIProcess/Automation/WebAutomationSession.h:
3414
3415 2017-07-23  Takuro Ashie  <ashie@clear-code.com>
3416
3417         [GTK] Correct a typo in the reference manual of WebKitWebInspector
3418         https://bugs.webkit.org/show_bug.cgi?id=174767
3419
3420         Reviewed by Michael Catanzaro.
3421
3422         * UIProcess/API/gtk/WebKitWebInspector.cpp:
3423
3424 2017-07-23  Chris Dumez  <cdumez@apple.com>
3425
3426         Drop ExceptionCodeDescription class
3427         https://bugs.webkit.org/show_bug.cgi?id=174757
3428
3429         Reviewed by Darin Adler.
3430
3431         Update GTK bindings to use new API on DOMException instead of
3432         ExceptionCodeDescription.
3433
3434         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
3435         (webkit_dom_attr_dispatch_event):
3436         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.cpp:
3437         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
3438         (webkit_dom_cdata_section_dispatch_event):
3439         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
3440         (webkit_dom_css_rule_set_css_text):
3441         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
3442         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
3443         (webkit_dom_css_style_declaration_set_property):
3444         (webkit_dom_css_style_declaration_set_css_text):
3445         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
3446         (webkit_dom_css_style_sheet_insert_rule):
3447         (webkit_dom_css_style_sheet_delete_rule):
3448         (webkit_dom_css_style_sheet_add_rule):
3449         (webkit_dom_css_style_sheet_remove_rule):
3450         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
3451         (webkit_dom_css_value_set_css_text):
3452         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
3453         (webkit_dom_character_data_dispatch_event):
3454         (webkit_dom_character_data_insert_data):
3455         (webkit_dom_character_data_delete_data):
3456         (webkit_dom_character_data_replace_data):
3457         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
3458         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
3459         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
3460         (webkit_dom_comment_dispatch_event):
3461         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:
3462         (webkit_dom_dom_implementation_create_document_type):
3463         (webkit_dom_dom_implementation_create_document):
3464         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
3465         (webkit_dom_dom_selection_collapse_to_end):
3466         (webkit_dom_dom_selection_collapse_to_start):
3467         (webkit_dom_dom_selection_extend):
3468         (webkit_dom_dom_selection_get_range_at):
3469         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
3470         (webkit_dom_dom_token_list_add):
3471         (webkit_dom_dom_token_list_remove):
3472         (webkit_dom_dom_token_list_toggle):
3473         (webkit_dom_dom_token_list_replace):
3474         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
3475         (webkit_dom_dom_window_dispatch_event):
3476         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
3477         (webkit_dom_node_set_prefix):
3478         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
3479         (webkit_dom_document_dispatch_event):
3480         (webkit_dom_document_create_element):
3481         (webkit_dom_document_create_cdata_section):
3482         (webkit_dom_document_create_processing_instruction):
3483         (webkit_dom_document_create_attribute):
3484         (webkit_dom_document_import_node):
3485         (webkit_dom_document_create_element_ns):
3486         (webkit_dom_document_create_attribute_ns):
3487         (webkit_dom_document_adopt_node):
3488         (webkit_dom_document_create_event):
3489         (webkit_dom_document_create_expression):
3490         (webkit_dom_document_evaluate):
3491         (webkit_dom_document_query_selector):
3492         (webkit_dom_document_query_selector_all):
3493         (webkit_dom_document_set_xml_version):
3494         (webkit_dom_document_set_cookie):
3495         (webkit_dom_document_set_body):
3496         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
3497         (webkit_dom_document_fragment_dispatch_event):
3498         (webkit_dom_document_fragment_query_selector):
3499         (webkit_dom_document_fragment_query_selector_all):
3500         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
3501         (webkit_dom_document_type_dispatch_event):
3502         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
3503         (webkit_dom_element_dispatch_event):
3504         (webkit_dom_element_set_attribute):
3505         (webkit_dom_element_set_attribute_node):
3506         (webkit_dom_element_remove_attribute_node):
3507         (webkit_dom_element_set_attribute_ns):
3508         (webkit_dom_element_set_attribute_node_ns):
3509         (webkit_dom_element_matches):
3510         (webkit_dom_element_closest):
3511         (webkit_dom_element_insert_adjacent_element):
3512         (webkit_dom_element_insert_adjacent_html):
3513         (webkit_dom_element_insert_adjacent_text):
3514         (webkit_dom_element_remove):
3515         (webkit_dom_element_query_selector):
3516         (webkit_dom_element_query_selector_all):
3517         (webkit_dom_element_set_inner_html):
3518         (webkit_dom_element_set_outer_html):
3519         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
3520         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp: