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