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