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