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