Turning off custom pasteboard data doesn't actually turn it off in WK2
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-01-21  Ryosuke Niwa  <rniwa@webkit.org>
2
3         Turning off custom pasteboard data doesn't actually turn it off in WK2
4         https://bugs.webkit.org/show_bug.cgi?id=181920
5         <rdar://problem/36686429>
6
7         Reviewed by Wenson Hsieh.
8
9         Moved the code to decide when to enable custom pasteboard data from WebCore
10         since we never enable this feature in WebKit1.
11
12         * Shared/WebPreferences.yaml:
13         * Shared/WebPreferencesDefaultValues.cpp:
14         (defaultCustomPasteboardDataEnabled): Added.
15         * Shared/WebPreferencesDefaultValues.h:
16
17 2018-01-21  Wenson Hsieh  <wenson_hsieh@apple.com>
18
19         Add a new feature flag for EXTRA_ZOOM_MODE and reintroduce AdditionalFeatureDefines.h
20         https://bugs.webkit.org/show_bug.cgi?id=181918
21
22         Reviewed by Tim Horton.
23
24         Add EXTRA_ZOOM_MODE to FeatureDefines.xconfig (off by default).
25
26         * Configurations/FeatureDefines.xcconfig:
27
28 2018-01-21  Eric Carlson  <eric.carlson@apple.com>
29
30         Resign NowPlaying status when no media element is eligible
31         https://bugs.webkit.org/show_bug.cgi?id=181914
32         <rdar://problem/35294116>
33
34         Reviewed by Jer Noble.
35
36         * UIProcess/API/Cocoa/WKWebView.mm:
37         (-[WKWebView _requestActiveNowPlayingSessionInfo:]): Return registeredAsNowPlayingApplication
38         status.
39         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
40
41         * UIProcess/WebPageProxy.cpp:
42         (WebKit::WebPageProxy::nowPlayingInfoCallback): Ditto.
43         * UIProcess/WebPageProxy.h:
44         * UIProcess/WebPageProxy.messages.in:
45         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
46         (WebKit::WebPage::requestActiveNowPlayingSessionInfo): Ditto.
47
48 2018-01-20  Andy Estes  <aestes@apple.com>
49
50         [Apple Pay] Stop eagerly loading PassKit.framework
51         https://bugs.webkit.org/show_bug.cgi?id=181911
52         <rdar://problem/36555369>
53
54         Reviewed by Tim Horton.
55
56         * Shared/WebPageCreationParameters.cpp:
57         (WebKit::WebPageCreationParameters::encode const):
58         (WebKit::WebPageCreationParameters::decode):
59         * Shared/WebPageCreationParameters.h:
60
61         Removed availablePaymentNetworks from WebPageCreationParameters.
62
63         * UIProcess/API/C/WKPreferences.cpp:
64         (WKPreferencesSetApplePayEnabled):
65         * UIProcess/API/Cocoa/WKWebView.mm:
66         (-[WKWebView _initializeWithConfiguration:]):
67
68         Stopped calling WebPaymentCoordinatorProxy::platformSupportsPayments().
69
70         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
71         (WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks):
72         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
73         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
74
75         Added message AvailablePaymentNetworks, which synchronously returns a Vector of payment
76         networks.
77
78         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
79         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):
80
81         Returned false if PassKitLibrary() fails.
82
83         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
84         (WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup):
85
86         Called completionHandler with false if PassKitLibrary() fails.
87
88         (WebKit::WebPaymentCoordinatorProxy::platformAvailablePaymentNetworks):
89         (WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks):
90
91         Renamed availablePaymentNetworks to platformAvailablePaymentNetworks
92
93         (WebKit::WebPaymentCoordinatorProxy::platformSupportsPayments): Deleted.
94
95         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
96         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
97
98         Called completionHandler with false if PassKitLibrary() fails.
99
100         * UIProcess/WebPageProxy.cpp:
101         (WebKit::WebPageProxy::creationParameters):
102
103         Stopped calling WebPaymentCoordinatorProxy::availablePaymentNetworks().
104
105         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
106         (WebKit::WebPaymentCoordinator::availablePaymentNetworks):
107         (WebKit::WebPaymentCoordinator::validatedPaymentNetwork):
108         * WebProcess/ApplePay/WebPaymentCoordinator.h:
109
110         Implemented PaymentCoordinatorClient::validatedPaymentNetwork(). m_availablePaymentNetworks
111         starts off as std::nullopt, but is initialized by sending the AvailablePaymentNetworks sync
112         message the first time it's accessed.
113
114         * WebProcess/WebPage/WebPage.cpp:
115         (WebKit::WebPage::WebPage):
116
117         Stopped setting PageConfiguration::availablePaymentNetworks.
118
119 2018-01-20  Jer Noble  <jer.noble@apple.com>
120
121         Release ASSERT when reloading Vimeo page @ WebCore: WebCore::Document::updateLayout
122         https://bugs.webkit.org/show_bug.cgi?id=181840
123         <rdar://problem/36186214>
124
125         Reviewed by Simon Fraser.
126
127         Updating layout while the document is suspended or stopped is unsafe.
128
129         * WebProcess/cocoa/VideoFullscreenManager.mm:
130         (WebKit::inlineVideoFrame):
131
132 2018-01-20  Chris Dumez  <cdumez@apple.com>
133
134         DOMCache data sometimes not properly removed when clearing data for a given origin
135         https://bugs.webkit.org/show_bug.cgi?id=181887
136         <rdar://problem/36671239>
137
138         Reviewed by Youenn Fablet.
139
140         * NetworkProcess/cache/CacheStorageEngine.cpp:
141         (WebKit::CacheStorage::Engine::clearCachesForOrigin):
142         This code was iterating through folders on disk, then reading the folder's origin
143         from the origin file on disk. Then, if the origin would match the one we want to
144         delete, it would regenerate the folder path using cachesRootPath(*folderOrigin).
145         I don't know how but on my machine, I was ended up in a state where the path
146         generated by cachesRootPath(*folderOrigin) differed from the actual folder path
147         we read the origin from (Likely a different salt?). To make the code more robust,
148         I updated the code to delete "folderPath", which is the path we read the origin
149         from.
150
151 2018-01-19  Zach Li  <zacharyli323@gmail.com>
152
153         Expose Safe Browsing SPI
154         https://bugs.webkit.org/show_bug.cgi?id=181804
155         <rdar://problem/36626946>
156
157         Reviewed by Dan Bernstein.
158
159         If client is using Apple internal SDK, then we can just import the header; if not,
160         then we declare necessary symbols that client will need.
161
162         * Configurations/WebKit.xcconfig:
163         Only link against SafariSafeBrowsing framework on macOS High Sierra
164         and iOS 11 and above. Weak link against SafariSafeBrowsing framework
165         because it is not present on the Base system.
166
167         * Platform/spi/Cocoa/SafeBrowsingSPI.h: Added.
168
169         * WebKit.xcodeproj/project.pbxproj:
170         Added SafeBrowsingSPI.h.
171
172         * WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/11/SafariSafeBrowsing.framework/SafariSafeBrowsing.tbd:
173         Added.
174
175 2018-01-19  Ryan Haddad  <ryanhaddad@apple.com>
176
177         Unreviewed build fix, removed unused lambda capture.
178
179         * UIProcess/WebResourceLoadStatisticsStore.cpp:
180         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
181
182 2018-01-19  John Wilander  <wilander@apple.com>
183
184         Resource Load Statistics: Remove unused calls to WebResourceLoadStatisticsStore:logTestingEvent() to fix API test
185         https://bugs.webkit.org/show_bug.cgi?id=181890
186         <rdar://problem/36674772>
187
188         Unreviewed API test fix.
189
190         * UIProcess/WebResourceLoadStatisticsStore.cpp:
191         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
192
193 2018-01-19  Youenn Fablet  <youenn@apple.com>
194
195         Do not go to the storage process when registering a service worker client if there is no service worker registered
196         https://bugs.webkit.org/show_bug.cgi?id=181740
197         <rdar://problem/36650400>
198
199         Reviewed by Chris Dumez.
200
201         UIProcess notifies all web processes to register their service worker clients when spinning the service worker process.
202         Add private API to set the number of web processes for testing purposes.
203
204         * UIProcess/API/Cocoa/WKProcessPool.mm:
205         (-[WKProcessPool _setMaximumNumberOfProcesses:]):
206         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
207         * UIProcess/WebProcessPool.cpp:
208         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
209         * WebProcess/WebProcess.cpp:
210         (WebKit::WebProcess::registerServiceWorkerClients):
211         * WebProcess/WebProcess.h:
212         * WebProcess/WebProcess.messages.in:
213
214 2018-01-19  Dean Jackson  <dino@apple.com>
215
216         REGRESSION (r221092): Swipe actions are hard to perform in FastMail app
217         https://bugs.webkit.org/show_bug.cgi?id=181817
218         <rdar://problem/35274055>
219
220         Reviewed by Simon Fraser.
221
222         Add a linked-on-or-after check to set passive touch listeners on document in WebCore.
223
224         * CMakeLists.txt:
225         * Shared/WebPreferences.yaml:
226         * Shared/WebPreferencesDefaultValues.cpp: Copied from Source/WebKit/UIProcess/Cocoa/VersionChecks.h.
227         (defaultPassiveTouchListenersAsDefaultOnDocument):
228         * Shared/WebPreferencesDefaultValues.h:
229         * UIProcess/Cocoa/VersionChecks.h:
230         * WebKit.xcodeproj/project.pbxproj:
231
232 2018-01-19  Joseph Pecoraro  <pecoraro@apple.com>
233
234         [Cocoa] _WKNSWindowExtras.h: Add missing availability annotation
235         https://bugs.webkit.org/show_bug.cgi?id=181868
236
237         Reviewed by Dan Bernstein.
238
239         * Shared/API/Cocoa/_WKNSWindowExtras.h:
240
241 2018-01-19  John Wilander  <wilander@apple.com>
242
243         Resource Load Statistics: Add void to argument list to fix build with -Wstrict-prototypes
244         https://bugs.webkit.org/show_bug.cgi?id=181870
245         <rdar://problem/36666750>
246
247         Unreviewed build fix.
248
249         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
250
251 2018-01-19  Ryan Haddad  <ryanhaddad@apple.com>
252
253         Unreviewed, rolling out r227211.
254
255         Breaks iOS Simulator tests.
256
257         Reverted changeset:
258
259         "Expose Safe Browsing SPI"
260         https://bugs.webkit.org/show_bug.cgi?id=181804
261         https://trac.webkit.org/changeset/227211
262
263 2018-01-19  John Wilander  <wilander@apple.com>
264
265         Resource Load Statistics: Implement callback support for removal of WebsiteDataType::ResourceLoadStatistics
266         https://bugs.webkit.org/show_bug.cgi?id=181822
267         https://bugs.webkit.org/show_bug.cgi?id=175263
268         https://bugs.webkit.org/show_bug.cgi?id=178536
269         https://bugs.webkit.org/show_bug.cgi?id=181223
270         https://bugs.webkit.org/show_bug.cgi?id=181482
271         <rdar://problem/33491222>
272         <rdar://problem/33805293>
273         <rdar://problem/36332683>
274         <rdar://problem/36549026>
275
276         Reviewed by Alex Christensen.
277
278         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
279         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
280         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
281         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
282         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore]):
283             Calls the new API with no-op completion handler.
284         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore:]):
285             New API with completion handler.
286         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]):
287             Calls the new API with no-op completion handler.
288         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:completionHandler:]):
289             New API with completion handler.
290         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
291         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
292         (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
293         * UIProcess/WebResourceLoadStatisticsStore.cpp:
294         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
295         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
296         * UIProcess/WebResourceLoadStatisticsStore.h:
297         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
298         (WebKit::WebsiteDataStore::removeData):
299         (WebKit::WebsiteDataStore::clearResourceLoadStatisticsInWebProcesses):
300         * UIProcess/WebsiteData/WebsiteDataStore.h:
301
302 2018-01-19  Daniel Bates  <dabates@apple.com>
303
304         REGRESSION (r223149): Ref WebPageProxy objects before calling their functionality
305         https://bugs.webkit.org/show_bug.cgi?id=181863
306         <rdar://problem/36662452>
307
308         Reviewed by Chris Dumez.
309
310         More fix ups following r223149. When notifying all pages of a process state change we need to
311         take care to ref all the pages before iterating over them and notifying them of the change.
312         Notifying a page of such a state change may ultimately delegate to the embedding client. And
313         the embedding client can do anything, including deallocating one or more pages.
314
315         * UIProcess/WebProcessProxy.cpp:
316         (WebKit::WebProcessProxy::didBecomeUnresponsive):
317         (WebKit::WebProcessProxy::didBecomeResponsive):
318         (WebKit::WebProcessProxy::willChangeIsResponsive):
319         (WebKit::WebProcessProxy::didChangeIsResponsive):
320         (WebKit::WebProcessProxy::requestTermination):
321
322 2018-01-19  Chris Dumez  <cdumez@apple.com>
323
324         The WebContent process should not process incoming IPC while waiting for a sync IPC reply
325         https://bugs.webkit.org/show_bug.cgi?id=181560
326
327         Reviewed by Ryosuke Niwa.
328
329         The WebContent process should not process incoming IPC while waiting for a sync IPC reply.
330         This is causing hard-to-debug crashes because developers often assume the state does not
331         change during a sendSync() call.
332
333         * Platform/IPC/Connection.cpp:
334         (IPC::Connection::waitForSyncReply):
335         * Platform/IPC/Connection.h:
336         (IPC::Connection::setShouldProcessIncomingMessagesWhileWaitingForSyncReply):
337         * UIProcess/WebProcessProxy.cpp:
338         (WebKit::WebProcessProxy::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
339         * UIProcess/WebProcessProxy.h:
340         * UIProcess/WebProcessProxy.messages.in:
341         * WebProcess/Network/NetworkProcessConnection.cpp:
342         (WebKit::NetworkProcessConnection::NetworkProcessConnection):
343         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
344         (WebKit::WebToStorageProcessConnection::WebToStorageProcessConnection):
345         * WebProcess/WebConnectionToUIProcess.cpp:
346         (WebKit::WebConnectionToUIProcess::WebConnectionToUIProcess):
347         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
348         (WebKit::WebChromeClient::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
349         * WebProcess/WebCoreSupport/WebChromeClient.h:
350         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
351         (WebKit::WebEditorClient::undo):
352         (WebKit::WebEditorClient::redo):
353         * WebProcess/WebProcess.cpp:
354         (WebKit::WebProcess::syncIPCMessageWhileWaitingForSyncReplyForTesting):
355         * WebProcess/WebProcess.h:
356         * WebProcess/WebProcess.messages.in:
357
358 2018-01-19  Keith Miller  <keith_miller@apple.com>
359
360         HaveInternalSDK includes should be "#include?"
361         https://bugs.webkit.org/show_bug.cgi?id=179670
362
363         Reviewed by Dan Bernstein.
364
365         * Configurations/Base.xcconfig:
366
367 2018-01-19  Daniel Bates  <dabates@apple.com>
368
369         Fix misspelling; substitute willDetachRenderer for willDetatchRenderer.
370
371         * WebProcess/Plugins/PDF/PDFPlugin.h:
372         * WebProcess/Plugins/PDF/PDFPlugin.mm:
373         (WebKit::PDFPlugin::willDetachRenderer):
374         (WebKit::PDFPlugin::willDetatchRenderer): Deleted.
375         * WebProcess/Plugins/Plugin.h:
376         (WebKit::Plugin::willDetachRenderer):
377         (WebKit::Plugin::willDetatchRenderer): Deleted.
378         * WebProcess/Plugins/PluginView.cpp:
379         (WebKit::PluginView::willDetachRenderer):
380         (WebKit::PluginView::willDetatchRenderer): Deleted.
381         * WebProcess/Plugins/PluginView.h:
382
383 2018-01-19  Zach Li  <zacharyli323@gmail.com>
384
385         Expose Safe Browsing SPI
386         https://bugs.webkit.org/show_bug.cgi?id=181804
387         <rdar://problem/36626946>
388
389         Reviewed by Alex Christensen.
390
391         If client is using Apple internal SDK, then we can just import the header; if not,
392         then we declare necessary symbols that client will need.
393
394         * Configurations/WebKit.xcconfig:
395         Only link against SafariSafeBrowsing framework on macOS High Sierra
396         and iOS 11 and above. Weak link against SafariSafeBrowsing framework
397         because it is not present on the Base system.
398
399         * Platform/spi/Cocoa/SafeBrowsingSPI.h: Added.
400
401         * WebKit.xcodeproj/project.pbxproj:
402         Added SafeBrowsingSPI.h.
403
404         * WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/11/SafariSafeBrowsing.framework/SafariSafeBrowsing.tbd:
405         Added.
406
407 2018-01-18  Chris Dumez  <cdumez@apple.com>
408
409         We should be able to terminate service workers that are unresponsive
410         https://bugs.webkit.org/show_bug.cgi?id=181563
411         <rdar://problem/35280031>
412
413         Reviewed by Alex Christensen.
414
415         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
416         (WebKit::WebSWContextManagerConnection::terminateWorker):
417         Use a 10 second timeout for forcefully exiting the service worker process when
418         the service worker in question fails to terminate.
419
420         (WebKit::WebSWContextManagerConnection::syncTerminateWorker):
421         Use a 100ms timeout for forcefully exiting the service worker process when
422         the service worker in question fails to terminate. This method is only called
423         from the layout tests, which is why we use a very short timeout.
424
425 2018-01-18  Ryan Haddad  <ryanhaddad@apple.com>
426
427         Unreviewed, suppress deprecation warnings to fix the build with a newer SDK.
428
429         * UIProcess/ios/WKPDFPageNumberIndicator.mm:
430         (-[WKPDFPageNumberIndicator _makeRoundedCorners]):
431
432 2018-01-18  Youenn Fablet  <youenn@apple.com>
433
434         Do not go to the storage process when loading a main resource if there is no service worker registered
435         https://bugs.webkit.org/show_bug.cgi?id=181395
436
437         Reviewed by Chris Dumez.
438
439         Add a new web process creation parameter to know whether there is any service worker registered at web process creation time.
440         If there is none, the web process will then start to load HTTP resources from the network.
441         The connection to the storage process is then executed when receiving the first bytes of the main resource.
442         This connection is needed as other web processes may create service workers at any given time.
443         If there is one registered service worker, the web process will wait for its connection to the storage process to be active.
444
445         * Shared/WebProcessCreationParameters.cpp:
446         (WebKit::WebProcessCreationParameters::encode const):
447         (WebKit::WebProcessCreationParameters::decode):
448         * Shared/WebProcessCreationParameters.h:
449         * UIProcess/ServiceWorkerProcessProxy.cpp:
450         (WebKit::ServiceWorkerProcessProxy::hasRegisteredServiceWorkers):
451         * UIProcess/ServiceWorkerProcessProxy.h:
452         * UIProcess/WebProcessPool.cpp:
453         (WebKit::WebProcessPool::initializeNewWebProcess):
454         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
455         (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
456         * WebProcess/Storage/WebServiceWorkerProvider.h:
457         * WebProcess/Storage/WebToStorageProcessConnection.h:
458         (WebKit::WebToStorageProcessConnection::existingServiceWorkerConnectionForSession):
459         * WebProcess/WebProcess.cpp:
460         (WebKit::WebProcess::initializeWebProcess):
461
462 2018-01-18  Chris Dumez  <cdumez@apple.com>
463
464         Regression(r223149): WebProcessProxy::didClose() no longer refs WebPageProxy objects
465         https://bugs.webkit.org/show_bug.cgi?id=181771
466         <rdar://problem/36566237>
467
468         Reviewed by Brady Eidson.
469
470         * UIProcess/WebProcessProxy.cpp:
471         (WebKit::WebProcessProxy::didClose):
472         Use copyToVectorOf<RefPtr<WebPageProxy>>() to maintain pre-r223149 behavior
473         and ref the pages.
474
475 2018-01-18  Dan Bernstein  <mitz@apple.com>
476
477         [Xcode] Streamline and future-proof target-macOS-version-dependent build setting definitions
478         https://bugs.webkit.org/show_bug.cgi?id=181803
479
480         Reviewed by Tim Horton.
481
482         * Configurations/Base.xcconfig: Updated.
483         * Configurations/DebugRelease.xcconfig: Ditto.
484         * Configurations/FeatureDefines.xcconfig: Adopted macOSTargetConditionals helpers.
485         * Configurations/Version.xcconfig: Updated.
486         * Configurations/macOSTargetConditionals.xcconfig: Added.  Defines helper build settings
487           useful for defining settings that depend on the target macOS version.
488
489 2018-01-18  Chris Dumez  <cdumez@apple.com>
490
491         Service Workers restored from persistent storage have 'redundant' state
492         https://bugs.webkit.org/show_bug.cgi?id=181749
493         <rdar://problem/36556486>
494
495         Reviewed by Youenn Fablet.
496
497         Allow service workers to intercept custom protocol loads as this is useful for
498         API testing.
499
500         * WebProcess/Network/WebLoaderStrategy.cpp:
501         (WebKit::WebLoaderStrategy::scheduleLoad):
502         (WebKit::WebLoaderStrategy::tryLoadingUsingURLSchemeHandler):
503         * WebProcess/Network/WebLoaderStrategy.h:
504
505 2018-01-18  Brent Fulgham  <bfulgham@apple.com>
506
507         REGRESSION(r225858): Sandbox violations due to blocked access to Spotlight search preferences
508         https://bugs.webkit.org/show_bug.cgi?id=181797
509         <rdar://problem/36546412>
510
511         Reviewed by Eric Carlson.
512
513         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Add the read permission for
514         'com.apple.lookup.shared' to support DataDetectors.
515
516 2018-01-17  John Wilander  <wilander@apple.com>
517
518         Resource Load Statistics: Block cookies for prevalent resources without user interaction
519         https://bugs.webkit.org/show_bug.cgi?id=177394
520         <rdar://problem/34613960>
521
522         Reviewed by Alex Christensen.
523
524         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
525             Now has m_hasBeenSetToUseStatelessCookieStorage to handle
526             cookie blocking.
527         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
528         (WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
529             Returns singleton empty, deny-all cookie storage for cookie blocking.
530             The ugly pragma instructions for clang are because the NSString
531             parameter for _initWithIdentifier was not marked nullable pre-Sierra.
532         (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
533             Instead of just decision making, this now applies the policy.
534         (WebKit::NetworkDataTaskCocoa::applyCookiePartitioningPolicy):
535             New method.
536         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
537             Now blocks cookies for domains where cookies will be purged anyway.
538         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
539             Now blocks cookies for domains where cookies will be purged anyway.
540         (WebKit::shouldChangePartition): Deleted.
541         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
542         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
543             Now downgrades for blocked cookies instead of partitioned cookies.
544         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
545             Now downgrades for blocked cookies instead of partitioned cookies.
546
547
548 2018-01-17  Stephan Szabo  <stephan.szabo@sony.com>
549
550         [Curl] Use ResourceRequest::encodeWithPlatformData()
551         https://bugs.webkit.org/show_bug.cgi?id=181768
552
553         Reviewed by Alex Christensen.
554
555         * Shared/curl/WebCoreArgumentCodersCurl.cpp:
556         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
557         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
558
559 2018-01-17  Matt Lewis  <jlewis3@apple.com>
560
561         Unreviewed, rolling out r227076.
562
563         This breaks internal builds
564
565         Reverted changeset:
566
567         "Resource Load Statistics: Block cookies for prevalent
568         resources without user interaction"
569         https://bugs.webkit.org/show_bug.cgi?id=177394
570         https://trac.webkit.org/changeset/227076
571
572 2018-01-17  Michael Catanzaro  <mcatanzaro@igalia.com>
573
574         WEBKIT_FRAMEWORK should not modify file-global include directories
575         https://bugs.webkit.org/show_bug.cgi?id=181656
576
577         Reviewed by Konstantin Tokarev.
578
579         * PlatformGTK.cmake:
580         * PlatformWPE.cmake:
581
582 2018-01-17  Youenn Fablet  <youenn@apple.com>
583
584         Put fetch request keepAlive behind a runtime flag
585         https://bugs.webkit.org/show_bug.cgi?id=181592
586
587         Reviewed by Chris Dumez.
588
589         * Shared/WebPreferences.yaml:
590         * UIProcess/API/C/WKPreferences.cpp:
591         (WKPreferencesSetFetchAPIKeepAliveEnabled):
592         (WKPreferencesGetFetchAPIKeepAliveEnabled):
593         * UIProcess/API/C/WKPreferencesRefPrivate.h:
594
595 2018-01-17  John Wilander  <wilander@apple.com>
596
597         Resource Load Statistics: Block cookies for prevalent resources without user interaction
598         https://bugs.webkit.org/show_bug.cgi?id=177394
599         <rdar://problem/34613960>
600
601         Reviewed by Alex Christensen.
602
603         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
604             Now has m_hasBeenSetToUseStatelessCookieStorage to handle
605             cookie blocking.
606         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
607         (WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
608             Returns singleton empty, deny-all cookie storage for cookie blocking.
609         (WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
610             Instead of just decision making, this now applies the policy.
611         (WebKit::NetworkDataTaskCocoa::applyCookiePartitioningPolicy):
612             New method.
613         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
614             Now blocks cookies for domains where cookies will be purged anyway.
615         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
616             Now blocks cookies for domains where cookies will be purged anyway.
617         (WebKit::shouldChangePartition): Deleted.
618         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
619         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
620             Now downgrades for blocked cookies instead of partitioned cookies.
621         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
622             Now downgrades for blocked cookies instead of partitioned cookies.
623
624 2018-01-17  Daniel Bates  <dabates@apple.com>
625
626         REGRESSION (r222795): Cardiogram never signs in
627         https://bugs.webkit.org/show_bug.cgi?id=181693
628         <rdar://problem/36286293>
629
630         Reviewed by Ryosuke Niwa.
631
632         Exempt Cardiogram from the XHR header restrictions in r222795.
633
634         Following r222795 only Dashboard widgets are allowed to set arbitrary XHR headers.
635         However Cardiogram also depends on such functionality.
636
637         * Shared/WebPreferences.yaml:
638         * UIProcess/API/Cocoa/WKWebView.mm:
639         (shouldAllowSettingAnyXHRHeaderFromFileURLs):
640         (-[WKWebView _initializeWithConfiguration:]):
641         * UIProcess/Cocoa/VersionChecks.h:
642
643 2018-01-17  Wenson Hsieh  <wenson_hsieh@apple.com>
644
645         Add injected bundle SPI to replace subresource URLs when dropping or pasting rich content
646         https://bugs.webkit.org/show_bug.cgi?id=181637
647         <rdar://problem/36508471>
648
649         Reviewed by Tim Horton.
650
651         Add new injected bundle SPI, replacementURLForResource, which clients may use to provide a replacement URL to
652         represent an archive resource, given the resource's data and MIME type.
653
654         * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
655         (API::InjectedBundle::EditorClient::replacementURLForResource):
656         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
657         * WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h:
658
659         Add replacementURLForResource, and also bump the current injected bundle editor client version to 2.
660
661         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
662         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
663         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
664         (WebKit::InjectedBundlePageEditorClient::replacementURLForResource):
665         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
666         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
667         (WebKit::WebEditorClient::replacementURLForResource):
668         * WebProcess/WebCoreSupport/WebEditorClient.h:
669
670 2018-01-17  Zan Dobersek  <zdobersek@igalia.com>
671
672         [Cairo] Don't mirror global alpha and image interpolation quality state values in PlatformContextCairo
673         https://bugs.webkit.org/show_bug.cgi?id=181725
674
675         Reviewed by Carlos Garcia Campos.
676
677         * Shared/cairo/ShareableBitmapCairo.cpp:
678         (WebKit::ShareableBitmap::paint):
679         Adjust the PlatformContextCairo::drawSurfaceToContext() invocation.
680         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
681         (WebKit::convertCairoSurfaceToShareableBitmap): Ditto.
682
683 2018-01-17  Carlos Garcia Campos  <cgarcia@igalia.com>
684
685         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.6 release.
686
687         * gtk/NEWS: Add release notes for 2.19.6.
688
689 2018-01-17  Carlos Garcia Campos  <cgarcia@igalia.com>
690
691         [GTK] Duplicated symbols in libjavascriptcoregtk and libwebkit2gtk can cause crashes in production builds
692         https://bugs.webkit.org/show_bug.cgi?id=179914
693
694         Reviewed by Žan Doberšek.
695
696         Add symbols detected by check-for-global-bss-symbols-in-webkigtk-libs to the version script.
697
698         * webkitglib-symbols.map:
699
700 2018-01-17  Youenn Fablet  <youenn@apple.com>
701
702         Clear Caches volatile storage as a memory optimization.
703         https://bugs.webkit.org/show_bug.cgi?id=181643
704
705         Reviewed by Chris Dumez.
706
707         clearMemoryRepresentation clears m_caches which exposes data potentially stored in m_volatileStorage.
708         Clearing m_volatileStorage allows releasing some memory.
709
710         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
711         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
712
713 2018-01-17  Zan Dobersek  <zdobersek@igalia.com>
714
715         [Cairo] Use one-time ShadowBlur objects when performing shadowing
716         https://bugs.webkit.org/show_bug.cgi?id=181720
717
718         Reviewed by Carlos Garcia Campos.
719
720         * Shared/cairo/ShareableBitmapCairo.cpp:
721         (WebKit::ShareableBitmap::paint):
722         Adjust the PlatformContextCairo::drawSurfaceToContext() invocation.
723         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
724         (WebKit::convertCairoSurfaceToShareableBitmap): Ditto.
725
726 2018-01-16  Fujii Hironori  <Hironori.Fujii@sony.com>
727
728         [CMake] Remove WebCoreDerivedSources library target
729         https://bugs.webkit.org/show_bug.cgi?id=181664
730
731         Reviewed by Carlos Garcia Campos.
732
733         * CMakeLists.txt: Do not link WebCoreDerivedSources.
734         * PlatformGTK.cmake: Appended WebCore after WebCorePlatformGTK in WebKit_LIBRARIES.
735         * PlatformWin.cmake: Ditto.
736
737 2018-01-16  Alex Christensen  <achristensen@webkit.org>
738
739         Merge sync and async code paths for getting context menus
740         https://bugs.webkit.org/show_bug.cgi?id=181423
741
742         Reviewed by Joseph Pecoraro.
743
744         What a mess.  We had a code path for asynchronous context menu generation and a different one for synchronous context menu generation.
745         This makes it so there is just one.  At the API level we see if there is an asynchronous delegate to call, then synchronous.
746         There is a subtle theoretical change in behaviour because m_page.contextMenuClient().showContextMenu is now called for the asynchronous
747         case and it wasn't before, but the one C API client that uses this has nullptr as it's WKPageShowContextMenuCallback, so we won't break anything!
748
749         * UIProcess/API/APIContextMenuClient.h:
750         (API::ContextMenuClient::getContextMenuFromProposedMenu):
751         (API::ContextMenuClient::getContextMenuFromProposedMenuAsync): Deleted.
752         * UIProcess/API/C/WKPage.cpp:
753         (WKPageSetPageContextMenuClient):
754         * UIProcess/API/glib/WebKitContextMenuClient.cpp:
755         * UIProcess/WebContextMenuProxy.h:
756         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
757         (WebKit::WebContextMenuProxyGtk::show):
758         (WebKit::WebContextMenuProxyGtk::showContextMenuWithItems):
759         * UIProcess/gtk/WebContextMenuProxyGtk.h:
760         * UIProcess/mac/WebContextMenuProxyMac.h:
761         * UIProcess/mac/WebContextMenuProxyMac.mm:
762         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
763         (WebKit::WebContextMenuProxyMac::showContextMenu):
764         * UIProcess/wpe/WebContextMenuProxyWPE.h:
765
766 2018-01-16  Michael Catanzaro  <mcatanzaro@igalia.com>
767
768         Don't link WebKit target directly to JavaScriptCore
769         https://bugs.webkit.org/show_bug.cgi?id=181688
770
771         Reviewed by Alex Christensen.
772
773         It's safer if we only link to the next lower-layered lib in the stack, so let's just link
774         directly to WebCore instead.
775
776         And WPE doesn't need to specify it twice.
777
778         * CMakeLists.txt:
779         * PlatformMac.cmake:
780         * PlatformWPE.cmake:
781
782 2018-01-16  Eric Carlson  <eric.carlson@apple.com>
783
784         AVSampleBufferDisplayLayer should be flushed when application activates
785         https://bugs.webkit.org/show_bug.cgi?id=181623
786         <rdar://problem/36487738>
787
788         Reviewed by Darin Adler.
789
790         * WebProcess/WebPage/ios/WebPageIOS.mm:
791         (WebKit::WebPage::applicationWillResignActive): Call page.
792         (WebKit::WebPage::applicationDidEnterBackground): Ditto, let it call libWebRTCProvider.
793         (WebKit::WebPage::applicationWillEnterForeground): Call page.
794         (WebKit::WebPage::applicationDidBecomeActive): Ditto, let it call libWebRTCProvider.
795
796 2018-01-16  Zach Li  <zachli@apple.com>
797
798         Add pop-up policy support in website policies.
799         https://bugs.webkit.org/show_bug.cgi?id=181544.
800         rdar://problem/30521400.
801
802         Reviewed by Alex Christensen.
803
804         * Shared/WebsitePoliciesData.cpp: Encode and decode
805         pop-up policy.
806         (WebKit::WebsitePoliciesData::encode const):
807         (WebKit::WebsitePoliciesData::decode):
808         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
809         Apply the pop-up policy from website policies to the
810         document loader.
811
812         * Shared/WebsitePoliciesData.h:
813
814         * Shared/WebsitePopUpPolicy.h:
815         Added for declaring enum WebsitePopUpPolicy.
816
817         * UIProcess/API/APIWforebsitePolicies.cpp:
818         Include pop-up policy in website policies.
819         (API::WebsitePolicies::WebsitePolicies):
820         (API::WebsitePolicies::data):
821         * UIProcess/API/APIWebsitePolicies.h:
822
823         * UIProcess/API/C/WKWebsitePolicies.cpp:
824         Added C API to get and set pop-up policy on
825         website policies.
826         (WKWebsitePoliciesGetPopUpPolicy):
827         (WKWebsitePoliciesSetPopUpPolicy):
828         * UIProcess/API/C/WKWebsitePolicies.h:
829
830         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
831         Added Obj-C API to get and set pop-up policy
832         on website policies.
833         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
834         (-[_WKWebsitePolicies setPopUpPolicy:]):
835         (-[_WKWebsitePolicies popUpPolicy]):
836
837         * WebKit.xcodeproj/project.pbxproj:
838         Added WebsitePopUpPolicy.h.
839
840 2018-01-16  Fujii Hironori  <Hironori.Fujii@sony.com>
841
842         [CMake][Mac] Fix the build errors
843         https://bugs.webkit.org/show_bug.cgi?id=181665
844
845         Reviewed by Alex Christensen.
846
847         * CMakeLists.txt: Added TouchBarMenuData.cpp and TouchBarMenuItemData.cpp to compile.
848         * PlatformMac.cmake: Added _WKApplicationManifest.mm, WKInspectorWKWebView.mm and WKInspectorWindow.mm to compile.
849         * UIProcess/API/Cocoa/WKProcessPool.mm:
850         (-[WKProcessPool _webPageContentProcessCount]): Call WebProcessPool::serviceWorkerProxy() only if ENABLE(SERVICE_WORKER).
851
852 2018-01-16  Wenson Hsieh  <wenson_hsieh@apple.com>
853
854         [Attachment Support] Provide the `src` of an attachment to the UI delegate when an attachment is inserted
855         https://bugs.webkit.org/show_bug.cgi?id=181638
856         <rdar://problem/36508702>
857
858         Reviewed by Dan Bernstein.
859
860         Add a `source` parameter to the `didInsertAttachment` codepath for notifying WebKit2 clients when attachment
861         elements are inserted into the document.
862
863         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
864         * UIProcess/API/Cocoa/WKWebView.mm:
865         (-[WKWebView _didInsertAttachment:withSource:]):
866         (-[WKWebView _didInsertAttachment:]): Deleted.
867         * UIProcess/API/Cocoa/WKWebViewInternal.h:
868         * UIProcess/Cocoa/PageClientImplCocoa.h:
869         * UIProcess/Cocoa/PageClientImplCocoa.mm:
870         (WebKit::PageClientImplCocoa::didInsertAttachment):
871         * UIProcess/PageClient.h:
872         (WebKit::PageClient::didInsertAttachment):
873         * UIProcess/WebPageProxy.cpp:
874         (WebKit::WebPageProxy::didInsertAttachment):
875         * UIProcess/WebPageProxy.h:
876         * UIProcess/WebPageProxy.messages.in:
877         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
878         (WebKit::WebEditorClient::didInsertAttachment):
879         * WebProcess/WebCoreSupport/WebEditorClient.h:
880
881 2018-01-15  Youenn Fablet  <youenn@apple.com>
882
883         ASSERTION FAILED: m_ptr under WebKit::CacheStorage::Caches::writeRecord
884         https://bugs.webkit.org/show_bug.cgi?id=181401
885         <rdar://problem/36379022>
886
887         Reviewed by Darin Adler.
888
889         m_isInitialized is true but m_storage is set to nullptr when calling writeRecord.
890         The only case seems to be if:
891         - We are doing persistent storage
892         - We are traversing the storage to do the initialization. At that point m_storage is set to a correct value.
893         - clearMemoryRepresentation is called, thus setting m_storage to nullptr and m_isInitialized to false.
894         We fix this by making clearMemoryRepresentation a no-op if we are initializing the caches.
895         clearMemoryRepresentation is about cleaning the in-memory information of the caches and the memory representation is empty at init time.
896         Nullifying m_storage is a memory consumption optimization.
897
898         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
899         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
900
901 2018-01-12  Wenson Hsieh  <wenson_hsieh@apple.com>
902
903         Unreviewed, speculative build fix after r226899.
904
905         Add an empty implementation for PageClient::startDrag.
906
907         * UIProcess/PageClient.h:
908         (WebKit::PageClient::startDrag):
909
910 2018-01-12  Brent Fulgham  <bfulgham@apple.com>
911
912         [iOS] Remove unneeded accessibility-related sandbox rules
913         https://bugs.webkit.org/show_bug.cgi?id=181619
914         <rdar://problem/36485356>
915
916         Reviewed by Eric Carlson.
917
918         Remove a number of sandbox exceptions that were in place for accessibility support. These are
919         not needed in the WebContent process, since Safari (not WebKit) handles the accessibility
920         interactions.
921
922         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
923
924 2018-01-12  Keith Rollin  <krollin@apple.com>
925
926         Logged JSON should escape "'s and \'s in strings.
927         https://bugs.webkit.org/show_bug.cgi?id=181608
928
929         Reviewed by Brent Fulgham.
930
931         * NetworkProcess/NetworkResourceLoader.cpp:
932         (WebKit::NetworkResourceLoader::logCookieInformation const):
933
934 2018-01-12  Megan Gardner  <megan_gardner@apple.com>
935
936         Unreviewed, fixing error in UIKitSPI.h.
937
938         * Platform/spi/ios/UIKitSPI.h:
939         
940 2018-01-12  Megan Gardner  <megan_gardner@apple.com>
941
942         Implement MultiDocument protocol for restoring focus to a WKWebView
943         https://bugs.webkit.org/show_bug.cgi?id=181510
944
945         Reviewed by Dan Bernstein.
946
947         Support the UIKit protocol for restoring focus to a what previously had focus.
948         WebKit already knows what node was previously being focused by the DOM, we merely
949         need to be asked to turn the focus on again.
950         Resubmitting https://trac.webkit.org/changeset/226826 as it broke internal builds
951
952         * Platform/spi/ios/UIKitSPI.h:
953         * UIProcess/ios/WKContentViewInteraction.h:
954         * UIProcess/ios/WKContentViewInteraction.mm:
955         (-[WKContentView _restoreFocusWithToken:]):
956         (-[WKContentView _preserveFocusWithToken:destructively:]):
957
958 2018-01-12  Youenn Fablet  <youenn@apple.com>
959
960         WebProcess should pass the registration identifier and not the worker identifier for fetch events
961         https://bugs.webkit.org/show_bug.cgi?id=181591
962
963         Reviewed by Chris Dumez.
964
965         Use service worker registration identifier to compute the active service worker identifier responsible to handle the fetch event.
966
967         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
968         (WebKit::WebSWServerConnection::startFetch):
969         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
970         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
971         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
972         (WebKit::ServiceWorkerClientFetch::start):
973         * WebProcess/Storage/WebSWClientConnection.cpp:
974         (WebKit::WebSWClientConnection::startFetch):
975         * WebProcess/Storage/WebSWClientConnection.h:
976         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
977         (WebKit::shouldHandleFetch):
978
979 2018-01-12  Ryan Haddad  <ryanhaddad@apple.com>
980
981         Unreviewed, rolling out r226826.
982
983         Breaks internal builds.
984
985         Reverted changeset:
986
987         "Implement MultiDocument protocol for restoring focus to a
988         WKWebView"
989         https://bugs.webkit.org/show_bug.cgi?id=181510
990         https://trac.webkit.org/changeset/226826
991
992 2018-01-12  Wenson Hsieh  <wenson_hsieh@apple.com>
993
994         [WK2] Unify macOS and iOS codepaths in the UI process when starting a drag
995         https://bugs.webkit.org/show_bug.cgi?id=181574
996
997         Reviewed by Tim Horton.
998
999         Rearrange some macOS drag start logic in the UI process so that it uses the same codepaths in WebPageProxy as
1000         iOS. Namely, startDrag should just forward the DragItem and drag image handle along to the appropriate views on
1001         each platform (WKContentView and WebViewImpl).
1002
1003         There should be no change in behavior.
1004
1005         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1006
1007         Both macOS and iOS now funnel through this method.
1008
1009         * UIProcess/Cocoa/WebViewImpl.h:
1010         * UIProcess/Cocoa/WebViewImpl.mm:
1011         (WebKit::WebViewImpl::startDrag):
1012         (WebKit::WebViewImpl::dragImageForView): Deleted.
1013
1014         Rename dragImageForView to startDrag. Move the call to didStartDrag() here, and call dragCancelled() in the
1015         case where we bailed from starting the drag (due to failing to create a drag image).
1016
1017         * UIProcess/PageClient.h:
1018         * UIProcess/ios/PageClientImplIOS.h:
1019         * UIProcess/ios/PageClientImplIOS.mm:
1020         (WebKit::PageClientImpl::setDragImage): Deleted.
1021
1022         Rename setDragImage to startDrag.
1023
1024         * UIProcess/mac/PageClientImplMac.h:
1025         * UIProcess/mac/PageClientImplMac.mm:
1026         (WebKit::PageClientImpl::startDrag):
1027         (WebKit::PageClientImpl::setDragImage): Deleted.
1028         * UIProcess/mac/WebPageProxyMac.mm:
1029         (WebKit::WebPageProxy::startDrag): Deleted.
1030
1031 2018-01-12  Antoine Quint  <graouts@apple.com>
1032
1033         Add support for the frames() timing function
1034         https://bugs.webkit.org/show_bug.cgi?id=181585
1035         <rdar://problem/36463317>
1036
1037         Reviewed by Dean.
1038
1039         Add the ability to endode and decode the frames() timing function.
1040
1041         * Shared/WebCoreArgumentCoders.cpp:
1042         (IPC::ArgumentCoder<FramesTimingFunction>::encode):
1043         (IPC::ArgumentCoder<FramesTimingFunction>::decode):
1044         * Shared/WebCoreArgumentCoders.h:
1045         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
1046         (WebKit::PlatformCAAnimationRemote::Properties::encode const):
1047         (WebKit::PlatformCAAnimationRemote::Properties::decode):
1048
1049 2018-01-11  Keith Miller  <keith_miller@apple.com>
1050
1051         Rename ENABLE_ASYNC_ITERATION to ENABLE_JS_ASYNC_ITERATION
1052         https://bugs.webkit.org/show_bug.cgi?id=181573
1053
1054         Reviewed by Simon Fraser.
1055
1056         * Configurations/FeatureDefines.xcconfig:
1057
1058 2018-01-11  Brent Fulgham  <bfulgham@apple.com>
1059
1060         REGRESSION(r219530): ResourceLoadStatisticsPersistentStorage should be read-only in ephemeral sessions
1061         https://bugs.webkit.org/show_bug.cgi?id=181136
1062         <rdar://problem/36116604>
1063
1064         Reviewed by Chris Dumez.
1065
1066         Some uses of WebKit involve running a UIProcess as an ephemeral session for the life of the process. In this
1067         case, we do not initialize the data path for the set of load statistics triggering an assertion.
1068
1069         We actually intended ephemeral sessions to consume the existing resource load data (presumably captured during
1070         non-ephemeral browsing). This would be a read-only mode, where it would not add new entries to the load
1071         statistics, but would take advantage of existing observations. Currently that does not happen (for this type
1072         of WebKit embed), which forces each run as an ephemeral session to build up in-memory browsing data until it has
1073         enough observations to begin modifying loads.
1074
1075         We need to set the ResourceLoadStatisticsPersistentStorage object to a "read only" mode in this case, so
1076         that it read (but does not write) from this database.
1077
1078         Tested by ephemeral website data TestWebKitAPI tests.
1079
1080         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
1081         (WebKit::ResourceLoadStatisticsPersistentStorage::create): Added to allow creation of the right style of
1082         Persistent Storage.
1083         (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage): Initialize the
1084         new data member.
1085         (WebKit::ResourceLoadStatisticsPersistentStorage::asyncWriteTimerFired): RELEASE_ASSERT that we never run
1086         this method when in "read only" mode.
1087         (WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk): Ditto.
1088         (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore): Return early if asked to
1089         schedule a write operation for a "read only" persistent store.
1090         (WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously): RELEASE_ASSERT if we
1091         ever shut down in "read only" mode with an active write timer.
1092         * UIProcess/ResourceLoadStatisticsPersistentStorage.h:
1093         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1094         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): Pass a flag indicating whether the
1095         storage session is ephemeral or not.
1096         * UIProcess/WebResourceLoadStatisticsStore.h:
1097
1098 2018-01-11  Keith Rollin  <krollin@apple.com>
1099
1100         Add optional logging of ITP-related user interaction information
1101         https://bugs.webkit.org/show_bug.cgi?id=181556
1102
1103         Reviewed by Brent Fulgham.
1104
1105         In order to support the tracking of the efficacy of Intelligent
1106         Tracking Protection, add some logging indicating when the user
1107         interacts with a page in a way that affects cookie partitioning. This
1108         logging is off by default, and is enabled with `defaults write -g
1109         WebKitLogCookieInformation -bool true`.
1110
1111         * Shared/WebProcessCreationParameters.cpp:
1112         (WebKit::WebProcessCreationParameters::encode const):
1113         (WebKit::WebProcessCreationParameters::decode):
1114         * Shared/WebProcessCreationParameters.h:
1115         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1116         (WebKit::WebProcessPool::platformInitializeWebProcess):
1117         * WebProcess/WebProcess.cpp:
1118         (WebKit::WebProcess::initializeWebProcess):
1119
1120 2018-01-11  Megan Gardner  <megan_gardner@apple.com>
1121
1122         Implement MultiDocument protocol for restoring focus to a WKWebView
1123         https://bugs.webkit.org/show_bug.cgi?id=181510
1124
1125         Reviewed by Dan Bernstein.
1126
1127         Support the UIKit protocol for restoring focus to a what previously had focus.
1128         WebKit already has a method to silently remove and replace focus, without telling the
1129         web process about the unfocus and refocusing, so we're just using that.
1130
1131         * Platform/spi/ios/UIKitSPI.h:
1132         * UIProcess/ios/WKContentViewInteraction.h:
1133         * UIProcess/ios/WKContentViewInteraction.mm:
1134         (-[WKContentView _restoreFocusWithToken:]):
1135         (-[WKContentView _preserveFocusWithToken:destructively:]):
1136
1137
1138 2018-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1139
1140         Don't load inline data when requesting info for an attachment element backed by a file path
1141         https://bugs.webkit.org/show_bug.cgi?id=181550
1142
1143         Reviewed by Tim Horton
1144
1145         See WebCore/ChangeLog for more information.
1146
1147         * UIProcess/API/Cocoa/_WKAttachment.mm:
1148         (-[_WKAttachmentInfo initWithInfo:]):
1149         (-[_WKAttachmentInfo fileLoadingError]):
1150         (-[_WKAttachment requestInfo:]):
1151
1152 2018-01-11  Commit Queue  <commit-queue@webkit.org>
1153
1154         Unreviewed, rolling out r226789 and r226794.
1155         https://bugs.webkit.org/show_bug.cgi?id=181564
1156
1157         broke API tests (Requested by alexchristensen on #webkit).
1158
1159         Reverted changesets:
1160
1161         "Merge sync and async code paths for getting context menus"
1162         https://bugs.webkit.org/show_bug.cgi?id=181423
1163         https://trac.webkit.org/changeset/226789
1164
1165         "Revert changes accidentally committed with r226789."
1166         https://bugs.webkit.org/show_bug.cgi?id=181423
1167         https://trac.webkit.org/changeset/226794
1168
1169 2018-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1170
1171         Send PromisedBlobInfo to the client through DragItem instead of DragClient::prepareToDragPromisedBlob
1172         https://bugs.webkit.org/show_bug.cgi?id=181497
1173
1174         Reviewed by Tim Horton.
1175
1176         Refactor drag and drop support for promised blob data, so that blob info is shipped across to the client layer
1177         via DragItem in the DragClient::startDrag codepath, rather than via a separate prepareToDragPromisedBlob client
1178         codepath that stages promised blob info.
1179
1180         * UIProcess/Cocoa/WebViewImpl.h:
1181         * UIProcess/Cocoa/WebViewImpl.mm:
1182         (WebKit::WebViewImpl::prepareToDragPromisedBlob): Deleted.
1183         * UIProcess/PageClient.h:
1184         (WebKit::PageClient::prepareToDragPromisedBlob): Deleted.
1185         * UIProcess/WebPageProxy.cpp:
1186         (WebKit::WebPageProxy::prepareToDragPromisedBlob): Deleted.
1187         * UIProcess/WebPageProxy.h:
1188         * UIProcess/WebPageProxy.messages.in:
1189         * UIProcess/ios/PageClientImplIOS.h:
1190         * UIProcess/ios/PageClientImplIOS.mm:
1191         (WebKit::PageClientImpl::prepareToDragPromisedBlob): Deleted.
1192         * UIProcess/ios/WKContentViewInteraction.h:
1193         * UIProcess/ios/WKContentViewInteraction.mm:
1194         (-[WKContentView _startDrag:item:]):
1195         * UIProcess/mac/PageClientImplMac.h:
1196         * UIProcess/mac/PageClientImplMac.mm:
1197         (WebKit::PageClientImpl::prepareToDragPromisedBlob): Deleted.
1198         * WebProcess/WebCoreSupport/WebDragClient.cpp:
1199         (WebKit::WebDragClient::prepareToDragPromisedBlob): Deleted.
1200         * WebProcess/WebCoreSupport/WebDragClient.h:
1201         * WebProcess/WebPage/WebPage.cpp:
1202         (WebKit::WebPage::prepareToDragPromisedBlob): Deleted.
1203         * WebProcess/WebPage/WebPage.h:
1204
1205 2018-01-09  Per Arne Vollan  <pvollan@apple.com>
1206
1207         VoiceOver does not work when the WebContent process is using NSRunLoop.
1208         https://bugs.webkit.org/show_bug.cgi?id=181331
1209         <rdar://problem/36408004>
1210
1211         Reviewed by Brent Fulgham.
1212
1213         When the WebContent process is using NSRunLoop instead of the NSApplication run loop,
1214         accessibility must be initialized for VoiceOver to work. This patch also switches to
1215         using NSRunLoop in the WebContent process.
1216
1217         * Configurations/WebContentService.xcconfig:
1218         * Platform/IPC/mac/ConnectionMac.mm:
1219         (IPC::AccessibilityProcessSuspendedNotification): Remove unneccessary workaround.
1220         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist: Switch to NSRunLoop.
1221         * WebProcess/cocoa/WebProcessCocoa.mm:
1222         (WebKit::WebProcess::platformInitializeProcess): Initialize accessibility.
1223
1224 2018-01-11  Don Olmstead  <don.olmstead@sony.com>
1225
1226         WebContextMenuListenerProxy.cpp not including config on first line
1227         https://bugs.webkit.org/show_bug.cgi?id=181552
1228
1229         Reviewed by Alex Christensen.
1230
1231         * UIProcess/WebContextMenuListenerProxy.cpp:
1232
1233 2018-01-11  Youenn Fablet  <youenn@apple.com>
1234
1235         Redirected iframe loading with Request.redirect=follow should fail
1236         https://bugs.webkit.org/show_bug.cgi?id=181491
1237
1238         Reviewed by Alex Christensen.
1239
1240         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1241         (WebKit::ServiceWorkerClientFetch::validateResponse):
1242
1243 2018-01-11  Youenn Fablet  <youenn@apple.com>
1244
1245         Replace WebRTCLegacyAPIDisabled by WebRTCLegacyAPIEnabled and switch off WebRTC legacy flag by default
1246         https://bugs.webkit.org/show_bug.cgi?id=181480
1247
1248         Reviewed by Eric Carlson.
1249
1250         Renaming preference to WebRTCLegacyAPIEnabled for simplification and removing it from experimental feature.
1251         Set it to off by default.
1252
1253         * Shared/WebPreferences.yaml:
1254         * UIProcess/API/C/WKPreferences.cpp:
1255         (WKPreferencesSetWebRTCLegacyAPIEnabled):
1256         (WKPreferencesGetWebRTCLegacyAPIEnabled):
1257         * UIProcess/API/Cocoa/WKPreferences.mm:
1258         (-[WKPreferences _webRTCLegacyAPIEnabled]):
1259         (-[WKPreferences _setWebRTCLegacyAPIEnabled:]):
1260         * UIProcess/WebProcessPool.cpp:
1261         (WebKit::WebProcessPool::ensureNetworkProcess):
1262         * WebProcess/WebPage/WebPage.cpp:
1263         (WebKit::WebPage::updatePreferences):
1264
1265 2018-01-11  Alex Christensen  <achristensen@webkit.org>
1266
1267         Merge sync and async code paths for getting context menus
1268         https://bugs.webkit.org/show_bug.cgi?id=181423
1269
1270         Reviewed by Joseph Pecoraro.
1271
1272         What a mess.  We had a code path for asynchronous context menu generation and a different one for synchronous context menu generation.
1273         This makes it so there is just one.  At the API level we see if there is an asynchronous delegate to call, then synchronous.
1274         There is a subtle theoretical change in behaviour because m_page.contextMenuClient().showContextMenu is now called for the asynchronous
1275         case and it wasn't before, but the one C API client that uses this has nullptr as it's WKPageShowContextMenuCallback, so we won't break anything!
1276
1277         * UIProcess/API/APIContextMenuClient.h:
1278         (API::ContextMenuClient::getContextMenuFromProposedMenu):
1279         (API::ContextMenuClient::getContextMenuFromProposedMenuAsync): Deleted.
1280         * UIProcess/API/C/WKPage.cpp:
1281         (WKPageSetPageContextMenuClient):
1282         * UIProcess/API/glib/WebKitContextMenuClient.cpp:
1283         * UIProcess/WebContextMenuProxy.h:
1284         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
1285         (WebKit::WebContextMenuProxyGtk::show):
1286         (WebKit::WebContextMenuProxyGtk::showContextMenuWithItems):
1287         * UIProcess/gtk/WebContextMenuProxyGtk.h:
1288         * UIProcess/mac/WebContextMenuProxyMac.h:
1289         * UIProcess/mac/WebContextMenuProxyMac.mm:
1290         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
1291         (WebKit::WebContextMenuProxyMac::showContextMenu):
1292         * UIProcess/wpe/WebContextMenuProxyWPE.h:
1293
1294 2018-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1295
1296         [Attachment Support] Support dragging attachment elements out as files on iOS
1297         https://bugs.webkit.org/show_bug.cgi?id=181199
1298         <rdar://problem/36299316>
1299
1300         Reviewed by Tim Horton, Andy Estes and Joseph Pecoraro.
1301
1302         Implement support for registering and beginning a drag with promised blob info. See below for more detail.
1303
1304         * UIProcess/ios/WKContentViewInteraction.mm:
1305         (-[WKDragSessionContext addTemporaryDirectory:]):
1306         (-[WKDragSessionContext cleanUpTemporaryDirectories]):
1307
1308         Introduce WKDragSessionContext, which represents the localContext of a UIDragSession initiated in WebKit. The
1309         blob promise dragging codepath uses this to register temporary directories when saving blob data to a location
1310         on disk; when all data transfers are finished, or if the drag interaction is being reset, we then use
1311         -cleanUpTemporaryDirectories to remove each temporary directory.
1312
1313         (existingLocalDragSessionContext):
1314         (ensureLocalDragSessionContext):
1315
1316         Helper methods to set the UIDragSession's localContext to a WKDragSessionContext and query for any existing
1317         context.
1318
1319         (-[WKContentView cleanupInteraction]):
1320
1321         Before the content view's UIDragInteraction goes away, clean up any temporary directories added to the
1322         UIDragSession.
1323
1324         (-[WKContentView _prepareToDragPromisedBlob:]):
1325
1326         When dragging with a promised blob, register a new item provider on the pasteboard representing the blob data,
1327         along with any additional metadata associated with the blob. For the promise callback, call out to the network
1328         process to write the blob data to a temporary path; when done, call the NSItemProvider's completion handler with
1329         the temporary blob data location.
1330
1331         (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
1332         (-[WKContentView dragInteraction:sessionDidTransferItems:]):
1333
1334         Use this delegate hook as an opportunity to remove any temporary directories created when promised blob data is
1335         requested upon drop. Since we know the drag session that has finished transferring data, we simply ask its local
1336         context (a WKDragSessionContext) to remove any temporary filepaths it has created.
1337
1338 2018-01-10  Jeff Miller  <jeffm@apple.com>
1339
1340         -[WKWebView _web_gestureEventWasNotHandledByWebCore:] should call -_gestureEventWasNotHandledByWebCore:
1341         https://bugs.webkit.org/show_bug.cgi?id=181498
1342
1343         Reviewed by Alex Christensen.
1344
1345         WKView's API contract allows clients to override -_gestureEventWasNotHandledByWebCore:, and -[WKView
1346         _web_gestureEventWasNotHandledByWebCore:] calls -_gestureEventWasNotHandledByWebCore: instead of
1347         invoking WebViewImpl::gestureEventWasNotHandledByWebCoreFromViewOnly() directly. WKWebView should do
1348         the same thing.
1349
1350         * UIProcess/API/Cocoa/WKWebView.mm:
1351         (-[WKWebView _web_gestureEventWasNotHandledByWebCore:]):
1352         Call -_gestureEventWasNotHandledByWebCore:, which will call gestureEventWasNotHandledByWebCoreFromViewOnly().
1353
1354 2018-01-10  Wenson Hsieh  <wenson_hsieh@apple.com>
1355
1356         REGRESSION(r222507): Composition highlight doesn't render when using IME
1357         https://bugs.webkit.org/show_bug.cgi?id=181485
1358         <rdar://problem/35896516>
1359
1360         Reviewed by Ryosuke Niwa.
1361
1362         Add plumbing for a `suppressUnderline` argument when setting marked text.
1363
1364         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1365         (WKBundlePageSetComposition):
1366         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
1367         * WebProcess/WebPage/WebPage.cpp:
1368         (WebKit::WebPage::setCompositionForTesting):
1369         * WebProcess/WebPage/WebPage.h:
1370
1371 2018-01-10  Tim Horton  <timothy_horton@apple.com>
1372
1373         REGRESSION (r213590): Swipe from edge to go to previous page is significantly slower than tapping back button on Twitter
1374         https://bugs.webkit.org/show_bug.cgi?id=181269
1375         <rdar://problem/35110344>
1376
1377         Reviewed by Simon Fraser.
1378
1379         * UIProcess/API/Cocoa/WKWebView.mm:
1380         (-[WKWebView _processDidExit]):
1381         (-[WKWebView _didCommitLayerTree:]):
1382         When swiping to a page that set history.scrollRestoration = "manual",
1383         we will never restore the scroll position. We will still restore
1384         "state", but won't have a location. Currently, the code assumes that
1385         it should wait to remove the swipe snapshot until the scroll position
1386         is restored. Instead, wait until the "state" is restored, whether
1387         or not that includes a scroll position/center point restoration.
1388
1389         Do this by making _firstTransactionIDAfterPageRestore an optional,
1390         and reset it after it fires, so that we only run the restoration code
1391         in _didCommitLayerTree for the first commit after state restoration,
1392         not all subsequent commits. Then, tell ViewGestureController that
1393         the scroll position has been restored even if the page opted out.
1394
1395         The reason that this is specific to pushState is that normal,
1396         non-same-document loads bail from waiting for the scroll position
1397         restoration in VGC::didReachMainFrameLoadTerminalState() (see the long
1398         comment there for an explanation).
1399
1400         (-[WKWebView _beginBackSwipeForTesting]):
1401         (-[WKWebView _completeBackSwipeForTesting]):
1402         * Platform/spi/ios/UIKitSPI.h:
1403         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1404         * UIProcess/Cocoa/ViewGestureController.h:
1405         * UIProcess/ios/ViewGestureControllerIOS.mm:
1406         (-[WKSwipeTransitionController transitionForDirection:]):
1407         (WebKit::ViewGestureController::beginSimulatedSwipeInDirectionForTesting):
1408         (WebKit::ViewGestureController::completeSimulatedSwipeInDirectionForTesting):
1409         * UIProcess/mac/ViewGestureControllerMac.mm:
1410         (WebKit::ViewGestureController::beginSimulatedSwipeInDirectionForTesting):
1411         (WebKit::ViewGestureController::completeSimulatedSwipeInDirectionForTesting):
1412         Add a mechanism to forcefully test swipe back. Instead of simulating
1413         events like on Mac, we just talk to the UIKit internals and force
1414         the interaction to start, pause, and then complete when we want.
1415
1416 2018-01-10  Brent Fulgham  <bfulgham@apple.com>
1417
1418         Use protectedThis for the 'updatePrevalentDomainsToPartitionOrBlockCookies' lambda
1419         https://bugs.webkit.org/show_bug.cgi?id=181452
1420         <rdar://problem/36416912>
1421         
1422         Reviewed by Chris Dumez.
1423
1424         We forgot to use a 'protectedThis' back in r225006 for one of the lambdas used by
1425         the WebsiteDataStore for processing.
1426
1427         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1428         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
1429
1430 2018-01-09  John Wilander  <wilander@apple.com>
1431
1432         Storage Access API: Turn feature on by default in WebPreferences.yaml
1433         https://bugs.webkit.org/show_bug.cgi?id=181458
1434
1435         Reviewed by Brent Fulgham.
1436
1437         * Shared/WebPreferences.yaml:
1438
1439 2018-01-09  Alex Christensen  <achristensen@webkit.org>
1440
1441         WKOpenPanelParameters SPI should return autoreleased objects
1442         https://bugs.webkit.org/show_bug.cgi?id=181457
1443         <rdar://problem/35884960>
1444
1445         Reviewed by Tim Horton.
1446
1447         In r226607 I made a mistake by returning an object that has been released.
1448         I instead follow a pattern of leaking and autoreleasing that we use elsewhere in the ObjC API.
1449
1450         * UIProcess/API/Cocoa/WKOpenPanelParameters.mm:
1451         (-[WKOpenPanelParameters _acceptedMIMETypes]):
1452         (-[WKOpenPanelParameters _acceptedFileExtensions]):
1453
1454 2018-01-09  Dan Bernstein  <mitz@apple.com>
1455
1456         Removed some empty directories that were left behind
1457
1458         * WebProcess/Cookies/cf: Removed.
1459         * WebProcess/ios: Removed.
1460
1461 2018-01-09  Paul Knight  <pknight@apple.com>
1462
1463         Don't record dynamic spelling corrections while in an ephemeral browsing session
1464         https://bugs.webkit.org/show_bug.cgi?id=181417
1465         <rdar://problem/33309104>
1466
1467         Dynamic spelling correction responses are kept on disk. Avoid recording
1468         these responses when in an ephemeral session.
1469
1470         Reviewed by Tim Horton and Wenson Hsieh.
1471
1472         * UIProcess/mac/CorrectionPanel.h:
1473         * UIProcess/mac/CorrectionPanel.mm:
1474         (WebKit::CorrectionPanel::recordAutocorrectionResponse):
1475             Add a WebViewImpl parameter so we can query the current session.
1476             Return early before recording the response if the session is
1477             ephemeral.
1478         (WebKit::CorrectionPanel::handleAcceptedReplacement):
1479             Update a caller to include the new parameter.
1480         * UIProcess/mac/PageClientImplMac.mm:
1481         (WebKit::PageClientImpl::recordAutocorrectionResponse):
1482             Ditto.
1483
1484 2018-01-09  Carlos Garcia Campos  <cgarcia@igalia.com>
1485
1486         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.5 release.
1487
1488         * gtk/NEWS: Add release notes for 2.19.5.
1489
1490 2018-01-09  Carlos Garcia Campos  <cgarcia@igalia.com>
1491
1492         [GTK] Missing symbols exported in 2.19.4
1493         https://bugs.webkit.org/show_bug.cgi?id=181433
1494
1495         Reviewed by Michael Catanzaro.
1496
1497         Add missing WEBKIT_API to webkit_dom_dom_window_webkit_message_handlers_post_message().
1498
1499         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.h:
1500         * webkitglib-symbols.map: Remove webkit_media_player_debug from local.
1501
1502 2018-01-09  Youenn Fablet  <youenn@apple.com>
1503
1504         SWClientConnection should not keep references to service worker jobs
1505         https://bugs.webkit.org/show_bug.cgi?id=181381
1506
1507         Reviewed by Chris Dumez.
1508
1509         Updated IPC handling based on WebCore refactoring.
1510
1511         * Scripts/webkit/messages.py:
1512         (forward_declarations_and_headers):
1513         (headers_for_type):
1514         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1515         (WebKit::WebSWServerConnection::rejectJobInClient):
1516         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
1517         (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
1518         (WebKit::WebSWServerConnection::startScriptFetchInClient):
1519         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1520         * WebProcess/Storage/WebSWClientConnection.messages.in:
1521
1522 2018-01-09  Carlos Garcia Campos  <cgarcia@igalia.com>
1523
1524         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.4 release.
1525
1526         * gtk/NEWS: Add release notes for 2.19.4.
1527
1528 2018-01-09  Ali Juma  <ajuma@chromium.org>
1529
1530         Implement VisualViewport API events
1531         https://bugs.webkit.org/show_bug.cgi?id=179386
1532
1533         Reviewed by Frédéric Wang.
1534
1535         Change the default value of the VisualViewportAPI experimental feature flag to
1536         DEFAULT_EXPERIMENTAL_FEATURES_ENABLED. This patch completes the implementation
1537         of this feature as specified by https://wicg.github.io/visual-viewport/, so this
1538         feature is now ready for wider testing.
1539
1540         * Shared/WebPreferences.yaml:
1541
1542 2018-01-08  Alex Christensen  <achristensen@webkit.org>
1543
1544         Add WKNavigationDelegate SPI exposing WebProcess crash reason
1545         https://bugs.webkit.org/show_bug.cgi?id=181410
1546         <rdar://problem/36167199>
1547
1548         Reviewed by Wenson Hsieh.
1549
1550         We exposed it in the C SPI.
1551
1552         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1553         * UIProcess/Cocoa/NavigationState.h:
1554         * UIProcess/Cocoa/NavigationState.mm:
1555         (WebKit::NavigationState::setNavigationDelegate):
1556         (WebKit::toWKProcessTerminationReason):
1557         (WebKit::NavigationState::NavigationClient::processDidTerminate):
1558
1559 2018-01-08  Alex Christensen  <achristensen@webkit.org>
1560
1561         Make ObjC SPI equivalent to WKPageNavigationClient.decidePolicyForPluginLoad
1562         https://bugs.webkit.org/show_bug.cgi?id=181413
1563         <rdar://problem/36169005>
1564
1565         Reviewed by Wenson Hsieh.
1566
1567         * UIProcess/API/APINavigationClient.h:
1568         (API::NavigationClient::decidePolicyForPluginLoad):
1569         * UIProcess/API/C/WKPage.cpp:
1570         (WKPageSetPageNavigationClient):
1571         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1572         * UIProcess/Cocoa/NavigationState.h:
1573         * UIProcess/Cocoa/NavigationState.mm:
1574         (WebKit::NavigationState::setNavigationDelegate):
1575         (WebKit::toPluginModuleLoadPolicy):
1576         (WebKit::toWKPluginModuleLoadPolicy):
1577         (WebKit::NavigationState::NavigationClient::decidePolicyForPluginLoad):
1578         * UIProcess/WebPageProxy.cpp:
1579         (WebKit::WebPageProxy::findPlugin):
1580
1581 2018-01-08  Ryosuke Niwa  <rniwa@webkit.org>
1582
1583         iOS build fix attempt after r226602.
1584
1585         * UIProcess/API/C/WKContextMenuListener.cpp:
1586         (WKContextMenuListenerUseContextMenuItems):
1587
1588 2018-01-08  Alex Christensen  <achristensen@webkit.org>
1589
1590         Add SPI for WKOpenPanelParameters._acceptedMIMETypes and _acceptedFileExtensions
1591         https://bugs.webkit.org/show_bug.cgi?id=181408
1592         <rdar://problem/35884960>
1593
1594         Reviewed by Tim Horton.
1595
1596         * UIProcess/API/Cocoa/WKOpenPanelParameters.mm:
1597         (-[WKOpenPanelParameters _acceptedMIMETypes]):
1598         (-[WKOpenPanelParameters _acceptedFileExtensions]):
1599         * UIProcess/API/Cocoa/WKOpenPanelParametersInternal.h:
1600         * UIProcess/API/Cocoa/WKOpenPanelParametersPrivate.h: Added.
1601         * WebKit.xcodeproj/project.pbxproj:
1602
1603 2018-01-08  Commit Queue  <commit-queue@webkit.org>
1604
1605         Unreviewed, rolling out r226532 and r226540.
1606         https://bugs.webkit.org/show_bug.cgi?id=181422
1607
1608         jessie says basic browsing does not seem to work (Requested by
1609         alexchristensen on #webkit).
1610
1611         Reverted changesets:
1612
1613         "Add CSP support to service workers"
1614         https://bugs.webkit.org/show_bug.cgi?id=181385
1615         https://trac.webkit.org/changeset/226532
1616
1617         "SWClientConnection should not keep references to service
1618         worker jobs"
1619         https://bugs.webkit.org/show_bug.cgi?id=181381
1620         https://trac.webkit.org/changeset/226540
1621
1622 2018-01-08  Wenson Hsieh  <wenson_hsieh@apple.com>
1623
1624         [Attachment Support] Expose file name and content type of WKAttachment
1625         https://bugs.webkit.org/show_bug.cgi?id=181390
1626         <rdar://problem/36336837>
1627
1628         Reviewed by Tim Horton.
1629
1630         Add support for -[_WKAttachment requestInfo:], which fetches a snapshot of the attachment's state. This API is
1631         meant to be a replacement for -requestData: that provides additional metadata about the attachment.
1632
1633         * Scripts/webkit/messages.py:
1634         (headers_for_type):
1635         * Shared/WebCoreArgumentCoders.cpp:
1636         (IPC::ArgumentCoder<AttachmentInfo>::encode):
1637         (IPC::ArgumentCoder<AttachmentInfo>::decode):
1638         * Shared/WebCoreArgumentCoders.h:
1639
1640         Add IPC support for AttachmentInfo. Note that instead of using (encode|decode)SharedBuffer, we send and receive
1641         data references to the shared buffer.
1642
1643         * UIProcess/API/APIAttachment.cpp:
1644         (API::Attachment::requestInfo):
1645         (API::Attachment::requestData): Deleted.
1646         * UIProcess/API/APIAttachment.h:
1647
1648         Change requestData to requestInfo.
1649
1650         * UIProcess/API/Cocoa/_WKAttachment.h:
1651         * UIProcess/API/Cocoa/_WKAttachment.mm:
1652         (-[_WKAttachmentInfo initWithInfo:]):
1653         (-[_WKAttachmentInfo data]):
1654         (-[_WKAttachmentInfo name]):
1655         (-[_WKAttachmentInfo filePath]):
1656         (-[_WKAttachmentInfo contentType]):
1657         (-[_WKAttachment requestInfo:]):
1658         (-[_WKAttachment requestData:]):
1659
1660         Implement -requestInfo: by calling into APIAttachment, and reimplement -requestData: in terms of -requestInfo:.
1661
1662         * UIProcess/WebPageProxy.cpp:
1663         (WebKit::WebPageProxy::attachmentInfoCallback):
1664         (WebKit::WebPageProxy::requestAttachmentInfo):
1665         (WebKit::WebPageProxy::sharedBufferCallback): Deleted.
1666         (WebKit::WebPageProxy::requestAttachmentData): Deleted.
1667         * UIProcess/WebPageProxy.h:
1668         * UIProcess/WebPageProxy.messages.in:
1669
1670         Rename the SharedBufferCallback IPC message to AttachmentInfoCallback, and make it conditional on
1671         ATTACHMENT_ELEMENT. Rename requestAttachmentData to requestAttachmentInfo.
1672
1673         * WebProcess/WebPage/WebPage.cpp:
1674         (WebKit::WebPage::requestAttachmentInfo):
1675         (WebKit::WebPage::invokeSharedBufferCallback): Deleted.
1676         (WebKit::WebPage::requestAttachmentData): Deleted.
1677
1678         Rename requestAttachmentData to requestAttachmentInfo and adopt HTMLAttachmentElement::requestInfo.
1679
1680         * WebProcess/WebPage/WebPage.h:
1681         * WebProcess/WebPage/WebPage.messages.in:
1682
1683 2018-01-08  Alex Christensen  <achristensen@webkit.org>
1684
1685         Pass around Vector<Ref<WebContextMenuItem>> instead of WKArrayRef or Vector<WebContextMenuItemData>
1686         https://bugs.webkit.org/show_bug.cgi?id=181419
1687
1688         Reviewed by Tim Horton.
1689
1690         Passing a WKArrayRef to an API object is messy and was preventing me from moving things around and making ObjC SPI.
1691         No change in behavior.  Just using different layering abstractions for the same data.
1692
1693         * UIProcess/API/C/WKContextMenuListener.cpp:
1694         (WKContextMenuListenerUseContextMenuItems):
1695         * UIProcess/WebContextMenuListenerProxy.cpp:
1696         (WebKit::WebContextMenuListenerProxy::useContextMenuItems):
1697         * UIProcess/WebContextMenuListenerProxy.h:
1698         * UIProcess/WebContextMenuProxy.h:
1699         * UIProcess/mac/WebContextMenuProxyMac.h:
1700         * UIProcess/mac/WebContextMenuProxyMac.mm:
1701         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
1702         (WebKit::WebContextMenuProxyMac::showContextMenu):
1703
1704 2018-01-08  John Wilander  <wilander@apple.com>
1705
1706         Storage Access API: Remove access for all frames under a page when the page is closed
1707         https://bugs.webkit.org/show_bug.cgi?id=181398
1708         <rdar://problem/36357879>
1709
1710         Reviewed by Alex Christensen.
1711
1712         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1713         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage):
1714         * NetworkProcess/NetworkConnectionToWebProcess.h:
1715         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1716         * WebProcess/WebPage/WebPage.cpp:
1717         (WebKit::WebPage::close):
1718
1719 2018-01-08  Youenn Fablet  <youenn@apple.com>
1720
1721         SWClientConnection should not keep references to service worker jobs
1722         https://bugs.webkit.org/show_bug.cgi?id=181381
1723
1724         Reviewed by Chris Dumez.
1725
1726         Updated IPC handling based on WebCore refactoring.
1727
1728         * Scripts/webkit/messages.py:
1729         (forward_declarations_and_headers):
1730         (headers_for_type):
1731         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1732         (WebKit::WebSWServerConnection::rejectJobInClient):
1733         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
1734         (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
1735         (WebKit::WebSWServerConnection::startScriptFetchInClient):
1736         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1737         * WebProcess/Storage/WebSWClientConnection.messages.in:
1738
1739 2018-01-08  Joseph Pecoraro  <pecoraro@apple.com>
1740
1741         [Cocoa] Web Inspector: Provide a way for clients to check if an NSWindow is a Web Inspector window
1742         https://bugs.webkit.org/show_bug.cgi?id=181361
1743         <rdar://problem/36332865>
1744
1745         Reviewed by Darin Adler.
1746
1747         * WebKit.xcodeproj/project.pbxproj:
1748         New files.
1749
1750         * Shared/API/Cocoa/_WKNSWindowExtras.h: Added.
1751         * Shared/API/Cocoa/_WKNSWindowExtras.mm: Added.
1752         (-[NSWindow _web_isWebInspectorWindow]):
1753         Method to determing if a window is being used for Web Inspector content.
1754
1755         * UIProcess/mac/WKInspectorWindow.h: Added.
1756         * UIProcess/mac/WKInspectorWindow.mm: Added.
1757         Named subclass so we can use isKindOfClass.
1758
1759         * UIProcess/mac/WebInspectorProxyMac.mm:
1760         (WebKit::WebInspectorProxy::createFrontendWindow):
1761         Use the named subclass.
1762
1763 2018-01-08  Tim Horton  <timothy_horton@apple.com>
1764
1765         Build fix for WKPDFView
1766         https://bugs.webkit.org/show_bug.cgi?id=181399
1767         <rdar://problem/36311915>
1768
1769         Reviewed by Simon Fraser.
1770
1771         * UIProcess/ios/WKPDFView.mm:
1772         Disable deprecation warnings in this whole file.
1773
1774 2018-01-08  Youenn Fablet  <youenn@apple.com>
1775
1776         Caches::writeCachesToDisk should assert that it is initialized
1777         https://bugs.webkit.org/show_bug.cgi?id=181383
1778
1779         Reviewed by Alex Christensen.
1780
1781         Add assertion to ensure caches is initialized
1782
1783         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1784         (WebKit::CacheStorage::Caches::writeCachesToDisk):
1785
1786 2018-01-08  Youenn Fablet  <youenn@apple.com>
1787
1788         WebProcessPool::terminateServiceWorkerProcess should protect itself in debug builds
1789         https://bugs.webkit.org/show_bug.cgi?id=181384
1790
1791         Reviewed by Chris Dumez.
1792
1793         * UIProcess/WebProcessPool.cpp:
1794         (WebKit::WebProcessPool::terminateServiceWorkerProcess):
1795
1796 2018-01-08  Frederic Wang  <fwang@igalia.com>
1797
1798         Unreviewed build fix after r226211.
1799
1800         * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Use WK_IOS_TBA for iOS.
1801
1802 2018-01-08  Youenn Fablet  <youenn@apple.com>
1803
1804         navigator.onLine does not work inside service workers
1805         https://bugs.webkit.org/show_bug.cgi?id=181079
1806         <rdar://problem/36178606>
1807
1808         Reviewed by Darin Adler.
1809
1810         Added support for a callback called for each service worker proxy creation.
1811         Callback is used by WTR to inject a self.internals object used for testing.
1812
1813         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1814         (WKBundleSetServiceWorkerProxyCreationCallback):
1815         * WebProcess/InjectedBundle/API/c/WKBundle.h:
1816         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1817         (WebKit::InjectedBundle::setServiceWorkerProxyCreationCallback):
1818         * WebProcess/InjectedBundle/InjectedBundle.h:
1819
1820 2018-01-07  David Kilzer  <ddkilzer@apple.com>
1821
1822         Enable -Wcast-qual for WebInspectorUI, WebKitLegacy, WebKit projects
1823         <https://webkit.org/b/181256>
1824         <rdar://problem/36281730>
1825
1826         Reviewed by Darin Adler.
1827
1828         * Configurations/Base.xcconfig:
1829         (WARNING_CFLAGS): Add -Wcast-qual.
1830         * NetworkProcess/cache/NetworkCacheCodersCocoa.cpp:
1831         (WTF::Persistence::encodeCertificateChain): Include
1832         TypeCastsCF.h from WTF, and use
1833         checked_cf_cast<SecCertificateRef>() to fix warning.
1834         * Platform/cocoa/WKCrashReporter.mm:
1835         (WebKit::setCrashReportApplicationSpecificInformation):
1836         - Move `oldMessage` check above nullptr check to fix a leak when
1837           passing in nullptr after previously setting the crash string.
1838         - Change C-style cast to const_cast<char*>() to fix warning.
1839         * PluginProcess/mac/PluginProcessShim.mm:
1840         (WebKit::shim_shmat): Change C-style cast to
1841         const_cast<void*>() to fix warning.
1842         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
1843         (WebKit::leafCertificate): Include TypeCastsCF.h from
1844         WTF, and use checked_cf_cast<SecCertificateRef>() to fix
1845         warning.
1846         * Shared/cf/ArgumentCodersCF.cpp:
1847         (IPC::encode): Use static_cast<>(const_cast<void*>() to
1848         fix warnings since the CFTypeID has already been
1849         checked.
1850         * Shared/mac/WebCoreArgumentCodersMac.mm:
1851         (IPC::decodeNSError): Use an `auto` variable to hold the
1852         CFMutableDictionaryRef, then WTFMove() to assign it back to
1853         `userInfo`.
1854         * UIProcess/Cocoa/WebViewImpl.mm:
1855         (WebKit::takeWindowSnapshot): Include TypeCastsCF.h from
1856         WTF, and use checked_cf_cast<CGImageRef>() to fix
1857         warning.
1858
1859 2018-01-07  Konstantin Tokarev  <annulen@yandex.ru>
1860
1861         [cmake] Unset CMAKE_REQUIRED_LIBRARIES after check_function_exists test
1862         https://bugs.webkit.org/show_bug.cgi?id=181371
1863
1864         Reviewed by Michael Catanzaro.
1865
1866         This variable is used by check_function_exists internally, its value
1867         should be never used for anything else.
1868
1869         * CMakeLists.txt:
1870
1871 2018-01-05  Dan Bernstein  <mitz@apple.com>
1872
1873         REGRESSION (r226218): iOS-only assets are installed on macOS
1874         https://bugs.webkit.org/show_bug.cgi?id=181362
1875
1876         Reviewed by Anders Carlsson.
1877
1878         * Configurations/WebKit.xcconfig: Exclude everything under Resources/ios when not targeting
1879           iOS.
1880
1881         * Resources/ios: Added.
1882         * Resources/ios/iOS.xcassets: Moved from Source/WebKit/WebKit.xcassets.
1883         * Resources/ios/iOS.xcassets/LockMini.imageset/NavigationBarLockMini@2x.pdf: Set the
1884           svn:mime-type property.
1885         * Resources/ios/iOS.xcassets/LockMini.imageset/NavigationBarLockMini@3x.pdf: Ditto.
1886
1887         * Resources/mac: Added.
1888         * Resources/mac/mediaIcon.pdf: Moved here…
1889         * Resources/mediaIcon.pdf: …from here.
1890
1891         * WebKit.xcassets: Moved under Resources/ios.
1892
1893         * WebKit.xcodeproj/project.pbxproj: Created an ios group under the Resources group, and
1894           cleaned up the mac group. Removed the Recovered References group.
1895
1896 2018-01-05  John Wilander  <wilander@apple.com>
1897
1898         Storage Access API: Refactor to make naming accurate and explicit, simplify access table, and prepare for access removal for page
1899         https://bugs.webkit.org/show_bug.cgi?id=181357
1900         <rdar://problem/36331031>
1901
1902         Reviewed by Alex Christensen.
1903
1904         This change does the following:
1905         - Changes function and message names to reflect how this feature
1906           was eventually implemented, i.e. access per frame.
1907         - Makes it explicit that the UI process is only involved in
1908           granting storage access and not removing storage access.
1909           The latter is done directly by the web process.
1910         - Simplifies the network process' entry map since only needs to
1911           be able to give access to one domain in one frame at a time.
1912           Access goes away on frame navigation so there can only be one
1913           domain at a time per frame. Also, the map now uses pageIDs as
1914           main keys to prepare for efficient access removal for all
1915           frames under a page.
1916         - Fixes a bug in so that a cross-origin iframe with the same
1917           partition as the top frame correctly is handled as already
1918           having access.
1919
1920         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1921         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
1922         (WebKit::NetworkConnectionToWebProcess::removeStorageAccess): Deleted.
1923         * NetworkProcess/NetworkConnectionToWebProcess.h:
1924         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1925         * NetworkProcess/NetworkProcess.cpp:
1926         (WebKit::NetworkProcess::hasStorageAccessForFrame):
1927         (WebKit::NetworkProcess::grantStorageAccessForFrame):
1928         (WebKit::NetworkProcess::hasStorageAccessForPrevalentDomains): Deleted.
1929         (WebKit::NetworkProcess::updateStorageAccessForPrevalentDomains): Deleted.
1930         * NetworkProcess/NetworkProcess.h:
1931         * NetworkProcess/NetworkProcess.messages.in:
1932         * UIProcess/Network/NetworkProcessProxy.cpp:
1933         (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
1934         (WebKit::NetworkProcessProxy::grantStorageAccessForFrame):
1935         (WebKit::NetworkProcessProxy::hasStorageAccessForPrevalentDomains): Deleted.
1936         (WebKit::NetworkProcessProxy::updateStorageAccessForPrevalentDomains): Deleted.
1937         * UIProcess/Network/NetworkProcessProxy.h:
1938         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1939         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1940         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
1941         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
1942         * UIProcess/WebResourceLoadStatisticsStore.h:
1943         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1944         (WebKit::WebsiteDataStore::hasStorageAccessForFrameHandler):
1945         (WebKit::WebsiteDataStore::grantStorageAccessForFrameHandler):
1946         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
1947         (WebKit::WebsiteDataStore::hasStorageAccessForPrevalentDomainsHandler): Deleted.
1948         (WebKit::WebsiteDataStore::updateStorageAccessForPrevalentDomainsHandler): Deleted.
1949         * UIProcess/WebsiteData/WebsiteDataStore.h:
1950         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1951         (WebKit::WebFrameLoaderClient::detachedFromParent2):
1952         (WebKit::WebFrameLoaderClient::dispatchWillChangeDocument):
1953
1954 2018-01-05  Youenn Fablet  <youenn@apple.com>
1955
1956         Implement Cache API partitioning based on ClientOrigin
1957         https://bugs.webkit.org/show_bug.cgi?id=181240
1958
1959         Reviewed by Alex Christensen.
1960
1961         open and retrieveCaches now take a ClientOrigin instead of a String.
1962         Updated cache filesystem path computation to take both client origin and top origin.
1963
1964         When clearing an origin, caches whose client origin or top origin matches the origin are cleared.
1965         Caches are added to the web site data of their client origin with their corresponding cache size.
1966         Caches are added to the web site data of their top origin with a size equal to 0.
1967
1968         Updated memory representation dumping used for test to include both top and client origins.
1969
1970         * NetworkProcess/NetworkProcess.cpp:
1971         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
1972         * NetworkProcess/cache/CacheStorageEngine.cpp:
1973         (WebKit::CacheStorage::Engine::cachesRootPath):
1974         (WebKit::CacheStorage::Engine::open):
1975         (WebKit::CacheStorage::Engine::remove):
1976         (WebKit::CacheStorage::Engine::retrieveCaches):
1977         (WebKit::CacheStorage::Engine::readCachesFromDisk):
1978         (WebKit::CacheStorage::Engine::removeCaches):
1979         (WebKit::CacheStorage::Engine::fetchEntries):
1980         (WebKit::CacheStorage::Engine::clearCachesForOrigin):
1981         (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
1982         (WebKit::CacheStorage::Engine::representation):
1983         * NetworkProcess/cache/CacheStorageEngine.h:
1984         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
1985         (WebKit::CacheStorage::Cache::Cache):
1986         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1987         (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory):
1988         (WebKit::CacheStorage::Caches::Caches):
1989         (WebKit::CacheStorage::Caches::storeOrigin):
1990         (WebKit::CacheStorage::Caches::readOrigin):
1991         (WebKit::CacheStorage::Caches::open):
1992         * NetworkProcess/cache/CacheStorageEngineCaches.h:
1993         (WebKit::CacheStorage::Caches::create):
1994         (WebKit::CacheStorage::Caches::origin const):
1995         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
1996         (WebKit::CacheStorageEngineConnection::open):
1997         (WebKit::CacheStorageEngineConnection::caches):
1998         (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
1999         * NetworkProcess/cache/CacheStorageEngineConnection.h:
2000         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
2001         * WebProcess/Cache/WebCacheStorageConnection.cpp:
2002         (WebKit::WebCacheStorageConnection::doOpen):
2003         (WebKit::WebCacheStorageConnection::doRetrieveCaches):
2004         (WebKit::WebCacheStorageConnection::clearMemoryRepresentation):
2005         * WebProcess/Cache/WebCacheStorageConnection.h:
2006
2007 2018-01-05  Megan Gardner  <megan_gardner@apple.com>
2008
2009         Show Keyboard when re-launching WKWebView with a previously focused element
2010         https://bugs.webkit.org/show_bug.cgi?id=181353
2011
2012         Reviewed by Tim Horton.
2013
2014         When relaunching an app with a WKWebView, restore the keyboard if there was a previously
2015         focused element that was being assisted. The element was already being tracked, we just
2016         needed to not bail on showing the keyboard for instances where it was a state change that
2017         caused the element to be refocused.
2018
2019         * UIProcess/PageClient.h:
2020         * UIProcess/WebPageProxy.h:
2021         * UIProcess/WebPageProxy.messages.in:
2022         * UIProcess/ios/PageClientImplIOS.h:
2023         * UIProcess/ios/PageClientImplIOS.mm:
2024         (WebKit::PageClientImpl::startAssistingNode):
2025         * UIProcess/ios/WKContentView.h:
2026         * UIProcess/ios/WKContentViewInteraction.h:
2027         * UIProcess/ios/WKContentViewInteraction.mm:
2028         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2029         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): Deleted.
2030         * UIProcess/ios/WebPageProxyIOS.mm:
2031         (WebKit::WebPageProxy::startAutoscrollAtPosition):
2032         (WebKit::WebPageProxy::startAssistingNode):
2033         * WebProcess/WebPage/WebPage.cpp:
2034         (WebKit::WebPage::setActivityState):
2035         (WebKit::WebPage::elementDidFocus):
2036         * WebProcess/WebPage/WebPage.h:
2037
2038 2018-01-05  Alex Christensen  <achristensen@webkit.org>
2039
2040         Restrict navigation-time WKWebsiteDataStore swapping to main frame navigations
2041         https://bugs.webkit.org/show_bug.cgi?id=181217
2042
2043         Reviewed by Tim Horton.
2044
2045         If we swap during an iframe navigation, then we get a page in a strange state.
2046         The intent of the main frame navigation WKWebsiteDataStore swap is that
2047         that is a time when we can change storages without a page in an inconsistent state.
2048
2049         * UIProcess/Cocoa/NavigationState.mm:
2050         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2051
2052 2018-01-05  Alex Christensen  <achristensen@webkit.org>
2053
2054         Add WKBundleFrameCreateFrameHandle
2055         https://bugs.webkit.org/show_bug.cgi?id=181232
2056         <rdar://problem/35926696>
2057
2058         Reviewed by Tim Horton.
2059
2060         InjectedBundle clients wanting to sent a _WKFrameHandle cannot without this function.
2061         Before, they would just send the WKBundleFrameRef which would be changed into a WKFrameRef
2062         in the UIProcess by WebProcessProxy::transformHandlesToObjects, but there is no ObjC equivalent
2063         of WKFrameRef, so we were just getting a WKObject when we wanted a _WKFrameHandle.
2064         We can't change WebProcessProxy::transformHandlesToObjects without being incompatible with the 
2065         existing C API, so let's add a way for clients to say "I want a _WKFrameHandle".
2066
2067         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2068         (WKBundleFrameCreateFrameHandle):
2069         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2070
2071 2018-01-05  Wenson Hsieh  <wenson_hsieh@apple.com>
2072
2073         [Attachment Support] Add a way to write blob data to a file URL from the UI process
2074         https://bugs.webkit.org/show_bug.cgi?id=181236
2075
2076         Reviewed by Brady Eidson.
2077
2078         Add support for writing a blob to a designated file path. In WebKit, this is mainly plumbing writeBlobToFilePath
2079         through WebPageProxy to the network process.
2080
2081         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2082         (WebKit::NetworkBlobRegistry::writeBlobToFilePath):
2083
2084         Call out to the BlobRegistryImpl to write blobs to the file path. Additionally grant sandbox extensions for any
2085         file-backed blob parts corresponding to the given blob URL.
2086
2087         (WebKit::NetworkBlobRegistry::filesInBlob):
2088
2089         Introduce a version of filesInBlob that doesn't check against the NetworkConnectionToWebProcess. This is used
2090         when the UI process is the driver for writing a blob.
2091
2092         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
2093         * NetworkProcess/NetworkProcess.cpp:
2094         (WebKit::NetworkProcess::writeBlobToFilePath):
2095
2096         Temporarily grant sandbox access to the given file path.
2097
2098         * NetworkProcess/NetworkProcess.h:
2099         * NetworkProcess/NetworkProcess.messages.in:
2100         * Shared/WebCoreArgumentCoders.cpp:
2101         (IPC::ArgumentCoder<PromisedBlobInfo>::encode):
2102         (IPC::ArgumentCoder<PromisedBlobInfo>::decode):
2103         (IPC::ArgumentCoder<PromisedBlobData>::encode): Deleted.
2104         (IPC::ArgumentCoder<PromisedBlobData>::decode): Deleted.
2105
2106         Remove PromisedBlobData (see WebCore/ChangeLog for more information).
2107
2108         * Shared/WebCoreArgumentCoders.h:
2109         * UIProcess/Network/NetworkProcessProxy.cpp:
2110         (WebKit::NetworkProcessProxy::didClose):
2111
2112         If the network process is terminated, flush any pending callbacks in m_writeBlobToFilePathCallbackMap, passing
2113         in a failure result (success := false) and clearing the callback map.
2114
2115         (WebKit::NetworkProcessProxy::writeBlobToFilePath):
2116         (WebKit::NetworkProcessProxy::didWriteBlobToFilePath):
2117         * UIProcess/Network/NetworkProcessProxy.h:
2118         * UIProcess/Network/NetworkProcessProxy.messages.in:
2119         * UIProcess/WebPageProxy.cpp:
2120         (WebKit::WebPageProxy::writeBlobToFilePath):
2121         * UIProcess/WebPageProxy.h:
2122
2123 2018-01-05  Dan Bernstein  <mitz@apple.com>
2124
2125         Add injected bundle equivalents of DOMHTMLDocument (DOMHTMLDocumentExtensions)
2126         https://bugs.webkit.org/show_bug.cgi?id=181345
2127
2128         Reviewed by Tim Horton.
2129
2130         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h: Declared new methods.
2131         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
2132         (-[WKDOMDocument createDocumentFragmentWithMarkupString:baseURL:]): Added. Calls WebCore’s
2133           createFragmentFromMarkup.
2134         (-[WKDOMDocument createDocumentFragmentWithText:]): Added. Calls WebCore’s
2135           createFragmentFromText.
2136
2137 2018-01-05  Don Olmstead  <don.olmstead@sony.com>
2138
2139         [Curl] Add implementation stubs for Network Cache
2140         https://bugs.webkit.org/show_bug.cgi?id=181343
2141
2142         Reviewed by Alex Christensen.
2143
2144         * NetworkProcess/cache/NetworkCacheCodersCurl.cpp: Added.
2145         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode):
2146         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
2147         * NetworkProcess/cache/NetworkCacheDataCurl.cpp: Added.
2148         (WebKit::NetworkCache::Data::Data):
2149         (WebKit::NetworkCache::Data::empty):
2150         (WebKit::NetworkCache::Data::data const):
2151         (WebKit::NetworkCache::Data::isNull const):
2152         (WebKit::NetworkCache::Data::apply const):
2153         (WebKit::NetworkCache::Data::subrange const):
2154         (WebKit::NetworkCache::concatenate):
2155         (WebKit::NetworkCache::Data::adoptMap):
2156         * NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp: Added.
2157         (WebKit::NetworkCache::IOChannel::IOChannel):
2158         (WebKit::NetworkCache::IOChannel::~IOChannel):
2159         (WebKit::NetworkCache::IOChannel::open):
2160         (WebKit::NetworkCache::IOChannel::read):
2161         (WebKit::NetworkCache::IOChannel::write):
2162         * PlatformWin.cmake:
2163
2164 2018-01-05  Don Olmstead  <don.olmstead@sony.com>
2165
2166         [Curl] Update method declarations in WebKit
2167         https://bugs.webkit.org/show_bug.cgi?id=181342
2168
2169         Reviewed by Alex Christensen.
2170
2171         * NetworkProcess/Downloads/curl/DownloadCurl.cpp:
2172         (WebKit::Download::resume):
2173         * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp:
2174         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Deleted.
2175         (WebKit::RemoteNetworkingContext::blockedError const): Deleted.
2176
2177 2018-01-05  Don Olmstead  <don.olmstead@sony.com>
2178
2179         WebFullScreenManager should compile when ENABLE(VIDEO) is off
2180         https://bugs.webkit.org/show_bug.cgi?id=181338
2181
2182         Reviewed by Alex Christensen.
2183
2184         * WebProcess/FullScreen/WebFullScreenManager.cpp:
2185         (WebKit::WebFullScreenManager::didEnterFullScreen):
2186         (WebKit::WebFullScreenManager::willExitFullScreen):
2187         * WebProcess/FullScreen/WebFullScreenManager.h:
2188
2189 2018-01-05  Andy Estes  <aestes@apple.com>
2190
2191         [Apple Pay] Disable Apple Pay on platforms that don't have PassKit.framework
2192         https://bugs.webkit.org/show_bug.cgi?id=181335
2193         <rdar://problem/36311296>
2194
2195         Reviewed by Brady Eidson.
2196
2197         When Safari is running in the macOS Base System, PassKit.framework is not available.
2198         If we fail to dlopen PassKit, we should disable Apple Pay.
2199
2200         * UIProcess/API/C/WKPreferences.cpp:
2201         (WKPreferencesSetApplePayEnabled):
2202         * UIProcess/API/Cocoa/WKWebView.mm:
2203         (-[WKWebView _initializeWithConfiguration:]):
2204         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
2205         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2206         (WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks):
2207         (WebKit::WebPaymentCoordinatorProxy::platformSupportsPayments):
2208
2209 2018-01-05  Dan Bernstein  <mitz@apple.com>
2210
2211         Fixed the build following AppKit API deprecations in a recent SDKs
2212
2213         * UIProcess/mac/WKFullScreenWindowController.mm:
2214         (-[WKFullScreenWindowController enterFullScreen:]): Suppressed deprecation warnings.
2215         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Ditto.
2216         (-[WKFullScreenWindowController exitFullScreen]): Ditto.
2217         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Ditto.
2218         (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]): Ditto.
2219         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]): Ditto.
2220         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]): Ditto.
2221         * UIProcess/mac/WKPrintingView.mm:
2222         (-[WKPrintingView _setAutodisplay:]): Ditto.
2223
2224 2018-01-05  Matt Lewis  <jlewis3@apple.com>
2225
2226         Unreviewed, rolling out r226401.
2227
2228         This caused timeouts on multiple platforms.
2229
2230         Reverted changeset:
2231
2232         "Implement Cache API partitioning based on ClientOrigin"
2233         https://bugs.webkit.org/show_bug.cgi?id=181240
2234         https://trac.webkit.org/changeset/226401
2235
2236 2018-01-05  Joseph Pecoraro  <pecoraro@apple.com>
2237
2238         ServiceWorkers: Enable UserTiming / ResourceTiming
2239         https://bugs.webkit.org/show_bug.cgi?id=181297
2240         <rdar://problem/36307306>
2241
2242         Reviewed by Youenn Fablet.
2243
2244         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2245         (WebKit::WebSWContextManagerConnection::updatePreferencesStore):
2246         Enable Resource Timing / User Timing for the ServiceWorker process.
2247
2248 2018-01-04  Zan Dobersek  <zdobersek@igalia.com>
2249
2250         Unreviewed GTK+ build fix.
2251
2252         * UIProcess/API/glib/WebKitUserMediaPermissionRequest.cpp:
2253         (webkit_user_media_permission_is_for_audio_device):
2254         Call UserMediaPermissionRequestProxy::requiresAudioCapture().
2255         (webkit_user_media_permission_is_for_video_device):
2256         Call UserMediaPermissionRequestProxy::requiresVideoCapture().
2257
2258 2018-01-04  Don Olmstead  <don.olmstead@sony.com>
2259
2260         [Curl] Fix compilation error in WebFrameNetworkingContext
2261         https://bugs.webkit.org/show_bug.cgi?id=181312
2262
2263         Reviewed by Alex Christensen.
2264
2265         * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.cpp:
2266         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
2267
2268 2018-01-04  Tim Horton  <timothy_horton@apple.com>
2269
2270         WKWebView loses minimum layout size overrides that happen while the process is terminated
2271         https://bugs.webkit.org/show_bug.cgi?id=181306
2272         <rdar://problem/34398288>
2273
2274         Reviewed by Dan Bernstein.
2275
2276         * Shared/WebPageCreationParameters.cpp:
2277         (WebKit::WebPageCreationParameters::encode const):
2278         (WebKit::WebPageCreationParameters::decode):
2279         * Shared/WebPageCreationParameters.h:
2280         * UIProcess/API/Cocoa/WKWebView.mm:
2281         (-[WKWebView _didRelaunchProcess]): Deleted.
2282         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2283         * UIProcess/WebPageProxy.cpp:
2284         (WebKit::WebPageProxy::creationParameters):
2285         * UIProcess/WebPageProxy.h:
2286         * UIProcess/ios/PageClientImplIOS.mm:
2287         (WebKit::PageClientImpl::didRelaunchProcess):
2288         * UIProcess/ios/WebPageProxyIOS.mm:
2289         (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
2290         (WebKit::WebPageProxy::setForceAlwaysUserScalable):
2291         (WebKit::WebPageProxy::setMaximumUnobscuredSize):
2292         * WebProcess/WebPage/WebPage.cpp:
2293         (WebKit::WebPage::WebPage):
2294         Pass the current viewport minimum layout size and maximum unobscured size
2295         in the WebPageCreationParameters instead of re-sending them in _didRelaunchProcess.
2296
2297         The previous approach was problematic when _dispatchSetMinimumLayoutSize:
2298         was changed to not re-send identical updates, because if the client calls 
2299         _overrideLayoutParametersWithMinimumLayoutSize before the Web Content process
2300         is re-launched (after terminating), we would cache the size, attempt to send it,
2301         fail silently (because the process is not launched), and then in _didRelaunchProcess
2302         we would choose not to re-send (after the process is successfully relaunched)
2303         because we think we already sent the new value.
2304
2305         Add isValid() checks to our message sends. Ideally send() would assert
2306         if the process is not alive to avoid problems like this, but it doesn't (yet).
2307
2308         Get rid of WKWebView's _didRelaunchProcess, because it does nothing now.
2309
2310 2018-01-04  Stephan Szabo  <stephan.szabo@sony.com>
2311
2312         NetworkProcess cache files use functions from unistd.h without explicitly including it
2313         https://bugs.webkit.org/show_bug.cgi?id=181261
2314
2315         Reviewed by Alex Christensen.
2316
2317         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
2318         * NetworkProcess/cache/NetworkCacheData.cpp:
2319
2320 2018-01-04  Keith Rollin  <krollin@apple.com>
2321
2322         Add commas
2323         https://bugs.webkit.org/show_bug.cgi?id=181295
2324         <rdar://problem/35802295>
2325
2326         Reviewed by Brent Fulgham.
2327
2328         Fix a problem introduced in r226226 where the emitted JSON didn't
2329         include some required commas.
2330
2331         * NetworkProcess/NetworkResourceLoader.cpp:
2332         (WebKit::NetworkResourceLoader::logCookieInformation const):
2333
2334 2018-01-04  Eric Carlson  <eric.carlson@apple.com>
2335
2336         [MediaStream] Add Mock screen capture source
2337         https://bugs.webkit.org/show_bug.cgi?id=181291
2338         <rdar://problem/36298164>
2339
2340         Reviewed by Dean Jackson.
2341
2342         * Shared/WebCoreArgumentCoders.cpp:
2343         (IPC::ArgumentCoder<MediaConstraints>::decode):
2344         (IPC::ArgumentCoder<CaptureDevice>::encode): Deleted, moved to CaptureDevice.h
2345         (IPC::ArgumentCoder<CaptureDevice>::decode): Ditto.
2346         * Shared/WebCoreArgumentCoders.h:
2347
2348         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add _WKCaptureDeviceDisplay.
2349         * UIProcess/Cocoa/UIDelegate.mm:
2350         (WebKit::requestUserMediaAuthorizationForDevices): Deal with display capture.
2351         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Ditto.
2352
2353         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2354         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): requiresAudio -> requiresAudioCapture.
2355         (WebKit::UserMediaPermissionRequestManagerProxy::searchForGrantedRequest const): Never reuse
2356         a previously granted display capture request.
2357
2358         * UIProcess/UserMediaPermissionRequestProxy.cpp:
2359         (WebKit::UserMediaPermissionRequestProxy::allow): Search the eligible devices instead of asking
2360         the source center to find devices.
2361         * UIProcess/UserMediaPermissionRequestProxy.h:
2362         (WebKit::UserMediaPermissionRequestProxy::requiresAudioCapture const): Renamed.
2363         (WebKit::UserMediaPermissionRequestProxy::requiresVideoCapture const): Ditto.
2364         (WebKit::UserMediaPermissionRequestProxy::requiresDisplayCapture const): New.
2365         (WebKit::UserMediaPermissionRequestProxy::requiresAudio const): Deleted.
2366         (WebKit::UserMediaPermissionRequestProxy::requiresVideo const): Deleted.
2367
2368 2018-01-04  Youenn Fablet  <youenn@apple.com>
2369
2370         FetchResponse should set its internal response text encoding name
2371         https://bugs.webkit.org/show_bug.cgi?id=181284
2372
2373         Reviewed by Alex Christensen.
2374
2375         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2376         (WebKit::ServiceWorkerClientFetch::didReceiveResponse): Set default encoding to UTF-8.
2377
2378 2018-01-04  Youenn Fablet  <youenn@apple.com>
2379
2380         Implement Cache API partitioning based on ClientOrigin
2381         https://bugs.webkit.org/show_bug.cgi?id=181240
2382
2383         Reviewed by Alex Christensen.
2384
2385         open and retrieveCaches now take a ClientOrigin instead of a String.
2386         Updated cache filesystem path computation to take both client origin and top origin.
2387
2388         When clearing an origin, caches whose client origin or top origin matches the origin are cleared.
2389         Caches are added to the web site data of their client origin with their corresponding cache size.
2390         Caches are added to the web site data of their top origin with a size equal to 0.
2391
2392         Updated memory representation dumping used for test to include both top and client origins.
2393
2394         * NetworkProcess/NetworkProcess.cpp:
2395         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
2396         * NetworkProcess/cache/CacheStorageEngine.cpp:
2397         (WebKit::CacheStorage::Engine::cachesRootPath):
2398         (WebKit::CacheStorage::Engine::open):
2399         (WebKit::CacheStorage::Engine::remove):
2400         (WebKit::CacheStorage::Engine::retrieveCaches):
2401         (WebKit::CacheStorage::Engine::readCachesFromDisk):
2402         (WebKit::CacheStorage::Engine::removeCaches):
2403         (WebKit::CacheStorage::Engine::fetchEntries):
2404         (WebKit::CacheStorage::Engine::clearCachesForOrigin):
2405         (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
2406         (WebKit::CacheStorage::Engine::representation):
2407         * NetworkProcess/cache/CacheStorageEngine.h:
2408         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
2409         (WebKit::CacheStorage::Cache::Cache):
2410         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2411         (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory):
2412         (WebKit::CacheStorage::Caches::Caches):
2413         (WebKit::CacheStorage::Caches::storeOrigin):
2414         (WebKit::CacheStorage::Caches::readOrigin):
2415         (WebKit::CacheStorage::Caches::open):
2416         * NetworkProcess/cache/CacheStorageEngineCaches.h:
2417         (WebKit::CacheStorage::Caches::create):
2418         (WebKit::CacheStorage::Caches::origin const):
2419         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
2420         (WebKit::CacheStorageEngineConnection::open):
2421         (WebKit::CacheStorageEngineConnection::caches):
2422         (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
2423         * NetworkProcess/cache/CacheStorageEngineConnection.h:
2424         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
2425         * WebProcess/Cache/WebCacheStorageConnection.cpp:
2426         (WebKit::WebCacheStorageConnection::doOpen):
2427         (WebKit::WebCacheStorageConnection::doRetrieveCaches):
2428         (WebKit::WebCacheStorageConnection::clearMemoryRepresentation):
2429         * WebProcess/Cache/WebCacheStorageConnection.h:
2430
2431 2018-01-04  Youenn Fablet  <youenn@apple.com>
2432
2433         Service Worker should expose redirect mode for navigation loads as manual
2434         https://bugs.webkit.org/show_bug.cgi?id=181067
2435
2436         Reviewed by Alex Christensen.
2437
2438         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2439         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
2440
2441 2018-01-03  Wenson Hsieh  <wenson_hsieh@apple.com>
2442
2443         [Attachment Support] Create attachment elements when dropping files on iOS
2444         https://bugs.webkit.org/show_bug.cgi?id=181192
2445         <rdar://problem/36280945>
2446
2447         Reviewed by Tim Horton.
2448
2449         Make some minor adjustments for changes to the pasteboard in WebCore. See WebCore/ChangeLog for more detail.
2450         Teaches WebPasteboardProxy et. al. to plumb PasteboardItemInfo from the UI process to the web process via the
2451         new `InformationForItemAtIndex` codepath.
2452
2453         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2454         (WebKit::WebPasteboardProxy::informationForItemAtIndex):
2455         (WebKit::WebPasteboardProxy::getFilenamesForDataInteraction): Deleted.
2456         * UIProcess/WebPasteboardProxy.h:
2457         * UIProcess/WebPasteboardProxy.messages.in:
2458         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2459         (WebKit::WebPlatformStrategies::informationForItemAtIndex):
2460         (WebKit::WebPlatformStrategies::getFilenamesForDataInteraction): Deleted.
2461         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2462
2463 2018-01-03  Ting-Wei Lan  <lantw44@gmail.com>
2464
2465         Replace hard-coded paths in shebangs with #!/usr/bin/env
2466         https://bugs.webkit.org/show_bug.cgi?id=181040
2467
2468         Reviewed by Alex Christensen.
2469
2470         * Scripts/generate-forwarding-headers.pl:
2471
2472 2018-01-03  Wenson Hsieh  <wenson_hsieh@apple.com>
2473
2474         [Attachment Support] Add plumbing for starting a drag with promised blob data
2475         https://bugs.webkit.org/show_bug.cgi?id=181201
2476
2477         Reviewed by Tim Horton.
2478
2479         Add boilerplate plumbing for PrepareToDragPromisedBlob, which delivers blob promises to the UI process when
2480         dragging, respectively.
2481
2482         * Scripts/webkit/messages.py:
2483         (headers_for_type):
2484         * Shared/WebCoreArgumentCoders.cpp:
2485         (IPC::encodeTypesAndData):
2486         (IPC::decodeTypesAndData):
2487         (IPC::ArgumentCoder<PasteboardWebContent>::encode):
2488         (IPC::ArgumentCoder<PasteboardWebContent>::decode):
2489         (IPC::ArgumentCoder<PasteboardImage>::encode):
2490         (IPC::ArgumentCoder<PasteboardImage>::decode):
2491         (IPC::ArgumentCoder<PromisedBlobInfo>::encode):
2492         (IPC::ArgumentCoder<PromisedBlobInfo>::decode):
2493
2494         Add IPC support PromisedBlobInfo's additionalTypes and additionalData.
2495
2496         (IPC::encodeClientTypesAndData): Deleted.
2497         (IPC::decodeClientTypesAndData): Deleted.
2498
2499         Rename these helper functions and move them to the top of the file.
2500
2501         * UIProcess/Cocoa/WebViewImpl.h:
2502         * UIProcess/Cocoa/WebViewImpl.mm:
2503         (WebKit::WebViewImpl::prepareToDragPromisedBlob):
2504         * UIProcess/PageClient.h:
2505         (WebKit::PageClient::prepareToDragPromisedBlob):
2506         * UIProcess/WebPageProxy.cpp:
2507         (WebKit::WebPageProxy::prepareToDragPromisedBlob):
2508         * UIProcess/WebPageProxy.h:
2509         * UIProcess/WebPageProxy.messages.in:
2510         * UIProcess/ios/PageClientImplIOS.h:
2511         * UIProcess/ios/PageClientImplIOS.mm:
2512         (WebKit::PageClientImpl::prepareToDragPromisedBlob):
2513         * UIProcess/ios/WKContentViewInteraction.h:
2514         * UIProcess/ios/WKContentViewInteraction.mm:
2515         (-[WKContentView _prepareToDragPromisedBlob:]):
2516         * UIProcess/mac/PageClientImplMac.h:
2517         * UIProcess/mac/PageClientImplMac.mm:
2518         (WebKit::PageClientImpl::prepareToDragPromisedBlob):
2519         * WebProcess/WebCoreSupport/WebDragClient.cpp:
2520         (WebKit::WebDragClient::prepareToDragPromisedBlob):
2521         * WebProcess/WebCoreSupport/WebDragClient.h:
2522         * WebProcess/WebPage/WebPage.cpp:
2523         (WebKit::WebPage::prepareToDragPromisedBlob):
2524         * WebProcess/WebPage/WebPage.h:
2525
2526 2018-01-03  David Kilzer  <ddkilzer@apple.com>
2527
2528         REGRESSION (r212929): WKSnapshotConfiguration may leak an NSNumber when deallocated
2529         <https://webkit.org/b/181274>
2530
2531         Reviewed by Joseph Pecoraro.
2532
2533         * UIProcess/API/Cocoa/WKSnapshotConfiguration.mm:
2534         (-[WKSnapshotConfiguration dealloc]): Implement method and
2535         release _snapshotWidth.
2536
2537 2018-01-03  John Wilander  <wilander@apple.com>
2538
2539         Storage Access API: Refactor XPC for access removal to go straight from the web process to the network process
2540         https://bugs.webkit.org/show_bug.cgi?id=181270
2541         <rdar://problem/36289544>
2542
2543         Reviewed by Alex Christensen.
2544
2545         This change refactors how the web process tells the network process
2546         to remove storage access. Previously, this was done over the UI process
2547         just like requests for storage access. But since no further reasoning
2548         is needed, the message should go straight from the web process to the
2549         network process for performance reasons and to minimize the risk of a
2550         race.
2551
2552         As a consequence, the XPC code for storage access removal in the UI
2553         process is deleted.
2554
2555         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2556         (WebKit::NetworkConnectionToWebProcess::removeStorageAccess):
2557         * NetworkProcess/NetworkConnectionToWebProcess.h:
2558         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2559         * NetworkProcess/NetworkProcess.cpp:
2560         (WebKit::NetworkProcess::removeStorageAccess): Deleted.
2561         * NetworkProcess/NetworkProcess.h:
2562         * NetworkProcess/NetworkProcess.messages.in:
2563         * UIProcess/Network/NetworkProcessProxy.cpp:
2564         (WebKit::NetworkProcessProxy::removeStorageAccess): Deleted.
2565         * UIProcess/Network/NetworkProcessProxy.h:
2566         * UIProcess/WebPageProxy.cpp:
2567         (WebKit::WebPageProxy::requestStorageAccess):
2568         (WebKit::WebPageProxy::removeStorageAccess): Deleted.
2569         * UIProcess/WebPageProxy.h:
2570         * UIProcess/WebPageProxy.messages.in:
2571         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2572         (WebKit::WebsiteDataStore::requestStorageAccess):
2573         (WebKit::WebsiteDataStore::removeStorageAccess): Deleted.
2574         * UIProcess/WebsiteData/WebsiteDataStore.h:
2575         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2576         (WebKit::WebFrameLoaderClient::detachedFromParent2):
2577         (WebKit::WebFrameLoaderClient::dispatchWillChangeDocument):
2578
2579 2018-01-03  David Kilzer  <ddkilzer@apple.com>
2580
2581         com.apple.WebKit.Networking crash in com.apple.Foundation: -[__NSOperationInternal _start:]
2582         <https://webkit.org/b/181272>
2583         <rdar://problem/35657310>
2584
2585         Reviewed by Alex Christensen.
2586
2587         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2588         (downgradeRequest): Remove unnecessary -autorelease.
2589
2590 2018-01-03  Brent Fulgham  <bfulgham@apple.com>
2591
2592         [macOS] Constant frame dropping during Flash video playback
2593         https://bugs.webkit.org/show_bug.cgi?id=181249
2594         <rdar://problem/34843448>
2595
2596         Reviewed by Eric Carlson.
2597
2598         Review of logs during jerky flash video playback shows a few IOKit properties are being blocked by the sandbox,
2599         which prevents some high-efficiency codecs from being used. Add 'AppleGVAKeyDoesNotExist', 'IODVDBundleName', and
2600         'IOGVA*Encode' to the whitelist.
2601
2602         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2603
2604 2018-01-03  Michael Catanzaro  <mcatanzaro@igalia.com>
2605
2606         [GTK] Add web process API to detect when form is submitted via JavaScript
2607         https://bugs.webkit.org/show_bug.cgi?id=173915
2608
2609         Reviewed by Carlos Garcia Campos.
2610
2611         Epiphany relies on the DOM submit event to detect when a form has been submitted. However,
2612         for historical reasons, the submit event is not emitted when a form is submitted by
2613         JavaScript. It is therefore not currently possible for a web browser to reliably detect form
2614         submission and not possible to implement a robust password storage feature. In order to
2615         avoid this problem, this patch adds a new WebKitWebPage signal, will-submit-form, that
2616         browsers can use in preference to a DOM event listener.
2617
2618         Unfortunately, this signal is not available for WPE because it depends on the DOM API.
2619
2620         There are two submission events, WEBKIT_FORM_SUBMISSION_WILL_SEND_DOM_EVENT and
2621         WEBKIT_FORM_SUBMISSION_WILL_COMPLETE. WEBKIT_FORM_SUBMISSION_WILL_SEND_DOM_EVENT
2622         occurs earlier than WEBKIT_FORM_SUBMISSION_WILL_COMPLETE and can be used to retrieve form
2623         values before websites receive the DOM submit event. This is useful as some websites like
2624         to delete form values right before a submit would normally happen in order to attempt to
2625         defeat browser password managers. There are two tricks to note: JavaScript can cancel form
2626         submission immediately after this event occurs (by returning false in an onsubmit handler),
2627         and, for historical reasons, this event will not occur at all when form submission is
2628         triggered by JavaScript. WEBKIT_FORM_SUBMISSION_WILL_COMPLETE occurs next, and is more
2629         straightforward: it is always emitted when a form is about to be submitted, when it is too
2630         late to cancel.
2631
2632         The recommended way to reliably retrieve password form values would be to watch for both
2633         events, use the form value detected in WEBKIT_FORM_SUBMISSION_WILL_SEND_DOM_EVENT
2634         if that event is emitted, and use the value detected later in
2635         WEBKIT_FORM_SUBMISSION_WILL_COMPLETE otherwise.
2636
2637         Since one of the signal arguments is an enum, we now have to run glib-mkenums for the web
2638         process API. And that has resulted in this patch also adding GType goo for
2639         WebKitConsoleMessageLevel and WebKitConsoleMessageSource that was previously missing. Any
2640         applications that for some unlikely reason want to use these enums in properties or signals
2641         will be happy.
2642
2643         * PlatformGTK.cmake:
2644         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2645         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
2646         (webkit_web_page_class_init):
2647         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h:
2648         * WebProcess/InjectedBundle/API/gtk/WebKitWebProcessEnumTypes.cpp.template: Added.
2649         * WebProcess/InjectedBundle/API/gtk/WebKitWebProcessEnumTypes.h.template: Added.
2650
2651 2018-01-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2652
2653         Unreviewed. Really fix plugin process after r226327.
2654
2655         * PluginProcess/unix/PluginProcessMainUnix.cpp:
2656
2657 2018-01-02  Brent Fulgham  <bfulgham@apple.com>
2658
2659         [macOS, iOS] Adopt new secure coding APIs in WebKit
2660         https://bugs.webkit.org/show_bug.cgi?id=181085
2661         <rdar://problem/34837397>
2662
2663         Reviewed by Tim Horton.
2664
2665         Update WebKit code to use NSSecureCoding when the underlying operating system supports it. Use new
2666         wrapper functions so the same code can be built on all supported OS releases, while enabling
2667         seure coding when possible.
2668
2669         Note that NSView-based classes cannot be migrated at present due to AppKit not supporting NSSecureCoding
2670         in its class hierarchy.
2671
2672         Tested by exising TestWebKitAPI tests for Coding and data transfer.
2673
2674         * Platform/ios/AccessibilityIOS.mm:
2675         (WebKit::newAccessibilityRemoteToken): Encode using NSSecureCoding.
2676         * UIProcess/API/Cocoa/WKPreferences.h:
2677         * UIProcess/API/Cocoa/WKPreferences.mm:
2678         (+[WKPreferences supportsSecureCoding]): Added to enable NSSecureCoding.
2679         * UIProcess/API/Cocoa/WKProcessPool.h:
2680         * UIProcess/API/Cocoa/WKProcessPool.mm:
2681         (+[WKProcessPool supportsSecureCoding]): Ditto.
2682         * UIProcess/API/Cocoa/WKUserContentController.h:
2683         * UIProcess/API/Cocoa/WKUserContentController.mm:
2684         (+[WKUserContentController supportsSecureCoding]): Ditto.
2685         * UIProcess/API/Cocoa/WKWebView.mm:
2686         (-[WKWebView initWithCoder:]): Use coding initialization that supports secure coding if
2687         it is available in the supplied class.
2688         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
2689         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2690         (+[WKWebViewConfiguration supportsSecureCoding]): Added to enable NSSecureCoding.
2691         (-[WKWebViewConfiguration initWithCoder:]): Use secure coding when possible.
2692         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
2693         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2694         (+[WKWebsiteDataStore supportsSecureCoding]): Added to enable NSSecureCoding.
2695         * UIProcess/API/Cocoa/_WKApplicationManifest.h:
2696         * UIProcess/API/Cocoa/_WKApplicationManifest.mm:
2697         (+[_WKApplicationManifest supportsSecureCoding]): Added to enable NSSecureCoding.
2698         (-[_WKApplicationManifest initWithCoder:]): Use secure coding when possible.
2699
2700 2017-12-28  Yusuke Suzuki  <utatane.tea@gmail.com>
2701
2702         Remove std::chrono completely
2703         https://bugs.webkit.org/show_bug.cgi?id=181186
2704
2705         Reviewed by Alex Christensen.
2706
2707         Use MonotonicTime, WallTime, and Seconds instead.
2708         Changes are mechanical ones.
2709
2710         * NetworkProcess/NetworkProcess.cpp:
2711         (WebKit::NetworkProcess::deleteWebsiteData):
2712         * NetworkProcess/NetworkProcess.h:
2713         * NetworkProcess/NetworkProcess.messages.in:
2714         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2715         (WebKit::CacheStorage::Caches::clear):
2716         * NetworkProcess/cache/NetworkCache.cpp:
2717         (WebKit::NetworkCache::responseHasExpired):
2718         (WebKit::NetworkCache::responseNeedsRevalidation):
2719         (WebKit::NetworkCache::makeStoreDecision):
2720         (WebKit::NetworkCache::Cache::clear):
2721         (WebKit::NetworkCache::Cache::storeData):
2722         * NetworkProcess/cache/NetworkCache.h:
2723         * NetworkProcess/cache/NetworkCacheEntry.cpp:
2724         (WebKit::NetworkCache::Entry::Entry):
2725         (WebKit::NetworkCache::Entry::asJSON const):
2726         * NetworkProcess/cache/NetworkCacheEntry.h:
2727         (WebKit::NetworkCache::Entry::timeStamp const):
2728         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
2729         (WebKit::NetworkCache::fileTimes):
2730         (WebKit::NetworkCache::updateFileModificationTimeIfNeeded):
2731         * NetworkProcess/cache/NetworkCacheFileSystem.h:
2732         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
2733         (WebKit::NetworkCache::IOChannel::IOChannel):
2734         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2735         (WebKit::NetworkCache::responseNeedsRevalidation):
2736         (WebKit::NetworkCache::canRevalidate):
2737         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2738         (WebKit::NetworkCache::Storage::readRecord):
2739         (WebKit::NetworkCache::Storage::clear):
2740         (WebKit::NetworkCache::computeRecordWorth):
2741         * NetworkProcess/cache/NetworkCacheStorage.h:
2742         Bump the cache version. We now change the data in persistent cache.
2743         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
2744         (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
2745         (WebKit::NetworkCache::SubresourcesEntry::SubresourcesEntry):
2746         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
2747         (WebKit::NetworkCache::SubresourceInfo::lastSeen const):
2748         (WebKit::NetworkCache::SubresourceInfo::firstSeen const):
2749         (WebKit::NetworkCache::SubresourcesEntry::timeStamp const):
2750         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2751         (WebKit::NetworkProcess::clearHSTSCache):
2752         (WebKit::clearNSURLCache):
2753         (WebKit::NetworkProcess::clearDiskCache):
2754         * NetworkProcess/curl/NetworkProcessCurl.cpp:
2755         (WebKit::NetworkProcess::clearDiskCache):
2756         * NetworkProcess/mac/NetworkProcessMac.mm:
2757         (WebKit::NetworkProcess::clearCacheForAllOrigins):
2758         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2759         (WebKit::NetworkProcess::clearCacheForAllOrigins):
2760         (WebKit::NetworkProcess::clearDiskCache):
2761         * Platform/IPC/ArgumentCoders.cpp:
2762         (IPC::ArgumentCoder<WallTime>::encode):
2763         (IPC::ArgumentCoder<WallTime>::decode):
2764         (IPC::ArgumentCoder<std::chrono::system_clock::time_point>::encode): Deleted.
2765         (IPC::ArgumentCoder<std::chrono::system_clock::time_point>::decode): Deleted.
2766         * Platform/IPC/ArgumentCoders.h:
2767         * PluginProcess/PluginProcess.cpp:
2768         (WebKit::PluginProcess::deleteWebsiteData):
2769         * PluginProcess/PluginProcess.h:
2770         * PluginProcess/PluginProcess.messages.in:
2771         * Scripts/webkit/messages.py:
2772         (headers_for_type):
2773         * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
2774         (WebKit::RemoteLayerBackingStore::lastDisplayTime const):
2775         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
2776         (WebKit::RemoteLayerBackingStore::RemoteLayerBackingStore):
2777         (WebKit::RemoteLayerBackingStore::display):
2778         * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.h:
2779         * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.mm:
2780         (WebKit::RemoteLayerBackingStoreCollection::markBackingStoreVolatile):
2781         (WebKit::RemoteLayerBackingStoreCollection::volatilityTimerFired):
2782         * Shared/WebCoreArgumentCoders.cpp:
2783         (IPC::ArgumentCoder<RecentSearch>::decode):
2784         (IPC::ArgumentCoder<WallTime>::encode): Deleted.
2785         (IPC::ArgumentCoder<WallTime>::decode): Deleted.
2786         * Shared/WebCoreArgumentCoders.h:
2787         * StorageProcess/StorageProcess.cpp:
2788         (WebKit::StorageProcess::deleteWebsiteData):
2789         * StorageProcess/StorageProcess.h:
2790         * StorageProcess/StorageProcess.messages.in:
2791         * UIProcess/API/C/WKApplicationCacheManager.cpp:
2792         (WKApplicationCacheManagerDeleteAllEntries):
2793         * UIProcess/API/C/WKCookieManager.cpp:
2794         (WKCookieManagerDeleteAllCookiesModifiedAfterDate):
2795         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
2796         (WKKeyValueStorageManagerDeleteAllEntries):
2797         * UIProcess/API/C/WKResourceCacheManager.cpp:
2798         (WKResourceCacheManagerClearCacheForAllOrigins):
2799         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2800         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
2801         (WKWebsiteDataStoreStatisticsClearThroughWebsiteDataRemoval):
2802         (WKWebsiteDataStoreRemoveAllFetchCaches):
2803         (WKWebsiteDataStoreRemoveAllIndexedDatabases):
2804         (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):
2805         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2806         (toSystemClockTime):
2807         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]):
2808         * UIProcess/API/glib/WebKitWebContext.cpp:
2809         (webkit_web_context_clear_cache):
2810         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
2811         (webkit_website_data_manager_clear):
2812         * UIProcess/DrawingAreaProxy.h:
2813         * UIProcess/Network/NetworkProcessProxy.cpp:
2814         (WebKit::NetworkProcessProxy::deleteWebsiteData):
2815         * UIProcess/Network/NetworkProcessProxy.h:
2816         * UIProcess/Plugins/PluginProcessManager.cpp:
2817         (WebKit::PluginProcessManager::deleteWebsiteData):
2818         * UIProcess/Plugins/PluginProcessManager.h:
2819         * UIProcess/Plugins/PluginProcessProxy.cpp:
2820         (WebKit::PluginProcessProxy::deleteWebsiteData):
2821         * UIProcess/Plugins/PluginProcessProxy.h:
2822         * UIProcess/Storage/StorageProcessProxy.cpp:
2823         (WebKit::StorageProcessProxy::deleteWebsiteData):
2824         * UIProcess/Storage/StorageProcessProxy.h:
2825         * UIProcess/WebCookieManagerProxy.cpp:
2826         (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince):
2827         * UIProcess/WebCookieManagerProxy.h:
2828         * UIProcess/WebProcessProxy.cpp:
2829         (WebKit::WebProcessProxy::deleteWebsiteData):
2830         * UIProcess/WebProcessProxy.h:
2831         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2832         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
2833         * UIProcess/WebResourceLoadStatisticsStore.h:
2834         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
2835         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
2836         * UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
2837         * UIProcess/WebStorage/StorageManager.cpp:
2838         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
2839         * UIProcess/WebStorage/StorageManager.h:
2840         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2841         (WebKit::WebsiteDataStore::platformRemoveRecentSearches):
2842         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2843         (WebKit::WebsiteDataStore::removeData):
2844         (WebKit::WebsiteDataStore::removeMediaKeys):
2845         * UIProcess/WebsiteData/WebsiteDataStore.h:
2846         * UIProcess/gtk/WebPageProxyGtk.cpp:
2847         (WebKit::WebsiteDataStore::platformRemoveRecentSearches):
2848         * UIProcess/wpe/WebPageProxyWPE.cpp:
2849         (WebKit::WebsiteDataStore::platformRemoveRecentSearches):
2850         * WebProcess/Cookies/WebCookieManager.cpp:
2851         (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
2852         * WebProcess/Cookies/WebCookieManager.h:
2853         * WebProcess/Cookies/WebCookieManager.messages.in:
2854         * WebProcess/Plugins/PluginView.cpp:
2855         (WebKit::lastModifiedDateMS):
2856         * WebProcess/WebProcess.cpp:
2857         (WebKit::WebProcess::deleteWebsiteData):
2858         * WebProcess/WebProcess.h:
2859         * WebProcess/WebProcess.messages.in:
2860
2861 2018-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
2862
2863         [Attachment Support] Introduce data structures and IPC support for writing promised blobs
2864         https://bugs.webkit.org/show_bug.cgi?id=181189
2865
2866         Reviewed by Tim Horton.
2867
2868         Add IPC support for PromisedBlobInfo and PromisedBlobData. See WebCore/ChangeLog for more detail.
2869
2870         * Shared/WebCoreArgumentCoders.cpp:
2871         (IPC::ArgumentCoder<PromisedBlobData>::encode):
2872         (IPC::ArgumentCoder<PromisedBlobData>::decode):
2873         (IPC::ArgumentCoder<PromisedBlobInfo>::encode):
2874         (IPC::ArgumentCoder<PromisedBlobInfo>::decode):
2875         * Shared/WebCoreArgumentCoders.h:
2876
2877 2018-01-02  Michael Catanzaro  <mcatanzaro@igalia.com>
2878
2879         REGRESSION(r223253): Broke ResourceLoadStatistics layout tests for non-Cocoa ports
2880         https://bugs.webkit.org/show_bug.cgi?id=181231
2881
2882         Reviewed by Alex Christensen.
2883
2884         Add new C API for use by WebKitTestRunner.
2885
2886         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2887         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
2888         (WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
2889         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2890
2891 2018-01-02  Jiewen Tan  <jiewen_tan@apple.com>
2892
2893         Add a WebAuthentication runtime feature flag
2894         https://bugs.webkit.org/show_bug.cgi?id=181220
2895         <rdar://problem/36055305>
2896
2897         Reviewed by Brent Fulgham.
2898
2899         Renames the CredentialManagement runtime feature flag into WebAuthentication.
2900
2901         * Shared/WebPreferences.yaml:
2902         * UIProcess/API/C/WKPreferences.cpp:
2903         (WKPreferencesSetWebAuthenticationEnabled):
2904         (WKPreferencesGetWebAuthenticationEnabled):
2905         (WKPreferencesSetCredentialManagementEnabled): Deleted.
2906         (WKPreferencesGetCredentialManagementEnabled): Deleted.
2907         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2908         * WebProcess/WebPage/WebPage.cpp:
2909         (WebKit::WebPage::updatePreferences):
2910
2911 2018-01-02  Michael Catanzaro  <mcatanzaro@igalia.com>
2912
2913         REGRESSION(r226327): [GTK] Plugin process is broken
2914         https://bugs.webkit.org/show_bug.cgi?id=181187
2915
2916         Unreviewed, fix PluginProcessMainUnix after r226327.
2917
2918         * PluginProcess/unix/PluginProcessMainUnix.cpp:
2919
2920 2018-01-02  Tim Horton  <timothy_horton@apple.com>
2921
2922         Fix the build on platforms where UICurrentUserInterfaceIdiomIsPad is defined to false
2923         https://bugs.webkit.org/show_bug.cgi?id=181218
2924
2925         Reviewed by Alex Christensen.
2926
2927         * Platform/spi/ios/UIKitSPI.h:
2928         (currentUserInterfaceIdiomIsPad):
2929         * UIProcess/ios/SmartMagnificationController.mm:
2930         (WebKit::SmartMagnificationController::didCollectGeometryForSmartMagnificationGesture):
2931         * UIProcess/ios/WKContentViewInteraction.mm:
2932         (-[WKFormInputSession setAccessoryViewCustomButtonTitle:]):
2933         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
2934         (-[WKContentView _displayFormNodeInputView]):
2935         (-[WKContentView requiresAccessoryView]):
2936         (-[WKContentView _updateAccessory]):
2937         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
2938         (-[WKAirPlayRoutePicker show:fromRect:]):
2939         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2940         (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
2941         (-[WKFileUploadPanel _presentMenuOptionForCurrentInterfaceIdiom:]):
2942         * UIProcess/ios/forms/WKFormInputControl.mm:
2943         (-[WKDateTimePicker initWithView:datePickerMode:]):
2944         (-[WKFormInputControl initWithView:]):
2945         * UIProcess/ios/forms/WKFormSelectControl.mm:
2946         (-[WKFormSelectControl initWithView:]):
2947         On platforms where UICurrentUserInterfaceIdiomIsPad is defined to false,
2948         blocks that conditionally execute based on its value are unreachable.
2949         This causes the compiler to complain. Hide it away inside an inline function
2950         and make use of that everywhere we used to use the macro.
2951
2952 2018-01-02  Alex Christensen  <achristensen@webkit.org>
2953
2954         Remove SVN file accidentally added in r226160
2955         https://bugs.webkit.org/show_bug.cgi?id=180934
2956
2957         * UIProcess/WebPageProxy.cpp.orig: Removed.
2958
2959 2018-01-02  Alex Christensen  <achristensen@webkit.org>
2960
2961         Use BlockPtrs and lambdas instead of new/delete to pass parameters to blocks in WebViewImpl::performDragOperation
2962         https://bugs.webkit.org/show_bug.cgi?id=180795
2963
2964         Reviewed by Brent Fulgham.
2965
2966         * UIProcess/Cocoa/WebViewImpl.mm:
2967         (WebKit::WebViewImpl::performDragOperation):
2968
2969 2018-01-02  Michael Catanzaro  <mcatanzaro@igalia.com>
2970
2971         [WPE][GTK] Implement the assignment of ProcessIdentifiers to child processes
2972         https://bugs.webkit.org/show_bug.cgi?id=181187
2973
2974         Reviewed by Brady Eidson.
2975
2976         * Shared/ChildProcess.cpp: Make the ProcessIdentifier mandatory.
2977         (WebKit::ChildProcess::initialize):
2978         * Shared/unix/ChildProcessMain.cpp: Initialize ChildProcessInitializationParameters with the
2979         ProcessIdentifier.
2980         (WebKit::ChildProcessMainBase::parseCommandLine):
2981         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: Copy the ProcessIdentifier from
2982         LaunchOptions into argv.
2983         (WebKit::ProcessLauncher::launchProcess):
2984         * WebProcess/wpe/WebProcessMainWPE.cpp: Expect the WPE socket ID later in the command line.
2985
2986 2018-01-02  Alex Christensen  <achristensen@webkit.org>
2987
2988         Use new WebsiteDataStore passed in through decidePolicyForNavigation SPI
2989         https://bugs.webkit.org/show_bug.cgi?id=180897
2990         <rdar://problem/35535328>
2991
2992         Reviewed by Brent Fulgham.
2993
2994         * Shared/WebsitePoliciesData.cpp:
2995         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
2996         * UIProcess/Cocoa/NavigationState.mm:
2997         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2998         * UIProcess/WebPageProxy.cpp:
2999         (WebKit::WebPageProxy::changeWebsiteDataStore):
3000         * UIProcess/WebPageProxy.h:
3001         * UIProcess/WebProcessPool.cpp:
3002         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
3003         (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
3004         (WebKit::WebProcessPool::pageAddedToProcess): Deleted.
3005         (WebKit::WebProcessPool::pageRemovedFromProcess): Deleted.
3006         * UIProcess/WebProcessPool.h:
3007         * UIProcess/WebProcessProxy.cpp:
3008         (WebKit::WebProcessProxy::addExistingWebPage):
3009         (WebKit::WebProcessProxy::removeWebPage):
3010         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
3011         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
3012
3013 2018-01-02  Alex Christensen  <achristensen@webkit.org>
3014
3015         Only use CookieStorageShim when we aren't using NetworkSession
3016         https://bugs.webkit.org/show_bug.cgi?id=180766
3017
3018         Reviewed by Brent Fulgham.
3019
3020         * Shared/mac/CookieStorageShim.h:
3021         * Shared/mac/CookieStorageShim.mm:
3022         * WebProcess/WebProcess.cpp:
3023         (WebKit::WebProcess::initializeWebProcess):
3024
3025 2018-01-02  Alex Christensen  <achristensen@webkit.org>
3026
3027         Clean up context menu code
3028         https://bugs.webkit.org/show_bug.cgi?id=181074
3029
3030         Reviewed by Brent Fulgham.
3031
3032         Use Ref instead of RefPtr where possible.
3033         Use move semantics instead of copying from const references when possible.
3034         Remove dead iOS code.  Reduce allocations.  Add stub for WPE.
3035
3036         * UIProcess/API/APIContextMenuClient.h:
3037         (API::ContextMenuClient::getContextMenuFromProposedMenu):
3038         (API::ContextMenuClient::getContextMenuFromProposedMenuAsync):
3039         (API::ContextMenuClient::showContextMenu):
3040         * UIProcess/API/C/WKPage.cpp:
3041         (WKPageSetPageContextMenuClient):
3042         * UIProcess/API/gtk/PageClientImpl.cpp:
3043         (WebKit::PageClientImpl::createContextMenuProxy):
3044         * UIProcess/API/gtk/PageClientImpl.h:
3045         * UIProcess/PageClient.h:
3046         * UIProcess/WebContextMenuListenerProxy.cpp:
3047         (WebKit::WebContextMenuListenerProxy::useContextMenuItems):
3048         * UIProcess/WebContextMenuProxy.cpp:
3049         (WebKit::WebContextMenuProxy::WebContextMenuProxy):
3050         * UIProcess/WebContextMenuProxy.h:
3051         * UIProcess/WebPageProxy.cpp:
3052         (WebKit::WebPageProxy::showContextMenu):
3053         (WebKit::WebPageProxy::internalShowContextMenu): Deleted.
3054         * UIProcess/WebPageProxy.h:
3055         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
3056         (WebKit::WebContextMenuProxyGtk::showContextMenuWithItems):
3057         (WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk):
3058         * UIProcess/gtk/WebContextMenuProxyGtk.h:
3059         (WebKit::WebContextMenuProxyGtk::create):
3060         * UIProcess/ios/PageClientImplIOS.h:
3061         * UIProcess/ios/PageClientImplIOS.mm:
3062         (WebKit::PageClientImpl::createContextMenuProxy): Deleted.
3063         * UIProcess/mac/PageClientImplMac.h:
3064         * UIProcess/mac/PageClientImplMac.mm:
3065         (WebKit::PageClientImpl::createContextMenuProxy):
3066         * UIProcess/mac/WebContextMenuProxyMac.h:
3067         (WebKit::WebContextMenuProxyMac::create):
3068         * UIProcess/mac/WebContextMenuProxyMac.mm:
3069         (WebKit::WebContextMenuProxyMac::WebContextMenuProxyMac):
3070         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
3071         (WebKit::WebContextMenuProxyMac::showContextMenu):
3072
3073 == Rolled over to ChangeLog-2018-01-01 ==