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