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