WKWebView should ask WKNavigationDelegate about bad ssl certificates
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-06-29  Alex Christensen  <achristensen@webkit.org>
2
3         WKWebView should ask WKNavigationDelegate about bad ssl certificates
4         https://bugs.webkit.org/show_bug.cgi?id=159176
5         rdar://problem/26864882
6
7         Reviewed by Sam Weinig.
8
9         This can be tested manually by visiting a site in MiniBrowser that has invalid ssl certificates, but we don't have proper ssl testing yet.
10         Before this change, we would just open the site as if nothing were invalid, now we call the WKNavigationDelegate's didReceiveAuthenticationChallenge
11         like we did before using NSURLSession, and we do not open the page, also like we did before using NSURLSession.
12
13         * NetworkProcess/NetworkLoad.cpp:
14         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
15         When using NSURLConnection and responding to canAuthenticateAgainstProtectionSpace with YES,
16         we get an NSURLAuthenticationChallenge when a bad ssl certificate is encountered in the handshake.
17         When using NSURLSession, we want to call webView:didReceiveAuthenticationChallenge:completionHandler: in this case.
18         The default implementation of NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace returns true
19         if there is an implementation of webView:didReceiveAuthenticationChallenge:completionHandler: in its WKNavigationDelegate.
20         Internal clients can implement _webView:canAuthenticateAgainstProtectionSpace: 
21         and Safari uses canHandleHTTPSServerTrustEvaluation, so it will be unaffected.
22
23 2016-06-29  Beth Dakin  <bdakin@apple.com>
24
25         Delete WKElementInfo since it's not used
26         https://bugs.webkit.org/show_bug.cgi?id=159265
27
28         Reviewed by Sam Weinig.
29
30         * Shared/API/Cocoa/WebKit.h:
31         * UIProcess/API/Cocoa/WKElementInfo.h: Removed.
32         * UIProcess/API/Cocoa/WKElementInfo.mm: Removed.
33         * UIProcess/API/Cocoa/WKElementInfoInternal.h: Removed.
34         * UIProcess/API/Cocoa/WKPreviewElementInfo.h:
35         * UIProcess/API/Cocoa/WKPreviewElementInfo.mm:
36         (-[WKPreviewElementInfo _initWithLinkURL:]):
37         (-[WKPreviewElementInfo copyWithZone:]):
38         (-[WKPreviewElementInfo linkURL]):
39         * UIProcess/API/Cocoa/WKPreviewElementInfoInternal.h:
40         * UIProcess/API/Cocoa/_WKContextMenuElementInfo.h:
41         * UIProcess/API/Cocoa/_WKContextMenuElementInfo.mm:
42         (-[_WKContextMenuElementInfo copyWithZone:]):
43         * WebKit2.xcodeproj/project.pbxproj:
44
45 2016-06-29  Jeremy Jones  <jeremyj@apple.com>
46
47         Replace MPAudioVideoRoutingActionSheet with MPAVRoutingSheet.
48         https://bugs.webkit.org/show_bug.cgi?id=159161
49         <rdar://problem/26017691>
50
51         Reviewed by Sam Weinig.
52
53         MPAudioVideoRoutingActionSheet is being replaced by MPAVRoutingSheet,
54         with only minor changes to the interface.
55
56         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
57         (-[WKAirPlayRoutePicker dealloc]):
58         (-[WKAirPlayRoutePicker showAirPlayPickerIPhone:]):
59
60 2016-06-29  Carlos Garcia Campos  <cgarcia@igalia.com>
61
62         Too much duplicated code in LayerTreeHosts implementations
63         https://bugs.webkit.org/show_bug.cgi?id=159144
64
65         Reviewed by Žan Doberšek.
66
67         There's some code common and duplicated in all current LayerTreeHosts implementations (Gtk, Coordinated, and
68         ThreadedCoordinated). The thing is even worse in the case of ThreadedCoordinated and Coordinated, where the
69         former is actually a special case of the later, and it seems like code was copy pasted and then modified to add
70         ThreadedCoordinated specific code. The problem of that approach, apart from the code duplication, is that common
71         parts end up diverging too. This patch moves the common parts to the base class LayerTreeHost and makes
72         ThreadedCoordinatedLayerTreeHost inherit from CoordinatedLayerTreeHost, to share the common code and simply add
73         the specific one.
74
75         * PlatformGTK.cmake:
76         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
77         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
78         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
79         (WebKit::CoordinatedLayerTreeHost::scheduleLayerFlush):
80         (WebKit::CoordinatedLayerTreeHost::setViewOverlayRootLayer):
81         (WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer):
82         (WebKit::CoordinatedLayerTreeHost::invalidate):
83         (WebKit::CoordinatedLayerTreeHost::sizeDidChange):
84         (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired):
85         (WebKit::CoordinatedLayerTreeHost::commitSceneState):
86         (WebKit::CoordinatedLayerTreeHost::createCoordinatedSurface):
87         (WebKit::CoordinatedLayerTreeHost::cancelPendingLayerFlush): Deleted.
88         (WebKit::CoordinatedLayerTreeHost::forceRepaint): Deleted.
89         (WebKit::CoordinatedLayerTreeHost::forceRepaintAsync): Deleted.
90         (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer): Deleted.
91         (WebKit::CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged): Deleted.
92         (WebKit::CoordinatedLayerTreeHost::pageBackgroundTransparencyChanged): Deleted.
93         (WebKit::CoordinatedLayerTreeHost::graphicsLayerFactory): Deleted.
94         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
95         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
96         (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost):
97         (WebKit::ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
98         (WebKit::ThreadedCoordinatedLayerTreeHost::sizeDidChange):
99         (WebKit::ThreadedCoordinatedLayerTreeHost::setVisibleContentsRect):
100         (WebKit::ThreadedCoordinatedLayerTreeHost::commitSceneState):
101         (WebKit::ThreadedCoordinatedLayerTreeHost::create): Deleted.
102         (WebKit::ThreadedCoordinatedLayerTreeHost::scrollNonCompositedContents): Deleted.
103         (WebKit::ThreadedCoordinatedLayerTreeHost::contentsSizeChanged): Deleted.
104         (WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewportProperties): Deleted.
105         (WebKit::ThreadedCoordinatedLayerTreeHost::didScaleFactorChanged): Deleted.
106         (WebKit::ThreadedCoordinatedLayerTreeHost::setNativeSurfaceHandleForCompositing): Deleted.
107         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
108         * WebProcess/WebPage/DrawingArea.h:
109         (WebKit::DrawingArea::layerHostDidFlushLayers):
110         * WebProcess/WebPage/DrawingAreaImpl.h:
111         * WebProcess/WebPage/LayerTreeHost.cpp:
112         (WebKit::LayerTreeHost::~LayerTreeHost):
113         (WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled):
114         (WebKit::LayerTreeHost::pauseRendering):
115         (WebKit::LayerTreeHost::resumeRendering):
116         (WebKit::LayerTreeHost::invalidate):
117         * WebProcess/WebPage/LayerTreeHost.h:
118         (WebKit::LayerTreeHost::layerTreeContext):
119         (WebKit::LayerTreeHost::setShouldNotifyAfterNextScheduledLayerFlush):
120         (WebKit::LayerTreeHost::setNonCompositedContentsNeedDisplay):
121         (WebKit::LayerTreeHost::setNonCompositedContentsNeedDisplayInRect):
122         (WebKit::LayerTreeHost::scrollNonCompositedContents):
123         (WebKit::LayerTreeHost::graphicsLayerFactory):
124         (WebKit::LayerTreeHost::contentsSizeChanged):
125         (WebKit::LayerTreeHost::didChangeViewportProperties):
126         (WebKit::LayerTreeHost::setNativeSurfaceHandleForCompositing):
127         (WebKit::LayerTreeHost::setViewOverlayRootLayer):
128         (WebKit::LayerTreeHost::forceRepaintAsync): Deleted.
129         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
130         (WebKit::LayerTreeHostGtk::invalidate):
131         (WebKit::LayerTreeHostGtk::setViewOverlayRootLayer):
132         (WebKit::LayerTreeHostGtk::LayerTreeHostGtk): Deleted.
133         (WebKit::LayerTreeHostGtk::setRootCompositingLayer): Deleted.
134         (WebKit::LayerTreeHostGtk::setNonCompositedContentsNeedDisplay): Deleted.
135         (WebKit::LayerTreeHostGtk::scrollNonCompositedContents): Deleted.
136         (WebKit::LayerTreeHostGtk::setNativeSurfaceHandleForCompositing): Deleted.
137         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
138
139 2016-06-28  Commit Queue  <commit-queue@webkit.org>
140
141         Unreviewed, rolling out r202586 and r202595.
142         https://bugs.webkit.org/show_bug.cgi?id=159247
143
144         These changes broke the iOS build (Requested by ryanhaddad on
145         #webkit).
146
147         Reverted changesets:
148
149         "Keep track of when a WKWebView is blank before the initial
150         non-empty layout"
151         https://bugs.webkit.org/show_bug.cgi?id=159217
152         http://trac.webkit.org/changeset/202586
153
154         "Try to fix the build."
155         http://trac.webkit.org/changeset/202595
156
157 2016-06-28  Commit Queue  <commit-queue@webkit.org>
158
159         Unreviewed, rolling out r202580.
160         https://bugs.webkit.org/show_bug.cgi?id=159245
161
162         Caused all WKTR tests to fail on GuardMalloc and Production
163         only for unknown reasons, investigating offline. (Requested by
164         brrian on #webkit).
165
166         Reverted changeset:
167
168         "RunLoop::Timer should use constructor templates instead of
169         class templates"
170         https://bugs.webkit.org/show_bug.cgi?id=159153
171         http://trac.webkit.org/changeset/202580
172
173 2016-06-28  Commit Queue  <commit-queue@webkit.org>
174
175         Unreviewed, rolling out r202598.
176         https://bugs.webkit.org/show_bug.cgi?id=159244
177
178         broke the build. (Requested by keith_miller on #webkit).
179
180         Reverted changeset:
181
182         "Try to fix the build."
183         http://trac.webkit.org/changeset/202598
184
185 2016-06-28  Tim Horton  <timothy_horton@apple.com>
186
187         Try to fix the build.
188
189         * UIProcess/API/Cocoa/WKWebView.mm:
190         (convertSystemLayoutDirection):
191         (-[WKWebView _setIsBlankBeforeFirstNonEmptyLayout:]):
192         (-[WKWebView _initializeWithConfiguration:]):
193         * UIProcess/API/Cocoa/WKWebViewInternal.h:
194
195 2016-06-28  Tim Horton  <timothy_horton@apple.com>
196
197         Try to fix the build.
198
199         * UIProcess/API/Cocoa/WKWebView.mm:
200         * UIProcess/API/Cocoa/WKWebViewInternal.h:
201
202 2016-06-28  Tim Horton  <timothy_horton@apple.com>
203
204         Keep track of when a WKWebView is blank before the initial non-empty layout
205         https://bugs.webkit.org/show_bug.cgi?id=159217
206         <rdar://problem/26071766>
207
208         Reviewed by Beth Dakin.
209
210         * UIProcess/API/Cocoa/WKWebView.mm:
211         (-[WKWebView _initializeWithConfiguration:]):
212         (-[WKWebView _setIsBlankBeforeFirstNonEmptyLayout:]):
213         (-[WKWebView _didFirstVisuallyNonEmptyLayoutForMainFrame]):
214         * UIProcess/API/Cocoa/WKWebViewInternal.h:
215         * UIProcess/ios/PageClientImplIOS.mm:
216         (WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame):
217
218 2016-06-28  Anders Carlsson  <andersca@apple.com>
219
220         PaymentMerchantSession should wrap a PKPaymentMerchantSession
221         https://bugs.webkit.org/show_bug.cgi?id=159218
222         rdar://problem/26872118
223
224         Reviewed by Tim Horton.
225
226         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
227         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode):
228         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::decode):
229         Use NSCoder.
230
231         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
232         PaymentMerchantSession is now a class.
233
234         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
235         PaymentMerchantSession is now a class.
236
237         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
238         (WebKit::WebPaymentCoordinatorProxy::platformCompleteMerchantValidation):
239         Just get the underlying PKPaymentMerchantSession from the PaymentMerchantSession object.
240         (WebKit::toPKPaymentMerchantSession): Deleted.
241
242 2016-06-28  Brian Burg  <bburg@apple.com>
243
244         RunLoop::Timer should use constructor templates instead of class templates
245         https://bugs.webkit.org/show_bug.cgi?id=159153
246
247         Reviewed by Alex Christensen.
248
249         Remove the RunLoop::Timer class template argument, and pass its constructor
250         a reference to `this` instead of a pointer to `this`.
251
252         * NetworkProcess/Downloads/soup/DownloadSoup.cpp:
253         * Platform/IPC/mac/ConnectionMac.mm:
254         (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
255         * PluginProcess/PluginControllerProxy.cpp:
256         (WebKit::PluginControllerProxy::PluginControllerProxy):
257         * PluginProcess/PluginControllerProxy.h:
258         * PluginProcess/PluginProcess.cpp:
259         (WebKit::PluginProcess::PluginProcess):
260         * PluginProcess/PluginProcess.h:
261         * Shared/ChildProcess.cpp:
262         (WebKit::ChildProcess::ChildProcess):
263         * Shared/ChildProcess.h:
264         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
265         * UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm:
266         (API::SharedJSContext::SharedJSContext):
267         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
268         (_WebKitWebViewBasePrivate::_WebKitWebViewBasePrivate):
269         * UIProcess/DrawingAreaProxy.cpp:
270         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
271         * UIProcess/DrawingAreaProxy.h:
272         * UIProcess/DrawingAreaProxyImpl.cpp:
273         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
274         * UIProcess/DrawingAreaProxyImpl.h:
275         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
276         (WebKit::PluginInfoCache::PluginInfoCache):
277         * UIProcess/Plugins/gtk/PluginInfoCache.h:
278         * UIProcess/ProcessThrottler.cpp:
279         (WebKit::ProcessThrottler::ProcessThrottler):
280         * UIProcess/ProcessThrottler.h:
281         * UIProcess/ResponsivenessTimer.cpp:
282         (WebKit::ResponsivenessTimer::ResponsivenessTimer):
283         * UIProcess/ResponsivenessTimer.h:
284         * UIProcess/ViewGestureController.cpp:
285         (WebKit::ViewGestureController::ViewGestureController):
286         (WebKit::ViewGestureController::SnapshotRemovalTracker::SnapshotRemovalTracker):
287         * UIProcess/VisitedLinkStore.cpp:
288         (WebKit::VisitedLinkStore::VisitedLinkStore):
289         * UIProcess/VisitedLinkStore.h:
290         * UIProcess/WebInspectorProxy.cpp:
291         (WebKit::WebInspectorProxy::WebInspectorProxy):
292         * UIProcess/WebInspectorProxy.h:
293         * UIProcess/WebProcessPool.cpp:
294         (WebKit::m_hiddenPageThrottlingTimer):
295         * UIProcess/WebProcessPool.h:
296         * UIProcess/gtk/GestureController.cpp:
297         (WebKit::GestureController::DragGesture::DragGesture):
298         (WebKit::GestureController::ZoomGesture::ZoomGesture):
299         * UIProcess/gtk/GestureController.h:
300         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
301         (WebKit::WebPopupMenuProxyGtk::WebPopupMenuProxyGtk):
302         * UIProcess/gtk/WebPopupMenuProxyGtk.h:
303         * UIProcess/mac/ViewGestureController.h:
304         * WebProcess/Network/WebLoaderStrategy.cpp:
305         (WebKit::WebLoaderStrategy::WebLoaderStrategy):
306         * WebProcess/Network/WebLoaderStrategy.h:
307         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
308         (WebKit::NPRuntimeObjectMap::NPRuntimeObjectMap):
309         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h:
310         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
311         (WebKit::NetscapePlugin::NetscapePlugin):
312         (WebKit::NetscapePlugin::Timer::Timer):
313         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
314         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
315         (WebKit::NetscapePluginStream::NetscapePluginStream):
316         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
317         * WebProcess/Plugins/PluginView.cpp:
318         (WebKit::PluginView::PluginView):
319         * WebProcess/Plugins/PluginView.h:
320         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
321         (WebKit::CoordinatedDrawingArea::CoordinatedDrawingArea):
322         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
323         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
324         (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost):
325         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
326         * WebProcess/WebPage/DrawingAreaImpl.cpp:
327         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
328         * WebProcess/WebPage/DrawingAreaImpl.h:
329         * WebProcess/WebPage/WebPage.cpp:
330         (WebKit::WebPage::WebPage):
331         * WebProcess/WebPage/WebPage.h:
332         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
333         (WebKit::LayerTreeHostGtk::RenderFrameScheduler::RenderFrameScheduler):
334         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
335         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
336         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
337         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
338
339 2016-06-28  Chris Dumez  <cdumez@apple.com>
340
341         [WK2] Add some logging related to NetworkProcess suspension
342         https://bugs.webkit.org/show_bug.cgi?id=159178
343
344         Reviewed by Andreas Kling.
345
346         Add some logging related to NetworkProcess suspension to help debug
347         suspension issues.
348
349         * NetworkProcess/NetworkProcess.cpp:
350         (WebKit::NetworkProcess::prepareToSuspend):
351         (WebKit::NetworkProcess::cancelPrepareToSuspend):
352         (WebKit::NetworkProcess::processDidResume):
353
354 2016-06-28  Chris Dumez  <cdumez@apple.com>
355
356         Add some more UIProcess-side logging related to process assertions
357         https://bugs.webkit.org/show_bug.cgi?id=159188
358
359         Reviewed by Andreas Kling.
360
361         Add some more UIProcess-side logging related to process assertions
362         to help debug process suspension issues.
363
364         * UIProcess/Network/NetworkProcessProxy.cpp:
365         (WebKit::NetworkProcessProxy::fetchWebsiteData):
366         (WebKit::NetworkProcessProxy::deleteWebsiteData):
367         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
368         * UIProcess/ProcessThrottler.cpp:
369         (WebKit::ProcessThrottler::updateAssertionNow):
370         (WebKit::ProcessThrottler::updateAssertion):
371         * UIProcess/WebPageProxy.cpp:
372         (WebKit::WebPageProxy::updateActivityToken):
373         * UIProcess/WebProcessProxy.cpp:
374         (WebKit::WebProcessProxy::fetchWebsiteData):
375         (WebKit::WebProcessProxy::deleteWebsiteData):
376         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
377         (WebKit::WebProcessProxy::didSetAssertionState):
378
379 2016-06-28  Chris Dumez  <cdumez@apple.com>
380
381         [WK2] Do not suppress navigation snapshotting on session restore if we are not navigating right away
382         https://bugs.webkit.org/show_bug.cgi?id=159216
383         <rdar://problem/27058360>
384
385         Reviewed by Andreas Kling.
386
387         Do not suppress navigation snapshotting on session restore if we are not navigating
388         right away. The snapshot we already have may be outdated by the time we actually
389         navigate (e.g. Because the user scrolled) so we don't want to suppress snapshotting
390         in this case.
391
392         * UIProcess/WebPageProxy.cpp:
393         (WebKit::WebPageProxy::restoreFromSessionState):
394
395 2016-06-27  Anders Carlsson  <andersca@apple.com>
396
397         WebKit::WebPaymentCoordinator leak
398         https://bugs.webkit.org/show_bug.cgi?id=159168
399         rdar://problem/26929772
400
401         Reviewed by Beth Dakin.
402
403         Update for WebCore changes.
404
405         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
406         (WebKit::WebPaymentCoordinator::paymentCoordinatorDestroyed):
407         (WebKit::WebPaymentCoordinator::mainFrameDestroyed): Deleted.
408         * WebProcess/ApplePay/WebPaymentCoordinator.h:
409
410 2016-06-27  Simon Fraser  <simon.fraser@apple.com>
411
412         Fix TestWebKitAPI crash introduced in r202532.
413
414         WebPageProxy::forceRepaint() could trigger a call to the didForceRepaintCallback()
415         after the WebPageProxy had been invalidated, causing a null de-ref of m_drawingArea.
416         Fix by checking for error and isValid().
417
418         * UIProcess/WebPageProxy.cpp:
419         (WebKit::WebPageProxy::forceRepaint):
420
421 2016-06-27  Simon Fraser  <simon.fraser@apple.com>
422
423         [iOS] Make DumpRenderTree and WebKitTestRunner in the simulator use render server snapshotting
424         https://bugs.webkit.org/show_bug.cgi?id=159077
425
426         Reviewed by Tim Horton.
427
428         Fix WebPageProxy::forceRepaint() to correctly wait for the next commit from the web process,
429         which is necessary for UI-side compositing.
430
431         * UIProcess/WebPageProxy.cpp:
432         (WebKit::WebPageProxy::forceRepaint):
433
434 2016-06-27  Joseph Pecoraro  <pecoraro@apple.com>
435
436         Web Inspector: When modifying sessionStorage, localStorage gets updated
437         https://bugs.webkit.org/show_bug.cgi?id=159181
438         <rdar://problem/27043447>
439
440         Reviewed by Timothy Hatcher.
441
442         * WebProcess/Storage/StorageAreaMap.cpp:
443         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
444         This should be dispatching storage events.
445
446 2016-06-27  Alex Christensen  <achristensen@webkit.org>
447
448         Fix flakiness on Sierra after r202511
449         https://bugs.webkit.org/show_bug.cgi?id=159071
450
451         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
452         (WebKit::NetworkSession::clearCredentials):
453         Replacing the NSURLSessions immediately caused assertions because the tasks are not always all stopped immediately when tearing down a test.
454         Stopping an NSURLSession needs to be done asynchronously.  I'll try a different testing technique for r202511.
455
456 2016-06-27  Alex Christensen  <achristensen@webkit.org>
457
458         Send canAuthenticateAgainstProtectionSpace calls from NetworkProcess directly to UIProcess
459         https://bugs.webkit.org/show_bug.cgi?id=159071
460
461         Reviewed by Brady Eidson.
462
463         When CFNetwork asks the NetworkProcess if we can authenticate against this protection space, we used to ask
464         the WebProcess, which would call ResourceLoader::canAuthenticateAgainstProtectionSpace which would ask the FrameLoaderClient,
465         which would synchronously ask the UIProcess.  Going directly from the NetworkProcess to the UIProcess gives us many advantages:
466         1. It reduces IPC because we ask fewer loads.
467         2. It reduces synchronous IPC because we are not using the same code path as WebKit1 any more.
468         3. It allows us to check if the NetworkProcess is still valid in sendToNetworkingProcess, possibly fixing rdar://problem/26825408
469         4. It allows us to ask the UIProcess when we get authentication challenges for synchronous xhr.
470
471         I added a new test http/tests/xmlhttprequest/sync-delegate-callbacks.html to verify the change in behavior of synchronous xhr.
472         In order to make this test not flaky on platforms using NSURLSession, we clear the NSURLSessions used by WebKitTestRunner
473         to make sure that the TLS session cache is cleared so we get NSURLAuthenticationChallenges corresponding to the NSURLConnection
474         canAuthenticateAgainstProtectionSpace callback when we initiate the first HTTPS connection to 127.0.0.1 with this session. 
475
476         * NetworkProcess/NetworkLoad.cpp:
477         (WebKit::NetworkLoad::didReceiveChallenge):
478         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
479         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
480         * NetworkProcess/NetworkProcess.cpp:
481         (WebKit::NetworkProcess::clearCachedCredentials):
482         (WebKit::NetworkProcess::ensurePrivateBrowsingSession):
483         (WebKit::NetworkProcess::cancelDownload):
484         (WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace):
485         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace):
486         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpaceDownload):
487         * NetworkProcess/NetworkProcess.h:
488         * NetworkProcess/NetworkProcess.messages.in:
489         * NetworkProcess/NetworkResourceLoader.cpp:
490         (WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
491         * NetworkProcess/NetworkResourceLoader.h:
492         * NetworkProcess/NetworkResourceLoader.messages.in:
493         * NetworkProcess/NetworkSession.h:
494         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
495         (WebKit::NetworkSession::networkStorageSession):
496         (WebKit::NetworkSession::clearCredentials):
497         (WebKit::NetworkSession::dataTaskForIdentifier):
498         * UIProcess/Downloads/DownloadProxy.cpp:
499         (WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace):
500         (WebKit::DownloadProxy::willSendRequest):
501         * UIProcess/Network/NetworkProcessProxy.cpp:
502         (WebKit::NetworkProcessProxy::logSampledDiagnosticMessageWithValue):
503         (WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace):
504         (WebKit::NetworkProcessProxy::sendProcessWillSuspendImminently):
505         * UIProcess/Network/NetworkProcessProxy.h:
506         * UIProcess/Network/NetworkProcessProxy.messages.in:
507         * UIProcess/WebPageProxy.cpp:
508         (WebKit::WebPageProxy::backForwardClear):
509         (WebKit::WebPageProxy::canAuthenticateAgainstProtectionSpace):
510         (WebKit::WebPageProxy::didReceiveAuthenticationChallenge):
511         (WebKit::WebPageProxy::canAuthenticateAgainstProtectionSpaceInFrame): Deleted.
512         * UIProcess/WebPageProxy.h:
513         * UIProcess/WebPageProxy.messages.in:
514         * WebProcess/Network/WebResourceLoader.cpp:
515         (WebKit::WebResourceLoader::didReceiveResource):
516         (WebKit::WebResourceLoader::isAlwaysOnLoggingAllowed):
517         (WebKit::WebResourceLoader::canAuthenticateAgainstProtectionSpace): Deleted.
518         * WebProcess/Network/WebResourceLoader.h:
519         * WebProcess/Network/WebResourceLoader.messages.in:
520         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
521         (WebKit::WebFrameLoaderClient::canAuthenticateAgainstProtectionSpace):
522         * WebProcess/WebProcess.cpp:
523         (WebKit::WebProcess::clearCachedCredentials):
524         (WebKit::WebProcess::focusedWebPage):
525
526 2016-06-27  Anders Carlsson  <andersca@apple.com>
527
528         Discounted items are displayed with positive values
529         https://bugs.webkit.org/show_bug.cgi?id=159160
530         rdar://problem/26980772
531
532         Reviewed by Dean Jackson.
533
534         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
535         (WebKit::toDecimalNumber):
536         Add new helper function. Correctly compute the mantissa.
537
538         (WebKit::toPKPaymentSummaryItem):
539         (WebKit::toPKShippingMethod):
540         Use toDecimalNumber.
541
542 2016-06-27  Miguel Gomez  <magomez@igalia.com>
543
544         [GTK][EFL] Build with threaded compositor enabled is broken
545         https://bugs.webkit.org/show_bug.cgi?id=159138
546
547         Reviewed by Carlos Garcia Campos.
548
549         Replace the usage of NoncopyableFunction with Function, to follow the changes in r202439.
550
551         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
552         (WebKit::CompositingRunLoop::performTask):
553         (WebKit::CompositingRunLoop::performTaskSync):
554         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
555
556 2016-06-24  Brian Burg  <bburg@apple.com>
557
558         REGRESSION(r201171): CRASH at WebKit::WebInspectorProxy::open() + 31 when running inspector layout tests
559         https://bugs.webkit.org/show_bug.cgi?id=159070
560         <rdar://problem/26768628>
561
562         Reviewed by Joseph Pecoraro.
563
564         We have been seeing a few crashes underneath WebInspectorProxy::bringToFront() on the bots.
565         Previously, this code didn't use m_inspectorPage so there was nothing to null-dereference.
566
567         However, it doesn't make sense that we would hit the null dereference here:
568
569          - The only caller of bringToFront() on the WebProcess side is InspectorController::show().
570            It only tries to bring to front if there is already a local frontend connection, which
571            shouldn't be the case if m_inspectorPage is null.
572
573          - It's guarded by m_underTest, which should have been set to true in createInspectorPage().
574
575         These clues lead me to believe that we may be improperly tearing down the inspector between tests.
576         For example, it seems possible that a local frontend connection is not being torn down, so
577         InspectorController never asks to create a inspector page when the next test calls showWebInspector.
578
579         Since this crash is not easy to reproduce, we don't have much to go on. For now, this patch
580         adds an early return in the case where m_inspectorPage is null when calling open().
581
582         * UIProcess/WebInspectorProxy.cpp:
583         (WebKit::WebInspectorProxy::open):
584
585 2016-06-24  Jer Noble  <jer.noble@apple.com>
586
587         Vimeo.com videos do not get playback controls
588         https://bugs.webkit.org/show_bug.cgi?id=159082
589         <rdar://problem/26586630>
590
591         Reviewed by Eric Carlson.
592
593         When the HasAudioOrVideo media state changes, let the video controls recalculate
594         by calling videoControlsManagerDidChange().
595
596         * UIProcess/WebPageProxy.cpp:
597         (WebKit::WebPageProxy::isPlayingMediaDidChange):
598
599 2016-06-24  Beth Dakin  <bdakin@apple.com>
600
601         Include enclosingListType in EditorState
602         https://bugs.webkit.org/show_bug.cgi?id=159102
603         -and corresponding-
604         rdar://problem/26932490
605
606         Reviewed by Enrica Casucci.
607
608         * Shared/EditorState.cpp:
609         (WebKit::EditorState::PostLayoutData::encode):
610         (WebKit::EditorState::PostLayoutData::decode):
611         * Shared/EditorState.h:
612         * WebProcess/WebPage/WebPage.cpp:
613         (WebKit::WebPage::editorState):
614
615 2016-06-24  Anders Carlsson  <andersca@apple.com>
616
617         Inline more of the Apple Pay source code
618         https://bugs.webkit.org/show_bug.cgi?id=159099
619
620         Reviewed by Andreas Kling.
621
622         * Shared/Cocoa/WebCoreArgumentCodersCocoa.h: Removed.
623         * Shared/WebCoreArgumentCoders.h:
624         * Shared/WebPreferencesDefinitions.h:
625         * UIProcess/API/Cocoa/WKPreferences.mm:
626         (-[WKPreferences _applePayCapabilityDisclosureAllowed]):
627         (-[WKPreferences _setApplePayCapabilityDisclosureAllowed:]):
628         * UIProcess/API/Cocoa/WKWebView.mm:
629         (-[WKWebView _initializeWithConfiguration:]):
630         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
631         (-[WKWebViewConfiguration copyWithZone:]):
632         (-[WKWebViewConfiguration _applePayEnabled]):
633         (-[WKWebViewConfiguration _setApplePayEnabled:]):
634         (-[WKWebViewConfiguration _paymentsEnabled]):
635         (-[WKWebViewConfiguration _setPaymentsEnabled:]):
636         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
637         * UIProcess/WebPageProxy.cpp:
638         (WebKit::WebPageProxy::WebPageProxy):
639         (WebKit::WebPageProxy::reattachToWebProcess):
640         (WebKit::WebPageProxy::resetState):
641         * UIProcess/WebPageProxy.h:
642         * WebKit2.xcodeproj/project.pbxproj:
643         * WebProcess/WebPage/WebPage.cpp:
644         (WebKit::m_userInterfaceLayoutDirection):
645         (WebKit::WebPage::updatePreferences):
646
647 2016-06-21  Anders Carlsson  <andersca@apple.com>
648
649         Rename NoncopyableFunction to Function
650         https://bugs.webkit.org/show_bug.cgi?id=158354
651
652         Reviewed by Chris Dumez.
653
654         * NetworkProcess/NetworkProcess.cpp:
655         (WebKit::fetchDiskCacheEntries):
656         (WebKit::NetworkProcess::fetchWebsiteData):
657         (WebKit::clearDiskCacheEntries):
658         * NetworkProcess/NetworkProcess.h:
659         * NetworkProcess/cache/NetworkCache.cpp:
660         (WebKit::NetworkCache::Cache::traverse):
661         * NetworkProcess/cache/NetworkCache.h:
662         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
663         (WebKit::NetworkCache::runTaskInQueue):
664         * NetworkProcess/cache/NetworkCacheStorage.h:
665
666 2016-06-22  Anders Carlsson  <andersca@apple.com>
667
668         Move WebKit2 Apple Pay code to the open source repository
669         https://bugs.webkit.org/show_bug.cgi?id=159041
670
671         Reviewed by Sam Weinig.
672
673         * DerivedSources.make:
674         * Shared/Cocoa/WebCoreArgumentCodersCocoa.h: Added.
675         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: Added.
676         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp: Added.
677         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Added.
678         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in: Added.
679         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: Added.
680         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: Added.
681         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: Added.
682         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: Added.
683         * UIProcess/WebPageProxy.cpp:
684         * UIProcess/WebPageProxy.h:
685         * WebKit2.xcodeproj/project.pbxproj:
686         * WebProcess/ApplePay/WebPaymentCoordinator.cpp: Added.
687         * WebProcess/ApplePay/WebPaymentCoordinator.h: Added.
688         * WebProcess/ApplePay/WebPaymentCoordinator.messages.in: Added.
689
690 2016-06-24  Chris Dumez  <cdumez@apple.com>
691
692         [WK2] PageConfiguration.m_relatedPage keeps WebPageProxy alive after its WebView has been destroyed
693         https://bugs.webkit.org/show_bug.cgi?id=159080
694         <rdar://problem/26982642>
695
696         Reviewed by Anders Carlsson.
697
698         PageConfiguration.m_relatedPage keeps WebPageProxy alive after its WebView has been destroyed.
699         This leads to WebPageProxy object leaks when the client keeps chaining related views.
700
701         In this patch, we null our the PageConfiguration's relatedPage in WebPageProxy::close()
702         to break the chain and make sure we only keep alive 1 relatedPage rather than a chain of
703         them.
704
705         * UIProcess/WebPageProxy.cpp:
706         (WebKit::WebPageProxy::close):
707
708 2016-06-24  Jer Noble  <jer.noble@apple.com>
709
710         Playback controls refer to wrong element when playing multiple items in a page.
711         https://bugs.webkit.org/show_bug.cgi?id=159076
712         <rdar://problem/26953532>
713
714         Reviewed by Beth Dakin.
715
716         clearPlaybackControlsManager() no longer takes a parameter.
717
718         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
719         (WebKit::WebChromeClient::clearPlaybackControlsManager):
720         * WebProcess/WebCoreSupport/WebChromeClient.h:
721         * WebProcess/cocoa/WebPlaybackSessionManager.h:
722         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
723         (WebKit::WebPlaybackSessionManager::setUpPlaybackControlsManager): Make sure to removeClientForContext()
724             if the old context refers to a live media element.
725         (WebKit::WebPlaybackSessionManager::clearPlaybackControlsManager):
726
727 2016-06-24  Brady Eidson  <beidson@apple.com>
728
729         IDB tests crashing attempting to register sandbox extensions for blob files.
730         https://bugs.webkit.org/show_bug.cgi?id=159094.
731
732         Reviewed by Sam Weinig.
733         
734         Already tested by storage/indexeddb/modern/handle-user-delete.html
735
736         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
737         (WebKit::preregisterSandboxExtensionsIfNecessary): Check whether the IDBResultData actually contains
738           a getResult before trying to access it.
739
740 2016-06-23  Brady Eidson  <beidson@apple.com>
741
742         Retrieving Blobs from IndexedDB using cursors fails in WK2 (Sandboxing)
743         https://bugs.webkit.org/show_bug.cgi?id=158991
744
745         Reviewed by Alex Christensen.
746
747         * CMakeLists.txt:
748         * WebKit2.xcodeproj/project.pbxproj:
749
750         * DatabaseProcess/DatabaseProcess.cpp:
751         (WebKit::DatabaseProcess::getSandboxExtensionsForBlobFiles):
752         (WebKit::DatabaseProcess::didGetSandboxExtensionsForBlobFiles):
753         * DatabaseProcess/DatabaseProcess.h:
754         
755         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
756         (WebKit::WebIDBConnectionToClient::handleGetResult): Handle creation of sandbox extensions
757           for any result that might contain blob values.
758         (WebKit::WebIDBConnectionToClient::didGetRecord):
759         (WebKit::WebIDBConnectionToClient::didOpenCursor):
760         (WebKit::WebIDBConnectionToClient::didIterateCursor):
761         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
762         
763         * Shared/Databases/IndexedDB/WebIDBResult.cpp: Added.
764         (WebKit::WebIDBResult::encode):
765         (WebKit::WebIDBResult::decode):
766         * Shared/Databases/IndexedDB/WebIDBResult.h: Added.
767         (WebKit::WebIDBResult::WebIDBResult):
768         (WebKit::WebIDBResult::resultData):
769         (WebKit::WebIDBResult::handles):
770         
771         * Shared/SandboxExtension.h: Make SandboxExtension handles moveable.
772                 
773         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
774         (WebKit::preregisterSandboxExtensionsIfNecessary): Register sandbox extensions with the
775           Networking process for any result that might contain blob values.
776         (WebKit::WebIDBConnectionToServer::didGetRecord):
777         (WebKit::WebIDBConnectionToServer::didOpenCursor):
778         (WebKit::WebIDBConnectionToServer::didIterateCursor):
779         (WebKit::WebIDBConnectionToServer::didGetRecordWithSandboxExtensions): Deleted.
780         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
781         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
782
783 2016-06-23  Alex Christensen  <achristensen@webkit.org>
784
785         Remove unused didCancelAuthenticationChallenge
786         https://bugs.webkit.org/show_bug.cgi?id=158819
787
788         Reviewed by David Kilzer.
789
790         * NetworkProcess/Downloads/mac/DownloadMac.mm:
791         (-[WKDownloadAsDelegate download:didCancelAuthenticationChallenge:]): Deleted.
792         * NetworkProcess/NetworkLoad.cpp:
793         (WebKit::NetworkLoad::didCancelAuthenticationChallenge): Deleted.
794         * NetworkProcess/NetworkLoad.h:
795         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
796         (WebKit::WebFrameLoaderClient::dispatchDidCancelAuthenticationChallenge): Deleted.
797         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
798
799 2016-06-23  Benjamin Poulain  <benjamin@webkit.org>
800
801         Specialize synchronous event tracking per event type
802         https://bugs.webkit.org/show_bug.cgi?id=158826
803
804         Reviewed by Simon Fraser.
805
806         * Shared/WebCoreArgumentCoders.cpp:
807         (IPC::ArgumentCoder<EventTrackingRegions>::encode):
808         (IPC::ArgumentCoder<EventTrackingRegions>::decode):
809         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
810         (WebKit::RemoteScrollingCoordinatorProxy::eventTrackingTypeForPoint):
811         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
812         * UIProcess/WebPageProxy.cpp:
813         (WebKit::mergeTrackingTypes):
814         (WebKit::WebPageProxy::updateTouchEventTracking):
815         (WebKit::WebPageProxy::touchEventTrackingType):
816         (WebKit::WebPageProxy::handleTouchEventSynchronously):
817         (WebKit::WebPageProxy::handleTouchEventAsynchronously):
818         (WebKit::WebPageProxy::handleTouchEvent):
819         (WebKit::WebPageProxy::resetState):
820         * UIProcess/WebPageProxy.h:
821         (WebKit::WebPageProxy::TouchEventTracking::isTrackingAnything):
822         (WebKit::WebPageProxy::TouchEventTracking::reset):
823
824 2016-06-23  Said Abou-Hallawa  <sabouhallawa@apple.com>
825
826         requestFrameAnimation() callback timestamp should be very close to Performance.now() 
827         https://bugs.webkit.org/show_bug.cgi?id=159038
828
829         Reviewed by Simon Fraser.
830
831         * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.mm:
832         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::didUpdateLayers):
833
834 2016-06-23  Chris Dumez  <cdumez@apple.com>
835
836         [iOS] A WebPageProxy in closed state should not be allowed to hold a process assertion
837         https://bugs.webkit.org/show_bug.cgi?id=159068
838         <rdar://problem/17665473>
839
840         Reviewed by Tim Horton.
841
842         A WebPageProxy in closed state should not be allowed to hold a process assertion. It
843         currently happens that WebPageProxy::close() gets called but that the WebPageProxy is
844         kept alive by Safari (e.g. In case of top-hit preloading). In such cases, we fail to
845         release the foreground process assertion that the WebPageProxy holds.
846
847         We should clear the foreground process assertion that the WebPageProxy holds as soon
848         as WebPageProxy::close() is called.
849
850         * UIProcess/WebPageProxy.cpp:
851         (WebKit::WebPageProxy::close):
852
853 2016-06-23  Brent Fulgham  <bfulgham@apple.com>
854
855         [OS X][WK2] Expand sandbox for new mach endpoints
856         https://bugs.webkit.org/show_bug.cgi?id=159040
857         <rdar://problem/25238336>
858
859         Reviewed by Alexey Proskuryakov.
860
861         Grant the WebContent and Networking processes the mach lookup capability for
862         various Security-related mach endpoints..
863
864         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
865         * WebProcess/com.apple.WebProcess.sb.in:
866
867 2016-06-23  Commit Queue  <commit-queue@webkit.org>
868
869         Unreviewed, rolling out r201194.
870         https://bugs.webkit.org/show_bug.cgi?id=159059
871
872         Not needed for iOS (Requested by bfulgham on #webkit).
873
874         Reverted changeset:
875
876         "[OS X][WK2] Expand sandbox for new mach endpoints"
877         https://bugs.webkit.org/show_bug.cgi?id=157919
878         http://trac.webkit.org/changeset/201194
879
880 2016-06-23  Carlos Garcia Campos  <cgarcia@igalia.com>
881
882         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.13.2 release.
883
884         * gtk/NEWS: Add release notes for 2.13.2.
885
886 2016-06-22  Carlos Garcia Campos  <cgarcia@igalia.com>
887
888         REGRESSION(r201880): WebSockets based remote inspector is broken since r201880
889         https://bugs.webkit.org/show_bug.cgi?id=158613
890
891         Reviewed by Michael Catanzaro.
892
893         In r201880 SocketStreamHandleClient was modified to receive references instead of
894         pointers. WebSocketServerConnection also implements SocketStreamHandleClient but since it's doesn't use
895         override, it was unnoticed and not updated, so we ended up using the default empty implementation instead of
896         the WebSocketServerConnection one.
897
898         * UIProcess/InspectorServer/WebSocketServerConnection.cpp:
899         (WebKit::WebSocketServerConnection::WebSocketServerConnection):
900         (WebKit::WebSocketServerConnection::setSocketHandle):
901         (WebKit::WebSocketServerConnection::shutdownNow):
902         (WebKit::WebSocketServerConnection::didCloseSocketStream):
903         (WebKit::WebSocketServerConnection::didReceiveSocketStreamData):
904         (WebKit::WebSocketServerConnection::didUpdateBufferedAmount):
905         (WebKit::WebSocketServerConnection::didFailSocketStream): Deleted.
906         * UIProcess/InspectorServer/WebSocketServerConnection.h:
907
908 2016-06-22  Brent Fulgham  <bfulgham@apple.com>
909
910         [iOS][WK2] Expand sandbox to read voice services preferences
911         https://bugs.webkit.org/show_bug.cgi?id=159046
912         <rdar://problem/26926722>
913
914         Reviewed by Alexey Proskuryakov.
915
916         Expand the sandbox to permit read-only access to voice services preferences.
917
918         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
919
920 2016-06-22  Sam Weinig  <sam@webkit.org>
921
922         Add SPI to allow creating a WKCertificateInfoRef from a SecTrustRef
923         https://bugs.webkit.org/show_bug.cgi?id=159025
924
925         Reviewed by Tim Horton.
926
927         * Shared/API/c/mac/WKCertificateInfoMac.h:
928         * Shared/API/c/mac/WKCertificateInfoMac.mm:
929         (WKCertificateInfoCreateWithServerTrust):
930
931 2016-06-22  Brady Eidson  <beidson@apple.com>
932
933         DatabaseProcess doesn't handle WebProcesses going away uncleanly.
934         https://bugs.webkit.org/show_bug.cgi?id=158894
935
936         Reviewed by Alex Christensen.
937
938         * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
939         (WebKit::DatabaseToWebProcessConnection::didClose):
940         
941         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
942         (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess): Actually unregister this connection
943           from the IDBServer so it can clean up.
944         (WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient):
945         
946 2016-06-22  Chris Dumez  <cdumez@apple.com>
947
948         Stop using PassRefPtr in ShareableResource
949         https://bugs.webkit.org/show_bug.cgi?id=159043
950
951         Reviewed by Alex Christensen.
952
953         Stop using PassRefPtr in ShareableResource.
954
955         * NetworkProcess/cache/NetworkCache.cpp:
956         (WebKit::NetworkCache::Cache::store):
957         * NetworkProcess/cache/NetworkCacheEntry.cpp:
958         (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord):
959         * Shared/ShareableResource.cpp:
960         (WebKit::shareableResourceDeallocate):
961         (WebKit::ShareableResource::wrapInSharedBuffer):
962         (WebKit::ShareableResource::Handle::tryWrapInSharedBuffer):
963         (WebKit::ShareableResource::create):
964         (WebKit::ShareableResource::map):
965         (WebKit::ShareableResource::ShareableResource):
966         * Shared/ShareableResource.h:
967
968 2016-06-17  Dean Jackson  <dino@apple.com>
969
970         REGRESSION: Double tap to zoom does not work on yahoo finance
971         https://bugs.webkit.org/show_bug.cgi?id=158886
972         <rdar://problem/24917760>
973
974         Reviewed by Simon Fraser.
975
976         We shouldn't enable fast click on pages that have
977         had to shrink to fit. In other words, we should enable
978         double-tap-to-zoom if the page has already zoomed.
979
980         Test: fast/events/ios/viewport-shrink-to-fit-allows-double-tap.html
981
982         * UIProcess/API/Cocoa/WKWebView.mm:
983         (-[WKWebView _allowsDoubleTapGestures]):
984
985 2016-06-22  Brian Burg  <bburg@apple.com>
986
987         Web Automation: Automation.inspectBrowsingContext should have an option to enable timeline auto-capturing
988         https://bugs.webkit.org/show_bug.cgi?id=159004
989         <rdar://problem/26931269>
990
991         Reviewed by Joseph Pecoraro.
992
993         Automation.inspectBrowsingContext was added to make it easier to hit breakpoints inside of
994         code evaluated using Automation.evaluateJavaScriptFunction. I recently changed the behavior
995         of this command to automatically start profiling the page as soon as the inspector attached
996         so that a full timeline recording could be obtained. However, starting a timeline recording
997         turns off the debugger, so this command is not so useful for debugging right now.
998
999         Add a new option, enableAutoCapturing, to the inspectBrowsingContext command. Don't toggle
1000         profiling automatically unless this optional flag is present and set to true.
1001
1002         * UIProcess/Automation/Automation.json:
1003         * UIProcess/Automation/WebAutomationSession.cpp:
1004         (WebKit::WebAutomationSession::inspectBrowsingContext):
1005         (WebKit::WebAutomationSession::inspectorFrontendLoaded): Deleted.
1006         * UIProcess/Automation/WebAutomationSession.h:
1007
1008 2016-06-22  Tim Horton  <timothy_horton@apple.com>
1009
1010         Mail snapshot has black webview in multitasking switcher
1011         https://bugs.webkit.org/show_bug.cgi?id=159036
1012         <rdar://problem/25972938>
1013
1014         Reviewed by Simon Fraser.
1015
1016         There is a window of time between an application going into the background
1017         and SpringBoard's snapshotting mechanism completing where it is possible
1018         (though difficult, timing-wise) for RemoteLayerBackingStoreCollection to
1019         make still-needed surfaces volatile (and, even worse, for them to get emptied).
1020
1021         UIKit suggested instead waiting for the window context teardown notification,
1022         which does indeed seem to fire after the snapshotting is complete.
1023         This may have the convenient side effect of making the volatility timer
1024         repeat fewer times in general, because it is now started closer to the
1025         last time that the surfaces will be in-use.
1026
1027         * UIProcess/ApplicationStateTracker.h:
1028         * UIProcess/ApplicationStateTracker.mm:
1029         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
1030         (WebKit::ApplicationStateTracker::~ApplicationStateTracker):
1031         (WebKit::ApplicationStateTracker::applicationDidFinishSnapshottingAfterEnteringBackground):
1032         * UIProcess/WebPageProxy.h:
1033         * UIProcess/ios/WKContentView.mm:
1034         (-[WKContentView didMoveToWindow]):
1035         (-[WKContentView _applicationDidFinishSnapshottingAfterEnteringBackground]):
1036         * UIProcess/ios/WKPDFView.mm:
1037         (-[WKPDFView didMoveToWindow]):
1038         (-[WKPDFView _applicationDidFinishSnapshottingAfterEnteringBackground]):
1039         * UIProcess/ios/WebPageProxyIOS.mm:
1040         (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
1041         * WebProcess/WebPage/WebPage.h:
1042         * WebProcess/WebPage/WebPage.messages.in:
1043         * WebProcess/WebPage/ios/WebPageIOS.mm:
1044         (WebKit::WebPage::applicationDidEnterBackground):
1045         (WebKit::WebPage::applicationDidFinishSnapshottingAfterEnteringBackground):
1046
1047 2016-06-22  Chris Dumez  <cdumez@apple.com>
1048
1049         Add logging related to process assertions to help debug process suspension issues
1050         https://bugs.webkit.org/show_bug.cgi?id=159001
1051
1052         Reviewed by Antti Koivisto.
1053
1054         Add logging related to process assertions to help debug process suspension issues.
1055
1056         * UIProcess/Cocoa/NavigationState.mm:
1057         (WebKit::NavigationState::didChangeIsLoading):
1058         * UIProcess/Network/NetworkProcessProxy.cpp:
1059         (WebKit::NetworkProcessProxy::fetchWebsiteData):
1060         (WebKit::NetworkProcessProxy::deleteWebsiteData):
1061         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
1062         (WebKit::NetworkProcessProxy::setIsHoldingLockedFiles):
1063         * UIProcess/WebPageProxy.cpp:
1064         (WebKit::WebPageProxy::updateActivityToken):
1065         * UIProcess/WebProcessProxy.cpp:
1066         (WebKit::WebProcessProxy::setIsHoldingLockedFiles):
1067
1068 2016-06-21  Sam Weinig  <sam@webkit.org>
1069
1070         WKWebView with no WKNavigationDelegate does not follow universal links
1071         <rdar://problem/24374110>
1072         https://bugs.webkit.org/show_bug.cgi?id=158997
1073
1074         Reviewed by Dan Bernstein.
1075
1076         API Test:
1077              WKWebView.DefaultNavigationDelegate
1078
1079         * UIProcess/API/Cocoa/WKWebView.mm:
1080         (-[WKWebView _initializeWithConfiguration:]):
1081         When initializing the WKWebView, set a default navigation client.
1082
1083 2016-06-21  Chris Dumez  <cdumez@apple.com>
1084
1085         Unreviewed, rolling out r202296.
1086
1087         Broke basic browsing in Safari
1088
1089         Reverted changeset:
1090
1091         "WKWebView with no WKNavigationDelegate does not follow
1092         universal links"
1093         https://bugs.webkit.org/show_bug.cgi?id=158997
1094         http://trac.webkit.org/changeset/202296
1095
1096 2016-06-21  Anders Carlsson  <andersca@apple.com>
1097
1098         Fix build.
1099
1100         * Configurations/FeatureDefines.xcconfig:
1101
1102 2016-06-21  Anders Carlsson  <andersca@apple.com>
1103
1104         Begin moving the Apple Pay code to the open source repository
1105         https://bugs.webkit.org/show_bug.cgi?id=158998
1106
1107         Reviewed by Tim Horton.
1108
1109         * Configurations/FeatureDefines.xcconfig:
1110         Add ENABLE_APPLE_PAY.
1111
1112 2016-06-21  Said Abou-Hallawa  <sabouhallawa@apple,com>
1113
1114         Add system tracing points for requestAnimationFrame() workflow
1115         https://bugs.webkit.org/show_bug.cgi?id=158723
1116
1117         Reviewed by Simon Fraser.
1118
1119         Add trace points for requestAnimationFrame().
1120
1121         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1122         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1123         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
1124         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
1125         (WebKit::RemoteLayerTreeContext::buildTransaction):
1126         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1127         (WebKit::RemoteLayerTreeDrawingArea::didUpdate):
1128         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush):
1129
1130 2016-06-21  Sam Weinig  <sam@webkit.org>
1131
1132         WKWebView with no WKNavigationDelegate does not follow universal links
1133         <rdar://problem/24374110>
1134         https://bugs.webkit.org/show_bug.cgi?id=158997
1135
1136         Reviewed by Dan Bernstein.
1137
1138         API Test:
1139              WKWebView.DefaultNavigationDelegate
1140
1141         * UIProcess/API/Cocoa/WKWebView.mm:
1142         (-[WKWebView _initializeWithConfiguration:]):
1143         When initializing the WKWebView, set a default navigation client.
1144
1145         * UIProcess/WebPageProxy.cpp:
1146         (WebKit::WebPageProxy::setLoaderClient):
1147         Be sure to clear out a navigation client, if present, when setting a loader client,
1148         as they are mutually exclusive.
1149
1150 2016-06-20  Simon Fraser  <simon.fraser@apple.com>
1151
1152         Focus event dispatched in iframe causes parent document to scroll incorrectly
1153         https://bugs.webkit.org/show_bug.cgi?id=158629
1154         rdar://problem/26521616
1155
1156         Reviewed by Tim Horton.
1157
1158         Pass SelectionRevealMode::Reveal in existing code.
1159
1160         * WebProcess/WebPage/WebPage.cpp:
1161         (WebKit::WebPage::centerSelectionInVisibleArea):
1162
1163 2016-06-21  Said Abou-Hallawa  <sabouhallawa@apple,com>
1164
1165         [iOS][WK2] When an animation frame is missed, the UI process should immediately notify the Web process once a frame is committed
1166         https://bugs.webkit.org/show_bug.cgi?id=158933
1167
1168         Reviewed by Simon Fraser.
1169
1170         When a frame is committed, the UI process schedules a CADisplayLink and waits until
1171         the next didRefreshDisplay event is fired. This causes more delay in the scenario
1172         where there are frames are dropped. didRefreshDisplay() should be called immediately
1173         when commitLayerTree message is received and the last frame was dropped.
1174
1175         The fix is to have the CADisplayLink active all the times. It should be paused
1176         only when we detect at least one frame is dropped. In this case we should not
1177         send a message to the UI process since it has not sent the last requested LayerTree.
1178         Also we should not waste the CPU time by scheduling a new CADisplayLink since we
1179         have not processed the last event. We should resume CADisplayLink timer once a
1180         commitLayerTree message is received.
1181
1182         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1183         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1184         (-[WKOneShotDisplayLinkHandler pause]):
1185         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1186         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
1187         (-[WKOneShotDisplayLinkHandler displayLinkFired:]):
1188
1189 2016-06-21  Amir Alavi  <aalavi@apple.com>
1190
1191         Upstream WKHTTPCookiesForURL from WebKitSystemInterface to OpenSource
1192         https://bugs.webkit.org/show_bug.cgi?id=158967
1193
1194         Reviewed by Brent Fulgham.
1195
1196         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1197         (InitWebCoreSystemInterface): Deleted.
1198
1199 2016-06-21  Dan Bernstein  <mitz@apple.com>
1200
1201         Inlined some picture-in-picture code.
1202         https://bugs.webkit.org/show_bug.cgi?id=158977
1203
1204         Reviewed by Eric Carlsson.
1205
1206         This code was written primarily by Ada Chan, and originally reviewed by Alex Christensen,
1207         Anders Carlsson, Conrad Shultz, Dan Bernstein, Eric Carlson, Jer Noble, Jeremy Jones,
1208         Jon Lee, Remy Demarest, and Zach Li.
1209
1210         * Shared/WebPreferencesStoreDefaultsAdditions.cpp:
1211           Define and use DEFAULT_ALLOWS_PICTURE_IN_PICTURE_MEDIA_PLAYBACK.
1212
1213         * Shared/WebPreferencesStore.cpp:
1214         (WebKit::defaults): Removed include of WebPreferencesStoreDefaultsAdditions.cpp now that the
1215           default is defined correctly in WebPreferencesStoreDefaultsAdditions.cpp.
1216
1217         * UIProcess/API/C/WKPreferences.cpp: Inlined WKPreferencesAdditions.cpp.
1218         * UIProcess/API/C/WKPreferencesRefPrivate.h: Ditto.
1219
1220         * WebProcess/cocoa/WebVideoFullscreenManager.mm: Inlined WebVideoFullscreenManagerSupportsVideoFullscreenMac.mm.
1221
1222 2016-06-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1223
1224         [GTK] Web view is not redrawn when reparented in force compositing mode
1225         https://bugs.webkit.org/show_bug.cgi?id=158689
1226
1227         Reviewed by Žan Doberšek.
1228
1229         When the web view is reparented in accelerated compositing mode, the UI process always exits the accelerated
1230         mode when the view is unrealized, because the native surface handle for compositing is destroyed, but it doesn't
1231         enter again when the view is realized and a new native surface handle for compositing is used. This happens
1232         because the UI and Web processes are not in sync regarding whether the page is in accelerated compositing or
1233         not. The Web process never exits accelerated mode when compositing mode is forced, but the UI process doesn't
1234         check that setting at all.
1235
1236         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1237         (webkitWebViewBaseResizeRedirectedWindow): Helper function to ensure the redirected window size is properly updated.
1238         (webkitWebViewBaseRealize): Resize the redirected window if the view is already in AC mode when realized.
1239         (webkitWebViewRenderAcceleratedCompositingResults): Use webkitWebViewBaseResizeRedirectedWindow().
1240         (webkitWebViewBaseSizeAllocate): Ditto.
1241         (webkitWebViewBaseWillEnterAcceleratedCompositingMode): Ditto.
1242         * UIProcess/DrawingAreaProxyImpl.cpp:
1243         (WebKit::DrawingAreaProxyImpl::alwaysUseCompositing): Return true in force compositing mode.
1244         (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode): Update assert.
1245         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode): Do not exit AC mode compositing mode is always enabled.
1246         * UIProcess/DrawingAreaProxyImpl.h:
1247         (WebKit::DrawingAreaProxyImpl::isInAcceleratedCompositingMode): Return true also in force compositing mode.
1248         * UIProcess/gtk/RedirectedXCompositeWindow.cpp:
1249         (WebKit::RedirectedXCompositeWindow::surface): Ensure we never return an uninitialized surface to prevent
1250         rendering artifacts in in force compositing mode when waiting for the first update on the redirected window.
1251
1252 2016-06-20  Commit Queue  <commit-queue@webkit.org>
1253
1254         Unreviewed, rolling out r202243.
1255         https://bugs.webkit.org/show_bug.cgi?id=158972
1256
1257         Broke Windows build and iOS tests (Requested by ap on
1258         #webkit).
1259
1260         Reverted changeset:
1261
1262         "Focus event dispatched in iframe causes parent document to
1263         scroll incorrectly"
1264         https://bugs.webkit.org/show_bug.cgi?id=158629
1265         http://trac.webkit.org/changeset/202243
1266
1267 2016-06-20  Brent Fulgham  <bfulgham@apple.com>
1268
1269         Allow Spotlight suggestions to be read by any process
1270         https://bugs.webkit.org/show_bug.cgi?id=158950
1271         <rdar://problem/26865374>
1272
1273         Reviewed by Alexey Proskuryakov.
1274
1275         Extend sandbox to allow all web processes to read Spotlight results.
1276
1277         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb:
1278         * WebProcess/com.apple.WebProcess.sb.in:
1279
1280 2016-06-20  Simon Fraser  <simon.fraser@apple.com>
1281
1282         Focus event dispatched in iframe causes parent document to scroll incorrectly
1283         https://bugs.webkit.org/show_bug.cgi?id=158629
1284         rdar://problem/26521616
1285
1286         Reviewed by Tim Horton.
1287
1288         Pass SelectionRevealMode::Reveal in existing code.
1289
1290         * WebProcess/WebPage/WebPage.cpp:
1291         (WebKit::WebPage::centerSelectionInVisibleArea):
1292
1293 2016-06-20  Keith Rollin  <krollin@apple.com>
1294
1295         Remove RefPtr::release() and change calls sites to use WTFMove()
1296         https://bugs.webkit.org/show_bug.cgi?id=158369
1297
1298         Reviewed by Chris Dumez.
1299
1300         RefPtr::release() releases its managed pointer awkwardly. It's more
1301         direct and clearer to use WTFMove to transfer ownership of the managed
1302         pointer.
1303
1304         As part of this cleanup, also change a lot of explicit data types to
1305         'auto'.
1306
1307         * DatabaseProcess/DatabaseProcess.cpp:
1308         (WebKit::DatabaseProcess::createDatabaseToWebProcessConnection):
1309         * NetworkProcess/NetworkProcess.cpp:
1310         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
1311         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1312         (WebKit::NetworkResourceLoadParameters::decode):
1313         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1314         (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord):
1315         * Platform/mac/SharedMemoryMac.cpp:
1316         (WebKit::SharedMemory::allocate):
1317         (WebKit::SharedMemory::create):
1318         (WebKit::SharedMemory::map):
1319         * PluginProcess/PluginProcess.cpp:
1320         (WebKit::PluginProcess::createWebProcessConnection):
1321         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
1322         (encodeToObjectStream):
1323         * Shared/API/c/WKImage.cpp:
1324         (WKImageCreate):
1325         * Shared/API/c/WKNumber.cpp:
1326         (WKBooleanCreate):
1327         (WKDoubleCreate):
1328         (WKUInt64Create):
1329         * Shared/API/c/WKSecurityOriginRef.cpp:
1330         (WKSecurityOriginCreate):
1331         * Shared/API/c/WKSerializedScriptValue.cpp:
1332         (WKSerializedScriptValueCreate):
1333         (WKSerializedScriptValueCreateWithInternalRepresentation):
1334         * Shared/API/c/cairo/WKImageCairo.cpp:
1335         (WKImageCreateFromCairoSurface):
1336         * Shared/API/c/cg/WKImageCG.cpp:
1337         (WKImageCreateFromCGImage):
1338         * Shared/API/c/mac/WKCertificateInfoMac.mm:
1339         (WKCertificateInfoCreateWithCertficateChain):
1340         * Shared/API/c/mac/WKObjCTypeWrapperRef.mm:
1341         (WKObjCTypeWrapperCreate):
1342         * Shared/API/c/mac/WKWebArchive.cpp:
1343         (WKWebArchiveCreate):
1344         (WKWebArchiveCreateWithData):
1345         (WKWebArchiveCreateFromRange):
1346         (WKWebArchiveCopyMainResource):
1347         (WKWebArchiveCopySubresources):
1348         (WKWebArchiveCopySubframeArchives):
1349         * Shared/API/c/mac/WKWebArchiveResource.cpp:
1350         (WKWebArchiveResourceCreate):
1351         * Shared/APIWebArchive.mm:
1352         (API::WebArchive::WebArchive):
1353         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
1354         (WebKit::NetscapePluginModule::getOrCreate):
1355         * Shared/ShareableBitmap.cpp:
1356         (WebKit::ShareableBitmap::create):
1357         * Shared/ShareableResource.cpp:
1358         (WebKit::ShareableResource::map):
1359         * Shared/gtk/ArgumentCodersGtk.cpp:
1360         (IPC::ArgumentCoder<DragData>::decode):
1361         * UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
1362         (WKViewCreate):
1363         * UIProcess/API/C/WKBatteryStatus.cpp:
1364         (WKBatteryStatusCreate):
1365         * UIProcess/API/C/WKGeolocationPosition.cpp:
1366         (WKGeolocationPositionCreate_b):
1367         * UIProcess/API/C/WKGrammarDetail.cpp:
1368         (WKGrammarDetailCreate):
1369         * UIProcess/API/C/WKPage.cpp:
1370         (WKPageCopySessionState):
1371         * UIProcess/API/C/WKPageGroup.cpp:
1372         (WKPageGroupCreateWithIdentifier):
1373         * UIProcess/API/C/WKPreferences.cpp:
1374         (WKPreferencesCreate):
1375         (WKPreferencesCreateWithIdentifier):
1376         (WKPreferencesCreateCopy):
1377         * UIProcess/API/C/WKSessionRef.cpp:
1378         (WKSessionCreate):
1379         * UIProcess/API/C/WKSessionStateRef.cpp:
1380         (WKSessionStateCopyData):
1381         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
1382         (WKContextCopyPlugInInfoForBundleIdentifier):
1383         * UIProcess/API/Cocoa/WKWebView.mm:
1384         (-[WKWebView loadRequest:]):
1385         (-[WKWebView loadFileURL:allowingReadAccessToURL:]):
1386         (-[WKWebView loadData:MIMEType:characterEncodingName:baseURL:]):
1387         (-[WKWebView goToBackForwardListItem:]):
1388         (-[WKWebView goBack]):
1389         (-[WKWebView goForward]):
1390         (-[WKWebView reload]):
1391         (-[WKWebView reloadFromOrigin]):
1392         (-[WKWebView _loadData:MIMEType:characterEncodingName:baseURL:userData:]):
1393         (-[WKWebView _reloadWithoutContentBlockers]):
1394         (-[WKWebView _sessionStateData]):
1395         (-[WKWebView _restoreSessionState:andNavigate:]):
1396         * UIProcess/API/efl/ewk_database_manager.cpp:
1397         (EwkDatabaseManager::createOriginList):
1398         * UIProcess/API/efl/ewk_storage_manager.cpp:
1399         (EwkStorageManager::createOriginList):
1400         * UIProcess/API/gtk/WebKitWebView.cpp:
1401         (webkitWebViewCreateNewPage):
1402         (webkitWebViewPrintFrame):
1403         (getContentsAsMHTMLDataCallback):
1404         * UIProcess/Cocoa/SessionStateCoding.mm:
1405         (WebKit::encodeSessionState):
1406         * UIProcess/GenericCallback.h:
1407         (WebKit::CallbackMap::take):
1408         * UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
1409         (WebKit::GeolocationPermissionRequestManagerProxy::createRequest):
1410         * UIProcess/Network/NetworkProcessProxy.cpp:
1411         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
1412         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
1413         (WebKit::NotificationPermissionRequestManagerProxy::createRequest):
1414         * UIProcess/Plugins/PluginProcessManager.cpp:
1415         (WebKit::PluginProcessManager::getOrCreatePluginProcess):
1416         * UIProcess/Storage/StorageManager.cpp:
1417         (WebKit::StorageManager::StorageArea::setItem):
1418         (WebKit::StorageManager::StorageArea::removeItem):
1419         (WebKit::StorageManager::createLocalStorageMap):
1420         * UIProcess/WebBackForwardList.cpp:
1421         (WebKit::WebBackForwardList::addItem):
1422         (WebKit::WebBackForwardList::clear):
1423         * UIProcess/WebCookieManagerProxy.cpp:
1424         (WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
1425         (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
1426         * UIProcess/WebPageProxy.cpp:
1427         (WebKit::WebPageProxy::installViewStateChangeCompletionHandler):
1428         * UIProcess/WebPreferences.cpp:
1429         (WebKit::WebPreferences::createWithLegacyDefaults):
1430         (WebKit::WebPreferences::copy):
1431         * UIProcess/WebProcessPool.cpp:
1432         (WebKit::WebProcessPool::~WebProcessPool):
1433         * UIProcess/mac/ViewSnapshotStore.mm:
1434         (WebKit::ViewSnapshotStore::recordSnapshot):
1435         * UIProcess/mac/WKImmediateActionController.mm:
1436         (-[WKImmediateActionController _webHitTestResult]):
1437         * UIProcess/mac/WKPrintingView.mm:
1438         (-[WKPrintingView _askPageToComputePageRects]):
1439         * UIProcess/mac/WebPageProxyMac.mm:
1440         (WebKit::WebPageProxy::setDragImage):
1441         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
1442         (-[WKWebProcessPlugInFrame hitTest:]):
1443         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.mm:
1444         (-[WKWebProcessPlugInHitTestResult nodeHandle]):
1445         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
1446         (+[WKWebProcessPlugInNodeHandle nodeHandleWithJSValue:inContext:]):
1447         (-[WKWebProcessPlugInNodeHandle htmlIFrameElementContentFrame]):
1448         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm:
1449         (+[WKWebProcessPlugInScriptWorld world]):
1450         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1451         (WKBundlePostSynchronousMessage):
1452         * WebProcess/InjectedBundle/API/c/WKBundleDOMWindowExtension.cpp:
1453         (WKBundleDOMWindowExtensionCreate):
1454         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
1455         (WKBundleHitTestResultCopyNodeHandle):
1456         (WKBundleHitTestResultCopyURLElementHandle):
1457         * WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp:
1458         (WKBundleNavigationActionCopyHitTestResult):
1459         (WKBundleNavigationActionCopyFormElement):
1460         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
1461         (WKBundleNodeHandleCreate):
1462         (WKBundleNodeHandleCopyDocument):
1463         (WKBundleNodeHandleCopySnapshotWithOptions):
1464         (WKBundleNodeHandleCopyVisibleRange):
1465         (WKBundleNodeHandleCopyHTMLTableCellElementCellAbove):
1466         (WKBundleNodeHandleCopyDocumentFrame):
1467         (WKBundleNodeHandleCopyHTMLFrameElementContentFrame):
1468         (WKBundleNodeHandleCopyHTMLIFrameElementContentFrame):
1469         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1470         (WKBundlePageCreateSnapshotWithOptions):
1471         (WKBundlePageCreateSnapshotInViewCoordinates):
1472         (WKBundlePageCreateSnapshotInDocumentCoordinates):
1473         (WKBundlePageCreateScaledSnapshotInDocumentCoordinates):
1474         (WKBundlePagePostSynchronousMessageForTesting):
1475         * WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp:
1476         (WKBundleRangeHandleCreate):
1477         (WKBundleRangeHandleCopySnapshotWithOptions):
1478         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
1479         (WKBundleScriptWorldCreateWorld):
1480         * WebProcess/InjectedBundle/API/mac/WKDOMNode.mm:
1481         (-[WKDOMNode _copyBundleNodeHandleRef]):
1482         * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
1483         (-[WKDOMRange _copyBundleRangeHandleRef]):
1484         * WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp:
1485         (WebKit::InjectedBundleCSSStyleDeclarationHandle::getOrCreate):
1486         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
1487         (WebKit::imageForRect):
1488         (WebKit::InjectedBundleNodeHandle::renderedImage):
1489         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
1490         (WebKit::InjectedBundleRangeHandle::getOrCreate):
1491         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1492         (WebKit::InjectedBundle::create):
1493         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1494         (WebKit::NetscapePlugin::loadURL):
1495         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
1496         (WebKit::PDFPlugin::createScrollbar):
1497         * WebProcess/Storage/StorageAreaMap.cpp:
1498         (WebKit::StorageAreaMap::applyChange):
1499         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
1500         (WebKit::toFormData):
1501         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1502         (WebKit::WebFrameLoaderClient::createPlugin):
1503         (WebKit::WebFrameLoaderClient::recreatePlugin):
1504         (WebKit::WebFrameLoaderClient::createJavaAppletWidget):
1505         (WebKit::WebFrameLoaderClient::createNetworkingContext):
1506         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
1507         (WebKit::WebInspectorClient::highlight):
1508         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1509         (WebKit::convertImageToBitmap):
1510         * WebProcess/WebPage/FindController.cpp:
1511         (WebKit::FindController::updateFindUIAfterPageScroll):
1512         * WebProcess/WebPage/VisitedLinkTableController.cpp:
1513         (WebKit::VisitedLinkTableController::getOrCreate):
1514         (WebKit::VisitedLinkTableController::setVisitedLinkTable):
1515         * WebProcess/WebPage/WebFrame.cpp:
1516         (WebKit::WebFrame::createWithCoreMainFrame):
1517         (WebKit::WebFrame::createSubframe):
1518         (WebKit::WebFrame::create):
1519         (WebKit::WebFrame::createSelectionSnapshot):
1520         * WebProcess/WebPage/WebPage.cpp:
1521         (WebKit::WebPage::createPlugin):
1522         (WebKit::WebPage::snapshotAtSize):
1523         (WebKit::WebPage::snapshotNode):
1524         (WebKit::WebPage::willPerformLoadDragDestinationAction):
1525         (WebKit::WebPage::SandboxExtensionTracker::didStartProvisionalLoad):
1526         (WebKit::WebPage::SandboxExtensionTracker::didCommitProvisionalLoad):
1527         (WebKit::WebPage::drawRectToImage):
1528         * WebProcess/WebPage/WebPageGroupProxy.cpp:
1529         (WebKit::WebPageGroupProxy::create):
1530         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
1531         (WebKit::PlatformCAAnimationRemote::Properties::decode):
1532         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1533         (WebKit::PlatformCALayerRemote::create):
1534         (WebKit::PlatformCALayerRemote::clone):
1535         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
1536         (WebKit::PlatformCALayerRemoteCustom::create):
1537         (WebKit::PlatformCALayerRemoteCustom::clone):
1538         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1539         (WebKit::RemoteLayerTreeDrawingArea::createDisplayRefreshMonitor):
1540
1541 2016-06-20  Commit Queue  <commit-queue@webkit.org>
1542
1543         Unreviewed, rolling out r202179.
1544         https://bugs.webkit.org/show_bug.cgi?id=158946
1545
1546         The test either fails or times out 100% of the time (Requested
1547         by ap on #webkit).
1548
1549         Reverted changeset:
1550
1551         "REGRESSION: Double tap to zoom does not work on yahoo
1552         finance"
1553         https://bugs.webkit.org/show_bug.cgi?id=158886
1554         http://trac.webkit.org/changeset/202179
1555
1556 2016-06-20  Tim Horton  <timothy_horton@apple.com>
1557
1558         REGRESSION (r191499): Tab content "jumps" down when focusing tabs that load in the background
1559         https://bugs.webkit.org/show_bug.cgi?id=158904
1560         <rdar://problem/26025831>
1561
1562         Reviewed by Sam Weinig.
1563
1564         * UIProcess/Cocoa/WebViewImpl.h:
1565         * UIProcess/Cocoa/WebViewImpl.mm:
1566         (WebKit::WebViewImpl::viewDidMoveToWindow):
1567         During the large refactor that was r191499, we somehow ended up with two
1568         different members for the same thing - one that got written, and one that
1569         got read. We should only have one.
1570
1571 2016-06-20  Tim Horton  <timothy_horton@apple.com>
1572
1573         Try to fix the iOS build after r202142 and r202224.
1574
1575         * Shared/mac/RemoteLayerBackingStore.mm:
1576         (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
1577
1578 2016-06-19  Simon Fraser  <simon.fraser@apple.com>
1579
1580         Fix erroneously commented line added in r202142.
1581
1582         * Shared/mac/RemoteLayerBackingStore.mm:
1583         (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
1584
1585 2016-06-16  Enrica Casucci  <enrica@apple.com>
1586
1587         Support configurable autocapitalization.
1588         https://bugs.webkit.org/show_bug.cgi?id=158860
1589         rdar://problem/26231403
1590
1591         Reviewed by Tim Horton.
1592
1593         The behavior of spellchecker should be configurable to avoid
1594         unwanted autocapitalization.
1595
1596         * UIProcess/API/APIPageConfiguration.cpp:
1597         (API::PageConfiguration::copy):
1598         * UIProcess/API/APIPageConfiguration.h:
1599         (API::PageConfiguration::initialCapitalizationEnabled):
1600         (API::PageConfiguration::setInitialCapitalizationEnabled):
1601         * UIProcess/API/C/WKPageConfigurationRef.cpp:
1602         (WKPageConfigurationSetIntialCapitalizationEnabled):
1603         * UIProcess/API/C/WKPageConfigurationRef.h:
1604         * UIProcess/API/Cocoa/WKWebView.mm:
1605         (-[WKWebView _initializeWithConfiguration:]):
1606         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1607         (-[WKWebViewConfiguration copyWithZone:]):
1608         (-[WKWebViewConfiguration _initialCapitalizationEnabled]):
1609         (-[WKWebViewConfiguration _setInitialCapitalizationEnabled:]):
1610         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1611         * UIProcess/TextChecker.h:
1612         * UIProcess/WebPageProxy.cpp:
1613         (WebKit::WebPageProxy::WebPageProxy):
1614         (WebKit::WebPageProxy::checkTextOfParagraph):
1615         (WebKit::WebPageProxy::getGuessesForWord):
1616         * UIProcess/WebPageProxy.h:
1617         * UIProcess/efl/TextCheckerEfl.cpp:
1618         (WebKit::TextChecker::checkTextOfParagraph):
1619         (WebKit::TextChecker::getGuessesForWord):
1620         * UIProcess/gtk/TextCheckerGtk.cpp:
1621         (WebKit::TextChecker::getGuessesForWord):
1622         (WebKit::TextChecker::checkTextOfParagraph):
1623         * UIProcess/ios/TextCheckerIOS.mm:
1624         (WebKit::TextChecker::checkTextOfParagraph):
1625         (WebKit::TextChecker::getGuessesForWord):
1626         * UIProcess/mac/TextCheckerMac.mm:
1627         (WebKit::TextChecker::checkTextOfParagraph):
1628         (WebKit::TextChecker::getGuessesForWord):
1629
1630 2016-06-17  Chris Dumez  <cdumez@apple.com>
1631
1632         Use WTF::NoncopyableFunction in NetworkDataTaskClient
1633         https://bugs.webkit.org/show_bug.cgi?id=158887
1634
1635         Reviewed by Alex Christensen.
1636
1637         Use WTF::NoncopyableFunction in NetworkDataTaskClient instead of std::function
1638         and consistently move it around. This avoids some unnecessary copying.
1639
1640         * NetworkProcess/Downloads/DownloadManager.cpp:
1641         (WebKit::DownloadManager::willDecidePendingDownloadDestination):
1642         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
1643         * NetworkProcess/Downloads/DownloadManager.h:
1644         * NetworkProcess/NetworkDataTask.h:
1645         * NetworkProcess/NetworkLoad.cpp:
1646         (WebKit::NetworkLoad::willPerformHTTPRedirection):
1647         (WebKit::NetworkLoad::didReceiveChallenge):
1648         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
1649         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
1650         * NetworkProcess/NetworkLoad.h:
1651         * NetworkProcess/NetworkProcess.cpp:
1652         (WebKit::NetworkProcess::findPendingDownloadLocation):
1653         * NetworkProcess/NetworkProcess.h:
1654         * NetworkProcess/PingLoad.h:
1655         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1656         (WebKit::NetworkDataTask::didReceiveChallenge):
1657         (WebKit::NetworkDataTask::didReceiveResponse):
1658         (WebKit::NetworkDataTask::willPerformHTTPRedirection):
1659         (WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
1660         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1661         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
1662         * Shared/Authentication/AuthenticationManager.cpp:
1663         (WebKit::AuthenticationManager::addChallengeToChallengeMap):
1664         (WebKit::AuthenticationManager::coalesceChallengesMatching):
1665         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
1666         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
1667         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
1668         * Shared/Authentication/AuthenticationManager.h:
1669         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
1670         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
1671
1672 2016-06-17  Antoine Quint  <graouts@apple.com>
1673
1674         Web video playback controls should have RTL volume slider
1675         https://bugs.webkit.org/show_bug.cgi?id=158856
1676         <rdar://problem/25971769>
1677
1678         Reviewed by Tim Horton.
1679
1680         We now call setUserInterfaceLayoutDirection() on WebCore::Page to propagate
1681         the user interface layout direction down to the Web content. To facilitate this,
1682         the UserInterfaceLayoutDirection enum is now defined in WebCore.
1683
1684         * Shared/WebPageCreationParameters.h:
1685         * UIProcess/API/Cocoa/WKWebView.mm:
1686         (convertSystemLayoutDirection):
1687         (toUserInterfaceLayoutDirection):
1688         * UIProcess/API/gtk/PageClientImpl.h:
1689         * UIProcess/Cocoa/WebViewImpl.h:
1690         * UIProcess/Cocoa/WebViewImpl.mm:
1691         (WebKit::toUserInterfaceLayoutDirection):
1692         (WebKit::WebViewImpl::userInterfaceLayoutDirection):
1693         * UIProcess/PageClient.h:
1694         * UIProcess/WebPageProxy.cpp:
1695         (WebKit::WebPageProxy::userInterfaceLayoutDirection):
1696         (WebKit::WebPageProxy::setUserInterfaceLayoutDirection):
1697         * UIProcess/WebPageProxy.h:
1698         * UIProcess/efl/WebView.h:
1699         * UIProcess/ios/PageClientImplIOS.h:
1700         * UIProcess/ios/PageClientImplIOS.mm:
1701         (WebKit::PageClientImpl::userInterfaceLayoutDirection):
1702         * UIProcess/mac/PageClientImpl.h:
1703         * UIProcess/mac/PageClientImpl.mm:
1704         (WebKit::PageClientImpl::userInterfaceLayoutDirection):
1705         * UIProcess/mac/ViewGestureControllerMac.mm:
1706         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
1707         (WebKit::ViewGestureController::isPhysicallySwipingLeft):
1708         * WebProcess/WebPage/WebPage.cpp:
1709         (WebKit::m_userInterfaceLayoutDirection):
1710         (WebKit::WebPage::setUserInterfaceLayoutDirection):
1711         * WebProcess/WebPage/WebPage.h:
1712         * WebProcess/WebPage/mac/WebPageMac.mm:
1713         (WebKit::WebPage::performNonEditingBehaviorForSelector):
1714
1715 2016-06-17  Dean Jackson  <dino@apple.com>
1716
1717         REGRESSION: Double tap to zoom does not work on yahoo finance
1718         https://bugs.webkit.org/show_bug.cgi?id=158886
1719         <rdar://problem/24917760>
1720
1721         Reviewed by Simon Fraser.
1722
1723         We shouldn't enable fast click on pages that have
1724         had to shrink to fit. In other words, we should enable
1725         double-tap-to-zoom if the page has already zoomed.
1726
1727         Test: fast/events/ios/viewport-shrink-to-fit-allows-double-tap.html
1728
1729         * UIProcess/API/Cocoa/WKWebView.mm:
1730         (-[WKWebView _allowsDoubleTapGestures]):
1731
1732 2016-06-16  Chris Dumez  <cdumez@apple.com>
1733
1734         No need to ref connection in lambda inside NetworkResourceLoader::tryStoreAsCacheEntry()
1735         https://bugs.webkit.org/show_bug.cgi?id=158862
1736
1737         Reviewed by Darin Adler.
1738
1739         No need to ref connection in lambda inside NetworkResourceLoader::tryStoreAsCacheEntry().
1740         We already ref the NetworkResourceLoader which hold a ref to the connection. Also update
1741         the lambda capture to use Ref<> for the NetworkResourceLoader instead of RefPtr<>.
1742         Switch callback type from std::function to WTF::NoncopyableFunction so we can capture a
1743         Ref<>.
1744
1745         * NetworkProcess/NetworkResourceLoader.cpp:
1746         (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
1747         * NetworkProcess/cache/NetworkCache.cpp:
1748         (WebKit::NetworkCache::Cache::store):
1749         * NetworkProcess/cache/NetworkCache.h:
1750         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1751         (WebKit::NetworkCache::Storage::WriteOperation::WriteOperation):
1752         * NetworkProcess/cache/NetworkCacheStorage.h:
1753
1754 2016-06-16  Chris Dumez  <cdumez@apple.com>
1755
1756         [WK2] Improve serialization of SubresourcesEntry to network disk cache
1757         https://bugs.webkit.org/show_bug.cgi?id=158851
1758
1759         Reviewed by Antti Koivisto.
1760
1761         Improve serialization of SubresourcesEntry to network disk cache:
1762         - Do not bother serializing SubresourceInfo's first party for cookies
1763           and HTTP headers data members if the resource is transient. This is
1764           because those are never used for transient resources. This patch also
1765           makes it so that we do not even bother initializing those data members
1766           if the transient flag is set.
1767         - Update SubresourceInfo::encode() / decode() to encode and decode
1768           the HTTPHeaderMap data member with the right NetworkCache::Coder
1769           template specialization instead of using directly HTTPHeaderMap::decode()
1770           and HTTPHeaderMap::encode(). HTTPHeaderMap::decode() / encode() is
1771           unsafe in the disk cache case (see r200394).
1772
1773         Also update entry types as so:
1774         - "resource" -> "Resource"
1775         - "subresources" -> "SubResources"
1776
1777         These entry types are used a folder names in the disk cache and other
1778         folder names were capitalized. Antti suggested this was a good time
1779         to harmonize since we're bumping the cache version.
1780
1781         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
1782         (WebKit::NetworkCache::constructRevalidationRequest):
1783         (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
1784         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
1785         * NetworkProcess/cache/NetworkCacheStorage.h:
1786         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
1787         (WebKit::NetworkCache::SubresourceInfo::encode):
1788         (WebKit::NetworkCache::SubresourceInfo::decode):
1789         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
1790         (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
1791         (WebKit::NetworkCache::SubresourceInfo::isTransient):
1792         (WebKit::NetworkCache::SubresourceInfo::firstPartyForCookies):
1793         (WebKit::NetworkCache::SubresourceInfo::requestHeaders):
1794
1795 2016-06-16  Anders Carlsson  <andersca@apple.com>
1796
1797         Fix macOS Sierra build
1798         https://bugs.webkit.org/show_bug.cgi?id=158849
1799
1800         Reviewed by Tim Horton.
1801
1802         Add WebCore:: qualifiers for IOSurface, to avoid conflicts with the IOSurface Objective-C class
1803         and adopt IOSurface::asLayerContents().
1804
1805         * Shared/mac/RemoteLayerBackingStore.mm:
1806         (WebKit::RemoteLayerBackingStore::decode):
1807         (WebKit::RemoteLayerBackingStore::bytesPerPixel):
1808         (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
1809         (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
1810         (WebKit::RemoteLayerBackingStore::setBufferVolatility):
1811         (WebKit::RemoteLayerBackingStore::Buffer::discard):
1812         * UIProcess/mac/ViewSnapshotStore.mm:
1813         (WebKit::ViewSnapshot::create):
1814         (WebKit::ViewSnapshot::ViewSnapshot):
1815         (WebKit::ViewSnapshot::asLayerContents):
1816
1817 2016-06-16  Brady Eidson  <beidson@apple.com>
1818
1819         When a WebsiteDataStore finds no ProcessPools and creates one from scratch, it should represent the data store's config.
1820         rdar://problem/26586991 and https://bugs.webkit.org/show_bug.cgi?id=158844
1821
1822         Reviewed by Anders Carlsson.
1823
1824         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1825         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
1826         * UIProcess/API/APIProcessPoolConfiguration.h:
1827
1828         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1829         (WebKit::WebsiteDataStore::WebsiteDataStore):
1830         (WebKit::WebsiteDataStore::fetchData):
1831         (WebKit::WebsiteDataStore::removeData):
1832         (WebKit::WebsiteDataStore::processPools):
1833         * UIProcess/WebsiteData/WebsiteDataStore.h:
1834
1835 2016-06-15  Simon Fraser  <simon.fraser@apple.com>
1836
1837         [iOS WK2] On iPad, indirect focussing of a text field doesn't always scroll to the correct location
1838         https://bugs.webkit.org/show_bug.cgi?id=158828
1839
1840         Reviewed by Enrica Casucci.
1841         
1842         WebPage::getAssistedNodeInformation() unconditionally set information.selectionRect()
1843         to a 1x1 rect at the last interaction location. This caused -[WKWebView _zoomToFocusRect:...]
1844         to early return under the !forceScroll clause if the last interaction rect was visible, but
1845         the elementRect was not. This would happen, for example, if a click in a <button> focussed
1846         an input on some other portion of the page. This behavior is iPad-only, because forceScroll
1847         is only NO there.
1848         
1849         Fix by making getAssistedNodeInformation() only set the selectionRect to the last interaction
1850         location if that is inside of the elementRect (this caters to the case where a tap is inside
1851         an input which is larger than the screen). Otherwise, set it to the empty rect.
1852         
1853         Make this testable by allowing a test to opt into the iPad-style scrolling/zooming behavior
1854         in this code path (essentially, making forceScroll NO for testing), via testing SPI on WKWebView,
1855         plumbed through to WKContentView.
1856
1857         * UIProcess/API/Cocoa/WKWebView.mm:
1858         (-[WKWebView forceIPadStyleZoomOnInputFocus]):
1859         (-[WKWebView setForceIPadStyleZoomOnInputFocus:]):
1860         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1861         * UIProcess/ios/WKContentViewInteraction.h:
1862         * UIProcess/ios/WKContentViewInteraction.mm:
1863         (-[WKContentView _displayFormNodeInputView]):
1864         (-[WKContentView requiresAccessoryView:]):
1865         (-[WKContentView inputAccessoryView]):
1866         (-[WKContentView forceIPadStyleZoomOnInputFocus]):
1867         (-[WKContentView setForceIPadStyleZoomOnInputFocus:]):
1868         (-[WKContentView requiresAccessoryView]): Remove redundant returns, and allow testing to
1869         override the "isIPad" condition.
1870         * WebProcess/WebPage/ios/WebPageIOS.mm:
1871         (WebKit::WebPage::getAssistedNodeInformation):
1872
1873 2016-06-15  Sam Weinig  <sam@webkit.org>
1874
1875         Forward/Back keyboard shortcuts need to flip for RTL
1876         https://bugs.webkit.org/show_bug.cgi?id=158823
1877         <rdar://problem/25975359>
1878
1879         Reviewed by Darin Adler.
1880
1881         Pipe the UserInterfaceLayoutDirection down to the WebContentProcess on initialization
1882         and when it changes, and use it to flip the behavior of command-left and command-right
1883         when in RTL mode.
1884
1885         Tests:
1886             WebKit2_CommandBackForwardTestWKView.LTR
1887             WebKit2_CommandBackForwardTestWKView.RTL
1888             WebKit2_CommandBackForwardTestWKWebView.LTR
1889             WebKit2_CommandBackForwardTestWKWebView.RTL
1890
1891         * Shared/WebPageCreationParameters.cpp:
1892         (WebKit::WebPageCreationParameters::encode):
1893         (WebKit::WebPageCreationParameters::decode):
1894         * Shared/WebPageCreationParameters.h:
1895         * UIProcess/API/Cocoa/WKWebView.mm:
1896         (-[WKWebView _webViewPrintFormatter]):
1897         (-[WKWebView setSemanticContentAttribute:]):
1898         (-[WKWebView _printOperationWithPrintInfo:forFrame:]):
1899         (-[WKWebView setUserInterfaceLayoutDirection:]):
1900         * UIProcess/API/mac/WKView.mm:
1901         (-[WKView setUserInterfaceLayoutDirection:]):
1902         * UIProcess/Cocoa/WebViewImpl.h:
1903         * UIProcess/Cocoa/WebViewImpl.mm:
1904         (WebKit::WebViewImpl::windowIsFrontWindowUnderMouse):
1905         (WebKit::toUserInterfaceLayoutDirection):
1906         (WebKit::WebViewImpl::userInterfaceLayoutDirection):
1907         (WebKit::WebViewImpl::setUserInterfaceLayoutDirection):
1908         * UIProcess/WebPageProxy.cpp:
1909         (WebKit::WebPageProxy::creationParameters):
1910         (WebKit::WebPageProxy::userInterfaceLayoutDirection):
1911         (WebKit::WebPageProxy::setUserInterfaceLayoutDirection):
1912         * UIProcess/WebPageProxy.h:
1913         (WebKit::WebPageProxy::hasHadSelectionChangesFromUserInteraction):
1914         * UIProcess/ios/WKContentView.mm:
1915         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
1916         * WebProcess/WebPage/WebPage.cpp:
1917         (WebKit::m_userInterfaceLayoutDirection):
1918         (WebKit::WebPage::setResourceCachingDisabled):
1919         (WebKit::WebPage::setUserInterfaceLayoutDirection):
1920         (WebKit::m_shouldDispatchFakeMouseMoveEvents): Deleted.
1921         * WebProcess/WebPage/WebPage.h:
1922         * WebProcess/WebPage/WebPage.messages.in:
1923         * WebProcess/WebPage/mac/WebPageMac.mm:
1924         (WebKit::WebPage::performNonEditingBehaviorForSelector):
1925
1926 2016-06-15  Tim Horton  <timothy_horton@apple.com>
1927
1928         Expose _shouldExpandContentToViewHeightForAutoLayout SPI on WKWebView
1929         https://bugs.webkit.org/show_bug.cgi?id=158824
1930         <rdar://problem/23713857>
1931
1932         Reviewed by Simon Fraser.
1933
1934         Test: TestWebKitAPI/WebKit2.AutoLayoutIntegration
1935
1936         * UIProcess/API/Cocoa/WKWebView.mm:
1937         (-[WKWebView _shouldExpandContentToViewHeightForAutoLayout]):
1938         (-[WKWebView _setShouldExpandContentToViewHeightForAutoLayout:]):
1939         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1940         This property exists on WKView; expose it on WKWebView.
1941
1942 2016-06-15  Alex Christensen  <achristensen@webkit.org>
1943
1944         Revert part of r196034
1945         https://bugs.webkit.org/show_bug.cgi?id=158805
1946         rdar://problem/26788138
1947
1948         Reviewed by Dan Bernstein.
1949
1950         * NetworkProcess/NetworkLoad.cpp:
1951         (WebKit::NetworkLoad::~NetworkLoad):
1952         If the WebResourceLoader was destroyed and received a canAuthenticateAgainstProtectionSpace
1953         but did not send a continueCanAuthenticateAgainstProtectionSpace answer because there's no
1954         core loader, then the NetworkLoad will be destroyed.  When this happens, we still need to call
1955         the callback for the challenge.
1956         * WebProcess/Network/WebResourceLoader.cpp:
1957         (WebKit::WebResourceLoader::canAuthenticateAgainstProtectionSpace):
1958         If there's no core loader, we can't send IPC.
1959
1960 2016-06-13  Simon Fraser  <simon.fraser@apple.com>
1961
1962         [iOS WK2] Make it possible to test the Next/Previous buttons in the keyboard accessory bar
1963         https://bugs.webkit.org/show_bug.cgi?id=158714
1964
1965         Reviewed by Enrica Casucci.
1966
1967         Add UIScriptController.keyboardAccessoryBar{Next,Previous} and hook it up to the WKContentView
1968         method that gets called from UIKit.
1969
1970         Add a test that exercises it.
1971
1972         * UIProcess/API/Cocoa/WKWebView.mm:
1973         (-[WKWebView keyboardAssistantBarNext]):
1974         (-[WKWebView keyboardAssistantBarPrevious]):
1975         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1976
1977 2016-06-15  Dean Jackson  <dino@apple.com>
1978
1979         RTL <select> forms are misplaced
1980         https://bugs.webkit.org/show_bug.cgi?id=158810
1981         <rdar://problem/24847541>
1982
1983         Reviewed by Eric Carlson.
1984
1985         AppKit made a change in Sierra that causes popup menus
1986         to snap to a different point when the system language is RTL.
1987         We need to be more explicit about what directionality
1988         we want, and override the location of the popup based
1989         on the text direction.
1990
1991         I also made a small tweak to the fudge offsets we use
1992         in order to make button text and menu text to be
1993         more consistent.
1994
1995         Unfortunately since this is just about the location
1996         of the popup menu, it's unable to be tested in our
1997         current infrastructure.
1998
1999         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2000         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
2001
2002 2016-06-15  Chris Dumez  <cdumez@apple.com>
2003
2004         Drop some unnecessary header includes
2005         https://bugs.webkit.org/show_bug.cgi?id=158788
2006
2007         Reviewed by Alexey Proskuryakov.
2008
2009         Drop some unnecessary header includes in headers to speed up build time.
2010
2011         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
2012         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
2013         * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm:
2014         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
2015         * WebProcess/Plugins/PluginView.cpp:
2016         * WebProcess/WebPage/WebPage.cpp:
2017
2018 2016-06-15  Romain Bellessort  <romain.bellessort@crf.canon.fr>
2019
2020         Enabling Shadow DOM for all platforms
2021         https://bugs.webkit.org/show_bug.cgi?id=158738
2022
2023         Reviewed by Ryosuke Niwa.
2024
2025         Removed Shadow DOM from options (enabled by default)
2026         (comprises removal of corresponding preprocessor directives)
2027
2028         * Configurations/FeatureDefines.xcconfig:
2029         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2030         * WebProcess/WebPage/WebPage.cpp:
2031
2032 2016-06-15  Antti Koivisto  <antti@apple.com>
2033
2034         Vary:Cookie validation doesn't work in private browsing
2035         https://bugs.webkit.org/show_bug.cgi?id=158616
2036         <rdar://problem/26755067>
2037
2038         Reviewed by Andreas Kling.
2039
2040         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2041         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
2042
2043             Implement SessionID version of the function.
2044
2045         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2046
2047 2016-06-14  Chris Dumez  <cdumez@apple.com>
2048
2049         Avoid constructing a AuthenticationChallenge unnecessarily in the NetworkLoad constructor
2050         https://bugs.webkit.org/show_bug.cgi?id=158746
2051
2052         Reviewed by Darin Adler.
2053
2054         Avoid constructing a AuthenticationChallenge unnecessarily in the
2055         NetworkLoad constructor by using WTF::Optional<> for this data
2056         member.
2057
2058         * NetworkProcess/NetworkLoad.cpp:
2059         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
2060         * NetworkProcess/NetworkLoad.h:
2061
2062 2016-06-14  Chris Dumez  <cdumez@apple.com>
2063
2064         Add missing WTFMove() in NetworkResourceLoader::didReceiveResponse()
2065         https://bugs.webkit.org/show_bug.cgi?id=158745
2066
2067         Reviewed by Darin Adler.
2068
2069         Add missing WTFMove() in NetworkResourceLoader::didReceiveResponse()
2070         to avoid copying the ResourceResponse.
2071
2072         * NetworkProcess/NetworkResourceLoader.cpp:
2073
2074 2016-06-14  Chris Dumez  <cdumez@apple.com>
2075
2076         Reduce copying of NetworkLoadParameters
2077         https://bugs.webkit.org/show_bug.cgi?id=158744
2078
2079         Reviewed by Alex Christensen.
2080
2081         Reduce copying of NetworkLoadParameters by moving it around instead.
2082
2083         * NetworkProcess/Downloads/DownloadManager.cpp:
2084         (WebKit::DownloadManager::startDownload):
2085         * NetworkProcess/Downloads/PendingDownload.cpp:
2086         (WebKit::PendingDownload::PendingDownload):
2087         * NetworkProcess/Downloads/PendingDownload.h:
2088         * NetworkProcess/NetworkLoad.cpp:
2089         (WebKit::NetworkLoad::NetworkLoad):
2090         * NetworkProcess/NetworkLoad.h:
2091         * NetworkProcess/NetworkResourceLoader.cpp:
2092         (WebKit::NetworkResourceLoader::startNetworkLoad):
2093         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2094         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
2095
2096 2016-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2097
2098         [ThreadedCompositor] Opening the inspector in a window causes a crash.
2099         https://bugs.webkit.org/show_bug.cgi?id=154444
2100
2101         Reviewed by Žan Doberšek.
2102
2103         The threaded compositor doesn't handle the case of changing or removing the native surface handle. When the web
2104         view is reparented, the current native surface handle is destroyed when the view is removed from the parent, and
2105         a new one is created when added to the new parent. We need to handle this case in the threaded compositor.
2106
2107         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
2108         (WebKit::CompositingRunLoop::stopUpdateTimer): Allow users to stop the update timer.
2109         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
2110         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2111         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): Use performTaskSync because this is called
2112         from a synchronous IPC message and right after it returns, the current native surface is destroyed by the UI
2113         process. So we need to ensure we finish all pending operations for the current native surface in the compositing
2114         thread before it's destroyed. Then we enable or disable the scene depending on whether the native surface has
2115         been created or destroyed and destroy the current context in case the new handle is 0.
2116         (WebKit::ThreadedCompositor::tryEnsureGLContext): Just renamed to make it clear that it can fail.
2117         (WebKit::ThreadedCompositor::glContext):
2118         (WebKit::ThreadedCompositor::renderLayerTree): Return early if scene is not active.
2119         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
2120         (WebKit::ThreadedCoordinatedLayerTreeHost::setNativeSurfaceHandleForCompositing): Schedule a new layer flush
2121         after the native surface handle changed.
2122
2123 2016-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2124
2125         [Threaded Compositor] Modernize and simplify threaded compositor code
2126         https://bugs.webkit.org/show_bug.cgi?id=158615
2127
2128         Reviewed by Žan Doberšek.
2129
2130         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
2131         (WebKit::CompositingRunLoop::performTask): Use NoncopyableFunction.
2132         (WebKit::CompositingRunLoop::performTaskSync): Ditto.
2133         (WebKit::CompositingRunLoop::startUpdateTimer): Just renamed to start instead of set.
2134         (WebKit::CompositingRunLoop::run): Expose run/stop methods instead of the internal RunLoop object.
2135         (WebKit::CompositingRunLoop::stop): Also stop the update timer instead of relying on the caller to do it.
2136         (WebKit::CompositingRunLoop::setUpdateTimer): Deleted.
2137         (WebKit::CompositingRunLoop::stopUpdateTimer): Deleted.
2138         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
2139         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2140         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): Protects this directly in lambda capture.
2141         (WebKit::ThreadedCompositor::setDeviceScaleFactor): Ditto.
2142         (WebKit::ThreadedCompositor::didChangeViewportSize): Ditto.
2143         (WebKit::ThreadedCompositor::didChangeViewportAttribute): Ditto.
2144         (WebKit::ThreadedCompositor::didChangeContentsSize): Ditto.
2145         (WebKit::ThreadedCompositor::scrollTo): Ditto.
2146         (WebKit::ThreadedCompositor::scrollBy): Ditto.
2147         (WebKit::ThreadedCompositor::updateViewport): Use startUpdateTimer().
2148         (WebKit::ThreadedCompositor::scheduleDisplayImmediately): Ditto.
2149         (WebKit::ThreadedCompositor::didChangeVisibleRect): Improve lambda captures.
2150         (WebKit::ThreadedCompositor::renderLayerTree): Use m_viewportController directly.
2151         (WebKit::ThreadedCompositor::createCompositingThread): Use createThread() version that receives a function.
2152         (WebKit::ThreadedCompositor::runCompositingThread): Use run method and don't stop the update timer when the run
2153         loop finishes.
2154         (WebKit::ThreadedCompositor::terminateCompositingThread): Use stop method.
2155         (WebKit::ThreadedCompositor::ThreadedCompositor): Deleted.
2156         (WebKit::ThreadedCompositor::compositingThreadEntry): Deleted.
2157         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
2158         (WebKit::ThreadedCompositor::viewportController): Deleted.
2159
2160 2016-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2161
2162         [Threaded Compositor] Flickering and rendering artifacts when resizing the web view
2163         https://bugs.webkit.org/show_bug.cgi?id=154070
2164
2165         Reviewed by Žan Doberšek.
2166
2167         Resizing the web view is expected to be a sync operation, the UI process creates a new backing store state ID,
2168         sends UpdateBackingStoreState message with the flag RespondImmediately to the web process and waits up to 500ms
2169         for the reply (DidUpdateBackingStoreState message). When using the threaded compositor, we schedule a task in
2170         the compositing thread to update the viewport size, and return immediately, so that we reply to the UI process
2171         before the compositing thread has actually updated its size. There's a moment in which sizes are out of sync
2172         causing the flickering and rendering artifacts, the UI process continues rendering at the new size, while the
2173         web process is still rendering at the previous size. We can prevent this from happening just by making the
2174         resize task synchronous in the threaded compositor.
2175
2176         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
2177         (WebKit::CompositingRunLoop::performTaskSync): Add sync version of performTask().
2178         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
2179         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2180         (WebKit::ThreadedCompositor::didChangeViewportSize): Use performTaskSync().
2181
2182 2016-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2183
2184         Unreviewed. Fix Soup downloads after r201943.
2185
2186         This is a follow up of r201943. The DownloadClient used in DownloadSoup was not updated to the new API of the
2187         ResourceHandleClient because it was not using override on the virtual methods, so it was unnoticed. That broke
2188         the downloads soup implementation, because didReceiveResponse is no longer used in the DownloadClient. This
2189         patch updates the DownloadClient to the new ResourceHandleClient API adding also override to all the virtual
2190         methods to prevent this from happening in the future.
2191
2192         * NetworkProcess/Downloads/soup/DownloadSoup.cpp:
2193         (WebKit::Download::start):
2194         (WebKit::Download::startWithHandle):
2195         (WebKit::DownloadClient::DownloadClient):
2196         (WebKit::DownloadClient::downloadFailed):
2197         (WebKit::DownloadClient::didReceiveResponse):
2198         (WebKit::DownloadClient::didReceiveData):
2199         (WebKit::DownloadClient::didFinishLoading):
2200         (WebKit::DownloadClient::didFail):
2201         (WebKit::DownloadClient::wasBlocked): Deleted.
2202         (WebKit::DownloadClient::cannotShowURL): Deleted.
2203         (WebKit::DownloadClient::cancel):
2204         (WebKit::DownloadClient::handleResponse):
2205
2206 2016-06-13  Dan Bernstein  <mitz@apple.com>
2207
2208         [Mac] Web Content service with a restricted entitlement may load arbitrary dylibs
2209         https://bugs.webkit.org/show_bug.cgi?id=156668
2210         <rdar://problem/26714558>
2211
2212         Reviewed by Anders Carlsson.
2213
2214         * Configurations/WebContentService.xcconfig: Enable library validation when the Web Content
2215           service is given the XPC domain extension entitlement when targeting macOS Sierra or later.
2216
2217 2016-06-13  Alex Christensen  <achristensen@webkit.org>
2218
2219         Add WebSocketProvider stub
2220         https://bugs.webkit.org/show_bug.cgi?id=158702
2221
2222         Reviewed by Brady Eidson.
2223
2224         * WebKit2.xcodeproj/project.pbxproj:
2225         * WebProcess/Network/WebSocketProvider.h: Added.
2226         * WebProcess/WebPage/WebPage.cpp:
2227         (WebKit::m_shouldDispatchFakeMouseMoveEvents):
2228
2229 2016-06-10  Ada Chan  <adachan@apple.com>
2230
2231         Use the video element's video box when getting the inline video rect in WebVideoFullscreenManager
2232         https://bugs.webkit.org/show_bug.cgi?id=158351
2233         <rdar://problem/26567938>
2234
2235         Reviewed by Darin Adler.
2236
2237         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
2238         (WebKit::inlineVideoFrame):
2239         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
2240         (WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement):
2241         (WebKit::WebVideoFullscreenManager::fullscreenMayReturnToInline):
2242         (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced):
2243         (WebKit::clientRectForElement): Deleted.
2244
2245 2016-06-10  Benjamin Poulain  <bpoulain@apple.com>
2246
2247         Add support for passive event listeners on touch events
2248         https://bugs.webkit.org/show_bug.cgi?id=158601
2249
2250         Reviewed by Simon Fraser.
2251
2252         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
2253         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
2254         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
2255         (WebKit::dump):
2256         * Shared/WebCoreArgumentCoders.cpp:
2257         (IPC::ArgumentCoder<EventTrackingRegions>::encode):
2258         (IPC::ArgumentCoder<EventTrackingRegions>::decode):
2259         * Shared/WebCoreArgumentCoders.h:
2260         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
2261         (WebKit::RemoteScrollingCoordinatorProxy::eventTrackingTypeForPoint):
2262         (WebKit::RemoteScrollingCoordinatorProxy::isPointInNonFastScrollableRegion): Deleted.
2263         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
2264         * UIProcess/WebPageProxy.cpp:
2265         (WebKit::WebPageProxy::touchEventTrackingType):
2266         The type is the most restrictive type of all the touch points.
2267         If any touch point needs synchronous tracking, everything has to be synchronous.
2268
2269         (WebKit::WebPageProxy::handleTouchEventSynchronously):
2270         This is a very unfortunate design.
2271
2272         The upper layer dealing with UIKit knows about gesture and when something
2273         can be dispatched asynchrnously because a gesture has started.
2274         This layer knows about tracking and can use that extra inforamtion
2275         to dispatch an event asynchrnously anyway.
2276
2277         In the future, we should refactor this to let WebPageProxy
2278         always decide of the dispatch type. I am just concerned changing
2279         the upper layer while we are stabilizing WebKit.
2280
2281         (WebKit::WebPageProxy::handleTouchEventAsynchronously):
2282         (WebKit::WebPageProxy::handleTouchEvent):
2283         (WebKit::WebPageProxy::resetState):
2284         (WebKit::WebPageProxy::WebPageProxy): Deleted.
2285         (WebKit::WebPageProxy::shouldStartTrackingTouchEvents): Deleted.
2286         * UIProcess/WebPageProxy.h:
2287
2288 2016-06-10  Beth Dakin  <bdakin@apple.com>
2289
2290         Add requestExitFullScreen to WKFullScreenWindowController
2291         https://bugs.webkit.org/show_bug.cgi?id=158633
2292         -and corresponding-
2293         rdar://problem/26564036
2294
2295         Reviewed by Tim Horton.
2296
2297         * UIProcess/mac/WKFullScreenWindowController.h:
2298         * UIProcess/mac/WKFullScreenWindowController.mm:
2299         (-[WKFullScreenWindowController requestExitFullScreen]):
2300
2301 2016-06-10  Alex Christensen  <achristensen@webkit.org>
2302
2303         Reduce ResourceResponse copying
2304         https://bugs.webkit.org/show_bug.cgi?id=158232
2305
2306         Reviewed by Darin Adler.
2307
2308         * NetworkProcess/Downloads/PendingDownload.h:
2309         * NetworkProcess/NetworkDataTask.h:
2310         * NetworkProcess/NetworkLoad.cpp:
2311         (WebKit::NetworkLoad::continueDidReceiveResponse):
2312         (WebKit::NetworkLoad::sharedDidReceiveResponse):
2313         (WebKit::NetworkLoad::sharedWillSendRedirectedRequest):
2314         (WebKit::NetworkLoad::didReceiveChallenge):
2315         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
2316         (WebKit::NetworkLoad::didReceiveResponseAsync):
2317         * NetworkProcess/NetworkLoad.h:
2318         * NetworkProcess/NetworkLoadClient.h:
2319         * NetworkProcess/NetworkResourceLoader.cpp:
2320         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
2321         (WebKit::NetworkResourceLoader::abort):
2322         * NetworkProcess/NetworkResourceLoader.h:
2323         * NetworkProcess/PingLoad.h:
2324         * NetworkProcess/cache/NetworkCacheCoders.h:
2325         (WebKit::NetworkCache::Coder<Optional<T>>::encode):
2326         (WebKit::NetworkCache::Coder<Optional<T>>::decode):
2327         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2328         (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
2329         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
2330         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2331         (WebKit::NetworkDataTask::didCompleteWithError):
2332         (WebKit::NetworkDataTask::didReceiveResponse):
2333         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2334         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
2335         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2336         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
2337         * WebProcess/WebPage/WebFrame.cpp:
2338         (WebKit::WebFrame::url):
2339         (WebKit::WebFrame::certificateInfo):
2340         (WebKit::WebFrame::innerText):
2341
2342 2016-06-09  Ryosuke Niwa  <rniwa@webkit.org>
2343
2344         Add SPI to disable spellchecking on auto-fillable text fields
2345         https://bugs.webkit.org/show_bug.cgi?id=158611
2346
2347         Reviewed by Anders Carlsson.
2348
2349         Added WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled to disable spellchecking on a text field.
2350
2351         This is used by WebKit2 client which desires to disable spellchecking and notably autocorrection on
2352         login forms, etc... where such feature would interfere with user's actions.
2353
2354         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
2355         (WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled): Added.
2356         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
2357         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
2358         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementSpellcheckEnabled): Added.
2359         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
2360
2361 2016-06-10  Alex Christensen  <achristensen@webkit.org>
2362
2363         Introduce WTF::UniqueRef
2364         https://bugs.webkit.org/show_bug.cgi?id=158596
2365
2366         Reviewed by Brady Eidson.
2367
2368         * WebProcess/WebPage/WebPage.cpp:
2369         (WebKit::m_shouldDispatchFakeMouseMoveEvents):
2370
2371 2016-06-10  Anders Carlsson  <andersca@apple.com>
2372
2373         Remove CommandLine class
2374         https://bugs.webkit.org/show_bug.cgi?id=158628
2375
2376         Reviewed by Tim Horton.
2377
2378         * Shared/CommandLine.h: Removed.
2379         (WebKit::CommandLine::operator[]): Deleted.
2380         * Shared/posix/CommandLinePOSIX.cpp: Removed.
2381         (WebKit::CommandLine::parse): Deleted.
2382         * WebKit2.xcodeproj/project.pbxproj:
2383
2384 2016-06-10  Simon Fraser  <simon.fraser@apple.com>
2385
2386         [iOS WK2] Rare RELEASE_ASSERT under RemoteLayerTreeDrawingArea::flushLayers()
2387         https://bugs.webkit.org/show_bug.cgi?id=158622
2388         rdar://problem/26609452
2389
2390         Reviewed by Tim Horton.
2391         
2392         It's possible for a CADisplayLink to fire after being paused sometimes, possibly
2393         when an app is running another CADisplayLink whose callback takes some time. When
2394         this happens, RemoteLayerTreeDrawingAreaProxy could erroneously send a second
2395         didUpdate() to the web process between commits, which would clear the m_waitingForBackingStoreSwap
2396         flag too early, and allow a subsequent RemoteLayerTreeDrawingArea::flushLayers()
2397         to proceed when the m_pendingBackingStoreFlusher was still flushing.
2398
2399         Fix by preventing two didUpdates from being sent from the UI process between
2400         commits.
2401         
2402         Not easily testable.
2403
2404         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2405         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2406         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2407         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
2408
2409 2016-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2410
2411         [Threaded Compositor] Content and viewport sizes are mixed
2412         https://bugs.webkit.org/show_bug.cgi?id=158564
2413
2414         Reviewed by Žan Doberšek.
2415
2416         Make ThreadedCoordinatedLayerTreeHost::sizeDidChange() update the viewport size for consistency with all other
2417         LayerTreeHost implementations and rename viewportSizeChanged() as contentsSizeChanged() and update the contents
2418         size.
2419
2420         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2421         (WebKit::WebChromeClient::contentsSizeChanged): Remove ifdefed code here, the drawing area is notified two lines below.
2422         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
2423         (WebKit::CoordinatedDrawingArea::mainFrameContentSizeChanged): Update the viewport size to the contents size
2424         only when using a fixed layout here instead of in cross-platform code.
2425         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
2426         (WebKit::ThreadedCoordinatedLayerTreeHost::contentsSizeChanged):
2427         (WebKit::ThreadedCoordinatedLayerTreeHost::sizeDidChange):
2428         (WebKit::ThreadedCoordinatedLayerTreeHost::viewportSizeChanged): Deleted.
2429         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
2430         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2431         (WebKit::DrawingAreaImpl::mainFrameContentSizeChanged): Call LayerTreeHost::contentsSizeChanged().
2432         (WebKit::DrawingAreaImpl::updateBackingStoreState): Remove ifdefed code for the threadecd compositor since it's
2433         now consistent with all other LayerTreeHost implementations.
2434         * WebProcess/WebPage/LayerTreeHost.h:
2435
2436 2016-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2437
2438         [Threaded Compositor] Make it clear that compositing thread operations are always scheduled from the main thread
2439         https://bugs.webkit.org/show_bug.cgi?id=158562
2440
2441         Reviewed by Žan Doberšek.
2442
2443         The code is written as if the compositor thread could also call callOnCompositingRunLoop() which makes the code
2444         confusing. This patch no longer checks if the task was scheduled in the compositing thread, and instead it adds
2445         an ASSERT to ensure it's always called from the main thread as expected. It also adds some more ASSERTS to ensure
2446         and clarify the methods are called from the expected thread.
2447
2448         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
2449         (WebKit::CompositingRunLoop::performTask):
2450         (WebKit::CompositingRunLoop::callOnCompositingRunLoop): Deleted.
2451         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
2452         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2453         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing):
2454         (WebKit::ThreadedCompositor::setDeviceScaleFactor):
2455         (WebKit::ThreadedCompositor::didChangeViewportSize):
2456         (WebKit::ThreadedCompositor::didChangeViewportAttribute):
2457         (WebKit::ThreadedCompositor::didChangeContentsSize):
2458         (WebKit::ThreadedCompositor::scrollTo):
2459         (WebKit::ThreadedCompositor::scrollBy):
2460         (WebKit::ThreadedCompositor::glContext):
2461         (WebKit::ThreadedCompositor::didChangeVisibleRect):
2462         (WebKit::ThreadedCompositor::renderLayerTree):
2463         (WebKit::ThreadedCompositor::updateSceneState):
2464         (WebKit::ThreadedCompositor::callOnCompositingThread): Deleted.
2465         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
2466
2467 2016-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2468
2469         [GTK] Browser plugins crash under Wayland
2470         https://bugs.webkit.org/show_bug.cgi?id=157605
2471
2472         Reviewed by Michael Catanzaro.
2473
2474         Fail the initialization of windowed plugins if we don't have a platform implementation.
2475
2476         * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp:
2477         (WebKit::NetscapePlugin::platformPostInitialize):
2478
2479 2016-06-09  Antoine Quint  <graouts@apple.com>
2480
2481         [iOS] -webkit-overflow-scrolling: touch; ignores pointer-events: none;
2482         https://bugs.webkit.org/show_bug.cgi?id=119839
2483         <rdar://problem/9671514>
2484
2485         Reviewed by Simon Fraser.
2486
2487         Propagate a "userInteractionEnabled" flag from the Web process which is used to turn off
2488         user interaction on a UIScrollView created for -webkit-overflow-scrolling: touch.
2489
2490         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
2491         (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
2492         * Shared/mac/RemoteLayerTreeTransaction.h:
2493         * Shared/mac/RemoteLayerTreeTransaction.mm:
2494         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
2495         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
2496         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
2497         (WebKit::dumpChangedLayers):
2498         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2499         (WebKit::PlatformCALayerRemote::userInteractionEnabled):
2500         (WebKit::PlatformCALayerRemote::setUserInteractionEnabled):
2501         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2502
2503 2016-06-09  Anders Carlsson  <andersca@apple.com>
2504
2505         Remove OriginAndDatabases.cpp, it's unused
2506         https://bugs.webkit.org/show_bug.cgi?id=158595
2507
2508         Reviewed by Sam Weinig.
2509
2510         * CMakeLists.txt:
2511         * Shared/OriginAndDatabases.cpp: Removed.
2512         (WebKit::OriginAndDatabases::encode): Deleted.
2513         (WebKit::OriginAndDatabases::decode): Deleted.
2514         * Shared/OriginAndDatabases.h: Removed.
2515         * WebKit2.xcodeproj/project.pbxproj:
2516
2517 2016-06-09  Alex Christensen  <achristensen@webkit.org>
2518
2519         Clean up EditorClient lifetime
2520         https://bugs.webkit.org/show_bug.cgi?id=158588
2521
2522         Reviewed by Anders Carlsson.
2523
2524         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2525         (WebKit::generateTextCheckingRequestID):
2526         (WebKit::WebEditorClient::shouldDeleteRange):
2527         (WebKit::WebEditorClient::pageDestroyed): Deleted.
2528         * WebProcess/WebCoreSupport/WebEditorClient.h:
2529         (WebKit::WebEditorClient::WebEditorClient):
2530         * WebProcess/WebPage/WebPage.cpp:
2531         (WebKit::m_shouldDispatchFakeMouseMoveEvents):
2532
2533 2016-06-09  Andy Estes  <aestes@apple.com>
2534
2535         WKWebView does not render PDF pages in AirPrint
2536         https://bugs.webkit.org/show_bug.cgi?id=151386
2537         rdar://problem/22499157
2538
2539         Reviewed by Tim Horton.
2540
2541         _WKWebViewPrintFormatter originally attempted to handle PDFs, but the code path was never
2542         properly tested since Safari prints PDFs by setting a printingItem on the
2543         UIPrintInteractionController instead of going through a print formatter. The existing code
2544         almost worked, if it weren't for CGContextScaleCTM() scaling each page into oblivion due to
2545         _totalScaleFactor equaling 0.
2546
2547         This patch properly implements -[_WKWebViewPrintFormatter drawInRect:forPageAtIndex:] to
2548         handle drawing both PDFs generated by WebKit and PDFs loaded in the main frame. It also
2549         takes the opportunity to clean up a number of issues in the existing code:
2550
2551         - Handling of -[_WKWebViewPrintFormatter startPage] is now correct. I had previously assumed
2552           this property represented the first page of output to print, but it actually represents
2553           the first page in the overall print job that the print formatter renders. In other words,
2554           regardless of -startPage, the print formatter should always print all its pages.
2555         - Code specific to webpage and PDF printing was factored out into WKContentView and
2556           WKPDFView, respectively. Each conforms to @protocol(_WKWebViewPrintProvider), and
2557           _WKWebViewPrintFormatter accesses the provider via -[WKWebView _printProvider].
2558         - Instead of piping the printed PDF data from WebPageProxy to WKWebView via PageClient, use
2559           the GenericCallback mechanism to have WebPageProxy call a lambda specified by
2560           WKContentView when the printed PDF is available.
2561         - Removed _totalScaleFactor and used CGPDFPageGetDrawingTransform() to transform both
2562           webpages and PDFs. For webpages, _totalScaleFactor will always equal the ratio of the
2563           paper width to the PDF page width, so CGPDFPageGetDrawingTransform() will apply the same
2564           scaling as CGContextScaleCTM(_totalScaleFactor, _totalScaleFactor) would.
2565
2566         * UIProcess/API/Cocoa/WKWebView.mm:
2567         (-[WKWebView _printProvider]): Added. Returns _currentContentView if it conforms to
2568         @protocol(_WKWebViewPrintProvider).
2569         (-[WKWebView _computePageCountAndStartDrawingToPDFForFrame:printInfo:firstPage:computedTotalScaleFactor:]):
2570         Moved code to _wk_pageCountForPrintFormatter in WKContentView and WKPDFView.
2571         (-[WKWebView _endPrinting]): Deleted.
2572         (-[WKWebView _printedDocument]): Deleted.
2573         (-[WKWebView _setPrintedDocument:]): Deleted.
2574         * UIProcess/API/Cocoa/WKWebViewInternal.h: Declared the _printProvider property.
2575         * UIProcess/PageClient.h: Removed didFinishDrawingPagesToPDF().
2576         * UIProcess/WebPageProxy.h: Declared computePagesForPrintingAndDrawToPDF() and
2577         drawToPDFCallback().
2578         * UIProcess/WebPageProxy.messages.in: Renamed DidFinishDrawingPagesToPDF to
2579         DrawToPDFCallback.
2580         * UIProcess/_WKWebViewPrintFormatter.mm: Backed the frameToPrint property with a RetainPtr
2581         ivar so that it doesn't need to be released manually in -dealloc; removed _totalScaleFactor
2582         and _printInfo ivars and added a _printedDocument ivar; removed the property declaration for
2583         webView.
2584         (-[_WKWebViewPrintFormatter frameToPrint]): Added a custom getter for the frameToPrint
2585         property.
2586         (-[_WKWebViewPrintFormatter setFrameToPrint:]): Added a custom setter for the frameToPrint
2587         property.
2588         (-[_WKWebViewPrintFormatter _webView]): Renamed from webView; added an underscore since this
2589         is a private method.
2590         (-[_WKWebViewPrintFormatter _recalcPageCount]): Retrieved the page count from the print
2591         provider and clamped its value to NSIntegerMax.
2592         (-[_WKWebViewPrintFormatter drawInRect:forPageAtIndex:]): Retrieved the printed document
2593         from the print provider if needed; modified the CTM transformations to work for both
2594         webpages and PDFs.
2595         (-[_WKWebViewPrintFormatter dealloc]): Deleted.
2596         (-[_WKWebViewPrintFormatter webView]): Renamed to _webView.
2597         (-[_WKWebViewPrintFormatter rectForPageAtIndex:]): Deleted.
2598         * UIProcess/_WKWebViewPrintFormatterInternal.h: Added. Moved a UIPrintFormatter internal
2599         method declaration to here and defined the _WKWebViewPrintProvider protocol.
2600         * UIProcess/ios/PageClientImplIOS.h: Removed didFinishDrawingPagesToPDF().
2601         * UIProcess/ios/PageClientImplIOS.mm: Ditto.
2602         (WebKit::PageClientImpl::didFinishDrawingPagesToPDF): Deleted.
2603         * UIProcess/ios/WKContentView.mm: Conformed to @protocol(_WKWebViewPrintProvider).
2604         (-[WKContentView _wk_pageCountForPrintFormatter:]): Moved the code to compute page count
2605         from WKWebView to here.
2606         (-[WKContentView _wk_printedDocument]): Moved the code to get the printed document from
2607         WKWebView to here.
2608         * UIProcess/ios/WKPDFView.mm:
2609         (-[WKPDFView _wk_pageCountForPrintFormatter:]): Moved the code to compute the page count
2610         from WKWebView to here; added a call to CGPDFDocumentAllowsPrinting(), returning 0 if
2611         printing is not allowed.
2612         (-[WKPDFView _wk_printedDocument]): Moved the code to get the printed document from
2613         WKWebView to here.
2614         * UIProcess/ios/WebPageProxyIOS.mm:
2615         (WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF): Registered the callback with
2616         m_callbacks and sent Messages::WebPage::ComputePagesForPrintingAndDrawToPDF; returned the
2617         synchronously-returned page count.
2618         (WebKit::WebPageProxy::drawToPDFCallback): Added to perform the callback when drawing to PDF
2619         is complete.
2620         (WebKit::WebPageProxy::didFinishDrawingPagesToPDF): Deleted.
2621         * WebKit2.xcodeproj/project.pbxproj: Added _WKWebViewPrintFormatterInternal.h.
2622         * WebProcess/WebPage/WebPage.h: Renamed computePagesForPrintingAndStartDrawingToPDF() to
2623         computePagesForPrintingAndDrawToPDF().
2624         * WebProcess/WebPage/WebPage.messages.in: Renamed
2625         ComputePagesForPrintingAndStartDrawingToPDF to ComputePagesForPrintingAndDrawToPDF. Removed
2626         the startPage parameter and added a callbackID.
2627         * WebProcess/WebPage/ios/WebPageIOS.mm:
2628         (WebKit::WebPage::computePagesForPrintingAndDrawToPDF): Renamed from
2629         computePagesForPrintingAndStartDrawingToPDF(). Added a call to endPrinting() after sending
2630         Messages::WebPageProxy::DrawToPDFCallback.
2631         (WebKit::WebPage::computePagesForPrintingAndStartDrawingToPDF): Renamed to
2632         computePagesForPrintingAndDrawToPDF.
2633
2634 2016-06-09  Alex Christensen  <achristensen@webkit.org>
2635
2636         Clean up WebSocket code
2637         https://bugs.webkit.org/show_bug.cgi?id=158551
2638
2639         Reviewed by Darin Adler.
2640
2641         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
2642         (WebKit::BlobRegistryProxy::registerFileBlobURL):
2643         * WebProcess/FileAPI/BlobRegistryProxy.h:
2644
2645 2016-06-09  David Kilzer  <ddkilzer@apple.com>
2646
2647         Update properties for UIWKTextInteractionAssistant
2648         <https://webkit.org/b/158559>
2649
2650         Reviewed by Darin Adler.
2651
2652         * Platform/spi/ios/UIKitSPI.h:
2653         (UIWKTextInteractionAssistant.loupeGesture):
2654         (UIWKTextInteractionAssistant.singleTapGesture):
2655         Change from retain to assign since UIWKTextInteractionAssistant
2656         is not responsible for their lifetime.  Sort alphabetically.
2657
2658 2016-06-09  Michael Saboff  <msaboff@apple.com>
2659
2660         WebKitTestRunner and DumpRenderTree do not handle dangling surrogate characters
2661         https://bugs.webkit.org/show_bug.cgi?id=154863
2662
2663         Reviewed by Alexey Proskuryakov.
2664
2665         Added a non-strict verions of WKStringGetUTF8CString() that will handle dangling
2666         surrogates called WKStringGetUTF8CStringNonStrict().
2667
2668         * Shared/API/c/WKString.cpp:
2669         (WKStringGetUTF8CStringImpl):
2670         (WKStringGetUTF8CString):
2671         (WKStringGetUTF8CStringNonStrict):
2672         * Shared/API/c/WKString.h:
2673
2674 2016-06-09  Carlos Garcia Campos  <cgarcia@igalia.com>
2675
2676         [Threaded Compositor] Many layout tests crash when threaded compositor is enabled
2677         https://bugs.webkit.org/show_bug.cgi?id=158560
2678
2679         Reviewed by Žan Doberšek.
2680
2681         This is because CoordinatedGraphicsLayer::notifyFlushRequired() assumes it has a valid compositor when it's
2682         called. But the compositor is only present when GraphicsLayer::create() is called with a
2683         GraphicsLayerFactory. When running the layout tests, layers are created without a factory because DrawingAreaImpl
2684         is not entering AC mode as expected and the layer tree host is not created, making
2685         DrawingAreaImpl::graphicsLayerFactory() always return nullptr. This happens because DrawingAreaImpl is checking
2686         acceleratedDrawingEnabled setting to decide whether to always use compositing mode or not, and WTR sets that
2687         setting to false (changing its default value). The thing is that acceleratedDrawingEnabled setting doesn't have
2688         any effect in non-Mac ports, what we really want to check there is whether acceleratedCompositingEnabled is true
2689         or false.
2690
2691         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2692         (WebKit::DrawingAreaImpl::updatePreferences):
2693
2694 2016-06-09  Carlos Garcia Campos  <cgarcia@igalia.com>
2695
2696         [Threaded Compositor] Remove ThreadedCompositor::setNeedsDisplay()
2697         https://bugs.webkit.org/show_bug.cgi?id=158523
2698
2699         Reviewed by Michael Catanzaro.
2700
2701         ThreadedCompositor::setNeedsDisplay() is always called from the main thread and schedules a task to the
2702         compositing thread to schedule an immediate update. But RunLoop::Timer is thread-safe so we don't really need to
2703         schedule a task to the update the timer in the compositing thread, we can do that directly in the main
2704         thread. And that's exactly what scheduleDisplayImmediately() does, so we can use it instead of setNeedsDisplay().
2705
2706         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2707         (WebKit::ThreadedCompositor::setNeedsDisplay(): Deleted.
2708         (WebKit::ThreadedCompositor::updateSceneState):
2709         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
2710
2711 2016-06-08  Antti Koivisto  <antti@apple.com>
2712
2713         Increase disk cache capacity when there is lots of free space
2714         https://bugs.webkit.org/show_bug.cgi?id=158526
2715
2716         Reviewed by Chris Dumez.
2717
2718         Our maximum disk cache capacity has been 175MB for a very long time. Meanwhile the average resource size has grown
2719         massively. 175MB is now enough for cacheable resources of a few dozen sites at most. Using bigger caches when there is
2720         room for it can reduce network traffic, reduce disk writes, save battery and speed up page loading.
2721
2722         This patch changes cache size for PrimaryWebBrowser cache model
2723
2724         >=16GB free: 175MB -> 500MB
2725         8-16GB free: 150MB -> 250MB
2726
2727         and modestly for DocumentBrowser
2728
2729         >=16GB free: 50MB -> 75MB
2730
2731         Note that if system (on Cocoa platforms) really needs disk space it will wipe out caches so this doesn't reduce
2732         available disk space in scenarios like software installation.
2733
2734         * Shared/CacheModel.cpp:
2735         (WebKit::calculateCacheSizes):
2736
2737 2016-06-08  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2738
2739         Introduce ResourceErrorBase::type
2740         https://bugs.webkit.org/show_bug.cgi?id=158299
2741
2742         Reviewed by Alex Christensen.
2743
2744         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
2745         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
2746         (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
2747
2748 2016-06-08  Beth Dakin  <bdakin@apple.com>
2749
2750         _web_didAddMediaControlsManager should take a controlsManager as a parameter 
2751         https://bugs.webkit.org/show_bug.cgi?id=158545
2752
2753         Reviewed by Tim Horton.
2754
2755         * UIProcess/Cocoa/WebViewImpl.h:
2756
2757 2016-06-06  Antti Koivisto  <antti@apple.com>
2758
2759         WebKit memory cache doesn't respect Vary header
2760         https://bugs.webkit.org/show_bug.cgi?id=71509
2761         <rdar://problem/26651033>
2762
2763         Reviewed by Sam Weinig.
2764
2765         * NetworkProcess/cache/NetworkCache.cpp:
2766         (WebKit::NetworkCache::makeCacheKey):
2767         (WebKit::NetworkCache::cachePolicyAllowsExpired):
2768         (WebKit::NetworkCache::makeUseDecision):
2769         (WebKit::NetworkCache::Cache::retrieve):
2770         (WebKit::NetworkCache::Cache::store):
2771         (WebKit::NetworkCache::Cache::storeRedirect):
2772         (WebKit::NetworkCache::Cache::update):
2773         (WebKit::NetworkCache::headerValueForVary): Deleted.
2774         (WebKit::NetworkCache::collectVaryingRequestHeaders): Deleted.
2775         (WebKit::NetworkCache::verifyVaryingRequestHeaders): Deleted.
2776
2777             These move to WebCore.
2778
2779 2016-06-08  Carlos Garcia Campos  <cgarcia@igalia.com>
2780
2781         Unreviewed. Fix GTK+ build with threaded compositor enabled after r201802.
2782
2783         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
2784         (WebKit::ThreadedCoordinatedLayerTreeHost::create):
2785
2786 2016-06-08  Carlos Garcia Campos  <cgarcia@igalia.com>
2787
2788         LayerTreeHost should be created with a WebPage reference instead of a pointer
2789         https://bugs.webkit.org/show_bug.cgi?id=158520
2790
2791         Reviewed by Žan Doberšek.
2792
2793         We are indeed creating the LayerTreeHost always from a WebPage reference but getting its address to pass it to
2794         the LayerTreeHost create() function.
2795
2796         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
2797         (WebKit::CoordinatedDrawingArea::enterAcceleratedCompositingMode):
2798         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2799         (WebKit::CoordinatedLayerTreeHost::create):
2800         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
2801         (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
2802         (WebKit::CoordinatedLayerTreeHost::performScheduledLayerFlush):
2803         (WebKit::CoordinatedLayerTreeHost::commitSceneState):
2804         (WebKit::CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
2805         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
2806         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
2807         (WebKit::ThreadedCoordinatedLayerTreeHost::create):
2808         (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost):
2809         (WebKit::ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
2810         (WebKit::ThreadedCoordinatedLayerTreeHost::compositorDidFlushLayers):
2811         (WebKit::ThreadedCoordinatedLayerTreeHost::didScaleFactorChanged):
2812         (WebKit::ThreadedCoordinatedLayerTreeHost::setVisibleContentsRect):
2813         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
2814         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2815         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
2816         * WebProcess/WebPage/LayerTreeHost.cpp:
2817         (WebKit::LayerTreeHost::create):
2818         (WebKit::LayerTreeHost::LayerTreeHost):
2819         * WebProcess/WebPage/LayerTreeHost.h:
2820         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
2821         (WebKit::LayerTreeHostGtk::create):
2822         (WebKit::LayerTreeHostGtk::LayerTreeHostGtk):
2823         (WebKit::LayerTreeHostGtk::makeContextCurrent):
2824         (WebKit::LayerTreeHostGtk::deviceOrPageScaleFactorChanged):
2825         (WebKit::LayerTreeHostGtk::paintContents):
2826         (WebKit::LayerTreeHostGtk::deviceScaleFactor):
2827         (WebKit::LayerTreeHostGtk::pageScaleFactor):
2828         (WebKit::LayerTreeHostGtk::flushPendingLayerChanges):
2829         (WebKit::LayerTreeHostGtk::flushAndRenderLayers):
2830         (WebKit::LayerTreeHostGtk::pageBackgroundTransparencyChanged):
2831         (WebKit::LayerTreeHostGtk::initialize): Deleted.
2832         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
2833
2834 2016-06-07  Sam Weinig  <sam@webkit.org>
2835
2836         Fix 10.10 build.
2837
2838         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
2839         (WebKit::addAnimationToLayer):
2840
2841 2016-06-06  Alex Christensen  <achristensen@webkit.org>
2842
2843         Modernize loading code
2844         https://bugs.webkit.org/show_bug.cgi?id=158332
2845
2846         Reviewed by Darin Adler.
2847
2848         * NetworkProcess/Downloads/PendingDownload.h:
2849         * NetworkProcess/NetworkDataTask.h:
2850         (WebKit::NetworkDataTask::client):
2851         * NetworkProcess/NetworkLoad.cpp:
2852         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
2853         (WebKit::NetworkLoad::didReceiveData):
2854         (WebKit::NetworkLoad::didReceiveBuffer):
2855         * NetworkProcess/NetworkLoad.h:
2856         * NetworkProcess/NetworkLoadClient.h:
2857         * NetworkProcess/NetworkResourceLoader.cpp:
2858         (WebKit::NetworkResourceLoader::didReceiveBuffer):
2859         (WebKit::NetworkResourceLoader::didFinishLoading):
2860         * NetworkProcess/NetworkResourceLoader.h:
2861         * NetworkProcess/PingLoad.h:
2862         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2863         (WebKit::NetworkCache::SpeculativeLoad::didReceiveBuffer):
2864         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
2865         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2866         (WebKit::NetworkDataTask::didReceiveResponse):
2867         (WebKit::NetworkDataTask::didReceiveData):
2868         * Shared/WebHitTestResultData.cpp:
2869         * WebProcess/Network/WebResourceLoader.cpp:
2870         (WebKit::WebResourceLoader::didReceiveResource):
2871
2872 2016-06-05  Sam Weinig  <sam@webkit.org>
2873
2874         Add experimental support for spring based CSS animations
2875         https://bugs.webkit.org/show_bug.cgi?id=158403
2876
2877         Reviewed by Dean Jackson.
2878
2879         * Shared/WebCoreArgumentCoders.cpp:
2880         (IPC::ArgumentCoder<StepsTimingFunction>::decode):
2881         (IPC::ArgumentCoder<SpringTimingFunction>::encode):
2882         (IPC::ArgumentCoder<SpringTimingFunction>::decode):
2883         (IPC::ArgumentCoder<FloatPoint>::encode):
2884         * Shared/WebCoreArgumentCoders.h:
2885         * Shared/WebPreferencesDefinitions.h:
2886         * WebProcess/WebPage/WebPage.cpp:
2887         (WebKit::WebPage::updatePreferences):
2888         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
2889         (WebKit::PlatformCAAnimationRemote::Properties::encode):
2890         (WebKit::PlatformCAAnimationRemote::Properties::decode):
2891         (WebKit::addAnimationToLayer):
2892         Pipe through support for the Spring animation.
2893
2894 2016-06-07  Michael Catanzaro  <mcatanzaro@igalia.com>
2895
2896         [GTK] Hide GTK+ 2 plugins if GTK+ 2 plugin process was built but is not installed
2897         https://bugs.webkit.org/show_bug.cgi?id=158419
2898
2899         Reviewed by Carlos Garcia Campos.
2900
2901         Patch by Alberto Garcia <berto@igalia.com>
2902
2903         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
2904         (WebKit::PluginInfoStore::getPluginInfo):
2905         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
2906         (WebKit::PluginProcessProxy::scanPlugin):
2907
2908 2016-06-06  Antoine Quint  <graouts@apple.com>
2909
2910         Position of WebGL <canvas> on iOS is incorrect with CSS borders
2911         https://bugs.webkit.org/show_bug.cgi?id=156790
2912
2913         Reviewed by Simon Fraser.
2914
2915         WebGL layers on iOS are hosted by a WKRemoteView, which applies a transform scaling
2916         its content by the inverse of the device pixel ratio, which affects how positions are
2917         applied to the WebGL layer. The container layer of the layer hosted by a WKRemoteView
2918         then has an inverse transform applied to it in the PlatformCALayerRemoteCustom
2919         constructor. However, the position of a CALayer is not affected by its transform.
2920
2921         The fix for <rdar://problem/18316542> should be specific to video, so we only apply the
2922         scaling in the case of a LayerTypeAVPlayerLayer.
2923
2924         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
2925         (-[WKRemoteView initWithFrame:contextID:]):
2926         (WebKit::RemoteLayerTreeHost::createLayer):
2927         (-[WKRemoteView initWithFrame:contextID:hostingDeviceScaleFactor:]): Deleted.
2928         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
2929         (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
2930
2931 2016-06-06  Brady Eidson  <beidson@apple.com>
2932
2933         Fix build after r201717
2934
2935         Unreviewed.
2936
2937         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2938         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
2939
2940         * NetworkProcess/NetworkProcess.cpp:
2941         (WebKit::NetworkProcess::grantSandboxExtensionsToDatabaseProcessForBlobs):
2942         * NetworkProcess/NetworkProcess.h:
2943         
2944 2016-06-06  Brady Eidson  <beidson@apple.com>
2945
2946         Modern IDB: Crash seen in IDBConnectionProxy::putOrAdd on GuardMalloc bot
2947         https://bugs.webkit.org/show_bug.cgi?id=158124
2948
2949         Reviewed by Darin Adler.
2950         
2951         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2952         (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
2953         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
2954         
2955         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
2956         (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
2957         * WebProcess/FileAPI/BlobRegistryProxy.h:
2958         
2959         * WebProcess/Network/NetworkProcessConnection.cpp:
2960         (WebKit::NetworkProcessConnection::didClose):
2961         (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
2962         * WebProcess/Network/NetworkProcessConnection.h:
2963
2964 2016-06-06  Commit Queue  <commit-queue@webkit.org>
2965
2966         Unreviewed, rolling out r201706.
2967         https://bugs.webkit.org/show_bug.cgi?id=158427
2968
2969         This change broke the Yosemite build and its LayoutTest is
2970         failing on Mac and iOS testers (Requested by ryanhaddad on
2971         #webkit).
2972
2973         Reverted changeset:
2974
2975         "Add experimental support for spring based CSS animations"
2976         https://bugs.webkit.org/show_bug.cgi?id=158403
2977         http://trac.webkit.org/changeset/201706
2978
2979 2016-06-06  Alex Christensen  <achristensen@webkit.org>
2980
2981         Reduce ResourceRequest copying in loading code
2982         https://bugs.webkit.org/show_bug.cgi?id=158251
2983
2984         Reviewed by Darin Adler.
2985
2986         * NetworkProcess/Downloads/DownloadManager.cpp:
2987         (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace):
2988         (WebKit::DownloadManager::continueWillSendRequest):
2989         (WebKit::DownloadManager::willDecidePendingDownloadDestination):
2990         * NetworkProcess/Downloads/DownloadManager.h:
2991         * NetworkProcess/Downloads/PendingDownload.cpp:
2992         (WebKit::PendingDownload::PendingDownload):
2993         (WebKit::PendingDownload::willSendRedirectedRequest):
2994         (WebKit::PendingDownload::continueWillSendRequest):
2995         (WebKit::PendingDownload::canAuthenticateAgainstProtectionSpaceAsync):
2996         * NetworkProcess/Downloads/PendingDownload.h:
2997         * NetworkProcess/NetworkDataTask.h:
2998         (WebKit::NetworkDataTask::firstRequest):
2999         * NetworkProcess/NetworkLoad.cpp:
3000         (WebKit::NetworkLoad::cancel):
3001         (WebKit::NetworkLoad::continueWillSendRequest):
3002         (WebKit::NetworkLoad::sharedDidReceiveResponse):
3003         (WebKit::NetworkLoad::sharedWillSendRedirectedRequest):
3004         (WebKit::NetworkLoad::setPendingDownload):
3005         (WebKit::NetworkLoad::willPerformHTTPRedirection):
3006         (WebKit::NetworkLoad::didReceiveChallenge):
3007         (WebKit::NetworkLoad::didFail):
3008         (WebKit::NetworkLoad::willSendRequestAsync):
3009         * NetworkProcess/NetworkLoad.h:
3010         (WebKit::NetworkLoad::currentRequest):
3011         (WebKit::NetworkLoad::clearCurrentRequest):
3012         (WebKit::NetworkLoad::pendingDownloadID):
3013         * NetworkProcess/NetworkLoadClient.h:
3014         * NetworkProcess/NetworkProcess.cpp:
3015         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace):
3016         (WebKit::NetworkProcess::continueWillSendRequest):
3017         (WebKit::NetworkProcess::pendingDownloadCanceled):
3018         * NetworkProcess/NetworkProcess.h:
3019         * NetworkProcess/NetworkResourceLoader.cpp:
3020         (WebKit::NetworkResourceLoader::didFailLoading):
3021         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
3022         (WebKit::NetworkResourceLoader::continueWillSendRequest):
3023         (WebKit::NetworkResourceLoader::continueDidReceiveResponse):
3024         * NetworkProcess/NetworkResourceLoader.h:
3025         * NetworkProcess/PingLoad.h:
3026         (WebKit::PingLoad::PingLoad):
3027         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
3028         (WebKit::NetworkCache::SpeculativeLoad::~SpeculativeLoad):
3029         (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
3030         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
3031         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3032         (WebKit::NetworkDataTask::didBecomeDownload):
3033         (WebKit::NetworkDataTask::willPerformHTTPRedirection):
3034         * WebProcess/Network/WebResourceLoader.cpp:
3035         (WebKit::WebResourceLoader::detachFromCoreLoader):
3036         (WebKit::WebResourceLoader::willSendRequest):
3037         * WebProcess/Network/WebResourceLoader.h:
3038
3039 2016-06-05  Sam Weinig  <sam@webkit.org>
3040
3041         Add experimental support for spring based CSS animations
3042         https://bugs.webkit.org/show_bug.cgi?id=158403
3043
3044         Reviewed by Dean Jackson.
3045
3046         * Shared/WebCoreArgumentCoders.cpp:
3047         (IPC::ArgumentCoder<StepsTimingFunction>::decode):
3048         (IPC::ArgumentCoder<SpringTimingFunction>::encode):
3049         (IPC::ArgumentCoder<SpringTimingFunction>::decode):
3050         (IPC::ArgumentCoder<FloatPoint>::encode):
3051         * Shared/WebCoreArgumentCoders.h:
3052         * Shared/WebPreferencesDefinitions.h:
3053         * WebProcess/WebPage/WebPage.cpp:
3054         (WebKit::WebPage::updatePreferences):
3055         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
3056         (WebKit::PlatformCAAnimationRemote::Properties::encode):
3057         (WebKit::PlatformCAAnimationRemote::Properties::decode):
3058         (WebKit::addAnimationToLayer):
3059         Pipe through support for the Spring animation.
3060
3061 2016-06-05  Yusuke Suzuki  <utatane.tea@gmail.com>
3062
3063         Change ProxyObject.[[Get]] not to use custom accessor
3064         https://bugs.webkit.org/show_bug.cgi?id=157080
3065
3066         Reviewed by Darin Adler.
3067
3068         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
3069         (WebKit::JSNPObject::propertyGetter):
3070         (WebKit::JSNPObject::methodGetter):
3071         * WebProcess/Plugins/Netscape/JSNPObject.h:
3072
3073 2016-06-05  Brady Eidson  <beidson@apple.com>
3074
3075         Unreviewed, rolling out r201694.
3076
3077         201693
3078
3079         Reverted changeset:
3080
3081         "Fix the build after r201693."
3082         https://bugs.webkit.org/show_bug.cgi?id=158394
3083         http://trac.webkit.org/changeset/201694
3084
3085 2016-06-05  Brady Eidson  <beidson@apple.com>
3086
3087         Fix the build after r201693.
3088         https://bugs.webkit.org/show_bug.cgi?id=158394
3089
3090         Reviewed by NOBODY (Build fix).
3091
3092         r201693 landed without the Source/WebKit2 changes, and I didn't have EWS/CQ available to check myself. *sigh*
3093         
3094         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
3095         (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
3096         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
3097         
3098         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
3099         (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
3100         * WebProcess/FileAPI/BlobRegistryProxy.h:
3101         
3102         * WebProcess/Network/NetworkProcessConnection.cpp:
3103         (WebKit::NetworkProcessConnection::didClose):
3104         (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
3105         * WebProcess/Network/NetworkProcessConnection.h:
3106
3107 2016-06-03  Commit Queue  <commit-queue@webkit.org>
3108
3109         Unreviewed, rolling out r201663.
3110         https://bugs.webkit.org/show_bug.cgi?id=158374
3111
3112         Broke the Windows build (Requested by andersca on #webkit).
3113
3114         Reverted changeset:
3115
3116         "Rename NoncopyableFunction to Function"
3117         https://bugs.webkit.org/show_bug.cgi?id=158354
3118         http://trac.webkit.org/changeset/201663
3119
3120 2016-06-03  Anders Carlsson  <andersca@apple.com>
3121
3122         Rename NoncopyableFunction to Function
3123         https://bugs.webkit.org/show_bug.cgi?id=158354
3124
3125         Reviewed by Chris Dumez.
3126
3127         * NetworkProcess/NetworkProcess.cpp:
3128         (WebKit::fetchDiskCacheEntries):
3129         (WebKit::NetworkProcess::fetchWebsiteData):
3130         (WebKit::clearDiskCacheEntries):
3131         * NetworkProcess/NetworkProcess.h:
3132         * NetworkProcess/cache/NetworkCache.cpp:
3133         (WebKit::NetworkCache::Cache::traverse):
3134         * NetworkProcess/cache/NetworkCache.h:
3135         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
3136         (WebKit::NetworkCache::runTaskInQueue):
3137         * NetworkProcess/cache/NetworkCacheStorage.h:
3138
3139 2016-06-03  Chris Dumez  <cdumez@apple.com>
3140
3141         Unreviewed, roll out r196633 as it broke PageCache on iOS for WebKit.org
3142         <rdar://problem/26521101>
3143
3144         * WebProcess/WebPage/VisitedLinkTableController.cpp:
3145         (WebKit::VisitedLinkTableController::setVisitedLinkTable):
3146         (WebKit::VisitedLinkTableController::visitedLinkStateChanged):
3147         (WebKit::VisitedLinkTableController::allVisitedLinkStateChanged):
3148         (WebKit::VisitedLinkTableController::removeAllVisitedLinks):
3149
3150 2016-06-03  Csaba Osztrogonác  <ossy@webkit.org>
3151
3152         Fix the !ENABLE(INDEXED_DATABASE) build after r201575
3153         https://bugs.webkit.org/show_bug.cgi?id=158346
3154
3155         Reviewed by Brady Eidson.
3156
3157         * DatabaseProcess/DatabaseProcess.cpp:
3158         (WebKit::DatabaseProcess::fetchWebsiteData):
3159         (WebKit::DatabaseProcess::deleteWebsiteData):
3160         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
3161
3162 2016-06-02  Chris Dumez  <cdumez@apple.com>
3163
3164         Crash under WebProcess::registerWithStateDumper()
3165         https://bugs.webkit.org/show_bug.cgi?id=158304
3166         <rdar://problem/25329276>
3167
3168         Reviewed by Anders Carlsson.
3169
3170         The issue is that the block in registerWithStateDumper() was executed in
3171         a background thread and is iterating over m_pageMap HashMap. The crash
3172         occurs when a page gets removed from the m_pageMap HashMap while the
3173         block is iterating over this same HashMap in another thread.
3174
3175         The solution proposed is to execute the registerWithStateDumper()'s
3176         block in the main thread.
3177
3178         * WebProcess/cocoa/WebProcessCocoa.mm:
3179         (WebKit::WebProcess::registerWithStateDumper):
3180
3181 2016-06-02  Brady Eidson  <beidson@apple.com>
3182
3183         Overhaul cross-thread use of ResourceRequest, ResourceResponse, and ResourceError.
3184         https://bugs.webkit.org/show_bug.cgi?id=158293
3185
3186         Reviewed by Darin Adler.
3187
3188         * NetworkProcess/cache/NetworkCacheEntry.cpp:
3189         (WebKit::NetworkCache::Entry::Entry):
3190
3191 2016-06-02  Chris Dumez  <cdumez@apple.com>
3192
3193         Modernize various lambda captures
3194         https://bugs.webkit.org/show_bug.cgi?id=158292
3195
3196         Reviewed by Brady Eidson.
3197
3198         Modernize various lambda captures, especially the ones unnecessarily
3199         allocating objects on the heap and destroying them in the lambda.
3200
3201         * NetworkProcess/NetworkProcess.cpp:
3202         (WebKit::fetchDiskCacheEntries):
3203         (WebKit::clearDiskCacheEntries):
3204         (WebKit::NetworkProcess::fetchWebsiteData): Deleted.
3205         * NetworkProcess/cache/NetworkCache.cpp:
3206         (WebKit::NetworkCache::Cache::traverse):
3207         * NetworkProcess/cache/NetworkCache.h:
3208         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3209         (WebKit::NetworkCache::Storage::TraverseOperation::TraverseOperation):
3210         * NetworkProcess/cache/NetworkCacheStorage.h:
3211
3212 2016-06-02  Chris Dumez  <cdumez@apple.com>
3213
3214         Speculative revalidated request returns 200 instead of 304
3215         https://bugs.webkit.org/show_bug.cgi?id=158256
3216
3217         Reviewed by Antti Koivisto and Carlos Garcia Campos.
3218
3219         Already conditional requests coming from WebCore should bypass the
3220         SpeculativeLoadManager. This is because the validation is requested
3221         by WebCore (usually the memory cache) and not our network cache. As
3222         a result, we need to pipe the revalidation response (e.g. 304 status
3223         code) back to WebCore instead of resolving it as disk cache level.
3224
3225         This should fix the /webkit2/WebKitWebResource/response unit test.
3226
3227         * NetworkProcess/cache/NetworkCache.cpp:
3228         (WebKit::NetworkCache::Cache::retrieve):
3229         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
3230         (WebKit::NetworkCache::requestsHeadersMatch):
3231
3232 2016-06-02  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3233
3234         Use more references in ResourceLoader related code
3235         https://bugs.webkit.org/show_bug.cgi?id=158222
3236
3237         Reviewed by Darin Adler.
3238
3239         * WebProcess/Network/WebLoaderStrategy.cpp:
3240         (WebKit::WebLoaderStrategy::loadResource):
3241         (WebKit::WebLoaderStrategy::schedulePluginStreamLoad):
3242         (WebKit::WebLoaderStrategy::scheduleLoad):
3243         (WebKit::WebLoaderStrategy::scheduleInternallyFailedLoad):
3244         (WebKit::WebLoaderStrategy::startLocalLoad):
3245         (WebKit::WebLoaderStrategy::networkProcessCrashed):
3246         * WebProcess/Network/WebLoaderStrategy.h:
3247         * WebProcess/Network/WebResourceLoader.cpp:
3248         (WebKit::WebResourceLoader::create):
3249         (WebKit::WebResourceLoader::WebResourceLoader):
3250         * WebProcess/Network/WebResourceLoader.h:
3251         * WebProcess/Plugins/PluginView.cpp:
3252         (WebKit::PluginView::Stream::start):
3253
3254 2016-06-01  Yongjun Zhang  <yongjun_zhang@apple.com>
3255
3256         Notify client immediately if network session doesn't exist for a synchronous XHR load.
3257         https://bugs.webkit.org/show_bug.cgi?id=158239
3258         <rdar://problem/26344251>
3259
3260         Reviewed by Brady Eidson.
3261
3262         For a synchronous XHR load, if the network session doesn't exist, we should notify NetworkLoadClient.
3263         Otherwise the Web process could hang when waiting for the synchronous load to finish.
3264
3265         * NetworkProcess/NetworkLoad.cpp:
3266         (WebKit::NetworkLoad::NetworkLoad):
3267
3268 2016-05-31  Brian Burg  <bburg@apple.com>
3269   
3270         REGRESSION(r191907): Can't enter combining diacritic marks in Web Inspector fields
3271         https://bugs.webkit.org/show_bug.cgi?id=158227
3272         <rdar://problem/26232464>
3273
3274         Reviewed by Darin Adler and Alexey Proskuryakov.
3275
3276         Web Inspector uses a WKWebView subclass for the inspector frontend interface.
3277         Since r191907, WKWebView does not have an inner WKView, and instead shares
3278         a WebViewImpl to implement the same methods as WKView. So, WKView is no longer
3279         involved at all when delivering keystrokes to the Web Inspector interface.
3280
3281         This caused a subtle regression where some keystrokes were not being interpreted
3282         in the same way by AppKit because WKWebView does not conform to NSTextInputClient
3283         but WKView does. AppKit won't automatically create a NSTextInputContext for a NSView
3284         unless the subclass is declared as conforming to NSTextInputClient. Thus, the keystroke
3285         never goes through NSTextInputContext machinery which converts the keystroke into
3286         a combining diacritic character.
3287
3288         This regression is covered by a new API test.
3289
3290         * UIProcess/API/Cocoa/WKWebView.mm: mark WKWebView as conforming to NSTextInputClient.
3291
3292 2016-06-01  Dan Bernstein  <mitz@apple.com>
3293
3294         Try to fix ENABLE(IOS_TOUCH_EVENTS) builds.
3295
3296         * WebProcess/WebPage/EventDispatcher.cpp:
3297         (WebKit::EventDispatcher::touchEvent):
3298
3299 2016-05-31  Darin Adler  <darin@apple.com>
3300
3301         Audit RenderObject casts and fix problems and style issues found
3302         https://bugs.webkit.org/show_bug.cgi?id=158221
3303
3304         Reviewed by Chris Dumez.
3305
3306         * Shared/WebRenderObject.cpp:
3307         (WebKit::WebRenderObject::WebRenderObject): Tightened up the code that
3308         builds the tree of objects; fewer local variables.
3309
3310         * WebProcess/Plugins/PluginView.cpp:
3311         (WebKit::PluginView::invalidateRect): Cast to RenderEmbeddedObject since
3312         that is the class used for plug-ins.
3313         (WebKit::PluginView::pluginProcessCrashed): Ditto.
3314         * WebProcess/WebPage/WebPage.cpp:
3315         (WebKit::WebPage::createPlugin): Ditto.
3316         (WebKit::WebPage::plugInIsPrimarySize): Check the renderer for null here.
3317         Did not change this to RenderEmbeddedObject, though, because I wasn't
3318         absolute certain this is only called with that type of renderer.
3319
3320         * WebProcess/WebPage/ios/WebPageIOS.mm:
3321         (WebKit::WebPage::rangeForWebSelectionAtPosition): Tweaked.
3322
3323 2016-06-01  Brady Eidson  <beidson@apple.com>
3324
3325         Modernize lambda usage for all callers of RunLoop::dispatch() (take 2).
3326         https://bugs.webkit.org/show_bug.cgi?id=158277
3327
3328         Reviewed by Chris Dumez.
3329
3330         * NetworkProcess/cache/NetworkCache.cpp:
3331         (WebKit::NetworkCache::Cache::deleteDumpFile):
3332
3333         * Platform/IPC/Connection.cpp:
3334         (IPC::Connection::addWorkQueueMessageReceiver):
3335         (IPC::Connection::removeWorkQueueMessageReceiver):
3336         (IPC::Connection::invalidate):
3337         (IPC::Connection::sendMessage):
3338         (IPC::Connection::processIncomingMessage):
3339         (IPC::Connection::postConnectionDidCloseOnConnectionWorkQueue):
3340
3341         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
3342         (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
3343
3344         * UIProcess/Storage/StorageManager.cpp:
3345         (WebKit::StorageManager::createSessionStorageNamespace):
3346         (WebKit::StorageManager::destroySessionStorageNamespace):
3347         (WebKit::StorageManager::setAllowedSessionStorageNamespaceConnection):
3348         (WebKit::StorageManager::cloneSessionStorageNamespace):
3349         (WebKit::StorageManager::processDidCloseConnection):
3350
3351         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3352         (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
3353
3354         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3355         (WebKit::WebsiteDataStore::fetchData):
3356         (WebKit::WebsiteDataStore::removeData):
3357
3358 2016-06-01  Chris Dumez  <cdumez@apple.com>
3359
3360         [iOS] Regression(r200972): Crash under WebKit::WebPage::selectTextWithGranularityAtPoint()
3361         https://bugs.webkit.org/show_bug.cgi?id=158284
3362         <rdar://problem/26573954>
3363
3364         Reviewed by Ryosuke Niwa.
3365
3366         range can be null but r200972 started dereferencing it without null
3367         check. This patch adds a null check for range and uses the pre-r200972
3368         code path if range is null.
3369
3370         * WebProcess/WebPage/ios/WebPageIOS.mm:
3371         (WebKit::WebPage::selectTextWithGranularityAtPoint):
3372
3373 2016-06-01  Brady Eidson  <beidson@apple.com>
3374
3375         Modernize lambda usage for all callers of RunLoop::dispatch().
3376         https://bugs.webkit.org/show_bug.cgi?id=158265
3377
3378         Reviewed by Chris Dumez.
3379
3380         * DatabaseProcess/DatabaseProcess.cpp:
3381         (WebKit::DatabaseProcess::fetchWebsiteData):
3382         (WebKit::DatabaseProcess::deleteWebsiteData):
3383         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
3384         
3385         * NetworkProcess/NetworkProcess.cpp:
3386         (WebKit::fetchDiskCacheEntries):
3387         (WebKit::NetworkProcess::fetchWebsiteData):
3388         
3389         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3390         (WebKit::NetworkCache::Storage::remove):
3391         (WebKit::NetworkCache::retrieveFromMemory):
3392         
3393         * Platform/IPC/Connection.cpp:
3394         (IPC::Connection::SyncMessageState::processIncomingMessage):
3395         (IPC::Connection::processIncomingMessage):
3396         (IPC::Connection::connectionDidClose):
3397         (IPC::Connection::enqueueIncomingMessage):
3398         * Platform/IPC/mac/ConnectionMac.mm:
3399         (IPC::Connection::receiveSourceEventHandler):
3400         
3401         * Shared/mac/CookieStorageShim.mm:
3402         (-[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:]):
3403         * UIProcess/API/APIUserContentExtensionStore.cpp:
3404         (API::UserContentExtensionStore::lookupContentExtension):
3405         (API::UserContentExtensionStore::compileContentExtension):
3406         (API::UserContentExtensionStore::removeContentExtension):
3407         
3408         * UIProcess/Launcher/ProcessLauncher.cpp:
3409         (WebKit::ProcessLauncher::ProcessLauncher):
3410         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3411         (WebKit::connectToService):
3412         
3413         * UIProcess/Storage/StorageManager.cpp:
3414         (WebKit::StorageManager::getSessionStorageOrigins):
3415         (WebKit::StorageManager::deleteSessionStorageOrigins):
3416         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
3417         (WebKit::StorageManager::getLocalStorageOrigins):
3418         (WebKit::StorageManager::getLocalStorageOriginDetails):
3419         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
3420         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
3421         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
3422         
3423         * UIProcess/WebPageProxy.cpp:
3424         (WebKit::WebPageProxy::isWebProcessResponsive):
3425         
3426         * UIProcess/WebProcessProxy.cpp:
3427         (WebKit::WebProcessProxy::isResponsive):
3428         
3429         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3430         (WebKit::WebsiteDataStore::fetchData):
3431         
3432         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
3433         (WebKit::NetscapePlugin::pluginThreadAsyncCall):
3434         
3435         * WebProcess/Plugins/PluginView.cpp:
3436         (WebKit::PluginView::unprotectPluginFromDestruction):
3437         
3438         * WebProcess/WebPage/EventDispatcher.cpp:
3439         (WebKit::EventDispatcher::wheelEvent):
3440         (WebKit::EventDispatcher::gestureEvent):
3441         (WebKit::EventDispatcher::touchEvent):
3442