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