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