Use WTF::Function instead of std::function in NetworkProcess code
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2017-06-09  Chris Dumez  <cdumez@apple.com>
2
3         Use WTF::Function instead of std::function in NetworkProcess code
4         https://bugs.webkit.org/show_bug.cgi?id=173182
5
6         Reviewed by Alex Christensen.
7
8         Use WTF::Function instead of std::function in NetworkProcess code to avoid
9         unnecessary copying.
10
11         * NetworkProcess/NetworkProcess.h:
12         * NetworkProcess/cache/NetworkCacheIOChannel.h:
13         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
14         (WebKit::NetworkCache::IOChannel::read):
15         (WebKit::NetworkCache::IOChannel::write):
16         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
17         (WebKit::NetworkCache::IOChannel::read):
18         (WebKit::NetworkCache::IOChannel::readSyncInThread):
19         (WebKit::NetworkCache::IOChannel::write):
20         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
21         * NetworkProcess/cache/NetworkCacheStatistics.h:
22         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
23         (WebKit::clearNSURLCache):
24         (WebKit::NetworkProcess::clearDiskCache):
25         * NetworkProcess/soup/NetworkProcessSoup.cpp:
26         (WebKit::NetworkProcess::clearDiskCache):
27
28 2017-06-09  Tim Horton  <timothy_horton@apple.com>
29
30         REGRESSION (r213584): WeChat app can not switch to next text field
31         https://bugs.webkit.org/show_bug.cgi?id=173183
32         <rdar://problem/32323478>
33
34         Reviewed by Wenson Hsieh.
35
36         * Platform/spi/ios/UIKitSPI.h:
37         * UIProcess/ios/InputViewUpdateDeferrer.mm:
38         (WebKit::InputViewUpdateDeferrer::~InputViewUpdateDeferrer):
39         It turns out that _endIgnoringReloadInputViews doesn't actually perform
40         the update if there was one ignored. It does, however, return whether
41         there was a change ignored, and we can force an update.
42
43         This remains untestable without sizable additional API test infrastructure
44         for the same reasons as the original patch.
45
46 2017-06-09  Chris Dumez  <cdumez@apple.com>
47
48         Make sure we protect |this| in lambdas in WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver()
49         https://bugs.webkit.org/show_bug.cgi?id=173174
50         <rdar://problem/32598919>
51
52         Reviewed by Darin Adler.
53
54         Follow-up fix to r218006, which caused a crash on the bots. We cannot WTFMove() protectedThis
55         here because the callback gets called several times.
56
57         * UIProcess/WebResourceLoadStatisticsStore.cpp:
58         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
59
60 2017-06-09  Jer Noble  <jer.noble@apple.com>
61
62         Crash in -[WKWebView _initializeWithConfiguration:]
63         https://bugs.webkit.org/show_bug.cgi?id=173126
64         <rdar://problem/32664993>
65
66         Reviewed by Darin Adler.
67
68         Follow up to previous fix; when setting NSString properties, store a copy of
69         the string rather than the NSString itself.
70
71         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
72         (-[WKWebViewConfiguration copyWithZone:]):
73         (-[WKWebViewConfiguration _overrideContentSecurityPolicy]):
74         (-[WKWebViewConfiguration _setOverrideContentSecurityPolicy:]):
75         (-[WKWebViewConfiguration _setMediaContentTypesRequiringHardwareSupport:]):
76
77 2017-06-09  Chris Dumez  <cdumez@apple.com>
78
79         Use WTF::Function instead of std::function in StorageManager
80         https://bugs.webkit.org/show_bug.cgi?id=173177
81
82         Reviewed by Brady Eidson.
83
84         Use WTF::Function instead of std::function in StorageManager. This eliminates some
85         potential implicit copying of captured variables, which is important here because
86         we pass those lambdas to other threads.
87
88         * UIProcess/Storage/StorageManager.cpp:
89         (WebKit::StorageManager::getSessionStorageOrigins):
90         (WebKit::StorageManager::deleteSessionStorageOrigins):
91         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
92         (WebKit::StorageManager::getLocalStorageOrigins):
93         (WebKit::StorageManager::getLocalStorageOriginDetails):
94         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
95         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
96         * UIProcess/Storage/StorageManager.h:
97
98 2017-06-09  Daniel Bates  <dabates@apple.com>
99
100         CSP: Apply img-src directive to favicon loads
101         https://bugs.webkit.org/show_bug.cgi?id=172733
102         <rdar://problem/32082654>
103
104         Reviewed by Brady Eidson.
105
106         Return 0 seconds for the maximum buffering time for favicons (no change in behavior).
107
108         * WebProcess/Network/WebLoaderStrategy.cpp:
109         (WebKit::maximumBufferingTime):
110
111 2017-06-09  Wenson Hsieh  <wenson_hsieh@apple.com>
112
113         [iOS DnD] Add a hook to perform two-step drops in editable content
114         https://bugs.webkit.org/show_bug.cgi?id=172992
115         <rdar://problem/32590174>
116
117         Reviewed by Tim Horton.
118
119         Add plumbing to support an injected bundle hook for overriding two-step drops. See WebCore ChangeLog.
120
121         * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
122         (API::InjectedBundle::EditorClient::performTwoStepDrop):
123         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
124         * WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h:
125         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
126         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
127         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
128         (WebKit::InjectedBundlePageEditorClient::performTwoStepDrop):
129         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
130         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
131         (WebKit::WebEditorClient::performTwoStepDrop):
132         * WebProcess/WebCoreSupport/WebEditorClient.h:
133
134 2017-06-09  Brent Fulgham  <bfulgham@apple.com>
135
136         Use Function rather than std::function for thread safety in WebsiteDataStore
137         https://bugs.webkit.org/show_bug.cgi?id=173172
138
139         Reviewed by Chris Dumez.
140         <rdar://problem/32679311>
141
142         Remove a few more instances of std::function in the WebsiteDataStore, and WTFMove completion handler to
143         avoid unnecessary copies.
144
145         * Shared/WebsiteData/WebsiteDataType.h: Remove redundant WebsiteDataType from name.
146         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
147         (WebKit::toWebsiteDataType): Update for revised name.
148         (WebKit::toWKWebsiteDataTypes): Ditto.
149         * UIProcess/WebProcessProxy.cpp:
150         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): ASSERT that
151         this function, as well as its completion handler, are getting called from the main thread.
152         (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebiteData): Ditto.
153         (WebKit::WebProcessProxy::fetchWebsiteData): Move the completionHandler.
154         (WebKit::WebProcessProxy::deleteWebsiteData): Ditto.
155         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): Ditto.
156         * UIProcess/WebProcessProxy.h:
157         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
158         (WebKit::WebsiteDataStore::fetchData): Switch to Function, and move completion handler.
159         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): Ditto.
160         (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData): Ditto.
161         (WebKit::WebsiteDataStore::removeData): Ditto.
162         (WebKit::WebsiteDataStore::removeDataForTopPrivatelyControlledDomains): Ditto.
163         * UIProcess/WebsiteData/WebsiteDataStore.h:
164
165 2017-06-09  Chris Dumez  <cdumez@apple.com>
166
167         Make sure we protect |this| in lambdas in WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver()
168         https://bugs.webkit.org/show_bug.cgi?id=173174
169         <rdar://problem/32598919>
170
171         Reviewed by Darin Adler.
172
173         * UIProcess/WebResourceLoadStatisticsStore.cpp:
174         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
175
176 2017-06-09  Chris Dumez  <cdumez@apple.com>
177
178         Avoid some ref counting churn in WebResourceLoadStatisticsStore
179         https://bugs.webkit.org/show_bug.cgi?id=173168
180
181         Reviewed by Brent Fulgham.
182
183         Move the protectedThis around instead of ref'ing it every time we capture it
184         in a lambda. Also add a missing protectedThis in WebResourceLoadStatisticsStore::removeDataRecords()
185         which likely fixes crashes.
186
187         * UIProcess/WebResourceLoadStatisticsStore.cpp:
188         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
189         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
190
191 2017-06-09  Sam Weinig  <sam@webkit.org>
192
193         Add SubresourceIntegrity as an experimental feature
194         https://bugs.webkit.org/show_bug.cgi?id=173164
195
196         Reviewed by Darin Adler.
197
198         * Shared/WebPreferencesDefinitions.h:
199         * WebProcess/WebPage/WebPage.cpp:
200         (WebKit::WebPage::updatePreferences):
201         Add SubresourceIntegrity to the list of experimental features. Also, sort the experimental features
202         as requested by the comment above it.
203
204 2017-06-09  Chris Dumez  <cdumez@apple.com>
205
206         Make sure |this| is protected in lambda capture in WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData()
207         https://bugs.webkit.org/show_bug.cgi?id=173163
208
209         Reviewed by Brent Fulgham.
210
211         Make sure |this| is protected in lambda capture in WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData()
212         or it may end up getting destroyed before the lambda executing and crash when calling m_statisticsQueue->dispatch().
213
214         * UIProcess/WebResourceLoadStatisticsStore.cpp:
215         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
216
217 2017-06-09  Daewoong Jang  <daewoong.jang@navercorp.com>
218
219         [CoordinatedGraphics] Remove unneeded interfaces in PageClient
220         https://bugs.webkit.org/show_bug.cgi?id=173149
221
222         Reviewed by Michael Catanzaro.
223
224         * UIProcess/PageClient.h:
225
226 2017-06-09  Chris Dumez  <cdumez@apple.com>
227
228         Use WTF::Function instead of std::function in SpeculativeLoadManager::ExpiringEntry
229         https://bugs.webkit.org/show_bug.cgi?id=173125
230
231         Reviewed by Antti Koivisto.
232
233         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
234         (WebKit::NetworkCache::SpeculativeLoadManager::ExpiringEntry::ExpiringEntry):
235         (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::PreloadedEntry):
236
237 2017-06-09  Daewoong Jang  <daewoong.jang@navercorp.com>
238
239         Use WTF::getCurrentProcessID() instead of getpid()
240         https://bugs.webkit.org/show_bug.cgi?id=173130
241
242         Reviewed by Tim Horton.
243
244         * UIProcess/API/APIProcessPoolConfiguration.h:
245
246 2017-06-09  Claudio Saavedra  <csaavedra@igalia.com>
247
248         struct does not accept initializer-form if member has initializers in GCC 4.9
249
250         Unreviewed speculative build fix.
251
252         Remove the default initializers for DeniedRequest struct,
253         since it's only initialized in one place, to keep gcc 4.9
254         happy.
255         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
256
257 2017-06-09  Adrien Plazas  <aplazas@igalia.com>
258
259         [GTK] Add kinetic scrolling
260         https://bugs.webkit.org/show_bug.cgi?id=155750
261
262         Reviewed by Carlos Garcia Campos.
263
264         Patch by Adrien Plazas and Yusuke Suzuki.
265
266         Add the notion of phase and momentum phase to WebWheelEvent.
267
268         Make WebWheelEvent manage the 'is_stop' attribute of GdkEventScroll to create the corresponding WebWheelEvent
269         with the correct phases and deltas.
270
271         Make GestureController manage swipes to create the corresponding WebWheelEvent with the correct phases and
272         deltas.
273
274         * Shared/NativeWebWheelEvent.h:
275         * Shared/WebEvent.h:
276         * Shared/WebEventConversion.cpp:
277         (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
278         * Shared/WebWheelEvent.cpp:
279         (WebKit::WebWheelEvent::WebWheelEvent):
280         (WebKit::WebWheelEvent::encode):
281         (WebKit::WebWheelEvent::decode):
282         * Shared/gtk/NativeWebWheelEventGtk.cpp:
283         (WebKit::NativeWebWheelEvent::NativeWebWheelEvent):
284         * Shared/gtk/WebEventFactory.cpp:
285         (WebKit::WebEventFactory::createWebWheelEvent):
286         * Shared/gtk/WebEventFactory.h:
287         * UIProcess/WebPageProxy.cpp:
288         (WebKit::WebPageProxy::handleWheelEvent):
289         (WebKit::WebPageProxy::shouldProcessWheelEventNow):
290         * UIProcess/WebPageProxy.h:
291         * UIProcess/gtk/GestureController.cpp:
292         (WebKit::GestureController::GestureController):
293         (WebKit::GestureController::handleEvent):
294         (WebKit::GestureController::isProcessingGestures):
295         (WebKit::createScrollEvent):
296         (WebKit::GestureController::DragGesture::startDrag):
297         (WebKit::GestureController::DragGesture::handleDrag):
298         (WebKit::GestureController::DragGesture::begin):
299         (WebKit::GestureController::DragGesture::end):
300         (WebKit::GestureController::SwipeGesture::startMomentumScroll):
301         (WebKit::GestureController::SwipeGesture::swipe):
302         (WebKit::GestureController::SwipeGesture::SwipeGesture):
303         * UIProcess/gtk/GestureController.h:
304
305 2017-06-09  Jer Noble  <jer.noble@apple.com>
306
307         Crash in -[WKWebView _initializeWithConfiguration:]
308         https://bugs.webkit.org/show_bug.cgi?id=173126
309
310         Reviewed by Antti Koivisto.
311
312         Crash occurs when passing an autoreleased NSString into _setMediaContentTypesRequiringHardwareSupport.
313         The ivar should be a RetainPtr rather than a bare NSString *.
314
315         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
316         (-[WKWebViewConfiguration _mediaContentTypesRequiringHardwareSupport]):
317
318 2017-06-08  Carlos Garcia Campos  <cgarcia@igalia.com>
319
320         [GTK] Use API::FormClient instead of the C API in WebKitFormClient
321         https://bugs.webkit.org/show_bug.cgi?id=173098
322
323         Reviewed by Žan Doberšek.
324
325         * UIProcess/API/gtk/WebKitFormClient.cpp:
326         (attachFormClientToView):
327         (willSubmitForm): Deleted.
328         * UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp:
329         (webkitFormSubmissionRequestCreate):
330         (webkit_form_submission_request_get_text_fields):
331         * UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h:
332         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
333         (webkitWebPageCreate):
334
335 2017-06-08  Carlos Garcia Campos  <cgarcia@igalia.com>
336
337         [GTK] Use API::Findclient instead of the C API in WebKitFindController
338         https://bugs.webkit.org/show_bug.cgi?id=173095
339
340         Reviewed by Žan Doberšek.
341
342         * UIProcess/API/gtk/WebKitFindController.cpp:
343         (getPage):
344         (webkitFindControllerDispose):
345         (webkitFindControllerConstructed):
346         (webkit_find_controller_class_init):
347
348 2017-06-08  Carlos Garcia Campos  <cgarcia@igalia.com>
349
350         [GTK] Get rid of custom marshallers of signals
351         https://bugs.webkit.org/show_bug.cgi?id=173094
352
353         Reviewed by Žan Doberšek.
354
355         Use g_cclosure_marshal_generic instead.
356
357         * PlatformGTK.cmake:
358         * UIProcess/API/gtk/WebKitBackForwardList.cpp:
359         * UIProcess/API/gtk/WebKitDownload.cpp:
360         (webkit_download_class_init):
361         * UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
362         (webkit_favicon_database_class_init):
363         * UIProcess/API/gtk/WebKitWebInspector.cpp:
364         (webkit_web_inspector_class_init):
365         * UIProcess/API/gtk/WebKitWebResource.cpp:
366         (webkit_web_resource_class_init):
367         * UIProcess/API/gtk/WebKitWebView.cpp:
368         (webkit_web_view_class_init):
369         * UIProcess/API/gtk/webkit2marshal.list: Removed.
370         * WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp:
371         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
372         (webkit_web_page_class_init):
373
374 2017-06-08  Simon Fraser  <simon.fraser@apple.com>
375
376         Crash under -[WKWebView _updateVisibleContentRects]
377         https://bugs.webkit.org/show_bug.cgi?id=173123
378         rdar://problem/32650112
379
380         Reviewed by Tim Horton.
381
382         Make sure the WKWebView is valid in places where we dispatch_async or use
383         a pre-commit handler.
384
385         Speculative fix for a rare crasher.
386
387         * UIProcess/API/Cocoa/WKWebView.mm:
388         (-[WKWebView _isValid]):
389         (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]):
390         (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
391
392 2017-06-07  Simon Fraser  <simon.fraser@apple.com>
393
394         Use initializers in WebPageProxy
395         https://bugs.webkit.org/show_bug.cgi?id=173073
396
397         Reviewed by Tim Horton.
398
399         Initialize the member variables the modern way.
400
401         * UIProcess/WebPageProxy.cpp:
402         (WebKit::WebPageProxy::WebPageProxy):
403         * UIProcess/WebPageProxy.h:
404
405 2017-06-08  Jeremy Jones  <jeremyj@apple.com>
406
407         Implement additional AVPlayerController interfaces for minTime and maxTime.
408         https://bugs.webkit.org/show_bug.cgi?id=172396
409         rdar://problem/30737452
410
411         Reviewed by Jer Noble.
412
413         Add support for new HLS UI in AVKit.
414
415         Plumb seekableTimeRangesLastModifiedTime and liveUpdateInterval across process boundaries.
416
417         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
418         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in:
419         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
420         (WebKit::WebPlaybackSessionModelContext::setSeekableRanges):
421         (WebKit::WebPlaybackSessionManagerProxy::setSeekableRangesVector):
422         * WebProcess/cocoa/WebPlaybackSessionManager.h:
423         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
424         (WebKit::WebPlaybackSessionInterfaceContext::seekableRangesChanged):
425         (WebKit::WebPlaybackSessionManager::seekableRangesChanged):
426
427 2017-06-08  Chris Dumez  <cdumez@apple.com>
428
429         Use WTF::Function more in SpeculativeLoadManager
430         https://bugs.webkit.org/show_bug.cgi?id=173109
431
432         Reviewed by Antti Koivisto.
433
434         Use WTF::Function more in SpeculativeLoadManager.
435
436         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
437         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::create):
438         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::PendingFrameLoad):
439         (WebKit::NetworkCache::SpeculativeLoadManager::registerLoad):
440         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
441         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
442
443 2017-06-08  Youenn Fablet  <youenn@apple.com>
444
445         getUserMedia should not be prompted again if user denied access
446         https://bugs.webkit.org/show_bug.cgi?id=173104
447
448         Reviewed by Geoff Garen.
449
450         Store denied requests to be able to replay them.
451         If mic is denied, user might be prompted for camera, not for mic and camera.
452         Same principle applies to the case of denied camera.
453         Clearing the stored denied requests when reloading/navigating away.
454
455         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
456         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
457         (WebKit::UserMediaPermissionRequestManagerProxy::resetAccess):
458         (WebKit::UserMediaPermissionRequestManagerProxy::isRequestDenied):
459         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
460         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
461
462 2017-06-08  Jer Noble  <jer.noble@apple.com>
463
464         Clients of the WK2 C-API don't have their mediaContentTypesRequiringHardwareSupport setting initialized correctly.
465         https://bugs.webkit.org/show_bug.cgi?id=173091
466
467         Reviewed by Eric Carlson.
468
469         Rather than add yet a third way of setting this preference, centralize everything by moving the
470         definition of the default value into WebCore.
471
472         * Shared/WebPreferencesDefinitions.h:
473         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
474         (-[WKWebViewConfiguration init]):
475         * WebProcess/WebPage/WebPage.cpp:
476         (WebKit::WebPage::updatePreferences):
477
478 2017-06-08  Jer Noble  <jer.noble@apple.com>
479
480         [WK2] mediaContentTypesRequiringHardwareSupport setting not being propogated
481         https://bugs.webkit.org/show_bug.cgi?id=173090
482
483         Reviewed by Eric Carlson.
484
485         Passing a NSString* into the WebPreferencesStore::Value constructor would rather cast the NSString*
486         into a bool than a const String&. So explicitly cast the NSString* into a String before passing.
487
488         * UIProcess/API/Cocoa/WKWebView.mm:
489         (-[WKWebView _initializeWithConfiguration:]):
490
491 2017-06-08  Youenn Fablet  <youenn@apple.com>
492
493         getUserMedia request should not be allowed for background tabs unless the tab is already capturing
494         https://bugs.webkit.org/show_bug.cgi?id=172989
495
496         Reviewed by Eric Carlson.
497
498         Covered by updated test and manual testing.
499
500         In case a getUserMedia can be granted, we check for visbility of the view.
501         If the view is visible, the getUserMedia request is allowed and promise is resolved.
502         Otherwise we store the pregranted request and will allow it when the view gets visible.
503         Pregranted requests will be cleared if the document of the view is changed.
504
505         Pregranted requests will not be used when capture page is muted.
506         In that case, a prompt will appear.
507
508         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
509         (WebKit::UserMediaPermissionRequestManagerProxy::removeGrantedAccess):
510         (WebKit::allowRequest):
511         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
512         (WebKit::UserMediaPermissionRequestManagerProxy::processPregrantedRequests):
513         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
514         * UIProcess/WebPageProxy.cpp:
515         (WebKit::WebPageProxy::dispatchActivityStateChange):
516         (WebKit::WebPageProxy::viewIsBecomingVisible):
517         * UIProcess/WebPageProxy.h:
518
519 2017-06-07  Carlos Garcia Campos  <cgarcia@igalia.com>
520
521         [WPE] Enable resource usage
522         https://bugs.webkit.org/show_bug.cgi?id=173054
523
524         Reviewed by Žan Doberšek.
525
526         Enable/disable the resources overlay with CTRL + Shift + G.
527
528         * UIProcess/API/wpe/WPEView.cpp:
529         (WKWPE::m_compositingManagerProxy):
530
531 2017-06-07  Carlos Garcia Campos  <cgarcia@igalia.com>
532
533         Remove legacy INSPECTOR_SERVER implementation
534         https://bugs.webkit.org/show_bug.cgi?id=172966
535
536         Reviewed by Žan Doberšek.
537
538         * CMakeLists.txt:
539         * Platform/Logging.h:
540         * PlatformWPE.cmake:
541         * UIProcess/InspectorServer/HTTPRequest.cpp: Removed.
542         * UIProcess/InspectorServer/HTTPRequest.h: Removed.
543         * UIProcess/InspectorServer/WebInspectorServer.cpp: Removed.
544         * UIProcess/InspectorServer/WebInspectorServer.h: Removed.
545         * UIProcess/InspectorServer/WebSocketServer.cpp: Removed.
546         * UIProcess/InspectorServer/WebSocketServer.h: Removed.
547         * UIProcess/InspectorServer/WebSocketServerClient.h: Removed.
548         * UIProcess/InspectorServer/WebSocketServerConnection.cpp: Removed.
549         * UIProcess/InspectorServer/WebSocketServerConnection.h: Removed.
550         * UIProcess/InspectorServer/front-end/inspectorPageIndex.html: Removed.
551         * UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp: Removed.
552         * UIProcess/WebInspectorProxy.cpp:
553         (WebKit::WebInspectorProxy::invalidate):
554         * UIProcess/WebInspectorProxy.h:
555         * UIProcess/WebInspectorProxy.messages.in:
556         * UIProcess/WebPageProxy.cpp:
557         (WebKit::WebPageProxy::initializeWebPage):
558         (WebKit::WebPageProxy::preferencesDidChange):
559         * UIProcess/wpe/WebProcessPoolWPE.cpp:
560         * WebProcess/WebPage/WebInspector.cpp:
561         (WebKit::WebInspector::sendMessageToFrontend):
562         * WebProcess/WebPage/WebInspector.h:
563         * WebProcess/WebPage/WebInspector.messages.in:
564
565 2017-06-07  Dan Bernstein  <mitz@apple.com>
566
567         [Cocoa] additionalReadAccessAllowedURLs doesn’t preserve non-Latin-1 paths
568         https://bugs.webkit.org/show_bug.cgi?id=173086
569
570         Reviewed by Andy Estes.
571
572         We were incorrectly passing the fileSystemRepresentation of an NSURL into the WTF::String
573         constructor that expects a Latin-1 string. However, in general, fileSystemRepresentation is
574         not Latin-1.
575
576         * UIProcess/API/APIProcessPoolConfiguration.h: Changed m_additionalReadAccessAllowedPaths
577           from a Vector<WTF::String> into a Vector<WTF::CString>.
578
579         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
580         (-[_WKProcessPoolConfiguration additionalReadAccessAllowedURLs]): Updated for the change.
581         (-[_WKProcessPoolConfiguration setAdditionalReadAccessAllowedURLs:]): Ditto.
582
583         * UIProcess/WebProcessPool.cpp:
584         (WebKit::WebProcessPool::resolvePathsForSandboxExtensions): Ditto.
585
586 2017-06-07  Ryosuke Niwa  <rniwa@webkit.org>
587
588         Crash inside WebKit::PluginView::getAuthenticationInfo
589         https://bugs.webkit.org/show_bug.cgi?id=173083
590
591         Reviewed by Chris Dumez.
592
593         Added a null pointer check. The content document may have went away by the time we get there from IPC.
594
595         * WebProcess/Plugins/PluginView.cpp:
596         (WebKit::PluginView::getAuthenticationInfo):
597
598 2017-06-07  Youenn Fablet  <youenn@apple.com>
599
600         getUserMedia is prompting too often
601         https://bugs.webkit.org/show_bug.cgi?id=172859
602         <rdar://problem/32589950>
603
604         Reviewed by Eric Carlson.
605
606         Introduce a storage of granted requests to skip prompting when needed.
607         This is a partial implementation as granted requests should not happen for background tabs.
608         This will be covered in a follow-up patch.
609         Covered by manual tests.
610
611         A granted request keeps its mainFrameID.
612         Whenever the document of the main frame changes, the granted requests for that mainFrameID will be removed.
613         This handles the case of navigating, reloading... while still supporting the case of granting getUserMedia after in page navigation.
614
615         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
616         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest):
617         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
618         (WebKit::UserMediaPermissionRequestManagerProxy::removeGrantedAccess):
619         (WebKit::UserMediaPermissionRequestManagerProxy::searchForGrantedRequest):
620         (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
621         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
622         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
623         * UIProcess/UserMediaPermissionRequestProxy.cpp:
624         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
625         * UIProcess/UserMediaPermissionRequestProxy.h:
626         (WebKit::UserMediaPermissionRequestProxy::create):
627         (WebKit::UserMediaPermissionRequestProxy::mainFrameID):
628         (WebKit::UserMediaPermissionRequestProxy::frameID):
629         (WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin):
630         * UIProcess/WebPageProxy.cpp:
631         (WebKit::WebPageProxy::didChangeMainDocument):
632         (WebKit::WebPageProxy::backForwardGoToItem):
633         * UIProcess/WebPageProxy.h:
634         * UIProcess/WebPageProxy.messages.in:
635         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
636         (WebKit::WebFrameLoaderClient::dispatchDidChangeMainDocument):
637         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
638
639 2017-06-07  Dan Bernstein  <mitz@apple.com>
640
641         [Cocoa] additionalReadAccessAllowedURLs should be consumed before loading the injected bundle
642         https://bugs.webkit.org/show_bug.cgi?id=173078
643
644         Reviewed by Anders Carlsson.
645
646         * WebProcess/WebProcess.cpp:
647         (WebKit::WebProcess::initializeWebProcess): Changed the order.
648
649 2017-06-07  Per Arne Vollan  <pvollan@apple.com>
650
651         Support removal of authentication data through the Website data store API.
652         https://bugs.webkit.org/show_bug.cgi?id=171217
653         <rdar://problem/29522573>
654
655         Reviewed by Brady Eidson.
656
657         Add support to remove and fetch credential data through the Website data store API.
658         Credential data is removed and fetched from both the network process and web process.
659         Authentication data stored in the keychain will not be cleared.
660
661         * NetworkProcess/NetworkProcess.cpp:
662         (WebKit::NetworkProcess::fetchWebsiteData):
663         (WebKit::NetworkProcess::deleteWebsiteData):
664         * Shared/WebsiteData/WebsiteData.cpp:
665         (WebKit::WebsiteData::encode):
666         (WebKit::WebsiteData::decode):
667         * Shared/WebsiteData/WebsiteData.h:
668         * Shared/WebsiteData/WebsiteDataType.h:
669         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
670         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
671         (dataTypesToString):
672         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
673         (WebKit::toWebsiteDataType):
674         (WebKit::toWKWebsiteDataTypes):
675         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
676         (+[WKWebsiteDataStore allWebsiteDataTypes]):
677         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
678         (WebKit::WebsiteDataRecord::addOriginWithCredential):
679         * UIProcess/WebsiteData/WebsiteDataRecord.h:
680         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
681         (WebKit::WebsiteDataStore::fetchData):
682         * WebProcess/WebProcess.cpp:
683         (WebKit::WebProcess::fetchWebsiteData):
684         (WebKit::WebProcess::deleteWebsiteData):
685
686 2017-06-06  Dan Bernstein  <mitz@apple.com>
687
688         Fixed building with the macOS 10.13 Apple Internal SDK when targeting macOS 10.12.
689
690         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
691         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:handler:]):
692         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]):
693         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]):
694         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]):
695
696 2017-06-06  Brent Fulgham  <bfulgham@apple.com>
697
698         [WK2][Cocoa] Allow network process to bind addresses without webrtc extension
699         https://bugs.webkit.org/show_bug.cgi?id=173032
700         <rdar://problem/32597426>
701
702         Reviewed by Youenn Fablet.
703
704         Remove the unnecessary WebRTC sandbox extension handle and conditional sandbox rules, since we've
705         decided that all WebKit clients should be able to use the WebRTC protocol.
706
707         * NetworkProcess/NetworkProcessCreationParameters.cpp:
708         (WebKit::NetworkProcessCreationParameters::encode): Remove unused sandbox extension from serialization.
709         (WebKit::NetworkProcessCreationParameters::decode): Ditto.
710         * NetworkProcess/NetworkProcessCreationParameters.h:
711         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
712         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): We no longer send the sandbox extension,
713         so don't attempt to consume it.
714         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: Remove check for 'com.apple.webkit.webrtc'
715         extension. Make rules conditional on building with WEB_RTC feature enabled.
716         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Remove check for 'com.apple.webkit.webrtc'
717         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
718         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Do not create unnecessary sandbox extension
719         handle.
720
721 2017-06-06  Tim Horton  <timothy_horton@apple.com>
722
723         Crash trying to drag the entire text of a long book out of Mail compose view
724         https://bugs.webkit.org/show_bug.cgi?id=173042
725         <rdar://problem/32382059>
726
727         Reviewed by Simon Fraser.
728
729         * WebProcess/WebPage/ios/FindControllerIOS.mm:
730         * WebProcess/WebPage/ios/WebPageIOS.mm:
731         (WebKit::WebPage::didConcludeEditDataInteraction):
732         Adapt to the new name.
733
734 2017-06-06  Chris Dumez  <cdumez@apple.com>
735
736         RELEASE_ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values)) hit in convertEnumerationToJS<WebCore::History::ScrollRestoration>()
737         https://bugs.webkit.org/show_bug.cgi?id=173033
738         <rdar://problem/32591099>
739
740         Reviewed by Simon Fraser.
741
742         * Shared/SessionState.h:
743         Make sure FrameState::shouldRestoreScrollPosition and other struct members are always
744         intialized.
745
746         * UIProcess/mac/LegacySessionStateCoding.cpp:
747         (WebKit::encodeFrameStateNode):
748         (WebKit::decodeBackForwardTreeNode):
749         Make sure FrameState::shouldRestoreScrollPosition is properly encoded / decoded.
750
751 2017-06-06  Andy Estes  <aestes@apple.com>
752
753         REGRESSION (r199558): WKWebView upload file which name contains Chinese character results in garbled code
754         https://bugs.webkit.org/show_bug.cgi?id=172849
755         <rdar://problem/32567454>
756
757         Reviewed by Darin Adler.
758
759         This is the Mac equivalent of what was fixed in r208295. This time we use -[NSURL path] to
760         construct a WTF::String instead of calling String::fromUTF8() on -[NSURL fileSystemRepresentation].
761
762         * UIProcess/Cocoa/UIDelegate.mm:
763         (WebKit::UIDelegate::UIClient::runOpenPanel):
764
765 2017-06-06  Yoav Weiss  <yoav@yoav.ws>
766
767         [preload] Conditional support for media preloading and align media `as` values.
768         https://bugs.webkit.org/show_bug.cgi?id=172501
769
770         Reviewed by Dean Jackson.
771
772         Add media preloading preference and hook it up to runtime enabled features.
773
774         * Shared/WebPreferencesDefinitions.h: Added a macro defining media preloading preference.
775         * UIProcess/API/C/WKPreferences.cpp:
776         (WebKit2::WKPreferences::WKPreferencesSetMediaPreloadingEnabled):
777         (WebKit2::WKPreferences::WKPreferencesGetMediaPreloadingEnabled):
778         * UIProcess/API/C/WKPreferencesRefPrivate.h:
779         * WebProcess/WebPage/WebPage.cpp: Set runtime enabled feature based on preference.
780
781 2017-06-06  Don Olmstead  <don.olmstead@am.sony.com>
782
783         [WebCore] Enable REQUEST_ANIMATION_FRAME_TIMER for all ports
784         https://bugs.webkit.org/show_bug.cgi?id=172780
785
786         Reviewed by Alex Christensen.
787
788         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
789         (WebKit::WebChromeClient::scheduleAnimation): Deleted.
790         * WebProcess/WebCoreSupport/WebChromeClient.h:
791         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
792         (WebKit::CompositingCoordinator::syncDisplayState):
793
794 2017-06-06  Beth Dakin  <bdakin@apple.com>
795
796         Netflix seeking quirk should also apply to Now Playing, and should always use the 
797         livestream UI
798         https://bugs.webkit.org/show_bug.cgi?id=173030
799         -and corresponding-
800         rdar://problem/32228660
801
802         Reviewed by Darin Adler.
803
804         See WebCore ChangeLog for more details. We can roll out allowsTouchBarScrubbing() 
805         and rely on supportsSeeking().
806
807         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
808         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in:
809         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
810         (WebKit::WebPlaybackSessionModelContext::setAllowsTouchBarScrubbing): Deleted.
811         (WebKit::WebPlaybackSessionManagerProxy::setAllowsTouchBarScrubbing): Deleted.
812         * WebProcess/cocoa/WebPlaybackSessionManager.h:
813         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
814         (WebKit::WebPlaybackSessionInterfaceContext::allowsTouchBarScrubbingChanged): Deleted.
815         (WebKit::WebPlaybackSessionManager::allowsTouchBarScrubbingChanged): Deleted.
816
817 2017-06-06  Jer Noble  <jer.noble@apple.com>
818
819         [Cocoa] Set defaults for mediaContentTypesRequiringHardwareSupport setting
820         https://bugs.webkit.org/show_bug.cgi?id=173008
821
822         Reviewed by Eric Carlson.
823
824         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
825         (-[WKWebViewConfiguration init]):
826
827 2017-06-06  Joseph Pecoraro  <pecoraro@apple.com>
828
829         Move Resource Timing / User Timing from experimental features into main preferences
830         https://bugs.webkit.org/show_bug.cgi?id=172950
831
832         Reviewed by Darin Adler.
833
834         * Shared/WebPreferencesDefinitions.h:
835         Move Resource Timing and User Timing out of the Experimental Features section.
836
837 2017-06-06  Youenn Fablet  <youenn@apple.com>
838
839         Add an option to disable getUserMedia prompt in case of mock capture sources
840         https://bugs.webkit.org/show_bug.cgi?id=172981
841         <rdar://problem/32580325>
842
843         Reviewed by Eric Carlson.
844
845         Adding mockCaptureDevicesPromptEnabled option.
846         Allowing any getUserMedia request if mock is on and prompt is off.
847
848         Renaming UserMediaProcessManager::willEnableMediaStreamInPage to muteCaptureMediaStreamsExceptIn.
849         This eases reading the code.
850         Making sure that a page for which a new getUserMedia MediaStream will be created is capture-unmuted.
851
852         * Shared/WebPreferencesDefinitions.h:
853         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
854         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
855         * UIProcess/UserMediaProcessManager.cpp:
856         (WebKit::UserMediaProcessManager::muteCaptureMediaStreamsExceptIn):
857         (WebKit::UserMediaProcessManager::willCreateMediaStream):
858         * UIProcess/UserMediaProcessManager.h:
859         * UIProcess/WebPageProxy.cpp:
860         (WebKit::WebPageProxy::setMuted):
861         * UIProcess/WebPageProxy.h:
862         (WebKit::WebPageProxy::activateMediaStreamCaptureInPage):
863
864 2017-06-06  Carlos Garcia Campos  <cgarcia@igalia.com>
865
866         [WPE] Enable remote inspector
867         https://bugs.webkit.org/show_bug.cgi?id=172971
868
869         Reviewed by Žan Doberšek.
870
871         Initialize the remote inpector if needed.
872
873         * UIProcess/wpe/WebProcessPoolWPE.cpp:
874         (WebKit::initializeRemoteInspectorServer):
875         (WebKit::WebProcessPool::platformInitialize):
876
877 2017-06-06  Carlos Garcia Campos  <cgarcia@igalia.com>
878
879         [GLIB] Make remote inspector DBus protocol common to all glib based ports
880         https://bugs.webkit.org/show_bug.cgi?id=172970
881
882         Reviewed by Žan Doberšek.
883
884         Use webkit instead of webkitgtk and reomve platform idfeds.
885
886         * UIProcess/glib/RemoteInspectorClient.cpp:
887
888 2017-06-06  Zan Dobersek  <zdobersek@igalia.com>
889
890         [WPE] Don't disable Web security preference by default
891         https://bugs.webkit.org/show_bug.cgi?id=172964
892
893         Reviewed by Carlos Garcia Campos.
894
895         * UIProcess/API/wpe/WPEView.cpp:
896         (WKWPE::View::View): Don't disable Web security by default.
897
898 2017-06-05  Chris Dumez  <cdumez@apple.com>
899
900         ASSERTION FAILED: RunLoop::isMain() in com.apple.WebKit: IPC::Connection::sendSyncMessage + 128
901         https://bugs.webkit.org/show_bug.cgi?id=172943
902         <rdar://problem/31288058>
903
904         Reviewed by Alexey Proskuryakov.
905
906         In Connection::sendMessage(), make sure we only ever transform asynchronous messages into synchronous
907         ones if sendMessage() is called on the main thread. This is necessary because we no longer support
908         sending synchronous messages from a background thread since r205125.
909
910         * Platform/IPC/Connection.cpp:
911         (IPC::Connection::sendMessage):
912         (IPC::Connection::sendSyncMessage):
913
914 2017-06-05  Joseph Pecoraro  <pecoraro@apple.com>
915
916         Revert r217405, this headerpad increase is no longer needed.
917
918         Rubber-stamped by Dan Bernstein.
919
920         * Configurations/BaseXPCService.xcconfig:
921
922 2017-06-05  Dan Bernstein  <mitz@apple.com>
923
924         Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.
925
926         * UIProcess/Cocoa/WebViewImpl.h:
927         * UIProcess/Cocoa/WebViewImpl.mm:
928         (WebKit::WebViewImpl::mediaPlaybackControlsView):
929
930 2017-06-05  Jer Noble  <jer.noble@apple.com>
931
932         Allow clients to specify a list of codecs which should require hardware decode support.
933         https://bugs.webkit.org/show_bug.cgi?id=172787
934
935         Reviewed by Alex Christensen.
936
937         Add a WKWebPageConfiguration (and associated WebPreferences and WKPreferencesRef) properties
938         allowing clients to require specified codecs have hardware decode support. Also open up the
939         sandbox on Cocoa ports to services required to check for hardware decode availability.
940
941         * Shared/WebPreferencesDefinitions.h:
942         * UIProcess/API/C/WKPreferences.cpp:
943         (WKPreferencesSetMediaCodecsRequiringHardwareSupport):
944         (WKPreferencesCopyMediaCodecsRequiringHardwareSupport):
945         * UIProcess/API/C/WKPreferencesRefPrivate.h:
946         * UIProcess/API/Cocoa/WKWebView.mm:
947         (-[WKWebView _initializeWithConfiguration:]):
948         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
949         (-[WKWebViewConfiguration copyWithZone:]):
950         (-[WKWebViewConfiguration _mediaCodecsRequiringHardwareSupport]):
951         (-[WKWebViewConfiguration _setMediaCodecsRequiringHardwareSupport:]):
952         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
953         * WebProcess/com.apple.WebProcess.sb.in:
954
955 2017-06-05  Beth Dakin  <bdakin@apple.com>
956
957         Modify Netflix controlsManager quirk to prevent only scrubbing
958         https://bugs.webkit.org/show_bug.cgi?id=172881
959         -and corresponding-
960         rdar://problem/32228660
961
962         Reviewed by Andy Estes.
963
964         Plumbing for allowsTouchBarScrubbing. See WebCore ChangeLog for more details.
965
966         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
967         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in:
968         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
969         (WebKit::WebPlaybackSessionModelContext::setAllowsTouchBarScrubbing):
970         (WebKit::WebPlaybackSessionManagerProxy::setAllowsTouchBarScrubbing):
971         * WebProcess/cocoa/WebPlaybackSessionManager.h:
972         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
973         (WebKit::WebPlaybackSessionInterfaceContext::allowsTouchBarScrubbingChanged):
974         (WebKit::WebPlaybackSessionManager::allowsTouchBarScrubbingChanged):
975
976 2017-06-05  Carlos Garcia Campos  <cgarcia@igalia.com>
977
978         Unreviewed. Fix GTK+ build with OpenGL disabled after r217779.
979
980         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
981         (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged):
982
983 2017-06-05  Carlos Garcia Campos  <cgarcia@igalia.com>
984
985         [WPE] Use AcceleratedDrawingArea instead of its fork
986         https://bugs.webkit.org/show_bug.cgi?id=172496
987
988         Reviewed by Žan Doberšek.
989
990         WPE uses its own drawing area implementation, which is actually a fork of AcceleratedDrawingArea, but simplified
991         for the case of compositing being always forced. AcceleratedDrawingArea already handles the case of compositing
992         being forced, so now that WPE is upstream we could simply use AcceleratedDrawingArea instead.
993
994         * PlatformWPE.cmake:
995         * Shared/DrawingAreaInfo.h: Remove DrawingAreaTypeWPE type.
996         * UIProcess/API/wpe/DrawingAreaProxyWPE.cpp: Removed.
997         * UIProcess/API/wpe/DrawingAreaProxyWPE.h: Removed.
998         * UIProcess/API/wpe/PageClientImpl.cpp:
999         (WebKit::PageClientImpl::createDrawingAreaProxy): Create an AcceleratedDrawingAreaProxy.
1000         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1001         (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged): Moved from DrawingAreaImpl since it actually
1002         belongs here.
1003         * WebProcess/WebPage/DrawingArea.cpp:
1004         (WebKit::DrawingArea::create): Create an AcceleratedDrawingArea for WPE port.
1005         * WebProcess/WebPage/DrawingAreaImpl.cpp: Remove mainFrameContentSizeChanged() that doesn't belong here.
1006         * WebProcess/WebPage/DrawingAreaImpl.h:
1007         * WebProcess/WebPage/wpe/DrawingAreaWPE.cpp: Removed.
1008         * WebProcess/WebPage/wpe/DrawingAreaWPE.h: Removed.
1009
1010 2017-06-03  Simon Fraser  <simon.fraser@apple.com>
1011
1012         Sort the project file.
1013
1014         * WebKit2.xcodeproj/project.pbxproj:
1015
1016 2017-06-02  Chris Dumez  <cdumez@apple.com>
1017
1018         ResourceLoadStatistics are not using unique paths during test runs
1019         https://bugs.webkit.org/show_bug.cgi?id=172861
1020         <rdar://problem/32442251>
1021
1022         Reviewed by Darin Adler.
1023
1024         Add WKContextConfigurationSetResourceLoadStatisticsDirectory() C API to allow
1025         WKTR to use a custom directory.
1026
1027         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1028         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
1029         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
1030         (API::ProcessPoolConfiguration::copy):
1031         * UIProcess/API/APIProcessPoolConfiguration.h:
1032         * UIProcess/API/C/WKContextConfigurationRef.cpp:
1033         (WKContextConfigurationCopyResourceLoadStatisticsDirectory):
1034         (WKContextConfigurationSetResourceLoadStatisticsDirectory):
1035         * UIProcess/API/C/WKContextConfigurationRef.h:
1036         * UIProcess/WebProcessPool.cpp:
1037         (WebKit::legacyWebsiteDataStoreConfiguration):
1038
1039 2017-06-02  Brady Eidson  <beidson@apple.com>
1040
1041         Prevent scheme handlers from handling all built-in URL schemes.
1042         <rdar://problem/32404790> and https://bugs.webkit.org/show_bug.cgi?id=172869
1043
1044         Reviewed by Andy Estes.
1045
1046         * UIProcess/API/Cocoa/WKWebView.mm:
1047         (+[WKWebView handlesURLScheme:]): Check against WebCore's new master list of URL schemes.
1048
1049 2017-06-02  Simon Fraser  <simon.fraser@apple.com>
1050
1051         All scroll peformance logging should happen in the UI process
1052         https://bugs.webkit.org/show_bug.cgi?id=172874
1053         rdar://problem/24474830
1054
1055         Reviewed by Tim Horton.
1056
1057         Printing to stdout from the WebProcess doesn't show up anywhere in non-development builds,
1058         so we have to log from the UI process.
1059
1060         Achieve this by adding a PerformanceLoggingClient to Page which forwards messages to
1061         WebPageProxy, which prints them with the same format they had before. Some plumbing through
1062         PlatformCALayerClient and GraphicsLayerClient is required to get messages from TileControllers
1063         through to something that can get to Page.
1064
1065         * UIProcess/WebPageProxy.cpp:
1066         (WebKit::WebPageProxy::logScrollingEvent):
1067         * UIProcess/WebPageProxy.h:
1068         * UIProcess/WebPageProxy.messages.in:
1069         * WebKit2.xcodeproj/project.pbxproj:
1070         * WebProcess/WebCoreSupport/WebPerformanceLoggingClient.cpp: Added.
1071         (WebKit::WebPerformanceLoggingClient::WebPerformanceLoggingClient):
1072         (WebKit::WebPerformanceLoggingClient::logScrollingEvent):
1073         * WebProcess/WebCoreSupport/WebPerformanceLoggingClient.h: Added.
1074         * WebProcess/WebPage/WebPage.cpp:
1075         (WebKit::m_cpuLimit):
1076
1077 2017-06-02  Chris Dumez  <cdumez@apple.com>
1078
1079         REGRESSION (r206386): Xactimate Website Crashes @ com.apple.WebKit: WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant + 255
1080         https://bugs.webkit.org/show_bug.cgi?id=172846
1081         <rdar://problem/31093005>
1082
1083         Reviewed by Mark Lam.
1084
1085         Follow-up to r217695 to deal with exceptions potentially thrown by
1086         NPRuntimeObjectMap::convertJSValueToNPVariant() as well.
1087
1088         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
1089         (WebKit::NPJSObject::invoke):
1090
1091 2017-06-02  Jeremy Jones  <jeremyj@apple.com>
1092
1093         Add abilility to specify presentingApplicationPID for a WebProcessPool.
1094         https://bugs.webkit.org/show_bug.cgi?id=172839
1095         rdar://problem/32247170
1096
1097         Reviewed by Tim Horton.
1098
1099         Expose presentingApplicationPID through WebProcessPoolConfiguration.
1100         This allows rehosted WebViews to specify the hosting application.
1101
1102         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1103         (API::ProcessPoolConfiguration::copy):
1104         * UIProcess/API/APIProcessPoolConfiguration.h:
1105         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1106         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1107         (-[_WKProcessPoolConfiguration setPresentingApplicationPID:]):
1108         (-[_WKProcessPoolConfiguration presentingApplicationPID]):
1109         * UIProcess/WebProcessPool.cpp:
1110         (WebKit::WebProcessPool::ensureNetworkProcess):
1111         (WebKit::WebProcessPool::createNewWebProcess):
1112
1113 2017-06-02  Frederic Wang  <fwang@igalia.com>
1114
1115         [Mac] Use compositing for frames when ScrollingTreeIncludesFrames=true
1116         https://bugs.webkit.org/show_bug.cgi?id=172851
1117
1118         Reviewed by Simon Fraser.
1119
1120         When fast frame scrolling is supported on mac (bug 171667), scrollable frames will require
1121         special composited layer. This commit enables that on mac but only when
1122         ScrollingTreeIncludesFrames=true, so that the default behavior is unchanged.
1123
1124         * WebProcess/WebCoreSupport/WebChromeClient.h: Make scrollable inner frame trigger
1125         compositing on Mac by default. This is ignored on mac when ScrollingTreeIncludesFrames=false.
1126         Rename ScrollableInnerFrameTrigger to ScrollableNonMainFrameTrigger.
1127
1128 2017-06-02  Zalan Bujtas  <zalan@apple.com>
1129
1130         Allow clients to override viewport size for CSS viewport units.
1131         https://bugs.webkit.org/show_bug.cgi?id=172838
1132         <rdar://problem/32523441>
1133
1134         Reviewed by Tim Horton.
1135
1136         This enables auto-sizing clients to ensure that styles relative to the viewport are
1137         resolved to a set value (presumably the size of the container) as opposed to the preferred
1138         document size (which is set as the FrameView size).
1139
1140         * Shared/WebPageCreationParameters.cpp:
1141         (WebKit::WebPageCreationParameters::encode):
1142         (WebKit::WebPageCreationParameters::decode):
1143         * Shared/WebPageCreationParameters.h:
1144         * UIProcess/API/Cocoa/WKWebView.mm:
1145         (-[WKWebView _viewportSizeForCSSViewportUnits]):
1146         (-[WKWebView _setViewportSizeForCSSViewportUnits:]):
1147         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1148         * UIProcess/WebPageProxy.cpp:
1149         (WebKit::WebPageProxy::creationParameters):
1150         (WebKit::WebPageProxy::setViewportSizeForCSSViewportUnits):
1151         * UIProcess/WebPageProxy.h:
1152         (WebKit::WebPageProxy::viewportSizeForCSSViewportUnits):
1153         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1154         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
1155         * WebProcess/WebPage/WebPage.cpp:
1156         (WebKit::m_cpuLimit):
1157         (WebKit::WebPage::setViewportSizeForCSSViewportUnits):
1158         * WebProcess/WebPage/WebPage.h:
1159         (WebKit::WebPage::viewportSizeForCSSViewportUnits):
1160         * WebProcess/WebPage/WebPage.messages.in:
1161
1162 2017-06-02  Simon Fraser  <simon.fraser@apple.com>
1163
1164         Get <chrono> out of StdLibExtras.h
1165         https://bugs.webkit.org/show_bug.cgi?id=172744
1166
1167         Reviewed by Zalan Bujtas.
1168
1169         Only bring in <chrono> and namespace std::literals::chrono_literals when necessary.
1170
1171         * NetworkProcess/cache/NetworkCache.cpp:
1172         * NetworkProcess/cache/NetworkCacheFileSystem.h:
1173         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
1174         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1175         (WebKit::NetworkCache::computeRecordWorth):
1176         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
1177         * WebProcess/Cookies/WebCookieManager.h:
1178
1179 2017-06-02  Andy Estes  <aestes@apple.com>
1180
1181         [Cocoa] Add a "supportedCountries" property to ApplePayPaymentRequest
1182         https://bugs.webkit.org/show_bug.cgi?id=172832
1183         <rdar://problem/30735544>
1184
1185         Reviewed by Alex Christensen.
1186
1187         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
1188         (IPC::ArgumentCoder<PaymentRequest>::encode):
1189         (IPC::ArgumentCoder<PaymentRequest>::decode):
1190         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1191         (WebKit::toNSSet):
1192         (WebKit::toPKPaymentRequest):
1193
1194 2017-06-02  Dan Bernstein  <mitz@apple.com>
1195
1196         [Xcode] Header postprocessing should be based on the target OS version rather than the builder OS version
1197         https://bugs.webkit.org/show_bug.cgi?id=172860
1198
1199         Reviewed by Anders Carlsson.
1200
1201         * Configurations/WebKit.xcconfig: Use TARGET_MAC_OS_X_VERSION_MAJOR
1202
1203 2017-06-02  Gwang Yoon Hwang  <yoon@igalia.com>
1204
1205         REGRESSION(r217214): [Coordinated Graphics] UpdateAtlas didn't released while resetting testrunner
1206         https://bugs.webkit.org/show_bug.cgi?id=172746
1207
1208         Reviewed by Žan Doberšek.
1209
1210         After clearing update atlases in CompositingCoordinator, we should
1211         release update atlases at the compositing thread, too.
1212
1213         We cannot remove update atlases from the CoordinatedGraphicsScene
1214         without regard to update scheduling, since previously committed scene
1215         states can try to use already released update atlases.
1216         To prevent this timing problem, releasing update atlases should be done
1217         with a update scheduler.
1218
1219         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1220         (WebKit::CoordinatedGraphicsScene::syncRemoteContent):
1221         (WebKit::CoordinatedGraphicsScene::appendUpdate):
1222         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1223         Use WTF::Function instead of std::function
1224         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1225         (WebKit::ThreadedCompositor::updateSceneState):
1226         (WebKit::ThreadedCompositor::releaseUpdateAtlases):
1227         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1228         (WebKit::ThreadedCompositor::flushPendingLayerChanges):
1229         Release UpdateAtlases at the end of compositing states update, too.
1230         (WebKit::CompositingCoordinator::clearUpdateAtlases):
1231
1232 2017-06-01  Andreas Kling  <akling@apple.com>
1233
1234         [Mac] Remove backing store for layers that are outside the viewport
1235         https://bugs.webkit.org/show_bug.cgi?id=170082
1236         <rdar://problem/31245009>
1237
1238         Reviewed by Simon Fraser.
1239
1240         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
1241
1242 2017-06-01  Chris Dumez  <cdumez@apple.com>
1243
1244         REGRESSION (r206386): Xactimate Website Crashes @ com.apple.WebKit: WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant + 255
1245         https://bugs.webkit.org/show_bug.cgi?id=172846
1246         <rdar://problem/31093005>
1247
1248         Reviewed by Andreas Kling.
1249
1250         In NPJSObject::invoke(), return early if there was an exception when calling JSC::call().
1251         Using the value returned by JSC::call() when an exception occurred is unsafe.
1252
1253         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
1254         (WebKit::NPJSObject::invoke):
1255
1256 2017-06-01  Jon Lee  <jonlee@apple.com>
1257
1258         Rename an experimental feature item
1259         https://bugs.webkit.org/show_bug.cgi?id=172830
1260
1261         Reviewed by Joseph Pecoraro.
1262
1263         * Shared/WebPreferencesDefinitions.h:
1264
1265 2017-06-01  Andy Estes  <aestes@apple.com>
1266
1267         REGRESSION (r217626): ENABLE_APPLE_PAY_SESSION_V3 was disabled by mistake
1268         https://bugs.webkit.org/show_bug.cgi?id=172828
1269
1270         Reviewed by Beth Dakin.
1271
1272         * Configurations/FeatureDefines.xcconfig:
1273
1274 2017-06-01  Chris Dumez  <cdumez@apple.com>
1275
1276         [WK2] Update plugin process sandbox profile for flash plugin on HBONow
1277         https://bugs.webkit.org/show_bug.cgi?id=172820
1278         <rdar://problem/32513297>
1279
1280         Reviewed by Brent Fulgham.
1281
1282         Relax the IOKit whitelist to silence sandbox violations by Flash plugin on
1283         HBONow.
1284
1285         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1286
1287 2017-06-01  Andy Estes  <aestes@apple.com>
1288
1289         [Cocoa] Upstream support for JCB as a supported payment network
1290         https://bugs.webkit.org/show_bug.cgi?id=172819
1291
1292         Reviewed by Tim Horton.
1293
1294         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1295         (WebKit::toSupportedNetwork):
1296         (WebKit::toAdditionalSupportedNetwork): Deleted.
1297
1298 2017-05-31  Andy Estes  <aestes@apple.com>
1299
1300         [Cocoa] "administrativeArea" contact field maps to the wrong CNPostalAddress key when creating NSErrors
1301         https://bugs.webkit.org/show_bug.cgi?id=172784
1302         <rdar://problem/32414416>
1303
1304         Reviewed by Beth Dakin.
1305
1306         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1307         (WebKit::toNSError): Used CNPostalAddressStateKey instead of CNPostalAddressCityKey.
1308
1309 2017-05-31  Andy Estes  <aestes@apple.com>
1310
1311         Rename ENABLE_APPLE_PAY_DELEGATE to ENABLE_APPLE_PAY_SESSION_V3 and bump the supported version number
1312         https://bugs.webkit.org/show_bug.cgi?id=172366
1313
1314         Reviewed by Daniel Bates.
1315
1316         * Configurations/FeatureDefines.xcconfig:
1317         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
1318         (WebKit::WebPaymentCoordinator::supportsVersion):
1319
1320 2017-05-31  Chris Dumez  <cdumez@apple.com>
1321
1322         [WK2] Fix bad assertion in BackgroundProcessResponsivenessTimer::scheduleNextResponsivenessCheck()
1323         https://bugs.webkit.org/show_bug.cgi?id=172763
1324
1325         Reviewed by Zalan Bujtas.
1326
1327         Fix bad assertion in BackgroundProcessResponsivenessTimer::scheduleNextResponsivenessCheck().
1328         It gets hit when a process becomes unresponsive. The reason is that RunLoop::Timer::isActive()
1329         still returns true while the timerFired() callback is called.
1330
1331         * UIProcess/BackgroundProcessResponsivenessTimer.cpp:
1332         (WebKit::BackgroundProcessResponsivenessTimer::scheduleNextResponsivenessCheck):
1333
1334 2017-05-31  Youenn Fablet  <youenn@apple.com>
1335
1336         Make WebRTC legacy API switch an experimental feature
1337         https://bugs.webkit.org/show_bug.cgi?id=172760
1338
1339         Reviewed by Eric Carlson.
1340
1341         This patch adds an experimental feature to disable WebRTC legacy API.
1342         We keep the runtime flag as "enable WebRTC legacy API" to minimize the changes and as it is clearer in the code.
1343
1344         * Shared/WebPreferencesDefinitions.h:
1345         * UIProcess/API/C/WKPreferences.cpp:
1346         (WKPreferencesSetWebRTCLegacyAPIEnabled):
1347         (WKPreferencesGetWebRTCLegacyAPIEnabled):
1348         * UIProcess/API/Cocoa/WKPreferences.mm:
1349         (-[WKPreferences _webRTCLegacyAPIEnabled]):
1350         (-[WKPreferences _setWebRTCLegacyAPIEnabled:]):
1351         * WebProcess/WebPage/WebPage.cpp:
1352         (WebKit::WebPage::updatePreferences):
1353
1354 2017-05-31  Matt Lewis  <jlewis3@apple.com>
1355
1356         Unreviewed, rolling out r217603.
1357
1358         This patch broke the internal builds.
1359
1360         Reverted changeset:
1361
1362         "Get <chrono> out of StdLibExtras.h"
1363         https://bugs.webkit.org/show_bug.cgi?id=172744
1364         http://trac.webkit.org/changeset/217603
1365
1366 2017-05-31  Brent Fulgham  <bfulgham@apple.com>
1367
1368         Make ResourceLoadStatistics testing more reliable
1369         https://bugs.webkit.org/show_bug.cgi?id=172730
1370         <rdar://problem/32028373>
1371
1372         Reviewed by Andy Estes.
1373
1374         * UIProcess/WebProcessProxy.cpp:
1375         (WebKit::WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed): Add a convenience method to notify the
1376         WebProcess when the UIProcess has finished processing the load statistics data.
1377         * UIProcess/WebProcessProxy.h:
1378         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1379         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): Notify clients (if they requested) when
1380         statistics have been processed.
1381
1382 2017-05-31  Simon Fraser  <simon.fraser@apple.com>
1383
1384         Get <chrono> out of StdLibExtras.h
1385         https://bugs.webkit.org/show_bug.cgi?id=172744
1386
1387         Reviewed by Saam Barati.
1388
1389         Only bring in <chrono> and namespace std::literals::chrono_literals when necessary.
1390
1391         * NetworkProcess/cache/NetworkCache.cpp:
1392         * NetworkProcess/cache/NetworkCacheFileSystem.h:
1393         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
1394         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1395         (WebKit::NetworkCache::computeRecordWorth):
1396         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
1397         * WebProcess/Cookies/WebCookieManager.h:
1398
1399 2017-05-31  Zan Dobersek  <zdobersek@igalia.com>
1400
1401         CoordinatedLayerTreeHost: properly support async force repaints
1402         https://bugs.webkit.org/show_bug.cgi?id=172444
1403
1404         Reviewed by Carlos Garcia Campos.
1405
1406         Before these changes the force-repaint callbacks were executed once
1407         the next layer flush was performed. This is not appropriate since
1408         with the threaded compositor this was done even before the flushed
1409         state was handled on the rendering thread.
1410
1411         Instead, the callback should be invoked once the first following
1412         flushed state is rendered through the compositor and the update
1413         finish is reported back to CoordinatedLayerTreeHost through invoking
1414         the renderNextFrame() method.
1415
1416         If the force-repaint callback is registered while a state update is
1417         already being processed by the renderer (i.e. the threaded compositor),
1418         the callback is invoked only after the following flush, which is
1419         executed when renderNextFrame() is called for the current state update.
1420
1421         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1422         Add the forceFrameSync() method that forces the following state flush
1423         to produce a state update that will be handled by the compositor.
1424         This ensures that the compositor informs the CoordinatedLayerTreeHost
1425         once this state update is done, invoking renderNextFrame() which would
1426         handle the force-repaint callback.
1427         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1428         (WebKit::CoordinatedLayerTreeHost::forceRepaintAsync):
1429         (WebKit::CoordinatedLayerTreeHost::renderNextFrame):
1430         (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired):
1431         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1432         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
1433         Remove the forceRepaintAsync() override that returned false.
1434
1435 2017-05-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1436
1437         Unreviewed. Fix copy-paste error added in r217209.
1438
1439         It seems I pasted twice.
1440
1441         * UIProcess/API/gtk/WebKitContextMenuItem.h:
1442
1443 2017-05-30  Tim Horton  <timothy_horton@apple.com>
1444
1445         Keyboard autocorrections do not apply with an active selection (but keyboard acts like they did)
1446         https://bugs.webkit.org/show_bug.cgi?id=172735
1447         <rdar://problem/32015977>
1448
1449         Reviewed by Enrica Casucci.
1450
1451         * UIProcess/API/Cocoa/WKWebView.mm:
1452         (-[WKWebView applyAutocorrection:toString:withCompletionHandler:]):
1453         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1454         Expose applyAutocorrection on the WKTesting category for use from UIScriptController.
1455
1456         * WebProcess/WebPage/ios/WebPageIOS.mm:
1457         (WebKit::WebPage::syncApplyAutocorrection):
1458         If there is a range selection and it precisely matches the autocorrection's "before"
1459         string, allow the autocorrection to take place.
1460
1461 2017-05-30  Joseph Pecoraro  <pecoraro@apple.com>
1462
1463         Web Inspector: images dragged from Inspector to Desktop are named "Unknown.png"
1464         https://bugs.webkit.org/show_bug.cgi?id=141515
1465         <rdar://problem/9251308>
1466
1467         Reviewed by Wenson Hsieh.
1468
1469         In Web Inspector these images are <img src="..."> with data: or blob:
1470         content. In these cases we have the image data but the URL does not
1471         provide a useful name. In fact the name "Unknown.png" comes from
1472         -[NSURLResponse suggestedFilename] for this URL / content.
1473
1474         To start, improve this situation for drags in Web Inspector pages.
1475         If the image element being dragged has a filename attribute use that
1476         as the suggested filename for the drag.
1477
1478         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1479         (WebKit::WebDragClient::declareAndWriteDragImage):
1480
1481 2017-05-30  Ryosuke Niwa  <rniwa@webkit.org>
1482
1483         Only include DataDetectorsUI headers in iOS
1484         https://bugs.webkit.org/show_bug.cgi?id=172633
1485
1486         Reviewed by David Kilzer.
1487
1488         Enable data detectors only on iOS and not other variants of iOS.
1489
1490         * Platform/spi/ios/ManagedConfigurationSPI.h:
1491         * UIProcess/API/Cocoa/WKWebView.mm:
1492         (-[WKWebView _dataDetectionResults]):
1493         * UIProcess/ios/WKActionSheetAssistant.h:
1494         * UIProcess/ios/WKActionSheetAssistant.mm:
1495         (-[WKActionSheetAssistant showDataDetectorsSheet]):
1496         * UIProcess/ios/WKContentViewInteraction.h:
1497         * UIProcess/ios/WKContentViewInteraction.mm:
1498         (-[WKContentView _actionForLongPressFromPositionInformation:]):
1499         (-[WKContentView _didNotHandleTapAsClick:]):
1500         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm:
1501         (-[WKWebProcessPlugInRangeHandle detectDataWithTypes:context:]):
1502         * WebProcess/WebPage/ios/WebPageIOS.mm:
1503         (WebKit::WebPage::handleTap):
1504         (WebKit::WebPage::handleTwoFingerTapAtPoint):
1505         (WebKit::WebPage::commitPotentialTap):
1506
1507 2017-05-30  Chris Dumez  <cdumez@apple.com>
1508
1509         REGRESSION(r215946): Can't reference a table cell in Google spreadsheet
1510         https://bugs.webkit.org/show_bug.cgi?id=172703
1511         <rdar://problem/32458086>
1512
1513         Reviewed by Ryosuke Niwa.
1514
1515         Fix GObject bindings accordingly.
1516
1517         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
1518         (WebKit::kit):
1519         (WebKit::core):
1520         (WebKit::wrapDOMRectList):
1521         (webkit_dom_client_rect_list_constructed):
1522         (webkit_dom_client_rect_list_item):
1523         (webkit_dom_client_rect_list_get_length):
1524         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectListPrivate.h:
1525         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
1526         (webkit_dom_element_get_client_rects):
1527
1528 2017-05-30  Daniel Bates  <dabates@apple.com>
1529
1530         [WK2] Add runBeforeUnloadConfirmPanel WKUIDelegate SPI; support onbeforeunload confirm panel in MiniBrowser
1531         https://bugs.webkit.org/show_bug.cgi?id=172603
1532         <rdar://problem/32471306>
1533
1534         Reviewed by Brady Eidson.
1535
1536         A page loaded in MiniBrowser using WebKit2 cannot show a beforeunload confirm panel (by registering
1537         an onbeforeunload event handler) when it is unloaded. The same page loaded in MiniBrowser using
1538         WebKit1 can show such a confirm panel. We need to add WKUIDelegate SPI so that an embedding client,
1539         such as MiniBrowser, can register to receive a callback to show a beforeunload confirm panel.
1540
1541         * UIProcess/API/APIUIClient.h:
1542         (API::UIClient::runBeforeUnloadConfirmPanel): Modified to take a SecurityOriginData object. This
1543         makes the API consistent with the existing JavaScript dialog callbacks.
1544         * UIProcess/API/C/WKPage.cpp:
1545         (WKPageSetPageUIClient):
1546         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Add SPI -_webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:completionHandler:.
1547         * UIProcess/API/Cocoa/WKWebView.mm:
1548         (-[WKWebView setUIDelegate:]): Set the delegate of WebKit::UIDelegate to the specified WKUIDelegate
1549         before we set the UI client on the page so as to ensure that API::UIClient callbacks that depend
1550         -respondsToSelector: checks (e.g. API::UIClient::canRunBeforeUnloadConfirmPanel()) return the correct
1551         result. To elaborate further, a API::UIClient client must override both canRunBeforeUnloadConfirmPanel()
1552         and runBeforeUnloadConfirmPanel() to support running a beforeunload confirm dialog. When mapping
1553         the Cocoa SPI, WKUIDelegatePrivate, to API::UIClient we implement API::UIClient::canRunBeforeUnloadConfirmPanel()
1554         in terms of whether the Cocoa delegate responds at runtime to the selector -_webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:completionHandler:.
1555         We need to do such runtime checks before we pass the API::UIClient to the page. Otherwise, querying
1556         API::UIClient::canRunBeforeUnloadConfirmPanel() will return the wrong result.
1557         * UIProcess/API/gtk/WebKitUIClient.cpp: Modified runBeforeUnloadConfirmPanel() to take a SecurityOriginData object.
1558         * UIProcess/Cocoa/UIDelegate.h: Add declarations for API::UIClient overrides: canRunBeforeUnloadConfirmPanel()
1559         and runBeforeUnloadConfirmPanel(). Add a bit to m_delegateMethods as to whether the Cocoa delegate
1560         responds to selector -_webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:completionHandler:.
1561         * UIProcess/Cocoa/UIDelegate.mm:
1562         (WebKit::UIDelegate::setDelegate): Set the above m_delegateMethods bit if the Cocoa delegate responds
1563         to selector -_webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:completionHandler:.
1564         (WebKit::UIDelegate::UIClient::canRunBeforeUnloadConfirmPanel): Return whether the above m_delegateMethods
1565         bit was set.
1566         (WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel): Turn around and call -_webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:completionHandler: (if applicable).
1567         * UIProcess/WebPageProxy.cpp:
1568         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): Modified to take a SecurityOriginData object
1569         and pass it to API::UIClient::runBeforeUnloadConfirmPanel().
1570         * UIProcess/WebPageProxy.h:
1571         * UIProcess/WebPageProxy.messages.in: Add SecurityOriginData argument to message RunBeforeUnloadConfirmPanel.
1572         Also pass the message for the panel as the last argument so as to make the order of arguments to message
1573         RunBeforeUnloadConfirmPanel more closely match the order of arguments passed to other JavaScript dialog
1574         messages (e.g. RunJavaScriptAlert) for consistency.
1575         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1576         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel): Include the SecurityOriginData object for the
1577         frame in message RunBeforeUnloadConfirmPanel.
1578
1579 2017-05-30  Alex Christensen  <achristensen@webkit.org>
1580
1581         Update libwebrtc configuration
1582         https://bugs.webkit.org/show_bug.cgi?id=172727
1583
1584         Reviewed by Geoffrey Garen.
1585
1586         * Configurations/FeatureDefines.xcconfig:
1587
1588 2017-05-30  Tim Horton  <timothy_horton@apple.com>
1589
1590         Dictionary lookup disappears after a few seconds on observer.com
1591         https://bugs.webkit.org/show_bug.cgi?id=172725
1592         <rdar://problem/32328324>
1593
1594         Reviewed by Beth Dakin.
1595
1596         Only dismiss content-relative child windows on main frame loads,
1597         not all subframes. This was causing e.g. dictionary popovers
1598         relative to main-frame content to be dismissed when subframe
1599         ads finished loading, which is likely the cause of most incidents
1600         of this problem.
1601
1602         If the popover is relative to subframe content and the subframe
1603         navigates out from under the popover, the popover will persist until
1604         dismissed by the user (or one of the other automatic dismissal
1605         mechanisms), but that seems preferable to the old behavior.
1606
1607         * UIProcess/Cocoa/WebViewImpl.h:
1608         Remove an unimplemented and unused declaration.
1609
1610         * UIProcess/Cocoa/WebViewImpl.mm:
1611         (WebKit::WebViewImpl::processDidExit):
1612         Move dismissContentRelativeChildWindows call here from WebPageProxy.
1613
1614         * UIProcess/PageClient.h:
1615         * UIProcess/WebPageProxy.cpp:
1616         (WebKit::WebPageProxy::didCommitLoadForFrame):
1617         (WebKit::WebPageProxy::resetStateAfterProcessExited):
1618         * UIProcess/mac/PageClientImpl.h:
1619         * UIProcess/mac/PageClientImpl.mm:
1620         (WebKit::PageClientImpl::didCommitLoadForMainFrame):
1621         (WebKit::PageClientImpl::navigationGestureDidBegin):
1622         (WebKit::PageClientImpl::dismissContentRelativeChildWindows):
1623         Remove dismissContentRelativeChildWindows from PageClient(Impl),
1624         call it from inside PageClientImpl and other Mac-specific places
1625         instead of inside ifdefs in WebPageProxy.
1626
1627 2017-05-30  Konstantin Tokarev  <annulen@yandex.ru>
1628
1629         Don't use designated initializers in WebBackForwardListProxy.cpp
1630         https://bugs.webkit.org/show_bug.cgi?id=172667
1631
1632         Reviewed by Alex Christensen.
1633
1634         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1635         (WebKit::WebBackForwardListProxy::addItemFromUIProcess):
1636         (WebKit::WebBackForwardListProxy::addItem):
1637
1638 2017-05-30  Antti Koivisto  <antti@apple.com>
1639
1640         REGRESSION(r191402?): Safari, Mail crash at com.apple.WebKit: WebKit::WebContextMenuListenerProxy::invalidate + 4
1641         https://bugs.webkit.org/show_bug.cgi?id=172704
1642
1643         Reviewed by Andreas Kling.
1644
1645         r191402 made WebContextMenuProxy non-refcounted. However there are several potential ways for WebContextMenuProxyMac::show()
1646         to re-enter WebPageProxy and delete itself. This patch partially reverts r191402 bringing refcounting back and protects
1647         WebContextMenuProxy during show().
1648
1649         Speculative fix. No test, can't repro the crash.
1650
1651         * UIProcess/PageClient.h:
1652         * UIProcess/WebContextMenuProxy.h:
1653         * UIProcess/WebPageProxy.cpp:
1654         (WebKit::WebPageProxy::internalShowContextMenu):
1655
1656             Protect WebContextMenuProxy during show().
1657
1658         * UIProcess/WebPageProxy.h:
1659         * UIProcess/gtk/WebContextMenuProxyGtk.h:
1660         (WebKit::WebContextMenuProxyGtk::create):
1661         * UIProcess/ios/PageClientImplIOS.h:
1662         * UIProcess/ios/PageClientImplIOS.mm:
1663         (WebKit::PageClientImpl::createContextMenuProxy):
1664         * UIProcess/mac/PageClientImpl.h:
1665         * UIProcess/mac/PageClientImpl.mm:
1666         (WebKit::PageClientImpl::createContextMenuProxy):
1667         * UIProcess/mac/WebContextMenuProxyMac.h:
1668         (WebKit::WebContextMenuProxyMac::create):
1669
1670 2017-05-30  Zan Dobersek  <zdobersek@igalia.com>
1671
1672         Invalidate the LayerTreeHost when destroying the DrawingAreaWPE object.
1673
1674         Rubber-stamped by Carlos Garcia Campos.
1675
1676         * WebProcess/WebPage/wpe/DrawingAreaWPE.cpp:
1677         (WebKit::DrawingAreaWPE::~DrawingAreaWPE): Invalidate the LayerTreeHost
1678         object, properly deconstructing the graphics pipeline.
1679
1680 2017-05-29  Claudio Saavedra  <csaavedra@igalia.com>
1681
1682         [GTK] Remove unneeded forward declaration
1683
1684         Rubber-stamped by Zan Dobersek.
1685
1686         * UIProcess/API/C/gtk/WKAPICastGtk.h: Remove WebGrammarDetail as
1687         its header is included in the same file.
1688
1689 2017-05-29  Claudio Saavedra  <csaavedra@igalia.com>
1690
1691         [WPE] Build fix after r217531
1692
1693         Unreviewed.
1694
1695         * UIProcess/API/C/wpe/WKAPICastWPE.h:
1696         (WebKit::toAPI): Add missing WebGrammarDetail API cast.
1697
1698 2017-05-28  Dan Bernstein  <mitz@apple.com>
1699
1700         [Xcode] ALWAYS_SEARCH_USER_PATHS is set to YES
1701         https://bugs.webkit.org/show_bug.cgi?id=172691
1702
1703         Reviewed by Tim Horton.
1704
1705         * Configurations/Base.xcconfig: Set ALWAYS_SEARCH_USER_PATHS to NO.
1706
1707         * UIProcess/API/C/WKAPICast.h: Moved GTK-only definitions that used WebGrammarDetail.h to
1708           WKAPICastGtk.h. This had the effect of no longer including APIArray.h from this header.
1709
1710         * UIProcess/API/C/gtk/WKAPICastGtk.h: Moved GTK-only definitions to here.
1711         (WebKit::toAPI):
1712         * UIProcess/WebGrammarDetail.h: Replaced include of APIArray.h with a forward declaration.
1713
1714         * Shared/API/c/WKRenderLayer.cpp:
1715         * Shared/API/c/WKRenderObject.cpp:
1716         * UIProcess/API/C/WKApplicationCacheManager.cpp:
1717         * UIProcess/API/C/WKContext.cpp:
1718         * UIProcess/API/C/WKContextConfigurationRef.cpp:
1719         * UIProcess/API/C/WKCookieManager.cpp:
1720         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
1721         * UIProcess/API/C/WKNotificationManager.cpp:
1722         * UIProcess/API/C/WKOpenPanelResultListener.cpp:
1723         * UIProcess/API/C/WKPageGroup.cpp:
1724         * UIProcess/API/C/WKResourceCacheManager.cpp:
1725         * UIProcess/API/C/WKUserContentControllerRef.cpp:
1726         * UIProcess/API/gtk/WebKitBackForwardList.cpp:
1727         * UIProcess/WebContextMenuListenerProxy.cpp:
1728
1729           Added #include "APIArray.h" to these files now that WKAPICast.h does not include it.
1730
1731 2017-05-26  Joseph Pecoraro  <pecoraro@apple.com>
1732
1733         Simply some NSNumber usage
1734         https://bugs.webkit.org/show_bug.cgi?id=172677
1735
1736         Reviewed by Sam Weinig.
1737
1738         * PluginProcess/mac/PluginControllerProxyMac.mm:
1739         (WebKit::PluginControllerProxy::platformGeometryDidChange):
1740         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1741         (WebKit::registerUserDefaultsIfNeeded):
1742         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
1743         (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
1744
1745 2017-05-26  Brent Fulgham  <bfulgham@apple.com>
1746
1747         [WK2] Address thread safety issues with ResourceLoadStatistics
1748         https://bugs.webkit.org/show_bug.cgi?id=172519
1749         <rdar://problem/31707642>
1750
1751         Reviewed by Chris Dumez.
1752
1753         Address some thread safety issues with the ResourceLoadStatistics architecture.
1754
1755         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1756         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): Assert that this is never called on the main thread. Also
1757         ensure that coreStore is only accessed on the statistics queue, not the main thread.
1758         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): Dispatch coreStore-accessing code
1759         on the statistics queue.
1760         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated): Assert we do not hit this method
1761         on the main thread.
1762         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Assert that this is being called on the
1763         main thread. Also ensure that coreStore is only accessed on the statistics queue, not the main thread.
1764         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): Dispatch coreStore-accessing code
1765         on the statistics queue.
1766         (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): Lock data before operating on it.
1767         (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk): Assert we do not hit this method on the main thread.
1768         (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk): Ditto.
1769         * UIProcess/WebResourceLoadStatisticsStore.h:
1770         * WebProcess/WebProcess.cpp: Add a queue for the local WebProcess ResourceLoadStatisticsStore to use while processing data.
1771         (WebKit::m_statisticsQueue): Added.
1772         * WebProcess/WebProcess.h:
1773
1774 2017-05-26  Joseph Pecoraro  <pecoraro@apple.com>
1775
1776         [Cocoa] Simplify some WebViewImpl pasteboard code
1777         https://bugs.webkit.org/show_bug.cgi?id=172668
1778
1779         Reviewed by Tim Horton.
1780
1781         * Shared/mac/PasteboardTypes.mm:
1782         * UIProcess/Cocoa/WebViewImpl.mm:
1783         (WebKit::WebViewImpl::setFileAndURLTypes):
1784         (WebKit::WebViewImpl::setPromisedDataForAttachment):
1785
1786 2017-05-26  Joseph Pecoraro  <pecoraro@apple.com>
1787
1788         JSContext Inspector: Improve the reliability of automatically pausing in auto-attach
1789         https://bugs.webkit.org/show_bug.cgi?id=172664
1790         <rdar://problem/32362933>
1791
1792         Reviewed by Matt Baker.
1793
1794         * UIProcess/Automation/WebAutomationSession.cpp:
1795         (WebKit::WebAutomationSession::connect):
1796         * UIProcess/Automation/WebAutomationSession.h:
1797         Special connection options are ignored in automation sessions.
1798
1799 2017-05-26  Commit Queue  <commit-queue@webkit.org>
1800
1801         Unreviewed, rolling out r217479.
1802         https://bugs.webkit.org/show_bug.cgi?id=172642
1803
1804         Exposes an underlying bug in WPEBackend-mesa that we have to
1805         resolve separately (Requested by zdobersek on #webkit).
1806
1807         Reverted changeset:
1808
1809         "[WPE] Use AcceleratedDrawingArea instead of its fork"
1810         https://bugs.webkit.org/show_bug.cgi?id=172496
1811         http://trac.webkit.org/changeset/217479
1812
1813 2017-05-26  Csaba Osztrogonác  <ossy@webkit.org>
1814
1815         Unreviewed Mac cmake buildfix after r217137, just for fun.
1816         https://bugs.webkit.org/show_bug.cgi?id=172362
1817
1818         * PlatformMac.cmake:
1819
1820 2017-05-26  Carlos Garcia Campos  <cgarcia@igalia.com>
1821
1822         [WPE] Use AcceleratedDrawingArea instead of its fork
1823         https://bugs.webkit.org/show_bug.cgi?id=172496
1824
1825         Reviewed by Žan Doberšek.
1826
1827         WPE uses its own drawing area implementation, which is actually a fork of AcceleratedDrawingArea, but simplified
1828         for the case of compositing being always forced. AcceleratedDrawingArea already handles the case of compositing
1829         being forced, so now that WPE is upstream we could simply use AcceleratedDrawingArea instead.
1830
1831         * PlatformWPE.cmake:
1832         * Shared/DrawingAreaInfo.h: Remove DrawingAreaTypeWPE type.
1833         * UIProcess/API/wpe/DrawingAreaProxyWPE.cpp: Removed.
1834         * UIProcess/API/wpe/DrawingAreaProxyWPE.h: Removed.
1835         * UIProcess/API/wpe/PageClientImpl.cpp:
1836         (WebKit::PageClientImpl::createDrawingAreaProxy): Create an AcceleratedDrawingAreaProxy.
1837         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1838         (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged): Moved from DrawingAreaImpl since it actually
1839         belongs here.
1840         * WebProcess/WebPage/DrawingArea.cpp:
1841         (WebKit::DrawingArea::create): Create an AcceleratedDrawingArea for WPE port.
1842         * WebProcess/WebPage/DrawingAreaImpl.cpp: Remove mainFrameContentSizeChanged() that doesn't belong here.
1843         * WebProcess/WebPage/DrawingAreaImpl.h:
1844         * WebProcess/WebPage/wpe/DrawingAreaWPE.cpp: Removed.
1845         * WebProcess/WebPage/wpe/DrawingAreaWPE.h: Removed.
1846
1847 2017-05-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
1848
1849         [iOS] Disbale async image decoding when synchronously painting a newly parented WebView
1850         https://bugs.webkit.org/show_bug.cgi?id=172626
1851
1852         Reviewed by Simon Fraser.
1853
1854         Large images have to be synchronously decoded when bringing a WebView to 
1855         the foreground because the whole page will be painted when we unblock the
1856         UI process.
1857
1858         * Shared/mac/RemoteLayerBackingStore.mm:
1859         (WebKit::RemoteLayerBackingStore::drawInContext): Get nextFlushIsForImmediatePaint
1860         from RemoteLayerTreeContext and pass the correct GraphicsLayerPaintFlags
1861         to drawLayerContents().
1862         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
1863         (WebKit::RemoteLayerTreeContext::setNextFlushIsForImmediatePaint):
1864         (WebKit::RemoteLayerTreeContext::nextFlushIsForImmediatePaint):
1865         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
1866         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1867         (WebKit::RemoteLayerTreeDrawingArea::flushLayers): Pass
1868         m_nextFlushIsForImmediatePaint to RemoteLayerTreeContext and then reset it.
1869         (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):
1870         Set m_nextFlushIsForImmediatePaint to true to say that in the next flush,
1871         large images have to be synchronously decoded.
1872
1873 2017-05-25  Joseph Pecoraro  <pecoraro@apple.com>
1874
1875         _WKUserStyleSheet and WKUserScript leak string data
1876         https://bugs.webkit.org/show_bug.cgi?id=172583
1877         <rdar://problem/32395209>
1878
1879         Reviewed by Sam Weinig.
1880
1881         * UIProcess/API/Cocoa/WKUserScript.mm:
1882         (-[WKUserScript dealloc]):
1883         * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
1884         (-[_WKUserStyleSheet dealloc]):
1885         Follow the pattern of destructing the internal API object.
1886
1887         * UIProcess/API/Cocoa/WKUserScriptInternal.h:
1888         * UIProcess/API/Cocoa/_WKUserStyleSheetInternal.h:
1889         Remove unnecessary includes.
1890
1891 2017-05-25  Chris Dumez  <cdumez@apple.com>
1892
1893         ASSERT(m_websiteDataStore->websiteDataStore().sessionID() == m_sessionID) in PageConfiguration::sessionID()
1894         https://bugs.webkit.org/show_bug.cgi?id=172615
1895         <rdar://problem/32277488>
1896
1897         Reviewed by Brady Eidson.
1898
1899         Fix assertion added in r215923 to take into account the fact that the PageConfiguration's sessionID
1900         is SessionID::legacyPrivateSessionID() when private browsing is enabled, instead of being the
1901         WebsiteDataStore's sessionID.
1902
1903         See code in WebProcessPool::createWebPage():
1904         """
1905         pageConfiguration->setSessionID(pageConfiguration->preferences()->privateBrowsingEnabled() ? SessionID::legacyPrivateSessionID() : m_websiteDataStore->websiteDataStore().sessionID());
1906         """
1907
1908         * UIProcess/API/APIPageConfiguration.cpp:
1909         (API::PageConfiguration::sessionID):
1910
1911 2017-05-25  Brent Fulgham  <bfulgham@apple.com>
1912
1913         [WK2][iOS] Add a mach-lookup exception for 'com.apple.lsd.mapdb' to Network sandbox
1914         https://bugs.webkit.org/show_bug.cgi?id=172465
1915         <rdar://problem/32332836>
1916
1917         Reviewed by Alex Christensen.
1918
1919         Expand sandbox to allow lookup of the mapdb that contains UTI information used
1920         by the Network process.
1921
1922         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1923
1924 2017-05-25  Youenn Fablet  <youenn@apple.com>
1925
1926         com.apple.coremedia.videoencoder XPC service should be allowed by WebProcess sandbox
1927         https://bugs.webkit.org/show_bug.cgi?id=172599
1928
1929         Reviewed by Alex Christensen.
1930
1931         * WebProcess/com.apple.WebProcess.sb.in:
1932
1933 2017-05-25  Simon Fraser  <simon.fraser@apple.com>
1934
1935         [iOS WK2] Avoid setting contentsScale and rasterizationScale on CATransformLayers
1936         https://bugs.webkit.org/show_bug.cgi?id=172569
1937
1938         Reviewed by Dean Jackson.
1939
1940         Setting contentsScale and rasterizationScale on CATransformLayers is a waste of CPU time,
1941         and triggers unwanted logging, so don't do it.
1942
1943         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1944         (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
1945
1946 2017-05-25  Matt Lewis  <jlewis3@apple.com>
1947
1948         Unreviewed, rolling out r217409.
1949
1950         The revision caused api failures
1951
1952         Reverted changeset:
1953
1954         "_WKUserStyleSheet leaks string data"
1955         https://bugs.webkit.org/show_bug.cgi?id=172583
1956         http://trac.webkit.org/changeset/217409
1957
1958 2017-05-25  Joseph Pecoraro  <pecoraro@apple.com>
1959
1960         _WKUserStyleSheet leaks string data
1961         https://bugs.webkit.org/show_bug.cgi?id=172583
1962         <rdar://problem/32395209>
1963
1964         Reviewed by Dan Bernstein.
1965
1966         * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
1967         (-[_WKUserStyleSheet dealloc]):
1968
1969 2017-05-24  Joseph Pecoraro  <pecoraro@apple.com>
1970
1971         Increase the headerpad for WebKit XPC Services
1972         https://bugs.webkit.org/show_bug.cgi?id=172571
1973
1974         Reviewed by Dan Bernstein.
1975
1976         * Configurations/BaseXPCService.xcconfig:
1977         Increase the headerpad to make room for additional dyld commands.
1978
1979 2017-05-24  David Keijser  <keijser@gmail.com>
1980
1981         [GTK] Provide details on javascript exception
1982         https://bugs.webkit.org/show_bug.cgi?id=161187
1983
1984         Reviewed by Carlos Garcia Campos.
1985
1986         * UIProcess/API/gtk/WebKitWebView.cpp:
1987         (webkitWebViewRunJavaScriptCallback):
1988         (webkit_web_view_run_javascript):
1989         (resourcesStreamReadCallback):
1990
1991 2017-05-24  Ryan Haddad  <ryanhaddad@apple.com>
1992
1993         Unreviewed, suppress deprecation warnings to fix the build.
1994
1995         * Shared/mac/ColorSpaceData.mm:
1996         (WebKit::ColorSpaceData::decode):
1997
1998 2017-05-24  Wenson Hsieh  <wenson_hsieh@apple.com>
1999
2000         Plumb additional image metadata to item providers when beginning data interaction on an image
2001         https://bugs.webkit.org/show_bug.cgi?id=172536
2002         <rdar://problem/32371300>
2003
2004         Reviewed by Beth Dakin.
2005
2006         Boilerplate plumbing to send suggestedName over IPC.
2007
2008         * Shared/WebCoreArgumentCoders.cpp:
2009         (IPC::ArgumentCoder<PasteboardImage>::encode):
2010         (IPC::ArgumentCoder<PasteboardImage>::decode):
2011
2012 2017-05-24  Wenson Hsieh  <wenson_hsieh@apple.com>
2013
2014         [WK2] Remove workaround to disable zooming to the focus rect while performing a data interaction
2015         https://bugs.webkit.org/show_bug.cgi?id=172546
2016
2017         Reviewed by Beth Dakin.
2018
2019         Removes a now-unnecessary workaround to prevent scrolling when performing a data interaction operation in
2020         editable content.
2021
2022         * UIProcess/ios/WKContentViewInteraction.mm:
2023         (-[WKContentView _displayFormNodeInputView]):
2024
2025 2017-05-24  John Wilander  <wilander@apple.com>
2026
2027         Resource Load Statistics: Change grandfathering default to one hour
2028         https://bugs.webkit.org/show_bug.cgi?id=172524
2029         <rdar://problem/32360462>
2030
2031         Reviewed by Brent Fulgham.
2032
2033         * Shared/WebPreferencesDefinitions.h:
2034         * UIProcess/WebResourceLoadStatisticsManager.cpp:
2035         (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState):
2036
2037 2017-05-24  Jer Noble  <jer.noble@apple.com>
2038
2039         Rename DisplaySleepDisabler -> SleepDisabler
2040         https://bugs.webkit.org/show_bug.cgi?id=172478
2041
2042         Reviewed by Sam Weinig.
2043
2044         * UIProcess/mac/WKFullScreenWindowController.h:
2045         * UIProcess/mac/WKFullScreenWindowController.mm:
2046
2047 2017-05-23  John Wilander  <wilander@apple.com>
2048
2049         Resource Load Statistics: Don't include HSTS cache data in website data removal
2050         https://bugs.webkit.org/show_bug.cgi?id=172525
2051         <rdar://problem/32332704>
2052
2053         Reviewed by Brent Fulgham.
2054
2055         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2056         (WebKit::initializeDataTypesToRemove):
2057
2058 2017-05-15  Matt Rajca  <mrajca@apple.com>
2059
2060         Replace autoplay events that fire at navigation with a DidAutoplayMediaPastThreshold event.
2061         https://bugs.webkit.org/show_bug.cgi?id=172138
2062
2063         Reviewed by Alex Christensen.
2064
2065         Updated auto-play event types.
2066
2067         * Shared/WebCoreArgumentCoders.h:
2068         * UIProcess/API/C/WKPage.cpp:
2069         (WKPageSetPageUIClient):
2070         * UIProcess/API/C/WKPageUIClient.h:
2071
2072 2017-05-23  Chris Dumez  <cdumez@apple.com>
2073
2074         ASSERT(!m_timeoutTimer.isActive()) hit in BackgroundProcessResponsivenessTimer::responsivenessCheckTimerFired()
2075         https://bugs.webkit.org/show_bug.cgi?id=172509
2076         <rdar://problem/32251578>
2077
2078         Reviewed by Geoffrey Garen.
2079
2080         In the BackgroundProcessResponsivenessTimer class, we have 2 timers:
2081         - m_responsivenessCheckTimer that causes us to do an IPC handshake with
2082           the WebProcess.
2083         - m_timeoutTimer that is started when we send the IPC message to the
2084           WebProcess and which is stopped when we get the response from the
2085           WebProcess. If we do not get the response by the time m_timeoutTimer
2086           fires, then we mark the process as unresponsive.
2087
2088         As a result, of the behavior above, whenever the BackgroundProcessResponsivenessTimer
2089         is considered "active", there should be one of the 2 timers above that
2090         is active, and only one.
2091
2092         The assertion hit showed that we decided to start the m_responsivenessCheckTimer
2093         timer even though the m_timeoutTimer timer is still active (we are still waiting
2094         for an IPC message from the WebProcess and the process is not considered
2095         unresponsive yet), which is wrong. The reason was that in
2096         BackgroundProcessResponsivenessTimer::updateState(), if we should be active,
2097         we would start the m_responsivenessCheckTimer if m_responsivenessCheckTimer is
2098         not already active, without checking if m_timeoutTimer is active. So if
2099         updateState() was called while the IPC handshake was in process, we would have
2100         both timers running at the same time.
2101
2102         * UIProcess/BackgroundProcessResponsivenessTimer.cpp:
2103         (WebKit::BackgroundProcessResponsivenessTimer::updateState):
2104         (WebKit::BackgroundProcessResponsivenessTimer::isActive):
2105         * UIProcess/BackgroundProcessResponsivenessTimer.h:
2106
2107 2017-05-22  Simon Fraser  <simon.fraser@apple.com>
2108
2109         Snapshotting via -renderInContext: should do synchronous image decodes
2110         https://bugs.webkit.org/show_bug.cgi?id=172485
2111         rdar://problem/32276146
2112
2113         Reviewed by Tim Horton.
2114
2115         Pass the PaintBehaviorSnapshotting flag in functions that do snapshotting.
2116
2117         * Shared/mac/RemoteLayerBackingStore.mm:
2118         (WebKit::RemoteLayerBackingStore::drawInContext):
2119         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
2120         (WebKit::imageForRect):
2121         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
2122         (WebKit::InjectedBundleRangeHandle::renderedImage):
2123
2124 2017-05-23  Myles C. Maxfield  <mmaxfield@apple.com>
2125
2126         Remove dead ENABLE(FONT_LOAD_EVENTS) code
2127         https://bugs.webkit.org/show_bug.cgi?id=172517
2128
2129         Rubber-stamped by Simon Fraser.
2130
2131         * Configurations/FeatureDefines.xcconfig:
2132
2133 2017-05-23  Tim Horton  <timothy_horton@apple.com>
2134
2135         Zoom in/out is slow in Safari with large PDFs
2136         https://bugs.webkit.org/show_bug.cgi?id=172495
2137         <rdar://problem/32338631>
2138
2139         Reviewed by Simon Fraser.
2140
2141         No tests; just a performance improvement.
2142
2143         * WebProcess/Plugins/PDF/PDFPlugin.h:
2144         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2145         (WebKit::PDFPlugin::computePageBoxes):
2146         Use PDFKit instead of CGPDF to compute the first page box, so we can take
2147         advantage of PDFKit optimizations. PDFKit also handles box fallback,
2148         so we don't need to do that ourselves. Stop fetching all the boxes, as
2149         we only seem to use the first one.
2150
2151 2017-05-23  Tim Horton  <timothy_horton@apple.com>
2152
2153         REGRESSION: API test WebKit2.WKObject is failing
2154         https://bugs.webkit.org/show_bug.cgi?id=172497
2155         <rdar://problem/31694641>
2156
2157         Reviewed by Geoff Garen.
2158
2159         * Shared/Cocoa/WKNSString.mm:
2160         (-[WKNSString superclass]):
2161         (-[WKNSString class]):
2162         Pretend to be NSString instead of the more specific subclass (__NSCFString)
2163         that we actually are. There is code underneath us that assumes that if
2164         -class returns __NSCFString, that the object is a CFStringRef, which is
2165         not true in our case.
2166
2167 2017-05-23  Brent Fulgham  <bfulgham@apple.com>
2168
2169         [WK2][iOS] Add a mach-lookup exception for 'com.apple.analyticsd'
2170         https://bugs.webkit.org/show_bug.cgi?id=172462
2171         <rdar://problem/32331638>
2172
2173         Reviewed by Alexey Proskuryakov.
2174
2175         * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb:
2176         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2177         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2178
2179 2017-05-22  Brent Fulgham  <bfulgham@apple.com>
2180
2181         [WK2][iOS] Adopt a whitelist for XPC services
2182         https://bugs.webkit.org/show_bug.cgi?id=172182
2183         <rdar://problem/30669445>
2184
2185         Reviewed by Sam Weinig.
2186
2187         Tell the Sandbox to block all XPC connections that are not explicitly allowed by
2188         the sandbox profile. The default behavior is to allow everything by default.
2189
2190         If the restriction is set before including the standard iOS sandbox profiles, there
2191         does not seem to be a need to white list any other services. 
2192
2193         General web browsing on multiple devices indicate that these sandbox profiles work
2194         properly with media, accessibility, webgl, and general web content.
2195
2196         * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb:
2197         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2198         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2199
2200 2017-05-23  Emilio Cobos Álvarez  <ecobos@igalia.com>
2201
2202         Add a RuntimeEnabledFeature for display: contents, defaulted to false.
2203         https://bugs.webkit.org/show_bug.cgi?id=171984
2204
2205         Reviewed by Antti Koivisto.
2206
2207         * Shared/WebPreferencesDefinitions.h:
2208         * UIProcess/API/C/WKPreferences.cpp:
2209         (WKPreferencesSetDisplayContentsEnabled):
2210         (WKPreferencesGetDisplayContentsEnabled):
2211         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2212         * WebProcess/WebPage/WebPage.cpp:
2213         (WebKit::WebPage::updatePreferences):
2214
2215 2017-05-20  Alex Christensen  <achristensen@webkit.org>
2216
2217         REGRESSION(r215686): O(n^2) algorithm in CachedRawResource::addDataBuffer
2218         https://bugs.webkit.org/show_bug.cgi?id=172406
2219         <rdar://32109532>
2220
2221         Reviewed by Brady Eidson.
2222
2223         * Platform/IPC/DataReference.cpp:
2224         (IPC::SharedBufferDataReference::encode):
2225         * WebProcess/Plugins/PluginView.cpp:
2226         (WebKit::PluginView::redeliverManualStream):
2227
2228 2017-05-22  Yongjun Zhang  <yongjun_zhang@apple.com>
2229
2230         Need a way to allow WKWebView to load request with ShouldOpenExternalURLsPolicy::ShouldAllow.
2231         https://bugs.webkit.org/show_bug.cgi?id=172460
2232
2233         Add an new method [WKWebView _loadRequest:shouldOpenExternalURLs:] to WKWebView; a WebKit client
2234         can use this to load request that allows opening external URLs.
2235
2236         Reviewed by Tim Horton.
2237
2238         * UIProcess/API/Cocoa/WKWebView.mm:
2239         (-[WKWebView _loadRequest:shouldOpenExternalURLs:]): When calling WebPageProxy::loadRequest, also
2240             set ShouldOpenExternalURLsPolicy based on the value of shouldOpenExternalURLs.
2241         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add [WKWebView _loadRequest:shouldOpenExternalURLs:].
2242
2243 2017-05-22  Youenn Fablet  <youenn@apple.com>
2244
2245         Remove AVAudioCaptureSource
2246         https://bugs.webkit.org/show_bug.cgi?id=172360
2247
2248         Reviewed by Sam Weinig.
2249
2250         Removing the handling of AVAudio/CoreAudio capture source dynamic switch.
2251
2252         * Shared/WebPreferencesDefinitions.h:
2253         * UIProcess/API/C/WKPreferences.cpp:
2254         (WKPreferencesSetUseAVFoundationAudioCapture): Deleted.
2255         (WKPreferencesGetUseAVFoundationAudioCapture): Deleted.
2256         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2257         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2258         (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs):
2259         * WebProcess/WebPage/WebPage.cpp:
2260         (WebKit::WebPage::updatePreferences):
2261
2262 2017-05-22  Brian Burg  <bburg@apple.com>
2263
2264         Web Automation: characters produced with shift modifier on QWERTY keyboard should be delivered as shift-down, char-down, char-up, shift-up events
2265         https://bugs.webkit.org/show_bug.cgi?id=172299
2266         <rdar://problem/32277988>
2267
2268         Reviewed by Joseph Pecoraro.
2269
2270         WebDriver tests expect some ASCII characters to be produced using the shift key,
2271         regardless of the actual keyboard layout. Emit extra events when simulating these
2272         keystrokes if the shift key is not already pressed.
2273
2274         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
2275         (WebKit::characterIsProducedUsingShift):
2276         (WebKit::WebAutomationSession::platformSimulateKeySequence):
2277
2278 2017-05-22  Sam Weinig  <sam@webkit.org>
2279
2280         [WebIDL] Support callbacks with arbitrary return types
2281         https://bugs.webkit.org/show_bug.cgi?id=172407
2282
2283         Reviewed by Chris Dumez.
2284
2285         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectNodeFilterCondition.cpp:
2286         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectNodeFilterCondition.h:
2287         Update to match new interface of NodeFilterCondition.
2288
2289         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp:
2290         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp:
2291         Update to account for new WebCore implementation return types.
2292
2293 2017-05-22  Michael Catanzaro  <mcatanzaro@igalia.com>
2294
2295         -Wreturn-type warning triggered by WKPage.cpp:2277
2296         https://bugs.webkit.org/show_bug.cgi?id=171866
2297
2298         Reviewed by Žan Doberšek.
2299
2300         * UIProcess/API/C/WKPage.cpp:
2301         (WKPageSetPageUIClient):
2302
2303 2017-05-22  Michael Catanzaro  <mcatanzaro@igalia.com>
2304
2305         -Wreturn-type warning triggered by WebAutomationSession.cpp:851
2306         https://bugs.webkit.org/show_bug.cgi?id=171867
2307
2308         Reviewed by Žan Doberšek.
2309
2310         * UIProcess/Automation/WebAutomationSession.cpp:
2311         (WebKit::protocolModifierToWebEventModifier):
2312
2313 2017-05-22  Wenson Hsieh  <wenson_hsieh@apple.com>
2314
2315         Remove unused documentIsHandlingNonDefaultDrag plumbing for WebKit2
2316         https://bugs.webkit.org/show_bug.cgi?id=172453
2317
2318         Reviewed by Tim Horton.
2319
2320         Removes unused plumbing that was originally added to support file uploads.
2321
2322         * UIProcess/WebPageProxy.cpp:
2323         (WebKit::WebPageProxy::didPerformDragControllerAction):
2324         (WebKit::WebPageProxy::resetCurrentDragInformation):
2325         * UIProcess/WebPageProxy.h:
2326         (WebKit::WebPageProxy::currentDragCaretRect):
2327         (WebKit::WebPageProxy::documentIsHandlingNonDefaultDrag): Deleted.
2328         * UIProcess/WebPageProxy.messages.in:
2329         * WebProcess/WebPage/WebPage.cpp:
2330         (WebKit::WebPage::performDragControllerAction):
2331
2332 2017-05-22  Michael Catanzaro  <mcatanzaro@igalia.com>
2333
2334         Add even more input validation in Connection::processMessage()
2335         https://bugs.webkit.org/show_bug.cgi?id=171682
2336
2337         Reviewed by Carlos Garcia Campos.
2338
2339         Verify that the size of the out-of-line message body matches the size of the AttachmentInfo
2340         that is containing it.
2341
2342         * Platform/IPC/unix/ConnectionUnix.cpp:
2343         (IPC::Connection::processMessage):
2344
2345 2017-05-22  Tomas Popela  <tpopela@redhat.com>
2346
2347         Remove some of the EFL port leftovers
2348         https://bugs.webkit.org/show_bug.cgi?id=172440
2349
2350         Reviewed by Carlos Garcia Campos.
2351
2352         * Scripts/generate-forwarding-headers.pl:
2353
2354 2017-05-22  Gwang Yoon Hwang  <yoon@igalia.com>
2355
2356         [CoordinatedGraphics] Clear UpdateAtlases for each tests
2357         https://bugs.webkit.org/show_bug.cgi?id=172119
2358
2359         Reviewed by Carlos Garcia Campos.
2360
2361         In Coordinated Graphics, we reuses at least one update atlas to
2362         render root compositing layer for several tests. So if one of the
2363         test cases breaks the internal states of Cairo's states, other
2364         followed test cases runs on same instance of WebKitTestRunner will
2365         be effected by broken states of Cairo. Because it increases test
2366         flaknesses, we should drop update atlases after each tests.
2367
2368         * WebProcess/WebCoreSupport/WebChromeClient.cpp: Remove a redundant
2369         include statement for Coordinated graphics
2370         (WebKit::WebChromeClient::resetUpdateAtlasForTesting): Added.
2371         * WebProcess/WebCoreSupport/WebChromeClient.h:
2372         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2373         (WebKit::AcceleratedDrawingArea::resetUpdateAtlasForTesting): Added.
2374         * WebProcess/WebPage/AcceleratedDrawingArea.h:
2375         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2376         (WebKit::CompositingCoordinator::clearUpdateAtlases): Added.
2377         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
2378         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2379         (WebKit::CoordinatedLayerTreeHost::clearUpdateAtlases): Added.
2380         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
2381         * WebProcess/WebPage/DrawingArea.h:
2382         * WebProcess/WebPage/LayerTreeHost.h:
2383         * WebProcess/WebPage/wpe/DrawingAreaWPE.cpp:
2384         (WebKit::DrawingAreaWPE::resetUpdateAtlasForTesting):
2385         * WebProcess/WebPage/wpe/DrawingAreaWPE.h:
2386
2387 2017-05-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2388
2389         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.3 release.
2390
2391         * gtk/NEWS: Add release notes for 2.17.3.
2392
2393 2017-05-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2394
2395         [GTK] Add webkit_context_menu_item_new_from_gaction
2396         https://bugs.webkit.org/show_bug.cgi?id=159631
2397
2398         Reviewed by Michael Catanzaro.
2399
2400         Add new API to create a WebKitContextMenuItem from a GAction and also to get the associated GAction.
2401
2402         * Shared/gtk/WebContextMenuItemGtk.cpp:
2403         (WebKit::WebContextMenuItemGtk::WebContextMenuItemGtk): Add constructor that receives a GAction.
2404         (WebKit::isGActionChecked): Helper to check if a stateful GAction is checked or not.
2405         (WebKit::WebContextMenuItemGtk::createActionIfNeeded): When creating a GAction from a GtkAtion, use the
2406         GtkAction name instead of adding a new one. Do not create the GAction if we already have one.
2407         * Shared/gtk/WebContextMenuItemGtk.h:
2408         (WebKit::WebContextMenuItemGtk::gAction):
2409         (WebKit::WebContextMenuItemGtk::gActionTarget):
2410         * UIProcess/API/gtk/WebKitContextMenuItem.cpp:
2411         (webkit_context_menu_item_new_from_gaction):
2412         (webkit_context_menu_item_get_gaction):
2413         * UIProcess/API/gtk/WebKitContextMenuItem.h:
2414         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
2415         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
2416         (WebKit::contextMenuItemActivatedCallback): Update the state of the internal GAction in case of toggle menu items.
2417         (WebKit::WebContextMenuProxyGtk::append): Pass the GAction target to g_menu_item_set_action_and_target_value. Do
2418         not connect to activate signal of actions provided by the user.
2419
2420 2017-05-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2421
2422         Add more input validation in Connection::readBytesFromSocket()
2423         https://bugs.webkit.org/show_bug.cgi?id=171871
2424
2425         Reviewed by Michael Catanzaro.
2426
2427         Check the control message length is in the limits. Credit to Nathan Crandall for reporting this issue and
2428         submitting an equivalent fix.
2429
2430         * Platform/IPC/unix/ConnectionUnix.cpp:
2431         (IPC::readBytesFromSocket):
2432
2433 2017-05-20  Michael Catanzaro  <mcatanzaro@igalia.com>
2434
2435         -Wreturn-type warning triggered by WKNotification.cpp:77
2436         https://bugs.webkit.org/show_bug.cgi?id=172414
2437
2438         Reviewed by Sam Weinig.
2439
2440         * UIProcess/API/C/WKNotification.cpp:
2441         (WKNotificationCopyDir):
2442
2443 2017-05-19  John Wilander  <wilander@apple.com>
2444
2445         Resource Load Statistics: Use WebProcessPool::allProcessPools() when sending message to network process about partitioning
2446         https://bugs.webkit.org/show_bug.cgi?id=172370
2447         <rdar://problem/32288012>
2448
2449         Reviewed by Alex Christensen.
2450
2451         The existing test case
2452         http/tests/loading/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction.html
2453         is currently failing and should start passing again with this patch.
2454
2455         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2456         (WebKit::WebsiteDataStore::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
2457
2458 2017-05-19  Chris Dumez  <cdumez@apple.com>
2459
2460         [WK2] Notify client when a process exceeds background CPU limit while in the foreground
2461         https://bugs.webkit.org/show_bug.cgi?id=172246
2462         <rdar://problem/32235411>
2463
2464         Reviewed by Geoffrey Garen.
2465
2466         When there is a background CPU limit set by the client, we now monitor the CPU
2467         usages of all WebContent processes, not just the non-visible ones. This way, we
2468         are now able to notify the client a process has exceeded the background CPU
2469         limit while in the foreground, via the UIClient's didExceedBackgroundResourceLimitWhileInForeground
2470         function, passing kWKResourceLimitCPU.
2471
2472         * Shared/WebPageCreationParameters.cpp:
2473         (WebKit::WebPageCreationParameters::encode):
2474         (WebKit::WebPageCreationParameters::decode):
2475         * Shared/WebPageCreationParameters.h:
2476         * UIProcess/API/APIPageConfiguration.cpp:
2477         (API::PageConfiguration::copy):
2478         * UIProcess/API/APIPageConfiguration.h:
2479         (API::PageConfiguration::cpuLimit):
2480         (API::PageConfiguration::setCPULimit):
2481         * UIProcess/API/C/WKPageConfigurationRef.cpp:
2482         (WKPageConfigurationSetBackgroundCPULimit):
2483         * UIProcess/WebPageProxy.cpp:
2484         (WebKit::WebPageProxy::updateThrottleState):
2485         (WebKit::WebPageProxy::creationParameters):
2486         (WebKit::WebPageProxy::didExceedInactiveMemoryLimitWhileActive):
2487         (WebKit::WebPageProxy::didExceedBackgroundCPULimitWhileInForeground):
2488         * UIProcess/WebPageProxy.h:
2489         * UIProcess/WebProcessProxy.cpp:
2490         (WebKit::WebProcessProxy::didExceedCPULimit):
2491         * UIProcess/WebProcessProxy.h:
2492         * UIProcess/WebProcessProxy.messages.in:
2493         * WebProcess/WebPage/WebPage.cpp:
2494         (WebKit::m_cpuLimit):
2495         * WebProcess/WebPage/WebPage.h:
2496         (WebKit::WebPage::cpuLimit):
2497         * WebProcess/WebProcess.cpp:
2498         (WebKit::WebProcess::createWebPage):
2499         (WebKit::WebProcess::removeWebPage):
2500         (WebKit::WebProcess::updateCPULimit):
2501         (WebKit::WebProcess::updateCPUMonitorState):
2502         (WebKit::WebProcess::pageActivityStateDidChange):
2503         * WebProcess/WebProcess.h:
2504         * WebProcess/cocoa/WebProcessCocoa.mm:
2505         (WebKit::WebProcess::updateCPULimit):
2506         (WebKit::WebProcess::updateCPUMonitorState):
2507
2508 2017-05-19  Jeremy Jones  <jeremyj@apple.com>
2509
2510         Remove defunct WebVideoFullscreenInterface
2511         https://bugs.webkit.org/show_bug.cgi?id=172254
2512
2513         Reviewed by Jon Lee.
2514
2515         Remove reference to WebVideoFullscreenInterface. It has long since been replaced by
2516         WebVideoFullscreenModelClient.
2517
2518         * WebProcess/cocoa/WebVideoFullscreenManager.h:
2519
2520 2017-05-19  Jeremy Jones  <jeremyj@apple.com>
2521
2522         [WebRTC] Remove PiP support for video elements that are showing camera capture
2523         https://bugs.webkit.org/show_bug.cgi?id=172336
2524
2525         Reviewed by Eric Carlson.
2526
2527         Ask video element if it supports picture-in-picture instead of asking the mediaSession directly.
2528         This allows the video element to give a more robust answer.
2529
2530         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
2531         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
2532
2533 2017-05-19  Chris Dumez  <cdumez@apple.com>
2534
2535         Make sure implementation of InitializeWebKit2() always run on the main thread
2536         https://bugs.webkit.org/show_bug.cgi?id=172362
2537         <rdar://problem/32295678>
2538
2539         Reviewed by Geoffrey Garen.
2540
2541         Add logic in InitializeWebKit2() for Cocoa ports to always run the initialization code
2542         is only called once, and on the main thread. If we are called from a non-main thread,
2543         we will dispatch synchronously to the main thread to run the initialization code.
2544
2545         This is needed because WebKit2Initialize() is called from the API::Object constructor.
2546         API::Object is thread-safe RefCounted and those objects are sometimes initialized on
2547         non-main thread. If the first of such objects happened to be initialized on a non-main
2548         thread, then we would run the initialization code for the first time on a non-main
2549         thread. This would lead to hard to debug issues because code such as
2550         RunLoop::initializeMainRunLoop() is only safe to call on the main thread because it
2551         stores a pointer to the current thread's RunLoop in a static variable for later use
2552         (i.e. for RunLoop::main()).
2553
2554         * Shared/Cocoa/WebKit2InitializeCocoa.mm: Copied from Source/WebKit2/Shared/WebKit2Initialize.cpp.
2555         (WebKit::runInitializationCode):
2556         (WebKit::InitializeWebKit2):
2557         * Shared/WebKit2Initialize.cpp:
2558         (WebKit::InitializeWebKit2):
2559         * WebKit2.xcodeproj/project.pbxproj:
2560
2561 2017-05-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2562
2563         REGRESSION(r216977): [GTK] Ephemeral sessions broken after r216977
2564         https://bugs.webkit.org/show_bug.cgi?id=172345
2565
2566         Reviewed by Michael Catanzaro.
2567
2568         Since r216977, WebProcessPool sends the page session ID to the web process, but the WebsiteDataStoreParameters
2569         session ID to the network process. WebsiteDataStoreParameters is only implemented for Cocoa, so we are sending 0
2570         session ID to the network process, while using the right session ID everywhere else.
2571
2572         * UIProcess/WebProcessPool.cpp:
2573         (WebKit::WebProcessPool::pageAddedToProcess): Add an ASSERT to ensure we are sending the same session ID to Web
2574         and Network processes.
2575         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2576         (WebKit::WebsiteDataStore::parameters): Add minimal implementation for non-Cocoa ports to at least set the
2577         session ID.
2578
2579 2017-05-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2580
2581         Add more input validation in Connection::processMessage()
2582         https://bugs.webkit.org/show_bug.cgi?id=171682
2583
2584         Reviewed by Michael Catanzaro.
2585
2586         Check limits of attachments and message size. Credit to Nathan Crandall for reporting this issue and submitting
2587         an equivalent fix.
2588
2589         * Platform/IPC/unix/ConnectionUnix.cpp:
2590         (IPC::Connection::processMessage):
2591
2592 2017-05-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2593
2594         [Threaded Compositor] Remove platform ifdefs from threaded compositor implementation
2595         https://bugs.webkit.org/show_bug.cgi?id=172265
2596
2597         Reviewed by Žan Doberšek.
2598
2599         Add AcceleratedSurfaceWPE implementation that is equivalent to the PlatformDisplayWPE::EGLTarget. Since WPE needs the
2600         surface to be initialized/finalized in the compositing thread, two new virtual methods has been added to
2601         AcceleratedSurface initialize/finalize that are only implemented by WPE. The threaded compositor no longer
2602         receives a native surface handle as contructor parameter, it now asks the client for it from the compositing
2603         thread, right after it's created.
2604
2605         * PlatformWPE.cmake:
2606         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2607         (WebKit::ThreadedCompositor::create): Remove ativeSurfaceHandle parameter.
2608         (WebKit::ThreadedCompositor::ThreadedCompositor): Initialize m_nativeSurfaceHandle from the compositing thread
2609         asking the client for it.
2610         (WebKit::ThreadedCompositor::createGLContext): Remove the WPE implementation.
2611         (WebKit::ThreadedCompositor::invalidate): Notify the client that the GL context has been destroyed.
2612         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): Remove GTK ifdefs.
2613         (WebKit::ThreadedCompositor::setViewportSize): Remove WPE implementation.
2614         (WebKit::ThreadedCompositor::renderLayerTree): Notify the client the frame will be rendered, and when it has
2615         been rendered.
2616         (WebKit::ThreadedCompositor::frameComplete): Remove WPE ifdefs.
2617         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
2618         * WebProcess/WebPage/AcceleratedSurface.cpp:
2619         (WebKit::AcceleratedSurface::create): Add client parameter.
2620         (WebKit::AcceleratedSurface::AcceleratedSurface): Create a AcceleratedSurfaceWPE if display is WPE.
2621         * WebProcess/WebPage/AcceleratedSurface.h:
2622         (WebKit::AcceleratedSurface::surfaceID):
2623         (WebKit::AcceleratedSurface::initialize):
2624         (WebKit::AcceleratedSurface::finalize):
2625         (WebKit::AcceleratedSurface::willRenderFrame):
2626         (WebKit::AcceleratedSurface::didRenderFrame):
2627         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
2628         (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): Pass this as client of AcceleratedSurface.
2629         (WebKit::ThreadedCoordinatedLayerTreeHost::frameComplete): Notify the compositor.
2630         (WebKit::ThreadedCoordinatedLayerTreeHost::nativeSurfaceHandleForCompositing): Initialize the surface and return
2631         the window handler.
2632         (WebKit::ThreadedCoordinatedLayerTreeHost::didDestroyGLContext): Finalize the surface.
2633         (WebKit::ThreadedCoordinatedLayerTreeHost::willRenderFrame): Notify the surface.
2634         (WebKit::ThreadedCoordinatedLayerTreeHost::didRenderFrame): Ditto.
2635         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
2636         * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.cpp:
2637         (WebKit::AcceleratedSurfaceWayland::create): Add client parameter.
2638         (WebKit::AcceleratedSurfaceWayland::AcceleratedSurfaceWayland): Ditto.
2639         (WebKit::AcceleratedSurfaceWayland::didRenderFrame): Call Client::frameComplete().
2640         * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.h:
2641         * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp:
2642         (WebKit::AcceleratedSurfaceX11::create): Add client parameter.
2643         (WebKit::AcceleratedSurfaceX11::AcceleratedSurfaceX11): Ditto.
2644         (WebKit::AcceleratedSurfaceX11::didRenderFrame): Call Client::frameComplete().
2645         * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h:
2646         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp: Added.
2647         (WebKit::AcceleratedSurfaceWPE::create):
2648         (WebKit::AcceleratedSurfaceWPE::AcceleratedSurfaceWPE):
2649         (WebKit::AcceleratedSurfaceWPE::~AcceleratedSurfaceWPE):
2650         (WebKit::AcceleratedSurfaceWPE::initialize):
2651         (WebKit::AcceleratedSurfaceWPE::finalize):
2652         (WebKit::AcceleratedSurfaceWPE::window):
2653         (WebKit::AcceleratedSurfaceWPE::surfaceID):
2654         (WebKit::AcceleratedSurfaceWPE::resize):
2655         (WebKit::AcceleratedSurfaceWPE::willRenderFrame):
2656         (WebKit::AcceleratedSurfaceWPE::didRenderFrame):
2657         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.h: Copied from Source/WebKit2/WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h.
2658
2659 2017-05-19  Yusuke Suzuki  <utatane.tea@gmail.com>
2660
2661         [JSC][DFG][DOMJIT] Extend CheckDOM to CheckSubClass
2662         https://bugs.webkit.org/show_bug.cgi?id=172098
2663
2664         Reviewed by Saam Barati.
2665
2666         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
2667         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
2668
2669 2017-05-18  Andreas Kling  <akling@apple.com>
2670
2671         [WK2] Notify WebPageProxy client when an active process goes over the inactive memory limit
2672         https://bugs.webkit.org/show_bug.cgi?id=172244
2673         <rdar://problem/31800943>
2674
2675         Reviewed by Geoffrey Garen.
2676
2677         Add a WKPageUIClient callback that is invoked when an active process exceeds the inactive memory limit.
2678
2679         With the current state of the implementation, this means that a UI client can learn that backgrounding
2680         a non-audible, non-capturing tab may cause it to get killed once the active/inactive hysteresis time
2681         is over (8 minutes.)
2682
2683         The callback can be invoked multiple times if we exceed the limit, and then go under, and exceed again.
2684
2685         This is the callback:
2686
2687             didExceedBackgroundResourceLimitWhileInForeground(WKPageRef, WKResourceLimit)
2688
2689         Where WKResourceLimit is one of { kWKResourceLimitMemory, kWKResourceLimitCPU }
2690         The CPU enum value is a placeholder pending implementation soon.
2691
2692         * UIProcess/API/APIUIClient.h:
2693         (API::UIClient::didExceedBackgroundResourceLimitWhileInForeground):
2694         * UIProcess/API/C/WKPage.cpp:
2695         (WKPageSetPageUIClient):
2696         * UIProcess/API/C/WKPageUIClient.h:
2697         * UIProcess/WebPageProxy.cpp:
2698         (WebKit::WebPageProxy::didExceedInactiveMemoryLimitWhileActive):
2699         * UIProcess/WebPageProxy.h:
2700         * UIProcess/WebProcessProxy.cpp:
2701         (WebKit::WebProcessProxy::didExceedInactiveMemoryLimitWhileActive):
2702         * UIProcess/WebProcessProxy.h:
2703         * UIProcess/WebProcessProxy.messages.in:
2704         * WebProcess/WebProcess.cpp:
2705         (WebKit::WebProcess::initializeWebProcess):
2706
2707 2017-05-18  Eric Carlson  <eric.carlson@apple.com>
2708
2709         [MediaStream] do not cache gUM permissions
2710         https://bugs.webkit.org/show_bug.cgi?id=172245
2711
2712         Reviewed by Youenn Fablet.
2713
2714         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2715         (WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests):
2716         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest):
2717         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
2718         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
2719         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2720         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
2721         (WebKit::FrameAuthorizationState::FrameAuthorizationState): Deleted.
2722         (WebKit::FrameAuthorizationState::hasPermissionToUseCaptureDevice): Deleted.
2723         (WebKit::FrameAuthorizationState::setHasPermissionToUseCaptureDevice): Deleted.
2724         (WebKit::FrameAuthorizationState::ensureSecurityOriginsAreEqual): Deleted.
2725         (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest): Deleted.
2726         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2727         (WebKit::FrameAuthorizationState::setDeviceIdentifierHashSalt): Deleted.
2728         (WebKit::FrameAuthorizationState::deviceIdentifierHashSalt): Deleted.
2729         * UIProcess/UserMediaPermissionRequestProxy.cpp:
2730         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
2731         * UIProcess/UserMediaPermissionRequestProxy.h:
2732         (WebKit::UserMediaPermissionRequestProxy::create):
2733         (WebKit::UserMediaPermissionRequestProxy::deviceIdentifierHashSalt):
2734
2735 2017-05-18  Tim Horton  <timothy_horton@apple.com>
2736
2737         Data interaction conclusion snapshot has too much margin
2738         https://bugs.webkit.org/show_bug.cgi?id=172323
2739         <rdar://problem/32283772>
2740
2741         Reviewed by Beth Dakin.
2742
2743         * WebProcess/WebPage/ios/WebPageIOS.mm:
2744         (WebKit::WebPage::didConcludeEditDataInteraction):
2745         Disable the default TextIndicator margin.
2746
2747 2017-05-18  Andy Estes  <aestes@apple.com>
2748
2749         ENABLE(APPLE_PAY_DELEGATE) should be NO on macOS Sierra and earlier
2750         https://bugs.webkit.org/show_bug.cgi?id=172305
2751
2752         Reviewed by Anders Carlsson.
2753
2754         * Configurations/FeatureDefines.xcconfig:
2755
2756 2017-05-18  John Wilander  <wilander@apple.com>
2757
2758         Resource Load Statistics: Grandfather domains for existing data records
2759         https://bugs.webkit.org/show_bug.cgi?id=172155
2760         <rdar://problem/24913532>
2761
2762         Reviewed by Alex Christensen.
2763
2764         When WebResourceLoadStatisticsStore starts fresh it needs
2765         to scan existing website data records and 'grandfather' them to
2766         allow ample time to capture user interaction.
2767
2768         * Shared/WebPreferencesDefinitions.h:
2769         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
2770         (WKResourceLoadStatisticsManagerSetGrandfathered):
2771         (WKResourceLoadStatisticsManagerIsGrandfathered):
2772         (WKResourceLoadStatisticsManagerSetMinimumTimeBetweeenDataRecordsRemoval):
2773         (WKResourceLoadStatisticsManagerSetGrandfatheringTime):
2774             Functions for testing and configuration.
2775         * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
2776         * UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm:
2777         (WebKit::WebResourceLoadStatisticsManager::registerUserDefaultsIfNeeded):
2778             Added grandfathering configuration.
2779         * UIProcess/WebProcessProxy.cpp:
2780         (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebiteData):
2781             New function to get all top privately controlled domains that
2782             have website data.
2783         * UIProcess/WebProcessProxy.h:
2784         * UIProcess/WebResourceLoadStatisticsManager.cpp:
2785         (WebKit::WebResourceLoadStatisticsManager::setGrandfathered):
2786         (WebKit::WebResourceLoadStatisticsManager::isGrandfathered):
2787         (WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval):
2788         (WebKit::WebResourceLoadStatisticsManager::setGrandfatheringTime):
2789         (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState):
2790             Functions for testing and configuration.
2791             WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval() changed
2792             as a result of WebResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval()
2793             moving to WebCore::ResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval().
2794         * UIProcess/WebResourceLoadStatisticsManager.h:
2795         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2796         (WebKit::initializeDataTypesToRemove):
2797         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
2798             Moved handling of pending removal into WebCore::ResourceLoadStatisticsStore since
2799             that's where grandfathering happens.
2800         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
2801             Moved registration of write persistent store callback and reading of Cocoa defaults to
2802             WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver without parameters
2803             so they are called for platforms without CFNETWORK_STORAGE_PARTITIONING.
2804             Now includes registering WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData()
2805             as handler for grandfathering since it involves reading of the website data store.
2806         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
2807         (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
2808         (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval): Deleted.
2809             Now happens in WebCore::ResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval().
2810         * UIProcess/WebResourceLoadStatisticsStore.h:
2811         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
2812         (WebKit::WebsiteDataRecord::topPrivatelyControlledDomain):
2813             New function to ask a WebsiteDataRecord for its top privately controlled domain.
2814         * UIProcess/WebsiteData/WebsiteDataRecord.h:
2815         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2816         (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData):
2817             New function to get all top privately controlled domains that
2818             have website data.
2819         * UIProcess/WebsiteData/WebsiteDataStore.h:
2820
2821 2017-05-18  Andy Estes  <aestes@apple.com>
2822
2823         Add "countryCode" to ApplePayErrorContactField
2824         https://bugs.webkit.org/show_bug.cgi?id=172264
2825         <rdar://problem/32004909>
2826
2827         Reviewed by Anders Carlsson.
2828
2829         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2830         (WebKit::toNSError):
2831
2832 2017-05-18  Commit Queue  <commit-queue@webkit.org>
2833
2834         Unreviewed, rolling out r217031, r217032, and r217037.
2835         https://bugs.webkit.org/show_bug.cgi?id=172293
2836
2837         cause linking errors in Windows (Requested by yusukesuzuki on
2838         #webkit).
2839
2840         Reverted changesets:
2841
2842         "[JSC][DFG][DOMJIT] Extend CheckDOM to CheckSubClass"
2843         https://bugs.webkit.org/show_bug.cgi?id=172098
2844         http://trac.webkit.org/changeset/217031
2845
2846         "Unreviewed, rebaseline for newly added ClassInfo"
2847         https://bugs.webkit.org/show_bug.cgi?id=172098
2848         http://trac.webkit.org/changeset/217032
2849
2850         "Unreviewed, fix debug and non-JIT build"
2851         https://bugs.webkit.org/show_bug.cgi?id=172098
2852         http://trac.webkit.org/changeset/217037
2853
2854 2017-05-18  Claudio Saavedra  <csaavedra@igalia.com>
2855
2856         [WPE] Unreviewed build fix
2857
2858         Add missing header after r217041.
2859         * UIProcess/API/wpe/WPEView.cpp:
2860
2861 2017-05-18  Tim Horton  <timothy_horton@apple.com>
2862
2863         More WebKit2 header cleanup
2864         https://bugs.webkit.org/show_bug.cgi?id=172214
2865
2866         Reviewed by Simon Fraser.
2867
2868         * Shared/WebFindOptions.h:
2869         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
2870         * UIProcess/Cocoa/WebViewImpl.mm:
2871         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2872         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2873         * UIProcess/UserMediaPermissionRequestProxy.h:
2874         * UIProcess/WebPageProxy.cpp:
2875         (WebKit::WebPageProxy::setCompositionAsync):
2876         * UIProcess/WebPageProxy.h:
2877         * UIProcess/mac/PageClientImpl.mm:
2878         * UIProcess/mac/ViewGestureControllerMac.mm:
2879         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
2880         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2881         * WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h:
2882         * WebProcess/InjectedBundle/API/c/WKBundlePageFullScreenClient.h:
2883         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h:
2884         * WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.h:
2885         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
2886         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.h:
2887         * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h:
2888         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2889         * WebProcess/Notifications/WebNotificationManager.cpp:
2890         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2891         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2892         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
2893         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2894         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2895         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
2896         * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp:
2897         * WebProcess/WebCoreSupport/WebValidationMessageClient.cpp:
2898         * WebProcess/WebPage/WebPage.cpp:
2899         (WebKit::WebPage::WebPage):
2900         (WebKit::WebPage::setDeviceScaleFactor):
2901         (WebKit::WebPage::centerSelectionInVisibleArea):
2902         (WebKit::WebPage::findString):
2903         (WebKit::WebPage::findStringMatches):
2904         (WebKit::WebPage::getImageForFindMatch):
2905         (WebKit::WebPage::selectFindMatch):
2906         (WebKit::WebPage::hideFindUI):
2907         (WebKit::WebPage::countStringMatches):
2908         (WebKit::WebPage::didReceiveGeolocationPermissionDecision):
2909         (WebKit::WebPage::mainFrameDidLayout):
2910         (WebKit::WebPage::setCompositionAsync):
2911         * WebProcess/WebPage/WebPage.h:
2912         (WebKit::WebPage::findController):
2913         (WebKit::WebPage::geolocationPermissionRequestManager):
2914         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
2915         Many small changes added up to a few percent. Removing UserMediaRequest
2916         from UserMediaPermissionRequestProxy, which is included into WebPageProxy.h,
2917         was worth another ~10% because it got VM.h out of WebPageProxy.h (like the
2918         previous patch did with WebPage.h). In total, in my measurement (WebKit2
2919         clean debug build) this is a ~15% speedup.
2920
2921         We really should figure out how to make DOMPromise.h not bring in all of
2922         JavaScriptCore (or how to use promises without including DOMPromise.h in headers).
2923
2924 2017-05-17  Chris Dumez  <cdumez@apple.com>
2925
2926         Fix unsafe lambda capture in ContentRuleListStore::lookupContentRuleList()
2927         https://bugs.webkit.org/show_bug.cgi?id=172258
2928
2929         Reviewed by Brady Eidson.
2930
2931         Fix unsafe lambda capture in ContentRuleListStore::lookupContentRuleList(). The String
2932         was moved instead of calling isolatedCopy(), even though we're passing the String to
2933         another thread.
2934
2935         * UIProcess/API/APIContentRuleListStore.cpp:
2936         (API::ContentRuleListStore::lookupContentRuleList):
2937
2938 2017-05-16  Yusuke Suzuki  <utatane.tea@gmail.com>
2939
2940         [JSC][DFG][DOMJIT] Extend CheckDOM to CheckSubClass
2941         https://bugs.webkit.org/show_bug.cgi?id=172098
2942
2943         Reviewed by Saam Barati.
2944
2945         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
2946         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
2947
2948 2017-05-17  Ryan Haddad  <ryanhaddad@apple.com>
2949
2950         Unreviewed, rolling out r217014.
2951
2952         This change caused mac-wk2 LayoutTests to exit early due to
2953         crashes.
2954
2955         Reverted changeset:
2956
2957         "Resource Load Statistics: Grandfather domains for existing
2958         data records"
2959         https://bugs.webkit.org/show_bug.cgi?id=172155
2960         http://trac.webkit.org/changeset/217014
2961
2962 2017-05-17  John Wilander  <wilander@apple.com>
2963
2964         Resource Load Statistics: Grandfather domains for existing data records
2965         https://bugs.webkit.org/show_bug.cgi?id=172155
2966         <rdar://problem/24913532>
2967
2968         Reviewed by Alex Christensen.
2969
2970         When WebResourceLoadStatisticsStore starts fresh it needs
2971         to scan existing website data records and 'grandfather' them to
2972         allow ample time to capture user interaction.
2973
2974         * Shared/WebPreferencesDefinitions.h:
2975         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
2976         (WKResourceLoadStatisticsManagerSetGrandfathered):
2977         (WKResourceLoadStatisticsManagerIsGrandfathered):
2978         (WKResourceLoadStatisticsManagerSetMinimumTimeBetweeenDataRecordsRemoval):
2979         (WKResourceLoadStatisticsManagerSetGrandfatheringTime):
2980             Functions for testing and configuration.
2981         * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
2982         * UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm:
2983         (WebKit::WebResourceLoadStatisticsManager::registerUserDefaultsIfNeeded):
2984             Added grandfathering configuration.
2985         * UIProcess/WebProcessProxy.cpp:
2986         (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebiteData):
2987             New function to get all top privately controlled domains that
2988             have website data.
2989         * UIProcess/WebProcessProxy.h:
2990         * UIProcess/WebResourceLoadStatisticsManager.cpp:
2991         (WebKit::WebResourceLoadStatisticsManager::setGrandfathered):
2992         (WebKit::WebResourceLoadStatisticsManager::isGrandfathered):
2993         (WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval):
2994         (WebKit::WebResourceLoadStatisticsManager::setGrandfatheringTime):
2995         (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState):
2996             Functions for testing and configuration.
2997             WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval() changed
2998             as a result of WebResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval()
2999             moving to WebCore::ResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval().
3000         * UIProcess/WebResourceLoadStatisticsManager.h:
3001         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3002         (WebKit::initializeDataTypesToRemove):
3003         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
3004             Moved handling of pending removal into WebCore::ResourceLoadStatisticsStore since
3005             that's where grandfathering happens.
3006         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
3007             Moved registration of write persistent store callback and reading of Cocoa defaults to
3008             WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver without parameters
3009             so they are called for platforms without CFNETWORK_STORAGE_PARTITIONING.
3010             Now includes registering WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData()
3011             as handler for grandfathering since it involves reading of the website data store.
3012         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
3013         (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
3014         (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval): Deleted.
3015             Now happens in WebCore::ResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval().
3016         * UIProcess/WebResourceLoadStatisticsStore.h:
3017         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
3018         (WebKit::WebsiteDataRecord::topPrivatelyControlledDomain):
3019             New function to ask a WebsiteDataRecord for its top privately controlled domain.
3020         * UIProcess/WebsiteData/WebsiteDataRecord.h:
3021         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3022         (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData):
3023             New function to get all top privately controlled domains that
3024             have website data.
3025         * UIProcess/WebsiteData/WebsiteDataStore.h:
3026
3027 2017-05-17  Brent Fulgham  <bfulgham@apple.com>
3028
3029         [WK2][iOS] Allow access to additional IOHID user class
3030         https://bugs.webkit.org/show_bug.cgi?id=172198
3031         <rdar://problem/31967635>
3032
3033         Reviewed by Alex Christensen.
3034
3035         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3036
3037 2017-05-17  Chris Dumez  <cdumez@apple.com>
3038
3039         Add more assertions in BackgroundProcessResponsivenessTimer
3040         https://bugs.webkit.org/show_bug.cgi?id=172239
3041
3042         Reviewed by Andreas Kling.
3043
3044         Add more assertions in BackgroundProcessResponsivenessTimer to help figure out the
3045         source of <rdar://problem/32251578>.
3046
3047         * UIProcess/BackgroundProcessResponsivenessTimer.cpp:
3048         (WebKit::BackgroundProcessResponsivenessTimer::updateState):
3049         (WebKit::BackgroundProcessResponsivenessTimer::scheduleNextResponsivenessCheck):
3050
3051 2017-05-17  Youenn Fablet  <youenn@apple.com>
3052
3053         No need to copy origin references in UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo
3054         https://bugs.webkit.org/show_bug.cgi?id=172242
3055
3056         Reviewed by Eric Carlson.
3057
3058         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3059         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
3060
3061 2017-05-17  Youenn Fablet  <youenn@apple.com>
3062
3063         Move-related refactoring on UserMediaPermissionRequestProxy
3064         https://bugs.webkit.org/show_bug.cgi?id=172195
3065
3066         Reviewed by Alex Christensen.
3067
3068         Moving vectors of strings instead of passing as const ref so that we do not copy them.
3069
3070         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3071         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest):
3072         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
3073         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
3074         * UIProcess/UserMediaPermissionRequestProxy.cpp:
3075         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
3076         * UIProcess/UserMediaPermissionRequestProxy.h:
3077         (WebKit::UserMediaPermissionRequestProxy::create):
3078
3079 2017-05-17  Andy Estes  <aestes@apple.com>
3080
3081         REGRESSION (r215480): PKPaymentAuthorizationStatusFailure sent to PassKit in completeShippingContactSelection() even when there are no errors
3082         https://bugs.webkit.org/show_bug.cgi?id=172227
3083         <rdar://problem/31978432>
3084
3085         Reviewed by Alexey Proskuryakov.
3086
3087         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3088         (WebKit::toPKPaymentAuthorizationStatus): If there is an update with no errors, we should
3089         return PKPaymentAuthorizationStatusSuccess instead of PKPaymentAuthorizationStatusFailure.
3090
3091 2017-05-17  Matt Lewis  <jlewis3@apple.com>
3092
3093         Unreviewed, rolling out r216974.
3094
3095         Revision caused consistent timeouts on all platforms.
3096
3097         Reverted changeset:
3098
3099         "Add a RuntimeEnabledFeature for display: contents, defaulted
3100         to false."
3101         https://bugs.webkit.org/show_bug.cgi?id=171984
3102         http://trac.webkit.org/changeset/216974
3103
3104 2017-05-17  Alex Christensen  <achristensen@webkit.org>
3105
3106         Interacting with WKHTTPCookieStores before creating WKWebViews and WKProcessPools should affect cookies used
3107         https://bugs.webkit.org/show_bug.cgi?id=171987
3108
3109         Reviewed by Brady Eidson.
3110
3111         When putting cookies in a WKHTTPCookieStore that hasn't been associated with a WKProcessPool yet, there is no
3112         NetworkProcess into which to put the cookies.  In such a case, we should store these cookies in the WebsiteDataStore
3113         until there is a NetworkProcess.
3114
3115         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3116         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
3117         * NetworkProcess/NetworkProcess.cpp:
3118         (WebKit::NetworkProcess::initializeNetworkProcess):
3119         (WebKit::NetworkProcess::ensurePrivateBrowsingSession):
3120         * NetworkProcess/NetworkProcess.h:
3121         * NetworkProcess/NetworkProcess.messages.in:
3122         * NetworkProcess/RemoteNetworkingContext.h:
3123         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3124         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
3125         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
3126         * Shared/WebsiteDataStoreParameters.cpp:
3127         (WebKit::WebsiteDataStoreParameters::~WebsiteDataStoreParameters):
3128         (WebKit::WebsiteDataStoreParameters::encode):
3129         (WebKit::WebsiteDataStoreParameters::decode):
3130         (WebKit::WebsiteDataStoreParameters::WebsiteDataStoreParameters): Deleted.
3131         * Shared/WebsiteDataStoreParameters.h:
3132         * UIProcess/API/APIHTTPCookieStore.cpp:
3133         (API::HTTPCookieStore::cookies):
3134         (API::HTTPCookieStore::setCookie):
3135         (API::HTTPCookieStore::deleteCookie):
3136         * UIProcess/API/APIHTTPCookieStore.h:
3137         * UIProcess/WebProcessPool.cpp:
3138         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
3139         (WebKit::WebProcessPool::pageAddedToProcess):
3140         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3141         (WebKit::WebsiteDataStore::parameters):
3142         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3143         (WebKit::WebsiteDataStore::pendingCookies):
3144         (WebKit::WebsiteDataStore::addPendingCookie):
3145         (WebKit::WebsiteDataStore::removePendingCookie):
3146         * UIProcess/WebsiteData/WebsiteDataStore.h:
3147
3148 2017-05-17  Emilio Cobos Álvarez  <ecobos@igalia.com>
3149
3150         Add a RuntimeEnabledFeature for display: contents, defaulted to false.
3151         https://bugs.webkit.org/show_bug.cgi?id=171984
3152
3153         Reviewed by Antti Koivisto.
3154
3155         * Shared/WebPreferencesDefinitions.h:
3156         * UIProcess/API/C/WKPreferences.cpp:
3157         (WKPreferencesSetDisplayContentsEnabled):
3158         (WKPreferencesGetDisplayContentsEnabled):
3159         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3160         * WebProcess/WebPage/WebPage.cpp:
3161         (WebKit::WebPage::updatePreferences):
3162
3163 2017-05-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3164
3165         Unreviewed. Fix the build with MEDIA_STREAM disabled after r216952.
3166
3167         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3168         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
3169         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
3170
3171 2017-05-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3172
3173         [Threaded Compositor] SHOULD NEVER BE REACHED in WebKit::CompositingRunLoop::updateCompleted
3174         https://bugs.webkit.org/show_bug.cgi?id=172167
3175
3176         Reviewed by Michael Catanzaro.
3177
3178         This is still happening, even after r216182, less often but still happens. There are two conditions in which
3179         this can happen:
3180
3181          - Again in force repaint. r216182 fixed the case of force repaint called when update state is completed, but it
3182            can also crash if update state is inProgress or PendingAfterCompletion when m_coordinateUpdateCompletionWithClient
3183            is true.
3184          - When the threaded compositor is invalidated right after renderLayerTree() starts, but before it finishes.
3185
3186         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3187         (WebKit::ThreadedCompositor::invalidate): Invalidate the refresh monitor right after stopping updates in the
3188         compositing run loop to ensure no more updates are scheduled.
3189         (WebKit::ThreadedCompositor::renderLayerTree): Check the scene is still active before calling sceneUpdateFinished().
3190         (WebKit::ThreadedCompositor::updateSceneState): Do not update m_coordinateUpdateCompletionWithClient when in
3191         force repaint.
3192         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
3193         (WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback): Return early if the monitor has been invalidated.
3194
3195 2017-05-16  Sam Weinig  <sam@webkit.org>
3196
3197         Bring Notification.idl up to spec
3198         https://bugs.webkit.org/show_bug.cgi?id=172156
3199
3200         Reviewed by Chris Dumez.
3201
3202         * Shared/WebCoreArgumentCoders.h:
3203         * UIProcess/API/C/WKNotification.cpp:
3204         (WKNotificationCopyDir):
3205         * UIProcess/Notifications/WebNotification.cpp:
3206         (WebKit::WebNotification::WebNotification):
3207         * UIProcess/Notifications/WebNotification.h:
3208         (WebKit::WebNotification::create):
3209         (WebKit::WebNotification::dir):
3210         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
3211         (WebKit::WebNotificationManagerProxy::show):
3212         * UIProcess/Notifications/WebNotificationManagerProxy.h:
3213         * UIProcess/WebPageProxy.cpp:
3214         (WebKit::WebPageProxy::showNotification):
3215         * UIProcess/WebPageProxy.h:
3216         * UIProcess/WebPageProxy.messages.in:
3217         * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
3218         (WebKit::NotificationPermissionRequestManager::startRequest):
3219         (WebKit::NotificationPermissionRequestManager::permissionLevel):
3220         (WebKit::NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision):
3221         * WebProcess/Notifications/WebNotificationManager.cpp:
3222         (WebKit::WebNotificationManager::policyForOrigin):
3223         (WebKit::WebNotificationManager::show):
3224         * WebProcess/WebCoreSupport/WebNotificationClient.cpp:
3225         (WebKit::WebNotificationClient::checkPermission):
3226         * WebProcess/WebCoreSupport/WebNotificationClient.h:
3227         Update for enum vs String usage.
3228
3229 2017-05-16  Youenn Fablet  <youenn@apple.com>
3230
3231         Modernize WebKit2 getUserMedia passing of parameters
3232         https://bugs.webkit.org/show_bug.cgi?id=172161
3233
3234         Reviewed by Eric Carlson.
3235
3236         Passing SecurityOrigin as SecurityOriginData through IPC instead of Strings.
3237         Making more use of Ref<> instead of RefPtr<>.
3238
3239         * UIProcess/UserMediaPermissionCheckProxy.cpp:
3240         (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy):
3241         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo):
3242         * UIProcess/UserMediaPermissionCheckProxy.h:
3243         (WebKit::UserMediaPermissionCheckProxy::create):
3244         (WebKit::UserMediaPermissionCheckProxy::userMediaDocumentSecurityOrigin):
3245         (WebKit::UserMediaPermissionCheckProxy::topLevelDocumentSecurityOrigin):
3246         (WebKit::UserMediaPermissionCheckProxy::completionHandler):
3247         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3248         (WebKit::FrameAuthorizationState::FrameAuthorizationState):
3249         (WebKit::FrameAuthorizationState::ensureSecurityOriginsAreEqual):
3250         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest):
3251         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
3252         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
3253         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
3254         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
3255         * UIProcess/UserMediaPermissionRequestProxy.cpp:
3256         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
3257         * UIProcess/UserMediaPermissionRequestProxy.h:
3258         (WebKit::UserMediaPermissionRequestProxy::create):
3259         * UIProcess/WebPageProxy.cpp:
3260         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
3261         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
3262         (WebKit::WebPageProxy::requestNotificationPermission):
3263         * UIProcess/WebPageProxy.h:
3264         * UIProcess/WebPageProxy.messages.in:
3265         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
3266         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
3267         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
3268
3269 2017-05-16  David Kilzer  <ddkilzer@apple.com>
3270
3271         Unused lambdas in UserMediaPermissionRequestManagerProxy.cpp
3272         <https://webkit.org/b/172179>
3273
3274         Reviewed by Eric Carlson.
3275
3276         Fixes unused lambda warnings found with newer clang:
3277
3278             Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:309:46: error: lambda capture 'userMediaID' is not used [-Werror,-Wunused-lambda-capture]
3279                 auto validateConstraintsHandler = [this, userMediaID, validHandler = WTFMove(validHandler), invalidHandler = WTFMove(invalidHandler), audioConstraints = WebCore::MediaConstraints(audioConstraints), videoConstraints = WebCore::MediaConstraints(videoConstraints)](String&& deviceIdentifierHashSalt) mutable {
3280                                                          ^
3281             Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:318:41: error: lambda capture 'userMediaID' is not used [-Werror,-Wunused-lambda-capture]
3282                 auto haveDeviceSaltHandler = [this, userMediaID, frameID, validateConstraintsHandler = WTFMove(validateConstraintsHandler)](uint64_t userMediaID, String&& deviceIdentifierHashSalt, bool originHasPersistentAccess) mutable {
3283                                                     ^
3284             Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:318:54: error: lambda capture 'frameID' is not used [-Werror,-Wunused-lambda-capture]
3285                 auto haveDeviceSaltHandler = [this, userMediaID, frameID, validateConstraintsHandler = WTFMove(validateConstraintsHandler)](uint64_t userMediaID, String&& deviceIdentifierHashSalt, bool originHasPersistentAccess) mutable {
3286                                                                  ^
3287             Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:362:37: error: lambda capture 'userMediaID' is not used [-Werror,-Wunused-lambda-capture]
3288                 auto completionHandler = [this, userMediaID](uint64_t userMediaID, String&& deviceIdentifierHashSalt, bool originHasPersistentAccess) {
3289                                                 ^
3290
3291         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3292         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
3293         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
3294         - Remove unused lambdas.
3295
3296 2017-05-16  Brent Fulgham  <bfulgham@apple.com>
3297
3298         [WK2][macOS] Support Flash Player DRM features
3299         https://bugs.webkit.org/show_bug.cgi?id=172157
3300         <rdar://problem/31889297>
3301
3302         Reviewed by Dean Jackson.
3303
3304         Relax the IOKit whitelist to support DRM features needed by
3305         some websites.
3306
3307         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
3308
3309 2017-05-16  Brent Fulgham  <bfulgham@apple.com>
3310
3311         [WK2][macOS] Adopt a whitelist for XPC services
3312         https://bugs.webkit.org/show_bug.cgi?id=172151
3313         <rdar://problem/31916325>
3314
3315         Reviewed by Alex Christensen.
3316
3317         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
3318         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
3319         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
3320         * WebProcess/com.apple.WebProcess.sb.in:
3321
3322 2017-05-16  Timothy Horton  <timothy_horton@apple.com>
3323
3324         Make it possible to adjust which edges are affected by safe area insets
3325         https://bugs.webkit.org/show_bug.cgi?id=172149
3326         <rdar://problem/31564729>
3327
3328         Reviewed by Beth Dakin.
3329
3330         * UIProcess/API/Cocoa/WKWebView.mm:
3331         (-[WKWebView _initializeWithConfiguration:]):
3332         (-[WKWebView _computedContentInset]):
3333         (-[WKWebView _obscuredInsetEdgesAffectedBySafeArea]):
3334         (-[WKWebView _setObscuredInsetEdgesAffectedBySafeArea:]):
3335         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3336         Add SPI to adjust which edges are taken into account, and adjust the default.
3337
3338 2017-05-16  Zan Dobersek  <zdobersek@igalia.com>
3339
3340         [GLib] Use RunLoopSourcePriority::RunLoopDispatcher as the GSocketMonitor's GSource priority
3341         https://bugs.webkit.org/show_bug.cgi?id=172160
3342
3343         Reviewed by Carlos Garcia Campos.
3344
3345         * Platform/IPC/glib/GSocketMonitor.cpp:
3346         (IPC::GSocketMonitor::start): Explicitly set the priority for the GSocketMonitor's
3347         GSource object to RunLoopSourcePriority::RunLoopDispatcher, equating it to the
3348         priority that's used in RunLoop for dispatches of the queued functions.
3349
3350 2017-05-16  Zan Dobersek  <zdobersek@igalia.com>
3351
3352         [GLib] Name more GSource-based RunLoop::Timers
3353         https://bugs.webkit.org/show_bug.cgi?id=172158
3354
3355         Reviewed by Carlos Garcia Campos.
3356
3357         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
3358         (WebKit::CompositingRunLoop::CompositingRunLoop):
3359         Specify 'CompositingRunLoop' as the name of this GSource-based RunLoop::Timer.
3360         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
3361         (WebKit::ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor):
3362         Specify 'ThreadedDisplayRefreshMonitor' as the name of this GSource-based RunLoop::Timer.
3363         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
3364         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
3365         Specify 'CoordinatedLayerTreeHost' as the name of this GSource-based RunLoop::Timer.
3366
3367 2017-05-16  Carlos Garcia Campos  <cgarcia@igalia.com>
3368
3369         Unreviewed. Revert change committed by mistakle in r216922.
3370
3371         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3372         (WebKit::ThreadedCompositor::forceRepaint):
3373
3374 2017-05-16  Youenn Fablet  <youenn@apple.com>
3375
3376         Remove MediaConstraintsData and MediaConstraintsImpl
3377         https://bugs.webkit.org/show_bug.cgi?id=172132
3378
3379         Reviewed by Eric Carlson.
3380
3381         Removing MediaConstraintsData and MediaConstraintsImpl allows simplifying the code.
3382         Further simplified the code by making MediaConstraints no longer ref counted and now a struct.
3383
3384         * Scripts/webkit/messages.py:
3385         (headers_for_type):
3386         * Shared/WebCoreArgumentCoders.cpp:
3387         (IPC::ArgumentCoder<MediaConstraints>::encode):
3388         (IPC::ArgumentCoder<MediaConstraints>::decode):
3389         (IPC::ArgumentCoder<MediaConstraintsData>::encode): Deleted.
3390         (IPC::ArgumentCoder<MediaConstraintsData>::decode): Deleted.
3391         * Shared/WebCoreArgumentCoders.h:
3392         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
3393         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
3394         (WebKit::UserMediaCaptureManagerProxy::applyConstraints):
3395         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
3396         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
3397         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3398         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
3399         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
3400         * UIProcess/WebPageProxy.cpp:
3401         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
3402         * UIProcess/WebPageProxy.h:
3403         * UIProcess/WebPageProxy.messages.in:
3404         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
3405         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
3406         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
3407         (WebKit::UserMediaCaptureManager::applyConstraints):
3408
3409 2017-05-16  Michael Catanzaro  <mcatanzaro@igalia.com>
3410
3411         [SOUP] Remove LATEST_RECORD_VERSION from GnuTLS priority string
3412         https://bugs.webkit.org/show_bug.cgi?id=172153
3413
3414         Based on discussion with Nikos in https://bugzilla.gnome.org/show_bug.cgi?id=782218, we
3415         should remove LATEST_RECORD_VERSION from our GnuTLS priority string. This causes GnuTLS to
3416         use the latest TLS record version (the record format is separate from the TLS protocol
3417         version), which we needed a couple years ago (after dropping SSLv3) for maximum
3418         compatibility with broken web servers. But it's not needed anymore, and is causing new
3419         compatibility problems with other broken web servers, so let's get rid of it.
3420
3421         Reviewed by Carlos Garcia Campos.
3422
3423         * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
3424         (main):
3425         * WebProcess/EntryPoint/unix/WebProcessMain.cpp:
3426         (main):
3427
3428 2017-05-15  Andy Estes  <aestes@apple.com>
3429
3430         Make the application PID available to WebCore
3431         https://bugs.webkit.org/show_bug.cgi?id=172133
3432
3433         Reviewed by Andreas Kling.
3434
3435         Added uiProcessPID to Web and Networking process creation parameters. The UI process
3436         initializes these to getpid(), and the child processes call WebCore::setPresentingApplicationPID()
3437         at initialization time.
3438
3439         This replaces presenterApplicationPid.
3440
3441         * NetworkProcess/NetworkProcess.cpp:
3442         (WebKit::NetworkProcess::initializeNetworkProcess):
3443         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3444         (WebKit::NetworkProcessCreationParameters::encode):
3445         (WebKit::NetworkProcessCreationParameters::decode):
3446         * NetworkProcess/NetworkProcessCreationParameters.h:
3447         * Shared/WebProcessCreationParameters.cpp:
3448         (WebKit::WebProcessCreationParameters::encode):
3449         (WebKit::WebProcessCreationParameters::decode):
3450         * Shared/WebProcessCreationParameters.h:
3451         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3452         (WebKit::WebProcessPool::platformInitializeWebProcess):
3453         * UIProcess/WebProcessPool.cpp:
3454         (WebKit::WebProcessPool::ensureNetworkProcess):
3455         (WebKit::WebProcessPool::createNewWebProcess):
3456         * WebProcess/WebPage/mac/WebPageMac.mm:
3457         (WebKit::WebPage::platformInitialize):
3458         * WebProcess/WebProcess.cpp:
3459         (WebKit::WebProcess::initializeWebProcess):
3460         * WebProcess/WebProcess.h:
3461         (WebKit::WebProcess::presenterApplicationPid): Deleted.
3462         * WebProcess/cocoa/WebProcessCocoa.mm:
3463         (WebKit::WebProcess::platformInitializeWebProcess):