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