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