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