22fe6e8d3c34902e7d02a6a77afe02474c54a568
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2017-05-11  Tim Horton  <timothy_horton@apple.com>
2
3         Data loss when saving a PDF form where only radio buttons/checkboxes were modified
4         https://bugs.webkit.org/show_bug.cgi?id=171991
5         <rdar://problem/32115945>
6
7         Reviewed by Andy Estes.
8
9         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
10         * WebProcess/Plugins/PDF/PDFPlugin.mm:
11         (-[WKPDFLayerControllerDelegate didChangeAnnotationState]):
12         Mark the PDF as dirty (so we re-encode it when asked to save) if annotations
13         that only PDFKit knows about change.
14
15 2017-05-11  Joseph Pecoraro  <pecoraro@apple.com>
16
17         Remove Vibration API
18         https://bugs.webkit.org/show_bug.cgi?id=171766
19
20         Rubber-stamped by Alexey Proskuryakov.
21
22         * CMakeLists.txt:
23         * Shared/API/APIObject.h:
24         * Shared/API/c/WKBase.h:
25         * UIProcess/API/C/WKAPICast.h:
26         * UIProcess/API/C/WKPage.cpp:
27         (WKPageGetVibration): Deleted.
28         * UIProcess/API/C/WKPage.h:
29         * UIProcess/API/C/WKVibration.cpp: Removed.
30         * UIProcess/API/C/WKVibration.h: Removed.
31         * UIProcess/WebPageProxy.cpp:
32         (WebKit::m_weakPtrFactory):
33         (WebKit::WebPageProxy::resetState):
34         * UIProcess/WebPageProxy.h:
35         (WebKit::WebPageProxy::vibration): Deleted.
36         * UIProcess/WebVibrationProvider.cpp: Removed.
37         * UIProcess/WebVibrationProvider.h: Removed.
38         * UIProcess/WebVibrationProxy.cpp: Removed.
39         * UIProcess/WebVibrationProxy.h: Removed.
40         * UIProcess/WebVibrationProxy.messages.in: Removed.
41         * WebProcess/WebCoreSupport/WebVibrationClient.cpp: Removed.
42         * WebProcess/WebCoreSupport/WebVibrationClient.h: Removed.
43         * WebProcess/WebPage/WebPage.cpp:
44
45 2017-05-11  Andy Estes  <aestes@apple.com>
46
47         Fix a spelling mistake in ApplePayErrorCode
48         https://bugs.webkit.org/show_bug.cgi?id=171981
49         <rdar://problem/32136567>
50
51         Reviewed by Beth Dakin.
52
53         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
54         (WebKit::toPKPaymentErrorCode):
55         (WebKit::toPKPaymentAuthorizationStatus):
56
57 2017-05-11  John Wilander  <wilander@apple.com>
58
59         Resource Load Statistics: Enable configuration through preferences
60         https://bugs.webkit.org/show_bug.cgi?id=171949
61         <rdar://problem/31894518>
62
63         Reviewed by Alex Christensen.
64
65         * Shared/WebPreferencesDefinitions.h:
66             Added ResourceLoadStatisticsTimeToLiveUserInteraction,
67             ResourceLoadStatisticsTimeToLiveCookiePartitionFree, and
68             ResourceLoadStatisticsReducedTimestampResolution.
69         * UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm: Added.
70         (WebKit::WebResourceLoadStatisticsManager::registerUserDefaultsIfNeeded):
71         * UIProcess/WebResourceLoadStatisticsManager.h:
72         * UIProcess/WebResourceLoadStatisticsStore.cpp:
73         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
74             Now calls WebResourceLoadStatisticsManager::registerUserDefaultsIfNeeded().
75         * WebKit2.xcodeproj/project.pbxproj:
76
77 2017-05-11  Claudio Saavedra  <csaavedra@igalia.com>
78
79         [GTK] Remove notifications guards from GTK API layer
80         https://bugs.webkit.org/show_bug.cgi?id=170014
81
82         Reviewed by Michael Catanzaro.
83
84         ENABLE_NOTIFICATIONS in the GTK port is a private option and
85         disabling it is unsupported, hence remove its guards from the GTK API
86         layer.
87
88         * UIProcess/API/gtk/WebKitWebContext.cpp:
89         (webkitWebContextConstructed):
90
91 2017-05-11  Carlos Garcia Campos  <cgarcia@igalia.com>
92
93         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.2 release.
94
95         * gtk/NEWS: Add release notes for 2.17.2.
96
97 2017-05-11  Claudio Saavedra  <csaavedra@igalia.com>
98
99         [GTK] JavaScript prompt uses title of page to be loaded rather than title of current page
100         https://bugs.webkit.org/show_bug.cgi?id=152690
101
102         Reviewed by Michael Catanzaro.
103
104         webkit_web_view_get_uri() returns the page to be loaded, use
105         internal api for this.
106         * UIProcess/API/gtk/WebKitWebView.cpp:
107         (webkitWebViewCreateJavaScriptDialog):
108
109 2017-05-10  Tim Horton  <timothy_horton@apple.com>
110
111         Null deref in WebPage::dictionaryPopupInfoForRange
112         https://bugs.webkit.org/show_bug.cgi?id=171959
113         <rdar://problem/20886282>
114
115         Reviewed by Beth Dakin.
116
117         * WebProcess/WebPage/mac/WebPageMac.mm:
118         (WebKit::WebPage::dictionaryPopupInfoForRange):
119         Speculative fix for non-reproducible crash when the startContainer of
120         the range is in an anonymous node.
121
122 2017-05-09  Sam Weinig  <sam@webkit.org>
123
124         Remove support for legacy Notifications
125         https://bugs.webkit.org/show_bug.cgi?id=171487
126
127         Reviewed by Jon Lee.
128
129         * Configurations/FeatureDefines.xcconfig:
130         * Shared/WebProcessCreationParameters.cpp:
131         * Shared/WebProcessCreationParameters.h:
132         * UIProcess/WebProcessPool.cpp:
133         * WebProcess/InjectedBundle/InjectedBundle.cpp:
134         * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
135         * WebProcess/Notifications/NotificationPermissionRequestManager.h:
136         * WebProcess/Notifications/WebNotificationManager.cpp:
137         * WebProcess/Notifications/WebNotificationManager.h:
138         * WebProcess/WebCoreSupport/WebNotificationClient.cpp:
139         * WebProcess/WebCoreSupport/WebNotificationClient.h:
140         * WebProcess/WebPage/WebPage.cpp:
141         * WebProcess/WebProcess.cpp:
142         Remove legacy notification specific code.
143
144 2017-05-10  Tim Horton  <timothy_horton@apple.com>
145
146         Add an experimental feature flag for viewport-fit
147         https://bugs.webkit.org/show_bug.cgi?id=171948
148         <rdar://problem/31995518>
149
150         Reviewed by Simon Fraser.
151
152         * Shared/WebPreferencesDefinitions.h:
153         * WebProcess/WebPage/WebPage.cpp:
154         (WebKit::WebPage::updatePreferences):
155         Add an experimental feature flag.
156
157 2017-05-10  Alex Christensen  <achristensen@webkit.org>
158
159         Include headers in WebKit.h
160         https://bugs.webkit.org/show_bug.cgi?id=171943
161
162         Reviewed by Dan Bernstein.
163
164         * Shared/API/Cocoa/WebKit.h:
165
166 2017-05-10  Timothy Horton  <timothy_horton@apple.com>
167
168         Disable block selection for dynamic selection granularity
169         https://bugs.webkit.org/show_bug.cgi?id=171908
170         <rdar://problem/32098024>
171
172         Reviewed by Enrica Casucci.
173
174         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
175         (-[WKWebViewConfiguration init]):
176         (-[WKWebViewConfiguration copyWithZone:]):
177         (-[WKWebViewConfiguration _allowsBlockSelection]):
178         (-[WKWebViewConfiguration _setAllowsBlockSelection:]):
179         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
180         Add a private configuration parameter to re-enable block selection.
181
182         * Shared/WebPageCreationParameters.cpp:
183         (WebKit::WebPageCreationParameters::encode):
184         (WebKit::WebPageCreationParameters::decode):
185         * Shared/WebPageCreationParameters.h:
186         * UIProcess/API/Cocoa/WKWebView.mm:
187         (-[WKWebView _allowsBlockSelection]):
188         * UIProcess/API/Cocoa/WKWebViewInternal.h:
189         * UIProcess/Cocoa/VersionChecks.h:
190         * UIProcess/PageClient.h:
191         * UIProcess/WebPageProxy.cpp:
192         (WebKit::WebPageProxy::creationParameters):
193         * UIProcess/ios/PageClientImplIOS.h:
194         * UIProcess/ios/PageClientImplIOS.mm:
195         (WebKit::PageClientImpl::allowsBlockSelection):
196         * WebProcess/WebPage/WebPage.cpp:
197         * WebProcess/WebPage/WebPage.h:
198         Plumb allowsBlockSelection through from WKWebViewConfiguration to WebPage.
199
200         * UIProcess/ios/WKContentViewInteraction.mm:
201         (-[WKContentView setupInteraction]):
202         (-[WKContentView useSelectionAssistantWithGranularity:]):
203         (-[WKContentView _startAssistingKeyboard]):
204         (-[WKContentView _stopAssistingKeyboard]):
205         (toUIWebSelectionMode): Deleted.
206         (-[WKContentView useSelectionAssistantWithMode:]): Deleted.
207         Stop needlessly converting to UIWebSelectionMode.
208         
209         * WebProcess/WebPage/ios/WebPageIOS.mm:
210         (WebKit::WebPage::shouldSwitchToBlockModeForHandle):
211         Don't switch to block selection unless allowsBlockSelection is set.
212
213 2017-05-10  Tim Horton  <timothy_horton@apple.com>
214
215         Add an experimental feature flag for constant properties
216         https://bugs.webkit.org/show_bug.cgi?id=171913
217         <rdar://problem/31995518>
218
219         Reviewed by Ryosuke Niwa.
220
221         * Shared/WebPreferencesDefinitions.h:
222         * WebProcess/WebPage/WebPage.cpp:
223         (WebKit::WebPage::updatePreferences):
224         Add an experimental feature flag.
225
226 2017-05-09  Dean Jackson  <dino@apple.com>
227
228         Disable WebGL2 by default
229         https://bugs.webkit.org/show_bug.cgi?id=171894
230         <rdar://problem/32089917>
231
232         Reviewed by Tim Horton.
233
234         Some WASM and WebGL2 content is failing because it
235         detects our WebGL2RenderingContext, but doesn't realise
236         that we don't implement enough of it to be useful.
237
238         * Shared/WebPreferencesDefinitions.h:
239
240 2017-05-10  Matt Lewis  <jlewis3@apple.com>
241
242         Unreviewed, rolling out r216563.
243
244         Revision caused 2 api failures
245
246         Reverted changeset:
247
248         "[MediaStream] deviceId constraint doesn't work with
249         getUserMedia"
250         https://bugs.webkit.org/show_bug.cgi?id=171877
251         http://trac.webkit.org/changeset/216563
252
253 2017-05-10  Claudio Saavedra  <csaavedra@igalia.com>
254
255         [GTK] HTTP authentication dialog should focus on first input field
256         https://bugs.webkit.org/show_bug.cgi?id=151349
257
258         Reviewed by Michael Catanzaro.
259
260         Setting focus on a widget before it's mapped does nothing. Move
261         the call to the right place.
262
263         * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp:
264         (webkitAuthenticationDialogInitialize):
265         (webkitAuthenticationDialogMap):
266
267 2017-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>
268
269         [GTK] -Wmissing-field-initializers triggered by RemoteInspectorServer.cpp:128
270         https://bugs.webkit.org/show_bug.cgi?id=171273
271
272         Reviewed by Carlos Garcia Campos.
273
274         * UIProcess/glib/RemoteInspectorClient.cpp:
275         (WebKit::RemoteInspectorClient::RemoteInspectorClient):
276
277 2017-05-09  Eric Carlson  <eric.carlson@apple.com>
278
279         [MediaStream] deviceId constraint doesn't work with getUserMedia
280         https://bugs.webkit.org/show_bug.cgi?id=171877
281         <rdar://problem/31899730>
282
283         Reviewed by Jer Noble.
284
285         * Shared/WebCoreArgumentCoders.cpp:
286         (IPC::ArgumentCoder<MediaConstraintsData>::encode): Encode deviceIDHashSalt.
287         (IPC::ArgumentCoder<MediaConstraintsData>::decode): Decode deviceIDHashSalt.
288
289         * UIProcess/UserMediaPermissionCheckProxy.cpp:
290         (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy): Initialize
291         completion handler, frame ID, and security origins.
292         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): Complete by calling
293         completion handler because we now sometimes request access info before calling gUM.
294         (WebKit::UserMediaPermissionCheckProxy::invalidate): Clear completion handler.
295         * UIProcess/UserMediaPermissionCheckProxy.h:
296
297         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
298         (WebKit::FrameAuthorizationState::FrameAuthorizationState): Take security origins, not
299         UserMediaPermissionRequestProxy, so it can be constructed with a UserMediaPermissionCheckProxy.
300         (WebKit::FrameAuthorizationState::ensureSecurityOriginsAreEqual): Ditto. Clear has salt
301         when origins don't match.
302         (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest): Templatize.
303         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): Fix typo.
304         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Ditto.
305         Don't set state for empty UIDs. Pass hash salt to web process.
306         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
307         The device ID hash salt is now required to validate constraints, so get it first.
308         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Helper
309         method used to get the device ID hash salt.
310         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Restructure
311         to use getUserMediaPermissionInfo.
312         (WebKit::UserMediaPermissionRequestManagerProxy::didCompleteUserMediaPermissionCheck): Deleted.
313         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
314
315         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
316         (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted): Add device ID
317         hash salt parameter.
318         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
319
320         * WebProcess/WebPage/WebPage.cpp:
321         (WebKit::WebPage::userMediaAccessWasGranted): Ditto.
322         * WebProcess/WebPage/WebPage.h:
323         * WebProcess/WebPage/WebPage.messages.in:
324
325         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
326         (WebKit::UserMediaCaptureManager::createCaptureSource): Use new MediaConstraintsData 
327         constructor.
328
329 2017-05-09  Alex Christensen  <achristensen@webkit.org>
330
331         Buffer media in NetworkProcess to reduce IPC overhead
332         https://bugs.webkit.org/show_bug.cgi?id=171834
333         <rdar://problem/31485485>
334
335         Reviewed by Jer Noble.
336
337         I have measured a significant CPU usage reduction when buffering media data in the NetworkProcess,
338         especially on arm64 processors.  Buffering data in the NetworkProcess introduces no additional data
339         copies after r215686, and it reduces the number of messages sent from the NetworkProcess to the WebProcess,
340         each of which must also be forwarded to mediaserverd by AVFoundation.  This reduces the number of messages
341         from thousands per second to a maximum of 20 per second.  This adds 1/20 second additional latency in
342         media loading, which will probably not be noticed by most users.  This also adds the possibility of large
343         allocations when decoding IPC messages in the WebProcess, and if that becomes the source of crashes we can
344         add a maximum buffered amount in addition to a maximum buffered time, but we are likely not to receive
345         so much data in 1/20 second to have problems allocating the buffer.
346
347         * WebProcess/Network/WebLoaderStrategy.cpp:
348         (WebKit::maximumBufferingTime):
349         Buffer data in the NetworkProcess for up to 50ms before sending it to the WebProcess in one message.
350         This value is used in NetworkResourceLoader::didReceiveBuffer to append to m_bufferedData instead of
351         sending the small chunks immediately.
352
353 2017-05-09  Commit Queue  <commit-queue@webkit.org>
354
355         Unreviewed, rolling out r216545.
356         https://bugs.webkit.org/show_bug.cgi?id=171889
357
358         Caused a test failure (Requested by eric_carlson on #webkit).
359
360         Reverted changeset:
361
362         "[MediaStream] deviceId constraint doesn't work with
363         getUserMedia"
364         https://bugs.webkit.org/show_bug.cgi?id=171877
365         http://trac.webkit.org/changeset/216545
366
367 2017-05-09  Eric Carlson  <eric.carlson@apple.com>
368
369         [MediaStream] deviceId constraint doesn't work with getUserMedia
370         https://bugs.webkit.org/show_bug.cgi?id=171877
371         <rdar://problem/31899730>
372
373         Reviewed by Jer Noble.
374
375         * Shared/WebCoreArgumentCoders.cpp:
376         (IPC::ArgumentCoder<MediaConstraintsData>::encode): Encode deviceIDHashSalt.
377         (IPC::ArgumentCoder<MediaConstraintsData>::decode): Decode deviceIDHashSalt.
378
379         * UIProcess/UserMediaPermissionCheckProxy.cpp:
380         (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy): Initialize
381         completion handler, frame ID, and security origins.
382         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): Complete by calling
383         completion handler because we now sometimes request access info before calling gUM.
384         (WebKit::UserMediaPermissionCheckProxy::invalidate): Clear completion handler.
385         * UIProcess/UserMediaPermissionCheckProxy.h:
386
387         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
388         (WebKit::FrameAuthorizationState::FrameAuthorizationState): Take security origins, not
389         UserMediaPermissionRequestProxy, so it can be constructed with a UserMediaPermissionCheckProxy.
390         (WebKit::FrameAuthorizationState::ensureSecurityOriginsAreEqual): Ditto. Clear has salt
391         when origins don't match.
392         (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest): Templatize.
393         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): Fix typo.
394         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Ditto.
395         Don't set state for empty UIDs. Pass hash salt to web process.
396         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
397         The device ID hash salt is now required to validate constraints, so get it first.
398         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Helper
399         method used to get the device ID hash salt.
400         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Restructure
401         to use getUserMediaPermissionInfo.
402         (WebKit::UserMediaPermissionRequestManagerProxy::didCompleteUserMediaPermissionCheck): Deleted.
403         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
404
405         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
406         (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted): Add device ID
407         hash salt parameter.
408         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
409
410         * WebProcess/WebPage/WebPage.cpp:
411         (WebKit::WebPage::userMediaAccessWasGranted): Ditto.
412         * WebProcess/WebPage/WebPage.h:
413         * WebProcess/WebPage/WebPage.messages.in:
414
415         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
416         (WebKit::UserMediaCaptureManager::createCaptureSource): Use new MediaConstraintsData 
417         constructor.
418
419 2017-05-10  Dean Jackson  <dino@apple.com>
420
421         Restrict SVG filters to accessible security origins
422         https://bugs.webkit.org/show_bug.cgi?id=118689
423         <rdar://problem/27362159>
424
425         Reviewed by Brent Fulgham.
426
427         Update parameter lists.
428
429         * WebProcess/Plugins/PluginView.cpp:
430         (WebKit::PluginView::paint):
431         * WebProcess/Plugins/PluginView.h:
432
433 2017-05-09  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
434
435         [Coordinated Graphics] Debug Visuals don't hide
436         https://bugs.webkit.org/show_bug.cgi?id=162704
437
438         Reviewed by Žan Doberšek.
439
440         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
441         (IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::encode):
442         (IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::decode):
443         (IPC::ArgumentCoder<DebugVisuals>::encode):
444         (IPC::ArgumentCoder<DebugVisuals>::decode):
445         The encoder and decoder for DebugVisuals have been added.
446
447         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h:
448         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
449         (WebKit::CoordinatedGraphicsScene::setLayerState):
450         Update the debug visuals of a layer according to the DebugVisuals information
451         if the debugVisualsChanged flag is set to true.
452
453 2017-05-09  Zan Dobersek  <zdobersek@igalia.com>
454
455         Upstream the WPE port
456         https://bugs.webkit.org/show_bug.cgi?id=171110
457
458         Reviewed by Alex Christensen.
459
460         webkit-dev thread:
461         https://lists.webkit.org/pipermail/webkit-dev/2017-April/028923.html
462
463         Existing files changed to properly use PLATFORM(WPE) build guards or other
464         WPE-specific additions (e.g. pasteboard support).
465         In-file changes removed from this ChangeLog entry for brevity.
466
467         * Platform/IPC/glib/GSocketMonitor.cpp:
468         * PlatformWPE.cmake: Added.
469         * Scripts/generate-forwarding-headers.pl:
470         * Shared/API/c/WKBase.h:
471         * Shared/API/c/wpe/WKBaseWPE.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
472         * Shared/API/c/wpe/WebKit.h: Added.
473         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
474         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
475         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
476         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
477         * Shared/DrawingAreaInfo.h:
478         * Shared/NativeWebKeyboardEvent.h:
479         * Shared/NativeWebMouseEvent.h:
480         * Shared/NativeWebTouchEvent.h:
481         * Shared/NativeWebWheelEvent.h:
482         * Shared/WebCoreArgumentCoders.cpp:
483         * Shared/WebCoreArgumentCoders.h:
484         * Shared/WebPreferencesDefinitions.h:
485         * Shared/wpe/NativeWebKeyboardEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
486         * Shared/wpe/NativeWebMouseEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
487         * Shared/wpe/NativeWebTouchEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
488         * Shared/wpe/NativeWebWheelEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
489         * Shared/wpe/ProcessExecutablePathWPE.cpp: Added.
490         * Shared/wpe/WebEventFactory.cpp: Added.
491         * Shared/wpe/WebEventFactory.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
492         * UIProcess/API/C/WKAPICast.h:
493         * UIProcess/API/C/wpe/WKAPICastWPE.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
494         * UIProcess/API/C/wpe/WKView.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
495         * UIProcess/API/C/wpe/WKView.h: Copied from Source/WebKit2/Shared/NativeWebWheelEvent.h.
496         * UIProcess/API/wpe/CompositingManagerProxy.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
497         * UIProcess/API/wpe/CompositingManagerProxy.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
498         * UIProcess/API/wpe/CompositingManagerProxy.messages.in: Added.
499         * UIProcess/API/wpe/DrawingAreaProxyWPE.cpp: Added.
500         * UIProcess/API/wpe/DrawingAreaProxyWPE.h: Copied from Source/WebKit2/Shared/NativeWebWheelEvent.h.
501         * UIProcess/API/wpe/PageClientImpl.cpp: Added.
502         * UIProcess/API/wpe/PageClientImpl.h: Added.
503         * UIProcess/API/wpe/ScrollGestureController.cpp: Added.
504         * UIProcess/API/wpe/ScrollGestureController.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
505         * UIProcess/API/wpe/WPEView.cpp: Added.
506         * UIProcess/API/wpe/WPEView.h: Added.
507         * UIProcess/API/wpe/WPEViewClient.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
508         * UIProcess/API/wpe/WPEViewClient.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
509         * UIProcess/API/wpe/WebKit2InspectorGResourceBundle.xml: Added.
510         * UIProcess/ChildProcessProxy.cpp:
511         * UIProcess/Launcher/ProcessLauncher.h:
512         * UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp: Added.
513         * UIProcess/WebInspectorProxy.h:
514         * UIProcess/WebPasteboardProxy.h:
515         * UIProcess/WebPasteboardProxy.messages.in:
516         * UIProcess/WebProcessPool.cpp:
517         * UIProcess/wpe/TextCheckerWPE.cpp: Added.
518         * UIProcess/wpe/WebInspectorProxyWPE.cpp: Added.
519         * UIProcess/wpe/WebPageProxyWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
520         * UIProcess/wpe/WebPasteboardProxyWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
521         * UIProcess/wpe/WebPreferencesWPE.cpp: Copied from Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h.
522         * UIProcess/wpe/WebProcessPoolWPE.cpp: Added.
523         * WebKit2.xcodeproj/project.pbxproj:
524         * WebKit2Prefix.h:
525         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
526         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
527         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
528         * WebProcess/WebCoreSupport/wpe/WebContextMenuClientWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
529         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp: Added.
530         * WebProcess/WebCoreSupport/wpe/WebPopupMenuWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
531         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
532         * WebProcess/WebPage/DrawingArea.cpp:
533         * WebProcess/WebPage/WebPage.cpp:
534         * WebProcess/WebPage/WebPage.h:
535         * WebProcess/WebPage/wpe/CompositingManager.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
536         * WebProcess/WebPage/wpe/CompositingManager.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
537         * WebProcess/WebPage/wpe/DrawingAreaWPE.cpp: Added.
538         * WebProcess/WebPage/wpe/DrawingAreaWPE.h: Added.
539         * WebProcess/WebPage/wpe/WebInspectorUIWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
540         * WebProcess/WebPage/wpe/WebInspectorWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
541         * WebProcess/WebPage/wpe/WebPageWPE.cpp: Copied from Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h.
542         * WebProcess/wpe/WebProcessMainWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
543         * wpe/wpe-webkit.pc.in: Added.
544
545 2017-05-09  Carlos Garcia Campos  <cgarcia@igalia.com>
546
547         [GTK] Building Webkit2Gtk without OpenGL fails.
548         https://bugs.webkit.org/show_bug.cgi?id=170959
549
550         Reviewed by Žan Doberšek.
551
552         * UIProcess/gtk/HardwareAccelerationManager.cpp:
553         (WebKit::HardwareAccelerationManager::HardwareAccelerationManager):
554
555 2017-05-08  Youenn Fablet  <youenn@apple.com>
556
557         Follow-up to bug 171710: use more references and reject if either audio or video source creation is failing
558         https://bugs.webkit.org/show_bug.cgi?id=171824
559
560         Reviewed by Alex Christensen.
561
562         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
563         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
564
565 2017-05-08  Brent Fulgham  <bfulgham@apple.com>
566
567         REGRESSION(r213564): Flash video playback failures
568         https://bugs.webkit.org/show_bug.cgi?id=171840
569         <rdar://problem/32041569>
570
571         Reviewed by Alexey Proskuryakov.
572
573         The sandbox restrictions added in r213564 to prevent access to unused iokit properties
574         blocked some items needed for Flash video playback. This change relaxes the sandbox
575         to allow this software to run properly.
576
577         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
578
579 2017-05-08  Alex Christensen  <achristensen@webkit.org>
580
581         Reduce PassRefPtr use in WebKit2
582         https://bugs.webkit.org/show_bug.cgi?id=171831
583
584         Reviewed by Chris Dumez.
585
586         * UIProcess/API/C/WKPageGroup.cpp:
587         (WKPageGroupCreateWithIdentifier):
588         * UIProcess/GenericCallback.h:
589         (WebKit::GenericCallback::create):
590         (WebKit::CallbackMap::put):
591         * UIProcess/StatisticsRequest.cpp:
592         (WebKit::StatisticsRequest::StatisticsRequest):
593         * UIProcess/StatisticsRequest.h:
594         (WebKit::StatisticsRequest::create):
595         * UIProcess/TextChecker.h:
596         * UIProcess/TextCheckerCompletion.cpp:
597         (WebKit::TextCheckerCompletion::create):
598         * UIProcess/TextCheckerCompletion.h:
599         * UIProcess/WebColorPicker.h:
600         (WebKit::WebColorPicker::create):
601         * UIProcess/WebConnectionToWebProcess.cpp:
602         (WebKit::WebConnectionToWebProcess::create):
603         * UIProcess/WebConnectionToWebProcess.h:
604         * UIProcess/WebContextInjectedBundleClient.cpp:
605         (WebKit::WebContextInjectedBundleClient::getInjectedBundleInitializationUserData):
606         * UIProcess/WebContextInjectedBundleClient.h:
607         * UIProcess/WebContextMenuListenerProxy.h:
608         (WebKit::WebContextMenuListenerProxy::create):
609         * UIProcess/WebCookieManagerProxy.cpp:
610         (WebKit::WebCookieManagerProxy::create):
611         * UIProcess/WebCookieManagerProxy.h:
612         * UIProcess/WebEditCommandProxy.h:
613         (WebKit::WebEditCommandProxy::create):
614         * UIProcess/WebFormSubmissionListenerProxy.h:
615         (WebKit::WebFormSubmissionListenerProxy::create):
616         * UIProcess/WebFrameListenerProxy.h:
617         * UIProcess/WebFrameProxy.h:
618         (WebKit::WebFrameProxy::create):
619         * UIProcess/WebFullScreenManagerProxy.cpp:
620         (WebKit::WebFullScreenManagerProxy::create):
621         * UIProcess/WebFullScreenManagerProxy.h:
622         * UIProcess/WebGeolocationManagerProxy.cpp:
623         (WebKit::WebGeolocationManagerProxy::create):
624         * UIProcess/WebGeolocationManagerProxy.h:
625         * UIProcess/WebIconDatabase.cpp:
626         (WebKit::WebIconDatabase::create):
627         (WebKit::WebIconDatabase::iconDataForPageURL):
628         * UIProcess/WebIconDatabase.h:
629         * UIProcess/WebMediaSessionFocusManager.cpp:
630         (WebKit::WebMediaSessionFocusManager::create):
631         * UIProcess/WebMediaSessionFocusManager.h:
632         * UIProcess/WebOpenPanelResultListenerProxy.h:
633         (WebKit::WebOpenPanelResultListenerProxy::create):
634         * UIProcess/WebPageGroup.cpp:
635         (WebKit::WebPageGroup::create):
636         * UIProcess/WebPageGroup.h:
637         * UIProcess/WebPageProxy.cpp:
638         (WebKit::WebPageProxy::forceRepaint):
639         (WebKit::WebPageProxy::computePagesForPrinting):
640         (WebKit::WebPageProxy::drawRectToImage):
641         (WebKit::WebPageProxy::drawPagesToPDF):
642         (WebKit::WebPageProxy::drawPagesForPrinting):
643         (WebKit::WebPageProxy::callAfterNextPresentationUpdate):
644         * UIProcess/WebPageProxy.h:
645         * UIProcess/ios/TextCheckerIOS.mm:
646         (WebKit::TextChecker::requestCheckingOfString):
647         * UIProcess/mac/TextCheckerMac.mm:
648         (WebKit::TextChecker::requestCheckingOfString):
649         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
650         * UIProcess/mac/WKFullScreenWindowController.mm:
651         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
652         * UIProcess/mac/WKPrintingView.mm:
653         (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]):
654         (-[WKPrintingView _drawPreview:]):
655         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
656         (WebKit::NetscapePlugin::loadURL):
657         (WebKit::NetscapePlugin::manualStreamDidReceiveResponse):
658         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
659         (WebKit::NetscapePluginStream::NetscapePluginStream):
660         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
661         (WebKit::NetscapePluginStream::create):
662         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
663         (WebKit::toFormData):
664
665 2017-05-08  Youenn Fablet  <youenn@apple.com>
666
667         Add support for reading and writing settings from UIProcess audio capture
668         https://bugs.webkit.org/show_bug.cgi?id=171633
669
670         Reviewed by Eric Carlson.
671
672         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
673         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
674         (WebKit::UserMediaCaptureManagerProxy::applyConstraints):
675         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
676         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
677         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
678         (WebKit::UserMediaCaptureManager::Source::setSettings):
679         (WebKit::UserMediaCaptureManager::Source::applyConstraintsSucceeded):
680         (WebKit::UserMediaCaptureManager::Source::applyConstraintsFailed):
681         (WebKit::UserMediaCaptureManager::createCaptureSource):
682         (WebKit::UserMediaCaptureManager::sourceSettingsChanged):
683         (WebKit::UserMediaCaptureManager::applyConstraints):
684         (WebKit::UserMediaCaptureManager::applyConstraintsSucceeded):
685         (WebKit::UserMediaCaptureManager::applyConstraintsFailed):
686         (WebKit::UserMediaCaptureManager::Source::setMuted): Deleted.
687         (WebKit::UserMediaCaptureManager::Source::setEnabled): Deleted.
688         * WebProcess/cocoa/UserMediaCaptureManager.h:
689         * WebProcess/cocoa/UserMediaCaptureManager.messages.in:
690
691 2017-05-08  Alex Christensen  <achristensen@webkit.org>
692
693         Reduce PassRefPtr use
694         https://bugs.webkit.org/show_bug.cgi?id=171809
695
696         Reviewed by Chris Dumez.
697
698         * PluginProcess/PluginControllerProxy.cpp:
699         (WebKit::PluginControllerProxy::setInitializationReply):
700         * PluginProcess/PluginControllerProxy.h:
701         * PluginProcess/WebProcessConnection.cpp:
702         (WebKit::WebProcessConnection::destroyPlugin):
703         (WebKit::WebProcessConnection::createPlugin):
704         * PluginProcess/WebProcessConnection.h:
705         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
706         (WebKit::WebChromeClient::runOpenPanel):
707         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
708         (WebKit::WebEditorClient::registerUndoStep):
709         * WebProcess/WebPage/VisitedLinkTableController.cpp:
710         (WebKit::VisitedLinkTableController::getOrCreate):
711         * WebProcess/WebPage/VisitedLinkTableController.h:
712         * WebProcess/WebPage/WebFrame.cpp:
713         (WebKit::WebFrame::hitTest):
714         (WebKit::WebFrame::createSelectionSnapshot):
715         * WebProcess/WebPage/WebFrame.h:
716         * WebProcess/WebPage/WebOpenPanelResultListener.cpp:
717         (WebKit::WebOpenPanelResultListener::create):
718         (WebKit::WebOpenPanelResultListener::WebOpenPanelResultListener):
719         * WebProcess/WebPage/WebOpenPanelResultListener.h:
720         * WebProcess/WebPage/WebPage.cpp:
721         (WebKit::WebPage::unapplyEditCommand):
722         (WebKit::WebPage::reapplyEditCommand):
723         * WebProcess/WebPage/WebPageGroupProxy.cpp:
724         (WebKit::WebPageGroupProxy::create):
725         * WebProcess/WebPage/WebPageGroupProxy.h:
726         * WebProcess/WebPage/WebUndoStep.cpp:
727         (WebKit::WebUndoStep::create):
728         * WebProcess/WebPage/WebUndoStep.h:
729         (WebKit::WebUndoStep::step):
730         (WebKit::WebUndoStep::WebUndoStep):
731         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
732         (WebKit::PlatformCALayerRemote::create):
733         (WebKit::PlatformCALayerRemote::clone):
734         (WebKit::PlatformCALayerRemote::animationForKey):
735         (WebKit::PlatformCALayerRemote::createCompatibleLayer):
736         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
737         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
738         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
739         (WebKit::PlatformCALayerRemoteCustom::create):
740         (WebKit::PlatformCALayerRemoteCustom::clone):
741
742 2017-05-08  Jer Noble  <jer.noble@apple.com>
743
744         [Mac] Audio capture fails when shouldCaptureAudioInUIProcess is set.
745         https://bugs.webkit.org/show_bug.cgi?id=171710
746
747         Reviewed by Eric Carlson.
748
749         RealtimeMediaSourceCenterMac's setUseAVFoundationAudioCapture() is now accessed via a singleton.
750
751         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
752         (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs):
753
754 2017-05-08  Andy Estes  <aestes@apple.com>
755
756         [macOS] com.macromedia.Flash Player ESR.plugin.sb is installed outside of PlugInSandboxProfiles
757         https://bugs.webkit.org/show_bug.cgi?id=171774
758
759         Reviewed by Dan Bernstein.
760
761         * WebKit2.xcodeproj/project.pbxproj:
762
763 2017-05-08  Youenn Fablet  <youenn@apple.com>
764
765         Clean UserMediaCaptureManager::capabilities return value
766         https://bugs.webkit.org/show_bug.cgi?id=171808
767
768         Reviewed by Eric Carlson.
769
770         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
771         (WebKit::UserMediaCaptureManager::capabilities):
772         * WebProcess/cocoa/UserMediaCaptureManager.h:
773
774 2017-05-08  Chris Dumez  <cdumez@apple.com>
775
776         Move 'style' from Element to HTMLElement / SVGElement and make it settable
777         https://bugs.webkit.org/show_bug.cgi?id=171795
778
779         Reviewed by Alex Christensen.
780
781         Build fix.
782
783         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
784         (WebKit::WebEditorClient::shouldApplyStyle):
785
786 2017-05-07  Simon Fraser  <simon.fraser@apple.com>
787
788         [iOS] REGRESSION (r209409): getBoundingClientRect is wrong for fixed-position elements in resize/orientationchange
789         https://bugs.webkit.org/show_bug.cgi?id=171140
790         rdar://problem/31765167
791
792         Reviewed by Sam Weinig.
793
794         WebPage::dynamicViewportSizeUpdate() is called during rotation, and does a layout which needs to have
795         an up-to-date layout viewport, since the layout viewport state is detectable in orientationchange and
796         resize events via fetching the client rect of fixed elements. Normally we send in the layout viewport
797         from the UI process, but in this case we need to compute one in the web process. So factor code
798         into FrameView to do the computation, called from both places.
799
800         * UIProcess/WebPageProxy.h:
801         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
802         (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect):
803         * UIProcess/ios/WKContentView.mm:
804         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
805         * UIProcess/ios/WebPageProxyIOS.mm:
806         (WebKit::WebPageProxy::computeCustomFixedPositionRect):
807         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
808         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
809         * WebProcess/WebPage/ios/WebPageIOS.mm:
810         (WebKit::WebPage::dynamicViewportSizeUpdate):
811
812 2017-05-07  Youenn Fablet  <youenn@apple.com>
813
814         [MediaStream] r216197 caused some webrtc tests to fail
815         https://bugs.webkit.org/show_bug.cgi?id=171728
816
817         Reviewed by Eric Carlson.
818
819         * UIProcess/UserMediaProcessManager.cpp:
820         (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Removing muting streams of the page requesting
821         additional capture streams. This is now done in the WebProcess.
822
823 2017-05-07  Tim Horton  <timothy_horton@apple.com>
824
825         Clean up some WebProcessProxy, WebPage, and message handler includes
826         https://bugs.webkit.org/show_bug.cgi?id=171791
827
828         Reviewed by Sam Weinig.
829
830         This is worth another ~10% off WebKit2 clean build time on Mac.
831         This time, the most impactful change is the removal of
832         UserMediaPermissionRequestManager.h from WebPage.h, which completely
833         eradicates JSC's VM.h (which is enormous) from WebPage.h (at least on Mac).
834
835         * Scripts/webkit/messages.py:
836         (headers_for_type):
837         Stop specializing CompositionUnderline now that it has its own file.
838
839         * Shared/API/c/WKDeprecatedFunctions.cpp:
840         * Shared/WebCoreArgumentCoders.cpp:
841         * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
842         * UIProcess/Gamepad/UIGamepadProvider.cpp:
843         * UIProcess/HiddenPageThrottlingAutoIncreasesCounter.h: Added.
844         * UIProcess/HighPerformanceGraphicsUsageSampler.cpp:
845         * UIProcess/Network/NetworkProcessProxy.cpp:
846         * UIProcess/PerActivityStateCPUUsageSampler.cpp:
847         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
848         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
849         (WebKit::toWebCore):
850         * UIProcess/VisibleWebPageCounter.h: Added.
851         * UIProcess/VisitedLinkStore.h:
852         * UIProcess/WebPageGroup.h:
853         * UIProcess/WebPageProxy.h:
854         * UIProcess/WebProcessLifetimeTracker.cpp:
855         * UIProcess/WebProcessPool.h:
856         * UIProcess/WebProcessProxy.h:
857         Remove WebPageProxy and forward-declare a whole bunch of things.
858
859         * WebKit2.xcodeproj/project.pbxproj:
860         * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
861         * WebProcess/WebPage/WebPage.cpp:
862         (WebKit::WebPage::userMediaAccessWasGranted):
863         (WebKit::WebPage::userMediaAccessWasDenied):
864         (WebKit::WebPage::didCompleteMediaDeviceEnumeration):
865         (WebKit::WebPage::grantUserMediaDeviceSandboxExtensions):
866         (WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions):
867         * WebProcess/WebPage/WebPage.h:
868         (WebKit::WebPage::userMediaPermissionRequestManager):
869         * WebProcess/WebPage/ios/FindControllerIOS.mm:
870         * WebProcess/WebPage/ios/WebPageIOS.mm:
871         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
872         (WebKit::RemoteLayerTreeContext::deviceScaleFactor): Deleted.
873         (WebKit::RemoteLayerTreeContext::layerHostingMode): Deleted.
874         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
875         (WebKit::RemoteLayerTreeContext::deviceScaleFactor):
876         (WebKit::RemoteLayerTreeContext::layerHostingMode):
877
878 2017-05-06  Chris Dumez  <cdumez@apple.com>
879
880         Align our IDL files with the latest DOM specification
881         https://bugs.webkit.org/show_bug.cgi?id=171777
882
883         Reviewed by Sam Weinig.
884
885         GTK build fix.
886
887         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
888         (webkit_dom_document_get_ready_state):
889
890 2017-05-06  Tim Horton  <timothy_horton@apple.com>
891
892         Reduce the number of includes in WebPage.h and WebProcess.h
893         https://bugs.webkit.org/show_bug.cgi?id=171779
894
895         Reviewed by Sam Weinig.
896
897         * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
898         * WebProcess/Network/NetworkProcessConnection.cpp:
899         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
900         * WebProcess/Network/webrtc/LibWebRTCResolver.cpp:
901         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
902         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
903         * WebProcess/WebPage/FindController.cpp:
904         * WebProcess/WebPage/WebFrame.cpp:
905         * WebProcess/WebPage/WebPage.cpp:
906         (WebKit::WebPage::disableEnumeratingAllNetworkInterfaces):
907         (WebKit::WebPage::enableEnumeratingAllNetworkInterfaces):
908         (WebKit::WebPage::didReceivePolicyDecision):
909         * WebProcess/WebPage/WebPage.h:
910         (WebKit::WebPage::disableEnumeratingAllNetworkInterfaces): Deleted.
911         (WebKit::WebPage::enableEnumeratingAllNetworkInterfaces): Deleted.
912         * WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
913         * WebProcess/WebProcess.cpp:
914         * WebProcess/WebProcess.h:
915         In my measurement, this improves WebKit2 debug clean build time by
916         ~10% for Mac and ~5% for iOS. The most valuable change is the one to
917         remove LibWebRTC headers..
918
919 2017-05-06  Alexey Proskuryakov  <ap@apple.com>
920
921         REGRESSION (r216294): The new test fails on WebKit1
922         https://bugs.webkit.org/show_bug.cgi?id=171780
923
924         Rolling back https://trac.webkit.org/r216294, https://trac.webkit.org/r216296,
925         https://trac.webkit.org/216299, https://trac.webkit.org/216330
926
927         * WebProcess/Plugins/PluginView.cpp:
928         (WebKit::PluginView::paint):
929         * WebProcess/Plugins/PluginView.h:
930
931 2017-05-06  Simon Fraser  <simon.fraser@apple.com>
932
933         [iOS WK2] Make rotation tests more reliable
934         https://bugs.webkit.org/show_bug.cgi?id=171778
935
936         Reviewed by Tim Horton.
937
938         Switching between "safari-style" rotation and normal rotation left state on the WKWebView
939         that would cause later viewport-sensitive tests to fail. The WKWebView would be left
940         with override layout parameters, and an override orientation, and these caused viewport
941         size to leak into later tests, and WebCore orientation to not get reset correctly.
942
943         Also, WKWebView was unregistering for UIWindowDidRotateNotification notifications when
944         an override orientation was set, and would never re-register, causing lost orientationchanged
945         events.
946
947         Fix by exposing WKWebView SPI to clear the various bits of overide state. Also don't unregister
948         from the UIWindowDidRotateNotification notification; it's already ignored anyway if it fires.
949
950         Also wait for a visible content rect update after resizing the WKWebVeiw between tests, to make sure
951         the WebProcess is caught up before proceeding with the test.
952
953         * UIProcess/API/Cocoa/WKWebView.mm:
954         (-[WKWebView _setInterfaceOrientationOverride:]):
955         (-[WKWebView _clearInterfaceOrientationOverride]):
956         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
957         (-[WKWebView _clearOverrideLayoutParameters]):
958         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
959
960 2017-05-06  Konstantin Tokarev  <annulen@yandex.ru>
961
962         Remove unused lambda capture
963         https://bugs.webkit.org/show_bug.cgi?id=171772
964
965         Reviewed by Yusuke Suzuki.
966
967         * DatabaseProcess/DatabaseProcess.cpp:
968         (WebKit::DatabaseProcess::fetchWebsiteData):
969
970 2017-05-06  David Kilzer  <ddkilzer@apple.com>
971
972         messages_unittest.py should support a [-r|--reset-results] switch
973         <https://webkit.org/b/171627>
974
975         Reviewed by Daniel Bates.
976
977         This change adds support for a [-r|--reset-results] switch when
978         running messages_unittest.py to make it easy to update the
979         expected file results.
980
981         This also cleans up a lot of duplicate code in
982         messages_unittest.py by extracting common code into new methods
983         and by pushing code down into methods where it's actually used.
984
985         * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
986         * Scripts/webkit/LegacyMessages-expected.h:
987         * Scripts/webkit/MessageReceiver-expected.cpp:
988         * Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
989         * Scripts/webkit/Messages-expected.h:
990         * Scripts/webkit/MessagesSuperclass-expected.h:
991         - Update expected files using the new --reset-results switch.
992
993         * Scripts/webkit/messages_unittest.py:
994         - Remove what appears to be a debugging print statement.
995         - Replace the code that reads in expected files with variables
996           that contain the expected file names.  The code to read in the
997           contents moved into
998           GeneratedFileContentsTest.assertGeneratedFileContentsEqual().
999         (ParsingTest.check_message):
1000         - Drive-by fix to change "!= None" to "is not None".
1001         (GeneratedFileContentsTest.assertGeneratedFileContentsEqual):
1002         - Add support for [-r|--reset-results] switch here.  This will
1003           write out updated expected file contents when the switch is
1004           used.
1005         - Push down most of the global code that reads in file contents
1006           into this method.
1007         - Change use of split('\n') into splitlines(False).
1008         (GeneratedFileContentsTest.assertHeaderEqual): Add.
1009         - Extracts common code from test_receiver_headers().
1010         (GeneratedFileContentsTest.assertImplementationEqual): Add.
1011         - Extracts common code from test_receiver_implementations().
1012         (HeaderTest):
1013         (HeaderTest.test_receiver_headers):
1014         - Rename from HeaderTest.test_header().
1015         - Simplify by calling assertHeaderEqual().
1016         (ReceiverImplementationTest):
1017         (ReceiverImplementationTest.test_receiver_implementations):
1018         - Rename from
1019           ReceiverImplementationTest.test_receiver_implementation().
1020         - Simplify by calling assertImplementationEqual().
1021         (add_reset_results_to_unittest_help): Add.
1022         - Inserts help text for [-r|--reset-results] switch.
1023         (parse_sys_argv): Add.
1024         - Parses [-r|--reset-results] switch, and then removes it from
1025           sys.argv.  We do this instead of using argparse so that the
1026           original help for the unittest module is still shown when
1027           using --help.
1028
1029 2017-05-05  Timothy Horton  <timothy_horton@apple.com>
1030
1031         [Mac] Adjust cursor position for dragged link (and stop it from moving based on how fast you are dragging)
1032         https://bugs.webkit.org/show_bug.cgi?id=171764
1033         <rdar://problem/32005865>
1034
1035         Reviewed by Simon Fraser.
1036
1037         * UIProcess/Cocoa/WebViewImpl.mm:
1038         (WebKit::WebViewImpl::dragImageForView):
1039         Always use the last mouse down event to originate the drag; this was a 2004 hack
1040         to work around a seemingly-fixed macOS bug that somehow propagated into WebKit2.
1041         With WebKit2, this would cause trouble because currentEvent could move on
1042         during the bounce to the Web Content process and back, causing the delta between
1043         clientPoint and the mouse point to be dependent on timing, and thus causing the
1044         link to sit at timing-dependent distance from the cursor, instead of exactly
1045         where dragOffsetForLinkDragImage placed it.
1046
1047 2017-05-05  Brady Eidson  <beidson@apple.com>
1048
1049         API test WebKit2.WebsiteDataStoreCustomPaths is failing on ios-simulator.
1050         <rdar://problem/31977294> and https://bugs.webkit.org/show_bug.cgi?id=171513
1051
1052         Reviewed by Andy Estes.
1053
1054         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1055         (WebKit::NetworkProcess::syncAllCookies):
1056
1057 2017-05-05  Dean Jackson  <dino@apple.com>
1058
1059         Restrict SVG filters to accessible security origins
1060         https://bugs.webkit.org/show_bug.cgi?id=118689
1061         <rdar://problem/27362159>
1062
1063         Reviewed by Brent Fulgham.
1064
1065         Update parameter lists.
1066
1067         * WebProcess/Plugins/PluginView.cpp:
1068         (WebKit::PluginView::paint):
1069         * WebProcess/Plugins/PluginView.h:
1070
1071 2017-05-05  Beth Dakin  <bdakin@apple.com>
1072
1073         Ensure NSColorPickerTouchBarItem only uses sRGB colors
1074         https://bugs.webkit.org/show_bug.cgi?id=171758
1075         -and corresponding-
1076         rdar://problem/28314183
1077
1078         Reviewed by Tim Horton.
1079
1080         * UIProcess/Cocoa/WebViewImpl.mm:
1081         (-[WKTextTouchBarItemController itemForIdentifier:]):
1082
1083 2017-05-05  Brent Fulgham  <bfulgham@apple.com>
1084
1085         [WK2][iOS][macOS] Expand sandbox to access vm.footprint_suspend 
1086         https://bugs.webkit.org/show_bug.cgi?id=171749
1087         <rdar://problem/32019494>
1088
1089         Reviewed by Geoffrey Garen.
1090
1091         The 'sysctl' whitelist needs to be extended to support an additional VM-related feature.
1092
1093         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
1094         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1095         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1096         * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb:
1097         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1098         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1099         * WebProcess/com.apple.WebProcess.sb.in:
1100
1101 2017-05-05  John Wilander  <wilander@apple.com>
1102
1103         Resource Load Statistics: Don't cover in-memory and disk caches during website data removal
1104         https://bugs.webkit.org/show_bug.cgi?id=171741
1105         <rdar://problem/32020691>
1106
1107         Reviewed by Brent Fulgham.
1108
1109         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1110         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
1111             No longer removes WebsiteDataType::DiskCache or WebsiteDataType::MemoryCache.
1112
1113 2017-05-05  Brian Burg  <bburg@apple.com>
1114
1115         CrashTracer: [USER] com.apple.WebKit.WebContent.Development at com.apple.WebCore: WebCore::commonVMSlow + 57
1116         https://bugs.webkit.org/show_bug.cgi?id=171669
1117         <rdar://problem/31967684>
1118
1119         Reviewed by Mark Lam.
1120
1121         safaridriver's AutomaticInspection capability causes us to call WebInspectorProxy::connect()
1122         underneath the Automation.inspectBrowsingContext command. This fires a NeedDebuggerBreak
1123         interrupt for the web content's VM, but this is racy because the web content process may
1124         not yet be fully initialized when this interrupt is handled.
1125
1126         To work around this, just don't deliver any interrupts if the VM singleton is still null.
1127         This is a reliable signal that the web content process is not fully initialized yet. Not delivering
1128         is harmless; the interrupt only exists to break out of infinite loops in JS code, but there
1129         could not be any such infinite loop yet if the web content process is not fully initialized.
1130
1131         * WebProcess/WebPage/WebInspectorInterruptDispatcher.cpp:
1132         (WebKit::WebInspectorInterruptDispatcher::notifyNeedDebuggerBreak):
1133
1134 2017-05-05  Brian Burg  <bburg@apple.com>
1135
1136         Web Automation: cookie-related commands don't work correctly
1137         https://bugs.webkit.org/show_bug.cgi?id=171713
1138         <rdar://problem/29829930>
1139
1140         Reviewed by Alexey Proskuryakov.
1141
1142         Commands that use WebCookieManager directly should complete when
1143         the manager's completion handler is called. Otherwise, this will race
1144         with subsequent accesses to cookies via the web process (document.cookie).
1145
1146         Also, these commands need to use the active browsing context's session ID.
1147         They currently use the process pool's storage session, which is wrong
1148         since we specially configure automation instances with an ephemeral store.
1149
1150         * UIProcess/Automation/WebAutomationSession.cpp:
1151         (WebKit::WebAutomationSession::addSingleCookie):
1152         (WebKit::WebAutomationSession::deleteAllCookies):
1153
1154 2017-05-05  Chris Dumez  <cdumez@apple.com>
1155
1156         Rename webProcessDidCrashWithReason callback to webProcessDidTerminate and stop calling webProcessDidCrash for client terminations
1157         https://bugs.webkit.org/show_bug.cgi?id=171624
1158
1159         Reviewed by Dan Bernstein.
1160
1161         Follow-up fixes after r216129 based on feedback I have received:
1162         - Rename webProcessDidCrashWithReason callback function to webProcessDidTerminate given that this is called
1163           for non-crashes (e.g. terminations requested by the client).
1164         - Rename WKProcessCrashReason / ProcessCrashReason to WKProcessTerminationReason / ProcessTerminationReason
1165           for consistency with the new naming.
1166         - Stop calling processDidCrash / webProcessDidCrash for terminations requested by the client, to maintain
1167           pre-r216129 behavior. Those are not crashes (The client used an API such as WKPageTerminateProcess()).
1168           webProcessDidTerminate will still be called though.
1169         - Fix a bug where - for terminations due to resource limits - WebPageProxy::processDidCrash() was getting
1170           called twice: First by WebProcessProxy::requestTermination() with reason "RequestedByClient" then a
1171           second time by WebProcessProxy::terminateProcessDueToResourceLimits() with the proper reason.
1172
1173         * Shared/ProcessTerminationReason.h: Renamed from Source/WebKit2/Shared/ProcessCrashReason.h.
1174         * UIProcess/API/APINavigationClient.h:
1175         (API::NavigationClient::processDidTerminate):
1176         * UIProcess/API/C/WKAPICast.h:
1177         (WebKit::toAPI):
1178         * UIProcess/API/C/WKPage.cpp:
1179         (WKPageTerminate):
1180         (WKPageSetPageNavigationClient):
1181         * UIProcess/API/C/WKPageNavigationClient.h:
1182         * UIProcess/API/C/WKProcessTerminationReason.h: Renamed from Source/WebKit2/UIProcess/API/C/WKProcessCrashReason.h.
1183         * UIProcess/API/Cocoa/WKWebView.mm:
1184         (-[WKWebView _killWebContentProcessAndResetState]):
1185         * UIProcess/Cocoa/NavigationState.h:
1186         * UIProcess/Cocoa/NavigationState.mm:
1187         (WebKit::NavigationState::NavigationClient::processDidTerminate):
1188         * UIProcess/WebPageProxy.cpp:
1189         (WebKit::WebPageProxy::processDidTerminate):
1190         * UIProcess/WebPageProxy.h:
1191         * UIProcess/WebProcessProxy.cpp:
1192         (WebKit::WebProcessProxy::didClose):
1193         (WebKit::WebProcessProxy::requestTermination):
1194         (WebKit::WebProcessProxy::logDiagnosticMessageForResourceLimitTermination):
1195         (WebKit::WebProcessProxy::didExceedActiveMemoryLimit):
1196         (WebKit::WebProcessProxy::didExceedInactiveMemoryLimit):
1197         (WebKit::WebProcessProxy::didExceedBackgroundCPULimit):
1198         * UIProcess/WebProcessProxy.h:
1199         * WebKit2.xcodeproj/project.pbxproj:
1200
1201 2017-05-05  Derek Schuff  <dschuff@chromium.org>
1202
1203         Mac cmake buildfix after r216037
1204         https://bugs.webkit.org/show_bug.cgi?id=171558
1205
1206         Reviewed by JF Bastien.
1207
1208         * PlatformMac.cmake:
1209
1210 2017-05-05  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1211
1212         [GTK] Enable runtime flag for MediaDevices with enable-media-stream property.
1213         https://bugs.webkit.org/show_bug.cgi?id=171730
1214
1215         Reviewed by Michael Catanzaro.
1216
1217         After r215939 the MediaDevices runtime setting has to be enabled
1218         also to use MediaStream / WebRTC.
1219
1220         Enable it as part of the enable-media-stream property of the
1221         WebKitGTK+ API.
1222
1223         * UIProcess/API/gtk/WebKitSettings.cpp:
1224         (webkit_settings_set_enable_media_stream):
1225
1226 2017-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1227
1228         [GTK] Assertion failure in Inspector::RemoteInspector::setRemoteInspectorClient when disposing WebKitWebContext
1229         https://bugs.webkit.org/show_bug.cgi?id=171644
1230
1231         Reviewed by Michael Catanzaro.
1232
1233         Ensure that it's not possible to enable automation in more than one WebKitWebContext at the same time. Instead
1234         of creating the AutomationClient unconditionally when the context is constructed, it's now created only when
1235         automation is enabled, and deleted if it's disabled.
1236
1237         * UIProcess/API/gtk/WebKitWebContext.cpp:
1238         (webkitWebContextConstructed):
1239         (webkit_web_context_is_automation_allowed):
1240         (webkit_web_context_set_automation_allowed):
1241         * UIProcess/Cocoa/AutomationClient.mm:
1242         (WebKit::AutomationClient::AutomationClient):
1243         (WebKit::AutomationClient::~AutomationClient):
1244
1245 2017-05-04  Commit Queue  <commit-queue@webkit.org>
1246
1247         Unreviewed, rolling out r216206.
1248         https://bugs.webkit.org/show_bug.cgi?id=171714
1249
1250         Multiple LayoutTests crashing in Document::page() (Requested
1251         by ap on #webkit).
1252
1253         Reverted changeset:
1254
1255         "Remove support for legacy Notifications"
1256         https://bugs.webkit.org/show_bug.cgi?id=171487
1257         http://trac.webkit.org/changeset/216206
1258
1259 2017-05-04  Mark Lam  <mark.lam@apple.com>
1260
1261         NeverDestroyed<String>(ASCIILiteral(...)) is not thread safe.
1262         https://bugs.webkit.org/show_bug.cgi?id=171586
1263         <rdar://problem/31873190>
1264
1265         Reviewed by Yusuke Suzuki.
1266
1267         * Shared/API/APIError.cpp:
1268         (API::Error::webKitErrorDomain):
1269         (API::Error::webKitNetworkErrorDomain):
1270         (API::Error::webKitPolicyErrorDomain):
1271         (API::Error::webKitPluginErrorDomain):
1272         (API::Error::webKitDownloadErrorDomain):
1273         (API::Error::webKitPrintErrorDomain):
1274         * Shared/WebPreferencesKeys.cpp:
1275         * UIProcess/WebPageProxy.cpp:
1276         (WebKit::WebPageProxy::executeEditCommand):
1277         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1278         (WebKit::WebEditorClient::didBeginEditing):
1279         (WebKit::WebEditorClient::respondToChangedContents):
1280         (WebKit::WebEditorClient::respondToChangedSelection):
1281         (WebKit::WebEditorClient::didEndEditing):
1282
1283 2017-05-04  Jeremy Jones  <jeremyj@apple.com>
1284
1285         Add mute to WebPlaybackSessionModel.
1286         https://bugs.webkit.org/show_bug.cgi?id=171592
1287         rdar://problem/31814074
1288
1289         Reviewed by Jer Noble.
1290
1291         Plumb through muted.
1292
1293         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
1294         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in:
1295         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
1296         (WebKit::WebPlaybackSessionModelContext::toggleMuted):
1297         (WebKit::WebPlaybackSessionModelContext::setMuted):
1298         (WebKit::WebPlaybackSessionManagerProxy::setMuted):
1299         (WebKit::WebPlaybackSessionManagerProxy::toggleMuted):
1300         * WebProcess/cocoa/WebPlaybackSessionManager.h:
1301         * WebProcess/cocoa/WebPlaybackSessionManager.messages.in:
1302         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
1303         (WebKit::WebPlaybackSessionInterfaceContext::mutedChanged):
1304         (WebKit::WebPlaybackSessionManager::mutedChanged):
1305         (WebKit::WebPlaybackSessionManager::toggleMuted):
1306
1307 2017-05-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1308
1309         [WK2] Image action sheets sometimes do not dismiss when beginning data interaction
1310         https://bugs.webkit.org/show_bug.cgi?id=171687
1311         <rdar://problem/31996534>
1312
1313         Reviewed by Beth Dakin.
1314
1315         When presenting an image sheet using WKActionSheetAssistant, we may present the popover asynchronously. In this
1316         case, even if -cleanupSheet is invoked after -showImageSheet, the popover will still be presented. To fix this,
1317         add a flag, _hasPendingActionSheet, that is set to true when an image action sheet will be presented in the
1318         future.
1319
1320         In cleanupSheet, we revert this flag to NO, and in the sheet presentation block, we first check to see if there
1321         is a pending action sheet. If there is not, then simply do not invoke the image sheet presentation block.
1322
1323         * UIProcess/ios/WKActionSheetAssistant.mm:
1324         (-[WKActionSheetAssistant showImageSheet]):
1325         (-[WKActionSheetAssistant cleanupSheet]):
1326
1327 2017-05-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1328
1329         [WK2] Add support for keeping the selection in a focused editable element when dragging begins
1330         https://bugs.webkit.org/show_bug.cgi?id=171585
1331         <rdar://problem/31544320>
1332
1333         Reviewed by Beth Dakin and Zalan Bujtas.
1334
1335         Minor adjustments and refactoring in WebKit2. See WebCore ChangeLog for more details.
1336
1337         * UIProcess/WebPageProxy.cpp:
1338         (WebKit::WebPageProxy::startDrag):
1339         (WebKit::WebPageProxy::didStartDrag):
1340
1341         Factor out code in WebPageProxy that sends a WebPage::DidStartDrag message to the web process into a separate
1342         helper, and tweak the places where we directly send this IPC message to the web process to instead call this
1343         helper.
1344
1345         * UIProcess/WebPageProxy.h:
1346         * UIProcess/mac/WebPageProxyMac.mm:
1347         (WebKit::WebPageProxy::setDragImage):
1348         * WebProcess/WebPage/WebPage.cpp:
1349         (WebKit::WebPage::didStartDrag):
1350         (WebKit::WebPage::dragCancelled):
1351
1352         Clear out state in the web process and call out to the EventHandler to handle drag cancellation and the drag
1353         start response from the UI process.
1354
1355         * WebProcess/WebPage/WebPage.h:
1356         (WebKit::WebPage::didStartDrag): Deleted.
1357         (WebKit::WebPage::dragCancelled): Deleted.
1358
1359 2017-05-04  Sam Weinig  <sam@webkit.org>
1360
1361         Remove support for legacy Notifications
1362         https://bugs.webkit.org/show_bug.cgi?id=171487
1363
1364         Reviewed by Jon Lee.
1365
1366         * Configurations/FeatureDefines.xcconfig:
1367         * Shared/WebProcessCreationParameters.cpp:
1368         * Shared/WebProcessCreationParameters.h:
1369         * UIProcess/WebProcessPool.cpp:
1370         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1371         * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
1372         * WebProcess/Notifications/NotificationPermissionRequestManager.h:
1373         * WebProcess/Notifications/WebNotificationManager.cpp:
1374         * WebProcess/Notifications/WebNotificationManager.h:
1375         * WebProcess/WebCoreSupport/WebNotificationClient.cpp:
1376         * WebProcess/WebCoreSupport/WebNotificationClient.h:
1377         * WebProcess/WebPage/WebPage.cpp:
1378         * WebProcess/WebProcess.cpp:
1379         Remove legacy notification specific code.
1380
1381 2017-05-04  Eric Carlson  <eric.carlson@apple.com>
1382
1383         [MediaStream] Allow host application to enable/disable media capture
1384         https://bugs.webkit.org/show_bug.cgi?id=171292
1385         <rdar://problem/31821492>
1386
1387         Reviewed by Jer Noble.
1388
1389         * UIProcess/API/C/WKPage.cpp:
1390         (WKPageSetMediaCaptureEnabled): New.
1391         (WKPageGetMediaCaptureEnabled): New.
1392         * UIProcess/API/C/WKPagePrivate.h:
1393
1394         * UIProcess/API/Cocoa/WKWebView.mm:
1395         (-[WKWebView _setMediaCaptureEnabled:]): New.
1396         (-[WKWebView _mediaCaptureEnabled]): New.
1397         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1398
1399         * UIProcess/Cocoa/UIDelegate.mm:
1400         (WebKit::UIDelegate::setDelegate): Initialize webViewRequestUserMediaAuthorizationForDevicesURLMainFrameURLDecisionHandler
1401         and webViewCheckUserMediaPermissionForURLMainFrameURLFrameIdentifierDecisionHandler on macOS
1402         and iOS.
1403
1404         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1405         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
1406         Initialize the rejection timer.
1407         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
1408         Call invalidatePendingRequests.
1409         (WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests): Invalidate all
1410         pending requests.
1411         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
1412         (WebKit::UserMediaPermissionRequestManagerProxy::rejectionTimerFired): Reject a promise and
1413         schedule the timer if there are any others pending.
1414         (WebKit::UserMediaPermissionRequestManagerProxy::scheduleNextRejection): 
1415         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Don't
1416         prompt the user if capture is disabled.
1417         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Deleted.
1418         (WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState): Deleted.
1419         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1420
1421         * UIProcess/UserMediaProcessManager.cpp:
1422         (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Stop capture in the current
1423         page on iOS.
1424         (WebKit::UserMediaProcessManager::setCaptureEnabled):
1425         * UIProcess/UserMediaProcessManager.h:
1426
1427         * UIProcess/WebPageProxy.cpp:
1428         (WebKit::WebPageProxy::setMediaCaptureEnabled):
1429
1430         * UIProcess/WebPageProxy.h:
1431         (WebKit::WebPageProxy::mediaCaptureEnabled):
1432
1433         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1434         (WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): New, cancel all pending
1435         requests.
1436         (WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest): Deny the request.
1437         (WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration):
1438         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
1439
1440         * WebProcess/WebPage/WebPage.cpp:
1441         (WebKit::WebPage::stopMediaCapture):
1442         * WebProcess/WebPage/WebPage.h:
1443         * WebProcess/WebPage/WebPage.messages.in:
1444
1445 2017-05-04  Konstantin Tokarev  <annulen@yandex.ru>
1446
1447         Fix compilation with ICU 59.1
1448         https://bugs.webkit.org/show_bug.cgi?id=171612
1449
1450         Reviewed by Mark Lam.
1451
1452         ICU 59.1 has broken source compatibility. Now it defines UChar as
1453         char16_t, which does not allow automatic type conversion from unsigned
1454         short in C++ code.
1455
1456         * Shared/API/c/WKString.cpp:
1457         (WKStringGetCharacters):
1458
1459 2017-05-04  Dan Bernstein  <mitz@apple.com>
1460
1461         [Cocoa] -[WKWebsiteDataStore httpCookieStore] is declared in the main @interface but implemented in a category
1462         https://bugs.webkit.org/show_bug.cgi?id=171657
1463
1464         Reviewed by Sam Weinig.
1465
1466         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1467         (-[WKWebsiteDataStore httpCookieStore]): Moved from the WKPrivate category into the main
1468           @implementation block.
1469
1470 2017-05-04  Andy Estes  <aestes@apple.com>
1471
1472         [Cocoa] Add an optional width parameter to -[WKWebProcessPlugInNodeHandle renderedImageWithOptions:]
1473         https://bugs.webkit.org/show_bug.cgi?id=171646
1474         <rdar://problem/30306321>
1475
1476         Reviewed by Tim Horton.
1477
1478         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
1479         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
1480         (-[WKWebProcessPlugInNodeHandle renderedImageWithOptions:]): Called
1481         -renderedImageWithOptions:width: with a nil width.
1482         (-[WKWebProcessPlugInNodeHandle renderedImageWithOptions:width:]): Passed an optional width
1483         to InjectedBundleNodeHandle::renderedImage().
1484         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
1485         (WebKit::imageForRect): If a width is specified, create an image graphics context at that
1486         width, preserving the aspect ratio of paintingRect.
1487         (WebKit::InjectedBundleNodeHandle::renderedImage):
1488         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
1489
1490 2017-05-04  Commit Queue  <commit-queue@webkit.org>
1491
1492         Unreviewed, rolling out r216172.
1493         https://bugs.webkit.org/show_bug.cgi?id=171654
1494
1495         FTBFS for iOS due to missing WebPageProxy::stopMediaCapture()
1496         implementation. (Requested by ddkilzer on #webkit).
1497
1498         Reverted changeset:
1499
1500         "[MediaStream] Allow host application to enable/disable media
1501         capture"
1502         https://bugs.webkit.org/show_bug.cgi?id=171292
1503         http://trac.webkit.org/changeset/216172
1504
1505 2017-05-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1506
1507         [Threaded Compositor] SHOULD NEVER BE REACHED in WebKit::CompositingRunLoop::updateCompleted
1508         https://bugs.webkit.org/show_bug.cgi?id=171336
1509
1510         Reviewed by Michael Catanzaro.
1511
1512         We are assuming that all calls to ThreadedCompositor::renderLayerTree() happen because of an scheduled update,
1513         but that's not true in the case of ThreadedCompositor::forceRepaint(). In that case we never want to call
1514         CompositingRunLoop::updateCompleted().
1515
1516         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1517         (WebKit::ThreadedCompositor::forceRepaint):
1518         (WebKit::ThreadedCompositor::sceneUpdateFinished):
1519         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1520
1521 2017-05-04  David Kilzer  <ddkilzer@apple.com>
1522
1523         check-webkit-style exits with an error while parsing Source/WebKit2/Scripts/webkit/ directory: KeyError: 'st'
1524         <https://bugs.webkit.org/show_bug.cgi?id=171510>
1525
1526         Reviewed by Daniel Bates.
1527
1528         The problem was that 'import parser' was ambiguous since there
1529         is a built-in parser module that comes with Python.  Changing
1530         'import parser' to 'from webkit import parser' fixed the error
1531         in check-webkit-style (and pylint) by forcing it to load the
1532         local 'parser' module, but then running messages_unittest.py
1533         directly would fail because .../Source/WebKit2/Scripts was not
1534         in the module search path by default.  This is fixed by using
1535         sys.path.append() to add .../Source/WebKit2/Scripts to the
1536         module search path based on the path to messages_unittest.py.
1537
1538         As an added bonus, this patch also fixes all webkit-style issues
1539         in Source/WebKit2/Scripts/webkit/*.py files.
1540
1541         * Scripts/webkit/messages.py:
1542         - Separate local module imports from built-in modules for
1543           consistency.
1544         - Fix whitespace issues for check-webkit-style, and remove stray
1545           semi-colon.
1546         * Scripts/webkit/messages_unittest.py:
1547         - Update sys.path to find the 'webkit' module based on the path
1548           to messages_unittest.py.  This makes 'from webkit import ...'
1549           statements work when running messages_unittest.py directly.
1550         - Change 'messages' and 'parser' modules to use
1551           'from webkit import ...' format for consistency.
1552         - Fix whitespace issues for check-webkit-style.
1553         * Scripts/webkit/model.py:
1554         - Fix whitespace issue for check-webkit-style.
1555         * Scripts/webkit/parser.py:
1556         - Fix whitespace issue for check-webkit-style.
1557
1558 2017-05-03  Eric Carlson  <eric.carlson@apple.com>
1559
1560         [MediaStream] Allow host application to enable/disable media capture
1561         https://bugs.webkit.org/show_bug.cgi?id=171292
1562         <rdar://problem/31821492>
1563
1564         Reviewed by Jer Noble.
1565
1566         * UIProcess/API/C/WKPage.cpp:
1567         (WKPageSetMediaCaptureEnabled): New.
1568         (WKPageGetMediaCaptureEnabled): New.
1569         * UIProcess/API/C/WKPagePrivate.h:
1570
1571         * UIProcess/API/Cocoa/WKWebView.mm:
1572         (-[WKWebView _setMediaCaptureEnabled:]): New.
1573         (-[WKWebView _mediaCaptureEnabled]): New.
1574         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1575
1576         * UIProcess/Cocoa/UIDelegate.mm:
1577         (WebKit::UIDelegate::setDelegate): Initialize webViewRequestUserMediaAuthorizationForDevicesURLMainFrameURLDecisionHandler
1578         and webViewCheckUserMediaPermissionForURLMainFrameURLFrameIdentifierDecisionHandler on macOS
1579         and iOS.
1580
1581         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1582         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
1583         Initialize the rejection timer.
1584         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
1585         Call invalidatePendingRequests.
1586         (WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests): Invalidate all
1587         pending requests.
1588         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
1589         (WebKit::UserMediaPermissionRequestManagerProxy::rejectionTimerFired): Reject a promise and
1590         schedule the timer if there are any others pending.
1591         (WebKit::UserMediaPermissionRequestManagerProxy::scheduleNextRejection): 
1592         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Don't
1593         prompt the user if capture is disabled.
1594         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Deleted.
1595         (WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState): Deleted.
1596         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1597
1598         * UIProcess/UserMediaProcessManager.cpp:
1599         (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Stop capture in the current
1600         page on iOS.
1601         (WebKit::UserMediaProcessManager::setCaptureEnabled):
1602         * UIProcess/UserMediaProcessManager.h:
1603
1604         * UIProcess/WebPageProxy.cpp:
1605         (WebKit::WebPageProxy::setMediaCaptureEnabled):
1606
1607         * UIProcess/WebPageProxy.h:
1608         (WebKit::WebPageProxy::mediaCaptureEnabled):
1609
1610         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1611         (WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): New, cancel all pending
1612         requests.
1613         (WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest): Deny the request.
1614         (WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration):
1615         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
1616
1617         * WebProcess/WebPage/WebPage.cpp:
1618         (WebKit::WebPage::stopMediaCapture):
1619         * WebProcess/WebPage/WebPage.h:
1620         * WebProcess/WebPage/WebPage.messages.in:
1621
1622 2017-05-03  John Wilander  <wilander@apple.com>
1623
1624         Resource Load Statistics: Remove all statistics for modifiedSince website data removals
1625         https://bugs.webkit.org/show_bug.cgi?id=171584
1626         <rdar://problem/24702576>
1627
1628         Reviewed by Brent Fulgham.
1629
1630         These are all test infrastructure changes.
1631
1632         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
1633         (WKResourceLoadStatisticsManagerClearInMemoryAndPersistentStoreModifiedSinceHours):
1634         * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
1635         * UIProcess/WebResourceLoadStatisticsManager.cpp:
1636         (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStoreModifiedSinceHours):
1637         * UIProcess/WebResourceLoadStatisticsManager.h:
1638
1639 2017-05-03  Timothy Horton  <timothy_horton@apple.com>
1640
1641         Maintain interaction information imageURL as a URL, not a string
1642         https://bugs.webkit.org/show_bug.cgi?id=171639
1643
1644         Reviewed by Sam Weinig.
1645
1646         * Shared/ios/InteractionInformationAtPosition.h:
1647         * UIProcess/ios/WKContentViewInteraction.mm:
1648         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
1649         (-[WKContentView _previewItemController:commitPreview:]):
1650         * WebProcess/WebPage/ios/WebPageIOS.mm:
1651         (WebKit::WebPage::getPositionInformation):
1652
1653 2017-05-03  Commit Queue  <commit-queue@webkit.org>
1654
1655         Unreviewed, rolling out r216160 and r216161.
1656         https://bugs.webkit.org/show_bug.cgi?id=171640
1657
1658         These changes broke the iOS build. (Requested by mlewis13 on
1659         #webkit).
1660
1661         Reverted changesets:
1662
1663         "[MediaStream] Allow host application to enable/disable media
1664         capture"
1665         https://bugs.webkit.org/show_bug.cgi?id=171292
1666         http://trac.webkit.org/changeset/216160
1667
1668         "[MediaStream] Allow host application to enable/disable media
1669         capture"
1670         https://bugs.webkit.org/show_bug.cgi?id=171292
1671         http://trac.webkit.org/changeset/216161
1672
1673 2017-05-03  Eric Carlson  <eric.carlson@apple.com>
1674
1675         [MediaStream] Allow host application to enable/disable media capture
1676         https://bugs.webkit.org/show_bug.cgi?id=171292
1677         <rdar://problem/31821492>
1678
1679         Unreviewed build fix.
1680
1681         * UIProcess/WebPageProxy.cpp:
1682         (WebKit::WebPageProxy::clearUserMediaState):
1683         * UIProcess/WebPageProxy.h:
1684
1685 2017-05-03  Eric Carlson  <eric.carlson@apple.com>
1686
1687         [MediaStream] Allow host application to enable/disable media capture
1688         https://bugs.webkit.org/show_bug.cgi?id=171292
1689         <rdar://problem/31821492>
1690
1691         Reviewed by Jer Noble.
1692
1693         * UIProcess/API/C/WKPage.cpp:
1694         (WKPageSetMediaCaptureEnabled): New.
1695         (WKPageGetMediaCaptureEnabled): New.
1696         (WKPageClearUserMediaState): Deleted, unused.
1697         * UIProcess/API/C/WKPagePrivate.h:
1698
1699         * UIProcess/API/Cocoa/WKWebView.mm:
1700         (-[WKWebView _setMediaCaptureEnabled:]): New.
1701         (-[WKWebView _mediaCaptureEnabled]): New.
1702         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1703
1704         * UIProcess/Cocoa/UIDelegate.mm:
1705         (WebKit::UIDelegate::setDelegate): Initialize webViewRequestUserMediaAuthorizationForDevicesURLMainFrameURLDecisionHandler
1706         and webViewCheckUserMediaPermissionForURLMainFrameURLFrameIdentifierDecisionHandler on macOS
1707         and iOS.
1708
1709         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1710         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
1711         Initialize the rejection timer.
1712         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
1713         Call invalidatePendingRequests.
1714         (WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests): Invalidate all
1715         pending requests.
1716         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
1717         (WebKit::UserMediaPermissionRequestManagerProxy::rejectionTimerFired): Reject a promise and
1718         schedule the timer if there are any others pending.
1719         (WebKit::UserMediaPermissionRequestManagerProxy::scheduleNextRejection): 
1720         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Don't
1721         prompt the user if capture is disabled.
1722         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Deleted.
1723         (WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState): Deleted.
1724         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1725
1726         * UIProcess/UserMediaProcessManager.cpp:
1727         (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Stop capture in the current
1728         page on iOS.
1729         (WebKit::UserMediaProcessManager::setCaptureEnabled):
1730         * UIProcess/UserMediaProcessManager.h:
1731
1732         * UIProcess/WebPageProxy.cpp:
1733         (WebKit::WebPageProxy::setMediaCaptureEnabled):
1734         (WebKit::WebPageProxy::clearUserMediaState): Deleted.
1735
1736         * UIProcess/WebPageProxy.h:
1737         (WebKit::WebPageProxy::mediaCaptureEnabled):
1738
1739         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1740         (WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): New, cancel all pending
1741         requests.
1742         (WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest): Deny the request.
1743         (WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration):
1744         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
1745
1746         * WebProcess/WebPage/WebPage.cpp:
1747         (WebKit::WebPage::stopMediaCapture):
1748         * WebProcess/WebPage/WebPage.h:
1749         * WebProcess/WebPage/WebPage.messages.in:
1750
1751 2017-05-03  Tim Horton  <timothy_horton@apple.com>
1752
1753         Maintain interaction information URL as a URL, not a string
1754         https://bugs.webkit.org/show_bug.cgi?id=171623
1755
1756         Reviewed by Simon Fraser.
1757
1758         * Shared/ios/InteractionInformationAtPosition.h:
1759         * UIProcess/ios/WKContentViewInteraction.mm:
1760         (-[WKContentView _showAttachmentSheet]):
1761         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
1762         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
1763         * UIProcess/ios/WKPDFView.mm:
1764         (-[WKPDFView annotation:isBeingPressedAtPoint:controller:]):
1765         (-[WKPDFView actionSheetAssistant:performAction:]):
1766         * WebProcess/WebPage/ios/WebPageIOS.mm:
1767         (WebKit::WebPage::getPositionInformation):
1768
1769 2017-05-03  Simon Fraser  <simon.fraser@apple.com>
1770
1771         Have WKWebView call _updateVisibleContentRects for the current transaction if possible, rather than always delaying
1772         https://bugs.webkit.org/show_bug.cgi?id=171619
1773         
1774         Also fixes webkit.org/b/170153 and webkit.org/b/170195
1775
1776         Reviewed by Tim Horton.
1777
1778         In r214391 we started adding the pre-commit handler in a dispatch_async() to ensure that
1779         the handler would always run, since we couldn't reliably test the phase of the current
1780         transaction. Now that problem has been solved (rdar://problem/31253952) we can go back to
1781         checking the transaction phase on newer iOS versions. If we're too late for the current transaction
1782         we still need to dispatch_async() to get into the next one.
1783
1784         * UIProcess/API/Cocoa/WKWebView.mm:
1785         (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]):
1786         (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
1787
1788 2017-05-03  Chris Dumez  <cdumez@apple.com>
1789
1790         REGRESSION (r216129): ASSERTION FAILED: m_process->state() == WebProcessProxy::State::Terminated
1791         https://bugs.webkit.org/show_bug.cgi?id=171616
1792
1793         Reviewed by Brady Eidson.
1794
1795         Stop calling resetStateAfterProcessExited() in WebPageProxy::terminateProcess() as the call to
1796         WebProcessProxy::requestTermination() already causes WebPageProxy::processDidCrash() to be called
1797         after r216129. WebPageProxy::processDidCrash() already takes care of calling
1798         resetStateAfterProcessExited().
1799
1800         * UIProcess/WebPageProxy.cpp:
1801         (WebKit::WebPageProxy::terminateProcess):
1802
1803 2017-05-03  Brady Eidson  <beidson@apple.com>
1804
1805         Handle KVO updating of the "hasOnlySecureContent" before a page results in an HTTP auth challenge.
1806         https://bugs.webkit.org/show_bug.cgi?id=171607
1807
1808         Reviewed by Andy Estes.
1809         
1810         To test this fix we'd need the combination of an HTTPD inside API tests, so no test for now.
1811
1812         * UIProcess/PageLoadState.cpp:
1813         (WebKit::PageLoadState::hasOnlySecureContent): If the state is provisional, check the provisional URL instead.
1814
1815 2017-05-03  Chris Dumez  <cdumez@apple.com>
1816
1817         [WK2] Extend processDidCrash delegate to let the client know the reason for the crash
1818         https://bugs.webkit.org/show_bug.cgi?id=171565
1819         <rdar://problem/31204417>
1820
1821         Reviewed by Sam Weinig.
1822
1823         Extend processDidCrash delegate to let the client know the reason for the crash. This
1824         is needed by some clients to distinguish actual crashes from terminations due to
1825         resource limits.
1826
1827         * Shared/ProcessCrashReason.h: Added.
1828         * UIProcess/API/APINavigationClient.h:
1829         (API::NavigationClient::processDidCrash):
1830         * UIProcess/API/C/WKAPICast.h:
1831         (WebKit::toAPI):
1832         * UIProcess/API/C/WKPage.cpp:
1833         (WKPageSetPageNavigationClient):
1834         * UIProcess/API/C/WKPageNavigationClient.h:
1835         * UIProcess/API/C/WKProcessCrashReason.h: Added.
1836         * UIProcess/Cocoa/NavigationState.h:
1837         * UIProcess/Cocoa/NavigationState.mm:
1838         (WebKit::NavigationState::NavigationClient::processDidCrash):
1839         * UIProcess/WebPageProxy.cpp:
1840         (WebKit::WebPageProxy::processDidCrash):
1841         * UIProcess/WebPageProxy.h:
1842         * UIProcess/WebProcessProxy.cpp:
1843         (WebKit::WebProcessProxy::didClose):
1844         (WebKit::WebProcessProxy::requestTermination):
1845         (WebKit::diagnosticLoggingKeyForTerminationReason):
1846         (WebKit::toProcessCrashReason):
1847         (WebKit::WebProcessProxy::terminateProcessDueToResourceLimits):
1848         (WebKit::WebProcessProxy::didExceedActiveMemoryLimit):
1849         (WebKit::WebProcessProxy::didExceedInactiveMemoryLimit):
1850         (WebKit::WebProcessProxy::didExceedBackgroundCPULimit):
1851         * UIProcess/WebProcessProxy.h:
1852         * WebKit2.xcodeproj/project.pbxproj:
1853
1854 2017-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1855
1856         [GTK] Add GTK+ implementation of WebAutomationSession
1857         https://bugs.webkit.org/show_bug.cgi?id=171431
1858
1859         Reviewed by Michael Catanzaro.
1860
1861         Add platform dependent methods for GTK+ to synthesize events.
1862
1863         * PlatformGTK.cmake:
1864         * UIProcess/API/gtk/WebKitUIClient.cpp: Always resize the window for web views controlled by automation.
1865         * UIProcess/Automation/WebAutomationSession.cpp:
1866         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
1867         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
1868         (WebKit::WebAutomationSession::performMouseInteraction):
1869         (WebKit::WebAutomationSession::performKeyboardInteractions):
1870         * UIProcess/Automation/WebAutomationSession.h:
1871         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: Added.
1872         (WebKit::modifiersToEventState):
1873         (WebKit::mouseButtonToGdkButton):
1874         (WebKit::doMouseEvent):
1875         (WebKit::doMotionEvent):
1876         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
1877         (WebKit::doKeyStrokeEvent):
1878         (WebKit::keyCodeForVirtualKey):
1879         (WebKit::WebAutomationSession::platformSimulateKeyStroke):
1880         (WebKit::WebAutomationSession::platformSimulateKeySequence):
1881         (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
1882
1883 2017-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1884
1885         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.1 release.
1886
1887         * gtk/NEWS: Add release notes for 2.17.1.
1888
1889 2017-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1890
1891         [Soup] Add request headers to network load metrics
1892         https://bugs.webkit.org/show_bug.cgi?id=171545
1893
1894         Reviewed by Sergio Villar Senin.
1895
1896         This will make the headers to appear in the web inspector.
1897
1898         Fixes: http/tests/inspector/network/resource-request-headers.html
1899
1900         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1901         (WebKit::NetworkDataTaskSoup::didGetHeaders):
1902
1903 2017-05-02  Simon Fraser  <simon.fraser@apple.com>
1904
1905         Dynamically added position:fixed element is in the wrong place
1906         https://bugs.webkit.org/show_bug.cgi?id=170280
1907         rdar://problem/31374008
1908
1909         Reviewed by Tim Horton.
1910
1911         Layers for position:fixed elements have their positions reconciled after scrolls
1912         via AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions() and GraphicsLayerCA::syncPosition(),
1913         which updates the GraphicsLayer's position, but does not push it to the PlatformCALayer.
1914
1915         This bug was a case where a position:fixed element gained a fixed ancestor, so had a GraphicsLayerCA whose
1916         position had been updated via syncPosition() in the past. A subsequent layout updated the GraphicsLayerCA position,
1917         but to a value that was the same as its pre-sync position, so the PlatformCALayerRemote's position didn't change,
1918         but there was no signal to the UI process to restore the layer's pre-scrolled position.
1919
1920         Fix by avoiding the early return in PlatformCALayerRemote::setPosition(), to ensure that GraphicsLayerCA
1921         geometry updates in the web process always send new positions to the UI process.
1922
1923         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1924         (WebKit::PlatformCALayerRemote::setPosition):
1925
1926 2017-05-02  Gwang Yoon Hwang  <yoon@igalia.com>
1927
1928         [GTK] Drop coordinated surfaces from the compositing thread as soon as possible
1929         https://bugs.webkit.org/show_bug.cgi?id=171544
1930
1931         Reviewed by Žan Doberšek.
1932
1933         Released coordinated surface from the main thread didn't be freed until
1934         next commit message because the deletion of coordinated surfaces is
1935         considered as a part of scene state.  We need to release corresponding
1936         surfaces whenever the compositing coordinator drops update atlases to
1937         reduce memory usages.
1938
1939         No new tests, only an optimization.
1940
1941         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
1942         Remove atlasesToRemove from the GraphicsState. it is not a commit
1943         state anymore.
1944         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1945         (WebKit::CoordinatedGraphicsScene::syncUpdateAtlases):
1946         (WebKit::CoordinatedGraphicsScene::releaseUpdateAtlases):
1947         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1948         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1949         (WebKit::CompositingCoordinator::releaseAtlases): Pass the list of
1950         released update atlases to the compositing thread right after cleaning
1951         up deactivated update atlases.
1952         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1953         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1954         (WebKit::CompositingCoordinator::clearPendingStateChanges):
1955         (WebKit::CompositingCoordinator::removeUpdateAtlas):
1956         (WebKit::CompositingCoordinator::releaseAtlases):
1957         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1958         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1959         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
1960         (WebKit::ThreadedCoordinatedLayerTreeHost::releaseUpdateAtlases):
1961         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
1962
1963 2017-05-02  Timothy Horton  <timothy_horton@apple.com>
1964
1965         Inform clients when viewport-fit state changes, so they can recompute insets
1966         https://bugs.webkit.org/show_bug.cgi?id=171573
1967         <rdar://problem/31947614>
1968
1969         Reviewed by Simon Fraser.
1970
1971         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1972         * UIProcess/API/Cocoa/WKWebView.mm:
1973         (-[WKWebView _didChangeAvoidsUnsafeArea]):
1974         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1975         * UIProcess/ios/PageClientImplIOS.mm:
1976         (WebKit::PageClientImpl::didChangeAvoidsUnsafeArea):
1977         For clients who use setObscuredInsets/setUnobscuredSafeAreaInsets
1978         themselves, we need to let them know when the current state of
1979         viewport-fit changes so that they can recompute the insets.
1980
1981 2017-05-02  Gwang Yoon Hwang  <yoon@igalia.com>
1982
1983         [GTK] Recycle textures while handling tiles
1984         https://bugs.webkit.org/show_bug.cgi?id=171541
1985
1986         Reviewed by Žan Doberšek.
1987
1988         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
1989         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
1990         Whenever we create new tiles or delete tiles, CoordGfx creates and
1991         deletes textures accordingly.  We should avoid this kind of heavy
1992         operations whenever possible.  This patch modifies to use the texture
1993         pool to reduce texture allocations.  Also this patch reduces number of
1994         resetting textures, which is also expensive operation.
1995         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:
1996         (WebKit::WebCoordinatedSurface::copyToTexture):
1997         Modified to pass BitmapTexture as a reference.
1998         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp:
1999         (WebKit::ThreadSafeCoordinatedSurface::copyToTexture): Ditto.
2000
2001 2017-05-02  David Kilzer  <ddkilzer@apple.com>
2002
2003         Stop using strcpy() in WebProcess::registerWithStateDumper() in WebProcessCocoa.mm
2004         <https://webkit.org/b/171520>
2005
2006         Reviewed by Chris Dumez.
2007
2008         * WebProcess/cocoa/WebProcessCocoa.mm:
2009         (WebKit::WebProcess::registerWithStateDumper): Switch from
2010         strcpy() to strlcpy(), removing comment in the process.
2011
2012 2017-05-02  Andrew Gold  <agold@apple.com>
2013
2014         MediaDevices is not enabled for MobileSafari
2015         https://bugs.webkit.org/show_bug.cgi?id=171433
2016         <rdar://problem/31923178>
2017
2018         Reviewed by Youenn Fablet.
2019
2020         Added the Cocoa API for toggling this feature and removed API for toggling
2021         MediaStreamEnabled since it will always be on.
2022
2023         * UIProcess/API/Cocoa/WKPreferences.mm:
2024         (-[WKPreferences _mediaDevicesEnabled]):
2025         (-[WKPreferences _setMediaDevicesEnabled:]):
2026         (-[WKPreferences _mediaStreamEnabled]): Deleted.
2027         (-[WKPreferences _setMediaStreamEnabled:]): Deleted.
2028         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2029
2030 2017-05-02  Andy Estes  <aestes@apple.com>
2031
2032         REGRESSION (r213036): Crash in -[WKContentView _webTouchEventsRecognized:] when a touch event arrives after a WebPageProxy has been invalidated
2033         https://bugs.webkit.org/show_bug.cgi?id=171539
2034         <rdar://problem/31614982>
2035
2036         Reviewed by Tim Horton.
2037
2038         Prior to r213036, the layer tree transaction at last touch start was tracked by
2039         WebPageProxy::handleTouchEventSynchronously(), which would ask the drawing area proxy for
2040         its most recent transaction ID after ensuring that the WebPageProxy was valid.
2041
2042         r213036 moved the tracking up to -[WKContentView _webTouchEventsRecognized:], but failed to
2043         check if _page was valid before asking for its drawing area proxy's last transaction ID; the
2044         drawing area proxy is set to null on WebPageProxy invalidation.
2045
2046         * UIProcess/ios/WKContentViewInteraction.mm:
2047         (-[WKContentView _webTouchEventsRecognized:]): Added an early return if _page isn't valid.
2048
2049 2017-05-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2050
2051         Web Automation: generate resizeWindowOfBrowsingContext and moveWindowOfBrowsingContext for all platforms
2052         https://bugs.webkit.org/show_bug.cgi?id=171107
2053
2054         Reviewed by Brian Burg.
2055
2056         The implementation is actually cross-platform, so it could be moved from WebAutomationSessionMac.mm to
2057         WebAutomationSession.cpp and simply return a NotImplemented error for iOS. This will allow to use these methods
2058         in other platforms.
2059
2060         * UIProcess/Automation/Automation.json:
2061         * UIProcess/Automation/WebAutomationSession.cpp:
2062         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
2063         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
2064         * UIProcess/Automation/WebAutomationSession.h:
2065         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
2066         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): Deleted.
2067         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext): Deleted.
2068
2069 2017-05-01  Chris Dumez  <cdumez@apple.com>
2070
2071         Use RELEASE_LOG_ERROR() to do process termination logging
2072         https://bugs.webkit.org/show_bug.cgi?id=171521
2073
2074         Reviewed by Andreas Kling.
2075
2076         Use RELEASE_LOG_ERROR() to do process termination logging instead of RELEASE_LOG().
2077         This makes the issue more visible in Console.
2078
2079         * UIProcess/WebProcessProxy.cpp:
2080         (WebKit::WebProcessProxy::didExceedActiveMemoryLimit):
2081         (WebKit::WebProcessProxy::didExceedInactiveMemoryLimit):
2082         (WebKit::WebProcessProxy::didExceedBackgroundCPULimit):
2083
2084 2017-05-01  Brady Eidson  <beidson@apple.com>
2085
2086         Only try to get sandbox extension handle for IndexedDB directory if it is set.
2087         rdar://problem/31925828 and https://bugs.webkit.org/show_bug.cgi?id=171522
2088
2089         Reviewed by Andy Estes.
2090
2091         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2092         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
2093
2094 2017-05-01  Timothy Horton  <timothy_horton@apple.com>
2095
2096         Expose viewport-fit instead of clip-to-safe-area
2097         https://bugs.webkit.org/show_bug.cgi?id=171503
2098         <rdar://problem/31918249>
2099
2100         Reviewed by Simon Fraser.
2101
2102         * Shared/VisibleContentRectUpdateInfo.cpp:
2103         (WebKit::VisibleContentRectUpdateInfo::encode):
2104         (WebKit::VisibleContentRectUpdateInfo::decode):
2105         (WebKit::operator<<):
2106         * Shared/VisibleContentRectUpdateInfo.h:
2107         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
2108         (WebKit::VisibleContentRectUpdateInfo::unobscuredSafeAreaInsets):
2109         (WebKit::operator==):
2110         Plumb the safe area insets down from the UI process to the Web Content
2111         process inside the visible content rect update, alongside the obscured
2112         insets.
2113
2114         * Shared/mac/RemoteLayerTreeTransaction.h:
2115         (WebKit::RemoteLayerTreeTransaction::avoidsUnsafeArea):
2116         (WebKit::RemoteLayerTreeTransaction::setAvoidsUnsafeArea):
2117         * Shared/mac/RemoteLayerTreeTransaction.mm:
2118         (WebKit::RemoteLayerTreeTransaction::encode):
2119         (WebKit::RemoteLayerTreeTransaction::decode):
2120         (WebKit::RemoteLayerTreeTransaction::description):
2121         * UIProcess/PageClient.h:
2122         * UIProcess/ios/PageClientImplIOS.h:
2123         * UIProcess/ios/PageClientImplIOS.mm:
2124         (WebKit::PageClientImpl::didChangeAvoidsUnsafeArea):
2125         (WebKit::PageClientImpl::didChangeClipToSafeArea): Deleted.
2126         * UIProcess/ios/WebPageProxyIOS.mm:
2127         (WebKit::WebPageProxy::didCommitLayerTree):
2128         * UIProcess/mac/PageClientImpl.h:
2129         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2130         (WebKit::WebChromeClient::didChangeClipToSafeArea): Deleted.
2131         * WebProcess/WebCoreSupport/WebChromeClient.h:
2132         * WebProcess/WebPage/WebPage.cpp:
2133         (WebKit::WebPage::willCommitLayerTree):
2134         * WebProcess/WebPage/ios/WebPageIOS.mm:
2135         (WebKit::WebPage::viewportConfigurationChanged):
2136         (WebKit::WebPage::updateVisibleContentRects):
2137         * UIProcess/WebPageProxy.cpp:
2138         (WebKit::WebPageProxy::resetState):
2139         (WebKit::WebPageProxy::setAvoidsUnsafeArea):
2140         (WebKit::WebPageProxy::setClipToSafeArea): Deleted.
2141         * UIProcess/WebPageProxy.h:
2142         (WebKit::WebPageProxy::avoidsUnsafeArea):
2143         (WebKit::WebPageProxy::clipToSafeArea): Deleted.
2144         * UIProcess/WebPageProxy.messages.in:
2145         Plumb the effective value of viewport-fit (whether or not to avoid
2146         the safe area for layout purposes) from the Web Content process
2147         to the UI process inside the layer tree transaction.
2148         Also, remove clip-to-safe-area plumbing.
2149
2150         * UIProcess/API/Cocoa/WKWebView.mm:
2151         (-[WKWebView _initializeWithConfiguration:]):
2152         (-[WKWebView _computedContentInset]):
2153         (-[WKWebView _computedUnobscuredSafeAreaInset]):
2154         (-[WKWebView _updateVisibleContentRects]):
2155         (-[WKWebView _updateScrollViewInsetAdjustmentBehavior]):
2156         (-[WKWebView _safeAreaShouldAffectObscuredInsets]):
2157         (-[WKWebView _unobscuredSafeAreaInsets]):
2158         (-[WKWebView _setUnobscuredSafeAreaInsets:]):
2159         (-[WKWebView _contentMayDrawInObscuredInsets]): Deleted.
2160         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2161         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2162         Make use of the effective value of viewport-fit to decide whether to
2163         take the safe area into account when computing the obscured insets,
2164         and expose this to clients (in the case that they need to know
2165         because they push their own obscured insets down). Also expose a 
2166         safe area inset setter for that case as well.
2167
2168         * UIProcess/ios/WKContentView.h:
2169         * UIProcess/ios/WKContentView.mm:
2170         (-[WKContentView updateFixedClippingView:]):
2171         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2172         Remove a piece of the clip-to-safe-area implementation, and plumb
2173         safe area insets into the visible content rect update info.
2174
2175         * UIProcess/ios/WKScrollView.h:
2176         * UIProcess/ios/WKScrollView.mm:
2177         (-[WKScrollView initWithFrame:]):
2178         (-[WKScrollView _contentInsetAdjustmentBehaviorWasExternallyOverridden]):
2179         (-[WKScrollView _setContentInsetAdjustmentBehavior:]):
2180         (-[WKScrollView _setContentInsetAdjustmentBehaviorInternal:]):
2181         Keep track of whether the client has ever touched the content inset adjustment
2182         behavior; if they have, we won't manage it ourselves.
2183
2184 2017-05-01  Brady Eidson  <beidson@apple.com>
2185
2186         Update names in WKURLSchemeHandler/WKURLSchemeHandlerTask APIs.
2187         <rdar://problem/31824838> and https://bugs.webkit.org/show_bug.cgi?id=171508
2188
2189         Reviewed by Andy Estes.
2190
2191         This patch:
2192         - Renames WKURLSchemeHandlerTask to WKURLSchemeTask
2193         - Renames the method "startTask" to "startURLSchemeTask"
2194         - Renames the method "stopTask" to "stopURLSchemeTask"
2195
2196         To those effects it's basically a global replace.
2197
2198         * Shared/API/APIObject.h:
2199         * Shared/Cocoa/APIObject.mm:
2200         (API::Object::newObject):
2201         * UIProcess/API/APIURLSchemeTask.cpp: Renamed from Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.cpp.
2202         (API::URLSchemeTask::create):
2203         (API::URLSchemeTask::URLSchemeTask):
2204         * UIProcess/API/APIURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/API/APIURLSchemeHandlerTask.h.
2205         * UIProcess/API/Cocoa/WKURLSchemeHandler.h:
2206         * UIProcess/API/Cocoa/WKURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.h.
2207         * UIProcess/API/Cocoa/WKURLSchemeTask.mm: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm.
2208         (raiseExceptionIfNecessary):
2209         (-[WKURLSchemeTaskImpl request]):
2210         (-[WKURLSchemeTaskImpl didReceiveResponse:]):
2211         (-[WKURLSchemeTaskImpl didReceiveData:]):
2212         (-[WKURLSchemeTaskImpl didFinish]):
2213         (-[WKURLSchemeTaskImpl didFailWithError:]):
2214         (-[WKURLSchemeTaskImpl _apiObject]):
2215         * UIProcess/API/Cocoa/WKURLSchemeTaskInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKURLSchemeHandlerTaskInternal.h.
2216         (WebKit::wrapper):
2217         * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.h:
2218         * UIProcess/Cocoa/WebURLSchemeHandlerCocoa.mm:
2219         (WebKit::WebURLSchemeHandlerCocoa::platformStartTask):
2220         (WebKit::WebURLSchemeHandlerCocoa::platformStopTask):
2221         * UIProcess/WebPageProxy.cpp:
2222         (WebKit::WebPageProxy::startURLSchemeTask):
2223         (WebKit::WebPageProxy::stopURLSchemeTask):
2224         (WebKit::WebPageProxy::startURLSchemeHandlerTask): Deleted.
2225         (WebKit::WebPageProxy::stopURLSchemeHandlerTask): Deleted.
2226         * UIProcess/WebPageProxy.h:
2227         * UIProcess/WebPageProxy.messages.in:
2228         * UIProcess/WebURLSchemeHandler.cpp:
2229         (WebKit::WebURLSchemeHandler::startTask):
2230         * UIProcess/WebURLSchemeHandler.h:
2231         * UIProcess/WebURLSchemeTask.cpp: Renamed from Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.cpp.
2232         (WebKit::WebURLSchemeTask::create):
2233         (WebKit::WebURLSchemeTask::WebURLSchemeTask):
2234         (WebKit::WebURLSchemeTask::didReceiveResponse):
2235         (WebKit::WebURLSchemeTask::didReceiveData):
2236         (WebKit::WebURLSchemeTask::didComplete):
2237         (WebKit::WebURLSchemeTask::pageDestroyed):
2238         (WebKit::WebURLSchemeTask::stop):
2239         * UIProcess/WebURLSchemeTask.h: Renamed from Source/WebKit2/UIProcess/WebURLSchemeHandlerTask.h.
2240         (WebKit::WebURLSchemeTask::identifier):
2241         (WebKit::WebURLSchemeTask::request):
2242         * WebKit2.xcodeproj/project.pbxproj:
2243         * WebProcess/Network/WebLoaderStrategy.cpp:
2244         (WebKit::WebLoaderStrategy::addURLSchemeTaskProxy):
2245         (WebKit::WebLoaderStrategy::removeURLSchemeTaskProxy):
2246         (WebKit::WebLoaderStrategy::remove):
2247         (WebKit::WebLoaderStrategy::addURLSchemeHandlerTaskProxy): Deleted.
2248         (WebKit::WebLoaderStrategy::removeURLSchemeHandlerTaskProxy): Deleted.
2249         * WebProcess/Network/WebLoaderStrategy.h:
2250         * WebProcess/WebPage/WebPage.cpp:
2251         (WebKit::WebPage::urlSchemeTaskDidReceiveResponse):
2252         (WebKit::WebPage::urlSchemeTaskDidReceiveData):
2253         (WebKit::WebPage::urlSchemeTaskDidComplete):
2254         (WebKit::WebPage::urlSchemeHandlerTaskDidReceiveResponse): Deleted.
2255         (WebKit::WebPage::urlSchemeHandlerTaskDidReceiveData): Deleted.
2256         (WebKit::WebPage::urlSchemeHandlerTaskDidComplete): Deleted.
2257         * WebProcess/WebPage/WebPage.h:
2258         * WebProcess/WebPage/WebPage.messages.in:
2259         * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp:
2260         (WebKit::WebURLSchemeHandlerProxy::startNewTask):
2261         (WebKit::WebURLSchemeHandlerProxy::taskDidComplete):
2262         (WebKit::WebURLSchemeHandlerProxy::taskDidStopLoading):
2263         * WebProcess/WebPage/WebURLSchemeHandlerProxy.h:
2264         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.cpp.
2265         (WebKit::WebURLSchemeTaskProxy::WebURLSchemeTaskProxy):
2266         (WebKit::WebURLSchemeTaskProxy::startLoading):
2267         (WebKit::WebURLSchemeTaskProxy::stopLoading):
2268         (WebKit::WebURLSchemeTaskProxy::didReceiveResponse):
2269         (WebKit::WebURLSchemeTaskProxy::didReceiveData):
2270         (WebKit::WebURLSchemeTaskProxy::didComplete):
2271         (WebKit::WebURLSchemeTaskProxy::hasLoader):
2272         * WebProcess/WebPage/WebURLSchemeTaskProxy.h: Renamed from Source/WebKit2/WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.h.
2273         (WebKit::WebURLSchemeTaskProxy::request):
2274         (WebKit::WebURLSchemeTaskProxy::identifier):
2275
2276 2017-05-01  Chris Dumez  <cdumez@apple.com>
2277
2278         Tweak how long we allow a process to go over its background CPU limit
2279         https://bugs.webkit.org/show_bug.cgi?id=170460
2280         <rdar://problem/31433141>
2281
2282         Reviewed by Geoffrey Garen.
2283
2284         Tweak how long we allow a process to go over its background CPU limit. We now use 8 minutes
2285         intervals (instead of previously 15). This is less conservative and aligned with our memory
2286         kills.
2287
2288         * WebProcess/cocoa/WebProcessCocoa.mm:
2289
2290 2017-05-01  Beth Dakin  <bdakin@apple.com>
2291
2292         On-screen panel for candidate bar is in the wrong place when the caret is at the 
2293         start of a paragraph
2294         https://bugs.webkit.org/show_bug.cgi?id=171453
2295         -and corresponding-
2296         rdar://problem/29779764
2297
2298         Reviewed by Tim Horton.
2299
2300         This bug only happens when the caret is at the beginning of the paragraph, and it 
2301         is because Range::absoluteTextQuads() returns no quads in this case. I think it 
2302         might be correct that absoluteTextQuads() returns no quads in this case, so this 
2303         patch fixes the bug at the call site by using absoluteCaretBounds() in this case.
2304
2305         SPI for testing.
2306         * UIProcess/API/Cocoa/WKWebView.mm:
2307         (-[WKWebView _candidateRect]):
2308         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2309
2310         Bug fix.
2311         * WebProcess/WebPage/mac/WebPageMac.mm:
2312         (WebKit::WebPage::platformEditorState):
2313
2314 2017-05-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2315
2316         [GTK] Add automation session API
2317         https://bugs.webkit.org/show_bug.cgi?id=171428
2318
2319         Reviewed by Carlos Alberto Lopez Perez.
2320
2321         Add new API to allow WebKitGTK+ to be controlled by automation. By default it's disabled, applications have to
2322         explicitly call webkit_web_context_set_automation_allowed() to enabled it. When a new automation session is
2323         requested, the signal WebKitWebContext::automation-started is emitted with a newly created
2324         WebKitAutomationSession, similar to how WebKitWebContext::download-started works. The user should connect to it
2325         have access to the WebKitAutomationSession and connect it its signals. When a new web view is requested to be
2326         created in a WebKitAutomationSession, the signal WebKitAutomationSession::create-web-view is emitted. The user
2327         should connect to it and return a WebKitWebView. The web views used for automation are special ones and need to
2328         be created with the new WebKitWebView:is-controlled-by-automation construct property enabled, otherwise we will
2329         refuse to create the requested browsing context.
2330
2331         * PlatformGTK.cmake:
2332         * UIProcess/API/gtk/WebKitAutomationSession.cpp: Added.
2333         (webkitAutomationSessionSetProperty):
2334         (webkitAutomationSessionConstructed):
2335         (webkit_automation_session_class_init):
2336         (webkitAutomationSessionCreate):
2337         (webkitAutomationSessionGetSession):
2338         (webkit_automation_session_get_id):
2339         * UIProcess/API/gtk/WebKitAutomationSession.h: Added.
2340         * UIProcess/API/gtk/WebKitAutomationSessionPrivate.h: Added.
2341         * UIProcess/API/gtk/WebKitWebContext.cpp:
2342         (webkitWebContextConstructed):
2343         (webkit_web_context_class_init):
2344         (webkit_web_context_is_automation_allowed):
2345         (webkit_web_context_set_automation_allowed):
2346         (webkitWebContextCreatePageForWebView):
2347         * UIProcess/API/gtk/WebKitWebContext.h:
2348         * UIProcess/API/gtk/WebKitWebView.cpp:
2349         (webkitWebViewConstructed):
2350         (webkitWebViewSetProperty):
2351         (webkitWebViewGetProperty):
2352         (webkit_web_view_class_init):
2353         (webkit_web_view_is_controlled_by_automation):
2354         * UIProcess/API/gtk/WebKitWebView.h:
2355         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2356         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types:
2357         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
2358         * UIProcess/API/gtk/webkit2.h:
2359
2360 2017-05-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2361
2362         Unreviewed. Fix GTK+ debug build after r216002.
2363
2364         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
2365         (WebKit::wrapClientRectList):
2366
2367 2017-04-30  Chris Dumez  <cdumez@apple.com>
2368
2369         Drop support for legacy ClientRect / ClientRectList
2370         https://bugs.webkit.org/show_bug.cgi?id=171418
2371
2372         Reviewed by Sam Weinig.
2373
2374         GTK build fix.
2375
2376         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
2377         (WebKit::kit):
2378         (WebKit::core):
2379         (WebKit::wrapClientRect):
2380         (webkit_dom_client_rect_constructed):
2381         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
2382         (ClientRectList::create):
2383         (ClientRectList::items):
2384         (ClientRectList::ClientRectList):
2385         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectListPrivate.h:
2386         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectPrivate.h:
2387         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
2388         (webkit_dom_element_get_bounding_client_rect):
2389         (webkit_dom_element_get_client_rects):
2390
2391 2017-04-30  Brady Eidson  <beidson@apple.com>
2392
2393         More fixing after r215991
2394         https://bugs.webkit.org/show_bug.cgi?id=171483
2395
2396         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2397         (WebKit::NetworkProcess::syncAllCookies):
2398
2399 2017-04-30  Brady Eidson  <beidson@apple.com>
2400
2401         Fix r215991
2402         https://bugs.webkit.org/show_bug.cgi?id=171483
2403
2404         Unreviewed.
2405
2406         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2407         (WebKit::NetworkProcess::syncAllCookies):
2408
2409 2017-04-30  Dan Bernstein  <mitz@apple.com>
2410
2411         [Cocoa] Replaces uses of [get…() alloc] with alloc…Instance()
2412         https://bugs.webkit.org/show_bug.cgi?id=171485
2413
2414         Reviewed by Geoffrey Garen.
2415
2416         * Platform/mac/MenuUtilities.mm:
2417         (WebKit::menuItemForTelephoneNumber):
2418         (WebKit::menuForTelephoneNumber):
2419
2420 2017-04-30  Brady Eidson  <beidson@apple.com>
2421
2422         Updates to _WKWebsiteDataStoreConfiguration cookie storage location SPI.
2423         <rdar://problem/31906397> and https://bugs.webkit.org/show_bug.cgi?id=171483
2424
2425         Reviewed by Geoff Garen (and kind of Andy Estes).
2426         
2427         Updates include:
2428         -Taking a file path as the config argument instead of a directory.
2429         -Proper sandbox extension handling.
2430         -Proper and thorough API test.
2431
2432         * NetworkProcess/NetworkProcess.cpp:
2433         (WebKit::NetworkProcess::syncAllCookies):
2434         * NetworkProcess/NetworkProcess.h:
2435         * NetworkProcess/NetworkProcess.messages.in:
2436
2437         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2438         (WebKit::NetworkProcess::syncAllCookies):
2439
2440         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2441         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
2442
2443         * Shared/WebsiteDataStoreParameters.cpp:
2444         (WebKit::WebsiteDataStoreParameters::encode):
2445         (WebKit::WebsiteDataStoreParameters::decode):
2446         * Shared/WebsiteDataStoreParameters.h:
2447
2448         * UIProcess/API/Cocoa/WKProcessPool.mm:
2449         (-[WKProcessPool _syncNetworkProcessCookies]):
2450         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2451
2452         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2453         (-[WKWebsiteDataStore _initWithConfiguration:]):
2454
2455         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
2456         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
2457         (-[_WKWebsiteDataStoreConfiguration _cookieStoragePath]):
2458         (-[_WKWebsiteDataStoreConfiguration _setCookieStoragePath:]):
2459         (-[_WKWebsiteDataStoreConfiguration _cookieStorageDirectory]): Deleted.
2460         (-[_WKWebsiteDataStoreConfiguration _setCookieStorageDirectory:]): Deleted.
2461
2462         * UIProcess/WebProcessPool.cpp:
2463         (WebKit::WebProcessPool::syncNetworkProcessCookies):
2464         * UIProcess/WebProcessPool.h:
2465
2466         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2467         (WebKit::WebsiteDataStore::parameters):
2468
2469         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2470         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
2471
2472         * UIProcess/WebsiteData/WebsiteDataStore.h:
2473         (WebKit::WebsiteDataStore::resolvedCookieStoragePath):
2474         (WebKit::WebsiteDataStore::resolvedCookieStorageDirectory): Deleted.
2475
2476 2017-04-30  Brady Eidson  <beidson@apple.com>
2477
2478         Regression (r215941) Unexpected logging causes perf tests to fail.
2479         <rdar://problem/31907269> and https://bugs.webkit.org/show_bug.cgi?id=171482
2480
2481         Reviewed by Alexey Proskuryakov.
2482
2483         * Shared/mac/SandboxExtensionMac.mm:
2484         (WebKit::resolveAndCreateReadWriteDirectoryForSandboxExtension):
2485
2486         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2487         (WebKit::WebProcessPool::networkingCachesDirectory):
2488         (WebKit::WebProcessPool::webContentCachesDirectory):
2489
2490         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2491         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary): Only resolve the cookie storage directory
2492           if a custom one has been set.
2493
2494 2017-04-29  Youenn Fablet  <youenn@apple.com>
2495
2496         Readd assertion removed accidentally in r215955
2497         https://bugs.webkit.org/show_bug.cgi?id=171466
2498
2499         Reviewed by Eric Carlson.
2500
2501         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2502         (WebKit::WebBackForwardListProxy::addItemFromUIProcess):
2503
2504 2017-04-29  Andy Estes  <aestes@apple.com>
2505
2506         [macOS] Picture-in-picture should be disabled in WebPlaybackControlsManager during external media playback
2507         https://bugs.webkit.org/show_bug.cgi?id=171468
2508         <rdar://problem/31900349>
2509
2510         Reviewed by Eric Carlson.
2511
2512         * UIProcess/Cocoa/WebViewImpl.mm:
2513         (WebKit::WebViewImpl::updateMediaTouchBar): Set canTogglePictureInPicture to YES by default
2514         on WebPlaybackControlsManager.
2515
2516 2017-04-29  Yusuke Suzuki  <utatane.tea@gmail.com>
2517
2518         Move WebCore CPUTime to WTF and implement it in all the platforms
2519         https://bugs.webkit.org/show_bug.cgi?id=171477
2520
2521         Reviewed by Chris Dumez.
2522
2523         We now hold Seconds in CPUTime instead of int64_t. It finally sends
2524         Seconds through WebKit2 IPC. We do not need to specialize ArgumentCoder
2525         for Seconds since Seconds just holds double.
2526
2527         * UIProcess/PerActivityStateCPUUsageSampler.cpp:
2528         (WebKit::PerActivityStateCPUUsageSampler::PerActivityStateCPUUsageSampler):
2529         (WebKit::PerActivityStateCPUUsageSampler::reportWebContentCPUTime):
2530         (WebKit::PerActivityStateCPUUsageSampler::loggingTimerFired):
2531         * UIProcess/PerActivityStateCPUUsageSampler.h:
2532         * UIProcess/WebProcessPool.cpp:
2533         (WebKit::WebProcessPool::reportWebContentCPUTime):
2534         * UIProcess/WebProcessPool.h:
2535         * UIProcess/WebProcessPool.messages.in:
2536         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2537         (WebKit::WebChromeClient::reportProcessCPUTime):
2538         * WebProcess/WebCoreSupport/WebChromeClient.h:
2539
2540 2017-04-28  Brady Eidson  <beidson@apple.com>
2541
2542         Teach the DatabaseProcess to be fully SessionID aware
2543         https://bugs.webkit.org/show_bug.cgi?id=171451
2544
2545         Reviewed by Geoffrey Garen.
2546         
2547         SessionIDs were already at the periphery of IDB and the DatabaseProcess.
2548         Getting a separate IDBServer per SessionID is a pretty straightforward improvement.
2549
2550         * DatabaseProcess/DatabaseProcess.cpp:
2551         (WebKit::DatabaseProcess::idbServer):
2552         (WebKit::DatabaseProcess::initializeWebsiteDataStore):
2553         (WebKit::DatabaseProcess::fetchWebsiteData):
2554         (WebKit::DatabaseProcess::deleteWebsiteData):
2555         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
2556         (WebKit::DatabaseProcess::indexedDatabaseOrigins):
2557         (WebKit::DatabaseProcess::initializeDatabaseProcess): Deleted.
2558         (WebKit::DatabaseProcess::ensureIndexedDatabaseRelativePathExists): Deleted.
2559         (WebKit::DatabaseProcess::absoluteIndexedDatabasePathFromDatabaseRelativePath): Deleted.
2560         * DatabaseProcess/DatabaseProcess.h:
2561         (WebKit::DatabaseProcess::indexedDatabaseDirectory): Deleted.
2562         * DatabaseProcess/DatabaseProcess.messages.in:
2563
2564         * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
2565         (WebKit::DatabaseToWebProcessConnection::establishIDBConnectionToServer):
2566         * DatabaseProcess/DatabaseToWebProcessConnection.h:
2567         * DatabaseProcess/DatabaseToWebProcessConnection.messages.in:
2568
2569         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2570         (WebKit::WebIDBConnectionToClient::create):
2571         (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
2572         (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
2573         (WebKit::WebIDBConnectionToClient::deleteDatabase):
2574         (WebKit::WebIDBConnectionToClient::openDatabase):
2575         (WebKit::WebIDBConnectionToClient::abortTransaction):
2576         (WebKit::WebIDBConnectionToClient::commitTransaction):
2577         (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
2578         (WebKit::WebIDBConnectionToClient::createObjectStore):
2579         (WebKit::WebIDBConnectionToClient::deleteObjectStore):
2580         (WebKit::WebIDBConnectionToClient::renameObjectStore):
2581         (WebKit::WebIDBConnectionToClient::clearObjectStore):
2582         (WebKit::WebIDBConnectionToClient::createIndex):
2583         (WebKit::WebIDBConnectionToClient::deleteIndex):
2584         (WebKit::WebIDBConnectionToClient::renameIndex):
2585         (WebKit::WebIDBConnectionToClient::putOrAdd):
2586         (WebKit::WebIDBConnectionToClient::getRecord):
2587         (WebKit::WebIDBConnectionToClient::getAllRecords):
2588         (WebKit::WebIDBConnectionToClient::getCount):
2589         (WebKit::WebIDBConnectionToClient::deleteRecord):
2590         (WebKit::WebIDBConnectionToClient::openCursor):
2591         (WebKit::WebIDBConnectionToClient::iterateCursor):
2592         (WebKit::WebIDBConnectionToClient::establishTransaction):
2593         (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
2594         (WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
2595         (WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
2596         (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
2597         (WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
2598         (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
2599         (WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
2600         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
2601
2602         * Shared/Databases/DatabaseProcessCreationParameters.cpp:
2603         (WebKit::DatabaseProcessCreationParameters::encode):
2604         (WebKit::DatabaseProcessCreationParameters::decode):
2605         * Shared/Databases/DatabaseProcessCreationParameters.h:
2606
2607         * UIProcess/WebProcessPool.cpp:
2608         (WebKit::WebProcessPool::ensureDatabaseProcess):
2609         (WebKit::WebProcessPool::resolvePathsForSandboxExtensions):
2610         (WebKit::WebProcessPool::pageAddedToProcess):
2611         * UIProcess/WebProcessPool.h:
2612
2613         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2614         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
2615         (WebKit::WebsiteDataStore::databaseProcessParameters):
2616         * UIProcess/WebsiteData/WebsiteDataStore.h:
2617         (WebKit::WebsiteDataStore::resolvedIndexedDatabaseDirectory):
2618
2619         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2620         (WebKit::WebIDBConnectionToServer::create):
2621         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
2622         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
2623
2624         * WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
2625         (WebKit::WebToDatabaseProcessConnection::idbConnectionToServerForSession):
2626
2627 2017-04-28  Youenn Fablet  <youenn@apple.com>
2628
2629         getUserMedia video streams should follow device orientation
2630         https://bugs.webkit.org/show_bug.cgi?id=171284
2631
2632         Reviewed by Eric Carlson.
2633
2634         Refactoring to specialize CaptureFactory in VideoCaptureFactory and AudioCaptureFactory.
2635         Refactoring to return a CaptureSourceOrError instead of passing an out parameter in addition to returning a RefPtr.
2636
2637         * Shared/WebCoreArgumentCoders.h:
2638         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2639         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
2640         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
2641         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
2642         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2643         (WebKit::UserMediaCaptureManager::createCaptureSource):
2644         (WebKit::UserMediaCaptureManager::createMediaSourceForCaptureDeviceWithConstraints): Deleted.
2645         * WebProcess/cocoa/UserMediaCaptureManager.h:
2646
2647 2017-04-28  Chris Dumez  <cdumez@apple.com>
2648
2649         [iOS] We should not take a background assertion for the UIProcess when app is MobileMail
2650         https://bugs.webkit.org/show_bug.cgi?id=171435
2651         <rdar://problem/31132330>
2652
2653         Reviewed by Geoffrey Garen.
2654
2655         Add SPI to disable taking on background process assertions in the UIProcess.
2656         This is useful for MobileMail.
2657
2658         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2659         (API::ProcessPoolConfiguration::copy):
2660         * UIProcess/API/APIProcessPoolConfiguration.h:
2661         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2662         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2663         (-[_WKProcessPoolConfiguration shouldTakeUIBackgroundAssertion]):
2664         (-[_WKProcessPoolConfiguration setShouldTakeUIBackgroundAssertion:]):
2665         * UIProcess/Network/NetworkProcessProxy.cpp:
2666         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
2667         * UIProcess/ProcessAssertion.h:
2668         (WebKit::ProcessAssertion::setClient):
2669         * UIProcess/ProcessThrottler.cpp:
2670         (WebKit::ProcessThrottler::ProcessThrottler):
2671         (WebKit::m_shouldTakeUIBackgroundAssertion):
2672         (WebKit::ProcessThrottler::didConnectToProcess):
2673         * UIProcess/ProcessThrottler.h:
2674         * UIProcess/WebProcessPool.cpp:
2675         (WebKit::WebProcessPool::WebProcessPool):
2676         * UIProcess/WebProcessPool.h:
2677         * UIProcess/WebProcessProxy.cpp:
2678         (WebKit::WebProcessProxy::WebProcessProxy):
2679
2680 2017-04-28  Chris Dumez  <cdumez@apple.com>
2681
2682         Unreviewed attempt to fix iOS build after r215943.
2683
2684         * Configurations/Base.xcconfig:
2685
2686 2017-04-28  Andy Estes  <aestes@apple.com>
2687
2688         [macOS] WebPlaybackControlsManager needs to know when the selected text or audio track changes
2689         https://bugs.webkit.org/show_bug.cgi?id=171434
2690         <rdar://problem/31887922>
2691
2692         Reviewed by Eric Carlson.
2693
2694         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
2695         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in:
2696         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
2697         (WebKit::WebPlaybackSessionModelContext::setAudioMediaSelectionIndex): Set
2698         m_audioMediaSelectedIndex and notified clients.
2699         (WebKit::WebPlaybackSessionModelContext::setLegibleMediaSelectionIndex): Ditto for
2700         m_legibleMediaSelectedIndex.
2701         (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionIndex): Called
2702         WebPlaybackSessionModelContext::setAudioMediaSelectionIndex().
2703         (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionIndex): Called
2704         WebPlaybackSessionModelContext::setLegibleMediaSelectionIndex().
2705         * WebProcess/cocoa/WebPlaybackSessionManager.h:
2706         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
2707         (WebKit::WebPlaybackSessionInterfaceContext::audioMediaSelectionIndexChanged): Called
2708         WebPlaybackSessionManager:: audioMediaSelectionIndexChanged().
2709         (WebKit::WebPlaybackSessionInterfaceContext::legibleMediaSelectionIndexChanged): Called
2710         WebPlaybackSessionManager::legibleMediaSelectionIndexChanged().
2711         (WebKit::WebPlaybackSessionManager::audioMediaSelectionIndexChanged): Sent
2712         WebPlaybackSessionManagerProxy::SetAudioMediaSelectionIndex().
2713         (WebKit::WebPlaybackSessionManager::legibleMediaSelectionIndexChanged): Sent
2714         WebPlaybackSessionManagerProxy::SetLegibleMediaSelectionIndex().
2715
2716 2017-04-28  Brady Eidson  <beidson@apple.com>
2717
2718         Start of support for multiple WebsiteDataStore/SessionIDs per process
2719         https://bugs.webkit.org/show_bug.cgi?id=171422
2720
2721         Reviewed by Geoffrey Garen.
2722
2723         * CMakeLists.txt:
2724         * WebKit2.xcodeproj/project.pbxproj:
2725
2726         * NetworkProcess/NetworkProcess.cpp:
2727         (WebKit::NetworkProcess::addWebsiteDataStore):
2728         (WebKit::NetworkProcess::destroySession):
2729         (WebKit::NetworkProcess::destroyPrivateBrowsingSession): Deleted.
2730         * NetworkProcess/NetworkProcess.h:
2731         * NetworkProcess/NetworkProcess.messages.in:
2732
2733         * NetworkProcess/RemoteNetworkingContext.h:
2734         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2735         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
2736         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
2737         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
2738
2739         * Shared/WebsiteDataStoreParameters.cpp: Copied from Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h.
2740         (WebKit::WebsiteDataStoreParameters::WebsiteDataStoreParameters):
2741         (WebKit::WebsiteDataStoreParameters::encode):
2742         (WebKit::WebsiteDataStoreParameters::decode):
2743         * Shared/WebsiteDataStoreParameters.h: Copied from Source/WebKit2/WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h.
2744
2745         * UIProcess/API/APIWebsiteDataStore.cpp:
2746         (API::WebsiteDataStore::defaultDataStore):
2747         (API::WebsiteDataStore::createLegacy):
2748         (API::WebsiteDataStore::WebsiteDataStore):
2749         (API::WebsiteDataStore::create): Deleted.
2750         * UIProcess/API/APIWebsiteDataStore.h:
2751
2752         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2753         (-[WKWebsiteDataStore _initWithConfiguration:]):
2754
2755         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
2756         (webkitWebsiteDataManagerCreate):
2757         (webkitWebsiteDataManagerGetDataStore):
2758
2759         * UIProcess/WebPageProxy.cpp:
2760         (WebKit::m_weakPtrFactory):
2761         * UIProcess/WebPageProxy.h:
2762
2763         * UIProcess/WebProcessPool.cpp:
2764         (WebKit::WebProcessPool::WebProcessPool):
2765         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
2766         (WebKit::WebProcessPool::pageAddedToProcess):
2767         (WebKit::WebProcessPool::pageRemovedFromProcess):
2768
2769         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2770         (WebKit::WebsiteDataStore::parameters):
2771         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2772         (WebKit::WebsiteDataStore::create):
2773         (WebKit::WebsiteDataStore::WebsiteDataStore):
2774         (WebKit::WebsiteDataStore::~WebsiteDataStore):
2775         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
2776         (WebKit::WebsiteDataStore::parameters):
2777         * UIProcess/WebsiteData/WebsiteDataStore.h:
2778
2779         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
2780         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
2781         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
2782         (WebKit::WebFrameNetworkingContext::storageSession):
2783         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
2784         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
2785         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
2786
2787         * WebProcess/WebProcess.cpp:
2788         (WebKit::WebProcess::addWebsiteDataStore):
2789         (WebKit::WebProcess::destroySession):
2790         (WebKit::WebProcess::destroyPrivateBrowsingSession): Deleted.
2791         * WebProcess/WebProcess.h:
2792         * WebProcess/WebProcess.messages.in:
2793         * WebProcess/cocoa/WebProcessCocoa.mm:
2794
2795 2017-04-28  Youenn Fablet  <youenn@apple.com>
2796
2797         Adding a runtime flag specific to MediaDevices
2798         https://bugs.webkit.org/show_bug.cgi?id=171433
2799
2800         Reviewed by Geoffrey Garen.
2801
2802         Adding a preference for MediaDevices.
2803         Setting media devices runtime flag to false by default.
2804         Setting peer connection and media stream flags to true by default.
2805         Sending microphone sandbox extension based on media devices and not media stream flag.
2806
2807         * Shared/WebPreferencesDefinitions.h:
2808         * UIProcess/API/C/WKPreferences.cpp:
2809         (WKPreferencesSetMediaDevicesEnabled):
2810         (WKPreferencesGetMediaDevicesEnabled):
2811         * UIProcess/API/C/WKPreferencesRef.h:
2812         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2813         (WebKit::WebProcessPool::platformInitializeWebProcess):
2814         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2815         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2816         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2817         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2818         * WebProcess/WebPage/WebPage.cpp:
2819         (WebKit::WebPage::updatePreferences):
2820
2821 2017-04-28  Brady Eidson  <beidson@apple.com>
2822
2823         Teach WebProcessPool to track a map of SessionIDs to WebPageProxys to manage their lifetime
2824         https://bugs.webkit.org/show_bug.cgi?id=171408
2825
2826         Reviewed by Alex Christensen.
2827
2828         * UIProcess/API/APIPageConfiguration.cpp:
2829         (API::PageConfiguration::sessionID):
2830         * UIProcess/API/APIPageConfiguration.h:
2831         * UIProcess/WebPageProxy.cpp:
2832         (WebKit::WebPageProxy::reattachToWebProcess):
2833         (WebKit::WebPageProxy::close):
2834         * UIProcess/WebProcessPool.cpp:
2835         (WebKit::WebProcessPool::pageAddedToProcess):
2836         (WebKit::WebProcessPool::pageRemovedFromProcess):
2837         * UIProcess/WebProcessPool.h:
2838         * UIProcess/WebProcessProxy.cpp:
2839         (WebKit::WebProcessProxy::createWebPage):
2840         (WebKit::WebProcessProxy::addExistingWebPage):
2841         (WebKit::WebProcessProxy::removeWebPage):
2842         * UIProcess/WebProcessProxy.h:
2843
2844 2017-04-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2845
2846         Move UUID from WebCore/platform to WTF
2847         https://bugs.webkit.org/show_bug.cgi?id=171372
2848
2849         Reviewed by Michael Catanzaro.
2850
2851         * UIProcess/Automation/WebAutomationSession.cpp:
2852         (WebKit::WebAutomationSession::handleForWebPageProxy):
2853         (WebKit::WebAutomationSession::handleForWebFrameID):
2854         * UIProcess/gtk/WaylandCompositor.cpp:
2855         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2856         (WebKit::createUUID):
2857         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2858         (WebKit::PDFPlugin::openWithNativeApplication):
2859
2860 2017-04-27  Chris Dumez  <cdumez@apple.com>
2861
2862         Align colspan/rowspan limits with the latest HTML specification
2863         https://bugs.webkit.org/show_bug.cgi?id=171322
2864
2865         Reviewed by Darin Adler.
2866
2867         GTK build fix.
2868
2869         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
2870         (webkit_dom_html_table_cell_element_get_col_span):
2871         (webkit_dom_html_table_cell_element_set_col_span):
2872
2873 2017-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>
2874
2875         WKUIDelegatePrivate needs a hook to vend data used to initialize item providers for data interaction
2876         https://bugs.webkit.org/show_bug.cgi?id=171386
2877         <rdar://problem/31557237>
2878
2879         Reviewed by Beth Dakin.
2880
2881         Add a new WKUIDelegate hook, _webView:adjustedDataInteractionItemProvidersForItemProvider:representingObjects:additionalData:.
2882
2883         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2884
2885 2017-04-27  Brady Eidson  <beidson@apple.com>
2886
2887         Refactor SessionID to support multiple non-ephemeral (persistent) sessions.
2888         https://bugs.webkit.org/show_bug.cgi?id=171367
2889
2890         Reviewed by Andy Estes.
2891
2892         * Shared/ChildProcess.cpp:
2893         (WebKit::ChildProcess::initialize): Child processes should never be generating new SessionIDs,
2894           so enable generation protection.
2895
2896         * Shared/WebCoreArgumentCoders.cpp:
2897         (IPC::ArgumentCoder<SessionID>::encode): Deleted.
2898         (IPC::ArgumentCoder<SessionID>::decode): Deleted.
2899         * Shared/WebCoreArgumentCoders.h:
2900
2901         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2902         (WebKit::WebsiteDataStore::createNonPersistent):
2903         (WebKit::generateNonPersistentSessionID): Deleted.
2904
2905 2017-04-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
2906
2907         REGRESSION(r213764): Async decoding of animated images is disabled for ImageDocument
2908         https://bugs.webkit.org/show_bug.cgi?id=170333
2909
2910         Reviewed by Simon Fraser.
2911
2912         Disbale the async decoding for large images for now.
2913
2914         * WebProcess/WebPage/WebPage.cpp:
2915         (WebKit::WebPage::updatePreferences):
2916
2917 2017-04-27  Brent Fulgham  <bfulgham@apple.com>
2918
2919         [WK2][macOS] Allow multi-touch related iokit-get-properties
2920         https://bugs.webkit.org/show_bug.cgi?id=171355
2921         <rdar://problem/31851928>
2922
2923         Reviewed by Alexey Proskuryakov.
2924
2925         During testing I've noticed Sandbox Violations being generated during some 'Force Touch' track pad use.
2926         The sandbox should allow these IOKit properties to be accessed.
2927
2928         * WebProcess/com.apple.WebProcess.sb.in:
2929
2930 2017-04-27  Alex Christensen  <achristensen@webkit.org>
2931
2932         Add stub SPI for setting cookie storage path on _WKWebsiteDataStoreConfiguration
2933         https://bugs.webkit.org/show_bug.cgi?id=171399
2934
2935         Reviewed by Brady Eidson.
2936
2937         This SPI isn't hooked up yet, but it has a test that will need to be updated once it works.
2938
2939         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2940         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2941         (-[WKWebsiteDataStore _initWithConfiguration:]):
2942         * UIProcess/API/Cocoa/_WKDraggableElementInfo.h:
2943         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
2944         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
2945         (-[_WKWebsiteDataStoreConfiguration _cookieStorageDirectory]):
2946         (-[_WKWebsiteDataStoreConfiguration _setCookieStorageDirectory:]):
2947         * UIProcess/WebsiteData/WebsiteDataStore.h:
2948         (WebKit::WebsiteDataStore::resolvedCookieStorageDirectory):
2949
2950 2017-04-27  Chris Dumez  <cdumez@apple.com>
2951
2952         Element.getBoundingClientRect() / getClientRects() should return a DOMRect types
2953         https://bugs.webkit.org/show_bug.cgi?id=171226
2954
2955         Reviewed by Simon Fraser.
2956
2957         GTK build fix.
2958
2959         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
2960         (toClientRect):
2961         (webkit_dom_element_get_bounding_client_rect):
2962         (webkit_dom_element_get_client_rects):
2963
2964 2017-04-27  Brady Eidson  <beidson@apple.com>
2965
2966         Update NetworkStorageSession to support multiple persistent sessions and explicitly set cookie storages.
2967         https://bugs.webkit.org/show_bug.cgi?id=171365
2968
2969         Reviewed by Andy Estes.
2970
2971         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2972         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2973
2974 2017-04-27  Alex Christensen  <achristensen@webkit.org>
2975
2976         Modernize Frame.h
2977         https://bugs.webkit.org/show_bug.cgi?id=171357
2978
2979         Reviewed by Andy Estes.
2980
2981         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2982         (WebKit::WebEditorClient::isSelectTrailingWhitespaceEnabled):
2983         * WebProcess/WebCoreSupport/WebEditorClient.h:
2984         * WebProcess/WebPage/WebPage.cpp:
2985         (WebKit::WebPage::contextMenuAtPointInWindow):
2986         (WebKit::handleContextMenuEvent):
2987         (WebKit::WebPage::isSelectTrailingWhitespaceEnabled):
2988         * WebProcess/WebPage/WebPage.h:
2989         * WebProcess/WebPage/ios/WebPageIOS.mm:
2990         (WebKit::WebPage::selectWithGesture):
2991         (WebKit::WebPage::selectPositionAtPoint):
2992         (WebKit::WebPage::selectPositionAtBoundaryWithDirection):
2993         (WebKit::WebPage::rangeForGranularityAtPoint):
2994         (WebKit::WebPage::selectTextWithGranularityAtPoint):
2995         (WebKit::WebPage::updateSelectionWithExtentPointAndBoundary):
2996         (WebKit::WebPage::updateSelectionWithExtentPoint):
2997
2998 2017-04-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2999
3000         [GTK] Remote inspector should support inspecting targets with previous version of backend commands
3001         https://bugs.webkit.org/show_bug.cgi?id=171267
3002
3003         Reviewed by Michael Catanzaro.
3004
3005         There's a FIXME for this in the code. The remote inspector proxy allows to pass a backend commands URL when
3006         inspecting a target. That URL, if not empty, is used as Protocol/InspectorBackendCommands.js in the inspector
3007         code instead of the local copy. We are currently assuming that both ends use the same version of that file.
3008
3009         * UIProcess/glib/RemoteInspectorClient.cpp:
3010         (WebKit::RemoteInspectorProxy::load): Pass RemoteInspectorClient::backendCommandsURL() to load().
3011         (WebKit::RemoteInspectorClient::setupConnection): Get the local backend commands hash and pass it to
3012         SetupInspectorClient method. Extract the server backend commands from the result and call setBackendCommands().
3013         (WebKit::RemoteInspectorClient::setBackendCommands): Create a data URL for the server backend commands file
3014         conents if needed.
3015         * UIProcess/glib/RemoteInspectorClient.h:
3016         (WebKit::RemoteInspectorClient::backendCommandsURL):
3017
3018 2017-04-26  Wenson Hsieh  <wenson_hsieh@apple.com>
3019
3020         WebItemProviderPasteboard should not synchronously load provided data
3021         https://bugs.webkit.org/show_bug.cgi?id=171341
3022         <rdar://problem/31614010>
3023
3024         Reviewed by Tim Horton.
3025
3026         Adds plumbing for updatePreferredTypeIdentifiers through the WebPasteboardProxy. This allows the web process to
3027         signal to the UI process what UTIs the current drop target should accept and load. See WebCore ChangeLog for more
3028         details.
3029
3030         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
3031         (WebKit::WebPasteboardProxy::updatePreferredTypeIdentifiers):
3032         * UIProcess/WebPasteboardProxy.h:
3033         * UIProcess/WebPasteboardProxy.messages.in:
3034         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3035         (WebKit::WebPlatformStrategies::updatePreferredTypeIdentifiers):
3036         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3037
3038 2017-04-26  Youenn Fablet  <youenn@apple.com>
3039
3040         Unauthenticated CORS preflight requests should not use client certificates
3041         https://bugs.webkit.org/show_bug.cgi?id=171298
3042
3043         Reviewed by Alex Christensen.
3044
3045         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3046         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Ensuring that session dedicated to requests that do not want to use credentials do not look for client credentials.
3047
3048 2017-04-26  Eric Carlson  <eric.carlson@apple.com>
3049
3050         The current page is given a muted state when starting a media stream on iOS.
3051         https://bugs.webkit.org/show_bug.cgi?id=171290
3052         <rdar://problem/31821427>
3053
3054         Reviewed by Jer Noble.
3055
3056         * UIProcess/UserMediaProcessManager.cpp:
3057         (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Don't mute the current
3058         page on iOS either, that will prevent the new media stream from playing.
3059
3060 2017-04-26  Alex Christensen  <achristensen@webkit.org>
3061
3062         Make user script injection more robust
3063         https://bugs.webkit.org/show_bug.cgi?id=171339
3064         <rdar://problem/30643691>
3065
3066         Reviewed by Geoffrey Garen.
3067
3068         * WebProcess/UserContent/WebUserContentController.cpp:
3069         (WebKit::WebUserContentController::forEachUserScript):
3070         (WebKit::WebUserContentController::forEachUserStyleSheet):
3071         (WebKit::WebUserContentController::forEachUserMessageHandler):
3072         * WebProcess/UserContent/WebUserContentController.h:
3073
3074 2017-04-26  Zalan Bujtas  <zalan@apple.com>
3075
3076         RTL: recent searches popover is displayed in incorrect location
3077         https://bugs.webkit.org/show_bug.cgi?id=171338
3078         <rdar://problem/31377807>
3079
3080         Reviewed by Dean Jackson.
3081
3082         Add RTL support for the pop-under branch.
3083
3084         * UIProcess/mac/WebPopupMenuProxyMac.mm:
3085         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
3086
3087 2017-04-26  Antti Koivisto  <antti@apple.com>
3088
3089         Enable expired-only reload policy on Mac and iOS
3090         https://bugs.webkit.org/show_bug.cgi?id=171264
3091         <rdar://problem/31807637>
3092
3093         Reviewed by Andreas Kling.
3094
3095         Enable the reload policy where only expired subresources are revalidated on Mac and iOS.
3096         The behavor is enabled in Safari and for other clients based on SDK version check.
3097
3098         * UIProcess/API/C/WKPage.cpp:
3099         (WKPageReload):
3100         * UIProcess/API/Cocoa/WKWebView.mm:
3101         (-[WKWebView reload]):
3102         * UIProcess/Cocoa/VersionChecks.h:
3103
3104 2017-04-26  Andy Estes  <aestes@apple.com>
3105
3106         [macOS] Add picture-in-picture support to WebPlaybackControlsManager
3107         https://bugs.webkit.org/show_bug.cgi?id=171328
3108         <rdar://problem/29875010>
3109
3110         Reviewed by Jer Noble.
3111
3112         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
3113         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
3114         (WebKit::WebPlaybackSessionModelContext::togglePictureInPicture): Added. Calls
3115         WebPlaybackSessionManagerProxy::togglePictureAndPicture().
3116         (WebKit::WebPlaybackSessionManagerProxy::togglePictureInPicture): Added. Sends
3117         TogglePictureInPicture to WebPlaybackSessionManager.
3118         * UIProcess/Cocoa/WebViewImpl.mm:
3119         (WebKit::WebViewImpl::updateMediaTouchBar): Called
3120         -[WebPlaybackControlsManager setAllowsPictureInPicturePlayback:YES] if
3121         WebPreferences::allowsPictureInPictureMediaPlayback() is true.
3122         * WebProcess/cocoa/WebPlaybackSessionManager.h:
3123         * WebProcess/cocoa/WebPlaybackSessionManager.messages.in:
3124         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
3125         (WebKit::WebPlaybackSessionManager::togglePictureInPicture): Added. Sets a
3126         UserGestureIndicator and calls WebPlaybackSessionModel::togglePictureInPicture().
3127
3128 2017-04-26  Tim Horton  <timothy_horton@apple.com>
3129
3130         WebKit calls AppKit NSCell API from a background queue
3131         https://bugs.webkit.org/show_bug.cgi?id=171318
3132         <rdar://problem/31798317>
3133
3134         Reviewed by Anders Carlsson.
3135
3136         * UIProcess/mac/ServicesController.mm:
3137         (WebKit::ServicesController::refreshExistingServices):
3138         Synchronously bounce to the main thread to do non-thread-safe NSCell related work.
3139
3140 2017-04-25  Alex Christensen  <achristensen@webkit.org>
3141
3142         Encoded filename should be decoded for WKContentExtension.identifier
3143         https://bugs.webkit.org/show_bug.cgi?id=171316
3144
3145         Reviewed by Andy Estes.
3146
3147         * UIProcess/API/APIContentExtensionStore.cpp:
3148         (API::createExtension):
3149         (API::ContentExtensionStore::lookupContentExtension):
3150         (API::ContentExtensionStore::getAvailableContentExtensionIdentifiers):
3151
3152 2017-04-26  Andrew Gold  <agold@apple.com>
3153
3154         Move mediaCaptureEnabled from WKWebViewConfiguration to WKPreferences
3155         https://bugs.webkit.org/show_bug.cgi?id=171294
3156
3157         Reviewed by Eric Carlson.
3158
3159         Since we now want the ability to toggle this setting dynamically, I have
3160         moved it from WKWebViewConfiguration to WKPreferences.
3161
3162         * UIProcess/API/Cocoa/WKPreferences.mm:
3163         (-[WKPreferences _mediaStreamEnabled]):
3164         (-[WKPreferences _setMediaStreamEnabled:]):
3165
3166         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3167         * UIProcess/API/Cocoa/WKWebView.mm:
3168         (-[WKWebView _initializeWithConfiguration:]): No longer set mediaStream enabled from
3169         the configuration.
3170
3171         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3172         (-[WKWebViewConfiguration copyWithZone:]):
3173         (-[WKWebViewConfiguration _mediaStreamEnabled]): Deleted.
3174         (-[WKWebViewConfiguration _setMediaStreamEnabled:]): Deleted.
3175         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3176
3177 2017-04-25  Alex Christensen  <achristensen@webkit.org>
3178
3179         REGRESSION(206450): WebKit2PlatformMouseEvent m_modifierFlags not set
3180         https://bugs.webkit.org/show_bug.cgi?id=171297
3181         <rdar://problem/31530719>
3182
3183         Reviewed by Geoffrey Garen.
3184
3185         * Shared/WebEventConversion.cpp:
3186         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
3187
3188 2017-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
3189
3190         Unreviewed, speculative build fix
3191
3192         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3193
3194         For the time being, remove all references to UIItemProviders from this private header.
3195         This should be fixed to use unavailability macros in a followup. See <rdar://problem/31827095>.
3196
3197 2017-04-25  Brent Fulgham  <bfulgham@apple.com>
3198
3199         Limit allowed size of document.title to avoid locking WebKit clients
3200         https://bugs.webkit.org/show_bug.cgi?id=165113
3201         <rdar://problem/28324389>
3202
3203         Reviewed by Darin Adler.
3204
3205         When a web application attempts to set an extremely long title, truncate the
3206         title to a more reasonable size.
3207
3208         We do this at at the presentation layer, rather than in the DOM, so that we do
3209         not affect script function. Instead, we merely limit display to a level that is
3210         reasonable for normal GUI widgets. Anything else needs to be truncated in the UI
3211         layer, so it is a waste of effort to send across IPC.
3212
3213         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3214         (WebKit::WebFrameLoaderClient::dispatchDidReceiveTitle):
3215         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3216
3217 2017-04-25  John Wilander  <wilander@apple.com>
3218
3219         Resource Load Statistics: Introduce shorter time-to-live for cookie partition whitelisting
3220         https://bugs.webkit.org/show_bug.cgi?id=171295
3221         <rdar://problem/31823818>
3222
3223         Reviewed by Brent Fulgham.
3224
3225         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
3226         (WKResourceLoadStatisticsManagerSetTimeToLiveCookiePartitionFree):
3227         (WKResourceLoadStatisticsManagerFireShouldPartitionCookiesHandler):
3228         (WKResourceLoadStatisticsManagerFireShouldPartitionCookiesHandlerForOneDomain):
3229             Changes and additions to test infrastructure.
3230         * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
3231         * UIProcess/WebResourceLoadStatisticsManager.cpp:
3232         (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveCookiePartitionFree):
3233         (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler):
3234         (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandlerForOneDomain):
3235         (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState):
3236             Changes and additions to test infrastructure.
3237         * UIProcess/WebResourceLoadStatisticsManager.h:
3238         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3239         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
3240             No longer sends a boolean parameter to
3241             WebCore::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
3242
3243 2017-04-25  Simon Fraser  <simon.fraser@apple.com>
3244
3245         REGRESSION (r213719): WebGL content on cubeslam.com is 1/4 expected size
3246         https://bugs.webkit.org/show_bug.cgi?id=171300
3247         rdar://problem/31051538
3248
3249         Reviewed by Dean Jackson.
3250
3251         Propagating the contentsScale to the UI process for canvas content layers causes
3252         scaling issues, so don't do it for contents-provided layers.
3253         
3254         No test because WebGL can't be tested in the iOS simulator.
3255
3256         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3257         (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
3258
3259 2017-04-25  Brady Eidson  <beidson@apple.com>
3260
3261         Update WebProcess(Pool) to assume there's always a WebsiteDataStore
3262         https://bugs.webkit.org/show_bug.cgi?id=171299
3263
3264         Reviewed by Alex Christensen.
3265
3266         * UIProcess/WebPageProxy.cpp:
3267         (WebKit::WebPageProxy::reattachToWebProcess):
3268         * UIProcess/WebProcessPool.cpp:
3269         (WebKit::WebProcessPool::createNewWebProcess):
3270         (WebKit::WebProcessPool::warmInitialProcess):
3271         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
3272         (WebKit::WebProcessPool::createWebPage):
3273         * UIProcess/WebProcessPool.h:
3274         * UIProcess/WebProcessProxy.cpp:
3275         (WebKit::WebProcessProxy::create):
3276         (WebKit::WebProcessProxy::WebProcessProxy):
3277         (WebKit::m_userMediaCaptureManagerProxy):
3278         * UIProcess/WebProcessProxy.h:
3279         (WebKit::WebProcessProxy::websiteDataStore):
3280
3281 2017-04-25  Ryan Haddad  <ryanhaddad@apple.com>
3282
3283         Unreviewed, rolling out r215730.
3284
3285         The LayoutTest for this change is a flaky timeout on mac-wk1
3286         debug.
3287
3288         Reverted changeset:
3289
3290         "Enable expired-only reload policy on Mac and iOS"
3291         https://bugs.webkit.org/show_bug.cgi?id=171264
3292         http://trac.webkit.org/changeset/215730
3293
3294 2017-04-24  Matt Rajca  <mrajca@apple.com>
3295
3296         Indicate presence of audio when handling autoplay events.
3297         https://bugs.webkit.org/show_bug.cgi?id=171227
3298
3299         Reviewed by Alex Christensen.
3300
3301         * UIProcess/API/APIUIClient.h:
3302         (API::UIClient::handleAutoplayEvent):
3303         * UIProcess/API/C/WKPage.cpp:
3304         (WKPageSetPageUIClient):
3305         * UIProcess/API/C/WKPageUIClient.h:
3306         * UIProcess/WebPageProxy.cpp:
3307         (WebKit::WebPageProxy::handleAutoplayEvent):
3308         * UIProcess/WebPageProxy.h:
3309         * UIProcess/WebPageProxy.messages.in:
3310         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3311         (WebKit::WebChromeClient::handleAutoplayEvent):
3312         * WebProcess/WebCoreSupport/WebChromeClient.h:
3313
3314 2017-04-25  Daniel Bates  <dabates@apple.com>
3315
3316         [Cocoa][Win] Enable of X-Content-Type-Options: nosniff header
3317         https://bugs.webkit.org/show_bug.cgi?id=136452
3318         <rdar://problem/23412620>
3319
3320         Reviewed by Brent Fulgham.
3321
3322         Enable X-Content-Type-Options: nosniff on Mac, iOS and Windows platforms.
3323
3324         * Configurations/FeatureDefines.xcconfig:
3325
3326 2017-04-25  John Wilander  <wilander@apple.com>
3327
3328         Resource Load Statistics: Clear network process cache when clearing store
3329         https://bugs.webkit.org/show_bug.cgi?id=171256
3330         <rdar://problem/31802347>
3331
3332         Reviewed by Brent Fulgham.
3333
3334         * NetworkProcess/NetworkProcess.cpp:
3335         (WebKit::NetworkProcess::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
3336             Now takes and passes on the boolean parameter clearFirst to
3337             WebCore::NetworkStorageSession::setShouldPartitionCookiesForHosts().
3338         * NetworkProcess/NetworkProcess.h:
3339         * NetworkProcess/NetworkProcess.messages.in:
3340             The message ShouldPartitionCookiesForTopPrivatelyOwnedDomains now
3341             takes the boolean parameter clearFirst.
3342         * UIProcess/Network/NetworkProcessProxy.cpp:
3343         (WebKit::NetworkProcessProxy::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
3344             Now takes and passes on the boolean parameter clearFirst to
3345             Messages::NetworkProcess::ShouldPartitionCookiesForTopPrivatelyOwnedDomains.
3346         * UIProcess/Network/NetworkProcessProxy.h:
3347         * UIProcess/Network/NetworkProcessProxy.messages.in:
3348             The message ShouldPartitionCookiesForTopPrivatelyOwnedDomains now
3349             takes the boolean parameter clearFirst.
3350         * UIProcess/WebResourceLoadStatisticsManager.cpp:
3351         (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler):
3352             Now uses the boolean parameter clearFirst when calling
3353             WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler().
3354         (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore):
3355             No longer uses the deleted store getter.
3356         (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState):
3357             No longer uses the deleted store getter.
3358         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3359         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
3360             No sends the boolean parameter clearFirst to
3361             ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
3362         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
3363             Now expects a handler with the boolean parameter clearFirst.
3364         (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
3365         * UIProcess/WebResourceLoadStatisticsStore.h:
3366             Now uses the new WebCore::ResourceLoadObserver::clearInMemoryStore().
3367         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3368         (WebKit::WebsiteDataStore::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
3369             Now takes and passes on the boolean parameter clearFirst in its
3370             message to the network process.
3371         (WebKit::WebsiteDataStore::registerSharedResourceLoadObserver):
3372             Now expects a handler with the boolean parameter clearFirst.
3373         * UIProcess/WebsiteData/WebsiteDataStore.h:
3374
3375 2017-04-25  Chris Dumez  <cdumez@apple.com>
3376
3377         Content-Disposition header filename is ignored when 'download' attribute is specified in HTML
3378         https://bugs.webkit.org/show_bug.cgi?id=171239
3379         <rdar://problem/31789855>
3380
3381         Reviewed by Alex Christensen.
3382
3383         Content-Disposition header filename is ignored when 'download' attribute is specified in HTML.
3384         This is not as per HTML specification:
3385         - https://html.spec.whatwg.org/#as-a-download (Step 2)
3386
3387         Content-Disposition header filename is supposed to override the value of the download attribute.
3388
3389         Firefox and Chrome follow the specification.
3390
3391         * NetworkProcess/NetworkProcess.cpp:
3392         (WebKit::NetworkProcess::findPendingDownloadLocation):
3393         * UIProcess/Downloads/DownloadProxy.cpp:
3394         (WebKit::DownloadProxy::didReceiveResponse):
3395
3396 2017-04-25  Carlos Garcia Campos  <cgarcia@igalia.com>
3397
3398         [GTK] Add WebKitInspectorWindow to create inspector windows from local and remote inspector
3399         https://bugs.webkit.org/show_bug.cgi?id=171261
3400
3401         Reviewed by Michael Catanzaro.
3402
3403         The code is currently duplicated in WebInspectorProxyGtk.cpp and RemoteWebInspectorProxyGtk.cpp. We can simplify
3404         it by using a common widget in both places.
3405         This patch also fixes the build when using GTK+ < 3.16.
3406
3407         * PlatformGTK.cmake:
3408         * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp:
3409         (WebKit::RemoteWebInspectorProxy::updateWindowTitle):
3410         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
3411         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3412         (WebKit::WebInspectorProxy::createInspectorWindow):
3413         (WebKit::WebInspectorProxy::updateInspectorWindowTitle):
3414         * UIProcess/gtk/WebKitInspectorWindow.cpp: Added.
3415         (webkit_inspector_window_class_init):
3416         (webkit_inspector_window_init):
3417         (webkitInspectorWindowNew):
3418         (webkitInspectorWindowSetSubtitle):
3419         * UIProcess/gtk/WebKitInspectorWindow.h: Added.
3420
3421 2017-04-25  Antti Koivisto  <antti@apple.com>
3422
3423         Enable expired-only reload policy on Mac and iOS
3424         https://bugs.webkit.org/show_bug.cgi?id=171264
3425         <rdar://problem/31807637>
3426
3427         Reviewed by Andreas Kling.
3428
3429         Enable the reload policy where only expired subresources are revalidated on Mac and iOS.
3430         The behavor is enabled in Safari and for other clients based on SDK version check.
3431
3432         * UIProcess/API/C/WKPage.cpp:
3433         (WKPageReload):
3434         * UIProcess/API/Cocoa/WKWebView.mm:
3435         (-[WKWebView reload]):
3436         * UIProcess/Cocoa/VersionChecks.h:
3437
3438 2017-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
3439
3440         Support reading NSURL titles from the pasteboard when performing data interaction
3441         https://bugs.webkit.org/show_bug.cgi?id=171156
3442         <rdar://problem/31356937>
3443
3444         Reviewed by Tim Horton.
3445
3446         Adjust for interface changes in WebCore to support plumbing the title of an NSURL from the platform pasteboard
3447         back to WebCore. Additionally, implement WebEditorClient::hasRichlyEditableSelection (which previously returned
3448         false) to check whether the current selection is richly editable, or the drop caret is in richly editable content.
3449         See WebCore ChangeLog for more details.
3450
3451         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
3452         (WebKit::WebPasteboardProxy::readURLFromPasteboard):
3453         * UIProcess/WebPasteboardProxy.h:
3454         * UIProcess/WebPasteboardProxy.messages.in:
3455         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3456         (WebKit::WebPlatformStrategies::readURLFromPasteboard):
3457         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3458         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
3459         (WebKit::WebEditorClient::hasRichlyEditableSelection):
3460         * WebProcess/WebPage/WebPage.cpp:
3461         (WebKit::WebPage::hasRichlyEditableSelection):
3462         * WebProcess/WebPage/WebPage.h:
3463
3464 2017-04-24  Wenson Hsieh  <wenson_hsieh@apple.com>
3465
3466         Respect fidelity order when reading web content from item providers
3467         https://bugs.webkit.org/show_bug.cgi?id=171155
3468         <rdar://problem/31356937>
3469
3470         Reviewed by Tim Horton.
3471
3472         Adjusts for changes in WebCore by adding plumbing to support Pasteboard::getTypesByFidelityForItemAtIndex. See
3473         WebCore/ChangeLog for more details.
3474
3475         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
3476         (WebKit::WebPasteboardProxy::getPasteboardTypesByFidelityForItemAtIndex):
3477         * UIProcess/WebPasteboardProxy.h:
3478         * UIProcess/WebPasteboardProxy.messages.in:
3479         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3480         (WebKit::WebPlatformStrategies::getTypesByFidelityForItemAtIndex):
3481         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3482
3483 2017-04-24  Brady Eidson  <beidson@apple.com>
3484
3485         WebProcessPools should always have a WebsiteDataStore
3486         https://bugs.webkit.org/show_bug.cgi?id=171252
3487
3488         Reviewed by Alex Christensen.
3489
3490         * UIProcess/API/APIWebsiteDataStore.cpp:
3491         (API::WebsiteDataStore::registerSharedResourceLoadObserver): Deleted.
3492         * UIProcess/API/APIWebsiteDataStore.h:
3493         * UIProcess/API/C/WKContext.cpp:
3494         (WKContextGetWebsiteDataStore):
3495         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3496         (WebKit::WebProcessPool::platformInitialize):
3497         * UIProcess/WebProcessPool.cpp:
3498         (WebKit::WebProcessPool::WebProcessPool):
3499         (WebKit::WebProcessPool::createWebPage):
3500         * UIProcess/WebProcessPool.h:
3501         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3502         (WebKit::WebsiteDataStore::isAssociatedProcessPool):
3503
3504 2017-04-24  Youenn Fablet  <youenn@apple.com>
3505
3506         Set defaults video getUserMedia constraints
3507         https://bugs.webkit.org/show_bug.cgi?id=171127
3508
3509         Reviewed by Eric Carlson.
3510
3511         Updated to cope with MediaStreamConstraintsImpl refactoring.
3512
3513         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
3514         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
3515         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3516         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
3517
3518 2017-04-24  Chris Dumez  <cdumez@apple.com>
3519
3520         Allow tabs with capturing audio or video to exceed background CPU limit
3521         https://bugs.webkit.org/show_bug.cgi?id=171249
3522         <rdar://problem/31796314>
3523
3524         Reviewed by Geoffrey Garen.
3525
3526         Allow tabs with capturing audio or video to exceed background CPU limit as this
3527         is a legit case of potentially high background CPU use.
3528
3529         * UIProcess/WebProcessProxy.cpp:
3530         (WebKit::WebProcessProxy::didExceedBackgroundCPULimit):
3531
3532 2017-04-24  Andy Estes  <aestes@apple.com>
3533
3534         Try to fix the 32-bit macOS build.
3535
3536         * UIProcess/Cocoa/WebViewImpl.mm:
3537
3538 2017-04-24  Andy Estes  <aestes@apple.com>
3539
3540         [macOS] Enable media selection button on AVTouchBarScrubber
3541         https://bugs.webkit.org/show_bug.cgi?id=171149
3542         <rdar://problem/29875010>
3543
3544         Reviewed by Beth Dakin.
3545
3546         * UIProcess/Cocoa/WebViewImpl.mm:
3547         (WebKit::WebViewImpl::updateMediaTouchBar):
3548
3549 2017-04-24  Alex Christensen  <achristensen@webkit.org>
3550
3551         Reduce copies and allocations in SharedBuffer::append
3552         https://bugs.webkit.org/show_bug.cgi?id=170956
3553
3554         Reviewed by Andreas Kling.
3555
3556         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3557         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
3558         * Platform/IPC/DataReference.cpp:
3559         (IPC::SharedBufferDataReference::encode):
3560         * Shared/ShareableResource.cpp:
3561         (WebKit::ShareableResource::wrapInSharedBuffer):
3562         * UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm:
3563         (-[WKURLSchemeHandlerTaskImpl didReceiveData:]):
3564         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3565         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
3566         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3567         (WebKit::PDFPlugin::addArchiveResource):
3568         (WebKit::PDFPlugin::liveResourceData):
3569         (WebKit::PDFPlugin::writeItemsToPasteboard):
3570         * WebProcess/Plugins/PluginView.cpp:
3571         (WebKit::PluginView::redeliverManualStream):
3572         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
3573         (WebKit::WebDragClient::declareAndWriteDragImage):
3574         * WebProcess/WebPage/mac/WebPageMac.mm:
3575         (WebKit::WebPage::cachedResponseDataForURL):
3576
3577 2017-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
3578
3579         [GTK] Switch to use ENABLE_REMOTE_INSPECTOR instead of ENABLE_INSPECTOR_SERVER for the remote inspector
3580         https://bugs.webkit.org/show_bug.cgi?id=166680
3581
3582         Reviewed by Michael Catanzaro.
3583
3584         Remove INSPECTOR_SERVER code and add new classes to implement REMOTE_INSPECTOR. The WebKitWebContext registers a
3585         custom protocol "inspector" that loads a page with the list of debuggable targets.
3586
3587         * PlatformGTK.cmake: Add new files to compilation and remove the old ones.
3588         * UIProcess/API/gtk/WebKit2InspectorGResourceBundle.xml: Removed.
3589         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp: Added.
3590         (WebKit::RemoteInspectorProtocolHandler::RemoteInspectorProtocolHandler):
3591         (WebKit::RemoteInspectorProtocolHandler::~RemoteInspectorProtocolHandler):
3592         (WebKit::RemoteInspectorProtocolHandler::webViewDestroyed):
3593         (WebKit::RemoteInspectorProtocolHandler::userContentManagerDestroyed):
3594         (WebKit::RemoteInspectorProtocolHandler::handleRequest):
3595         (WebKit::RemoteInspectorProtocolHandler::inspect):
3596         (WebKit::RemoteInspectorProtocolHandler::targetListChanged):
3597         (WebKit::RemoteInspectorProtocolHandler::connectionClosed):
3598         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.h: Added.
3599         * UIProcess/API/gtk/WebKitWebContext.cpp:
3600         (webkitWebContextConstructed):
3601         * UIProcess/InspectorServer/HTTPRequest.cpp: Add missing ENABLE(INSPECTOR_SERVER) ifdefs.
3602         * UIProcess/InspectorServer/HTTPRequest.h:
3603         * UIProcess/InspectorServer/WebInspectorServer.h:
3604         * UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp: Removed.
3605         * UIProcess/RemoteWebInspectorProxy.cpp:
3606         * UIProcess/RemoteWebInspectorProxy.h:
3607         * UIProcess/WebProcessPool.cpp:
3608         * UIProcess/glib/RemoteInspectorClient.cpp: Added.
3609         (WebKit::RemoteInspectorClient::RemoteInspectorClient):
3610         (WebKit::RemoteInspectorClient::~RemoteInspectorClient):
3611         (WebKit::dbusConnectionCallAsyncReadyCallback):
3612         (WebKit::RemoteInspectorClient::connectionClosedCallback):
3613         (WebKit::RemoteInspectorClient::setupConnection):
3614         (WebKit::RemoteInspectorClient::connectionClosed):
3615         (WebKit::RemoteInspectorClient::inspect):
3616         (WebKit::RemoteInspectorClient::sendMessageToBackend):
3617         (WebKit::RemoteInspectorClient::closeFromFrontend):
3618         (WebKit::RemoteInspectorClient::setTargetList):
3619         (WebKit::RemoteInspectorClient::sendMessageToFrontend):
3620         * UIProcess/glib/RemoteInspectorClient.h: Added.
3621         (WebKit::RemoteInspectorObserver::~RemoteInspectorObserver):
3622         (WebKit::RemoteInspectorClient::targets):
3623         (WebKit::RemoteInspectorClient::hostAndPort):
3624         * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp: Added.
3625         (WebKit::RemoteWebInspectorProxy::updateWindowTitle):
3626         (WebKit::inspectorViewDestroyed):
3627         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
3628         (WebKit::RemoteWebInspectorProxy::platformCloseFrontendPageAndWindow):
3629         (WebKit::RemoteWebInspectorProxy::platformBringToFront):
3630         (WebKit::RemoteWebInspectorProxy::platformSave):
3631         (WebKit::RemoteWebInspectorProxy::platformAppend):
3632         (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag):
3633         (WebKit::RemoteWebInspectorProxy::platformOpenInNewTab):
3634         * UIProcess/gtk/WebProcessPoolGtk.cpp:
3635         (WebKit::initializeRemoteInspectorServer):
3636         (WebKit::WebProcessPool::platformInitialize):
3637         (WebKit::WebProcessPool::platformInitializeWebProcess):
3638         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
3639         (didReceiveMessageToPage): Updated after the GRefPtr hash traitds changes.
3640         * config.h:
3641
3642 2017-04-23  Dan Bernstein  <mitz@apple.com>
3643
3644         [macOS] WKWebInspectorProxyObjCAdapter has a public ivar
3645         https://bugs.webkit.org/show_bug.cgi?id=171200
3646
3647         Reviewed by Geoffrey Garen.
3648
3649         * UIProcess/API/C/mac/WKInspectorPrivateMac.h: Made ivar private.
3650
3651 2017-04-23  Commit Queue  <commit-queue@webkit.org>
3652
3653         Unreviewed, rolling out r215657 and r215676.
3654         https://bugs.webkit.org/show_bug.cgi?id=171201
3655
3656         Broke the build (Requested by ap on #webkit).
3657
3658         Reverted changesets:
3659
3660         "[macOS] Enable media selection button on AVTouchBarScrubber"
3661         https://bugs.webkit.org/show_bug.cgi?id=171149
3662         http://trac.webkit.org/changeset/215657
3663
3664         "Build fix after r215657."
3665         http://trac.webkit.org/changeset/215676
3666
3667 2017-04-23  Alexey Proskuryakov  <ap@apple.com>
3668
3669         Build fix after r215657.
3670
3671         * UIProcess/Cocoa/WebViewImpl.mm:
3672
3673 2017-04-23  Andy Estes  <aestes@apple.com>
3674
3675         [macOS] AVTouchBarMediaSelectionOptions should be created with the correct type
3676         https://bugs.webkit.org/show_bug.cgi?id=171192
3677         <rdar://problem/29875010>
3678
3679         Reviewed by Wenson Hsieh.
3680
3681         * Shared/WebCoreArgumentCoders.cpp:
3682         (IPC::ArgumentCoder<MediaSelectionOption>::encode):
3683         (IPC::ArgumentCoder<MediaSelectionOption>::decode):
3684         * Shared/WebCoreArgumentCoders.h:
3685         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
3686         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in:
3687         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
3688         (WebKit::WebPlaybackSessionModelContext::setAudioMediaSelectionOptions):
3689         (WebKit::WebPlaybackSessionModelContext::setLegibleMediaSelectionOptions):
3690         (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionOptions):
3691         (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionOptions):
3692         * WebProcess/cocoa/WebPlaybackSessionManager.h:
3693         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
3694         (WebKit::WebPlaybackSessionInterfaceContext::audioMediaSelectionOptionsChanged):
3695         (WebKit::WebPlaybackSessionInterfaceContext::legibleMediaSelectionOptionsChanged):
3696         (WebKit::WebPlaybackSessionManager::audioMediaSelectionOptionsChanged):
3697         (WebKit::WebPlaybackSessionManager::legibleMediaSelectionOptionsChanged):
3698
3699 2017-04-21  Wenson Hsieh  <wenson_hsieh@apple.com>
3700
3701         Support writing link titles to the pasteboard when beginning data interaction on a link
3702         https://bugs.webkit.org/show_bug.cgi?id=171154
3703         <rdar://problem/31356937>
3704
3705         Reviewed by Andy Estes.
3706
3707         Adds support for setting the _title attribute of NSURLs written to the pasteboard. See WebCore ChangeLog for more details.
3708
3709         * Scripts/webkit/messages.py:
3710         (headers_for_type):
3711         * Shared/WebCoreArgumentCoders.cpp:
3712         (IPC::ArgumentCoder<PasteboardURL>::encode):
3713         (IPC::ArgumentCoder<PasteboardURL>::decode):
3714         * Shared/WebCoreArgumentCoders.h:
3715
3716         Teach PasteboardURL to be serialized in IPC. For now, we just send across the absolute string of the link and
3717         its title.
3718
3719         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
3720         (WebKit::WebPasteboardProxy::writeURLToPasteboard):
3721         * UIProcess/WebPasteboardProxy.h:
3722         * UIProcess/WebPasteboardProxy.messages.in:
3723
3724         Add IPC plumbing for writing PasteboarURLs to the pasteboard.
3725
3726         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3727         (WebKit::WebPlatformStrategies::writeToPasteboard):
3728         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3729
3730 2017-04-21  Michael Catanzaro  <mcatanzaro@igalia.com>
3731
3732         Unreviewed, rolling out r215608.
3733
3734         Hundreds of test failures on GTK bot
3735
3736         Reverted changeset:
3737
3738         "Reduce copies and allocations in SharedBuffer::append"
3739         https://bugs.webkit.org/show_bug.cgi?id=170956
3740         http://trac.webkit.org/changeset/215608
3741
3742 2017-04-21  Andy Estes  <aestes@apple.com>
3743
3744         [macOS] Enable media selection button on AVTouchBarScrubber
3745         https://bugs.webkit.org/show_bug.cgi?id=171149
3746         <rdar://problem/29875010>
3747
3748         Reviewed by Beth Dakin.
3749
3750         * UIProcess/Cocoa/WebViewImpl.mm:
3751         (WebKit::WebViewImpl::updateMediaTouchBar):
3752
3753 2017-04-21  Wenson Hsieh  <wenson_hsieh@apple.com>
3754
3755         [WK2] Add delegate hooks for overriding unhanded data interaction operations
3756         https://bugs.webkit.org/show_bug.cgi?id=171005
3757         <rdar://problem/31669646>
3758
3759         Reviewed by Tim Horton.
3760
3761         Adds support for overriding data interaction operations through two new delegate methods:
3762         _webView:willUpdateDataInteractionOperationToOperation:forSession:, and
3763         _webView:dataInteractionOperationWasHandled:forSession:. The former may be overridden to return a different
3764         operation type than what WebKit would originally have returned, and the latter may be overridden to run custom
3765         logic after the web process has handled a data interaction operation.
3766
3767         Additionally, includes some minor cleanup around WKContentViewInteraction. With the new
3768         _webView:dataInteractionOperationWasHandled:forSession: delegate method, the last method on _WKTestingDelegate
3769         may be removed. This means _WKTestingDelegate is no longer needed, so this patch removes its header entirely.
3770         Also, relocates some state variables formerly on WKContentView to WKContentView's WKDataInteractionState struct
3771         instead, so that all state associated with data interaction may be cleaned up at the same time.
3772
3773         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3774         * UIProcess/API/Cocoa/WKWebView.mm:
3775         (-[WKWebView _testingDelegate]): Deleted.
3776         (-[WKWebView _setTestingDelegate:]): Deleted.
3777         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3778         * UIProcess/API/Cocoa/_WKTestingDelegate.h: Removed.
3779         * UIProcess/PageClient.h:
3780         * UIProcess/WebPageProxy.h:
3781         * UIProcess/WebPageProxy.messages.in:
3782
3783         Add a new "handled" IPC argument to DidPerformDataInteractionControllerOperation. This lets the UI process
3784         know whether or not the data interaction operation was handled by the web process, and is eventually plumbed
3785         through to the UI delegate via the new SPI.
3786
3787         * UIProcess/ios/PageClientImplIOS.h:
3788         * UIProcess/ios/PageClientImplIOS.mm:
3789         (WebKit::PageClientImpl::didPerformDataInteractionControllerOperation):
3790         * UIProcess/ios/WKContentViewInteraction.h:
3791         * UIProcess/ios/WKContentViewInteraction.mm:
3792         (-[WKContentView cleanupInteraction]):
3793         (-[WKContentView _displayFormNodeInputView]):
3794         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
3795         * UIProcess/ios/WebPageProxyIOS.mm:
3796         (WebKit::WebPageProxy::didPerformDataInteractionControllerOperation):
3797         * WebKit2.xcodeproj/project.pbxproj:
3798         * WebProcess/WebPage/WebPage.cpp:
3799         (WebKit::WebPage::performDragControllerAction):
3800
3801 2017-04-21  Anders Carlsson  <andersca@apple.com>
3802
3803         Stop using deprecated APIs, part 5
3804         https://bugs.webkit.org/show_bug.cgi?id=171134
3805         rdar://problem/31589635
3806
3807         Reviewed by Tim Horton.
3808
3809         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3810         (WebKit::toPKPaymentAuthorizationStatus):
3811         Remove this and add a new version that doesn't use any deprecated values.
3812
3813         (WebKit::toPKPaymentAuthorizationStatus):
3814         New function that takes a WebCore::PaymentAuthorizationResult and converts it to a status, for older OSes.
3815
3816         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
3817         Use the new toPKPaymentAuthorizationStatus versions.
3818
3819         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
3820         Ditto.
3821
3822         (WebKit::status): Deleted.
3823
3824 2017-04-21  David Kilzer  <ddkilzer@apple.com>
3825
3826         Switch from -std=gnu++11 to -std=gnu++14 for consistency in DerivedSources.make
3827         <https://webkit.org/b/171122>
3828
3829         Reviewed by Brent Fulgham.
3830
3831         * DerivedSources.make: Switch to -std=gnu++14 for preprocessing
3832         headers to check for build settings.
3833
3834 2017-04-21  Jer Noble  <jer.noble@apple.com>
3835
3836         [WK2][MediaCapture] Pass muted and enabled state across process boundary when capturing in UIProcess
3837         https://bugs.webkit.org/show_bug.cgi?id=170846
3838
3839         Reviewed by Jon Lee.
3840
3841         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
3842         (WebKit::UserMediaCaptureManagerProxy::setMuted):
3843         (WebKit::UserMediaCaptureManagerProxy::setEnabled):
3844         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
3845         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
3846         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
3847         (WebKit::UserMediaCaptureManager::Source::setMuted):
3848         (WebKit::UserMediaCaptureManager::Source::setEnabled):
3849         (WebKit::UserMediaCaptureManager::setMuted):
3850         (WebKit::UserMediaCaptureManager::setEnabled):
3851         * WebProcess/cocoa/UserMediaCaptureManager.h:
3852
3853 2017-04-21  Jer Noble  <jer.noble@apple.com>
3854
3855         [WK2][MediaCapture] Remove now-unused WKWebViewConfiguration property for shouldCaptureAudioInUIProcess
3856         https://bugs.webkit.org/show_bug.cgi?id=170847
3857
3858         Reviewed by Jon Lee.
3859
3860         * Shared/WebPreferencesDefinitions.h:
3861         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3862         (-[WKWebViewConfiguration copyWithZone:]):
3863         (-[WKWebViewConfiguration _shouldCaptureAudioInUIProcess]): Deleted.
3864         (-[WKWebViewConfiguration _setShouldCaptureAudioInUIProcess:]): Deleted.
3865
3866 2017-04-21  Anders Carlsson  <andersca@apple.com>
3867
3868         Stop using deprecated APIs, part 4
3869         https://bugs.webkit.org/show_bug.cgi?id=171125
3870         rdar://problem/31589635
3871
3872         Reviewed by Tim Horton.
3873
3874         It doesn't really matter what we pass to these completion functions, since the sheet has already been dismissed at this point
3875         so just remove the status parameter.
3876
3877         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3878         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]):
3879         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]):
3880         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]):
3881
3882 2017-04-21  Andrew Gold  <agold@apple.com>
3883
3884         -[WKUIDelegatePrivate _webView:requestUserMediaAuthorizationForMicrophone:camera:url:mainFrameURL:decisionHandler:] 
3885         decision handler should only have one parameter.
3886         https://bugs.webkit.org/show_bug.cgi?id=171081
3887
3888         Reviewed by Tim Horton.
3889
3890         Because user media authorization is all or nothing, we should not have separate booleans
3891         to indicate authorization. Additionally, rather than passing two separate booleans to the
3892         UIDelegate, we now pass an NS_OPTIONS parameter.
3893
3894         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3895         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Added _WKCaptureDevice NS_OPTIONS.
3896
3897         * UIProcess/Cocoa/UIDelegate.mm:
3898         * UIProcess/Cocoa/UIDelegate.mm:
3899         (WebKit::UIDelegate::setDelegate): Uses new WKUIDelegatePrivate method.
3900         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Ditto.
3901
3902 2017-04-21  Konstantin Tokarev  <annulen@yandex.ru>
3903
3904         Unreviewed, added missing file to PlatformMac.cmake
3905
3906         * PlatformMac.cmake:
3907
3908 2017-04-21  Konstantin Tokarev  <annulen@yandex.ru>
3909
3910         Unreviewed follow-up for r215609
3911
3912         * UIProcess/API/Cocoa/WKWebView.mm: Move internal header include too.
3913
3914 2017-04-21  Konstantin Tokarev  <annulen@yandex.ru>
3915
3916         Include iOS-specific headers inside preprocessor guard
3917         https://bugs.webkit.org/show_bug.cgi?id=171104
3918
3919         Reviewed by Michael Catanzaro.
3920
3921         This patch should fix Mac cmake build.
3922
3923         * UIProcess/API/Cocoa/WKWebView.mm:
3924
3925 2017-04-21  Alex Christensen  <achristensen@webkit.org>
3926
3927         Reduce copies and allocations in SharedBuffer::append
3928         https://bugs.webkit.org/show_bug.cgi?id=170956
3929
3930         Reviewed by Andreas Kling.
3931
3932         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3933         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
3934         * Platform/IPC/DataReference.cpp:
3935         (IPC::SharedBufferDataReference::encode):
3936         * Shared/ShareableResource.cpp:
3937         (WebKit::ShareableResource::wrapInSharedBuffer):
3938         * UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm:
3939         (-[WKURLSchemeHandlerTaskImpl didReceiveData:]):
3940         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3941         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
3942         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3943         (WebKit::PDFPlugin::addArchiveResource):
3944         (WebKit::PDFPlugin::liveResourceData):
3945         (WebKit::PDFPlugin::writeItemsToPasteboard):
3946         * WebProcess/Plugins/PluginView.cpp:
3947         (WebKit::PluginView::redeliverManualStream):
3948         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
3949         (WebKit::WebDragClient::declareAndWriteDragImage):
3950         * WebProcess/WebPage/mac/WebPageMac.mm:
3951         (WebKit::WebPage::cachedResponseDataForURL):
3952
3953 2017-04-20  Konstantin Tokarev  <annulen@yandex.ru>
3954
3955         [cmake] Define FORWARDING_HEADERS_DIR in WebKitFS and use it everywhere
3956         https://bugs.webkit.org/show_bug.cgi?id=171071
3957
3958         Reviewed by Michael Catanzaro.
3959
3960         "${DERIVED_SOURCES_DIR}/ForwardingHeaders" path occurs very often in the
3961         build system files. GTK-specifc FORWARDING_HEADERS_DIR variable should
3962         be available for all ports.
3963
3964         * CMakeLists.txt:
3965         * PlatformMac.cmake:
3966
3967 2017-04-20  Brady Eidson  <beidson@apple.com>
3968
3969         WebContent process becomes unresponsive after returning nil from async version of -webView:createWebViewWithConfiguration:...
3970         <rdar://problem/31739023> and https://bugs.webkit.org/show_bug.cgi?id=171090
3971
3972         Reviewed by Andy Estes.
3973
3974         * UIProcess/Cocoa/UIDelegate.mm:
3975         (WebKit::UIDelegate::UIClient::createNewPageCommon): Handle the perfectly valid "nil webView" case correctly.
3976
3977 2017-04-20  Dan Bernstein  <mitz@apple.com>
3978
3979         Disable header postprocessing when building for Sierra
3980
3981         Absolutely rubber-stamped by Anders Carlsson.
3982
3983         * Configurations/WebKit.xcconfig:
3984
3985 2017-04-20  Matt Rajca  <mrajca@apple.com>
3986
3987         Cocoa: add private API for suppressing first responder changes
3988         https://bugs.webkit.org/show_bug.cgi?id=171069
3989         <rdar://problem/31658967>
3990
3991         Reviewed by Tim Horton.
3992
3993         Some clients may not want the web view to be programmatically made the first responder
3994         and invoking -makeFirstResponder: unconditionally posts 'first responder did change'
3995         notifications.
3996
3997         Added API test.
3998
3999         * UIProcess/API/Cocoa/WKWebView.mm:
4000         (-[WKWebView _setShouldSuppressFirstResponderChanges:]):
4001         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
4002         * UIProcess/Cocoa/WebViewImpl.h:
4003         * UIProcess/Cocoa/WebViewImpl.mm:
4004         (WebKit::WebViewImpl::setShouldSuppressFirstResponderChanges):
4005         * UIProcess/PageClient.h:
4006         * UIProcess/mac/PageClientImpl.h:
4007         * UIProcess/mac/PageClientImpl.mm:
4008         (WebKit::PageClientImpl::makeFirstResponder):
4009
4010 2017-04-20  Eric Carlson  <eric.carlson@apple.com>
4011
4012         [MediaStream iOS] Hold process assertion while media capture is active
4013         https://bugs.webkit.org/show_bug.cgi?id=171017
4014         <rdar://problem/31719177>
4015
4016         Reviewed by Dean Jackson.
4017
4018         * UIProcess/WebPageProxy.cpp:
4019         (WebKit::WebPageProxy::updateActivityState): Update IsCapturingMedia when necessary.
4020         (WebKit::WebPageProxy::updateThrottleState): Hold a token when capture is active.
4021         (WebKit::WebPageProxy::setMuted): Capture state may change when the page is muted,
4022         so pass IsCapturingMedia to activityStateDidChange.
4023         (WebKit::WebPageProxy::isPlayingMediaDidChange): Ditto.
4024
4025         * WebProcess/WebPage/WebPage.cpp:
4026         (WebKit::WebPage::updateThrottleState): Don't allow page suppression when capture
4027         is active. 
4028
4029 2017-04-20  Anders Carlsson  <andersca@apple.com>
4030
4031         Fix build.
4032
4033         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
4034         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
4035
4036 2017-04-20  Brady Eidson  <beidson@apple.com>
4037
4038         Add CompletionHandlerCallChecker to SPI added in r215545.
4039         https://bugs.webkit.org/show_bug.cgi?id=171067
4040
4041         Reviewed by Dan Bernstein.
4042
4043         * UIProcess/Cocoa/UIDelegate.mm:
4044         (WebKit::UIDelegate::UIClient::createNewPageCommon):
4045
4046 2017-04-20  Anders Carlsson  <andersca@apple.com>
4047
4048         Replace isFinalStateStatus with isFinalStateResult
4049         https://bugs.webkit.org/show_bug.cgi?id=171072
4050         rdar://problem/31589635
4051
4052         Reviewed by Tim Horton.
4053
4054         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
4055         (WebKit::WebPaymentCoordinatorProxy::completePaymentSession):
4056
4057 2017-04-20  Wenson Hsieh  <wenson_hsieh@apple.com>
4058
4059         [WK2] -[WKContentView doAfterPositionInformationUpdate:atPosition:] should be robust against synchronous reentrancy
4060         https://bugs.webkit.org/show_bug.cgi?id=170922
4061         <rdar://problem/31634990>
4062
4063         Reviewed by Tim Horton.