[WK2] Extend processDidCrash delegate to let the client know the reason for the crash
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2017-05-03  Chris Dumez  <cdumez@apple.com>
2
3         [WK2] Extend processDidCrash delegate to let the client know the reason for the crash
4         https://bugs.webkit.org/show_bug.cgi?id=171565
5         <rdar://problem/31204417>
6
7         Reviewed by Sam Weinig.
8
9         Extend processDidCrash delegate to let the client know the reason for the crash. This
10         is needed by some clients to distinguish actual crashes from terminations due to
11         resource limits.
12
13         * Shared/ProcessCrashReason.h: Added.
14         * UIProcess/API/APINavigationClient.h:
15         (API::NavigationClient::processDidCrash):
16         * UIProcess/API/C/WKAPICast.h:
17         (WebKit::toAPI):
18         * UIProcess/API/C/WKPage.cpp:
19         (WKPageSetPageNavigationClient):
20         * UIProcess/API/C/WKPageNavigationClient.h:
21         * UIProcess/API/C/WKProcessCrashReason.h: Added.
22         * UIProcess/Cocoa/NavigationState.h:
23         * UIProcess/Cocoa/NavigationState.mm:
24         (WebKit::NavigationState::NavigationClient::processDidCrash):
25         * UIProcess/WebPageProxy.cpp:
26         (WebKit::WebPageProxy::processDidCrash):
27         * UIProcess/WebPageProxy.h:
28         * UIProcess/WebProcessProxy.cpp:
29         (WebKit::WebProcessProxy::didClose):
30         (WebKit::WebProcessProxy::requestTermination):
31         (WebKit::diagnosticLoggingKeyForTerminationReason):
32         (WebKit::toProcessCrashReason):
33         (WebKit::WebProcessProxy::terminateProcessDueToResourceLimits):
34         (WebKit::WebProcessProxy::didExceedActiveMemoryLimit):
35         (WebKit::WebProcessProxy::didExceedInactiveMemoryLimit):
36         (WebKit::WebProcessProxy::didExceedBackgroundCPULimit):
37         * UIProcess/WebProcessProxy.h:
38         * WebKit2.xcodeproj/project.pbxproj:
39
40 2017-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
41
42         [GTK] Add GTK+ implementation of WebAutomationSession
43         https://bugs.webkit.org/show_bug.cgi?id=171431
44
45         Reviewed by Michael Catanzaro.
46
47         Add platform dependent methods for GTK+ to synthesize events.
48
49         * PlatformGTK.cmake:
50         * UIProcess/API/gtk/WebKitUIClient.cpp: Always resize the window for web views controlled by automation.
51         * UIProcess/Automation/WebAutomationSession.cpp:
52         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
53         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
54         (WebKit::WebAutomationSession::performMouseInteraction):
55         (WebKit::WebAutomationSession::performKeyboardInteractions):
56         * UIProcess/Automation/WebAutomationSession.h:
57         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: Added.
58         (WebKit::modifiersToEventState):
59         (WebKit::mouseButtonToGdkButton):
60         (WebKit::doMouseEvent):
61         (WebKit::doMotionEvent):
62         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
63         (WebKit::doKeyStrokeEvent):
64         (WebKit::keyCodeForVirtualKey):
65         (WebKit::WebAutomationSession::platformSimulateKeyStroke):
66         (WebKit::WebAutomationSession::platformSimulateKeySequence):
67         (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
68
69 2017-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
70
71         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.1 release.
72
73         * gtk/NEWS: Add release notes for 2.17.1.
74
75 2017-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
76
77         [Soup] Add request headers to network load metrics
78         https://bugs.webkit.org/show_bug.cgi?id=171545
79
80         Reviewed by Sergio Villar Senin.
81
82         This will make the headers to appear in the web inspector.
83
84         Fixes: http/tests/inspector/network/resource-request-headers.html
85
86         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
87         (WebKit::NetworkDataTaskSoup::didGetHeaders):
88
89 2017-05-02  Simon Fraser  <simon.fraser@apple.com>
90
91         Dynamically added position:fixed element is in the wrong place
92         https://bugs.webkit.org/show_bug.cgi?id=170280
93         rdar://problem/31374008
94
95         Reviewed by Tim Horton.
96
97         Layers for position:fixed elements have their positions reconciled after scrolls
98         via AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions() and GraphicsLayerCA::syncPosition(),
99         which updates the GraphicsLayer's position, but does not push it to the PlatformCALayer.
100
101         This bug was a case where a position:fixed element gained a fixed ancestor, so had a GraphicsLayerCA whose
102         position had been updated via syncPosition() in the past. A subsequent layout updated the GraphicsLayerCA position,
103         but to a value that was the same as its pre-sync position, so the PlatformCALayerRemote's position didn't change,
104         but there was no signal to the UI process to restore the layer's pre-scrolled position.
105
106         Fix by avoiding the early return in PlatformCALayerRemote::setPosition(), to ensure that GraphicsLayerCA
107         geometry updates in the web process always send new positions to the UI process.
108
109         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
110         (WebKit::PlatformCALayerRemote::setPosition):
111
112 2017-05-02  Gwang Yoon Hwang  <yoon@igalia.com>
113
114         [GTK] Drop coordinated surfaces from the compositing thread as soon as possible
115         https://bugs.webkit.org/show_bug.cgi?id=171544
116
117         Reviewed by Žan Doberšek.
118
119         Released coordinated surface from the main thread didn't be freed until
120         next commit message because the deletion of coordinated surfaces is
121         considered as a part of scene state.  We need to release corresponding
122         surfaces whenever the compositing coordinator drops update atlases to
123         reduce memory usages.
124
125         No new tests, only an optimization.
126
127         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
128         Remove atlasesToRemove from the GraphicsState. it is not a commit
129         state anymore.
130         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
131         (WebKit::CoordinatedGraphicsScene::syncUpdateAtlases):
132         (WebKit::CoordinatedGraphicsScene::releaseUpdateAtlases):
133         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
134         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
135         (WebKit::CompositingCoordinator::releaseAtlases): Pass the list of
136         released update atlases to the compositing thread right after cleaning
137         up deactivated update atlases.
138         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
139         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
140         (WebKit::CompositingCoordinator::clearPendingStateChanges):
141         (WebKit::CompositingCoordinator::removeUpdateAtlas):
142         (WebKit::CompositingCoordinator::releaseAtlases):
143         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
144         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
145         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
146         (WebKit::ThreadedCoordinatedLayerTreeHost::releaseUpdateAtlases):
147         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
148
149 2017-05-02  Timothy Horton  <timothy_horton@apple.com>
150
151         Inform clients when viewport-fit state changes, so they can recompute insets
152         https://bugs.webkit.org/show_bug.cgi?id=171573
153         <rdar://problem/31947614>
154
155         Reviewed by Simon Fraser.
156
157         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
158         * UIProcess/API/Cocoa/WKWebView.mm:
159         (-[WKWebView _didChangeAvoidsUnsafeArea]):
160         * UIProcess/API/Cocoa/WKWebViewInternal.h:
161         * UIProcess/ios/PageClientImplIOS.mm:
162         (WebKit::PageClientImpl::didChangeAvoidsUnsafeArea):
163         For clients who use setObscuredInsets/setUnobscuredSafeAreaInsets
164         themselves, we need to let them know when the current state of
165         viewport-fit changes so that they can recompute the insets.
166
167 2017-05-02  Gwang Yoon Hwang  <yoon@igalia.com>
168
169         [GTK] Recycle textures while handling tiles
170         https://bugs.webkit.org/show_bug.cgi?id=171541
171
172         Reviewed by Žan Doberšek.
173
174         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
175         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
176         Whenever we create new tiles or delete tiles, CoordGfx creates and
177         deletes textures accordingly.  We should avoid this kind of heavy
178         operations whenever possible.  This patch modifies to use the texture
179         pool to reduce texture allocations.  Also this patch reduces number of
180         resetting textures, which is also expensive operation.
181         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:
182         (WebKit::WebCoordinatedSurface::copyToTexture):
183         Modified to pass BitmapTexture as a reference.
184         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp:
185         (WebKit::ThreadSafeCoordinatedSurface::copyToTexture): Ditto.
186
187 2017-05-02  David Kilzer  <ddkilzer@apple.com>
188
189         Stop using strcpy() in WebProcess::registerWithStateDumper() in WebProcessCocoa.mm
190         <https://webkit.org/b/171520>
191
192         Reviewed by Chris Dumez.
193
194         * WebProcess/cocoa/WebProcessCocoa.mm:
195         (WebKit::WebProcess::registerWithStateDumper): Switch from
196         strcpy() to strlcpy(), removing comment in the process.
197
198 2017-05-02  Andrew Gold  <agold@apple.com>
199
200         MediaDevices is not enabled for MobileSafari
201         https://bugs.webkit.org/show_bug.cgi?id=171433
202         <rdar://problem/31923178>
203
204         Reviewed by Youenn Fablet.
205
206         Added the Cocoa API for toggling this feature and removed API for toggling
207         MediaStreamEnabled since it will always be on.
208
209         * UIProcess/API/Cocoa/WKPreferences.mm:
210         (-[WKPreferences _mediaDevicesEnabled]):
211         (-[WKPreferences _setMediaDevicesEnabled:]):
212         (-[WKPreferences _mediaStreamEnabled]): Deleted.
213         (-[WKPreferences _setMediaStreamEnabled:]): Deleted.
214         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
215
216 2017-05-02  Andy Estes  <aestes@apple.com>
217
218         REGRESSION (r213036): Crash in -[WKContentView _webTouchEventsRecognized:] when a touch event arrives after a WebPageProxy has been invalidated
219         https://bugs.webkit.org/show_bug.cgi?id=171539
220         <rdar://problem/31614982>
221
222         Reviewed by Tim Horton.
223
224         Prior to r213036, the layer tree transaction at last touch start was tracked by
225         WebPageProxy::handleTouchEventSynchronously(), which would ask the drawing area proxy for
226         its most recent transaction ID after ensuring that the WebPageProxy was valid.
227
228         r213036 moved the tracking up to -[WKContentView _webTouchEventsRecognized:], but failed to
229         check if _page was valid before asking for its drawing area proxy's last transaction ID; the
230         drawing area proxy is set to null on WebPageProxy invalidation.
231
232         * UIProcess/ios/WKContentViewInteraction.mm:
233         (-[WKContentView _webTouchEventsRecognized:]): Added an early return if _page isn't valid.
234
235 2017-05-02  Carlos Garcia Campos  <cgarcia@igalia.com>
236
237         Web Automation: generate resizeWindowOfBrowsingContext and moveWindowOfBrowsingContext for all platforms
238         https://bugs.webkit.org/show_bug.cgi?id=171107
239
240         Reviewed by Brian Burg.
241
242         The implementation is actually cross-platform, so it could be moved from WebAutomationSessionMac.mm to
243         WebAutomationSession.cpp and simply return a NotImplemented error for iOS. This will allow to use these methods
244         in other platforms.
245
246         * UIProcess/Automation/Automation.json:
247         * UIProcess/Automation/WebAutomationSession.cpp:
248         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
249         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
250         * UIProcess/Automation/WebAutomationSession.h:
251         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
252         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): Deleted.
253         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext): Deleted.
254
255 2017-05-01  Chris Dumez  <cdumez@apple.com>
256
257         Use RELEASE_LOG_ERROR() to do process termination logging
258         https://bugs.webkit.org/show_bug.cgi?id=171521
259
260         Reviewed by Andreas Kling.
261
262         Use RELEASE_LOG_ERROR() to do process termination logging instead of RELEASE_LOG().
263         This makes the issue more visible in Console.
264
265         * UIProcess/WebProcessProxy.cpp:
266         (WebKit::WebProcessProxy::didExceedActiveMemoryLimit):
267         (WebKit::WebProcessProxy::didExceedInactiveMemoryLimit):
268         (WebKit::WebProcessProxy::didExceedBackgroundCPULimit):
269
270 2017-05-01  Brady Eidson  <beidson@apple.com>
271
272         Only try to get sandbox extension handle for IndexedDB directory if it is set.
273         rdar://problem/31925828 and https://bugs.webkit.org/show_bug.cgi?id=171522
274
275         Reviewed by Andy Estes.
276
277         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
278         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
279
280 2017-05-01  Timothy Horton  <timothy_horton@apple.com>
281
282         Expose viewport-fit instead of clip-to-safe-area
283         https://bugs.webkit.org/show_bug.cgi?id=171503
284         <rdar://problem/31918249>
285
286         Reviewed by Simon Fraser.
287
288         * Shared/VisibleContentRectUpdateInfo.cpp:
289         (WebKit::VisibleContentRectUpdateInfo::encode):
290         (WebKit::VisibleContentRectUpdateInfo::decode):
291         (WebKit::operator<<):
292         * Shared/VisibleContentRectUpdateInfo.h:
293         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
294         (WebKit::VisibleContentRectUpdateInfo::unobscuredSafeAreaInsets):
295         (WebKit::operator==):
296         Plumb the safe area insets down from the UI process to the Web Content
297         process inside the visible content rect update, alongside the obscured
298         insets.
299
300         * Shared/mac/RemoteLayerTreeTransaction.h:
301         (WebKit::RemoteLayerTreeTransaction::avoidsUnsafeArea):
302         (WebKit::RemoteLayerTreeTransaction::setAvoidsUnsafeArea):
303         * Shared/mac/RemoteLayerTreeTransaction.mm:
304         (WebKit::RemoteLayerTreeTransaction::encode):
305         (WebKit::RemoteLayerTreeTransaction::decode):
306         (WebKit::RemoteLayerTreeTransaction::description):
307         * UIProcess/PageClient.h:
308         * UIProcess/ios/PageClientImplIOS.h:
309         * UIProcess/ios/PageClientImplIOS.mm:
310         (WebKit::PageClientImpl::didChangeAvoidsUnsafeArea):
311         (WebKit::PageClientImpl::didChangeClipToSafeArea): Deleted.
312         * UIProcess/ios/WebPageProxyIOS.mm:
313         (WebKit::WebPageProxy::didCommitLayerTree):
314         * UIProcess/mac/PageClientImpl.h:
315         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
316         (WebKit::WebChromeClient::didChangeClipToSafeArea): Deleted.
317         * WebProcess/WebCoreSupport/WebChromeClient.h:
318         * WebProcess/WebPage/WebPage.cpp:
319         (WebKit::WebPage::willCommitLayerTree):
320         * WebProcess/WebPage/ios/WebPageIOS.mm:
321         (WebKit::WebPage::viewportConfigurationChanged):
322         (WebKit::WebPage::updateVisibleContentRects):
323         * UIProcess/WebPageProxy.cpp:
324         (WebKit::WebPageProxy::resetState):
325         (WebKit::WebPageProxy::setAvoidsUnsafeArea):
326         (WebKit::WebPageProxy::setClipToSafeArea): Deleted.
327         * UIProcess/WebPageProxy.h:
328         (WebKit::WebPageProxy::avoidsUnsafeArea):
329         (WebKit::WebPageProxy::clipToSafeArea): Deleted.
330         * UIProcess/WebPageProxy.messages.in:
331         Plumb the effective value of viewport-fit (whether or not to avoid
332         the safe area for layout purposes) from the Web Content process
333         to the UI process inside the layer tree transaction.
334         Also, remove clip-to-safe-area plumbing.
335
336         * UIProcess/API/Cocoa/WKWebView.mm:
337         (-[WKWebView _initializeWithConfiguration:]):
338         (-[WKWebView _computedContentInset]):
339         (-[WKWebView _computedUnobscuredSafeAreaInset]):
340         (-[WKWebView _updateVisibleContentRects]):
341         (-[WKWebView _updateScrollViewInsetAdjustmentBehavior]):
342         (-[WKWebView _safeAreaShouldAffectObscuredInsets]):
343         (-[WKWebView _unobscuredSafeAreaInsets]):
344         (-[WKWebView _setUnobscuredSafeAreaInsets:]):
345         (-[WKWebView _contentMayDrawInObscuredInsets]): Deleted.
346         * UIProcess/API/Cocoa/WKWebViewInternal.h:
347         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
348         Make use of the effective value of viewport-fit to decide whether to
349         take the safe area into account when computing the obscured insets,
350         and expose this to clients (in the case that they need to know
351         because they push their own obscured insets down). Also expose a 
352         safe area inset setter for that case as well.
353
354         * UIProcess/ios/WKContentView.h:
355         * UIProcess/ios/WKContentView.mm:
356         (-[WKContentView updateFixedClippingView:]):
357         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
358         Remove a piece of the clip-to-safe-area implementation, and plumb
359         safe area insets into the visible content rect update info.
360
361         * UIProcess/ios/WKScrollView.h:
362         * UIProcess/ios/WKScrollView.mm:
363         (-[WKScrollView initWithFrame:]):
364         (-[WKScrollView _contentInsetAdjustmentBehaviorWasExternallyOverridden]):
365         (-[WKScrollView _setContentInsetAdjustmentBehavior:]):
366         (-[WKScrollView _setContentInsetAdjustmentBehaviorInternal:]):
367         Keep track of whether the client has ever touched the content inset adjustment
368         behavior; if they have, we won't manage it ourselves.
369
370 2017-05-01  Brady Eidson  <beidson@apple.com>
371
372         Update names in WKURLSchemeHandler/WKURLSchemeHandlerTask APIs.
373         <rdar://problem/31824838> and https://bugs.webkit.org/show_bug.cgi?id=171508
374
375         Reviewed by Andy Estes.
376
377         This patch:
378         - Renames WKURLSchemeHandlerTask to WKURLSchemeTask
379         - Renames the method "startTask" to "startURLSchemeTask"
380         - Renames the method "stopTask" to "stopURLSchemeTask"
381
382         To those effects it's basically a global replace.
383
384         * Shared/API/APIObject.h:
385         * Shared/Cocoa/APIObject.mm:
386         (API::Object::newObject):
387         * UIProcess/API/APIURLSchemeTask.cpp: Renamed from Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.cpp.
388         (API::URLSchemeTask::create):
389         (API::URLSchemeTask::URLSchemeTask):
390         * UIProcess/API/APIURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.h.
391         * UIProcess/API/Cocoa/WKURLSchemeHandler.h:
392         * UIProcess/API/Cocoa/WKURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.h.
393         * UIProcess/API/Cocoa/WKURLSchemeTask.mm: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm.
394         (raiseExceptionIfNecessary):
395         (-[WKURLSchemeTaskImpl request]):
396         (-[WKURLSchemeTaskImpl didReceiveResponse:]):
397         (-[WKURLSchemeTaskImpl didReceiveData:]):
398         (-[WKURLSchemeTaskImpl didFinish]):
399         (-[WKURLSchemeTaskImpl didFailWithError:]):
400         (-[WKURLSchemeTaskImpl _apiObject]):
401         * UIProcess/API/Cocoa/WKURLSchemeTaskInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTaskInternal.h.
402         (WebKit::wrapper):
403         * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.h:
404         * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm:
405         (WebKit::WebURLSchemeHandlerCocoa::platformStartTask):
406         (WebKit::WebURLSchemeHandlerCocoa::platformStopTask):
407         * UIProcess/WebPageProxy.cpp:
408         (WebKit::WebPageProxy::startURLSchemeTask):
409         (WebKit::WebPageProxy::stopURLSchemeTask):
410         (WebKit::WebPageProxy::startURLSchemeHandlerTask): Deleted.
411         (WebKit::WebPageProxy::stopURLSchemeHandlerTask): Deleted.
412         * UIProcess/WebPageProxy.h:
413         * UIProcess/WebPageProxy.messages.in:
414         * UIProcess/WebURLSchemeHandler.cpp:
415         (WebKit::WebURLSchemeHandler::startTask):
416         * UIProcess/WebURLSchemeHandler.h:
417         * UIProcess/WebURLSchemeTask.cpp: Renamed from Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.cpp.
418         (WebKit::WebURLSchemeTask::create):
419         (WebKit::WebURLSchemeTask::WebURLSchemeTask):
420         (WebKit::WebURLSchemeTask::didReceiveResponse):
421         (WebKit::WebURLSchemeTask::didReceiveData):
422         (WebKit::WebURLSchemeTask::didComplete):
423         (WebKit::WebURLSchemeTask::pageDestroyed):
424         (WebKit::WebURLSchemeTask::stop):
425         * UIProcess/WebURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.h.
426         (WebKit::WebURLSchemeTask::identifier):
427         (WebKit::WebURLSchemeTask::request):
428         * WebKit2.xcodeproj/project.pbxproj:
429         * WebProcess/Network/WebLoaderStrategy.cpp:
430         (WebKit::WebLoaderStrategy::addURLSchemeTaskProxy):
431         (WebKit::WebLoaderStrategy::removeURLSchemeTaskProxy):
432         (WebKit::WebLoaderStrategy::remove):
433         (WebKit::WebLoaderStrategy::addURLSchemeHandlerTaskProxy): Deleted.
434         (WebKit::WebLoaderStrategy::removeURLSchemeHandlerTaskProxy): Deleted.
435         * WebProcess/Network/WebLoaderStrategy.h:
436         * WebProcess/WebPage/WebPage.cpp:
437         (WebKit::WebPage::urlSchemeTaskDidReceiveResponse):
438         (WebKit::WebPage::urlSchemeTaskDidReceiveData):
439         (WebKit::WebPage::urlSchemeTaskDidComplete):
440         (WebKit::WebPage::urlSchemeHandlerTaskDidReceiveResponse): Deleted.
441         (WebKit::WebPage::urlSchemeHandlerTaskDidReceiveData): Deleted.
442         (WebKit::WebPage::urlSchemeHandlerTaskDidComplete): Deleted.
443         * WebProcess/WebPage/WebPage.h:
444         * WebProcess/WebPage/WebPage.messages.in:
445         * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp:
446         (WebKit::WebURLSchemeHandlerProxy::startNewTask):
447         (WebKit::WebURLSchemeHandlerProxy::taskDidComplete):
448         (WebKit::WebURLSchemeHandlerProxy::taskDidStopLoading):
449         * WebProcess/WebPage/WebURLSchemeHandlerProxy.h:
450         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.cpp.
451         (WebKit::WebURLSchemeTaskProxy::WebURLSchemeTaskProxy):
452         (WebKit::WebURLSchemeTaskProxy::startLoading):
453         (WebKit::WebURLSchemeTaskProxy::stopLoading):
454         (WebKit::WebURLSchemeTaskProxy::didReceiveResponse):
455         (WebKit::WebURLSchemeTaskProxy::didReceiveData):
456         (WebKit::WebURLSchemeTaskProxy::didComplete):
457         (WebKit::WebURLSchemeTaskProxy::hasLoader):
458         * WebProcess/WebPage/WebURLSchemeTaskProxy.h: Renamed from Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.h.
459         (WebKit::WebURLSchemeTaskProxy::request):
460         (WebKit::WebURLSchemeTaskProxy::identifier):
461
462 2017-05-01  Chris Dumez  <cdumez@apple.com>
463
464         Tweak how long we allow a process to go over its background CPU limit
465         https://bugs.webkit.org/show_bug.cgi?id=170460
466         <rdar://problem/31433141>
467
468         Reviewed by Geoffrey Garen.
469
470         Tweak how long we allow a process to go over its background CPU limit. We now use 8 minutes
471         intervals (instead of previously 15). This is less conservative and aligned with our memory
472         kills.
473
474         * WebProcess/cocoa/WebProcessCocoa.mm:
475
476 2017-05-01  Beth Dakin  <bdakin@apple.com>
477
478         On-screen panel for candidate bar is in the wrong place when the caret is at the 
479         start of a paragraph
480         https://bugs.webkit.org/show_bug.cgi?id=171453
481         -and corresponding-
482         rdar://problem/29779764
483
484         Reviewed by Tim Horton.
485
486         This bug only happens when the caret is at the beginning of the paragraph, and it 
487         is because Range::absoluteTextQuads() returns no quads in this case. I think it 
488         might be correct that absoluteTextQuads() returns no quads in this case, so this 
489         patch fixes the bug at the call site by using absoluteCaretBounds() in this case.
490
491         SPI for testing.
492         * UIProcess/API/Cocoa/WKWebView.mm:
493         (-[WKWebView _candidateRect]):
494         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
495
496         Bug fix.
497         * WebProcess/WebPage/mac/WebPageMac.mm:
498         (WebKit::WebPage::platformEditorState):
499
500 2017-05-01  Carlos Garcia Campos  <cgarcia@igalia.com>
501
502         [GTK] Add automation session API
503         https://bugs.webkit.org/show_bug.cgi?id=171428
504
505         Reviewed by Carlos Alberto Lopez Perez.
506
507         Add new API to allow WebKitGTK+ to be controlled by automation. By default it's disabled, applications have to
508         explicitly call webkit_web_context_set_automation_allowed() to enabled it. When a new automation session is
509         requested, the signal WebKitWebContext::automation-started is emitted with a newly created
510         WebKitAutomationSession, similar to how WebKitWebContext::download-started works. The user should connect to it
511         have access to the WebKitAutomationSession and connect it its signals. When a new web view is requested to be
512         created in a WebKitAutomationSession, the signal WebKitAutomationSession::create-web-view is emitted. The user
513         should connect to it and return a WebKitWebView. The web views used for automation are special ones and need to
514         be created with the new WebKitWebView:is-controlled-by-automation construct property enabled, otherwise we will
515         refuse to create the requested browsing context.
516
517         * PlatformGTK.cmake:
518         * UIProcess/API/gtk/WebKitAutomationSession.cpp: Added.
519         (webkitAutomationSessionSetProperty):
520         (webkitAutomationSessionConstructed):
521         (webkit_automation_session_class_init):
522         (webkitAutomationSessionCreate):
523         (webkitAutomationSessionGetSession):
524         (webkit_automation_session_get_id):
525         * UIProcess/API/gtk/WebKitAutomationSession.h: Added.
526         * UIProcess/API/gtk/WebKitAutomationSessionPrivate.h: Added.
527         * UIProcess/API/gtk/WebKitWebContext.cpp:
528         (webkitWebContextConstructed):
529         (webkit_web_context_class_init):
530         (webkit_web_context_is_automation_allowed):
531         (webkit_web_context_set_automation_allowed):
532         (webkitWebContextCreatePageForWebView):
533         * UIProcess/API/gtk/WebKitWebContext.h:
534         * UIProcess/API/gtk/WebKitWebView.cpp:
535         (webkitWebViewConstructed):
536         (webkitWebViewSetProperty):
537         (webkitWebViewGetProperty):
538         (webkit_web_view_class_init):
539         (webkit_web_view_is_controlled_by_automation):
540         * UIProcess/API/gtk/WebKitWebView.h:
541         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
542         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types:
543         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
544         * UIProcess/API/gtk/webkit2.h:
545
546 2017-05-01  Carlos Garcia Campos  <cgarcia@igalia.com>
547
548         Unreviewed. Fix GTK+ debug build after r216002.
549
550         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
551         (WebKit::wrapClientRectList):
552
553 2017-04-30  Chris Dumez  <cdumez@apple.com>
554
555         Drop support for legacy ClientRect / ClientRectList
556         https://bugs.webkit.org/show_bug.cgi?id=171418
557
558         Reviewed by Sam Weinig.
559
560         GTK build fix.
561
562         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
563         (WebKit::kit):
564         (WebKit::core):
565         (WebKit::wrapClientRect):
566         (webkit_dom_client_rect_constructed):
567         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
568         (ClientRectList::create):
569         (ClientRectList::items):
570         (ClientRectList::ClientRectList):
571         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectListPrivate.h:
572         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectPrivate.h:
573         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
574         (webkit_dom_element_get_bounding_client_rect):
575         (webkit_dom_element_get_client_rects):
576
577 2017-04-30  Brady Eidson  <beidson@apple.com>
578
579         More fixing after r215991
580         https://bugs.webkit.org/show_bug.cgi?id=171483
581
582         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
583         (WebKit::NetworkProcess::syncAllCookies):
584
585 2017-04-30  Brady Eidson  <beidson@apple.com>
586
587         Fix r215991
588         https://bugs.webkit.org/show_bug.cgi?id=171483
589
590         Unreviewed.
591
592         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
593         (WebKit::NetworkProcess::syncAllCookies):
594
595 2017-04-30  Dan Bernstein  <mitz@apple.com>
596
597         [Cocoa] Replaces uses of [get…() alloc] with alloc…Instance()
598         https://bugs.webkit.org/show_bug.cgi?id=171485
599
600         Reviewed by Geoffrey Garen.
601
602         * Platform/mac/MenuUtilities.mm:
603         (WebKit::menuItemForTelephoneNumber):
604         (WebKit::menuForTelephoneNumber):
605
606 2017-04-30  Brady Eidson  <beidson@apple.com>
607
608         Updates to _WKWebsiteDataStoreConfiguration cookie storage location SPI.
609         <rdar://problem/31906397> and https://bugs.webkit.org/show_bug.cgi?id=171483
610
611         Reviewed by Geoff Garen (and kind of Andy Estes).
612         
613         Updates include:
614         -Taking a file path as the config argument instead of a directory.
615         -Proper sandbox extension handling.
616         -Proper and thorough API test.
617
618         * NetworkProcess/NetworkProcess.cpp:
619         (WebKit::NetworkProcess::syncAllCookies):
620         * NetworkProcess/NetworkProcess.h:
621         * NetworkProcess/NetworkProcess.messages.in:
622
623         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
624         (WebKit::NetworkProcess::syncAllCookies):
625
626         * NetworkProcess/mac/RemoteNetworkingContext.mm:
627         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
628
629         * Shared/WebsiteDataStoreParameters.cpp:
630         (WebKit::WebsiteDataStoreParameters::encode):
631         (WebKit::WebsiteDataStoreParameters::decode):
632         * Shared/WebsiteDataStoreParameters.h:
633
634         * UIProcess/API/Cocoa/WKProcessPool.mm:
635         (-[WKProcessPool _syncNetworkProcessCookies]):
636         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
637
638         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
639         (-[WKWebsiteDataStore _initWithConfiguration:]):
640
641         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
642         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
643         (-[_WKWebsiteDataStoreConfiguration _cookieStoragePath]):
644         (-[_WKWebsiteDataStoreConfiguration _setCookieStoragePath:]):
645         (-[_WKWebsiteDataStoreConfiguration _cookieStorageDirectory]): Deleted.
646         (-[_WKWebsiteDataStoreConfiguration _setCookieStorageDirectory:]): Deleted.
647
648         * UIProcess/WebProcessPool.cpp:
649         (WebKit::WebProcessPool::syncNetworkProcessCookies):
650         * UIProcess/WebProcessPool.h:
651
652         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
653         (WebKit::WebsiteDataStore::parameters):
654
655         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
656         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
657
658         * UIProcess/WebsiteData/WebsiteDataStore.h:
659         (WebKit::WebsiteDataStore::resolvedCookieStoragePath):
660         (WebKit::WebsiteDataStore::resolvedCookieStorageDirectory): Deleted.
661
662 2017-04-30  Brady Eidson  <beidson@apple.com>
663
664         Regression (r215941) Unexpected logging causes perf tests to fail.
665         <rdar://problem/31907269> and https://bugs.webkit.org/show_bug.cgi?id=171482
666
667         Reviewed by Alexey Proskuryakov.
668
669         * Shared/mac/SandboxExtensionMac.mm:
670         (WebKit::resolveAndCreateReadWriteDirectoryForSandboxExtension):
671
672         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
673         (WebKit::WebProcessPool::networkingCachesDirectory):
674         (WebKit::WebProcessPool::webContentCachesDirectory):
675
676         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
677         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): Only resolve the cookie storage directory
678           if a custom one has been set.
679
680 2017-04-29  Youenn Fablet  <youenn@apple.com>
681
682         Readd assertion removed accidentally in r215955
683         https://bugs.webkit.org/show_bug.cgi?id=171466
684
685         Reviewed by Eric Carlson.
686
687         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
688         (WebKit::WebBackForwardListProxy::addItemFromUIProcess):
689
690 2017-04-29  Andy Estes  <aestes@apple.com>
691
692         [macOS] Picture-in-picture should be disabled in WebPlaybackControlsManager during external media playback
693         https://bugs.webkit.org/show_bug.cgi?id=171468
694         <rdar://problem/31900349>
695
696         Reviewed by Eric Carlson.
697
698         * UIProcess/Cocoa/WebViewImpl.mm:
699         (WebKit::WebViewImpl::updateMediaTouchBar): Set canTogglePictureInPicture to YES by default
700         on WebPlaybackControlsManager.
701
702 2017-04-29  Yusuke Suzuki  <utatane.tea@gmail.com>
703
704         Move WebCore CPUTime to WTF and implement it in all the platforms
705         https://bugs.webkit.org/show_bug.cgi?id=171477
706
707         Reviewed by Chris Dumez.
708
709         We now hold Seconds in CPUTime instead of int64_t. It finally sends
710         Seconds through WebKit2 IPC. We do not need to specialize ArgumentCoder
711         for Seconds since Seconds just holds double.
712
713         * UIProcess/PerActivityStateCPUUsageSampler.cpp:
714         (WebKit::PerActivityStateCPUUsageSampler::PerActivityStateCPUUsageSampler):
715         (WebKit::PerActivityStateCPUUsageSampler::reportWebContentCPUTime):
716         (WebKit::PerActivityStateCPUUsageSampler::loggingTimerFired):
717         * UIProcess/PerActivityStateCPUUsageSampler.h:
718         * UIProcess/WebProcessPool.cpp:
719         (WebKit::WebProcessPool::reportWebContentCPUTime):
720         * UIProcess/WebProcessPool.h:
721         * UIProcess/WebProcessPool.messages.in:
722         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
723         (WebKit::WebChromeClient::reportProcessCPUTime):
724         * WebProcess/WebCoreSupport/WebChromeClient.h:
725
726 2017-04-28  Brady Eidson  <beidson@apple.com>
727
728         Teach the DatabaseProcess to be fully SessionID aware
729         https://bugs.webkit.org/show_bug.cgi?id=171451
730
731         Reviewed by Geoffrey Garen.
732         
733         SessionIDs were already at the periphery of IDB and the DatabaseProcess.
734         Getting a separate IDBServer per SessionID is a pretty straightforward improvement.
735
736         * DatabaseProcess/DatabaseProcess.cpp:
737         (WebKit::DatabaseProcess::idbServer):
738         (WebKit::DatabaseProcess::initializeWebsiteDataStore):
739         (WebKit::DatabaseProcess::fetchWebsiteData):
740         (WebKit::DatabaseProcess::deleteWebsiteData):
741         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
742         (WebKit::DatabaseProcess::indexedDatabaseOrigins):
743         (WebKit::DatabaseProcess::initializeDatabaseProcess): Deleted.
744         (WebKit::DatabaseProcess::ensureIndexedDatabaseRelativePathExists): Deleted.
745         (WebKit::DatabaseProcess::absoluteIndexedDatabasePathFromDatabaseRelativePath): Deleted.
746         * DatabaseProcess/DatabaseProcess.h:
747         (WebKit::DatabaseProcess::indexedDatabaseDirectory): Deleted.
748         * DatabaseProcess/DatabaseProcess.messages.in:
749
750         * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
751         (WebKit::DatabaseToWebProcessConnection::establishIDBConnectionToServer):
752         * DatabaseProcess/DatabaseToWebProcessConnection.h:
753         * DatabaseProcess/DatabaseToWebProcessConnection.messages.in:
754
755         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
756         (WebKit::WebIDBConnectionToClient::create):
757         (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
758         (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
759         (WebKit::WebIDBConnectionToClient::deleteDatabase):
760         (WebKit::WebIDBConnectionToClient::openDatabase):
761         (WebKit::WebIDBConnectionToClient::abortTransaction):
762         (WebKit::WebIDBConnectionToClient::commitTransaction):
763         (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
764         (WebKit::WebIDBConnectionToClient::createObjectStore):
765         (WebKit::WebIDBConnectionToClient::deleteObjectStore):
766         (WebKit::WebIDBConnectionToClient::renameObjectStore):
767         (WebKit::WebIDBConnectionToClient::clearObjectStore):
768         (WebKit::WebIDBConnectionToClient::createIndex):
769         (WebKit::WebIDBConnectionToClient::deleteIndex):
770         (WebKit::WebIDBConnectionToClient::renameIndex):
771         (WebKit::WebIDBConnectionToClient::putOrAdd):
772         (WebKit::WebIDBConnectionToClient::getRecord):
773         (WebKit::WebIDBConnectionToClient::getAllRecords):
774         (WebKit::WebIDBConnectionToClient::getCount):
775         (WebKit::WebIDBConnectionToClient::deleteRecord):
776         (WebKit::WebIDBConnectionToClient::openCursor):
777         (WebKit::WebIDBConnectionToClient::iterateCursor):
778         (WebKit::WebIDBConnectionToClient::establishTransaction):
779         (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
780         (WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
781         (WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
782         (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
783         (WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
784         (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
785         (WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
786         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
787
788         * Shared/Databases/DatabaseProcessCreationParameters.cpp:
789         (WebKit::DatabaseProcessCreationParameters::encode):
790         (WebKit::DatabaseProcessCreationParameters::decode):
791         * Shared/Databases/DatabaseProcessCreationParameters.h:
792
793         * UIProcess/WebProcessPool.cpp:
794         (WebKit::WebProcessPool::ensureDatabaseProcess):
795         (WebKit::WebProcessPool::resolvePathsForSandboxExtensions):
796         (WebKit::WebProcessPool::pageAddedToProcess):
797         * UIProcess/WebProcessPool.h:
798
799         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
800         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
801         (WebKit::WebsiteDataStore::databaseProcessParameters):
802         * UIProcess/WebsiteData/WebsiteDataStore.h:
803         (WebKit::WebsiteDataStore::resolvedIndexedDatabaseDirectory):
804
805         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
806         (WebKit::WebIDBConnectionToServer::create):
807         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
808         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
809
810         * WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
811         (WebKit::WebToDatabaseProcessConnection::idbConnectionToServerForSession):
812
813 2017-04-28  Youenn Fablet  <youenn@apple.com>
814
815         getUserMedia video streams should follow device orientation
816         https://bugs.webkit.org/show_bug.cgi?id=171284
817
818         Reviewed by Eric Carlson.
819
820         Refactoring to specialize CaptureFactory in VideoCaptureFactory and AudioCaptureFactory.
821         Refactoring to return a CaptureSourceOrError instead of passing an out parameter in addition to returning a RefPtr.
822
823         * Shared/WebCoreArgumentCoders.h:
824         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
825         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
826         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
827         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
828         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
829         (WebKit::UserMediaCaptureManager::createCaptureSource):
830         (WebKit::UserMediaCaptureManager::createMediaSourceForCaptureDeviceWithConstraints): Deleted.
831         * WebProcess/cocoa/UserMediaCaptureManager.h:
832
833 2017-04-28  Chris Dumez  <cdumez@apple.com>
834
835         [iOS] We should not take a background assertion for the UIProcess when app is MobileMail
836         https://bugs.webkit.org/show_bug.cgi?id=171435
837         <rdar://problem/31132330>
838
839         Reviewed by Geoffrey Garen.
840
841         Add SPI to disable taking on background process assertions in the UIProcess.
842         This is useful for MobileMail.
843
844         * UIProcess/API/APIProcessPoolConfiguration.cpp:
845         (API::ProcessPoolConfiguration::copy):
846         * UIProcess/API/APIProcessPoolConfiguration.h:
847         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
848         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
849         (-[_WKProcessPoolConfiguration shouldTakeUIBackgroundAssertion]):
850         (-[_WKProcessPoolConfiguration setShouldTakeUIBackgroundAssertion:]):
851         * UIProcess/Network/NetworkProcessProxy.cpp:
852         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
853         * UIProcess/ProcessAssertion.h:
854         (WebKit::ProcessAssertion::setClient):
855         * UIProcess/ProcessThrottler.cpp:
856         (WebKit::ProcessThrottler::ProcessThrottler):
857         (WebKit::m_shouldTakeUIBackgroundAssertion):
858         (WebKit::ProcessThrottler::didConnectToProcess):
859         * UIProcess/ProcessThrottler.h:
860         * UIProcess/WebProcessPool.cpp:
861         (WebKit::WebProcessPool::WebProcessPool):
862         * UIProcess/WebProcessPool.h:
863         * UIProcess/WebProcessProxy.cpp:
864         (WebKit::WebProcessProxy::WebProcessProxy):
865
866 2017-04-28  Chris Dumez  <cdumez@apple.com>
867
868         Unreviewed attempt to fix iOS build after r215943.
869
870         * Configurations/Base.xcconfig:
871
872 2017-04-28  Andy Estes  <aestes@apple.com>
873
874         [macOS] WebPlaybackControlsManager needs to know when the selected text or audio track changes
875         https://bugs.webkit.org/show_bug.cgi?id=171434
876         <rdar://problem/31887922>
877
878         Reviewed by Eric Carlson.
879
880         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
881         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in:
882         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
883         (WebKit::WebPlaybackSessionModelContext::setAudioMediaSelectionIndex): Set
884         m_audioMediaSelectedIndex and notified clients.
885         (WebKit::WebPlaybackSessionModelContext::setLegibleMediaSelectionIndex): Ditto for
886         m_legibleMediaSelectedIndex.
887         (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionIndex): Called
888         WebPlaybackSessionModelContext::setAudioMediaSelectionIndex().
889         (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionIndex): Called
890         WebPlaybackSessionModelContext::setLegibleMediaSelectionIndex().
891         * WebProcess/cocoa/WebPlaybackSessionManager.h:
892         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
893         (WebKit::WebPlaybackSessionInterfaceContext::audioMediaSelectionIndexChanged): Called
894         WebPlaybackSessionManager:: audioMediaSelectionIndexChanged().
895         (WebKit::WebPlaybackSessionInterfaceContext::legibleMediaSelectionIndexChanged): Called
896         WebPlaybackSessionManager::legibleMediaSelectionIndexChanged().
897         (WebKit::WebPlaybackSessionManager::audioMediaSelectionIndexChanged): Sent
898         WebPlaybackSessionManagerProxy::SetAudioMediaSelectionIndex().
899         (WebKit::WebPlaybackSessionManager::legibleMediaSelectionIndexChanged): Sent
900         WebPlaybackSessionManagerProxy::SetLegibleMediaSelectionIndex().
901
902 2017-04-28  Brady Eidson  <beidson@apple.com>
903
904         Start of support for multiple WebsiteDataStore/SessionIDs per process
905         https://bugs.webkit.org/show_bug.cgi?id=171422
906
907         Reviewed by Geoffrey Garen.
908
909         * CMakeLists.txt:
910         * WebKit2.xcodeproj/project.pbxproj:
911
912         * NetworkProcess/NetworkProcess.cpp:
913         (WebKit::NetworkProcess::addWebsiteDataStore):
914         (WebKit::NetworkProcess::destroySession):
915         (WebKit::NetworkProcess::destroyPrivateBrowsingSession): Deleted.
916         * NetworkProcess/NetworkProcess.h:
917         * NetworkProcess/NetworkProcess.messages.in:
918
919         * NetworkProcess/RemoteNetworkingContext.h:
920         * NetworkProcess/mac/RemoteNetworkingContext.mm:
921         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
922         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
923         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
924
925         * Shared/WebsiteDataStoreParameters.cpp: Copied from Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h.
926         (WebKit::WebsiteDataStoreParameters::WebsiteDataStoreParameters):
927         (WebKit::WebsiteDataStoreParameters::encode):
928         (WebKit::WebsiteDataStoreParameters::decode):
929         * Shared/WebsiteDataStoreParameters.h: Copied from Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h.
930
931         * UIProcess/API/APIWebsiteDataStore.cpp:
932         (API::WebsiteDataStore::defaultDataStore):
933         (API::WebsiteDataStore::createLegacy):
934         (API::WebsiteDataStore::WebsiteDataStore):
935         (API::WebsiteDataStore::create): Deleted.
936         * UIProcess/API/APIWebsiteDataStore.h:
937
938         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
939         (-[WKWebsiteDataStore _initWithConfiguration:]):
940
941         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
942         (webkitWebsiteDataManagerCreate):
943         (webkitWebsiteDataManagerGetDataStore):
944
945         * UIProcess/WebPageProxy.cpp:
946         (WebKit::m_weakPtrFactory):
947         * UIProcess/WebPageProxy.h:
948
949         * UIProcess/WebProcessPool.cpp:
950         (WebKit::WebProcessPool::WebProcessPool):
951         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
952         (WebKit::WebProcessPool::pageAddedToProcess):
953         (WebKit::WebProcessPool::pageRemovedFromProcess):
954
955         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
956         (WebKit::WebsiteDataStore::parameters):
957         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
958         (WebKit::WebsiteDataStore::create):
959         (WebKit::WebsiteDataStore::WebsiteDataStore):
960         (WebKit::WebsiteDataStore::~WebsiteDataStore):
961         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
962         (WebKit::WebsiteDataStore::parameters):
963         * UIProcess/WebsiteData/WebsiteDataStore.h:
964
965         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
966         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
967         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
968         (WebKit::WebFrameNetworkingContext::storageSession):
969         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
970         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
971         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
972
973         * WebProcess/WebProcess.cpp:
974         (WebKit::WebProcess::addWebsiteDataStore):
975         (WebKit::WebProcess::destroySession):
976         (WebKit::WebProcess::destroyPrivateBrowsingSession): Deleted.
977         * WebProcess/WebProcess.h:
978         * WebProcess/WebProcess.messages.in:
979         * WebProcess/cocoa/WebProcessCocoa.mm:
980
981 2017-04-28  Youenn Fablet  <youenn@apple.com>
982
983         Adding a runtime flag specific to MediaDevices
984         https://bugs.webkit.org/show_bug.cgi?id=171433
985
986         Reviewed by Geoffrey Garen.
987
988         Adding a preference for MediaDevices.
989         Setting media devices runtime flag to false by default.
990         Setting peer connection and media stream flags to true by default.
991         Sending microphone sandbox extension based on media devices and not media stream flag.
992
993         * Shared/WebPreferencesDefinitions.h:
994         * UIProcess/API/C/WKPreferences.cpp:
995         (WKPreferencesSetMediaDevicesEnabled):
996         (WKPreferencesGetMediaDevicesEnabled):
997         * UIProcess/API/C/WKPreferencesRef.h:
998         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
999         (WebKit::WebProcessPool::platformInitializeWebProcess):
1000         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1001         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1002         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1003         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1004         * WebProcess/WebPage/WebPage.cpp:
1005         (WebKit::WebPage::updatePreferences):
1006
1007 2017-04-28  Brady Eidson  <beidson@apple.com>
1008
1009         Teach WebProcessPool to track a map of SessionIDs to WebPageProxys to manage their lifetime
1010         https://bugs.webkit.org/show_bug.cgi?id=171408
1011
1012         Reviewed by Alex Christensen.
1013
1014         * UIProcess/API/APIPageConfiguration.cpp:
1015         (API::PageConfiguration::sessionID):
1016         * UIProcess/API/APIPageConfiguration.h:
1017         * UIProcess/WebPageProxy.cpp:
1018         (WebKit::WebPageProxy::reattachToWebProcess):
1019         (WebKit::WebPageProxy::close):
1020         * UIProcess/WebProcessPool.cpp:
1021         (WebKit::WebProcessPool::pageAddedToProcess):
1022         (WebKit::WebProcessPool::pageRemovedFromProcess):
1023         * UIProcess/WebProcessPool.h:
1024         * UIProcess/WebProcessProxy.cpp:
1025         (WebKit::WebProcessProxy::createWebPage):
1026         (WebKit::WebProcessProxy::addExistingWebPage):
1027         (WebKit::WebProcessProxy::removeWebPage):
1028         * UIProcess/WebProcessProxy.h:
1029
1030 2017-04-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1031
1032         Move UUID from WebCore/platform to WTF
1033         https://bugs.webkit.org/show_bug.cgi?id=171372
1034
1035         Reviewed by Michael Catanzaro.
1036
1037         * UIProcess/Automation/WebAutomationSession.cpp:
1038         (WebKit::WebAutomationSession::handleForWebPageProxy):
1039         (WebKit::WebAutomationSession::handleForWebFrameID):
1040         * UIProcess/gtk/WaylandCompositor.cpp:
1041         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1042         (WebKit::createUUID):
1043         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1044         (WebKit::PDFPlugin::openWithNativeApplication):
1045
1046 2017-04-27  Chris Dumez  <cdumez@apple.com>
1047
1048         Align colspan/rowspan limits with the latest HTML specification
1049         https://bugs.webkit.org/show_bug.cgi?id=171322
1050
1051         Reviewed by Darin Adler.
1052
1053         GTK build fix.
1054
1055         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
1056         (webkit_dom_html_table_cell_element_get_col_span):
1057         (webkit_dom_html_table_cell_element_set_col_span):
1058
1059 2017-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1060
1061         WKUIDelegatePrivate needs a hook to vend data used to initialize item providers for data interaction
1062         https://bugs.webkit.org/show_bug.cgi?id=171386
1063         <rdar://problem/31557237>
1064
1065         Reviewed by Beth Dakin.
1066
1067         Add a new WKUIDelegate hook, _webView:adjustedDataInteractionItemProvidersForItemProvider:representingObjects:additionalData:.
1068
1069         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1070
1071 2017-04-27  Brady Eidson  <beidson@apple.com>
1072
1073         Refactor SessionID to support multiple non-ephemeral (persistent) sessions.
1074         https://bugs.webkit.org/show_bug.cgi?id=171367
1075
1076         Reviewed by Andy Estes.
1077
1078         * Shared/ChildProcess.cpp:
1079         (WebKit::ChildProcess::initialize): Child processes should never be generating new SessionIDs,
1080           so enable generation protection.
1081
1082         * Shared/WebCoreArgumentCoders.cpp:
1083         (IPC::ArgumentCoder<SessionID>::encode): Deleted.
1084         (IPC::ArgumentCoder<SessionID>::decode): Deleted.
1085         * Shared/WebCoreArgumentCoders.h:
1086
1087         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1088         (WebKit::WebsiteDataStore::createNonPersistent):
1089         (WebKit::generateNonPersistentSessionID): Deleted.
1090
1091 2017-04-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
1092
1093         REGRESSION(r213764): Async decoding of animated images is disabled for ImageDocument
1094         https://bugs.webkit.org/show_bug.cgi?id=170333
1095
1096         Reviewed by Simon Fraser.
1097
1098         Disbale the async decoding for large images for now.
1099
1100         * WebProcess/WebPage/WebPage.cpp:
1101         (WebKit::WebPage::updatePreferences):
1102
1103 2017-04-27  Brent Fulgham  <bfulgham@apple.com>
1104
1105         [WK2][macOS] Allow multi-touch related iokit-get-properties
1106         https://bugs.webkit.org/show_bug.cgi?id=171355
1107         <rdar://problem/31851928>
1108
1109         Reviewed by Alexey Proskuryakov.
1110
1111         During testing I've noticed Sandbox Violations being generated during some 'Force Touch' track pad use.
1112         The sandbox should allow these IOKit properties to be accessed.
1113
1114         * WebProcess/com.apple.WebProcess.sb.in:
1115
1116 2017-04-27  Alex Christensen  <achristensen@webkit.org>
1117
1118         Add stub SPI for setting cookie storage path on _WKWebsiteDataStoreConfiguration
1119         https://bugs.webkit.org/show_bug.cgi?id=171399
1120
1121         Reviewed by Brady Eidson.
1122
1123         This SPI isn't hooked up yet, but it has a test that will need to be updated once it works.
1124
1125         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1126         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1127         (-[WKWebsiteDataStore _initWithConfiguration:]):
1128         * UIProcess/API/Cocoa/_WKDraggableElementInfo.h:
1129         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
1130         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
1131         (-[_WKWebsiteDataStoreConfiguration _cookieStorageDirectory]):
1132         (-[_WKWebsiteDataStoreConfiguration _setCookieStorageDirectory:]):
1133         * UIProcess/WebsiteData/WebsiteDataStore.h:
1134         (WebKit::WebsiteDataStore::resolvedCookieStorageDirectory):
1135
1136 2017-04-27  Chris Dumez  <cdumez@apple.com>
1137
1138         Element.getBoundingClientRect() / getClientRects() should return a DOMRect types
1139         https://bugs.webkit.org/show_bug.cgi?id=171226
1140
1141         Reviewed by Simon Fraser.
1142
1143         GTK build fix.
1144
1145         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
1146         (toClientRect):
1147         (webkit_dom_element_get_bounding_client_rect):
1148         (webkit_dom_element_get_client_rects):
1149
1150 2017-04-27  Brady Eidson  <beidson@apple.com>
1151
1152         Update NetworkStorageSession to support multiple persistent sessions and explicitly set cookie storages.
1153         https://bugs.webkit.org/show_bug.cgi?id=171365
1154
1155         Reviewed by Andy Estes.
1156
1157         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1158         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1159
1160 2017-04-27  Alex Christensen  <achristensen@webkit.org>
1161
1162         Modernize Frame.h
1163         https://bugs.webkit.org/show_bug.cgi?id=171357
1164
1165         Reviewed by Andy Estes.
1166
1167         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1168         (WebKit::WebEditorClient::isSelectTrailingWhitespaceEnabled):
1169         * WebProcess/WebCoreSupport/WebEditorClient.h:
1170         * WebProcess/WebPage/WebPage.cpp:
1171         (WebKit::WebPage::contextMenuAtPointInWindow):
1172         (WebKit::handleContextMenuEvent):
1173         (WebKit::WebPage::isSelectTrailingWhitespaceEnabled):
1174         * WebProcess/WebPage/WebPage.h:
1175         * WebProcess/WebPage/ios/WebPageIOS.mm:
1176         (WebKit::WebPage::selectWithGesture):
1177         (WebKit::WebPage::selectPositionAtPoint):
1178         (WebKit::WebPage::selectPositionAtBoundaryWithDirection):
1179         (WebKit::WebPage::rangeForGranularityAtPoint):
1180         (WebKit::WebPage::selectTextWithGranularityAtPoint):
1181         (WebKit::WebPage::updateSelectionWithExtentPointAndBoundary):
1182         (WebKit::WebPage::updateSelectionWithExtentPoint):
1183
1184 2017-04-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1185
1186         [GTK] Remote inspector should support inspecting targets with previous version of backend commands
1187         https://bugs.webkit.org/show_bug.cgi?id=171267
1188
1189         Reviewed by Michael Catanzaro.
1190
1191         There's a FIXME for this in the code. The remote inspector proxy allows to pass a backend commands URL when
1192         inspecting a target. That URL, if not empty, is used as Protocol/InspectorBackendCommands.js in the inspector
1193         code instead of the local copy. We are currently assuming that both ends use the same version of that file.
1194
1195         * UIProcess/glib/RemoteInspectorClient.cpp:
1196         (WebKit::RemoteInspectorProxy::load): Pass RemoteInspectorClient::backendCommandsURL() to load().
1197         (WebKit::RemoteInspectorClient::setupConnection): Get the local backend commands hash and pass it to
1198         SetupInspectorClient method. Extract the server backend commands from the result and call setBackendCommands().
1199         (WebKit::RemoteInspectorClient::setBackendCommands): Create a data URL for the server backend commands file
1200         conents if needed.
1201         * UIProcess/glib/RemoteInspectorClient.h:
1202         (WebKit::RemoteInspectorClient::backendCommandsURL):
1203
1204 2017-04-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1205
1206         WebItemProviderPasteboard should not synchronously load provided data
1207         https://bugs.webkit.org/show_bug.cgi?id=171341
1208         <rdar://problem/31614010>
1209
1210         Reviewed by Tim Horton.
1211
1212         Adds plumbing for updatePreferredTypeIdentifiers through the WebPasteboardProxy. This allows the web process to
1213         signal to the UI process what UTIs the current drop target should accept and load. See WebCore ChangeLog for more
1214         details.
1215
1216         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1217         (WebKit::WebPasteboardProxy::updatePreferredTypeIdentifiers):
1218         * UIProcess/WebPasteboardProxy.h:
1219         * UIProcess/WebPasteboardProxy.messages.in:
1220         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1221         (WebKit::WebPlatformStrategies::updatePreferredTypeIdentifiers):
1222         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1223
1224 2017-04-26  Youenn Fablet  <youenn@apple.com>
1225
1226         Unauthenticated CORS preflight requests should not use client certificates
1227         https://bugs.webkit.org/show_bug.cgi?id=171298
1228
1229         Reviewed by Alex Christensen.
1230
1231         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1232         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Ensuring that session dedicated to requests that do not want to use credentials do not look for client credentials.
1233
1234 2017-04-26  Eric Carlson  <eric.carlson@apple.com>
1235
1236         The current page is given a muted state when starting a media stream on iOS.
1237         https://bugs.webkit.org/show_bug.cgi?id=171290
1238         <rdar://problem/31821427>
1239
1240         Reviewed by Jer Noble.
1241
1242         * UIProcess/UserMediaProcessManager.cpp:
1243         (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Don't mute the current
1244         page on iOS either, that will prevent the new media stream from playing.
1245
1246 2017-04-26  Alex Christensen  <achristensen@webkit.org>
1247
1248         Make user script injection more robust
1249         https://bugs.webkit.org/show_bug.cgi?id=171339
1250         <rdar://problem/30643691>
1251
1252         Reviewed by Geoffrey Garen.
1253
1254         * WebProcess/UserContent/WebUserContentController.cpp:
1255         (WebKit::WebUserContentController::forEachUserScript):
1256         (WebKit::WebUserContentController::forEachUserStyleSheet):
1257         (WebKit::WebUserContentController::forEachUserMessageHandler):
1258         * WebProcess/UserContent/WebUserContentController.h:
1259
1260 2017-04-26  Zalan Bujtas  <zalan@apple.com>
1261
1262         RTL: recent searches popover is displayed in incorrect location
1263         https://bugs.webkit.org/show_bug.cgi?id=171338
1264         <rdar://problem/31377807>
1265
1266         Reviewed by Dean Jackson.
1267
1268         Add RTL support for the pop-under branch.
1269
1270         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1271         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
1272
1273 2017-04-26  Antti Koivisto  <antti@apple.com>
1274
1275         Enable expired-only reload policy on Mac and iOS
1276         https://bugs.webkit.org/show_bug.cgi?id=171264
1277         <rdar://problem/31807637>
1278
1279         Reviewed by Andreas Kling.
1280
1281         Enable the reload policy where only expired subresources are revalidated on Mac and iOS.
1282         The behavor is enabled in Safari and for other clients based on SDK version check.
1283
1284         * UIProcess/API/C/WKPage.cpp:
1285         (WKPageReload):
1286         * UIProcess/API/Cocoa/WKWebView.mm:
1287         (-[WKWebView reload]):
1288         * UIProcess/Cocoa/VersionChecks.h:
1289
1290 2017-04-26  Andy Estes  <aestes@apple.com>
1291
1292         [macOS] Add picture-in-picture support to WebPlaybackControlsManager
1293         https://bugs.webkit.org/show_bug.cgi?id=171328
1294         <rdar://problem/29875010>
1295
1296         Reviewed by Jer Noble.
1297
1298         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
1299         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
1300         (WebKit::WebPlaybackSessionModelContext::togglePictureInPicture): Added. Calls
1301         WebPlaybackSessionManagerProxy::togglePictureAndPicture().
1302         (WebKit::WebPlaybackSessionManagerProxy::togglePictureInPicture): Added. Sends
1303         TogglePictureInPicture to WebPlaybackSessionManager.
1304         * UIProcess/Cocoa/WebViewImpl.mm:
1305         (WebKit::WebViewImpl::updateMediaTouchBar): Called
1306         -[WebPlaybackControlsManager setAllowsPictureInPicturePlayback:YES] if
1307         WebPreferences::allowsPictureInPictureMediaPlayback() is true.
1308         * WebProcess/cocoa/WebPlaybackSessionManager.h:
1309         * WebProcess/cocoa/WebPlaybackSessionManager.messages.in:
1310         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
1311         (WebKit::WebPlaybackSessionManager::togglePictureInPicture): Added. Sets a
1312         UserGestureIndicator and calls WebPlaybackSessionModel::togglePictureInPicture().
1313
1314 2017-04-26  Tim Horton  <timothy_horton@apple.com>
1315
1316         WebKit calls AppKit NSCell API from a background queue
1317         https://bugs.webkit.org/show_bug.cgi?id=171318
1318         <rdar://problem/31798317>
1319
1320         Reviewed by Anders Carlsson.
1321
1322         * UIProcess/mac/ServicesController.mm:
1323         (WebKit::ServicesController::refreshExistingServices):
1324         Synchronously bounce to the main thread to do non-thread-safe NSCell related work.
1325
1326 2017-04-25  Alex Christensen  <achristensen@webkit.org>
1327
1328         Encoded filename should be decoded for WKContentExtension.identifier
1329         https://bugs.webkit.org/show_bug.cgi?id=171316
1330
1331         Reviewed by Andy Estes.
1332
1333         * UIProcess/API/APIContentExtensionStore.cpp:
1334         (API::createExtension):
1335         (API::ContentExtensionStore::lookupContentExtension):
1336         (API::ContentExtensionStore::getAvailableContentExtensionIdentifiers):
1337
1338 2017-04-26  Andrew Gold  <agold@apple.com>
1339
1340         Move mediaCaptureEnabled from WKWebViewConfiguration to WKPreferences
1341         https://bugs.webkit.org/show_bug.cgi?id=171294
1342
1343         Reviewed by Eric Carlson.
1344
1345         Since we now want the ability to toggle this setting dynamically, I have
1346         moved it from WKWebViewConfiguration to WKPreferences.
1347
1348         * UIProcess/API/Cocoa/WKPreferences.mm:
1349         (-[WKPreferences _mediaStreamEnabled]):
1350         (-[WKPreferences _setMediaStreamEnabled:]):
1351
1352         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1353         * UIProcess/API/Cocoa/WKWebView.mm:
1354         (-[WKWebView _initializeWithConfiguration:]): No longer set mediaStream enabled from
1355         the configuration.
1356
1357         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1358         (-[WKWebViewConfiguration copyWithZone:]):
1359         (-[WKWebViewConfiguration _mediaStreamEnabled]): Deleted.
1360         (-[WKWebViewConfiguration _setMediaStreamEnabled:]): Deleted.
1361         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1362
1363 2017-04-25  Alex Christensen  <achristensen@webkit.org>
1364
1365         REGRESSION(206450): WebKit2PlatformMouseEvent m_modifierFlags not set
1366         https://bugs.webkit.org/show_bug.cgi?id=171297
1367         <rdar://problem/31530719>
1368
1369         Reviewed by Geoffrey Garen.
1370
1371         * Shared/WebEventConversion.cpp:
1372         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
1373
1374 2017-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
1375
1376         Unreviewed, speculative build fix
1377
1378         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1379
1380         For the time being, remove all references to UIItemProviders from this private header.
1381         This should be fixed to use unavailability macros in a followup. See <rdar://problem/31827095>.
1382
1383 2017-04-25  Brent Fulgham  <bfulgham@apple.com>
1384
1385         Limit allowed size of document.title to avoid locking WebKit clients
1386         https://bugs.webkit.org/show_bug.cgi?id=165113
1387         <rdar://problem/28324389>
1388
1389         Reviewed by Darin Adler.
1390
1391         When a web application attempts to set an extremely long title, truncate the
1392         title to a more reasonable size.
1393
1394         We do this at at the presentation layer, rather than in the DOM, so that we do
1395         not affect script function. Instead, we merely limit display to a level that is
1396         reasonable for normal GUI widgets. Anything else needs to be truncated in the UI
1397         layer, so it is a waste of effort to send across IPC.
1398
1399         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1400         (WebKit::WebFrameLoaderClient::dispatchDidReceiveTitle):
1401         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1402
1403 2017-04-25  John Wilander  <wilander@apple.com>
1404
1405         Resource Load Statistics: Introduce shorter time-to-live for cookie partition whitelisting
1406         https://bugs.webkit.org/show_bug.cgi?id=171295
1407         <rdar://problem/31823818>
1408
1409         Reviewed by Brent Fulgham.
1410
1411         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
1412         (WKResourceLoadStatisticsManagerSetTimeToLiveCookiePartitionFree):
1413         (WKResourceLoadStatisticsManagerFireShouldPartitionCookiesHandler):
1414         (WKResourceLoadStatisticsManagerFireShouldPartitionCookiesHandlerForOneDomain):
1415             Changes and additions to test infrastructure.
1416         * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
1417         * UIProcess/WebResourceLoadStatisticsManager.cpp:
1418         (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveCookiePartitionFree):
1419         (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler):
1420         (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandlerForOneDomain):
1421         (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState):
1422             Changes and additions to test infrastructure.
1423         * UIProcess/WebResourceLoadStatisticsManager.h:
1424         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1425         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
1426             No longer sends a boolean parameter to
1427             WebCore::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
1428
1429 2017-04-25  Simon Fraser  <simon.fraser@apple.com>
1430
1431         REGRESSION (r213719): WebGL content on cubeslam.com is 1/4 expected size
1432         https://bugs.webkit.org/show_bug.cgi?id=171300
1433         rdar://problem/31051538
1434
1435         Reviewed by Dean Jackson.
1436
1437         Propagating the contentsScale to the UI process for canvas content layers causes
1438         scaling issues, so don't do it for contents-provided layers.
1439         
1440         No test because WebGL can't be tested in the iOS simulator.
1441
1442         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1443         (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
1444
1445 2017-04-25  Brady Eidson  <beidson@apple.com>
1446
1447         Update WebProcess(Pool) to assume there's always a WebsiteDataStore
1448         https://bugs.webkit.org/show_bug.cgi?id=171299
1449
1450         Reviewed by Alex Christensen.
1451
1452         * UIProcess/WebPageProxy.cpp:
1453         (WebKit::WebPageProxy::reattachToWebProcess):
1454         * UIProcess/WebProcessPool.cpp:
1455         (WebKit::WebProcessPool::createNewWebProcess):
1456         (WebKit::WebProcessPool::warmInitialProcess):
1457         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
1458         (WebKit::WebProcessPool::createWebPage):
1459         * UIProcess/WebProcessPool.h:
1460         * UIProcess/WebProcessProxy.cpp:
1461         (WebKit::WebProcessProxy::create):
1462         (WebKit::WebProcessProxy::WebProcessProxy):
1463         (WebKit::m_userMediaCaptureManagerProxy):
1464         * UIProcess/WebProcessProxy.h:
1465         (WebKit::WebProcessProxy::websiteDataStore):
1466
1467 2017-04-25  Ryan Haddad  <ryanhaddad@apple.com>
1468
1469         Unreviewed, rolling out r215730.
1470
1471         The LayoutTest for this change is a flaky timeout on mac-wk1
1472         debug.
1473
1474         Reverted changeset:
1475
1476         "Enable expired-only reload policy on Mac and iOS"
1477         https://bugs.webkit.org/show_bug.cgi?id=171264
1478         http://trac.webkit.org/changeset/215730
1479
1480 2017-04-24  Matt Rajca  <mrajca@apple.com>
1481
1482         Indicate presence of audio when handling autoplay events.
1483         https://bugs.webkit.org/show_bug.cgi?id=171227
1484
1485         Reviewed by Alex Christensen.
1486
1487         * UIProcess/API/APIUIClient.h:
1488         (API::UIClient::handleAutoplayEvent):
1489         * UIProcess/API/C/WKPage.cpp:
1490         (WKPageSetPageUIClient):
1491         * UIProcess/API/C/WKPageUIClient.h:
1492         * UIProcess/WebPageProxy.cpp:
1493         (WebKit::WebPageProxy::handleAutoplayEvent):
1494         * UIProcess/WebPageProxy.h:
1495         * UIProcess/WebPageProxy.messages.in:
1496         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1497         (WebKit::WebChromeClient::handleAutoplayEvent):
1498         * WebProcess/WebCoreSupport/WebChromeClient.h:
1499
1500 2017-04-25  Daniel Bates  <dabates@apple.com>
1501
1502         [Cocoa][Win] Enable of X-Content-Type-Options: nosniff header
1503         https://bugs.webkit.org/show_bug.cgi?id=136452
1504         <rdar://problem/23412620>
1505
1506         Reviewed by Brent Fulgham.
1507
1508         Enable X-Content-Type-Options: nosniff on Mac, iOS and Windows platforms.
1509
1510         * Configurations/FeatureDefines.xcconfig:
1511
1512 2017-04-25  John Wilander  <wilander@apple.com>
1513
1514         Resource Load Statistics: Clear network process cache when clearing store
1515         https://bugs.webkit.org/show_bug.cgi?id=171256
1516         <rdar://problem/31802347>
1517
1518         Reviewed by Brent Fulgham.
1519
1520         * NetworkProcess/NetworkProcess.cpp:
1521         (WebKit::NetworkProcess::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
1522             Now takes and passes on the boolean parameter clearFirst to
1523             WebCore::NetworkStorageSession::setShouldPartitionCookiesForHosts().
1524         * NetworkProcess/NetworkProcess.h:
1525         * NetworkProcess/NetworkProcess.messages.in:
1526             The message ShouldPartitionCookiesForTopPrivatelyOwnedDomains now
1527             takes the boolean parameter clearFirst.
1528         * UIProcess/Network/NetworkProcessProxy.cpp:
1529         (WebKit::NetworkProcessProxy::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
1530             Now takes and passes on the boolean parameter clearFirst to
1531             Messages::NetworkProcess::ShouldPartitionCookiesForTopPrivatelyOwnedDomains.
1532         * UIProcess/Network/NetworkProcessProxy.h:
1533         * UIProcess/Network/NetworkProcessProxy.messages.in:
1534             The message ShouldPartitionCookiesForTopPrivatelyOwnedDomains now
1535             takes the boolean parameter clearFirst.
1536         * UIProcess/WebResourceLoadStatisticsManager.cpp:
1537         (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler):
1538             Now uses the boolean parameter clearFirst when calling
1539             WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler().
1540         (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore):
1541             No longer uses the deleted store getter.
1542         (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState):
1543             No longer uses the deleted store getter.
1544         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1545         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
1546             No sends the boolean parameter clearFirst to
1547             ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
1548         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
1549             Now expects a handler with the boolean parameter clearFirst.
1550         (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
1551         * UIProcess/WebResourceLoadStatisticsStore.h:
1552             Now uses the new WebCore::ResourceLoadObserver::clearInMemoryStore().
1553         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1554         (WebKit::WebsiteDataStore::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
1555             Now takes and passes on the boolean parameter clearFirst in its
1556             message to the network process.
1557         (WebKit::WebsiteDataStore::registerSharedResourceLoadObserver):
1558             Now expects a handler with the boolean parameter clearFirst.
1559         * UIProcess/WebsiteData/WebsiteDataStore.h:
1560
1561 2017-04-25  Chris Dumez  <cdumez@apple.com>
1562
1563         Content-Disposition header filename is ignored when 'download' attribute is specified in HTML
1564         https://bugs.webkit.org/show_bug.cgi?id=171239
1565         <rdar://problem/31789855>
1566
1567         Reviewed by Alex Christensen.
1568
1569         Content-Disposition header filename is ignored when 'download' attribute is specified in HTML.
1570         This is not as per HTML specification:
1571         - https://html.spec.whatwg.org/#as-a-download (Step 2)
1572
1573         Content-Disposition header filename is supposed to override the value of the download attribute.
1574
1575         Firefox and Chrome follow the specification.
1576
1577         * NetworkProcess/NetworkProcess.cpp:
1578         (WebKit::NetworkProcess::findPendingDownloadLocation):
1579         * UIProcess/Downloads/DownloadProxy.cpp:
1580         (WebKit::DownloadProxy::didReceiveResponse):
1581
1582 2017-04-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1583
1584         [GTK] Add WebKitInspectorWindow to create inspector windows from local and remote inspector
1585         https://bugs.webkit.org/show_bug.cgi?id=171261
1586
1587         Reviewed by Michael Catanzaro.
1588
1589         The code is currently duplicated in WebInspectorProxyGtk.cpp and RemoteWebInspectorProxyGtk.cpp. We can simplify
1590         it by using a common widget in both places.
1591         This patch also fixes the build when using GTK+ < 3.16.
1592
1593         * PlatformGTK.cmake:
1594         * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp:
1595         (WebKit::RemoteWebInspectorProxy::updateWindowTitle):
1596         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
1597         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
1598         (WebKit::WebInspectorProxy::createInspectorWindow):
1599         (WebKit::WebInspectorProxy::updateInspectorWindowTitle):
1600         * UIProcess/gtk/WebKitInspectorWindow.cpp: Added.
1601         (webkit_inspector_window_class_init):
1602         (webkit_inspector_window_init):
1603         (webkitInspectorWindowNew):
1604         (webkitInspectorWindowSetSubtitle):
1605         * UIProcess/gtk/WebKitInspectorWindow.h: Added.
1606
1607 2017-04-25  Antti Koivisto  <antti@apple.com>
1608
1609         Enable expired-only reload policy on Mac and iOS
1610         https://bugs.webkit.org/show_bug.cgi?id=171264
1611         <rdar://problem/31807637>
1612
1613         Reviewed by Andreas Kling.
1614
1615         Enable the reload policy where only expired subresources are revalidated on Mac and iOS.
1616         The behavor is enabled in Safari and for other clients based on SDK version check.
1617
1618         * UIProcess/API/C/WKPage.cpp:
1619         (WKPageReload):
1620         * UIProcess/API/Cocoa/WKWebView.mm:
1621         (-[WKWebView reload]):
1622         * UIProcess/Cocoa/VersionChecks.h:
1623
1624 2017-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
1625
1626         Support reading NSURL titles from the pasteboard when performing data interaction
1627         https://bugs.webkit.org/show_bug.cgi?id=171156
1628         <rdar://problem/31356937>
1629
1630         Reviewed by Tim Horton.
1631
1632         Adjust for interface changes in WebCore to support plumbing the title of an NSURL from the platform pasteboard
1633         back to WebCore. Additionally, implement WebEditorClient::hasRichlyEditableSelection (which previously returned
1634         false) to check whether the current selection is richly editable, or the drop caret is in richly editable content.
1635         See WebCore ChangeLog for more details.
1636
1637         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1638         (WebKit::WebPasteboardProxy::readURLFromPasteboard):
1639         * UIProcess/WebPasteboardProxy.h:
1640         * UIProcess/WebPasteboardProxy.messages.in:
1641         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1642         (WebKit::WebPlatformStrategies::readURLFromPasteboard):
1643         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1644         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
1645         (WebKit::WebEditorClient::hasRichlyEditableSelection):
1646         * WebProcess/WebPage/WebPage.cpp:
1647         (WebKit::WebPage::hasRichlyEditableSelection):
1648         * WebProcess/WebPage/WebPage.h:
1649
1650 2017-04-24  Wenson Hsieh  <wenson_hsieh@apple.com>
1651
1652         Respect fidelity order when reading web content from item providers
1653         https://bugs.webkit.org/show_bug.cgi?id=171155
1654         <rdar://problem/31356937>
1655
1656         Reviewed by Tim Horton.
1657
1658         Adjusts for changes in WebCore by adding plumbing to support Pasteboard::getTypesByFidelityForItemAtIndex. See
1659         WebCore/ChangeLog for more details.
1660
1661         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1662         (WebKit::WebPasteboardProxy::getPasteboardTypesByFidelityForItemAtIndex):
1663         * UIProcess/WebPasteboardProxy.h:
1664         * UIProcess/WebPasteboardProxy.messages.in:
1665         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1666         (WebKit::WebPlatformStrategies::getTypesByFidelityForItemAtIndex):
1667         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1668
1669 2017-04-24  Brady Eidson  <beidson@apple.com>
1670
1671         WebProcessPools should always have a WebsiteDataStore
1672         https://bugs.webkit.org/show_bug.cgi?id=171252
1673
1674         Reviewed by Alex Christensen.
1675
1676         * UIProcess/API/APIWebsiteDataStore.cpp:
1677         (API::WebsiteDataStore::registerSharedResourceLoadObserver): Deleted.
1678         * UIProcess/API/APIWebsiteDataStore.h:
1679         * UIProcess/API/C/WKContext.cpp:
1680         (WKContextGetWebsiteDataStore):
1681         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1682         (WebKit::WebProcessPool::platformInitialize):
1683         * UIProcess/WebProcessPool.cpp:
1684         (WebKit::WebProcessPool::WebProcessPool):
1685         (WebKit::WebProcessPool::createWebPage):
1686         * UIProcess/WebProcessPool.h:
1687         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1688         (WebKit::WebsiteDataStore::isAssociatedProcessPool):
1689
1690 2017-04-24  Youenn Fablet  <youenn@apple.com>
1691
1692         Set defaults video getUserMedia constraints
1693         https://bugs.webkit.org/show_bug.cgi?id=171127
1694
1695         Reviewed by Eric Carlson.
1696
1697         Updated to cope with MediaStreamConstraintsImpl refactoring.
1698
1699         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
1700         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
1701         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1702         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1703
1704 2017-04-24  Chris Dumez  <cdumez@apple.com>
1705
1706         Allow tabs with capturing audio or video to exceed background CPU limit
1707         https://bugs.webkit.org/show_bug.cgi?id=171249
1708         <rdar://problem/31796314>
1709
1710         Reviewed by Geoffrey Garen.
1711
1712         Allow tabs with capturing audio or video to exceed background CPU limit as this
1713         is a legit case of potentially high background CPU use.
1714
1715         * UIProcess/WebProcessProxy.cpp:
1716         (WebKit::WebProcessProxy::didExceedBackgroundCPULimit):
1717
1718 2017-04-24  Andy Estes  <aestes@apple.com>
1719
1720         Try to fix the 32-bit macOS build.
1721
1722         * UIProcess/Cocoa/WebViewImpl.mm:
1723
1724 2017-04-24  Andy Estes  <aestes@apple.com>
1725
1726         [macOS] Enable media selection button on AVTouchBarScrubber
1727         https://bugs.webkit.org/show_bug.cgi?id=171149
1728         <rdar://problem/29875010>
1729
1730         Reviewed by Beth Dakin.
1731
1732         * UIProcess/Cocoa/WebViewImpl.mm:
1733         (WebKit::WebViewImpl::updateMediaTouchBar):
1734
1735 2017-04-24  Alex Christensen  <achristensen@webkit.org>
1736
1737         Reduce copies and allocations in SharedBuffer::append
1738         https://bugs.webkit.org/show_bug.cgi?id=170956
1739
1740         Reviewed by Andreas Kling.
1741
1742         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1743         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
1744         * Platform/IPC/DataReference.cpp:
1745         (IPC::SharedBufferDataReference::encode):
1746         * Shared/ShareableResource.cpp:
1747         (WebKit::ShareableResource::wrapInSharedBuffer):
1748         * UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm:
1749         (-[WKURLSchemeHandlerTaskImpl didReceiveData:]):
1750         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1751         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
1752         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1753         (WebKit::PDFPlugin::addArchiveResource):
1754         (WebKit::PDFPlugin::liveResourceData):
1755         (WebKit::PDFPlugin::writeItemsToPasteboard):
1756         * WebProcess/Plugins/PluginView.cpp:
1757         (WebKit::PluginView::redeliverManualStream):
1758         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1759         (WebKit::WebDragClient::declareAndWriteDragImage):
1760         * WebProcess/WebPage/mac/WebPageMac.mm:
1761         (WebKit::WebPage::cachedResponseDataForURL):
1762
1763 2017-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1764
1765         [GTK] Switch to use ENABLE_REMOTE_INSPECTOR instead of ENABLE_INSPECTOR_SERVER for the remote inspector
1766         https://bugs.webkit.org/show_bug.cgi?id=166680
1767
1768         Reviewed by Michael Catanzaro.
1769
1770         Remove INSPECTOR_SERVER code and add new classes to implement REMOTE_INSPECTOR. The WebKitWebContext registers a
1771         custom protocol "inspector" that loads a page with the list of debuggable targets.
1772
1773         * PlatformGTK.cmake: Add new files to compilation and remove the old ones.
1774         * UIProcess/API/gtk/WebKit2InspectorGResourceBundle.xml: Removed.
1775         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp: Added.
1776         (WebKit::RemoteInspectorProtocolHandler::RemoteInspectorProtocolHandler):
1777         (WebKit::RemoteInspectorProtocolHandler::~RemoteInspectorProtocolHandler):
1778         (WebKit::RemoteInspectorProtocolHandler::webViewDestroyed):
1779         (WebKit::RemoteInspectorProtocolHandler::userContentManagerDestroyed):
1780         (WebKit::RemoteInspectorProtocolHandler::handleRequest):
1781         (WebKit::RemoteInspectorProtocolHandler::inspect):
1782         (WebKit::RemoteInspectorProtocolHandler::targetListChanged):
1783         (WebKit::RemoteInspectorProtocolHandler::connectionClosed):
1784         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.h: Added.
1785         * UIProcess/API/gtk/WebKitWebContext.cpp:
1786         (webkitWebContextConstructed):
1787         * UIProcess/InspectorServer/HTTPRequest.cpp: Add missing ENABLE(INSPECTOR_SERVER) ifdefs.
1788         * UIProcess/InspectorServer/HTTPRequest.h:
1789         * UIProcess/InspectorServer/WebInspectorServer.h:
1790         * UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp: Removed.
1791         * UIProcess/RemoteWebInspectorProxy.cpp:
1792         * UIProcess/RemoteWebInspectorProxy.h:
1793         * UIProcess/WebProcessPool.cpp:
1794         * UIProcess/glib/RemoteInspectorClient.cpp: Added.
1795         (WebKit::RemoteInspectorClient::RemoteInspectorClient):
1796         (WebKit::RemoteInspectorClient::~RemoteInspectorClient):
1797         (WebKit::dbusConnectionCallAsyncReadyCallback):
1798         (WebKit::RemoteInspectorClient::connectionClosedCallback):
1799         (WebKit::RemoteInspectorClient::setupConnection):
1800         (WebKit::RemoteInspectorClient::connectionClosed):
1801         (WebKit::RemoteInspectorClient::inspect):
1802         (WebKit::RemoteInspectorClient::sendMessageToBackend):
1803         (WebKit::RemoteInspectorClient::closeFromFrontend):
1804         (WebKit::RemoteInspectorClient::setTargetList):
1805         (WebKit::RemoteInspectorClient::sendMessageToFrontend):
1806         * UIProcess/glib/RemoteInspectorClient.h: Added.
1807         (WebKit::RemoteInspectorObserver::~RemoteInspectorObserver):
1808         (WebKit::RemoteInspectorClient::targets):
1809         (WebKit::RemoteInspectorClient::hostAndPort):
1810         * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp: Added.
1811         (WebKit::RemoteWebInspectorProxy::updateWindowTitle):
1812         (WebKit::inspectorViewDestroyed):
1813         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
1814         (WebKit::RemoteWebInspectorProxy::platformCloseFrontendPageAndWindow):
1815         (WebKit::RemoteWebInspectorProxy::platformBringToFront):
1816         (WebKit::RemoteWebInspectorProxy::platformSave):
1817         (WebKit::RemoteWebInspectorProxy::platformAppend):
1818         (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag):
1819         (WebKit::RemoteWebInspectorProxy::platformOpenInNewTab):
1820         * UIProcess/gtk/WebProcessPoolGtk.cpp:
1821         (WebKit::initializeRemoteInspectorServer):
1822         (WebKit::WebProcessPool::platformInitialize):
1823         (WebKit::WebProcessPool::platformInitializeWebProcess):
1824         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
1825         (didReceiveMessageToPage): Updated after the GRefPtr hash traitds changes.
1826         * config.h:
1827
1828 2017-04-23  Dan Bernstein  <mitz@apple.com>
1829
1830         [macOS] WKWebInspectorProxyObjCAdapter has a public ivar
1831         https://bugs.webkit.org/show_bug.cgi?id=171200
1832
1833         Reviewed by Geoffrey Garen.
1834
1835         * UIProcess/API/C/mac/WKInspectorPrivateMac.h: Made ivar private.
1836
1837 2017-04-23  Commit Queue  <commit-queue@webkit.org>
1838
1839         Unreviewed, rolling out r215657 and r215676.
1840         https://bugs.webkit.org/show_bug.cgi?id=171201
1841
1842         Broke the build (Requested by ap on #webkit).
1843
1844         Reverted changesets:
1845
1846         "[macOS] Enable media selection button on AVTouchBarScrubber"
1847         https://bugs.webkit.org/show_bug.cgi?id=171149
1848         http://trac.webkit.org/changeset/215657
1849
1850         "Build fix after r215657."
1851         http://trac.webkit.org/changeset/215676
1852
1853 2017-04-23  Alexey Proskuryakov  <ap@apple.com>
1854
1855         Build fix after r215657.
1856
1857         * UIProcess/Cocoa/WebViewImpl.mm:
1858
1859 2017-04-23  Andy Estes  <aestes@apple.com>
1860
1861         [macOS] AVTouchBarMediaSelectionOptions should be created with the correct type
1862         https://bugs.webkit.org/show_bug.cgi?id=171192
1863         <rdar://problem/29875010>
1864
1865         Reviewed by Wenson Hsieh.
1866
1867         * Shared/WebCoreArgumentCoders.cpp:
1868         (IPC::ArgumentCoder<MediaSelectionOption>::encode):
1869         (IPC::ArgumentCoder<MediaSelectionOption>::decode):
1870         * Shared/WebCoreArgumentCoders.h:
1871         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
1872         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in:
1873         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
1874         (WebKit::WebPlaybackSessionModelContext::setAudioMediaSelectionOptions):
1875         (WebKit::WebPlaybackSessionModelContext::setLegibleMediaSelectionOptions):
1876         (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionOptions):
1877         (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionOptions):
1878         * WebProcess/cocoa/WebPlaybackSessionManager.h:
1879         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
1880         (WebKit::WebPlaybackSessionInterfaceContext::audioMediaSelectionOptionsChanged):
1881         (WebKit::WebPlaybackSessionInterfaceContext::legibleMediaSelectionOptionsChanged):
1882         (WebKit::WebPlaybackSessionManager::audioMediaSelectionOptionsChanged):
1883         (WebKit::WebPlaybackSessionManager::legibleMediaSelectionOptionsChanged):
1884
1885 2017-04-21  Wenson Hsieh  <wenson_hsieh@apple.com>
1886
1887         Support writing link titles to the pasteboard when beginning data interaction on a link
1888         https://bugs.webkit.org/show_bug.cgi?id=171154
1889         <rdar://problem/31356937>
1890
1891         Reviewed by Andy Estes.
1892
1893         Adds support for setting the _title attribute of NSURLs written to the pasteboard. See WebCore ChangeLog for more details.
1894
1895         * Scripts/webkit/messages.py:
1896         (headers_for_type):
1897         * Shared/WebCoreArgumentCoders.cpp:
1898         (IPC::ArgumentCoder<PasteboardURL>::encode):
1899         (IPC::ArgumentCoder<PasteboardURL>::decode):
1900         * Shared/WebCoreArgumentCoders.h:
1901
1902         Teach PasteboardURL to be serialized in IPC. For now, we just send across the absolute string of the link and
1903         its title.
1904
1905         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1906         (WebKit::WebPasteboardProxy::writeURLToPasteboard):
1907         * UIProcess/WebPasteboardProxy.h:
1908         * UIProcess/WebPasteboardProxy.messages.in:
1909
1910         Add IPC plumbing for writing PasteboarURLs to the pasteboard.
1911
1912         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1913         (WebKit::WebPlatformStrategies::writeToPasteboard):
1914         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1915
1916 2017-04-21  Michael Catanzaro  <mcatanzaro@igalia.com>
1917
1918         Unreviewed, rolling out r215608.
1919
1920         Hundreds of test failures on GTK bot
1921
1922         Reverted changeset:
1923
1924         "Reduce copies and allocations in SharedBuffer::append"
1925         https://bugs.webkit.org/show_bug.cgi?id=170956
1926         http://trac.webkit.org/changeset/215608
1927
1928 2017-04-21  Andy Estes  <aestes@apple.com>
1929
1930         [macOS] Enable media selection button on AVTouchBarScrubber
1931         https://bugs.webkit.org/show_bug.cgi?id=171149
1932         <rdar://problem/29875010>
1933
1934         Reviewed by Beth Dakin.
1935
1936         * UIProcess/Cocoa/WebViewImpl.mm:
1937         (WebKit::WebViewImpl::updateMediaTouchBar):
1938
1939 2017-04-21  Wenson Hsieh  <wenson_hsieh@apple.com>
1940
1941         [WK2] Add delegate hooks for overriding unhanded data interaction operations
1942         https://bugs.webkit.org/show_bug.cgi?id=171005
1943         <rdar://problem/31669646>
1944
1945         Reviewed by Tim Horton.
1946
1947         Adds support for overriding data interaction operations through two new delegate methods:
1948         _webView:willUpdateDataInteractionOperationToOperation:forSession:, and
1949         _webView:dataInteractionOperationWasHandled:forSession:. The former may be overridden to return a different
1950         operation type than what WebKit would originally have returned, and the latter may be overridden to run custom
1951         logic after the web process has handled a data interaction operation.
1952
1953         Additionally, includes some minor cleanup around WKContentViewInteraction. With the new
1954         _webView:dataInteractionOperationWasHandled:forSession: delegate method, the last method on _WKTestingDelegate
1955         may be removed. This means _WKTestingDelegate is no longer needed, so this patch removes its header entirely.
1956         Also, relocates some state variables formerly on WKContentView to WKContentView's WKDataInteractionState struct
1957         instead, so that all state associated with data interaction may be cleaned up at the same time.
1958
1959         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1960         * UIProcess/API/Cocoa/WKWebView.mm:
1961         (-[WKWebView _testingDelegate]): Deleted.
1962         (-[WKWebView _setTestingDelegate:]): Deleted.
1963         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1964         * UIProcess/API/Cocoa/_WKTestingDelegate.h: Removed.
1965         * UIProcess/PageClient.h:
1966         * UIProcess/WebPageProxy.h:
1967         * UIProcess/WebPageProxy.messages.in:
1968
1969         Add a new "handled" IPC argument to DidPerformDataInteractionControllerOperation. This lets the UI process
1970         know whether or not the data interaction operation was handled by the web process, and is eventually plumbed
1971         through to the UI delegate via the new SPI.
1972
1973         * UIProcess/ios/PageClientImplIOS.h:
1974         * UIProcess/ios/PageClientImplIOS.mm:
1975         (WebKit::PageClientImpl::didPerformDataInteractionControllerOperation):
1976         * UIProcess/ios/WKContentViewInteraction.h:
1977         * UIProcess/ios/WKContentViewInteraction.mm:
1978         (-[WKContentView cleanupInteraction]):
1979         (-[WKContentView _displayFormNodeInputView]):
1980         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
1981         * UIProcess/ios/WebPageProxyIOS.mm:
1982         (WebKit::WebPageProxy::didPerformDataInteractionControllerOperation):
1983         * WebKit2.xcodeproj/project.pbxproj:
1984         * WebProcess/WebPage/WebPage.cpp:
1985         (WebKit::WebPage::performDragControllerAction):
1986
1987 2017-04-21  Anders Carlsson  <andersca@apple.com>
1988
1989         Stop using deprecated APIs, part 5
1990         https://bugs.webkit.org/show_bug.cgi?id=171134
1991         rdar://problem/31589635
1992
1993         Reviewed by Tim Horton.
1994
1995         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1996         (WebKit::toPKPaymentAuthorizationStatus):
1997         Remove this and add a new version that doesn't use any deprecated values.
1998
1999         (WebKit::toPKPaymentAuthorizationStatus):
2000         New function that takes a WebCore::PaymentAuthorizationResult and converts it to a status, for older OSes.
2001
2002         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
2003         Use the new toPKPaymentAuthorizationStatus versions.
2004
2005         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
2006         Ditto.
2007
2008         (WebKit::status): Deleted.
2009
2010 2017-04-21  David Kilzer  <ddkilzer@apple.com>
2011
2012         Switch from -std=gnu++11 to -std=gnu++14 for consistency in DerivedSources.make
2013         <https://webkit.org/b/171122>
2014
2015         Reviewed by Brent Fulgham.
2016
2017         * DerivedSources.make: Switch to -std=gnu++14 for preprocessing
2018         headers to check for build settings.
2019
2020 2017-04-21  Jer Noble  <jer.noble@apple.com>
2021
2022         [WK2][MediaCapture] Pass muted and enabled state across process boundary when capturing in UIProcess
2023         https://bugs.webkit.org/show_bug.cgi?id=170846
2024
2025         Reviewed by Jon Lee.
2026
2027         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2028         (WebKit::UserMediaCaptureManagerProxy::setMuted):
2029         (WebKit::UserMediaCaptureManagerProxy::setEnabled):
2030         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
2031         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
2032         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2033         (WebKit::UserMediaCaptureManager::Source::setMuted):
2034         (WebKit::UserMediaCaptureManager::Source::setEnabled):
2035         (WebKit::UserMediaCaptureManager::setMuted):
2036         (WebKit::UserMediaCaptureManager::setEnabled):
2037         * WebProcess/cocoa/UserMediaCaptureManager.h:
2038
2039 2017-04-21  Jer Noble  <jer.noble@apple.com>
2040
2041         [WK2][MediaCapture] Remove now-unused WKWebViewConfiguration property for shouldCaptureAudioInUIProcess
2042         https://bugs.webkit.org/show_bug.cgi?id=170847
2043
2044         Reviewed by Jon Lee.
2045
2046         * Shared/WebPreferencesDefinitions.h:
2047         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2048         (-[WKWebViewConfiguration copyWithZone:]):
2049         (-[WKWebViewConfiguration _shouldCaptureAudioInUIProcess]): Deleted.
2050         (-[WKWebViewConfiguration _setShouldCaptureAudioInUIProcess:]): Deleted.
2051
2052 2017-04-21  Anders Carlsson  <andersca@apple.com>
2053
2054         Stop using deprecated APIs, part 4
2055         https://bugs.webkit.org/show_bug.cgi?id=171125
2056         rdar://problem/31589635
2057
2058         Reviewed by Tim Horton.
2059
2060         It doesn't really matter what we pass to these completion functions, since the sheet has already been dismissed at this point
2061         so just remove the status parameter.
2062
2063         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2064         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]):
2065         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]):
2066         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]):
2067
2068 2017-04-21  Andrew Gold  <agold@apple.com>
2069
2070         -[WKUIDelegatePrivate _webView:requestUserMediaAuthorizationForMicrophone:camera:url:mainFrameURL:decisionHandler:] 
2071         decision handler should only have one parameter.
2072         https://bugs.webkit.org/show_bug.cgi?id=171081
2073
2074         Reviewed by Tim Horton.
2075
2076         Because user media authorization is all or nothing, we should not have separate booleans
2077         to indicate authorization. Additionally, rather than passing two separate booleans to the
2078         UIDelegate, we now pass an NS_OPTIONS parameter.
2079
2080         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2081         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Added _WKCaptureDevice NS_OPTIONS.
2082
2083         * UIProcess/Cocoa/UIDelegate.mm:
2084         * UIProcess/Cocoa/UIDelegate.mm:
2085         (WebKit::UIDelegate::setDelegate): Uses new WKUIDelegatePrivate method.
2086         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Ditto.
2087
2088 2017-04-21  Konstantin Tokarev  <annulen@yandex.ru>
2089
2090         Unreviewed, added missing file to PlatformMac.cmake
2091
2092         * PlatformMac.cmake:
2093
2094 2017-04-21  Konstantin Tokarev  <annulen@yandex.ru>
2095
2096         Unreviewed follow-up for r215609
2097
2098         * UIProcess/API/Cocoa/WKWebView.mm: Move internal header include too.
2099
2100 2017-04-21  Konstantin Tokarev  <annulen@yandex.ru>
2101
2102         Include iOS-specific headers inside preprocessor guard
2103         https://bugs.webkit.org/show_bug.cgi?id=171104
2104
2105         Reviewed by Michael Catanzaro.
2106
2107         This patch should fix Mac cmake build.
2108
2109         * UIProcess/API/Cocoa/WKWebView.mm:
2110
2111 2017-04-21  Alex Christensen  <achristensen@webkit.org>
2112
2113         Reduce copies and allocations in SharedBuffer::append
2114         https://bugs.webkit.org/show_bug.cgi?id=170956
2115
2116         Reviewed by Andreas Kling.
2117
2118         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2119         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
2120         * Platform/IPC/DataReference.cpp:
2121         (IPC::SharedBufferDataReference::encode):
2122         * Shared/ShareableResource.cpp:
2123         (WebKit::ShareableResource::wrapInSharedBuffer):
2124         * UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm:
2125         (-[WKURLSchemeHandlerTaskImpl didReceiveData:]):
2126         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2127         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
2128         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2129         (WebKit::PDFPlugin::addArchiveResource):
2130         (WebKit::PDFPlugin::liveResourceData):
2131         (WebKit::PDFPlugin::writeItemsToPasteboard):
2132         * WebProcess/Plugins/PluginView.cpp:
2133         (WebKit::PluginView::redeliverManualStream):
2134         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2135         (WebKit::WebDragClient::declareAndWriteDragImage):
2136         * WebProcess/WebPage/mac/WebPageMac.mm:
2137         (WebKit::WebPage::cachedResponseDataForURL):
2138
2139 2017-04-20  Konstantin Tokarev  <annulen@yandex.ru>
2140
2141         [cmake] Define FORWARDING_HEADERS_DIR in WebKitFS and use it everywhere
2142         https://bugs.webkit.org/show_bug.cgi?id=171071
2143
2144         Reviewed by Michael Catanzaro.
2145
2146         "${DERIVED_SOURCES_DIR}/ForwardingHeaders" path occurs very often in the
2147         build system files. GTK-specifc FORWARDING_HEADERS_DIR variable should
2148         be available for all ports.
2149
2150         * CMakeLists.txt:
2151         * PlatformMac.cmake:
2152
2153 2017-04-20  Brady Eidson  <beidson@apple.com>
2154
2155         WebContent process becomes unresponsive after returning nil from async version of -webView:createWebViewWithConfiguration:...
2156         <rdar://problem/31739023> and https://bugs.webkit.org/show_bug.cgi?id=171090
2157
2158         Reviewed by Andy Estes.
2159
2160         * UIProcess/Cocoa/UIDelegate.mm:
2161         (WebKit::UIDelegate::UIClient::createNewPageCommon): Handle the perfectly valid "nil webView" case correctly.
2162
2163 2017-04-20  Dan Bernstein  <mitz@apple.com>
2164
2165         Disable header postprocessing when building for Sierra
2166
2167         Absolutely rubber-stamped by Anders Carlsson.
2168
2169         * Configurations/WebKit.xcconfig:
2170
2171 2017-04-20  Matt Rajca  <mrajca@apple.com>
2172
2173         Cocoa: add private API for suppressing first responder changes
2174         https://bugs.webkit.org/show_bug.cgi?id=171069
2175         <rdar://problem/31658967>
2176
2177         Reviewed by Tim Horton.
2178
2179         Some clients may not want the web view to be programmatically made the first responder
2180         and invoking -makeFirstResponder: unconditionally posts 'first responder did change'
2181         notifications.
2182
2183         Added API test.
2184
2185         * UIProcess/API/Cocoa/WKWebView.mm:
2186         (-[WKWebView _setShouldSuppressFirstResponderChanges:]):
2187         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2188         * UIProcess/Cocoa/WebViewImpl.h:
2189         * UIProcess/Cocoa/WebViewImpl.mm:
2190         (WebKit::WebViewImpl::setShouldSuppressFirstResponderChanges):
2191         * UIProcess/PageClient.h:
2192         * UIProcess/mac/PageClientImpl.h:
2193         * UIProcess/mac/PageClientImpl.mm:
2194         (WebKit::PageClientImpl::makeFirstResponder):
2195
2196 2017-04-20  Eric Carlson  <eric.carlson@apple.com>
2197
2198         [MediaStream iOS] Hold process assertion while media capture is active
2199         https://bugs.webkit.org/show_bug.cgi?id=171017
2200         <rdar://problem/31719177>
2201
2202         Reviewed by Dean Jackson.
2203
2204         * UIProcess/WebPageProxy.cpp:
2205         (WebKit::WebPageProxy::updateActivityState): Update IsCapturingMedia when necessary.
2206         (WebKit::WebPageProxy::updateThrottleState): Hold a token when capture is active.
2207         (WebKit::WebPageProxy::setMuted): Capture state may change when the page is muted,
2208         so pass IsCapturingMedia to activityStateDidChange.
2209         (WebKit::WebPageProxy::isPlayingMediaDidChange): Ditto.
2210
2211         * WebProcess/WebPage/WebPage.cpp:
2212         (WebKit::WebPage::updateThrottleState): Don't allow page suppression when capture
2213         is active. 
2214
2215 2017-04-20  Anders Carlsson  <andersca@apple.com>
2216
2217         Fix build.
2218
2219         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2220         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
2221
2222 2017-04-20  Brady Eidson  <beidson@apple.com>
2223
2224         Add CompletionHandlerCallChecker to SPI added in r215545.
2225         https://bugs.webkit.org/show_bug.cgi?id=171067
2226
2227         Reviewed by Dan Bernstein.
2228
2229         * UIProcess/Cocoa/UIDelegate.mm:
2230         (WebKit::UIDelegate::UIClient::createNewPageCommon):
2231
2232 2017-04-20  Anders Carlsson  <andersca@apple.com>
2233
2234         Replace isFinalStateStatus with isFinalStateResult
2235         https://bugs.webkit.org/show_bug.cgi?id=171072
2236         rdar://problem/31589635
2237
2238         Reviewed by Tim Horton.
2239
2240         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
2241         (WebKit::WebPaymentCoordinatorProxy::completePaymentSession):
2242
2243 2017-04-20  Wenson Hsieh  <wenson_hsieh@apple.com>
2244
2245         [WK2] -[WKContentView doAfterPositionInformationUpdate:atPosition:] should be robust against synchronous reentrancy
2246         https://bugs.webkit.org/show_bug.cgi?id=170922
2247         <rdar://problem/31634990>
2248
2249         Reviewed by Tim Horton.
2250
2251         Refactors part of the asynchronous position information mechanism introduced in
2252         <https://trac.webkit.org/changeset/215171>, and introduces infrastructure for unit testing UI-side position
2253         information requests.
2254
2255         _invokeAndRemovePendingHandlersValidForCurrentPositionInformation is a helper method on WKContentView
2256         responsible for invoking queued position information handlers after receiving a position information response
2257         from the web process. Previously, this method would iterate over the list of pending callbacks and invoke all
2258         callbacks whose requests are satisfied by the incoming position information update, saving the indices of these
2259         handled callbacks in the process. At the end, it would then remove callbacks at these indices from the array of
2260         pending callbacks. This is problematic when a synchronous position update (via
2261         ensurePositionInformationIsUpToDate:) is triggered from within one of these callbacks, since
2262         _invokeAndRemovePendingHandlersValidForCurrentPositionInformation will be called from within itself, and then we
2263         will attempt to remove a callback at the same index twice.
2264
2265         To fix this, we change the array of pending position information handlers to be an array of optionals instead.
2266         When invoking and removing pending handlers after a position information response arrives, we now mark callbacks
2267         as handled by setting them to std::nullopt. Then, when the top-level invocation to
2268         _invokeAndRemovePendingHandlersValidForCurrentPositionInformation is finished, we remove all marked handlers
2269         from the pending vector.
2270
2271         Covered by 6 new unit tests:
2272         - PositionInformationTests.FindDraggableLinkAtPosition
2273         - PositionInformationTests.RequestDraggableLinkAtPosition
2274         - PositionInformationTests.FindDraggableLinkAtDifferentPositionWithinRequestBlock
2275         - PositionInformationTests.FindDraggableLinkAtSamePositionWithinRequestBlock
2276         - PositionInformationTests.RequestDraggableLinkAtSamePositionWithinRequestBlock
2277         - PositionInformationTests.RequestDraggableLinkAtDifferentPositionWithinRequestBlock
2278
2279         * UIProcess/API/Cocoa/WKWebView.mm:
2280         (-[WKWebView draggableElementAtPosition:]):
2281         (-[WKWebView requestDraggableElementAtPosition:completionBlock:]):
2282
2283         Uses WKContentView's position information request helpers to search for draggable elements on the page. There
2284         are both synchronous and asynchronous versions of this, both of which retrieve a _WKDraggableElementInfo.
2285
2286         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2287         * UIProcess/API/Cocoa/_WKDraggableElementInfo.h: Added.
2288         * UIProcess/API/Cocoa/_WKDraggableElementInfo.mm: Added.
2289
2290         Exposes what elements are draggable at a given position as SPI (only for use in testing code, at the moment).
2291
2292         (-[_WKDraggableElementInfo initWithInteractionInformationAtPosition:]):
2293         (-[_WKDraggableElementInfo copyWithZone:]):
2294         * UIProcess/API/Cocoa/_WKDraggableElementInfoInternal.h: Added.
2295         * UIProcess/ios/WKContentViewInteraction.h:
2296         * UIProcess/ios/WKContentViewInteraction.mm:
2297         (-[WKContentView currentPositionInformation]):
2298         (-[WKContentView doAfterPositionInformationUpdate:forRequest:]):
2299         (-[WKContentView _invokeAndRemovePendingHandlersValidForCurrentPositionInformation]):
2300         * WebKit2.xcodeproj/project.pbxproj:
2301
2302 2017-04-20  Anders Carlsson  <andersca@apple.com>
2303
2304         Fix a PassKit function declaration typo
2305         https://bugs.webkit.org/show_bug.cgi?id=171068
2306         rdar://problem/31635008
2307
2308         Reviewed by Tim Horton.
2309
2310         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2311         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
2312
2313 2017-04-20  Jer Noble  <jer.noble@apple.com>
2314
2315         [MediaCapture] gUM() with CoreAudio fails if capturing audio in the UIProcess.
2316         https://bugs.webkit.org/show_bug.cgi?id=171021
2317
2318         Reviewed by Eric Carlson.
2319
2320         Pass a deviceID rather than a CaptureDevice across the process boundary.
2321
2322         * Shared/WebCoreArgumentCoders.h:
2323         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2324         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
2325         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
2326         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
2327         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2328         (WebKit::UserMediaCaptureManager::createMediaSourceForCaptureDeviceWithConstraints):
2329         * WebProcess/cocoa/UserMediaCaptureManager.h:
2330
2331 2017-04-20  Alex Christensen  <achristensen@webkit.org>
2332
2333         Fix assertions in webProcessProxyFromConnection
2334         https://bugs.webkit.org/show_bug.cgi?id=171025
2335         <rdar://problem/31184073>
2336
2337         Reviewed by Brady Eidson.
2338
2339         * UIProcess/WebProcessPool.cpp:
2340         (WebKit::webProcessProxyFromConnection):
2341         If we have a Connection, then we have a valid process attached to that connection,
2342         unless it's a Connection to a different type of child process.
2343         Calling ChildProcessProxy::connection on other web processes that are in State::Launching,
2344         then we get an assertion.  Luckily, ChildProcessProxy::hasConnection was introduced in r210861
2345         for this reason.
2346
2347 2017-04-20  Brent Fulgham  <bfulgham@apple.com>
2348
2349         [WK2][macOS] Allow iokit-get-properties for IOAudioControlValue
2350         https://bugs.webkit.org/show_bug.cgi?id=171020
2351         <rdar://problem/30878974>
2352
2353         Reviewed by Alexey Proskuryakov.
2354
2355         * WebProcess/com.apple.WebProcess.sb.in: Add missing property name.
2356
2357 2017-04-19  Joseph Pecoraro  <pecoraro@apple.com>
2358
2359         Remove WebKitTestRunner code for enabling features that are already enabled by default
2360         https://bugs.webkit.org/show_bug.cgi?id=171033
2361
2362         Reviewed by Ryosuke Niwa.
2363
2364         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2365         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2366
2367 2017-04-19  Youenn Fablet  <youenn@apple.com>
2368
2369         [Mac] Allow customizing H264 encoder
2370         https://bugs.webkit.org/show_bug.cgi?id=170829
2371
2372         Reviewed by Alex Christensen.
2373
2374         * Configurations/FeatureDefines.xcconfig:
2375         * WebKit2.xcodeproj/project.pbxproj:
2376
2377 2017-04-19  Brady Eidson  <beidson@apple.com>
2378
2379         Add asynchronous equivalent of -[<WKUIDelegate> webView:createWebViewWithConfiguration:...].
2380         <rdar://problem/30699851> and https://bugs.webkit.org/show_bug.cgi?id=171018
2381
2382         Reviewed by Tim Horton.
2383
2384         * UIProcess/API/APIUIClient.h:
2385         (API::UIClient::createNewPageAsync):
2386
2387         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2388
2389         * UIProcess/Cocoa/UIDelegate.h:
2390         * UIProcess/Cocoa/UIDelegate.mm:
2391         (WebKit::UIDelegate::setDelegate):
2392         (WebKit::UIDelegate::UIClient::createNewPageCommon):
2393         (WebKit::UIDelegate::UIClient::createNewPage):
2394         (WebKit::UIDelegate::UIClient::createNewPageAsync):
2395
2396         * UIProcess/WebPageProxy.cpp:
2397         (WebKit::WebPageProxy::createNewPage):
2398         * UIProcess/WebPageProxy.h:
2399         * UIProcess/WebPageProxy.messages.in:
2400
2401 2017-04-19  Anders Carlsson  <andersca@apple.com>
2402
2403         Stop using deprecated APIs, part 3
2404         https://bugs.webkit.org/show_bug.cgi?id=171003
2405         rdar://problem/31589635
2406
2407         Reviewed by Tim Horton.
2408
2409         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2410         (IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::encode):
2411         (IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::decode):
2412         Don't encode/decode status.
2413
2414         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
2415         (WebKit::WebPaymentCoordinatorProxy::cancelPaymentSession):
2416         Hide the UI and report back.
2417
2418         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
2419         Add new member.
2420
2421         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
2422         Add new message.
2423
2424         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2425         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
2426         Always pass success in the old code path. Stop using the deprecated method.
2427
2428         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
2429         (WebKit::WebPaymentCoordinator::cancelPaymentSession):
2430         Send a message to the UI process.
2431
2432         * WebProcess/ApplePay/WebPaymentCoordinator.h:
2433         Add new member.
2434
2435 2017-04-19  Eric Carlson  <eric.carlson@apple.com>
2436
2437         [MediaStream] Limit capture to one tab at a time
2438         https://bugs.webkit.org/show_bug.cgi?id=171009
2439
2440         Reviewed by Jon Lee.
2441
2442         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2443         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): Deleted, not used.
2444         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2445
2446         * UIProcess/UserMediaProcessManager.cpp:
2447         (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Mute media streams
2448         on other pages.
2449         (WebKit::UserMediaProcessManager::willCreateMediaStream): Call willEnableMediaStreamInPage.
2450         * UIProcess/UserMediaProcessManager.h:
2451
2452         * UIProcess/WebPageProxy.cpp:
2453         (WebKit::WebPageProxy::setMuted): If media streams in the page will be unmuted, call
2454         willEnableMediaStreamInPage so streams in other pages are muted first.
2455
2456 2017-04-19  Brady Eidson  <beidson@apple.com>
2457
2458         REGRESSION (r213168): An extra Web Content process is spun up on launch and is never closed.
2459         <rdar://problem/30774839> and https://bugs.webkit.org/show_bug.cgi?id=171002
2460
2461         Reviewed by Alex Christensen.
2462
2463         The original change unnecessarily avoided using the initial warmed process if an explicit
2464         data store was set on the new WKWebView.
2465         
2466         Fixing that fixes the regression.
2467         
2468         * UIProcess/API/Cocoa/WKProcessPool.mm:
2469         (-[WKProcessPool _webProcessCount]):
2470         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2471
2472         * UIProcess/WebProcessPool.cpp:
2473         (WebKit::WebProcessPool::createWebPage):
2474
2475 2017-04-19  Anders Carlsson  <andersca@apple.com>
2476
2477         Rename cancelPayment to cancelPaymentSession
2478         https://bugs.webkit.org/show_bug.cgi?id=171007
2479
2480         Reviewed by Tim Horton.
2481
2482         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
2483         (WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
2484         (WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession):
2485         (WebKit::WebPaymentCoordinatorProxy::didCancelPayment): Deleted.
2486         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
2487         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2488         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]):
2489         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
2490         (WebKit::WebPaymentCoordinator::didCancelPaymentSession):
2491         (WebKit::WebPaymentCoordinator::didCancelPayment): Deleted.
2492         * WebProcess/ApplePay/WebPaymentCoordinator.h:
2493         * WebProcess/ApplePay/WebPaymentCoordinator.messages.in:
2494
2495 2017-04-19  David Kilzer  <ddkilzer@apple.com>
2496
2497         Stop using strcpy() in WebKit::EnvironmentUtilities::stripValuesEndingWithString()
2498         <https://webkit.org/b/170994>
2499         <rdar://problem/29889932>
2500
2501         Reviewed by Brent Fulgham.
2502
2503         * Platform/unix/EnvironmentUtilities.cpp:
2504         (WebKit::EnvironmentUtilities::stripValuesEndingWithString):
2505         Switch from using strcpy() to strlcpy().  Also switch from using
2506         strstr() to strnstr().
2507         * Platform/unix/EnvironmentUtilities.h: Switch to #pragma once.
2508         (WebKit::EnvironmentUtilities::stripValuesEndingWithString):
2509         Export function for testing.
2510         * WebKit2.xcodeproj/project.pbxproj:
2511         (EnvironmentUtilitiesTest.h): Make header private for testing.
2512
2513 2017-04-19  Eric Carlson  <eric.carlson@apple.com>
2514
2515         Provide a way for clients to unmute a media stream.
2516         https://bugs.webkit.org/show_bug.cgi?id=170855
2517         <rdar://problem/31656855>
2518
2519         Unreviewed, fix a typo missed in the review of r215420.
2520
2521         * UIProcess/API/Cocoa/WKWebView.mm:
2522         (-[WKWebView _setPageMuted:]):
2523
2524 2017-04-19  Adrian Perez de Castro  <aperez@igalia.com>
2525
2526         [GTK] WebKitAutocleanups.h regression in v2.16.1 release
2527         https://bugs.webkit.org/show_bug.cgi?id=170987
2528
2529         Reviewed by Carlos Garcia Campos.
2530
2531         * UIProcess/API/gtk/WebKitAutocleanups.h: Remove stray semicolon.
2532
2533 2017-04-18  Per Arne Vollan  <pvollan@apple.com>
2534
2535         Dragging a few items over MiniBrowser has 0 in the red indicator.
2536         https://bugs.webkit.org/show_bug.cgi?id=170874
2537
2538         Reviewed by Tim Horton.
2539
2540         When WebKit does not accept the drag items, the drag count badge should not be updated.
2541         Also, if WebKit changes the drag count badge, it should be restored to its original
2542         value when the drag exits.
2543
2544         * UIProcess/Cocoa/WebViewImpl.h:
2545         * UIProcess/Cocoa/WebViewImpl.mm:
2546         (WebKit::WebViewImpl::draggingEntered):
2547         (WebKit::WebViewImpl::draggingUpdated):
2548         (WebKit::WebViewImpl::draggingExited):
2549
2550 2017-04-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2551
2552         [WK2] Add infrastructure and unit tests for file uploads using data interaction
2553         https://bugs.webkit.org/show_bug.cgi?id=170903
2554         <rdar://problem/31314689>
2555
2556         Reviewed by Tim Horton.
2557
2558         See Tools/ChangeLog for more details. Makes a small adjustment to _simulateDataInteractionUpdated: to return a
2559         BOOL indicating whether or not to allow the operation to proceed. This is necessary for testing scenarios where
2560         multiple files are being "data interacted" onto an element. See <https://bugs.webkit.org/show_bug.cgi?id=170880>
2561         for more details about the change this patch is testing.
2562
2563         * UIProcess/API/Cocoa/WKWebView.mm:
2564         (-[WKWebView _simulateDataInteractionUpdated:]):
2565         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2566         * UIProcess/ios/WKContentViewInteraction.h:
2567
2568 2017-04-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2569
2570         [WK2] Support DataTransfer::files() when performing a DHTML data interaction
2571         https://bugs.webkit.org/show_bug.cgi?id=170880
2572         <rdar://problem/31314689>
2573
2574         Reviewed by Tim Horton.
2575
2576         See the WebCore ChangeLog for more details.
2577
2578         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2579         (WebKit::WebPasteboardProxy::getFilenamesForDataInteraction):
2580         * UIProcess/WebPageProxy.cpp:
2581         (WebKit::WebPageProxy::didPerformDragControllerAction):
2582         (WebKit::WebPageProxy::resetCurrentDragInformation):
2583         * UIProcess/WebPageProxy.h:
2584         (WebKit::WebPageProxy::documentIsHandlingNonDefaultDrag):
2585         * UIProcess/WebPageProxy.messages.in:
2586
2587         Adds an IPC argument to DidPerformDragControllerAction specifying whether the page prevented the default behavior.
2588
2589         * UIProcess/WebPasteboardProxy.h:
2590         * UIProcess/WebPasteboardProxy.messages.in:
2591
2592         Adds IPC plumbing for the new filenamesForDataInteraction Pasteboard codepath.
2593
2594         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2595         (WebKit::WebPlatformStrategies::getFilenamesForDataInteraction):
2596         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2597         * WebProcess/WebPage/WebPage.cpp:
2598         (WebKit::WebPage::performDragControllerAction):
2599
2600 2017-04-18  John Wilander  <wilander@apple.com>
2601
2602         Resource Load Statistics: Check both origins and cookieHostNames for domain matches in data removal
2603         https://bugs.webkit.org/show_bug.cgi?id=170763
2604         <rdar://problem/31573091>
2605
2606         Reviewed by Alex Christensen.
2607
2608         * UIProcess/WebProcessProxy.cpp:
2609         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
2610             Move semantics for topPrivatelyControlledDomains vector.
2611         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyOwnedDomainsInAllPersistentDataStores): Deleted.
2612             Renamed 'PrivatelyControlled' instead of 'PrivatelyOwned.'
2613         * UIProcess/WebProcessProxy.h:
2614         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2615         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
2616             Move semantics for prevalentResourceDomains vector.
2617         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
2618         (WebKit::hostIsInDomain):
2619             Static convenience function.
2620         (WebKit::WebsiteDataRecord::matchesTopPrivatelyControlledDomain):
2621             Checks for matching cookieHostNames if types contains WebsiteDataType::Cookies.
2622             Also checks origins.
2623         * UIProcess/WebsiteData/WebsiteDataRecord.h:
2624         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2625         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains):
2626             Now makes use of the new function
2627             WebKit::WebsiteDataRecord::validForTopPrivatelyControlledDomain().
2628         (WebKit::WebsiteDataStore::removeDataForTopPrivatelyControlledDomains):
2629             Move semantics for topPrivatelyControlledDomains vector.
2630         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyOwnedDomains): Deleted.
2631             Renamed 'PrivatelyControlled' instead of 'PrivatelyOwned.'
2632         (WebKit::WebsiteDataStore::removeDataForTopPrivatelyOwnedDomains): Deleted.
2633             Renamed 'PrivatelyControlled' instead of 'PrivatelyOwned.'
2634         * UIProcess/WebsiteData/WebsiteDataStore.h:
2635
2636 2017-04-18  Brent Fulgham  <bfulgham@apple.com>
2637
2638         [iOS][WK2] Prevent ephemeral files from being backed up
2639         https://bugs.webkit.org/show_bug.cgi?id=170963
2640         <rdar://problem/30470332>
2641
2642         Reviewed by Brady Eidson.
2643
2644         Tell the OS to skip temporary data files when performing backups.
2645
2646         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm: Added.
2647         (WebKit::WebResourceLoadStatisticsStore::platformExcludeFromBackup): Added.
2648         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2649         (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
2650         (WebKit::WebResourceLoadStatisticsStore::platformExcludeFromBackup): Add stub for
2651         non-iOS platforms.
2652         * UIProcess/WebResourceLoadStatisticsStore.h:
2653         * WebKit2.xcodeproj/project.pbxproj: Add new file.
2654
2655 2017-04-18  Wenson Hsieh  <wenson_hsieh@apple.com>
2656
2657         [WK2] Cannot select text on nytimes.com when the selection granularity is WKSelectionGranularityCharacter
2658         https://bugs.webkit.org/show_bug.cgi?id=170968
2659         <rdar://problem/31692560>
2660
2661         Reviewed by Dan Bernstein.
2662
2663         Makes a small adjustment to textInteractionGesture:shouldBeginAtPoint:. When determining whether to allow the
2664         text interaction assistant to recognize at a given point, instead of depending on whether or not the hit node is
2665         the same as the assisted node, only enforce this restriction when editing an assisted node. Otherwise, default
2666         to allowing the selection gesture.
2667
2668         Note that character granularity selection was working on most pages before, due to the fact that
2669         nodeAtPositionIsAssistedNode was true in many cases when there is no assisted node at all. This is because, in
2670         WebPage.mm, we compute the hit-tested node responding to click events to be null, and then set
2671         nodeAtPositionIsAssistedNode to be equal to hitNode == m_assistedNode, which ends up being true because both of
2672         these values are null.
2673
2674         This allowed text selection to work in the simple case when selection granularity character is used, but not
2675         when the node containing the selected point actually does respond to click events, since the comparison returns
2676         false.
2677
2678         New layout test: LayoutTests/editing/selection/character-granularity-select-text-with-click-handler.html.
2679
2680         * UIProcess/ios/WKContentViewInteraction.mm:
2681         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
2682
2683 2017-04-18  Keith Rollin  <krollin@apple.com>
2684
2685         Add additional information when logging URL disposition in WebLoaderStrategy::scheduleLoad
2686         https://bugs.webkit.org/show_bug.cgi?id=170813
2687
2688         Reviewed by Alex Christensen.
2689
2690         There are a few logging statements in WebLoaderStrategy::scheduleLoad
2691         that report, for example, "URL will be loaded as data". These
2692         statements also log the address of the frame doing the loading and the
2693         identifier of the resource. For consistency with other logging and to
2694         make scripted analysis of the logs more robust, also include the
2695         pageID and frameID in the logging.
2696
2697         * WebProcess/Network/WebLoaderStrategy.cpp:
2698         (WebKit::WebLoaderStrategy::scheduleLoad):
2699
2700 2017-04-18  Anders Carlsson  <andersca@apple.com>
2701
2702         Stop using deprecated APIs, part 2
2703         https://bugs.webkit.org/show_bug.cgi?id=170965
2704
2705         Reviewed by Tim Horton.
2706
2707         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2708         (IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::encode):
2709         (IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::decode):
2710         Remove the status member variable.
2711
2712         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2713         (WebKit::status):
2714         New function to be used by older OSes. This will recreate a PKPaymentAuthorizationStatus given a ShippingContactUpdate.
2715
2716         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
2717         Stop using the deprecated API.
2718
2719 2017-04-18  Timothy Horton  <timothy_horton@apple.com>
2720
2721         Force scroll view insets to be respected regardless of rubber-banding state
2722         https://bugs.webkit.org/show_bug.cgi?id=170937
2723         <rdar://problem/31412788>
2724
2725         Reviewed by Simon Fraser.
2726
2727         * Platform/spi/ios/UIKitSPI.h:
2728         * UIProcess/API/Cocoa/WKWebView.mm:
2729         (-[WKWebView _initializeWithConfiguration:]):
2730
2731 2017-04-18  Carlos Garcia Campos  <cgarcia@igalia.com>
2732
2733         [GLIB] Define priorities also for async network IO tasks
2734         https://bugs.webkit.org/show_bug.cgi?id=170905
2735
2736         Reviewed by Žan Doberšek.
2737
2738         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
2739         (WebKit::NetworkCache::inputStreamReadReadyCallback):
2740         (WebKit::NetworkCache::IOChannel::read):
2741         (WebKit::NetworkCache::outputStreamWriteReadyCallback):
2742         (WebKit::NetworkCache::IOChannel::write):
2743         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2744         (WebKit::NetworkDataTaskSoup::skipInputStreamForRedirection):
2745         (WebKit::NetworkDataTaskSoup::read):
2746         (WebKit::NetworkDataTaskSoup::requestNextPart):
2747         (WebKit::NetworkDataTaskSoup::writeDownload):
2748         (WebKit::NetworkDataTaskSoup::didFinishDownload):
2749         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
2750         (webkitURISchemeRequestReadCallback):
2751         (webkit_uri_scheme_request_finish):
2752
2753 2017-04-17  Timothy Horton  <timothy_horton@apple.com>
2754
2755         Plumb all four obscured insets to WebCore, instead of just top/left
2756         https://bugs.webkit.org/show_bug.cgi?id=170913
2757
2758         Reviewed by Wenson Hsieh.
2759
2760         * Shared/VisibleContentRectUpdateInfo.cpp:
2761         (WebKit::VisibleContentRectUpdateInfo::encode):
2762         (WebKit::VisibleContentRectUpdateInfo::decode):
2763         (WebKit::operator<<):
2764         * Shared/VisibleContentRectUpdateInfo.h:
2765         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
2766         (WebKit::VisibleContentRectUpdateInfo::obscuredInsets):
2767         (WebKit::operator==):
2768         (WebKit::VisibleContentRectUpdateInfo::obscuredInset): Deleted.
2769         * Shared/WebCoreArgumentCoders.cpp:
2770         (IPC::ArgumentCoder<FloatRectInsets>::encode):
2771         (IPC::ArgumentCoder<FloatRectInsets>::decode):
2772         * Shared/WebCoreArgumentCoders.h:
2773         * UIProcess/API/Cocoa/WKWebView.mm:
2774         (-[WKWebView _didCommitLayerTree:]):
2775         (-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]):
2776         (-[WKWebView _updateVisibleContentRects]):
2777         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2778         * UIProcess/PageClient.h:
2779         * UIProcess/WebPageProxy.cpp:
2780         * UIProcess/WebPageProxy.h:
2781         * UIProcess/WebPageProxy.messages.in:
2782         * UIProcess/ios/PageClientImplIOS.h:
2783         * UIProcess/ios/PageClientImplIOS.mm:
2784         (WebKit::PageClientImpl::restorePageState):
2785         * UIProcess/ios/WKContentView.h:
2786         * UIProcess/ios/WKContentView.mm:
2787         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2788         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): Deleted.
2789         * UIProcess/ios/WebPageProxyIOS.mm:
2790         (WebKit::WebPageProxy::restorePageState):
2791         * WebProcess/WebPage/ios/WebPageIOS.mm:
2792         (WebKit::WebPage::restorePageState):
2793         (WebKit::WebPage::updateVisibleContentRects):
2794         Adopt FloatBoxExtent for obscuredInsets (and adjust pluralization).
2795
2796 2017-04-17  Joseph Pecoraro  <pecoraro@apple.com>
2797
2798         Web Inspector: Doesn't show size of compressed content correctly
2799         https://bugs.webkit.org/show_bug.cgi?id=155112
2800         <rdar://problem/25006728>
2801
2802         Reviewed by Alex Christensen and Timothy Hatcher.
2803
2804         * NetworkProcess/NetworkResourceLoader.cpp:
2805         (WebKit::NetworkResourceLoader::sendResultForCacheEntry):
2806         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2807         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
2808         Include size information in network load metrics.
2809
2810 2017-04-17  Youenn Fablet  <youenn@apple.com>
2811
2812         com.apple.WebKit.Networking.Development crashed in com.apple.WebKit: WebKit::NetworkRTCProvider::resolvedName
2813         https://bugs.webkit.org/show_bug.cgi?id=170889
2814
2815         Reviewed by Alex Christensen.
2816
2817         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
2818         (WebKit::NetworkRTCProvider::Resolver::~Resolver): Unschedule the host resolution in addition to cancelling it.
2819         Providing a test would need to stop the resolver between the time the resolver is created and gets
2820         data in the network process. Or we would need to change Resolver to be instantiated/tested on its own.
2821         * NetworkProcess/webrtc/NetworkRTCProvider.h:
2822
2823 2017-04-17  Brady Eidson  <beidson@apple.com>
2824
2825         Make WKHTTPCookieStore public.
2826         <rdar://problem/31024691> and https://bugs.webkit.org/show_bug.cgi?id=170920
2827
2828         Reviewed by Geoffrey Garen.
2829
2830         * UIProcess/API/Cocoa/WKHTTPCookieStore.h:
2831         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
2832         (-[WKHTTPCookieStore getAllCookies:]):
2833         (-[WKHTTPCookieStore allCookies:]): Deleted.
2834
2835         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
2836         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2837         (-[WKWebsiteDataStore httpCookieStore]):
2838         (-[WKWebsiteDataStore _httpCookieStore]): Deleted.
2839         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2840
2841         * WebKit2.xcodeproj/project.pbxproj:
2842
2843 2017-04-17  Eric Carlson  <eric.carlson@apple.com>
2844
2845         [MediaStream] Fix typo in UIDelegate::mediaCaptureStateDidChange
2846         https://bugs.webkit.org/show_bug.cgi?id=170911
2847
2848         Reviewed by Youenn Fablet.
2849
2850         * UIProcess/Cocoa/UIDelegate.mm:
2851         (WebKit::UIDelegate::UIClient::mediaCaptureStateDidChange): Fix typo.
2852
2853 2017-04-17  Keith Rollin  <krollin@apple.com>
2854
2855         Move and update WebLoaderStrategy logging statement
2856         https://bugs.webkit.org/show_bug.cgi?id=170140
2857
2858         Reviewed by Alex Christensen.
2859
2860         WebLoaderStrategy::scheduleLoad has a logging statement that says, in
2861         part: "Resource has been queued for scheduling with the
2862         NetworkProcess". This statement is emitted after the
2863         ScheduleResourceLoad message has been successfully sent to the
2864         NetworkProcess. The logging statement was added at this location to
2865         indicate that the resource-load had been successfully handed off; it
2866         pairs a similar logging statement that is emitted if the sending of
2867         the ScheduleResourceLoad message fails.
2868
2869         I think it would be better to move this logging statement before the
2870         ScheduleResourceLoad message is sent to the NetworkProcess (and change
2871         its wording to "Resource is being scheduled with the NetworkProcess").
2872         The reason for this change is to help make sure that the sequence of
2873         logging statements is more deterministic. In the current form, the
2874         message "Resource has been queued for scheduling with the
2875         NetworkProcess" normally appears before any NetworkProcess logging
2876         statements that indicate that the resource-loading is continuing
2877         there, but in rare occasions the logging statements can be reversed.
2878         This change in the ordering of the statements has caused a problem in
2879         a script I've written that examines the resource-loading process and
2880         looks for errors. By ensuring that the WebLoaderStrategy statement
2881         always appears before the NetworkResourceLoader statement, the flow
2882         makes better sense and the script can be more robust.
2883
2884         In making this change, we are probably not giving up any assurance
2885         that the ScheduleResourceLoad message has been sent to the
2886         NetworkResourceLoader. If the message is successfully sent, we'll see
2887         logging in the NetworkProcess. If the message has not been sent, we'll
2888         see WebLoaderStrategy logging an error.
2889
2890         * WebProcess/Network/WebLoaderStrategy.cpp:
2891         (WebKit::WebLoaderStrategy::scheduleLoad):
2892
2893 2017-04-17  Anders Carlsson  <andersca@apple.com>
2894
2895         Stop using deprecated APIs, part 1
2896         https://bugs.webkit.org/show_bug.cgi?id=170915
2897         rdar://problem/31589635
2898
2899         Reviewed by Tim Horton.
2900
2901         Stop using the PKPaymentRequestPaymentMethodUpdate initializer that takes a status, it's been deprecated
2902         and we always passed PKPaymentAuthorizationStatusSuccess anyway.
2903
2904         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2905         (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::encode):
2906         (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):
2907         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2908         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
2909
2910 2017-04-17  Youenn Fablet  <youenn@apple.com>
2911
2912         Disable outdated WritableStream API
2913         https://bugs.webkit.org/show_bug.cgi?id=170749
2914         <rdar://problem/31446233>
2915
2916         Reviewed by Alex Christensen.
2917
2918         Replacing READABLE_STREAM_API, READABLE_BYTE_STREAM_API and WRITABLE_STREAM_API compilation flag by:
2919         - A STREAMS_API compilation flag.
2920         - A ReadableByteStreamAPI and WritableStreamAPI runtime flags, turned off except for RWT and DRT.
2921
2922         * Configurations/FeatureDefines.xcconfig:
2923         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2924         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2925
2926 2017-04-17  Tim Horton  <timothy_horton@apple.com>
2927
2928         Provide a viewport parameter to disable clipping to the safe area
2929         https://bugs.webkit.org/show_bug.cgi?id=170766
2930         <rdar://problem/31564634>
2931
2932         Reviewed by Beth Dakin.
2933
2934         * UIProcess/WebPageProxy.cpp:
2935         (WebKit::WebPageProxy::resetState):
2936         (WebKit::WebPageProxy::setClipToSafeArea):
2937         * UIProcess/WebPageProxy.h:
2938         (WebKit::WebPageProxy::clipToSafeArea):
2939         * UIProcess/WebPageProxy.messages.in:
2940         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2941         (WebKit::WebChromeClient::didChangeClipToSafeArea):
2942         * WebProcess/WebCoreSupport/WebChromeClient.h:
2943         * UIProcess/API/gtk/PageClientImpl.h:
2944         * UIProcess/PageClient.h:
2945         * UIProcess/ios/PageClientImplIOS.h:
2946         * UIProcess/ios/PageClientImplIOS.mm:
2947         (WebKit::PageClientImpl::didChangeClipToSafeArea):
2948         * UIProcess/mac/PageClientImpl.h:
2949         Forward clip-to-safe-area changes from ChromeClient to WKWebView.
2950         Update visible content rects when it changes, which will
2951         result in a call to updateFixedClippingView, as below.
2952         Keep track of the current state in the UI process.
2953
2954         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2955         * UIProcess/API/Cocoa/WKWebView.mm:
2956         (-[WKWebView _contentMayDrawInObscuredInsets]):
2957         Expose the current state of the clip-to-safe-area bit as SPI.
2958
2959         * UIProcess/ios/WKContentView.mm:
2960         (-[WKContentView updateFixedClippingView:]):
2961         Disable fixed clipping when clip-to-safe-area is disabled.
2962         
2963         * WebProcess/WebPage/ios/WebPageIOS.mm:
2964         (WebKit::WebPage::viewportConfigurationChanged):
2965         Push the viewport's clip-to-safe-area bit onto the main frame's FrameView.
2966
2967 2017-04-17  Dan Bernstein  <mitz@apple.com>
2968
2969         [Cocoa] Move isNullFunctionPointer down into WTF
2970         https://bugs.webkit.org/show_bug.cgi?id=170892
2971
2972         Reviewed by Sam Weinig.
2973
2974         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp:
2975         (WebKit::ResourceLoadStatisticsClassifierCocoa::canUseCorePrediction): Changed to use
2976           WTF::isNullFunctionPointer.
2977         (WebKit::isNullFunctionPointer): Deleted.
2978
2979 2017-04-17  Wenson Hsieh  <wenson_hsieh@apple.com>
2980
2981         [WK2] Respect a new internal setting for defaulting to character selection granularity
2982         https://bugs.webkit.org/show_bug.cgi?id=170904
2983         <rdar://problem/31364280>
2984
2985         Reviewed by Dan Bernstein.
2986
2987         Respect a new WebKitDebugDefaultSelectionGranularityCharacter user default by initializing
2988         WKWebViewConfiguration with WKSelectionGranularityCharacter, but only when linked on or after the first iOS to
2989         use WKSelectionGranularityCharacter by default.
2990
2991         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2992         (-[WKWebViewConfiguration init]):
2993         * UIProcess/Cocoa/VersionChecks.h:
2994
2995 2017-04-17  Eric Carlson  <eric.carlson@apple.com>
2996
2997         Provide a way for clients to unmute a media stream.
2998         https://bugs.webkit.org/show_bug.cgi?id=170855
2999         <rdar://problem/31656855>
3000
3001         Reviewed by Jon Lee.
3002
3003         * UIProcess/API/Cocoa/WKWebView.mm:
3004         (-[WKWebView _setPageMuted:]): New.
3005         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3006
3007 2017-04-17  Jeremy Jones  <jeremyj@apple.com>
3008
3009         Refactor enumerateDevices to allow separate CaptureDeviceManagers for audio and video.
3010         https://bugs.webkit.org/show_bug.cgi?id=170778
3011
3012         Reviewed by Tim Horton.
3013
3014         setUseAVFoundationAudioCapture is moved from AVCaptureDeviceManager to RealtimeMediaSourceCenterMac.
3015
3016         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3017         (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs):
3018
3019 2017-04-15  Keith Rollin  <krollin@apple.com>
3020
3021         Include resource size in some existing logging
3022         https://bugs.webkit.org/show_bug.cgi?id=170866
3023
3024         Reviewed by Alex Christensen.
3025
3026         In order to correlate resource load times with resource size, we log
3027         when the resource is starting to be loaded and when the resource is
3028         finished loading. In NetworkResourceLoader::didReceiveResponse, we
3029         also log the expected resource length. However, we can only log the
3030         length if it is provided in Content-Length, which is not always the
3031         case. If it's not provided, we end up logging "length = -1". To make
3032         up for this, change NetworkResourceLoader::didFinishLoading and
3033         WebResourceLoader:: didFinishLoading to log the length once we know
3034         it.
3035
3036         * NetworkProcess/NetworkResourceLoader.cpp:
3037         (WebKit::NetworkResourceLoader::didReceiveBuffer):
3038         (WebKit::NetworkResourceLoader::didFinishLoading):
3039         * NetworkProcess/NetworkResourceLoader.h:
3040         * WebProcess/Network/WebResourceLoader.cpp:
3041         (WebKit::WebResourceLoader::didReceiveData):
3042         (WebKit::WebResourceLoader::didFinishResourceLoad):
3043         * WebProcess/Network/WebResourceLoader.h:
3044
3045 2017-04-15  Wenson Hsieh  <wenson_hsieh@apple.com>
3046
3047         [WK2] Support data interaction of files into file inputs
3048         https://bugs.webkit.org/show_bug.cgi?id=170803
3049         <rdar://problem/31286130>
3050
3051         Reviewed by Tim Horton.
3052
3053         Implements remaining support for performing data interaction onto file inputs. There are two main changes at
3054         this layer: plumbing the number of files in the pasteboard to the web process, and pulling the implementation of
3055         createSandboxExtensionsIfNeeded out of Mac-specific WebViewImpl::createSandboxExtensionsIfNeeded and into
3056         WebPageProxy::createSandboxExtensionsIfNeeded.
3057
3058         * Shared/WebCoreArgumentCoders.cpp:
3059         (IPC::ArgumentCoder<DragData>::encode):
3060         (IPC::ArgumentCoder<DragData>::decode):
3061
3062         Relax special-casing of encoding and decoding filenames to be PLATFORM(COCOA) rather than PLATFORM(MAC).
3063
3064         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
3065         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
3066         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
3067         (WebKit::WebPasteboardProxy::getNumberOfFiles):
3068
3069         More boilerplate plumbing to deliver the number of files in the pasteboard to the web process.
3070
3071         * UIProcess/Cocoa/WebViewImpl.h:
3072         * UIProcess/Cocoa/WebViewImpl.mm:
3073         (WebKit::WebViewImpl::performDragOperation):
3074         (WebKit::WebViewImpl::createSandboxExtensionsIfNeeded): Deleted.
3075
3076         Move the logic in WebViewImpl::createSandboxExtensionsIfNeeded over to WebPageProxy::createSandboxExtensionsIfNeeded.
3077
3078         * UIProcess/WebPageProxy.h:
3079         * UIProcess/WebPasteboardProxy.h:
3080         * UIProcess/WebPasteboardProxy.messages.in:
3081         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3082         (WebKit::WebPlatformStrategies::getNumberOfFiles):
3083         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3084
3085 2017-04-14  Mark Lam  <mark.lam@apple.com>
3086
3087         Update architectures in xcconfig files.
3088         https://bugs.webkit.org/show_bug.cgi?id=170867
3089         <rdar://problem/31628104>
3090
3091         Reviewed by Joseph Pecoraro.
3092
3093         * Configurations/FeatureDefines.xcconfig:
3094
3095 2017-04-14  Wenson Hsieh  <wenson_hsieh@apple.com>
3096
3097         [WK2] Support Icon creation from file URLs on iOS
3098         https://bugs.webkit.org/show_bug.cgi?id=170809
3099         <rdar://problem/31286130>
3100
3101         Reviewed by Tim Horton.
3102
3103         Refactors file icon generation logic to support showing an Icon representing the content at a list of file paths
3104         on iOS. Pulls out logic in WKFileUploadPanel responsible for generating the thumbnail image for a file input into
3105         separate helpers in WebIconUtilities, and then uses these utilities in both WKFileUploadPanel and
3106         WebChromeClientIOS.
3107
3108         * Shared/ios/WebIconUtilities.h: Added.
3109         * Shared/ios/WebIconUtilities.mm: Added.
3110         (WebKit::squareCropRectForSize):
3111         (WebKit::squareImage):
3112         (WebKit::thumbnailSizedImageForImage):
3113         (WebKit::fallbackIconForFile):
3114         (WebKit::iconForImageFile):
3115         (WebKit::iconForVideoFile):
3116         (WebKit::iconForFile):
3117
3118         Add logic for generating thumbnail icons, moved from WKFileUploadPanel.mm.
3119
3120         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3121         (squareCropRectForSize): Deleted.
3122         (squareImage): Deleted.
3123         (thumbnailSizedImageForImage): Deleted.
3124         (fallbackIconForFile): Deleted.
3125         (iconForImageFile): Deleted.
3126         (iconForVideoFile): Deleted.
3127         (iconForFile): Deleted.
3128
3129         Remove logic for generating thumbnail icons.
3130
3131         * WebKit2.xcodeproj/project.pbxproj:
3132         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3133         (WebKit::WebChromeClient::loadIconForFiles):
3134         (WebKit::WebChromeClient::createIconForFiles):
3135
3136         Rather than call Icon::createIconForFiles directly, loadIconForFiles now consults ChromeClient::createIconForFiles
3137         instead. On other platforms, this just turns around and calls Icon::createIconForFiles, but on iOS, we use the
3138         utilities introduced in WebIconUtilities to generate a file icon.
3139
3140         * WebProcess/WebCoreSupport/WebChromeClient.h:
3141         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
3142         (WebKit::WebChromeClient::createIconForFiles):
3143
3144 2017-04-14  Brady Eidson  <beidson@apple.com>
3145
3146         Fix basic WKURLSchemeHandler bugs.
3147         <rdar://problem/30647559> and https://bugs.webkit.org/show_bug.cgi?id=170862
3148
3149         Reviewed by Andy Estes.
3150
3151         * UIProcess/Cocoa/NavigationState.mm:
3152         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
3153
3154         * UIProcess/WebURLSchemeHandlerTask.cpp:
3155         (WebKit::WebURLSchemeHandlerTask::didReceiveResponse):
3156
3157         * WebProcess/Network/WebLoaderStrategy.cpp:
3158         (WebKit::WebLoaderStrategy::addURLSchemeHandlerTaskProxy):
3159         (WebKit::WebLoaderStrategy::removeURLSchemeHandlerTaskProxy):
3160         (WebKit::WebLoaderStrategy::remove):
3161         * WebProcess/Network/WebLoaderStrategy.h:
3162
3163         * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp:
3164         (WebKit::WebURLSchemeHandlerProxy::startNewTask):
3165         (WebKit::WebURLSchemeHandlerProxy::taskDidComplete):
3166         (WebKit::WebURLSchemeHandlerProxy::taskDidStopLoading):
3167         * WebProcess/WebPage/WebURLSchemeHandlerProxy.h:
3168
3169         * WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.cpp:
3170         (WebKit::WebURLSchemeHandlerTaskProxy::WebURLSchemeHandlerTaskProxy):
3171         (WebKit::WebURLSchemeHandlerTaskProxy::stopLoading):
3172         (WebKit::WebURLSchemeHandlerTaskProxy::didReceiveResponse):
3173         (WebKit::WebURLSchemeHandlerTaskProxy::didReceiveData):
3174         (WebKit::WebURLSchemeHandlerTaskProxy::didComplete):
3175         (WebKit::WebURLSchemeHandlerTaskProxy::hasLoader):
3176         * WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.h:
3177         (WebKit::WebURLSchemeHandlerTaskProxy::identifier):
3178
3179 2017-04-14  Jer Noble  <jer.noble@apple.com>
3180
3181         [MediaSource] Push capabilities across process boundary during UIProcess capture.
3182         https://bugs.webkit.org/show_bug.cgi?id=170814
3183
3184         Reviewed by Eric Carlson.
3185
3186         Make a new synchronous getter for capabilities(), moderated by only requesting the capabilities() cross-process
3187         the first time called.
3188
3189         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
3190         (WebKit::UserMediaCaptureManagerProxy::capabilities):
3191         (WebKit::UserMediaCaptureManagerProxy::supportedConstraints):
3192         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
3193         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
3194         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
3195         (WebKit::UserMediaCaptureManager::Source::setCapabilities):
3196         (WebKit::UserMediaCaptureManager::capabilities):
3197         * WebProcess/cocoa/UserMediaCaptureManager.h:
3198
3199 2017-04-13  Dan Bernstein  <mitz@apple.com>
3200
3201         [Cocoa] Allow clients to specify in _WKProcessPoolConfiguration additional directory sandbox extensions
3202         https://bugs.webkit.org/show_bug.cgi?id=170387
3203
3204         Reviewed by Sam Weinig.
3205
3206         Test: TestWebKitAPI/Tests/WebKit2Cocoa/AdditionalReadAccessAllowedURLs.mm
3207
3208         Added an additionalReadAccessAllowedURLs property to _WKProcessPoolConfiguration.
3209
3210         * Shared/WebProcessCreationParameters.cpp:
3211         (WebKit::WebProcessCreationParameters::encode): Encode the new
3212           additionalSandboxExtensionHandles member.
3213         (WebKit::WebProcessCreationParameters::decode): Decode it.
3214         * Shared/WebProcessCreationParameters.h: Added additionalSandboxExtensionHandles member.
3215
3216         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3217         (API::ProcessPoolConfiguration::copy): Copy new m_additionalReadAccessAllowedPaths member.
3218         * UIProcess/API/APIProcessPoolConfiguration.h: Added m_additionalReadAccessAllowedPaths
3219           member and accessor functions.
3220
3221         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: Declared new
3222           additionalReadAccessAllowedURLs property whose value is an array of URLs to which the Web
3223           Content process will be given read access.
3224         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3225         (-[_WKProcessPoolConfiguration additionalReadAccessAllowedURLs]): New getter that returns
3226           an array of file URLs from the ProcessPoolConfiguration’s additionalReadAccessAllowedPaths().
3227         (-[_WKProcessPoolConfiguration setAdditionalReadAccessAllowedURLs:]): New setter that checks
3228           that the given URLs are file URLs and populates the ProcessPoolConfiguration’s
3229           additionalReadAccessAllowedPaths with their paths.
3230
3231         * UIProcess/WebProcessPool.cpp:
3232         (WebKit::WebProcessPool::resolvePathsForSandboxExtensions): Populate the new
3233           m_resolvedPaths.additionalWebProcessSandboxExtensionPaths with resolved paths from the
3234           ProcessPoolConfiguration’s additionalReadAccessAllowedPaths.
3235         (WebKit::WebProcessPool::createNewWebProcess): Populate the WebProcessCreationParameters’s
3236           additionalSandboxExtensionHandles member with read-only sandbox extensions created from
3237           the resolved paths.
3238         * UIProcess/WebProcessPool.h: Added additionalWebProcessSandboxExtensionPaths member to
3239           the Paths struct.
3240
3241         * WebProcess/WebProcess.cpp:
3242         (WebKit::WebProcess::initializeWebProcess): Consume the additional sandbox extensions.
3243
3244 2017-04-13  Alex Christensen  <achristensen@webkit.org>
3245
3246         Fix CMake build
3247         https://bugs.webkit.org/show_bug.cgi?id=170815
3248
3249         Reviewed by Beth Dakin.
3250
3251         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3252         (-[WKWebViewConfiguration _setShouldCaptureAudioInUIProcess:]):
3253
3254 2017-04-12  Dan Bernstein  <mitz@apple.com>
3255
3256         [Mac] Future-proof .xcconfig files
3257         https://bugs.webkit.org/show_bug.cgi?id=170802
3258
3259         Reviewed by Tim Horton.
3260
3261         * Configurations/Base.xcconfig:
3262         * Configurations/DebugRelease.xcconfig:
3263         * Configurations/FeatureDefines.xcconfig:
3264         * Configurations/Version.xcconfig:
3265
3266 2017-04-12  Brady Eidson  <beidson@apple.com>
3267
3268         QuotaExceededError when saving to localStorage in private mode.
3269         https://bugs.webkit.org/show_bug.cgi?id=157010
3270
3271         Reviewed by Alex Christensen.
3272
3273         * WebProcess/Storage/StorageAreaMap.cpp:
3274         (WebKit::StorageAreaMap::StorageAreaMap):
3275         (WebKit::StorageAreaMap::~StorageAreaMap):
3276
3277         * WebProcess/Storage/StorageNamespaceImpl.cpp:
3278         (WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace):
3279         (WebKit::StorageNamespaceImpl::storageArea):
3280         (WebKit::StorageNamespaceImpl::ephemeralLocalStorageArea):
3281         (WebKit::StorageNamespaceImpl::copy):
3282         * WebProcess/Storage/StorageNamespaceImpl.h:
3283
3284         * WebProcess/Storage/WebStorageNamespaceProvider.cpp:
3285         (WebKit::WebStorageNamespaceProvider::createEphemeralLocalStorageNamespace):
3286         * WebProcess/Storage/WebStorageNamespaceProvider.h:
3287
3288 2017-04-12  Yusuke Suzuki  <utatane.tea@gmail.com>
3289
3290         Unreviewed, fix build failure on Ubuntu LTS GTK bot
3291         https://bugs.webkit.org/show_bug.cgi?id=170781
3292
3293         * UIProcess/WebProcessPool.cpp:
3294         (WebKit::WebProcessPool::createNewWebProcess):
3295
3296 2017-04-12  Eric Carlson  <eric.carlson@apple.com>
3297
3298         [MediaStream] rename -[WKWebView _stopMediaCapture]
3299         https://bugs.webkit.org/show_bug.cgi?id=170791
3300         <rdar://problem/31589204>
3301
3302         Reviewed by Youenn Fablet.
3303
3304         * UIProcess/API/Cocoa/WKWebView.mm:
3305         (-[WKWebView _muteMediaCapture]):
3306         (-[WKWebView _stopMediaCapture]): Deleted.
3307         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3308
3309 2017-04-12  Ryan Haddad  <ryanhaddad@apple.com>
3310
3311         Unreviewed build fix.
3312
3313         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3314         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]):
3315         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]):
3316         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]):
3317         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
3318         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
3319         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
3320
3321 2017-04-12  Jer Noble  <jer.noble@apple.com>
3322
3323         [WK2] Add a C-API for creating a WKContextConfigurationRef with legacy options.
3324         https://bugs.webkit.org/show_bug.cgi?id=170790
3325
3326         Reviewed by Alex Christensen.
3327
3328         * UIProcess/API/C/WKContextConfigurationRef.cpp:
3329         (WKContextConfigurationCreate):
3330         (WKContextConfigurationCreateWithLegacyOptions):
3331         * UIProcess/API/C/WKContextConfigurationRef.h:
3332
3333 2017-04-12  Jer Noble  <jer.noble@apple.com>
3334
3335         [WK2] Do not pass microphone sandbox extension to WebProcess if capturing is happening in UIProcess.
3336         https://bugs.webkit.org/show_bug.cgi?id=170781
3337
3338         Reviewed by Alex Christensen.
3339
3340         Simultaneously, allow clients to configure whether capturing will occur in the UIProcess through
3341         _WKProcessPoolConfiguration.
3342
3343         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3344         (API::ProcessPoolConfiguration::copy):
3345         * UIProcess/API/APIProcessPoolConfiguration.h:
3346         * UIProcess/API/C/WKContextConfigurationRef.cpp:
3347         (WKContextConfigurationShouldCaptureAudioInUIProcess):
3348         (WKContextConfigurationSetShouldCaptureAudioInUIProcess):
3349         * UIProcess/API/C/WKContextConfigurationRef.h:
3350         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3351         (-[WKWebViewConfiguration copyWithZone:]):
3352         (-[WKWebViewConfiguration _shouldCaptureAudioInUIProcess]):
3353         (-[WKWebViewConfiguration _setShouldCaptureAudioInUIProcess:]):
3354         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
3355         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3356         (-[_WKProcessPoolConfiguration shouldCaptureAudioInUIProcess]):
3357         (-[_WKProcessPoolConfiguration setShouldCaptureAudioInUIProcess:]):
3358         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3359         (WebKit::WebProcessPool::platformInitializeWebProcess):
3360         * UIProcess/WebProcessPool.cpp:
3361         (WebKit::WebProcessPool::createNewWebProcess):
3362
3363 2017-04-12  Keith Rollin  <krollin@apple.com>
3364
3365         Add some missing NetworkResourceLoader logging
3366         https://bugs.webkit.org/show_bug.cgi?id=170139
3367
3368         Reviewed by Alex Christensen.
3369
3370         Once execution enters the lambda in
3371         NetworkResourceLoader::retrieveCacheEntry, there is little indication
3372         of which exit point was taken. If flow enters into startNetworkLoad,
3373         we'll get some logging from that function, but not from the others.
3374         Add some logging so that we know what the result was from looking up
3375         the resource in the cache.
3376
3377         * NetworkProcess/NetworkResourceLoader.cpp:
3378         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
3379
3380 2017-04-12  Anders Carlsson  <andersca@apple.com>
3381
3382         Tweak WebCore::setMetadataURL function
3383         https://bugs.webkit.org/show_bug.cgi?id=170786
3384
3385         Reviewed by Beth Dakin.
3386
3387         Update for WebCore changes.
3388
3389         * UIProcess/Cocoa/WebViewImpl.mm:
3390         (WebKit::WebViewImpl::namesOfPromisedFilesDroppedAtDestination):
3391
3392 2017-04-12  Brent Fulgham  <bfulgham@apple.com>
3393
3394         [WK2][Mac] Stop allowing access to disk arbitration process
3395         https://bugs.webkit.org/show_bug.cgi?id=170517
3396         <rdar://problem/31071151>
3397
3398         Reviewed by Alex Christensen.
3399
3400         * WebProcess/com.apple.WebProcess.sb.in:
3401
3402 2017-04-12  Beth Dakin  <bdakin@apple.com>
3403
3404         32-bit build fix.
3405
3406         * UIProcess/API/mac/WKView.mm:
3407         (-[WKView _mediaPlaybackControlsView]):
3408
3409 2017-04-12  Beth Dakin  <bdakin@apple.com>
3410
3411         More 32-bit build fix.
3412
3413         * UIProcess/API/Cocoa/WKWebView.mm:
3414         (-[WKWebView _mediaPlaybackControlsView]):
3415         (-[WKWebView _addMediaPlaybackControlsView:]):
3416         * UIProcess/API/mac/WKView.mm:
3417         (-[WKView _mediaPlaybackControlsView]):
3418         (-[WKView _addMediaPlaybackControlsView:]):
3419
3420 2017-04-12  Beth Dakin  <bdakin@apple.com>
3421
3422         Another 32 bit build fix.
3423
3424         * UIProcess/Cocoa/WebViewImpl.h:
3425         * UIProcess/Cocoa/WebViewImpl.mm:
3426         (WebKit::WebViewImpl::mediaPlaybackControlsView):
3427
3428 2017-04-12  Alex Christensen  <achristensen@webkit.org>
3429
3430         Stop using didReceiveDataArray callback on El Capitan
3431         https://bugs.webkit.org/show_bug.cgi?id=170780
3432
3433         Reviewed by Brady Eidson.
3434
3435         * NetworkProcess/NetworkLoad.cpp:
3436         (WebKit::NetworkLoad::supportsDataArray): Deleted.
3437         (WebKit::NetworkLoad::didReceiveDataArray): Deleted.
3438         * NetworkProcess/NetworkLoad.h:
3439
3440 2017-04-12  Beth Dakin  <bdakin@apple.com>
3441
3442         Speculative build fix.
3443
3444         * UIProcess/API/Cocoa/WKViewPrivate.h:
3445
3446 2017-04-12  Beth Dakin  <bdakin@apple.com>
3447
3448         Attempted build fix.
3449
3450         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3451
3452 2017-04-12  Beth Dakin  <bdakin@apple.com>
3453
3454         Adopt AVKit name change from AVFunctionBar* to AVTouchBar*
3455         https://bugs.webkit.org/show_bug.cgi?id=170693
3456         -and corresponding-
3457         rdar://problem/31230018
3458
3459         Reviewed by Sam Weinig.
3460
3461         Since the new names only apply to some versions of macOS, this patch uses typedefs 
3462         for the older OS’s. SO:
3463
3464         AVFunctionBarScrubber is now AVTouchBarScrubber
3465
3466         AVFunctionBarPlaybackControlsProvider is now AVTouchBarPlaybackControlsProvider
3467
3468         AVFunctionBarMediaSelectionOption is now AVTouchBarMediaSelectionOption
3469
3470         And the protocol AVFunctionBarPlaybackControlsControlling is now 
3471         AVTouchBarPlaybackControlsControlling
3472
3473         Use the new name.
3474         * UIProcess/API/Cocoa/WKViewPrivate.h:
3475         * UIProcess/API/Cocoa/WKWebView.mm:
3476         (-[WKWebView _mediaPlaybackControlsView]):
3477         (-[WKWebView _addMediaPlaybackControlsView:]):
3478         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3479         * UIProcess/API/mac/WKView.mm:
3480         (-[WKView _mediaPlaybackControlsView]):
3481         (-[WKView _addMediaPlaybackControlsView:]):