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