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