Dragging & dropping a file creates an attachment element even when it's disabled
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2017-09-12  Ryosuke Niwa  <rniwa@webkit.org>
2
3         Dragging & dropping a file creates an attachment element even when it's disabled
4         https://bugs.webkit.org/show_bug.cgi?id=176769
5
6         Reviewed by Tim Horton.
7
8         * UIProcess/API/C/WKPreferences.cpp:
9         (WKPreferencesSetAttachmentElementEnabled):
10         (WKPreferencesGetAttachmentElementEnabled):
11         * UIProcess/API/C/WKPreferencesRefPrivate.h:
12         * WebProcess/WebPage/WebPage.cpp:
13         (WebKit::WebPage::updatePreferences):
14
15 2017-09-12  Youenn Fablet  <youenn@apple.com>
16
17         Introduce a RecordData for Cache to efficiently check whether it matches a corresponding request or not
18         https://bugs.webkit.org/show_bug.cgi?id=176579
19
20         Reviewed by Alex Christensen.
21
22         Introducing RecordData that splits its stored data in mandatory data,
23         used to check a record with a request and optional data that is
24         necessary to build a CacheStorageEngine::Record used by WebProcess.
25
26         The mandatory data contains the URL, Vary header information and identifiers.
27         Adding routines to go from a Record to RecordData and vice versa.
28         Storing in CacheStorage::Cache RecordData instead of Record.
29
30         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
31         (WebKit::CacheStorage::queryCache):
32         (WebKit::CacheStorage::updateVaryInformation):
33         (WebKit::CacheStorage::toRecord):
34         (WebKit::CacheStorage::toRecordData):
35         (WebKit::CacheStorage::Cache::retrieveRecords const):
36         (WebKit::CacheStorage::Cache::addRecord):
37         (WebKit::CacheStorage::Cache::recordsFromURL):
38         (WebKit::CacheStorage::Cache::recordsFromURL const):
39         (WebKit::CacheStorage::Cache::put):
40         (WebKit::CacheStorage::Cache::writeRecordToDisk):
41         (WebKit::CacheStorage::Cache::removeRecordFromDisk):
42         * NetworkProcess/cache/CacheStorageEngineCache.h:
43
44 2017-09-12  Dan Bernstein  <mitz@apple.com>
45
46         Tried to fix the iOS 10 build after r221930.
47
48         * UIProcess/API/Cocoa/WKWebView.mm:
49         (-[WKWebView _initializeWithConfiguration:]):
50         (-[WKWebView _setDragInteractionPolicy:]):
51
52 2017-09-12  Dan Bernstein  <mitz@apple.com>
53
54         Update availability annotations to match the macOS 10.13 and iOS 11.0 GM seed SDKs
55         https://bugs.webkit.org/show_bug.cgi?id=176793
56
57         Reviewed by Tim Horton.
58
59         Changed WK_MAC_TBA and WK_IOS_TBA to 10.13 and 11.0, respectively, in all declarations that
60         appear in the GM seed SDKs. Additional changes and exceptions are noted below.
61
62         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Added missing availability annotation to
63           -_webView:dataOwnerForDropSession: and -_webView:dataOwnerForDragSession:.
64
65         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Removed rednundant
66           __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 guards.
67
68         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: Added missing availability annotation to
69           -_setResourceLoadStatisticsTestingCallback:.
70
71         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h: Added missing availability annotation.
72
73         * UIProcess/API/Cocoa/_WKLinkIconParameters.h: Added availability annotation that had been
74           missing since macOS 10.12.3 and iOS 10.3. Corrected annotation for _WKLinkIconParameters.
75
76         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: Added missing TBA annotation to
77           _resourceLoadStatisticsDirectory.
78
79         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h: Removed iOS
80           availability from macOS-only declaration and vice versa.
81
82         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm:
83         (-[WKWebProcessPlugInRangeHandle detectDataWithTypes:context:]): Removed an availability
84           annotation from this method implementation.
85
86         * Shared/API/Cocoa/WKDragDestinationAction.h:
87         * UIProcess/API/Cocoa/WKContentRuleList.h:
88         * UIProcess/API/Cocoa/WKContentRuleListStore.h:
89         * UIProcess/API/Cocoa/WKError.h:
90         * UIProcess/API/Cocoa/WKFrameInfo.h:
91         * UIProcess/API/Cocoa/WKHTTPCookieStore.h:
92         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
93         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
94         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
95         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
96         * UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
97         * UIProcess/API/Cocoa/WKURLSchemeHandler.h:
98         * UIProcess/API/Cocoa/WKURLSchemeTask.h:
99         * UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h:
100         * UIProcess/API/Cocoa/WKUserContentController.h:
101         * UIProcess/API/Cocoa/WKWebView.h:
102         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
103         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
104         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
105         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
106         * UIProcess/API/Cocoa/WKWindowFeaturesPrivate.h:
107         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
108         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
109         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
110         * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h:
111         * UIProcess/API/Cocoa/_WKGeolocationPosition.h:
112         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
113         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
114         * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
115         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
116         * UIProcess/_WKWebViewPrintFormatter.h:
117         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
118         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h:
119         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
120
121 2017-09-12  Alex Christensen  <achristensen@webkit.org>
122
123         Add WKUIDelegatePrivate equivalent of WKPageUIClient's runModal
124         https://bugs.webkit.org/show_bug.cgi?id=176728
125         <rdar://problem/29270035>
126         
127         Covered by a new API test.
128
129         Reviewed by Tim Horton.
130
131         * UIProcess/API/APIUIClient.h:
132         (API::UIClient::runModal):
133         * UIProcess/API/C/WKPage.cpp:
134         (WKPageSetPageUIClient):
135         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
136         * UIProcess/Cocoa/UIDelegate.h:
137         * UIProcess/Cocoa/UIDelegate.mm:
138         (WebKit::UIDelegate::setDelegate):
139         (WebKit::UIDelegate::UIClient::canRunModal const):
140         (WebKit::UIDelegate::UIClient::runModal):
141         * UIProcess/WebPageProxy.cpp:
142         (WebKit::WebPageProxy::runModal):
143
144 2017-09-12  Alex Christensen  <achristensen@webkit.org>
145
146         Add WKUIDelegatePrivate equivalent of WKPageUIClient's decidePolicyForNotificationPermissionRequest
147         https://bugs.webkit.org/show_bug.cgi?id=176768
148         <rdar://problem/29270035>
149
150         Reviewed by Tim Horton.
151
152         Covered by a new API test.
153
154         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
155         * UIProcess/Cocoa/UIDelegate.h:
156         * UIProcess/Cocoa/UIDelegate.mm:
157         (WebKit::UIDelegate::setDelegate):
158         (WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel):
159         (WebKit::UIDelegate::UIClient::exceededDatabaseQuota):
160         (WebKit::UIDelegate::UIClient::decidePolicyForNotificationPermissionRequest):
161         (WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota):
162
163 2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
164
165         [iOS DnD] Support DataTransfer.setDragImage when starting a drag on iOS
166         https://bugs.webkit.org/show_bug.cgi?id=176721
167         <rdar://problem/34373660>
168
169         Reviewed by Tim Horton.
170
171         Rename elementBounds => dragPreviewFrameInRootViewCoordinates.
172
173         * UIProcess/ios/DragDropInteractionState.h:
174         * UIProcess/ios/DragDropInteractionState.mm:
175         (WebKit::DragDropInteractionState::previewForDragItem const):
176         (WebKit::DragDropInteractionState::stageDragItem):
177
178 2017-09-11  Tim Horton  <timothy_horton@apple.com>
179
180         REGRESSION (r221272): WKWebView gets stuck zoomed in if the web process crashes
181         https://bugs.webkit.org/show_bug.cgi?id=176767
182         <rdar://problem/34196874>
183
184         Reviewed by Dan Bernstein.
185
186         * UIProcess/API/Cocoa/WKWebView.mm:
187         (-[WKWebView _processDidExit]):
188         Reset the "last sent" layout parameters when the Web Content process exits.
189         They're no longer "last sent", and if we short-circuit from sending them
190         again (from under _didRelaunchProcess), we will never send the correct
191         layout width (until it changes).
192
193 2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
194
195         [iOS WK2] Support tapping to add items to the current drag session in web content
196         https://bugs.webkit.org/show_bug.cgi?id=176421
197         <rdar://problem/31144674>
198
199         Reviewed by Tim Horton.
200
201         To request additional drag items, end the current drag in the web page and try to begin a drag at the new
202         location. This process is transparent to the UI process, which still maintains the same UIDragSession with the
203         old drag source.
204
205         As opposed to firing a new event (for instance: `adddragitem`), this approach is taken to ensure that if the
206         page wants to preventDefault() on `dragstart`, it would also prevent the user from adding it as an additional
207         drag item. Using the new event approach, dealing with this case would either require the page to listen for a
208         new event and call preventDefault(), which would break compatibility with pages that only preventDefault() on
209         `dragstart`, or it would require the default behavior of this new event to be _not_ adding a drag item, in which
210         case this approach would require pages to adopt the new event in some form.
211
212         * WebProcess/WebPage/ios/WebPageIOS.mm:
213         (WebKit::WebPage::requestAdditionalItemsForDragSession):
214
215 2017-09-11  Alex Christensen  <achristensen@webkit.org>
216
217         Clean up API::UIClient
218         https://bugs.webkit.org/show_bug.cgi?id=176568
219
220         Reviewed by Brady Eidson.
221
222         We don't need createNewPage and createNewPageAsync.
223         An async version can support synchronous delegate calls by just calling the completion handler synchronously.
224
225         * UIProcess/API/APIUIClient.h:
226         (API::UIClient::createNewPage):
227         (API::UIClient::createNewPageAsync): Deleted.
228         (API::UIClient::canCreateNewPageAsync): Deleted.
229         * UIProcess/API/C/WKPage.cpp:
230         (WKPageSetPageUIClient):
231         * UIProcess/API/glib/WebKitUIClient.cpp:
232         * UIProcess/API/glib/WebKitUIClient.h:
233         * UIProcess/Cocoa/UIDelegate.h:
234         * UIProcess/Cocoa/UIDelegate.mm:
235         (WebKit::UIDelegate::UIClient::createNewPage):
236         (WebKit::UIDelegate::UIClient::createNewPageCommon): Deleted.
237         (WebKit::UIDelegate::UIClient::canCreateNewPageAsync): Deleted.
238         (WebKit::UIDelegate::UIClient::createNewPageAsync): Deleted.
239         * UIProcess/WebPageProxy.cpp:
240         (WebKit::WebPageProxy::createNewPage):
241         * UIProcess/WebPageProxy.h:
242
243 2017-09-11  Alex Christensen  <achristensen@webkit.org>
244
245         Fix memory leak introduced in r221894.
246         https://bugs.webkit.org/show_bug.cgi?id=176753
247
248         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
249         (WebKit::NotificationPermissionRequestManagerProxy::createRequest):
250         The NotificationPermissionRequestManagerProxy keeps track of pending requests
251         so they can be denied when invalidating the page.  We add them to a HashMap and in
252         r221894 I removed the code that removes them from that map once the request is complete.
253         This code adds the completed task removal back.
254         The NotificationPermissionRequestManagerProxy and WebPageProxy have the same lifetime,
255         so protecting the WebPageProxy (m_page) makes sure there is no use-after-free when the
256         completion handler is called.
257
258 2017-09-11  Alex Christensen  <achristensen@webkit.org>
259
260         Make NotificationPermissionRequest work with completion handlers
261         https://bugs.webkit.org/show_bug.cgi?id=176753
262
263         Reviewed by Andy Estes.
264
265         API::UIClient::decidePolicyForNotificationPermissionRequest should take a completion handler
266         which it will eventually call with a bool representing whether notifications are allowed.
267         To do this, I make NotificationPermissionRequest just a wrapper for a lambda.
268         One subtle change in behavior is when invalidating all outstanding requests, we deny them instead
269         of just dropping them.  This results in a deny message sent where there wasn't one before,
270         resulting in better cleanup in NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision.
271
272         * UIProcess/API/APIUIClient.h:
273         (API::UIClient::decidePolicyForNotificationPermissionRequest):
274         * UIProcess/API/C/WKPage.cpp:
275         (WKPageSetPageUIClient):
276         * UIProcess/Notifications/NotificationPermissionRequest.cpp: Removed.
277         * UIProcess/Notifications/NotificationPermissionRequest.h:
278         (WebKit::NotificationPermissionRequest::create):
279         (WebKit::NotificationPermissionRequest::allow):
280         (WebKit::NotificationPermissionRequest::deny):
281         (WebKit::NotificationPermissionRequest::NotificationPermissionRequest):
282         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
283         (WebKit::NotificationPermissionRequestManagerProxy::invalidateRequests):
284         (WebKit::NotificationPermissionRequestManagerProxy::createRequest):
285         (WebKit::NotificationPermissionRequestManagerProxy::didReceiveNotificationPermissionDecision): Deleted.
286         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h:
287         * UIProcess/WebPageProxy.cpp:
288         (WebKit::WebPageProxy::requestNotificationPermission):
289         * WebKit.xcodeproj/project.pbxproj:
290
291 2017-09-11  Alex Christensen  <achristensen@webkit.org>
292
293         Modernize and make API::UIClient more asynchronous
294         https://bugs.webkit.org/show_bug.cgi?id=176583
295
296         Reviewed by Brian Burg.
297
298         API::UIClient calls that return values synchronously require synchronous APIs unnecessarily.
299         Having them call completion handlers with the results instead allows us to make asynchronous
300         APIs, and existing synchronous APIs can just call the completion handlers immediately.
301         
302         Unfortunately an assumption that API::UIClient::windowFrame returns synchronously had worked
303         its way into the WebAutomationSession, which calls WebPageProxy::getWindowFrame.  Making it
304         asynchronous required making some automation protocols asynchronous so they can send their
305         result once they have the resulting frames from the UIClient.
306         
307         No change in behaviour.
308
309         * UIProcess/API/APIUIClient.h:
310         (API::UIClient::setToolbarsAreVisible):
311         (API::UIClient::menuBarIsVisible):
312         (API::UIClient::setMenuBarIsVisible):
313         (API::UIClient::statusBarIsVisible):
314         (API::UIClient::setStatusBarIsVisible):
315         (API::UIClient::isResizable):
316         (API::UIClient::setIsResizable):
317         (API::UIClient::setWindowFrame):
318         (API::UIClient::windowFrame):
319         (API::UIClient::headerHeight):
320         (API::UIClient::footerHeight):
321         (API::UIClient::drawHeader):
322         (API::UIClient::drawFooter):
323         (API::UIClient::printFrame):
324         * UIProcess/API/C/WKPage.cpp:
325         (WKPageSetPageUIClient):
326         * UIProcess/Automation/Automation.json:
327         * UIProcess/Automation/WebAutomationSession.cpp:
328         (WebKit::WebAutomationSession::buildBrowsingContextForPage):
329         (WebKit::WebAutomationSession::getNextContext):
330         (WebKit::WebAutomationSession::getBrowsingContexts):
331         (WebKit::WebAutomationSession::getBrowsingContext):
332         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
333         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
334         (WebKit::WebAutomationSession::performMouseInteraction):
335         * UIProcess/Automation/WebAutomationSession.h:
336         * UIProcess/Cocoa/UIDelegate.h:
337         * UIProcess/Cocoa/UIDelegate.mm:
338         (WebKit::UIDelegate::UIClient::printFrame):
339         * UIProcess/Cocoa/WebViewImpl.mm:
340         (WebKit::WebViewImpl::printOperationWithPrintInfo):
341         * UIProcess/WebPageProxy.cpp:
342         (WebKit::WebPageProxy::runJavaScriptPrompt):
343         (WebKit::WebPageProxy::setToolbarsAreVisible):
344         (WebKit::WebPageProxy::setMenuBarIsVisible):
345         (WebKit::WebPageProxy::getMenuBarIsVisible):
346         (WebKit::WebPageProxy::setStatusBarIsVisible):
347         (WebKit::WebPageProxy::getStatusBarIsVisible):
348         (WebKit::WebPageProxy::setIsResizable):
349         (WebKit::WebPageProxy::getIsResizable):
350         (WebKit::WebPageProxy::setWindowFrame):
351         (WebKit::WebPageProxy::getWindowFrame):
352         (WebKit::WebPageProxy::getWindowFrameWithCompletionHandler):
353         (WebKit::WebPageProxy::screenToRootView):
354         (WebKit::WebPageProxy::rootViewToScreen):
355         (WebKit::WebPageProxy::printFrame):
356         (WebKit::WebPageProxy::headerHeight):
357         (WebKit::WebPageProxy::footerHeight):
358         (WebKit::WebPageProxy::drawHeader):
359         (WebKit::WebPageProxy::drawFooter):
360         * UIProcess/WebPageProxy.h:
361         * UIProcess/WebPageProxy.messages.in:
362         * UIProcess/mac/WKPrintingView.h:
363         * UIProcess/mac/WKPrintingView.mm:
364         (-[WKPrintingView initWithFrameProxy:view:]):
365         (-[WKPrintingView _adjustPrintingMarginsForHeaderAndFooter]):
366         (-[WKPrintingView drawPageBorderWithSize:]):
367         * UIProcess/mac/WebPageProxyMac.mm:
368         (WebKit::WebPageProxy::windowAndViewFramesChanged):
369
370 2017-09-11  Stephan Szabo  <stephan.szabo@sony.com>
371
372         [WinCairo] Add entry Web Process files for wincairo webkit
373         https://bugs.webkit.org/show_bug.cgi?id=176570
374
375         Reviewed by Alex Christensen.
376
377         * PlatformWin.cmake:
378         * WebProcess/EntryPoint/win/WebProcessMain.cpp: Added.
379         * WebProcess/win/WebProcessMainWin.cpp: Added.
380         * WebProcess/win/WebProcessMainWin.h: Added.
381
382 2017-09-11  Alex Christensen  <achristensen@webkit.org>
383
384         Add WKUIDelegatePrivate equivalent of WKPageUIClient's decidePolicyForGeolocationPermissionRequest
385         https://bugs.webkit.org/show_bug.cgi?id=176642
386         <rdar://problem/29270035>
387
388         Reviewed by Darin Adler.
389
390         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
391         * UIProcess/Cocoa/UIDelegate.h:
392         * UIProcess/Cocoa/UIDelegate.mm:
393         (WebKit::UIDelegate::setDelegate):
394         (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
395         (WebKit::Function<void):
396
397 2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
398
399         [iOS DnD] Elements in the DOM with the `draggable` attribute should be draggable
400         https://bugs.webkit.org/show_bug.cgi?id=176664
401         <rdar://problem/32596156>
402
403         Reviewed by Tim Horton.
404
405         Makes a simple adjustment in DragDropInteractionState::previewForDragItem to respect the drag image supplied to
406         the UI process during a "DHTML"-defined drag (i.e. DragSourceActionDHTML).
407
408         Test: DataInteractionTests.CanStartDragOnDivWithDraggableAttribute
409
410         * UIProcess/API/Cocoa/WKWebView.mm:
411         (-[WKWebView _simulateDataInteractionEntered:]): Deleted.
412         (-[WKWebView _simulateDataInteractionUpdated:]): Deleted.
413         (-[WKWebView _simulateDataInteractionPerformOperation:]): Deleted.
414         (-[WKWebView _simulateDataInteractionEnded:]): Deleted.
415         (-[WKWebView _simulateDataInteractionSessionDidEnd:]): Deleted.
416         (-[WKWebView _simulateWillBeginDataInteractionWithSession:]): Deleted.
417         (-[WKWebView _simulatedItemsForSession:]): Deleted.
418         (-[WKWebView _simulateItemsForAddingToSession:atLocation:completion:]): Deleted.
419         (-[WKWebView _simulatePrepareForDataInteractionSession:completion:]): Deleted.
420
421         Remove all -_simulate*: testing helpers on WKWebView.
422
423         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
424         * UIProcess/ios/DragDropInteractionState.mm:
425         (WebKit::shouldUseDragImageToCreatePreviewForDragSource):
426         (WebKit::shouldUseTextIndicatorToCreatePreviewForDragSource):
427
428         Add shouldUseDragImageToCreatePreviewForDragSource, which returns YES when dragging an image or DHTML-defined
429         draggable element and the drag image exists. This is called from previewForDragItem when constructing the drag
430         preview for a given UIDragItem.
431
432         (WebKit::DragDropInteractionState::previewForDragItem const):
433         (WebKit::shouldUseTextIndicatorToCreatePreviewForDragAction): Deleted.
434         * UIProcess/ios/WKContentViewInteraction.h:
435         * UIProcess/ios/WKContentViewInteraction.mm:
436         (-[WKContentView _simulateDataInteractionEntered:]): Deleted.
437         (-[WKContentView _simulateDataInteractionUpdated:]): Deleted.
438         (-[WKContentView _simulateDataInteractionEnded:]): Deleted.
439         (-[WKContentView _simulateDataInteractionPerformOperation:]): Deleted.
440         (-[WKContentView _simulateDataInteractionSessionDidEnd:]): Deleted.
441         (-[WKContentView _simulateWillBeginDataInteractionWithSession:]): Deleted.
442         (-[WKContentView _simulatedItemsForSession:]): Deleted.
443         (-[WKContentView _simulatePrepareForDataInteractionSession:completion:]): Deleted.
444         (-[WKContentView _simulateItemsForAddingToSession:atLocation:completion:]): Deleted.
445
446         Remove all -_simulate*: testing helpers on WKContentView.
447
448 2017-09-11  Alex Christensen  <achristensen@webkit.org>
449
450         Modernize BoxExtent into RectEdges
451         https://bugs.webkit.org/show_bug.cgi?id=176437
452
453         Reviewed by Simon Fraser.
454
455         * Scripts/webkit/messages.py:
456         (class_template_headers):
457         * Shared/WebCoreArgumentCoders.h:
458         * UIProcess/WebPageProxy.h:
459         * UIProcess/WebPageProxy.messages.in:
460         * WebProcess/WebPage/WebPage.messages.in:
461
462 2017-09-11  Andy Estes  <aestes@apple.com>
463
464         [Mac] Upstream QTKit-related WebKitSystemInterface functions
465         https://bugs.webkit.org/show_bug.cgi?id=176472
466
467         Reviewed by Eric Carlson.
468
469         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
470         (InitWebCoreSystemInterface):
471
472 2017-09-11  JF Bastien  <jfbastien@apple.com>
473
474         cmake build fix
475
476         Unreviewed
477
478         * PlatformMac.cmake: one file was deleted, another renamed.
479
480 2017-09-10  Carlos Garcia Campos  <cgarcia@igalia.com>
481
482         REGRESSION: [GTK] Generated HTML API documentation is missing descriptions
483         https://bugs.webkit.org/show_bug.cgi?id=176667
484
485         Reviewed by Michael Catanzaro.
486
487         Fix several typos in API documentation.
488
489         * UIProcess/API/glib/WebKitSettings.cpp:
490         (webkit_settings_class_init):
491         * UIProcess/API/glib/WebKitWebView.cpp:
492         (webkit_web_view_class_init):
493         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
494         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
495
496 2017-09-10  Brady Eidson  <beidson@apple.com>
497
498         Try to avoid creating the default WKWebsiteDataStore until its actually needed.
499         <rdar://problem/33164453> and https://bugs.webkit.org/show_bug.cgi?id=176551
500
501         Reviewed by Tim Horton.
502
503         * UIProcess/API/APIHTTPCookieStore.cpp:
504         (API::HTTPCookieStore::cookies):
505         (API::HTTPCookieStore::setCookie):
506         (API::HTTPCookieStore::deleteCookie):
507
508         * UIProcess/API/APIWebsiteDataStore.cpp:
509         (API::WebsiteDataStore::defaultDataStore):
510         (API::WebsiteDataStore::defaultDataStoreExists):
511         * UIProcess/API/APIWebsiteDataStore.h:
512
513         * UIProcess/API/C/WKContext.cpp:
514         (WKContextGetWebsiteDataStore):
515
516         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
517         (+[WKWebsiteDataStore _defaultDataStoreExists]):
518         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
519
520         * UIProcess/WebProcessPool.cpp:
521         (WebKit::WebProcessPool::WebProcessPool):
522         (WebKit::m_hiddenPageThrottlingTimer):
523         (WebKit::WebProcessPool::ensureNetworkProcess):
524         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
525         (WebKit::WebProcessPool::warmInitialProcess):
526         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
527         (WebKit::WebProcessPool::createWebPage):
528         (WebKit::WebProcessPool::pageAddedToProcess):
529         * UIProcess/WebProcessPool.h:
530
531         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
532         (WebKit::WebsiteDataStore::isAssociatedProcessPool const):
533
534 2017-09-09  Mark Lam  <mark.lam@apple.com>
535
536         Avoid duplicate computations of ExecState::vm().
537         https://bugs.webkit.org/show_bug.cgi?id=176647
538
539         Reviewed by Saam Barati.
540
541         * WebProcess/Plugins/Netscape/JSNPMethod.h:
542         (WebKit::JSNPMethod::create):
543         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
544         (WebKit::NPJSObject::setProperty):
545         (WebKit::NPJSObject::removeProperty):
546         (WebKit::NPJSObject::enumerate):
547
548 2017-09-08  Joseph Pecoraro  <pecoraro@apple.com>
549
550         Fetch's Response.statusText is unexpectedly the full http status line for HTTP/2 responses
551         https://bugs.webkit.org/show_bug.cgi?id=176479
552
553         Reviewed by Alex Christensen.
554
555         * NetworkProcess/NetworkProcess.cpp:
556         (WebKit::NetworkProcess::initializeNetworkProcess):
557         Initialize AtomicString statics like emptyAtom().
558
559 2017-09-08  Commit Queue  <commit-queue@webkit.org>
560
561         Unreviewed, rolling out r221773.
562         https://bugs.webkit.org/show_bug.cgi?id=176614
563
564         This caused build failures. (Requested by mlewis13 on
565         #webkit).
566
567         Reverted changeset:
568
569         "[Mac] Upstream QTKit-related WebKitSystemInterface functions"
570         https://bugs.webkit.org/show_bug.cgi?id=176472
571         http://trac.webkit.org/changeset/221773
572
573 2017-09-08  Stephan Szabo  <stephan.szabo@am.sony.com>
574
575         [WinCairo] Add Storage Process files for wincairo webkit
576         https://bugs.webkit.org/show_bug.cgi?id=176567
577
578         Reviewed by Alex Christensen.
579
580         * PlatformWin.cmake:
581         * StorageProcess/EntryPoint/win/StorageProcessMain.cpp: Added.
582         (main):
583         * StorageProcess/win/StorageProcessMainWin.cpp: Added.
584         (WebKit::StorageProcessMainWin):
585         * StorageProcess/win/StorageProcessMainWin.h: Added.
586
587 2017-09-08  Ryan Haddad  <ryanhaddad@apple.com>
588
589         Unreviewed, rolling out r221771.
590
591         This change caused two API tests to crash.
592
593         Reverted changeset:
594
595         "Clean up API::UIClient"
596         https://bugs.webkit.org/show_bug.cgi?id=176568
597         http://trac.webkit.org/changeset/221771
598
599 2017-09-07  Carlos Garcia Campos  <cgarcia@igalia.com>
600
601         [GTK][WPE] UI process crash in WebBackForwardList::restoreFromState
602         https://bugs.webkit.org/show_bug.cgi?id=176303
603
604         Reviewed by Michael Catanzaro.
605
606         Ensure the current index provided by the session state is not out of actual item list bounds. This is a bug in
607         the session state decoder, but WebBackForwardList::backForwardListState() is already doing the check and using
608         the last item index instead, so it's not easy to know where the actual problem is. In any case we should
609         still protect the decoder.
610
611         * UIProcess/API/glib/WebKitWebViewSessionState.cpp:
612         (decodeSessionState):
613
614 2017-09-07  Andy Estes  <aestes@apple.com>
615
616         [Mac] Upstream QTKit-related WebKitSystemInterface functions
617         https://bugs.webkit.org/show_bug.cgi?id=176472
618
619         Reviewed by Eric Carlson.
620
621         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
622         (InitWebCoreSystemInterface):
623
624 2017-09-07  Alex Christensen  <achristensen@webkit.org>
625
626         Clean up API::UIClient
627         https://bugs.webkit.org/show_bug.cgi?id=176568
628
629         Reviewed by Brady Eidson.
630
631         We don't need createNewPage and createNewPageAsync.
632         An async version can support synchronous delegate calls by just calling the completion handler synchronously.
633
634         * UIProcess/API/APIUIClient.h:
635         (API::UIClient::createNewPage):
636         (API::UIClient::createNewPageAsync): Deleted.
637         (API::UIClient::canCreateNewPageAsync): Deleted.
638         * UIProcess/API/C/WKPage.cpp:
639         (WKPageSetPageUIClient):
640         * UIProcess/API/glib/WebKitUIClient.cpp:
641         * UIProcess/API/glib/WebKitUIClient.h:
642         * UIProcess/Cocoa/UIDelegate.h:
643         * UIProcess/Cocoa/UIDelegate.mm:
644         (WebKit::UIDelegate::UIClient::createNewPage):
645         (WebKit::UIDelegate::UIClient::createNewPageCommon): Deleted.
646         (WebKit::UIDelegate::UIClient::canCreateNewPageAsync): Deleted.
647         (WebKit::UIDelegate::UIClient::createNewPageAsync): Deleted.
648         * UIProcess/WebPageProxy.cpp:
649         (WebKit::WebPageProxy::createNewPage):
650         * UIProcess/WebPageProxy.h:
651
652 2017-09-07  Alex Christensen  <achristensen@webkit.org>
653
654         Make DragControllerAction an enum class
655         https://bugs.webkit.org/show_bug.cgi?id=176565
656
657         Reviewed by Andy Estes.
658
659         * Shared/DragControllerAction.h:
660         (): Deleted.
661         * UIProcess/WebPageProxy.cpp:
662         (WebKit::WebPageProxy::dragEntered):
663         (WebKit::WebPageProxy::dragUpdated):
664         (WebKit::WebPageProxy::dragExited):
665         (WebKit::WebPageProxy::performDragOperation):
666         * WebProcess/WebPage/WebPage.cpp:
667         (WebKit::WebPage::performDragControllerAction):
668         * WebProcess/WebPage/WebPage.h:
669         * WebProcess/WebPage/WebPage.messages.in:
670
671 2017-09-07  Myles C. Maxfield  <mmaxfield@apple.com>
672
673         [PAL] Unify PlatformUserPreferredLanguages.h with Language.h
674         https://bugs.webkit.org/show_bug.cgi?id=176561
675
676         Reviewed by Brent Fulgham.
677
678         * UIProcess/WebProcessPool.cpp:
679         * WebProcess/WebProcess.cpp:
680         (WebKit::WebProcess::userPreferredLanguagesChanged const):
681
682 2017-09-07  Youenn Fablet  <youenn@apple.com>
683
684         Remove entry from CacheStorageEngineConnection lock map when unlocking a Cache
685         https://bugs.webkit.org/show_bug.cgi?id=176548
686
687         Reviewed by Alex Christensen.
688
689         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
690         (WebKit::CacheStorageEngineConnection::dereference):
691
692 2017-09-07  Chris Dumez  <cdumez@apple.com>
693
694         [WK2] Add C API to retrieve the originating page of a WKDownload
695         https://bugs.webkit.org/show_bug.cgi?id=176557
696         <rdar://problem/34314776>
697
698         Reviewed by Alex Christensen.
699
700         Add C API to retrieve the original page of a WKDownload. This is the C API equivalent to
701         _WKDownload.originatingWebView which already exists in ObjC. The pointer is weak so as
702         to not keep alive the page for the duration of the download.
703
704         * UIProcess/API/C/WKDownload.cpp:
705         (WKDownloadGetOriginatingPage):
706         * UIProcess/API/C/WKDownload.h:
707         * UIProcess/API/Cocoa/_WKDownload.mm:
708         (-[_WKDownload originatingWebView]):
709         * UIProcess/API/Cocoa/_WKDownloadInternal.h:
710         * UIProcess/Downloads/DownloadProxy.cpp:
711         (WebKit::DownloadProxy::originatingPage const):
712         (WebKit::DownloadProxy::setOriginatingPage):
713         * UIProcess/Downloads/DownloadProxy.h:
714         * UIProcess/WebPageProxy.cpp:
715         (WebKit::WebPageProxy::receivedPolicyDecision):
716         * UIProcess/WebProcessPool.cpp:
717         (WebKit::WebProcessPool::download):
718         (WebKit::WebProcessPool::resumeDownload):
719         (WebKit::WebProcessPool::createDownloadProxy):
720         * UIProcess/WebProcessPool.h:
721         * UIProcess/ios/PageClientImplIOS.mm:
722         (WebKit::PageClientImpl::handleDownloadRequest):
723         * UIProcess/mac/PageClientImplMac.mm:
724         (WebKit::PageClientImpl::handleDownloadRequest):
725
726 2017-09-07  Alex Christensen  <achristensen@webkit.org>
727
728         Clean up Geolocation request handling
729         https://bugs.webkit.org/show_bug.cgi?id=176562
730
731         Reviewed by Tim Horton.
732
733         Instead of passing a GeolocationPermissionRequestProxy& to each client and returning a bool if the request will be handled,
734         pass a Function<void(bool)>&& completionHandler and return the function if it won't be handled.
735         This allows to temporarily support our UIClient/PageClient hybrid design while moving towards a sane design.
736
737         * UIProcess/API/APIUIClient.h:
738         (API::UIClient::Function<void):
739         (API::UIClient::decidePolicyForGeolocationPermissionRequest): Deleted.
740         * UIProcess/API/C/WKAPICast.h:
741         * UIProcess/API/C/WKGeolocationPermissionRequest.cpp:
742         (WKGeolocationPermissionRequestGetTypeID):
743         * UIProcess/API/C/WKPage.cpp:
744         (WKPageSetPageUIClient):
745         * UIProcess/GeolocationPermissionRequestProxy.cpp:
746         (WebKit::GeolocationPermissionRequestProxy::allow):
747         (WebKit::GeolocationPermissionRequestProxy::deny):
748         (WebKit::GeolocationPermissionRequestProxy::invalidate):
749         * UIProcess/GeolocationPermissionRequestProxy.h:
750         (WebKit::GeolocationPermissionRequest::create):
751         (WebKit::GeolocationPermissionRequest::allow):
752         (WebKit::GeolocationPermissionRequest::deny):
753         (WebKit::GeolocationPermissionRequest::GeolocationPermissionRequest):
754         * UIProcess/PageClient.h:
755         (WebKit::PageClient::decidePolicyForGeolocationPermissionRequest): Deleted.
756         * UIProcess/WebPageProxy.cpp:
757         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
758         * UIProcess/ios/PageClientImplIOS.h:
759         * UIProcess/ios/PageClientImplIOS.mm:
760         (WebKit::Function<void):
761         (WebKit::PageClientImpl::decidePolicyForGeolocationPermissionRequest): Deleted.
762         * UIProcess/ios/WKContentView.h:
763         * UIProcess/ios/WKGeolocationProviderIOS.h:
764         * UIProcess/ios/WKGeolocationProviderIOS.mm:
765         (-[WKGeolocationProviderIOS decidePolicyForGeolocationRequestFromOrigin:frame:completionHandler:view:]):
766         (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
767         (-[WKGeolocationProviderIOS geolocationAuthorizationDenied]):
768         (-[WKWebAllowDenyPolicyListener initWithCompletionHandler:]):
769         (-[WKWebAllowDenyPolicyListener allow]):
770         (-[WKWebAllowDenyPolicyListener deny]):
771         (-[WKGeolocationProviderIOS decidePolicyForGeolocationRequestFromOrigin:frame:request:view:]): Deleted.
772         (-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]): Deleted.
773
774 2017-09-07  Alex Christensen  <achristensen@webkit.org>
775
776         Allow modern decoding of enums and OptionSets
777         https://bugs.webkit.org/show_bug.cgi?id=176480
778
779         Reviewed by Andy Estes.
780
781         * Platform/IPC/ArgumentCoders.h:
782         (IPC::ArgumentCoder<OptionSet<T>>::decode):
783         * Platform/IPC/Decoder.h:
784         (IPC::Decoder::operator>>):
785         * Platform/IPC/Encoder.h:
786         * Shared/WebsitePolicies.h:
787         (WebKit::WebsitePolicies::encode const):
788         (WebKit::WebsitePolicies::decode):
789
790 2017-09-07  Frederic Wang  <fwang@igalia.com>
791
792          Move more code from ScrollingTreeScrollingNodeDelegateIOS to ScrollingTreeScrollingNodeDelegate
793          https://bugs.webkit.org/show_bug.cgi?id=174130
794
795          Reviewed by Simon Fraser.
796
797          * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h: Remove some members,
798          headers and pre-declaration that are moved into the delegate.
799          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollLayer): Deleted.
800          * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: Remove some headers and
801          WKOverflowScrollViewDelegate since they are moved into the delegate file. Also fix the
802          comment to closing the WebKit namespace.
803          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::~ScrollingTreeOverflowScrollingNodeIOS):
804          Remove some code moved into the delegate and call the corresponding helper function to
805          preserve the current behavior.
806          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren): Ditto.
807          Note that it is only necessary to cast the parameter to a ScrollingStateTreeNode.
808          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren): Ditto.
809          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange): Ditto.
810          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollPosition): Ditto.
811          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): Ditto.
812          (-[WKOverflowScrollViewDelegate initWithScrollingTreeNodeDelegate:]): Deleted.
813          (-[WKOverflowScrollViewDelegate scrollViewDidScroll:]): Deleted.
814          (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]): Deleted.
815          (-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Deleted.
816          (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): Deleted.
817          (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]): Deleted.
818          * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h: Import headers and members
819          from ScrollingTreeOverflowScrollingNodeIOS. Define new helper functions for the code imported
820          from ScrollingTreeOverflowScrollingNodeIOS. Remove the friendship with
821          ScrollingTreeOverflowScrollingNodeIOS and only makes public the function used by that class.
822          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollLayer): This function is moved from
823          ScrollingTreeOverflowScrollingNodeIOS.
824          * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: Add headers,
825          WKOverflowScrollViewDelegate (renamed WKScrollingNodeScrollViewDelegate) and some helper code
826          imported from ScrollingTreeOverflowScrollingNodeIOS.
827          (-[WKScrollingNodeScrollViewDelegate scrollViewDidScroll:]): Moved from
828          ScrollingTreeOverflowScrollingNodeIOS.
829          (-[WKScrollingNodeScrollViewDelegate scrollViewWillBeginDragging:]): Ditto.
830          (-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Ditto.
831          (-[WKScrollingNodeScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): Ditto.
832          (-[WKScrollingNodeScrollViewDelegate scrollViewDidEndDecelerating:]): Ditto.
833          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::~ScrollingTreeScrollingNodeDelegateIOS):
834          Import code from ScrollingTreeOverflowScrollingNodeIOS.
835          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::resetScrollViewDelegate): New helper function
836          importing code from ScrollingTreeOverflowScrollingNodeIOS.
837          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren): Ditto.
838          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren): Ditto.
839          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange): Ditto.
840          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollPosition): Ditto.
841          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::setScrollLayerPosition): Ditto.
842
843 2017-09-07  Chris Dumez  <cdumez@apple.com>
844
845         [WK2] Notify client when downloads are redirected
846         https://bugs.webkit.org/show_bug.cgi?id=176481
847         <rdar://problem/34309065>
848
849         Reviewed by Geoffrey Garen.
850
851         Notify client when downloads are redirected via both ObjC and C
852         API.
853
854         * NetworkProcess/Downloads/Download.cpp:
855         (WebKit::Download::willSendRedirectedRequest):
856         * NetworkProcess/Downloads/Download.h:
857         * NetworkProcess/Downloads/mac/DownloadMac.mm:
858         (-[WKDownloadAsDelegate download:willSendRequest:redirectResponse:]):
859         * UIProcess/API/APIDownloadClient.h:
860         (API::DownloadClient::willSendRequest):
861         * UIProcess/API/C/WKContext.cpp:
862         (WKContextSetDownloadClient):
863         * UIProcess/API/C/WKContextDownloadClient.h:
864         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
865         * UIProcess/Cocoa/DownloadClient.h:
866         * UIProcess/Cocoa/DownloadClient.mm:
867         (WebKit::DownloadClient::DownloadClient):
868         (WebKit::DownloadClient::willSendRequest):
869         * UIProcess/Downloads/DownloadProxy.cpp:
870         (WebKit::DownloadProxy::willSendRequest):
871         * UIProcess/Downloads/DownloadProxy.h:
872         * UIProcess/Downloads/DownloadProxy.messages.in:
873
874         * UIProcess/mac/WebContextMenuProxyMac.mm:
875         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
876         Set menu proxy before calling menuFromProposedMenu() client delegate.
877         This allows me to perform one of the menu item's action from the
878         menuFromProposedMenu() client delegate in my API test.
879
880 2017-09-07  Alex Christensen  <achristensen@webkit.org>
881
882         Modernize Geolocation code
883         https://bugs.webkit.org/show_bug.cgi?id=176496
884
885         Reviewed by Andy Estes.
886
887         Making the GeolocationPermissionRequestManager take a reference instead of a pointer
888         spilled into making the other supplement constructors do the same.
889
890         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.cpp:
891         (WebKit::LegacyCustomProtocolManager::LegacyCustomProtocolManager):
892         (WebKit::LegacyCustomProtocolManager::startLoading):
893         (WebKit::LegacyCustomProtocolManager::stopLoading):
894         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h:
895         * NetworkProcess/NetworkProcess.h:
896         (WebKit::NetworkProcess::addSupplement):
897         * Shared/Authentication/AuthenticationManager.cpp:
898         (WebKit::AuthenticationManager::AuthenticationManager):
899         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
900         * Shared/Authentication/AuthenticationManager.h:
901         * UIProcess/API/APIUIClient.h:
902         (API::UIClient::decidePolicyForGeolocationPermissionRequest):
903         * UIProcess/API/C/WKPage.cpp:
904         (WKPageSetPageUIClient):
905         * UIProcess/WebPageProxy.cpp:
906         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
907         * WebProcess/Cookies/WebCookieManager.cpp:
908         (WebKit::WebCookieManager::WebCookieManager):
909         (WebKit::WebCookieManager::getHostnamesWithCookies):
910         (WebKit::WebCookieManager::deleteCookie):
911         (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
912         (WebKit::WebCookieManager::getAllCookies):
913         (WebKit::WebCookieManager::getCookies):
914         (WebKit::WebCookieManager::setCookie):
915         (WebKit::WebCookieManager::setCookies):
916         (WebKit::WebCookieManager::notifyCookiesDidChange):
917         (WebKit::WebCookieManager::setHTTPCookieAcceptPolicy):
918         (WebKit::WebCookieManager::getHTTPCookieAcceptPolicy):
919         * WebProcess/Cookies/WebCookieManager.h:
920         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
921         (WebKit::GeolocationPermissionRequestManager::GeolocationPermissionRequestManager):
922         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
923         (WebKit::GeolocationPermissionRequestManager::cancelRequestForGeolocation):
924         * WebProcess/Geolocation/GeolocationPermissionRequestManager.h:
925         * WebProcess/Geolocation/WebGeolocationManager.cpp:
926         (WebKit::WebGeolocationManager::WebGeolocationManager):
927         (WebKit::WebGeolocationManager::registerWebPage):
928         (WebKit::WebGeolocationManager::unregisterWebPage):
929         (WebKit::WebGeolocationManager::setEnableHighAccuracyForPage):
930         (WebKit::WebGeolocationManager::didChangePosition):
931         (WebKit::WebGeolocationManager::didFailToDeterminePosition):
932         (WebKit::WebGeolocationManager::resetPermissions):
933         * WebProcess/Geolocation/WebGeolocationManager.h:
934         * WebProcess/MediaCache/WebMediaKeyStorageManager.h:
935         (WebKit::WebMediaKeyStorageManager::WebMediaKeyStorageManager):
936         * WebProcess/Notifications/WebNotificationManager.cpp:
937         (WebKit::WebNotificationManager::WebNotificationManager):
938         (WebKit::WebNotificationManager::show):
939         (WebKit::WebNotificationManager::cancel):
940         (WebKit::WebNotificationManager::clearNotifications):
941         (WebKit::WebNotificationManager::didDestroyNotification):
942         * WebProcess/Notifications/WebNotificationManager.h:
943         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
944         (WebKit::WebGeolocationClient::requestPermission):
945         (WebKit::WebGeolocationClient::cancelPermissionRequest):
946         * WebProcess/WebCoreSupport/WebGeolocationClient.h:
947         (WebKit::WebGeolocationClient::WebGeolocationClient):
948         * WebProcess/WebPage/WebPage.cpp:
949         (WebKit::m_cpuLimit):
950         * WebProcess/WebProcess.h:
951         (WebKit::WebProcess::addSupplement):
952         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
953         (WebKit::UserMediaCaptureManager::UserMediaCaptureManager):
954         * WebProcess/cocoa/UserMediaCaptureManager.h:
955
956 2017-09-06  Alex Christensen  <achristensen@webkit.org>
957
958         Add WKUIDelegatePrivate equivalent of WKPageUIClient's pageDidScroll
959         https://bugs.webkit.org/show_bug.cgi?id=176482
960         <rdar://problem/29270035>
961
962         Reviewed by Tim Horton.
963         
964         Covered by a new API test!
965
966         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
967         * UIProcess/Cocoa/UIDelegate.h:
968         * UIProcess/Cocoa/UIDelegate.mm:
969         (WebKit::UIDelegate::setDelegate):
970         (WebKit::UIDelegate::UIClient::pageDidScroll):
971
972 2017-09-06  Youenn Fablet  <youenn@apple.com>
973
974         NetworkProcess Cache and Caches should be cleared when the last related WebProcess Cache or CacheStorage is destroyed
975         https://bugs.webkit.org/show_bug.cgi?id=176249
976
977         Reviewed by Alex Christensen.
978
979         CacheStorageEngineConnection will store the number of Caches references for its related WebProcess.
980         For a new reference, CacheStorageEngineConnection will notify its engine to lock the related Cache.
981         When the last reference is gone, CacheStorageEngineConnection will ask the engine to release the lock.
982
983         CacheStorageEngine will keep locks as a counter for each Cache object.
984         When the counter goes to zero, the engine asks the Cache to dispose itself.
985         Disposal is done by its parent Caches as only Caches knows whether the Cache is persistent or has been removed.
986
987         The Caches will remove the Cache from memory.
988         For removed caches, all information will be lost.
989         For caches that are not removed, they will keep their identifiers but all in-memory record information will be discarded.
990         If there is a need to reopen the Cache, it will need to read its information from the filesystem.
991         If the Caches has no longer any active Cache object, it will ask the engine to release itself.
992
993         WebProcess crashing is handled correctly as the CacheStorageEngineConnection will release its locks at destruction
994         time of the connection to the web process.
995
996         Adding the possiblity to grab an engine representation for test purposes.
997
998         * NetworkProcess/cache/CacheStorageEngine.cpp:
999         (WebKit::CacheStorage::Engine::readCachesFromDisk):
1000         (WebKit::CacheStorage::Engine::removeCaches):
1001         (WebKit::CacheStorage::Engine::lock):
1002         (WebKit::CacheStorage::Engine::unlock):
1003         * NetworkProcess/cache/CacheStorageEngine.h:
1004         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
1005         (WebKit::CacheStorage::Cache::Cache):
1006         (WebKit::CacheStorage::Cache::dispose):
1007         (WebKit::CacheStorage::Cache::clearMemoryRepresentation):
1008         * NetworkProcess/cache/CacheStorageEngineCache.h:
1009         (WebKit::CacheStorage::Cache::isActive const):
1010         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1011         (WebKit::CacheStorage::Caches::Caches):
1012         (WebKit::CacheStorage::Caches::open):
1013         (WebKit::CacheStorage::Caches::dispose):
1014         (WebKit::CacheStorage::Caches::readCachesFromDisk):
1015         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
1016         * NetworkProcess/cache/CacheStorageEngineCaches.h:
1017         (WebKit::CacheStorage::Caches::create):
1018         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
1019         (WebKit::CacheStorageEngineConnection::~CacheStorageEngineConnection):
1020         (WebKit::CacheStorageEngineConnection::reference):
1021         (WebKit::CacheStorageEngineConnection::dereference):
1022         * NetworkProcess/cache/CacheStorageEngineConnection.h:
1023         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
1024         * WebProcess/Cache/WebCacheStorageConnection.cpp:
1025         (WebKit::WebCacheStorageConnection::reference):
1026         (WebKit::WebCacheStorageConnection::dereference):
1027         * WebProcess/Cache/WebCacheStorageConnection.h:
1028
1029 2017-09-06  Alex Christensen  <achristensen@webkit.org>
1030
1031         Add WKUIDelegatePrivate equivalent of WKPageUIClient's pinnedStateDidChange
1032         https://bugs.webkit.org/show_bug.cgi?id=176474
1033         <rdar://problem/29270035>
1034
1035         Reviewed by Tim Horton.
1036
1037         Rather than telling the UIClient that the pinned state changed and having the application check 4 bools
1038         like we do with WKPage, I made a KVO property on the WKWebView.  I introduce _WKRectEdge for this purpose,
1039         which is like UIRectEdge but unfortunately NSRectEdge and CGRectEdge cannot be used as NS_OPTIONS/flags.
1040         This same structure is used for rubber band state.
1041         
1042         Covered by a new API test.
1043
1044         * UIProcess/API/Cocoa/WKWebView.mm:
1045         (-[WKWebView _pinnedState]):
1046         (-[WKWebView _rubberBandState]):
1047         (-[WKWebView _setRubberBandState:]):
1048         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1049         * UIProcess/Cocoa/WebViewImpl.h:
1050         * UIProcess/Cocoa/WebViewImpl.mm:
1051         (WebKit::WebViewImpl::pinnedState):
1052         (WebKit::WebViewImpl::rubberBandState):
1053         (WebKit::WebViewImpl::setRubberBandState):
1054         * UIProcess/PageClient.h:
1055         (WebKit::PageClient::pinnedStateWillChange):
1056         (WebKit::PageClient::pinnedStateDidChange):
1057         * UIProcess/WebPageProxy.cpp:
1058         (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
1059         * UIProcess/mac/PageClientImplMac.h:
1060         * UIProcess/mac/PageClientImplMac.mm:
1061         (WebKit::PageClientImpl::pinnedStateWillChange):
1062         (WebKit::PageClientImpl::pinnedStateDidChange):
1063
1064 2017-09-06  Youenn Fablet  <youenn@apple.com>
1065
1066         Introduce asynchronous opening of CacheStorageEngine cache
1067         https://bugs.webkit.org/show_bug.cgi?id=176425
1068
1069         Reviewed by Alex Christensen.
1070
1071         Introducing Cache::open to allow reading from the filesystem to fill the Cache.
1072         This is called by Caches when engine requests to open an existing Cache.
1073
1074         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
1075         (WebKit::CacheStorage::Cache::Cache):
1076         (WebKit::CacheStorage::Cache::open):
1077         (WebKit::CacheStorage::Cache::finishOpening):
1078         (WebKit::CacheStorage::Cache::readRecordsList):
1079         * NetworkProcess/cache/CacheStorageEngineCache.h:
1080         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1081         (WebKit::CacheStorage::Caches::find):
1082         (WebKit::CacheStorage::Caches::open):
1083         (WebKit::CacheStorage::Caches::remove):
1084         (WebKit::CacheStorage::Caches::readCachesFromDisk):
1085         (WebKit::CacheStorage::Caches::find const): Deleted.
1086         * NetworkProcess/cache/CacheStorageEngineCaches.h:
1087
1088 2017-09-06  Alex Christensen  <achristensen@webkit.org>
1089
1090         Unreviewed, rolling out r221694.
1091
1092         broke build
1093
1094         Reverted changeset:
1095
1096         "Add WKUIDelegatePrivate equivalent of WKPageUIClient's
1097         pinnedStateDidChange"
1098         https://bugs.webkit.org/show_bug.cgi?id=176474
1099         http://trac.webkit.org/changeset/221694
1100
1101 2017-09-06  Ryan Haddad  <ryanhaddad@apple.com>
1102
1103         Unreviewed, rolling out r221461.
1104
1105         The LayoutTest added with this change crashes under
1106         GuardMalloc.
1107
1108         Reverted changeset:
1109
1110         "Add (entirely incorrect) fetching of ServiceWorker scripts."
1111         https://bugs.webkit.org/show_bug.cgi?id=176179
1112         http://trac.webkit.org/changeset/221461
1113
1114 2017-09-06  Alex Christensen  <achristensen@webkit.org>
1115
1116         Add modern decoders for POD types
1117         https://bugs.webkit.org/show_bug.cgi?id=176456
1118
1119         Reviewed by Geoffrey Garen.
1120
1121         * Platform/IPC/Decoder.cpp:
1122         (IPC::Decoder::getOptional):
1123         (IPC::Decoder::operator>>):
1124         * Platform/IPC/Decoder.h:
1125         * Shared/NavigationActionData.cpp:
1126         (WebKit::NavigationActionData::decode):
1127         * Shared/NavigationActionData.h:
1128
1129 2017-09-06  Alex Christensen  <achristensen@webkit.org>
1130
1131         Add WKUIDelegatePrivate equivalent of WKPageUIClient's pinnedStateDidChange
1132         https://bugs.webkit.org/show_bug.cgi?id=176474
1133         <rdar://problem/29270035>
1134
1135         Reviewed by Tim Horton.
1136
1137         Rather than telling the UIClient that the pinned state changed and having the application check 4 bools
1138         like we do with WKPage, I made a KVO property on the WKWebView.  I introduce _WKRectEdge for this purpose,
1139         which is like UIRectEdge but unfortunately NSRectEdge and CGRectEdge cannot be used as NS_OPTIONS/flags.
1140         This same structure is used for rubber band state.
1141         
1142         Covered by a new API test.
1143
1144         * UIProcess/API/Cocoa/WKWebView.mm:
1145         (-[WKWebView _pinnedState]):
1146         (-[WKWebView _rubberBandState]):
1147         (-[WKWebView _setRubberBandState:]):
1148         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1149         * UIProcess/Cocoa/WebViewImpl.h:
1150         * UIProcess/Cocoa/WebViewImpl.mm:
1151         (WebKit::WebViewImpl::pinnedState):
1152         (WebKit::WebViewImpl::rubberBandState):
1153         (WebKit::WebViewImpl::setRubberBandState):
1154         * UIProcess/PageClient.h:
1155         (WebKit::PageClient::pinnedStateWillChange):
1156         (WebKit::PageClient::pinnedStateDidChange):
1157         * UIProcess/WebPageProxy.cpp:
1158         (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
1159         * UIProcess/mac/PageClientImplMac.h:
1160         * UIProcess/mac/PageClientImplMac.mm:
1161         (WebKit::PageClientImpl::pinnedStateWillChange):
1162         (WebKit::PageClientImpl::pinnedStateDidChange):
1163
1164 2017-09-06  Brent Fulgham  <bfulgham@apple.com>
1165
1166         Deny third-party cookie creation for prevalent resources without interaction
1167         https://bugs.webkit.org/show_bug.cgi?id=175232
1168         <rdar://problem/33709386>
1169
1170         Reviewed by Alex Christensen.
1171
1172         Prior to Intelligent Tracking Prevention, WebKit would deny the ability to create a third party cookie if the user's
1173         settings prohibited it. Due to the internal mechanics of cookie partitioning, we now accept the third party cookie,
1174         but destroy it at some arbitrary moment which is difficult for websites to work with.
1175         
1176         This patch revises WebKit so that attempts to set third party cookies without user interaction fails immediately,
1177         which is what sites are expecting from Safari.
1178
1179         * NetworkProcess/NetworkProcess.cpp:
1180         (WebKit::NetworkProcess::updatePrevalentDomainsWithAndWithoutInteraction):
1181         (WebKit::NetworkProcess::updateCookiePartitioningForTopPrivatelyOwnedDomains): Renamed to updatePrevalentDomainsWithAndWithoutInteraction.
1182         * NetworkProcess/NetworkProcess.h:
1183         * NetworkProcess/NetworkProcess.messages.in: Renamed the UpdateCookiePartitioningForTopPrivatelyOwnedDomains message
1184         to UpdatePrevalentDomainsWithAndWithoutInteraction.
1185         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1186         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Recognize cases where a network session should block cookies, and
1187         use the stateless session so we fail immediately when attempting an invalid cookie set operation.
1188         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1189         (WebKit::WKWebsiteDataStore::_resourceLoadStatisticsSetShouldPartitionCookies): Use new helper function to clear partitioning state.
1190         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1191         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): Update for revised naming.
1192         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning): Track domains with and without interaction so that we can recognize
1193         domains that should be immediately blocked from setting cookies.
1194         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains): Update for revised naming.
1195         (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains): Added helper function for testing.
1196         * UIProcess/WebResourceLoadStatisticsStore.h:
1197         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1198         (WebKit::WebsiteDataStore::updatePrevalentDomainsWithAndWithoutInteraction): Update for revised naming.
1199         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback): Ditto.
1200         (WebKit::WebsiteDataStore::updateCookiePartitioningForTopPrivatelyOwnedDomains): Renamed to updatePrevalentDomainsWithAndWithoutInteraction.
1201         * UIProcess/WebsiteData/WebsiteDataStore.h:
1202
1203 2017-09-06  Adrian Perez de Castro  <aperez@igalia.com>
1204
1205         [WPE][CMake] Fix path to the WebKitApplicationInfo.h header.
1206
1207         Unreviewed build fix.
1208
1209         This doesn't really make a difference for the build bots, but it makes
1210         it possible to craft working release tarballs of WPE.
1211
1212         * PlatformWPE.cmake: Use the WPE version of WebKitApplicationInfo.h
1213
1214 2017-09-06  Frédéric Wang  <fwang@igalia.com>
1215
1216         Introduce ScrollingTreeScrollingNodeDelegateIOS to share code between overflow and frame scrolling
1217         https://bugs.webkit.org/show_bug.cgi?id=174097
1218
1219         Reviewed by Darin Adler.
1220
1221         This patch introduces a new ScrollingTreeScrollingNodeDelegateIOS that can be used by
1222         WKOverflowScrollViewDelegate to communicate to the scrolling tree and nodes. It can also be
1223         used as a helper class by ScrollingTreeOverflowScrollingNodeIOS. For now, only the non-
1224         overriden member functions of ScrollingTreeOverflowScrollingNodeIOS are moved to that new
1225         class. In follow-up commits, WKOverflowScrollViewDelegate can become a generic
1226         ScrollViewDelegate and more code can be moved into the ScrollingTreeScrollingNodeDelegateIOS
1227         file. Frame scrolling nodes will then be able to share the same UI code as overflow:auto when
1228         iOS frame scrolling is implemented (bug 149264).
1229
1230         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h: Move non-overriden member
1231         functions and m_updatingFromStateNode into the delegate class. Also define a member to store
1232         that delegate.
1233         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: Use the node delegate to
1234         communicate to the scrolling tree and node.
1235         (-[WKOverflowScrollViewDelegate initWithScrollingTreeNodeDelegate:]): Init with a delegate.
1236         (-[WKOverflowScrollViewDelegate scrollViewDidScroll:]): Call the delegate function.
1237         (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]): Ditto.
1238         (-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
1239         Use the delegate functions or pass by ScrollingTreeScrollingNodeDelegateIOS::scrollingNode().
1240         (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): Use the delegate
1241         functions.
1242         (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]): Ditto.
1243         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::ScrollingTreeOverflowScrollingNodeIOS):
1244         Init the delegate for this class.
1245         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren): Use the delegate.
1246         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): Use the delegate
1247         function.
1248         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterDelegatedScroll): Ditto.
1249         (-[WKOverflowScrollViewDelegate initWithScrollingTreeNode:]): Deleted. This is renamed
1250         initWithScrollingTreeNodeDelegate and accepts a delegate.
1251         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll): Deleted. Moved
1252         to ScrollingTreeScrollingNodeDelegateIOS.
1253         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollWillStart): Ditto.
1254         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollDidEnd): Ditto.
1255         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewWillStartPanGesture): Ditto.
1256         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll): Ditto.
1257         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::currentSnapPointIndicesDidChange): Ditto.
1258         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h: Added. New delegate class
1259         for ScrollingTreeOverflowScrollingNodeIOS. The members used by WKOverflowScrollViewDelegate
1260         are public and the others are private. ScrollingTreeOverflowScrollingNodeIOS is a friend of
1261         ScrollingTreeScrollingNodeDelegateIOS so that it can access private members e.g.
1262         updateChildNodesAfterScroll() or  m_updatingFromStateNode.
1263         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: Added.
1264         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::ScrollingTreeScrollingNodeDelegateIOS):
1265         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::~ScrollingTreeScrollingNodeDelegateIOS):
1266         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll): Code extracted
1267         from ScrollingTreeOverflowScrollingNodeIOS.
1268         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollWillStart): Ditto.
1269         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollDidEnd): Ditto.
1270         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewWillStartPanGesture): Ditto.
1271         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll): Ditto.
1272         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::currentSnapPointIndicesDidChange): Ditto.
1273         * WebKit.xcodeproj/project.pbxproj: Add ScrollingTreeScrollingNodeDelegateIOS files to the
1274         build system.
1275
1276 2017-09-05  Wenson Hsieh  <wenson_hsieh@apple.com>
1277
1278         [iOS WK2] Add plumbing for WKContentView to ask the web process for additional drag items
1279         https://bugs.webkit.org/show_bug.cgi?id=176348
1280         Work towards <rdar://problem/31144674>
1281
1282         Reviewed by Tim Horton.
1283
1284         Adds boilerplate plumbing to request additional items to an existing session. This implements some UI-side logic
1285         in WKContentView to send an additional drag items request and handle a response from the web process. 
1286         To start, WebPageProxy::requestAdditionalItemsForDragSession is invoked by -_dragInteraction:
1287         itemsForAddingToSession:withTouchAtPoint:completion: in WKContentView, and the response from the web process is
1288         handled in -[WKContentView _didHandleAdditionalDragItemsRequest:].
1289
1290         * UIProcess/API/Cocoa/WKWebView.mm:
1291         (-[WKWebView _simulateItemsForAddingToSession:atLocation:completion:]):
1292         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1293
1294         Add SPI to simulate a request for additional drag items. See Tools/ChangeLog for more detail.
1295
1296         * UIProcess/PageClient.h:
1297         * UIProcess/WebPageProxy.h:
1298         * UIProcess/WebPageProxy.messages.in:
1299
1300         Add an IPC message handler for the additional drag items response from the web process.
1301
1302         * UIProcess/ios/DragDropInteractionState.h:
1303         (WebKit::DragDropInteractionState::BlockPtr<void):
1304         * UIProcess/ios/DragDropInteractionState.mm:
1305         (WebKit::DragDropInteractionState::shouldRequestAdditionalItemForDragSession const):
1306         (WebKit::DragDropInteractionState::dragSessionWillRequestAdditionalItem):
1307
1308         Invoke the new additional items completion handler when tearing down to avoid getting UIKit into a bad state.
1309
1310         (WebKit::DragDropInteractionState::dragAndDropSessionsDidEnd):
1311         * UIProcess/ios/PageClientImplIOS.h:
1312         * UIProcess/ios/PageClientImplIOS.mm:
1313         (WebKit::PageClientImpl::didHandleAdditionalDragItemsRequest):
1314         * UIProcess/ios/WKContentViewInteraction.h:
1315         * UIProcess/ios/WKContentViewInteraction.mm:
1316         (-[WKContentView _didHandleAdditionalDragItemsRequest:]):
1317         (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
1318
1319         Factors common logic to convert a staged WebItemProviderRegistrationInfoList and DragSourceState into a list of
1320         drag items, invoking the private UI delegate in the process. This is called both when starting a drag session,
1321         and adding items to an existing drag session.
1322
1323         (-[WKContentView _dragInteraction:itemsForAddingToSession:withTouchAtPoint:completion:]):
1324
1325         Implements a (proposed) additional drag item delegate that serves as an asynchronous alternative to the API
1326         variant, -_dragInteraction:itemsForAddingToSession:withTouchAtPoint:. See <rdar://problem/33146803> for more
1327         information.
1328
1329         (-[WKContentView dragInteraction:itemsForBeginningSession:]):
1330
1331         Refactored to use -_itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:.
1332
1333         (-[WKContentView _simulateItemsForAddingToSession:atLocation:completion:]):
1334         * UIProcess/ios/WebPageProxyIOS.mm:
1335         (WebKit::WebPageProxy::didHandleAdditionalDragItemsRequest):
1336         (WebKit::WebPageProxy::requestAdditionalItemsForDragSession):
1337         * WebProcess/WebPage/WebPage.h:
1338         * WebProcess/WebPage/WebPage.messages.in:
1339
1340         Add an IPC message handler for the additional drag items request from the UI process.
1341
1342         * WebProcess/WebPage/ios/WebPageIOS.mm:
1343         (WebKit::WebPage::requestAdditionalItemsForDragSession):
1344
1345 2017-09-05  Alex Christensen  <achristensen@webkit.org>
1346
1347         Add WKUIDelegatePrivate equivalent of WKPageUIClient's mouseDidMoveOverElement
1348         https://bugs.webkit.org/show_bug.cgi?id=176428
1349         <rdar://problem/29270035>
1350
1351         Reviewed by Tim Horton.
1352
1353         Covered by a new API test.
1354
1355         * UIProcess/API/APIUIClient.h:
1356         (API::UIClient::mouseDidMoveOverElement):
1357         * UIProcess/API/C/WKPage.cpp:
1358         (WKPageSetPageUIClient):
1359         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1360         * UIProcess/Cocoa/UIDelegate.h:
1361         * UIProcess/Cocoa/UIDelegate.mm:
1362         (WebKit::UIDelegate::setDelegate):
1363         (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
1364         (WebKit::UIDelegate::UIClient::createNewPageCommon):
1365         (WebKit::UIDelegate::UIClient::runJavaScriptAlert):
1366         (WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
1367         (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
1368         (WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel):
1369         (WebKit::UIDelegate::UIClient::takeFocus):
1370         (WebKit::UIDelegate::UIClient::focus):
1371         (WebKit::UIDelegate::UIClient::unfocus):
1372         (WebKit::UIDelegate::UIClient::didExceedBackgroundResourceLimitWhileInForeground):
1373         (WebKit::UIDelegate::UIClient::didNotHandleWheelEvent):
1374         (WebKit::toNSEventModifierFlags):
1375         (WebKit::UIDelegate::UIClient::mouseDidMoveOverElement):
1376         (WebKit::UIDelegate::UIClient::toolbarsAreVisible):
1377         (WebKit::UIDelegate::UIClient::didClickAutoFillButton):
1378         (WebKit::UIDelegate::UIClient::handleAutoplayEvent):
1379         (WebKit::requestUserMediaAuthorizationForDevices):
1380         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
1381         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
1382         (WebKit::UIDelegate::UIClient::printFrame):
1383         (WebKit::UIDelegate::UIClient::close):
1384         (WebKit::UIDelegate::UIClient::fullscreenMayReturnToInline):
1385         (WebKit::UIDelegate::UIClient::didEnterFullscreen):
1386         (WebKit::UIDelegate::UIClient::didExitFullscreen):
1387         (WebKit::UIDelegate::UIClient::requestPointerLock):
1388         (WebKit::UIDelegate::UIClient::didLosePointerLock):
1389         (WebKit::UIDelegate::UIClient::hasVideoInPictureInPictureDidChange):
1390         * UIProcess/WebPageProxy.cpp:
1391         (WebKit::WebPageProxy::mouseDidMoveOverElement):
1392         * UIProcess/WebPageProxy.h:
1393
1394 2017-09-05  Brent Fulgham  <bfulgham@apple.com>
1395
1396         Relax keychain access to permit users to permanently allow client certificates
1397         https://bugs.webkit.org/show_bug.cgi?id=175857
1398         <rdar://problem/32293867>
1399
1400         Reviewed by Alex Christensen.
1401
1402         Further relax the write permissions on the user's Keychain directory to support local certificates.
1403
1404         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1405         * WebProcess/com.apple.WebProcess.sb.in:
1406
1407 2017-09-05  Youenn Fablet  <youenn@apple.com>
1408
1409         Cache Storage Engine should not mix different origin caches
1410         https://bugs.webkit.org/show_bug.cgi?id=176394
1411
1412         Reviewed by Alex Christensen.
1413
1414         * NetworkProcess/cache/CacheStorageEngine.cpp:
1415         (WebKit::CacheStorage::Engine::readCachesFromDisk): Initializing the salt before creating the Caches object
1416         so that its persistency path is correctly computed.
1417         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1418         (WebKit::CacheStorage::cachesRootPath): Setting origin as partition string.
1419
1420 2017-09-05  Brent Fulgham  <bfulgham@apple.com>
1421
1422         Use a single network storage session for stateless connections
1423         https://bugs.webkit.org/show_bug.cgi?id=176386
1424         <rdar://problem/34262148>
1425
1426         Reviewed by Alex Christensen.
1427
1428         Change the name of 'm_dataTaskMapWithoutCredentials' to 'm_dataTaskMapWithoutState'
1429         to reflect that the data tasks do not involve credential or cookie storage. Ditto for
1430         the change from 'm_sessionWIthoutCredentialStorage' to 'm_statelessSession'.
1431
1432         This update should not change behavior, unless some stateless sessions were depending
1433         on cookies to be persistent (which would be a bug!)
1434
1435         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1436         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Update for new variable names.
1437         (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa): Ditto.
1438         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1439         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1440         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Update the configuration to block
1441         cookies as well.
1442         (WebKit::NetworkSessionCocoa::invalidateAndCancel): Update for new names.
1443         (WebKit::NetworkSessionCocoa::clearCredentials): Ditto.
1444         (WebKit::NetworkSessionCocoa::dataTaskForIdentifier): Ditto.
1445
1446 2017-09-05  Yousuke Kimoto  <yousuke.kimoto@sony.com>
1447
1448         [WinCairo] Add Network Process files for wincairo webkit
1449         https://bugs.webkit.org/show_bug.cgi?id=176069
1450
1451         Reviewed by Alex Christensen.
1452
1453         * NetworkProcess/Downloads/curl/DownloadCurl.cpp: Added.
1454         (WebKit::Download::resume):
1455         (WebKit::Download::platformDidFinish):
1456         (WebKit::Download::startNetworkLoadWithHandle):
1457         (WebKit::Download::startNetworkLoad):
1458         (WebKit::Download::platformInvalidate):
1459         * NetworkProcess/EntryPoint/win/NetworkProcessMain.cpp: Added.
1460         (main):
1461         * NetworkProcess/curl/NetworkProcessCurl.cpp: Added.
1462         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
1463         (WebKit::NetworkProcess::platformSetURLCacheSize):
1464         (WebKit::NetworkProcess::allowSpecificHTTPSCertificateForHost):
1465         (WebKit::NetworkProcess::clearCacheForAllOrigins):
1466         (WebKit::NetworkProcess::clearDiskCache):
1467         (WebKit::NetworkProcess::platformTerminate):
1468         * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp: Added.
1469         (WebKit::RemoteNetworkingContext::~RemoteNetworkingContext):
1470         (WebKit::RemoteNetworkingContext::isValid const):
1471         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
1472         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
1473         (WebKit::RemoteNetworkingContext::storageSession const):
1474         (WebKit::RemoteNetworkingContext::blockedError const):
1475         * NetworkProcess/win/NetworkProcessMainWin.cpp: Added.
1476         (WebKit::NetworkProcessMainWin):
1477         * NetworkProcess/win/NetworkProcessMainWin.h: Added.
1478         * NetworkProcess/win/SystemProxyWin.cpp: Added.
1479         (WindowsSystemProxy::getSystemHttpProxy):
1480         (WindowsSystemProxy::setCurlHttpProxy):
1481         (WindowsSystemProxy::parseProxyString):
1482         * NetworkProcess/win/SystemProxyWin.h: Added.
1483         * PlatformWin.cmake:
1484
1485 2017-09-05  Youenn Fablet  <youenn@apple.com>
1486
1487         Allow retrieving Cache Storage records for a given URL only
1488         https://bugs.webkit.org/show_bug.cgi?id=176202
1489
1490         Reviewed by Alex Christensen.
1491
1492         Update CacheStorageEngineCache to store records as a map URL -> Vector of Records.
1493         This allows regular record retrieval to be faster.
1494         Retrieval of all records is less efficient but this should happen less often.
1495
1496         * NetworkProcess/cache/CacheStorageEngine.cpp:
1497         (WebKit::CacheStorage::Engine::retrieveRecords):
1498         * NetworkProcess/cache/CacheStorageEngine.h:
1499         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
1500         (WebKit::CacheStorage::queryCache):
1501         (WebKit::CacheStorage::Cache::retrieveRecords const):
1502         (WebKit::CacheStorage::computeKeyURL):
1503         (WebKit::CacheStorage::Cache::addNewURLRecord):
1504         (WebKit::CacheStorage::Cache::recordsFromURL):
1505         (WebKit::CacheStorage::Cache::recordsFromURL const):
1506         (WebKit::CacheStorage::Cache::put):
1507         (WebKit::CacheStorage::Cache::remove):
1508         * NetworkProcess/cache/CacheStorageEngineCache.h:
1509         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
1510         (WebKit::CacheStorageEngineConnection::retrieveRecords):
1511         * NetworkProcess/cache/CacheStorageEngineConnection.h:
1512         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
1513         * WebProcess/Cache/WebCacheStorageConnection.cpp:
1514         (WebKit::WebCacheStorageConnection::doRetrieveRecords):
1515         * WebProcess/Cache/WebCacheStorageConnection.h:
1516
1517 2017-09-05  Youenn Fablet  <youenn@apple.com>
1518
1519         WebKitTestRunner should set the cache storage directory path
1520         https://bugs.webkit.org/show_bug.cgi?id=176373
1521
1522         Reviewed by Chris Dumez.
1523
1524         * UIProcess/API/C/WKContextConfigurationRef.cpp:
1525         (WKContextConfigurationCopyCacheStorageDirectory):
1526         (WKContextConfigurationSetCacheStorageDirectory):
1527         * UIProcess/API/C/WKContextConfigurationRef.h:
1528
1529 2017-09-05  Alex Christensen  <achristensen@webkit.org>
1530
1531         Add WKUIDelegatePrivate equivalent of WKPageUIClient's unavailablePluginButtonClicked
1532         https://bugs.webkit.org/show_bug.cgi?id=176274
1533         <rdar://problem/29270035>
1534
1535         Reviewed by Darin Adler.
1536
1537         * UIProcess/API/APIUIClient.h:
1538         (API::UIClient::unavailablePluginButtonClicked):
1539         * UIProcess/API/C/WKPage.cpp:
1540         (WKPageSetPageUIClient):
1541         * UIProcess/API/Cocoa/WKPreferences.mm:
1542         (-[WKPreferences _setPluginsEnabled:]):
1543         (-[WKPreferences _pluginsEnabled]):
1544         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1545         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1546         * UIProcess/Cocoa/UIDelegate.h:
1547         * UIProcess/Cocoa/UIDelegate.mm:
1548         (WebKit::UIDelegate::setDelegate):
1549         (WebKit::toWKPluginUnavailabilityReason):
1550         (WebKit::UIDelegate::UIClient::unavailablePluginButtonClicked):
1551         * UIProcess/WebPageProxy.cpp:
1552         (WebKit::WebPageProxy::unavailablePluginButtonClicked):
1553
1554 2017-09-04  Alex Christensen  <achristensen@webkit.org>
1555
1556         Allow classes to have modern and legacy decoders to aid transition
1557         https://bugs.webkit.org/show_bug.cgi?id=176186
1558
1559         Reviewed by Zan Dobersek.
1560
1561         To illustrate this, I made legacy and modern decoders to WTF::String and transitioned one String decoder.
1562
1563         * Platform/IPC/ArgumentCoder.h:
1564         * Platform/IPC/ArgumentCoders.cpp:
1565         (IPC::ArgumentCoder<String>::decode):
1566         * Platform/IPC/ArgumentCoders.h:
1567         * Platform/IPC/Decoder.h:
1568         * Shared/WebPageCreationParameters.cpp:
1569         (WebKit::WebPageCreationParameters::decode):
1570
1571 2017-09-05  Frederic Wang  <fwang@igalia.com>
1572
1573         Use TilesBacking for iframes when async frame scrolling is enabled
1574         https://bugs.webkit.org/show_bug.cgi?id=173644
1575
1576         Reviewed by Simon Fraser.
1577
1578         This patch adds creation of TilesBacking for non-main frames when async frame scrolling is
1579         enabled. RenderLayerBacking::m_isMainFrameLayerWithTiledBacking is also renamed to reflect
1580         that tiled backing is not exclusive to the main frame. More adjustments might be needed for
1581         non-main frames and will be handled in follow-up commits.
1582
1583         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1584         (WebKit::RemoteLayerTreeDrawingArea::shouldUseTiledBackingForFrameView): Also use tiled
1585         backing when asyncFrameScrollingEnabled is true.
1586         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1587         (WebKit::TiledCoreAnimationDrawingArea::shouldUseTiledBackingForFrameView): Ditto.
1588
1589 2017-09-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1590
1591         [GTK] Rename PLUGIN_ARCHITECTURE(X11) as PLUGIN_ARCHITECTURE(UNIX)
1592         https://bugs.webkit.org/show_bug.cgi?id=176330
1593
1594         Reviewed by Michael Catanzaro.
1595
1596         It's no longer X11 specific since it's also used in Wayland when the X11 target is enabled. It should be renamed
1597         as UNIX and make it available when building the wayland target even if the X11 on is disabled.
1598
1599         * PlatformGTK.cmake:
1600         * PlatformWPE.cmake:
1601         * PluginProcess/unix/PluginProcessMainUnix.cpp:
1602         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
1603         (WebKit::NetscapePluginModule::tryLoad):
1604         * Shared/Plugins/Netscape/NetscapePluginModule.h:
1605         * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp: Renamed from Source/WebKit/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp.
1606         * UIProcess/Plugins/PluginProcessProxy.h:
1607         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
1608         (WebKit::PluginInfoCache::getPluginInfo):
1609         (WebKit::PluginInfoCache::updatePluginInfo):
1610         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
1611         (WebKit::PluginProcessProxy::scanPlugin):
1612         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1613         (WebKit::NPN_InvalidateRect):
1614         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1615         (WebKit::NetscapePlugin::initialize):
1616         (WebKit::NetscapePlugin::destroy):
1617         (WebKit::NetscapePlugin::geometryDidChange):
1618         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
1619         * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp:
1620         * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.h:
1621         * config.h:
1622
1623 2017-09-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1624
1625         [GTK] Wrong use of PLUGIN_ARCHITECTURE(X11) in several places
1626         https://bugs.webkit.org/show_bug.cgi?id=176329
1627
1628         Reviewed by Michael Catanzaro.
1629
1630         We are using PLUGIN_ARCHITECTURE(X11) in several places where we should actually be using PLATFORM(X11). This is
1631         confusing because PLUGIN_ARCHITECTURE(X11) is no longer specific to X11, it will be renamed as UNIX in a follow
1632         up patch. Because of this we only support plugins in Wayland when building with both X11 and Wayland targets
1633         enabled.
1634
1635         * PluginProcess/PluginControllerProxy.cpp:
1636         * PluginProcess/PluginControllerProxy.h:
1637         * PluginProcess/unix/PluginProcessMainUnix.cpp:
1638         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
1639         (WebKit::NetscapePluginModule::determineQuirks):
1640         * Shared/Plugins/PluginQuirks.h:
1641         * UIProcess/WebPageProxy.h:
1642         * UIProcess/WebPageProxy.messages.in:
1643         * UIProcess/gtk/WebPageProxyGtk.cpp:
1644         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1645         (WebKit::NPN_GetValue):
1646         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1647         (WebKit::NetscapePlugin::shouldLoadSrcURL):
1648         (WebKit::NetscapePlugin::initialize):
1649         * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp:
1650         (WebKit::NetscapePlugin::platformHandleMouseEvent):
1651         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
1652         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.h:
1653         * WebProcess/Plugins/PluginController.h:
1654         * WebProcess/Plugins/PluginProxy.cpp:
1655         * WebProcess/Plugins/PluginProxy.h:
1656         * WebProcess/Plugins/PluginProxy.messages.in:
1657         * WebProcess/Plugins/PluginView.cpp:
1658         * WebProcess/Plugins/PluginView.h:
1659
1660 2017-09-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1661
1662         [iOS DnD] Refactor drag and drop logic in WKContentView in preparation for supporting multiple drag items in a drag session
1663         https://bugs.webkit.org/show_bug.cgi?id=176264
1664         <rdar://problem/31144674>
1665
1666         Reviewed by Darin Adler.
1667
1668         Move DataInteractionState from WKContentViewInteraction.h to DragDropInteractionState.h, and also rename it to
1669         DragDropInteractionState. Additionally, refactor drag and drop state in the UI process to capture metadata about
1670         the dragged element in a separate DragSourceState struct. This patch also moves drag and drop state transition
1671         logic that doesn't involve WKContentView internals out of WKContentView, and into the implementation of
1672         DragDropInteractionState.
1673
1674         To support multiple drag items per session, we also introduce a simple mechanism to trace a UIDragItem back to
1675         the DragSourceState used to generate it. When generating a DragSourceState, we assign it a unique identifier,
1676         which we also set as the privateLocalContext of all UIDragItems generated when beginning the drag (this
1677         includes drag items returned by an internal client that uses one of the SPI hooks to augment drag items when
1678         starting a drag). This is subsequently used in the implementation of lift and cancellation preview delegate
1679         methods to supply the appropriate drag preview for each UIDragItem.
1680
1681         Lastly, fix a bug wherein the pageX and pageY of mouse drag events are inconsistent with other synthetic mouse
1682         events, such as synthetic clicks. For synthetic clicks, the PlatformMouseEvent is initialized with the same
1683         position and globalPosition. Whether this is really intended is unclear (see http://webkit.org/b/173855), but
1684         it's a trivial change for now to keep mouse events on iOS consistent by tweaking the behavior during drag and
1685         drop. See Tools/ChangeLog for some more information.
1686
1687         * Platform/spi/ios/UIKitSPI.h:
1688
1689         Add -[UIDragItem privateLocalContext].
1690
1691         * UIProcess/ios/DragDropInteractionState.h: Added.
1692         (WebKit::DragDropInteractionState::stagedDragSource const):
1693         (WebKit::DragDropInteractionState::dropSessionDidExit):
1694         (WebKit::DragDropInteractionState::dropSessionWillPerformDrop):
1695         (WebKit::DragDropInteractionState::adjustedPositionForDragEnd const):
1696         (WebKit::DragDropInteractionState::didBeginDragging const):
1697         (WebKit::DragDropInteractionState::isPerformingDrop const):
1698         (WebKit::DragDropInteractionState::dragSession const):
1699         (WebKit::DragDropInteractionState::dropSession const):
1700
1701         Wrap private drag/drop state member variables behind const getters, and move drag and drop logic that involves
1702         only the DragDropInteractionState into helper methods on DragDropInteractionState.
1703
1704         (WebKit::DragDropInteractionState::BlockPtr<void):
1705         * UIProcess/ios/DragDropInteractionState.mm: Added.
1706         (WebKit::dragItemMatchingIdentifier):
1707         (WebKit::createTargetedDragPreview):
1708         (WebKit::uiImageForImage):
1709
1710         Move drag preview creation logic here, from WKContentViewInteraction.mm.
1711
1712         (WebKit::shouldUseTextIndicatorToCreatePreviewForDragAction):
1713         (WebKit::DragDropInteractionState::activeDragSourceForItem const):
1714         (WebKit::DragDropInteractionState::anyActiveDragSourceIs const):
1715         (WebKit::DragDropInteractionState::prepareForDragSession):
1716         (WebKit::DragDropInteractionState::dragSessionWillBegin):
1717         (WebKit::DragDropInteractionState::previewForDragItem const):
1718         (WebKit::DragDropInteractionState::dragSessionWillDelaySetDownAnimation):
1719         (WebKit::DragDropInteractionState::dropSessionDidEnterOrUpdate):
1720         (WebKit::DragDropInteractionState::stageDragItem):
1721         (WebKit::DragDropInteractionState::hasStagedDragSource const):
1722         (WebKit::DragDropInteractionState::clearStagedDragSource):
1723         (WebKit::DragDropInteractionState::dragAndDropSessionsDidEnd):
1724         (WebKit::DragDropInteractionState::updatePreviewsForActiveDragSources):
1725         * UIProcess/ios/WKContentViewInteraction.h:
1726
1727         Move drag-and-drop-related state tied to the WKContentView here, from DataInteractionState (for instance, the
1728         UIView for the drop caret, the WKContentView snapshot when dropping, and a flag use to keep track of hiding the
1729         callout bar when dragging a text selection).
1730
1731         (): Deleted.
1732         * UIProcess/ios/WKContentViewInteraction.mm:
1733         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
1734         (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]):
1735         (-[WKContentView _didChangeDragInteractionPolicy]):
1736         (-[WKContentView setupDataInteractionDelegates]):
1737         (-[WKContentView teardownDataInteractionDelegates]):
1738         (-[WKContentView _startDrag:item:]):
1739         (-[WKContentView _didHandleStartDataInteractionRequest:]):
1740         (-[WKContentView computeClientAndGlobalPointsForDropSession:outClientPoint:outGlobalPoint:]):
1741         (-[WKContentView cleanUpDragSourceSessionState]):
1742         (-[WKContentView _didConcludeEditDataInteraction:]):
1743         (-[WKContentView _didPerformDataInteractionControllerOperation:]):
1744         (-[WKContentView _didChangeDataInteractionCaretRect:currentRect:]):
1745         (-[WKContentView currentDragOrDropSession]):
1746         (-[WKContentView _restoreCalloutBarIfNeeded]):
1747         (-[WKContentView _dragInteraction:prepareForSession:completion:]):
1748         (-[WKContentView dragInteraction:itemsForBeginningSession:]):
1749         (-[WKContentView dragInteraction:previewForLiftingItem:session:]):
1750         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
1751         (-[WKContentView dragInteraction:sessionWillBegin:]):
1752         (-[WKContentView dragInteraction:session:didEndWithOperation:]):
1753         (-[WKContentView dragInteraction:previewForCancellingItem:withDefault:]):
1754         (-[WKContentView _dragInteraction:item:shouldDelaySetDownAnimationWithCompletion:]):
1755         (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
1756         (-[WKContentView dropInteraction:sessionDidEnter:]):
1757         (-[WKContentView dropInteraction:sessionDidUpdate:]):
1758         (-[WKContentView dropInteraction:sessionDidExit:]):
1759         (-[WKContentView dropInteraction:performDrop:]):
1760         (-[WKContentView dropInteraction:sessionDidEnd:]):
1761
1762         Pull out logic that mutates drag and drop state into DragDropInteractionState. Adjust places that previously
1763         accessed DataInteractionState's members directly with corresponding getters in DragDropInteractionState.
1764
1765         (-[WKContentView _simulateDataInteractionEntered:]):
1766         (-[WKContentView _simulateDataInteractionUpdated:]):
1767         (-[WKContentView _simulateDataInteractionEnded:]):
1768         (-[WKContentView _simulateDataInteractionPerformOperation:]):
1769         (-[WKContentView _simulateDataInteractionSessionDidEnd:]):
1770         (-[WKContentView _simulateWillBeginDataInteractionWithSession:]):
1771         (-[WKContentView _simulatedItemsForSession:]):
1772         (-[WKContentView _simulatePrepareForDataInteractionSession:completion:]):
1773
1774         Rename _dataInteraction => _dragInteraction and _dataOperation => _dropInteraction.
1775
1776         (uiImageForImage): Deleted.
1777         (shouldUseTextIndicatorToCreatePreviewForDragAction): Deleted.
1778         (-[WKContentView dragPreviewForImage:frameInRootViewCoordinates:clippingRectsInFrameCoordinates:backgroundColor:]): Deleted.
1779         (-[WKContentView dragPreviewForCurrentDataInteractionState]): Deleted.
1780         (-[WKContentView _transitionDragPreviewToImageIfNecessary:]): Deleted.
1781         * WebKit.xcodeproj/project.pbxproj:
1782
1783 2017-09-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1784
1785         [Threaded Compositor] Deadlock in ThreadedDisplayRefreshMonitor
1786         https://bugs.webkit.org/show_bug.cgi?id=176296
1787
1788         Reviewed by Žan Doberšek.
1789
1790         The main thread tries to schedule a display refresh monitor from RAF, requestDisplayRefreshMonitorUpdate() tries
1791         to take the attributes lock to update coordinateUpdateCompletionWithClient. The compositing thread has finished
1792         a frame and sceneUpdateFinished() takes the attributes lock to update clientRendersNextFrame and then asks the
1793         display refresh monitor if it requires a new callback. ThreadedDisplayRefreshMonitor::requiresDisplayRefreshCallback()
1794         takes its lock to check the state, and requestDisplayRefreshMonitorUpdate() was called by
1795         ThreadedDisplayRefreshMonitor::requestRefreshCallback() with the display refresh monitor lock taken. So,
1796         the compositing thread has the attributes lock and wants the display refresh monitor one, and main thread has the
1797         display refresh monitor lock and wants the attributes one.
1798
1799         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
1800         (WebKit::ThreadedDisplayRefreshMonitor::requestRefreshCallback): Release the mutex before calling
1801         ThreadedCompositor::requestDisplayRefreshMonitorUpdate().
1802
1803 2017-09-03  Zan Dobersek  <zdobersek@igalia.com>
1804
1805         [GTK] Libgcrypt warning: missing initialization - please fix the application
1806         https://bugs.webkit.org/show_bug.cgi?id=171230
1807
1808         Reviewed by Michael Catanzaro.
1809
1810         Replicate the libgcrypt initialization in the NetworkProcess entrypoint.
1811         This is required due to libgcrypt being used through digest operations
1812         originating from the certificate hash computation in SoupNetworkSession.
1813
1814         The initialization is moved to the PAL library, and the initialize()
1815         function is now leveraged in both NetworkProcess and WebProcess entrypoints.
1816
1817         * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
1818         (main):
1819         * WebProcess/EntryPoint/unix/WebProcessMain.cpp:
1820         (main):
1821
1822 2017-09-03  Zan Dobersek  <zdobersek@igalia.com>
1823
1824         [WPE] Use the device scale factor value in WebPageCreationParameters
1825         https://bugs.webkit.org/show_bug.cgi?id=175377
1826
1827         Reviewed by Michael Catanzaro.
1828
1829         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1830         (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea):
1831         WebPageCreationParameters::deviceScaleFactor value should be used
1832         to set the device scale factor on the given WebPage object. This
1833         enables correctly leveraging the scale factor for the WPE port
1834         which enters accelerated mode unconditionally and as such doesn't
1835         wait for the backing store update that would provide that value
1836         otherwise.
1837
1838 2017-09-03  Brent Fulgham  <bfulgham@apple.com>
1839
1840         [WK2][iOS] Remove unnecessary IOHIDEventServiceFastPathUserClient access
1841         https://bugs.webkit.org/show_bug.cgi?id=175947
1842         <rdar://problem/33353627>
1843
1844         Reviewed by Darin Adler.
1845
1846         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1847
1848 2017-09-03  Dan Bernstein  <mitz@apple.com>
1849
1850         WKContentViewInteraction.mm includes redundant declaration of UIPreviewItemController's presentationSecondaryGestureRecognizer
1851         https://bugs.webkit.org/show_bug.cgi?id=176322
1852
1853         Reviewed by Darin Adler.
1854
1855         * UIProcess/ios/WKContentViewInteraction.mm: Removed the declaration, which is already made in the
1856           SDK or in UIKitSPI.h.
1857
1858 2017-09-03  Timothy Horton  <timothy_horton@apple.com>
1859
1860         Try to fix the iOS build
1861
1862         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
1863         (-[WKRemoteView initWithFrame:contextID:]):
1864
1865 2017-09-03  Tim Horton  <timothy_horton@apple.com>
1866
1867         Fix some style issues in the Remote Layer Tree code
1868         https://bugs.webkit.org/show_bug.cgi?id=176298
1869
1870         Reviewed by Dan Bernstein.
1871
1872         In bugs 176273 and 176297, the style bot noticed some existing style
1873         issues in the UI-side compositing code. Fix them, because there aren't
1874         many and they're straightforward.
1875
1876         * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
1877         * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.h:
1878         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
1879         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.h:
1880         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
1881         * UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.h:
1882         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
1883         * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
1884         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
1885         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
1886
1887 2017-09-03  Yusuke Suzuki  <utatane.tea@gmail.com>
1888
1889         String#utf8() allocates new CString
1890         https://bugs.webkit.org/show_bug.cgi?id=176302
1891
1892         Reviewed by Sam Weinig.
1893
1894         * NetworkProcess/webrtc/NetworkRTCSocket.cpp:
1895         (WebKit::NetworkRTCSocket::sendTo):
1896
1897 2017-09-03  Tim Horton  <timothy_horton@apple.com>
1898
1899         Move shared part of the Remote Layer Tree code out of a Mac-specific directory
1900         https://bugs.webkit.org/show_bug.cgi?id=176297
1901
1902         Reviewed by Dan Bernstein.
1903
1904         UI-side compositing works on all Cocoa platforms, so the code should
1905         not live inside Mac/. Also merge the Scrolling directory in here,
1906         since those files are very related.
1907
1908         * PlatformMac.cmake:
1909         * Shared/RemoteLayerTree/RemoteLayerBackingStore.h: Renamed from Shared/mac/RemoteLayerBackingStore.h.
1910         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: Renamed from Shared/mac/RemoteLayerBackingStore.mm.
1911         * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.h: Renamed from Shared/mac/RemoteLayerBackingStoreCollection.h.
1912         * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.mm: Renamed from Shared/mac/RemoteLayerBackingStoreCollection.mm.
1913         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h: Renamed from Shared/mac/RemoteLayerTreePropertyApplier.h.
1914         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm: Renamed from Shared/mac/RemoteLayerTreePropertyApplier.mm.
1915         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: Renamed from Shared/mac/RemoteLayerTreeTransaction.h.
1916         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: Renamed from Shared/mac/RemoteLayerTreeTransaction.mm.
1917         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: Renamed from Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp.
1918         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.h: Renamed from Shared/Scrolling/RemoteScrollingCoordinatorTransaction.h.
1919         * WebKit.xcodeproj/project.pbxproj:
1920
1921 2017-09-03  Sam Weinig  <sam@webkit.org>
1922
1923         Remove CanvasProxy
1924         https://bugs.webkit.org/show_bug.cgi?id=176288
1925
1926         Reviewed by Yusuke Suzuki.
1927
1928         CanvasProxy does not appear to be in any current HTML spec
1929         and was disabled and unimplemented in our tree. Time to 
1930         get rid of it.
1931
1932         * Configurations/FeatureDefines.xcconfig:
1933
1934 2017-09-02  Andy Estes  <aestes@apple.com>
1935
1936         [CA] Upstream QuartzCore-related WebKitSystemInterface functions
1937         https://bugs.webkit.org/show_bug.cgi?id=176270
1938
1939         Reviewed by Tim Horton.
1940
1941         * Platform/mac/LayerHostingContext.mm:
1942         (WebKit::LayerHostingContext::createForPort):
1943         (WebKit::LayerHostingContext::createForExternalHostingProcess):
1944         * UIProcess/mac/PageClientImpl.mm:
1945         (WebKit::PageClientImpl::enterAcceleratedCompositingMode):
1946         (WebKit::PageClientImpl::updateAcceleratedCompositingMode):
1947         * UIProcess/mac/RemoteLayerTreeHost.mm:
1948         (WebKit::RemoteLayerTreeHost::createLayer):
1949         * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:
1950         (WebKit::makeRenderLayer):
1951         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1952         (InitWebCoreSystemInterface):
1953
1954 2017-09-02  Tim Horton  <timothy_horton@apple.com>
1955
1956         Move UI Process part of the Remote Layer Tree code out of a Mac-specific directory
1957         https://bugs.webkit.org/show_bug.cgi?id=176273
1958
1959         Reviewed by Dan Bernstein.
1960
1961         UI-side compositing works on all Cocoa platforms, so the code should
1962         not live inside Mac/. Also merge the Scrolling directory in here,
1963         since those files are very related.
1964
1965         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h: Renamed from SourceebKit/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h.
1966         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in: Renamed from UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.messages.in.
1967         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: Renamed from UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm.
1968         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h: Renamed from UIProcess/mac/RemoteLayerTreeHost.h.
1969         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm: Renamed from UIProcess/mac/RemoteLayerTreeHost.mm.
1970         * UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.h: Renamed from UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.h.
1971         * UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.mm: Renamed from UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.mm.
1972         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: Renamed from UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp.
1973         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: Renamed from UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h.
1974         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp: Renamed from UIProcess/Scrolling/RemoteScrollingTree.cpp.
1975         * UIProcess/RemoteLayerTree/RemoteScrollingTree.h: Renamed from UIProcess/Scrolling/RemoteScrollingTree.h.
1976         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: Renamed from UIProcess/ios/RemoteLayerTreeHostIOS.mm.
1977         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: Renamed from UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm.
1978         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h: Renamed from UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h.
1979         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: Renamed from UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm.
1980         * WebKit.xcodeproj/project.pbxproj:
1981
1982 2017-09-02  Joseph Pecoraro  <pecoraro@apple.com>
1983
1984         Web Automation: -[_WKAutomationSession init] leaks
1985         https://bugs.webkit.org/show_bug.cgi?id=176268
1986
1987         Reviewed by Darin Adler.
1988
1989         * UIProcess/API/Cocoa/_WKAutomationSession.mm:
1990         (-[_WKAutomationSession init]):
1991
1992 2017-09-02  Tim Horton  <timothy_horton@apple.com>
1993
1994         Fix some style issues in the Web Process part of the Remote Layer Tree code
1995         https://bugs.webkit.org/show_bug.cgi?id=176272
1996
1997         Reviewed by Dan Bernstein.
1998
1999         In bug 176271, the style bot noticed some existing style issues in the UI-side
2000         compositing code. Fix them, because there aren't many and they're straightforward.
2001
2002         * WebProcess/WebPage/Cocoa/RemoteLayerTree/GraphicsLayerCARemote.cpp:
2003         * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCAAnimationRemote.h:
2004         * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCAAnimationRemote.mm:
2005         (WebKit::PlatformCAAnimationRemote::setValues):
2006         * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCALayerRemote.cpp:
2007         (WebKit::PlatformCALayerRemote::appendSublayer):
2008         (WebKit::PlatformCALayerRemote::insertSublayer):
2009         (WebKit::PlatformCALayerRemote::replaceSublayer):
2010         * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCALayerRemote.h:
2011         * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
2012         (WebKit::PlatformCALayerRemoteCustom::clone const):
2013         * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCALayerRemoteTiledBacking.h:
2014         * WebProcess/WebPage/Cocoa/RemoteLayerTree/RemoteLayerTreeContext.h:
2015         * WebProcess/WebPage/Cocoa/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
2016         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2017         * WebProcess/WebPage/Cocoa/RemoteLayerTree/RemoteScrollingCoordinator.h:
2018         * WebProcess/WebPage/Cocoa/RemoteLayerTree/RemoteScrollingCoordinator.mm:
2019
2020 2017-09-02  Tim Horton  <timothy_horton@apple.com>
2021
2022         Move Web Process part of the Remote Layer Tree code out of a Mac-specific directory
2023         https://bugs.webkit.org/show_bug.cgi?id=176271
2024
2025         Rubber-stamped by Dan Bernstein.
2026
2027         UI-side compositing works on all Cocoa platforms, so the code should
2028         not live inside Mac/. Also merge the Scrolling directory in here,
2029         since those files are very related.
2030
2031         * WebKit.xcodeproj/project.pbxproj:
2032         * DerivedSources.make:
2033         * PlatformMac.cmake:
2034         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.cpp: Renamed from WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp.
2035         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.h: Renamed from WebProcess/WebPage/mac/GraphicsLayerCARemote.h.
2036         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h: Renamed from WebProcess/WebPage/mac/PlatformCAAnimationRemote.h.
2037         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm: Renamed from WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm.
2038         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemote.cpp.
2039         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemote.h.
2040         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.h: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h.
2041         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm.
2042         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteTiledBacking.cpp: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp.
2043         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteTiledBacking.h: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h.
2044         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h: Renamed from WebProcess/WebPage/mac/RemoteLayerTreeContext.h.
2045         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm: Renamed from WebProcess/WebPage/mac/RemoteLayerTreeContext.mm.
2046         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h: Renamed from WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.h.
2047         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm: Renamed from WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.mm.
2048         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: Renamed from WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h.
2049         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: Renamed from WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm.
2050         * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.h: Renamed from WebProcess/Scrolling/RemoteScrollingCoordinator.h.
2051         * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.messages.in: Renamed from WebProcess/Scrolling/RemoteScrollingCoordinator.messages.in.
2052         * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm: Renamed from WebProcess/Scrolling/RemoteScrollingCoordinator.mm.
2053
2054 2017-09-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2055
2056         [GTK][Wayland] Use fast malloc to allocate backing store cairo surfaces data
2057         https://bugs.webkit.org/show_bug.cgi?id=176226
2058
2059         Reviewed by Michael Catanzaro.
2060
2061         Do not create the cairo surface for BackingStoreBackendCairoImpl. When not using X11 we are going to use an
2062         image surface anyway, so we don't really need to use the create similar. This way we only need to pass the size
2063         and device scale factor to BackingStoreBackendCairoImpl that will create the image surface using fast malloc to
2064         allocate the data.
2065
2066         * UIProcess/cairo/BackingStoreCairo.cpp:
2067         (WebKit::BackingStore::createBackend):
2068
2069 2017-09-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2070
2071         [GTK][Wayland] Opening FedoraProject's pastebin chews CPU
2072         https://bugs.webkit.org/show_bug.cgi?id=175942
2073
2074         Reviewed by Žan Doberšek.
2075
2076         This regressed when we introduced the display refresh monitor. The monitor schedules updates immediately,
2077         because we removed the option to not do frame sync in X11 to let swapBuffers do the throttling, but that's
2078         not happening in Wayland because the nested compositor is dispatching frame callbacks on surface commit.
2079         We need to ensure that frame callbacks are dispatched on every monitor refresh, because swapBuffers waits for
2080         frame callbacks to be queued on display.
2081
2082         * UIProcess/gtk/WaylandCompositor.cpp:
2083         (WebKit::WaylandCompositor::Surface::~Surface): Destroy pending frame callbacks too.
2084         (WebKit::WaylandCompositor::Surface::setWebPage): Add a tick callback to the web view widget to flush all
2085         committed frame callbacks on every frame update.
2086         (WebKit::WaylandCompositor::Surface::requestFrame): Add the callbacks to m_pendingFrameCallbackList.
2087         (WebKit::WaylandCompositor::Surface::flushFrameCallbacks): Dispatch all committed frame callabcks.
2088         (WebKit::WaylandCompositor::Surface::flushPendingFrameCallbacks): Dispatch all pending frame callbacks.
2089         (WebKit::WaylandCompositor::Surface::commit): Do not dispatch frame callbacks here, move them to the list of
2090         committed frame callbacks that will be dispatched on the next frame clock update.
2091         * UIProcess/gtk/WaylandCompositor.h:
2092         (WebKit::WaylandCompositor::Surface::setWebPage): Moved to the cpp.
2093         * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.cpp:
2094         (WebKit::AcceleratedSurfaceWayland::AcceleratedSurfaceWayland): Move surface initialization and destruction to
2095         the compositing thread.
2096         (WebKit::AcceleratedSurfaceWayland::initialize):
2097         (WebKit::AcceleratedSurfaceWayland::finalize):
2098         (WebKit::AcceleratedSurfaceWayland::~AcceleratedSurfaceWayland): Deleted.
2099         * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.h:
2100
2101 2017-09-01  Youenn Fablet  <youenn@apple.com>
2102
2103         Do not Reject CacheStorage promises when updating the persistent filesystem data fails
2104         https://bugs.webkit.org/show_bug.cgi?id=176241
2105
2106         Reviewed by Alex Christensen.
2107
2108         Open/Remove caches may succeed in the memory representation but the write-to-disk operation may fail.
2109         In that case, the callback does not return an error but a value containing the cache identifier.
2110         The value will also contain a boolean flag set to true to notify the client that persistent storage failed this time.
2111
2112         * NetworkProcess/cache/CacheStorageEngine.cpp:
2113         (WebKit::CacheStorage::Engine::open):
2114         (WebKit::CacheStorage::Engine::remove):
2115         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2116         (WebKit::CacheStorage::Caches::open):
2117         (WebKit::CacheStorage::Caches::remove):
2118         * NetworkProcess/cache/CacheStorageEngineCaches.h:
2119
2120 2017-09-01  Alex Christensen  <achristensen@webkit.org>
2121
2122         Add WKUIDelegatePrivate equivalent of WKPageUIClient's toolbarsAreVisible
2123         https://bugs.webkit.org/show_bug.cgi?id=176246
2124         <rdar://problem/29270035>
2125
2126         Reviewed by Tim Horton.
2127
2128         * UIProcess/API/APIUIClient.h:
2129         (API::UIClient::toolbarsAreVisible):
2130         * UIProcess/API/C/WKPage.cpp:
2131         (WKPageSetPageUIClient):
2132         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2133         * UIProcess/Cocoa/UIDelegate.h:
2134         * UIProcess/Cocoa/UIDelegate.mm:
2135         (WebKit::UIDelegate::setDelegate):
2136         (WebKit::UIDelegate::UIClient::toolbarsAreVisible):
2137         * UIProcess/WebPageProxy.cpp:
2138         (WebKit::WebPageProxy::getToolbarsAreVisible):
2139         * UIProcess/WebPageProxy.h:
2140         * UIProcess/WebPageProxy.messages.in:
2141
2142 2017-09-01  Alex Christensen  <achristensen@webkit.org>
2143
2144         Make PageClientImplCocoa a proper superclass of PageClientImpls for Mac and iOS
2145         https://bugs.webkit.org/show_bug.cgi?id=176239
2146
2147         Reviewed by Tim Horton.
2148
2149         * UIProcess/Cocoa/PageClientImplCocoa.h: Added.
2150         (WebKit::PageClientImplCocoa::PageClientImplCocoa):
2151         * UIProcess/Cocoa/PageClientImplCocoa.mm:
2152         (WebKit::PageClientImplCocoa::isPlayingAudioWillChange):
2153         (WebKit::PageClientImplCocoa::isPlayingAudioDidChange):
2154         (WebKit::PageClientImpl::isPlayingAudioWillChange): Deleted.
2155         (WebKit::PageClientImpl::isPlayingAudioDidChange): Deleted.
2156         * UIProcess/Cocoa/WebViewImpl.mm:
2157         * UIProcess/ios/PageClientImplIOS.h:
2158         * UIProcess/ios/PageClientImplIOS.mm:
2159         (WebKit::PageClientImpl::PageClientImpl):
2160         * UIProcess/mac/PageClientImpl.h: Removed.
2161         * UIProcess/mac/PageClientImpl.mm: Removed.
2162         * UIProcess/mac/PageClientImplMac.h: Copied from Source/WebKit/UIProcess/mac/PageClientImpl.h.
2163         * UIProcess/mac/PageClientImplMac.mm: Copied from Source/WebKit/UIProcess/mac/PageClientImpl.mm.
2164         (WebKit::PageClientImpl::PageClientImpl):
2165         * UIProcess/mac/WebContextMenuProxyMac.mm:
2166         * UIProcess/mac/WebPageProxyMac.mm:
2167         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2168         * WebKit.xcodeproj/project.pbxproj:
2169
2170 2017-09-01  Alex Christensen  <achristensen@webkit.org>
2171
2172         Replace WKUIDelegatePrivate's isPlayingMediaDidChange with KVO _isPlayingAudio on WKWebView
2173         https://bugs.webkit.org/show_bug.cgi?id=176212
2174
2175         Reviewed by Tim Horton.
2176
2177         Dan suggested this in bug 176203, I think it's a good idea,
2178         and I'll need to add more KVO properties soon anyways so I'd better learn how.
2179         Determining if audio playing changed is important for Safari, so WKPageUIClient's
2180         isPlayingAudioDidChange was correctly named but incorrectly fired if either audio
2181         or video playing changed and had you check if audio was playing, possibly too often.
2182
2183         * UIProcess/API/APIUIClient.h:
2184         (API::UIClient::isPlayingMediaDidChange):
2185         * UIProcess/API/C/WKPage.cpp:
2186         (WKPageSetPageUIClient):
2187         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2188         * UIProcess/API/Cocoa/WKWebView.mm:
2189         (-[WKWebView _isPlayingAudio]):
2190         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2191         * UIProcess/API/glib/WebKitUIClient.cpp:
2192         * UIProcess/Cocoa/UIDelegate.h:
2193         * UIProcess/Cocoa/UIDelegate.mm:
2194         (WebKit::UIDelegate::setDelegate):
2195         (WebKit::UIDelegate::UIClient::isPlayingMediaDidChange): Deleted.
2196         * UIProcess/Cocoa/WebViewImpl.h:
2197         * UIProcess/Cocoa/WebViewImpl.mm:
2198         (WebKit::WebViewImpl::isPlayingAudioWillChange):
2199         (WebKit::WebViewImpl::isPlayingAudioDidChange):
2200         * UIProcess/PageClient.h:
2201         * UIProcess/WebPageProxy.cpp:
2202         (WebKit::WebPageProxy::isPlayingMediaDidChange):
2203         * UIProcess/mac/PageClientImpl.h:
2204         * UIProcess/mac/PageClientImpl.mm:
2205         (WebKit::PageClientImpl::isPlayingAudioDidChange):
2206         (WebKit::PageClientImpl::isPlayingAudioWillChange):
2207
2208 2017-09-01  Alex Christensen  <achristensen@webkit.org>
2209
2210         Disable ObjC WebGL policy SPI on iOS
2211         https://bugs.webkit.org/show_bug.cgi?id=176233
2212
2213         Reviewed by Tim Horton.
2214         
2215         In r221465 I uploaded new SPI that is only needed on Mac with a beautiful test that only works on Mac.
2216         Since it fails on iOS and is not needed on iOS, let's just disable it on iOS.
2217
2218         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2219         * UIProcess/Cocoa/NavigationState.h:
2220         * UIProcess/Cocoa/NavigationState.mm:
2221         (WebKit::NavigationState::setNavigationDelegate):
2222
2223 2017-09-01  Andy Estes  <aestes@apple.com>
2224
2225         [CG] Upstream CoreGraphics-related WebKitSystemInterface functions
2226         https://bugs.webkit.org/show_bug.cgi?id=176200
2227
2228         Reviewed by Tim Horton.
2229
2230         * PluginProcess/mac/PluginProcessMac.mm:
2231         (WebKit::PluginProcess::platformInitializeProcess):
2232         * UIProcess/mac/WindowServerConnection.h:
2233         * UIProcess/mac/WindowServerConnection.mm:
2234         (WebKit::registerOcclusionNotificationHandler):
2235         (WebKit::WindowServerConnection::WindowServerConnection):
2236         (WebKit::WindowServerConnection::applicationWindowModificationsStarted): Deleted.
2237         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2238         (InitWebCoreSystemInterface):
2239
2240 2017-09-01  Per Arne Vollan  <pvollan@apple.com>
2241
2242         [Win] Compile error, 'Cache' is not declared.
2243         https://bugs.webkit.org/show_bug.cgi?id=176062
2244
2245         Reviewed by Youenn Fablet.
2246
2247         Rename DOMCache to DOMCacheEngine.
2248
2249         * NetworkProcess/cache/CacheStorageEngine.cpp:
2250         (WebKit::CacheStorage::Engine::queryCache):
2251         (WebKit::CacheStorage::Engine::writeFile):
2252         * NetworkProcess/cache/CacheStorageEngine.h:
2253         * NetworkProcess/cache/CacheStorageEngineCache.h:
2254         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2255         (WebKit::CacheStorage::Caches::initialize):
2256         * NetworkProcess/cache/CacheStorageEngineCaches.h:
2257         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
2258         * NetworkProcess/cache/CacheStorageEngineConnection.h:
2259         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
2260         * Shared/WebCoreArgumentCoders.cpp:
2261         (IPC::ArgumentCoder<DOMCacheEngine::CacheInfo>::encode):
2262         (IPC::ArgumentCoder<DOMCacheEngine::CacheInfo>::decode):
2263         (IPC::ArgumentCoder<DOMCacheEngine::Record>::encode):
2264         (IPC::ArgumentCoder<DOMCacheEngine::Record>::decode):
2265         (IPC::ArgumentCoder<DOMCache::CacheInfo>::encode): Deleted.
2266         (IPC::ArgumentCoder<DOMCache::CacheInfo>::decode): Deleted.
2267         (IPC::ArgumentCoder<DOMCache::Record>::encode): Deleted.
2268         (IPC::ArgumentCoder<DOMCache::Record>::decode): Deleted.
2269         * Shared/WebCoreArgumentCoders.h:
2270         * WebProcess/Cache/WebCacheStorageConnection.cpp:
2271         * WebProcess/Cache/WebCacheStorageConnection.h:
2272         * WebProcess/Cache/WebCacheStorageConnection.messages.in:
2273
2274 2017-08-31  Andy Estes  <aestes@apple.com>
2275
2276         [Mac] Upstream AppKit-related WebKitSystemInterface functions
2277         https://bugs.webkit.org/show_bug.cgi?id=176175
2278
2279         Reviewed by Brady Eidson.
2280
2281         * PluginProcess/mac/PluginProcessMac.mm:
2282         (WebKit::initializeCocoaOverrides):
2283         * Shared/mac/WebEventFactory.mm:
2284         (WebKit::WebEventFactory::createWebWheelEvent):
2285         (WebKit::WebEventFactory::createWebKeyboardEvent):
2286         * UIProcess/mac/WKTextInputWindowController.mm:
2287         (-[WKTextInputPanel init]):
2288         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2289         (InitWebCoreSystemInterface):
2290
2291 2017-08-31  Alex Christensen  <achristensen@webkit.org>
2292
2293         Add WKUIDelegatePrivate equivalent of WKPageUIClient's isPlayingAudioDidChange
2294         https://bugs.webkit.org/show_bug.cgi?id=176203
2295         <rdar://problem/29270035>
2296
2297         Reviewed by Tim Horton.
2298
2299         * UIProcess/API/APIUIClient.h:
2300         (API::UIClient::isPlayingMediaDidChange):
2301         (API::UIClient::isPlayingAudioDidChange): Deleted.
2302         * UIProcess/API/C/WKPage.cpp:
2303         (WKPageSetPageUIClient):
2304         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2305         * UIProcess/Cocoa/UIDelegate.h:
2306         * UIProcess/Cocoa/UIDelegate.mm:
2307         (WebKit::UIDelegate::setDelegate):
2308         (WebKit::UIDelegate::UIClient::isPlayingMediaDidChange):
2309         * UIProcess/WebPageProxy.cpp:
2310         (WebKit::WebPageProxy::isPlayingMediaDidChange):
2311
2312 2017-08-31  Alex Christensen  <achristensen@webkit.org>
2313
2314         Add ObjC SPI corresponding to WKPageLoaderClient's webGLLoadPolicy and resolveWebGLLoadPolicy
2315         https://bugs.webkit.org/show_bug.cgi?id=175779
2316         <rdar://problem/22367975>
2317
2318         Reviewed by Tim Horton.
2319
2320         * UIProcess/API/APINavigationClient.h:
2321         (API::NavigationClient::webGLLoadPolicy const):
2322         (API::NavigationClient::resolveWebGLLoadPolicy const):
2323         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2324         * UIProcess/Cocoa/NavigationState.h:
2325         * UIProcess/Cocoa/NavigationState.mm:
2326         (WebKit::NavigationState::setNavigationDelegate):
2327         (WebKit::toWebCoreWebGLLoadPolicy):
2328         (WebKit::NavigationState::NavigationClient::webGLLoadPolicy const):
2329         (WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const):
2330         * UIProcess/WebPageProxy.cpp:
2331         (WebKit::WebPageProxy::webGLPolicyForURL):
2332         (WebKit::WebPageProxy::resolveWebGLPolicyForURL):
2333         * UIProcess/WebPageProxy.h:
2334         * UIProcess/WebPageProxy.messages.in:
2335         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2336         (WebKit::WebFrameLoaderClient::webGLPolicyForURL const):
2337         (WebKit::WebFrameLoaderClient::resolveWebGLPolicyForURL const):
2338         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2339         * WebProcess/WebPage/WebPage.cpp:
2340         (WebKit::WebPage::webGLPolicyForURL):
2341         (WebKit::WebPage::resolveWebGLPolicyForURL):
2342         * WebProcess/WebPage/WebPage.h:
2343         * WebProcess/WebPage/ios/WebPageIOS.mm:
2344         (WebKit::WebPage::webGLPolicyForURL):
2345         (WebKit::WebPage::resolveWebGLPolicyForURL):
2346         * WebProcess/WebPage/mac/WebPageMac.mm:
2347         (WebKit::WebPage::webGLPolicyForURL):
2348         (WebKit::WebPage::resolveWebGLPolicyForURL):
2349
2350 2017-08-31  Brady Eidson  <beidson@apple.com>
2351
2352         Add (entirely incorrect) fetching of ServiceWorker scripts.
2353         https://bugs.webkit.org/show_bug.cgi?id=176179
2354
2355         Reviewed by Andy Estes.
2356
2357         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2358         (WebKit::WebSWServerConnection::startScriptFetchInClient):
2359         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2360         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2361
2362         * WebProcess/Storage/WebSWClientConnection.cpp:
2363         (WebKit::WebSWClientConnection::finishFetchingScriptInServer):
2364         * WebProcess/Storage/WebSWClientConnection.h:
2365         * WebProcess/Storage/WebSWClientConnection.messages.in:
2366
2367 2017-08-31  Megan Gardner  <megan_gardner@apple.com>
2368
2369         Fix error in protocol revving
2370         https://bugs.webkit.org/show_bug.cgi?id=176191
2371
2372         Protocol definition was mastered out of later iOS submissions, causing them to not build.
2373
2374         Reviewed by Tim Horton.
2375
2376         * UIProcess/ios/WKContentViewInteraction.mm:
2377         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:]):
2378
2379 2017-08-31  Youenn Fablet  <youenn@apple.com>
2380
2381         Update CacheStorage caches only if it is updated
2382         https://bugs.webkit.org/show_bug.cgi?id=176135
2383
2384         Reviewed by Alex Christensen.
2385
2386         For each change to CacheStorageEngineCaches list of cache, CacheStorageEngineCaches increments a counter.
2387         When sending the list of caches, CacheStorageEngineCaches will compare its counter with the one provided.
2388         If they sare the same, CacheStorageEngineCaches will return nothing.
2389         Otherwise it returns the whole list of caches.
2390
2391         * NetworkProcess/cache/CacheStorageEngine.cpp:
2392         (WebKit::CacheStorage::Engine::retrieveCaches):
2393         * NetworkProcess/cache/CacheStorageEngine.h:
2394         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2395         (WebKit::CacheStorage::Caches::initialize):
2396         (WebKit::CacheStorage::Caches::open):
2397         (WebKit::CacheStorage::Caches::remove):
2398         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
2399         (WebKit::CacheStorage::Caches::cacheInfos const):
2400         * NetworkProcess/cache/CacheStorageEngineCaches.h:
2401         (WebKit::CacheStorage::Caches::updateCounter const):
2402         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
2403         (WebKit::CacheStorageEngineConnection::caches):
2404         * NetworkProcess/cache/CacheStorageEngineConnection.h:
2405         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
2406         * WebProcess/Cache/WebCacheStorageConnection.cpp:
2407         (WebKit::WebCacheStorageConnection::doRetrieveCaches):
2408         * WebProcess/Cache/WebCacheStorageConnection.h:
2409
2410 2017-08-31  Youenn Fablet  <youenn@apple.com>
2411
2412         Introduce CacheStorageEngineCache to handle cache records
2413         https://bugs.webkit.org/show_bug.cgi?id=176137
2414
2415         Reviewed by Alex Christensen.
2416
2417         CacheStorageEngineCache is the equivalent of WebCore Cache.
2418         It contains a list of records that it needs to manage (add, update, remove).
2419         Moving the logic of this management from CacheStorageEngine to this new class so as to ease future development.
2420
2421         * CMakeLists.txt:
2422         * NetworkProcess/cache/CacheStorageEngine.cpp:
2423         (WebKit::CacheStorage::Engine::open):
2424         (WebKit::CacheStorage::Engine::remove):
2425         (WebKit::CacheStorage::Engine::retrieveRecords):
2426         (WebKit::CacheStorage::Engine::putRecords):
2427         (WebKit::CacheStorage::Engine::deleteMatchingRecords):
2428         (WebKit::CacheStorage::Engine::cache):
2429         (WebKit::CacheStorage::Engine::writeCacheRecords): Deleted.
2430         (WebKit::CacheStorage::Engine::removeCacheRecords): Deleted.
2431         (WebKit::CacheStorage::Engine::queryCache): Deleted.
2432         * NetworkProcess/cache/CacheStorageEngine.h:
2433         * NetworkProcess/cache/CacheStorageEngineCache.cpp: Added.
2434         * NetworkProcess/cache/CacheStorageEngineCache.h:
2435         (WebKit::CacheStorage::Cache::identifier const):
2436         (WebKit::CacheStorage::Cache::name const):
2437         (WebKit::CacheStorage::Cache::info const):
2438         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2439         (WebKit::CacheStorage::Caches::find):
2440         (WebKit::CacheStorage::Caches::open):
2441         (WebKit::CacheStorage::Caches::remove):
2442         (WebKit::CacheStorage::encodeCacheNames):
2443         (WebKit::CacheStorage::Caches::readCachesFromDisk):
2444         (WebKit::CacheStorage::Caches::cacheInfos const):
2445         * WebKit.xcodeproj/project.pbxproj:
2446
2447 2017-08-31  David Quesada  <david_quesada@apple.com>
2448
2449         WKNavigationDelegatePrivate client redirect SPI needs to be able to detect redirects scheduled before the document finishes loading
2450         https://bugs.webkit.org/show_bug.cgi?id=176128
2451         rdar://problem/34068476
2452
2453         Reviewed by Brady Eidson.
2454
2455         _webView:didPerformClientRedirect: isn't useful for delegates that want to know about client redirects
2456         started before the document is finished loading. This is because the method would be called after the
2457         navigation scheduler's timer fires and the navigation for the redirect has begun. Since this happens in
2458         a later iteration of the run loop, the document has already finished loading. Address this by replacing
2459         the method with two that give the navigation delegate more information about when client redirects are
2460         scheduled and canceled.
2461
2462         * UIProcess/API/APINavigationClient.h:
2463         (API::NavigationClient::willPerformClientRedirect):
2464         (API::NavigationClient::didCancelClientRedirect):
2465         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2466         * UIProcess/Cocoa/NavigationState.h:
2467         * UIProcess/Cocoa/NavigationState.mm:
2468         (WebKit::NavigationState::setNavigationDelegate):
2469         (WebKit::NavigationState::NavigationClient::willPerformClientRedirect):
2470         (WebKit::NavigationState::NavigationClient::didCancelClientRedirect):
2471         * UIProcess/WebPageProxy.cpp:
2472         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
2473         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
2474         * UIProcess/WebPageProxy.h:
2475         * UIProcess/WebPageProxy.messages.in:
2476         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2477         (WebKit::WebFrameLoaderClient::dispatchDidCancelClientRedirect):
2478         (WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect):
2479         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2480
2481 2017-08-30  Megan Gardner  <megan_gardner@apple.com>
2482
2483         Remove IsBlockSelection flag
2484         https://bugs.webkit.org/show_bug.cgi?id=176141
2485
2486         Reviewed by Dean Jackson.
2487
2488         Block selection is disabled. Removed code associated with this flag to allow removal of the
2489         flag in UIKit.
2490         
2491         No tests for a removed feature.
2492
2493         * Platform/spi/ios/UIKitSPI.h:
2494         * Shared/ios/GestureTypes.h:
2495         * UIProcess/ios/WKContentViewInteraction.mm:
2496         (toUIWKSelectionFlags):
2497         * WebProcess/WebPage/ios/WebPageIOS.mm:
2498         (WebKit::WebPage::rangeForWebSelectionAtPosition):
2499         (WebKit::WebPage::selectWithGesture):
2500         (WebKit::WebPage::contractedRangeFromHandle):
2501         (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle):
2502         (WebKit::WebPage::updateBlockSelectionWithTouch):
2503         (WebKit::WebPage::updateSelectionWithTouches):
2504
2505 2017-08-30  Alex Christensen  <achristensen@webkit.org>
2506
2507         Add WKUIDelegatePrivate equivalent of WKPageUIClient's didClickAutoFillButton
2508         https://bugs.webkit.org/show_bug.cgi?id=176139
2509         <rdar://problem/29270035>
2510
2511         Reviewed by Tim Horton.
2512
2513         Covered by a cool new API test!
2514
2515         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2516         * UIProcess/Cocoa/UIDelegate.h:
2517         * UIProcess/Cocoa/UIDelegate.mm:
2518         (WebKit::UIDelegate::setDelegate):
2519         (WebKit::UIDelegate::UIClient::didClickAutoFillButton):
2520
2521 2017-08-31  Chris Dumez  <cdumez@apple.com>
2522
2523         Use WTF::crossThreadCopy() in more places
2524         https://bugs.webkit.org/show_bug.cgi?id=176169
2525
2526         Reviewed by Andreas Kling.
2527
2528         Use WTF::crossThreadCopy() in more places to make code more concise.
2529
2530         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2531         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
2532         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
2533         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
2534         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
2535         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
2536         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2537         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains):
2538
2539 2017-08-31  Youenn Fablet  <youenn@apple.com>
2540
2541         Take into account removed caches in Caches::remove assertion
2542         https://bugs.webkit.org/show_bug.cgi?id=176164
2543
2544         Reviewed by Alex Christensen.
2545
2546         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2547         (WebKit::CacheStorage::Caches::remove):
2548
2549 2017-08-31  Youenn Fablet  <youenn@apple.com>
2550
2551         Do not create a salt if the CacheStorage engine should not persist
2552         https://bugs.webkit.org/show_bug.cgi?id=176138
2553
2554         Reviewed by Alex Christensen.
2555
2556         * NetworkProcess/cache/CacheStorageEngine.cpp:
2557         (WebKit::CacheStorage::Engine::~Engine): Ensuring that Caches will not try using the engine if it goes away.
2558         (WebKit::CacheStorage::Engine::initialize): Removing making a salt if engine data is not persistent.
2559         * NetworkProcess/cache/CacheStorageEngine.h: Check persistency according the root path. If it is null, caches should not try to do persistency.
2560         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2561         (WebKit::CacheStorage::cachesRootPath):
2562         (WebKit::CacheStorage::Caches::initialize):
2563         (WebKit::CacheStorage::Caches::detach):
2564         (WebKit::CacheStorage::Caches::readCachesFromDisk):
2565         (WebKit::CacheStorage::Caches::writeCachesToDisk):
2566         * NetworkProcess/cache/CacheStorageEngineCaches.h:
2567         (WebKit::CacheStorage::Caches::shouldPersist const):
2568         * NetworkProcess/cache/NetworkCacheData.cpp: Making makeSalt private again.
2569         (WebKit::NetworkCache::makeSalt):
2570         * NetworkProcess/cache/NetworkCacheData.h:
2571
2572
2573 2017-08-31  Carlos Garcia Campos  <cgarcia@igalia.com>
2574
2575         [GTK] Several InputMethodFilter tests are failing and crashing
2576         https://bugs.webkit.org/show_bug.cgi?id=176158
2577
2578         Reviewed by Carlos Alberto Lopez Perez.
2579
2580         * UIProcess/gtk/InputMethodFilter.cpp:
2581         (WebKit::InputMethodFilter::confirmCurrentComposition): Return early in testing mode because the page is not available.
2582         (WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting): Use hexadecimal numbers for
2583         logging key codes.
2584
2585 2017-08-31  Carlos Garcia Campos  <cgarcia@igalia.com>
2586
2587         [GTK][Wayland] Crash when gdk_keymap_get_entries_for_keyval returns TRUE but n_keys=0
2588         https://bugs.webkit.org/show_bug.cgi?id=176154
2589
2590         Reviewed by Carlos Alberto Lopez Perez.
2591
2592         In Wayland gdk_keymap_get_entries_for_keyval() can return TRUE with n_keys=0. We have several places in WebKit
2593         where we just check the return value of gdk_keymap_get_entries_for_keyval() and then use the returned array to
2594         get the first position assuming it has at least one item. This has always worked in X11 because the GDK X11
2595         backend does the right thing, but it's crashing in Wayland now. It should be fixed in GTK+ but in the meantime
2596         it's easy to workaround by also checking n_keys > 0.
2597
2598         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
2599         (WebKit::doKeyStrokeEvent):
2600
2601 2017-08-30  Dan Bernstein  <mitz@apple.com>
2602
2603         [iOS] REGRESSION (r218144) -[WKContentView targetForAction:withSender:] returns the content view for actions implemented only by the WKWebView, causing a crash
2604         https://bugs.webkit.org/show_bug.cgi?id=176077
2605         <rdar://problem/34145200>
2606
2607         Reviewed by Sam Weinig.
2608
2609         Test: TestWebKitAPI/Tests/WebKitCocoa/WKContentViewTargetForAction.mm
2610
2611         * UIProcess/API/Cocoa/WKWebView.mm:
2612         (-[WKWebView targetForAction:withSender:]): Override and forward WKContentView actions to
2613           -[WKContentView targetForActionForWebView:withSender:].
2614         * UIProcess/ios/WKContentViewInteraction.h: Declare -targetForActionForWebView:withSender:.
2615         * UIProcess/ios/WKContentViewInteraction.mm:
2616         (-[WKContentView targetForAction:withSender:]): Forward to the WKWebView.
2617         (-[WKContentView targetForActionForWebView:withSender:]): Call super’s
2618           -targetForAction:withSender:.
2619
2620 2017-08-30  Brent Fulgham  <bfulgham@apple.com>
2621
2622         Fix whitespace and formatting
2623         https://bugs.webkit.org/show_bug.cgi?id=176134
2624
2625         Reviewed by Sam Weinig.
2626
2627         Bring the file formatting into compliance with WebKit Coding Style.
2628
2629         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
2630         (-[_WKWebsiteDataStoreConfiguration _webStorageDirectory]):
2631         (-[_WKWebsiteDataStoreConfiguration _setWebStorageDirectory:]):
2632         (-[_WKWebsiteDataStoreConfiguration _indexedDBDatabaseDirectory]):
2633         (-[_WKWebsiteDataStoreConfiguration _setIndexedDBDatabaseDirectory:]):
2634         (-[_WKWebsiteDataStoreConfiguration _webSQLDatabaseDirectory]):
2635         (-[_WKWebsiteDataStoreConfiguration _setWebSQLDatabaseDirectory:]):
2636         (-[_WKWebsiteDataStoreConfiguration _cookieStorageFile]):
2637         (-[_WKWebsiteDataStoreConfiguration _setCookieStorageFile:]):
2638         (-[_WKWebsiteDataStoreConfiguration _resourceLoadStatisticsDirectory]):
2639         (-[_WKWebsiteDataStoreConfiguration _setResourceLoadStatisticsDirectory:]):
2640
2641 2017-08-30  Youenn Fablet  <youenn@apple.com>
2642
2643         Remove the list of removed caches from CacheStorageEngine
2644         https://bugs.webkit.org/show_bug.cgi?id=176136
2645
2646         Reviewed by Alex Christensen.
2647
2648
2649         This list is no longer useful as CacheStorageEngineCaches handles its own removed caches.
2650
2651         * NetworkProcess/cache/CacheStorageEngine.cpp:
2652         (WebKit::CacheStorage::Engine::remove):
2653         (WebKit::CacheStorage::Engine::cache):
2654         * NetworkProcess/cache/CacheStorageEngine.h:
2655
2656 2017-08-30  Tim Horton  <timothy_horton@apple.com>
2657
2658         REGRESSION (r221068): Graphics corruption when dragging images on iOS
2659         https://bugs.webkit.org/show_bug.cgi?id=176132
2660         <rdar://problem/34142983>
2661
2662         Reviewed by Dean Jackson.
2663
2664         * Shared/mac/ColorSpaceData.mm:
2665         (WebKit::ColorSpaceData::encode):
2666         Color space encoding was entirely disabled on iOS, so after r221068,
2667         ShareableBitmap would make different decisions about image format
2668         on both sides of the wire.
2669
2670         Enable color space encoding on iOS (decoding is already implemented)
2671         by moving some ifdefs around.
2672
2673 2017-08-30  Youenn Fablet  <youenn@apple.com>
2674
2675         [Cache API] Support cache names persistency
2676         https://bugs.webkit.org/show_bug.cgi?id=175995
2677
2678         Reviewed by Alex Christensen.
2679
2680         Adding disk read/write capacities to CacheStorage engine.
2681         This is used to store per-origin cache names in a file.
2682         Making Engine a thread safe refcounted object so that it does read/write in a background thread.
2683
2684         Introducing CacheStorage::Caches as the object managing the list of Cache objects for a given origin.
2685         Caches will be responsible to do all the read/write operations for all of its caches.
2686         It will be responsible for quota limitation as well.
2687
2688         Moving part of the logic from CacheStorage::Engine into CacheStorage::Caches.
2689
2690         CacheStorage::Engine is initialized asynchronously as it first creates a salt which is used
2691         to obfuscate the names of the various files stored on disk.
2692
2693         In the same spirit, CacheStorage::Caches is initialized asynchronously as it needs to read from the disk the list of cache names.
2694         Once read, the names will be stored in memory.
2695         Added the possibility to clear this in-memory representation. This will be useful for testing.
2696         This might also be useful to save memory when there is no more use of CacheStorage by web pages.
2697
2698         Introducing a new cacheStorageSubdirectoryName parameter for WebsiteDataStore so as to segment the different per session CacheStorageEngine
2699         in direct sub folders of the main cacheStorageDirectory folder.
2700
2701         * CMakeLists.txt:
2702         * NetworkProcess/cache/CacheStorageEngine.cpp:
2703         (WebKit::CacheStorage::Engine::open):
2704         (WebKit::CacheStorage::Engine::remove):
2705         (WebKit::CacheStorage::Engine::retrieveCaches):
2706         (WebKit::CacheStorage::Engine::retrieveRecords):
2707         (WebKit::CacheStorage::Engine::initialize):
2708         (WebKit::CacheStorage::Engine::readCachesFromDisk):
2709         (WebKit::CacheStorage::Engine::cache):
2710         (WebKit::CacheStorage::Engine::writeFile): Making use of default parameter to directly return to the main loop.
2711         (WebKit::CacheStorage::Engine::readFile): Ditto.
2712         (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
2713         * NetworkProcess/cache/CacheStorageEngine.h:
2714         (WebKit::CacheStorage::Engine::rootPath const):
2715         (WebKit::CacheStorage::Engine::salt const):
2716         (WebKit::CacheStorage::Engine::nextCacheIdentifier):
2717         * NetworkProcess/cache/CacheStorageEngineCaches.cpp: Added.
2718         (WebKit::CacheStorage::cachesRootPath):
2719         (WebKit::CacheStorage::cachesListFilename):
2720         (WebKit::CacheStorage::Caches::Caches):
2721         (WebKit::CacheStorage::Caches::initialize):
2722         (WebKit::CacheStorage::Caches::find):
2723         (WebKit::CacheStorage::Caches::open):
2724         (WebKit::CacheStorage::Caches::remove):
2725         (WebKit::CacheStorage::encodeCacheNames):
2726         (WebKit::CacheStorage::decodeCachesNames):
2727         (WebKit::CacheStorage::Caches::readCachesFromDisk):
2728         (WebKit::CacheStorage::Caches::writeCachesToDisk):
2729         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
2730         (WebKit::CacheStorage::Caches::cacheInfos const):
2731         * NetworkProcess/cache/CacheStorageEngineCaches.h: Added.
2732         (WebKit::CacheStorage::Caches::create):
2733         (WebKit::CacheStorage::Caches::isInitialized const):
2734         (WebKit::CacheStorage::Caches::detach):
2735         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
2736         (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
2737         * NetworkProcess/cache/CacheStorageEngineConnection.h:
2738         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
2739         * NetworkProcess/cache/NetworkCacheData.cpp:
2740         (WebKit::NetworkCache::makeSalt):
2741         * NetworkProcess/cache/NetworkCacheData.h:
2742         * UIProcess/WebsiteData/WebsiteDataStore.h:
2743         * WebKit.xcodeproj/project.pbxproj:
2744         * WebProcess/Cache/WebCacheStorageConnection.cpp:
2745         (WebKit::WebCacheStorageConnection::clearMemoryRepresentation):
2746         * WebProcess/Cache/WebCacheStorageConnection.h:
2747
2748 2017-08-30  Brady Eidson  <beidson@apple.com>
2749
2750         Add "Identified" base class to replace a whole bunch of custom identifier generators.
2751         https://bugs.webkit.org/show_bug.cgi?id=176120
2752
2753         Reviewed by Alex Christensen.
2754
2755         * UIProcess/API/APIUserScript.cpp:
2756         (API::UserScript::UserScript):
2757         (API::generateIdentifier): Deleted.
2758         * UIProcess/API/APIUserScript.h:
2759
2760         * UIProcess/API/APIUserStyleSheet.cpp:
2761         (API::UserStyleSheet::UserStyleSheet):
2762         (API::generateIdentifier): Deleted.
2763         * UIProcess/API/APIUserStyleSheet.h:
2764
2765         * UIProcess/UserContent/WebScriptMessageHandler.cpp:
2766         (WebKit::WebScriptMessageHandler::WebScriptMessageHandler):
2767         (WebKit::generateIdentifier): Deleted.
2768         * UIProcess/UserContent/WebScriptMessageHandler.h:
2769         (WebKit::WebScriptMessageHandler::identifier const): Deleted.
2770
2771         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
2772         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
2773         (WebKit::WebUserContentControllerProxy::~WebUserContentControllerProxy):
2774         (WebKit::WebUserContentControllerProxy::addProcess):
2775         (WebKit::WebUserContentControllerProxy::removeProcess):
2776         (WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
2777         (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
2778         (WebKit::WebUserContentControllerProxy::addUserScript):
2779         (WebKit::WebUserContentControllerProxy::removeUserScript):
2780         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
2781         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
2782         (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
2783         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
2784         (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
2785         (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
2786         (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
2787         (WebKit::WebUserContentControllerProxy::addContentRuleList):
2788         (WebKit::WebUserContentControllerProxy::removeContentRuleList):
2789         (WebKit::WebUserContentControllerProxy::removeAllContentRuleLists):
2790         (WebKit::generateIdentifier): Deleted.
2791         * UIProcess/UserContent/WebUserContentControllerProxy.h:
2792         (WebKit::WebUserContentControllerProxy::identifier const): Deleted.
2793
2794         * UIProcess/VisitedLinkStore.cpp:
2795         (WebKit::VisitedLinkStore::~VisitedLinkStore):
2796         (WebKit::VisitedLinkStore::VisitedLinkStore):
2797         (WebKit::VisitedLinkStore::addProcess):
2798         (WebKit::VisitedLinkStore::removeProcess):
2799         (WebKit::VisitedLinkStore::removeAll):
2800         (WebKit::VisitedLinkStore::pendingVisitedLinksTimerFired):
2801         (WebKit::VisitedLinkStore::sendTable):
2802         (WebKit::generateIdentifier): Deleted.
2803         * UIProcess/VisitedLinkStore.h:
2804
2805         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2806         (WebKit::WebsiteDataStore::WebsiteDataStore):
2807         (WebKit::generateIdentifier): Deleted.
2808         * UIProcess/WebsiteData/WebsiteDataStore.h:
2809         (WebKit::WebsiteDataStore::identifier const): Deleted.
2810
2811         * WebProcess/Network/WebSocketStream.cpp:
2812         (WebKit::WebSocketStream::WebSocketStream):
2813         (WebKit::WebSocketStream::~WebSocketStream):
2814         (WebKit::WebSocketStream::messageSenderDestinationID):
2815         * WebProcess/Network/WebSocketStream.h:
2816
2817 2017-08-30  Brady Eidson  <beidson@apple.com>
2818
2819         Implement all of "Register" right up until where the script is fetched.
2820         https://bugs.webkit.org/show_bug.cgi?id=176082
2821
2822         Reviewed by Andy Estes.
2823
2824         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2825         (WebKit::WebSWServerConnection::resolveJobInClient):
2826         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2827         * WebProcess/Storage/WebSWClientConnection.messages.in:
2828
2829 2017-08-30  Andy Estes  <aestes@apple.com>
2830
2831         [Mac] Upstream Accessibility-related WebKitSystemInterface functions
2832         https://bugs.webkit.org/show_bug.cgi?id=176093
2833
2834         Reviewed by Eric Carlson.
2835
2836         * UIProcess/Cocoa/WebViewImpl.h:
2837         * UIProcess/Cocoa/WebViewImpl.mm:
2838         (WebKit::WebViewImpl::setAccessibilityWebProcessToken):
2839         (WebKit::WebViewImpl::updateRemoteAccessibilityRegistration):
2840         (WebKit::WebViewImpl::accessibilityRegisterUIProcessTokens):
2841         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2842         (InitWebCoreSystemInterface):
2843         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
2844         * WebProcess/WebPage/mac/WebPageMac.mm:
2845         (WebKit::WebPage::platformInitialize):
2846         (WebKit::WebPage::registerUIProcessAccessibilityTokens):
2847
2848 2017-08-30  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2849
2850         [WPE] Enable MEMORY_SAMPLER
2851         https://bugs.webkit.org/show_bug.cgi?id=176099
2852
2853         Reviewed by Michael Catanzaro.
2854
2855         Enable it at runtime if the environment variable WEBKIT_SAMPLE_MEMORY is set.
2856
2857         * UIProcess/API/wpe/WPEView.cpp:
2858         (WKWPE::m_compositingManagerProxy):
2859
2860 2017-08-30  Andy Estes  <aestes@apple.com>
2861
2862         [Mac] Upstream Carbon-related WebKitSystemInterface functions
2863         https://bugs.webkit.org/show_bug.cgi?id=176087
2864
2865         Reviewed by Alex Christensen.
2866
2867         * PluginProcess/mac/PluginProcessMac.mm:
2868         (WebKit::cgWindowID):
2869         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2870         (WebKit::scriptCodeFromCurrentKeyboardInputSource):
2871         (WebKit::NetscapePlugin::sendComplexTextInput):
2872
2873 2017-08-30  Carlos Garcia Campos  <cgarcia@igalia.com>
2874
2875         Unreviewed. Try to fix layout test timing out after r221344.
2876
2877         There seems to be an infinite loop in the web process when WebPage::platformEditorState is called with non
2878         content editable result.
2879
2880         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
2881         (WebKit::WebPage::platformEditorState const):
2882
2883 2017-08-29  Carlos Garcia Campos  <cgarcia@igalia.com>
2884
2885         REGRESSION(r221064): [GTK] Editor not correctly working after r221064
2886         https://bugs.webkit.org/show_bug.cgi?id=176052
2887
2888         Reviewed by Michael Catanzaro.
2889
2890         Since r221064 we are not always notified about typing attributes when editor state changes. didChangeSelection
2891         no longer includes the typing attributes in EditorStateChange message, it's scheduled to be sent after the
2892         compositing layer have been flushed, but that part is not implemented for GTK+ port.
2893
2894         Fixes test /webkit2/WebKitWebView/editor-state/typing-attributes.
2895
2896         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2897         (WebKit::AcceleratedDrawingArea::updateBackingStoreState): Call WebPage::flushPendingEditorStateUpdate() after
2898         the layout.
2899         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2900         (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired): Call WebPage::flushPendingEditorStateUpdate() after
2901         the display sync.
2902         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2903         (WebKit::DrawingAreaImpl::display): Call WebPage::flushPendingEditorStateUpdate() after the layout.
2904         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
2905         (WebKit::WebPage::platformEditorState const): Also return early, setting isMissingPostLayoutData to true, when
2906         there's no frame view, the view needs a layout or the result is not for editable content.
2907
2908 2017-08-29  Brent Fulgham  <bfulgham@apple.com>
2909
2910         ResourceLoadStatistics logic does not understand custom WebsiteData stores
2911         https://bugs.webkit.org/show_bug.cgi?id=176037
2912         <rdar://problem/33338238>
2913
2914         Reviewed by Alex Christensen.
2915
2916         The NetworkProcess::updateCookiePartitioningForTopPrivatelyOwnedDomains always notifies the default website
2917         data store about observations it has made. This should be revised so that WebKit clients that register
2918         custom data stores through the WKWebsiteDataStores API can be assured that observations made in one session
2919         do not manipulate data from another session.
2920
2921         * NetworkProcess/NetworkProcess.cpp:
2922         (WebKit::NetworkProcess::updateCookiePartitioningForTopPrivatelyOwnedDomains): Use the passed sessionID to locate
2923         the correct NetworkStorageSession to notify about the new partitioning data.
2924         * NetworkProcess/NetworkProcess.h:
2925         * NetworkProcess/NetworkProcess.messages.in: Accept new argument.
2926         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2927         (WebKit::WebsiteDataStore::updateCookiePartitioningForTopPrivatelyOwnedDomains): Include the WebsiteDataStore's
2928         session ID in the message to update cookie partition data.
2929
2930 2017-08-29  Alex Christensen  <achristensen@webkit.org>
2931
2932         Automatically determine if a class has a modern decoder
2933         https://bugs.webkit.org/show_bug.cgi?id=176084
2934
2935         Reviewed by Sam Weinig.
2936
2937         Instead of determining if ModernDecoder is defined in the class,
2938         just check the signature of the decode member function.
2939
2940         * Platform/IPC/ArgumentCoder.h:
2941         (): Deleted.
2942         * Shared/WebPageCreationParameters.h:
2943         * Shared/WebPageGroupData.h:
2944         * Shared/WebsitePolicies.h:
2945
2946 2017-08-29  Alex Christensen  <achristensen@webkit.org>
2947
2948         Begin transition to modern IPC decoding
2949         https://bugs.webkit.org/show_bug.cgi?id=176043
2950
2951         Reviewed by JF Bastien.
2952
2953         Right now, if a class is decoded from IPC we must have a default constructor.
2954         This prevents us from having Ref or C++ references in such types, which is cluttering up our code.
2955         This is because IPC::decode makes a default-constructed object, fills it, and returns a bool indicating success.
2956         Making IPC::decode instead return a std::optional makes it so we do not need to call an empty constructor.
2957         This could also enable us to add IPC::Decoder::operator>> and other fun things!
2958         I also modernized two arbitrary classes, WebsitePolicies and WebPageGroupData with more to come.
2959         There's no good way to update the actual generated IPC code until each class has been transitioned.
2960
2961         * Platform/IPC/ArgumentCoder.h:
2962         (IPC::ArgumentCoder::decode):
2963         * Platform/IPC/Decoder.h:
2964         (IPC::Decoder::decode):
2965         * Shared/WebPageCreationParameters.cpp:
2966         (WebKit::WebPageCreationParameters::decode):
2967         * Shared/WebPageCreationParameters.h:
2968         * Shared/WebPageGroupData.cpp:
2969         (WebKit::WebPageGroupData::decode):
2970         * Shared/WebPageGroupData.h:
2971         * Shared/WebsitePolicies.h:
2972         (WebKit::WebsitePolicies::decode):
2973
2974 2017-08-29  Youenn Fablet  <youenn@apple.com>
2975
2976         Setting the cache storage engine root path according the session WebsiteDataStore
2977         https://bugs.webkit.org/show_bug.cgi?id=176055
2978
2979         Reviewed by Alex Christensen.
2980
2981         Adding disk read/write capacities to CacheStorage engine.
2982         This is used to store per-origin cache names in a file.
2983         Making Engine a thread safe refcounted object so that it does read/write in a background thread.
2984
2985         Setting the root path of the engine to the directory set for the session in use according the WebsiteDataStore.
2986         For each WebsiteDataStore, a path and a sandbox extension is passed to the network process if persistency of the cache storage is wanted.
2987         Ephemeral sessions will set the path of the engine to null so that no read/write access is performed.
2988
2989         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2990         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
2991         * NetworkProcess/NetworkProcess.cpp:
2992         (WebKit::NetworkProcess::initializeNetworkProcess):
2993         (WebKit::NetworkProcess::cacheStorageDirectory const):
2994         * NetworkProcess/NetworkProcess.h:
2995         * NetworkProcess/cache/CacheStorageEngine.cpp:
2996         (WebKit::CacheStorage::Engine::from):
2997         (WebKit::CacheStorage::Engine::defaultEngine):
2998         (WebKit::CacheStorage::Engine::Engine):
2999         (WebKit::CacheStorage::Engine::writeFile):
3000         * NetworkProcess/cache/CacheStorageEngine.h:
3001         (WebKit::CacheStorage::Engine::create):
3002         (WebKit::CacheStorage::Engine::shouldPersist const):
3003         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3004         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3005         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3006         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
3007         * Shared/WebsiteDataStoreParameters.cpp:
3008         (WebKit::WebsiteDataStoreParameters::encode const):
3009         (WebKit::WebsiteDataStoreParameters::decode):
3010         * Shared/WebsiteDataStoreParameters.h:
3011         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3012         (WebKit::WebsiteDataStore::parameters):
3013
3014 2017-08-29  Chris Dumez  <cdumez@apple.com>
3015
3016         Add initial support for dataTransferItem.webkitGetAsEntry()
3017         https://bugs.webkit.org/show_bug.cgi?id=176038
3018         <rdar://problem/34121095>
3019
3020         Reviewed by Wenson Hsieh.
3021
3022         Make dataTransfer.items an experimental feature so that it can be easily
3023         turned on from the Develop menu, for testing convenience.
3024
3025         * Shared/WebPreferencesDefinitions.h:
3026
3027 2017-08-29  Andy Estes  <aestes@apple.com>
3028
3029         [Mac] Upstream WKSetMetadataURL() from WebKitSystemInterface
3030         https://bugs.webkit.org/show_bug.cgi?id=176046
3031
3032         Reviewed by Alex Christensen.
3033
3034         * UIProcess/mac/WebPageProxyMac.mm:
3035         (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw):
3036         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3037         (InitWebCoreSystemInterface):
3038
3039 2017-08-28  Andy Estes  <aestes@apple.com>
3040
3041         [Cocoa] Upstream WKGetWebDefaultCFStringEncoding()
3042         https://bugs.webkit.org/show_bug.cgi?id=176039
3043
3044         Reviewed by Alex Christensen.
3045
3046         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3047         (InitWebCoreSystemInterface):
3048
3049 2017-08-28  Megan Gardner  <megan_gardner@apple.com>
3050
3051         Fix incorrect enum in atBoundaryOfGranularity call
3052         https://bugs.webkit.org/show_bug.cgi?id=176004
3053
3054         Reviewed by Wenson Hsieh and Enrica Casucci
3055
3056         Enum that was being used was incorrect, as that case in not covered in called function.
3057         Resulted in a no-op. Should now have correct behavior around line boundaries.
3058         
3059         Not possible to add tests for selections with velocity. Will attempt to add this behavior later.
3060
3061         * WebProcess/WebPage/ios/WebPageIOS.mm:
3062         (WebKit::rangeAtWordBoundaryForPosition):
3063
3064 2017-08-28  Stephan Szabo  <stephan.szabo@sony.com>
3065
3066         [WinCairo] Add PlatformWin cmake for Webkit
3067         https://bugs.webkit.org/show_bug.cgi?id=176027
3068
3069         Reviewed by Brent Fulgham.
3070
3071         * PlatformWin.cmake: Added.
3072
3073 2017-08-28  Andy Estes  <aestes@apple.com>
3074
3075         [Cocoa] Upstream CFNetwork-related WebKitSystemInterface functions
3076         https://bugs.webkit.org/show_bug.cgi?id=176032
3077
3078         Reviewed by Alex Christensen.
3079
3080         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3081         (WebKit::privateBrowsingSession):
3082         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3083         (InitWebCoreSystemInterface):
3084         * WebProcess/WebPage/mac/WebPageMac.mm:
3085         (WebKit::WebPage::platformHasLocalDataForURL):
3086         (WebKit::cachedResponseForURL):
3087
3088 2017-08-28  Brent Fulgham  <bfulgham@apple.com>
3089
3090         Disable access to secure cookies if an HTTPS site loads mixed content (Part 2: Header Requests)
3091         https://bugs.webkit.org/show_bug.cgi?id=175992
3092         <rdar://problem/34086613>
3093
3094         Reviewed by Daniel Bates.
3095
3096         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3097         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM): Use a better label than 'result'.
3098         (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue): Modify to accept a flag
3099         indicating if secure cookies should be included, and return a pair containing the resulting
3100         cookie string and a boolean indicating if secure cookies were accessed.
3101         * NetworkProcess/NetworkConnectionToWebProcess.h:
3102         * NetworkProcess/NetworkConnectionToWebProcess.messages.in: Ditto.
3103         * Shared/mac/CookieStorageShim.mm:
3104         (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL): Ditto.
3105         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3106         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue): Ditto.
3107         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3108
3109 2017-08-28  Alex Christensen  <achristensen@webkit.org>
3110
3111         Add WKUIDelegatePrivate equivalent of WKPageUIClient's didExceedBackgroundResourceLimitWhileInForeground
3112         https://bugs.webkit.org/show_bug.cgi?id=176028
3113         <rdar://problem/29270035>
3114
3115         Reviewed by Andy Estes.
3116
3117         An API test for this did not succeed with either the memory or CPU limit calls,
3118         possibly because the app must be in the foreground for this call to be made.
3119
3120         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3121         * UIProcess/Cocoa/UIDelegate.h:
3122         * UIProcess/Cocoa/UIDelegate.mm:
3123         (WebKit::UIDelegate::setDelegate):
3124         (WebKit::toWKResourceLimit):
3125         (WebKit::UIDelegate::UIClient::didExceedBackgroundResourceLimitWhileInForeground):
3126
3127 2017-08-28  Carlos Garcia Campos  <cgarcia@igalia.com>
3128
3129         WebDriver: implement screen capture commands
3130         https://bugs.webkit.org/show_bug.cgi?id=174615
3131
3132         Reviewed by Brian Burg.
3133
3134         Extend takeScreenshot command to optionally take a screenshot of an element. When no element is provided, the
3135         screenshot is taken from the page visible area.
3136
3137         * PlatformGTK.cmake: Add WebAutomationSessionCairo.cpp to compilation.
3138         * PlatformWPE.cmake: Ditto.
3139         * UIProcess/Automation/Automation.json: Add ScreenshotError and several optional parameters to takeScreenshot.
3140         * UIProcess/Automation/WebAutomationSession.cpp:
3141         (WebKit::WebAutomationSession::takeScreenshot): Receive optional frame, node and scrollIntoView that are
3142         checked and passed to the web process.
3143         * UIProcess/Automation/WebAutomationSession.h:
3144         * UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp: Added.
3145         (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData): Cairo implementation.
3146         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
3147         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
3148         (WebKit::snapshotRectForScreenshot): Helper to get the rectangle to be used for a screenshot.
3149         (WebKit::WebAutomationSessionProxy::takeScreenshot): If a node handle is provided take the snapshot using the
3150         element rectangle, otherwise use the page visible content rectangle.
3151         * WebProcess/Automation/WebAutomationSessionProxy.h:
3152         * WebProcess/Automation/WebAutomationSessionProxy.messages.in: Update TakeSnapshot message.
3153
3154 2017-08-28  Carlos Garcia Campos  <cgarcia@igalia.com>
3155
3156         Automation: takeScreenshot should use the visible content rect not the document rect
3157         https://bugs.webkit.org/show_bug.cgi?id=175665
3158
3159         Reviewed by Brian Burg.
3160
3161         According to the spec, we should get the toplevel browsing context document rectangle and take a screenshot of
3162         it using the current viewport width and height. We are currently using the document size.
3163
3164         19. Screen Capture.
3165         https://w3c.github.io/webdriver/webdriver-spec.html#dfn-draw-a-bounding-box-from-the-framebuffer
3166
3167         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
3168         (WebKit::WebAutomationSessionProxy::takeScreenshot): Use FrameView::visibleContentRect().
3169
3170 2017-08-28  Carlos Garcia Campos  <cgarcia@igalia.com>
3171
3172         [GTK][WPE] ASSERTION FAILED: !isOpen() in WebKit::IconDatabase::~IconDatabase()
3173         https://bugs.webkit.org/show_bug.cgi?id=175719
3174
3175         Reviewed by Michael Catanzaro.
3176
3177         This is happening always when running /webkit2/WebKitFaviconDatabase/favicon-database-test in debug builds. The
3178         last step we do is removing all icons, then the test finishes, which destroys the WebKitFaviconDatabase object
3179         that closes the icon database on dispose. The problem is that removing all icons schedules a main thread
3180         notification and IconDatabase is not considered closed until all main thread callbacks have been dispatched. This
3181         is never going to happen in the test, because the main loop is no longer running at that point. I don't think
3182         it's worth it to consider the database open while main thread callbacks are pending, they are just notifications
3183         and the client is no longer insterested on them afer closing the database. I think it's bettter and simpler to
3184         simply cancel the pending callbacks on database close. That ensures that isOpen() after close() is always
3185         false. This patch adds a helper private class to schedule notifications to the main thread that can be cancelled
3186         on database close. It also removes the didClose() notification because it was unused and because it's pointless
3187         now that we know the database is closed after close().
3188
3189         * UIProcess/API/glib/IconDatabase.cpp:
3190         (WebKit::IconDatabase::open): Mark the main thread notifier as active.
3191         (WebKit::IconDatabase::close): Mark the main thread notifier as not active.
3192         (WebKit::IconDatabase::IconDatabase): Remove m_mainThreadCallbackCount initialization.
3193         (WebKit::IconDatabase::isOpen const): Do what isOpenBesidesMainThreadCallbacks() used to do.
3194         (WebKit::IconDatabase::removeAllIconsOnThread): Remove the notification because it's currently unused.
3195         (WebKit::IconDatabase::dispatchDidImportIconURLForPageURLOnMainThread): Use MainThreadNotifier.
3196         (WebKit::IconDatabase::dispatchDidImportIconDataForPageURLOnMainThread): Ditto.
3197         (WebKit::IconDatabase::dispatchDidFinishURLImportOnMainThread): Ditto.
3198         (WebKit::IconDatabase::isOpenBesidesMainThreadCallbacks const): Deleted.
3199         (WebKit::IconDatabase::checkClosedAfterMainThreadCallback): Deleted.
3200         (WebKit::IconDatabase::dispatchDidRemoveAllIconsOnMainThread): Deleted.
3201         * UIProcess/API/glib/IconDatabase.h:
3202         (WebKit::IconDatabaseClient::didChangeIconForPageURL):
3203         (WebKit::IconDatabaseClient::didFinishURLImport):
3204         (WebKit::IconDatabase::MainThreadNotifier::MainThreadNotifier):
3205         (WebKit::IconDatabase::MainThreadNotifier::setActive):
3206         (WebKit::IconDatabase::MainThreadNotifier::notify):
3207         (WebKit::IconDatabase::MainThreadNotifier::stop):
3208         (WebKit::IconDatabase::MainThreadNotifier::timerFired):
3209         (WebKit::IconDatabaseClient::didRemoveAllIcons): Deleted.
3210         (WebKit::IconDatabaseClient::didClose): Deleted.
3211
3212 2017-08-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3213
3214         Picking an emoji via the emoji dialog (Ctrl+Cmd+Space) fires inconsistent beforeinput events.
3215         https://bugs.webkit.org/show_bug.cgi?id=170955
3216         <rdar://problem/31697653>
3217
3218         Reviewed by Ryosuke Niwa.
3219
3220         Currently, we insert text with TextEventInputAutocompletion as the text event input type if any text range to
3221         replace was specified by the platform. Instead, limit this only to when the text replacement range is not empty.
3222         This more closely matches the intention of the spec, which states that the "insertReplacementText" inputType
3223         should be used when "[replacing] existing text by means of a spell checker, auto-correct or similar".
3224
3225         * WebProcess/WebPage/WebPage.cpp:
3226         (WebKit::WebPage::insertTextAsync):
3227
3228 2017-08-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3229
3230         [iOS WK2] Web process crashes after changing selection to the end of the document when speaking a selection
3231         https://bugs.webkit.org/show_bug.cgi?id=176011
3232         <rdar://problem/32614095>
3233
3234         Reviewed by Ryosuke Niwa.
3235
3236         Adds an SPI hook to test accessibility codepaths when speaking selected content. This patch does some minor
3237         refactoring by introducing _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:, which takes
3238         and invokes a completion handler block. The existing _accessibilityRetrieveRectsAtSelectionOffset:withText:
3239         method simply turns around and calls the former variant with `nil` as a completion handler.
3240
3241         * UIProcess/API/Cocoa/WKWebView.mm:
3242         (-[WKWebView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]):
3243         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3244         * UIProcess/ios/WKContentViewInteraction.h:
3245         * UIProcess/ios/WKContentViewInteraction.mm:
3246         (-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:]):
3247         (-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:completionHandler:]):
3248         * WebProcess/WebPage/ios/WebPageIOS.mm:
3249         (WebKit::visiblePositionForPositionWithOffset): Deleted.
3250
3251 2017-08-25  Alex Christensen  <achristensen@webkit.org>
3252
3253         Add WKUIDelegatePrivate equivalent of WKPageUIClient's saveDataToFileInDownloadsFolder
3254         https://bugs.webkit.org/show_bug.cgi?id=176000
3255         <rdar://problem/29270035>
3256
3257         Reviewed by Andy Estes.
3258         
3259         Covered by a new API test.
3260
3261         * Shared/Cocoa/WKNSData.h:
3262         (wrapper): Deleted.
3263         * UIProcess/API/APIUIClient.h:
3264         (API::UIClient::saveDataToFileInDownloadsFolder):
3265         * UIProcess/API/C/WKPage.cpp:
3266         (WKPageSetPageUIClient):
3267         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3268         * UIProcess/Cocoa/UIDelegate.h:
3269         * UIProcess/Cocoa/UIDelegate.mm:
3270         (WebKit::UIDelegate::setDelegate):
3271         (WebKit::UIDelegate::UIClient::saveDataToFileInDownloadsFolder):
3272         * UIProcess/WebPageProxy.cpp:
3273         (WebKit::WebPageProxy::saveDataToFileInDownloadsFolder):
3274         (WebKit::WebPageProxy::savePDFToFileInDownloadsFolder):
3275         * UIProcess/WebPageProxy.h:
3276         * UIProcess/WebPageProxy.messages.in:
3277         * WebProcess/WebPage/WebFrame.cpp:
3278         (WebKit::WebFrame::url const):
3279         * WebProcess/WebPage/WebFrame.h:
3280         * WebProcess/WebPage/WebPage.cpp:
3281         (WebKit::WebPage::savePDFToFileInDownloadsFolder):
3282         * WebProcess/WebPage/WebPage.h:
3283
3284 2017-08-25  David Kilzer  <ddkilzer@apple.com>
3285
3286         Fix -Wunused-lambda-capture warnings in WebKit with new clang compiler
3287         <https://webkit.org/b/175911>
3288         <rdar://problem/33667497>
3289
3290         Reviewed by Alex Christensen.
3291
3292         * NetworkProcess/cache/CacheStorageEngine.cpp:
3293         (WebKit::CacheStorage::Engine::retrieveCaches): Remove unused
3294         lambda capture for 'this'.
3295         (WebKit::CacheStorage::Engine::putRecords): Remove unused
3296         lambda capture for 'cacheIdentifier'.
3297         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
3298         (WebKit::CacheStorageEngineConnection::records): Ditto.
3299
3300 2017-08-25  Brian Burg  <bburg@apple.com>
3301
3302         Web Automation: add capabilities to control ICE candidate filtering and insecure media capture
3303         https://bugs.webkit.org/show_bug.cgi?id=175563
3304         <rdar://problem/33734492>
3305
3306         Reviewed by Joseph Pecoraro.
3307
3308         * UIProcess/Cocoa/AutomationClient.mm:
3309         (WebKit::AutomationClient::requestAutomationSessionWithCapabilities):
3310         Translate new capabilities to _WKAutomationSessionConfiguration properties.
3311
3312 2017-08-24  Brian Burg  <bburg@apple.com>
3313
3314         Web Automation: use automation session configurations to propagate per-session settings
3315         https://bugs.webkit.org/show_bug.cgi?id=175562
3316         <rdar://problem/30853362>
3317
3318         Reviewed by Joseph Pecoraro.
3319
3320         Some WebDriver capabilities need WebKit support in order to be implemented correctly.
3321         There is currently no easy way to forward WebDriver capability keys and values to WebKit
3322         at session creation time. This is unfortunate, as it would be best to implement many of
3323         them via existing mechanisms (i.e., WKPreferences properties) that need to be set up
3324         before any windows are opened in the session.
3325
3326         This patch adds WebKit-side plumbing to forward named capabilities from a remote
3327         WebDriver client to the _WKAutomationSession and its delegate in WebKit2 UIProcess.
3328         These capabilities are exposed via API in ways that abstract away details of how the
3329         capabilities are represented in RWI wire protocol messages.
3330
3331         In the Cocoa API, these capabilities are exposed via a session configuration object
3332         that's similar to WKWebView's WKWebViewConfiguration. A session's configuration is copied
3333         and used at initialization and cannot be modified after the session is created.
3334         Code in the Cocoa subclass of API::AutomationClient translates between RWI protocol
3335         capability names and property values on the _WKAutomationSessionConfiguration it
3336         uses to request a new session.
3337
3338         Later patches will hook up the two properties present in the configuration in this patch.
3339         Most of this patch is just generic plumbing without doing any capability-specific work.
3340
3341         * UIProcess/API/Cocoa/_WKAutomationDelegate.h:
3342         * UIProcess/API/Cocoa/_WKAutomationSession.h:
3343         * UIProcess/API/Cocoa/_WKAutomationSession.mm:
3344         (-[_WKAutomationSession init]):
3345         (-[_WKAutomationSession initWithConfiguration:]):
3346         (-[_WKAutomationSession configuration]):
3347         * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKAutomationDelegate.h.
3348         * UIProcess/API/Cocoa/_WKAutomationSessionConfiguration.mm: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSession.h.
3349         (-[_WKAutomationSessionConfiguration init]):
3350         (-[_WKAutomationSessionConfiguration description]):
3351         * UIProcess/Cocoa/AutomationClient.h:
3352         * UIProcess/Cocoa/AutomationClient.mm:
3353         (WebKit::AutomationClient::AutomationClient):
3354         (WebKit::AutomationClient::requestAutomationSession):
3355         (WebKit::AutomationClient::requestAutomationSessionWithCapabilities):
3356         * WebKit.xcodeproj/project.pbxproj:
3357
3358 2017-08-25  Brady Eidson  <beidson@apple.com>
3359
3360         Introduce ServerWorkerRegistration task queues.
3361         https://bugs.webkit.org/show_bug.cgi?id=175851
3362
3363         Reviewed by Andy Estes.
3364
3365         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3366         (WebKit::WebSWServerConnection::WebSWServerConnection):
3367         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3368         (WebKit::WebSWServerConnection::identifier const): Deleted.
3369
3370         * WebProcess/Storage/WebSWClientConnection.h:
3371         (WebKit::WebSWClientConnection::identifier const): Deleted.
3372
3373 2017-08-25  Youenn Fablet  <youenn@apple.com>
3374
3375         [Cache API] UIProcess should provide the directory path where to store Cache Storage data
3376         https://bugs.webkit.org/show_bug.cgi?id=175884
3377         <rdar://problem/34072441>
3378
3379         Unreviewed.
3380
3381         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3382         (API::ProcessPoolConfiguration::ProcessPoolConfiguration): Fixing typo.
3383
3384 2017-08-25  Jonathan Bedard  <jbedard@apple.com>
3385
3386         Fix build breakage with Public iOS 11 SDK
3387         https://bugs.webkit.org/show_bug.cgi?id=175960
3388         <rdar://problem/34069264>
3389
3390         Reviewed by Wenson Hsieh.
3391
3392         * Platform/spi/ios/UIKitSPI.h: Add UIURLDragPreviewView declaration.
3393
3394 2017-08-24  Chris Dumez  <cdumez@apple.com>
3395
3396         [Directory Upload] Add basic support for input.webkitdirectory
3397         https://bugs.webkit.org/show_bug.cgi?id=175950
3398         <rdar://problem/33951915>
3399
3400         Reviewed by Geoffrey Garen.
3401