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