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