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