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