Rolling out r212757
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2017-02-22  Chris Dumez  <cdumez@apple.com>
2
3         [WK2] Call processDidBecomeUnresponsive delegate when a background process is unresponsive
4         https://bugs.webkit.org/show_bug.cgi?id=168683
5         <rdar://problem/30558745>
6
7         Reviewed by Dan Bernstein.
8
9         Call processDidBecomeUnresponsive delegate when a background process is unresponsive
10         instead of killing it on WebKit side. This gives the client the choice about what it
11         wants to do about this process.
12
13         * UIProcess/API/APIProcessPoolConfiguration.cpp:
14         (API::ProcessPoolConfiguration::copy):
15         * UIProcess/API/APIProcessPoolConfiguration.h:
16         * UIProcess/API/C/WKContext.cpp:
17         * UIProcess/API/C/WKContextPrivate.h:
18         * UIProcess/BackgroundProcessResponsivenessTimer.cpp: Renamed from Source/WebKit2/UIProcess/UnresponsiveWebProcessTerminator.cpp.
19         (WebKit::BackgroundProcessResponsivenessTimer::BackgroundProcessResponsivenessTimer):
20         (WebKit::BackgroundProcessResponsivenessTimer::updateState):
21         (WebKit::BackgroundProcessResponsivenessTimer::timerFired):
22         * UIProcess/BackgroundProcessResponsivenessTimer.h: Renamed from Source/WebKit2/UIProcess/UnresponsiveWebProcessTerminator.h.
23         * UIProcess/WebPageProxy.cpp:
24         (WebKit::WebPageProxy::reattachToWebProcess):
25         (WebKit::WebPageProxy::dispatchActivityStateChange):
26         (WebKit::WebPageProxy::terminateProcess):
27         * UIProcess/WebPageProxy.h:
28         * UIProcess/WebProcessProxy.cpp:
29         (WebKit::m_backgroundResponsivenessTimer):
30         * UIProcess/WebProcessProxy.h:
31         * WebKit2.xcodeproj/project.pbxproj:
32
33 2017-02-22  Carlos Garcia Campos  <cgarcia@igalia.com>
34
35         NetworkProcess: Stop disabling buffering when NETWORK_CACHE is disabled in build
36         https://bugs.webkit.org/show_bug.cgi?id=168637
37
38         Reviewed by Alex Christensen.
39
40         It was added in r193752 as part of bug #137692 to fix an infinite loop in network process that happened in EFL
41         because they didn't enable the network cache at that time. I think that was actually a workaround, and it was
42         added without any comment so it has stayed there even when EFL enabled disk cache, and now that is gone. Looking
43         at current code I see no reason why buffering can't work with the disk cache disabled, so I think it's time to
44         remove that workaround.
45
46         * WebProcess/Network/WebLoaderStrategy.cpp:
47         (WebKit::maximumBufferingTime):
48
49 2017-02-21  Youenn Fablet  <youenn@apple.com>
50
51         [WebRTC][Mac] Activate libwebrtc
52         https://bugs.webkit.org/show_bug.cgi?id=167293
53         <rdar://problem/30401864>
54
55         Reviewed by Alex Christensen.
56
57         Activating PeerConnection runtime flag based on successful loading of libwebrtc.dylib.
58
59         * Configurations/WebKit.xcconfig:
60         * Configurations/FeatureDefines.xcconfig:
61         * Shared/WebPreferencesDefinitions.h:
62         * UIProcess/WebPreferences.cpp:
63         (WebKit::checkWebRTCAvailability):
64
65 2017-02-21  Commit Queue  <commit-queue@webkit.org>
66
67         Unreviewed, rolling out r212786.
68         https://bugs.webkit.org/show_bug.cgi?id=168710
69
70         It broke GTK+ port when using single shared process model
71         (Requested by KaL on #webkit).
72
73         Reverted changeset:
74
75         "Refactor WebViewImpl creation in preparation for supporting
76         multiple WebsiteDataStores."
77         https://bugs.webkit.org/show_bug.cgi?id=168676
78         http://trac.webkit.org/changeset/212786
79
80 2017-02-21  Brady Eidson  <beidson@apple.com>
81
82         Refactor WebViewImpl creation in preparation for supporting multiple WebsiteDataStores.
83         https://bugs.webkit.org/show_bug.cgi?id=168676
84
85         Reviewed by Alex Christensen.
86
87         * UIProcess/API/Cocoa/WKWebView.mm:
88         (-[WKWebView _initializeWithConfiguration:]): Allow for WebViewImpl creation to fail.
89
90         * UIProcess/API/mac/WKView.mm:
91         (-[WKView initWithFrame:processPool:configuration:]): Ditto.
92
93         * UIProcess/Cocoa/WebViewImpl.h:
94         * UIProcess/Cocoa/WebViewImpl.mm:
95         (WebKit::WebViewImpl::maybeCreate):
96         (WebKit::WebViewImpl::WebViewImpl):
97
98         * UIProcess/WebPageProxy.cpp:
99         (WebKit::WebPageProxy::reattachToWebProcess): New WebProcess creation might fail. Handle it.
100         * UIProcess/WebProcessPool.cpp:
101         (WebKit::WebProcessPool::createNewWebProcess):
102         (WebKit::WebProcessPool::warmInitialProcess):
103         (WebKit::WebProcessPool::maybeCreateNewWebProcessRespectingProcessCountLimit): This can now fail
104           if the process will have a non-default WebsiteDataStore but we've already reached the process cap.
105         (WebKit::WebProcessPool::createWebPage):
106         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit): Deleted.
107         * UIProcess/WebProcessPool.h:
108
109 2017-02-21  Youenn Fablet  <youenn@apple.com>
110
111         [WebRTC] WebKit2 should assert that libwebrtc transmitted IP addresses family is IP4 or IP6
112         https://bugs.webkit.org/show_bug.cgi?id=168691
113
114         Reviewed by Alex Christensen.
115
116         Adding some asserts that family is IPv4 or IPv6.
117
118         * Shared/RTCNetwork.cpp:
119         (WebKit::RTCNetwork::IPAddress::decode):
120         (WebKit::RTCNetwork::IPAddress::encode):
121
122 2017-02-20  Simon Fraser  <simon.fraser@apple.com>
123
124         Add support to PlatformCALayer/GraphicsLayerCA for subpixel-antialiased text, with a Setting and a MiniBrowser switch
125         https://bugs.webkit.org/show_bug.cgi?id=168620
126         <rdar://problem/30617772>
127
128         Reviewed by Tim Horton.
129
130         Add a Setting for subpixel-antialiased layer text. Plumb this through GraphicsLayerCA and
131         PlatformCALayer, where it ultimately affects the layer contents format.
132         
133         This is not supported with UI-side compositing.
134
135         * Shared/WebPreferencesDefinitions.h:
136         * UIProcess/API/C/WKPreferences.cpp:
137         (WKPreferencesSetSubpixelAntialiasedLayerTextEnabled):
138         (WKPreferencesGetSubpixelAntialiasedLayerTextEnabled):
139         * UIProcess/API/C/WKPreferencesRefPrivate.h:
140         * UIProcess/API/Cocoa/WKPreferences.mm:
141         (-[WKPreferences _subpixelAntialiasedLayerTextEnabled]):
142         (-[WKPreferences _setSubpixelAntialiasedLayerTextEnabled:]):
143         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
144         * WebProcess/WebPage/WebPage.cpp:
145         (WebKit::WebPage::updatePreferences):
146         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
147         (WebKit::PlatformCALayerRemote::supportsSubpixelAntialiasedText):
148         (WebKit::PlatformCALayerRemote::setSupportsSubpixelAntialiasedText):
149         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
150         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
151         (WebKit::PlatformCALayerRemoteTiledBacking::supportsSubpixelAntialiasedText):
152         (WebKit::PlatformCALayerRemoteTiledBacking::setSupportsSubpixelAntialiasedText):
153         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
154
155 2017-02-21  John Wilander  <wilander@apple.com>
156
157         Resource Load Statistics: Only scan website data store once per session ID + reinstate removal counting
158         https://bugs.webkit.org/show_bug.cgi?id=168541
159
160         Reviewed by Alex Christensen.
161
162         * UIProcess/WebProcessProxy.cpp:
163         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyOwnedDomainsInAllPersistentDataStores):
164             The CallbackAggregator now merges a list of domains for which we
165             have removed data records and eventually reports this back to the
166             caller.
167         * UIProcess/WebProcessProxy.h:
168         * UIProcess/WebResourceLoadStatisticsStore.cpp:
169         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
170             Now reports back to its WebCore::ResourceLoadStatisticsStore
171             which domains have had data records removed.
172         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
173         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyOwnedDomains):
174             The completion handler now handles data record removal counting.
175         (WebKit::WebsiteDataStore::removeDataForTopPrivatelyOwnedDomains):
176             The completion handler now handles data record removal counting.
177         * UIProcess/WebsiteData/WebsiteDataStore.h:
178
179 2017-02-21  Alex Christensen  <achristensen@webkit.org>
180
181         Fix CMake build.
182
183         * PlatformMac.cmake:
184
185 2017-02-21  Youenn Fablet  <youenn@apple.com>
186
187         [WebRTC][Mac] Network process sandbox does not allow WebRTC networking
188         https://bugs.webkit.org/show_bug.cgi?id=168594
189
190         Reviewed by Brent Fulgham.
191
192         UIProcess was passing a boolean to know whether WebRTC networking is allowed or not to the network process.
193         This boolean was known to late for the sandbox to be relaxed.
194         A sandbox extension is now used instead to relax the sandbox.
195
196         * NetworkProcess/NetworkProcess.h:
197         * NetworkProcess/NetworkProcessCreationParameters.cpp:
198         (WebKit::NetworkProcessCreationParameters::encode):
199         (WebKit::NetworkProcessCreationParameters::decode):
200         * NetworkProcess/NetworkProcessCreationParameters.h:
201         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
202         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
203         * NetworkProcess/mac/NetworkProcessMac.mm:
204         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
205         (WebKit::NetworkProcess::initializeSandbox):
206         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
207         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
208         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
209
210 2017-02-21  Youenn Fablet  <youenn@apple.com>
211
212         [WebRTC] ICE candidates should be filtered according a policy
213         https://bugs.webkit.org/show_bug.cgi?id=168348
214
215         Reviewed by Alex Christensen.
216
217         Adding the possibility for the UI process to control the ICE candidate filtering and whether libwebrtc can
218         enumerate all interfaces or not.
219
220         Disabling ICE candidate filtering for the moment.
221         Enabling to enumerate all interfaces for the moment.
222
223         In the future, ICE candidate filtering should be tied to getUserMedia.
224         Interface enumeration should be disabled with the default configuration.
225         We should do that once we have sufficient testing in various network infrastructures.
226
227         * UIProcess/WebPageProxy.cpp:
228         (WebKit::WebPageProxy::initializeWebPage):
229         * WebKit2.xcodeproj/project.pbxproj:
230         * WebProcess/WebPage/WebPage.h:
231         (WebKit::WebPage::disableICECandidateFiltering):
232         (WebKit::WebPage::enableICECandidateFiltering):
233         (WebKit::WebPage::disableEnumeratingAllNetworkInterfaces):
234         (WebKit::WebPage::enableEnumeratingAllNetworkInterfaces):
235         * WebProcess/WebPage/WebPage.messages.in:
236
237 2017-02-21  Youenn Fablet  <youenn@apple.com>
238
239         [WebRTC] NetworkRTCMonitor should ensure clearing its manager only once
240         https://bugs.webkit.org/show_bug.cgi?id=168661
241
242         Reviewed by Alex Christensen.
243
244         Making sure NetworkRTCMonitor manager is cleared only once.
245         ALso ensuring that manager does not get destroyed as part of NetworkRTCMonitor destructor.
246         The manager needs to be destroyed in the RTC network thread.
247
248         * NetworkProcess/webrtc/NetworkRTCMonitor.cpp:
249         (WebKit::NetworkRTCMonitor::~NetworkRTCMonitor):
250         (WebKit::NetworkRTCMonitor::stopUpdating):
251         * NetworkProcess/webrtc/NetworkRTCMonitor.h:
252
253 2017-02-21  Brent Fulgham  <bfulgham@apple.com>
254
255         [WebRTC][Mac][WebKit2] Revise sandbox to limit connections to UDP and TCP
256         https://bugs.webkit.org/show_bug.cgi?id=168664
257         <rdar://problem/30600587>
258
259         Reviewed by Youenn Fablet.
260
261         Add filters to the WebRTC rule to limit network traffic to UDP and TCP.
262
263         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
264
265 2017-02-21  Maureen Daum  <mdaum@apple.com>
266
267         Check what LocalStorage data exists in deleteDatabasesModifiedSince() before attempting deletion.
268         https://bugs.webkit.org/show_bug.cgi?id=168659
269         rdar://problem/22781730
270
271         Reviewed by Brady Eidson.
272
273         Check what LocalStorage data exists in deleteDatabasesModifiedSince() before attempting deletion.
274         It is possible that another process has caused information to be added to LocalStorage
275         after we created this LocalStorageDatabaseTracker instance, so we should update our
276         internal state by checking the contents of StorageTracker.db and the other local
277         storage files so we know what databases actually exist. By calling importOriginIdentifiers()
278         at the start of deleteDatabasesModifiedSince(), m_origins will now have the up-to-date
279         list of origins LocalStorage contains data for.
280
281         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
282         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
283
284 2017-02-21  Carlos Garcia Campos  <cgarcia@igalia.com>
285
286         Reduce platform ifdefs in WebKit2 custom protocols implementation
287         https://bugs.webkit.org/show_bug.cgi?id=165028
288
289         Reviewed by Darin Adler.
290
291         Make mac implementation use the APICustomProtocolManagerClient to share more code with the soup based ports.
292
293         * CMakeLists.txt: Add CustomProtocolManagerProxy.cpp.
294         * PlatformEfl.cmake: Remove CustomProtocolManagerProxySoup.cpp.
295         * PlatformGTK.cmake: Ditto.
296         * PlatformMac.cmake: Remove CustomProtocolManagerProxyMac.mm.
297         * UIProcess/API/APICustomProtocolManagerClient.h:
298         (API::CustomProtocolManagerClient::startLoading): Make it void, since we were always returning true and the
299         returned value was ignored.
300         * UIProcess/API/efl/ewk_url_scheme_request.cpp:
301         (EwkUrlSchemeRequest::finish): Update to new CustomProtocolManagerProxy API.
302         * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp:
303         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
304         (webkitURISchemeRequestReadCallback): Ditto.
305         * UIProcess/Cocoa/CustomProtocolManagerClient.h: Added.
306         * UIProcess/Cocoa/CustomProtocolManagerClient.mm: Added.
307         (-[WKCustomProtocolLoader initWithCustomProtocolManagerProxy:customProtocolID:request:]):
308         (-[WKCustomProtocolLoader dealloc]):
309         (-[WKCustomProtocolLoader connection:didFailWithError:]):
310         (-[WKCustomProtocolLoader connection:didReceiveResponse:]):
311         (-[WKCustomProtocolLoader connection:didReceiveData:]):
312         (-[WKCustomProtocolLoader connection:willSendRequest:redirectResponse:]):
313         (-[WKCustomProtocolLoader connectionDidFinishLoading:]):
314         (WebKit::CustomProtocolManagerClient::startLoading):
315         (WebKit::CustomProtocolManagerClient::stopLoading):
316         (WebKit::CustomProtocolManagerClient::invalidate):
317         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
318         (WebKit::WebProcessPool::platformInitialize): Set the CustomProtocolManagerClient.
319         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Remove code that is now shared.
320         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.cpp: Added.
321         (WebKit::CustomProtocolManagerProxy::startLoading):
322         (WebKit::CustomProtocolManagerProxy::processDidClose):
323         (WebKit::CustomProtocolManagerProxy::wasRedirectedToRequest):
324         (WebKit::CustomProtocolManagerProxy::didReceiveResponse):
325         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
326         * UIProcess/WebProcessPool.cpp:
327         (WebKit::globalURLSchemesWithCustomProtocolHandlers): Just moved here to use it from ensureNetworkProcess().
328         (WebKit::WebProcessPool::WebProcessPool): Remove soup ifdefs.
329         (WebKit::WebProcessPool::setCustomProtocolManagerClient): Moved from the soup implementation.
330         (WebKit::WebProcessPool::ensureNetworkProcess): Initialize custom protocols parameters.
331         (WebKit::WebProcessPool::registerSchemeForCustomProtocol): Register the protocol if not already registered globally.
332         (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): Remove soup ifdefs.
333         * UIProcess/WebProcessPool.h: Remove soup ifdefs.
334         * UIProcess/efl/RequestManagerClientEfl.cpp:
335         * UIProcess/soup/WebProcessPoolSoup.cpp:
336         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Remove code that is now shared.
337         * WebKit2.xcodeproj/project.pbxproj:
338
339 2017-02-21  Daewoong Jang  <daewoong.jang@navercorp.com>
340
341         Remove unused files.
342         https://bugs.webkit.org/show_bug.cgi?id=168656.
343
344         Reviewed by Csaba Osztrogonác.
345
346         Remove files which became unused after removal of EFL port.
347
348         * UIProcess/CoordinatedGraphics/PageViewportController.cpp: Removed.
349         * UIProcess/CoordinatedGraphics/PageViewportController.h: Removed.
350         * UIProcess/PageViewportControllerClient.h: Removed.
351
352 2017-02-21  Youenn Fablet  <youenn@apple.com>
353
354         [WebRTC] LibWebRTCSocket::SendTo message should have a correct SocketAddress
355         https://bugs.webkit.org/show_bug.cgi?id=168636
356
357         Reviewed by Eric Carlson.
358
359         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
360         (WebKit::LibWebRTCSocket::SendTo): Ensuring address remains valid during SendTo message lifetime.
361
362 2017-02-21  Alex Christensen  <achristensen@webkit.org>
363
364         Unreviewed, rolling out r212699.
365
366         Internal build not ready
367
368         Reverted changeset:
369
370         "[WebRTC][Mac] Activate libwebrtc"
371         https://bugs.webkit.org/show_bug.cgi?id=167293
372         http://trac.webkit.org/changeset/212699
373
374 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
375
376         Remove ENABLE_THREADED_COMPOSITOR build option
377         https://bugs.webkit.org/show_bug.cgi?id=168606
378
379         Reviewed by Michael Catanzaro.
380
381         Now that we have AC mode on demand with the threaded compositor there's no reason to keep the old AC code.
382
383         * PlatformGTK.cmake:
384         * WebProcess/WebPage/LayerTreeHost.cpp:
385         (WebKit::LayerTreeHost::create):
386         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: Removed.
387         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h: Removed.
388
389 2017-02-20  Youenn Fablet  <youenn@apple.com>
390
391         [WebRTC][Mac] Activate libwebrtc
392         https://bugs.webkit.org/show_bug.cgi?id=167293
393         <rdar://problem/30401864>
394
395         Reviewed by Alex Christensen.
396
397         Activating PeerConnection runtime flag based on successful loading of libwebrtc.dylib.
398
399         * Configurations/WebKit.xcconfig:
400         * Shared/WebPreferencesDefinitions.h:
401         * UIProcess/WebPreferences.cpp:
402         (WebKit::checkWebRTCAvailability):
403
404 2017-02-20  Ryan Haddad  <ryanhaddad@apple.com>
405
406         Unreviewed, rolling out r212685.
407
408         This change broke the 32-bit Sierra build.
409
410         Reverted changeset:
411
412         "Resource Load Statistics: Add alternate classification
413         method"
414         https://bugs.webkit.org/show_bug.cgi?id=168347
415         http://trac.webkit.org/changeset/212685
416
417 2017-02-20  John Wilander  <wilander@apple.com>
418
419         Resource Load Statistics: Add alternate classification method
420         https://bugs.webkit.org/show_bug.cgi?id=168347
421         <rdar://problem/30352793>
422
423         Reviewed by Alex Christensen.
424
425         This patch adds a CorePrediction-based classifier to the WebResourceLoadStatisticsStore.
426         The CorePrediction framework is introduced as a dependency for macOS and iOS. The patch
427         also adds functions to support layout tests of the feature.
428
429         * Configurations/BaseTarget.xcconfig:
430         * Configurations/WebKit.xcconfig:
431             Added dependency on CorePrediction.
432         * Platform/classifier: Added.
433         * Platform/classifier/ResourceLoadStatisticsClassifier.h: Added.
434             Pulls in the Cocoa-specific classifier for Cocoa-based platforms.
435         (WebKit::ResourceLoadStatisticsClassifier::ResourceLoadStatisticsClassifier):
436         * Platform/classifier/ResourceLoadStatisticsClassifierBase.cpp: Added.
437         (WebKit::ResourceLoadStatisticsClassifierBase::hasPrevalentResourceCharacteristics):
438             Shared classifier logic.
439         (WebKit::ResourceLoadStatisticsClassifierBase::classifyWithVectorThreshold):
440             Fallback classifier for when we don't have CorePrediction.
441         * Platform/classifier/ResourceLoadStatisticsClassifierBase.h: Added.
442         (WebKit::ResourceLoadStatisticsClassifierBase::ResourceLoadStatisticsClassifierBase):
443         (WebKit::ResourceLoadStatisticsClassifierBase::~ResourceLoadStatisticsClassifierBase):
444         * Platform/classifier/cocoa: Added.
445         * Platform/classifier/cocoa/CorePredictionSPI.h: Added.
446             Includes CorePrediction if available, otherwise declares needed symbols.
447             Always redeclares the functions so we'll get a build error if
448             CorePrediction changes.
449         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: Added.
450         (WebKit::ResourceLoadStatisticsClassifier::classify):
451         (WebKit::ResourceLoadStatisticsClassifier::storagePath):
452         (WebKit::ResourceLoadStatisticsClassifier::shouldUseCorePrediction):
453             The new classifier for Cocoa platforms.
454         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h: Added.
455         (WebKit::ResourceLoadStatisticsClassifier::ResourceLoadStatisticsClassifier):
456         * PlatformGTK.cmake:
457            Added Platform/classifier directory and ResourceLoadStatisticsClassifierBase.cpp.
458         * PlatformMac.cmake:
459            Added Platform/classifier and Platform/classifier/cocoa directories, and
460            source files ResourceLoadStatisticsClassifierBase.cpp and
461            ResourceLoadStatisticsClassifierCocoa.cpp
462         * Resources/ResourceLoadStatistics: Added.
463         * Resources/ResourceLoadStatistics/corePrediction_model: Added.
464             Model file to load into CorePrediction.
465         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
466         (WKResourceLoadStatisticsManagerSetSubframeUnderTopFrameOrigin):
467         (WKResourceLoadStatisticsManagerSetSubresourceUnderTopFrameOrigin):
468         (WKResourceLoadStatisticsManagerSetSubresourceUniqueRedirectTo):
469             Test infrastructure.
470         * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
471         * UIProcess/WebResourceLoadStatisticsManager.cpp:
472         (WebKit::WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin):
473         (WebKit::WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin):
474         (WebKit::WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo):
475             Test infrastructure.
476         * UIProcess/WebResourceLoadStatisticsManager.h:
477         * UIProcess/WebResourceLoadStatisticsStore.cpp:
478         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
479             Renamed m_storagePath to m_statisticsStoragePath for clarity.
480         (WebKit::WebResourceLoadStatisticsStore::classifyResource):
481             Now calls the classifier through its ResourceLoadStatisticsClassifier
482             member variable.
483         (WebKit::WebResourceLoadStatisticsStore::persistentStoragePath):
484             Renamed m_storagePath to m_statisticsStoragePath for clarity.
485         (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
486             Renamed m_storagePath to m_statisticsStoragePath for clarity.
487         (WebKit::WebResourceLoadStatisticsStore::hasPrevalentResourceCharacteristics): Deleted.
488         * UIProcess/WebResourceLoadStatisticsStore.h:
489         * WebKit2.xcodeproj/project.pbxproj:
490             Added the new classifier source files under Platform/classifier and the
491             corePrediction_model file under Resources/ResourceLoadStatistics.
492
493 2017-02-20  Wenson Hsieh  <wenson_hsieh@apple.com>
494
495         Add plumbing to the UI process for TextIndicatorData when computing the drag image
496         https://bugs.webkit.org/show_bug.cgi?id=168583
497         Work towards <rdar://problem/30313681>
498
499         Reviewed by Tim Horton.
500
501         Changes the SetDragImage IPC message to send TextIndicatorData over to the UI process. Also changes the boolean
502         isLink parameter to be a DragSourceAction instead, leaving it up to the receiving end (in the UI process) to
503         special case links.
504
505         Additionally, renames hasDataInteractionAtPosition to hasSelectionAtPosition to better reflect its purpose.
506
507         These changes are only infrastructural should not alter any behaviors.
508
509         * Shared/ios/InteractionInformationAtPosition.h:
510         * Shared/ios/InteractionInformationAtPosition.mm:
511         (WebKit::InteractionInformationAtPosition::encode):
512         (WebKit::InteractionInformationAtPosition::decode):
513         * UIProcess/API/Cocoa/WKWebView.mm:
514         (-[WKWebView _simulateDataInteractionGestureRecognized]):
515         (-[WKWebView _simulateDataInteractionEntered:]):
516         (-[WKWebView _simulateDataInteractionUpdated:]):
517         (-[WKWebView _simulateDataInteractionPerformOperation:]):
518         (-[WKWebView _simulateDataInteractionEnded:]):
519         (-[WKWebView _simulateDataInteractionSessionDidEnd:withOperation:]):
520         (-[WKWebView _simulateFailedDataInteractionWithIndex:]):
521         (-[WKWebView _simulateWillBeginDataInteractionWithIndex:withSession:]):
522         (-[WKWebView _simulatedItemsForDataInteractionWithIndex:]):
523         * UIProcess/API/Cocoa/_WKTestingDelegate.h:
524         * UIProcess/PageClient.h:
525         * UIProcess/WebPageProxy.h:
526         * UIProcess/WebPageProxy.messages.in:
527         * UIProcess/ios/PageClientImplIOS.h:
528         * UIProcess/ios/PageClientImplIOS.mm:
529         (WebKit::PageClientImpl::setDragImage):
530         (WebKit::PageClientImpl::startDataInteractionWithImage):
531         * UIProcess/ios/WKContentViewInteraction.h:
532         * UIProcess/ios/WKContentViewInteraction.mm:
533         (-[WKContentView hasSelectablePositionAtPoint:]):
534         (-[WKContentView pointIsInDataInteractionContent:]):
535         (-[WKContentView _dataInteractionGestureRecognizer]):
536         (-[WKContentView pointIsInAssistedNode:]):
537         * UIProcess/mac/PageClientImpl.h:
538         * UIProcess/mac/PageClientImpl.mm:
539         (WebKit::PageClientImpl::setDragImage):
540         * UIProcess/mac/WebPageProxyMac.mm:
541         (WebKit::WebPageProxy::setDragImage):
542         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
543         (WebKit::WebDragClient::startDrag):
544         * WebProcess/WebPage/ios/WebPageIOS.mm:
545         (WebKit::WebPage::getPositionInformation):
546
547 2017-02-20  David Quesada  <david_quesada@apple.com>
548
549         Don’t set NSURLSessionConfiguration’s _sourceApplicationAuditTokenData if _sourceApplicationBundleIdentifier is also set.
550         https://bugs.webkit.org/show_bug.cgi?id=168607
551
552         rdar://problem/30239618
553
554         Reviewed by Geoffrey Garen.
555
556         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
557         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
558         If the process pool configuration sets a source application bundle identifier, don't give the NSURLSession configuration
559         the audit token from the UI process, as it may be associated with an application with a conflicting bundle identifier.
560
561 2017-02-20  Ryan Haddad  <ryanhaddad@apple.com>
562
563         Unreviewed, rolling out r212632.
564
565         This change appears to have caused API test failures.
566
567         Reverted changeset:
568
569         "Reduce platform ifdefs in WebKit2 custom protocols
570         implementation"
571         https://bugs.webkit.org/show_bug.cgi?id=165028
572         http://trac.webkit.org/changeset/212632
573
574 2017-02-20  Youenn Fablet  <youenn@apple.com>
575
576         [WebRTC] Fix some memory leaks in libwebrtc binding code
577         https://bugs.webkit.org/show_bug.cgi?id=168596
578
579         Reviewed by Eric Carlson.
580
581         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
582         (WebKit::NetworkRTCProvider::OnMessage):
583
584 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
585
586         Remove code under USE(GRAPHICS_SURFACE)
587         https://bugs.webkit.org/show_bug.cgi?id=168592
588
589         Reviewed by Michael Catanzaro.
590
591         This was only used by EFL port.
592
593         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
594         (IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::encode):
595         (IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::decode):
596         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h:
597         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
598         (WebKit::CoordinatedGraphicsScene::syncPlatformLayerIfNeeded):
599         (WebKit::CoordinatedGraphicsScene::deleteLayer):
600         (WebKit::CoordinatedGraphicsScene::assignImageBackingToLayer):
601         (WebKit::CoordinatedGraphicsScene::purgeGLResources):
602         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
603         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:
604         (WebKit::WebCoordinatedSurface::Handle::encode):
605         (WebKit::WebCoordinatedSurface::Handle::decode):
606         (WebKit::WebCoordinatedSurface::create):
607         (WebKit::WebCoordinatedSurface::createGraphicsContext):
608         (WebKit::WebCoordinatedSurface::createHandle):
609         (WebKit::WebCoordinatedSurface::copyToTexture):
610         * Shared/CoordinatedGraphics/WebCoordinatedSurface.h:
611
612 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
613
614         Reduce platform ifdefs in WebKit2 custom protocols implementation
615         https://bugs.webkit.org/show_bug.cgi?id=165028
616
617         Reviewed by Darin Adler.
618
619         Make mac implementation use the APICustomProtocolManagerClient to share more code with the soup based ports.
620
621         * CMakeLists.txt: Add CustomProtocolManagerProxy.cpp.
622         * PlatformEfl.cmake: Remove CustomProtocolManagerProxySoup.cpp.
623         * PlatformGTK.cmake: Ditto.
624         * PlatformMac.cmake: Remove CustomProtocolManagerProxyMac.mm.
625         * UIProcess/API/APICustomProtocolManagerClient.h:
626         (API::CustomProtocolManagerClient::startLoading): Make it void, since we were always returning true and the
627         returned value was ignored.
628         * UIProcess/API/efl/ewk_url_scheme_request.cpp:
629         (EwkUrlSchemeRequest::finish): Update to new CustomProtocolManagerProxy API.
630         * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp:
631         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
632         (webkitURISchemeRequestReadCallback): Ditto.
633         * UIProcess/Cocoa/CustomProtocolManagerClient.h: Added.
634         * UIProcess/Cocoa/CustomProtocolManagerClient.mm: Added.
635         (-[WKCustomProtocolLoader initWithCustomProtocolManagerProxy:customProtocolID:request:]):
636         (-[WKCustomProtocolLoader dealloc]):
637         (-[WKCustomProtocolLoader connection:didFailWithError:]):
638         (-[WKCustomProtocolLoader connection:didReceiveResponse:]):
639         (-[WKCustomProtocolLoader connection:didReceiveData:]):
640         (-[WKCustomProtocolLoader connection:willSendRequest:redirectResponse:]):
641         (-[WKCustomProtocolLoader connectionDidFinishLoading:]):
642         (WebKit::CustomProtocolManagerClient::startLoading):
643         (WebKit::CustomProtocolManagerClient::stopLoading):
644         (WebKit::CustomProtocolManagerClient::invalidate):
645         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
646         (WebKit::WebProcessPool::platformInitialize): Set the CustomProtocolManagerClient.
647         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Remove code that is now shared.
648         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.cpp: Added.
649         (WebKit::CustomProtocolManagerProxy::startLoading):
650         (WebKit::CustomProtocolManagerProxy::processDidClose):
651         (WebKit::CustomProtocolManagerProxy::wasRedirectedToRequest):
652         (WebKit::CustomProtocolManagerProxy::didReceiveResponse):
653         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
654         * UIProcess/WebProcessPool.cpp:
655         (WebKit::globalURLSchemesWithCustomProtocolHandlers): Just moved here to use it from ensureNetworkProcess().
656         (WebKit::WebProcessPool::WebProcessPool): Remove soup ifdefs.
657         (WebKit::WebProcessPool::setCustomProtocolManagerClient): Moved from the soup implementation.
658         (WebKit::WebProcessPool::ensureNetworkProcess): Initialize custom protocols parameters.
659         (WebKit::WebProcessPool::registerSchemeForCustomProtocol): Register the protocol if not already registered globally.
660         (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): Remove soup ifdefs.
661         * UIProcess/WebProcessPool.h: Remove soup ifdefs.
662         * UIProcess/efl/RequestManagerClientEfl.cpp:
663         * UIProcess/soup/WebProcessPoolSoup.cpp:
664         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Remove code that is now shared.
665         * WebKit2.xcodeproj/project.pbxproj:
666
667 2017-02-20  Manuel Rego Casasnovas  <rego@igalia.com>
668
669         [css-grid] Remove compilation flag ENABLE_CSS_GRID_LAYOUT
670         https://bugs.webkit.org/show_bug.cgi?id=167693
671
672         Reviewed by Sergio Villar Senin.
673
674         * Configurations/FeatureDefines.xcconfig:
675         * WebProcess/InjectedBundle/InjectedBundle.cpp:
676         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
677         * WebProcess/WebPage/WebPage.cpp:
678         (WebKit::WebPage::updatePreferences):
679
680 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
681
682         REGRESSION(r212345): [GTK] ASSERT(cookieChangeCallbackMap().contains(jar)) failed in WebCore::stopObservingCookieChanges:54
683         https://bugs.webkit.org/show_bug.cgi?id=168375
684
685         Reviewed by Alex Christensen.
686
687         Simplify the cookies change notification. The current approach of the UI process telling the network process
688         when to start and stop observing cookie changes is quite fragile and error prone. In the GTK+ port we always
689         observe cookies, so our cookie manager always calls start in the constructor and stop in the destructor.
690         Everything would be a lot simpler if the network process always monitored cookies.
691
692         * NetworkProcess/soup/NetworkSessionSoup.cpp:
693         (WebKit::NetworkSessionSoup::NetworkSessionSoup): Set cookies observer handler for the session.
694         (WebKit::NetworkSessionSoup::~NetworkSessionSoup): Remove the cookies observer handler.
695         * UIProcess/API/gtk/WebKitCookieManager.cpp:
696         (_WebKitCookieManagerPrivate::~_WebKitCookieManagerPrivate): Remove the cookies observer callback.
697         (webkit_cookie_manager_class_init): Remove dispose implementation that is no longer needed.
698         (webkitCookieManagerCreate): Set the cookies observer callback.
699         (webkit_cookie_manager_set_persistent_storage): Remove code to start/stop observing cookies when the jar
700         changes, the network process deals with that now.
701         (webkitCookieManagerDispose): Deleted.
702         * UIProcess/WebCookieManagerProxy.cpp:
703         (WebKit::WebCookieManagerProxy::startObservingCookieChanges): Remove the optional callback method in favor of an
704         explicit method to the set the callback that doesn't send the StartObservingCookieChanges message to the network
705         process.
706         (WebKit::WebCookieManagerProxy::stopObservingCookieChanges): Do not change the callback map here.
707         (WebKit::WebCookieManagerProxy::setCookieObserverCallback): Add the callback to the map or remove the session if
708         nullptr is given.
709         * UIProcess/WebCookieManagerProxy.h:
710         * WebProcess/Cookies/WebCookieManager.cpp:
711         (WebKit::WebCookieManager::notifyCookiesDidChange): Send CookiesDidChange message to the UI process.
712         (WebKit::WebCookieManager::startObservingCookieChanges): Use notifyCookiesDidChange().
713         * WebProcess/Cookies/WebCookieManager.h:
714         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
715         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy): Set the policy on all sessions. Code moved from
716         WebFrameNetworkingContext since it doesn't belong there.
717         (WebKit::WebCookieManager::setCookiePersistentStorage): Use new method to set the cookie storage in the
718         NetworkStorageSession.
719         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
720         (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts): Deleted.
721         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
722
723 2017-02-19  Chris Dumez  <cdumez@apple.com>
724
725         [WK2] Support termination of unresponsive WebContent processes that are in the background
726         https://bugs.webkit.org/show_bug.cgi?id=168479
727         <rdar://problem/30558745>
728
729         Reviewed by Antti Koivisto.
730
731         Support termination of unresponsive WebContent processes that are in the background.
732         This protects us against cases where a background tab is unresponsive and has high CPU
733         usage, thus draining the battery without the user knowing about it (e.g.
734         <rdar://problem/29808005>).
735
736         The feature works as follows:
737         - If a WebProcessProxy has pages but none of them are visible, then it will check
738           regularly if its associated WebContent process is still responsive.
739         - Every time we find that the WebContent process is responsive, we exponentially
740           back off the timer to avoid waking up the process too often. The timer initially
741           uses a 20 seconds interval and can back off up to 8 hours.
742         - If the WebContent process is unresponsive, then we terminate it. No notification
743           is shown to the user and the termination is not immediately observable since the
744           tab is not visible and its title remains. The tab is not immediately reloaded
745           so as to avoid getting back into a bad state in the background (and have a
746           yo-yo effect).
747         - If the user switches to a tab that was previously killed for being unresponsive
748           while in the background, we will then reload the tab in a fresh WebContent
749           process. The crash banner will only be shown if the tab has ever been visible.
750           If it wasn't ever visible (e.g. session restore case), then it will look as if
751           the tab loads for the first time when the user switches to it.
752
753         The functionality is disabled by default and can be enabled by the client via the new
754         WKContextSetUnresponsiveBackgroundProcessesTerminationEnabled() private API.
755
756         * CMakeLists.txt:
757         * UIProcess/API/APIProcessPoolConfiguration.cpp:
758         (API::ProcessPoolConfiguration::copy):
759         * UIProcess/API/APIProcessPoolConfiguration.h:
760         * UIProcess/API/C/WKContext.cpp:
761         (WKContextSetUnresponsiveBackgroundProcessesTerminationEnabled):
762         * UIProcess/API/C/WKContextPrivate.h:
763         * UIProcess/UnresponsiveWebProcessTerminator.cpp: Added.
764         (WebKit::UnresponsiveWebProcessTerminator::UnresponsiveWebProcessTerminator):
765         (WebKit::UnresponsiveWebProcessTerminator::updateState):
766         (WebKit::pagesCopy):
767         (WebKit::UnresponsiveWebProcessTerminator::timerFired):
768         * UIProcess/UnresponsiveWebProcessTerminator.h: Added.
769         (WebKit::UnresponsiveWebProcessTerminator::shouldBeActive):
770         * UIProcess/WebPageProxy.cpp:
771         (WebKit::WebPageProxy::reattachToWebProcess):
772         (WebKit::WebPageProxy::reloadAfterBeingKilledInBackground):
773         (WebKit::WebPageProxy::dispatchActivityStateChange):
774         (WebKit::WebPageProxy::terminateProcess):
775         (WebKit::WebPageProxy::resetStateAfterProcessExited):
776         * UIProcess/WebPageProxy.h:
777         * UIProcess/WebProcessProxy.cpp:
778         (WebKit::WebProcessProxy::WebProcessProxy):
779         (WebKit::m_backgroundResponsivenessTimer):
780         (WebKit::WebProcessProxy::createWebPage):
781         (WebKit::WebProcessProxy::addExistingWebPage):
782         (WebKit::WebProcessProxy::removeWebPage):
783         (WebKit::WebProcessProxy::updateBackgroundResponsivenessTimer):
784         * UIProcess/WebProcessProxy.h:
785         (WebKit::WebProcessProxy::visiblePageCount):
786         * WebKit2.xcodeproj/project.pbxproj:
787
788 2017-02-18  Michael Catanzaro  <mcatanzaro@igalia.com>
789
790         Remove COORDINATED_GRAPHICS_MULTIPROCESS
791         https://bugs.webkit.org/show_bug.cgi?id=168514
792
793         Reviewed by Darin Adler.
794
795         * Shared/DrawingAreaInfo.h:
796         * UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
797         (WKViewFindZoomableAreaForRect):
798         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
799         (WebKit::AcceleratedDrawingAreaProxy::AcceleratedDrawingAreaProxy):
800         * UIProcess/AcceleratedDrawingAreaProxy.h:
801         (WebKit::AcceleratedDrawingAreaProxy::coordinatedLayerTreeHostProxy): Deleted.
802         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp: Removed.
803         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h: Removed.
804         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in: Removed.
805         * UIProcess/CoordinatedGraphics/PageViewportController.cpp:
806         (WebKit::PageViewportController::pageTransitionViewportReady):
807         * UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp: Removed.
808         * UIProcess/DrawingAreaProxy.h:
809         * UIProcess/PageClient.h:
810         * UIProcess/WebPageProxy.cpp:
811         (WebKit::WebPageProxy::pageDidRequestScroll): Deleted.
812         (WebKit::WebPageProxy::pageTransitionViewportReady): Deleted.
813         (WebKit::WebPageProxy::didRenderFrame): Deleted.
814         (WebKit::WebPageProxy::commitPageTransitionViewport): Deleted.
815         * UIProcess/WebPageProxy.h:
816         * UIProcess/WebPageProxy.messages.in:
817         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
818         (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea):
819         (WebKit::AcceleratedDrawingArea::updateBackingStoreState):
820         (WebKit::AcceleratedDrawingArea::didReceiveCoordinatedLayerTreeHostMessage): Deleted.
821         * WebProcess/WebPage/AcceleratedDrawingArea.h:
822         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
823         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
824         (WebKit::CoordinatedLayerTreeHost::commitSceneState):
825         (WebKit::CoordinatedLayerTreeHost::createCoordinatedSurface):
826         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
827         * WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp: Removed.
828         * WebProcess/WebPage/DrawingArea.cpp:
829         (WebKit::DrawingArea::create):
830         * WebProcess/WebPage/DrawingArea.h:
831         * WebProcess/WebPage/LayerTreeHost.cpp:
832         (WebKit::LayerTreeHost::create):
833         * WebProcess/WebPage/LayerTreeHost.h:
834         * WebProcess/WebPage/WebPage.cpp:
835         (WebKit::WebPage::~WebPage):
836         (WebKit::WebPage::pageDidRequestScroll):
837         (WebKit::WebPage::didCompletePageTransition):
838         (WebKit::WebPage::didReceiveMessage):
839         (WebKit::WebPage::commitPageTransitionViewport): Deleted.
840         * WebProcess/WebPage/WebPage.h:
841         * WebProcess/WebPage/WebPage.messages.in:
842
843 2017-02-18  Michael Catanzaro  <mcatanzaro@igalia.com>
844
845         [GTK] Cannot paste primary selection into web view in Wayland
846         https://bugs.webkit.org/show_bug.cgi?id=166949
847
848         Reviewed by Carlos Garcia Campos.
849
850         Once upon a time, primary selection (middle-click paste) was not supported in Wayland. At
851         the time, I changed this function to report that primary selection was unsupported. But
852         nowadays, primary selection works fine in all GTK+ applications except WebKit. All we have
853         to do to make it work in WebKit is change this return value.
854
855         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
856         (WebKit::WebEditorClient::supportsGlobalSelection):
857
858 2017-02-17  Brian Burg  <bburg@apple.com>
859
860         Web Inspector: RTL: Inspector window should dock to the left when using RTL layout direction
861         https://bugs.webkit.org/show_bug.cgi?id=168273
862         <rdar://problem/29949325>
863
864         Reviewed by Matt Baker.
865
866         Add the ability to dock Web Inspector to the left of the inspected view.
867         The frontend decides whether the Dock to Side button docks left or right
868         based on the current layout direction.
869
870         * UIProcess/WebInspectorProxy.cpp:
871         (WebKit::WebInspectorProxy::attachLeft):
872         (WebKit::WebInspectorProxy::attach):
873         (WebKit::WebInspectorProxy::createInspectorPage):
874         * UIProcess/WebInspectorProxy.h:
875         * UIProcess/WebInspectorProxy.messages.in:
876         Add plumbing for new dock configuration.
877
878         * UIProcess/mac/WebInspectorProxyMac.mm:
879         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
880         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
881         (WebKit::WebInspectorProxy::platformAttach):
882         Adapt existing sizing logic to work for docking to left.
883
884         * WebProcess/WebPage/WebInspectorUI.cpp:
885         (WebKit::WebInspectorUI::requestSetDockSide):
886         (WebKit::WebInspectorUI::setDockSide):
887         * WebProcess/WebPage/WebInspectorUI.h:
888         (WebKit::WebInspectorUI::attachedLeft):
889         * WebProcess/WebPage/WebInspectorUI.messages.in:
890         Add plumbing for new dock configuration.
891
892 2017-02-16  Simon Fraser  <simon.fraser@apple.com>
893
894         Allow PlatformCALayers to specify that they want deep color backing store
895         https://bugs.webkit.org/show_bug.cgi?id=168495
896
897         Reviewed by Tim Horton.
898
899         Currently capable iOS devices get deep color backing store by virtue of a supports
900         check in PlatformCALayerCocoa::PlatformCALayerCocoa(), and LegacyTileGridTile.
901
902         Future work will make layer contents format selection more complex, so express the need
903         for deep color on PlatformCALayer, and have the creators of PlatformCALayer (mainly the
904         flavors of GraphicsLayerCA) choose for them to support deep color. A bit of special-casing
905         is needed to propagte the state to TileControllers.
906         
907         The deep-colorness now propagates from PlatformCALayerRemote to RemoteLayerBackingStore,
908         instead of RemoteLayerBackingStore looking at the properties of the screen directly.
909
910         Remove PlatformCALayer::LayerTypeWebTiledLayer which was only used for the old CATiledLayers
911         that we no longer use.
912
913         * Shared/mac/RemoteLayerBackingStore.h:
914         * Shared/mac/RemoteLayerBackingStore.mm:
915         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
916         (WebKit::RemoteLayerBackingStore::bytesPerPixel):
917         (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
918         (WebKit::RemoteLayerBackingStore::drawInContext):
919         (WebKit::RemoteLayerBackingStore::surfaceBufferFormat):
920         (WebKit::bufferFormat): Deleted.
921         * WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp:
922         (WebKit::GraphicsLayerCARemote::createPlatformCALayer):
923         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
924         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
925         (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
926         (WebKit::PlatformCALayerRemote::updateBackingStore):
927         (WebKit::PlatformCALayerRemote::wantsDeepColorBackingStore):
928         (WebKit::PlatformCALayerRemote::setWantsDeepColorBackingStore):
929         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
930         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
931         (WebKit::PlatformCALayerRemoteTiledBacking::wantsDeepColorBackingStore):
932         (WebKit::PlatformCALayerRemoteTiledBacking::setWantsDeepColorBackingStore):
933         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
934
935 2017-02-17  Wenson Hsieh  <wenson_hsieh@apple.com>
936
937         [WK2] Action sheet should not dismiss when a DDAction with user interface is being presented
938         https://bugs.webkit.org/show_bug.cgi?id=168528
939         <rdar://problem/30515324>
940
941         Reviewed by Beth Dakin.
942
943         After r211643, -[WKActionSheet doneWithSheet] now dismisses the presenting view controller. This is called when
944         interaction with the sheet is finished and is a reasonable thing to do in most cases. However, when using data
945         detectors, we don't want to dismiss the presenting view controller, since DataDetector handles dismissing on its
946         own and expects that its completion handler will be invoked.
947
948         To fix this, we add a parameter to doneWithSheet: to indicate whether or not we should additionally dismiss the
949         presenting view controller, and pass in NO in the case where we are handing control over to DataDetector.
950
951         * UIProcess/ios/WKActionSheet.h:
952         * UIProcess/ios/WKActionSheet.mm:
953         (-[WKActionSheet doneWithSheet:]):
954         (-[WKActionSheet doneWithSheet]): Deleted.
955         * UIProcess/ios/WKActionSheetAssistant.mm:
956         (-[WKActionSheetAssistant showDataDetectorsSheet]):
957         (-[WKActionSheetAssistant cleanupSheet]):
958
959 2017-02-17  Michael Catanzaro  <mcatanzaro@igalia.com>
960
961         Remove EFL from WebKit2
962         https://bugs.webkit.org/show_bug.cgi?id=168511
963
964         Reviewed by Alex Christensen.
965
966         * Platform/IPC/unix/ConnectionUnix.cpp:
967         (IPC::Connection::platformInvalidate):
968         (IPC::Connection::open):
969         * Platform/Module.h:
970         * PlatformEfl.cmake: Removed.
971         * PluginProcess/unix/PluginProcessMainUnix.cpp:
972         * Shared/API/APIObject.h:
973         * Shared/API/c/WKBase.h:
974         * Shared/API/c/WKSharedAPICast.h:
975         (WebKit::toAPI):
976         (WebKit::toImpl):
977         * Shared/NativeWebKeyboardEvent.h:
978         (WebKit::NativeWebKeyboardEvent::isFakeEventForComposition):
979         (WebKit::NativeWebKeyboardEvent::isFiltered): Deleted.
980         * Shared/NativeWebMouseEvent.h:
981         (WebKit::NativeWebMouseEvent::nativeEvent):
982         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent): Deleted.
983         * Shared/NativeWebTouchEvent.h:
984         (WebKit::NativeWebTouchEvent::nativeEvent):
985         * Shared/NativeWebWheelEvent.h:
986         (WebKit::NativeWebWheelEvent::nativeEvent):
987         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
988         (WebKit::NetscapePluginModule::determineQuirks):
989         * Shared/WebPreferencesDefinitions.h:
990         * UIProcess/API/APIWebsiteDataStore.cpp:
991         * UIProcess/API/C/WKAPICast.h:
992         * UIProcess/API/C/WKTextChecker.cpp:
993         * UIProcess/API/C/WKTextChecker.h:
994         * UIProcess/ChildProcessProxy.cpp:
995         (WebKit::ChildProcessProxy::getLaunchOptions):
996         * UIProcess/CoordinatedGraphics/PageViewportController.cpp:
997         (WebKit::PageViewportController::pixelAlignedFloatPoint):
998         * UIProcess/InspectorServer/WebInspectorServer.h:
999         * UIProcess/Launcher/ProcessLauncher.h:
1000         * UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp:
1001         * UIProcess/PageClient.h:
1002         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
1003         (WebKit::PluginProcessProxy::scanPlugin):
1004         * UIProcess/WebInspectorProxy.h:
1005         * UIProcess/WebPageProxy.h:
1006         * WebKit2.xcodeproj/project.pbxproj:
1007         * WebProcess/InjectedBundle/InjectedBundle.h:
1008         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
1009         (WebKit::getPluginDisplay):
1010         (WebKit::x11Screen):
1011         (WebKit::displayDepth):
1012         (WebKit::rootWindowID):
1013         (WebKit::NetscapePluginX11::paint):
1014         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1015         (WebKit::WebChromeClient::selectItemWritingDirectionIsNatural):
1016         (WebKit::WebChromeClient::pageExtendedBackgroundColorDidChange):
1017         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1018         (WebKit::WebEditorClient::shouldEraseMarkersAfterChangeSelection):
1019         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1020         (WebKit::WebFrameLoaderClient::saveViewStateToItem):
1021         (WebKit::WebFrameLoaderClient::restoreViewState):
1022         (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
1023         * WebProcess/WebPage/WebPage.cpp:
1024         (WebKit::WebPage::WebPage):
1025         * WebProcess/WebPage/WebPage.h:
1026         * WebProcess/WebPage/WebPage.messages.in:
1027         * config.h:
1028
1029 2017-02-15  Brady Eidson  <beidson@apple.com>
1030
1031         Stop backing up localStorage databases to iCloud by default.
1032         <rdar://problem/29045531> and https://bugs.webkit.org/show_bug.cgi?id=168388
1033
1034         Reviewed by Geoffrey Garen.
1035
1036         * UIProcess/Cocoa/VersionChecks.h:
1037
1038         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1039         (WebKit::LocalStorageDatabaseTracker::databasePath):
1040         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
1041         * UIProcess/Storage/ios/LocalStorageDatabaseTrackerIOS.mm: Copied from Source/WebKit2/UIProcess/Cocoa/VersionChecks.h.
1042         (WebKit::LocalStorageDatabaseTracker::platformExcludeFromBackup):
1043
1044         * WebKit2.xcodeproj/project.pbxproj:
1045
1046 2017-02-16  Aakash Jain  <aakash_jain@apple.com>
1047
1048         Remove unused methods WKPageGetDebugPaintFlags and WKPageSetDebugPaintFlags
1049         https://bugs.webkit.org/show_bug.cgi?id=168464
1050
1051         Reviewed by Alexey Proskuryakov.
1052
1053         * UIProcess/API/C/WKPagePrivate.h:
1054
1055 2017-02-16  Youenn Fablet  <youenn@apple.com>
1056
1057         [WebRTC] libwebrtc socket addresses should not be passed as strings
1058         https://bugs.webkit.org/show_bug.cgi?id=168474
1059
1060         Reviewed by Alex Christensen.
1061
1062         Removing all seralization of socket addresses as strings.
1063         Instead, a dedicated serialization is provided.
1064         This allows proper handling of various cases like addresses with both hostnames and resolved IPs.
1065
1066         * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
1067         (WebKit::LibWebRTCSocketClient::signalReadPacket):
1068         (WebKit::LibWebRTCSocketClient::signalSentPacket):
1069         (WebKit::LibWebRTCSocketClient::signalAddressReady):
1070         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
1071         (WebKit::NetworkRTCProvider::createUDPSocket):
1072         (WebKit::NetworkRTCProvider::createServerTCPSocket):
1073         (WebKit::NetworkRTCProvider::createClientTCPSocket):
1074         * NetworkProcess/webrtc/NetworkRTCProvider.h:
1075         * NetworkProcess/webrtc/NetworkRTCProvider.messages.in:
1076         * NetworkProcess/webrtc/NetworkRTCSocket.cpp:
1077         (WebKit::NetworkRTCSocket::sendTo):
1078         * NetworkProcess/webrtc/NetworkRTCSocket.h:
1079         * NetworkProcess/webrtc/NetworkRTCSocket.messages.in:
1080         * Shared/RTCNetwork.cpp:
1081         (WebKit::RTCNetwork::SocketAddress::decode):
1082         (WebKit::RTCNetwork::SocketAddress::encode):
1083         * Shared/RTCNetwork.h:
1084         (WebKit::RTCNetwork::SocketAddress::SocketAddress):
1085         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
1086         (WebKit::LibWebRTCSocket::signalAddressReady):
1087         (WebKit::LibWebRTCSocket::SendTo):
1088         * WebProcess/Network/webrtc/LibWebRTCSocket.h:
1089         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
1090         (WebKit::LibWebRTCSocketFactory::CreateServerTcpSocket):
1091         (WebKit::LibWebRTCSocketFactory::CreateUdpSocket):
1092         (WebKit::LibWebRTCSocketFactory::CreateClientTcpSocket):
1093         * WebProcess/Network/webrtc/WebRTCSocket.cpp:
1094         (WebKit::WebRTCSocket::signalAddressReady):
1095         * WebProcess/Network/webrtc/WebRTCSocket.h:
1096         * WebProcess/Network/webrtc/WebRTCSocket.messages.in:
1097
1098 2017-02-16  Daniel Bates  <dabates@apple.com>
1099
1100         Remove Chromium-specific code to call FrameLoaderClient::redirectDataToPlugin(nullptr)
1101         https://bugs.webkit.org/show_bug.cgi?id=168417
1102         <rdar://problem/30541748>
1103
1104         Reviewed by Brent Fulgham.
1105
1106         Update override of FrameLoaderClient::redirectDataToPlugin() to take a Widget& instead of a
1107         Widget* as it is always called with a valid Widget.
1108
1109         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1110         (WebKit::WebFrameLoaderClient::redirectDataToPlugin):
1111         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1112         * mac/WebKit2.order: Remove symbol for WebFrameLoaderClient::redirectDataToPlugin() that took a Widget*
1113         as it no longer exists. I am unclear if this file is still meaningful as it was last modified in
1114         r180570 (2 years ago) though Xcode still references this ordering file (why?).
1115
1116 2017-02-16  Alex Christensen  <achristensen@webkit.org>
1117
1118         Remove EFL-specific files in WebKit2.
1119
1120         Rubber-stamped by Anders Carlsson
1121
1122         * DatabaseProcess/efl: Removed.
1123         * DatabaseProcess/efl/DatabaseProcessMainEfl.cpp: Removed.
1124         * NetworkProcess/Downloads/efl: Removed.
1125         * NetworkProcess/Downloads/efl/DownloadSoupErrorsEfl.cpp: Removed.
1126         * NetworkProcess/efl: Removed.
1127         * NetworkProcess/efl/NetworkProcessMainEfl.cpp: Removed.
1128         * Platform/efl: Removed.
1129         * Platform/efl/ModuleEfl.cpp: Removed.
1130         * Shared/API/c/efl: Removed.
1131         * Shared/API/c/efl/WKArrayEfl.cpp: Removed.
1132         * Shared/API/c/efl/WKArrayEfl.h: Removed.
1133         * Shared/API/c/efl/WKBaseEfl.h: Removed.
1134         * Shared/efl: Removed.
1135         * Shared/efl/NativeWebKeyboardEventEfl.cpp: Removed.
1136         * Shared/efl/NativeWebTouchEventEfl.cpp: Removed.
1137         * Shared/efl/NativeWebWheelEventEfl.cpp: Removed.
1138         * Shared/efl/ProcessExecutablePathEfl.cpp: Removed.
1139         * Shared/efl/WebEventFactory.cpp: Removed.
1140         * Shared/efl/WebEventFactory.h: Removed.
1141         * UIProcess/API/C/efl: Removed.
1142         * UIProcess/API/C/efl/WKAPICastEfl.h: Removed.
1143         * UIProcess/API/C/efl/WKColorPickerResultListener.cpp: Removed.
1144         * UIProcess/API/C/efl/WKColorPickerResultListener.h: Removed.
1145         * UIProcess/API/C/efl/WKEventEfl.cpp: Removed.
1146         * UIProcess/API/C/efl/WKEventEfl.h: Removed.
1147         * UIProcess/API/C/efl/WKViewEfl.cpp: Removed.
1148         * UIProcess/API/C/efl/WKViewEfl.h: Removed.
1149         * UIProcess/API/cpp/efl: Removed.
1150         * UIProcess/API/cpp/efl/WKEinaSharedString.cpp: Removed.
1151         * UIProcess/API/cpp/efl/WKEinaSharedString.h: Removed.
1152         * UIProcess/API/efl: Removed.
1153         * UIProcess/API/efl/APIWebsiteDataStoreEfl.cpp: Removed.
1154         * UIProcess/API/efl/EWebKit2.h.in: Removed.
1155         * UIProcess/API/efl/EwkView.cpp: Removed.
1156         * UIProcess/API/efl/EwkView.h: Removed.
1157         * UIProcess/API/efl/EwkViewCallbacks.h: Removed.
1158         * UIProcess/API/efl/GestureRecognizer.cpp: Removed.
1159         * UIProcess/API/efl/GestureRecognizer.h: Removed.
1160         * UIProcess/API/efl/SnapshotImageGL.cpp: Removed.
1161         * UIProcess/API/efl/SnapshotImageGL.h: Removed.
1162         * UIProcess/API/efl/WebAccessibility.cpp: Removed.
1163         * UIProcess/API/efl/WebAccessibility.h: Removed.
1164         * UIProcess/API/efl/ewk_application_cache_manager.cpp: Removed.
1165         * UIProcess/API/efl/ewk_application_cache_manager.h: Removed.
1166         * UIProcess/API/efl/ewk_application_cache_manager_private.h: Removed.
1167         * UIProcess/API/efl/ewk_auth_request.cpp: Removed.
1168         * UIProcess/API/efl/ewk_auth_request.h: Removed.
1169         * UIProcess/API/efl/ewk_auth_request_private.h: Removed.
1170         * UIProcess/API/efl/ewk_back_forward_list.cpp: Removed.
1171         * UIProcess/API/efl/ewk_back_forward_list.h: Removed.
1172         * UIProcess/API/efl/ewk_back_forward_list_item.cpp: Removed.
1173         * UIProcess/API/efl/ewk_back_forward_list_item.h: Removed.
1174         * UIProcess/API/efl/ewk_back_forward_list_item_private.h: Removed.
1175         * UIProcess/API/efl/ewk_back_forward_list_private.h: Removed.
1176         * UIProcess/API/efl/ewk_color_picker.cpp: Removed.
1177         * UIProcess/API/efl/ewk_color_picker.h: Removed.
1178         * UIProcess/API/efl/ewk_color_picker_private.h: Removed.
1179         * UIProcess/API/efl/ewk_context.cpp: Removed.
1180         * UIProcess/API/efl/ewk_context.h: Removed.
1181         * UIProcess/API/efl/ewk_context_menu.cpp: Removed.
1182         * UIProcess/API/efl/ewk_context_menu.h: Removed.
1183         * UIProcess/API/efl/ewk_context_menu_item.cpp: Removed.
1184         * UIProcess/API/efl/ewk_context_menu_item.h: Removed.
1185         * UIProcess/API/efl/ewk_context_menu_item_private.h: Removed.
1186         * UIProcess/API/efl/ewk_context_menu_private.h: Removed.
1187         * UIProcess/API/efl/ewk_context_private.h: Removed.
1188         * UIProcess/API/efl/ewk_cookie_manager.cpp: Removed.
1189         * UIProcess/API/efl/ewk_cookie_manager.h: Removed.
1190         * UIProcess/API/efl/ewk_cookie_manager_private.h: Removed.
1191         * UIProcess/API/efl/ewk_database_manager.cpp: Removed.
1192         * UIProcess/API/efl/ewk_database_manager.h: Removed.
1193         * UIProcess/API/efl/ewk_database_manager_private.h: Removed.
1194         * UIProcess/API/efl/ewk_download_job.cpp: Removed.
1195         * UIProcess/API/efl/ewk_download_job.h: Removed.
1196         * UIProcess/API/efl/ewk_download_job_private.h: Removed.
1197         * UIProcess/API/efl/ewk_error.cpp: Removed.
1198         * UIProcess/API/efl/ewk_error.h: Removed.
1199         * UIProcess/API/efl/ewk_error_private.h: Removed.
1200         * UIProcess/API/efl/ewk_favicon_database.cpp: Removed.
1201         * UIProcess/API/efl/ewk_favicon_database.h: Removed.
1202         * UIProcess/API/efl/ewk_favicon_database_private.h: Removed.
1203         * UIProcess/API/efl/ewk_file_chooser_request.cpp: Removed.
1204         * UIProcess/API/efl/ewk_file_chooser_request.h: Removed.
1205         * UIProcess/API/efl/ewk_file_chooser_request_private.h: Removed.
1206         * UIProcess/API/efl/ewk_form_submission_request.cpp: Removed.
1207         * UIProcess/API/efl/ewk_form_submission_request.h: Removed.
1208         * UIProcess/API/efl/ewk_form_submission_request_private.h: Removed.
1209         * UIProcess/API/efl/ewk_intro.h: Removed.
1210         * UIProcess/API/efl/ewk_main.cpp: Removed.
1211         * UIProcess/API/efl/ewk_main.h: Removed.
1212         * UIProcess/API/efl/ewk_main_private.h: Removed.
1213         * UIProcess/API/efl/ewk_navigation_data.cpp: Removed.
1214         * UIProcess/API/efl/ewk_navigation_data.h: Removed.
1215         * UIProcess/API/efl/ewk_navigation_data_private.h: Removed.
1216         * UIProcess/API/efl/ewk_navigation_policy_decision.cpp: Removed.
1217         * UIProcess/API/efl/ewk_navigation_policy_decision.h: Removed.
1218         * UIProcess/API/efl/ewk_navigation_policy_decision_private.h: Removed.
1219         * UIProcess/API/efl/ewk_object.cpp: Removed.
1220         * UIProcess/API/efl/ewk_object.h: Removed.
1221         * UIProcess/API/efl/ewk_object_private.h: Removed.
1222         * UIProcess/API/efl/ewk_page_group.cpp: Removed.
1223         * UIProcess/API/efl/ewk_page_group.h: Removed.
1224         * UIProcess/API/efl/ewk_page_group_private.h: Removed.
1225         * UIProcess/API/efl/ewk_popup_menu.cpp: Removed.
1226         * UIProcess/API/efl/ewk_popup_menu.h: Removed.
1227         * UIProcess/API/efl/ewk_popup_menu_item.cpp: Removed.
1228         * UIProcess/API/efl/ewk_popup_menu_item.h: Removed.
1229         * UIProcess/API/efl/ewk_popup_menu_item_private.h: Removed.
1230         * UIProcess/API/efl/ewk_popup_menu_private.h: Removed.
1231         * UIProcess/API/efl/ewk_security_origin.cpp: Removed.
1232         * UIProcess/API/efl/ewk_security_origin.h: Removed.
1233         * UIProcess/API/efl/ewk_security_origin_private.h: Removed.
1234         * UIProcess/API/efl/ewk_settings.cpp: Removed.
1235         * UIProcess/API/efl/ewk_settings.h: Removed.
1236         * UIProcess/API/efl/ewk_settings_private.h: Removed.
1237         * UIProcess/API/efl/ewk_storage_manager.cpp: Removed.
1238         * UIProcess/API/efl/ewk_storage_manager.h: Removed.
1239         * UIProcess/API/efl/ewk_storage_manager_private.h: Removed.
1240         * UIProcess/API/efl/ewk_text_checker.cpp: Removed.
1241         * UIProcess/API/efl/ewk_text_checker.h: Removed.
1242         * UIProcess/API/efl/ewk_text_checker_private.h: Removed.
1243         * UIProcess/API/efl/ewk_touch.h: Removed.
1244         * UIProcess/API/efl/ewk_url_request.cpp: Removed.
1245         * UIProcess/API/efl/ewk_url_request.h: Removed.
1246         * UIProcess/API/efl/ewk_url_request_private.h: Removed.
1247         * UIProcess/API/efl/ewk_url_response.cpp: Removed.
1248         * UIProcess/API/efl/ewk_url_response.h: Removed.
1249         * UIProcess/API/efl/ewk_url_response_private.h: Removed.
1250         * UIProcess/API/efl/ewk_url_scheme_request.cpp: Removed.
1251         * UIProcess/API/efl/ewk_url_scheme_request.h: Removed.
1252         * UIProcess/API/efl/ewk_url_scheme_request_private.h: Removed.
1253         * UIProcess/API/efl/ewk_view.cpp: Removed.
1254         * UIProcess/API/efl/ewk_view.h: Removed.
1255         * UIProcess/API/efl/ewk_view_configuration.cpp: Removed.
1256         * UIProcess/API/efl/ewk_view_configuration.h: Removed.
1257         * UIProcess/API/efl/ewk_view_configuration_private.h: Removed.
1258         * UIProcess/API/efl/ewk_view_private.h: Removed.
1259         * UIProcess/API/efl/ewk_window_features.cpp: Removed.
1260         * UIProcess/API/efl/ewk_window_features.h: Removed.
1261         * UIProcess/API/efl/ewk_window_features_private.h: Removed.
1262         * UIProcess/API/efl/tests: Removed.
1263         * UIProcess/API/efl/tests/UnitTestUtils: Removed.
1264         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp: Removed.
1265         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h: Removed.
1266         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.cpp: Removed.
1267         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.h: Removed.
1268         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestMain.cpp: Removed.
1269         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestServer.cpp: Removed.
1270         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestServer.h: Removed.
1271         * UIProcess/API/efl/tests/extensions: Removed.
1272         * UIProcess/API/efl/tests/extensions/extension_sample.cpp: Removed.
1273         * UIProcess/API/efl/tests/resources: Removed.
1274         * UIProcess/API/efl/tests/resources/Page1.html: Removed.
1275         * UIProcess/API/efl/tests/resources/Page2.html: Removed.
1276         * UIProcess/API/efl/tests/resources/Page3.html: Removed.
1277         * UIProcess/API/efl/tests/resources/blank.ico: Removed.
1278         * UIProcess/API/efl/tests/resources/default_test_page.html: Removed.
1279         * UIProcess/API/efl/tests/resources/empty_theme.edj: Removed.
1280         * UIProcess/API/efl/tests/resources/file_chooser.html: Removed.
1281         * UIProcess/API/efl/tests/resources/frame_flattening_test.html: Removed.
1282         * UIProcess/API/efl/tests/resources/frame_flattening_test_subframe.html: Removed.
1283         * UIProcess/API/efl/tests/resources/local_file_access.html: Removed.
1284         * UIProcess/API/efl/tests/resources/redirect_url_to_default.html: Removed.
1285         * UIProcess/API/efl/tests/resources/resultMHTML.mht: Removed.
1286         * UIProcess/API/efl/tests/resources/same_page_navigation.html: Removed.
1287         * UIProcess/API/efl/tests/resources/spelling_selection_tests.html: Removed.
1288         * UIProcess/API/efl/tests/resources/spelling_test.html: Removed.
1289         * UIProcess/API/efl/tests/resources/test.pdf: Removed.
1290         * UIProcess/API/efl/tests/resources/window_move_resize.html: Removed.
1291         * UIProcess/API/efl/tests/test_ewk2_accessibility.cpp: Removed.
1292         * UIProcess/API/efl/tests/test_ewk2_application_cache_manager.cpp: Removed.
1293         * UIProcess/API/efl/tests/test_ewk2_auth_request.cpp: Removed.
1294         * UIProcess/API/efl/tests/test_ewk2_back_forward_list.cpp: Removed.
1295         * UIProcess/API/efl/tests/test_ewk2_color_picker.cpp: Removed.
1296         * UIProcess/API/efl/tests/test_ewk2_context.cpp: Removed.
1297         * UIProcess/API/efl/tests/test_ewk2_context_history_callbacks.cpp: Removed.
1298         * UIProcess/API/efl/tests/test_ewk2_context_menu.cpp: Removed.
1299         * UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp: Removed.
1300         * UIProcess/API/efl/tests/test_ewk2_database_manager.cpp: Removed.
1301         * UIProcess/API/efl/tests/test_ewk2_download_job.cpp: Removed.
1302         * UIProcess/API/efl/tests/test_ewk2_eina_shared_string.cpp: Removed.
1303         * UIProcess/API/efl/tests/test_ewk2_favicon_database.cpp: Removed.
1304         * UIProcess/API/efl/tests/test_ewk2_file_chooser_request.cpp: Removed.
1305         * UIProcess/API/efl/tests/test_ewk2_javascript_binding.cpp: Removed.
1306         * UIProcess/API/efl/tests/test_ewk2_object.cpp: Removed.
1307         * UIProcess/API/efl/tests/test_ewk2_page.cpp: Removed.
1308         * UIProcess/API/efl/tests/test_ewk2_page_group.cpp: Removed.
1309         * UIProcess/API/efl/tests/test_ewk2_popup_menu.cpp: Removed.
1310         * UIProcess/API/efl/tests/test_ewk2_settings.cpp: Removed.
1311         * UIProcess/API/efl/tests/test_ewk2_ssl.cpp: Removed.
1312         * UIProcess/API/efl/tests/test_ewk2_storage_manager.cpp: Removed.
1313         * UIProcess/API/efl/tests/test_ewk2_text_checker.cpp: Removed.
1314         * UIProcess/API/efl/tests/test_ewk2_view.cpp: Removed.
1315         * UIProcess/API/efl/tests/test_ewk2_view_configuration.cpp: Removed.
1316         * UIProcess/API/efl/tests/test_ewk2_window_features.cpp: Removed.
1317         * UIProcess/InspectorServer/efl: Removed.
1318         * UIProcess/InspectorServer/efl/WebInspectorServerEfl.cpp: Removed.
1319         * UIProcess/Launcher/efl: Removed.
1320         * UIProcess/Launcher/efl/ProcessLauncherEfl.cpp: Removed.
1321         * UIProcess/efl: Removed.
1322         * UIProcess/efl/ContextHistoryClientEfl.cpp: Removed.
1323         * UIProcess/efl/ContextHistoryClientEfl.h: Removed.
1324         * UIProcess/efl/ContextMenuClientEfl.cpp: Removed.
1325         * UIProcess/efl/ContextMenuClientEfl.h: Removed.
1326         * UIProcess/efl/DownloadManagerEfl.cpp: Removed.
1327         * UIProcess/efl/DownloadManagerEfl.h: Removed.
1328         * UIProcess/efl/EasingCurves.cpp: Removed.
1329         * UIProcess/efl/EasingCurves.h: Removed.
1330         * UIProcess/efl/EwkDebug.h: Removed.
1331         * UIProcess/efl/EwkTouchEvent.cpp: Removed.
1332         * UIProcess/efl/EwkTouchEvent.h: Removed.
1333         * UIProcess/efl/EwkTouchPoint.cpp: Removed.
1334         * UIProcess/efl/EwkTouchPoint.h: Removed.
1335         * UIProcess/efl/FindClientEfl.cpp: Removed.
1336         * UIProcess/efl/FindClientEfl.h: Removed.
1337         * UIProcess/efl/FormClientEfl.cpp: Removed.
1338         * UIProcess/efl/FormClientEfl.h: Removed.
1339         * UIProcess/efl/InputMethodContextEfl.cpp: Removed.
1340         * UIProcess/efl/InputMethodContextEfl.h: Removed.
1341         * UIProcess/efl/PageLoadClientEfl.cpp: Removed.
1342         * UIProcess/efl/PageLoadClientEfl.h: Removed.
1343         * UIProcess/efl/PagePolicyClientEfl.cpp: Removed.
1344         * UIProcess/efl/PagePolicyClientEfl.h: Removed.
1345         * UIProcess/efl/PageUIClientEfl.cpp: Removed.
1346         * UIProcess/efl/PageUIClientEfl.h: Removed.
1347         * UIProcess/efl/PageViewportControllerClientEfl.cpp: Removed.
1348         * UIProcess/efl/PageViewportControllerClientEfl.h: Removed.
1349         * UIProcess/efl/RequestManagerClientEfl.cpp: Removed.
1350         * UIProcess/efl/RequestManagerClientEfl.h: Removed.
1351         * UIProcess/efl/TextCheckerClientEfl.cpp: Removed.
1352         * UIProcess/efl/TextCheckerClientEfl.h: Removed.
1353         * UIProcess/efl/TextCheckerEfl.cpp: Removed.
1354         * UIProcess/efl/VibrationClientEfl.cpp: Removed.
1355         * UIProcess/efl/VibrationClientEfl.h: Removed.
1356         * UIProcess/efl/ViewClientEfl.cpp: Removed.
1357         * UIProcess/efl/ViewClientEfl.h: Removed.
1358         * UIProcess/efl/WebColorPickerClient.cpp: Removed.
1359         * UIProcess/efl/WebColorPickerClient.h: Removed.
1360         * UIProcess/efl/WebColorPickerEfl.cpp: Removed.
1361         * UIProcess/efl/WebColorPickerEfl.h: Removed.
1362         * UIProcess/efl/WebColorPickerResultListenerProxy.cpp: Removed.
1363         * UIProcess/efl/WebColorPickerResultListenerProxy.h: Removed.
1364         * UIProcess/efl/WebContextMenuProxyEfl.cpp: Removed.
1365         * UIProcess/efl/WebContextMenuProxyEfl.h: Removed.
1366         * UIProcess/efl/WebInspectorProxyEfl.cpp: Removed.
1367         * UIProcess/efl/WebPageProxyEfl.cpp: Removed.
1368         * UIProcess/efl/WebPopupItemEfl.cpp: Removed.
1369         * UIProcess/efl/WebPopupItemEfl.h: Removed.
1370         * UIProcess/efl/WebPopupMenuProxyEfl.cpp: Removed.
1371         * UIProcess/efl/WebPopupMenuProxyEfl.h: Removed.
1372         * UIProcess/efl/WebPreferencesEfl.cpp: Removed.
1373         * UIProcess/efl/WebProcessPoolEfl.cpp: Removed.
1374         * UIProcess/efl/WebView.cpp: Removed.
1375         * UIProcess/efl/WebView.h: Removed.
1376         * UIProcess/efl/WebViewClient.cpp: Removed.
1377         * UIProcess/efl/WebViewClient.h: Removed.
1378         * WebProcess/InjectedBundle/API/efl: Removed.
1379         * WebProcess/InjectedBundle/API/efl/EWebKit_Extension.h: Removed.
1380         * WebProcess/InjectedBundle/API/efl/ewk_extension.cpp: Removed.
1381         * WebProcess/InjectedBundle/API/efl/ewk_extension.h: Removed.
1382         * WebProcess/InjectedBundle/API/efl/ewk_extension_private.h: Removed.
1383         * WebProcess/InjectedBundle/API/efl/ewk_page.cpp: Removed.
1384         * WebProcess/InjectedBundle/API/efl/ewk_page.h: Removed.
1385         * WebProcess/InjectedBundle/API/efl/ewk_page_private.h: Removed.
1386         * WebProcess/InjectedBundle/efl: Removed.
1387         * WebProcess/InjectedBundle/efl/InjectedBundleEfl.cpp: Removed.
1388         * WebProcess/WebCoreSupport/efl: Removed.
1389         * WebProcess/WebCoreSupport/efl/WebContextMenuClientEfl.cpp: Removed.
1390         * WebProcess/WebCoreSupport/efl/WebEditorClientEfl.cpp: Removed.
1391         * WebProcess/WebCoreSupport/efl/WebErrorsEfl.cpp: Removed.
1392         * WebProcess/WebCoreSupport/efl/WebPopupMenuEfl.cpp: Removed.
1393         * WebProcess/WebPage/efl: Removed.
1394         * WebProcess/WebPage/efl/WebInspectorUIEfl.cpp: Removed.
1395         * WebProcess/WebPage/efl/WebPageEfl.cpp: Removed.
1396         * WebProcess/efl: Removed.
1397         * WebProcess/efl/ExtensionManagerEfl.cpp: Removed.
1398         * WebProcess/efl/ExtensionManagerEfl.h: Removed.
1399         * WebProcess/efl/WebInjectedBundleMainEfl.cpp: Removed.
1400         * WebProcess/efl/WebProcessMainEfl.cpp: Removed.
1401         * efl: Removed.
1402         * efl/EWebKit2Config.cmake.in: Removed.
1403         * efl/EWebKit2ConfigVersion.cmake.in: Removed.
1404         * efl/ewebkit2-extension.pc.in: Removed.
1405         * efl/ewebkit2.pc.in: Removed.
1406
1407 2017-02-16  Alex Christensen  <achristensen@webkit.org>
1408
1409         Remove old URL parser
1410         https://bugs.webkit.org/show_bug.cgi?id=168483
1411
1412         Reviewed by Tim Horton.
1413
1414         * NetworkProcess/NetworkProcess.cpp:
1415         (WebKit::NetworkProcess::initializeNetworkProcess):
1416         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1417         (WebKit::NetworkProcessCreationParameters::encode):
1418         (WebKit::NetworkProcessCreationParameters::decode):
1419         * NetworkProcess/NetworkProcessCreationParameters.h:
1420         * PlatformEfl.cmake:
1421         * PlatformGTK.cmake:
1422         * PlatformMac.cmake:
1423         * Shared/Cocoa/WebKit2InitializeCocoa.mm: Removed.
1424         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
1425         (WebKit::XPCServiceInitializer):
1426         * Shared/WebKit2Initialize.cpp:
1427         (WebKit::InitializeWebKit2):
1428         * Shared/WebKit2Initialize.h:
1429         (): Deleted.
1430         * Shared/WebProcessCreationParameters.cpp:
1431         (WebKit::WebProcessCreationParameters::encode):
1432         (WebKit::WebProcessCreationParameters::decode):
1433         * Shared/WebProcessCreationParameters.h:
1434         * Shared/efl/WebKit2InitializeEFL.cpp: Removed.
1435         * Shared/gtk/WebKit2InitializeGTK.cpp: Removed.
1436         * UIProcess/WebProcessPool.cpp:
1437         (WebKit::WebProcessPool::ensureNetworkProcess):
1438         (WebKit::WebProcessPool::createNewWebProcess):
1439         * WebKit2.xcodeproj/project.pbxproj:
1440         * WebProcess/WebProcess.cpp:
1441         (WebKit::WebProcess::initializeWebProcess):
1442
1443 2017-02-16  Wenson Hsieh  <wenson_hsieh@apple.com>
1444
1445         [WK2] Add additional test infrastructure and unit tests for data interaction
1446         https://bugs.webkit.org/show_bug.cgi?id=168439
1447         <rdar://problem/30557942>
1448
1449         Reviewed by Tim Horton.
1450
1451         Adds two new _WKTestingDelegate protocol methods that are fired when a 'start data interaction' request has been
1452         sent to the web process, and when a response has been received. See Tools/ChangeLog for more details.
1453
1454         * UIProcess/API/Cocoa/_WKTestingDelegate.h:
1455
1456 2017-02-16  Aakash Jain  <aakash_jain@apple.com>
1457
1458         Remove unused method WKBundlePageCopyContextMenuItemTitle
1459         https://bugs.webkit.org/show_bug.cgi?id=168456
1460
1461         Reviewed by Dan Bernstein.
1462
1463         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: Removed WKBundlePageCopyContextMenuItemTitle.
1464
1465 2017-02-16  Aakash Jain  <aakash_jain@apple.com>
1466
1467         Remove unused WKContextGetProcessSuppressionEnabled and WKContextSetProcessSuppressionEnabled
1468         https://bugs.webkit.org/show_bug.cgi?id=168460
1469
1470         Reviewed by Dan Bernstein.
1471
1472         * UIProcess/API/C/mac/WKContextPrivateMac.h:
1473
1474 2017-02-16  Aakash Jain  <aakash_jain@apple.com>
1475
1476         Removed unused method WKContextGetProcessModel
1477         https://bugs.webkit.org/show_bug.cgi?id=168457
1478
1479         Reviewed by Dan Bernstein.
1480
1481         * UIProcess/API/C/WKContext.h: Removed WKContextGetProcessModel.
1482
1483 2017-02-16  Tim Horton  <timothy_horton@apple.com>
1484
1485         WKWebView inside a UICollectionView flashes when items are inserted above it
1486         https://bugs.webkit.org/show_bug.cgi?id=168376
1487         <rdar://problem/29322051>
1488
1489         Reviewed by Simon Fraser.
1490
1491         Previously, we would immediately send visible content rect updates
1492         whenever we scrolled, or our frame or bounds changed, or ... a whole
1493         bunch of other things. This message would be immediately sent to the
1494         Web Content process, and coalesced at the whims of the Web Content process
1495         main thread. However, if we received multiple such updates within the
1496         same runloop cycle in the UI process, the Web Content process could
1497         send back layer tree commits for intermediate states that would
1498         never make it to the screen.
1499
1500         In the UICollectionView case, UIKit would first scroll to the new location
1501         (potentially putting the WKWebView totally off-screen), and then update
1502         our frame (back on screen), and we would get two layer tree commits;
1503         one, with less tile coverage than needed to cover the area, and another
1504         with full coverage.
1505
1506         Instead, wait until just before we commit the UI-side layer tree (and
1507         thus everyone is done moving things around) to push the new visible 
1508         rect info to the Web Content process.
1509
1510         So far, I have not found a way to test that reliably fails before
1511         and reliably passes after without adding a ton of supporting code to WebKit.
1512
1513         * UIProcess/API/Cocoa/WKWebView.mm:
1514         (-[WKWebView _didInvokeUIScrollViewDelegateCallback]):
1515         (-[WKWebView _didCommitLayerTree:]):
1516         (-[WKWebView _didFinishScrolling]):
1517         (-[WKWebView scrollViewDidScroll:]):
1518         (-[WKWebView scrollViewDidZoom:]):
1519         (-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
1520         (-[WKWebView _scrollViewDidInterruptDecelerating:]):
1521         (-[WKWebView _didScroll]):
1522         (-[WKWebView _enclosingScrollerScrollingEnded:]):
1523         (-[WKWebView _frameOrBoundsChanged]):
1524         (-[WKWebView _scheduleVisibleContentRectUpdate]):
1525         (-[WKWebView _scrollViewIsInStableState:]):
1526         (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
1527         (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
1528         (-[WKWebView _setObscuredInsets:]):
1529         (-[WKWebView _endInteractiveObscuredInsetsChange]):
1530         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1531         (-[WKWebView _endAnimatedResize]):
1532         (-[WKWebView _updateVisibleContentRects]): Deleted.
1533         (-[WKWebView _updateVisibleContentRectAfterScrollInView:]): Deleted.
1534         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1535         * UIProcess/ios/WKContentView.mm:
1536         (-[WKContentView _didCommitLayerTree:]):
1537         * UIProcess/ios/WKContentViewInteraction.mm:
1538         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
1539         (-[WKContentView _stopAssistingNode]):
1540         * UIProcess/ios/WKScrollView.mm:
1541         (-[WKScrollView setContentInset:]):
1542         Have existing callers of _updateVisibleContentRect* instead call
1543         _scheduleVisibleContentRectUpdate*.
1544
1545         In _scheduleVisibleContentRectUpdate, schedule a pre-commit callback
1546         in which we will compute the new visible content rect information
1547         and send it to the Web Content process.
1548
1549         Keep track of the stable state of the scroll view which most recently
1550         scheduled an update, and use that to inform _updateVisibleContentRects.
1551         This matches the previous behavior where the updates might get coalesced
1552         in the Web Content process, and the most recent update wins.
1553
1554         Make a few callers of _updateVisibleContentRectAfterScrollInView
1555         that passed in our scroll view just use _scheduleVisibleContentRectUpdate instead.
1556
1557 2017-02-16  Brent Fulgham  <bfulgham@apple.com>
1558
1559         [WebRTC][Mac] Conditionally add sandbox extensions to the Network Process
1560         https://bugs.webkit.org/show_bug.cgi?id=168010
1561         <rdar://problem/30245503>
1562
1563         Reviewed by Youenn Fablet.
1564
1565         Conditionally add sandbox extensions to the Network Process when the WebRTC/Media Capture
1566         features are enabled.
1567
1568         * NetworkProcess/NetworkProcess.h:
1569         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1570         (WebKit::NetworkProcessCreationParameters::encode): Serialize new process configuration flag.
1571         (WebKit::NetworkProcessCreationParameters::decode): Ditto.
1572         * NetworkProcess/NetworkProcessCreationParameters.h:
1573         * NetworkProcess/mac/NetworkProcessMac.mm:
1574         (WebKit::NetworkProcess::platformInitializeNetworkProcess):  Remember state of WebRTC for when the
1575         sandbox is established.
1576         (WebKit::NetworkProcess::initializeSandbox): Add ENABLE_WEB_RTC parameter to sandbox launch state.
1577         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: Add conditional sandbox expansion to allow
1578         bidirectional network access when the ENABLE_LIBWEBRTC flag is present in the sandbox launch parameters.
1579         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1580         (WebKit::WebProcessPool::platformInitializeWebProcess): Use proper compile guards and check media stream
1581         preference, rather than the peer connection preference.
1582         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Notify NetworkProcess at launch time whether the
1583         user wants WebRTC support.
1584
1585 2017-02-16  Brent Fulgham  <bfulgham@apple.com>
1586
1587         [WebRTC][Mac][WebKit2] Initial WebProcess does not support WebRTC
1588         https://bugs.webkit.org/show_bug.cgi?id=168438
1589         <rdar://problem/30401818>
1590
1591         Reviewed by Youenn Fablet.
1592
1593         The sandbox extension for microphone access does not take effect until the second WebProcess
1594         is created, causing the initial browser tab to lack microphone support.
1595
1596         This patch checks the setting earlier in the boot process so that the initial WebProcess
1597         instance gets the correct setting.
1598
1599         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1600         (WebKit::WebProcessPool::platformInitializeWebProcess): Move microphone sandbox extension here, so that the
1601         initial WebProcess has the correct microphone access.
1602         * UIProcess/WebProcessPool.cpp:
1603         (WebKit::WebProcessPool::createNewWebProcess): Move microphone sandbox extension from here to platform-specific file.
1604         (WebKit::WebProcessPool::createWebPage): Remove unneeded preference checks.
1605
1606 2017-02-16  Eric Carlson  <eric.carlson@apple.com>
1607
1608         Add WebRTC as an off-by-default experimental feature menu item.
1609         https://bugs.webkit.org/show_bug.cgi?id=167972
1610         <rdar://problem/30293429>
1611
1612         Reviewed by Alex Christensen.
1613
1614         * Shared/WebPreferencesDefinitions.h:
1615         * UIProcess/WebPreferences.cpp:
1616         (WebKit::WebPreferences::setPeerConnectionAndMediaStreamEnabled): We need to enable/disable
1617         peer connection and media stream preferences at the same time, so special case them.
1618         (WebKit::WebPreferences::setEnabledForFeature):
1619         * UIProcess/WebPreferences.h:
1620
1621 2017-02-15  Alex Christensen  <achristensen@webkit.org>
1622
1623         Unreviewed, rolling out r212394.
1624
1625         Fixed iOS WebInspector
1626
1627         Reverted changeset:
1628
1629         "Unreviewed, rolling out r212169."
1630         https://bugs.webkit.org/show_bug.cgi?id=166681
1631         http://trac.webkit.org/changeset/212394
1632
1633 2017-02-15  Eric Carlson  <eric.carlson@apple.com>
1634
1635         [MediaStream] delete CaptureDeviceInfo struct
1636         https://bugs.webkit.org/show_bug.cgi?id=168395
1637
1638         Reviewed by Sam Weinig.
1639
1640         * Shared/WebCoreArgumentCoders.cpp:
1641         (IPC::ArgumentCoder<CaptureDevice>::encode):
1642         (IPC::ArgumentCoder<CaptureDevice>::decode):
1643
1644 2017-02-15  Anders Carlsson  <andersca@apple.com>
1645
1646         Try again.
1647
1648         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
1649         (WebKit::WebDragClient::startDrag):
1650
1651 2017-02-15  Anders Carlsson  <andersca@apple.com>
1652
1653         Attempt to fix the GTK+ build.
1654
1655         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
1656         (WebKit::WebDragClient::startDrag):
1657
1658 2017-02-15  Simon Fraser  <simon.fraser@apple.com>
1659
1660         Clean up WebProcessCreationParameters a little
1661         https://bugs.webkit.org/show_bug.cgi?id=168349
1662
1663         Reviewed by Alex Christensen.
1664
1665         Initialize the data members better, and rearrange to group the types in a slightly more space-efficient manner.
1666
1667         * Shared/WebProcessCreationParameters.cpp:
1668         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
1669         * Shared/WebProcessCreationParameters.h:
1670
1671 2017-02-15  Jer Noble  <jer.noble@apple.com>
1672
1673         REGRESSION(r183937): Fullscreen Exit animation missing mask
1674         https://bugs.webkit.org/show_bug.cgi?id=168360
1675
1676         Reviewed by Eric Carlson.
1677
1678         In r183937, the fullscreen window's clip layer has it's mask removed when the enter
1679         fullscreen animation completes, allowing low-power video playback mode to be entered. But
1680         this breaks the exit fullscreen animaiton, which assumes a mask is present. Abstract the
1681         mask creation code out into a static helper method, and use it at the beginning of the exit
1682         fullscreen animation to re-create the mask before adding animations to it.
1683
1684         * UIProcess/mac/WKFullScreenWindowController.mm:
1685         (createMask):
1686         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
1687         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
1688
1689 2017-02-15  Alex Christensen  <achristensen@webkit.org>
1690
1691         Unreviewed, rolling out r212169.
1692
1693         Broke iOS WebInspector
1694
1695         Reverted changeset:
1696
1697         "WebInspector: refactor RemoteInspector to move cocoa specific
1698         code to their own files"
1699         https://bugs.webkit.org/show_bug.cgi?id=166681
1700         http://trac.webkit.org/changeset/212169
1701
1702 2017-02-15  Anders Carlsson  <andersca@apple.com>
1703
1704         Modernize DragClient::startDrag somewhat
1705         https://bugs.webkit.org/show_bug.cgi?id=168379
1706
1707         Reviewed by Tim Horton.
1708
1709         Update for WebCore changes.
1710
1711         * WebProcess/WebCoreSupport/WebDragClient.cpp:
1712         (WebKit::WebDragClient::startDrag):
1713         * WebProcess/WebCoreSupport/WebDragClient.h:
1714         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1715         (WebKit::WebDragClient::startDrag):
1716
1717 2017-02-15  Aakash Jain  <aakash_jain@apple.com>
1718
1719         Remove WebIOSEvent interface
1720         https://bugs.webkit.org/show_bug.cgi?id=168368
1721
1722         Reviewed by Tim Horton.
1723
1724         * Shared/NativeWebKeyboardEvent.h: Using WebEvent from WebCore instead of WebIOSEvent.
1725         * Shared/ios/NativeWebKeyboardEventIOS.mm: Ditto.
1726         * Shared/ios/WebIOSEventFactory.h: Ditto.
1727         * Shared/ios/WebIOSEventFactory.mm: Ditto.
1728         * UIProcess/ios/WKContentViewInteraction.h: Ditto.
1729         * UIProcess/ios/WKContentViewInteraction.mm: Ditto.
1730         * UIProcess/API/C/WKPage.cpp: Using WebEvent from WebKit.
1731
1732 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1733
1734         [GTK] Update cookie manager API to properly work with ephemeral sessions
1735         https://bugs.webkit.org/show_bug.cgi?id=168230
1736
1737         Reviewed by Michael Catanzaro.
1738
1739         WebKitCookieManager is associated to a particular WebKitWebContext and uses the default session ID
1740         unconditionally. It should be associated to a WebKitWebsiteDataManager instead and use its session ID. This
1741         patch also adds support for handling cookies with WebKitWebsiteDataManager and deprecates
1742         webkit_cookie_manager_get_domains_with_cookies(), webkit_cookie_manager_delete_cookies_for_domain() and
1743         webkit_cookie_manager_delete_all_cookies(). It also adds API to get the the WebKitWebsiteDataManager of a
1744         WebKitWebView, since it's the only way to get the WebKitCookieManager associated to an ephemeral web view.
1745
1746         * UIProcess/API/gtk/WebKitCookieManager.cpp:
1747         (webkitCookieManagerDispose): Stop observing cookie changes.
1748         (webkit_cookie_manager_class_init): Add dispose implementation.
1749         (webkitCookieManagerCreate): Create the WebKitCookieManager with a WebKitWebsiteDataManager.
1750         (webkit_cookie_manager_set_persistent_storage): Work with all contexts having the session.
1751         (webkit_cookie_manager_set_accept_policy): Ditto.
1752         (webkit_cookie_manager_get_accept_policy): Use any context having the session.
1753         (webkit_cookie_manager_get_domains_with_cookies): Deprecate and implement using WebKitWebsiteDataManager.
1754         (webkit_cookie_manager_get_domains_with_cookies_finish): Ditto.
1755         (webkit_cookie_manager_delete_cookies_for_domain): Ditto.
1756         (webkit_cookie_manager_delete_all_cookies): Ditto.
1757         * UIProcess/API/gtk/WebKitCookieManager.h:
1758         * UIProcess/API/gtk/WebKitCookieManagerPrivate.h:
1759         * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp:
1760         (attachCustomProtocolManagerClientToContext):
1761         * UIProcess/API/gtk/WebKitDownloadClient.cpp:
1762         (attachDownloadClientToContext):
1763         * UIProcess/API/gtk/WebKitInjectedBundleClient.cpp:
1764         (attachInjectedBundleClientToContext):
1765         * UIProcess/API/gtk/WebKitSecurityManager.cpp:
1766         (registerSecurityPolicyForURIScheme):
1767         * UIProcess/API/gtk/WebKitWebContext.cpp:
1768         (webkitWebContextConstructed): Call webkitWebsiteDataManagerAddProcessPool.
1769         (webkitWebContextDispose): Call webkitWebsiteDataManagerRemoveProcessPool.
1770         (webkit_web_context_get_cookie_manager): Return the WebKitCookieManager of the WebKitWebsiteDataManager.
1771         (webkitWebContextGetProcessPool): Make it return a reference.
1772         * UIProcess/API/gtk/WebKitWebContextPrivate.h:
1773         * UIProcess/API/gtk/WebKitWebView.cpp:
1774         (webkitWebViewConstructed): Call webkitWebsiteDataManagerAddProcessPool when creating a ephemeral web view.
1775         (webkitWebViewDispose): Call webkitWebsiteDataManagerRemoveProcessPool if needed.
1776         (webkit_web_view_get_website_data_manager): Return the WebKitWebsiteDataManager or the context one.
1777         * UIProcess/API/gtk/WebKitWebView.h:
1778         * UIProcess/API/gtk/WebKitWebsiteData.cpp: Add support for Cookies type.
1779         (recordContainsSupportedDataTypes):
1780         (toWebKitWebsiteDataTypes):
1781         * UIProcess/API/gtk/WebKitWebsiteData.h:
1782         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
1783         (_WebKitWebsiteDataManagerPrivate::~_WebKitWebsiteDataManagerPrivate): Ensure all contexts were unregistered.
1784         (webkitWebsiteDataManagerAddProcessPool): Register the process pool in the session.
1785         (webkitWebsiteDataManagerRemoveProcessPool): Unregister the process poll from the session.
1786         (webkitWebsiteDataManagerGetProcessPools): Return the list of proces pools registered.
1787         (webkit_website_data_manager_get_cookie_manager): Return the WebKitCookieManager.
1788         (toWebsiteDataTypes): Add Cookies.
1789         * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
1790         * UIProcess/API/gtk/WebKitWebsiteDataManagerPrivate.h:
1791         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
1792         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
1793         (WebKit::WebsiteDataRecord::displayNameForCookieHostName): Handle localhost as a special case here for backwards
1794         compatibility.
1795
1796 2017-02-14  Wenson Hsieh  <wenson_hsieh@apple.com>
1797
1798         [WK2] Support data interaction on links
1799         https://bugs.webkit.org/show_bug.cgi?id=168331
1800         <rdar://problem/30200837>
1801
1802         Reviewed by Tim Horton.
1803
1804         Adds support for data interaction on links at the client layer for WebKit2. This involves several changes,
1805         detailed in the per-method changes below:
1806
1807         * Shared/ios/InteractionInformationAtPosition.h:
1808         * Shared/ios/InteractionInformationAtPosition.mm:
1809         (WebKit::InteractionInformationAtPosition::encode):
1810         (WebKit::InteractionInformationAtPosition::decode):
1811
1812         Add adjustedPointForNodeRespondingToClickEvents (the request point, adjusted to take nodeRespondingToClickEvents
1813         into account) to InteractionInformationAtPosition. The web process sends this adjusted point over to the UI
1814         process so that the UI process will be able to begin a data interaction at the adjusted point rather than the
1815         request point, which is necessary for small clickable (and data-interactive) elements such as links.
1816
1817         * UIProcess/ios/WKActionSheet.h:
1818         * UIProcess/ios/WKActionSheet.mm:
1819         (-[WKActionSheet presentSheet:]):
1820         (-[WKActionSheet _presentationRectForStyle:]):
1821         (-[WKActionSheet updateSheetPosition]):
1822         * UIProcess/ios/WKActionSheetAssistant.h:
1823         * UIProcess/ios/WKActionSheetAssistant.mm:
1824         (-[WKActionSheetAssistant presentationRectForElementUsingClosestIndicatedRect]):
1825         (-[WKActionSheetAssistant presentationRectForIndicatedElement]):
1826         (-[WKActionSheetAssistant showImageSheet]):
1827         (-[WKActionSheetAssistant _shouldPresentAtTouchLocationForElementRect:]):
1828         (-[WKActionSheetAssistant needsLinkIndicator]):
1829         (-[WKActionSheetAssistant showLinkSheet]):
1830         (-[WKActionSheetAssistant cleanupSheet]):
1831         (-[WKActionSheetAssistant _presentationStyleForImageAtElementRect:]): Deleted.
1832
1833         Add support for the WKActionSheetPresentAtClosestIndicatorRect style of presenting an action sheet. When
1834         showing the action sheet for a link and there is space along the margins to show a popover in the first place,
1835         we will now target the popover rect to the bounding rect of the set of adjacent (or nearly-adjacent) element
1836         rects closest to the user's touch location. This covers cases where the link is split into multiple rects due to
1837         a line break, when the link is on multiple lines with a jagged rect per line, and when both of the above are
1838         true.
1839
1840         * UIProcess/ios/WKContentViewInteraction.mm:
1841         (-[WKContentView pointIsInDataInteractionContent:]):
1842         (-[WKContentView _positionInformationDidChange:]):
1843         (-[WKContentView positionInformationForActionSheetAssistant:]):
1844         (-[WKContentView updatePositionInformationForActionSheetAssistant:]):
1845
1846         Include link indicator data in the position information request if needed. As the FIXME suggests, this can be
1847         improved by asynchronously presenting the action sheet assistant after the request returns, and is something we
1848         should address in the future.
1849
1850         * WebProcess/WebPage/ios/WebPageIOS.mm:
1851         (WebKit::WebPage::getPositionInformation):
1852
1853 2017-02-14  Jason Rinn  <jrinn@apple.com>
1854
1855         Add new WKWebKit Cocoa API for getContentsAsString.
1856         https://bugs.webkit.org/show_bug.cgi?id=168147
1857         <rdar://problem/30502539>
1858
1859         Reviewed by Tim Horton.
1860
1861         * UIProcess/API/Cocoa/WKWebView.mm:
1862         (-[WKWebView _getContentsAsStringWithCompletionHandler:]): New API for getContentsAsString.
1863         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1864
1865 2017-02-14  Chris Dumez  <cdumez@apple.com>
1866
1867         HTML Form Validation bubble should take minimum font size setting into consideration
1868         https://bugs.webkit.org/show_bug.cgi?id=168271
1869         <rdar://problem/29869869>
1870
1871         Reviewed by Simon Fraser.
1872
1873         * UIProcess/API/Cocoa/WKWebView.mm:
1874         (-[WKWebView _contentsOfUserInterfaceItem:]):
1875         Return font size used in the validation bubble.
1876
1877         * UIProcess/PageClient.h:
1878         * UIProcess/ios/PageClientImplIOS.h:
1879         * UIProcess/ios/PageClientImplIOS.mm:
1880         (WebKit::PageClientImpl::createValidationBubble):
1881         * UIProcess/ios/WebPageProxyIOS.mm:
1882         (WebKit::WebPageProxy::showValidationMessage):
1883         * UIProcess/mac/PageClientImpl.h:
1884         * UIProcess/mac/PageClientImpl.mm:
1885         (WebKit::PageClientImpl::createValidationBubble):
1886         * UIProcess/mac/WebPageProxyMac.mm:
1887         (WebKit::WebPageProxy::showValidationMessage):
1888         Pass minimum font size setting when constructing the form validation bubble.
1889
1890 2017-02-14  Commit Queue  <commit-queue@webkit.org>
1891
1892         Unreviewed, rolling out r211879.
1893         https://bugs.webkit.org/show_bug.cgi?id=168330
1894
1895         Not ready for the menu yet (Requested by eric_car_ on
1896         #webkit).
1897
1898         Reverted changeset:
1899
1900         "Add WebRTC as an off-by-default experimental feature menu
1901         item."
1902         https://bugs.webkit.org/show_bug.cgi?id=167972
1903         http://trac.webkit.org/changeset/211879
1904
1905 2017-02-14  Simon Fraser  <simon.fraser@apple.com>
1906
1907         Add logging and defensive fixes to try to detect problems causing blank tabs
1908         https://bugs.webkit.org/show_bug.cgi?id=168270
1909         rdar://problem/30505482
1910
1911         Reviewed by Jon Lee.
1912         
1913         Add release logging when -[WKWebView _beginAnimatedResizeWithUpdates:] and -[WKWebView _endAnimatedResize]
1914         are unbalanced across a commit, to detect cases where _endAnimatedResize wasn't called enough times.
1915         
1916         Also log when RemoteLayerTreeHost::updateLayerTree() fails to find a root layer, which should never happen.
1917         
1918         In WebPageProxy, clear m_firstLayerTreeTransactionIdAfterDidCommitLoad on a web process crash.
1919
1920         * Platform/Logging.h:
1921         * UIProcess/API/Cocoa/WKWebView.mm:
1922         (-[WKWebView _didCommitLayerTree:]):
1923         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1924         (-[WKWebView _endAnimatedResize]):
1925         * UIProcess/WebPageProxy.cpp:
1926         (WebKit::WebPageProxy::resetState):
1927         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1928         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1929         (WebKit::RemoteLayerTreeDrawingAreaProxy::isAlwaysOnLoggingAllowed):
1930         * UIProcess/mac/RemoteLayerTreeHost.mm:
1931         (WebKit::RemoteLayerTreeHost::updateLayerTree):
1932         (WebKit::RemoteLayerTreeHost::clearLayers):
1933         * WebProcess/WebPage/WebFrame.cpp:
1934         (WebKit::WebFrame::WebFrame):
1935         * WebProcess/WebPage/WebFrame.h:
1936
1937 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1938
1939         Allow to use stored credentials also for downloads started by DownloadManager::startDownload
1940         https://bugs.webkit.org/show_bug.cgi?id=167584
1941
1942         Reviewed by Michael Catanzaro.
1943
1944         Cliking on a link that triggers a download works on an already HTTP authenticated site works, but right clicking
1945         and downloading from the context menu shows the HTTP auth dialog again. This is because PendingDownload uses
1946         DoNotAllowStoredCredentials unconditionally. We want to allow using cached credentials at least for
1947         non-ephemeral sessions.
1948
1949         * NetworkProcess/Downloads/DownloadManager.cpp:
1950         (WebKit::DownloadManager::startDownload):
1951
1952 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1953
1954         [GTK] Make DragImageRef a RefPtr instead of a plain pointer
1955         https://bugs.webkit.org/show_bug.cgi?id=168296
1956
1957         Reviewed by Sergio Villar Senin.
1958
1959         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
1960         (WebKit::WebDragClient::startDrag):
1961
1962 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1963
1964         [SOUP] Ensure a response MIME type when Content-Type is missing and sniffing not allowed
1965         https://bugs.webkit.org/show_bug.cgi?id=168299
1966
1967         Reviewed by Sergio Villar Senin.
1968
1969         Sniffing is not allowed but we can try to guess the MIME using the response path, or at least fallback to
1970         default MIME type instead of leaving an empty string. This matches what mac port does.
1971
1972         Fixes: http/tests/inspector/network/fetch-response-body.html
1973                http/tests/inspector/network/xhr-response-body.html
1974
1975         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1976         (WebKit::NetworkDataTaskSoup::didSendRequest):
1977
1978 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1979
1980         CookieManager only works with the default session
1981         https://bugs.webkit.org/show_bug.cgi?id=168229
1982
1983         Reviewed by Alex Christensen.
1984
1985         Make CookieManager session aware by adding a SessionID parameter to all its functions, and update all the callers
1986         to pass the default session ID, preserving the current
1987         behavior. WebCookieManagerProxy::startObservingCookieChanges() now also receives an optional callback to be
1988         called on every change.
1989
1990         * UIProcess/API/C/WKCookieManager.cpp:
1991         (WKCookieManagerGetHostnamesWithCookies):
1992         (WKCookieManagerDeleteCookiesForHostname):
1993         (WKCookieManagerDeleteAllCookies):
1994         (WKCookieManagerDeleteAllCookiesModifiedAfterDate):
1995         (WKCookieManagerStartObservingCookieChanges):
1996         (WKCookieManagerStopObservingCookieChanges):
1997         * UIProcess/API/gtk/WebKitCookieManager.cpp:
1998         (_WebKitCookieManagerPrivate::~_WebKitCookieManagerPrivate):
1999         (webkitCookieManagerCreate):
2000         (webkit_cookie_manager_set_persistent_storage):
2001         (webkit_cookie_manager_get_domains_with_cookies):
2002         (webkit_cookie_manager_delete_cookies_for_domain):
2003         (webkit_cookie_manager_delete_all_cookies):
2004         * UIProcess/Automation/WebAutomationSession.cpp:
2005         (WebKit::WebAutomationSession::addSingleCookie):
2006         (WebKit::WebAutomationSession::deleteAllCookies):
2007         * UIProcess/WebCookieManagerProxy.cpp:
2008         (WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
2009         (WebKit::WebCookieManagerProxy::deleteCookiesForHostname):
2010         (WebKit::WebCookieManagerProxy::deleteAllCookies):
2011         (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince):
2012         (WebKit::WebCookieManagerProxy::addCookie):
2013         (WebKit::WebCookieManagerProxy::startObservingCookieChanges):
2014         (WebKit::WebCookieManagerProxy::stopObservingCookieChanges):
2015         (WebKit::WebCookieManagerProxy::cookiesDidChange):
2016         * UIProcess/WebCookieManagerProxy.h:
2017         * UIProcess/WebCookieManagerProxy.messages.in:
2018         * WebProcess/Cookies/WebCookieManager.cpp:
2019         (WebKit::WebCookieManager::WebCookieManager):
2020         (WebKit::WebCookieManager::getHostnamesWithCookies):
2021         (WebKit::WebCookieManager::deleteCookiesForHostname):
2022         (WebKit::WebCookieManager::deleteAllCookies):
2023         (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
2024         (WebKit::WebCookieManager::addCookie):
2025         (WebKit::WebCookieManager::startObservingCookieChanges):
2026         (WebKit::WebCookieManager::stopObservingCookieChanges):
2027         * WebProcess/Cookies/WebCookieManager.h:
2028         * WebProcess/Cookies/WebCookieManager.messages.in:
2029
2030 2017-02-14  Tomas Popela  <tpopela@redhat.com>
2031
2032         Unreviewed, fix documentation typo
2033
2034         * UIProcess/API/gtk/WebKitEditingCommands.h:
2035
2036 2017-02-12  Brian Burg  <bburg@apple.com>
2037
2038         Web Inspector: expose system user interface layout direction through InspectorFrontendHost
2039         https://bugs.webkit.org/show_bug.cgi?id=168209
2040         <rdar://problem/11573736>
2041
2042         Reviewed by Joseph Pecoraro.
2043
2044         Forward the UserInterfaceLayoutDirection of the inspector page. If the WebKit client has
2045         properly set the UI directionality from system settings in PageClient, this will get inherited
2046         automatically by the Inspector's WebPage instance.
2047
2048         * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
2049         (WebKit::RemoteWebInspectorUI::userInterfaceLayoutDirection):
2050         * WebProcess/WebPage/RemoteWebInspectorUI.h:
2051         * WebProcess/WebPage/WebInspectorUI.cpp:
2052         (WebKit::WebInspectorUI::userInterfaceLayoutDirection):
2053         * WebProcess/WebPage/WebInspectorUI.h:
2054
2055 2017-02-13  Youenn Fablet  <youennf@gmail.com>
2056
2057         [WebRTC] Creating RTCPeerConnection with libwebrtc backend is crashing on rwt
2058         https://bugs.webkit.org/show_bug.cgi?id=168250
2059
2060         Reviewed by Alex Christensen.
2061
2062         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
2063         (WebKit::LibWebRTCProvider::createPeerConnection):
2064         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
2065         * WebProcess/Network/webrtc/LibWebRTCSocket.h:
2066         * WebProcess/Network/webrtc/WebRTCMonitor.cpp:
2067         (WebKit::WebRTCMonitor::StartUpdating):
2068         (WebKit::WebRTCMonitor::networksChanged):
2069         * WebProcess/Network/webrtc/WebRTCMonitor.h:
2070         * WebProcess/Network/webrtc/WebRTCResolver.cpp:
2071         (WebKit::WebRTCResolver::setResolvedAddress):
2072         (WebKit::WebRTCResolver::resolvedAddressError):
2073         * WebProcess/Network/webrtc/WebRTCSocket.cpp:
2074         (WebKit::WebRTCSocket::signalOnNetworkThread):
2075
2076 2017-02-13  Megan Gardner  <megan_gardner@apple.com>
2077
2078         Implement Drag cancels
2079         https://bugs.webkit.org/show_bug.cgi?id=168266
2080
2081         Reviewed by Wenson Hsieh.
2082
2083         Adds support for the UI Process to cancel already started drag events.
2084
2085         * UIProcess/WebPageProxy.cpp:
2086         (WebKit::WebPageProxy::cancelledDrag):
2087         * UIProcess/WebPageProxy.h:
2088         * WebProcess/WebPage/WebPage.h:
2089         (WebKit::WebPage::cancelledDrag):
2090         * WebProcess/WebPage/WebPage.messages.in:
2091
2092 2017-02-13  Simon Fraser  <simon.fraser@apple.com>
2093
2094         Call WKDestroyRenderingResources() on iOS when tabs are backgrounded
2095         https://bugs.webkit.org/show_bug.cgi?id=168261
2096         rdar://problem/30481079
2097
2098         Reviewed by Tim Horton.
2099
2100         There's code to call CABackingStoreCollectBlocking() on a 10s timer that exists for Mac, but on iOS
2101         the web processes are suspended before this timer fires. So call CABackingStoreCollectBlocking()
2102         from WebProcess::actualPrepareToSuspend(), which is where we also trigger the markAllLayersVolatile()
2103         code.
2104
2105         Also add CABackingStoreCollectBlocking() to QuartzCoreSPI.h so we can use it without using WKSI.
2106
2107         Release-log how long this takes, in case we get reports of bad performance. In my testing it could be up to 10ms.
2108
2109         * WebProcess/WebProcess.cpp:
2110         (WebKit::WebProcess::actualPrepareToSuspend):
2111         * WebProcess/cocoa/WebProcessCocoa.mm:
2112         (WebKit::WebProcess::destroyRenderingResources):
2113
2114 2017-02-13  Brady Eidson  <beidson@apple.com>
2115
2116         Followup to: Replace all WebKit Library Version checks in WK2 with SDK version checks.
2117         https://bugs.webkit.org/show_bug.cgi?id=168124
2118
2119         Reviewed by Geoffrey Garen.
2120
2121         * UIProcess/Cocoa/VersionChecks.h: 
2122
2123 2017-02-13  Wenson Hsieh  <wenson_hsieh@apple.com>
2124
2125         [WK2] Add test infrastructure and unit tests for data interaction
2126         https://bugs.webkit.org/show_bug.cgi?id=168159
2127         <rdar://problem/30477634>
2128
2129         Reviewed by Tim Horton.
2130
2131         Adds support at the WebKit2 layer for testing data interaction. Introduces the _WKTestingDelegate, which a
2132         protocol which can specified for a WKWebView and used to install mock objects and simulate the state of the
2133         platform. By default, this delegate is nil, which results in normal behavior. For data interaction, we are able
2134         to specify a mock data interaction gesture recognizer for use by the WKContentView to simulate firing a long
2135         press and subsequent movement. This gesture recognizer is used in place of the regular data interaction gesture
2136         recognizer, and allows for TestWebKitAPI to drive interaction without actually sending events through the
2137         UIApplication. The _WKTestingDelegate also contains optional method hooks which are invoked at key points in
2138         time when performing a data interaction gesture.
2139
2140         Since all methods of the testing delegate are optional, the testing delegate can be easily extended to support
2141         testing for other features -- the idea is that leaving all but the relevant methods in the protocol
2142         unimplemented will result in default behavior for everything other than those methods, so a client need only
2143         implement and add WebKit2 hooks for a few methods to support testing for a new feature.
2144
2145         * UIProcess/API/Cocoa/WKWebView.mm:
2146         (-[WKWebView _testingDelegate]):
2147         (-[WKWebView _setTestingDelegate:]):
2148
2149         Specify the testing delegate to use for this WKWebView (see above for more details).
2150
2151         (-[WKWebView _simulateDataInteractionGestureRecognized]):
2152         (-[WKWebView _simulateDataInteractionEntered:]):
2153         (-[WKWebView _simulateDataInteractionUpdated:]):
2154         (-[WKWebView _simulateDataInteractionPerformOperation:]):
2155         (-[WKWebView _simulateDataInteractionEnded:]):
2156         (-[WKWebView _simulateDataInteractionSessionDidEnd:withOperation:]):
2157         (-[WKWebView _simulateFailedDataInteractionWithIndex:]):
2158         (-[WKWebView _simulateWillBeginDataInteractionWithIndex:withSession:]):
2159         (-[WKWebView _simulatedItemsForDataInteractionWithIndex:]):
2160
2161         Used by TestWebKitAPI to drive data interaction tests. See DataInteractionTests.mm.
2162
2163         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2164         * UIProcess/API/Cocoa/_WKTestingDelegate.h: Added.
2165         * UIProcess/ios/WKContentViewInteraction.h:
2166         * UIProcess/ios/WKContentViewInteraction.mm:
2167         (-[WKContentView setupInteraction]):
2168         (-[WKContentView _dataInteractionGestureRecognizer]):
2169         * WebKit2.xcodeproj/project.pbxproj:
2170
2171 2017-02-13  Eric Carlson  <eric.carlson@apple.com>
2172
2173         [MediaStream Mac] Video capture needs access to /Library/CoreMediaIO/Plug-Ins/DAL/
2174         https://bugs.webkit.org/show_bug.cgi?id=168244
2175         <rdar://problem/30461158>
2176
2177         Reviewed by Brady Eidson.
2178
2179         * WebProcess/com.apple.WebProcess.sb.in: Grant read-access to the video capture
2180         plug-in directory when enabling video capture.
2181
2182 2017-02-13  Antti Koivisto  <antti@apple.com>
2183
2184         Disable mmap'd cache files if container is class A
2185         https://bugs.webkit.org/show_bug.cgi?id=168241
2186         <rdar://problem/23676252>
2187
2188         Reviewed by JF Bastien and Chris Dumez.
2189
2190         If the mmap'd cache file gets evicted and the device is locked,
2191         then WebContent won't be able to bring the file back in under
2192         class A, causing SIGBUS.
2193
2194         In those circumstances, don't use mmap'd files.
2195
2196         * NetworkProcess/cache/NetworkCache.h:
2197         (WebKit::NetworkCache::Cache::canUseSharedMemoryForBodyData):
2198         * NetworkProcess/cache/NetworkCacheEntry.cpp:
2199         (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord):
2200
2201             Don't initialize the shareable resource handle for the map if forbidden.
2202
2203         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
2204         (WebKit::NetworkCache::canUseSharedMemoryForPath):
2205
2206             Query the system for the protection status of the cache path.
2207
2208         * NetworkProcess/cache/NetworkCacheFileSystem.h:
2209         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2210         (WebKit::NetworkCache::Storage::Storage):
2211         * NetworkProcess/cache/NetworkCacheStorage.h:
2212         (WebKit::NetworkCache::Storage::canUseSharedMemoryForBodyData):
2213
2214 2017-02-13  Youenn Fablet  <youennf@gmail.com>
2215
2216         [WebRTC] libwebrtc socket factory is not assigning the right socket type
2217         https://bugs.webkit.org/show_bug.cgi?id=168233
2218
2219         Reviewed by Brent Fulgham.
2220
2221         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
2222         (WebKit::LibWebRTCSocketFactory::CreateUdpSocket):
2223         (WebKit::LibWebRTCSocketFactory::CreateClientTcpSocket):
2224
2225 2017-02-13  Michael Catanzaro  <mcatanzaro@igalia.com>
2226
2227         [GTK] Unreviewed, add missing precondition check
2228
2229         * WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp:
2230         (webkit_web_editor_get_page):
2231
2232 2017-02-13  Michael Catanzaro  <mcatanzaro@igalia.com>
2233
2234         Unreviewed, fix another docs typo.
2235
2236         * UIProcess/API/gtk/WebKitEditingCommands.h:
2237
2238 2017-02-12  Michael Catanzaro  <mcatanzaro@igalia.com>
2239
2240         [GTK] Improve documentation of webkit_context_menu_set_user_data()
2241         https://bugs.webkit.org/show_bug.cgi?id=168214
2242
2243         Reviewed by Carlos Garcia Campos.
2244
2245         * UIProcess/API/gtk/WebKitContextMenu.cpp:
2246
2247 2017-02-12  Dan Bernstein  <mitz@apple.com>
2248
2249         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
2250
2251         * UIProcess/mac/WebContextMenuProxyMac.mm:
2252         (WebKit::WebContextMenuProxyMac::createShareMenuItem): Use non-deprecated method.
2253
2254 2017-02-12  Dan Bernstein  <mitz@apple.com>
2255
2256         [Cocoa] Some -respondsToSelector: checks are unnecessary
2257         https://bugs.webkit.org/show_bug.cgi?id=168183
2258
2259         Reviewed by Tim Horton.
2260
2261         * Platform/mac/LayerHostingContext.mm:
2262         (WebKit::LayerHostingContext::setColorMatchUntaggedContent): Removed unnecessary
2263           -respondsToSelector: check.
2264         (WebKit::LayerHostingContext::colorMatchUntaggedContent): Ditto.
2265
2266         * Platform/mac/MenuUtilities.mm:
2267         (WebKit::menuItemTitleForTelephoneNumberGroup): Ditto.
2268
2269         * Platform/spi/ios/UIKitSPI.h: Moved declaration of
2270           -[UIScrollView _isInterruptingDeceleration] from WKWebView.mm to the
2271           !USE(APPLE_INTERNAL_SDK) section here.
2272
2273         * Shared/mac/ChildProcessMac.mm:
2274         (WebKit::ChildProcess::setSharedHTTPCookieStorage): Removed unnecessary -respondsToSelector:
2275           check.
2276
2277         * Shared/mac/WebEventFactory.mm:
2278         (WebKit::typeForEvent): Ditto.
2279
2280         * UIProcess/API/Cocoa/WKWebView.mm:
2281         (-[WKWebView _updateVisibleContentRectAfterScrollInView:]): Ditto.
2282
2283         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2284         (WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup): Ditto.
2285
2286         * UIProcess/Cocoa/WebViewImpl.mm:
2287         (WebKit::WebViewImpl::dismissContentRelativeChildWindowsFromViewOnly): Ditto.
2288
2289         * UIProcess/WKImagePreviewViewController.mm:
2290         (-[WKImagePreviewViewController previewActions]): Removed check whether _WKElementAction
2291           responds to -runActionWithElementInfo:.
2292
2293         * UIProcess/ios/WKActionSheetAssistant.mm:
2294         (-[WKActionSheetAssistant showDataDetectorsSheet]): Ditto.
2295
2296         * UIProcess/ios/WKContentViewInteraction.mm:
2297         (-[WKContentView _lookup:]): Ditto.
2298         (-[WKContentView _share:]): Ditto.
2299         (-[WKContentView _addShortcut:]): Ditto.
2300         (-[WKContentView _promptForReplace:]): Ditto.
2301         (-[WKContentView _transliterateChinese:]): Ditto.
2302         (-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Removed call to
2303           -[UIKeyboardImpl didHandleWebKeyEvent], which is a no-op.
2304         (-[WKContentView _interpretKeyEvent:isCharEvent:]): Removed unnecessary -respondsToSelector:
2305           check.
2306         (-[WKContentView _dataForPreviewItemController:atPosition:type:]): Ditto.
2307
2308         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2309         (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence): Ditto.
2310
2311         * UIProcess/mac/WKImmediateActionController.mm:
2312         (-[WKImmediateActionController _animationControllerForDataDetectedText]): Ditto.
2313
2314         * UIProcess/mac/WebContextMenuProxyMac.mm:
2315         (WebKit::WebContextMenuProxyMac::createShareMenuItem): Ditto.
2316
2317 2017-02-12  Michael Catanzaro  <mcatanzaro@igalia.com>
2318
2319         [GTK] Unreviewed, minor documentation improvements
2320
2321         * UIProcess/API/gtk/WebKitWebView.cpp:
2322         (webkit_web_view_class_init):
2323         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
2324         (webkit_web_page_class_init):
2325
2326 2017-02-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2327
2328         [SOUP] Downloads fail when the given destination is not a URI
2329         https://bugs.webkit.org/show_bug.cgi?id=168187
2330
2331         Reviewed by Michael Catanzaro.
2332
2333         It always expects a uri, and fails if a local path is given.
2334
2335         Fixes: http/tests/download/anchor-download-no-extension.html
2336                http/tests/download/area-download.html
2337                http/tests/security/anchor-download-allow-data.html
2338                http/tests/security/anchor-download-allow-sameorigin.html
2339
2340         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2341         (WebKit::NetworkDataTaskSoup::download): Use g_file_new_for_path() if the pending destination is a path instead
2342         of a URI.
2343
2344 2017-02-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2345
2346         [GTK] Handle caps lock indicator in event modifiers
2347         https://bugs.webkit.org/show_bug.cgi?id=168186
2348
2349         Reviewed by Michael Catanzaro.
2350
2351         Use PlatformKeyboardEvent::modifiersContainCapsLock() to check if modifiers contain the caps lock and add
2352         Modifiers::CapsLockKey in that case.
2353
2354         * Shared/gtk/WebEventFactory.cpp:
2355         (WebKit::modifiersForEvent):
2356         * UIProcess/API/gtk/WebKitPrivate.cpp:
2357         (wkEventModifiersToGdkModifiers):
2358         (toGdkModifiers):
2359
2360 2017-02-12  Andy Estes  <aestes@apple.com>
2361
2362         [iOS] PDF page number indicator can show "0 of n" on short pages
2363         https://bugs.webkit.org/show_bug.cgi?id=168185
2364
2365         Reviewed by Tim Horton.
2366
2367         When viewing a PDF with a last page that is shorter than the frame height, it's possible
2368         (thanks to rubber-banding) to scroll down until the page no longer intersects the rect we
2369         use to determine the center page. When this happens, the page number indicator displays
2370         "0 of n".
2371
2372         Fix this by handling cases where the first page starts below the center page rect or the
2373         last page ends above it.
2374
2375         * UIProcess/ios/WKPDFView.mm:
2376         (-[WKPDFView _revalidateViews]):
2377
2378 2017-02-11  Alex Christensen  <achristensen@webkit.org>
2379
2380         Fix crashes after [NSURLSession invalidateAndCancel]
2381         https://bugs.webkit.org/show_bug.cgi?id=168181
2382         <rdar://problem/29813868>
2383
2384         Reviewed by Brady Eidson.
2385
2386         When we call NetworkSessionCocoa::invalidateAndCancel, we intend for the session to immediately
2387         become invalid and stop doing things. [NSURLSession invalidateAndCancel] asynchronously cancels
2388         everything and then calls the delegate's didBecomeInvalidWithError, so before this change there
2389         is a time when we have torn down the session with SessionTracker::destroySession but we can still
2390         get a delegate callback which assumes the session and its NetworkStorageSession exists.  If we
2391         get any delegate callbacks after a NetworkSession has been invalidated, we will want to ignore them.
2392
2393         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2394         (-[WKNetworkSessionDelegate sessionInvalidated]):
2395         (-[WKNetworkSessionDelegate URLSession:didBecomeInvalidWithError:]):
2396         (-[WKNetworkSessionDelegate URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:]):
2397         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
2398         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
2399         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
2400         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
2401         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
2402         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
2403         (-[WKNetworkSessionDelegate URLSession:downloadTask:didFinishDownloadingToURL:]):
2404         (-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
2405         (-[WKNetworkSessionDelegate URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:]):
2406         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
2407         The pointer to the NetworkSessionCocoa can now be null. We need to check it.
2408         (WebKit::NetworkSessionCocoa::invalidateAndCancel):
2409         Synchronously remove the connection between the delegates and the NetworkSessionCocoa.
2410
2411 2017-02-10  John Wilander  <wilander@apple.com>
2412
2413         Updates to Resource Load Statistics: Get the right website data store and introduce timeout for user interaction
2414         https://bugs.webkit.org/show_bug.cgi?id=167474
2415         <rdar://problem/24681808>
2416         <rdar://problem/24703286>
2417         <rdar://problem/30290270>
2418
2419         This patch does the following:
2420         1. Gets the right website data store. API::WebsiteDataStore::defaultDataStore()
2421             does not provide the right data store.
2422         2. Introduces timeout for user interaction. A domain needs interaction every 30
2423             days to stay in that category.
2424         3. Adds grandfathered to the statistics model in preparation for grandfathering of
2425             existing data records.
2426         4. Adds test infrastructure to allow testing of the various rules in place for
2427             data records removal.
2428         5. Fixes various smaller bugs that were found as part of setting up the tests.
2429         6. Regresses the data records removal counting. We need to come up with a thread
2430             safe way of gathering removal statistics from more than one data store now
2431             that we potentially interact with multiple stores.
2432         7. Adds a first set of layout tests for resource load statistics.
2433
2434         Reviewed by Andy Estes.
2435
2436         * PlatformEfl.cmake:
2437             Added UIProcess/WebResourceLoadStatisticsManager.cpp and
2438             UIProcess/API/C/WKResourceLoadStatisticsManager.cpp.
2439         * PlatformGTK.cmake:
2440             Added UIProcess/WebResourceLoadStatisticsManager.cpp and
2441             UIProcess/API/C/WKResourceLoadStatisticsManager.cpp.
2442         * PlatformMac.cmake:
2443             Added UIProcess/WebResourceLoadStatisticsManager.cpp and
2444             UIProcess/API/C/WKResourceLoadStatisticsManager.cpp.
2445         * Shared/API/APIObject.h:
2446             Adds WebResourceLoadStatisticsManager to the Type enum.
2447         * Shared/API/c/WKBase.h:
2448             Typedef of WKResourceLoadStatisticsManagerRef.
2449         * Shared/WebCoreArgumentCoders.cpp:
2450         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
2451         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
2452             Adds support for statistics mostRecentUserInteraction, grandfathered, and
2453             dataRecordsRemoved.
2454         * UIProcess/API/C/WKAPICast.h:
2455             Adds API mapping between WKResourceLoadStatisticsManagerRef and 
2456             WebResourceLoadStatisticsManager.
2457         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: Added.
2458         (WKResourceLoadStatisticsManagerGetTypeID):
2459         (WKResourceLoadStatisticsManagerSetPrevalentResource):
2460         (WKResourceLoadStatisticsManagerIsPrevalentResource):
2461         (WKResourceLoadStatisticsManagerSetHasHadUserInteraction):
2462         (WKResourceLoadStatisticsManagerIsHasHadUserInteraction):
2463         (WKResourceLoadStatisticsManagerSetTimeToLiveUserInteraction):
2464         (WKResourceLoadStatisticsManagerFireDataModificationHandler):
2465         (WKResourceLoadStatisticsManagerSetNotifyPagesWhenDataRecordsWereScanned):
2466         (WKResourceLoadStatisticsManagerSetShouldClassifyResourcesBeforeDataRecordsRemoval):
2467         (WKResourceLoadStatisticsManagerSetMinimumTimeBetweeenDataRecordsRemoval):
2468         (WKResourceLoadStatisticsManagerResetToConsistentState):
2469             API level bridge to WebResourceLoadStatisticsManager functions.
2470         * UIProcess/API/C/WKResourceLoadStatisticsManager.h: Added.
2471         * UIProcess/WebProcessProxy.cpp:
2472         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyOwnedDomainsInAllPersistentDataStores):
2473             A way to delete website data in persistent store(s) configured by the 
2474             embedding client. API::WebsiteDataStore::defaultDataStore() does not 
2475             do this which caused us to skip session storage.
2476         * UIProcess/WebProcessProxy.h:
2477         * UIProcess/WebResourceLoadStatisticsManager.cpp: Added.
2478         (WebKit::WebResourceLoadStatisticsManager::setPrevalentResource):
2479         (WebKit::WebResourceLoadStatisticsManager::isPrevalentResource):
2480         (WebKit::WebResourceLoadStatisticsManager::setHasHadUserInteraction):
2481         (WebKit::WebResourceLoadStatisticsManager::hasHadUserInteraction):
2482         (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveUserInteraction):
2483         (WebKit::WebResourceLoadStatisticsManager::fireDataModificationHandler):
2484         (WebKit::WebResourceLoadStatisticsManager::setNotifyPagesWhenDataRecordsWereScanned):
2485         (WebKit::WebResourceLoadStatisticsManager::setShouldClassifyResourcesBeforeDataRecordsRemoval):
2486         (WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval):
2487         (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState):
2488             Static functions to manage the state and behavior of the UI process' 
2489             resource load statistics store.
2490         * UIProcess/WebResourceLoadStatisticsManager.h: Added.
2491         (WebKit::WebResourceLoadStatisticsManager::create):
2492         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2493         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2494             An effect of a member variable rename. See header file comment below.
2495         (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
2496         (WebKit::WebResourceLoadStatisticsStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
2497         (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval):
2498             Three static functions for controlling the behavior of the store.
2499         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
2500             Changes:
2501             1. Covers all data record types.
2502             2. Allows data removal when m_lastTimeDataRecordsWereRemoved is not set.
2503             3. Moves the heavy lifting to WebsiteDataStore (see below).
2504             4. No longer counts removed data regressions.
2505         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
2506             See next comment.
2507         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
2508             WebResourceLoadStatisticsStore::processStatisticsAndDataRecords() is 
2509             broken out of WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated
2510             to allow for statistics processing without prior classification.
2511             Tests need to set statistics and a run of the classifier may
2512             reset the data.
2513         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
2514             Sets the notification callback which calls 
2515             WebResourceLoadStatisticsStore::processStatisticsAndDataRecords().
2516         * UIProcess/WebResourceLoadStatisticsStore.h:
2517         (WebKit::WebResourceLoadStatisticsStore::coreStore):
2518             Renamed m_resourceStatisticsStore to m_resourceLoadStatisticsStore to
2519             harmonize with other naming.
2520         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2521         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyOwnedDomains):
2522             This is now where matching is made between prevalent resources
2523             and data records. This function is used by 
2524             WebsiteDataStore::removeDataForTopPrivatelyOwnedDomains().
2525         (WebKit::WebsiteDataStore::removeDataForTopPrivatelyOwnedDomains):
2526             The function WebResourceLoadStatisticsStore::removeDataRecords()
2527             calls to get data records removed in all persistent stores.
2528         * UIProcess/WebsiteData/WebsiteDataStore.h:
2529         * WebKit2.xcodeproj/project.pbxproj:
2530         * WebProcess/WebProcess.cpp:
2531         (WebKit::m_resourceLoadStatisticsStore):
2532         (WebKit::WebProcess::statisticsChangedTimerFired):
2533         (WebKit::m_resourceLoadStatisticsStorage): Deleted.
2534             Renamed m_resourceLoadStatisticsStorage to m_resourceLoadStatisticsStore 
2535             to harmonize with other naming.
2536         * WebProcess/WebProcess.h:
2537
2538 2017-02-10  Simon Fraser  <simon.fraser@apple.com>
2539
2540         Zero out some WKWebView state in the case of a web content crash
2541         https://bugs.webkit.org/show_bug.cgi?id=168157
2542
2543         Reviewed by Tim Horton.
2544
2545         Reset some bits of state in WKWebView when the web content process crashes, in
2546         to try to avoid states that might cause the web view to stay blank.
2547
2548         * UIProcess/API/Cocoa/WKWebView.mm:
2549         (-[WKWebView _processDidExit]):
2550
2551 2017-02-10  Daniel Bates  <dabates@apple.com>
2552
2553         Detach frame from document when entering page cache
2554         https://bugs.webkit.org/show_bug.cgi?id=166774
2555         <rdar://problem/29904368>
2556
2557         Reviewed by Chris Dumez.
2558
2559         * Shared/WebPreferencesDefinitions.h:
2560         * UIProcess/API/C/WKPreferences.cpp:
2561         (WKPreferencesSetAllowsPageCacheWithWindowOpener): Deleted.
2562         (WKPreferencesGetAllowsPageCacheWithWindowOpener): Deleted.
2563         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2564         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2565         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2566         * WebProcess/WebPage/WebPage.cpp:
2567         (WebKit::WebPage::updatePreferences):
2568
2569 2017-02-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2570
2571         WebInspector: refactor RemoteInspector to move cocoa specific code to their own files
2572         https://bugs.webkit.org/show_bug.cgi?id=166681
2573
2574         Reviewed by Michael Catanzaro.
2575
2576         * WebProcess/WebProcess.cpp:
2577         (WebKit::WebProcess::initializeWebProcess): Add PLATFORM(COCOA) to the ifdef.
2578
2579 2017-02-10  Tim Horton  <timothy_horton@apple.com>
2580
2581         Infinite UI process hang under ensurePositionInformationIsUpToDate
2582         https://bugs.webkit.org/show_bug.cgi?id=168154
2583         <rdar://problem/30428673>
2584
2585         Reviewed by Simon Fraser.
2586
2587         * UIProcess/ios/WKContentViewInteraction.mm:
2588         (-[WKContentView cleanupInteraction]):
2589         If the web process crashes or we're being torn down for another reason,
2590         assume that we aren't ever going to receive any pending async interaction
2591         information update. Otherwise, ensurePositionInformationIsUpToDate can end
2592         up waiting for it forever.
2593
2594 2017-02-10  Andrew Gold  <agold@apple.com>
2595
2596         Add mediaStreamEnabled property to WKPreferences for Cocoa.
2597         https://bugs.webkit.org/show_bug.cgi?id=168080
2598
2599         Reviewed by Tim Horton.
2600
2601         * UIProcess/API/Cocoa/WKWebView.mm:
2602         (-[WKWebView _initializeWithConfiguration:]): Sets the pageConfiguration's mediaStreamEnabled preference value.
2603
2604         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2605         (-[WKWebViewConfiguration copyWithZone:]): Copies the mediaStreamEnabled property.
2606         (-[WKWebViewConfiguration _mediaStreamEnabled]): Gets the mediaStreamEnabled property.
2607         (-[WKWebViewConfiguration _setMediaStreamEnabled:]): Sets the mediaStreamEnabled property.
2608         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2609
2610 2017-02-10  Olivier Blin  <olivier.blin@softathome.com>
2611
2612         WebProcess: remove unused m_inDidClose
2613         https://bugs.webkit.org/show_bug.cgi?id=168121
2614
2615         Reviewed by Alex Christensen.
2616
2617         * WebProcess/WebProcess.cpp:
2618         (WebKit::WebProcess::didClose):
2619         * WebProcess/WebProcess.h:
2620         m_inDidClose has been unused since r83774
2621
2622 2017-02-10  Joseph Pecoraro  <pecoraro@apple.com>
2623
2624         [Resource Timing] Enable Resource Timing by default in Tests
2625         https://bugs.webkit.org/show_bug.cgi?id=168145
2626
2627         Reviewed by Ryosuke Niwa.
2628
2629         * Shared/WebPreferencesDefinitions.h:
2630         * UIProcess/API/C/WKPreferences.cpp:
2631         (WKPreferencesSetResourceTimingEnabled):
2632         (WKPreferencesGetResourceTimingEnabled):
2633         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2634         * WebProcess/WebPage/WebPage.cpp:
2635         (WebKit::WebPage::updatePreferences):
2636
2637 2017-02-10  Dan Bernstein  <mitz@apple.com>
2638
2639         [Cocoa] Add shouldChangeSelectedRange to WKWebProcessPlugInEditingDelegate
2640         https://bugs.webkit.org/show_bug.cgi?id=168097
2641
2642         Reviewed by Tim Horton.
2643
2644         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
2645           Declared new delegate method.
2646         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2647         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): Dispatch new delegate
2648           method.
2649
2650         * WebProcess/WebPage/ios/WebPageIOS.mm:
2651         (WebKit::WebPage::selectWithGesture): Pass UserTriggered whan calling
2652           WebCore::Frame::Selection::setSelectedRange, so that the delegate is consulted.
2653         (WebKit::WebPage::changeBlockSelection): Ditto.
2654         (WebKit::WebPage::updateSelectionWithTouches): Ditto.
2655         (WebKit::WebPage::selectWithTwoTouches): Ditto.
2656         (WebKit::WebPage::extendSelection): Ditto.
2657         (WebKit::WebPage::selectWordBackward): Ditto,
2658         (WebKit::WebPage::moveSelectionByOffset): Ditto.
2659         (WebKit::WebPage::selectPositionAtPoint): Ditto.
2660         (WebKit::WebPage::selectPositionAtBoundaryWithDirection): Ditto.
2661         (WebKit::WebPage::moveSelectionAtBoundaryWithDirection): Ditto.
2662         (WebKit::WebPage::selectTextWithGranularityAtPoint): Ditto.
2663         (WebKit::WebPage::updateSelectionWithExtentPointAndBoundary): Ditto.
2664         (WebKit::WebPage::updateSelectionWithExtentPoint): Ditto.
2665
2666 2017-02-10  Brady Eidson  <beidson@apple.com>
2667
2668         Replace all WebKit Library Version checks in WK2 with SDK version checks.
2669         https://bugs.webkit.org/show_bug.cgi?id=168124
2670
2671         Reviewed by Geoffrey Garen.
2672
2673         This change gets rid of WebKit Library Version checks and replaces them with SDK version checks.
2674         
2675         To allow our tools to still be able to test new behaviors even when built against older SDKs,
2676         it also opts them into an SPI default to have "linkedOnOrAfter()" always return true.
2677         
2678         * Shared/Cocoa/CompletionHandlerCallChecker.mm:
2679         (WebKit::shouldThrowExceptionForDuplicateCompletionHandlerCall):
2680         
2681         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2682         (-[WKWebViewConfiguration init]):
2683         
2684         * UIProcess/Cocoa/VersionChecks.h:
2685         (WebKit::linkedOnOrAfter): Deleted.
2686         * UIProcess/Cocoa/VersionChecks.mm:
2687         (WebKit::linkedOnOrAfter):
2688         
2689         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2690         (WebKit::WebProcessPool::isNetworkCacheEnabled):
2691
2692 2017-02-10  Brian Burg  <bburg@apple.com>
2693
2694         [Cocoa] Web Inspector: generate an NS_ENUM containing platforms supported by the protocol code generator
2695         https://bugs.webkit.org/show_bug.cgi?id=168019
2696         <rdar://problem/28718990>
2697
2698         Reviewed by Joseph Pecoraro.
2699
2700         * UIProcess/Automation/Automation.json: Fix the platform values to be lowercase.
2701
2702 2017-02-10  Brian Burg  <bburg@apple.com>
2703
2704         Web Automation: fail gracefully when a screenshot cannot be encoded as base64
2705         https://bugs.webkit.org/show_bug.cgi?id=168095
2706         <rdar://problem/30297427>
2707
2708         Reviewed by Joseph Pecoraro.
2709
2710         Convert platformGetBase64EncodedPNGData to return a std::optional<String>.
2711         Return nullopt if we can't create a screenshot or convert it to base64.
2712
2713         * UIProcess/Automation/WebAutomationSession.cpp:
2714         (WebKit::WebAutomationSession::didTakeScreenshot):
2715         (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
2716         * UIProcess/Automation/WebAutomationSession.h:
2717         * UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm:
2718         (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
2719
2720 2017-02-09  Carlos Garcia Campos  <cgarcia@igalia.com>
2721
2722         Unreviewed. Fix GTK+ build with threaded compositor disabled.
2723
2724         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2725         (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
2726         (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow):
2727
2728 2017-02-09  Alex Christensen  <achristensen@webkit.org>
2729
2730         Unreviewed, rolling out r212040.
2731
2732         Broke build.  I'm not surprised
2733
2734         Reverted changeset:
2735
2736         "[WebRTC][Mac] Activate libwebrtc"
2737         https://bugs.webkit.org/show_bug.cgi?id=167293
2738         http://trac.webkit.org/changeset/212040
2739
2740 2017-02-09  Chris Dumez  <cdumez@apple.com>
2741
2742         [Mac][WK2] Use MIME type to add file extension to downloads' suggested filenames when missing
2743         https://bugs.webkit.org/show_bug.cgi?id=168077
2744         <rdar://problem/30412595>
2745
2746         Reviewed by Alex Christensen.
2747
2748         Use MIME type to add file extension to downloads' suggested filenames when missing:
2749         - https://html.spec.whatwg.org/#as-a-download (step 19)
2750
2751         This new behavior matches Chrome.
2752
2753         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
2754         (WebKit::BlobDownloadClient::didReceiveResponseAsync):
2755         * NetworkProcess/Downloads/Download.cpp:
2756         (WebKit::Download::didReceiveResponse):
2757         (WebKit::Download::decideDestinationWithSuggestedFilename):
2758         * NetworkProcess/Downloads/Download.h:
2759         * NetworkProcess/NetworkProcess.cpp:
2760         (WebKit::NetworkProcess::findPendingDownloadLocation):
2761         * UIProcess/Downloads/DownloadProxy.cpp:
2762         (WebKit::DownloadProxy::didStart):
2763         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
2764         * UIProcess/Downloads/DownloadProxy.h:
2765         * UIProcess/Downloads/DownloadProxy.messages.in:
2766
2767 2017-02-09  Youenn Fablet  <youenn@apple.com>
2768
2769         [WebRTC][Mac] Activate libwebrtc
2770         https://bugs.webkit.org/show_bug.cgi?id=167293
2771
2772         Reviewed by Alex Christensen.
2773
2774         * Shared/WebPreferencesDefinitions.h:
2775
2776 2017-02-09  Alex Christensen  <achristensen@webkit.org>
2777
2778         Fix libwebrtc build on case-sensitive file systems.
2779
2780         * WebProcess/Network/webrtc/WebRTCMonitor.cpp:
2781
2782 2017-02-09  Alex Christensen  <achristensen@webkit.org>
2783
2784         Fix CMake build.
2785
2786         * PlatformMac.cmake:
2787
2788 2017-02-09  Brady Eidson  <beidson@apple.com>
2789
2790         Transition "WebKit Library Version" checks to SDK version checks.
2791         <rdar://problem/30313696> and https://bugs.webkit.org/show_bug.cgi?id=168056
2792
2793         Reviewed by Geoffrey Garen.
2794
2795         When doing linkedOnOrAfter checks, relying solely on the WebKit library version number is error prone,
2796         since apps may not link against WebKit directly and therefore the linked WebKit is unknown.
2797         
2798         We should first prefer a version check on the SDK that the app was built with.
2799         
2800         If that check fails, we can fallback to the linked WebKit library version number if it exists.
2801
2802         * Shared/Cocoa/CompletionHandlerCallChecker.mm:
2803         (WebKit::shouldThrowExceptionForDuplicateCompletionHandlerCall):
2804
2805         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2806         (-[WKWebViewConfiguration init]):
2807
2808         For each "linked-on-or-after" feature, include both the WebKit library version and SDK version:
2809         * UIProcess/Cocoa/VersionChecks.h:
2810         (WebKit::linkedOnOrAfter):
2811         * UIProcess/Cocoa/VersionChecks.mm:
2812         (WebKit::linkedOnOrAfter):
2813         (WebKit::linkTimeVersion): Deleted.
2814
2815         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2816         (WebKit::WebProcessPool::isNetworkCacheEnabled):
2817
2818 2017-02-09  Commit Queue  <commit-queue@webkit.org>
2819
2820         Unreviewed, rolling out r211980 and r211987.
2821         https://bugs.webkit.org/show_bug.cgi?id=168072
2822
2823         Caused API test WebKit2.DuplicateCompletionHandlerCalls to
2824         fail (Requested by ryanhaddad on #webkit).
2825
2826         Reverted changesets:
2827
2828         "Transition "WebKit Library Version" checks to SDK version
2829         checks."
2830         https://bugs.webkit.org/show_bug.cgi?id=168056
2831         http://trac.webkit.org/changeset/211980
2832
2833         "Build fix for APPLE_INTERNAL_SDK builds after r211980."
2834         http://trac.webkit.org/changeset/211987
2835
2836 2017-02-09  Brady Eidson  <beidson@apple.com>
2837
2838         Transition "WebKit Library Version" checks to SDK version checks.
2839         <rdar://problem/30313696> and https://bugs.webkit.org/show_bug.cgi?id=168056
2840
2841         Reviewed by Geoffrey Garen.
2842
2843         Library version linkedOnOrAfter checks are error prone since apps may not link directly to WebKit.
2844         
2845         We always know what version of the SDK an app was built with, so we should use SDK version checks
2846         whenever possible.
2847
2848         * Shared/Cocoa/CompletionHandlerCallChecker.mm:
2849         (WebKit::shouldThrowExceptionForDuplicateCompletionHandlerCall):
2850         
2851         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2852         (-[WKWebViewConfiguration init]):
2853         
2854         Add SDKVersion form of the linkedOnOrAfter check, and transition over the current Library Version checks:
2855         * UIProcess/Cocoa/VersionChecks.h: 
2856         * UIProcess/Cocoa/VersionChecks.mm:
2857         (WebKit::linkedOnOrAfter):
2858         
2859         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2860         (WebKit::WebProcessPool::isNetworkCacheEnabled):
2861
2862 2017-02-09  Antti Koivisto  <antti@apple.com>
2863
2864         Use all cacheable speculatively loaded responses
2865         https://bugs.webkit.org/show_bug.cgi?id=168052
2866
2867         Reviewed by Andreas Kling.
2868
2869         We currently only allow 200 responses. There is no reason not to use speculative responses
2870         that have other cacheable status codes. This is helpful for 204s and 404s.
2871
2872         * NetworkProcess/cache/NetworkCache.cpp:
2873         (WebKit::NetworkCache::makeStoreDecision):
2874         (WebKit::NetworkCache::isStatusCodeCacheableByDefault): Deleted.
2875         (WebKit::NetworkCache::isStatusCodePotentiallyCacheable): Deleted.
2876
2877             Move to CacheValidation.h/cpp
2878
2879         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2880         (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
2881
2882             Allow all cacheable-by-default responses.
2883
2884 2017-02-09  Tomas Popela  <tpopela@redhat.com>
2885
2886         Unreviewed. Fix gtk-doc warning
2887
2888         html/WebKitSettings.html:4435: warning: no link for: 'api-index-2.3' -> (2.3).
2889
2890         * UIProcess/API/gtk/WebKitSettings.cpp:
2891         (webkit_settings_class_init):
2892
2893 2017-02-09  Antti Koivisto  <antti@apple.com>
2894
2895         Remove most cases of #if ENABLE(CACHE_PARTITIONING)
2896         https://bugs.webkit.org/show_bug.cgi?id=167990
2897
2898         Reviewed by Sam Weinig.
2899
2900         * NetworkProcess/NetworkResourceLoader.cpp:
2901         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
2902         * NetworkProcess/cache/NetworkCache.cpp:
2903         (WebKit::NetworkCache::Cache::makeCacheKey):
2904         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2905         (WebKit::NetworkCache::constructRevalidationRequest):
2906         * Shared/WebCoreArgumentCoders.cpp:
2907         (IPC::ArgumentCoder<ResourceRequest>::encode):
2908         (IPC::ArgumentCoder<ResourceRequest>::decode):
2909         * Shared/WebProcessCreationParameters.cpp:
2910         (WebKit::WebProcessCreationParameters::encode):
2911         (WebKit::WebProcessCreationParameters::decode):
2912         * Shared/WebProcessCreationParameters.h:
2913         * UIProcess/API/C/WKContext.cpp:
2914         (WKContextRegisterURLSchemeAsCachePartitioned):
2915         * UIProcess/WebProcessPool.cpp:
2916         (WebKit::m_hiddenPageThrottlingTimer):
2917         (WebKit::WebProcessPool::createNewWebProcess):
2918         (WebKit::WebProcessPool::registerURLSchemeAsCachePartitioned):
2919         * UIProcess/WebProcessPool.h:
2920         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2921         (InitWebCoreSystemInterface):
2922         * WebProcess/WebProcess.cpp:
2923         (WebKit::WebProcess::initializeWebProcess):
2924         (WebKit::WebProcess::registerURLSchemeAsCachePartitioned):
2925         * WebProcess/WebProcess.h:
2926         * WebProcess/WebProcess.messages.in:
2927
2928 2017-02-08  Simon Fraser  <simon.fraser@apple.com>
2929
2930         Put names on more UIViews for ease of debugging
2931         https://bugs.webkit.org/show_bug.cgi?id=168035
2932
2933         Reviewed by Tim Horton.
2934
2935         Put names on the various bare UIViews that we create.
2936
2937         * UIProcess/API/Cocoa/WKWebView.mm:
2938         (-[WKWebView _setHasCustomContentView:loadedMIMEType:]):
2939         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
2940         * UIProcess/ios/ViewGestureControllerIOS.mm:
2941         (WebKit::ViewGestureController::beginSwipeGesture):
2942         * UIProcess/ios/WKContentView.mm:
2943         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
2944         * UIProcess/ios/WKContentViewInteraction.mm:
2945         (-[WKContentView setupInteraction]):
2946         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
2947         (WebKit::WebInspectorClient::showPaintRect):
2948         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2949         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
2950
2951 2017-02-08  Andy Estes  <aestes@apple.com>
2952
2953         Custom protocols should not continue loading after a network process crash
2954         https://bugs.webkit.org/show_bug.cgi?id=168028
2955         <rdar://problem/27607520>
2956
2957         Reviewed by Brady Eidson.
2958
2959         WKCustomProtocolLoaders are meant to be owned by CustomProtocolManagerProxy and have their
2960         loads cancelled when CustomProtocolManagerProxy is destroyed. However, WKCustomProtocolLoader
2961         creates a NSURLConnection for which it is the client, so NSURLConnection retains it for the
2962         duration of the load.
2963
2964         These loaders should be explicitly cancelled when their CustomProtocolManagerProxy is destroyed.
2965
2966         New API test: WebKit2CustomProtocolsTest.CloseDuringCustomProtocolLoad
2967
2968         * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
2969         (-[WKCustomProtocolLoader customProtocolManagerProxyDestroyed]): Added. Cancels the
2970         _urlConnection and sets _customProtocolManagerProxy to nullptr.
2971         (WebKit::CustomProtocolManagerProxy::~CustomProtocolManagerProxy):
2972         Called -customProtocolManagerProxyDestroyed on every loader in m_loaderMap.
2973
2974 2017-02-08  Dan Bernstein  <mitz@apple.com>
2975
2976         [Cocoa] WKRemoteObjectCoder doesn’t handle CGSize
2977         https://bugs.webkit.org/show_bug.cgi?id=168031
2978
2979         Reviewed by Tim Horton.
2980
2981         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
2982         (encodeInvocationArguments): Encode CGSize by encoding two NSNumbers. Somewhat sadly,
2983           +[NSValue valueWithCGSize:] is not available in macOS.
2984         (decodeInvocationArguments): Decode wrapped numbers.
2985
2986 2017-02-08  Dan Bernstein  <mitz@apple.com>
2987
2988         Tried to fix the build after r211897.
2989
2990         * UIProcess/ios/WKContentViewInteraction.h:
2991
2992 2017-02-08  Dan Bernstein  <mitz@apple.com>
2993
2994         [iOS] WKWebView doesn’t have implementations of UIResponderStandardEditActions that can be overridden
2995         https://bugs.webkit.org/show_bug.cgi?id=167974
2996
2997         Reviewed by Tim Horton.
2998
2999         * UIProcess/API/Cocoa/WKWebView.mm:
3000           Gave each of the actions in FOR_EACH_WKCONTENTVIEW_ACTION an implementation that sends it
3001           to the WKContentView if we’re using one.
3002         (-[WKWebView canPerformAction:withSender:]): Override and for each of the actions in
3003           FOR_EACH_WKCONTENTVIEW_ACTION, forward to
3004           -[WKContentView canPerformActionForWebView:withSender:] if we’re using a WKContentView,
3005           otherwise returning NO.
3006
3007         * UIProcess/ios/WKContentViewInteraction.h: Declared -canPerformActionForWebView:withSender:
3008           and several internal methods we override.
3009         * UIProcess/ios/WKContentViewInteraction.mm:
3010         (-[WKContentView canPerformAction:withSender:]): Now returns NO so that the target for any
3011           action is the WKWebView.
3012         (-[WKContentView canPerformActionForWebView:withSender:]): Moved the logic previously in
3013           -canPerformAction:withSender: to here.
3014
3015 2017-02-08  Antti Koivisto  <antti@apple.com>
3016
3017         Allow speculative redirects
3018         https://bugs.webkit.org/show_bug.cgi?id=167982
3019
3020         Reviewed by Andreas Kling.
3021
3022         If speculative loader hits a redirect it will drop it on the floor. We should use it instead.
3023
3024         * NetworkProcess/NetworkResourceLoader.cpp:
3025         (WebKit::NetworkResourceLoader::continueWillSendRequest):
3026         (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
3027
3028             Reset m_isWaitingContinueWillSendRequestForCachedRedirect bit immediately.
3029
3030         * NetworkProcess/cache/NetworkCache.cpp:
3031         (WebKit::NetworkCache::Cache::makeRedirectEntry):
3032
3033             Factor to a function.
3034
3035         (WebKit::NetworkCache::Cache::storeRedirect):
3036         * NetworkProcess/cache/NetworkCache.h:
3037         (WebKit::NetworkCache::Cache::speculativeLoadManager):
3038         * NetworkProcess/cache/NetworkCacheEntry.cpp:
3039         (WebKit::NetworkCache::Entry::Entry):
3040
3041             Use std::optional instead std::unique_ptr for the redirect request.
3042
3043         (WebKit::NetworkCache::Entry::decodeStorageRecord):
3044         * NetworkProcess/cache/NetworkCacheEntry.h:
3045         (WebKit::NetworkCache::Entry::redirectRequest):
3046         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
3047         (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
3048
3049             Make a cache entry for speculative redirect.
3050             Redirect is not actually performed, the target resource will have a separate
3051             speculative entry.
3052
3053         (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
3054         (WebKit::NetworkCache::SpeculativeLoad::didFailLoading):
3055         (WebKit::NetworkCache::SpeculativeLoad::didComplete):
3056
3057             Protect against multiple completions.
3058
3059         (WebKit::NetworkCache::SpeculativeLoad::abort): Deleted.
3060         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
3061         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
3062         (WebKit::NetworkCache::SpeculativeLoadManager::retrieve):
3063
3064             Make successful retrieves asynchronous to avoid re-entrancy problems.
3065
3066 2017-02-08  Jer Noble  <jer.noble@apple.com>
3067
3068         Unreviewed build fix; FullscreenClient only avaialble on 32-bit builds.
3069
3070         * UIProcess/Cocoa/WebViewImpl.mm:
3071         (WebKit::WebViewImpl::WebViewImpl):
3072
3073 2017-02-08  Jer Noble  <jer.noble@apple.com>
3074
3075         Move FullscreenClient creation into WebViewImpl, for use in (deprecated) WKView.
3076         https://bugs.webkit.org/show_bug.cgi?id=168007
3077
3078         Reviewed by Alex Christensen.
3079
3080         * UIProcess/API/Cocoa/WKWebView.mm:
3081         (-[WKWebView _initializeWithConfiguration:]):
3082         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h:
3083         * UIProcess/Cocoa/FullscreenClient.h:
3084         * UIProcess/Cocoa/FullscreenClient.mm:
3085         (WebKit::FullscreenClient::FullscreenClient):
3086         * UIProcess/Cocoa/WebViewImpl.mm:
3087         (WebKit::WebViewImpl::WebViewImpl):
3088
3089 2017-02-08  Youenn Fablet  <youenn@apple.com>
3090
3091         GUM is crashing in Debug mode when access is granted/denied for a page that is gone
3092         https://bugs.webkit.org/show_bug.cgi?id=168003
3093
3094         Reviewed by Eric Carlson.
3095
3096         Removing the assertion since manager can be null and case is coevered by the if statement behind it.
3097
3098         * UIProcess/UserMediaPermissionRequestProxy.cpp:
3099         (WebKit::UserMediaPermissionRequestProxy::deny):
3100
3101 2017-02-08  Ryan Haddad  <ryanhaddad@apple.com>
3102
3103         Unreviewed, rolling out r211869.
3104
3105         This change caused assertion failures on macOS WK2.
3106
3107         Reverted changeset:
3108
3109         "Allow speculative redirects"
3110         https://bugs.webkit.org/show_bug.cgi?id=167982
3111         http://trac.webkit.org/changeset/211869
3112
3113 2017-02-08  Eric Carlson  <eric.carlson@apple.com>
3114
3115         Add WebRTC as an off-by-default experimental feature menu item.
3116         https://bugs.webkit.org/show_bug.cgi?id=167972
3117         <rdar://problem/30293429>
3118
3119         Reviewed by Jon Lee.
3120
3121         * Shared/WebPreferencesDefinitions.h:
3122         * UIProcess/WebPreferences.cpp:
3123         (WebKit::WebPreferences::setPeerConnectionAndMediaStreamEnabled): We need to enable/disable
3124         peer connection and media stream preferences at the same time, so special case them.
3125         (WebKit::WebPreferences::setEnabledForFeature):
3126         * UIProcess/WebPreferences.h:
3127
3128 2017-02-08  Chris Dumez  <cdumez@apple.com>
3129
3130         Add support for enhanced privacy diagnostic logging
3131         https://bugs.webkit.org/show_bug.cgi?id=167948
3132         <rdar://problem/30385112>
3133
3134         Reviewed by Antti Koivisto.
3135
3136         Implement new DiagnosticLoggingClient::logDiagnosticMessageWithEnhancedPrivacy()
3137         virtual method on WebKit2 and expose it to the client via the WKPageDiagnosticLogging
3138         delegate.
3139
3140         * UIProcess/API/APIDiagnosticLoggingClient.h:
3141         (API::DiagnosticLoggingClient::logDiagnosticMessageWithEnhancedPrivacy):
3142         * UIProcess/API/C/WKPageDiagnosticLoggingClient.h:
3143         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
3144         * UIProcess/Cocoa/DiagnosticLoggingClient.h:
3145         * UIProcess/Cocoa/DiagnosticLoggingClient.mm:
3146         (WebKit::DiagnosticLoggingClient::setDelegate):
3147         (WebKit::DiagnosticLoggingClient::logDiagnosticMessageWithEnhancedPrivacy):
3148         * UIProcess/WebPageDiagnosticLoggingClient.cpp:
3149         (WebKit::WebPageDiagnosticLoggingClient::logDiagnosticMessageWithEnhancedPrivacy):
3150         * UIProcess/WebPageDiagnosticLoggingClient.h:
3151         * UIProcess/WebPageProxy.cpp:
3152         (WebKit::WebPageProxy::logDiagnosticMessageWithEnhancedPrivacy):
3153         * UIProcess/WebPageProxy.h:
3154         * UIProcess/WebPageProxy.messages.in:
3155         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
3156         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithEnhancedPrivacy):
3157         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:
3158
3159 2017-02-08  Antti Koivisto  <antti@apple.com>
3160
3161         Allow speculative redirects
3162         https://bugs.webkit.org/show_bug.cgi?id=167982
3163
3164         Reviewed by Andreas Kling.
3165
3166         If speculative loader hits a redirect it will drop it on the floor. We should use it.
3167
3168         * NetworkProcess/NetworkResourceLoader.cpp:
3169         (WebKit::NetworkResourceLoader::continueWillSendRequest):
3170         (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
3171
3172             Reset the m_isWaitingContinueWillSendRequestForCachedRedirect bit immediately.
3173
3174         * NetworkProcess/cache/NetworkCache.cpp:
3175         (WebKit::NetworkCache::Cache::makeRedirectEntry):
3176
3177             Factor to a function.
3178
3179         (WebKit::NetworkCache::Cache::storeRedirect):
3180         * NetworkProcess/cache/NetworkCache.h:
3181         (WebKit::NetworkCache::Cache::speculativeLoadManager):
3182         * NetworkProcess/cache/NetworkCacheEntry.cpp:
3183         (WebKit::NetworkCache::Entry::Entry):
3184
3185             Use std::optional instead std::unique_ptr for the redirect request.
3186
3187         (WebKit::NetworkCache::Entry::decodeStorageRecord):
3188         * NetworkProcess/cache/NetworkCacheEntry.h:
3189         (WebKit::NetworkCache::Entry::redirectRequest):
3190         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
3191         (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
3192
3193             Make cache entry for speculative redirect.
3194             The redirect is not actually performed, the target resource will have separate
3195             a speculative entry.
3196
3197         (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
3198         (WebKit::NetworkCache::SpeculativeLoad::didFailLoading):
3199         (WebKit::NetworkCache::SpeculativeLoad::didComplete):
3200
3201             Protect against multiple completions.
3202
3203         (WebKit::NetworkCache::SpeculativeLoad::abort): Deleted.
3204         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
3205         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
3206         (WebKit::NetworkCache::SpeculativeLoadManager::retrieve):
3207
3208             Make successful retrieves asynchronous to avoid re-entrancy problems.
3209
3210 2017-02-07  Brent Fulgham  <bfulgham@apple.com>
3211
3212         Correct initialization of Resource Load Statistics for use in WebKitTestRunner
3213         https://bugs.webkit.org/show_bug.cgi?id=167960
3214
3215         Reviewed by Andy Estes.
3216
3217         WebKit2 starts up with different process configuration settings depending on the type of
3218         WebView and client application. This led to two problems:
3219         1. Registering the shared resource load observer did not start at UIProcess launch. Instead, it
3220            was lazily initialized as messages from the various WebProcess started getting received. This
3221            is too slow for WebKitTestRunner, which needs this object to be initialized right at launch
3222            time.
3223            
3224            A new 'registerSharedResourceLoadObserver' method was needed, so that the WebProcess can ask
3225            the WebsiteDataStore to register a resource load observer during platform initialization.
3226
3227         2. Some WebView uses do not enable WebsiteDataStore, and should not activate a resource load
3228            statistics observer.
3229
3230         * UIProcess/API/APIWebsiteDataStore.cpp:
3231         (API::WebsiteDataStore::registerSharedResourceLoadObserver): Added.
3232         * UIProcess/API/APIWebsiteDataStore.h:
3233         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3234         (WebKit::WebProcessPool::platformInitialize): If the web process is using a WebsiteDataStore,
3235         register a resource load observer.
3236         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3237         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Added.
3238         * UIProcess/WebResourceLoadStatisticsStore.h:
3239         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3240         (WebKit::WebsiteDataStore::registerSharedResourceLoadObserver): Added.
3241         * UIProcess/WebsiteData/WebsiteDataStore.h:
3242
3243 2017-02-07  Anders Carlsson  <andersca@apple.com>
3244
3245         REGRESSION (r211819): [ios-simulator] API tests Coding.WKWebView and Coding.WKWebView_SameConfiguration crashing
3246         https://bugs.webkit.org/show_bug.cgi?id=167947
3247
3248         Reviewed by Tim Horton.
3249
3250         * Platform/spi/ios/UIKitSPI.h:
3251         Add SPI declaration.
3252
3253         * UIProcess/API/Cocoa/WKWebView.mm:
3254         (-[WKWebView _initializeWithConfiguration:]):
3255         Make sure to call setDrawsBackground here.
3256
3257         (-[WKWebView _populateArchivedSubviews:]):
3258         We don't want to archive the scroll view and the fixed overlay view.
3259
3260         (-[WKWebView setOpaque:]):
3261         Return early if this is called before we have a page (like from -[UIView initWithCoder:]).
3262
3263 2017-02-07  Alex Christensen  <achristensen@webkit.org>
3264
3265         Revert r166597
3266         https://bugs.webkit.org/show_bug.cgi?id=167951
3267
3268         Reviewed by Andreas Kling.
3269
3270         CFURLConnectionInvalidateConnectionCache is not commonly called and is likely causing
3271         CFNetwork to be in a strange state when using NSURLSession and invalidating the connection
3272         cache during authentication, especially server trust evaluation.  Right now we only call
3273         it when handling memory pressure, and it isn't worth getting into such a strange state
3274         in a poorly tested situation. See rdar://problem/27439617
3275
3276         * NetworkProcess/NetworkProcess.cpp:
3277         (WebKit::NetworkProcess::lowMemoryHandler):
3278         (WebKit::NetworkProcess::initializeSandbox):
3279         (WebKit::NetworkProcess::platformLowMemoryHandler): Deleted.
3280         * NetworkProcess/NetworkProcess.h:
3281         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3282         (WebKit::NetworkProcess::platformLowMemoryHandler): Deleted.
3283
3284 2017-02-07  Brian Burg  <bburg@apple.com>
3285
3286         [Mac] Web Automation: NSEventType not initialized in WebAutomationSession::platformSimulateMouseInteraction
3287         https://bugs.webkit.org/show_bug.cgi?id=167902
3288
3289         Reviewed by Joseph Pecoraro.
3290
3291         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
3292         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
3293         Initialize these to 0, which is not a valid NSEventType. Assert that
3294         each NSEventType has a valid value before attempting to use it.
3295
3296 2017-02-07  Youenn Fablet  <youennf@gmail.com>
3297
3298         [WebRTC] LibWebRTC WK2 network stack is not providing correct ports for ICE candidates
3299         https://bugs.webkit.org/show_bug.cgi?id=167939
3300
3301         Reviewed by Sam Weinig.
3302
3303         AddressReady signalling was done by the WebProcess for UDP and ServerTCP as real async sockets in those case do
3304         not send it. But the WebProcess does not have information on the port, as it is assigned by the socket factory
3305         which is in the network process.
3306
3307         Fixed that bug by signalling AddressReady in the network process for UDP, ServerTCP and ClientTCP.
3308
3309         * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
3310         (WebKit::LibWebRTCSocketClient::LibWebRTCSocketClient):
3311         (WebKit::LibWebRTCSocketClient::signalAddressReady):
3312         * NetworkProcess/webrtc/LibWebRTCSocketClient.h:
3313         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
3314         (WebKit::NetworkRTCProvider::createUDPSocket):
3315         (WebKit::NetworkRTCProvider::createServerTCPSocket):
3316         (WebKit::NetworkRTCProvider::createClientTCPSocket):
3317         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
3318         (WebKit::LibWebRTCSocket::LibWebRTCSocket):
3319         (WebKit::LibWebRTCSocket::signalAddressReady):
3320
3321 2017-02-07  Sam Weinig  <sam@webkit.org>
3322
3323         Try to fix the EFL build.
3324
3325         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3326
3327 2017-02-07  Anders Carlsson  <andersca@apple.com>
3328
3329         -[WKWebView encodeWithCoder:] needs to call super
3330         https://bugs.webkit.org/show_bug.cgi?id=167945
3331         rdar://problem/29777668
3332
3333         Reviewed by Geoffrey Garen.
3334
3335         * UIProcess/API/Cocoa/WKWebView.mm:
3336         (-[WKWebView encodeWithCoder:]):
3337         Call super.
3338
3339 2017-02-07  Carlos Garcia Campos  <cgarcia@igalia.com>
3340
3341         [Soup] WebKitSoupRequestInputStream can still leave requests unfinished after r211773
3342         https://bugs.webkit.org/show_bug.cgi?id=167929
3343
3344         Reviewed by Michael Catanzaro.
3345
3346         The while loop to process the pending data requests was not a good idea, because having a new pending request
3347         doesn't mean we have more data available, but that more data was requested.
3348
3349         * WebProcess/soup/WebKitSoupRequestInputStream.cpp:
3350         (webkitSoupRequestInputStreamPendingReadAsyncComplete): Process only one request if needed.
3351
3352 2017-02-06  Carlos Garcia Campos  <cgarcia@igalia.com>
3353
3354         [Soup] Long resources loaded by custom protocols sometimes never finish loading
3355         https://bugs.webkit.org/show_bug.cgi?id=167890
3356
3357         Reviewed by Michael Catanzaro.
3358
3359         It's another bug that has appeared in WebKitSoupRequestInputStream after moving the custom protocols handling to
3360         the main thread. The problem is that webkitSoupRequestInputStreamPendingReadAsyncComplete invalidates
3361         pendingAsyncRead after calling webkitSoupRequestInputStreamReadAsyncResultComplete, but in some cases
3362         webkitSoupRequestInputStreamReadAsyncResultComplete completes the task in the same run loop iteration. In that
3363         case webkitSoupRequestInputStreamReadAsync is called again creating a new AsyncReadData that is destroyed right
3364         after webkitSoupRequestInputStreamReadAsyncResultComplete returns.
3365
3366         * WebProcess/soup/WebKitSoupRequestInputStream.cpp:
3367         (AsyncReadData::AsyncReadData): Use an rvalue reference for the task.
3368         (webkitSoupRequestInputStreamPendingReadAsyncComplete): Use WTFMove to ensure pendingAsyncRead is cleared before
3369         webkitSoupRequestInputStreamReadAsyncResultComplete is called, and continue processing pending requests if there
3370         are new ones after webkitSoupRequestInputStreamReadAsyncResultComplete.
3371         (webkitSoupRequestInputStreamReadAsync): Use WTFMove to transfer the task to AsyncReadData.
3372         (webkitSoupRequestInputStreamDidFailWithError): Use WTFMove to ensure pendingAsyncRead is cleared.
3373
3374 2017-02-06  Dan Bernstein  <mitz@apple.com>
3375
3376         [iOS] -[WKWebView becomeFirstResponder] and -[WKWebView resignFirstResponder] don’t get called when non-programmatic first responder changes happen
3377         https://bugs.webkit.org/show_bug.cgi?id=167898
3378
3379         Reviewed by Tim Horton.
3380
3381         Made WKContentView’s -becomeFirstResponder and -resignFirstResponder forward to the
3382         WKWebView, giving subclasses an opportunity to override these methods. Changed the WKWebView
3383         implementations to call back into WKContentView methods that actually do the work.
3384
3385         * UIProcess/API/Cocoa/WKWebView.mm:
3386         (-[WKWebView becomeFirstResponder]): If the current content view is a WKContentView, call
3387           -becomeFirstResponderForWebView. Added a check that the content view has a superview to
3388           get the right behavior when this is called during the transition from not having to having
3389           a custom content view.
3390         (-[WKWebView canBecomeFirstResponder]): If the current content view is a WKContentView, call
3391           -canBecomeFirstResponderForWebView.
3392         (-[WKWebView resignFirstResponder]): If the current content view is a WKContentView, call
3393           -resignFirstResponderForWebView.
3394