50cd6428a2a0cbbf93afd83fb8c360d2ac305f02
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2017-10-18  Chris Dumez  <cdumez@apple.com>
2
3         Add an efficient data structure for WebCore to query if there is a Service Worker registered for a given origin
4         https://bugs.webkit.org/show_bug.cgi?id=177876
5         <rdar://problem/34813129>
6
7         Reviewed by Ryosuke Niwa.
8
9         Introduce a Service Worker origin store which gets populated / updated on the StorageProcess side
10         and queried on the WebContent process side via the WebSWOriginTable so that the WebProcess can
11         efficiently check if there is a ServiceWorker registered for a given origin without actually doing
12         an IPC to the StorageProcess.
13
14         For efficiency, the hash table is backed by SharedMemory so we only pass shared memory handles
15         between the StorageProcess and the WebProcesses.
16
17         We currently add entries to the WebSWOriginStore whenever a service worker registration succeeds
18         on the StorageProcess side. We also clear this store whenever the API to clear service worker
19         registrations is called. Code to query the WebSWOriginTable from the WebContent process side is
20         there but currently only used by Internals for testing. We will later leverage this code when
21         integrating with Fetch API.
22
23         * CMakeLists.txt:
24         * Shared/SharedStringHashStore.h:
25         (WebKit::SharedStringHashStore::Client::didUpdateSharedStringHashes):
26         * Shared/SharedStringHashTable.cpp:
27         (WebKit::SharedStringHashTable::clear):
28         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp.
29         (WebKit::WebSWOriginStore::WebSWOriginStore):
30         (WebKit::WebSWOriginStore::add):
31         (WebKit::WebSWOriginStore::remove):
32         (WebKit::WebSWOriginStore::clear):
33         (WebKit::WebSWOriginStore::registerSWServerConnection):
34         (WebKit::WebSWOriginStore::unregisterSWServerConnection):
35         (WebKit::WebSWOriginStore::sendStoreHandle):
36         (WebKit::WebSWOriginStore::didInvalidateSharedMemory):
37         * StorageProcess/ServiceWorker/WebSWOriginStore.h: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h.
38         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
39         (WebKit::WebSWServerConnection::WebSWServerConnection):
40         (WebKit::WebSWServerConnection::resolveJobInClient):
41         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
42         (WebKit::WebSWServerConnection::sessionID const):
43         * StorageProcess/StorageProcess.cpp:
44         (WebKit::StorageProcess::deleteWebsiteData):
45         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
46         (WebKit::StorageProcess::ensureSWOriginStoreForSession):
47         (WebKit::StorageProcess::swOriginStoreForSession const):
48         (WebKit::StorageProcess::serviceWorkerContextStarted):
49         (WebKit::StorageProcess::registerSWServerConnection):
50         (WebKit::StorageProcess::unregisterSWServerConnection):
51         * StorageProcess/StorageProcess.h:
52         * StorageProcess/StorageProcess.messages.in:
53         * WebKit.xcodeproj/project.pbxproj:
54         * WebProcess/Storage/WebSWClientConnection.cpp:
55         (WebKit::WebSWClientConnection::WebSWClientConnection):
56         (WebKit::WebSWClientConnection::hasServiceWorkerRegisteredForOrigin const):
57         (WebKit::WebSWClientConnection::setSWOriginTableSharedMemory):
58         * WebProcess/Storage/WebSWClientConnection.h:
59         * WebProcess/Storage/WebSWClientConnection.messages.in:
60         * WebProcess/Storage/WebSWOriginTable.cpp: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h.
61         (WebKit::WebSWOriginTable::contains const):
62         (WebKit::WebSWOriginTable::setSharedMemory):
63         * WebProcess/Storage/WebSWOriginTable.h: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h.
64         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
65         (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
66         * WebProcess/Storage/WebServiceWorkerProvider.h:
67         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
68         (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):
69         * WebProcess/Storage/WebToStorageProcessConnection.h:
70         * WebProcess/WebProcess.cpp:
71         (WebKit::WebProcess::startServiceWorkerContext):
72
73 2017-10-16  Andy Estes  <aestes@apple.com>
74
75         [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError
76         https://bugs.webkit.org/show_bug.cgi?id=178191
77         <rdar://problem/34906367>
78
79         Reviewed by Tim Horton.
80
81         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
82         (WebKit::toNSError):
83
84 2017-10-17  Sam Weinig  <sam@webkit.org>
85
86         [Settings] Generate Settings.h/cpp
87         https://bugs.webkit.org/show_bug.cgi?id=178361
88
89         Reviewed by Dean Jackson.
90
91         * PlatformGTK.cmake:
92         * PlatformWPE.cmake:
93
94             Delete the old Settings.h from the forwarding 
95             headers directory to allow the build to work.
96
97 2017-10-17  John Wilander  <wilander@apple.com>
98
99         Add and remove cookie partition accordingly in intermediary redirect requests
100         https://bugs.webkit.org/show_bug.cgi?id=178369
101         <rdar://problem/34467603>
102
103         Reviewed by Brent Fulgham.
104
105         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
106         (WebKit::shouldChangePartition):
107             Convenience function. Comment documents the logic.
108         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
109             Now adds and removes cookie partition based on the
110             redirect-to URL's domain.
111         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
112         (WKBundleResourceLoadStatisticsNotifyObserver):
113             Test infrastructure.
114         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
115
116 2017-10-17  Youenn Fablet  <youenn@apple.com>
117
118         Cache API implementation should be able to compute storage size for WebKit client applications.
119         https://bugs.webkit.org/show_bug.cgi?id=178350
120
121         Reviewed by Chris Dumez.
122
123         When gathering data from DOM Cache, we compute the size as follows:
124         - If Caches object is not persistent, size is zero
125         - If Caches object is persistent, we use the size computed by NetworkCache::Storage. 
126         Covered by updated tests.
127
128         * NetworkProcess/cache/CacheStorageEngine.cpp:
129         (WebKit::CacheStorage::ReadOriginsTaskCounter::create):
130         (WebKit::CacheStorage::ReadOriginsTaskCounter::addOrigin):
131         (WebKit::CacheStorage::Engine::fetchEntries):
132         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
133         (WebKit::CacheStorage::Caches::storageSize const):
134         * NetworkProcess/cache/CacheStorageEngineCaches.h:
135         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
136         (WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
137         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
138
139 2017-10-17  Keith Miller  <keith_miller@apple.com>
140
141         Change WebCore sources to work with unified source builds
142         https://bugs.webkit.org/show_bug.cgi?id=178229
143
144         Rubber stamped by Tim Horton.
145
146         * Configurations/FeatureDefines.xcconfig:
147
148 2017-10-16  Wenson Hsieh  <wenson_hsieh@apple.com>
149
150         Unreviewed, fix the iOS build after r223431
151
152         Remove an unused variable captured in a lambda.
153
154         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
155         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
156
157 2017-10-12  Matt Rajca  <mrajca@apple.com>
158
159         Add API support for quirk that lets an arbitrary click allow auto-play.
160         https://bugs.webkit.org/show_bug.cgi?id=178227
161
162         Reviewed by Alex Christensen.
163
164         Instead of hardcoding sites in WebCore, let API clients control which websites opt into the quirk that lets
165         an arbitrary click allow auto-play via website policies.
166
167         * Shared/WebsitePolicies.h:
168         * UIProcess/API/C/WKWebsitePolicies.cpp:
169         (WKWebsitePoliciesSetAllowedAutoplayQuirks):
170         (WKWebsitePoliciesGetAllowedAutoplayQuirks):
171         * UIProcess/API/C/WKWebsitePolicies.h:
172         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
173         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
174         (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]):
175         (-[_WKWebsitePolicies allowedAutoplayQuirks]):
176         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
177         (WebKit::WebFrameLoaderClient::applyToDocumentLoader):
178         * WebProcess/WebPage/WebPage.cpp:
179         (WebKit::WebPage::updateWebsitePolicies):
180
181 2017-10-16  Andy Estes  <aestes@apple.com>
182
183         [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError
184         https://bugs.webkit.org/show_bug.cgi?id=178191
185         <rdar://problem/34906367>
186
187         Reviewed by Tim Horton.
188
189         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
190         (WebKit::toNSError):
191
192 2017-10-16  Tim Horton  <timothy_horton@apple.com>
193
194         Safari crashes after searching PDF (under [WKPDFView zoom:to:atPoint:kind:])
195         https://bugs.webkit.org/show_bug.cgi?id=178358
196         <rdar://problem/34676899>
197
198         Reviewed by Wenson Hsieh.
199
200         * UIProcess/ios/WKPDFView.mm:
201         (-[WKPDFView _didFindMatch:]):
202         UIPDFSelection can return a null rect as the selection's bounds.
203         We can't zoom to a null rect (and doing so results in CA throwing an
204         exception later).
205
206 2017-10-16  Alex Christensen  <achristensen@webkit.org>
207
208         Add a _WKThumbnailView initializer with a WKWebView
209         https://bugs.webkit.org/show_bug.cgi?id=178351
210         <rdar://problem/34979453>
211
212         Reviewed by Tim Horton.
213
214         * UIProcess/API/Cocoa/WKWebView.mm:
215         (-[WKWebView _page]):
216         (-[WKWebView _setThumbnailView:]):
217         (-[WKWebView _thumbnailView]):
218         (-[WKWebView _setIgnoresAllEvents:]):
219         (-[WKWebView _ignoresAllEvents]):
220         * UIProcess/API/Cocoa/WKWebViewInternal.h:
221         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
222         * UIProcess/API/Cocoa/_WKThumbnailView.h:
223         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
224         (-[_WKThumbnailView initWithFrame:fromWKWebView:]):
225         (-[_WKThumbnailView _viewWasUnparented]):
226         (-[_WKThumbnailView _viewWasParented]):
227
228 2017-10-16  Alex Christensen  <achristensen@webkit.org>
229
230         Expose more WKView properties as WKWebViewPrivate SPI
231         https://bugs.webkit.org/show_bug.cgi?id=178349
232         <rdar://problem/34980919>
233
234         Reviewed by Tim Horton.
235
236         _backgroundExtendsBeyondPage was already exposed on iOS, but we need it on Mac, too.
237         A few other properties also need exposing.
238
239         * UIProcess/API/Cocoa/WKWebView.mm:
240         (toAPIScrollbarStyle):
241         (toCoreScrollbarStyle):
242         (-[WKWebView _setBackgroundExtendsBeyondPage:]):
243         (-[WKWebView _backgroundExtendsBeyondPage]):
244         (-[WKWebView _setOverlayScrollbarStyle:]):
245         (-[WKWebView _overlayScrollbarStyle]):
246         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
247
248 2017-10-16  Chris Dumez  <cdumez@apple.com>
249
250         Log using differential privacy domains where the WebContent process crashes
251         https://bugs.webkit.org/show_bug.cgi?id=178346
252         <rdar://problem/33293830>
253
254         Reviewed by Alex Christensen.
255
256         * UIProcess/WebPageProxy.cpp:
257         (WebKit::WebPageProxy::reload):
258         (WebKit::WebPageProxy::currentURL const):
259         (WebKit::WebPageProxy::processDidTerminate):
260         * UIProcess/WebPageProxy.h:
261         * UIProcess/WebProcessProxy.cpp:
262         (WebKit::WebProcessProxy::didClose):
263
264 2017-10-16  Youenn Fablet  <youenn@apple.com>
265
266         Activate Cache API by default
267         https://bugs.webkit.org/show_bug.cgi?id=178186
268
269         Reviewed by Chris Dumez.
270
271         * Shared/WebPreferencesDefinitions.h:
272
273 2017-10-16  Sam Weinig  <sam@webkit.org>
274
275         [Settings] Remove all custom code from Settings.h/cpp
276         https://bugs.webkit.org/show_bug.cgi?id=178330
277
278         Reviewed by Simon Fraser.
279
280         * Shared/WebPreferencesDefinitions.h:
281         * UIProcess/API/C/WKPreferences.cpp:
282         (WKPreferencesSetFrameFlatteningEnabled):
283         (WKPreferencesGetFrameFlatteningEnabled):
284         * UIProcess/API/glib/WebKitSettings.cpp:
285         (webkit_settings_get_enable_frame_flattening):
286         (webkit_settings_set_enable_frame_flattening):
287         * WebProcess/InjectedBundle/InjectedBundle.cpp:
288         (WebKit::InjectedBundle::setFrameFlatteningEnabled):
289         
290             Update for naming changes of FrameFlattening now that it is an enum class.
291
292         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
293         (WebKit::WebChromeClient::contentsSizeChanged const):
294
295             Ge the effectiveFrameFlattening from the FrameView, rather than the Settings.
296
297 2017-10-16  Chris Dumez  <cdumez@apple.com>
298
299         [WK2][NetworkSession] Add support for resuming downloads
300         https://bugs.webkit.org/show_bug.cgi?id=177625
301         <rdar://problem/34345975>
302
303         Reviewed by Alex Christensen.
304
305         Add support for resuming downloads for the WK2 NETWORK_SESSION code path.
306
307         This was tested manually. I was unable to write an API test because our tests
308         do not run an HTTP server and CFNetwork does not seem to generate resume data
309         when cancelling a download over non-HTTP.
310
311         * NetworkProcess/Downloads/Download.cpp:
312         (WebKit::Download::didReceiveChallenge):
313         (WebKit::Download::continueCanAuthenticateAgainstProtectionSpace):
314         * NetworkProcess/Downloads/Download.h:
315         * NetworkProcess/Downloads/DownloadManager.cpp:
316         (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace):
317         (WebKit::DownloadManager::resumeDownload):
318         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
319         (WebKit::Download::resume):
320         This currently includes a workaround for <rdar://problem/34745171>. We update the
321         resume data to include the NSURLSessionResumeInfoLocalPath key with the final
322         destination path so that CFNetwork looks for the temporary data at the right
323         location.
324
325         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
326         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
327         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
328         (WebKit::NetworkSessionCocoa::downloadTaskWithResumeData):
329         * Shared/Authentication/AuthenticationManager.cpp:
330         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
331         * Shared/Authentication/AuthenticationManager.h:
332
333 2017-10-16  Adrian Perez de Castro  <aperez@igalia.com>
334
335         [WPE] Build failure due to invalid cast of EGLNativeWindowType when targetting 64-bit ARM
336         https://bugs.webkit.org/show_bug.cgi?id=178090
337
338         Reviewed by Michael Catanzaro.
339
340         EGLNativeWindowType can be aliased to a different type depending (at least) on the EGL
341         implementation, its build options, and the libepoxy build options.  Using "static_cast"
342         works when it is a numeric value and the width of the value needs to be optionally
343         extended to 64 bits (e.g. the EGL type is "int" in a 32-bit CPU) but not for pointers,
344         and using "reinterpret_cast" works when the size of a pointer is 64 bits but not in other
345         cases. Therefore it seems reasonable to use a plain C cast expression to solve this
346         particular situation.
347
348         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
349         (WebKit::AcceleratedSurfaceWPE::window const): Use a good old plain C cast expression.
350
351 2017-10-16  Chris Dumez  <cdumez@apple.com>
352
353         Clicks on Link with download attribute causes all (other) links to trigger download when clicked
354         https://bugs.webkit.org/show_bug.cgi?id=178267
355         <rdar://problem/34985016>
356
357         Reviewed by Darin Adler.
358
359         When clicking on an anchor with the download attribute, the m_syncNavigationActionHasDownloadAttribute
360         flag on WebPageProxy would get set. This flag would not get reset right away and instead, it would get
361         updated during the next call to WebPageProxy::decidePolicyForNavigationAction(). The issue is that if
362         you later click on a link with target="_blank", WebPageProxy::decidePolicyForNewWindowAction() gets
363         called instead of WebPageProxy::decidePolicyForNavigationAction() and we do not reset the
364         m_syncNavigationActionHasDownloadAttribute flag and we force a download.
365
366         To address the problem, I got rid of this flag on WebPageProxy and it is error-prone and should really
367         not be at page-level. Instead, I added a shouldForceDownload flag on the navigation object. It makes
368         more sense to associate the flag with the navigation and makes it less error-prone.
369
370         * UIProcess/API/APINavigation.h:
371         (API::Navigation::setShouldForceDownload):
372         (API::Navigation::shouldForceDownload const):
373         * UIProcess/WebPageProxy.cpp:
374         (WebKit::WebPageProxy::receivedPolicyDecision):
375         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
376         * UIProcess/WebPageProxy.h:
377
378 2017-10-16  Ryan Haddad  <ryanhaddad@apple.com>
379
380         Unreviewed, rolling out r223271.
381
382         This change introduced LayoutTest failures on WK1.
383
384         Reverted changeset:
385
386         "Use asynchronous ResourceHandleClient calls for WebKit1"
387         https://bugs.webkit.org/show_bug.cgi?id=160677
388         https://trac.webkit.org/changeset/223271
389
390 2017-10-13  Youenn Fablet  <youenn@apple.com>
391
392         Implement listing origins for which CacheStorage is storing data
393         https://bugs.webkit.org/show_bug.cgi?id=178236
394
395         Reviewed by Chris Dumez.
396
397         Cache storage is split on per-origin folders which name is obfuscated through salting.
398         To retrieve the origin for each folder, an origin file is now stored within each folder.
399         This file contains the actual origin.
400
401         Adding support to get the list of origin by iterating through each folder and
402         getting the actual origin by reading the content of the 'origin' file.
403
404         Adding C API for WebKitTestRunner.
405
406         * NetworkProcess/cache/CacheStorageEngine.cpp:
407         (WebKit::CacheStorage::Engine::fetchEntries):
408         (WebKit::CacheStorage::ReadOriginsTaskCounter::create):
409         (WebKit::CacheStorage::ReadOriginsTaskCounter::~ReadOriginsTaskCounter):
410         (WebKit::CacheStorage::ReadOriginsTaskCounter::addOrigin):
411         (WebKit::CacheStorage::ReadOriginsTaskCounter::ReadOriginsTaskCounter):
412         * NetworkProcess/cache/CacheStorageEngine.h:
413         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
414         (WebKit::CacheStorage::cachesOriginFilename):
415         (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory):
416         (WebKit::CacheStorage::Caches::Caches):
417         (WebKit::CacheStorage::Caches::storeOrigin):
418         (WebKit::CacheStorage::Caches::readOrigin):
419         (WebKit::CacheStorage::Caches::initialize):
420         * NetworkProcess/cache/CacheStorageEngineCaches.h:
421         (WebKit::CacheStorage::Caches::origin const):
422         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
423         (WKWebsiteDataStoreGetFetchCacheOrigins):
424         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
425
426 2017-10-13  Alex Christensen  <achristensen@webkit.org>
427
428         Fix API tests after r223269.
429         https://bugs.webkit.org/show_bug.cgi?id=178246
430
431         * UIProcess/API/APIContentRuleListStore.cpp:
432         (API::ContentRuleListStore::getContentRuleListSource):
433         Version 10 also has the ability to recover content rule list source.
434
435 2017-10-11  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
436
437         [GLib] WebKitNavigationAction should tell whether it is a redirect
438         https://bugs.webkit.org/show_bug.cgi?id=178178
439
440         There is no good way to know whether a given navigation action has been caused
441         by a redirect through the glib API. This is necessary to implement some app mode
442         heuristics for Epiphany.
443
444         Reviewed by Carlos Garcia Campos.
445
446         * UIProcess/API/glib/WebKitNavigationAction.cpp:
447         (webkit_navigation_action_is_redirect): returns whether the navigation action is a redirect.
448         * UIProcess/API/glib/WebKitNavigationActionPrivate.h: add isRedirect to the wrapper object.
449         (_WebKitNavigationAction::_WebKitNavigationAction):
450         * UIProcess/API/gtk/WebKitNavigationAction.h: add the new API.
451         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: ditto.
452         * UIProcess/API/wpe/WebKitNavigationAction.h: ditto.
453
454 2017-10-12  Brady Eidson  <beidson@apple.com>
455
456         SW "Hello world".
457         https://bugs.webkit.org/show_bug.cgi?id=178187
458
459         Reviewed by Andy Estes.
460
461         * WebProcess/WebProcess.cpp:
462         (WebKit::WebProcess::startServiceWorkerContext):
463
464 2017-10-12  Alex Christensen  <achristensen@webkit.org>
465
466         Remove unnecessary includes in WebKit
467         https://bugs.webkit.org/show_bug.cgi?id=178235
468
469         Reviewed by Tim Horton.
470
471         * Platform/IPC/ArgumentCoders.h:
472         * WebProcess/WebProcess.cpp:
473         * WebProcess/WebStorage/StorageAreaImpl.h:
474
475 2017-10-12  Alex Christensen  <achristensen@webkit.org>
476
477         Increment ContentRuleListStore::CurrentContentRuleListFileVersion
478         https://bugs.webkit.org/show_bug.cgi?id=178246
479         <rdar://problem/34890057>
480
481         Reviewed by Tim Horton.
482
483         * UIProcess/API/APIContentRuleListStore.h:
484         Things are crashing.  Something isn't binary reverse compatible.
485         Probably something related to r222602.
486         This is why we have a version number to update.
487
488 2017-10-12  Alex Christensen  <achristensen@webkit.org>
489
490         Expose some of WKView's WebViewImpl accessors through WKWebViewPrivate
491         https://bugs.webkit.org/show_bug.cgi?id=178240
492         <rdar://problem/34962720>
493
494         Reviewed by Tim Horton.
495         
496         Also renamed createFullScreenWindow to fullScreenWindow to reflect the fact that it returns
497         an autoreleased NSWindow so we don't make the same naming mistake in the WKWebView SPI.
498
499         * UIProcess/API/Cocoa/WKWebView.mm:
500         (-[WKWebView _dismissContentRelativeChildWindows]):
501         (-[WKWebView _setFrame:andScrollBy:]):
502         (-[WKWebView _setTotalHeightOfBanners:]):
503         (-[WKWebView _totalHeightOfBanners]):
504         (-[WKWebView _beginDeferringViewInWindowChanges]):
505         (-[WKWebView _endDeferringViewInWindowChanges]):
506         (-[WKWebView _endDeferringViewInWindowChangesSync]):
507         (-[WKWebView _gestureEventWasNotHandledByWebCore:]):
508         (-[WKWebView _setIgnoresNonWheelEvents:]):
509         (-[WKWebView _ignoresNonWheelEvents]):
510         (-[WKWebView _setCustomSwipeViews:]):
511         (-[WKWebView _setCustomSwipeViewsTopContentInset:]):
512         (-[WKWebView _tryToSwipeWithEvent:ignoringPinnedState:]):
513         (-[WKWebView _setDidMoveSwipeSnapshotCallback:]):
514         (-[WKWebView _fullScreenPlaceholderView]):
515         (-[WKWebView _fullScreenWindow]):
516         (-[WKWebView _disableFrameSizeUpdates]):
517         (-[WKWebView _enableFrameSizeUpdates]):
518         (-[WKWebView _canChangeFrameLayout:]):
519         (-[WKWebView _underlayColor]):
520         (-[WKWebView _setUnderlayColor:]):
521         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
522         * UIProcess/API/mac/WKView.mm:
523         (-[WKView createFullScreenWindow]):
524         * UIProcess/Cocoa/WebViewImpl.h:
525         * UIProcess/Cocoa/WebViewImpl.mm:
526         (WebKit::WebViewImpl::fullScreenWindowController):
527         (WebKit::WebViewImpl::fullScreenWindow):
528         (WebKit::WebViewImpl::createFullScreenWindow): Deleted.
529
530 2017-10-12  Youenn Fablet  <youenn@apple.com>
531
532         Layout Test http/tests/cache-storage/cache-clearing.https.html is failing
533         https://bugs.webkit.org/show_bug.cgi?id=178200
534
535         Reviewed by Chris Dumez.
536
537         Deleting only the per-origin folders inside the CacheStorage engine root folder.
538
539         * NetworkProcess/cache/CacheStorageEngine.cpp:
540         (WebKit::CacheStorage::Engine::clearAllCaches):
541         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
542         (WKWebsiteDataStoreRemoveAllFetchCaches):
543         (WKWebsiteDataStoreRemoveFetchCacheForOrigin):
544         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
545
546 2017-10-12  Chris Dumez  <cdumez@apple.com>
547
548         [Mac] Add support for MouseEvent.buttons
549         https://bugs.webkit.org/show_bug.cgi?id=178214
550
551         Reviewed by Ryosuke Niwa.
552
553         * Shared/WebEvent.h:
554         (WebKit::WebMouseEvent::buttons const):
555         * Shared/WebEventConversion.cpp:
556         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
557         * Shared/WebMouseEvent.cpp:
558         (WebKit::WebMouseEvent::WebMouseEvent):
559         (WebKit::WebMouseEvent::encode const):
560         (WebKit::WebMouseEvent::decode):
561         * Shared/mac/WebEventFactory.mm:
562         (WebKit::currentlyPressedMouseButtons):
563         (WebKit::WebEventFactory::createWebMouseEvent):
564         * WebProcess/Plugins/PDF/PDFPlugin.mm:
565         (WebKit::PDFPlugin::showContextMenuAtPoint):
566         * WebProcess/Plugins/PluginView.cpp:
567         (WebKit::PluginView::createWebEvent const):
568         * WebProcess/WebPage/WebPage.cpp:
569         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
570         (WebKit::WebPage::simulateMouseDown):
571         (WebKit::WebPage::simulateMouseUp):
572         (WebKit::WebPage::simulateMouseMotion):
573
574 2017-10-12  Youenn Fablet  <youenn@apple.com>
575
576         Add API to clean CacheStorage data
577         https://bugs.webkit.org/show_bug.cgi?id=178034
578
579         Unreviewed.
580
581         * Shared/WebsiteData/WebsiteDataType.h: fixing the DOMCache value. 
582
583 2017-10-12  Stephan Szabo  <stephan.szabo@sony.com>
584
585         [WinCairo] add WebProcess files for wincairo webkit
586         https://bugs.webkit.org/show_bug.cgi?id=178024
587
588         Reviewed by Alex Christensen.
589
590         * PlatformWin.cmake:
591         * WebProcess/Cookies/curl/WebCookieManagerCurl.cpp: Added.
592         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
593         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
594         * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp: Added.
595         (WebKit::InjectedBundle::initialize):
596         (WebKit::InjectedBundle::setBundleParameter):
597         (WebKit::InjectedBundle::setBundleParameters):
598         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
599         * WebProcess/Plugins/Netscape/win/PluginProxyWin.cpp: Added.
600         (WebKit::PluginProxy::needsBackingStore const):
601         * WebProcess/WebCoreSupport/win/WebContextMenuClientWin.cpp: Added.
602         (WebKit::WebContextMenuClient::lookUpInDictionary):
603         (WebKit::WebContextMenuClient::isSpeaking):
604         (WebKit::WebContextMenuClient::speak):
605         (WebKit::WebContextMenuClient::stopSpeaking):
606         * WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.cpp: Added.
607         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
608         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
609         (WebKit::WebFrameNetworkingContext::WebFrameNetworkingContext):
610         (WebKit::WebFrameNetworkingContext::storageSession const):
611         (WebKit::WebFrameNetworkingContext::webFrameLoaderClient const):
612         (WebKit::WebFrameNetworkingContext::blockedError const):
613         * WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h: Added.
614         (WebKit::WebFrameNetworkingContext::create):
615         * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp: Added.
616         (WebKit::WebPopupMenu::setUpPlatformData):
617         * WebProcess/WebPage/win/WebInspectorUIWin.cpp: Added.
618         (WebKit::WebInspectorUI::canSave):
619         (WebKit::WebInspectorUI::localizedStringsURL):
620         (WebKit::RemoteWebInspectorUI::localizedStringsURL):
621         * WebProcess/WebPage/win/WebPageWin.cpp: Added.
622         (WebKit::WebPage::platformInitialize):
623         (WebKit::WebPage::platformDetach):
624         (WebKit::WebPage::platformEditorState const):
625         (WebKit::WebPage::platformPreferencesDidChange):
626         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
627         (WebKit::WebPage::platformHasLocalDataForURL):
628         (WebKit::WebPage::cachedResponseMIMETypeForURL):
629         (WebKit::WebPage::platformCanHandleRequest):
630         (WebKit::WebPage::cachedSuggestedFilenameForURL):
631         (WebKit::WebPage::cachedResponseDataForURL):
632         (WebKit::WebPage::platformUserAgent const):
633         (WebKit::WebPage::interpretKeyEvent):
634         * WebProcess/WebProcess.cpp:
635         (WebKit::WebProcess::ensureWebToStorageProcessConnection):
636         * WebProcess/win/WebProcessWin.cpp: Added.
637         (loadResourceIntoBuffer):
638         (WebKit::WebProcess::platformInitializeWebProcess):
639         (WebKit::WebProcess::platformTerminate):
640         (WebKit::WebProcess::platformSetCacheModel):
641
642 2017-10-12  David Kilzer  <ddkilzer@apple.com>
643
644         [iOS] Fix -Wunused-lambda-capture warnings in WebCore/WebKit with new clang compiler
645         <https://webkit.org/b/178226>
646
647         Reviewed by Chris Fleizach.
648
649         * UIProcess/ios/WKContentViewInteraction.mm:
650         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:withFlags:]):
651         - Remove unused lambda variable 'touch' which was also passed as
652           an argument.
653         (-[WKContentView changeSelectionWithTouchesFrom:to:withGesture:withState:]):
654         - Remove unused lambda variable 'gestureState' which was also
655           passed as an argument.
656         (-[WKContentView _simulateLongPressActionAtLocation:]):
657         - Remove unused lambda variable 'location'.
658
659 2017-10-12  John Wilander  <wilander@apple.com>
660
661         ResourceLoadObserver::logFrameNavigation() should use redirectResponse.url()
662         https://bugs.webkit.org/show_bug.cgi?id=175257
663         <rdar://problem/33359866>
664
665         Reviewed by Brent Fulgham.
666
667         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
668         (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsSubFrameUnder:topFrameHost:completionHandler:]):
669         (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsRedirectingTo:hostRedirectedTo:completionHandler:]):
670             Test infrastructure.
671         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
672         * UIProcess/WebResourceLoadStatisticsStore.cpp:
673         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
674         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
675             Test infrastructure.
676         * UIProcess/WebResourceLoadStatisticsStore.h:
677
678 2017-10-12  Andy Estes  <aestes@apple.com>
679
680         [iOS] Conditionally rename DatabaseProcess to StorageProcess when building for iOS devices
681         https://bugs.webkit.org/show_bug.cgi?id=178181
682         <rdar://problem/33660282>
683
684         Reviewed by Dan Bernstein.
685
686         * Configurations/BaseTarget.xcconfig:
687         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
688         (WebKit::serviceName):
689         * WebKit.xcodeproj/project.pbxproj:
690
691 2017-10-12  Youenn Fablet  <youenn@apple.com>
692
693         CacheStorage persistent folder should be in /Library/Cache
694         https://bugs.webkit.org/show_bug.cgi?id=178193
695
696         Reviewed by Brady Eidson.
697
698         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
699         (API::WebsiteDataStore::defaultCacheStorageDirectory): Making CacheStorage
700         directory a subfolder of Caches folder.
701         (API::WebsiteDataStore::defaultDataStoreConfiguration):
702         * UIProcess/WebProcessPool.cpp:
703         (WebKit::legacyWebsiteDataStoreConfiguration):
704         (WebKit::WebProcessPool::ensureNetworkProcess): Make sure the web site data store
705         has the right cache directory path. Also make sure that the quota is set even if there is no folder specified.
706         Quota may still be useful in case of non persistent sessions.
707         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
708         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
709         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
710         (API::WebsiteDataStore::defaultCacheStorageDirectory):
711
712 2017-10-11  Sam Weinig  <sam@webkit.org>
713
714         Remove out-parameter variants of copyToVector
715         https://bugs.webkit.org/show_bug.cgi?id=178155
716
717         Reviewed by Tim Horton.
718
719         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
720         (-[_WKRemoteObjectInterface debugDescription]):
721         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
722         (WebKit::dump):
723         * UIProcess/WebPageProxy.cpp:
724         (WebKit::WebPageProxy::resetState):
725         * UIProcess/WebProcessPool.cpp:
726         (WebKit::WebProcessPool::createNewWebProcess):
727         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
728         (WebKit::WebsiteDataStore::parameters):
729         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
730         (WebKit::WebsiteDataStore::pendingCookies const):
731         * UIProcess/ios/ProcessAssertionIOS.mm:
732         (-[WKProcessAssertionBackgroundTaskManager _notifyClientsOfImminentSuspension]):
733         * WebProcess/Cookies/WebCookieManager.cpp:
734         (WebKit::WebCookieManager::getHostnamesWithCookies):
735         * WebProcess/Geolocation/WebGeolocationManager.cpp:
736         (WebKit::WebGeolocationManager::didChangePosition):
737         (WebKit::WebGeolocationManager::didFailToDeterminePosition):
738         * WebProcess/Network/WebLoaderStrategy.cpp:
739         (WebKit::WebLoaderStrategy::internallyFailedLoadTimerFired):
740
741             Replace out-parameter based copyToVector, with one that returns a Vector.
742
743 2017-10-11  Jaehun Lim  <ljaehun.lim@samsung.com>
744
745         Fix debug build
746
747         Unreviewed.
748
749         Add ENABLE(SERVICE_WORKER) guard.
750
751         * UIProcess/WebProcessPool.cpp:
752         (WebKit::WebProcessPool::createWebPage):
753
754 2017-10-11  Youenn Fablet  <youenn@apple.com>
755
756         Add API to clean CacheStorage data
757         https://bugs.webkit.org/show_bug.cgi?id=178034
758
759         Unreviewed.
760
761         * NetworkProcess/NetworkProcess.cpp:
762         (WebKit::NetworkProcess::fetchWebsiteData): Fixing lifetime of aggregator.
763
764 2017-10-11  Youenn Fablet  <youenn@apple.com>
765
766         Add API to clean CacheStorage data
767         https://bugs.webkit.org/show_bug.cgi?id=178034
768
769         Reviewed by Chris Dumez.
770
771         Introducing a new website data type for DOMCache.
772         Adding API to delete DOMCache for a given origin or for all origins.
773         This is added to WKWebsiteDataStore.
774
775         Cleaning a CacheStorage will remove all data in the Cache object but the object will stay live
776         for the duration of the NetworkProcess.
777         This allows ensuring that once a cache is cleaned, WebProcess will update to this new state.
778
779         Fetching of WebsiteData for DOMCache is not implemented yet since we do not keep a list of all origins for which we have data.
780
781         * NetworkProcess/NetworkProcess.cpp:
782         (WebKit::fetchDOMCacheEntries):
783         (WebKit::NetworkProcess::fetchWebsiteData):
784         (WebKit::NetworkProcess::deleteWebsiteData):
785         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
786         * NetworkProcess/cache/CacheStorageEngine.cpp:
787         (WebKit::CacheStorage::Engine::cachesRootPath):
788         (WebKit::CacheStorage::Engine::fetchEntries):
789         (WebKit::CacheStorage::ClearTasksHandler::ClearTasksHandler):
790         (WebKit::CacheStorage::ClearTasksHandler::~ClearTasksHandler):
791         (WebKit::CacheStorage::Engine::clearEngines):
792         (WebKit::CacheStorage::Engine::clearCachesForOrigins):
793         (WebKit::CacheStorage::Engine::readCachesFromDisk):
794         (WebKit::CacheStorage::deleteFolder):
795         (WebKit::CacheStorage::Engine::clearCaches):
796         (WebKit::CacheStorage::Engine::unlock): Removing the assertion as Cache objects are removed when clearing data.
797         * NetworkProcess/cache/CacheStorageEngine.h:
798         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
799         (WebKit::CacheStorage::Caches::Caches):
800         (WebKit::CacheStorage::Caches::clear):
801         * NetworkProcess/cache/CacheStorageEngineCaches.h:
802         (WebKit::CacheStorage::Caches::create):
803         * Shared/WebsiteData/WebsiteDataType.h:
804         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
805         (WKWebsiteDataStoreRemoveAllDOMCaches):
806         (WKWebsiteDataStoreRemoveDOMCacheForOrigin):
807         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
808         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
809         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
810         (dataTypesToString):
811         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
812         (WebKit::toWebsiteDataType):
813         (WebKit::toWKWebsiteDataTypes):
814         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
815         (+[WKWebsiteDataStore allWebsiteDataTypes]):
816         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
817         (WebKit::computeNetworkProcessAccessTypeForDataFetch):
818         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
819
820 2017-10-11  Chris Dumez  <cdumez@apple.com>
821
822         [Geolocation] Expose Coordinates.floorLevel
823         https://bugs.webkit.org/show_bug.cgi?id=178173
824         <rdar://problem/34918936>
825
826         Reviewed by Ryosuke Niwa.
827
828         * UIProcess/API/C/WKGeolocationPosition.cpp:
829         (WKGeolocationPositionCreate):
830         (WKGeolocationPositionCreate_b):
831         (WKGeolocationPositionCreate_c):
832         * UIProcess/API/C/WKGeolocationPosition.h:
833
834 2017-10-11  Youenn Fablet  <youenn@apple.com>
835
836         Bump default cache storage quota to 20MB
837         https://bugs.webkit.org/show_bug.cgi?id=178132
838
839         Reviewed by Alex Christensen.
840
841         Adding the ability to set the quota per origin through WebsiteDataStore.
842         Moving cache storage directory setting also in WebsiteDataStore.
843
844         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
845         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
846         * NetworkProcess/NetworkProcess.cpp:
847         (WebKit::NetworkProcess::initializeNetworkProcess):
848         * NetworkProcess/mac/RemoteNetworkingContext.mm:
849         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
850         * Shared/WebsiteDataStoreParameters.cpp:
851         (WebKit::WebsiteDataStoreParameters::encode const):
852         (WebKit::WebsiteDataStoreParameters::decode):
853         * Shared/WebsiteDataStoreParameters.h:
854         * UIProcess/API/APIProcessPoolConfiguration.cpp:
855         (API::ProcessPoolConfiguration::createWithLegacyOptions):
856         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
857         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
858         (API::ProcessPoolConfiguration::copy):
859         * UIProcess/API/APIProcessPoolConfiguration.h:
860         * UIProcess/API/C/WKContextConfigurationRef.cpp:
861         * UIProcess/API/C/WKContextConfigurationRef.h:
862         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
863         (-[WKWebsiteDataStore _cacheStoragePerOriginQuota]):
864         (-[WKWebsiteDataStore _setCacheStoragePerOriginQuota:]):
865         (-[WKWebsiteDataStore _cacheStorageDirectory]):
866         (-[WKWebsiteDataStore _setCacheStorageDirectory:]):
867         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
868         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
869         * UIProcess/WebProcessPool.cpp:
870         (WebKit::legacyWebsiteDataStoreConfiguration):
871         (WebKit::WebProcessPool::ensureNetworkProcess):
872         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
873         * UIProcess/WebProcessPool.h:
874         * UIProcess/WebsiteData/WebsiteDataStore.h:
875         (WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const):
876         (WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota):
877         (WebKit::WebsiteDataStore::cacheStorageDirectory const):
878         (WebKit::WebsiteDataStore::setCacheStorageDirectory):
879
880 2017-10-11  Myles C. Maxfield  <mmaxfield@apple.com>
881
882         Allow PAL to log messages
883         https://bugs.webkit.org/show_bug.cgi?id=171523
884
885         Reviewed by Alex Christensen.
886
887         * Platform/Logging.h:
888         * Scripts/generate-forwarding-headers.pl:
889
890 2017-10-11  Ryosuke Niwa  <rniwa@webkit.org>
891
892         Sanitize URL in pasteboard for other applications and cross origin content
893         https://bugs.webkit.org/show_bug.cgi?id=178060
894         <rdar://problem/34874518>
895
896         Reviewed by Wenson Hsieh.
897
898         Plubmed the origin identifier through IPC from Pasteboard in WebContent process to PlatformPasteboard in UIProcess.
899
900         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
901         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
902         * UIProcess/WebPasteboardProxy.cpp:
903         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
904         * UIProcess/WebPasteboardProxy.h:
905         * UIProcess/WebPasteboardProxy.messages.in:
906         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
907         (WebKit::WebPlatformStrategies::typesSafeForDOMToReadAndWrite):
908         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
909
910 2017-10-11  Chris Dumez  <cdumez@apple.com>
911
912         Modernize Geolocation code
913         https://bugs.webkit.org/show_bug.cgi?id=178148
914
915         Reviewed by Ryosuke Niwa.
916
917         * Shared/WebGeolocationPosition.cpp:
918         (WebKit::WebGeolocationPosition::create):
919         (WebKit::WebGeolocationPosition::~WebGeolocationPosition):
920         * Shared/WebGeolocationPosition.h:
921         (WebKit::WebGeolocationPosition::timestamp const):
922         (WebKit::WebGeolocationPosition::latitude const):
923         (WebKit::WebGeolocationPosition::longitude const):
924         (WebKit::WebGeolocationPosition::accuracy const):
925         (WebKit::WebGeolocationPosition::altitude const):
926         (WebKit::WebGeolocationPosition::altitudeAccuracy const):
927         (WebKit::WebGeolocationPosition::heading const):
928         (WebKit::WebGeolocationPosition::speed const):
929         (WebKit::WebGeolocationPosition::corePosition const):
930         (WebKit::WebGeolocationPosition::WebGeolocationPosition):
931         * UIProcess/API/C/WKGeolocationPosition.cpp:
932         (WKGeolocationPositionCreate_b):
933         * UIProcess/API/Cocoa/_WKGeolocationPosition.mm:
934         (WebKit::wrapper):
935         * UIProcess/API/glib/WebKitGeolocationProvider.cpp:
936         (WebKit::WebKitGeolocationProvider::notifyPositionChanged):
937         * UIProcess/WebGeolocationManagerProxy.cpp:
938         (WebKit::WebGeolocationManagerProxy::providerDidChangePosition):
939         * UIProcess/ios/WKGeolocationProviderIOS.mm:
940         (-[WKLegacyCoreLocationProvider positionChanged:]):
941         * WebProcess/Geolocation/WebGeolocationManager.cpp:
942         (WebKit::WebGeolocationManager::didChangePosition):
943         * WebProcess/Geolocation/WebGeolocationManager.h:
944         * WebProcess/Geolocation/WebGeolocationManager.messages.in:
945         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
946         (WebKit::WebGeolocationClient::lastPosition):
947         * WebProcess/WebCoreSupport/WebGeolocationClient.h:
948
949 2017-10-11  Brady Eidson  <beidson@apple.com>
950
951         Add a SW context process (where SW scripts will actually execute).
952         https://bugs.webkit.org/show_bug.cgi?id=178156
953
954         Reviewed by Andy Estes.
955
956         This patch adds an auxiliary "ServiceWorker context" WebProcess to a WebProcessPool.
957
958         This process is where ServiceWorker scripts will execute, separate from the client WebProcess
959         hosting the page(s) they are serving.
960
961         This patch also adds all of the plumbing to pass along a fetched service worker script to this
962         context WebProcess, as well as message back failure to actually start the script so we can test.
963
964         Touches lots of code sites but is basically just a lot of plumbing.
965
966         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
967         (WebKit::WebSWServerConnection::WebSWServerConnection):
968         (WebKit::WebSWServerConnection::startServiceWorkerContext):
969         (WebKit::WebSWServerConnection::sendToContextProcess):
970         (WebKit::WebSWServerConnection::setContextConnection):
971         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
972
973         * StorageProcess/StorageProcess.cpp:
974         (WebKit::StorageProcess::workerContextProcessConnection):
975         (WebKit::StorageProcess::createWorkerContextProcessConnection):
976         (WebKit::StorageProcess::didGetWorkerContextProcessConnection):
977         (WebKit::StorageProcess::serviceWorkerContextFailedToStart):
978         (WebKit::StorageProcess::registerSWServerConnection):
979         (WebKit::StorageProcess::unregisterSWServerConnection):
980         * StorageProcess/StorageProcess.h:
981         * StorageProcess/StorageProcess.messages.in:
982
983         * StorageProcess/StorageToWebProcessConnection.cpp:
984         (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection):
985         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
986         (WebKit::StorageToWebProcessConnection::removeSWServerConnection):
987         (WebKit::StorageToWebProcessConnection::workerContextProcessConnectionCreated):
988         * StorageProcess/StorageToWebProcessConnection.h:
989
990         * UIProcess/Storage/StorageProcessProxy.cpp:
991         (WebKit::StorageProcessProxy::create):
992         (WebKit::StorageProcessProxy::StorageProcessProxy):
993         (WebKit::StorageProcessProxy::didClose):
994         (WebKit::StorageProcessProxy::getWorkerContextProcessConnection):
995         (WebKit::StorageProcessProxy::didGetWorkerContextProcessConnection):
996         * UIProcess/Storage/StorageProcessProxy.h:
997         * UIProcess/Storage/StorageProcessProxy.messages.in:
998
999         * UIProcess/WebProcessPool.cpp:
1000         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
1001         (WebKit::WebProcessPool::getWorkerContextProcessConnection):
1002         (WebKit::WebProcessPool::didGetWorkerContextProcessConnection):
1003         (WebKit::WebProcessPool::disconnectProcess):
1004         (WebKit::WebProcessPool::createWebPage):
1005         * UIProcess/WebProcessPool.h:
1006
1007         * UIProcess/WebProcessProxy.cpp:
1008         (WebKit::WebProcessProxy::didGetWorkerContextConnection):
1009         * UIProcess/WebProcessProxy.h:
1010         * UIProcess/WebProcessProxy.messages.in:
1011
1012         * WebProcess/WebProcess.cpp:
1013         (WebKit::WebProcess::getWorkerContextConnection):
1014         (WebKit::WebProcess::startServiceWorkerContext):
1015         * WebProcess/WebProcess.h:
1016         * WebProcess/WebProcess.messages.in:
1017
1018 2017-10-11  Don Olmstead  <don.olmstead@sony.com>
1019
1020         Remove ENABLE_NETWORK_CACHE
1021         https://bugs.webkit.org/show_bug.cgi?id=177424
1022
1023         Reviewed by Antti Koivisto.
1024
1025         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1026         (WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache):
1027         * NetworkProcess/NetworkConnectionToWebProcess.h:
1028         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1029         * NetworkProcess/NetworkProcess.cpp:
1030         (WebKit::fetchDiskCacheEntries):
1031         (WebKit::clearDiskCacheEntries):
1032         (WebKit::NetworkProcess::setCacheModel):
1033         * NetworkProcess/NetworkProcess.h:
1034         (WebKit::NetworkProcess::cache):
1035         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1036         (WebKit::NetworkProcessCreationParameters::encode const):
1037         (WebKit::NetworkProcessCreationParameters::decode):
1038         * NetworkProcess/NetworkProcessCreationParameters.h:
1039         * NetworkProcess/NetworkResourceLoader.cpp:
1040         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
1041         (WebKit::NetworkResourceLoader::canUseCachedRedirect const):
1042         (WebKit::NetworkResourceLoader::start):
1043         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
1044         (WebKit::NetworkResourceLoader::startNetworkLoad):
1045         (WebKit::NetworkResourceLoader::abort):
1046         (WebKit::NetworkResourceLoader::didReceiveResponse):
1047         (WebKit::NetworkResourceLoader::didReceiveBuffer):
1048         (WebKit::NetworkResourceLoader::didFinishLoading):
1049         (WebKit::NetworkResourceLoader::didFailLoading):
1050         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
1051         (WebKit::NetworkResourceLoader::continueWillSendRequest):
1052         (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
1053         * NetworkProcess/NetworkResourceLoader.h:
1054         * NetworkProcess/cache/NetworkCache.cpp:
1055         * NetworkProcess/cache/NetworkCache.h:
1056         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
1057         * NetworkProcess/cache/NetworkCacheBlobStorage.h:
1058         * NetworkProcess/cache/NetworkCacheCoders.cpp:
1059         * NetworkProcess/cache/NetworkCacheCoders.h:
1060         * NetworkProcess/cache/NetworkCacheCodersCocoa.cpp:
1061         * NetworkProcess/cache/NetworkCacheCodersSoup.cpp:
1062         * NetworkProcess/cache/NetworkCacheData.cpp:
1063         * NetworkProcess/cache/NetworkCacheData.h:
1064         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
1065         * NetworkProcess/cache/NetworkCacheDataSoup.cpp:
1066         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1067         * NetworkProcess/cache/NetworkCacheEntry.h:
1068         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
1069         * NetworkProcess/cache/NetworkCacheFileSystem.h:
1070         * NetworkProcess/cache/NetworkCacheIOChannel.h:
1071         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1072         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
1073         * NetworkProcess/cache/NetworkCacheKey.cpp:
1074         * NetworkProcess/cache/NetworkCacheKey.h:
1075         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
1076         * NetworkProcess/cache/NetworkCacheStatistics.h:
1077         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1078         * NetworkProcess/cache/NetworkCacheStorage.h:
1079         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1080         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1081         (WebKit::NetworkProcess::clearDiskCache):
1082         * NetworkProcess/ios/NetworkProcessIOS.mm:
1083         (WebKit::NetworkProcess::clearCacheForAllOrigins):
1084         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1085         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
1086         (WebKit::NetworkProcess::clearDiskCache):
1087         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1088         (WebKit::registerUserDefaultsIfNeeded):
1089         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1090         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
1091         (WebKit::WebProcessPool::isNetworkCacheEnabled):
1092         * UIProcess/soup/WebProcessPoolSoup.cpp:
1093         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1094         * WebProcess/Network/WebLoaderStrategy.cpp:
1095         (WebKit::WebLoaderStrategy::storeDerivedDataToCache):
1096         * config.h:
1097
1098 2017-10-11  Michael Catanzaro  <mcatanzaro@igalia.com>
1099
1100         Unreviewed, rolling out r223146.
1101
1102         Better to not expose cairo in the WPE API
1103
1104         Reverted changeset:
1105
1106         "[WPE] Header cairo.h is used in GLib API headers but cannot
1107         be found"
1108         https://bugs.webkit.org/show_bug.cgi?id=178100
1109         http://trac.webkit.org/changeset/223146
1110
1111 2017-09-27  Frederic Wang  <fwang@igalia.com>
1112
1113         [iOS] Do not flatten frames when async frame scrolling is enabled
1114         https://bugs.webkit.org/show_bug.cgi?id=173704
1115
1116         Reviewed by Simon Fraser.
1117
1118         This patch disables frame flattening when async frame scrolling is enabled on iOS, as
1119         otherwise you can not scroll them. Once iframe scrolling is implemented in iOS (bug 149264),
1120         developers and beta testers will be able to check it by enabling "Async Frame Scrolling"
1121         in the "Experimental WebKit Features" menu of Safari iOS.
1122
1123         Test: platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling.html
1124
1125         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1126         (WebKit::WebChromeClient::contentsSizeChanged): Use effectiveFrameFlattening() introduced in
1127         Source/WebCore.
1128
1129 2017-10-10  Ryosuke Niwa  <rniwa@webkit.org>
1130
1131         Enable custom pasteboard data in DumpRenderTree and WebKitTestRunner
1132         https://bugs.webkit.org/show_bug.cgi?id=178154
1133
1134         Reviewed by Wenson Hsieh.
1135
1136         Plumbed customPasteboardDataEnabled flag to be used in WebKitTestRunner.
1137
1138         * Shared/WebPreferencesDefinitions.h:
1139         * UIProcess/API/C/WKPreferences.cpp:
1140         (WKPreferencesSetCustomPasteboardDataEnabled):
1141         (WKPreferencesGetCustomPasteboardDataEnabled):
1142         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1143         * WebProcess/WebPage/WebPage.cpp:
1144         (WebKit::WebPage::updatePreferences):
1145
1146 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1147
1148         [WPE] Remove the possibility of installing the old WebKit2 C API
1149         https://bugs.webkit.org/show_bug.cgi?id=178125
1150
1151         Reviewed by Michael Catanzaro.
1152
1153         * PlatformWPE.cmake: Remove support for installing the deprecated C API.
1154
1155 2017-10-10  Chris Dumez  <cdumez@apple.com>
1156
1157         [WK2] Add API to clear service worker registrations
1158         https://bugs.webkit.org/show_bug.cgi?id=178085
1159         <rdar://problem/34866025>
1160
1161         Reviewed by Ryosuke Niwa.
1162
1163         Add API to clear service worker registrations. Although the request to
1164         clear the registration is passed on to the StorageProcess, it is currently
1165         a no-op on StorageProcess side until we actually persist service worker
1166         registrations on disk.
1167
1168         * Shared/WebsiteData/WebsiteDataType.h:
1169         * StorageProcess/StorageProcess.cpp:
1170         (WebKit::StorageProcess::fetchWebsiteData):
1171         (WebKit::StorageProcess::deleteWebsiteData):
1172         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
1173         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1174         (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):
1175         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1176         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
1177         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
1178         (dataTypesToString):
1179         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
1180         (WebKit::toWebsiteDataType):
1181         (WebKit::toWKWebsiteDataTypes):
1182         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1183         (+[WKWebsiteDataStore allWebsiteDataTypes]):
1184         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1185         (WebKit::WebsiteDataStore::fetchDataAndApply):
1186         (WebKit::WebsiteDataStore::removeData):
1187
1188 2017-10-10  Commit Queue  <commit-queue@webkit.org>
1189
1190         Unreviewed, rolling out r223130.
1191         https://bugs.webkit.org/show_bug.cgi?id=178147
1192
1193         Breaks the build when EGLNativeWindowType is a pointer
1194         (Requested by aperezdc on #webkit).
1195
1196         Reverted changeset:
1197
1198         "[WPE] Build failure due to invalid cast of
1199         EGLNativeWindowType when targetting 64-bit ARM"
1200         https://bugs.webkit.org/show_bug.cgi?id=178090
1201         http://trac.webkit.org/changeset/223130
1202
1203 2017-10-10  Sam Weinig  <sam@webkit.org>
1204
1205         Replace copyKeysToVector/copyValuesToVector with copyToVector(map.keys())/copyToVector(map.values())
1206         https://bugs.webkit.org/show_bug.cgi?id=178102
1207
1208         Reviewed by Tim Horton.
1209
1210         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1211         (WebKit::NetworkConnectionToWebProcess::didClose):
1212         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
1213         (WebKit::dumpChangedLayers):
1214         * UIProcess/API/glib/WebKitWebContext.cpp:
1215         (webkitWebContextInvalidateCustomProtocolRequests):
1216         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1217         (webkitWebViewBaseContainerForall):
1218         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
1219         (-[WKWebViewContentProviderRegistry _mimeTypesWithCustomContentProviders]):
1220         * UIProcess/GenericCallback.h:
1221         (WebKit::invalidateCallbackMap):
1222         * UIProcess/WebProcessProxy.cpp:
1223         (WebKit::WebProcessProxy::shutDown):
1224         (WebKit::WebProcessProxy::didClose):
1225         (WebKit::WebProcessProxy::didBecomeUnresponsive):
1226         (WebKit::WebProcessProxy::didBecomeResponsive):
1227         (WebKit::WebProcessProxy::willChangeIsResponsive):
1228         (WebKit::WebProcessProxy::didChangeIsResponsive):
1229         (WebKit::WebProcessProxy::disconnectFramesFromPage):
1230         (WebKit::WebProcessProxy::frameCountInPage const):
1231         (WebKit::WebProcessProxy::requestTermination):
1232         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
1233         (WebKit::NPRuntimeObjectMap::invalidate):
1234         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1235         (WebKit::NetscapePlugin::stopAllStreams):
1236         * WebProcess/Plugins/PluginView.cpp:
1237         (WebKit::PluginView::cancelAllStreams):
1238         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
1239         (WebKit::RemoteLayerTreeContext::buildTransaction):
1240         * WebProcess/WebProcess.cpp:
1241         (WebKit::WebProcess::didClose):
1242
1243 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1244
1245         [WPE] Header cairo.h is used in GLib API headers but cannot be found
1246         https://bugs.webkit.org/show_bug.cgi?id=178100
1247
1248         Reviewed by Michael Catanzaro.
1249
1250         * wpe/wpe-webkit.pc.in: Add Cairo to the "Requires" field, so its flags get pulled
1251         in and the "cairo.h", used in the WPE WebKit GLib API headers, can be found.
1252
1253 2017-10-10  Michael Catanzaro  <mcatanzaro@igalia.com>
1254
1255         CSS constant properties should not be enabled by default
1256         https://bugs.webkit.org/show_bug.cgi?id=177416
1257
1258         Reviewed by Darin Adler.
1259
1260         * Shared/WebPreferencesDefinitions.h:
1261
1262 2017-10-10  Brady Eidson  <beidson@apple.com>
1263
1264         Random StorageProcess and SWServer cleanup.
1265         https://bugs.webkit.org/show_bug.cgi?id=178141
1266
1267         Reviewed by Andy Estes.
1268
1269         -StorageProcess should own the set of SWServers
1270         -Some renaming and cleanup
1271
1272         * StorageProcess/StorageProcess.cpp:
1273         (WebKit::StorageProcess::createStorageToWebProcessConnection):
1274         (WebKit::StorageProcess::swServerForSession):
1275         * StorageProcess/StorageProcess.h:
1276         (WebKit::StorageProcess::queue):
1277
1278         * StorageProcess/StorageToWebProcessConnection.cpp:
1279         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
1280         * StorageProcess/StorageToWebProcessConnection.h:
1281
1282 2017-10-10  Michael Catanzaro  <mcatanzaro@igalia.com>
1283
1284         Unreviewed, rolling out r223136.
1285
1286         Forgot to update GTK API header
1287
1288         Reverted changeset:
1289
1290         "[WPE] Header cairo.h is used in GLib API headers but cannot
1291         be found"
1292         https://bugs.webkit.org/show_bug.cgi?id=178100
1293         http://trac.webkit.org/changeset/223136
1294
1295 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1296
1297         [WPE] Header cairo.h is used in GLib API headers but cannot be found
1298         https://bugs.webkit.org/show_bug.cgi?id=178100
1299
1300         Reviewed by Žan Doberšek.
1301
1302         Instead of including <cairo.h>, it is better to forward-declare cairo_surface_t,
1303         which is the one and only Cairo declaration needed by the WPE API header.
1304
1305         * UIProcess/API/glib/WebKitFaviconDatabase.cpp: Add inclusion of <cairo.h>.
1306         * UIProcess/API/glib/WebKitWebView.cpp: Add inclusion of <cairo.h>.
1307         * UIProcess/API/wpe/WebKitFaviconDatabase.h: Add forward declaration of cairo_surface_t.
1308
1309 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1310
1311         [WPE] Cannot link against libWPEWebkit due to wrong contents of wpe-webkit.pc
1312         https://bugs.webkit.org/show_bug.cgi?id=178133
1313
1314         Reviewed by Žan Doberšek.
1315
1316         * wpe/wpe-webkit.pc.in: Remove "-lWPE" and replace "Requires.private" with a plain "Requires".
1317
1318 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1319
1320         [WPE] Build failure due to invalid cast of EGLNativeWindowType when targetting 64-bit ARM
1321         https://bugs.webkit.org/show_bug.cgi?id=178090
1322
1323         Reviewed by Žan Doberšek.
1324
1325         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
1326         (WebKit::AcceleratedSurfaceWPE::window const): Use static_cast instead of reinterpret_cast,
1327         this way extending values of EGLNativeWindowType to 64 bits is allowed.
1328
1329 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1330
1331         [WPE] GLib API headers WebKitScriptDialog.h and WebKitFileChooserRequest.h are not installed
1332         https://bugs.webkit.org/show_bug.cgi?id=178104
1333
1334         Reviewed by Žan Doberšek.
1335
1336         * PlatformWPE.cmake: Add missing header paths to the WPE_API_INSTALLED_HEADERS variable.
1337
1338 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1339
1340         [WPE][CMake] The “install” target should install all public API headers
1341         https://bugs.webkit.org/show_bug.cgi?id=176475
1342
1343         Reviewed by Žan Doberšek.
1344
1345         Install the WPE port GLib-based API headers. The deprecated C API is still available,
1346         but disabled by default behind the "EXPORT_DEPRECATED_WEBKIT2_C_API" CMake option.
1347
1348         * PlatformWPE.cmake: Always install "wpe-webkit.pc" and the GLib C API for WPE.
1349
1350 2017-10-09  Jeremy Jones  <jeremyj@apple.com>
1351
1352         Fix typo of virtual keyword in PageClientImplIOS.h
1353         https://bugs.webkit.org/show_bug.cgi?id=178088
1354
1355         Reviewed by Simon Fraser.
1356
1357         This compile error happens when FULLSCREEN_API is enabled for iOS.
1358         Remove the redundant virtual keyword since function is marked override.
1359
1360         * UIProcess/ios/PageClientImplIOS.h:
1361
1362 2017-10-09  Chris Dumez  <cdumez@apple.com>
1363
1364         [iOS][WK2] Tiles outsides the viewport are sometimes missing after relaunching a crashes WebProcess
1365         https://bugs.webkit.org/show_bug.cgi?id=178095
1366         <rdar://problem/34415016>
1367
1368         Reviewed by Simon Fraser.
1369
1370         Make sure we reset WKWebView._hasScheduledVisibleRectUpdate to NO in WKWebView._processDidExit.
1371         _scheduleVisibleContentRectUpdateAfterScrollInView would otherwise return early because
1372         WKWebView._hasScheduledVisibleRectUpdate is always YES. Normally,
1373         _addUpdateVisibleContentRectPreCommitHandler sets a CATransaction commit handler that
1374         resets _hasScheduledVisibleRectUpdate to NO, but it does not do so when ![webView _isValid]
1375         (which is true when the WebProcess has crashed.
1376
1377         Also reset WKWebView._commitDidRestoreScrollPosition to NO in WKWebView._processDidExit even
1378         though it does not seem to be the cause of this bug. It seems to make sense to reset this member
1379         when the process crashes.
1380
1381         * UIProcess/API/Cocoa/WKWebView.mm:
1382         (-[WKWebView _processDidExit]):
1383
1384 2017-10-09  Youenn Fablet  <youenn@apple.com>
1385
1386         Add quota to cache API
1387         https://bugs.webkit.org/show_bug.cgi?id=177552
1388
1389         Reviewed by Alex Christensen.
1390
1391         Adding support for quota checking in CacheStorage::Caches.
1392         It is passed to NetworkProcess at creation time.
1393         Default quota size is configured to 400Ko by origin per default.
1394         This value is suitable for testing.
1395         Future patch should raise this default value and allows configuring it.
1396
1397         Quota is computed based on the response body size.
1398         This size is padded at WebCore for opaque responses.
1399         Size is stored persistently as opaque response padded size should remain stable.
1400         See https://github.com/whatwg/storage/issues/31 for the rationale about this padding.
1401
1402         In case of putting several records at the same time, the size of all records
1403         is computed so that all records will be written or rejected together.
1404
1405         Sending QuotaExceeded error when quota is exceeded.
1406         Future effort should allow asking UIProcess for quota extension.
1407
1408         * NetworkProcess/NetworkProcess.cpp:
1409         (WebKit::NetworkProcess::cacheStoragePerOriginQuota const):
1410         * NetworkProcess/NetworkProcess.h:
1411         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1412         (WebKit::NetworkProcessCreationParameters::encode const):
1413         (WebKit::NetworkProcessCreationParameters::decode):
1414         * NetworkProcess/NetworkProcessCreationParameters.h:
1415         * NetworkProcess/cache/CacheStorageEngine.cpp:
1416         (WebKit::CacheStorage::Engine::readCachesFromDisk):
1417         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
1418         (WebKit::CacheStorage::Cache::toRecordInformation):
1419         (WebKit::CacheStorage::isolatedCopy):
1420         (WebKit::CacheStorage::Cache::open):
1421         (WebKit::CacheStorage::Cache::storeRecords):
1422         (WebKit::CacheStorage::Cache::put):
1423         (WebKit::CacheStorage::Cache::writeRecordToDisk):
1424         (WebKit::CacheStorage::Cache::updateRecordToDisk):
1425         (WebKit::CacheStorage::Cache::removeRecordFromDisk):
1426         (WebKit::CacheStorage::Cache::encode):
1427         (WebKit::CacheStorage::Cache::decodeRecordHeader):
1428         (WebKit::CacheStorage::Cache::decode):
1429         * NetworkProcess/cache/CacheStorageEngineCache.h:
1430         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1431         (WebKit::CacheStorage::Caches::Caches):
1432         (WebKit::CacheStorage::Caches::initialize):
1433         (WebKit::CacheStorage::Caches::initializeSize):
1434         (WebKit::CacheStorage::Caches::requestSpace):
1435         (WebKit::CacheStorage::Caches::writeRecord):
1436         (WebKit::CacheStorage::Caches::removeRecord):
1437         (WebKit::CacheStorage::Caches::removeCacheEntry):
1438         * NetworkProcess/cache/CacheStorageEngineCaches.h:
1439         (WebKit::CacheStorage::Caches::create):
1440         (WebKit::CacheStorage::Caches::hasEnoughSpace const):
1441         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1442         (WebKit::NetworkCache::Storage::traverse):
1443         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1444         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1445         * Shared/WebCoreArgumentCoders.cpp:
1446         (IPC::ArgumentCoder<DOMCacheEngine::Record>::encode):
1447         (IPC::ArgumentCoder<DOMCacheEngine::Record>::decode):
1448         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1449         (API::ProcessPoolConfiguration::copy):
1450         * UIProcess/API/APIProcessPoolConfiguration.h:
1451         * UIProcess/WebProcessPool.cpp:
1452         (WebKit::WebProcessPool::ensureNetworkProcess):
1453
1454 2017-10-09  Sam Weinig  <sam@webkit.org>
1455
1456         Make HashMap::keys() and HashMap::values() work with WTF::map/WTF::copyToVector
1457         https://bugs.webkit.org/show_bug.cgi?id=178072
1458
1459         Reviewed by Darin Adler.
1460
1461         * Shared/AsyncRequest.h:
1462         (WebKit::AsyncRequestMap::values):
1463         * UIProcess/WebProcessProxy.h:
1464         (WebKit::WebProcessProxy::pages const):
1465
1466             Update for type change for HashMap::values().
1467
1468 2017-10-09  Jeremy Jones  <jeremyj@apple.com>
1469
1470         Incorrect fullscreen animation when element has a transform.
1471         https://bugs.webkit.org/show_bug.cgi?id=177558
1472         rdar://problem/29603741
1473
1474         Reviewed by Jer Noble.
1475
1476         Use a bit of code from element fullscreen to do this correctly for video fullscreen.
1477         The key is to get the absolute quad from the renderer. This will work for scaling,
1478         But since we still take the bounding box, it won't work for rotations.
1479
1480         * WebProcess/cocoa/VideoFullscreenManager.mm:
1481         (WebKit::inlineVideoFrame):
1482
1483 2017-10-09  Robin Morisset  <rmorisset@apple.com>
1484
1485         Make the names of the options consistent
1486         https://bugs.webkit.org/show_bug.cgi?id=177933
1487
1488         Reviewed by Saam Barati.
1489
1490         * NetworkProcess/capture/json.hpp:
1491         * Platform/IPC/Connection.cpp:
1492         (IPC::Connection::connectionDidClose):
1493         * UIProcess/API/Cocoa/WKWebView.mm:
1494         (-[WKWebView _keyboardWillHide:]):
1495         * UIProcess/WebPageProxy.cpp:
1496         (WebKit::WebPageProxy::runModal):
1497         * UIProcess/mac/WebInspectorProxyMac.mm:
1498         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
1499         * WebProcess/WebPage/ios/WebPageIOS.mm:
1500         (WebKit::WebPage::selectWithGesture):
1501
1502 2017-10-09  Adrian Perez de Castro  <aperez@igalia.com>
1503
1504         [WPE][GTK] Propagate libepoxy compiler flags obtained from pkg-config
1505         https://bugs.webkit.org/show_bug.cgi?id=178081
1506
1507         Reviewed by Carlos Alberto Lopez Perez.
1508
1509         * CMakeLists.txt: Use ${LIBEPOXY_DEFINITIONS} for building WebKit.
1510
1511 2017-10-08  Tim Horton  <timothy_horton@apple.com>
1512
1513         mediaPlaybackRequiresUserAction API replacement annotation is wrong
1514         https://bugs.webkit.org/show_bug.cgi?id=178063
1515
1516         Reviewed by Dan Bernstein.
1517
1518         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1519         mediaPlaybackRequiresUserAction suggests that you should use 
1520         requiresUserActionForMediaPlayback instead, but that is also deprecated.
1521         Instead, follow the chain and suggest mediaTypesRequiringUserActionForPlayback.
1522
1523 2017-10-06  Wenson Hsieh  <wenson_hsieh@apple.com>
1524
1525         [iOS WK2] API tests added in r222991 are failing in iOS 11 test runners
1526         https://bugs.webkit.org/show_bug.cgi?id=178037
1527
1528         Reviewed by Tim Horton.
1529
1530         This patch carries out some minor cleanup around UIKitSPI.h in WebKit2, so that the internal SDK isn't required
1531         to implement -[WKContentView insertTextSuggestion:].
1532
1533         * Platform/spi/ios/UIKitSPI.h:
1534         * UIProcess/ios/WKContentViewInteraction.mm:
1535         (-[WKContentView insertTextSuggestion:]):
1536
1537 2017-10-06  Chris Dumez  <cdumez@apple.com>
1538
1539         [Beacon][Cocoa] Beacon requests with BufferSource payload should not have a Content-Type HTTP header
1540         https://bugs.webkit.org/show_bug.cgi?id=178027
1541         <rdar://problem/34748470>
1542
1543         Reviewed by Youenn Fablet.
1544
1545         Use new NSURLSessionConfiguration._suppressedAutoAddedHTTPHeaders CFNetwork SPI to
1546         make sure that CFNetwork never adds a Content-Type HTTP headers to our requests
1547         when we did not add one.
1548
1549         This is covered by the following tests on newer OSes:
1550         - imported/w3c/web-platform-tests/beacon/headers/header-content-type.html
1551         - http/tests/blink/sendbeacon/beacon-same-origin.html
1552
1553         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1554         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1555
1556 2017-10-06  Aishwarya Nirmal  <anirmal@apple.com>
1557
1558         [iOS] Respect the "caret-color" CSS property when editing 
1559         https://bugs.webkit.org/show_bug.cgi?id=177489
1560         <rdar://problem/34600419>
1561
1562         Reviewed by Tim Horton.
1563
1564         This change adds support for the caret-color property on iOS.
1565
1566         * Shared/EditorState.cpp:
1567         (WebKit::EditorState::PostLayoutData::encode const):
1568         (WebKit::EditorState::PostLayoutData::decode):
1569         * Shared/EditorState.h:
1570         * UIProcess/ios/WKContentViewInteraction.mm:
1571         (-[WKContentView insertionPointColor]):
1572         * WebProcess/WebPage/ios/WebPageIOS.mm:
1573         (WebKit::WebPage::platformEditorState const):
1574
1575 2017-10-06  Brian Burg  <bburg@apple.com>
1576
1577         Web Inspector: clicking in Inspector webview clears the selection in the inspected page
1578         https://bugs.webkit.org/show_bug.cgi?id=178014
1579         <rdar://problem/12706857>
1580
1581         Reviewed by Timothy Hatcher.
1582
1583         If the Inspector is docked to the inspected view, clicking on the Inspector
1584         webview will cause selection in the inspected view to be lost. This is because
1585         the selection is lost when the web view resigns first responder.
1586
1587         Add a check in maintainsInactiveSelection to always retain selection if
1588         Web Inspector is open. This approach seems simpler than trying to sync a client's
1589         usage of WKPageSetMaintainsInactiveSelection with overrides that need to be applied
1590         and unapplied when an inspector web view is shown or hidden.
1591
1592         * UIProcess/WebPageProxy.cpp:
1593         (WebKit::WebPageProxy::maintainsInactiveSelection const):
1594         (WebKit::WebPageProxy::inspector const): Drive by, use nullptr.
1595
1596         * UIProcess/WebPageProxy.h:
1597         (WebKit::WebPageProxy::maintainsInactiveSelection const): Deleted.
1598
1599 2017-10-06  Alex Christensen  <achristensen@webkit.org>
1600
1601         Add more infrastructure to apply custom headers to same-origin requests
1602         https://bugs.webkit.org/show_bug.cgi?id=177629
1603
1604         Reviewed by Ryosuke Niwa.
1605
1606         * UIProcess/API/C/WKWebsitePolicies.cpp:
1607         (WKWebsitePoliciesCopyCustomHeaderFields):
1608         (WKWebsitePoliciesSetCustomHeaderFields):
1609         * UIProcess/API/C/WKWebsitePolicies.h:
1610         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1611         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
1612         (-[_WKWebsitePolicies customHeaderFields]):
1613         (-[_WKWebsitePolicies setCustomHeaderFields:]):
1614
1615         Make the SPI for setting custom header fields take a dictionary<String, String>
1616         instead of an array of Strings with colons. This matches NSURLRequest and other
1617         APIs that deal with header fields.
1618
1619 2017-10-06  Wenson Hsieh  <wenson_hsieh@apple.com>
1620
1621         [iOS] Tweak support for classifying form controls (followup to r222487)
1622         https://bugs.webkit.org/show_bug.cgi?id=177917
1623         <rdar://problem/34820122>
1624
1625         Reviewed by Dean Jackson.
1626
1627         This patch follows up with <http://trac.webkit.org/r222487>. It combines the functionality of two SPI hooks
1628         implemented on WKContentView into a single method that vends a context dictionary, and additionally addresses an
1629         issue with the original implementation, wherein some cached state on WebPageProxy is set upon starting node
1630         assistance, but is never unset when stopping node assistance, nor set anywhere else. See per-method comments for
1631         more detail.
1632
1633         * UIProcess/WebPageProxy.h:
1634
1635         Remove members m_acceptsAutofilledLoginCredentials and m_representingPageURL from WebPageProxy. This state is
1636         retrieved from the AssistedNodeInformation struct when starting node assistance, but is never reset anywhere
1637         else. Instead of introducing new members to remember this state, we can just use the WKContentView's current
1638         assisted node information.
1639
1640         This also means that programmatically focusing forms (without user gesture) will no longer cause WKContentView
1641         to accept autofilled login credentials, since we bail out of node assistance and don't begin an input session.
1642
1643         * UIProcess/ios/WKContentView.mm:
1644         (-[WKContentView acceptsAutofilledLoginCredentials]): Deleted.
1645         (-[WKContentView representingPageURL]): Deleted.
1646         * UIProcess/ios/WKContentViewInteraction.mm:
1647         (-[WKContentView _autofillContext]):
1648
1649         Merge functionality of the previous two SPI hooks, such that -_autofillContext will return a non-null dictionary
1650         containing the URL of the focused element's document if and only if WKContentView accepts autofilled login
1651         credentials, and there exists a representing page URL.
1652
1653         When the page stops assisting the focused node, we set the AssistedNodeInformation's element type to None, so we
1654         additionally bail and return nil if the element type is None. As an aside, it seems a more reasonable approach to
1655         resetting state upon stopping node assistance is to just completely reset _assistedNodeInformation to its initial
1656         value, i.e. via _assistedNodeInformation = { }. It's not clear whether there are behaviors relying on the fact
1657         that all members but the element type in the content view's assisted node information could be stale, so this
1658         seems worthy of some investigation.
1659
1660         * UIProcess/ios/WebPageProxyIOS.mm:
1661         (WebKit::WebPageProxy::startAssistingNode):
1662         (WebKit::WebPageProxy::acceptsAutofilledLoginCredentials): Deleted.
1663         (WebKit::WebPageProxy::representingPageURL): Deleted.
1664
1665 2017-10-06  Yousuke Kimoto  <yousuke.kimoto@sony.com>
1666
1667         [WinCairo] Add shared curl files
1668         https://bugs.webkit.org/show_bug.cgi?id=177999
1669
1670         Reviewed by Alex Christensen.
1671
1672         * PlatformWin.cmake:
1673         * Shared/Authentication/curl/AuthenticationManagerCurl.cpp: Added.
1674         (WebKit::AuthenticationManager::receivedCredential):
1675         (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
1676         (WebKit::AuthenticationManager::receivedCancellation):
1677         (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
1678         (WebKit::AuthenticationManager::receivedChallengeRejection):
1679         * Shared/curl/WebCoreArgumentCodersCurl.cpp: Added.
1680         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
1681         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
1682         (IPC::ArgumentCoder<CertificateInfo>::encode):
1683         (IPC::ArgumentCoder<CertificateInfo>::decode):
1684         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
1685         (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
1686         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
1687         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData):
1688         (IPC::ArgumentCoder<Credential>::encodePlatformData):
1689         (IPC::ArgumentCoder<Credential>::decodePlatformData):
1690
1691 2017-10-06  Brent Fulgham  <bfulgham@apple.com>
1692
1693         Sandbox rules block PluginProcess using "File Open/Save" dialogs
1694         https://bugs.webkit.org/show_bug.cgi?id=177965
1695         <rdar://problem/33976846>
1696
1697         Reviewed by Alexey Proskuryakov.
1698
1699         Update the PluginProcess sandboxes to allow the same XPC services as
1700         the WebContent process. Also allow access to the openAndSavePanelServices.
1701
1702         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: 
1703
1704 2017-10-06  Brady Eidson  <beidson@apple.com>
1705
1706         Add (entirely incorrect) fetching of ServiceWorker scripts.
1707         https://bugs.webkit.org/show_bug.cgi?id=176179
1708
1709         Reviewed by Andy Estes.
1710
1711         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1712         (WebKit::WebSWServerConnection::startScriptFetchInClient):
1713         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1714         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1715
1716         * WebProcess/Storage/WebSWClientConnection.cpp:
1717         (WebKit::WebSWClientConnection::finishFetchingScriptInServer):
1718         * WebProcess/Storage/WebSWClientConnection.h:
1719         * WebProcess/Storage/WebSWClientConnection.messages.in:
1720
1721 2017-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1722
1723         [GTK][WPE] Add API to configure and enable resource load statistics
1724         https://bugs.webkit.org/show_bug.cgi?id=177943
1725
1726         Reviewed by Michael Catanzaro.
1727
1728         Add new WebKitWebsiteDataManager construct only property to set the directory where the persistent stats are
1729         stored, and methods to enable resource load statistics and query whether it's currently enabled. Also add a new
1730         Website data type to be able to remove the persistent stats using WebKitWebsiteDataManager existing API.
1731
1732         * UIProcess/API/glib/WebKitWebContext.cpp:
1733         (websiteDataStoreConfigurationForWebProcessPoolConfiguration):
1734         (webkitWebContextConstructed):
1735         * UIProcess/API/glib/WebKitWebsiteData.cpp:
1736         (recordContainsSupportedDataTypes):
1737         (toWebKitWebsiteDataTypes):
1738         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
1739         (webkitWebsiteDataManagerGetProperty):
1740         (webkitWebsiteDataManagerSetProperty):
1741         (webkitWebsiteDataManagerConstructed):
1742         (webkit_website_data_manager_class_init):
1743         (webkitWebsiteDataManagerGetDataStore):
1744         (webkit_website_data_manager_get_resource_load_stats_directory):
1745         (webkit_website_data_manager_set_resource_load_stats_enabled):
1746         (webkit_website_data_manager_get_resource_load_stats_enabled):
1747         (toWebsiteDataTypes):
1748         * UIProcess/API/gtk/WebKitWebsiteData.h:
1749         * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
1750         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1751         * UIProcess/API/wpe/WebKitWebsiteData.h:
1752         * UIProcess/API/wpe/WebKitWebsiteDataManager.h:
1753
1754 2017-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1755
1756         [GTK][WPE] All resource load statistics tests added in r212183 crash in GTK bots, timeout in GTK and WPE bots since r219049
1757         https://bugs.webkit.org/show_bug.cgi?id=168171
1758
1759         Reviewed by Chris Dumez.
1760
1761         Add C API to handle all resource load statistics requests made by the layout tests.
1762
1763         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1764         (WKWebsiteDataStoreSetStatisticsLastSeen):
1765         (WKWebsiteDataStoreSetStatisticsPrevalentResource):
1766         (WKWebsiteDataStoreIsStatisticsPrevalentResource):
1767         (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
1768         (WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
1769         (WKWebsiteDataStoreSetStatisticsGrandfathered):
1770         (WKWebsiteDataStoreIsStatisticsGrandfathered):
1771         (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
1772         (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
1773         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
1774         (WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
1775         (WKWebsiteDataStoreSetStatisticsTimeToLiveCookiePartitionFree):
1776         (WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
1777         (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
1778         (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
1779         (WKWebsiteDataStoreStatisticsSubmitTelemetry):
1780         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenDataRecordsWereScanned):
1781         (WKWebsiteDataStoreSetStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
1782         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenTelemetryWasCaptured):
1783         (WKWebsiteDataStoreSetStatisticsMinimumTimeBetweenDataRecordsRemoval):
1784         (WKWebsiteDataStoreSetStatisticsGrandfatheringTime):
1785         (WKWebsiteDataStoreSetStatisticsMaxStatisticsEntries):
1786         (WKWebsiteDataStoreSetStatisticsPruneEntriesDownTo):
1787         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
1788         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
1789         (WKWebsiteDataStoreStatisticsClearThroughWebsiteDataRemoval):
1790         (WKWebsiteDataStoreStatisticsResetToConsistentState):
1791         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1792
1793 2017-10-05  Tim Horton  <timothy_horton@apple.com>
1794
1795         Fix the Mac CMake build
1796         https://bugs.webkit.org/show_bug.cgi?id=177985
1797
1798         Unreviewed build fix.
1799
1800         * CMakeLists.txt:
1801         * PlatformMac.cmake:
1802         After r222917, there's one more piece of WebKitSystemInterface left.
1803         And some missing bits of PaymentRequest.
1804
1805 2017-10-05  Keith Miller  <keith_miller@apple.com>
1806
1807         Unreviewed, tapi builds without optimization so we should have TAPI passes -DRELEASE_WITHOUT_OPTIMIZATIONS.
1808
1809         * Configurations/Base.xcconfig:
1810
1811 2017-10-05  Jer Noble  <jer.noble@apple.com>
1812
1813         [Cocoa] Enable ENABLE_ENCRYPTED_MEDIA build-time setting
1814         https://bugs.webkit.org/show_bug.cgi?id=177261
1815
1816         Reviewed by Eric Carlson.
1817
1818         * Configurations/FeatureDefines.xcconfig:
1819
1820 2017-10-05  Alex Christensen  <achristensen@webkit.org>
1821
1822         Add ObjC equivalent of WKPageNavigationClient.didChangeBackForwardList
1823         https://bugs.webkit.org/show_bug.cgi?id=177966
1824         <rdar://problem/22387135>
1825
1826         Reviewed by Tim Horton.
1827
1828         * UIProcess/API/APINavigationClient.h:
1829         (API::NavigationClient::didChangeBackForwardList):
1830         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1831         * UIProcess/Cocoa/NavigationState.h:
1832         * UIProcess/Cocoa/NavigationState.mm:
1833         (WebKit::NavigationState::setNavigationDelegate):
1834         (WebKit::NavigationState::NavigationClient::didFailToInitializePlugIn):
1835         (WebKit::NavigationState::NavigationClient::didChangeBackForwardList):
1836         (WebKit::NavigationState::NavigationClient::willPerformClientRedirect):
1837         (WebKit::NavigationState::NavigationClient::didCancelClientRedirect):
1838         (WebKit::NavigationState::NavigationClient::renderingProgressDidChange):
1839         (WebKit::NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace):
1840         (WebKit::NavigationState::NavigationClient::processDidTerminate):
1841         (WebKit::NavigationState::NavigationClient::processDidBecomeResponsive):
1842         (WebKit::NavigationState::NavigationClient::processDidBecomeUnresponsive):
1843         (WebKit::NavigationState::NavigationClient::webCryptoMasterKey):
1844         (WebKit::NavigationState::NavigationClient::didFinishLoadForQuickLookDocumentInMainFrame):
1845         (WebKit::NavigationState::HistoryClient::didNavigateWithNavigationData):
1846         (WebKit::NavigationState::HistoryClient::didPerformClientRedirect):
1847         (WebKit::NavigationState::HistoryClient::didPerformServerRedirect):
1848         (WebKit::NavigationState::HistoryClient::didUpdateHistoryTitle):
1849         * UIProcess/WebPageProxy.cpp:
1850         (WebKit::WebPageProxy::didChangeBackForwardList):
1851
1852 2017-10-05  Alex Christensen  <achristensen@webkit.org>
1853
1854         Add ObjC SPI with userInfo corresponding to WKPageNavigationClient's decidePolicyForNavigationAction, didStartProvisionalNavigation, and didFailNavigation
1855         https://bugs.webkit.org/show_bug.cgi?id=177974
1856         <rdar://problem/22888802>
1857
1858         Reviewed by Tim Horton.
1859
1860         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1861         * UIProcess/Cocoa/NavigationState.h:
1862         * UIProcess/Cocoa/NavigationState.mm:
1863         (WebKit::NavigationState::setNavigationDelegate):
1864         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1865         (WebKit::NavigationState::NavigationClient::didStartProvisionalNavigation):
1866         (WebKit::NavigationState::NavigationClient::didFailNavigationWithError):
1867         * UIProcess/Cocoa/UIDelegate.mm:
1868         (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
1869
1870 2017-10-05  John Wilander  <wilander@apple.com>
1871
1872         Storage Access API: Web process should ask UI process for grant/deny
1873         https://bugs.webkit.org/show_bug.cgi?id=176941
1874         <rdar://problem/34440036>
1875
1876         Reviewed by Chris Dumez and Sam Weinig.
1877
1878         This patch adds infrastructure to let WebCore::Document call
1879         WebKit::WebResourceLoadStatisticsStore and ask for storage
1880         access on behalf of an iframe. The communication goes through
1881         the ChromeClient since we might want to add a native prompt.
1882         From the ChromeClient it continues to the WebPage which
1883         messages the WebPageProxy. The WebPageProxy calls the
1884         WebsiteDataStore which owns the WebResourceLoadStatisticsStore.
1885         A uint64_t is used to match the right callback with the boolean
1886         result.
1887
1888         * UIProcess/WebPageProxy.cpp:
1889         (WebKit::WebPageProxy::requestStorageAccess):
1890         * UIProcess/WebPageProxy.h:
1891         * UIProcess/WebPageProxy.messages.in:
1892         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1893         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
1894         * UIProcess/WebResourceLoadStatisticsStore.h:
1895         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1896         (WebKit::WebsiteDataStore::requestStorageAccess):
1897         * UIProcess/WebsiteData/WebsiteDataStore.h:
1898         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1899         (WebKit::WebChromeClient::requestStorageAccess):
1900         * WebProcess/WebCoreSupport/WebChromeClient.h:
1901         * WebProcess/WebPage/WebPage.cpp:
1902         (WebKit::nextRequestStorageAccessContextId):
1903         (WebKit::WebPage::requestStorageAccess):
1904         (WebKit::WebPage::storageAccessResponse):
1905         * WebProcess/WebPage/WebPage.h:
1906         * WebProcess/WebPage/WebPage.messages.in:
1907
1908 2017-10-05  Chris Dumez  <cdumez@apple.com>
1909
1910         Drop unused parameters for CookiesStrategy::cookiesEnabled()
1911         https://bugs.webkit.org/show_bug.cgi?id=177957
1912
1913         Reviewed by Alex Christensen.
1914
1915         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1916         (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
1917         * NetworkProcess/NetworkConnectionToWebProcess.h:
1918         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1919         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1920         (WebKit::WebPlatformStrategies::cookiesEnabled):
1921         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1922
1923 2017-10-05  Tim Horton  <timothy_horton@apple.com>
1924
1925         Make progress toward properly-formed XPC services in the Mac CMake build
1926         https://bugs.webkit.org/show_bug.cgi?id=177918
1927
1928         Reviewed by Alex Christensen.
1929
1930         * CMakeLists.txt:
1931         * PlatformMac.cmake:
1932         Turn on the storage process on Mac, and fix its build.
1933         Move XPC services to Versions/A/XPCServices and add the toplevel
1934         XPCServices as a symlink of that.
1935         Run the XPC services' Info.plists through configure_file, and substitute
1936         the important variables (most critically the bundle identifier).
1937         Factor out the service setup so we don't keep duplicating it as it
1938         gets more complicated.
1939
1940 2017-10-05  Andy Estes  <aestes@apple.com>
1941
1942         [Payment Request] Add a payment method that supports Apple Pay
1943         https://bugs.webkit.org/show_bug.cgi?id=177850
1944
1945         Reviewed by Youenn Fablet.
1946
1947         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1948         (toShippingMethod): Converted the NSDecimalNumber amount to a string rather than an integer.
1949         (WebKit::toDecimalNumber): used -decimalNumberWithString:locale: rather than
1950         -initWithMantissa:exponent:isNegative: to create an NSDecimalNumber.
1951         (WebKit::toPKPaymentSummaryItem):
1952         (WebKit::toPKShippingMethod):
1953
1954 2017-10-05  Youenn Fablet  <youenn@apple.com>
1955
1956         Make LibWebRTCProvider port agnostic
1957         https://bugs.webkit.org/show_bug.cgi?id=177747
1958
1959         Reviewed by Alex Christensen & Alex Garcia.
1960
1961         * WebProcess/Network/webrtc/LibWebRTCProvider.h: Making sure Mac/iOS provider creates the codec factories.
1962
1963 2017-10-04  Alex Christensen  <achristensen@webkit.org>
1964
1965         Stop linking with WebKitSystemInterface
1966         https://bugs.webkit.org/show_bug.cgi?id=177915
1967
1968         Reviewed by Antti Koivisto.
1969
1970         * Configurations/DebugRelease.xcconfig:
1971         * WebKit.xcodeproj/project.pbxproj:
1972
1973 2017-10-04  Alex Christensen  <achristensen@webkit.org>
1974
1975         Remove unnecessary includes of WebKitSystemInterface on Cocoa platforms
1976         https://bugs.webkit.org/show_bug.cgi?id=177912
1977
1978         Reviewed by Saam Barati.
1979
1980         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1981         * NetworkProcess/mac/NetworkProcessMac.mm:
1982         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1983         * Platform/IPC/mac/ConnectionMac.mm:
1984         * Platform/mac/LayerHostingContext.mm:
1985         * PluginProcess/mac/PluginProcessMac.mm:
1986         * PluginProcess/mac/PluginProcessShim.mm:
1987         * Shared/ios/ChildProcessIOS.mm:
1988         * Shared/mac/ChildProcessMac.mm:
1989         * Shared/mac/SandboxExtensionMac.mm:
1990         * Shared/mac/WebCoreArgumentCodersMac.mm:
1991         * Shared/mac/WebEventFactory.mm:
1992         * StorageProcess/ios/StorageProcessIOS.mm:
1993         * StorageProcess/mac/StorageProcessMac.mm:
1994         * UIProcess/API/Cocoa/WKWebView.mm:
1995         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
1996         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
1997         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1998         * UIProcess/Cocoa/WebViewImpl.mm:
1999         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2000         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
2001         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
2002         * UIProcess/mac/PageClientImplMac.mm:
2003         * UIProcess/mac/WKTextInputWindowController.mm:
2004         * UIProcess/mac/WebContextMenuProxyMac.mm:
2005         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2006         * UIProcess/mac/WindowServerConnection.mm:
2007         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2008         * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:
2009         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2010         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2011         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
2012         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2013         * WebProcess/WebPage/ios/WebPageIOS.mm:
2014         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
2015         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
2016         * WebProcess/WebPage/mac/WebPageMac.mm:
2017         * WebProcess/cocoa/WebProcessCocoa.mm:
2018
2019 2017-10-04  Youenn Fablet  <youenn@apple.com>
2020
2021         rtc::PacketOptions should have its own IPC encoding/decoding routines
2022         https://bugs.webkit.org/show_bug.cgi?id=177812
2023
2024         Reviewed by Alex Christensen.
2025
2026         Replacing rtc::PacketOptions IPC encoding/decoding from passing the structure as individual parameters to the structure as a parameter.
2027         Introducing WebKit::RTCPacketOptions as a wrapper around it for which encode/decode routines are added.
2028         Updating code using rtc::PacketOptions accordingly.
2029
2030         * NetworkProcess/webrtc/NetworkRTCSocket.cpp:
2031         (WebKit::NetworkRTCSocket::sendTo):
2032         * NetworkProcess/webrtc/NetworkRTCSocket.h:
2033         * NetworkProcess/webrtc/NetworkRTCSocket.messages.in:
2034         * Platform/IPC/Decoder.cpp:
2035         (IPC::Decoder::operator>>):
2036         (IPC::Decoder::decode):
2037         * Platform/IPC/Decoder.h:
2038         * Platform/IPC/Encoder.cpp:
2039         (IPC::Encoder::encode):
2040         * Platform/IPC/Encoder.h:
2041         * Shared/RTCPacketOptions.cpp: Added.
2042         (WebKit::RTCPacketOptions::encode const):
2043         (WebKit::RTCPacketOptions::decode):
2044         * Shared/RTCPacketOptions.h: Added.
2045         * WebKit.xcodeproj/project.pbxproj:
2046         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
2047         (WebKit::LibWebRTCSocket::SendTo):
2048
2049 2017-10-04  Don Olmstead  <don.olmstead@sony.com>
2050
2051         Include Pasteboard.h for all in WebCoreArgumentCoders
2052         https://bugs.webkit.org/show_bug.cgi?id=177902
2053
2054         Reviewed by Alex Christensen.
2055
2056         * Shared/WebCoreArgumentCoders.cpp:
2057
2058 2017-10-04  David Kilzer  <ddkilzer@apple.com>
2059
2060         Remove unused variables in lambdas for network process cache
2061         <https://webkit.org/b/177878>
2062         <rdar://problem/34038482>
2063
2064         Reviewed by Tim Horton.
2065
2066         * NetworkProcess/cache/CacheStorageEngine.cpp:
2067         (WebKit::CacheStorage::Engine::open):
2068         (WebKit::CacheStorage::Engine::putRecords):
2069         (WebKit::CacheStorage::Engine::deleteMatchingRecords):
2070         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
2071         (WebKit::CacheStorageEngineConnection::reference):
2072         - Remove unused |this| from lambda captures.
2073
2074 2017-10-04  Stephan Szabo  <stephan.szabo@sony.com>
2075
2076         [WinCairo] add PLATFORM(WIN) configurations to config.h
2077         https://bugs.webkit.org/show_bug.cgi?id=177846
2078
2079         Reviewed by Alex Christensen.
2080
2081         * config.h:
2082
2083 2017-10-04  Adrian Perez de Castro  <aperez@igalia.com>
2084
2085         [GTK] WebKit2GTK+ does not handle touchmove and touchend events correctly
2086         https://bugs.webkit.org/show_bug.cgi?id=158531
2087
2088         Reviewed by Carlos Alberto Lopez Perez.
2089
2090         Do not bypass WebCore event handling when receiving touch events.
2091
2092         Based on a patch by Andre Moreira Magalhaes <andre.magalhaes@collabora.co.uk>.
2093         Thanks to Carlos Garnacho <carlosg@gnome.org> for helping out reviewing the code.
2094
2095         * UIProcess/API/gtk/PageClientImpl.cpp:
2096         (WebKit::PageClientImpl::doneWithTouchEvent): Make sure touchend reaches gesture controller if touchbegin evet got to it.
2097         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2098         (webkitWebViewBaseTouchEvent): Do not invoke gesture controller directly by bypassing WebCore event handling.
2099         * UIProcess/gtk/GestureController.cpp:
2100         (WebKit::GestureController::reset): Added.
2101         (WebKit::GestureController::handleEvent): Reset gesture controller when touchpadupdate/end is received without touchbegin.
2102         (WebKit::GestureController::Gesture::reset): Added.
2103         * UIProcess/gtk/GestureController.h:
2104
2105 2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
2106
2107         Unreviewed WPE build fix after r222837
2108         https://bugs.webkit.org/show_bug.cgi?id=177449
2109
2110         * Shared/wpe/WebEventFactory.cpp:
2111         (WebKit::wallTimeForEventTime):
2112
2113 2017-10-04  Ryosuke Niwa  <rniwa@webkit.org>
2114
2115         Use blob URL when pasting RTFD instead of overriding DocumentLoader
2116         https://bugs.webkit.org/show_bug.cgi?id=177801
2117         <rdar://problem/34542270>
2118
2119         Reviewed by Wenson Hsieh.
2120
2121         Fixed the assertion failure when RTFD content is empty.
2122
2123         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2124         (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
2125
2126 2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
2127
2128         REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
2129         https://bugs.webkit.org/show_bug.cgi?id=177449
2130
2131         Reviewed by Chris Dumez.
2132
2133         * Shared/wpe/WebEventFactory.cpp:
2134         (WebKit::wallTimeForEventTime):
2135
2136 2017-10-03  Brent Fulgham  <bfulgham@apple.com>
2137
2138         Correct nullptr dereference during shutdown
2139         https://bugs.webkit.org/show_bug.cgi?id=177845
2140         <rdar://problem/33651405>
2141
2142         Reviewed by Chris Dumez.
2143
2144         It looks like the ResourceLoadStatisticsPersistentStorage destructor is calling code that attempts
2145         to use member variables in its owning class (WebResourceLoadStatisticsStore). Since these may have
2146         already been destroyed, they are in an invalid state when accessed.
2147
2148         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
2149         (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage): Do not call
2150         finishAllPendingWorkSynchronously() in the destructor, since it relies on the m_memoryStore to be
2151         a reference to completely valid object.
2152         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2153         (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore): Instead, call
2154         'finishAllPendingWorkSynchronously' here, when the object is still in a known valid state.
2155
2156 2017-10-03  Alex Christensen  <achristensen@webkit.org>
2157
2158         Moderize WebKit's back forward list code
2159         https://bugs.webkit.org/show_bug.cgi?id=177843
2160
2161         Reviewed by Tim Horton.
2162
2163         Use Ref instead of RefPtr when possible.
2164         Use references instead of pointers when possible.
2165         Remove unnecessary null checks.
2166         Reduce unnecessary Vector copying.
2167
2168         * Shared/SessionState.h:
2169         * Shared/WebBackForwardListItem.h:
2170         * UIProcess/API/APILoaderClient.h:
2171         (API::LoaderClient::didChangeBackForwardList):
2172         (API::LoaderClient::shouldKeepCurrentBackForwardListItemInList):
2173         * UIProcess/API/C/WKPage.cpp:
2174         (WKPageSetPageLoaderClient):
2175         * UIProcess/WebBackForwardList.cpp:
2176         (WebKit::WebBackForwardList::pageClosed):
2177         (WebKit::WebBackForwardList::addItem):
2178         (WebKit::WebBackForwardList::goToItem):
2179         (WebKit::WebBackForwardList::currentItem const):
2180         (WebKit::WebBackForwardList::backItem const):
2181         (WebKit::WebBackForwardList::forwardItem const):
2182         (WebKit::WebBackForwardList::itemAtIndex const):
2183         (WebKit::WebBackForwardList::backListAsAPIArrayWithLimit const):
2184         (WebKit::WebBackForwardList::forwardListAsAPIArrayWithLimit const):
2185         (WebKit::WebBackForwardList::removeAllItems):
2186         (WebKit::WebBackForwardList::clear):
2187         (WebKit::WebBackForwardList::backForwardListState const):
2188         (WebKit::WebBackForwardList::restoreFromState):
2189         * UIProcess/WebBackForwardList.h:
2190         * UIProcess/WebPageProxy.cpp:
2191         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
2192         (WebKit::WebPageProxy::initializeWebPage):
2193         (WebKit::WebPageProxy::didChangeBackForwardList):
2194         (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList):
2195         (WebKit::WebPageProxy::backForwardGoToItem):
2196         * UIProcess/WebPageProxy.h:
2197         * UIProcess/WebProcessProxy.cpp:
2198         (WebKit::WebProcessProxy::registerNewWebBackForwardListItem):
2199         * UIProcess/WebProcessProxy.h:
2200         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2201         (WebKit::WebBackForwardListProxy::itemAtIndex):
2202
2203 2017-10-03  Chris Dumez  <cdumez@apple.com>
2204
2205         SharedStringHashStore should support removing hashes
2206         https://bugs.webkit.org/show_bug.cgi?id=177770
2207
2208         Reviewed by Alex Christensen.
2209
2210         SharedStringHashStore should support removing hashes. It currently only supports adding hashes or
2211         clearing all of them, which is sufficient for the VisitedLinkStore but will not be for Service
2212         Worker purposes.
2213
2214         * Shared/SharedStringHashStore.cpp:
2215         (WebKit::SharedStringHashStore::SharedStringHashStore):
2216         (WebKit::SharedStringHashStore::add):
2217         (WebKit::SharedStringHashStore::remove):
2218         (WebKit::SharedStringHashStore::contains):
2219         (WebKit::SharedStringHashStore::clear):
2220         (WebKit::SharedStringHashStore::resizeTable):
2221         (WebKit::SharedStringHashStore::pendingOperationsTimerFired):
2222         * Shared/SharedStringHashStore.h:
2223         * Shared/SharedStringHashTable.cpp:
2224         (WebKit::SharedStringHashTable::remove):
2225         * Shared/SharedStringHashTable.h:
2226         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
2227         * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm:
2228         (-[_WKVisitedLinkStore containsVisitedLinkWithURL:]):
2229         (-[_WKVisitedLinkStore removeVisitedLinkWithURL:]):
2230         * UIProcess/VisitedLinkStore.cpp:
2231         (WebKit::VisitedLinkStore::containsVisitedLinkHash):
2232         (WebKit::VisitedLinkStore::removeVisitedLinkHash):
2233         (WebKit::VisitedLinkStore::didUpdateSharedStringHashes):
2234         * UIProcess/VisitedLinkStore.h:
2235
2236 2017-10-03  Alex Christensen  <achristensen@webkit.org>
2237
2238         Fix API tests after r222794.
2239         https://bugs.webkit.org/show_bug.cgi?id=177825
2240
2241         * UIProcess/WebPageProxy.cpp:
2242         (WebKit::WebPageProxy::willGoToBackForwardListItem):
2243         Sometimes there's no navigation client.
2244
2245 2017-10-03  Alex Christensen  <achristensen@webkit.org>
2246
2247         Add ObjC equivalent of WKPageLoaderClient.pluginDidFail
2248         https://bugs.webkit.org/show_bug.cgi?id=177787
2249         <rdar://problem/22387633>
2250
2251         Reviewed by Tim Horton.
2252
2253         * UIProcess/API/APILoaderClient.h:
2254         (API::LoaderClient::didFailToInitializePlugin):
2255         * UIProcess/API/APINavigationClient.h:
2256         (API::NavigationClient::canHandleDidFailToInitializePlugIn const):
2257         (API::NavigationClient::didFailToInitializePlugIn):
2258         * UIProcess/API/C/WKPage.cpp:
2259         (WKPageSetPageLoaderClient):
2260         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2261         * UIProcess/Cocoa/NavigationState.h:
2262         * UIProcess/Cocoa/NavigationState.mm:
2263         (WebKit::NavigationState::setNavigationDelegate):
2264         (WebKit::NavigationState::NavigationClient::canHandleDidFailToInitializePlugIn const):
2265         (WebKit::NavigationState::NavigationClient::didFailToInitializePlugIn):
2266         * UIProcess/WebPageProxy.cpp:
2267         (WebKit::WebPageProxy::didFailToInitializePlugin):
2268
2269 2017-10-03  Adrian Perez de Castro  <aperez@igalia.com>
2270
2271         [GTK] Prefer -webkit-system-font
2272         https://bugs.webkit.org/show_bug.cgi?id=177814
2273
2274         Reviewed by Carlos Garcia Campos.
2275
2276         Use "font-family: -webkit-system-font" instead of "font: menu".
2277
2278         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
2279         (WebKit::RemoteInspectorProtocolHandler::handleRequest): Edited HTML snippet.
2280
2281 2017-10-03  Alex Christensen  <achristensen@webkit.org>
2282
2283         Add ObjC SPI equivalent to WKPageLoaderClient.willGoToBackForwardListItem
2284         https://bugs.webkit.org/show_bug.cgi?id=177825
2285         <rdar://problem/22387505>
2286
2287         Reviewed by Tim Horton.
2288
2289         * UIProcess/API/APILoaderClient.h:
2290         (API::LoaderClient::willGoToBackForwardListItem):
2291         * UIProcess/API/APINavigationClient.h:
2292         (API::NavigationClient::canHandleWillGoToBackForwardListItem const):
2293         (API::NavigationClient::willGoToBackForwardListItem):
2294         * UIProcess/API/C/WKPage.cpp:
2295         (WKPageSetPageLoaderClient):
2296         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2297         * UIProcess/Cocoa/NavigationState.h:
2298         * UIProcess/Cocoa/NavigationState.mm:
2299         (WebKit::NavigationState::setNavigationDelegate):
2300         (WebKit::NavigationState::NavigationClient::canHandleWillGoToBackForwardListItem const):
2301         (WebKit::NavigationState::NavigationClient::willGoToBackForwardListItem):
2302         * UIProcess/WebPageProxy.cpp:
2303         (WebKit::WebPageProxy::willGoToBackForwardListItem):
2304         * UIProcess/WebPageProxy.h:
2305         * UIProcess/WebPageProxy.messages.in:
2306         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2307         (WebKit::WebFrameLoaderClient::shouldGoToHistoryItem const):
2308
2309 2017-10-03  Michael Catanzaro  <mcatanzaro@igalia.com>
2310
2311         REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
2312         https://bugs.webkit.org/show_bug.cgi?id=177449
2313
2314         Reviewed by Chris Dumez.
2315
2316         * Shared/gtk/WebEventFactory.cpp:
2317         (WebKit::WebEventFactory::createWebMouseEvent):
2318         (WebKit::WebEventFactory::createWebWheelEvent):
2319         (WebKit::WebEventFactory::createWebKeyboardEvent):
2320         (WebKit::WebEventFactory::createWebTouchEvent):
2321         * Shared/wpe/WebEventFactory.cpp:
2322         (WebKit::wallTimeForEventTime):
2323         (WebKit::WebEventFactory::createWebKeyboardEvent):
2324         (WebKit::WebEventFactory::createWebMouseEvent):
2325         (WebKit::WebEventFactory::createWebWheelEvent):
2326         (WebKit::WebEventFactory::createWebTouchEvent):
2327
2328 2017-10-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2329
2330         [GTK][WPE] WebProcess should run cleanup on quit to release resources
2331         https://bugs.webkit.org/show_bug.cgi?id=168126
2332
2333         Reviewed by Michael Catanzaro.
2334
2335         Do not call exit on sync message send failure for GTK and WPE ports.
2336
2337         * WebProcess/WebProcess.cpp:
2338         (WebKit::WebProcess::initializeConnection):
2339
2340 2017-10-02  Ryosuke Niwa  <rniwa@webkit.org>
2341
2342         Move more code into PasteboardCustomData
2343         https://bugs.webkit.org/show_bug.cgi?id=177795
2344
2345         Reviewed by Wenson Hsieh.
2346
2347         Added the support for encoding and decoding the origin string in PasteboardCustomData.
2348
2349         * Shared/WebCoreArgumentCoders.cpp:
2350         (IPC::ArgumentCoder<PasteboardCustomData>::encode):
2351         (IPC::ArgumentCoder<PasteboardCustomData>::decode):
2352
2353 2017-10-02  Adrian Perez de Castro  <aperez@igalia.com>
2354
2355         [GTK] Do not hardcode font family in served remote inspector HTML snippets
2356         https://bugs.webkit.org/show_bug.cgi?id=177742
2357
2358         Reviewed by Carlos Garcia Campos.
2359
2360         Instead of hardcoding Cantarell as the font used for the HTML snippets served
2361         by the remote inspector handler, use "font: menu" to obtain the system UI
2362         font, plus a "font-size" rule for adjusting the size.
2363
2364         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
2365         (WebKit::RemoteInspectorProtocolHandler::handleRequest): Change the
2366         CSS rules in the served snippet.
2367
2368 2017-10-02  Joseph Pecoraro  <pecoraro@apple.com>
2369
2370         Web Inspector: Include Beacon and Ping requests in Network tab
2371         https://bugs.webkit.org/show_bug.cgi?id=177641
2372         <rdar://problem/33086839>
2373
2374         Reviewed by Chris Dumez.
2375
2376         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2377         (WebKit::NetworkConnectionToWebProcess::loadPing):
2378         (WebKit::NetworkConnectionToWebProcess::didFinishPingLoad):
2379         * NetworkProcess/NetworkConnectionToWebProcess.h:
2380         * NetworkProcess/PingLoad.cpp:
2381         (WebKit::PingLoad::PingLoad):
2382         (WebKit::PingLoad::didFinish):
2383         (WebKit::PingLoad::didReceiveResponseNetworkSession):
2384         * NetworkProcess/PingLoad.h:
2385         * WebProcess/Network/NetworkProcessConnection.cpp:
2386         (WebKit::NetworkProcessConnection::didFinishPingLoad):
2387         * WebProcess/Network/NetworkProcessConnection.h:
2388         * WebProcess/Network/NetworkProcessConnection.messages.in:
2389         * WebProcess/Network/WebLoaderStrategy.cpp:
2390         (WebKit::WebLoaderStrategy::networkProcessCrashed):
2391         (WebKit::WebLoaderStrategy::startPingLoad):
2392         (WebKit::WebLoaderStrategy::didFinishPingLoad):
2393         * WebProcess/Network/WebLoaderStrategy.h:
2394         Pass an optional ResourceResponse back to the ping completion handler.
2395
2396 2017-10-02  Alex Christensen  <achristensen@webkit.org>
2397
2398         REGRESSION: API tests WebKit.ProcessDidTerminateRequestedByClient and WebKit.ProcessDidTerminateWithReasonCrash are timing out
2399         https://bugs.webkit.org/show_bug.cgi?id=177764
2400
2401         Reviewed by Chris Dumez.
2402
2403         * UIProcess/API/C/WKPage.cpp:
2404         (WKPageSetPageNavigationClient):
2405         I shouldn't have reverted the A API telling the listener to continue if there's no client function.
2406
2407 2017-10-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2408
2409         [WPE][GTK] Crash in webkit_web_resource_get_data_finish()
2410         https://bugs.webkit.org/show_bug.cgi?id=177107
2411
2412         Reviewed by Michael Catanzaro.
2413
2414         Handle errors in webkit_web_resource_get_data() callback.
2415
2416         * UIProcess/API/glib/WebKitWebResource.cpp:
2417         (resourceDataCallback):
2418         (webkit_web_resource_get_data):
2419
2420 2017-10-02  Olivier Blin  <olivier.blin@softathome.com>
2421
2422         [WPE] Fix UIProcess build with GStreamer and without VIDEO
2423         https://bugs.webkit.org/show_bug.cgi?id=177753
2424
2425         Reviewed by Michael Catanzaro.
2426
2427         GStreamer builds fail when WebAudio is enabled but VIDEO disabled.
2428         This is the WPE counterpart of bug 153135.
2429
2430         * UIProcess/API/wpe/PageClientImpl.h:
2431
2432 2017-10-02  Alex Christensen  <achristensen@webkit.org>
2433
2434         Expose more WKPreferences SPI to match C SPI
2435         https://bugs.webkit.org/show_bug.cgi?id=177697
2436
2437         * UIProcess/API/Cocoa/WKPreferences.mm:
2438         (-[WKPreferences _javaEnabledForLocalFiles]):
2439         (-[WKPreferences _setPlugInsEnabled:]): Deleted.
2440         (-[WKPreferences _plugInsEnabled]): Deleted.
2441         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2442         _javaEnabledForLocalFiles should return the correct value.
2443         _plugInsEnabled has public API.  This SPI is not needed.
2444
2445 2017-10-02  Alex Christensen  <achristensen@webkit.org>
2446
2447         REGRESSION(r214201): WebProcess hangs during policy decisions
2448         https://bugs.webkit.org/show_bug.cgi?id=177590
2449         <rdar://problem/33362929>
2450
2451         Reviewed by Andy Estes.
2452
2453         This is like r222431 but for trunk instead of a branch.
2454         It includes the same regression API test so I don't make the same mistake again.
2455
2456         * UIProcess/API/C/WKPage.cpp:
2457         (WKPageSetPageNavigationClient):
2458         * UIProcess/WebPageProxy.cpp:
2459         (WebKit::WebPageProxy::receivedPolicyDecision):
2460         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2461         (WebKit::WebPageProxy::decidePolicyForResponseSync):
2462         * UIProcess/WebPageProxy.h:
2463         * UIProcess/WebPageProxy.messages.in:
2464         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2465         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2466         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
2467         (WebKit::WebFrameLoaderClient::applyToDocumentLoader):
2468         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2469         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2470         * WebProcess/WebPage/WebDocumentLoader.cpp:
2471         (WebKit::WebDocumentLoader::setNavigationID):
2472         * WebProcess/WebPage/WebFrame.cpp:
2473         (WebKit::WebFrame::setUpPolicyListener):
2474         (WebKit::WebFrame::invalidatePolicyListener):
2475         (WebKit::WebFrame::didReceivePolicyDecision):
2476         * WebProcess/WebPage/WebFrame.h:
2477         * WebProcess/WebPage/WebPage.cpp:
2478         (WebKit::WebPage::didReceivePolicyDecision):
2479         * WebProcess/WebPage/WebPage.h:
2480         * WebProcess/WebPage/WebPage.messages.in:
2481
2482 2017-10-02  Alex Christensen  <achristensen@webkit.org>
2483
2484         Remove unnecessary copy of SessionID in WebPageProxy
2485         https://bugs.webkit.org/show_bug.cgi?id=177702
2486
2487         Reviewed by Darin Adler.
2488
2489         * UIProcess/WebPageProxy.cpp:
2490         (WebKit::WebPageProxy::sessionID const):
2491         (WebKit::WebPageProxy::creationParameters):
2492         * UIProcess/WebPageProxy.h:
2493         (WebKit::WebPageProxy::sessionID const): Deleted.
2494
2495 2017-10-02  Alex Christensen  <achristensen@webkit.org>
2496
2497         Expose more WKPreferences SPI to match C SPI
2498         https://bugs.webkit.org/show_bug.cgi?id=177697
2499         <rdar://problem/24110556>
2500
2501         Reviewed by Darin Adler.
2502
2503         * UIProcess/API/Cocoa/WKPreferences.mm:
2504         (-[WKPreferences _setJavaEnabledForLocalFiles:]):
2505         (-[WKPreferences _javaEnabledForLocalFiles]):
2506         (-[WKPreferences _setCanvasUsesAcceleratedDrawing:]):
2507         (-[WKPreferences _canvasUsesAcceleratedDrawing]):
2508         (-[WKPreferences _setAcceleratedCompositingEnabled:]):
2509         (-[WKPreferences _acceleratedCompositingEnabled]):
2510         (-[WKPreferences _setDefaultTextEncodingName:]):
2511         (-[WKPreferences _defaultTextEncodingName]):
2512         (-[WKPreferences _setNeedsSiteSpecificQuirks:]):
2513         (-[WKPreferences _needsSiteSpecificQuirks]):
2514         (-[WKPreferences _setAuthorAndUserStylesEnabled:]):
2515         (-[WKPreferences _authorAndUserStylesEnabled]):
2516         (-[WKPreferences _setDOMTimersThrottlingEnabled:]):
2517         (-[WKPreferences _domTimersThrottlingEnabled]):
2518         (-[WKPreferences _setWebArchiveDebugModeEnabled:]):
2519         (-[WKPreferences _webArchiveDebugModeEnabled]):
2520         (-[WKPreferences _setLocalFileContentSniffingEnabled:]):
2521         (-[WKPreferences _localFileContentSniffingEnabled]):
2522         (-[WKPreferences _setUsesPageCache:]):
2523         (-[WKPreferences _usesPageCache]):
2524         (-[WKPreferences _setPageCacheSupportsPlugins:]):
2525         (-[WKPreferences _pageCacheSupportsPlugins]):
2526         (-[WKPreferences _setShouldPrintBackgrounds:]):
2527         (-[WKPreferences _shouldPrintBackgrounds]):
2528         (-[WKPreferences _setWebSecurityEnabled:]):
2529         (-[WKPreferences _webSecurityEnabled]):
2530         (-[WKPreferences _setUniversalAccessFromFileURLsAllowed:]):
2531         (-[WKPreferences _universalAccessFromFileURLsAllowed]):
2532         (-[WKPreferences _setAVFoundationEnabled:]):
2533         (-[WKPreferences _avFoundationEnabled]):
2534         (-[WKPreferences _setSuppressesIncrementalRendering:]):
2535         (-[WKPreferences _suppressesIncrementalRendering]):
2536         (-[WKPreferences _setAsynchronousPluginInitializationEnabled:]):
2537         (-[WKPreferences _asynchronousPluginInitializationEnabled]):
2538         (-[WKPreferences _setArtificialPluginInitializationDelayEnabled:]):
2539         (-[WKPreferences _artificialPluginInitializationDelayEnabled]):
2540         (-[WKPreferences _setCookieEnabled:]):
2541         (-[WKPreferences _cookieEnabled]):
2542         (-[WKPreferences _setPlugInSnapshottingEnabled:]):
2543         (-[WKPreferences _plugInSnapshottingEnabled]):
2544         (-[WKPreferences _setQTKitEnabled:]):
2545         (-[WKPreferences _qtKitEnabled]):
2546         (-[WKPreferences _setSubpixelCSSOMElementMetricsEnabled:]):
2547         (-[WKPreferences _subpixelCSSOMElementMetricsEnabled]):
2548         (-[WKPreferences _setMediaSourceEnabled:]):
2549         (-[WKPreferences _mediaSourceEnabled]):
2550         (-[WKPreferences _setViewGestureDebuggingEnabled:]):
2551         (-[WKPreferences _viewGestureDebuggingEnabled]):
2552         (-[WKPreferences _setCSSAnimationTriggersEnabled:]):
2553         (-[WKPreferences _cssAnimationTriggersEnabled]):
2554         (-[WKPreferences _setStandardFontFamily:]):
2555         (-[WKPreferences _standardFontFamily]):
2556         (-[WKPreferences _setNotificationsEnabled:]):
2557         (-[WKPreferences _notificationsEnabled]):
2558         (-[WKPreferences _setBackspaceKeyNavigationEnabled:]):
2559         (-[WKPreferences _backspaceKeyNavigationEnabled]):
2560         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2561
2562 2017-10-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2563
2564         [GTK][WPE] Enable interactive forms validation by default
2565         https://bugs.webkit.org/show_bug.cgi?id=177737
2566
2567         Reviewed by Michael Catanzaro.
2568
2569         It's currently disabled for no reason.
2570
2571         * Shared/WebPreferencesDefinitions.h:
2572
2573 2017-10-02  Michael Catanzaro  <mcatanzaro@igalia.com>
2574
2575         Remove ENABLE_CSS_REGIONS
2576         https://bugs.webkit.org/show_bug.cgi?id=177689
2577
2578         Reviewed by Darin Adler.
2579
2580         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
2581         (webkit_dom_element_get_webkit_region_overset):
2582         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.h:
2583         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
2584         (webkit_dom_element_get_webkit_region_overset): Deleted.
2585         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
2586
2587 2017-09-30  Darin Adler  <darin@apple.com>
2588
2589         Have IPC::Connection::Client objects consistently invalidate the connection when destroyed
2590         https://bugs.webkit.org/show_bug.cgi?id=177708
2591
2592         Reviewed by Anders Carlsson.
2593
2594         I ran into an intermittent crash when running regression tests. It looked like a connection
2595         client was being called after it was destroyed. I did an audit of the all the connection
2596         clients to make sure they all invalidate their connection before they are destroyed.
2597
2598         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2599         (WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess): Invalidate the
2600         connection since this object opened the connection. There is no obvious
2601         guarantee that the connection will already be invalid when this is destroyed.
2602         * StorageProcess/StorageToWebProcessConnection.cpp:
2603         (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection): Ditto.
2604         * UIProcess/Plugins/PluginProcessProxy.cpp:
2605         (WebKit::PluginProcessProxy::~PluginProcessProxy): Ditto.
2606         * WebProcess/Network/NetworkProcessConnection.cpp:
2607         (WebKit::NetworkProcessConnection::~NetworkProcessConnection): Ditto.
2608         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
2609         (WebKit::WebToStorageProcessConnection::~WebToStorageProcessConnection): Ditto.
2610
2611         * StorageProcess/StorageToWebProcessConnection.h: Derive privately rather than publicly
2612         from IPC::Connection::Client because we can, and this means we don't have to study quite
2613         as much code to understand how this is used as a connection client.
2614         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: Ditto.
2615         * WebProcess/Storage/WebToStorageProcessConnection.h: Ditto.
2616         * WebProcess/WebPage/WebInspector.h: Ditto.
2617         * WebProcess/WebPage/WebInspectorUI.h: Ditto.
2618
2619         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2620         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer): Added a comment about a
2621         reference cycle cycle leading to a leak that I believe exists here.
2622
2623 2017-09-29  Alex Christensen  <achristensen@webkit.org>
2624
2625         REGRESSION: ASSERTION FAILED: m_provisionalURL.isEmpty() in WebKit::FrameLoadState::didStartProvisionalLoad
2626         https://bugs.webkit.org/show_bug.cgi?id=177491
2627
2628         Reviewed by Andy Estes.
2629
2630         * WebProcess/WebPage/WebFrame.cpp:
2631         (WebKit::WebFrame::setUpWillSubmitFormListener):
2632         (WebKit::WebFrame::continueWillSubmitForm):
2633         (WebKit::WebFrame::invalidatePolicyListener):
2634         Speculative fix for a flaky assertion.
2635         Restore the clearing of the policy listeners we used to have when form submission was treated as a policy.
2636
2637 2017-09-29  Chris Dumez  <cdumez@apple.com>
2638
2639         http/tests/preconnect/link-rel-preconnect-https.html is flaky
2640         https://bugs.webkit.org/show_bug.cgi?id=177673
2641
2642         Reviewed by Alex Christensen.
2643
2644         Update PreconnectTask to query the client when a certificate needs to be
2645         validated. This allows WebKitTestRunner to ignore invalid certificates
2646         and this causes http/tests/preconnect/link-rel-preconnect-https.html
2647         to pass consistently.
2648
2649         To avoid duplicating code, PreconnectTask now uses NetworkLoad internally
2650         instead of using a NetworkDataTask directly.
2651
2652         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2653         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
2654         * NetworkProcess/NetworkConnectionToWebProcess.h:
2655         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2656         * NetworkProcess/NetworkLoad.h:
2657         * NetworkProcess/NetworkProcess.cpp:
2658         (WebKit::generateCanAuthenticateIdentifier):
2659         (WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace):
2660         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace):
2661         (WebKit::NetworkProcess::preconnectTo):
2662         * NetworkProcess/NetworkProcess.h:
2663         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2664         (WebKit::NetworkResourceLoadParameters::encode const):
2665         (WebKit::NetworkResourceLoadParameters::decode):
2666         * NetworkProcess/PreconnectTask.cpp:
2667         (WebKit::PreconnectTask::PreconnectTask):
2668         (WebKit::PreconnectTask::~PreconnectTask):
2669         (WebKit::PreconnectTask::willSendRedirectedRequest):
2670         (WebKit::PreconnectTask::didReceiveResponse):
2671         (WebKit::PreconnectTask::didReceiveBuffer):
2672         (WebKit::PreconnectTask::didFinishLoading):
2673         (WebKit::PreconnectTask::didFailLoading):
2674         (WebKit::PreconnectTask::didSendData):
2675         (WebKit::PreconnectTask::canAuthenticateAgainstProtectionSpaceAsync):
2676         (WebKit::PreconnectTask::continueCanAuthenticateAgainstProtectionSpace):
2677         (WebKit::PreconnectTask::frameID const):
2678         (WebKit::PreconnectTask::pageID const):
2679         * NetworkProcess/PreconnectTask.h:
2680         * WebProcess/Network/WebLoaderStrategy.cpp:
2681         (WebKit::WebLoaderStrategy::preconnectTo):
2682         * WebProcess/Network/WebLoaderStrategy.h:
2683
2684 2017-09-29  Alex Christensen  <achristensen@webkit.org>
2685
2686         Expose WebPreferences::webGLEnabled through WKPreferences
2687         https://bugs.webkit.org/show_bug.cgi?id=177692
2688         <rdar://problem/24110556>
2689
2690         Reviewed by Andy Estes.
2691
2692         * UIProcess/API/Cocoa/WKPreferences.mm:
2693         (-[WKPreferences _setWebGLEnabled:]):
2694         (-[WKPreferences _webGLEnabled]):
2695         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2696
2697 2017-09-29  Chris Dumez  <cdumez@apple.com>
2698
2699         [WK2][NETWORK_SESSION] Move some authentication-related code to avoid duplication
2700         https://bugs.webkit.org/show_bug.cgi?id=177667
2701
2702         Reviewed by Alex Christensen.
2703
2704         Move some authentication-related code to avoid duplication.
2705         This is a preparation code supporting Download authentication
2706         as Download uses a NSURLSessionDownloadTask and not a
2707         NetworkDataTask.
2708
2709         * NetworkProcess/NetworkDataTask.h:
2710         (WebKit::NetworkDataTask::setSuggestedFilename):
2711         * NetworkProcess/NetworkLoad.cpp:
2712         (WebKit::NetworkLoad::didReceiveChallenge):
2713         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
2714         * NetworkProcess/NetworkSession.cpp:
2715         (WebKit::NetworkSession::allowsSpecificHTTPSCertificateForHost):
2716         * NetworkProcess/NetworkSession.h:
2717         * NetworkProcess/PreconnectTask.cpp:
2718         (WebKit::PreconnectTask::didReceiveChallenge):
2719         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2720         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2721         (WebKit::NetworkDataTaskCocoa::didReceiveChallenge):
2722         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
2723         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2724         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
2725         (WebKit::certificatesMatch):
2726         (WebKit::NetworkSessionCocoa::allowsSpecificHTTPSCertificateForHost):
2727
2728 2017-09-29  Alex Christensen  <achristensen@webkit.org>
2729
2730         Fix WKWebViewConfigurationPrivate after r222663
2731         https://bugs.webkit.org/show_bug.cgi?id=177644
2732
2733         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2734         (-[WKWebViewConfiguration init]):
2735         (-[WKWebViewConfiguration copyWithZone:]):
2736         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2737
2738 2017-09-29  Chris Dumez  <cdumez@apple.com>
2739
2740         Split some logic out of VisitedLinkStore and make it reusable
2741         https://bugs.webkit.org/show_bug.cgi?id=177575
2742
2743         Reviewed by Alex Christensen.
2744
2745         Split some logic out of VisitedLinkStore and make it reusable for other purposes than
2746         visited links and from other processes than the UIProcess.
2747
2748         The plan is to reuse the new SharedStringHashStore for Service Worker registration
2749         on StorageProcess side and querying on WebContent process side.
2750
2751         * CMakeLists.txt:
2752         * Shared/SharedStringHashStore.cpp: Added.
2753         (WebKit::nextPowerOf2):
2754         (WebKit::tableSizeForKeyCount):
2755         (WebKit::SharedStringHashStore::SharedStringHashStore):
2756         (WebKit::SharedStringHashStore::createSharedMemoryHandle):
2757         (WebKit::SharedStringHashStore::add):
2758         (WebKit::SharedStringHashStore::clear):
2759         (WebKit::SharedStringHashStore::resizeTable):
2760         (WebKit::SharedStringHashStore::pendingSharedStringHashesTimerFired):
2761         * Shared/SharedStringHashStore.h: Copied from Source/WebKit/WebProcess/WebPage/VisitedLinkTableController.h.
2762         (WebKit::SharedStringHashStore::Client::~Client):
2763         (WebKit::SharedStringHashStore::isEmpty const):
2764         * Shared/SharedStringHashTable.cpp: Renamed from Source/WebKit/Shared/VisitedLinkTable.cpp.
2765         (WebKit::SharedStringHashTable::SharedStringHashTable):
2766         (WebKit::SharedStringHashTable::~SharedStringHashTable):
2767         (WebKit::SharedStringHashTable::setSharedMemory):
2768         (WebKit::SharedStringHashTable::add):
2769         (WebKit::SharedStringHashTable::contains const):
2770         (WebKit::SharedStringHashTable::clear):
2771         * Shared/SharedStringHashTable.h: Renamed from Source/WebKit/Shared/VisitedLinkTable.h.
2772         * UIProcess/API/C/WKContext.cpp:
2773         (WKContextAddVisitedLink):
2774         * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm:
2775         (-[_WKVisitedLinkStore addVisitedLinkWithURL:]):
2776         * UIProcess/VisitedLinkStore.cpp:
2777         (WebKit::VisitedLinkStore::VisitedLinkStore):
2778         (WebKit::VisitedLinkStore::addProcess):
2779         (WebKit::VisitedLinkStore::addVisitedLinkHash):
2780         (WebKit::VisitedLinkStore::removeAll):
2781         (WebKit::VisitedLinkStore::addVisitedLinkHashFromPage):
2782         (WebKit::VisitedLinkStore::sendStoreHandleToProcess):
2783         (WebKit::VisitedLinkStore::didInvalidateSharedMemory):
2784         (WebKit::VisitedLinkStore::didAddSharedStringHashes):
2785         * UIProcess/VisitedLinkStore.h:
2786         * UIProcess/WebProcessPool.cpp:
2787         * UIProcess/WebProcessPool.h:
2788         * UIProcess/WebProcessProxy.h:
2789         * WebKit.xcodeproj/project.pbxproj:
2790         * WebProcess/WebPage/VisitedLinkTableController.cpp:
2791         (WebKit::VisitedLinkTableController::isLinkVisited):
2792         (WebKit::VisitedLinkTableController::addVisitedLink):
2793         (WebKit::VisitedLinkTableController::visitedLinkStateChanged):
2794         * WebProcess/WebPage/VisitedLinkTableController.h:
2795         * WebProcess/WebPage/VisitedLinkTableController.messages.in:
2796
2797 2017-09-28  Alex Christensen  <achristensen@webkit.org>
2798
2799         Add WKWebViewConfiguration SPI equivalent to WKPageConfigurationSetBackgroundCPULimit
2800         https://bugs.webkit.org/show_bug.cgi?id=177644
2801         <rdar://problem/34338698>
2802
2803         Reviewed by Geoffrey Garen.
2804
2805         WKPageConfigurationSetBackgroundCPULimit is a setter of a std::optional<double> with no accessor.
2806         It's never set to 0 in practice, so I guess the ObjC equivalent is a double that is zero or nonzero.
2807
2808         * UIProcess/API/Cocoa/WKWebView.mm:
2809         (-[WKWebView _initializeWithConfiguration:]):
2810         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2811         (-[WKWebViewConfiguration _setCPULimit:]):
2812         (-[WKWebViewConfiguration _cpuLimit]):
2813         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2814
2815 2017-09-28  Ryosuke Niwa  <rniwa@webkit.org>
2816
2817         Image pasting is not working on tineye.com / gmail.com / GitHub.com due to lack of support for DataTransfer.items
2818         https://bugs.webkit.org/show_bug.cgi?id=170449
2819         <rdar://problem/31432525>
2820
2821         Reviewed by Wenson Hsieh.
2822
2823         Add sandbox extensions for files in the pasteboard to make copying & pasting image files work.
2824         This is what we do for drag & drop but we should consider adding a mechanism to rekoke the extension in the future.
2825
2826         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2827         (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType): Add sandbox extensions to the pasted files.
2828         * UIProcess/WebPasteboardProxy.h:
2829         * UIProcess/WebPasteboardProxy.messages.in:
2830         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2831         (WebKit::WebPlatformStrategies::getPathnamesForType): Consume the sandbox tokens sent by the UI process permanently
2832         since WebCore will now create File objects for these pasted files.
2833
2834 2017-09-29  Wenson Hsieh  <wenson_hsieh@apple.com>
2835
2836         [iOS WK2] Implement -[WKContentView hasText] for compatibility with the UITextInput protocol
2837         https://bugs.webkit.org/show_bug.cgi?id=177662
2838         <rdar://problem/33410373>
2839
2840         Reviewed by Tim Horton.
2841
2842         Implements -[WKContentView hasText] by propagating a flag through post-layout editor state.
2843
2844         * Shared/EditorState.cpp:
2845         (WebKit::EditorState::PostLayoutData::encode const):
2846         (WebKit::EditorState::PostLayoutData::decode):
2847         * Shared/EditorState.h:
2848
2849         Add a new flag to EditorState indicating whether or not the current editable root containing the selection has
2850         any plain text. Add IPC support for this new flag.
2851
2852         * UIProcess/ios/WKContentViewInteraction.mm:
2853         (-[WKContentView hasText]):
2854         * WebProcess/WebPage/ios/WebPageIOS.mm:
2855         (WebKit::computeEditableRootHasContentAndPlainText):
2856
2857         Add a new helper to compute whether or not the editable root has any content, and any plain text. This
2858         is used as the last cached value for -hasText on WKContentView that we will deliver to UIKit. Some important
2859         things to note here:
2860         - If post layout data already indicates that we have selected some plain text, or that there is a plain text
2861           character near the selection, just set the flags to true and bail, since the editable root necessarily has
2862           content that is plain text.
2863         - If hasContent is false, don't even bother computing hasPlainText, because it must also be false.
2864         - Otherwise, use hasAnyPlainText to compute the value of hasPlainText, which is a faster variant of plainText.
2865         These optimizations help us avoid doing extra work at all when running Speedometer, apart from checking the
2866         values of a few PostLayoutData flags. This also fixes the value of hasContent, which was previously always false
2867         if we had a range selection rather than a caret selection even when the editable root has content, because the
2868         logic to compute the value of hasContent only existed in the branch where we have a caret selection.
2869
2870         (WebKit::WebPage::platformEditorState const):
2871
2872 2017-09-28  Timothy Horton  <timothy_horton@apple.com>
2873
2874         Fix the macOS CMake build
2875
2876         * CMakeLists.txt:
2877
2878 2017-09-28  Timothy Horton  <timothy_horton@apple.com>
2879
2880         Revise deployment target macros from r222620
2881
2882         Rubber-stamped by Wenson Hsieh.
2883
2884         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
2885         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2886         (WebKit::PDFPlugin::pdfDocumentDidLoad):
2887
2888 2017-09-28  Aishwarya Nirmal  <anirmal@apple.com>
2889
2890         Request for PDF URL targets for specific pages, sections, etc.
2891         https://bugs.webkit.org/show_bug.cgi?id=177582
2892         <rdar://problem/5692679>
2893
2894         Reviewed by Tim Horton.
2895         
2896         This change sets the URL fragment for scroll anchoring in PDFs.
2897
2898         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
2899         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2900         (WebKit::PDFPlugin::pdfDocumentDidLoad):
2901
2902 2017-09-28  Ross Kirsling  <ross.kirsling@sony.com>
2903
2904         [PAL] Move HysteresisActivity into PAL
2905         https://bugs.webkit.org/show_bug.cgi?id=177516
2906
2907         Reviewed by Alex Christensen.
2908
2909         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2910         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::PendingFrameLoad):
2911         * Shared/WebSQLiteDatabaseTracker.cpp:
2912         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
2913         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
2914         * Shared/WebSQLiteDatabaseTracker.h:
2915         * WebProcess/WebPage/WebPage.cpp:
2916         (WebKit::m_pageScrolledHysteresis):
2917         (WebKit::m_userActivityHysteresis):
2918         (WebKit::WebPage::updateUserActivity):
2919         * WebProcess/WebPage/WebPage.h:
2920         * WebProcess/WebProcess.cpp:
2921         (WebKit::WebProcess::WebProcess):
2922         * WebProcess/WebProcess.h:
2923
2924 2017-09-28  Chris Dumez  <cdumez@apple.com>
2925
2926         Add support for <link rel=preconnect>
2927         https://bugs.webkit.org/show_bug.cgi?id=177474
2928         <rdar://problem/33141380>
2929
2930         Reviewed by Alex Christensen.
2931
2932         Add support for <link rel=preconnect>:
2933         - https://w3c.github.io/resource-hints/#preconnect
2934
2935         Also add corresponding native private API.
2936
2937         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2938         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
2939         (WebKit::NetworkConnectionToWebProcess::didFinishPreconnection):
2940         * NetworkProcess/NetworkConnectionToWebProcess.h:
2941         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2942         * NetworkProcess/NetworkDataTask.cpp:
2943         (WebKit::NetworkDataTask::create):
2944         * NetworkProcess/NetworkLoadParameters.h:
2945         * NetworkProcess/NetworkProcess.cpp:
2946         (WebKit::NetworkProcess::preconnectTo):
2947         * NetworkProcess/NetworkProcess.h:
2948         * NetworkProcess/NetworkProcess.messages.in:
2949         * NetworkProcess/PreconnectTask.cpp: Added.
2950         (WebKit::PreconnectTask::PreconnectTask):
2951         (WebKit::PreconnectTask::~PreconnectTask):
2952         (WebKit::PreconnectTask::willPerformHTTPRedirection):
2953         (WebKit::PreconnectTask::didReceiveChallenge):
2954         (WebKit::PreconnectTask::didReceiveResponseNetworkSession):
2955         (WebKit::PreconnectTask::didReceiveData):
2956         (WebKit::PreconnectTask::didCompleteWithError):
2957         (WebKit::PreconnectTask::didSendData):
2958         (WebKit::PreconnectTask::wasBlocked):
2959         (WebKit::PreconnectTask::cannotShowURL):
2960         (WebKit::PreconnectTask::didFinish):
2961         * NetworkProcess/PreconnectTask.h: Copied from Source/WebKit/NetworkProcess/NetworkLoadParameters.h.
2962         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2963         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2964         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
2965         * Shared/WebCoreArgumentCoders.h:
2966         * Shared/WebPreferencesDefinitions.h:
2967         * UIProcess/API/C/WKContext.cpp:
2968         (WKContextPreconnectToServer):
2969         * UIProcess/API/C/WKContextPrivate.h:
2970         * UIProcess/API/Cocoa/WKProcessPool.mm:
2971         (-[WKProcessPool _preconnectToServer:]):
2972         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2973         * UIProcess/WebProcessPool.cpp:
2974         (WebKit::WebProcessPool::preconnectToServer):
2975         * UIProcess/WebProcessPool.h:
2976         * WebKit.xcodeproj/project.pbxproj:
2977         * WebProcess/Network/NetworkProcessConnection.cpp:
2978         (WebKit::NetworkProcessConnection::didFinishPreconnection):
2979         * WebProcess/Network/NetworkProcessConnection.h:
2980         * WebProcess/Network/NetworkProcessConnection.messages.in:
2981         * WebProcess/Network/WebLoaderStrategy.cpp:
2982         (WebKit::WebLoaderStrategy::networkProcessCrashed):
2983         (WebKit::generateLoadIdentifier):
2984         (WebKit::WebLoaderStrategy::startPingLoad):
2985         (WebKit::WebLoaderStrategy::preconnectTo):
2986         (WebKit::WebLoaderStrategy::didFinishPreconnection):
2987         * WebProcess/Network/WebLoaderStrategy.h:
2988         * WebProcess/WebPage/WebPage.cpp:
2989         (WebKit::WebPage::updatePreferences):
2990         * config.h:
2991
2992 2017-09-28  Zan Dobersek  <zdobersek@igalia.com>
2993
2994         [Cairo] Remove the cairo_glyph_t complexity from GlyphBuffer
2995         https://bugs.webkit.org/show_bug.cgi?id=177598
2996
2997         Reviewed by Carlos Garcia Campos.
2998
2999         * Shared/API/c/cairo/WKImageCairo.cpp: Explicitly include the <cairo.h>
3000         header here now that it's not included in GlyphBuffer.h.
3001         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp: Ditto.
3002
3003 2017-09-27  Alex Christensen  <achristensen@webkit.org>
3004
3005         Add WKContentRuleList notify action type
3006         https://bugs.webkit.org/show_bug.cgi?id=177013
3007         <rdar://problem/31073936>
3008
3009         Reviewed by Darin Adler.
3010
3011         * NetworkProcess/PingLoad.cpp:
3012         (WebKit::PingLoad::processContentExtensionRulesForLoad):
3013         * UIProcess/API/APINavigationClient.h:
3014         (API::NavigationClient::contentRuleListNotification):
3015         * UIProcess/API/C/WKPage.cpp:
3016         (WKPageSetPageNavigationClient):
3017         * UIProcess/API/C/WKPageNavigationClient.h:
3018         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3019         * UIProcess/Cocoa/NavigationState.h:
3020         * UIProcess/Cocoa/NavigationState.mm:
3021         (WebKit::NavigationState::setNavigationDelegate):
3022         (WebKit::NavigationState::NavigationClient::contentRuleListNotification):
3023         * UIProcess/WebPageProxy.cpp:
3024         (WebKit::WebPageProxy::contentRuleListNotification):
3025         * UIProcess/WebPageProxy.h:
3026         * UIProcess/WebPageProxy.messages.in:
3027         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3028         (WebKit::WebChromeClient::contentRuleListNotification):
3029         * WebProcess/WebCoreSupport/WebChromeClient.h:
3030
3031 2017-09-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3032
3033         Drag event DataTransfer has unexpected types "dyn.ah62d4..."
3034         https://bugs.webkit.org/show_bug.cgi?id=172526
3035         <rdar://problem/32396081>
3036
3037         Reviewed by Ryosuke Niwa.
3038
3039         Add boilerplate plumbing and encoder/decoder support for new pasteboard codepaths. See WebCore ChangeLog for
3040         more details.
3041
3042         * Scripts/webkit/messages.py:
3043         (headers_for_type):
3044         * Shared/WebCoreArgumentCoders.cpp:
3045         (IPC::ArgumentCoder<PasteboardCustomData>::encode):
3046         (IPC::ArgumentCoder<PasteboardCustomData>::decode):
3047
3048         Add encoder/decoder support for PasteboardCustomData.
3049
3050         (IPC::ArgumentCoder<PasteboardWebContent>::encode):
3051         (IPC::ArgumentCoder<PasteboardWebContent>::decode):
3052
3053         Encode and decode dataInHTMLFormat.
3054
3055         * Shared/WebCoreArgumentCoders.h:
3056         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
3057         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
3058         (WebKit::WebPasteboardProxy::writeCustomData):
3059         * UIProcess/WebPasteboardProxy.cpp:
3060         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
3061         (WebKit::WebPasteboardProxy::writeCustomData):
3062         * UIProcess/WebPasteboardProxy.h:
3063         * UIProcess/WebPasteboardProxy.messages.in:
3064         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3065         (WebKit::WebPlatformStrategies::typesSafeForDOMToReadAndWrite):
3066         (WebKit::WebPlatformStrategies::writeCustomData):
3067         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3068
3069 2017-09-27  Alex Christensen  <achristensen@webkit.org>
3070
3071         Allow modern decoding of std::optional<T>
3072         https://bugs.webkit.org/show_bug.cgi?id=177519
3073
3074         Reviewed by Tim Horton.
3075
3076         * Platform/IPC/ArgumentCoders.h:
3077         (IPC::ArgumentCoder<std::optional<T>>::decode):
3078         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
3079         (IPC::ArgumentCoder<WebCore::PaymentAuthorizationResult>::decode):
3080         (IPC::ArgumentCoder<WebCore::PaymentError>::decode):
3081         (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):
3082         (IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::decode):
3083         (IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::decode):
3084         * Shared/WebCoreArgumentCoders.cpp:
3085         (IPC::ArgumentCoder<IntPoint>::decode):
3086         (IPC::ArgumentCoder<IntSize>::decode):
3087         * Shared/WebCoreArgumentCoders.h:
3088         * Shared/WebPageCreationParameters.cpp:
3089         (WebKit::WebPageCreationParameters::decode):
3090
3091 2017-09-27  Commit Queue  <commit-queue@webkit.org>
3092
3093         Unreviewed, rolling out r222541.
3094         https://bugs.webkit.org/show_bug.cgi?id=177580
3095
3096         WebCore isn't ready for the asynchronousness this was going to
3097         enable (Requested by alexchristensen on #webkit).
3098
3099         Reverted changeset:
3100
3101         "Pass a completion handler instead of a
3102         WebFramePolicyListenerProxy during policy decisions"
3103         https://bugs.webkit.org/show_bug.cgi?id=177509
3104         http://trac.webkit.org/changeset/222541
3105
3106 2017-09-27  Tina Liu  <iting_liu@apple.com>
3107
3108         Expose setShouldSuppressFirstResponderChanges() as WKView SPI
3109         https://bugs.webkit.org/show_bug.cgi?id=177513
3110         <rdar://problem/34669220>
3111
3112         Reviewed by Wenson Hsieh.
3113
3114         We already have setShouldSuppressFirstResponderChanges() SPI on WKWebView; Expose it on
3115         WKView as well for clients using legacy WebKit.
3116
3117         * UIProcess/API/Cocoa/WKViewPrivate.h:
3118         * UIProcess/API/mac/WKView.mm:
3119         (-[WKView _setShouldSuppressFirstResponderChanges:]):
3120
3121 2017-09-27  Chris Dumez  <cdumez@apple.com>
3122
3123         Have PingLoad take a CompletionHandler
3124         https://bugs.webkit.org/show_bug.cgi?id=177549
3125
3126         Reviewed by Youenn Fablet.
3127
3128         Have PingLoad take a CompletionHandler instead of relying on it calling on method on the
3129         NetworkConnectionToWebProcess when it is done.
3130
3131         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3132         (WebKit::NetworkConnectionToWebProcess::loadPing):
3133         * NetworkProcess/PingLoad.cpp:
3134         (WebKit::PingLoad::PingLoad):
3135         (WebKit::PingLoad::didFinish):
3136         * NetworkProcess/PingLoad.h:
3137
3138 2017-09-26  Alex Christensen  <achristensen@webkit.org>
3139
3140         Pass a completion handler instead of a WebFramePolicyListenerProxy during policy decisions
3141         https://bugs.webkit.org/show_bug.cgi?id=177509
3142
3143         Reviewed by Tim Horton.
3144
3145         This makes WebFramePolicyListenerProxy just a wrapper around a WTF::Function which is only needed for the C and glib APIs.
3146         This is a step towards making WebPageProxy::DecidePolicyForResponseSync and WebPageProxy::DecidePolicyForNavigationAction asynchronous.
3147
3148         This patch has no change in behavior.
3149
3150         * CMakeLists.txt:
3151         * UIProcess/API/APINavigationClient.h:
3152         (API::NavigationClient::decidePolicyForNavigationAction):
3153         (API::NavigationClient::decidePolicyForNavigationResponse):
3154         * UIProcess/API/APIPolicyClient.h:
3155         (API::PolicyClient::decidePolicyForNavigationAction):
3156         (API::PolicyClient::decidePolicyForNewWindowAction):
3157         (API::PolicyClient::decidePolicyForResponse):
3158         * UIProcess/API/C/WKFramePolicyListener.cpp:
3159         (WKFramePolicyListenerUseWithPolicies):
3160         * UIProcess/API/C/WKPage.cpp:
3161         (WKPageSetPagePolicyClient):
3162         (WKPageSetPageNavigationClient):
3163         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
3164         * UIProcess/API/glib/WebKitPolicyClient.cpp:
3165         * UIProcess/Automation/WebAutomationSession.cpp:
3166         * UIProcess/Cocoa/NavigationState.h:
3167         * UIProcess/Cocoa/NavigationState.mm:
3168         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
3169         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
3170         * UIProcess/Cocoa/WebViewImpl.mm:
3171         * UIProcess/RemoteWebInspectorProxy.cpp:
3172         * UIProcess/WebFormSubmissionListenerProxy.h:
3173         * UIProcess/WebFrameListenerProxy.cpp: Removed.
3174         * UIProcess/WebFrameListenerProxy.h: Removed.
3175         * UIProcess/WebFramePolicyListenerProxy.cpp:
3176         (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
3177         (WebKit::WebFramePolicyListenerProxy::~WebFramePolicyListenerProxy):
3178         (WebKit::WebFramePolicyListenerProxy::create):
3179         (WebKit::WebFramePolicyListenerProxy::use):
3180         (WebKit::WebFramePolicyListenerProxy::download):
3181         (WebKit::WebFramePolicyListenerProxy::ignore):
3182         * UIProcess/WebFramePolicyListenerProxy.h:
3183         (WebKit::WebFramePolicyListenerProxy::create): Deleted.
3184         (): Deleted.
3185         (WebKit::WebFramePolicyListenerProxy::operator new): Deleted.
3186         * UIProcess/WebFrameProxy.cpp:
3187         (WebKit::WebFrameProxy::webProcessWillShutDown):
3188         (WebKit::WebFrameProxy::receivedPolicyDecision): Deleted.
3189         (WebKit::WebFrameProxy::setUpPolicyListenerProxy): Deleted.
3190         * UIProcess/WebFrameProxy.h:
3191         * UIProcess/WebInspectorProxy.cpp:
3192         * UIProcess/WebPageProxy.cpp:
3193         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3194         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
3195         (WebKit::WebPageProxy::decidePolicyForResponseSync):
3196         (WebKit::WebPageProxy::receivedPolicyDecision): Deleted.
3197         (WebKit::WebPageProxy::decidePolicyForResponse): Deleted.
3198         * UIProcess/WebPageProxy.h:
3199         * UIProcess/mac/ViewGestureControllerMac.mm:
3200         * WebKit.xcodeproj/project.pbxproj:
3201
3202 2017-09-26  Brian Burg  <bburg@apple.com>
3203
3204         Web Automation: overflow:hidden elements with no children are mistakenly reported as not visible
3205         https://bugs.webkit.org/show_bug.cgi?id=177514
3206         <rdar://problem/31936291>
3207
3208         Reviewed by Joseph Pecoraro.
3209
3210         * UIProcess/Automation/atoms/ElementDisplayed.js:
3211         (isShown.isElementSubtreeHiddenByOverflow):
3212         Array.prototype.every returns true when passed an empty list, so we need
3213         to check for the case where the element has no children and return 'false'.
3214
3215 2017-09-26  Youenn Fablet  <youenn@apple.com>
3216
3217         [Cocoa] Add a modern WKPreferences switch to disable WebRTC
3218         https://bugs.webkit.org/show_bug.cgi?id=176638
3219         <rdar://problem/34335158>
3220
3221         Reviewed by Alex Christensen.
3222
3223         * UIProcess/API/Cocoa/WKPreferences.mm:
3224         (-[WKPreferences _peerConnectionEnabled]):
3225         (-[WKPreferences _setPeerConnectionEnabled:]):
3226         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3227
3228 2017-09-26  Brent Fulgham  <bfulgham@apple.com>
3229
3230         Harden our access to the vector of URL schemes.
3231         https://bugs.webkit.org/show_bug.cgi?id=177470
3232         <rdar://problem/33881522>
3233
3234         Reviewed by Chris Dumez.
3235
3236         Instead of asserting, use MESSAGE_CHECK so that we actually refuse to access an invalid iterator.
3237
3238         * UIProcess/WebPageProxy.cpp:
3239         (WebKit::WebPageProxy::startURLSchemeTask):
3240         (WebKit::WebPageProxy::stopURLSchemeTask):
3241
3242 2017-09-26  Jer Noble  <jer.noble@apple.com>
3243
3244         Thrown ObjC exception when right clicking on <img> containing mp4 link
3245         https://bugs.webkit.org/show_bug.cgi?id=177370
3246
3247         Reviewed by Darin Adler.
3248
3249         Creating a NSImage from mp4 data will fail and return nil; do a nil-check before attempting
3250         to put the results into a NSMutableArray.
3251
3252         * UIProcess/mac/WebContextMenuProxyMac.mm:
3253         (WebKit::WebContextMenuProxyMac::createShareMenuItem):
3254
3255 2017-09-26  Brian Burg  <bburg@apple.com>
3256
3257         Web Automation: add commands to get and set user permissions for pages in an automation session
3258         https://bugs.webkit.org/show_bug.cgi?id=177405
3259         <rdar://problem/34493846>
3260
3261         Reviewed by Joseph Pecoraro.
3262
3263         To test some Web APIs via WebDriver, it needs to be possible to simulate a user accepting or
3264         denying requests for elevated permissions, such as getUserMedia() or geolocation.
3265
3266         This patch adds a generic way for a test to configure the automation session's
3267         simulated user action that will happen every time a specific permission is requested.
3268         A test can set a "session permission", trigger the permission request via Web API,
3269         and then verify that the page behaves correctly when the user accepted or denied the request.
3270
3271         A proposal will follow shortly to expose this functionality via a new REST API endpoint.
3272
3273         * UIProcess/Automation/Automation.json: Add get/set commands.
3274
3275         * UIProcess/Automation/WebAutomationSession.cpp:
3276         (WebKit::WebAutomationSession::getSessionPermissions):
3277         (WebKit::WebAutomationSession::setSessionPermissions):
3278         For now, store the permission value in a member of the session. The getUserMedia
3279         permission only needs a bool, but there is no reason we couldn't use more complicated
3280         values for permissions (i.e., strings, numbers, arrays, objects) someday.
3281
3282         (WebKit::WebAutomationSession::shouldAllowGetUserMediaForPage const):
3283         Expose the specific decision to be taken based on whether the request is allowed or denied.
3284
3285         * UIProcess/Automation/WebAutomationSession.h:
3286         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3287         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
3288         If the page is under automation, then simulate the user action according to the
3289         current values of permissions set for the session.
3290
3291 2017-09-25  Alex Christensen  <achristensen@webkit.org>
3292
3293         Make PolicyAction an encodable enum class
3294         https://bugs.webkit.org/show_bug.cgi?id=177480
3295
3296         Reviewed by Antti Koivisto.
3297
3298         * NetworkProcess/Downloads/DownloadManager.cpp:
3299         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
3300         (WebKit::DownloadManager::cancelDownload):
3301         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
3302         (WebKit::NetworkCORSPreflightChecker::didReceiveResponseNetworkSession):
3303         * NetworkProcess/NetworkDataTask.cpp:
3304         (WebKit::NetworkDataTask::didReceiveResponse):
3305         * NetworkProcess/NetworkDataTaskBlob.cpp:
3306         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
3307         * NetworkProcess/NetworkLoad.cpp:
3308         (WebKit::NetworkLoad::~NetworkLoad):
3309         (WebKit::NetworkLoad::continueDidReceiveResponse):
3310         (WebKit::NetworkLoad::notifyDidReceiveResponse):
3311         * NetworkProcess/PingLoad.cpp:
3312         (WebKit::PingLoad::didReceiveResponseNetworkSession):
3313         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
3314         (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):
3315         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3316         (toNSURLSessionResponseDisposition):
3317         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3318         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
3319         * Scripts/webkit/messages.py:
3320         (headers_for_type):
3321         * UIProcess/WebFormSubmissionListenerProxy.h:
3322         * UIProcess/WebFrameListenerProxy.h:
3323         (WebKit::WebFrameListenerProxy::navigation): Deleted.
3324         * UIProcess/WebFramePolicyListenerProxy.cpp:
3325         (WebKit::WebFramePolicyListenerProxy::use):
3326         (WebKit::WebFramePolicyListenerProxy::download):
3327         (WebKit::WebFramePolicyListenerProxy::ignore):
3328         * UIProcess/WebPageProxy.cpp:
3329         (WebKit::WebPageProxy::receivedPolicyDecision):
3330         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3331         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3332         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
3333         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
3334         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3335         * WebProcess/WebPage/WebFrame.cpp:
3336         (WebKit::WebFrame::invalidatePolicyListener):
3337         * WebProcess/WebPage/WebPage.cpp:
3338         (WebKit::WebPage::didReceivePolicyDecision):
3339         * WebProcess/WebPage/WebPage.h:
3340         * WebProcess/WebPage/WebPage.messages.in:
3341
3342 2017-09-25  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
3343
3344         [WinCairo] Share default value of font family preferences among non-cocoa builds
3345         https://bugs.webkit.org/show_bug.cgi?id=177479
3346
3347         Reviewed by Yusuke Suzuki.
3348
3349         * Shared/WebPreferencesDefinitions.h:
3350
3351 2017-09-25  Frederik Riedel  <riedel@apple.com>
3352
3353         Expose way to set values of classified form controls as {Legacy WebKit, WebKit} SPI
3354         https://bugs.webkit.org/show_bug.cgi?id=174394
3355         <rdar://problem/33183504>
3356
3357         Reviewed by Ryosuke Niwa.
3358
3359         * Platform/spi/ios/UIKitSPI.h:
3360         * Shared/AssistedNodeInformation.cpp:
3361         (WebKit::AssistedNodeInformation::encode const):
3362         Encodes additional node information, including if the node is part of a login screen.
3363         (WebKit::AssistedNodeInformation::decode):
3364         Decodes the additional assisted node information.
3365         * Shared/AssistedNodeInformation.h:
3366         * UIProcess/WebPageProxy.h:
3367         * UIProcess/ios/WKContentView.mm:
3368         (-[WKContentView acceptsAutofilledLoginCredentials]):
3369         Determines if the WKContentView shows a login screen.
3370         (-[WKContentView representingPageUrl]):
3371         Returns the URL of the currently displayed web page.
3372         * UIProcess/ios/WKContentViewInteraction.mm:
3373         (-[WKContentView insertTextSuggestion:]):
3374         Inserts the login credentials into the Web View.
3375         * UIProcess/ios/WebPageProxyIOS.mm:
3376         (WebKit::WebPageProxy::startAssistingNode):
3377         Transfer the additional assistednode information (acceptsAutofilledLoginCredentials and representingPageUrl).
3378         (WebKit::WebPageProxy::acceptsAutofilledLoginCredentials):
3379         Returns if the Web View shows a login screen.
3380         (WebKit::WebPageProxy::representingPageUrl):
3381         Returns the Web View's URL.
3382         (WebKit::WebPageProxy::autofillLoginCredentials):
3383         Insert the credentials into the Web View.
3384         * WebProcess/WebPage/WebPage.h:
3385         * WebProcess/WebPage/WebPage.messages.in:
3386         * WebProcess/WebPage/ios/WebPageIOS.mm:
3387         (WebKit::WebPage::getAssistedNodeInformation): Transports the information if the currently
3388         highlighted node accepts autofilled login credentials.
3389         (WebKit::WebPage::autofillLoginCredentials): Fills the login credentials into the
3390         WebPage.
3391
3392 2017-09-25  Youenn Fablet  <youenn@apple.com>
3393
3394         WebRTC video does not resume receiving when switching back to Safari 11 on iOS
3395         https://bugs.webkit.org/show_bug.cgi?id=175472
3396         <rdar://problem/33860863>
3397
3398         Reviewed by Darin Adler.
3399
3400         Notifying LibWebRTC of backgrounding/foregrouding.
3401
3402         * WebProcess/WebPage/ios/WebPageIOS.mm:
3403         (WebKit::WebPage::applicationDidEnterBackground):
3404         (WebKit::WebPage::applicationWillEnterForeground):
3405
3406 2017-09-25  Sam Weinig  <sam@webkit.org>
3407
3408         Remove unused EditorClient functions
3409         https://bugs.webkit.org/show_bug.cgi?id=177463
3410
3411         Reviewed by Alex Christensen.
3412
3413         Remove unused EditorClient functions.
3414
3415         * WebProcess/WebCoreSupport/WebEditorClient.h:
3416         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
3417         (WebKit::WebEditorClient::canonicalizeURL): Deleted.
3418         (WebKit::WebEditorClient::canonicalizeURLString): Deleted.
3419         (WebKit::WebEditorClient::writeDataToPasteboard): Deleted.
3420         (WebKit::WebEditorClient::supportedPasteboardTypesForCurrentSelection): Deleted.
3421         (WebKit::WebEditorClient::readDataFromPasteboard): Deleted.
3422         (WebKit::WebEditorClient::pasteboardChangeCount): Deleted.
3423         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
3424         (WebKit::WebEditorClient::canonicalizeURL): Deleted.
3425         (WebKit::WebEditorClient::canonicalizeURLString): Deleted.
3426
3427 2017-09-25  Alex Christensen  <achristensen@webkit.org>
3428
3429         Make Attribute an enum class
3430         https://bugs.webkit.org/show_bug.cgi?id=177414
3431
3432         Reviewed by Yusuke Suzuki.
3433
3434         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
3435         (WebKit::JSNPObject::getOwnPropertySlot):
3436
3437 2017-09-25  Alex Christensen  <achristensen@webkit.org>
3438
3439         Stop using PolicyCallback
3440         https://bugs.webkit.org/show_bug.cgi?id=176088
3441
3442         Reviewed by Andy Estes.
3443
3444         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3445         * WebProcess/WebPage/WebFrame.cpp:
3446         (WebKit::WebFrame::invalidatePolicyListener):
3447         * WebProcess/WebPage/WebFrame.h:
3448         * WebProcess/WebPage/WebInspector.cpp:
3449
3450 2017-09-25  Chris Dumez  <cdumez@apple.com>
3451
3452         [WK2] Add API to query if a download was user-initiated
3453         https://bugs.webkit.org/show_bug.cgi?id=177435
3454         <rdar://problem/34498422>
3455
3456         Reviewed by Alex Christensen.
3457
3458         Add C and Cocoa private API to query if a download was user-initiated.
3459
3460         For clarity, we now construct navigation object for subframe loads
3461         as well (we used to do so only for main frame loads). This allows us
3462         to store the user-intiated flag and the redirect chain on the navigation
3463         object instead of the WebFrameProxy.
3464
3465         * UIProcess/API/APINavigation.cpp:
3466         (API::Navigation::Navigation):
3467         (API::Navigation::appendRedirectionURL):
3468         * UIProcess/API/APINavigation.h:
3469         (API::Navigation::takeRedirectChain):
3470         (API::Navigation::setWasUserInitiated):
3471         (API::Navigation::wasUserInitiated const):
3472         * UIProcess/API/C/WKDownload.cpp:
3473         (WKDownloadGetWasUserInitiated):
3474         * UIProcess/API/C/WKDownload.h:
3475         * UIProcess/API/Cocoa/_WKDownload.h:
3476         * UIProcess/API/Cocoa/_WKDownload.mm:
3477         (-[_WKDownload wasUserInitiated]):
3478         * UIProcess/Downloads/DownloadProxy.h:
3479         (WebKit::DownloadProxy::setWasUserInitiated):
3480         (WebKit::DownloadProxy::wasUserInitiated const):
3481         * UIProcess/WebFrameProxy.cpp:
3482         (WebKit::WebFrameProxy::didStartProvisionalLoad):
3483         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad):