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