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