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