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