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