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