2a1c2668b302b64fc75be6a58ce3d10e8703f94f
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-01-10  Tim Horton  <timothy_horton@apple.com>
2
3         REGRESSION (r213590): Swipe from edge to go to previous page is significantly slower than tapping back button on Twitter
4         https://bugs.webkit.org/show_bug.cgi?id=181269
5         <rdar://problem/35110344>
6
7         Reviewed by Simon Fraser.
8
9         * UIProcess/API/Cocoa/WKWebView.mm:
10         (-[WKWebView _processDidExit]):
11         (-[WKWebView _didCommitLayerTree:]):
12         When swiping to a page that set history.scrollRestoration = "manual",
13         we will never restore the scroll position. We will still restore
14         "state", but won't have a location. Currently, the code assumes that
15         it should wait to remove the swipe snapshot until the scroll position
16         is restored. Instead, wait until the "state" is restored, whether
17         or not that includes a scroll position/center point restoration.
18
19         Do this by making _firstTransactionIDAfterPageRestore an optional,
20         and reset it after it fires, so that we only run the restoration code
21         in _didCommitLayerTree for the first commit after state restoration,
22         not all subsequent commits. Then, tell ViewGestureController that
23         the scroll position has been restored even if the page opted out.
24
25         The reason that this is specific to pushState is that normal,
26         non-same-document loads bail from waiting for the scroll position
27         restoration in VGC::didReachMainFrameLoadTerminalState() (see the long
28         comment there for an explanation).
29
30         (-[WKWebView _beginBackSwipeForTesting]):
31         (-[WKWebView _completeBackSwipeForTesting]):
32         * Platform/spi/ios/UIKitSPI.h:
33         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
34         * UIProcess/Cocoa/ViewGestureController.h:
35         * UIProcess/ios/ViewGestureControllerIOS.mm:
36         (-[WKSwipeTransitionController transitionForDirection:]):
37         (WebKit::ViewGestureController::beginSimulatedSwipeInDirectionForTesting):
38         (WebKit::ViewGestureController::completeSimulatedSwipeInDirectionForTesting):
39         * UIProcess/mac/ViewGestureControllerMac.mm:
40         (WebKit::ViewGestureController::beginSimulatedSwipeInDirectionForTesting):
41         (WebKit::ViewGestureController::completeSimulatedSwipeInDirectionForTesting):
42         Add a mechanism to forcefully test swipe back. Instead of simulating
43         events like on Mac, we just talk to the UIKit internals and force
44         the interaction to start, pause, and then complete when we want.
45
46 2018-01-10  Brent Fulgham  <bfulgham@apple.com>
47
48         Use protectedThis for the 'updatePrevalentDomainsToPartitionOrBlockCookies' lambda
49         https://bugs.webkit.org/show_bug.cgi?id=181452
50         <rdar://problem/36416912>
51         
52         Reviewed by Chris Dumez.
53
54         We forgot to use a 'protectedThis' back in r225006 for one of the lambdas used by
55         the WebsiteDataStore for processing.
56
57         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
58         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
59
60 2018-01-09  John Wilander  <wilander@apple.com>
61
62         Storage Access API: Turn feature on by default in WebPreferences.yaml
63         https://bugs.webkit.org/show_bug.cgi?id=181458
64
65         Reviewed by Brent Fulgham.
66
67         * Shared/WebPreferences.yaml:
68
69 2018-01-09  Alex Christensen  <achristensen@webkit.org>
70
71         WKOpenPanelParameters SPI should return autoreleased objects
72         https://bugs.webkit.org/show_bug.cgi?id=181457
73         <rdar://problem/35884960>
74
75         Reviewed by Tim Horton.
76
77         In r226607 I made a mistake by returning an object that has been released.
78         I instead follow a pattern of leaking and autoreleasing that we use elsewhere in the ObjC API.
79
80         * UIProcess/API/Cocoa/WKOpenPanelParameters.mm:
81         (-[WKOpenPanelParameters _acceptedMIMETypes]):
82         (-[WKOpenPanelParameters _acceptedFileExtensions]):
83
84 2018-01-09  Dan Bernstein  <mitz@apple.com>
85
86         Removed some empty directories that were left behind
87
88         * WebProcess/Cookies/cf: Removed.
89         * WebProcess/ios: Removed.
90
91 2018-01-09  Paul Knight  <pknight@apple.com>
92
93         Don't record dynamic spelling corrections while in an ephemeral browsing session
94         https://bugs.webkit.org/show_bug.cgi?id=181417
95         <rdar://problem/33309104>
96
97         Dynamic spelling correction responses are kept on disk. Avoid recording
98         these responses when in an ephemeral session.
99
100         Reviewed by Tim Horton and Wenson Hsieh.
101
102         * UIProcess/mac/CorrectionPanel.h:
103         * UIProcess/mac/CorrectionPanel.mm:
104         (WebKit::CorrectionPanel::recordAutocorrectionResponse):
105             Add a WebViewImpl parameter so we can query the current session.
106             Return early before recording the response if the session is
107             ephemeral.
108         (WebKit::CorrectionPanel::handleAcceptedReplacement):
109             Update a caller to include the new parameter.
110         * UIProcess/mac/PageClientImplMac.mm:
111         (WebKit::PageClientImpl::recordAutocorrectionResponse):
112             Ditto.
113
114 2018-01-09  Carlos Garcia Campos  <cgarcia@igalia.com>
115
116         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.5 release.
117
118         * gtk/NEWS: Add release notes for 2.19.5.
119
120 2018-01-09  Carlos Garcia Campos  <cgarcia@igalia.com>
121
122         [GTK] Missing symbols exported in 2.19.4
123         https://bugs.webkit.org/show_bug.cgi?id=181433
124
125         Reviewed by Michael Catanzaro.
126
127         Add missing WEBKIT_API to webkit_dom_dom_window_webkit_message_handlers_post_message().
128
129         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.h:
130         * webkitglib-symbols.map: Remove webkit_media_player_debug from local.
131
132 2018-01-09  Youenn Fablet  <youenn@apple.com>
133
134         SWClientConnection should not keep references to service worker jobs
135         https://bugs.webkit.org/show_bug.cgi?id=181381
136
137         Reviewed by Chris Dumez.
138
139         Updated IPC handling based on WebCore refactoring.
140
141         * Scripts/webkit/messages.py:
142         (forward_declarations_and_headers):
143         (headers_for_type):
144         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
145         (WebKit::WebSWServerConnection::rejectJobInClient):
146         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
147         (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
148         (WebKit::WebSWServerConnection::startScriptFetchInClient):
149         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
150         * WebProcess/Storage/WebSWClientConnection.messages.in:
151
152 2018-01-09  Carlos Garcia Campos  <cgarcia@igalia.com>
153
154         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.4 release.
155
156         * gtk/NEWS: Add release notes for 2.19.4.
157
158 2018-01-09  Ali Juma  <ajuma@chromium.org>
159
160         Implement VisualViewport API events
161         https://bugs.webkit.org/show_bug.cgi?id=179386
162
163         Reviewed by Frédéric Wang.
164
165         Change the default value of the VisualViewportAPI experimental feature flag to
166         DEFAULT_EXPERIMENTAL_FEATURES_ENABLED. This patch completes the implementation
167         of this feature as specified by https://wicg.github.io/visual-viewport/, so this
168         feature is now ready for wider testing.
169
170         * Shared/WebPreferences.yaml:
171
172 2018-01-08  Alex Christensen  <achristensen@webkit.org>
173
174         Add WKNavigationDelegate SPI exposing WebProcess crash reason
175         https://bugs.webkit.org/show_bug.cgi?id=181410
176         <rdar://problem/36167199>
177
178         Reviewed by Wenson Hsieh.
179
180         We exposed it in the C SPI.
181
182         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
183         * UIProcess/Cocoa/NavigationState.h:
184         * UIProcess/Cocoa/NavigationState.mm:
185         (WebKit::NavigationState::setNavigationDelegate):
186         (WebKit::toWKProcessTerminationReason):
187         (WebKit::NavigationState::NavigationClient::processDidTerminate):
188
189 2018-01-08  Alex Christensen  <achristensen@webkit.org>
190
191         Make ObjC SPI equivalent to WKPageNavigationClient.decidePolicyForPluginLoad
192         https://bugs.webkit.org/show_bug.cgi?id=181413
193         <rdar://problem/36169005>
194
195         Reviewed by Wenson Hsieh.
196
197         * UIProcess/API/APINavigationClient.h:
198         (API::NavigationClient::decidePolicyForPluginLoad):
199         * UIProcess/API/C/WKPage.cpp:
200         (WKPageSetPageNavigationClient):
201         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
202         * UIProcess/Cocoa/NavigationState.h:
203         * UIProcess/Cocoa/NavigationState.mm:
204         (WebKit::NavigationState::setNavigationDelegate):
205         (WebKit::toPluginModuleLoadPolicy):
206         (WebKit::toWKPluginModuleLoadPolicy):
207         (WebKit::NavigationState::NavigationClient::decidePolicyForPluginLoad):
208         * UIProcess/WebPageProxy.cpp:
209         (WebKit::WebPageProxy::findPlugin):
210
211 2018-01-08  Ryosuke Niwa  <rniwa@webkit.org>
212
213         iOS build fix attempt after r226602.
214
215         * UIProcess/API/C/WKContextMenuListener.cpp:
216         (WKContextMenuListenerUseContextMenuItems):
217
218 2018-01-08  Alex Christensen  <achristensen@webkit.org>
219
220         Add SPI for WKOpenPanelParameters._acceptedMIMETypes and _acceptedFileExtensions
221         https://bugs.webkit.org/show_bug.cgi?id=181408
222         <rdar://problem/35884960>
223
224         Reviewed by Tim Horton.
225
226         * UIProcess/API/Cocoa/WKOpenPanelParameters.mm:
227         (-[WKOpenPanelParameters _acceptedMIMETypes]):
228         (-[WKOpenPanelParameters _acceptedFileExtensions]):
229         * UIProcess/API/Cocoa/WKOpenPanelParametersInternal.h:
230         * UIProcess/API/Cocoa/WKOpenPanelParametersPrivate.h: Added.
231         * WebKit.xcodeproj/project.pbxproj:
232
233 2018-01-08  Commit Queue  <commit-queue@webkit.org>
234
235         Unreviewed, rolling out r226532 and r226540.
236         https://bugs.webkit.org/show_bug.cgi?id=181422
237
238         jessie says basic browsing does not seem to work (Requested by
239         alexchristensen on #webkit).
240
241         Reverted changesets:
242
243         "Add CSP support to service workers"
244         https://bugs.webkit.org/show_bug.cgi?id=181385
245         https://trac.webkit.org/changeset/226532
246
247         "SWClientConnection should not keep references to service
248         worker jobs"
249         https://bugs.webkit.org/show_bug.cgi?id=181381
250         https://trac.webkit.org/changeset/226540
251
252 2018-01-08  Wenson Hsieh  <wenson_hsieh@apple.com>
253
254         [Attachment Support] Expose file name and content type of WKAttachment
255         https://bugs.webkit.org/show_bug.cgi?id=181390
256         <rdar://problem/36336837>
257
258         Reviewed by Tim Horton.
259
260         Add support for -[_WKAttachment requestInfo:], which fetches a snapshot of the attachment's state. This API is
261         meant to be a replacement for -requestData: that provides additional metadata about the attachment.
262
263         * Scripts/webkit/messages.py:
264         (headers_for_type):
265         * Shared/WebCoreArgumentCoders.cpp:
266         (IPC::ArgumentCoder<AttachmentInfo>::encode):
267         (IPC::ArgumentCoder<AttachmentInfo>::decode):
268         * Shared/WebCoreArgumentCoders.h:
269
270         Add IPC support for AttachmentInfo. Note that instead of using (encode|decode)SharedBuffer, we send and receive
271         data references to the shared buffer.
272
273         * UIProcess/API/APIAttachment.cpp:
274         (API::Attachment::requestInfo):
275         (API::Attachment::requestData): Deleted.
276         * UIProcess/API/APIAttachment.h:
277
278         Change requestData to requestInfo.
279
280         * UIProcess/API/Cocoa/_WKAttachment.h:
281         * UIProcess/API/Cocoa/_WKAttachment.mm:
282         (-[_WKAttachmentInfo initWithInfo:]):
283         (-[_WKAttachmentInfo data]):
284         (-[_WKAttachmentInfo name]):
285         (-[_WKAttachmentInfo filePath]):
286         (-[_WKAttachmentInfo contentType]):
287         (-[_WKAttachment requestInfo:]):
288         (-[_WKAttachment requestData:]):
289
290         Implement -requestInfo: by calling into APIAttachment, and reimplement -requestData: in terms of -requestInfo:.
291
292         * UIProcess/WebPageProxy.cpp:
293         (WebKit::WebPageProxy::attachmentInfoCallback):
294         (WebKit::WebPageProxy::requestAttachmentInfo):
295         (WebKit::WebPageProxy::sharedBufferCallback): Deleted.
296         (WebKit::WebPageProxy::requestAttachmentData): Deleted.
297         * UIProcess/WebPageProxy.h:
298         * UIProcess/WebPageProxy.messages.in:
299
300         Rename the SharedBufferCallback IPC message to AttachmentInfoCallback, and make it conditional on
301         ATTACHMENT_ELEMENT. Rename requestAttachmentData to requestAttachmentInfo.
302
303         * WebProcess/WebPage/WebPage.cpp:
304         (WebKit::WebPage::requestAttachmentInfo):
305         (WebKit::WebPage::invokeSharedBufferCallback): Deleted.
306         (WebKit::WebPage::requestAttachmentData): Deleted.
307
308         Rename requestAttachmentData to requestAttachmentInfo and adopt HTMLAttachmentElement::requestInfo.
309
310         * WebProcess/WebPage/WebPage.h:
311         * WebProcess/WebPage/WebPage.messages.in:
312
313 2018-01-08  Alex Christensen  <achristensen@webkit.org>
314
315         Pass around Vector<Ref<WebContextMenuItem>> instead of WKArrayRef or Vector<WebContextMenuItemData>
316         https://bugs.webkit.org/show_bug.cgi?id=181419
317
318         Reviewed by Tim Horton.
319
320         Passing a WKArrayRef to an API object is messy and was preventing me from moving things around and making ObjC SPI.
321         No change in behavior.  Just using different layering abstractions for the same data.
322
323         * UIProcess/API/C/WKContextMenuListener.cpp:
324         (WKContextMenuListenerUseContextMenuItems):
325         * UIProcess/WebContextMenuListenerProxy.cpp:
326         (WebKit::WebContextMenuListenerProxy::useContextMenuItems):
327         * UIProcess/WebContextMenuListenerProxy.h:
328         * UIProcess/WebContextMenuProxy.h:
329         * UIProcess/mac/WebContextMenuProxyMac.h:
330         * UIProcess/mac/WebContextMenuProxyMac.mm:
331         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
332         (WebKit::WebContextMenuProxyMac::showContextMenu):
333
334 2018-01-08  John Wilander  <wilander@apple.com>
335
336         Storage Access API: Remove access for all frames under a page when the page is closed
337         https://bugs.webkit.org/show_bug.cgi?id=181398
338         <rdar://problem/36357879>
339
340         Reviewed by Alex Christensen.
341
342         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
343         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage):
344         * NetworkProcess/NetworkConnectionToWebProcess.h:
345         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
346         * WebProcess/WebPage/WebPage.cpp:
347         (WebKit::WebPage::close):
348
349 2018-01-08  Youenn Fablet  <youenn@apple.com>
350
351         SWClientConnection should not keep references to service worker jobs
352         https://bugs.webkit.org/show_bug.cgi?id=181381
353
354         Reviewed by Chris Dumez.
355
356         Updated IPC handling based on WebCore refactoring.
357
358         * Scripts/webkit/messages.py:
359         (forward_declarations_and_headers):
360         (headers_for_type):
361         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
362         (WebKit::WebSWServerConnection::rejectJobInClient):
363         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
364         (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
365         (WebKit::WebSWServerConnection::startScriptFetchInClient):
366         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
367         * WebProcess/Storage/WebSWClientConnection.messages.in:
368
369 2018-01-08  Joseph Pecoraro  <pecoraro@apple.com>
370
371         [Cocoa] Web Inspector: Provide a way for clients to check if an NSWindow is a Web Inspector window
372         https://bugs.webkit.org/show_bug.cgi?id=181361
373         <rdar://problem/36332865>
374
375         Reviewed by Darin Adler.
376
377         * WebKit.xcodeproj/project.pbxproj:
378         New files.
379
380         * Shared/API/Cocoa/_WKNSWindowExtras.h: Added.
381         * Shared/API/Cocoa/_WKNSWindowExtras.mm: Added.
382         (-[NSWindow _web_isWebInspectorWindow]):
383         Method to determing if a window is being used for Web Inspector content.
384
385         * UIProcess/mac/WKInspectorWindow.h: Added.
386         * UIProcess/mac/WKInspectorWindow.mm: Added.
387         Named subclass so we can use isKindOfClass.
388
389         * UIProcess/mac/WebInspectorProxyMac.mm:
390         (WebKit::WebInspectorProxy::createFrontendWindow):
391         Use the named subclass.
392
393 2018-01-08  Tim Horton  <timothy_horton@apple.com>
394
395         Build fix for WKPDFView
396         https://bugs.webkit.org/show_bug.cgi?id=181399
397         <rdar://problem/36311915>
398
399         Reviewed by Simon Fraser.
400
401         * UIProcess/ios/WKPDFView.mm:
402         Disable deprecation warnings in this whole file.
403
404 2018-01-08  Youenn Fablet  <youenn@apple.com>
405
406         Caches::writeCachesToDisk should assert that it is initialized
407         https://bugs.webkit.org/show_bug.cgi?id=181383
408
409         Reviewed by Alex Christensen.
410
411         Add assertion to ensure caches is initialized
412
413         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
414         (WebKit::CacheStorage::Caches::writeCachesToDisk):
415
416 2018-01-08  Youenn Fablet  <youenn@apple.com>
417
418         WebProcessPool::terminateServiceWorkerProcess should protect itself in debug builds
419         https://bugs.webkit.org/show_bug.cgi?id=181384
420
421         Reviewed by Chris Dumez.
422
423         * UIProcess/WebProcessPool.cpp:
424         (WebKit::WebProcessPool::terminateServiceWorkerProcess):
425
426 2018-01-08  Frederic Wang  <fwang@igalia.com>
427
428         Unreviewed build fix after r226211.
429
430         * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Use WK_IOS_TBA for iOS.
431
432 2018-01-08  Youenn Fablet  <youenn@apple.com>
433
434         navigator.onLine does not work inside service workers
435         https://bugs.webkit.org/show_bug.cgi?id=181079
436         <rdar://problem/36178606>
437
438         Reviewed by Darin Adler.
439
440         Added support for a callback called for each service worker proxy creation.
441         Callback is used by WTR to inject a self.internals object used for testing.
442
443         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
444         (WKBundleSetServiceWorkerProxyCreationCallback):
445         * WebProcess/InjectedBundle/API/c/WKBundle.h:
446         * WebProcess/InjectedBundle/InjectedBundle.cpp:
447         (WebKit::InjectedBundle::setServiceWorkerProxyCreationCallback):
448         * WebProcess/InjectedBundle/InjectedBundle.h:
449
450 2018-01-07  David Kilzer  <ddkilzer@apple.com>
451
452         Enable -Wcast-qual for WebInspectorUI, WebKitLegacy, WebKit projects
453         <https://webkit.org/b/181256>
454         <rdar://problem/36281730>
455
456         Reviewed by Darin Adler.
457
458         * Configurations/Base.xcconfig:
459         (WARNING_CFLAGS): Add -Wcast-qual.
460         * NetworkProcess/cache/NetworkCacheCodersCocoa.cpp:
461         (WTF::Persistence::encodeCertificateChain): Include
462         TypeCastsCF.h from WTF, and use
463         checked_cf_cast<SecCertificateRef>() to fix warning.
464         * Platform/cocoa/WKCrashReporter.mm:
465         (WebKit::setCrashReportApplicationSpecificInformation):
466         - Move `oldMessage` check above nullptr check to fix a leak when
467           passing in nullptr after previously setting the crash string.
468         - Change C-style cast to const_cast<char*>() to fix warning.
469         * PluginProcess/mac/PluginProcessShim.mm:
470         (WebKit::shim_shmat): Change C-style cast to
471         const_cast<void*>() to fix warning.
472         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
473         (WebKit::leafCertificate): Include TypeCastsCF.h from
474         WTF, and use checked_cf_cast<SecCertificateRef>() to fix
475         warning.
476         * Shared/cf/ArgumentCodersCF.cpp:
477         (IPC::encode): Use static_cast<>(const_cast<void*>() to
478         fix warnings since the CFTypeID has already been
479         checked.
480         * Shared/mac/WebCoreArgumentCodersMac.mm:
481         (IPC::decodeNSError): Use an `auto` variable to hold the
482         CFMutableDictionaryRef, then WTFMove() to assign it back to
483         `userInfo`.
484         * UIProcess/Cocoa/WebViewImpl.mm:
485         (WebKit::takeWindowSnapshot): Include TypeCastsCF.h from
486         WTF, and use checked_cf_cast<CGImageRef>() to fix
487         warning.
488
489 2018-01-07  Konstantin Tokarev  <annulen@yandex.ru>
490
491         [cmake] Unset CMAKE_REQUIRED_LIBRARIES after check_function_exists test
492         https://bugs.webkit.org/show_bug.cgi?id=181371
493
494         Reviewed by Michael Catanzaro.
495
496         This variable is used by check_function_exists internally, its value
497         should be never used for anything else.
498
499         * CMakeLists.txt:
500
501 2018-01-05  Dan Bernstein  <mitz@apple.com>
502
503         REGRESSION (r226218): iOS-only assets are installed on macOS
504         https://bugs.webkit.org/show_bug.cgi?id=181362
505
506         Reviewed by Anders Carlsson.
507
508         * Configurations/WebKit.xcconfig: Exclude everything under Resources/ios when not targeting
509           iOS.
510
511         * Resources/ios: Added.
512         * Resources/ios/iOS.xcassets: Moved from Source/WebKit/WebKit.xcassets.
513         * Resources/ios/iOS.xcassets/LockMini.imageset/NavigationBarLockMini@2x.pdf: Set the
514           svn:mime-type property.
515         * Resources/ios/iOS.xcassets/LockMini.imageset/NavigationBarLockMini@3x.pdf: Ditto.
516
517         * Resources/mac: Added.
518         * Resources/mac/mediaIcon.pdf: Moved here…
519         * Resources/mediaIcon.pdf: …from here.
520
521         * WebKit.xcassets: Moved under Resources/ios.
522
523         * WebKit.xcodeproj/project.pbxproj: Created an ios group under the Resources group, and
524           cleaned up the mac group. Removed the Recovered References group.
525
526 2018-01-05  John Wilander  <wilander@apple.com>
527
528         Storage Access API: Refactor to make naming accurate and explicit, simplify access table, and prepare for access removal for page
529         https://bugs.webkit.org/show_bug.cgi?id=181357
530         <rdar://problem/36331031>
531
532         Reviewed by Alex Christensen.
533
534         This change does the following:
535         - Changes function and message names to reflect how this feature
536           was eventually implemented, i.e. access per frame.
537         - Makes it explicit that the UI process is only involved in
538           granting storage access and not removing storage access.
539           The latter is done directly by the web process.
540         - Simplifies the network process' entry map since only needs to
541           be able to give access to one domain in one frame at a time.
542           Access goes away on frame navigation so there can only be one
543           domain at a time per frame. Also, the map now uses pageIDs as
544           main keys to prepare for efficient access removal for all
545           frames under a page.
546         - Fixes a bug in so that a cross-origin iframe with the same
547           partition as the top frame correctly is handled as already
548           having access.
549
550         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
551         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
552         (WebKit::NetworkConnectionToWebProcess::removeStorageAccess): Deleted.
553         * NetworkProcess/NetworkConnectionToWebProcess.h:
554         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
555         * NetworkProcess/NetworkProcess.cpp:
556         (WebKit::NetworkProcess::hasStorageAccessForFrame):
557         (WebKit::NetworkProcess::grantStorageAccessForFrame):
558         (WebKit::NetworkProcess::hasStorageAccessForPrevalentDomains): Deleted.
559         (WebKit::NetworkProcess::updateStorageAccessForPrevalentDomains): Deleted.
560         * NetworkProcess/NetworkProcess.h:
561         * NetworkProcess/NetworkProcess.messages.in:
562         * UIProcess/Network/NetworkProcessProxy.cpp:
563         (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
564         (WebKit::NetworkProcessProxy::grantStorageAccessForFrame):
565         (WebKit::NetworkProcessProxy::hasStorageAccessForPrevalentDomains): Deleted.
566         (WebKit::NetworkProcessProxy::updateStorageAccessForPrevalentDomains): Deleted.
567         * UIProcess/Network/NetworkProcessProxy.h:
568         * UIProcess/WebResourceLoadStatisticsStore.cpp:
569         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
570         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
571         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
572         * UIProcess/WebResourceLoadStatisticsStore.h:
573         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
574         (WebKit::WebsiteDataStore::hasStorageAccessForFrameHandler):
575         (WebKit::WebsiteDataStore::grantStorageAccessForFrameHandler):
576         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
577         (WebKit::WebsiteDataStore::hasStorageAccessForPrevalentDomainsHandler): Deleted.
578         (WebKit::WebsiteDataStore::updateStorageAccessForPrevalentDomainsHandler): Deleted.
579         * UIProcess/WebsiteData/WebsiteDataStore.h:
580         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
581         (WebKit::WebFrameLoaderClient::detachedFromParent2):
582         (WebKit::WebFrameLoaderClient::dispatchWillChangeDocument):
583
584 2018-01-05  Youenn Fablet  <youenn@apple.com>
585
586         Implement Cache API partitioning based on ClientOrigin
587         https://bugs.webkit.org/show_bug.cgi?id=181240
588
589         Reviewed by Alex Christensen.
590
591         open and retrieveCaches now take a ClientOrigin instead of a String.
592         Updated cache filesystem path computation to take both client origin and top origin.
593
594         When clearing an origin, caches whose client origin or top origin matches the origin are cleared.
595         Caches are added to the web site data of their client origin with their corresponding cache size.
596         Caches are added to the web site data of their top origin with a size equal to 0.
597
598         Updated memory representation dumping used for test to include both top and client origins.
599
600         * NetworkProcess/NetworkProcess.cpp:
601         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
602         * NetworkProcess/cache/CacheStorageEngine.cpp:
603         (WebKit::CacheStorage::Engine::cachesRootPath):
604         (WebKit::CacheStorage::Engine::open):
605         (WebKit::CacheStorage::Engine::remove):
606         (WebKit::CacheStorage::Engine::retrieveCaches):
607         (WebKit::CacheStorage::Engine::readCachesFromDisk):
608         (WebKit::CacheStorage::Engine::removeCaches):
609         (WebKit::CacheStorage::Engine::fetchEntries):
610         (WebKit::CacheStorage::Engine::clearCachesForOrigin):
611         (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
612         (WebKit::CacheStorage::Engine::representation):
613         * NetworkProcess/cache/CacheStorageEngine.h:
614         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
615         (WebKit::CacheStorage::Cache::Cache):
616         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
617         (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory):
618         (WebKit::CacheStorage::Caches::Caches):
619         (WebKit::CacheStorage::Caches::storeOrigin):
620         (WebKit::CacheStorage::Caches::readOrigin):
621         (WebKit::CacheStorage::Caches::open):
622         * NetworkProcess/cache/CacheStorageEngineCaches.h:
623         (WebKit::CacheStorage::Caches::create):
624         (WebKit::CacheStorage::Caches::origin const):
625         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
626         (WebKit::CacheStorageEngineConnection::open):
627         (WebKit::CacheStorageEngineConnection::caches):
628         (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
629         * NetworkProcess/cache/CacheStorageEngineConnection.h:
630         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
631         * WebProcess/Cache/WebCacheStorageConnection.cpp:
632         (WebKit::WebCacheStorageConnection::doOpen):
633         (WebKit::WebCacheStorageConnection::doRetrieveCaches):
634         (WebKit::WebCacheStorageConnection::clearMemoryRepresentation):
635         * WebProcess/Cache/WebCacheStorageConnection.h:
636
637 2018-01-05  Megan Gardner  <megan_gardner@apple.com>
638
639         Show Keyboard when re-launching WKWebView with a previously focused element
640         https://bugs.webkit.org/show_bug.cgi?id=181353
641
642         Reviewed by Tim Horton.
643
644         When relaunching an app with a WKWebView, restore the keyboard if there was a previously
645         focused element that was being assisted. The element was already being tracked, we just
646         needed to not bail on showing the keyboard for instances where it was a state change that
647         caused the element to be refocused.
648
649         * UIProcess/PageClient.h:
650         * UIProcess/WebPageProxy.h:
651         * UIProcess/WebPageProxy.messages.in:
652         * UIProcess/ios/PageClientImplIOS.h:
653         * UIProcess/ios/PageClientImplIOS.mm:
654         (WebKit::PageClientImpl::startAssistingNode):
655         * UIProcess/ios/WKContentView.h:
656         * UIProcess/ios/WKContentViewInteraction.h:
657         * UIProcess/ios/WKContentViewInteraction.mm:
658         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
659         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): Deleted.
660         * UIProcess/ios/WebPageProxyIOS.mm:
661         (WebKit::WebPageProxy::startAutoscrollAtPosition):
662         (WebKit::WebPageProxy::startAssistingNode):
663         * WebProcess/WebPage/WebPage.cpp:
664         (WebKit::WebPage::setActivityState):
665         (WebKit::WebPage::elementDidFocus):
666         * WebProcess/WebPage/WebPage.h:
667
668 2018-01-05  Alex Christensen  <achristensen@webkit.org>
669
670         Restrict navigation-time WKWebsiteDataStore swapping to main frame navigations
671         https://bugs.webkit.org/show_bug.cgi?id=181217
672
673         Reviewed by Tim Horton.
674
675         If we swap during an iframe navigation, then we get a page in a strange state.
676         The intent of the main frame navigation WKWebsiteDataStore swap is that
677         that is a time when we can change storages without a page in an inconsistent state.
678
679         * UIProcess/Cocoa/NavigationState.mm:
680         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
681
682 2018-01-05  Alex Christensen  <achristensen@webkit.org>
683
684         Add WKBundleFrameCreateFrameHandle
685         https://bugs.webkit.org/show_bug.cgi?id=181232
686         <rdar://problem/35926696>
687
688         Reviewed by Tim Horton.
689
690         InjectedBundle clients wanting to sent a _WKFrameHandle cannot without this function.
691         Before, they would just send the WKBundleFrameRef which would be changed into a WKFrameRef
692         in the UIProcess by WebProcessProxy::transformHandlesToObjects, but there is no ObjC equivalent
693         of WKFrameRef, so we were just getting a WKObject when we wanted a _WKFrameHandle.
694         We can't change WebProcessProxy::transformHandlesToObjects without being incompatible with the 
695         existing C API, so let's add a way for clients to say "I want a _WKFrameHandle".
696
697         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
698         (WKBundleFrameCreateFrameHandle):
699         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
700
701 2018-01-05  Wenson Hsieh  <wenson_hsieh@apple.com>
702
703         [Attachment Support] Add a way to write blob data to a file URL from the UI process
704         https://bugs.webkit.org/show_bug.cgi?id=181236
705
706         Reviewed by Brady Eidson.
707
708         Add support for writing a blob to a designated file path. In WebKit, this is mainly plumbing writeBlobToFilePath
709         through WebPageProxy to the network process.
710
711         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
712         (WebKit::NetworkBlobRegistry::writeBlobToFilePath):
713
714         Call out to the BlobRegistryImpl to write blobs to the file path. Additionally grant sandbox extensions for any
715         file-backed blob parts corresponding to the given blob URL.
716
717         (WebKit::NetworkBlobRegistry::filesInBlob):
718
719         Introduce a version of filesInBlob that doesn't check against the NetworkConnectionToWebProcess. This is used
720         when the UI process is the driver for writing a blob.
721
722         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
723         * NetworkProcess/NetworkProcess.cpp:
724         (WebKit::NetworkProcess::writeBlobToFilePath):
725
726         Temporarily grant sandbox access to the given file path.
727
728         * NetworkProcess/NetworkProcess.h:
729         * NetworkProcess/NetworkProcess.messages.in:
730         * Shared/WebCoreArgumentCoders.cpp:
731         (IPC::ArgumentCoder<PromisedBlobInfo>::encode):
732         (IPC::ArgumentCoder<PromisedBlobInfo>::decode):
733         (IPC::ArgumentCoder<PromisedBlobData>::encode): Deleted.
734         (IPC::ArgumentCoder<PromisedBlobData>::decode): Deleted.
735
736         Remove PromisedBlobData (see WebCore/ChangeLog for more information).
737
738         * Shared/WebCoreArgumentCoders.h:
739         * UIProcess/Network/NetworkProcessProxy.cpp:
740         (WebKit::NetworkProcessProxy::didClose):
741
742         If the network process is terminated, flush any pending callbacks in m_writeBlobToFilePathCallbackMap, passing
743         in a failure result (success := false) and clearing the callback map.
744
745         (WebKit::NetworkProcessProxy::writeBlobToFilePath):
746         (WebKit::NetworkProcessProxy::didWriteBlobToFilePath):
747         * UIProcess/Network/NetworkProcessProxy.h:
748         * UIProcess/Network/NetworkProcessProxy.messages.in:
749         * UIProcess/WebPageProxy.cpp:
750         (WebKit::WebPageProxy::writeBlobToFilePath):
751         * UIProcess/WebPageProxy.h:
752
753 2018-01-05  Dan Bernstein  <mitz@apple.com>
754
755         Add injected bundle equivalents of DOMHTMLDocument (DOMHTMLDocumentExtensions)
756         https://bugs.webkit.org/show_bug.cgi?id=181345
757
758         Reviewed by Tim Horton.
759
760         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h: Declared new methods.
761         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
762         (-[WKDOMDocument createDocumentFragmentWithMarkupString:baseURL:]): Added. Calls WebCore’s
763           createFragmentFromMarkup.
764         (-[WKDOMDocument createDocumentFragmentWithText:]): Added. Calls WebCore’s
765           createFragmentFromText.
766
767 2018-01-05  Don Olmstead  <don.olmstead@sony.com>
768
769         [Curl] Add implementation stubs for Network Cache
770         https://bugs.webkit.org/show_bug.cgi?id=181343
771
772         Reviewed by Alex Christensen.
773
774         * NetworkProcess/cache/NetworkCacheCodersCurl.cpp: Added.
775         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode):
776         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
777         * NetworkProcess/cache/NetworkCacheDataCurl.cpp: Added.
778         (WebKit::NetworkCache::Data::Data):
779         (WebKit::NetworkCache::Data::empty):
780         (WebKit::NetworkCache::Data::data const):
781         (WebKit::NetworkCache::Data::isNull const):
782         (WebKit::NetworkCache::Data::apply const):
783         (WebKit::NetworkCache::Data::subrange const):
784         (WebKit::NetworkCache::concatenate):
785         (WebKit::NetworkCache::Data::adoptMap):
786         * NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp: Added.
787         (WebKit::NetworkCache::IOChannel::IOChannel):
788         (WebKit::NetworkCache::IOChannel::~IOChannel):
789         (WebKit::NetworkCache::IOChannel::open):
790         (WebKit::NetworkCache::IOChannel::read):
791         (WebKit::NetworkCache::IOChannel::write):
792         * PlatformWin.cmake:
793
794 2018-01-05  Don Olmstead  <don.olmstead@sony.com>
795
796         [Curl] Update method declarations in WebKit
797         https://bugs.webkit.org/show_bug.cgi?id=181342
798
799         Reviewed by Alex Christensen.
800
801         * NetworkProcess/Downloads/curl/DownloadCurl.cpp:
802         (WebKit::Download::resume):
803         * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp:
804         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Deleted.
805         (WebKit::RemoteNetworkingContext::blockedError const): Deleted.
806
807 2018-01-05  Don Olmstead  <don.olmstead@sony.com>
808
809         WebFullScreenManager should compile when ENABLE(VIDEO) is off
810         https://bugs.webkit.org/show_bug.cgi?id=181338
811
812         Reviewed by Alex Christensen.
813
814         * WebProcess/FullScreen/WebFullScreenManager.cpp:
815         (WebKit::WebFullScreenManager::didEnterFullScreen):
816         (WebKit::WebFullScreenManager::willExitFullScreen):
817         * WebProcess/FullScreen/WebFullScreenManager.h:
818
819 2018-01-05  Andy Estes  <aestes@apple.com>
820
821         [Apple Pay] Disable Apple Pay on platforms that don't have PassKit.framework
822         https://bugs.webkit.org/show_bug.cgi?id=181335
823         <rdar://problem/36311296>
824
825         Reviewed by Brady Eidson.
826
827         When Safari is running in the macOS Base System, PassKit.framework is not available.
828         If we fail to dlopen PassKit, we should disable Apple Pay.
829
830         * UIProcess/API/C/WKPreferences.cpp:
831         (WKPreferencesSetApplePayEnabled):
832         * UIProcess/API/Cocoa/WKWebView.mm:
833         (-[WKWebView _initializeWithConfiguration:]):
834         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
835         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
836         (WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks):
837         (WebKit::WebPaymentCoordinatorProxy::platformSupportsPayments):
838
839 2018-01-05  Dan Bernstein  <mitz@apple.com>
840
841         Fixed the build following AppKit API deprecations in a recent SDKs
842
843         * UIProcess/mac/WKFullScreenWindowController.mm:
844         (-[WKFullScreenWindowController enterFullScreen:]): Suppressed deprecation warnings.
845         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Ditto.
846         (-[WKFullScreenWindowController exitFullScreen]): Ditto.
847         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Ditto.
848         (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]): Ditto.
849         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]): Ditto.
850         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]): Ditto.
851         * UIProcess/mac/WKPrintingView.mm:
852         (-[WKPrintingView _setAutodisplay:]): Ditto.
853
854 2018-01-05  Matt Lewis  <jlewis3@apple.com>
855
856         Unreviewed, rolling out r226401.
857
858         This caused timeouts on multiple platforms.
859
860         Reverted changeset:
861
862         "Implement Cache API partitioning based on ClientOrigin"
863         https://bugs.webkit.org/show_bug.cgi?id=181240
864         https://trac.webkit.org/changeset/226401
865
866 2018-01-05  Joseph Pecoraro  <pecoraro@apple.com>
867
868         ServiceWorkers: Enable UserTiming / ResourceTiming
869         https://bugs.webkit.org/show_bug.cgi?id=181297
870         <rdar://problem/36307306>
871
872         Reviewed by Youenn Fablet.
873
874         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
875         (WebKit::WebSWContextManagerConnection::updatePreferencesStore):
876         Enable Resource Timing / User Timing for the ServiceWorker process.
877
878 2018-01-04  Zan Dobersek  <zdobersek@igalia.com>
879
880         Unreviewed GTK+ build fix.
881
882         * UIProcess/API/glib/WebKitUserMediaPermissionRequest.cpp:
883         (webkit_user_media_permission_is_for_audio_device):
884         Call UserMediaPermissionRequestProxy::requiresAudioCapture().
885         (webkit_user_media_permission_is_for_video_device):
886         Call UserMediaPermissionRequestProxy::requiresVideoCapture().
887
888 2018-01-04  Don Olmstead  <don.olmstead@sony.com>
889
890         [Curl] Fix compilation error in WebFrameNetworkingContext
891         https://bugs.webkit.org/show_bug.cgi?id=181312
892
893         Reviewed by Alex Christensen.
894
895         * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.cpp:
896         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
897
898 2018-01-04  Tim Horton  <timothy_horton@apple.com>
899
900         WKWebView loses minimum layout size overrides that happen while the process is terminated
901         https://bugs.webkit.org/show_bug.cgi?id=181306
902         <rdar://problem/34398288>
903
904         Reviewed by Dan Bernstein.
905
906         * Shared/WebPageCreationParameters.cpp:
907         (WebKit::WebPageCreationParameters::encode const):
908         (WebKit::WebPageCreationParameters::decode):
909         * Shared/WebPageCreationParameters.h:
910         * UIProcess/API/Cocoa/WKWebView.mm:
911         (-[WKWebView _didRelaunchProcess]): Deleted.
912         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
913         * UIProcess/WebPageProxy.cpp:
914         (WebKit::WebPageProxy::creationParameters):
915         * UIProcess/WebPageProxy.h:
916         * UIProcess/ios/PageClientImplIOS.mm:
917         (WebKit::PageClientImpl::didRelaunchProcess):
918         * UIProcess/ios/WebPageProxyIOS.mm:
919         (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
920         (WebKit::WebPageProxy::setForceAlwaysUserScalable):
921         (WebKit::WebPageProxy::setMaximumUnobscuredSize):
922         * WebProcess/WebPage/WebPage.cpp:
923         (WebKit::WebPage::WebPage):
924         Pass the current viewport minimum layout size and maximum unobscured size
925         in the WebPageCreationParameters instead of re-sending them in _didRelaunchProcess.
926
927         The previous approach was problematic when _dispatchSetMinimumLayoutSize:
928         was changed to not re-send identical updates, because if the client calls 
929         _overrideLayoutParametersWithMinimumLayoutSize before the Web Content process
930         is re-launched (after terminating), we would cache the size, attempt to send it,
931         fail silently (because the process is not launched), and then in _didRelaunchProcess
932         we would choose not to re-send (after the process is successfully relaunched)
933         because we think we already sent the new value.
934
935         Add isValid() checks to our message sends. Ideally send() would assert
936         if the process is not alive to avoid problems like this, but it doesn't (yet).
937
938         Get rid of WKWebView's _didRelaunchProcess, because it does nothing now.
939
940 2018-01-04  Stephan Szabo  <stephan.szabo@sony.com>
941
942         NetworkProcess cache files use functions from unistd.h without explicitly including it
943         https://bugs.webkit.org/show_bug.cgi?id=181261
944
945         Reviewed by Alex Christensen.
946
947         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
948         * NetworkProcess/cache/NetworkCacheData.cpp:
949
950 2018-01-04  Keith Rollin  <krollin@apple.com>
951
952         Add commas
953         https://bugs.webkit.org/show_bug.cgi?id=181295
954         <rdar://problem/35802295>
955
956         Reviewed by Brent Fulgham.
957
958         Fix a problem introduced in r226226 where the emitted JSON didn't
959         include some required commas.
960
961         * NetworkProcess/NetworkResourceLoader.cpp:
962         (WebKit::NetworkResourceLoader::logCookieInformation const):
963
964 2018-01-04  Eric Carlson  <eric.carlson@apple.com>
965
966         [MediaStream] Add Mock screen capture source
967         https://bugs.webkit.org/show_bug.cgi?id=181291
968         <rdar://problem/36298164>
969
970         Reviewed by Dean Jackson.
971
972         * Shared/WebCoreArgumentCoders.cpp:
973         (IPC::ArgumentCoder<MediaConstraints>::decode):
974         (IPC::ArgumentCoder<CaptureDevice>::encode): Deleted, moved to CaptureDevice.h
975         (IPC::ArgumentCoder<CaptureDevice>::decode): Ditto.
976         * Shared/WebCoreArgumentCoders.h:
977
978         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add _WKCaptureDeviceDisplay.
979         * UIProcess/Cocoa/UIDelegate.mm:
980         (WebKit::requestUserMediaAuthorizationForDevices): Deal with display capture.
981         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Ditto.
982
983         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
984         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): requiresAudio -> requiresAudioCapture.
985         (WebKit::UserMediaPermissionRequestManagerProxy::searchForGrantedRequest const): Never reuse
986         a previously granted display capture request.
987
988         * UIProcess/UserMediaPermissionRequestProxy.cpp:
989         (WebKit::UserMediaPermissionRequestProxy::allow): Search the eligible devices instead of asking
990         the source center to find devices.
991         * UIProcess/UserMediaPermissionRequestProxy.h:
992         (WebKit::UserMediaPermissionRequestProxy::requiresAudioCapture const): Renamed.
993         (WebKit::UserMediaPermissionRequestProxy::requiresVideoCapture const): Ditto.
994         (WebKit::UserMediaPermissionRequestProxy::requiresDisplayCapture const): New.
995         (WebKit::UserMediaPermissionRequestProxy::requiresAudio const): Deleted.
996         (WebKit::UserMediaPermissionRequestProxy::requiresVideo const): Deleted.
997
998 2018-01-04  Youenn Fablet  <youenn@apple.com>
999
1000         FetchResponse should set its internal response text encoding name
1001         https://bugs.webkit.org/show_bug.cgi?id=181284
1002
1003         Reviewed by Alex Christensen.
1004
1005         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1006         (WebKit::ServiceWorkerClientFetch::didReceiveResponse): Set default encoding to UTF-8.
1007
1008 2018-01-04  Youenn Fablet  <youenn@apple.com>
1009
1010         Implement Cache API partitioning based on ClientOrigin
1011         https://bugs.webkit.org/show_bug.cgi?id=181240
1012
1013         Reviewed by Alex Christensen.
1014
1015         open and retrieveCaches now take a ClientOrigin instead of a String.
1016         Updated cache filesystem path computation to take both client origin and top origin.
1017
1018         When clearing an origin, caches whose client origin or top origin matches the origin are cleared.
1019         Caches are added to the web site data of their client origin with their corresponding cache size.
1020         Caches are added to the web site data of their top origin with a size equal to 0.
1021
1022         Updated memory representation dumping used for test to include both top and client origins.
1023
1024         * NetworkProcess/NetworkProcess.cpp:
1025         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
1026         * NetworkProcess/cache/CacheStorageEngine.cpp:
1027         (WebKit::CacheStorage::Engine::cachesRootPath):
1028         (WebKit::CacheStorage::Engine::open):
1029         (WebKit::CacheStorage::Engine::remove):
1030         (WebKit::CacheStorage::Engine::retrieveCaches):
1031         (WebKit::CacheStorage::Engine::readCachesFromDisk):
1032         (WebKit::CacheStorage::Engine::removeCaches):
1033         (WebKit::CacheStorage::Engine::fetchEntries):
1034         (WebKit::CacheStorage::Engine::clearCachesForOrigin):
1035         (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
1036         (WebKit::CacheStorage::Engine::representation):
1037         * NetworkProcess/cache/CacheStorageEngine.h:
1038         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
1039         (WebKit::CacheStorage::Cache::Cache):
1040         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1041         (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory):
1042         (WebKit::CacheStorage::Caches::Caches):
1043         (WebKit::CacheStorage::Caches::storeOrigin):
1044         (WebKit::CacheStorage::Caches::readOrigin):
1045         (WebKit::CacheStorage::Caches::open):
1046         * NetworkProcess/cache/CacheStorageEngineCaches.h:
1047         (WebKit::CacheStorage::Caches::create):
1048         (WebKit::CacheStorage::Caches::origin const):
1049         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
1050         (WebKit::CacheStorageEngineConnection::open):
1051         (WebKit::CacheStorageEngineConnection::caches):
1052         (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
1053         * NetworkProcess/cache/CacheStorageEngineConnection.h:
1054         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
1055         * WebProcess/Cache/WebCacheStorageConnection.cpp:
1056         (WebKit::WebCacheStorageConnection::doOpen):
1057         (WebKit::WebCacheStorageConnection::doRetrieveCaches):
1058         (WebKit::WebCacheStorageConnection::clearMemoryRepresentation):
1059         * WebProcess/Cache/WebCacheStorageConnection.h:
1060
1061 2018-01-04  Youenn Fablet  <youenn@apple.com>
1062
1063         Service Worker should expose redirect mode for navigation loads as manual
1064         https://bugs.webkit.org/show_bug.cgi?id=181067
1065
1066         Reviewed by Alex Christensen.
1067
1068         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1069         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
1070
1071 2018-01-03  Wenson Hsieh  <wenson_hsieh@apple.com>
1072
1073         [Attachment Support] Create attachment elements when dropping files on iOS
1074         https://bugs.webkit.org/show_bug.cgi?id=181192
1075         <rdar://problem/36280945>
1076
1077         Reviewed by Tim Horton.
1078
1079         Make some minor adjustments for changes to the pasteboard in WebCore. See WebCore/ChangeLog for more detail.
1080         Teaches WebPasteboardProxy et. al. to plumb PasteboardItemInfo from the UI process to the web process via the
1081         new `InformationForItemAtIndex` codepath.
1082
1083         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1084         (WebKit::WebPasteboardProxy::informationForItemAtIndex):
1085         (WebKit::WebPasteboardProxy::getFilenamesForDataInteraction): Deleted.
1086         * UIProcess/WebPasteboardProxy.h:
1087         * UIProcess/WebPasteboardProxy.messages.in:
1088         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1089         (WebKit::WebPlatformStrategies::informationForItemAtIndex):
1090         (WebKit::WebPlatformStrategies::getFilenamesForDataInteraction): Deleted.
1091         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1092
1093 2018-01-03  Ting-Wei Lan  <lantw44@gmail.com>
1094
1095         Replace hard-coded paths in shebangs with #!/usr/bin/env
1096         https://bugs.webkit.org/show_bug.cgi?id=181040
1097
1098         Reviewed by Alex Christensen.
1099
1100         * Scripts/generate-forwarding-headers.pl:
1101
1102 2018-01-03  Wenson Hsieh  <wenson_hsieh@apple.com>
1103
1104         [Attachment Support] Add plumbing for starting a drag with promised blob data
1105         https://bugs.webkit.org/show_bug.cgi?id=181201
1106
1107         Reviewed by Tim Horton.
1108
1109         Add boilerplate plumbing for PrepareToDragPromisedBlob, which delivers blob promises to the UI process when
1110         dragging, respectively.
1111
1112         * Scripts/webkit/messages.py:
1113         (headers_for_type):
1114         * Shared/WebCoreArgumentCoders.cpp:
1115         (IPC::encodeTypesAndData):
1116         (IPC::decodeTypesAndData):
1117         (IPC::ArgumentCoder<PasteboardWebContent>::encode):
1118         (IPC::ArgumentCoder<PasteboardWebContent>::decode):
1119         (IPC::ArgumentCoder<PasteboardImage>::encode):
1120         (IPC::ArgumentCoder<PasteboardImage>::decode):
1121         (IPC::ArgumentCoder<PromisedBlobInfo>::encode):
1122         (IPC::ArgumentCoder<PromisedBlobInfo>::decode):
1123
1124         Add IPC support PromisedBlobInfo's additionalTypes and additionalData.
1125
1126         (IPC::encodeClientTypesAndData): Deleted.
1127         (IPC::decodeClientTypesAndData): Deleted.
1128
1129         Rename these helper functions and move them to the top of the file.
1130
1131         * UIProcess/Cocoa/WebViewImpl.h:
1132         * UIProcess/Cocoa/WebViewImpl.mm:
1133         (WebKit::WebViewImpl::prepareToDragPromisedBlob):
1134         * UIProcess/PageClient.h:
1135         (WebKit::PageClient::prepareToDragPromisedBlob):
1136         * UIProcess/WebPageProxy.cpp:
1137         (WebKit::WebPageProxy::prepareToDragPromisedBlob):
1138         * UIProcess/WebPageProxy.h:
1139         * UIProcess/WebPageProxy.messages.in:
1140         * UIProcess/ios/PageClientImplIOS.h:
1141         * UIProcess/ios/PageClientImplIOS.mm:
1142         (WebKit::PageClientImpl::prepareToDragPromisedBlob):
1143         * UIProcess/ios/WKContentViewInteraction.h:
1144         * UIProcess/ios/WKContentViewInteraction.mm:
1145         (-[WKContentView _prepareToDragPromisedBlob:]):
1146         * UIProcess/mac/PageClientImplMac.h:
1147         * UIProcess/mac/PageClientImplMac.mm:
1148         (WebKit::PageClientImpl::prepareToDragPromisedBlob):
1149         * WebProcess/WebCoreSupport/WebDragClient.cpp:
1150         (WebKit::WebDragClient::prepareToDragPromisedBlob):
1151         * WebProcess/WebCoreSupport/WebDragClient.h:
1152         * WebProcess/WebPage/WebPage.cpp:
1153         (WebKit::WebPage::prepareToDragPromisedBlob):
1154         * WebProcess/WebPage/WebPage.h:
1155
1156 2018-01-03  David Kilzer  <ddkilzer@apple.com>
1157
1158         REGRESSION (r212929): WKSnapshotConfiguration may leak an NSNumber when deallocated
1159         <https://webkit.org/b/181274>
1160
1161         Reviewed by Joseph Pecoraro.
1162
1163         * UIProcess/API/Cocoa/WKSnapshotConfiguration.mm:
1164         (-[WKSnapshotConfiguration dealloc]): Implement method and
1165         release _snapshotWidth.
1166
1167 2018-01-03  John Wilander  <wilander@apple.com>
1168
1169         Storage Access API: Refactor XPC for access removal to go straight from the web process to the network process
1170         https://bugs.webkit.org/show_bug.cgi?id=181270
1171         <rdar://problem/36289544>
1172
1173         Reviewed by Alex Christensen.
1174
1175         This change refactors how the web process tells the network process
1176         to remove storage access. Previously, this was done over the UI process
1177         just like requests for storage access. But since no further reasoning
1178         is needed, the message should go straight from the web process to the
1179         network process for performance reasons and to minimize the risk of a
1180         race.
1181
1182         As a consequence, the XPC code for storage access removal in the UI
1183         process is deleted.
1184
1185         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1186         (WebKit::NetworkConnectionToWebProcess::removeStorageAccess):
1187         * NetworkProcess/NetworkConnectionToWebProcess.h:
1188         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1189         * NetworkProcess/NetworkProcess.cpp:
1190         (WebKit::NetworkProcess::removeStorageAccess): Deleted.
1191         * NetworkProcess/NetworkProcess.h:
1192         * NetworkProcess/NetworkProcess.messages.in:
1193         * UIProcess/Network/NetworkProcessProxy.cpp:
1194         (WebKit::NetworkProcessProxy::removeStorageAccess): Deleted.
1195         * UIProcess/Network/NetworkProcessProxy.h:
1196         * UIProcess/WebPageProxy.cpp:
1197         (WebKit::WebPageProxy::requestStorageAccess):
1198         (WebKit::WebPageProxy::removeStorageAccess): Deleted.
1199         * UIProcess/WebPageProxy.h:
1200         * UIProcess/WebPageProxy.messages.in:
1201         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1202         (WebKit::WebsiteDataStore::requestStorageAccess):
1203         (WebKit::WebsiteDataStore::removeStorageAccess): Deleted.
1204         * UIProcess/WebsiteData/WebsiteDataStore.h:
1205         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1206         (WebKit::WebFrameLoaderClient::detachedFromParent2):
1207         (WebKit::WebFrameLoaderClient::dispatchWillChangeDocument):
1208
1209 2018-01-03  David Kilzer  <ddkilzer@apple.com>
1210
1211         com.apple.WebKit.Networking crash in com.apple.Foundation: -[__NSOperationInternal _start:]
1212         <https://webkit.org/b/181272>
1213         <rdar://problem/35657310>
1214
1215         Reviewed by Alex Christensen.
1216
1217         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1218         (downgradeRequest): Remove unnecessary -autorelease.
1219
1220 2018-01-03  Brent Fulgham  <bfulgham@apple.com>
1221
1222         [macOS] Constant frame dropping during Flash video playback
1223         https://bugs.webkit.org/show_bug.cgi?id=181249
1224         <rdar://problem/34843448>
1225
1226         Reviewed by Eric Carlson.
1227
1228         Review of logs during jerky flash video playback shows a few IOKit properties are being blocked by the sandbox,
1229         which prevents some high-efficiency codecs from being used. Add 'AppleGVAKeyDoesNotExist', 'IODVDBundleName', and
1230         'IOGVA*Encode' to the whitelist.
1231
1232         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1233
1234 2018-01-03  Michael Catanzaro  <mcatanzaro@igalia.com>
1235
1236         [GTK] Add web process API to detect when form is submitted via JavaScript
1237         https://bugs.webkit.org/show_bug.cgi?id=173915
1238
1239         Reviewed by Carlos Garcia Campos.
1240
1241         Epiphany relies on the DOM submit event to detect when a form has been submitted. However,
1242         for historical reasons, the submit event is not emitted when a form is submitted by
1243         JavaScript. It is therefore not currently possible for a web browser to reliably detect form
1244         submission and not possible to implement a robust password storage feature. In order to
1245         avoid this problem, this patch adds a new WebKitWebPage signal, will-submit-form, that
1246         browsers can use in preference to a DOM event listener.
1247
1248         Unfortunately, this signal is not available for WPE because it depends on the DOM API.
1249
1250         There are two submission events, WEBKIT_FORM_SUBMISSION_WILL_SEND_DOM_EVENT and
1251         WEBKIT_FORM_SUBMISSION_WILL_COMPLETE. WEBKIT_FORM_SUBMISSION_WILL_SEND_DOM_EVENT
1252         occurs earlier than WEBKIT_FORM_SUBMISSION_WILL_COMPLETE and can be used to retrieve form
1253         values before websites receive the DOM submit event. This is useful as some websites like
1254         to delete form values right before a submit would normally happen in order to attempt to
1255         defeat browser password managers. There are two tricks to note: JavaScript can cancel form
1256         submission immediately after this event occurs (by returning false in an onsubmit handler),
1257         and, for historical reasons, this event will not occur at all when form submission is
1258         triggered by JavaScript. WEBKIT_FORM_SUBMISSION_WILL_COMPLETE occurs next, and is more
1259         straightforward: it is always emitted when a form is about to be submitted, when it is too
1260         late to cancel.
1261
1262         The recommended way to reliably retrieve password form values would be to watch for both
1263         events, use the form value detected in WEBKIT_FORM_SUBMISSION_WILL_SEND_DOM_EVENT
1264         if that event is emitted, and use the value detected later in
1265         WEBKIT_FORM_SUBMISSION_WILL_COMPLETE otherwise.
1266
1267         Since one of the signal arguments is an enum, we now have to run glib-mkenums for the web
1268         process API. And that has resulted in this patch also adding GType goo for
1269         WebKitConsoleMessageLevel and WebKitConsoleMessageSource that was previously missing. Any
1270         applications that for some unlikely reason want to use these enums in properties or signals
1271         will be happy.
1272
1273         * PlatformGTK.cmake:
1274         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1275         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
1276         (webkit_web_page_class_init):
1277         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h:
1278         * WebProcess/InjectedBundle/API/gtk/WebKitWebProcessEnumTypes.cpp.template: Added.
1279         * WebProcess/InjectedBundle/API/gtk/WebKitWebProcessEnumTypes.h.template: Added.
1280
1281 2018-01-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1282
1283         Unreviewed. Really fix plugin process after r226327.
1284
1285         * PluginProcess/unix/PluginProcessMainUnix.cpp:
1286
1287 2018-01-02  Brent Fulgham  <bfulgham@apple.com>
1288
1289         [macOS, iOS] Adopt new secure coding APIs in WebKit
1290         https://bugs.webkit.org/show_bug.cgi?id=181085
1291         <rdar://problem/34837397>
1292
1293         Reviewed by Tim Horton.
1294
1295         Update WebKit code to use NSSecureCoding when the underlying operating system supports it. Use new
1296         wrapper functions so the same code can be built on all supported OS releases, while enabling
1297         seure coding when possible.
1298
1299         Note that NSView-based classes cannot be migrated at present due to AppKit not supporting NSSecureCoding
1300         in its class hierarchy.
1301
1302         Tested by exising TestWebKitAPI tests for Coding and data transfer.
1303
1304         * Platform/ios/AccessibilityIOS.mm:
1305         (WebKit::newAccessibilityRemoteToken): Encode using NSSecureCoding.
1306         * UIProcess/API/Cocoa/WKPreferences.h:
1307         * UIProcess/API/Cocoa/WKPreferences.mm:
1308         (+[WKPreferences supportsSecureCoding]): Added to enable NSSecureCoding.
1309         * UIProcess/API/Cocoa/WKProcessPool.h:
1310         * UIProcess/API/Cocoa/WKProcessPool.mm:
1311         (+[WKProcessPool supportsSecureCoding]): Ditto.
1312         * UIProcess/API/Cocoa/WKUserContentController.h:
1313         * UIProcess/API/Cocoa/WKUserContentController.mm:
1314         (+[WKUserContentController supportsSecureCoding]): Ditto.
1315         * UIProcess/API/Cocoa/WKWebView.mm:
1316         (-[WKWebView initWithCoder:]): Use coding initialization that supports secure coding if
1317         it is available in the supplied class.
1318         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1319         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1320         (+[WKWebViewConfiguration supportsSecureCoding]): Added to enable NSSecureCoding.
1321         (-[WKWebViewConfiguration initWithCoder:]): Use secure coding when possible.
1322         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
1323         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1324         (+[WKWebsiteDataStore supportsSecureCoding]): Added to enable NSSecureCoding.
1325         * UIProcess/API/Cocoa/_WKApplicationManifest.h:
1326         * UIProcess/API/Cocoa/_WKApplicationManifest.mm:
1327         (+[_WKApplicationManifest supportsSecureCoding]): Added to enable NSSecureCoding.
1328         (-[_WKApplicationManifest initWithCoder:]): Use secure coding when possible.
1329
1330 2017-12-28  Yusuke Suzuki  <utatane.tea@gmail.com>
1331
1332         Remove std::chrono completely
1333         https://bugs.webkit.org/show_bug.cgi?id=181186
1334
1335         Reviewed by Alex Christensen.
1336
1337         Use MonotonicTime, WallTime, and Seconds instead.
1338         Changes are mechanical ones.
1339
1340         * NetworkProcess/NetworkProcess.cpp:
1341         (WebKit::NetworkProcess::deleteWebsiteData):
1342         * NetworkProcess/NetworkProcess.h:
1343         * NetworkProcess/NetworkProcess.messages.in:
1344         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1345         (WebKit::CacheStorage::Caches::clear):
1346         * NetworkProcess/cache/NetworkCache.cpp:
1347         (WebKit::NetworkCache::responseHasExpired):
1348         (WebKit::NetworkCache::responseNeedsRevalidation):
1349         (WebKit::NetworkCache::makeStoreDecision):
1350         (WebKit::NetworkCache::Cache::clear):
1351         (WebKit::NetworkCache::Cache::storeData):
1352         * NetworkProcess/cache/NetworkCache.h:
1353         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1354         (WebKit::NetworkCache::Entry::Entry):
1355         (WebKit::NetworkCache::Entry::asJSON const):
1356         * NetworkProcess/cache/NetworkCacheEntry.h:
1357         (WebKit::NetworkCache::Entry::timeStamp const):
1358         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
1359         (WebKit::NetworkCache::fileTimes):
1360         (WebKit::NetworkCache::updateFileModificationTimeIfNeeded):
1361         * NetworkProcess/cache/NetworkCacheFileSystem.h:
1362         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
1363         (WebKit::NetworkCache::IOChannel::IOChannel):
1364         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
1365         (WebKit::NetworkCache::responseNeedsRevalidation):
1366         (WebKit::NetworkCache::canRevalidate):
1367         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1368         (WebKit::NetworkCache::Storage::readRecord):
1369         (WebKit::NetworkCache::Storage::clear):
1370         (WebKit::NetworkCache::computeRecordWorth):
1371         * NetworkProcess/cache/NetworkCacheStorage.h:
1372         Bump the cache version. We now change the data in persistent cache.
1373         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
1374         (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
1375         (WebKit::NetworkCache::SubresourcesEntry::SubresourcesEntry):
1376         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
1377         (WebKit::NetworkCache::SubresourceInfo::lastSeen const):
1378         (WebKit::NetworkCache::SubresourceInfo::firstSeen const):
1379         (WebKit::NetworkCache::SubresourcesEntry::timeStamp const):
1380         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1381         (WebKit::NetworkProcess::clearHSTSCache):
1382         (WebKit::clearNSURLCache):
1383         (WebKit::NetworkProcess::clearDiskCache):
1384         * NetworkProcess/curl/NetworkProcessCurl.cpp:
1385         (WebKit::NetworkProcess::clearDiskCache):
1386         * NetworkProcess/mac/NetworkProcessMac.mm:
1387         (WebKit::NetworkProcess::clearCacheForAllOrigins):
1388         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1389         (WebKit::NetworkProcess::clearCacheForAllOrigins):
1390         (WebKit::NetworkProcess::clearDiskCache):
1391         * Platform/IPC/ArgumentCoders.cpp:
1392         (IPC::ArgumentCoder<WallTime>::encode):
1393         (IPC::ArgumentCoder<WallTime>::decode):
1394         (IPC::ArgumentCoder<std::chrono::system_clock::time_point>::encode): Deleted.
1395         (IPC::ArgumentCoder<std::chrono::system_clock::time_point>::decode): Deleted.
1396         * Platform/IPC/ArgumentCoders.h:
1397         * PluginProcess/PluginProcess.cpp:
1398         (WebKit::PluginProcess::deleteWebsiteData):
1399         * PluginProcess/PluginProcess.h:
1400         * PluginProcess/PluginProcess.messages.in:
1401         * Scripts/webkit/messages.py:
1402         (headers_for_type):
1403         * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
1404         (WebKit::RemoteLayerBackingStore::lastDisplayTime const):
1405         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
1406         (WebKit::RemoteLayerBackingStore::RemoteLayerBackingStore):
1407         (WebKit::RemoteLayerBackingStore::display):
1408         * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.h:
1409         * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.mm:
1410         (WebKit::RemoteLayerBackingStoreCollection::markBackingStoreVolatile):
1411         (WebKit::RemoteLayerBackingStoreCollection::volatilityTimerFired):
1412         * Shared/WebCoreArgumentCoders.cpp:
1413         (IPC::ArgumentCoder<RecentSearch>::decode):
1414         (IPC::ArgumentCoder<WallTime>::encode): Deleted.
1415         (IPC::ArgumentCoder<WallTime>::decode): Deleted.
1416         * Shared/WebCoreArgumentCoders.h:
1417         * StorageProcess/StorageProcess.cpp:
1418         (WebKit::StorageProcess::deleteWebsiteData):
1419         * StorageProcess/StorageProcess.h:
1420         * StorageProcess/StorageProcess.messages.in:
1421         * UIProcess/API/C/WKApplicationCacheManager.cpp:
1422         (WKApplicationCacheManagerDeleteAllEntries):
1423         * UIProcess/API/C/WKCookieManager.cpp:
1424         (WKCookieManagerDeleteAllCookiesModifiedAfterDate):
1425         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
1426         (WKKeyValueStorageManagerDeleteAllEntries):
1427         * UIProcess/API/C/WKResourceCacheManager.cpp:
1428         (WKResourceCacheManagerClearCacheForAllOrigins):
1429         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1430         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
1431         (WKWebsiteDataStoreStatisticsClearThroughWebsiteDataRemoval):
1432         (WKWebsiteDataStoreRemoveAllFetchCaches):
1433         (WKWebsiteDataStoreRemoveAllIndexedDatabases):
1434         (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):
1435         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1436         (toSystemClockTime):
1437         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]):
1438         * UIProcess/API/glib/WebKitWebContext.cpp:
1439         (webkit_web_context_clear_cache):
1440         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
1441         (webkit_website_data_manager_clear):
1442         * UIProcess/DrawingAreaProxy.h:
1443         * UIProcess/Network/NetworkProcessProxy.cpp:
1444         (WebKit::NetworkProcessProxy::deleteWebsiteData):
1445         * UIProcess/Network/NetworkProcessProxy.h:
1446         * UIProcess/Plugins/PluginProcessManager.cpp:
1447         (WebKit::PluginProcessManager::deleteWebsiteData):
1448         * UIProcess/Plugins/PluginProcessManager.h:
1449         * UIProcess/Plugins/PluginProcessProxy.cpp:
1450         (WebKit::PluginProcessProxy::deleteWebsiteData):
1451         * UIProcess/Plugins/PluginProcessProxy.h:
1452         * UIProcess/Storage/StorageProcessProxy.cpp:
1453         (WebKit::StorageProcessProxy::deleteWebsiteData):
1454         * UIProcess/Storage/StorageProcessProxy.h:
1455         * UIProcess/WebCookieManagerProxy.cpp:
1456         (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince):
1457         * UIProcess/WebCookieManagerProxy.h:
1458         * UIProcess/WebProcessProxy.cpp:
1459         (WebKit::WebProcessProxy::deleteWebsiteData):
1460         * UIProcess/WebProcessProxy.h:
1461         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1462         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
1463         * UIProcess/WebResourceLoadStatisticsStore.h:
1464         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
1465         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
1466         * UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
1467         * UIProcess/WebStorage/StorageManager.cpp:
1468         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
1469         * UIProcess/WebStorage/StorageManager.h:
1470         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1471         (WebKit::WebsiteDataStore::platformRemoveRecentSearches):
1472         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1473         (WebKit::WebsiteDataStore::removeData):
1474         (WebKit::WebsiteDataStore::removeMediaKeys):
1475         * UIProcess/WebsiteData/WebsiteDataStore.h:
1476         * UIProcess/gtk/WebPageProxyGtk.cpp:
1477         (WebKit::WebsiteDataStore::platformRemoveRecentSearches):
1478         * UIProcess/wpe/WebPageProxyWPE.cpp:
1479         (WebKit::WebsiteDataStore::platformRemoveRecentSearches):
1480         * WebProcess/Cookies/WebCookieManager.cpp:
1481         (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
1482         * WebProcess/Cookies/WebCookieManager.h:
1483         * WebProcess/Cookies/WebCookieManager.messages.in:
1484         * WebProcess/Plugins/PluginView.cpp:
1485         (WebKit::lastModifiedDateMS):
1486         * WebProcess/WebProcess.cpp:
1487         (WebKit::WebProcess::deleteWebsiteData):
1488         * WebProcess/WebProcess.h:
1489         * WebProcess/WebProcess.messages.in:
1490
1491 2018-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
1492
1493         [Attachment Support] Introduce data structures and IPC support for writing promised blobs
1494         https://bugs.webkit.org/show_bug.cgi?id=181189
1495
1496         Reviewed by Tim Horton.
1497
1498         Add IPC support for PromisedBlobInfo and PromisedBlobData. See WebCore/ChangeLog for more detail.
1499
1500         * Shared/WebCoreArgumentCoders.cpp:
1501         (IPC::ArgumentCoder<PromisedBlobData>::encode):
1502         (IPC::ArgumentCoder<PromisedBlobData>::decode):
1503         (IPC::ArgumentCoder<PromisedBlobInfo>::encode):
1504         (IPC::ArgumentCoder<PromisedBlobInfo>::decode):
1505         * Shared/WebCoreArgumentCoders.h:
1506
1507 2018-01-02  Michael Catanzaro  <mcatanzaro@igalia.com>
1508
1509         REGRESSION(r223253): Broke ResourceLoadStatistics layout tests for non-Cocoa ports
1510         https://bugs.webkit.org/show_bug.cgi?id=181231
1511
1512         Reviewed by Alex Christensen.
1513
1514         Add new C API for use by WebKitTestRunner.
1515
1516         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1517         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
1518         (WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
1519         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1520
1521 2018-01-02  Jiewen Tan  <jiewen_tan@apple.com>
1522
1523         Add a WebAuthentication runtime feature flag
1524         https://bugs.webkit.org/show_bug.cgi?id=181220
1525         <rdar://problem/36055305>
1526
1527         Reviewed by Brent Fulgham.
1528
1529         Renames the CredentialManagement runtime feature flag into WebAuthentication.
1530
1531         * Shared/WebPreferences.yaml:
1532         * UIProcess/API/C/WKPreferences.cpp:
1533         (WKPreferencesSetWebAuthenticationEnabled):
1534         (WKPreferencesGetWebAuthenticationEnabled):
1535         (WKPreferencesSetCredentialManagementEnabled): Deleted.
1536         (WKPreferencesGetCredentialManagementEnabled): Deleted.
1537         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1538         * WebProcess/WebPage/WebPage.cpp:
1539         (WebKit::WebPage::updatePreferences):
1540
1541 2018-01-02  Michael Catanzaro  <mcatanzaro@igalia.com>
1542
1543         REGRESSION(r226327): [GTK] Plugin process is broken
1544         https://bugs.webkit.org/show_bug.cgi?id=181187
1545
1546         Unreviewed, fix PluginProcessMainUnix after r226327.
1547
1548         * PluginProcess/unix/PluginProcessMainUnix.cpp:
1549
1550 2018-01-02  Tim Horton  <timothy_horton@apple.com>
1551
1552         Fix the build on platforms where UICurrentUserInterfaceIdiomIsPad is defined to false
1553         https://bugs.webkit.org/show_bug.cgi?id=181218
1554
1555         Reviewed by Alex Christensen.
1556
1557         * Platform/spi/ios/UIKitSPI.h:
1558         (currentUserInterfaceIdiomIsPad):
1559         * UIProcess/ios/SmartMagnificationController.mm:
1560         (WebKit::SmartMagnificationController::didCollectGeometryForSmartMagnificationGesture):
1561         * UIProcess/ios/WKContentViewInteraction.mm:
1562         (-[WKFormInputSession setAccessoryViewCustomButtonTitle:]):
1563         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
1564         (-[WKContentView _displayFormNodeInputView]):
1565         (-[WKContentView requiresAccessoryView]):
1566         (-[WKContentView _updateAccessory]):
1567         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
1568         (-[WKAirPlayRoutePicker show:fromRect:]):
1569         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1570         (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
1571         (-[WKFileUploadPanel _presentMenuOptionForCurrentInterfaceIdiom:]):
1572         * UIProcess/ios/forms/WKFormInputControl.mm:
1573         (-[WKDateTimePicker initWithView:datePickerMode:]):
1574         (-[WKFormInputControl initWithView:]):
1575         * UIProcess/ios/forms/WKFormSelectControl.mm:
1576         (-[WKFormSelectControl initWithView:]):
1577         On platforms where UICurrentUserInterfaceIdiomIsPad is defined to false,
1578         blocks that conditionally execute based on its value are unreachable.
1579         This causes the compiler to complain. Hide it away inside an inline function
1580         and make use of that everywhere we used to use the macro.
1581
1582 2018-01-02  Alex Christensen  <achristensen@webkit.org>
1583
1584         Remove SVN file accidentally added in r226160
1585         https://bugs.webkit.org/show_bug.cgi?id=180934
1586
1587         * UIProcess/WebPageProxy.cpp.orig: Removed.
1588
1589 2018-01-02  Alex Christensen  <achristensen@webkit.org>
1590
1591         Use BlockPtrs and lambdas instead of new/delete to pass parameters to blocks in WebViewImpl::performDragOperation
1592         https://bugs.webkit.org/show_bug.cgi?id=180795
1593
1594         Reviewed by Brent Fulgham.
1595
1596         * UIProcess/Cocoa/WebViewImpl.mm:
1597         (WebKit::WebViewImpl::performDragOperation):
1598
1599 2018-01-02  Michael Catanzaro  <mcatanzaro@igalia.com>
1600
1601         [WPE][GTK] Implement the assignment of ProcessIdentifiers to child processes
1602         https://bugs.webkit.org/show_bug.cgi?id=181187
1603
1604         Reviewed by Brady Eidson.
1605
1606         * Shared/ChildProcess.cpp: Make the ProcessIdentifier mandatory.
1607         (WebKit::ChildProcess::initialize):
1608         * Shared/unix/ChildProcessMain.cpp: Initialize ChildProcessInitializationParameters with the
1609         ProcessIdentifier.
1610         (WebKit::ChildProcessMainBase::parseCommandLine):
1611         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: Copy the ProcessIdentifier from
1612         LaunchOptions into argv.
1613         (WebKit::ProcessLauncher::launchProcess):
1614         * WebProcess/wpe/WebProcessMainWPE.cpp: Expect the WPE socket ID later in the command line.
1615
1616 2018-01-02  Alex Christensen  <achristensen@webkit.org>
1617
1618         Use new WebsiteDataStore passed in through decidePolicyForNavigation SPI
1619         https://bugs.webkit.org/show_bug.cgi?id=180897
1620         <rdar://problem/35535328>
1621
1622         Reviewed by Brent Fulgham.
1623
1624         * Shared/WebsitePoliciesData.cpp:
1625         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
1626         * UIProcess/Cocoa/NavigationState.mm:
1627         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1628         * UIProcess/WebPageProxy.cpp:
1629         (WebKit::WebPageProxy::changeWebsiteDataStore):
1630         * UIProcess/WebPageProxy.h:
1631         * UIProcess/WebProcessPool.cpp:
1632         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
1633         (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
1634         (WebKit::WebProcessPool::pageAddedToProcess): Deleted.
1635         (WebKit::WebProcessPool::pageRemovedFromProcess): Deleted.
1636         * UIProcess/WebProcessPool.h:
1637         * UIProcess/WebProcessProxy.cpp:
1638         (WebKit::WebProcessProxy::addExistingWebPage):
1639         (WebKit::WebProcessProxy::removeWebPage):
1640         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
1641         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
1642
1643 2018-01-02  Alex Christensen  <achristensen@webkit.org>
1644
1645         Only use CookieStorageShim when we aren't using NetworkSession
1646         https://bugs.webkit.org/show_bug.cgi?id=180766
1647
1648         Reviewed by Brent Fulgham.
1649
1650         * Shared/mac/CookieStorageShim.h:
1651         * Shared/mac/CookieStorageShim.mm:
1652         * WebProcess/WebProcess.cpp:
1653         (WebKit::WebProcess::initializeWebProcess):
1654
1655 2018-01-02  Alex Christensen  <achristensen@webkit.org>
1656
1657         Clean up context menu code
1658         https://bugs.webkit.org/show_bug.cgi?id=181074
1659
1660         Reviewed by Brent Fulgham.
1661
1662         Use Ref instead of RefPtr where possible.
1663         Use move semantics instead of copying from const references when possible.
1664         Remove dead iOS code.  Reduce allocations.  Add stub for WPE.
1665
1666         * UIProcess/API/APIContextMenuClient.h:
1667         (API::ContextMenuClient::getContextMenuFromProposedMenu):
1668         (API::ContextMenuClient::getContextMenuFromProposedMenuAsync):
1669         (API::ContextMenuClient::showContextMenu):
1670         * UIProcess/API/C/WKPage.cpp:
1671         (WKPageSetPageContextMenuClient):
1672         * UIProcess/API/gtk/PageClientImpl.cpp:
1673         (WebKit::PageClientImpl::createContextMenuProxy):
1674         * UIProcess/API/gtk/PageClientImpl.h:
1675         * UIProcess/PageClient.h:
1676         * UIProcess/WebContextMenuListenerProxy.cpp:
1677         (WebKit::WebContextMenuListenerProxy::useContextMenuItems):
1678         * UIProcess/WebContextMenuProxy.cpp:
1679         (WebKit::WebContextMenuProxy::WebContextMenuProxy):
1680         * UIProcess/WebContextMenuProxy.h:
1681         * UIProcess/WebPageProxy.cpp:
1682         (WebKit::WebPageProxy::showContextMenu):
1683         (WebKit::WebPageProxy::internalShowContextMenu): Deleted.
1684         * UIProcess/WebPageProxy.h:
1685         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
1686         (WebKit::WebContextMenuProxyGtk::showContextMenuWithItems):
1687         (WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk):
1688         * UIProcess/gtk/WebContextMenuProxyGtk.h:
1689         (WebKit::WebContextMenuProxyGtk::create):
1690         * UIProcess/ios/PageClientImplIOS.h:
1691         * UIProcess/ios/PageClientImplIOS.mm:
1692         (WebKit::PageClientImpl::createContextMenuProxy): Deleted.
1693         * UIProcess/mac/PageClientImplMac.h:
1694         * UIProcess/mac/PageClientImplMac.mm:
1695         (WebKit::PageClientImpl::createContextMenuProxy):
1696         * UIProcess/mac/WebContextMenuProxyMac.h:
1697         (WebKit::WebContextMenuProxyMac::create):
1698         * UIProcess/mac/WebContextMenuProxyMac.mm:
1699         (WebKit::WebContextMenuProxyMac::WebContextMenuProxyMac):
1700         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
1701         (WebKit::WebContextMenuProxyMac::showContextMenu):
1702
1703 == Rolled over to ChangeLog-2018-01-01 ==