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