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