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