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