bdc94e188c528e3ff5543b9436e0bc764e4bdf58
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2017-03-07  Simon Fraser  <simon.fraser@apple.com>
2
3         Have fixedPositionCreatesStackingContext be on by default everywhere
4         https://bugs.webkit.org/show_bug.cgi?id=169334
5
6         Reviewed by Zalan Bujtas.
7
8         It makes no sense to have web-exposed CSS functionality be different based on setting,
9         and other browser are now aligned with having position:fixed create stacking context.
10
11         So remove the fixedPositionCreatesStackingContext setting and have StyleResolver::adjustRenderStyle()
12         always force stacking context for position:fixed.
13
14         * WebProcess/WebPage/WebPage.cpp:
15         (WebKit::WebPage::setUseFixedLayout):
16         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
17         (WebKit::RemoteLayerTreeDrawingArea::updatePreferences):
18         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
19         (WebKit::TiledCoreAnimationDrawingArea::updatePreferences):
20
21 2017-03-07  Brent Fulgham  <bfulgham@apple.com>
22
23         [Mac][WK2] Whitelist iokit-get-properties
24         https://bugs.webkit.org/show_bug.cgi?id=169331
25         <rdar://problem/16363632>
26
27         Reviewed by Alex Christensen.
28
29         Block access to all IOKit properties by default. Turn on only those properties
30         that are actually needed by our engine.
31
32         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
33         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
34         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
35         * WebProcess/com.apple.WebProcess.sb.in:
36
37 2017-03-07  Simon Fraser  <simon.fraser@apple.com>
38
39         Enable SubpixelAntialiasedLayerTextEnabled by default on some versions of macOS
40         https://bugs.webkit.org/show_bug.cgi?id=169329
41
42         Reviewed by Tim Horton.
43
44         If the macOS version is > 101300, enable subpixelAntialiasedLayerTextEnabled.
45
46         * Shared/WebPreferencesDefinitions.h:
47
48 2017-03-07  Dean Jackson  <dino@apple.com>
49
50         Some platforms won't be able to create a GPUDevice
51         https://bugs.webkit.org/show_bug.cgi?id=169314
52         <rdar://problems/30907521>
53
54         Reviewed by Jon Lee.
55
56         Disable WEB_GPU on the iOS Simulator.
57
58         * Configurations/FeatureDefines.xcconfig:
59
60 2017-03-07  Brent Fulgham  <bfulgham@apple.com>
61
62         [Mac][iOS][WK2] Whitelist sysctl-read
63         https://bugs.webkit.org/show_bug.cgi?id=169306
64         <rdar://problem/16371458>
65
66         Reviewed by Alex Christensen.
67
68         Limit access to the 'sysctl' call to read-only cases of the very small
69         set of operations we actually use.
70
71         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
72         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
73         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
74         * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb:
75         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
76         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
77         * WebProcess/com.apple.WebProcess.sb.in:
78
79 2017-03-07  Alex Christensen  <achristensen@webkit.org>
80
81         [Content Extensions] Rename "Domain" to "Condition" where appropriate
82         https://bugs.webkit.org/show_bug.cgi?id=169297
83
84         Reviewed by Brady Eidson.
85
86         * Shared/WebCompiledContentExtension.cpp:
87         (WebKit::WebCompiledContentExtension::filtersWithoutConditionsBytecode):
88         (WebKit::WebCompiledContentExtension::filtersWithoutConditionsBytecodeLength):
89         (WebKit::WebCompiledContentExtension::filtersWithConditionsBytecode):
90         (WebKit::WebCompiledContentExtension::filtersWithConditionsBytecodeLength):
91         (WebKit::WebCompiledContentExtension::conditionedFiltersBytecode):
92         (WebKit::WebCompiledContentExtension::conditionedFiltersBytecodeLength):
93         (WebKit::WebCompiledContentExtension::filtersWithoutDomainsBytecode): Deleted.
94         (WebKit::WebCompiledContentExtension::filtersWithoutDomainsBytecodeLength): Deleted.
95         (WebKit::WebCompiledContentExtension::filtersWithDomainsBytecode): Deleted.
96         (WebKit::WebCompiledContentExtension::filtersWithDomainsBytecodeLength): Deleted.
97         (WebKit::WebCompiledContentExtension::domainFiltersBytecode): Deleted.
98         (WebKit::WebCompiledContentExtension::domainFiltersBytecodeLength): Deleted.
99         * Shared/WebCompiledContentExtension.h:
100         * Shared/WebCompiledContentExtensionData.cpp:
101         (WebKit::WebCompiledContentExtensionData::encode):
102         (WebKit::WebCompiledContentExtensionData::decode):
103         * Shared/WebCompiledContentExtensionData.h:
104         (WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData):
105         * UIProcess/API/APIUserContentExtensionStore.cpp:
106         (API::ContentExtensionMetaData::fileSize):
107         (API::encodeContentExtensionMetaData):
108         (API::decodeContentExtensionMetaData):
109         (API::compiledToFile):
110         (API::createExtension):
111         (API::UserContentExtensionStore::lookupContentExtension):
112         (API::UserContentExtensionStore::compileContentExtension):
113         (API::UserContentExtensionStore::removeContentExtension):
114         * UIProcess/API/APIUserContentExtensionStore.h:
115
116 2017-03-07  Brent Fulgham  <bfulgham@apple.com>
117
118         [Mac][WK2] Expand sandbox to support access to audio component registrar
119         https://bugs.webkit.org/show_bug.cgi?id=169283
120         <rdar://problem/30793512>
121
122         Reviewed by Alexey Proskuryakov.
123
124         * WebProcess/com.apple.WebProcess.sb.in:
125
126 2017-03-07  Chris Dumez  <cdumez@apple.com>
127
128         Port DOMTimer from std::chrono::milliseconds to WTF::Seconds type
129         https://bugs.webkit.org/show_bug.cgi?id=169236
130
131         Reviewed by Simon Fraser.
132
133         * UIProcess/WebProcessPool.cpp:
134         (WebKit::WebProcessPool::updateHiddenPageThrottlingAutoIncreaseLimit):
135         * WebProcess/WebPage/WebPage.h:
136         (WebKit::WebPage::setHiddenPageDOMTimerThrottlingIncreaseLimit):
137         * WebProcess/WebProcess.cpp:
138         (WebKit::WebProcess::setHiddenPageDOMTimerThrottlingIncreaseLimit):
139         * WebProcess/WebProcess.h:
140         * WebProcess/WebProcess.messages.in:
141
142 2017-03-06  Aakash Jain  <aakash_jain@apple.com>
143
144         Enable SUPPORTS_TEXT_BASED_API in WebKit2 for iOS
145         https://bugs.webkit.org/show_bug.cgi?id=169233
146
147         Reviewed by Alexey Proskuryakov.
148
149         * Configurations/Base.xcconfig: Enable SUPPORTS_TEXT_BASED_API.
150         * Configurations/WebKit.xcconfig: Pass information to TAPI about reexporting WebKitLegacy and few extra headers.
151         * WebKit2.xcodeproj/project.pbxproj: Run scripts which are run for installhdrs phase for installapi phase as well.
152
153 2017-03-06  Dan Bernstein  <mitz@apple.com>
154
155         [Cocoa] Expose API::InjectedBundle::EditorClient::didChange via the Objective-C bundle SPI
156         https://bugs.webkit.org/show_bug.cgi?id=169223
157
158         Reviewed by Tim Horton.
159
160         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h: Declared new
161           delegate method -_webProcessPlugInBrowserContextControllerDidChangeByEditing:.
162         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
163         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): Added an override
164           of API::InjectedBundle::EditorClient::didChange that calls the new delegate method.
165
166 2017-03-06  Michael Saboff  <msaboff@apple.com>
167
168         Unreviewed build fix after r213492.
169
170         * Configurations/Base.xcconfig:
171
172 2017-03-06  Aakash Jain  <aakash_jain@apple.com>
173
174         Add WK_CLASS_AVAILABLE to _WKLinkIconParameters and _WKWebViewPrintFormatter
175         https://bugs.webkit.org/show_bug.cgi?id=169225
176
177         Reviewed by Tim Horton.
178
179         * UIProcess/API/Cocoa/_WKLinkIconParameters.h:
180         * UIProcess/_WKWebViewPrintFormatter.h:
181
182 2017-03-06  Michael Saboff  <msaboff@apple.com>
183
184         Unreviewed build fix after r213483.
185
186         * Configurations/Base.xcconfig:
187
188 2017-03-06  Brent Fulgham  <bfulgham@apple.com>
189
190         [Mac][WK2] Support new CoreMedia routing features
191         https://bugs.webkit.org/show_bug.cgi?id=169241
192         <rdar://problem/30077969>
193
194         Reviewed by Alexey Proskuryakov.
195
196         * WebProcess/com.apple.WebProcess.sb.in:
197
198 2017-03-06  Michael Saboff  <msaboff@apple.com>
199
200         Take advantage of fast permissions switching of JIT memory for devices that support it
201         https://bugs.webkit.org/show_bug.cgi?id=169155
202
203         Reviewed by Saam Barati.
204
205         Updated the Xcode config files to match what is in the JavaScriptCore ones.
206
207         * Configurations/FeatureDefines.xcconfig:
208
209 2017-03-06  Aakash Jain  <aakash_jain@apple.com>
210
211         Make WKMenuItemIdentifiersPrivate.h private header
212         https://bugs.webkit.org/show_bug.cgi?id=168981
213
214         Reviewed by Tim Horton.
215
216         * WebKit2.xcodeproj/project.pbxproj: Made WKMenuItemIdentifiersPrivate.h private.
217
218 2017-03-06  Alexey Proskuryakov  <ap@apple.com>
219
220         Replace -sub_umbrella linker flag with a build setting
221         https://bugs.webkit.org/show_bug.cgi?id=169146
222
223         Reviewed by Tim Horton.
224
225         * Configurations/WebKit.xcconfig:
226
227 2017-03-03  Matt Rajca  <mrajca@apple.com>
228
229         Media: notify clients when the user never plays a media element that was prevented from auto-playing
230         https://bugs.webkit.org/show_bug.cgi?id=169150
231
232         Reviewed by Alex Christensen.
233
234         * UIProcess/API/C/WKPageUIClient.h:
235
236 2017-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
237
238         Expand font-weight and font-stretch to take any number
239         https://bugs.webkit.org/show_bug.cgi?id=168889
240
241         Reviewed by Simon Fraser.
242
243         Migrate off old enum types.
244
245         * WebProcess/WebPage/WebPage.cpp:
246         (WebKit::WebPage::editorState):
247
248 2017-03-06  Andreas Kling  <akling@apple.com>
249
250         [iOS] Report domains crashing under memory pressure via enhanced privacy logging.
251         <https://webkit.org/b/169133>
252         <rdar://problem/29964017>
253
254         Reviewed by Antti Koivisto.
255
256         Notify the UI process when the memory pressure status changes.
257         If a web process crashes while under memory pressure, log the domain of the last open page
258         using enhanced privacy logging.
259
260         * UIProcess/WebPageProxy.cpp:
261         (WebKit::WebPageProxy::processDidCrash):
262         * UIProcess/WebProcessProxy.h:
263         (WebKit::WebProcessProxy::memoryPressureStatusChanged):
264         (WebKit::WebProcessProxy::isUnderMemoryPressure):
265         * UIProcess/WebProcessProxy.messages.in:
266         * WebProcess/WebProcess.cpp:
267         (WebKit::WebProcess::initializeWebProcess):
268
269 2017-03-05  Brady Eidson  <beidson@apple.com>
270
271         Remove new files accidentally added in r213441
272
273         Unreviewed.
274
275         * UIProcess/WebLoadingProviderProxy.cpp: Removed.
276         * UIProcess/WebLoadingProviderProxy.h: Removed.
277         * UIProcess/WebLoadingProviderProxy.messages.in: Removed.
278
279 2017-03-05  Brady Eidson  <beidson@apple.com>
280
281         Rename CustomProtocolFoo to LegacyCustomProtocolFoo.
282         https://bugs.webkit.org/show_bug.cgi?id=169188
283
284         Reviewed by Andy Estes.
285
286         * CMakeLists.txt:
287         * DerivedSources.make:
288
289         * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm: Renamed from Source/WebKit2/NetworkProcess/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm.
290         (+[WKCustomProtocol canInitWithRequest:]):
291         (+[WKCustomProtocol canonicalRequestForRequest:]):
292         (+[WKCustomProtocol requestIsCacheEquivalent:toRequest:]):
293         (-[WKCustomProtocol initWithRequest:cachedResponse:client:]):
294         (-[WKCustomProtocol initializationRunLoop]):
295         (-[WKCustomProtocol startLoading]):
296         (-[WKCustomProtocol stopLoading]):
297         (WebKit::LegacyCustomProtocolManager::registerProtocolClass):
298         (WebKit::LegacyCustomProtocolManager::registerScheme):
299         (WebKit::LegacyCustomProtocolManager::unregisterScheme):
300         (WebKit::LegacyCustomProtocolManager::supportsScheme):
301         (WebKit::dispatchOnInitializationRunLoop):
302         (WebKit::LegacyCustomProtocolManager::didFailWithError):
303         (WebKit::LegacyCustomProtocolManager::didLoadData):
304         (WebKit::LegacyCustomProtocolManager::didReceiveResponse):
305         (WebKit::LegacyCustomProtocolManager::didFinishLoading):
306         (WebKit::LegacyCustomProtocolManager::wasRedirectedToRequest):
307         (WebKit::LegacyCustomProtocolManager::protocolForID):
308
309         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.cpp: Renamed from Source/WebKit2/NetworkProcess/CustomProtocols/CustomProtocolManager.cpp.
310         (WebKit::generateCustomProtocolID):
311         (WebKit::LegacyCustomProtocolManager::supplementName):
312         (WebKit::LegacyCustomProtocolManager::LegacyCustomProtocolManager):
313         (WebKit::LegacyCustomProtocolManager::initialize):
314         (WebKit::LegacyCustomProtocolManager::addCustomProtocol):
315         (WebKit::LegacyCustomProtocolManager::removeCustomProtocol):
316         (WebKit::LegacyCustomProtocolManager::startLoading):
317         (WebKit::LegacyCustomProtocolManager::stopLoading):
318         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h: Renamed from Source/WebKit2/NetworkProcess/CustomProtocols/CustomProtocolManager.h.
319         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.messages.in: Renamed from Source/WebKit2/NetworkProcess/CustomProtocols/CustomProtocolManager.messages.in.
320
321         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp: Renamed from Source/WebKit2/NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp.
322         (WebKit::CustomProtocolManager::WebSoupRequestAsyncData::WebSoupRequestAsyncData):
323         (WebKit::CustomProtocolManager::WebSoupRequestAsyncData::~WebSoupRequestAsyncData):
324         (WebKit::CustomProtocolManager::registerProtocolClass):
325         (WebKit::CustomProtocolManager::registerScheme):
326         (WebKit::CustomProtocolManager::unregisterScheme):
327         (WebKit::CustomProtocolManager::supportsScheme):
328         (WebKit::CustomProtocolManager::didFailWithError):
329         (WebKit::CustomProtocolManager::didLoadData):
330         (WebKit::CustomProtocolManager::didReceiveResponse):
331         (WebKit::CustomProtocolManager::didFinishLoading):
332         (WebKit::CustomProtocolManager::wasRedirectedToRequest):
333
334         * NetworkProcess/NetworkProcess.cpp:
335         (WebKit::NetworkProcess::NetworkProcess):
336
337         * NetworkProcess/NetworkSession.cpp:
338         (WebKit::NetworkSession::create):
339         * NetworkProcess/NetworkSession.h:
340
341         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
342         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
343         (WebKit::globalLegacyCustomProtocolManager):
344         (WebKit::NetworkSessionCocoa::setLegacyCustomProtocolManager):
345         (WebKit::NetworkSessionCocoa::create):
346         (WebKit::NetworkSessionCocoa::defaultSession):
347         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
348         (WebKit::globalCustomProtocolManager): Deleted.
349         (WebKit::NetworkSessionCocoa::setCustomProtocolManager): Deleted.
350
351         * NetworkProcess/mac/RemoteNetworkingContext.mm:
352         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
353
354         * UIProcess/API/APICustomProtocolManagerClient.h:
355         (API::LegacyCustomProtocolManagerClient::~LegacyCustomProtocolManagerClient):
356         (API::LegacyCustomProtocolManagerClient::startLoading):
357         (API::LegacyCustomProtocolManagerClient::stopLoading):
358         (API::LegacyCustomProtocolManagerClient::invalidate):
359         (API::CustomProtocolManagerClient::~CustomProtocolManagerClient): Deleted.
360         (API::CustomProtocolManagerClient::startLoading): Deleted.
361         (API::CustomProtocolManagerClient::stopLoading): Deleted.
362         (API::CustomProtocolManagerClient::invalidate): Deleted.
363
364         * UIProcess/Cocoa/LegacyCustomProtocolManagerClient.h: Renamed from Source/WebKit2/UIProcess/Cocoa/CustomProtocolManagerClient.h.
365         * UIProcess/Cocoa/LegacyCustomProtocolManagerClient.mm: Renamed from Source/WebKit2/UIProcess/Cocoa/CustomProtocolManagerClient.mm.
366         (-[WKCustomProtocolLoader initWithLegacyCustomProtocolManagerProxy:customProtocolID:request:]):
367         (-[WKCustomProtocolLoader dealloc]):
368         (-[WKCustomProtocolLoader customProtocolManagerProxyDestroyed]):
369         (-[WKCustomProtocolLoader connection:didFailWithError:]):
370         (-[WKCustomProtocolLoader connection:willCacheResponse:]):
371         (-[WKCustomProtocolLoader connection:didReceiveResponse:]):
372         (-[WKCustomProtocolLoader connection:didReceiveData:]):
373         (-[WKCustomProtocolLoader connection:willSendRequest:redirectResponse:]):
374         (-[WKCustomProtocolLoader connectionDidFinishLoading:]):
375         (WebKit::LegacyCustomProtocolManagerClient::startLoading):
376         (WebKit::LegacyCustomProtocolManagerClient::stopLoading):
377         (WebKit::LegacyCustomProtocolManagerClient::invalidate):
378
379         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
380         (WebKit::WebProcessPool::platformInitialize):
381
382         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.cpp: Removed.
383         * UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.cpp: Added.
384         (WebKit::LegacyCustomProtocolManagerProxy::LegacyCustomProtocolManagerProxy):
385         (WebKit::LegacyCustomProtocolManagerProxy::~LegacyCustomProtocolManagerProxy):
386         (WebKit::LegacyCustomProtocolManagerProxy::startLoading):
387         (WebKit::LegacyCustomProtocolManagerProxy::stopLoading):
388         (WebKit::LegacyCustomProtocolManagerProxy::processDidClose):
389         (WebKit::LegacyCustomProtocolManagerProxy::wasRedirectedToRequest):
390         (WebKit::LegacyCustomProtocolManagerProxy::didReceiveResponse):
391         (WebKit::LegacyCustomProtocolManagerProxy::didLoadData):
392         (WebKit::LegacyCustomProtocolManagerProxy::didFailWithError):
393         (WebKit::LegacyCustomProtocolManagerProxy::didFinishLoading):
394         * UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.h: Renamed from Source/WebKit2/UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h.
395         * UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.messages.in: Renamed from Source/WebKit2/UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.messages.in.
396
397         * UIProcess/Network/NetworkProcessProxy.cpp:
398         * UIProcess/Network/NetworkProcessProxy.h:
399
400         * UIProcess/WebProcessPool.cpp:
401         (WebKit::WebProcessPool::WebProcessPool):
402         (WebKit::WebProcessPool::setLegacyCustomProtocolManagerClient):
403         (WebKit::WebProcessPool::registerSchemeForCustomProtocol):
404         (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol):
405         (WebKit::WebProcessPool::setCustomProtocolManagerClient): Deleted.
406         * UIProcess/WebProcessPool.h:
407
408         * WebKit2.xcodeproj/project.pbxproj:
409
410         * WebProcess/cocoa/WebProcessCocoa.mm:
411
412 2017-03-04  Eric Carlson  <eric.carlson@apple.com>
413
414         [iOS] The web process should inherit application state from UI process
415         https://bugs.webkit.org/show_bug.cgi?id=169156
416         <rdar://problem/30845473>
417
418         Reviewed by Alexey Proskuryakov.
419
420         * Platform/spi/ios/CelestialSPI.h: Added.
421
422         * WebKit2.xcodeproj/project.pbxproj: Include CelestialSPI.h.
423
424         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist: Add entitlement.
425
426         * WebProcess/WebPage/ios/WebPageIOS.mm:
427         (WebKit::WebPage::platformInitialize): Set up PID proxying.
428
429 2017-03-04  Aakash Jain  <aakash_jain@apple.com>
430
431         Add symbols required by TAPI from Shared/API/Cocoa/WebKit.m in a header file
432         https://bugs.webkit.org/show_bug.cgi?id=169162
433
434         Reviewed by Alexey Proskuryakov.
435
436         The symbols from binary and headers should match precisely, otherwise TAPI would
437         complain. There are few symbols which are not actually needed in header file, but
438         we still need to add them in a header file to make TAPI happy.
439
440         * Platform/ExtraPublicSymbolsForTAPI.h: Added.
441         * WebKit2.xcodeproj/project.pbxproj: Added ExtraPublicSymbolsForTAPI.h
442
443 2017-03-04  Aakash Jain  <aakash_jain@apple.com>
444
445         Add symbols required by TAPI in a header file
446         https://bugs.webkit.org/show_bug.cgi?id=169113
447         <rdar://problem/30772033>
448
449         Reviewed by Alexey Proskuryakov.
450
451         The symbols from binary and headers should match precisely, otherwise TAPI would
452         complain. There are few symbols which are not actually needed in header file, but
453         we still need to add them in a header file to make TAPI happy.
454
455         * Platform/ExtraPrivateSymbolsForTAPI.h: Added.
456         * WebKit2.xcodeproj/project.pbxproj: Added Platform/ExtraPrivateSymbolsForTAPI.h
457
458 2017-03-04  Joseph Pecoraro  <pecoraro@apple.com>
459
460         Remove duplicate initialization guard in WebKit2 logging initialization
461         https://bugs.webkit.org/show_bug.cgi?id=169164
462
463         Reviewed by Dan Bernstein.
464
465         * Platform/Logging.cpp:
466         (WebKit::initializeLogChannelsIfNecessary):
467
468 2017-03-03  Youenn Fablet  <youenn@apple.com>
469
470         [WebRTC] Update libwebrtc source code
471         https://bugs.webkit.org/show_bug.cgi?id=168599
472
473         Reviewed by Alex Christensen.
474
475         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
476
477 2017-03-03  Dean Jackson  <dino@apple.com>
478
479         Add WebGPU compile flag and experimental feature flag
480         https://bugs.webkit.org/show_bug.cgi?id=169161
481         <rdar://problem/30846689>
482
483         Reviewed by Tim Horton.
484
485         Add ENABLE_WEBGPU, an experimental feature flag, a RuntimeEnabledFeature,
486         and an InternalSetting.
487
488         * Configurations/FeatureDefines.xcconfig:
489         * Shared/WebPreferencesDefinitions.h:
490         * WebProcess/InjectedBundle/InjectedBundle.cpp:
491         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
492         * WebProcess/WebPage/WebPage.cpp:
493         (WebKit::WebPage::updatePreferences):
494
495 2017-03-03  Dean Jackson  <dino@apple.com>
496
497         Move Input Events and Gamepad from experimental features into main preferences
498         https://bugs.webkit.org/show_bug.cgi?id=169157
499         <rdar://problems/30845587>
500
501         Reviewed by Myles C. Maxfield.
502
503         These are no longer experimental on trunk.
504
505         * Shared/WebPreferencesDefinitions.h:
506
507 2017-03-03  Brent Fulgham  <bfulgham@apple.com>
508
509         [MediaStream iOS] REGRESSION(r212883): Missing function definition breaks sandbox
510         https://bugs.webkit.org/show_bug.cgi?id=169148
511         <rdar://problem/30825728>
512
513         Reviewed by Alex Christensen.
514
515         The changes in r212883 added a call to 'shared-preferences-read', which is not defined
516         for iOS. In fact, it's not needed since 'user-preference-read' does everything we need on iOS.
517         Switch to the correct preference rule.
518
519         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Add missing function
520
521 2017-03-03  Aakash Jain  <aakash_jain@apple.com>
522
523         Move declaration of _WKSetCrashReportApplicationSpecificInformation to header file
524         https://bugs.webkit.org/show_bug.cgi?id=169043
525
526         Reviewed by Alex Christensen.
527
528         * WebKit2.xcodeproj/project.pbxproj: Added WebProcessCocoa.h
529         * WebProcess/cocoa/WebProcessCocoa.h: Added.
530         * WebProcess/cocoa/WebProcessCocoa.mm: Imported WebProcessCocoa.h
531         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm: Ditto.
532
533 2017-03-03  Carlos Garcia Campos  <cgarcia@igalia.com>
534
535         [GTK] Ensure WebKitWebView always have a user content manager
536         https://bugs.webkit.org/show_bug.cgi?id=169130
537
538         Reviewed by Michael Catanzaro.
539
540         User content manager is a construct only property, so if not set by the user the web view doesn't have any. We
541         can create a default one, like we do for settings, when user didn't provide one.
542
543         * UIProcess/API/gtk/WebKitWebView.cpp:
544         (webkitWebViewConstructed):
545
546 2017-03-02  Sam Weinig  <sam@webkit.org>
547
548         Rename htmlediting.h/cpp to Editing.h/cpp
549         https://bugs.webkit.org/show_bug.cgi?id=169103
550
551         Reviewed by Alex Christensen.
552
553         * WebProcess/WebPage/WebPage.cpp:
554         * WebProcess/WebPage/ios/WebPageIOS.mm:
555         * WebProcess/WebPage/mac/WebPageMac.mm:
556
557 2017-03-02  Joseph Pecoraro  <pecoraro@apple.com>
558
559         [Mac] Set the NSURLSessionTask priority to match the request's priority
560         https://bugs.webkit.org/show_bug.cgi?id=169115
561         <rdar://problem/28881392>
562
563         Reviewed by Alex Christensen.
564
565         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
566         (WebKit::toNSURLSessionTaskPriority):
567         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
568         Set the priority on the task based on the ResourceRequest's priority.
569         This is used for HTTP/2 request prioritization.
570
571 2017-03-02  Mark Lam  <mark.lam@apple.com>
572
573         Add WebKit2 hooks to notify the VM that the user has requested a debugger break.
574         https://bugs.webkit.org/show_bug.cgi?id=169089
575
576         Reviewed by Tim Horton and Joseph Pecoraro.
577
578         * CMakeLists.txt:
579         * DerivedSources.make:
580         * UIProcess/WebInspectorProxy.cpp:
581         (WebKit::WebInspectorProxy::connect):
582         * WebKit2.xcodeproj/project.pbxproj:
583         * WebProcess/WebPage/WebInspectorInterruptDispatcher.cpp: Added.
584         (WebKit::WebInspectorInterruptDispatcher::create):
585         (WebKit::WebInspectorInterruptDispatcher::WebInspectorInterruptDispatcher):
586         (WebKit::WebInspectorInterruptDispatcher::~WebInspectorInterruptDispatcher):
587         (WebKit::WebInspectorInterruptDispatcher::initializeConnection):
588         (WebKit::WebInspectorInterruptDispatcher::notifyNeedDebuggerBreak):
589         * WebProcess/WebPage/WebInspectorInterruptDispatcher.h: Added.
590         * WebProcess/WebPage/WebInspectorInterruptDispatcher.messages.in: Added.
591         * WebProcess/WebProcess.cpp:
592         (WebKit::WebProcess::WebProcess):
593         (WebKit::WebProcess::initializeConnection):
594         * WebProcess/WebProcess.h:
595
596 2017-03-02  Brady Eidson  <beidson@apple.com>
597
598         Update WKWebsiteDatastoreConfiguration SPI.
599         https://bugs.webkit.org/show_bug.cgi?id=169102
600
601         Reviewed by Tim Horton.
602         
603         Make these strings URLs, and throw exceptions if you try to use non-file URLs.
604
605         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
606         (-[WKWebsiteDataStore _initWithConfiguration:]):
607
608         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
609         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
610         (checkURLArgument):
611         (-[_WKWebsiteDataStoreConfiguration _webStorageDirectory]):
612         (-[_WKWebsiteDataStoreConfiguration _setWebStorageDirectory:]):
613         (-[_WKWebsiteDataStoreConfiguration _indexedDBDatabaseDirectory]):
614         (-[_WKWebsiteDataStoreConfiguration _setIndexedDBDatabaseDirectory:]):
615         (-[_WKWebsiteDataStoreConfiguration _webSQLDatabaseDirectory]):
616         (-[_WKWebsiteDataStoreConfiguration _setWebSQLDatabaseDirectory:]):
617
618 2017-03-02  Youenn Fablet  <youenn@apple.com>
619
620         Move part of NetworkRTCProvider::close implementation in NetworkRTCProvider destructor
621         https://bugs.webkit.org/show_bug.cgi?id=169104
622
623         Reviewed by Alex Christensen.
624
625         Improving NetworkRTCProvider clean-up by moving some member field cleaning to the destructor.
626         The remaining cleaning is still kept in NetworkRTCProvider::close as we need to go to the rtc network thread and
627         for that, we take a ref of NetworkRTCProvider.
628         Stopping any resolver before freeing them.
629
630         * NetworkProcess/webrtc/NetworkRTCMonitor.h:
631         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
632         (WebKit::NetworkRTCProvider::~NetworkRTCProvider):
633         (WebKit::NetworkRTCProvider::close):
634         * NetworkProcess/webrtc/NetworkRTCProvider.h:
635
636 2017-03-02  Youenn Fablet  <youenn@apple.com>
637
638         [iOS] Replicate NetworkProcess Mac sandboxing in iOS to allow TCP/UDP
639         https://bugs.webkit.org/show_bug.cgi?id=169105
640
641         Reviewed by Alex Christensen.
642
643         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Adding sandbox extension support for TCP/UDP networking.
644
645 2017-03-02  Aakash Jain  <aakash_jain@apple.com>
646
647         Move stringMatchesWildcardString from WebKit2 to WebCore
648         https://bugs.webkit.org/show_bug.cgi?id=169065
649
650         Reviewed by Alexey Proskuryakov.
651
652         * Platform/mac/StringUtilities.h: Moved stringMatchesWildcardString to WebCore.
653         * WebKit2.xcodeproj/project.pbxproj: Make StringUtilities.h a project header.
654         * Platform/mac/StringUtilities.mm:
655         (WebKit::wildcardRegexPatternString): Moved to WebCore.
656         (WebKit::stringMatchesWildcardString): Ditto.
657         * WebProcess/Plugins/WebPluginInfoProvider.cpp: Using stringMatchesWildcardString from WebCore.
658
659 2017-03-02  Aakash Jain  <aakash_jain@apple.com>
660
661         IsSmartPtr<WKRetainPtr<T>>::value should not be exported
662         https://bugs.webkit.org/show_bug.cgi?id=169047
663
664         Reviewed by Alexey Proskuryakov.
665
666         * UIProcess/API/cpp/WKRetainPtr.h:
667
668 2017-03-02  Youenn Fablet  <youenn@apple.com>
669
670         Activate some new webrtc tests
671         https://bugs.webkit.org/show_bug.cgi?id=168850
672
673         Reviewed by Alex Christensen.
674
675         * Shared/WebPreferencesDefinitions.h: Activating peer connection by default when libwebrtc is on.
676         This allows ensuring the network process will have its sandbox extension.
677
678 2017-03-02  Brian Burg  <bburg@apple.com>
679
680         Web Automation: _WKAutomationSessionDelegate should work with WKWebViews
681         https://bugs.webkit.org/show_bug.cgi?id=169091
682         <rdar://problem/30810538>
683
684         Reviewed by Tim Horton.
685
686         As a first step towards fixing the mistake of using WKPageRef in an Objective-C SPI,
687         add the correct delegate methods that take WKWebView so that Objective-C clients can
688         use this functionality.
689
690         In a future patch, we'll remove the WKPageRef delegate methods when they are no longer
691         being used by clients. Clients should switch to using WKWebView, or wait for a C SPI
692         with equivalent functionality (something like WKAutomationSessionClient) to be ported.
693
694         While I'm fixing this mess, make API::AutomationSessionClient use references instead
695         of pointers. We null-check all WebPageProxy parameters before calling its methods.
696
697         * UIProcess/API/APIAutomationSessionClient.h:
698         (API::AutomationSessionClient::didDisconnectFromRemote):
699         (API::AutomationSessionClient::didRequestNewWindow):
700         (API::AutomationSessionClient::isShowingJavaScriptDialogOnPage):
701         (API::AutomationSessionClient::dismissCurrentJavaScriptDialogOnPage):
702         (API::AutomationSessionClient::acceptCurrentJavaScriptDialogOnPage):
703         (API::AutomationSessionClient::messageOfCurrentJavaScriptDialogOnPage):
704         (API::AutomationSessionClient::setUserInputForCurrentJavaScriptPromptOnPage):
705         Change pointer to reference.
706
707         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
708         Add duplicate delegate methods that take/return WKWebView instead of WKPageRef.
709         Adjust the delegate method names to reflect parameter type and avoid conflicts with the
710         WKPageRef-using methods that we need to remove eventually.
711
712         * UIProcess/Automation/WebAutomationSession.cpp:
713         (WebKit::WebAutomationSession::terminate):
714         (WebKit::WebAutomationSession::createBrowsingContext):
715         (WebKit::WebAutomationSession::isShowingJavaScriptDialog):
716         (WebKit::WebAutomationSession::dismissCurrentJavaScriptDialog):
717         (WebKit::WebAutomationSession::acceptCurrentJavaScriptDialog):
718         (WebKit::WebAutomationSession::messageOfCurrentJavaScriptDialog):
719         (WebKit::WebAutomationSession::setUserInputForCurrentJavaScriptPrompt):
720         Dereference `this` and `webPageProxy` when calling API::AutomationSessionClient methods.
721
722         * UIProcess/Cocoa/AutomationSessionClient.h:
723         * UIProcess/Cocoa/AutomationSessionClient.mm:
724         (WebKit::AutomationSessionClient::AutomationSessionClient):
725         (WebKit::AutomationSessionClient::didDisconnectFromRemote):
726         (WebKit::AutomationSessionClient::didRequestNewWindow):
727         (WebKit::AutomationSessionClient::isShowingJavaScriptDialogOnPage):
728         (WebKit::AutomationSessionClient::dismissCurrentJavaScriptDialogOnPage):
729         (WebKit::AutomationSessionClient::acceptCurrentJavaScriptDialogOnPage):
730         (WebKit::AutomationSessionClient::messageOfCurrentJavaScriptDialogOnPage):
731         (WebKit::AutomationSessionClient::setUserInputForCurrentJavaScriptPromptOnPage):
732         Now there are two possible delegate methods for most of these, so try to use the
733         WKWebView-based delegate method first and fall back to the WKPageRef delegate method.
734
735 2017-03-02  Alex Christensen  <achristensen@webkit.org>
736
737         Continue enabling WebRTC
738         https://bugs.webkit.org/show_bug.cgi?id=169056
739
740         Reviewed by Jon Lee.
741
742         * Configurations/FeatureDefines.xcconfig:
743
744 2017-03-01  Megan Gardner  <megan_gardner@apple.com>
745
746         Data interaction support for WK1
747         https://bugs.webkit.org/show_bug.cgi?id=169062
748
749         Reviewed by Wenson Hsieh.
750
751         Allow for separate additions files in WK1 and WK2
752
753         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
754
755 2017-03-02  Youenn Fablet  <youenn@apple.com>
756
757         [WebRTC] Activate ICE candidate privacy policy
758         https://bugs.webkit.org/show_bug.cgi?id=168975
759
760         Reviewed by Alex Christensen.
761
762         Disabling network enumeration by default.
763         Enabling ICE candidate filtering by default.
764         Chaning ICE candidate filtering according userMediaAccess policy:
765         - If access is denied, filtering is on.
766         - If access is granted, filtering is off.
767
768         * Shared/WebPageCreationParameters.cpp:
769         (WebKit::WebPageCreationParameters::encode):
770         (WebKit::WebPageCreationParameters::decode):
771         * Shared/WebPageCreationParameters.h:
772         * Shared/WebPreferencesDefinitions.h:
773         * UIProcess/API/C/WKPreferences.cpp:
774         (WKPreferencesSetICECandidateFilteringEnabled):
775         (WKPreferencesGetICECandidateFilteringEnabled):
776         (WKPreferencesSetEnumeratingAllNetworkInterfacesEnabled):
777         (WKPreferencesGetEnumeratingAllNetworkInterfacesEnabled):
778         * UIProcess/API/C/WKPreferencesRefPrivate.h:
779         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
780         (WebKit::toWebCore):
781         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
782         * UIProcess/UserMediaProcessManager.cpp:
783         (WebKit::UserMediaProcessManager::willCreateMediaStream):
784         (WebKit::UserMediaProcessManager::endedCaptureSession):
785         * UIProcess/WebPageProxy.cpp:
786         (WebKit::WebPageProxy::creationParameters):
787         * WebProcess/WebPage/WebPage.cpp:
788
789 2017-03-02  Tomas Popela  <tpopela@redhat.com>
790
791         [WK2] Keyboard menu key should show context menu
792         https://bugs.webkit.org/show_bug.cgi?id=72099
793
794         Reviewed by Carlos Garcia Campos.
795
796         Show the context menu when the GtkWidget::popup-menu signal is
797         emitted. This signal is triggered by pressing a key (usually
798         the Menu key or the Shift + F10 shortcut) or it could be emitted on
799         WebKitWebView.
800
801         * UIProcess/API/gtk/WebKitWebView.cpp:
802         (webkit_web_view_class_init):
803         (webkit_web_view_class_init): Update the documentation for the
804         context-menu signal
805         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
806         (webkitWebViewBasePopupMenu): Connect to the popup-menu signal and
807         save the event that was used to trigger the signal. If there is no
808         such event create a new GdkEvent with GDK_NOTHING type.
809         (webkitWebViewBasePopupMenu):
810         (webkit_web_view_base_class_init):
811         * UIProcess/WebPageProxy.cpp:
812         (WebKit::WebPageProxy::handleContextMenuKeyEvent):
813         * UIProcess/WebPageProxy.h:
814         * WebProcess/WebPage/WebPage.cpp:
815         (WebKit::WebPage::contextMenuForKeyEvent):
816         * WebProcess/WebPage/WebPage.h:
817         * WebProcess/WebPage/WebPage.messages.in:
818
819 2017-03-01  Wenson Hsieh  <wenson_hsieh@apple.com>
820
821         Replace -[WKWebView adjustedDataInteractionItemProviders:] with a UI delegate method
822         https://bugs.webkit.org/show_bug.cgi?id=169013
823
824         Reviewed by Dan Bernstein.
825
826         Rather than introduce new SPI on WKWebView directly, we should follow convention and add the hook to the private
827         version of the UI delegate.
828
829         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
830         * UIProcess/API/Cocoa/WKWebView.mm:
831         (-[WKWebView _adjustedDataInteractionItemProviders:]): Deleted.
832         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
833
834 2017-03-01  Alex Christensen  <achristensen@webkit.org>
835
836         Unreviewed, rolling out r213259.
837
838         Broke an internal build
839
840         Reverted changeset:
841
842         "Continue enabling WebRTC"
843         https://bugs.webkit.org/show_bug.cgi?id=169056
844         http://trac.webkit.org/changeset/213259
845
846 2017-03-01  Alex Christensen  <achristensen@webkit.org>
847
848         Continue enabling WebRTC
849         https://bugs.webkit.org/show_bug.cgi?id=169056
850
851         Reviewed by Jon Lee.
852
853         * Configurations/FeatureDefines.xcconfig:
854
855 2017-03-01  Chris Dumez  <cdumez@apple.com>
856
857         [WK2][!NETWORK_SESSION] Failure to download when using a download attribute with no value on an anchor
858         https://bugs.webkit.org/show_bug.cgi?id=169060
859         <rdar://problem/30773140>
860
861         Reviewed by Darin Adler.
862
863         In the !NETWORK_SESSION code path, we were failing to use the suggested filename coming from the
864         network layer in the case where the download attribute is present but has no value. We were ending
865         up passing an empty string as suggested filename to Safari which is not handled properly.
866
867         * UIProcess/Downloads/DownloadProxy.cpp:
868         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
869
870 2017-02-28  Matt Rajca  <mrajca@apple.com>
871
872         Media: notify clients when autoplayed media is muted
873         https://bugs.webkit.org/show_bug.cgi?id=168987
874
875         Reviewed by Alex Christensen.
876
877         * UIProcess/API/C/WKPageUIClient.h:
878
879 2017-03-01  Brady Eidson  <beidson@apple.com>
880
881         Add SPI to create WebsiteDataStore objects pointing to custom paths.
882         https://bugs.webkit.org/show_bug.cgi?id=169044
883
884         Reviewed by Tim Horton.
885
886         * UIProcess/API/APIWebsiteDataStore.h:
887
888         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
889         (-[WKWebsiteDataStore _initWithConfiguration:]):
890
891         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
892
893         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h.
894         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h.
895
896         * UIProcess/WebsiteData/WebsiteDataStore.h:
897
898         * WebKit2.xcodeproj/project.pbxproj:
899
900 2017-03-01  Jon Lee  <jonlee@apple.com>
901
902         Update peer connection preference
903         https://bugs.webkit.org/show_bug.cgi?id=169016
904         rdar://problem/30773889
905
906         Reviewed by Eric Carlson.
907
908         * Shared/WebPreferencesDefinitions.h:
909         * UIProcess/WebPreferences.cpp:
910         (WebKit::WebPreferences::setEnabledForFeature):
911         (WebKit::WebPreferences::setPeerConnectionAndMediaStreamEnabled): Deleted.
912         * UIProcess/WebPreferences.h:
913
914 2017-03-01  Tomas Popela  <tpopela@redhat.com>
915
916         [GTK] Fix problems found by Coverity scan in WebPrintOperationGtk.cpp
917         https://bugs.webkit.org/show_bug.cgi?id=169027
918
919         Reviewed by Carlos Garcia Campos.
920
921         Initialize the lastPagePosition variable and remove an unused one
922         - totalToPrint.
923
924         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
925         (WebKit::PrintPagesData::PrintPagesData):
926
927 2017-03-01  Andreas Kling  <akling@apple.com>
928
929         Move MemoryPressureHandler to WTF
930         <https://webkit.org/b/168908>
931
932         Reviewed by Sam Weinig.
933
934         * NetworkProcess/NetworkProcess.h:
935         * NetworkProcess/mac/NetworkProcessMac.mm:
936         * PluginProcess/PluginProcess.cpp:
937         * Shared/linux/WebMemorySamplerLinux.cpp:
938         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
939         * WebProcess/WebPage/ios/WebPageIOS.mm:
940
941 2017-03-01  Joseph Pecoraro  <pecoraro@apple.com>
942
943         [WebRTC] Install libwebrtc.dylib inside of WebCore.framework
944         https://bugs.webkit.org/show_bug.cgi?id=168859
945
946         Reviewed by Dan Bernstein.
947
948         * Configurations/BaseTarget.xcconfig:
949         * Configurations/WebKit.xcconfig:
950         Set library search path to find the libwebrtc.dylib inside of WebCore's Frameworks
951         or in the WK_OVERRIDE_FRAMEWORKS_DIR.
952
953 2017-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
954
955         NetworkProcess aborts in WebKit::NetworkLoad::didCompleteWithError at Source/WebKit2/NetworkProcess/NetworkLoad.cpp:423
956         https://bugs.webkit.org/show_bug.cgi?id=168963
957
958         Reviewed by Antti Koivisto.
959
960         This is trying to call SpeculativeLoad::didFailLoading() after SpeculativeLoad has already been
961         completed. SpeculativeLoad::didComplete() call its completion handler that removes the load from
962         m_pendingPreloads. When the completion handler returns the SpeculativeLoad is deleted. So, we should always
963         ensure that SpeculativeLoad is not used after didComplete() call. In SpeculativeLoad::willSendRedirectedRequest(),
964         the call to NetworkLoad::continueWillSendRequest() causes SpeculativeLoad::didFailLoading() to be called. We
965         don't really need to call continueWillSendRequest() though, since the network load is going to be deleted anyway
966         by didComplete(), and the willSendRequest completion handler does nothing when the request is null.
967
968         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
969         (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
970
971 2017-02-28  Alexey Proskuryakov  <ap@apple.com>
972
973         https://bugs.webkit.org/show_bug.cgi?id=168899
974         Re-add deprecated functions to WKPageGroup.h
975
976         Reviewed by Tim Horton.
977
978         * Shared/API/c/WKDeprecatedFunctions.cpp:
979         (WKPageGroupRemoveUserContentFilter):
980         (WKPageGroupRemoveAllUserContentFilters): Deleted. Unlike the other three, this
981         function isn't used by any clients.
982         * UIProcess/API/C/WKPageGroup.h:
983
984 2017-02-28  Alexey Proskuryakov  <ap@apple.com>
985
986         Expose _WKVisitedLinkProvider in a header
987         https://bugs.webkit.org/show_bug.cgi?id=168955
988
989         Reviewed by Tim Horton.
990
991         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm:
992         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
993         The class needs to be visible in a header, as it is exported SPI.
994
995 2017-02-28  Brady Eidson  <beidson@apple.com>
996
997         Move resolving symlinks of some WebsiteDataStore paths from WebProcessPool to... WebsiteDataStore!.
998         https://bugs.webkit.org/show_bug.cgi?id=168696.
999
1000         Reviewed by Alex Christensen.
1001
1002         * UIProcess/WebProcessPool.cpp:
1003         (WebKit::WebProcessPool::createNewWebProcess):
1004
1005         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1006         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
1007         * UIProcess/WebsiteData/WebsiteDataStore.h:
1008         (WebKit::WebsiteDataStore::resolvedApplicationCacheDirectory):
1009         (WebKit::WebsiteDataStore::resolvedMediaCacheDirectory):
1010         (WebKit::WebsiteDataStore::resolvedMediaKeysDirectory):
1011         (WebKit::WebsiteDataStore::resolvedDatabaseDirectory):
1012
1013 2017-02-28  Alex Christensen  <achristensen@webkit.org>
1014
1015         LibWebRTCProvider should check existence of libwebrtc.dylib
1016         https://bugs.webkit.org/show_bug.cgi?id=168986
1017
1018         Reviewed by Youenn Fablet.
1019
1020         * Shared/WebPreferencesDefinitions.h:
1021         * Shared/WebPreferencesStore.cpp:
1022         * UIProcess/WebPreferences.cpp:
1023         (WebKit::checkWebRTCAvailability): Deleted.
1024
1025 2017-02-28  Wenson Hsieh  <wenson_hsieh@apple.com>
1026
1027         Unreviewed, build fix after r213176.
1028
1029         * Platform/spi/ios/UIKitSPI.h:
1030
1031 2017-02-28  Tim Horton  <timothy_horton@apple.com>
1032
1033         [iOS] Getting QLPreviewProtocol slows down first navigation in Web process
1034         https://bugs.webkit.org/show_bug.cgi?id=168940
1035         <rdar://problem/29468999>
1036
1037         Reviewed by Simon Fraser.
1038
1039         * WebProcess/Network/WebLoaderStrategy.cpp:
1040         (WebKit::WebLoaderStrategy::scheduleLoad):
1041         Make use of isQuickLookPreviewURL.
1042
1043 2017-02-28  Brady Eidson  <beidson@apple.com>
1044
1045         Fix API test regression(s):
1046         REGRESSION (r213168): API test WKUserContentController.ScriptMessageHandlerMultipleHandlerRemoval crashing
1047         https://bugs.webkit.org/show_bug.cgi?id=168991
1048
1049         Unreviewed.
1050
1051         * UIProcess/WebProcessPool.cpp:
1052         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
1053
1054 2017-02-28  Wenson Hsieh  <wenson_hsieh@apple.com>
1055
1056         Data interaction should support attachment elements
1057         https://bugs.webkit.org/show_bug.cgi?id=168916
1058         <rdar://problem/30664519>
1059
1060         Reviewed by Ryosuke Niwa.
1061
1062         Teaches WKContentView to recognize attachment elements as data interactive content, and add an internal hook to
1063         adjust the list of item providers before initiating data interaction.
1064
1065         * Platform/spi/ios/UIKitSPI.h:
1066         * UIProcess/API/Cocoa/WKWebView.mm:
1067         (-[WKWebView _adjustedDataInteractionItemProviders:]):
1068         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1069         * UIProcess/ios/WKContentViewInteraction.mm:
1070         (-[WKContentView pointIsInDataInteractionContent:]):
1071
1072 2017-02-28  Yongjun Zhang  <yongjun_zhang@apple.com>
1073
1074         Add delegate method to handle images with alternate data.
1075         https://bugs.webkit.org/show_bug.cgi?id=168785
1076         <rdar://problem/28776219>
1077
1078         Add delegate methods to WKUIDelegatePrivate so that a WebKit client can provide alternate URL or data for an image
1079         before long-press or preview. When an image has alternate URL or data, we can change the actions accordingly.
1080
1081         Reviewed by Enrica Casucci.
1082
1083         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Add two delegate methods _webView:getAlternateURLFromImage:completionHandler:
1084             and _webView:alternateURLFromImage:userInfo;
1085         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h: Add an readonly property userInfo so that alternate data can be
1086             carried by _WKActivatedElementInfo and be processed by WebKit client.
1087         * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
1088         (-[_WKActivatedElementInfo _initWithType:URL:location:title:ID:rect:image:]):
1089         (-[_WKActivatedElementInfo _initWithType:URL:location:title:ID:rect:image:userInfo:]): A new initializer that also takes userInfo.
1090         (-[_WKActivatedElementInfo userInfo]):
1091         * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h: A new delegate method for WKActionSheetAssistantDelegate to fetch
1092             alternate data before showing image sheet.
1093         * UIProcess/ios/WKActionSheetAssistant.h:
1094         * UIProcess/ios/WKActionSheetAssistant.mm:
1095         (-[WKActionSheetAssistant showImageSheet]): Before showing the image sheet, if the image doesn't have linked URL (i.e. not a image
1096             link), try to fetch its alternate URL and data.
1097         (-[WKActionSheetAssistant defaultActionsForImageSheet:]): Drive-by fix. We always use positionInformation's URL to populate the
1098             actions, however, we should use elementInfo's URL since the two URLs could mismatch.
1099         * UIProcess/ios/WKContentViewInteraction.mm:
1100         (-[WKContentView actionSheetAssistant:getAlternateURLForImage:completion:]):
1101         (-[WKContentView _presentedViewControllerForPreviewItemController:]): Before previewing an image, synchronously get alternate
1102             data for the image and update the actions accordingly.
1103
1104 2017-02-28  Brady Eidson  <beidson@apple.com>
1105         
1106         Refactor WebViewImpl creation in preparation for supporting multiple WebsiteDataStores.
1107         https://bugs.webkit.org/show_bug.cgi?id=168676
1108
1109         Reviewed by Alex Christensen and Sam Weinig.
1110
1111         * UIProcess/WebProcessPool.cpp:
1112         (WebKit::WebProcessPool::createNewWebProcess):
1113         (WebKit::WebProcessPool::warmInitialProcess):
1114         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
1115         (WebKit::WebProcessPool::createWebPage):
1116         * UIProcess/WebProcessPool.h:
1117
1118 2017-02-28  Youenn Fablet  <youenn@apple.com>
1119
1120         [WebRTC] Limit libwebrtc logging in Debug build
1121         https://bugs.webkit.org/show_bug.cgi?id=168974
1122
1123         Reviewed by Alex Christensen.
1124
1125         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
1126         (WebKit::NetworkRTCProvider::NetworkRTCProvider):
1127         * Platform/Logging.h:
1128
1129 2017-02-28  Youenn Fablet  <youenn@apple.com>
1130
1131         [WebRTC] NetworkRTCProvider should stop the network thread from the main thread
1132         https://bugs.webkit.org/show_bug.cgi?id=168972
1133
1134         Reviewed by Alex Christensen.
1135
1136         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
1137         (WebKit::NetworkRTCProvider::close): Ensuring to stop the network thread from the main thread when provider is
1138         getting closed.
1139
1140 2017-02-24  Matt Rajca  <mrajca@apple.com>
1141
1142         Media: notify clients when autoplayed media ends without being paused
1143         https://bugs.webkit.org/show_bug.cgi?id=168852
1144
1145         Reviewed by Alex Christensen.
1146
1147         * UIProcess/API/C/WKPageUIClient.h:
1148
1149 2017-02-28  Csaba Osztrogonác  <ossy@webkit.org>
1150
1151         Remove EFL leftover from WebPageProxy.messages.in
1152         https://bugs.webkit.org/show_bug.cgi?id=168828
1153
1154         Reviewed by Gyuyoung Kim.
1155
1156         * UIProcess/WebPageProxy.messages.in:
1157
1158 2017-02-28  Alex Christensen  <achristensen@webkit.org>
1159
1160         Main resource requests need cachePartition
1161         https://bugs.webkit.org/show_bug.cgi?id=168806
1162
1163         Reviewed by Brady Eidson.
1164
1165         * NetworkProcess/NetworkResourceLoader.cpp:
1166         (WebKit::NetworkResourceLoader::continueWillSendRequest):
1167
1168 2017-02-27  Alex Christensen  <achristensen@webkit.org>
1169
1170         Begin enabling WebRTC on 64-bit
1171         https://bugs.webkit.org/show_bug.cgi?id=168915
1172
1173         Reviewed by Eric Carlson.
1174
1175         * Configurations/FeatureDefines.xcconfig:
1176
1177 2017-02-27  Alexey Proskuryakov  <ap@apple.com>
1178
1179         Remove _WKWebsiteDataRecord.h
1180         https://bugs.webkit.org/show_bug.cgi?id=168954
1181
1182         Reviewed by Dan Bernstein.
1183
1184         This doesn't seem to have ever been used, so better to remove it than to add an
1185         implementation.
1186
1187         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h: Removed.
1188         * WebKit2.xcodeproj/project.pbxproj:
1189
1190 2017-02-27  Alexey Proskuryakov  <ap@apple.com>
1191
1192         WKPageIsPlayingVideoInEnhancedFullscreen availability mismatch
1193         https://bugs.webkit.org/show_bug.cgi?id=168952
1194
1195         Reviewed by Dan Bernstein.
1196
1197         * UIProcess/API/C/mac/WKPagePrivateMac.h: TARGET_OS_MAC is not the right thing to
1198         check, as it's true on both macOS and iOS.
1199
1200 2017-02-27  Alexey Proskuryakov  <ap@apple.com>
1201
1202         Export WKPluginInformationBundleShortVersionKey
1203         https://bugs.webkit.org/show_bug.cgi?id=168951
1204
1205         Reviewed by Dan Bernstein.
1206
1207         * Shared/API/c/WKPluginInformation.h: It was accidentally not exported when added.
1208
1209 2017-02-27  Youenn Fablet  <youenn@apple.com>
1210
1211         [WebRTC] Add support for libwebrtc TCP incoming connections
1212         https://bugs.webkit.org/show_bug.cgi?id=168748
1213
1214         Reviewed by Alex Christensen.
1215
1216         Covered by added layout tests.
1217
1218         When a libwebrtc server socket is signalling a new connnection through SignalNewConnection, we do:
1219         - Wrap the incoming socket into a LibWebRTCSocketClient
1220         - Store it into a pending socket map with an identifier
1221         - Send a message to the web process of a new connection with the server socket identifier and new connection socket identifier.
1222         The Web process then creates a WebRTCSocket wrapper around it by sendinig a WrapNewTCPConnection message.
1223         It then propagates the SignalNewConnection to libwebrtc code path.
1224
1225         * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
1226         (WebKit::LibWebRTCSocketClient::LibWebRTCSocketClient):
1227         (WebKit::LibWebRTCSocketClient::signalReadPacket):
1228         (WebKit::LibWebRTCSocketClient::signalSentPacket):
1229         (WebKit::LibWebRTCSocketClient::signalNewConnection):
1230         (WebKit::LibWebRTCSocketClient::signalAddressReady):
1231         (WebKit::LibWebRTCSocketClient::signalConnect):
1232         (WebKit::LibWebRTCSocketClient::signalClose):
1233         * NetworkProcess/webrtc/LibWebRTCSocketClient.h:
1234         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
1235         (WebKit::NetworkRTCProvider::wrapNewTCPConnection):
1236         (WebKit::NetworkRTCProvider::newConnection):
1237         * NetworkProcess/webrtc/NetworkRTCProvider.h:
1238         * NetworkProcess/webrtc/NetworkRTCProvider.messages.in:
1239         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
1240         (WebKit::LibWebRTCSocket::signalNewConnection):
1241         * WebProcess/Network/webrtc/LibWebRTCSocket.h:
1242         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
1243         (WebKit::LibWebRTCSocketFactory::createNewConnectionSocket):
1244         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
1245         * WebProcess/Network/webrtc/WebRTCSocket.cpp:
1246         (WebKit::WebRTCSocket::signalNewConnection):
1247         * WebProcess/Network/webrtc/WebRTCSocket.h:
1248         * WebProcess/Network/webrtc/WebRTCSocket.messages.in:
1249
1250 2017-02-27  Brent Fulgham  <bfulgham@apple.com>
1251
1252         [Mac] Don't use undefined sandbox rule on macOS 10.11 or earlier
1253         https://bugs.webkit.org/show_bug.cgi?id=168942
1254         <rdar://problem/30743376>
1255
1256         Reviewed by Ryosuke Niwa.
1257
1258         * WebProcess/com.apple.WebProcess.sb.in:
1259
1260 2017-02-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1261
1262         Unreviewed, roll out r213065.
1263
1264         * UIProcess/ios/WKContentViewInteraction.h:
1265
1266 2017-02-27  Alexey Proskuryakov  <ap@apple.com>
1267
1268         Remove some deprecated WKPage plug-in information functions
1269         https://bugs.webkit.org/show_bug.cgi?id=168897
1270
1271         Reviewed by Tim Horton.
1272
1273         * UIProcess/API/C/WKPage.cpp:
1274         (WKPageGetProcessIdentifier):
1275         (WKPageGetPluginInformationBundleIdentifierKey): Deleted.
1276         (WKPageGetPluginInformationBundleVersionKey): Deleted.
1277         (WKPageGetPluginInformationDisplayNameKey): Deleted.
1278         (WKPageGetPluginInformationFrameURLKey): Deleted.
1279         (WKPageGetPluginInformationMIMETypeKey): Deleted.
1280         (WKPageGetPluginInformationPageURLKey): Deleted.
1281         (WKPageGetPluginInformationPluginspageAttributeURLKey): Deleted.
1282         (WKPageGetPluginInformationPluginURLKey): Deleted.
1283         * UIProcess/API/C/WKPage.h:
1284
1285 2017-02-27  Alexey Proskuryakov  <ap@apple.com>
1286
1287         Stop exporting C++ member variables from class extensions in WKDOMInternals.h
1288         https://bugs.webkit.org/show_bug.cgi?id=168886
1289
1290         Reviewed by Tim Horton.
1291
1292         * WebProcess/InjectedBundle/API/mac/WKDOMInternals.h: These are @package variables.
1293
1294 2017-02-27  Alex Christensen  <achristensen@webkit.org>
1295
1296         Optimize checkWebRTCAvailability
1297         https://bugs.webkit.org/show_bug.cgi?id=168913
1298
1299         Reviewed by Darin Adler.
1300
1301         We can optimize startup time by using RTLD_LAZY instead of RTLD_NOW because we don't need to load all the symbols.
1302         We just need to check whether libwebrtc.dylib can be found and is a valid dylib for the current architecture.
1303         Also, initialize a static bool so it only needs to be checked once.  Right now it's only used when initializing settings,
1304         but if we use it for other things in the future there will be no need to reopen the dylib.
1305
1306         * UIProcess/WebPreferences.cpp:
1307         (WebKit::checkWebRTCAvailability):
1308
1309 2017-02-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1310
1311         Unreviewed, revert all temporary build fixes for data interaction
1312
1313         Rolls out r212990, r212988 and r212984.
1314
1315         * UIProcess/ios/WKContentViewInteraction.h:
1316
1317 2017-02-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1318
1319         [GTK] Rendering artifacts when resizing the window in X11 with AC mode enabled
1320         https://bugs.webkit.org/show_bug.cgi?id=168728
1321
1322         Reviewed by Žan Doberšek.
1323
1324         This happens because the pixmap we create from the redirected window is uninitialized until the threaded
1325         compositor renders into it. We should always initialize the pixmap right after it's created.
1326
1327         * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp:
1328         (WebKit::defaultVisual): Helper static method to get the default GdkVisual.
1329         (WebKit::AcceleratedSurfaceX11::AcceleratedSurfaceX11): Use createPixmap().
1330         (WebKit::AcceleratedSurfaceX11::createPixmap): Create and initialize the pixmap.
1331         (WebKit::AcceleratedSurfaceX11::resize): Use createPixmap().
1332         * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h:
1333
1334 2017-02-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1335
1336         [GTK] Flickering when leaving accelerated compositing mode
1337         https://bugs.webkit.org/show_bug.cgi?id=168911
1338
1339         Reviewed by Žan Doberšek.
1340
1341         It doesn't always happen, and it's too fast, more noticeable in websites with a dark background, because we are
1342         drawing a single white frame. This happens when we leave AC mode during the layer flush that schedules an update
1343         on the compositor, which at that point only clears the area and renders nothing. However,
1344         CoordinatedGraphicsScene::paintToCurrentGLContext() always renders a white background when no web view color has
1345         been set. And that's the white frame we get. We could prevent that last update from happening by checking if we
1346         still have a graphics root layer after syncDisplayState() in the layer flush, the same way we check the layer
1347         tree host is still valid.
1348
1349         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1350         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1351         (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired):
1352
1353 2017-02-27  Alex Christensen  <achristensen@webkit.org>
1354
1355         [libwebrtc] Enable WebRTC in some Production Builds
1356         https://bugs.webkit.org/show_bug.cgi?id=168858
1357
1358         * Configurations/FeatureDefines.xcconfig:
1359
1360 2017-02-27  Andy Estes  <aestes@apple.com>
1361
1362         Links cannot be activated when running Mobile Safari with external SDK build of WebKit for iOS Simulator
1363         https://bugs.webkit.org/show_bug.cgi?id=141906
1364
1365         Reviewed by Tim Horton.
1366
1367         Even if Touch Events are disabled, we still need to register a
1368         UIWebTouchEventsGestureRecognizer to record the layer tree transaction ID when a touch
1369         begins. Click events are only generated for touches that occur after the current frame's
1370         load has committed, and we use the transaction ID from when the touch began to implement
1371         this check.
1372
1373         * UIProcess/WebPageProxy.cpp:
1374         (WebKit::WebPageProxy::handleTouchEventSynchronously):
1375         (WebKit::WebPageProxy::resetState):
1376         * UIProcess/WebPageProxy.h:
1377         * UIProcess/ios/WKContentViewInteraction.h: Declared _layerTreeTransactionIdAtLastTouchStart.
1378         * UIProcess/ios/WKContentViewInteraction.mm:
1379         (-[WKContentView setupInteraction]): Register a UIWebTouchEventsGestureRecognizer even if
1380         Touch Events are disabled.
1381         (-[WKContentView cleanupInteraction]): Reset _layerTreeTransactionIdAtLastTouchStart to 0.
1382         (-[WKContentView _webTouchEventsRecognized:]): Update _layerTreeTransactionIdAtLastTouchStart
1383         when a touch begins, even if Touch Events are disabled.
1384         (-[WKContentView _singleTapCommited:]): Passed _layerTreeTransactionIdAtLastTouchStart to
1385         WebPageProxy::commitPotentialTap().
1386         (-[WKContentView _attemptClickAtLocation:]): Ditto for WebPageProxy::handleTap().
1387         * UIProcess/ios/WebPageProxyIOS.mm:
1388         (WebKit::WebPageProxy::commitPotentialTap):
1389         (WebKit::WebPageProxy::handleTap):
1390
1391 2017-02-26  Zan Dobersek  <zdobersek@igalia.com>
1392
1393         [CoordinatedGraphics] Remove CoordinatedGraphicsScene::paintToGraphicsContext()
1394         https://bugs.webkit.org/show_bug.cgi?id=168903
1395
1396         Reviewed by Carlos Garcia Campos.
1397
1398         Remove the CoordinatedGraphicsScene::paintToGraphicsContext() method as it
1399         is not used anywhere. Also enables removing the GraphicsContext pointer
1400         member from the TextureMapper class.
1401
1402         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1403         (WebKit::CoordinatedGraphicsScene::paintToGraphicsContext): Deleted.
1404         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1405
1406 2017-02-26  Carlos Garcia Campos  <cgarcia@igalia.com>
1407
1408         [GTK] Hangs when showing Google search results
1409         https://bugs.webkit.org/show_bug.cgi?id=168699
1410
1411         Reviewed by Žan Doberšek.
1412
1413         Connection::sendOutgoingMessage() can poll forever if sendmsg fails with EAGAIN or EWOULDBLOCK. For example if
1414         socket read buffers are full, poll will be blocked until we read the pending data, but we can't read because
1415         the thread is blocked in the poll. In case of EAGAIN/EWOULDBLOCK we should poll using the run loop, to allow
1416         reads to happen in thread while we wait for the socket to be writable again. In the GTK+ port we use
1417         GSocketMonitor to poll socket file descriptor without blocking, using the run loop. This patch renames the
1418         socket monitor as readSocketMonitor and adds another one for polling output. When sendmsg fails with
1419         EAGAIN/EWOULDBLOCK, the pending message is saved and the write monitor starts polling. Once the socket is
1420         writable again we send the pending message. Helper class MessageInfo and a new one UnixMessage have been moved
1421         to its own header file to be able to use std::unique_ptr member to save the pending message.
1422
1423         * Platform/IPC/Connection.cpp: Include UnixMessage.h as required by std::unique_ptr.
1424         * Platform/IPC/Connection.h: Add write socket monitor and also keep the GSocket as a member to reuse it.
1425         * Platform/IPC/glib/GSocketMonitor.cpp: Use Function instead of std::function.
1426         (IPC::GSocketMonitor::start):
1427         * Platform/IPC/glib/GSocketMonitor.h:
1428         * Platform/IPC/unix/ConnectionUnix.cpp:
1429         (IPC::Connection::platformInitialize): Initialize the GSocket here since we rely on it to take the ownership of
1430         the descriptor. We were leaking it if the connection was invalidated without being opened.
1431         (IPC::Connection::platformInvalidate): Destroy the GSocket even when not connected. Also stop the write monitor.
1432         (IPC::Connection::processMessage):
1433         (IPC::Connection::open):
1434         (IPC::Connection::platformCanSendOutgoingMessages): Return false if we have a pending message to ensure
1435         Connection doesn't try to send more messages until the pending message is dispatched. We don't need to check
1436         m_isConnected because the caller already checks that.
1437         (IPC::Connection::sendOutgoingMessage): Split it in two. This creates and prepares a UnixMessage and then calls
1438         sendOutputMessage() to do the rest.
1439         (IPC::Connection::sendOutputMessage): Send the message, or save it if sendmsg fails with EAGAIN or EWOULDBLOCK
1440         to be sent later when the socket is writable.
1441         * Platform/IPC/unix/UnixMessage.h: Added.
1442         (IPC::MessageInfo::MessageInfo):
1443         (IPC::MessageInfo::setMessageBodyIsOutOfLine):
1444         (IPC::MessageInfo::isMessageBodyIsOutOfLine):
1445         (IPC::MessageInfo::bodySize):
1446         (IPC::MessageInfo::attachmentCount):
1447         (IPC::UnixMessage::UnixMessage):
1448         (IPC::UnixMessage::~UnixMessage):
1449         (IPC::UnixMessage::attachments):
1450         (IPC::UnixMessage::messageInfo):
1451         (IPC::UnixMessage::body):
1452         (IPC::UnixMessage::bodySize):
1453         (IPC::UnixMessage::appendAttachment):
1454         * PlatformGTK.cmake:
1455
1456 2017-02-26  Devin Rousso  <dcrousso+webkit@gmail.com>
1457
1458         Web Inspector: RTL: Docking Left doesn't constrain the page width
1459         https://bugs.webkit.org/show_bug.cgi?id=168862
1460
1461         Reviewed by Brian Burg.
1462
1463         * UIProcess/mac/WebInspectorProxyMac.mm:
1464         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
1465         Calculate the inspectedViewFrame to be the remaining space after WebInspector is opened
1466         instead of using the original page size.
1467
1468 2017-02-26  Alexey Proskuryakov  <ap@apple.com>
1469
1470         Stop exporting C++ member variables from WKDOMTextIterator
1471         https://bugs.webkit.org/show_bug.cgi?id=168885
1472
1473         Reviewed by Dan Bernstein.
1474
1475         * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.mm:
1476
1477 2017-02-26  Alexey Proskuryakov  <ap@apple.com>
1478
1479         Add preprocessor guards to Mac specific files that are exposed as private headers on iOS
1480         https://bugs.webkit.org/show_bug.cgi?id=168878
1481
1482         Reviewed by Dan Bernstein.
1483
1484         * UIProcess/API/C/WKInspector.h:
1485         * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.h:
1486
1487 2017-02-26  Alexey Proskuryakov  <ap@apple.com>
1488
1489         Remove spurious C++ include from _WKTestingDelegate.h
1490         https://bugs.webkit.org/show_bug.cgi?id=168877
1491
1492         Reviewed by Dan Bernstein.
1493
1494         * UIProcess/API/Cocoa/_WKTestingDelegate.h:
1495
1496 2017-02-26  Alexey Proskuryakov  <ap@apple.com>
1497
1498         Remove unimplemented WKResourceLoadStatisticsManagerSetReducedTimestampResolution
1499         https://bugs.webkit.org/show_bug.cgi?id=168880
1500
1501         Reviewed by Dan Bernstein.
1502
1503         * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
1504
1505 2017-02-26  Alexey Proskuryakov  <ap@apple.com>
1506
1507         Remove leftover WebKit2 C API function declarations
1508         https://bugs.webkit.org/show_bug.cgi?id=168879
1509
1510         Reviewed by Tim Horton.
1511
1512         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1513
1514 2017-02-26  Alexey Proskuryakov  <ap@apple.com>
1515
1516         Remove some old WKSecurityOrigin binary compatibility stubs
1517         https://bugs.webkit.org/show_bug.cgi?id=168881
1518
1519         Reviewed by Dan Bernstein.
1520
1521         * Shared/API/c/WKSecurityOriginRef.cpp:
1522         (WKSecurityOriginGetHost): Deleted.
1523         (WKSecurityOriginGetProtocol): Deleted.
1524
1525 2017-02-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1526
1527         REGRESSION (r211312): Double-clicking a word selects it along with the space that follows it
1528         https://bugs.webkit.org/show_bug.cgi?id=168821
1529         <rdar://problem/30690431>
1530
1531         Reviewed by Tim Horton.
1532
1533         Actually encode and decode smartInsertDeleteEnabled when sending WebPageCreationParameters over XPC.
1534
1535         * Shared/WebPageCreationParameters.cpp:
1536         (WebKit::WebPageCreationParameters::encode):
1537         (WebKit::WebPageCreationParameters::decode):
1538
1539 2017-02-26  Chris Dumez  <cdumez@apple.com>
1540
1541         HitTestResult's linkSuggestedFilename should sanitize download attribute
1542         https://bugs.webkit.org/show_bug.cgi?id=168856
1543         <rdar://problem/30683109>
1544
1545         Reviewed by Antti Koivisto.
1546
1547         HitTestResult's linkSuggestedFilename should sanitize download attribute.
1548         This is used by the context menu's "Download Linked File" & "Download Linked
1549         File As..." actions.
1550
1551         * Shared/WebHitTestResultData.cpp:
1552         (WebKit::WebHitTestResultData::WebHitTestResultData):
1553         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
1554         (WebKit::InjectedBundleHitTestResult::linkSuggestedFilename):
1555
1556 2017-02-25  Michael Catanzaro  <mcatanzaro@igalia.com>
1557
1558         [GTK] Unreviewed, document deficiency in webkit_website_data_manager_clear() API
1559
1560         Document that this function cannot currently delete cookie data for a particular period of
1561         time.
1562
1563         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
1564
1565 2017-02-24  Joseph Pecoraro  <pecoraro@apple.com>
1566
1567         [Resource Timing] Gather timing information with reliable responseEnd time
1568         https://bugs.webkit.org/show_bug.cgi?id=168351
1569
1570         Reviewed by Alex Christensen.
1571
1572         Change from an unused `double finishTime` to a complete WebCore::NetworkLoadMetrics
1573         object in the didFinishLoad ResourceLoader path. We may also extend this in the
1574         didFail path later on. This allows the NetworkProcess to give complete timing
1575         information, and more final metrics about the load, to WebCore.
1576
1577         * NetworkProcess/NetworkDataTask.h:
1578         (WebKit::NetworkDataTaskClient::didCompleteWithError):
1579         Give the NetworkDataTaskClient a basic didCompleteWithError for a completion
1580         without metrics. For loads that complete with an error, or haven't populated
1581         any metrics, this will pass empty metrics onward.
1582
1583         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
1584         (WebKit::BlobDownloadClient::didFinishLoading):
1585         * NetworkProcess/Downloads/BlobDownloadClient.h:
1586         * NetworkProcess/Downloads/PendingDownload.h:
1587         * NetworkProcess/PingLoad.h:
1588         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1589         (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
1590         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
1591         * NetworkProcess/NetworkDataTaskBlob.cpp:
1592         (WebKit::NetworkDataTaskBlob::didFail):
1593         * NetworkProcess/NetworkLoad.cpp:
1594         (WebKit::NetworkLoad::continueWillSendRequest):
1595         (WebKit::NetworkLoad::didCompleteWithError):
1596         (WebKit::NetworkLoad::didFinishLoading):
1597         * NetworkProcess/NetworkLoad.h:
1598         * NetworkProcess/NetworkLoadClient.h:
1599         * NetworkProcess/NetworkResourceLoader.cpp:
1600         (WebKit::NetworkResourceLoader::didFinishLoading):
1601         (WebKit::NetworkResourceLoader::sendResultForCacheEntry):
1602         * NetworkProcess/NetworkResourceLoader.h:
1603         * WebProcess/Network/WebResourceLoader.cpp:
1604         (WebKit::WebResourceLoader::didFinishResourceLoad):
1605         (WebKit::WebResourceLoader::didReceiveResource):
1606         * WebProcess/Network/WebResourceLoader.h:
1607         * WebProcess/Network/WebResourceLoader.messages.in:
1608         Change didFinishLoad paths to take a NetworkLoadMetrics object instead of finishTime.
1609         Change didCompleteWithError pathes to include a NetworkLoadMetrics object instead of finishTime.
1610
1611         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1612         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1613         (WebKit::NetworkDataTaskCocoa::didCompleteWithError):
1614         Own a NetworkLoadTiming that will be populated with the load.
1615
1616         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1617         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1618         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
1619         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
1620         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
1621         Populate NetworkLoadMetrics in the didFinishCollectingMetrics NSURLSessionTaskDelegate method.
1622
1623         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1624         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
1625         (WebKit::NetworkDataTaskSoup::timeoutFired):
1626         (WebKit::NetworkDataTaskSoup::didSendRequest):
1627         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
1628         (WebKit::NetworkDataTaskSoup::dispatchDidCompleteWithError):
1629         (WebKit::NetworkDataTaskSoup::tlsErrorsChanged):
1630         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
1631         (WebKit::NetworkDataTaskSoup::didFinishRead):
1632         (WebKit::NetworkDataTaskSoup::didFinishRequestNextPart):
1633         (WebKit::NetworkDataTaskSoup::didFailDownload):
1634         (WebKit::NetworkDataTaskSoup::didFail):
1635         (WebKit::NetworkDataTaskSoup::networkEvent):
1636         (WebKit::NetworkDataTaskSoup::didStartRequest):
1637         (WebKit::NetworkDataTaskSoup::didRestart):
1638         * NetworkProcess/soup/NetworkDataTaskSoup.h:
1639         Instead of populating the NetworkLoadMetrics on the ResourceResponse, populate
1640         a member variable during the entire load and dispatch didFinishCollectingMetrics
1641         right before didCompleteLoadWithError.
1642
1643 2017-02-24  Chris Dumez  <cdumez@apple.com>
1644
1645         Unreviewed, rolling out r212944.
1646
1647         Caused a lot of failures on the debug bots
1648
1649         Reverted changeset:
1650
1651         "[Resource Timing] Gather timing information with reliable
1652         responseEnd time"
1653         https://bugs.webkit.org/show_bug.cgi?id=168351
1654         http://trac.webkit.org/changeset/212944
1655
1656 2017-02-24  Wenson Hsieh  <wenson_hsieh@apple.com>
1657
1658         Unreviewed, fix the internal build
1659
1660         * UIProcess/ios/WKContentViewInteraction.h:
1661
1662 2017-02-24  Matt Rajca  <mrajca@apple.com>
1663
1664         Media: notify clients when autoplay is denied
1665         https://bugs.webkit.org/show_bug.cgi?id=168840
1666
1667         Reviewed by Alex Christensen.
1668
1669         * UIProcess/API/APIUIClient.h:
1670         (API::UIClient::handleAutoplayEvent):
1671         (API::UIClient::didPlayMediaPreventedFromPlayingWithoutUserGesture): Deleted.
1672         * UIProcess/API/C/WKPage.cpp:
1673         (WKPageSetPageUIClient):
1674         * UIProcess/API/C/WKPageUIClient.h:
1675         * UIProcess/WebPageProxy.cpp:
1676         (WebKit::WebPageProxy::handleAutoplayEvent):
1677         (WebKit::WebPageProxy::didPlayMediaPreventedFromPlayingWithoutUserGesture): Deleted.
1678         * UIProcess/WebPageProxy.h:
1679         * UIProcess/WebPageProxy.messages.in:
1680         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1681         (WebKit::WebChromeClient::handleAutoplayEvent):
1682         (WebKit::WebChromeClient::didPlayMediaPreventedFromPlayingWithoutUserGesture): Deleted.
1683         * WebProcess/WebCoreSupport/WebChromeClient.h:
1684
1685 2017-02-20  Wenson Hsieh  <wenson_hsieh@apple.com>
1686
1687         Refactor data interaction to use new WKDataInteraction SPI
1688         https://bugs.webkit.org/show_bug.cgi?id=168602
1689         Work towards <rdar://problem/30313681>
1690
1691         Reviewed by Tim Horton.
1692
1693         Adjust testing SPI to match new data interaction interfaces.
1694
1695         * Platform/spi/ios/UIKitSPI.h:
1696         * UIProcess/API/Cocoa/WKWebView.mm:
1697         (-[WKWebView _simulateDataInteractionEntered:]):
1698         (-[WKWebView _simulateDataInteractionUpdated:]):
1699         (-[WKWebView _simulateDataInteractionPerformOperation:]):
1700         (-[WKWebView _simulateDataInteractionEnded:]):
1701         (-[WKWebView _simulateDataInteractionSessionDidEnd:]):
1702         (-[WKWebView _simulateWillBeginDataInteractionWithSession:]):
1703         (-[WKWebView _simulatedItemsForSession:]):
1704         (-[WKWebView _simulatePrepareForDataInteractionSession:completion:]):
1705         (-[WKWebView _simulateDataInteractionSessionDidEnd:withOperation:]): Deleted.
1706         (-[WKWebView _simulateFailedDataInteractionWithIndex:]): Deleted.
1707         (-[WKWebView _simulateWillBeginDataInteractionWithIndex:withSession:]): Deleted.
1708         (-[WKWebView _simulatedItemsForDataInteractionWithIndex:]): Deleted.
1709         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1710         * UIProcess/ios/WKContentViewInteraction.h:
1711         * UIProcess/ios/WKContentViewInteraction.mm:
1712         (-[WKContentView _positionInformationDidChange:]):
1713         * UIProcess/ios/WKScrollView.h:
1714         * UIProcess/ios/WKScrollView.mm:
1715
1716 2017-02-20  Wenson Hsieh  <wenson_hsieh@apple.com>
1717
1718         Remove the data interaction gesture recognizer
1719         https://bugs.webkit.org/show_bug.cgi?id=168600
1720         <rdar://problem/30313681>
1721
1722         Reviewed by Anders Carlsson.
1723
1724         The data interaction gesture recognizer will no longer be needed moving forward.
1725
1726         * UIProcess/API/Cocoa/WKWebView.mm:
1727         (-[WKWebView _simulateDataInteractionGestureRecognized]): Deleted.
1728         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1729         * UIProcess/ios/WKContentViewInteraction.h:
1730         * UIProcess/ios/WKContentViewInteraction.mm:
1731         (-[WKContentView setupInteraction]):
1732         (-[WKContentView cleanupInteraction]):
1733         (-[WKContentView _removeDefaultGestureRecognizers]):
1734         (-[WKContentView _addDefaultGestureRecognizers]):
1735         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
1736         (-[WKContentView gestureRecognizerShouldBegin:]):
1737         (-[WKContentView _dataInteractionGestureRecognizer]): Deleted.
1738
1739 2017-02-24  Chris Dumez  <cdumez@apple.com>
1740
1741         [iOS][WK2] Disable network cache speculative revalidation / loading in low power mode
1742         https://bugs.webkit.org/show_bug.cgi?id=168832
1743         <rdar://problem/30697911>
1744
1745         Reviewed by Antti Koivisto.
1746
1747         Disable network cache speculative revalidation / loading in low power mode on iOS to
1748         save battery.
1749
1750         * NetworkProcess/cache/NetworkCache.cpp:
1751         (WebKit::NetworkCache::Cache::initialize):
1752         * NetworkProcess/cache/NetworkCache.h:
1753
1754 2017-02-24  John Wilander  <wilander@apple.com>
1755
1756         Resource Load Statistics: Add alternate classification method
1757         https://bugs.webkit.org/show_bug.cgi?id=168347
1758         <rdar://problem/30352793>
1759         <rdar://problem/30646710>
1760         <rdar://problem/30660708>
1761
1762         Reviewed by Alex Christensen.
1763
1764         This patch adds a CorePrediction-based classifier to the WebResourceLoadStatisticsStore.
1765         The CorePrediction framework is introduced as a dependency for macOS and iOS. The patch
1766         also adds functions to support layout tests of the feature.
1767
1768         * Platform/Logging.h:
1769             Added channel ResourceLoadStatistics.
1770         * Platform/classifier/ResourceLoadStatisticsClassifier.h: Added.
1771             Pulls in the Cocoa-specific classifier for Cocoa-based platforms.
1772         (WebKit::ResourceLoadStatisticsClassifier::ResourceLoadStatisticsClassifier):
1773         * Platform/classifier/ResourceLoadStatisticsClassifierBase.cpp: Added.
1774         (WebKit::ResourceLoadStatisticsClassifierBase::hasPrevalentResourceCharacteristics):
1775             Shared classifier logic.
1776         (WebKit::ResourceLoadStatisticsClassifierBase::classifyWithVectorThreshold):
1777             Fallback classifier for when we don't have CorePrediction.
1778         * Platform/classifier/ResourceLoadStatisticsClassifierBase.h: Added.
1779         (WebKit::ResourceLoadStatisticsClassifierBase::ResourceLoadStatisticsClassifierBase):
1780         (WebKit::ResourceLoadStatisticsClassifierBase::~ResourceLoadStatisticsClassifierBase):
1781         * Platform/classifier/cocoa/CorePredictionSoftLink.h: Added.
1782             Soft links to CorePrediction and the two functions we use from it.
1783         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: Added.
1784         (WebKit::ResourceLoadStatisticsClassifier::classify):
1785         (WebKit::ResourceLoadStatisticsClassifier::storagePath):
1786         (WebKit::ResourceLoadStatisticsClassifier::shouldUseCorePredictionAndHaveModelLoaded):
1787         (WebKit::ResourceLoadStatisticsClassifier::singletonPredictionModel):
1788             The new classifier for Cocoa platforms.
1789         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h: Added.
1790         * PlatformGTK.cmake:
1791             Added Platform/classifier directory and ResourceLoadStatisticsClassifierBase.cpp.
1792         * PlatformMac.cmake:
1793             Added Platform/classifier and Platform/classifier/cocoa directories, and
1794             source files ResourceLoadStatisticsClassifierBase.cpp and
1795             ResourceLoadStatisticsClassifierCocoa.cpp
1796         * Resources/ResourceLoadStatistics/corePrediction_model: Added.
1797             Model file to load into CorePrediction.
1798         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
1799         (WKResourceLoadStatisticsManagerSetSubframeUnderTopFrameOrigin):
1800         (WKResourceLoadStatisticsManagerSetSubresourceUnderTopFrameOrigin):
1801         (WKResourceLoadStatisticsManagerSetSubresourceUniqueRedirectTo):
1802             Test infrastructure.
1803         * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
1804         * UIProcess/WebResourceLoadStatisticsManager.cpp:
1805         (WebKit::WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin):
1806         (WebKit::WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin):
1807         (WebKit::WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo):
1808             Test infrastructure.
1809         * UIProcess/WebResourceLoadStatisticsManager.h:
1810         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1811         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1812             Renamed m_storagePath to m_statisticsStoragePath for clarity.
1813         (WebKit::WebResourceLoadStatisticsStore::classifyResource):
1814             Now calls the classifier through its ResourceLoadStatisticsClassifier
1815             member variable.
1816         (WebKit::WebResourceLoadStatisticsStore::persistentStoragePath):
1817             Renamed m_storagePath to m_statisticsStoragePath for clarity.
1818         (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
1819             Renamed m_storagePath to m_statisticsStoragePath for clarity.
1820         (WebKit::WebResourceLoadStatisticsStore::hasPrevalentResourceCharacteristics): Deleted.
1821         * UIProcess/WebResourceLoadStatisticsStore.h:
1822         * WebKit2.xcodeproj/project.pbxproj:
1823             Added the new classifier source files under Platform/classifier and the
1824             corePrediction_model file under Resources/ResourceLoadStatistics.
1825
1826 2017-02-23  Joseph Pecoraro  <pecoraro@apple.com>
1827
1828         [Resource Timing] Add Experimental Feature Flag
1829         https://bugs.webkit.org/show_bug.cgi?id=167147
1830
1831         Reviewed by Ryosuke Niwa.
1832
1833         * Shared/WebPreferencesDefinitions.h:
1834         Move ResourceTiming to experimental section.
1835         Disable it for El Capitan due to known issues.
1836
1837 2017-02-23  Joseph Pecoraro  <pecoraro@apple.com>
1838
1839         [Resource Timing] Gather timing information with reliable responseEnd time
1840         https://bugs.webkit.org/show_bug.cgi?id=168351
1841
1842         Reviewed by Alex Christensen.
1843
1844         Change from an unused `double finishTime` to a complete WebCore::NetworkLoadMetrics
1845         object in the didFinishLoad ResourceLoader path. We may also extend this in the
1846         didFail path later on. This allows the NetworkProcess to give complete timing
1847         information, and more final metrics about the load, to WebCore.
1848
1849         * NetworkProcess/NetworkDataTask.h:
1850         (WebKit::NetworkDataTaskClient::didCompleteWithError):
1851         Give the NetworkDataTaskClient a basic didCompleteWithError for a completion
1852         without metrics. For loads that complete with an error, or haven't populated
1853         any metrics, this will pass empty metrics onward.
1854
1855         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
1856         (WebKit::BlobDownloadClient::didFinishLoading):
1857         * NetworkProcess/Downloads/BlobDownloadClient.h:
1858         * NetworkProcess/Downloads/PendingDownload.h:
1859         * NetworkProcess/PingLoad.h:
1860         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1861         (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
1862         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
1863         * NetworkProcess/NetworkDataTaskBlob.cpp:
1864         (WebKit::NetworkDataTaskBlob::didFail):
1865         * NetworkProcess/NetworkLoad.cpp:
1866         (WebKit::NetworkLoad::continueWillSendRequest):
1867         (WebKit::NetworkLoad::didCompleteWithError):
1868         (WebKit::NetworkLoad::didFinishLoading):
1869         * NetworkProcess/NetworkLoad.h:
1870         * NetworkProcess/NetworkLoadClient.h:
1871         * NetworkProcess/NetworkResourceLoader.cpp:
1872         (WebKit::NetworkResourceLoader::didFinishLoading):
1873         (WebKit::NetworkResourceLoader::sendResultForCacheEntry):
1874         * NetworkProcess/NetworkResourceLoader.h:
1875         * WebProcess/Network/WebResourceLoader.cpp:
1876         (WebKit::WebResourceLoader::didFinishResourceLoad):
1877         (WebKit::WebResourceLoader::didReceiveResource):
1878         * WebProcess/Network/WebResourceLoader.h:
1879         * WebProcess/Network/WebResourceLoader.messages.in:
1880         Change didFinishLoad paths to take a NetworkLoadMetrics object instead of finishTime.
1881         Change didCompleteWithError pathes to include a NetworkLoadMetrics object instead of finishTime.
1882
1883         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1884         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1885         (WebKit::NetworkDataTaskCocoa::didCompleteWithError):
1886         Own a NetworkLoadTiming that will be populated with the load.
1887
1888         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1889         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1890         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
1891         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
1892         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
1893         Populate NetworkLoadMetrics in the didFinishCollectingMetrics NSURLSessionTaskDelegate method.
1894
1895         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1896         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
1897         (WebKit::NetworkDataTaskSoup::timeoutFired):
1898         (WebKit::NetworkDataTaskSoup::didSendRequest):
1899         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
1900         (WebKit::NetworkDataTaskSoup::dispatchDidCompleteWithError):
1901         (WebKit::NetworkDataTaskSoup::tlsErrorsChanged):
1902         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
1903         (WebKit::NetworkDataTaskSoup::didFinishRead):
1904         (WebKit::NetworkDataTaskSoup::didFinishRequestNextPart):
1905         (WebKit::NetworkDataTaskSoup::didFailDownload):
1906         (WebKit::NetworkDataTaskSoup::didFail):
1907         (WebKit::NetworkDataTaskSoup::networkEvent):
1908         (WebKit::NetworkDataTaskSoup::didStartRequest):
1909         (WebKit::NetworkDataTaskSoup::didRestart):
1910         * NetworkProcess/soup/NetworkDataTaskSoup.h:
1911         Instead of populating the NetworkLoadMetrics on the ResourceResponse, populate
1912         a member variable during the entire load and dispatch didFinishCollectingMetrics
1913         right before didCompleteLoadWithError.
1914
1915 2017-02-23  Beth Dakin  <bdakin@apple.com> + Dan Saunders  <dasau@microsoft.com>
1916
1917         No reliable way to get a snapshot of WKWebView
1918         https://bugs.webkit.org/show_bug.cgi?id=161450
1919         -and corresponding-
1920         <rdar://problem/23846039>
1921
1922         Reviewed by Tim Horton.
1923
1924         This patch adds a new API to WKWebView to snapshot a rect:
1925         takeSnapshotWithConfiguration:completionHandler:
1926
1927         It also adds a new API object WKSnapshotConfiguration.
1928
1929         * UIProcess/API/Cocoa/WKSnapshotConfiguration.h: Added.
1930         * UIProcess/API/Cocoa/WKSnapshotConfiguration.mm: Added.
1931         (-[WKSnapshotConfiguration copyWithZone:]):
1932         * UIProcess/API/Cocoa/WKWebView.h:
1933         * UIProcess/API/Cocoa/WKWebView.mm:
1934         (-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):
1935         * WebKit2.xcodeproj/project.pbxproj:
1936
1937 2017-02-23  Jer Noble  <jer.noble@apple.com>
1938
1939         ASSERT in RTCNetwork::IPAddress::decode()
1940         https://bugs.webkit.org/show_bug.cgi?id=168792
1941
1942         Reviewed by Tim Horton.
1943
1944         An ASSERT added to RTCNetwork::IPAddress::decode in r212781 was hit due to a bad encode of SocketAddress; an
1945         extra boolean value was added to the encoder unnecessarily, leading to garbage data being decoded in the following
1946         IPAddress.
1947
1948         Drive-by-fix: allow the IPAddress encoder/decoder to pass through a value of AF_UNSPEC for an IPAddress to support
1949         passing through an "empty" IPAddress value.
1950
1951         * Shared/RTCNetwork.cpp:
1952         (WebKit::RTCNetwork::IPAddress::decode):
1953         (WebKit::RTCNetwork::IPAddress::encode):
1954         (WebKit::RTCNetwork::SocketAddress::encode):
1955
1956 2017-02-23  Eric Carlson  <eric.carlson@apple.com>
1957
1958         [WebRTC][Mac][WebKit2] WebRTC requires media capture
1959         https://bugs.webkit.org/show_bug.cgi?id=168782
1960         <rdar://problem/30675242>
1961
1962         Reviewed by Youenn Fablet.
1963
1964         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1965         (WebKit::WebProcessPool::platformInitializeWebProcess): Extend the sanbox to allow microphone access
1966         if media stream OR WebRTC is enabled.
1967
1968 2017-02-23  Brent Fulgham  <bfulgham@apple.com>
1969
1970         [Mac] Remove unneeded sandbox exceptions for media elements
1971         https://bugs.webkit.org/show_bug.cgi?id=168767
1972
1973         Reviewed by Alex Christensen.
1974
1975         Remove several sandbox exceptions that have not been needed for the past four
1976         or five macOS releases.
1977         
1978         * WebProcess/com.apple.WebProcess.sb.in:
1979
1980 2017-02-23  Brent Fulgham  <bfulgham@apple.com>
1981
1982         [Mac] Remove com.apple.audio.VDCAssistant from sandboxes
1983         https://bugs.webkit.org/show_bug.cgi?id=168764
1984         <rdar://problem/16736919>
1985
1986         Reviewed by Alex Christensen.
1987
1988         Remove unneeded sandbox class.
1989
1990         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1991         * WebProcess/com.apple.WebProcess.sb.in:
1992
1993 2017-02-22  Wenson Hsieh  <wenson_hsieh@apple.com>
1994
1995         Data interaction causes selection to fall out of sync between web/UI processes
1996         https://bugs.webkit.org/show_bug.cgi?id=168735
1997         <rdar://problem/30657817>
1998
1999         Reviewed by Tim Horton.
2000
2001         Fixes a bug with data interaction causing selection state to fall out of sync between the UI and web processes,
2002         and also introduces testing infrastructure and tests for grabbing UI-side selection view rects in TestWebKitAPI.
2003         While performing a data interaction operation, we now lift restrictions for assisting the focused node.
2004
2005         * UIProcess/ios/WKContentViewInteraction.h:
2006         * UIProcess/ios/WKContentViewInteraction.mm:
2007         (-[WKContentView cleanupInteraction]):
2008         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
2009
2010 2017-02-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2011
2012         [GTK] Crash attempting to load Flash plugin in Wayland
2013         https://bugs.webkit.org/show_bug.cgi?id=163159
2014
2015         Reviewed by Michael Catanzaro.
2016
2017         The problem is that we check if the current diplay is X11 or Wayland also in the plugin process, but with GTK2
2018         plugins the display is always X11. We should early reject plugins requiring GTK2 in the UI process when the
2019         current display is Wayland.
2020
2021         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
2022         (WebKit::PluginInfoStore::getPluginInfo):
2023         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
2024         (WebKit::PluginProcessProxy::scanPlugin):
2025         * UIProcess/gtk/WebPageProxyGtk.cpp:
2026         (WebKit::WebPageProxy::createPluginContainer): Add an assert to ensure this message is never received on a
2027         non-X11 display.
2028         * WebProcess/Plugins/PluginView.cpp:
2029         (WebKit::PluginView::createPluginContainer): Never send CreatePluginContainer message to the UI process if the
2030         display is not X11.
2031
2032 2017-02-23  Eric Carlson  <eric.carlson@apple.com>
2033
2034         [MediaStream iOS] Allow web process sandbox to be extended for media capture
2035         https://bugs.webkit.org/show_bug.cgi?id=168756
2036
2037         Reviewed by Brent Fulgham.
2038
2039         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Add rules to dynamically
2040         extend the sandbox to allow access to the camera and/or microphone.
2041
2042 2017-02-23  Tomas Popela  <tpopela@redhat.com>
2043
2044         [GTK] Drag and drop is always moving the content even if copy is requested
2045         https://bugs.webkit.org/show_bug.cgi?id=168424
2046
2047         Reviewed by Carlos Garcia Campos.
2048
2049         Drag and drop is always moving the content around even if the copy is
2050         requested (i.e. by pressing the Control key).
2051
2052         * UIProcess/gtk/DragAndDropHandler.cpp:
2053         (WebKit::DragAndDropHandler::drop):
2054
2055 2017-02-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2056
2057         Better handle Thread and RunLoop initialization
2058         https://bugs.webkit.org/show_bug.cgi?id=167828
2059
2060         Reviewed by Yusuke Suzuki.
2061
2062         Remove unnecessary call to WTF::initializeMainThread().
2063
2064         * Shared/WebKit2Initialize.cpp:
2065         (WebKit::InitializeWebKit2):
2066
2067 2017-02-22  Chris Dumez  <cdumez@apple.com>
2068
2069         Unreviewed, drop console logging landed by mistake as part of r212832.
2070
2071         * UIProcess/BackgroundProcessResponsivenessTimer.cpp:
2072         (WebKit::BackgroundProcessResponsivenessTimer::timerFired):
2073
2074 2017-02-22  Brent Fulgham  <bfulgham@apple.com>
2075
2076         [Mac] Tighten sandbox to deny process-info* access
2077         https://bugs.webkit.org/show_bug.cgi?id=168704
2078         <rdar://problem/16371441>
2079
2080         Reviewed by Alex Christensen.
2081
2082         Tighten the various WebKit sandboxes by denying access to process-info.
2083         Add back specific features needed to run WebKit tests and to do browsing
2084         of websites (including plugins).
2085
2086         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
2087         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2088         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2089         * WebProcess/com.apple.WebProcess.sb.in:
2090
2091 2017-02-22  Anders Carlsson  <andersca@apple.com>
2092
2093         Crash if there's a mismatch between the WebKit used by the UI process and child processes respectively
2094         https://bugs.webkit.org/show_bug.cgi?id=168739
2095         Part of rdar://problem/30631411.
2096
2097         Reviewed by Geoffrey Garen.
2098
2099         If the UI process and web process for some reason end up using different versions of the WebKit framework, weird things happen
2100         because the message format is different between versions. To avoid this, send along the WebKit bundle version from the UI process
2101         in the XPC bootstrap message, check that it matches inside the XPC main functions. If there's a mismatch, crash.
2102
2103         * Shared/Cocoa/ChildProcessCocoa.mm:
2104         (WebKit::ChildProcess::didReceiveInvalidMessage):
2105         Fix parameters.
2106
2107         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
2108         (main):
2109         Check for the bundle version and crash if it's not what we expect.
2110
2111         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2112         (WebKit::ProcessLauncher::launchProcess):
2113         Initialize the bundle version.
2114
2115         * WebProcess/cocoa/WebProcessCocoa.mm:
2116         (WebKit::_WKSetCrashReportApplicationSpecificInformation):
2117         Export this so we can call it from the XPC services without having to link WKSI.
2118
2119 2017-02-22  Chris Dumez  <cdumez@apple.com>
2120
2121         [WK2] Call processDidBecomeUnresponsive delegate when a background process is unresponsive
2122         https://bugs.webkit.org/show_bug.cgi?id=168683
2123         <rdar://problem/30558745>
2124
2125         Reviewed by Dan Bernstein.
2126
2127         Call processDidBecomeUnresponsive delegate when a background process is unresponsive
2128         instead of killing it on WebKit side. This gives the client the choice about what it
2129         wants to do about this process.
2130
2131         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2132         (API::ProcessPoolConfiguration::copy):
2133         * UIProcess/API/APIProcessPoolConfiguration.h:
2134         * UIProcess/API/C/WKContext.cpp:
2135         * UIProcess/API/C/WKContextPrivate.h:
2136         * UIProcess/BackgroundProcessResponsivenessTimer.cpp: Renamed from Source/WebKit2/UIProcess/UnresponsiveWebProcessTerminator.cpp.
2137         (WebKit::BackgroundProcessResponsivenessTimer::BackgroundProcessResponsivenessTimer):
2138         (WebKit::BackgroundProcessResponsivenessTimer::updateState):
2139         (WebKit::BackgroundProcessResponsivenessTimer::timerFired):
2140         * UIProcess/BackgroundProcessResponsivenessTimer.h: Renamed from Source/WebKit2/UIProcess/UnresponsiveWebProcessTerminator.h.
2141         * UIProcess/WebPageProxy.cpp:
2142         (WebKit::WebPageProxy::reattachToWebProcess):
2143         (WebKit::WebPageProxy::dispatchActivityStateChange):
2144         (WebKit::WebPageProxy::terminateProcess):
2145         * UIProcess/WebPageProxy.h:
2146         * UIProcess/WebProcessProxy.cpp:
2147         (WebKit::m_backgroundResponsivenessTimer):
2148         * UIProcess/WebProcessProxy.h:
2149         * WebKit2.xcodeproj/project.pbxproj:
2150
2151 2017-02-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2152
2153         NetworkProcess: Stop disabling buffering when NETWORK_CACHE is disabled in build
2154         https://bugs.webkit.org/show_bug.cgi?id=168637
2155
2156         Reviewed by Alex Christensen.
2157
2158         It was added in r193752 as part of bug #137692 to fix an infinite loop in network process that happened in EFL
2159         because they didn't enable the network cache at that time. I think that was actually a workaround, and it was
2160         added without any comment so it has stayed there even when EFL enabled disk cache, and now that is gone. Looking
2161         at current code I see no reason why buffering can't work with the disk cache disabled, so I think it's time to
2162         remove that workaround.
2163
2164         * WebProcess/Network/WebLoaderStrategy.cpp:
2165         (WebKit::maximumBufferingTime):
2166
2167 2017-02-21  Youenn Fablet  <youenn@apple.com>
2168
2169         [WebRTC][Mac] Activate libwebrtc
2170         https://bugs.webkit.org/show_bug.cgi?id=167293
2171         <rdar://problem/30401864>
2172
2173         Reviewed by Alex Christensen.
2174
2175         Activating PeerConnection runtime flag based on successful loading of libwebrtc.dylib.
2176
2177         * Configurations/WebKit.xcconfig:
2178         * Configurations/FeatureDefines.xcconfig:
2179         * Shared/WebPreferencesDefinitions.h:
2180         * UIProcess/WebPreferences.cpp:
2181         (WebKit::checkWebRTCAvailability):
2182
2183 2017-02-21  Commit Queue  <commit-queue@webkit.org>
2184
2185         Unreviewed, rolling out r212786.
2186         https://bugs.webkit.org/show_bug.cgi?id=168710
2187
2188         It broke GTK+ port when using single shared process model
2189         (Requested by KaL on #webkit).
2190
2191         Reverted changeset:
2192
2193         "Refactor WebViewImpl creation in preparation for supporting
2194         multiple WebsiteDataStores."
2195         https://bugs.webkit.org/show_bug.cgi?id=168676
2196         http://trac.webkit.org/changeset/212786
2197
2198 2017-02-21  Brady Eidson  <beidson@apple.com>
2199
2200         Refactor WebViewImpl creation in preparation for supporting multiple WebsiteDataStores.
2201         https://bugs.webkit.org/show_bug.cgi?id=168676
2202
2203         Reviewed by Alex Christensen.
2204
2205         * UIProcess/API/Cocoa/WKWebView.mm:
2206         (-[WKWebView _initializeWithConfiguration:]): Allow for WebViewImpl creation to fail.
2207
2208         * UIProcess/API/mac/WKView.mm:
2209         (-[WKView initWithFrame:processPool:configuration:]): Ditto.
2210
2211         * UIProcess/Cocoa/WebViewImpl.h:
2212         * UIProcess/Cocoa/WebViewImpl.mm:
2213         (WebKit::WebViewImpl::maybeCreate):
2214         (WebKit::WebViewImpl::WebViewImpl):
2215
2216         * UIProcess/WebPageProxy.cpp:
2217         (WebKit::WebPageProxy::reattachToWebProcess): New WebProcess creation might fail. Handle it.
2218         * UIProcess/WebProcessPool.cpp:
2219         (WebKit::WebProcessPool::createNewWebProcess):
2220         (WebKit::WebProcessPool::warmInitialProcess):
2221         (WebKit::WebProcessPool::maybeCreateNewWebProcessRespectingProcessCountLimit): This can now fail
2222           if the process will have a non-default WebsiteDataStore but we've already reached the process cap.
2223         (WebKit::WebProcessPool::createWebPage):
2224         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit): Deleted.
2225         * UIProcess/WebProcessPool.h:
2226
2227 2017-02-21  Youenn Fablet  <youenn@apple.com>
2228
2229         [WebRTC] WebKit2 should assert that libwebrtc transmitted IP addresses family is IP4 or IP6
2230         https://bugs.webkit.org/show_bug.cgi?id=168691
2231
2232         Reviewed by Alex Christensen.
2233
2234         Adding some asserts that family is IPv4 or IPv6.
2235
2236         * Shared/RTCNetwork.cpp:
2237         (WebKit::RTCNetwork::IPAddress::decode):
2238         (WebKit::RTCNetwork::IPAddress::encode):
2239
2240 2017-02-20  Simon Fraser  <simon.fraser@apple.com>
2241
2242         Add support to PlatformCALayer/GraphicsLayerCA for subpixel-antialiased text, with a Setting and a MiniBrowser switch
2243         https://bugs.webkit.org/show_bug.cgi?id=168620
2244         <rdar://problem/30617772>
2245
2246         Reviewed by Tim Horton.
2247
2248         Add a Setting for subpixel-antialiased layer text. Plumb this through GraphicsLayerCA and
2249         PlatformCALayer, where it ultimately affects the layer contents format.
2250         
2251         This is not supported with UI-side compositing.
2252
2253         * Shared/WebPreferencesDefinitions.h:
2254         * UIProcess/API/C/WKPreferences.cpp:
2255         (WKPreferencesSetSubpixelAntialiasedLayerTextEnabled):
2256         (WKPreferencesGetSubpixelAntialiasedLayerTextEnabled):
2257         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2258         * UIProcess/API/Cocoa/WKPreferences.mm:
2259         (-[WKPreferences _subpixelAntialiasedLayerTextEnabled]):
2260         (-[WKPreferences _setSubpixelAntialiasedLayerTextEnabled:]):
2261         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2262         * WebProcess/WebPage/WebPage.cpp:
2263         (WebKit::WebPage::updatePreferences):
2264         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2265         (WebKit::PlatformCALayerRemote::supportsSubpixelAntialiasedText):
2266         (WebKit::PlatformCALayerRemote::setSupportsSubpixelAntialiasedText):
2267         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2268         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
2269         (WebKit::PlatformCALayerRemoteTiledBacking::supportsSubpixelAntialiasedText):
2270         (WebKit::PlatformCALayerRemoteTiledBacking::setSupportsSubpixelAntialiasedText):
2271         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
2272
2273 2017-02-21  John Wilander  <wilander@apple.com>
2274
2275         Resource Load Statistics: Only scan website data store once per session ID + reinstate removal counting
2276         https://bugs.webkit.org/show_bug.cgi?id=168541
2277
2278         Reviewed by Alex Christensen.
2279
2280         * UIProcess/WebProcessProxy.cpp:
2281         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyOwnedDomainsInAllPersistentDataStores):
2282             The CallbackAggregator now merges a list of domains for which we
2283             have removed data records and eventually reports this back to the
2284             caller.
2285         * UIProcess/WebProcessProxy.h:
2286         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2287         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
2288             Now reports back to its WebCore::ResourceLoadStatisticsStore
2289             which domains have had data records removed.
2290         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2291         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyOwnedDomains):
2292             The completion handler now handles data record removal counting.
2293         (WebKit::WebsiteDataStore::removeDataForTopPrivatelyOwnedDomains):
2294             The completion handler now handles data record removal counting.
2295         * UIProcess/WebsiteData/WebsiteDataStore.h:
2296
2297 2017-02-21  Alex Christensen  <achristensen@webkit.org>
2298
2299         Fix CMake build.
2300
2301         * PlatformMac.cmake:
2302
2303 2017-02-21  Youenn Fablet  <youenn@apple.com>
2304
2305         [WebRTC][Mac] Network process sandbox does not allow WebRTC networking
2306         https://bugs.webkit.org/show_bug.cgi?id=168594
2307
2308         Reviewed by Brent Fulgham.
2309
2310         UIProcess was passing a boolean to know whether WebRTC networking is allowed or not to the network process.
2311         This boolean was known to late for the sandbox to be relaxed.
2312         A sandbox extension is now used instead to relax the sandbox.
2313
2314         * NetworkProcess/NetworkProcess.h:
2315         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2316         (WebKit::NetworkProcessCreationParameters::encode):
2317         (WebKit::NetworkProcessCreationParameters::decode):
2318         * NetworkProcess/NetworkProcessCreationParameters.h:
2319         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2320         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2321         * NetworkProcess/mac/NetworkProcessMac.mm:
2322         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
2323         (WebKit::NetworkProcess::initializeSandbox):
2324         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2325         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2326         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2327
2328 2017-02-21  Youenn Fablet  <youenn@apple.com>
2329
2330         [WebRTC] ICE candidates should be filtered according a policy
2331         https://bugs.webkit.org/show_bug.cgi?id=168348
2332
2333         Reviewed by Alex Christensen.
2334
2335         Adding the possibility for the UI process to control the ICE candidate filtering and whether libwebrtc can
2336         enumerate all interfaces or not.
2337
2338         Disabling ICE candidate filtering for the moment.
2339         Enabling to enumerate all interfaces for the moment.
2340
2341         In the future, ICE candidate filtering should be tied to getUserMedia.
2342         Interface enumeration should be disabled with the default configuration.
2343         We should do that once we have sufficient testing in various network infrastructures.
2344
2345         * UIProcess/WebPageProxy.cpp:
2346         (WebKit::WebPageProxy::initializeWebPage):
2347         * WebKit2.xcodeproj/project.pbxproj:
2348         * WebProcess/WebPage/WebPage.h:
2349         (WebKit::WebPage::disableICECandidateFiltering):
2350         (WebKit::WebPage::enableICECandidateFiltering):
2351         (WebKit::WebPage::disableEnumeratingAllNetworkInterfaces):
2352         (WebKit::WebPage::enableEnumeratingAllNetworkInterfaces):
2353         * WebProcess/WebPage/WebPage.messages.in:
2354
2355 2017-02-21  Youenn Fablet  <youenn@apple.com>
2356
2357         [WebRTC] NetworkRTCMonitor should ensure clearing its manager only once
2358         https://bugs.webkit.org/show_bug.cgi?id=168661
2359
2360         Reviewed by Alex Christensen.
2361
2362         Making sure NetworkRTCMonitor manager is cleared only once.
2363         ALso ensuring that manager does not get destroyed as part of NetworkRTCMonitor destructor.
2364         The manager needs to be destroyed in the RTC network thread.
2365
2366         * NetworkProcess/webrtc/NetworkRTCMonitor.cpp:
2367         (WebKit::NetworkRTCMonitor::~NetworkRTCMonitor):
2368         (WebKit::NetworkRTCMonitor::stopUpdating):
2369         * NetworkProcess/webrtc/NetworkRTCMonitor.h:
2370
2371 2017-02-21  Brent Fulgham  <bfulgham@apple.com>
2372
2373         [WebRTC][Mac][WebKit2] Revise sandbox to limit connections to UDP and TCP
2374         https://bugs.webkit.org/show_bug.cgi?id=168664
2375         <rdar://problem/30600587>
2376
2377         Reviewed by Youenn Fablet.
2378
2379         Add filters to the WebRTC rule to limit network traffic to UDP and TCP.
2380
2381         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2382
2383 2017-02-21  Maureen Daum  <mdaum@apple.com>
2384
2385         Check what LocalStorage data exists in deleteDatabasesModifiedSince() before attempting deletion.
2386         https://bugs.webkit.org/show_bug.cgi?id=168659
2387         rdar://problem/22781730
2388
2389         Reviewed by Brady Eidson.
2390
2391         Check what LocalStorage data exists in deleteDatabasesModifiedSince() before attempting deletion.
2392         It is possible that another process has caused information to be added to LocalStorage
2393         after we created this LocalStorageDatabaseTracker instance, so we should update our
2394         internal state by checking the contents of StorageTracker.db and the other local
2395         storage files so we know what databases actually exist. By calling importOriginIdentifiers()
2396         at the start of deleteDatabasesModifiedSince(), m_origins will now have the up-to-date
2397         list of origins LocalStorage contains data for.
2398
2399         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
2400         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
2401
2402 2017-02-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2403
2404         Reduce platform ifdefs in WebKit2 custom protocols implementation
2405         https://bugs.webkit.org/show_bug.cgi?id=165028
2406
2407         Reviewed by Darin Adler.
2408
2409         Make mac implementation use the APICustomProtocolManagerClient to share more code with the soup based ports.
2410
2411         * CMakeLists.txt: Add CustomProtocolManagerProxy.cpp.
2412         * PlatformEfl.cmake: Remove CustomProtocolManagerProxySoup.cpp.
2413         * PlatformGTK.cmake: Ditto.
2414         * PlatformMac.cmake: Remove CustomProtocolManagerProxyMac.mm.
2415         * UIProcess/API/APICustomProtocolManagerClient.h:
2416         (API::CustomProtocolManagerClient::startLoading): Make it void, since we were always returning true and the
2417         returned value was ignored.
2418         * UIProcess/API/efl/ewk_url_scheme_request.cpp:
2419         (EwkUrlSchemeRequest::finish): Update to new CustomProtocolManagerProxy API.
2420         * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp:
2421         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
2422         (webkitURISchemeRequestReadCallback): Ditto.
2423         * UIProcess/Cocoa/CustomProtocolManagerClient.h: Added.
2424         * UIProcess/Cocoa/CustomProtocolManagerClient.mm: Added.
2425         (-[WKCustomProtocolLoader initWithCustomProtocolManagerProxy:customProtocolID:request:]):
2426         (-[WKCustomProtocolLoader dealloc]):
2427         (-[WKCustomProtocolLoader connection:didFailWithError:]):
2428         (-[WKCustomProtocolLoader connection:didReceiveResponse:]):
2429         (-[WKCustomProtocolLoader connection:didReceiveData:]):
2430         (-[WKCustomProtocolLoader connection:willSendRequest:redirectResponse:]):
2431         (-[WKCustomProtocolLoader connectionDidFinishLoading:]):
2432         (WebKit::CustomProtocolManagerClient::startLoading):
2433         (WebKit::CustomProtocolManagerClient::stopLoading):
2434         (WebKit::CustomProtocolManagerClient::invalidate):
2435         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2436         (WebKit::WebProcessPool::platformInitialize): Set the CustomProtocolManagerClient.
2437         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Remove code that is now shared.
2438         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.cpp: Added.
2439         (WebKit::CustomProtocolManagerProxy::startLoading):
2440         (WebKit::CustomProtocolManagerProxy::processDidClose):
2441         (WebKit::CustomProtocolManagerProxy::wasRedirectedToRequest):
2442         (WebKit::CustomProtocolManagerProxy::didReceiveResponse):
2443         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
2444         * UIProcess/WebProcessPool.cpp:
2445         (WebKit::globalURLSchemesWithCustomProtocolHandlers): Just moved here to use it from ensureNetworkProcess().
2446         (WebKit::WebProcessPool::WebProcessPool): Remove soup ifdefs.
2447         (WebKit::WebProcessPool::setCustomProtocolManagerClient): Moved from the soup implementation.
2448         (WebKit::WebProcessPool::ensureNetworkProcess): Initialize custom protocols parameters.
2449         (WebKit::WebProcessPool::registerSchemeForCustomProtocol): Register the protocol if not already registered globally.
2450         (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): Remove soup ifdefs.
2451         * UIProcess/WebProcessPool.h: Remove soup ifdefs.
2452         * UIProcess/efl/RequestManagerClientEfl.cpp:
2453         * UIProcess/soup/WebProcessPoolSoup.cpp:
2454         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Remove code that is now shared.
2455         * WebKit2.xcodeproj/project.pbxproj:
2456
2457 2017-02-21  Daewoong Jang  <daewoong.jang@navercorp.com>
2458
2459         Remove unused files.
2460         https://bugs.webkit.org/show_bug.cgi?id=168656.
2461
2462         Reviewed by Csaba Osztrogonác.
2463
2464         Remove files which became unused after removal of EFL port.
2465
2466         * UIProcess/CoordinatedGraphics/PageViewportController.cpp: Removed.
2467         * UIProcess/CoordinatedGraphics/PageViewportController.h: Removed.
2468         * UIProcess/PageViewportControllerClient.h: Removed.
2469
2470 2017-02-21  Youenn Fablet  <youenn@apple.com>
2471
2472         [WebRTC] LibWebRTCSocket::SendTo message should have a correct SocketAddress
2473         https://bugs.webkit.org/show_bug.cgi?id=168636
2474
2475         Reviewed by Eric Carlson.
2476
2477         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
2478         (WebKit::LibWebRTCSocket::SendTo): Ensuring address remains valid during SendTo message lifetime.
2479
2480 2017-02-21  Alex Christensen  <achristensen@webkit.org>
2481
2482         Unreviewed, rolling out r212699.
2483
2484         Internal build not ready
2485
2486         Reverted changeset:
2487
2488         "[WebRTC][Mac] Activate libwebrtc"
2489         https://bugs.webkit.org/show_bug.cgi?id=167293
2490         http://trac.webkit.org/changeset/212699
2491
2492 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2493
2494         Remove ENABLE_THREADED_COMPOSITOR build option
2495         https://bugs.webkit.org/show_bug.cgi?id=168606
2496
2497         Reviewed by Michael Catanzaro.
2498
2499         Now that we have AC mode on demand with the threaded compositor there's no reason to keep the old AC code.
2500
2501         * PlatformGTK.cmake:
2502         * WebProcess/WebPage/LayerTreeHost.cpp:
2503         (WebKit::LayerTreeHost::create):
2504         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: Removed.
2505         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h: Removed.
2506
2507 2017-02-20  Youenn Fablet  <youenn@apple.com>
2508
2509         [WebRTC][Mac] Activate libwebrtc
2510         https://bugs.webkit.org/show_bug.cgi?id=167293
2511         <rdar://problem/30401864>
2512
2513         Reviewed by Alex Christensen.
2514
2515         Activating PeerConnection runtime flag based on successful loading of libwebrtc.dylib.
2516
2517         * Configurations/WebKit.xcconfig:
2518         * Shared/WebPreferencesDefinitions.h:
2519         * UIProcess/WebPreferences.cpp:
2520         (WebKit::checkWebRTCAvailability):
2521
2522 2017-02-20  Ryan Haddad  <ryanhaddad@apple.com>
2523
2524         Unreviewed, rolling out r212685.
2525
2526         This change broke the 32-bit Sierra build.
2527
2528         Reverted changeset:
2529
2530         "Resource Load Statistics: Add alternate classification
2531         method"
2532         https://bugs.webkit.org/show_bug.cgi?id=168347
2533         http://trac.webkit.org/changeset/212685
2534
2535 2017-02-20  John Wilander  <wilander@apple.com>
2536
2537         Resource Load Statistics: Add alternate classification method
2538         https://bugs.webkit.org/show_bug.cgi?id=168347
2539         <rdar://problem/30352793>
2540
2541         Reviewed by Alex Christensen.
2542
2543         This patch adds a CorePrediction-based classifier to the WebResourceLoadStatisticsStore.
2544         The CorePrediction framework is introduced as a dependency for macOS and iOS. The patch
2545         also adds functions to support layout tests of the feature.
2546
2547         * Configurations/BaseTarget.xcconfig:
2548         * Configurations/WebKit.xcconfig:
2549             Added dependency on CorePrediction.
2550         * Platform/classifier: Added.
2551         * Platform/classifier/ResourceLoadStatisticsClassifier.h: Added.
2552             Pulls in the Cocoa-specific classifier for Cocoa-based platforms.
2553         (WebKit::ResourceLoadStatisticsClassifier::ResourceLoadStatisticsClassifier):
2554         * Platform/classifier/ResourceLoadStatisticsClassifierBase.cpp: Added.
2555         (WebKit::ResourceLoadStatisticsClassifierBase::hasPrevalentResourceCharacteristics):
2556             Shared classifier logic.
2557         (WebKit::ResourceLoadStatisticsClassifierBase::classifyWithVectorThreshold):
2558             Fallback classifier for when we don't have CorePrediction.
2559         * Platform/classifier/ResourceLoadStatisticsClassifierBase.h: Added.
2560         (WebKit::ResourceLoadStatisticsClassifierBase::ResourceLoadStatisticsClassifierBase):
2561         (WebKit::ResourceLoadStatisticsClassifierBase::~ResourceLoadStatisticsClassifierBase):
2562         * Platform/classifier/cocoa: Added.
2563         * Platform/classifier/cocoa/CorePredictionSPI.h: Added.
2564             Includes CorePrediction if available, otherwise declares needed symbols.
2565             Always redeclares the functions so we'll get a build error if
2566             CorePrediction changes.
2567         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: Added.
2568         (WebKit::ResourceLoadStatisticsClassifier::classify):
2569         (WebKit::ResourceLoadStatisticsClassifier::storagePath):
2570         (WebKit::ResourceLoadStatisticsClassifier::shouldUseCorePrediction):
2571             The new classifier for Cocoa platforms.
2572         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h: Added.
2573         (WebKit::ResourceLoadStatisticsClassifier::ResourceLoadStatisticsClassifier):
2574         * PlatformGTK.cmake:
2575            Added Platform/classifier directory and ResourceLoadStatisticsClassifierBase.cpp.
2576         * PlatformMac.cmake:
2577            Added Platform/classifier and Platform/classifier/cocoa directories, and
2578            source files ResourceLoadStatisticsClassifierBase.cpp and
2579            ResourceLoadStatisticsClassifierCocoa.cpp
2580         * Resources/ResourceLoadStatistics: Added.
2581         * Resources/ResourceLoadStatistics/corePrediction_model: Added.
2582             Model file to load into CorePrediction.
2583         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
2584         (WKResourceLoadStatisticsManagerSetSubframeUnderTopFrameOrigin):
2585         (WKResourceLoadStatisticsManagerSetSubresourceUnderTopFrameOrigin):
2586         (WKResourceLoadStatisticsManagerSetSubresourceUniqueRedirectTo):
2587             Test infrastructure.
2588         * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
2589         * UIProcess/WebResourceLoadStatisticsManager.cpp:
2590         (WebKit::WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin):
2591         (WebKit::WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin):
2592         (WebKit::WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo):
2593             Test infrastructure.
2594         * UIProcess/WebResourceLoadStatisticsManager.h:
2595         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2596         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2597             Renamed m_storagePath to m_statisticsStoragePath for clarity.
2598         (WebKit::WebResourceLoadStatisticsStore::classifyResource):
2599             Now calls the classifier through its ResourceLoadStatisticsClassifier
2600             member variable.
2601         (WebKit::WebResourceLoadStatisticsStore::persistentStoragePath):
2602             Renamed m_storagePath to m_statisticsStoragePath for clarity.
2603         (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
2604             Renamed m_storagePath to m_statisticsStoragePath for clarity.
2605         (WebKit::WebResourceLoadStatisticsStore::hasPrevalentResourceCharacteristics): Deleted.
2606         * UIProcess/WebResourceLoadStatisticsStore.h:
2607         * WebKit2.xcodeproj/project.pbxproj:
2608             Added the new classifier source files under Platform/classifier and the
2609             corePrediction_model file under Resources/ResourceLoadStatistics.
2610
2611 2017-02-20  Wenson Hsieh  <wenson_hsieh@apple.com>
2612
2613         Add plumbing to the UI process for TextIndicatorData when computing the drag image
2614         https://bugs.webkit.org/show_bug.cgi?id=168583
2615         Work towards <rdar://problem/30313681>
2616
2617         Reviewed by Tim Horton.
2618
2619         Changes the SetDragImage IPC message to send TextIndicatorData over to the UI process. Also changes the boolean
2620         isLink parameter to be a DragSourceAction instead, leaving it up to the receiving end (in the UI process) to
2621         special case links.
2622
2623         Additionally, renames hasDataInteractionAtPosition to hasSelectionAtPosition to better reflect its purpose.
2624
2625         These changes are only infrastructural should not alter any behaviors.
2626
2627         * Shared/ios/InteractionInformationAtPosition.h:
2628         * Shared/ios/InteractionInformationAtPosition.mm:
2629         (WebKit::InteractionInformationAtPosition::encode):
2630         (WebKit::InteractionInformationAtPosition::decode):
2631         * UIProcess/API/Cocoa/WKWebView.mm:
2632         (-[WKWebView _simulateDataInteractionGestureRecognized]):
2633         (-[WKWebView _simulateDataInteractionEntered:]):
2634         (-[WKWebView _simulateDataInteractionUpdated:]):
2635         (-[WKWebView _simulateDataInteractionPerformOperation:]):
2636         (-[WKWebView _simulateDataInteractionEnded:]):
2637         (-[WKWebView _simulateDataInteractionSessionDidEnd:withOperation:]):
2638         (-[WKWebView _simulateFailedDataInteractionWithIndex:]):
2639         (-[WKWebView _simulateWillBeginDataInteractionWithIndex:withSession:]):
2640         (-[WKWebView _simulatedItemsForDataInteractionWithIndex:]):
2641         * UIProcess/API/Cocoa/_WKTestingDelegate.h:
2642         * UIProcess/PageClient.h:
2643         * UIProcess/WebPageProxy.h:
2644         * UIProcess/WebPageProxy.messages.in:
2645         * UIProcess/ios/PageClientImplIOS.h:
2646         * UIProcess/ios/PageClientImplIOS.mm:
2647         (WebKit::PageClientImpl::setDragImage):
2648         (WebKit::PageClientImpl::startDataInteractionWithImage):
2649         * UIProcess/ios/WKContentViewInteraction.h:
2650         * UIProcess/ios/WKContentViewInteraction.mm:
2651         (-[WKContentView hasSelectablePositionAtPoint:]):
2652         (-[WKContentView pointIsInDataInteractionContent:]):
2653         (-[WKContentView _dataInteractionGestureRecognizer]):
2654         (-[WKContentView pointIsInAssistedNode:]):
2655         * UIProcess/mac/PageClientImpl.h:
2656         * UIProcess/mac/PageClientImpl.mm:
2657         (WebKit::PageClientImpl::setDragImage):
2658         * UIProcess/mac/WebPageProxyMac.mm:
2659         (WebKit::WebPageProxy::setDragImage):
2660         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2661         (WebKit::WebDragClient::startDrag):
2662         * WebProcess/WebPage/ios/WebPageIOS.mm:
2663         (WebKit::WebPage::getPositionInformation):
2664
2665 2017-02-20  David Quesada  <david_quesada@apple.com>
2666
2667         Don’t set NSURLSessionConfiguration’s _sourceApplicationAuditTokenData if _sourceApplicationBundleIdentifier is also set.
2668         https://bugs.webkit.org/show_bug.cgi?id=168607
2669
2670         rdar://problem/30239618
2671
2672         Reviewed by Geoffrey Garen.
2673
2674         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2675         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2676         If the process pool configuration sets a source application bundle identifier, don't give the NSURLSession configuration
2677         the audit token from the UI process, as it may be associated with an application with a conflicting bundle identifier.
2678
2679 2017-02-20  Ryan Haddad  <ryanhaddad@apple.com>
2680
2681         Unreviewed, rolling out r212632.
2682
2683         This change appears to have caused API test failures.
2684
2685         Reverted changeset:
2686
2687         "Reduce platform ifdefs in WebKit2 custom protocols
2688         implementation"
2689         https://bugs.webkit.org/show_bug.cgi?id=165028
2690         http://trac.webkit.org/changeset/212632
2691
2692 2017-02-20  Youenn Fablet  <youenn@apple.com>
2693
2694         [WebRTC] Fix some memory leaks in libwebrtc binding code
2695         https://bugs.webkit.org/show_bug.cgi?id=168596
2696
2697         Reviewed by Eric Carlson.
2698
2699         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
2700         (WebKit::NetworkRTCProvider::OnMessage):
2701
2702 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2703
2704         Remove code under USE(GRAPHICS_SURFACE)
2705         https://bugs.webkit.org/show_bug.cgi?id=168592
2706
2707         Reviewed by Michael Catanzaro.
2708
2709         This was only used by EFL port.
2710
2711         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
2712         (IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::encode):
2713         (IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::decode):
2714         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h:
2715         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2716         (WebKit::CoordinatedGraphicsScene::syncPlatformLayerIfNeeded):
2717         (WebKit::CoordinatedGraphicsScene::deleteLayer):
2718         (WebKit::CoordinatedGraphicsScene::assignImageBackingToLayer):
2719         (WebKit::CoordinatedGraphicsScene::purgeGLResources):
2720         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
2721         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:
2722         (WebKit::WebCoordinatedSurface::Handle::encode):
2723         (WebKit::WebCoordinatedSurface::Handle::decode):
2724         (WebKit::WebCoordinatedSurface::create):
2725         (WebKit::WebCoordinatedSurface::createGraphicsContext):
2726         (WebKit::WebCoordinatedSurface::createHandle):
2727         (WebKit::WebCoordinatedSurface::copyToTexture):
2728         * Shared/CoordinatedGraphics/WebCoordinatedSurface.h:
2729
2730 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2731
2732         Reduce platform ifdefs in WebKit2 custom protocols implementation
2733         https://bugs.webkit.org/show_bug.cgi?id=165028
2734
2735         Reviewed by Darin Adler.
2736
2737         Make mac implementation use the APICustomProtocolManagerClient to share more code with the soup based ports.
2738
2739         * CMakeLists.txt: Add CustomProtocolManagerProxy.cpp.
2740         * PlatformEfl.cmake: Remove CustomProtocolManagerProxySoup.cpp.
2741         * PlatformGTK.cmake: Ditto.
2742         * PlatformMac.cmake: Remove CustomProtocolManagerProxyMac.mm.
2743         * UIProcess/API/APICustomProtocolManagerClient.h:
2744         (API::CustomProtocolManagerClient::startLoading): Make it void, since we were always returning true and the
2745         returned value was ignored.
2746         * UIProcess/API/efl/ewk_url_scheme_request.cpp:
2747         (EwkUrlSchemeRequest::finish): Update to new CustomProtocolManagerProxy API.
2748         * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp:
2749         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
2750         (webkitURISchemeRequestReadCallback): Ditto.
2751         * UIProcess/Cocoa/CustomProtocolManagerClient.h: Added.
2752         * UIProcess/Cocoa/CustomProtocolManagerClient.mm: Added.
2753         (-[WKCustomProtocolLoader initWithCustomProtocolManagerProxy:customProtocolID:request:]):
2754         (-[WKCustomProtocolLoader dealloc]):
2755         (-[WKCustomProtocolLoader connection:didFailWithError:]):
2756         (-[WKCustomProtocolLoader connection:didReceiveResponse:]):
2757         (-[WKCustomProtocolLoader connection:didReceiveData:]):
2758         (-[WKCustomProtocolLoader connection:willSendRequest:redirectResponse:]):
2759         (-[WKCustomProtocolLoader connectionDidFinishLoading:]):
2760         (WebKit::CustomProtocolManagerClient::startLoading):
2761         (WebKit::CustomProtocolManagerClient::stopLoading):
2762         (WebKit::CustomProtocolManagerClient::invalidate):
2763         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2764         (WebKit::WebProcessPool::platformInitialize): Set the CustomProtocolManagerClient.
2765         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Remove code that is now shared.
2766         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.cpp: Added.
2767         (WebKit::CustomProtocolManagerProxy::startLoading):
2768         (WebKit::CustomProtocolManagerProxy::processDidClose):
2769         (WebKit::CustomProtocolManagerProxy::wasRedirectedToRequest):
2770         (WebKit::CustomProtocolManagerProxy::didReceiveResponse):
2771         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
2772         * UIProcess/WebProcessPool.cpp:
2773         (WebKit::globalURLSchemesWithCustomProtocolHandlers): Just moved here to use it from ensureNetworkProcess().
2774         (WebKit::WebProcessPool::WebProcessPool): Remove soup ifdefs.
2775         (WebKit::WebProcessPool::setCustomProtocolManagerClient): Moved from the soup implementation.
2776         (WebKit::WebProcessPool::ensureNetworkProcess): Initialize custom protocols parameters.
2777         (WebKit::WebProcessPool::registerSchemeForCustomProtocol): Register the protocol if not already registered globally.
2778         (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): Remove soup ifdefs.
2779         * UIProcess/WebProcessPool.h: Remove soup ifdefs.
2780         * UIProcess/efl/RequestManagerClientEfl.cpp:
2781         * UIProcess/soup/WebProcessPoolSoup.cpp:
2782         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Remove code that is now shared.
2783         * WebKit2.xcodeproj/project.pbxproj:
2784
2785 2017-02-20  Manuel Rego Casasnovas  <rego@igalia.com>
2786
2787         [css-grid] Remove compilation flag ENABLE_CSS_GRID_LAYOUT
2788         https://bugs.webkit.org/show_bug.cgi?id=167693
2789
2790         Reviewed by Sergio Villar Senin.
2791
2792         * Configurations/FeatureDefines.xcconfig:
2793         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2794         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2795         * WebProcess/WebPage/WebPage.cpp:
2796         (WebKit::WebPage::updatePreferences):
2797
2798 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2799
2800         REGRESSION(r212345): [GTK] ASSERT(cookieChangeCallbackMap().contains(jar)) failed in WebCore::stopObservingCookieChanges:54
2801         https://bugs.webkit.org/show_bug.cgi?id=168375
2802
2803         Reviewed by Alex Christensen.
2804
2805         Simplify the cookies change notification. The current approach of the UI process telling the network process
2806         when to start and stop observing cookie changes is quite fragile and error prone. In the GTK+ port we always
2807         observe cookies, so our cookie manager always calls start in the constructor and stop in the destructor.
2808         Everything would be a lot simpler if the network process always monitored cookies.
2809
2810         * NetworkProcess/soup/NetworkSessionSoup.cpp:
2811         (WebKit::NetworkSessionSoup::NetworkSessionSoup): Set cookies observer handler for the session.
2812         (WebKit::NetworkSessionSoup::~NetworkSessionSoup): Remove the cookies observer handler.
2813         * UIProcess/API/gtk/WebKitCookieManager.cpp:
2814         (_WebKitCookieManagerPrivate::~_WebKitCookieManagerPrivate): Remove the cookies observer callback.
2815         (webkit_cookie_manager_class_init): Remove dispose implementation that is no longer needed.
2816         (webkitCookieManagerCreate): Set the cookies observer callback.
2817         (webkit_cookie_manager_set_persistent_storage): Remove code to start/stop observing cookies when the jar
2818         changes, the network process deals with that now.
2819         (webkitCookieManagerDispose): Deleted.
2820         * UIProcess/WebCookieManagerProxy.cpp:
2821         (WebKit::WebCookieManagerProxy::startObservingCookieChanges): Remove the optional callback method in favor of an
2822         explicit method to the set the callback that doesn't send the StartObservingCookieChanges message to the network
2823         process.
2824         (WebKit::WebCookieManagerProxy::stopObservingCookieChanges): Do not change the callback map here.
2825         (WebKit::WebCookieManagerProxy::setCookieObserverCallback): Add the callback to the map or remove the session if
2826         nullptr is given.
2827         * UIProcess/WebCookieManagerProxy.h:
2828         * WebProcess/Cookies/WebCookieManager.cpp:
2829         (WebKit::WebCookieManager::notifyCookiesDidChange): Send CookiesDidChange message to the UI process.
2830         (WebKit::WebCookieManager::startObservingCookieChanges): Use notifyCookiesDidChange().
2831         * WebProcess/Cookies/WebCookieManager.h:
2832         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
2833         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy): Set the policy on all sessions. Code moved from
2834         WebFrameNetworkingContext since it doesn't belong there.
2835         (WebKit::WebCookieManager::setCookiePersistentStorage): Use new method to set the cookie storage in the
2836         NetworkStorageSession.
2837         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
2838         (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts): Deleted.
2839         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
2840
2841 2017-02-19  Chris Dumez  <cdumez@apple.com>
2842
2843         [WK2] Support termination of unresponsive WebContent processes that are in the background
2844         https://bugs.webkit.org/show_bug.cgi?id=168479
2845         <rdar://problem/30558745>
2846
2847         Reviewed by Antti Koivisto.
2848
2849         Support termination of unresponsive WebContent processes that are in the background.
2850         This protects us against cases where a background tab is unresponsive and has high CPU
2851         usage, thus draining the battery without the user knowing about it (e.g.
2852         <rdar://problem/29808005>).
2853
2854         The feature works as follows:
2855         - If a WebProcessProxy has pages but none of them are visible, then it will check
2856           regularly if its associated WebContent process is still responsive.
2857         - Every time we find that the WebContent process is responsive, we exponentially
2858           back off the timer to avoid waking up the process too often. The timer initially
2859           uses a 20 seconds interval and can back off up to 8 hours.
2860         - If the WebContent process is unresponsive, then we terminate it. No notification
2861           is shown to the user and the termination is not immediately observable since the
2862           tab is not visible and its title remains. The tab is not immediately reloaded
2863           so as to avoid getting back into a bad state in the background (and have a
2864           yo-yo effect).
2865         - If the user switches to a tab that was previously killed for being unresponsive
2866           while in the background, we will then reload the tab in a fresh WebContent
2867           process. The crash banner will only be shown if the tab has ever been visible.
2868           If it wasn't ever visible (e.g. session restore case), then it will look as if
2869           the tab loads for the first time when the user switches to it.
2870
2871         The functionality is disabled by default and can be enabled by the client via the new
2872         WKContextSetUnresponsiveBackgroundProcessesTerminationEnabled() private API.
2873
2874         * CMakeLists.txt:
2875         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2876         (API::ProcessPoolConfiguration::copy):
2877         * UIProcess/API/APIProcessPoolConfiguration.h:
2878         * UIProcess/API/C/WKContext.cpp:
2879         (WKContextSetUnresponsiveBackgroundProcessesTerminationEnabled):
2880         * UIProcess/API/C/WKContextPrivate.h:
2881         * UIProcess/UnresponsiveWebProcessTerminator.cpp: Added.
2882         (WebKit::UnresponsiveWebProcessTerminator::UnresponsiveWebProcessTerminator):
2883         (WebKit::UnresponsiveWebProcessTerminator::updateState):
2884         (WebKit::pagesCopy):
2885         (WebKit::UnresponsiveWebProcessTerminator::timerFired):
2886         * UIProcess/UnresponsiveWebProcessTerminator.h: Added.
2887         (WebKit::UnresponsiveWebProcessTerminator::shouldBeActive):
2888         * UIProcess/WebPageProxy.cpp:
2889         (WebKit::WebPageProxy::reattachToWebProcess):
2890         (WebKit::WebPageProxy::reloadAfterBeingKilledInBackground):
2891         (WebKit::WebPageProxy::dispatchActivityStateChange):
2892         (WebKit::WebPageProxy::terminateProcess):
2893         (WebKit::WebPageProxy::resetStateAfterProcessExited):
2894         * UIProcess/WebPageProxy.h:
2895         * UIProcess/WebProcessProxy.cpp:
2896         (WebKit::WebProcessProxy::WebProcessProxy):
2897         (WebKit::m_backgroundResponsivenessTimer):
2898         (WebKit::WebProcessProxy::createWebPage):
2899         (WebKit::WebProcessProxy::addExistingWebPage):
2900         (WebKit::WebProcessProxy::removeWebPage):
2901         (WebKit::WebProcessProxy::updateBackgroundResponsivenessTimer):
2902         * UIProcess/WebProcessProxy.h:
2903         (WebKit::WebProcessProxy::visiblePageCount):
2904         * WebKit2.xcodeproj/project.pbxproj:
2905
2906 2017-02-18  Michael Catanzaro  <mcatanzaro@igalia.com>
2907
2908         Remove COORDINATED_GRAPHICS_MULTIPROCESS
2909         https://bugs.webkit.org/show_bug.cgi?id=168514
2910
2911         Reviewed by Darin Adler.
2912
2913         * Shared/DrawingAreaInfo.h:
2914         * UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
2915         (WKViewFindZoomableAreaForRect):
2916         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
2917         (WebKit::AcceleratedDrawingAreaProxy::AcceleratedDrawingAreaProxy):
2918         * UIProcess/AcceleratedDrawingAreaProxy.h:
2919         (WebKit::AcceleratedDrawingAreaProxy::coordinatedLayerTreeHostProxy): Deleted.
2920         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp: Removed.
2921         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h: Removed.
2922         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in: Removed.
2923         * UIProcess/CoordinatedGraphics/PageViewportController.cpp:
2924         (WebKit::PageViewportController::pageTransitionViewportReady):
2925         * UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp: Removed.
2926         * UIProcess/DrawingAreaProxy.h:
2927         * UIProcess/PageClient.h:
2928         * UIProcess/WebPageProxy.cpp:
2929         (WebKit::WebPageProxy::pageDidRequestScroll): Deleted.
2930         (WebKit::WebPageProxy::pageTransitionViewportReady): Deleted.
2931         (WebKit::WebPageProxy::didRenderFrame): Deleted.
2932         (WebKit::WebPageProxy::commitPageTransitionViewport): Deleted.
2933         * UIProcess/WebPageProxy.h:
2934         * UIProcess/WebPageProxy.messages.in:
2935         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2936         (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea):
2937         (WebKit::AcceleratedDrawingArea::updateBackingStoreState):
2938         (WebKit::AcceleratedDrawingArea::didReceiveCoordinatedLayerTreeHostMessage): Deleted.
2939         * WebProcess/WebPage/AcceleratedDrawingArea.h:
2940         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2941         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
2942         (WebKit::CoordinatedLayerTreeHost::commitSceneState):
2943         (WebKit::CoordinatedLayerTreeHost::createCoordinatedSurface):
2944         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
2945         * WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp: Removed.
2946         * WebProcess/WebPage/DrawingArea.cpp:
2947         (WebKit::DrawingArea::create):
2948         * WebProcess/WebPage/DrawingArea.h:
2949         * WebProcess/WebPage/LayerTreeHost.cpp:
2950         (WebKit::LayerTreeHost::create):
2951         * WebProcess/WebPage/LayerTreeHost.h:
2952         * WebProcess/WebPage/WebPage.cpp:
2953         (WebKit::WebPage::~WebPage):
2954         (WebKit::WebPage::pageDidRequestScroll):
2955         (WebKit::WebPage::didCompletePageTransition):
2956         (WebKit::WebPage::didReceiveMessage):
2957         (WebKit::WebPage::commitPageTransitionViewport): Deleted.
2958         * WebProcess/WebPage/WebPage.h:
2959         * WebProcess/WebPage/WebPage.messages.in:
2960
2961 2017-02-18  Michael Catanzaro  <mcatanzaro@igalia.com>
2962
2963         [GTK] Cannot paste primary selection into web view in Wayland
2964         https://bugs.webkit.org/show_bug.cgi?id=166949
2965
2966         Reviewed by Carlos Garcia Campos.
2967
2968         Once upon a time, primary selection (middle-click paste) was not supported in Wayland. At
2969         the time, I changed this function to report that primary selection was unsupported. But
2970         nowadays, primary selection works fine in all GTK+ applications except WebKit. All we have
2971         to do to make it work in WebKit is change this return value.
2972
2973         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2974         (WebKit::WebEditorClient::supportsGlobalSelection):
2975
2976 2017-02-17  Brian Burg  <bburg@apple.com>
2977
2978         Web Inspector: RTL: Inspector window should dock to the left when using RTL layout direction
2979         https://bugs.webkit.org/show_bug.cgi?id=168273
2980         <rdar://problem/29949325>
2981
2982         Reviewed by Matt Baker.
2983
2984         Add the ability to dock Web Inspector to the left of the inspected view.
2985         The frontend decides whether the Dock to Side button docks left or right
2986         based on the current layout direction.
2987
2988         * UIProcess/WebInspectorProxy.cpp:
2989         (WebKit::WebInspectorProxy::attachLeft):
2990         (WebKit::WebInspectorProxy::attach):
2991         (WebKit::WebInspectorProxy::createInspectorPage):
2992         * UIProcess/WebInspectorProxy.h:
2993         * UIProcess/WebInspectorProxy.messages.in:
2994         Add plumbing for new dock configuration.
2995
2996         * UIProcess/mac/WebInspectorProxyMac.mm:
2997         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2998         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
2999         (WebKit::WebInspectorProxy::platformAttach):
3000         Adapt existing sizing logic to work for docking to left.
3001
3002         * WebProcess/WebPage/WebInspectorUI.cpp:
3003         (WebKit::WebInspectorUI::requestSetDockSide):
3004         (WebKit::WebInspectorUI::setDockSide):
3005         * WebProcess/WebPage/WebInspectorUI.h:
3006         (WebKit::WebInspectorUI::attachedLeft):
3007         * WebProcess/WebPage/WebInspectorUI.messages.in:
3008         Add plumbing for new dock configuration.
3009
3010 2017-02-16  Simon Fraser  <simon.fraser@apple.com>
3011
3012         Allow PlatformCALayers to specify that they want deep color backing store
3013         https://bugs.webkit.org/show_bug.cgi?id=168495
3014
3015         Reviewed by Tim Horton.
3016
3017         Currently capable iOS devices get deep color backing store by virtue of a supports
3018         check in PlatformCALayerCocoa::PlatformCALayerCocoa(), and LegacyTileGridTile.
3019
3020         Future work will make layer contents format selection more complex, so express the need
3021         for deep color on PlatformCALayer, and have the creators of PlatformCALayer (mainly the
3022         flavors of GraphicsLayerCA) choose for them to support deep color. A bit of special-casing
3023         is needed to propagte the state to TileControllers.
3024         
3025         The deep-colorness now propagates from PlatformCALayerRemote to RemoteLayerBackingStore,
3026         instead of RemoteLayerBackingStore looking at the properties of the screen directly.
3027
3028         Remove PlatformCALayer::LayerTypeWebTiledLayer which was only used for the old CATiledLayers
3029         that we no longer use.
3030
3031         * Shared/mac/RemoteLayerBackingStore.h:
3032         * Shared/mac/RemoteLayerBackingStore.mm:
3033         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
3034         (WebKit::RemoteLayerBackingStore::bytesPerPixel):
3035         (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
3036         (WebKit::RemoteLayerBackingStore::drawInContext):
3037         (WebKit::RemoteLayerBackingStore::surfaceBufferFormat):
3038         (WebKit::bufferFormat): Deleted.
3039         * WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp:
3040         (WebKit::GraphicsLayerCARemote::createPlatformCALayer):
3041         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
3042         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3043         (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
3044         (WebKit::PlatformCALayerRemote::updateBackingStore):
3045         (WebKit::PlatformCALayerRemote::wantsDeepColorBackingStore):
3046         (WebKit::PlatformCALayerRemote::setWantsDeepColorBackingStore):
3047         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
3048         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
3049         (WebKit::PlatformCALayerRemoteTiledBacking::wantsDeepColorBackingStore):
3050         (WebKit::PlatformCALayerRemoteTiledBacking::setWantsDeepColorBackingStore):
3051         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
3052
3053 2017-02-17  Wenson Hsieh  <wenson_hsieh@apple.com>
3054
3055         [WK2] Action sheet should not dismiss when a DDAction with user interface is being presented
3056         https://bugs.webkit.org/show_bug.cgi?id=168528
3057         <rdar://problem/30515324>
3058
3059         Reviewed by Beth Dakin.
3060
3061         After r211643, -[WKActionSheet doneWithSheet] now dismisses the presenting view controller. This is called when
3062         interaction with the sheet is finished and is a reasonable thing to do in most cases. However, when using data
3063         detectors, we don't want to dismiss the presenting view controller, since DataDetector handles dismissing on its
3064         own and expects that its completion handler will be invoked.
3065
3066         To fix this, we add a parameter to doneWithSheet: to indicate whether or not we should additionally dismiss the
3067         presenting view controller, and pass in NO in the case where we are handing control over to DataDetector.
3068
3069         * UIProcess/ios/WKActionSheet.h:
3070         * UIProcess/ios/WKActionSheet.mm:
3071         (-[WKActionSheet doneWithSheet:]):
3072         (-[WKActionSheet doneWithSheet]): Deleted.
3073         * UIProcess/ios/WKActionSheetAssistant.mm:
3074         (-[WKActionSheetAssistant showDataDetectorsSheet]):
3075         (-[WKActionSheetAssistant cleanupSheet]):
3076
3077 2017-02-17  Michael Catanzaro  <mcatanzaro@igalia.com>
3078
3079         Remove EFL from WebKit2
3080         https://bugs.webkit.org/show_bug.cgi?id=168511
3081
3082         Reviewed by Alex Christensen.
3083
3084         * Platform/IPC/unix/ConnectionUnix.cpp:
3085         (IPC::Connection::platformInvalidate):
3086         (IPC::Connection::open):
3087         * Platform/Module.h:
3088         * PlatformEfl.cmake: Removed.
3089         * PluginProcess/unix/PluginProcessMainUnix.cpp:
3090         * Shared/API/APIObject.h:
3091         * Shared/API/c/WKBase.h:
3092         * Shared/API/c/WKSharedAPICast.h:
3093         (WebKit::toAPI):
3094         (WebKit::toImpl):
3095         * Shared/NativeWebKeyboardEvent.h:
3096         (WebKit::NativeWebKeyboardEvent::isFakeEventForComposition):
3097         (WebKit::NativeWebKeyboardEvent::isFiltered): Deleted.
3098         * Shared/NativeWebMouseEvent.h:
3099         (WebKit::NativeWebMouseEvent::nativeEvent):
3100         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent): Deleted.
3101         * Shared/NativeWebTouchEvent.h:
3102         (WebKit::NativeWebTouchEvent::nativeEvent):
3103         * Shared/NativeWebWheelEvent.h:
3104         (WebKit::NativeWebWheelEvent::nativeEvent):
3105         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
3106         (WebKit::NetscapePluginModule::determineQuirks):
3107         * Shared/WebPreferencesDefinitions.h:
3108         * UIProcess/API/APIWebsiteDataStore.cpp:
3109         * UIProcess/API/C/WKAPICast.h:
3110         * UIProcess/API/C/WKTextChecker.cpp:
3111         * UIProcess/API/C/WKTextChecker.h:
3112         * UIProcess/ChildProcessProxy.cpp:
3113         (WebKit::ChildProcessProxy::getLaunchOptions):
3114         * UIProcess/CoordinatedGraphics/PageViewportController.cpp:
3115         (WebKit::PageViewportController::pixelAlignedFloatPoint):
3116         * UIProcess/InspectorServer/WebInspectorServer.h:
3117         * UIProcess/Launcher/ProcessLauncher.h:
3118         * UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp:
3119         * UIProcess/PageClient.h:
3120         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
3121         (WebKit::PluginProcessProxy::scanPlugin):
3122         * UIProcess/WebInspectorProxy.h:
3123         * UIProcess/WebPageProxy.h:
3124         * WebKit2.xcodeproj/project.pbxproj:
3125         * WebProcess/InjectedBundle/InjectedBundle.h:
3126         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
3127         (WebKit::getPluginDisplay):
3128         (WebKit::x11Screen):
3129         (WebKit::displayDepth):
3130         (WebKit::rootWindowID):
3131         (WebKit::NetscapePluginX11::paint):
3132         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3133         (WebKit::WebChromeClient::selectItemWritingDirectionIsNatural):
3134         (WebKit::WebChromeClient::pageExtendedBackgroundColorDidChange):
3135         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3136         (WebKit::WebEditorClient::shouldEraseMarkersAfterChangeSelection):
3137         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3138         (WebKit::WebFrameLoaderClient::saveViewStateToItem):
3139         (WebKit::WebFrameLoaderClient::restoreViewState):
3140         (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
3141         * WebProcess/WebPage/WebPage.cpp:
3142         (WebKit::WebPage::WebPage):
3143         * WebProcess/WebPage/WebPage.h:
3144         * WebProcess/WebPage/WebPage.messages.in:
3145         * config.h:
3146
3147 2017-02-15  Brady Eidson  <beidson@apple.com>
3148
3149         Stop backing up localStorage databases to iCloud by default.
3150         <rdar://problem/29045531> and https://bugs.webkit.org/show_bug.cgi?id=168388
3151
3152         Reviewed by Geoffrey Garen.
3153
3154         * UIProcess/Cocoa/VersionChecks.h:
3155
3156         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
3157         (WebKit::LocalStorageDatabaseTracker::databasePath):
3158         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
3159         * UIProcess/Storage/ios/LocalStorageDatabaseTrackerIOS.mm: Copied from Source/WebKit2/UIProcess/Cocoa/VersionChecks.h.
3160         (WebKit::LocalStorageDatabaseTracker::platformExcludeFromBackup):
3161
3162         * WebKit2.xcodeproj/project.pbxproj:
3163
3164 2017-02-16  Aakash Jain  <aakash_jain@apple.com>
3165
3166         Remove unused methods WKPageGetDebugPaintFlags and WKPageSetDebugPaintFlags
3167         https://bugs.webkit.org/show_bug.cgi?id=168464
3168
3169         Reviewed by Alexey Proskuryakov.
3170
3171         * UIProcess/API/C/WKPagePrivate.h:
3172
3173 2017-02-16  Youenn Fablet  <youenn@apple.com>
3174
3175         [WebRTC] libwebrtc socket addresses should not be passed as strings
3176         https://bugs.webkit.org/show_bug.cgi?id=168474
3177
3178         Reviewed by Alex Christensen.
3179
3180         Removing all seralization of socket addresses as strings.
3181         Instead, a dedicated serialization is provided.
3182         This allows proper handling of various cases like addresses with both hostnames and resolved IPs.
3183
3184         * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
3185         (WebKit::LibWebRTCSocketClient::signalReadPacket):
3186         (WebKit::LibWebRTCSocketClient::signalSentPacket):
3187         (WebKit::LibWebRTCSocketClient::signalAddressReady):
3188         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
3189         (WebKit::NetworkRTCProvider::createUDPSocket):
3190         (WebKit::NetworkRTCProvider::createServerTCPSocket):
3191         (WebKit::NetworkRTCProvider::createClientTCPSocket):
3192         * NetworkProcess/webrtc/NetworkRTCProvider.h:
3193         * NetworkProcess/webrtc/NetworkRTCProvider.messages.in:
3194         * NetworkProcess/webrtc/NetworkRTCSocket.cpp:
3195         (WebKit::NetworkRTCSocket::sendTo):
3196         * NetworkProcess/webrtc/NetworkRTCSocket.h:
3197         * NetworkProcess/webrtc/NetworkRTCSocket.messages.in:
3198         * Shared/RTCNetwork.cpp:
3199         (WebKit::RTCNetwork::SocketAddress::decode):
3200         (WebKit::RTCNetwork::SocketAddress::encode):
3201         * Shared/RTCNetwork.h:
3202         (WebKit::RTCNetwork::SocketAddress::SocketAddress):
3203         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
3204         (WebKit::LibWebRTCSocket::signalAddressReady):
3205         (WebKit::LibWebRTCSocket::SendTo):
3206         * WebProcess/Network/webrtc/LibWebRTCSocket.h:
3207         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
3208         (WebKit::LibWebRTCSocketFactory::CreateServerTcpSocket):
3209         (WebKit::LibWebRTCSocketFactory::CreateUdpSocket):
3210         (WebKit::LibWebRTCSocketFactory::CreateClientTcpSocket):
3211         * WebProcess/Network/webrtc/WebRTCSocket.cpp:
3212         (WebKit::WebRTCSocket::signalAddressReady):
3213         * WebProcess/Network/webrtc/WebRTCSocket.h:
3214         * WebProcess/Network/webrtc/WebRTCSocket.messages.in:
3215
3216 2017-02-16  Daniel Bates  <dabates@apple.com>
3217
3218         Remove Chromium-specific code to call FrameLoaderClient::redirectDataToPlugin(nullptr)
3219         https://bugs.webkit.org/show_bug.cgi?id=168417
3220         <rdar://problem/30541748>
3221
3222         Reviewed by Brent Fulgham.
3223
3224         Update override of FrameLoaderClient::redirectDataToPlugin() to take a Widget& instead of a
3225         Widget* as it is always called with a valid Widget.
3226
3227         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3228         (WebKit::WebFrameLoaderClient::redirectDataToPlugin):
3229         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3230         * mac/WebKit2.order: Remove symbol for WebFrameLoaderClient::redirectDataToPlugin() that took a Widget*
3231         as it no longer exists. I am unclear if this file is still meaningful as it was last modified in
3232         r180570 (2 years ago) though Xcode still references this ordering file (why?).
3233
3234 2017-02-16  Alex Christensen  <achristensen@webkit.org>
3235
3236         Remove EFL-specific files in WebKit2.
3237
3238         Rubber-stamped by Anders Carlsson
3239
3240         * DatabaseProcess/efl: Removed.
3241         * DatabaseProcess/efl/DatabaseProcessMainEfl.cpp: Removed.
3242         * NetworkProcess/Downloads/efl: Removed.
3243         * NetworkProcess/Downloads/efl/DownloadSoupErrorsEfl.cpp: Removed.
3244         * NetworkProcess/efl: Removed.
3245         * NetworkProcess/efl/NetworkProcessMainEfl.cpp: Removed.
3246         * Platform/efl: Removed.
3247         * Platform/efl/ModuleEfl.cpp: Removed.
3248         * Shared/API/c/efl: Removed.
3249         * Shared/API/c/efl/WKArrayEfl.cpp: Removed.
3250         * Shared/API/c/efl/WKArrayEfl.h: Removed.
3251         * Shared/API/c/efl/WKBaseEfl.h: Removed.
3252         * Shared/efl: Removed.
3253         * Shared/efl/NativeWebKeyboardEventEfl.cpp: Removed.
3254         * Shared/efl/NativeWebTouchEventEfl.cpp: Removed.
3255         * Shared/efl/NativeWebWheelEventEfl.cpp: Removed.
3256         * Shared/efl/ProcessExecutablePathEfl.cpp: Removed.
3257         * Shared/efl/WebEventFactory.cpp: Removed.
3258         * Shared/efl/WebEventFactory.h: Removed.
3259         * UIProcess/API/C/efl: Removed.
3260         * UIProcess/API/C/efl/WKAPICastEfl.h: Removed.
3261         * UIProcess/API/C/efl/WKColorPickerResultListener.cpp: Removed.
3262         * UIProcess/API/C/efl/WKColorPickerResultListener.h: Removed.
3263         * UIProcess/API/C/efl/WKEventEfl.cpp: Removed.
3264         * UIProcess/API/C/efl/WKEventEfl.h: Removed.
3265         * UIProcess/API/C/efl/WKViewEfl.cpp: Removed.
3266         * UIProcess/API/C/efl/WKViewEfl.h: Removed.
3267         * UIProcess/API/cpp/efl: Removed.
3268         * UIProcess/API/cpp/efl/WKEinaSharedString.cpp: Removed.
3269         * UIProcess/API/cpp/efl/WKEinaSharedString.h: Removed.
3270         * UIProcess/API/efl: Removed.
3271         * UIProcess/API/efl/APIWebsiteDataStoreEfl.cpp: Removed.
3272         * UIProcess/API/efl/EWebKit2.h.in: Removed.
3273         * UIProcess/API/efl/EwkView.cpp: Removed.
3274         * UIProcess/API/efl/EwkView.h: Removed.
3275         * UIProcess/API/efl/EwkViewCallbacks.h: Removed.
3276         * UIProcess/API/efl/GestureRecognizer.cpp: Removed.
3277         * UIProcess/API/efl/GestureRecognizer.h: Removed.
3278         * UIProcess/API/efl/SnapshotImageGL.cpp: Removed.
3279         * UIProcess/API/efl/SnapshotImageGL.h: Removed.
3280         * UIProcess/API/efl/WebAccessibility.cpp: Removed.
3281         * UIProcess/API/efl/WebAccessibility.h: Removed.
3282         * UIProcess/API/efl/ewk_application_cache_manager.cpp: Removed.
3283         * UIProcess/API/efl/ewk_application_cache_manager.h: Removed.
3284         * UIProcess/API/efl/ewk_application_cache_manager_private.h: Removed.
3285         * UIProcess/API/efl/ewk_auth_request.cpp: Removed.
3286         * UIProcess/API/efl/ewk_auth_request.h: Removed.
3287         * UIProcess/API/efl/ewk_auth_request_private.h: Removed.
3288         * UIProcess/API/efl/ewk_back_forward_list.cpp: Removed.
3289         * UIProcess/API/efl/ewk_back_forward_list.h: Removed.
3290         * UIProcess/API/efl/ewk_back_forward_list_item.cpp: Removed.
3291         * UIProcess/API/efl/ewk_back_forward_list_item.h: Removed.
3292         * UIProcess/API/efl/ewk_back_forward_list_item_private.h: Removed.
3293         * UIProcess/API/efl/ewk_back_forward_list_private.h: Removed.
3294         * UIProcess/API/efl/ewk_color_picker.cpp: Removed.
3295         * UIProcess/API/efl/ewk_color_picker.h: Removed.
3296         * UIProcess/API/efl/ewk_color_picker_private.h: Removed.
3297         * UIProcess/API/efl/ewk_context.cpp: Removed.
3298         * UIProcess/API/efl/ewk_context.h: Removed.
3299         * UIProcess/API/efl/ewk_context_menu.cpp: Removed.
3300         * UIProcess/API/efl/ewk_context_menu.h: Removed.
3301         * UIProcess/API/efl/ewk_context_menu_item.cpp: Removed.
3302         * UIProcess/API/efl/ewk_context_menu_item.h: Removed.
3303         * UIProcess/API/efl/ewk_context_menu_item_private.h: Removed.
3304         * UIProcess/API/efl/ewk_context_menu_private.h: Removed.
3305         * UIProcess/API/efl/ewk_context_private.h: Removed.
3306         * UIProcess/API/efl/ewk_cookie_manager.cpp: Removed.
3307         * UIProcess/API/efl/ewk_cookie_manager.h: Removed.
3308         * UIProcess/API/efl/ewk_cookie_manager_private.h: Removed.
3309         * UIProcess/API/efl/ewk_database_manager.cpp: Removed.
3310         * UIProcess/API/efl/ewk_database_manager.h: Removed.
3311         * UIProcess/API/efl/ewk_database_manager_private.h: Removed.
3312         * UIProcess/API/efl/ewk_download_job.cpp: Removed.
3313         * UIProcess/API/efl/ewk_download_job.h: Removed.
3314         * UIProcess/API/efl/ewk_download_job_private.h: Removed.
3315         * UIProcess/API/efl/ewk_error.cpp: Removed.
3316         * UIProcess/API/efl/ewk_error.h: Removed.
3317         * UIProcess/API/efl/ewk_error_private.h: Removed.
3318         * UIProcess/API/efl/ewk_favicon_database.cpp: Removed.
3319         * UIProcess/API/efl/ewk_favicon_database.h: Removed.
3320         * UIProcess/API/efl/ewk_favicon_database_private.h: Removed.
3321         * UIProcess/API/efl/ewk_file_chooser_request.cpp: Removed.
3322         * UIProcess/API/efl/ewk_file_chooser_request.h: Removed.
3323         * UIProcess/API/efl/ewk_file_chooser_request_private.h: Removed.
3324         * UIProcess/API/efl/ewk_form_submission_request.cpp: Removed.
3325         * UIProcess/API/efl/ewk_form_submission_request.h: Removed.
3326         * UIProcess/API/efl/ewk_form_submission_request_private.h: Removed.
3327         * UIProcess/API/efl/ewk_intro.h: Removed.
3328         * UIProcess/API/efl/ewk_main.cpp: Removed.
3329         * UIProcess/API/efl/ewk_main.h: Removed.
3330         * UIProcess/API/efl/ewk_main_private.h: Removed.
3331         * UIProcess/API/efl/ewk_navigation_data.cpp: Removed.
3332         * UIProcess/API/efl/ewk_navigation_data.h: Removed.
3333         * UIProcess/API/efl/ewk_navigation_data_private.h: Removed.
3334         * UIProcess/API/efl/ewk_navigation_policy_decision.cpp: Removed.
3335         * UIProcess/API/efl/ewk_navigation_policy_decision.h: Removed.
3336         * UIProcess/API/efl/ewk_navigation_policy_decision_private.h: Removed.
3337         * UIProcess/API/efl/ewk_object.cpp: Removed.
3338         * UIProcess/API/efl/ewk_object.h: Removed.
3339         * UIProcess/API/efl/ewk_object_private.h: Removed.
3340         * UIProcess/API/efl/ewk_page_group.cpp: Removed.
3341         * UIProcess/API/efl/ewk_page_group.h: Removed.
3342         * UIProcess/API/efl/ewk_page_group_private.h: Removed.
3343         * UIProcess/API/efl/ewk_popup_menu.cpp: Removed.
3344         * UIProcess/API/efl/ewk_popup_menu.h: Removed.
3345         * UIProcess/API/efl/ewk_popup_menu_item.cpp: Removed.
3346         * UIProcess/API/efl/ewk_popup_menu_item.h: Removed.
3347         * UIProcess/API/efl/ewk_popup_menu_item_private.h: Removed.
3348         * UIProcess/API/efl/ewk_popup_menu_private.h: Removed.
3349         * UIProcess/API/efl/ewk_security_origin.cpp: Removed.
3350         * UIProcess/API/efl/ewk_security_origin.h: Removed.
3351         * UIProcess/API/efl/ewk_security_origin_private.h: Removed.
3352         * UIProcess/API/efl/ewk_settings.cpp: Removed.
3353         * UIProcess/API/efl/ewk_settings.h: Removed.
3354         * UIProcess/API/efl/ewk_settings_private.h: Removed.
3355         * UIProcess/API/efl/ewk_storage_manager.cpp: Removed.
3356         * UIProcess/API/efl/ewk_storage_manager.h: Removed.
3357         * UIProcess/API/efl/ewk_storage_manager_private.h: Removed.
3358         * UIProcess/API/efl/ewk_text_checker.cpp: Removed.
3359         * UIProcess/API/efl/ewk_text_checker.h: Removed.
3360         * UIProcess/API/efl/ewk_text_checker_private.h: Removed.
3361         * UIProcess/API/efl/ewk_touch.h: Removed.
3362         * UIProcess/API/efl/ewk_url_request.cpp: Removed.
3363         * UIProcess/API/efl/ewk_url_request.h: Removed.
3364         * UIProcess/API/efl/ewk_url_request_private.h: Removed.
3365         * UIProcess/API/efl/ewk_url_response.cpp: Removed.
3366         * UIProcess/API/efl/ewk_url_response.h: Removed.
3367         * UIProcess/API/efl/ewk_url_response_private.h: Removed.
3368         * UIProcess/API/efl/ewk_url_scheme_request.cpp: Removed.
3369         * UIProcess/API/efl/ewk_url_scheme_request.h: Removed.
3370         * UIProcess/API/efl/ewk_url_scheme_request_private.h: Removed.
3371         * UIProcess/API/efl/ewk_view.cpp: Removed.
3372         * UIProcess/API/efl/ewk_view.h: Removed.
3373         * UIProcess/API/efl/ewk_view_configuration.cpp: Removed.
3374         * UIProcess/API/efl/ewk_view_configuration.h: Removed.
3375         * UIProcess/API/efl/ewk_view_configuration_private.h: Removed.
3376         * UIProcess/API/efl/ewk_view_private.h: Removed.
3377         * UIProcess/API/efl/ewk_window_features.cpp: Removed.
3378         * UIProcess/API/efl/ewk_window_features.h: Removed.
3379         * UIProcess/API/efl/ewk_window_features_private.h: Removed.
3380         * UIProcess/API/efl/tests: Removed.
3381         * UIProcess/API/efl/tests/UnitTestUtils: Removed.
3382         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp: Removed.
3383         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h: Removed.
3384         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.cpp: Removed.
3385         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.h: Removed.
3386         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestMain.cpp: Removed.
3387         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestServer.cpp: Removed.
3388         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestServer.h: Removed.
3389         * UIProcess/API/efl/tests/extensions: Removed.
3390         * UIProcess/API/efl/tests/extensions/extension_sample.cpp: Removed.
3391         * UIProcess/API/efl/tests/resources: Removed.
3392         * UIProcess/API/efl/tests/resources/Page1.html: Removed.
3393         * UIProcess/API/efl/tests/resources/Page2.html: Removed.
3394         * UIProcess/API/efl/tests/resources/Page3.html: Removed.
3395         * UIProcess/API/efl/tests/resources/blank.ico: Removed.
3396         * UIProcess/API/efl/tests/resources/default_test_page.html: Removed.
3397         * UIProcess/API/efl/tests/resources/empty_theme.edj: Removed.
3398         * UIProcess/API/efl/tests/resources/file_chooser.html: Removed.
3399         * UIProcess/API/efl/tests/resources/frame_flattening_test.html: Removed.
3400         * UIProcess/API/efl/tests/resources/frame_flattening_test_subframe.html: Removed.
3401         * UIProcess/API/efl/tests/resources/local_file_access.html: Removed.
3402         * UIProcess/API/efl/tests/resources/redirect_url_to_default.html: Removed.
3403         * UIProcess/API/efl/tests/resources/resultMHTML.mht: Removed.
3404         * UIProcess/API/efl/tests/resources/same_page_navigation.html: Removed.
3405         * UIProcess/API/efl/tests/resources/spelling_selection_tests.html: Removed.
3406         * UIProcess/API/efl/tests/resources/spelling_test.html: Removed.
3407         * UIProcess/API/efl/tests/resources/test.pdf: Removed.
3408         * UIProcess/API/efl/tests/resources/window_move_resize.html: Removed.
3409         * UIProcess/API/efl/tests/test_ewk2_accessibility.cpp: Removed.
3410         * UIProcess/API/efl/tests/test_ewk2_application_cache_manager.cpp: Removed.
3411         * UIProcess/API/efl/tests/test_ewk2_auth_request.cpp: Removed.
3412         * UIProcess/API/efl/tests/test_ewk2_back_forward_list.cpp: Removed.
3413         * UIProcess/API/efl/tests/test_ewk2_color_picker.cpp: Removed.
3414         * UIProcess/API/efl/tests/test_ewk2_context.cpp: Removed.
3415         * UIProcess/API/efl/tests/test_ewk2_context_history_callbacks.cpp: Removed.
3416         * UIProcess/API/efl/tests/test_ewk2_context_menu.cpp: Removed.
3417         * UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp: Removed.
3418         * UIProcess/API/efl/tests/test_ewk2_database_manager.cpp: Removed.
3419         * UIProcess/API/efl/tests/test_ewk2_download_job.cpp: Removed.
3420         * UIProcess/API/efl/tests/test_ewk2_eina_shared_string.cpp: Removed.
3421         * UIProcess/API/efl/tests/test_ewk2_favicon_database.cpp: Removed.
3422         * UIProcess/API/efl/tests/test_ewk2_file_chooser_request.cpp: Removed.
3423         * UIProcess/API/efl/tests/test_ewk2_javascript_binding.cpp: Removed.
3424         * UIProcess/API/efl/tests/test_ewk2_object.cpp: Removed.
3425         * UIProcess/API/efl/tests/test_ewk2_page.cpp: Removed.
3426         * UIProcess/API/efl/tests/test_ewk2_page_group.cpp: Removed.
3427         * UIProcess/API/efl/tests/test_ewk2_popup_menu.cpp: Removed.
3428         * UIProcess/API/efl/tests/test_ewk2_settings.cpp: Removed.
3429         * UIProcess/API/efl/tests/test_ewk2_ssl.cpp: Removed.
3430         * UIProcess/API/efl/tests/test_ewk2_storage_manager.cpp: Removed.
3431         * UIProcess/API/efl/tests/test_ewk2_text_checker.cpp: Removed.
3432         * UIProcess/API/efl/tests/test_ewk2_view.cpp: Removed.
3433         * UIProcess/API/efl/tests/test_ewk2_view_configuration.cpp: Removed.
3434         * UIProcess/API/efl/tests/test_ewk2_window_features.cpp: Removed.