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