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