Resource Load Statistics: Grandfather domains for existing data records
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2017-05-17  John Wilander  <wilander@apple.com>
2
3         Resource Load Statistics: Grandfather domains for existing data records
4         https://bugs.webkit.org/show_bug.cgi?id=172155
5         <rdar://problem/24913532>
6
7         Reviewed by Alex Christensen.
8
9         When WebResourceLoadStatisticsStore starts fresh it needs
10         to scan existing website data records and 'grandfather' them to
11         allow ample time to capture user interaction.
12
13         * Shared/WebPreferencesDefinitions.h:
14         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
15         (WKResourceLoadStatisticsManagerSetGrandfathered):
16         (WKResourceLoadStatisticsManagerIsGrandfathered):
17         (WKResourceLoadStatisticsManagerSetMinimumTimeBetweeenDataRecordsRemoval):
18         (WKResourceLoadStatisticsManagerSetGrandfatheringTime):
19             Functions for testing and configuration.
20         * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
21         * UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm:
22         (WebKit::WebResourceLoadStatisticsManager::registerUserDefaultsIfNeeded):
23             Added grandfathering configuration.
24         * UIProcess/WebProcessProxy.cpp:
25         (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebiteData):
26             New function to get all top privately controlled domains that
27             have website data.
28         * UIProcess/WebProcessProxy.h:
29         * UIProcess/WebResourceLoadStatisticsManager.cpp:
30         (WebKit::WebResourceLoadStatisticsManager::setGrandfathered):
31         (WebKit::WebResourceLoadStatisticsManager::isGrandfathered):
32         (WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval):
33         (WebKit::WebResourceLoadStatisticsManager::setGrandfatheringTime):
34         (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState):
35             Functions for testing and configuration.
36             WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval() changed
37             as a result of WebResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval()
38             moving to WebCore::ResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval().
39         * UIProcess/WebResourceLoadStatisticsManager.h:
40         * UIProcess/WebResourceLoadStatisticsStore.cpp:
41         (WebKit::initializeDataTypesToRemove):
42         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
43             Moved handling of pending removal into WebCore::ResourceLoadStatisticsStore since
44             that's where grandfathering happens.
45         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
46             Moved registration of write persistent store callback and reading of Cocoa defaults to
47             WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver without parameters
48             so they are called for platforms without CFNETWORK_STORAGE_PARTITIONING.
49             Now includes registering WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData()
50             as handler for grandfathering since it involves reading of the website data store.
51         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
52         (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
53         (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval): Deleted.
54             Now happens in WebCore::ResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval().
55         * UIProcess/WebResourceLoadStatisticsStore.h:
56         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
57         (WebKit::WebsiteDataRecord::topPrivatelyControlledDomain):
58             New function to ask a WebsiteDataRecord for its top privately controlled domain.
59         * UIProcess/WebsiteData/WebsiteDataRecord.h:
60         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
61         (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData):
62             New function to get all top privately controlled domains that
63             have website data.
64         * UIProcess/WebsiteData/WebsiteDataStore.h:
65
66 2017-05-17  Brent Fulgham  <bfulgham@apple.com>
67
68         [WK2][iOS] Allow access to additional IOHID user class
69         https://bugs.webkit.org/show_bug.cgi?id=172198
70         <rdar://problem/31967635>
71
72         Reviewed by Alex Christensen.
73
74         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
75
76 2017-05-17  Chris Dumez  <cdumez@apple.com>
77
78         Add more assertions in BackgroundProcessResponsivenessTimer
79         https://bugs.webkit.org/show_bug.cgi?id=172239
80
81         Reviewed by Andreas Kling.
82
83         Add more assertions in BackgroundProcessResponsivenessTimer to help figure out the
84         source of <rdar://problem/32251578>.
85
86         * UIProcess/BackgroundProcessResponsivenessTimer.cpp:
87         (WebKit::BackgroundProcessResponsivenessTimer::updateState):
88         (WebKit::BackgroundProcessResponsivenessTimer::scheduleNextResponsivenessCheck):
89
90 2017-05-17  Youenn Fablet  <youenn@apple.com>
91
92         No need to copy origin references in UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo
93         https://bugs.webkit.org/show_bug.cgi?id=172242
94
95         Reviewed by Eric Carlson.
96
97         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
98         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
99
100 2017-05-17  Youenn Fablet  <youenn@apple.com>
101
102         Move-related refactoring on UserMediaPermissionRequestProxy
103         https://bugs.webkit.org/show_bug.cgi?id=172195
104
105         Reviewed by Alex Christensen.
106
107         Moving vectors of strings instead of passing as const ref so that we do not copy them.
108
109         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
110         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest):
111         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
112         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
113         * UIProcess/UserMediaPermissionRequestProxy.cpp:
114         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
115         * UIProcess/UserMediaPermissionRequestProxy.h:
116         (WebKit::UserMediaPermissionRequestProxy::create):
117
118 2017-05-17  Andy Estes  <aestes@apple.com>
119
120         REGRESSION (r215480): PKPaymentAuthorizationStatusFailure sent to PassKit in completeShippingContactSelection() even when there are no errors
121         https://bugs.webkit.org/show_bug.cgi?id=172227
122         <rdar://problem/31978432>
123
124         Reviewed by Alexey Proskuryakov.
125
126         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
127         (WebKit::toPKPaymentAuthorizationStatus): If there is an update with no errors, we should
128         return PKPaymentAuthorizationStatusSuccess instead of PKPaymentAuthorizationStatusFailure.
129
130 2017-05-17  Matt Lewis  <jlewis3@apple.com>
131
132         Unreviewed, rolling out r216974.
133
134         Revision caused consistent timeouts on all platforms.
135
136         Reverted changeset:
137
138         "Add a RuntimeEnabledFeature for display: contents, defaulted
139         to false."
140         https://bugs.webkit.org/show_bug.cgi?id=171984
141         http://trac.webkit.org/changeset/216974
142
143 2017-05-17  Alex Christensen  <achristensen@webkit.org>
144
145         Interacting with WKHTTPCookieStores before creating WKWebViews and WKProcessPools should affect cookies used
146         https://bugs.webkit.org/show_bug.cgi?id=171987
147
148         Reviewed by Brady Eidson.
149
150         When putting cookies in a WKHTTPCookieStore that hasn't been associated with a WKProcessPool yet, there is no
151         NetworkProcess into which to put the cookies.  In such a case, we should store these cookies in the WebsiteDataStore
152         until there is a NetworkProcess.
153
154         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
155         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
156         * NetworkProcess/NetworkProcess.cpp:
157         (WebKit::NetworkProcess::initializeNetworkProcess):
158         (WebKit::NetworkProcess::ensurePrivateBrowsingSession):
159         * NetworkProcess/NetworkProcess.h:
160         * NetworkProcess/NetworkProcess.messages.in:
161         * NetworkProcess/RemoteNetworkingContext.h:
162         * NetworkProcess/mac/RemoteNetworkingContext.mm:
163         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
164         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
165         * Shared/WebsiteDataStoreParameters.cpp:
166         (WebKit::WebsiteDataStoreParameters::~WebsiteDataStoreParameters):
167         (WebKit::WebsiteDataStoreParameters::encode):
168         (WebKit::WebsiteDataStoreParameters::decode):
169         (WebKit::WebsiteDataStoreParameters::WebsiteDataStoreParameters): Deleted.
170         * Shared/WebsiteDataStoreParameters.h:
171         * UIProcess/API/APIHTTPCookieStore.cpp:
172         (API::HTTPCookieStore::cookies):
173         (API::HTTPCookieStore::setCookie):
174         (API::HTTPCookieStore::deleteCookie):
175         * UIProcess/API/APIHTTPCookieStore.h:
176         * UIProcess/WebProcessPool.cpp:
177         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
178         (WebKit::WebProcessPool::pageAddedToProcess):
179         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
180         (WebKit::WebsiteDataStore::parameters):
181         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
182         (WebKit::WebsiteDataStore::pendingCookies):
183         (WebKit::WebsiteDataStore::addPendingCookie):
184         (WebKit::WebsiteDataStore::removePendingCookie):
185         * UIProcess/WebsiteData/WebsiteDataStore.h:
186
187 2017-05-17  Emilio Cobos Álvarez  <ecobos@igalia.com>
188
189         Add a RuntimeEnabledFeature for display: contents, defaulted to false.
190         https://bugs.webkit.org/show_bug.cgi?id=171984
191
192         Reviewed by Antti Koivisto.
193
194         * Shared/WebPreferencesDefinitions.h:
195         * UIProcess/API/C/WKPreferences.cpp:
196         (WKPreferencesSetDisplayContentsEnabled):
197         (WKPreferencesGetDisplayContentsEnabled):
198         * UIProcess/API/C/WKPreferencesRefPrivate.h:
199         * WebProcess/WebPage/WebPage.cpp:
200         (WebKit::WebPage::updatePreferences):
201
202 2017-05-17  Carlos Garcia Campos  <cgarcia@igalia.com>
203
204         Unreviewed. Fix the build with MEDIA_STREAM disabled after r216952.
205
206         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
207         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
208         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
209
210 2017-05-17  Carlos Garcia Campos  <cgarcia@igalia.com>
211
212         [Threaded Compositor] SHOULD NEVER BE REACHED in WebKit::CompositingRunLoop::updateCompleted
213         https://bugs.webkit.org/show_bug.cgi?id=172167
214
215         Reviewed by Michael Catanzaro.
216
217         This is still happening, even after r216182, less often but still happens. There are two conditions in which
218         this can happen:
219
220          - Again in force repaint. r216182 fixed the case of force repaint called when update state is completed, but it
221            can also crash if update state is inProgress or PendingAfterCompletion when m_coordinateUpdateCompletionWithClient
222            is true.
223          - When the threaded compositor is invalidated right after renderLayerTree() starts, but before it finishes.
224
225         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
226         (WebKit::ThreadedCompositor::invalidate): Invalidate the refresh monitor right after stopping updates in the
227         compositing run loop to ensure no more updates are scheduled.
228         (WebKit::ThreadedCompositor::renderLayerTree): Check the scene is still active before calling sceneUpdateFinished().
229         (WebKit::ThreadedCompositor::updateSceneState): Do not update m_coordinateUpdateCompletionWithClient when in
230         force repaint.
231         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
232         (WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback): Return early if the monitor has been invalidated.
233
234 2017-05-16  Sam Weinig  <sam@webkit.org>
235
236         Bring Notification.idl up to spec
237         https://bugs.webkit.org/show_bug.cgi?id=172156
238
239         Reviewed by Chris Dumez.
240
241         * Shared/WebCoreArgumentCoders.h:
242         * UIProcess/API/C/WKNotification.cpp:
243         (WKNotificationCopyDir):
244         * UIProcess/Notifications/WebNotification.cpp:
245         (WebKit::WebNotification::WebNotification):
246         * UIProcess/Notifications/WebNotification.h:
247         (WebKit::WebNotification::create):
248         (WebKit::WebNotification::dir):
249         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
250         (WebKit::WebNotificationManagerProxy::show):
251         * UIProcess/Notifications/WebNotificationManagerProxy.h:
252         * UIProcess/WebPageProxy.cpp:
253         (WebKit::WebPageProxy::showNotification):
254         * UIProcess/WebPageProxy.h:
255         * UIProcess/WebPageProxy.messages.in:
256         * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
257         (WebKit::NotificationPermissionRequestManager::startRequest):
258         (WebKit::NotificationPermissionRequestManager::permissionLevel):
259         (WebKit::NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision):
260         * WebProcess/Notifications/WebNotificationManager.cpp:
261         (WebKit::WebNotificationManager::policyForOrigin):
262         (WebKit::WebNotificationManager::show):
263         * WebProcess/WebCoreSupport/WebNotificationClient.cpp:
264         (WebKit::WebNotificationClient::checkPermission):
265         * WebProcess/WebCoreSupport/WebNotificationClient.h:
266         Update for enum vs String usage.
267
268 2017-05-16  Youenn Fablet  <youenn@apple.com>
269
270         Modernize WebKit2 getUserMedia passing of parameters
271         https://bugs.webkit.org/show_bug.cgi?id=172161
272
273         Reviewed by Eric Carlson.
274
275         Passing SecurityOrigin as SecurityOriginData through IPC instead of Strings.
276         Making more use of Ref<> instead of RefPtr<>.
277
278         * UIProcess/UserMediaPermissionCheckProxy.cpp:
279         (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy):
280         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo):
281         * UIProcess/UserMediaPermissionCheckProxy.h:
282         (WebKit::UserMediaPermissionCheckProxy::create):
283         (WebKit::UserMediaPermissionCheckProxy::userMediaDocumentSecurityOrigin):
284         (WebKit::UserMediaPermissionCheckProxy::topLevelDocumentSecurityOrigin):
285         (WebKit::UserMediaPermissionCheckProxy::completionHandler):
286         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
287         (WebKit::FrameAuthorizationState::FrameAuthorizationState):
288         (WebKit::FrameAuthorizationState::ensureSecurityOriginsAreEqual):
289         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest):
290         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
291         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
292         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
293         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
294         * UIProcess/UserMediaPermissionRequestProxy.cpp:
295         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
296         * UIProcess/UserMediaPermissionRequestProxy.h:
297         (WebKit::UserMediaPermissionRequestProxy::create):
298         * UIProcess/WebPageProxy.cpp:
299         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
300         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
301         (WebKit::WebPageProxy::requestNotificationPermission):
302         * UIProcess/WebPageProxy.h:
303         * UIProcess/WebPageProxy.messages.in:
304         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
305         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
306         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
307
308 2017-05-16  David Kilzer  <ddkilzer@apple.com>
309
310         Unused lambdas in UserMediaPermissionRequestManagerProxy.cpp
311         <https://webkit.org/b/172179>
312
313         Reviewed by Eric Carlson.
314
315         Fixes unused lambda warnings found with newer clang:
316
317             Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:309:46: error: lambda capture 'userMediaID' is not used [-Werror,-Wunused-lambda-capture]
318                 auto validateConstraintsHandler = [this, userMediaID, validHandler = WTFMove(validHandler), invalidHandler = WTFMove(invalidHandler), audioConstraints = WebCore::MediaConstraints(audioConstraints), videoConstraints = WebCore::MediaConstraints(videoConstraints)](String&& deviceIdentifierHashSalt) mutable {
319                                                          ^
320             Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:318:41: error: lambda capture 'userMediaID' is not used [-Werror,-Wunused-lambda-capture]
321                 auto haveDeviceSaltHandler = [this, userMediaID, frameID, validateConstraintsHandler = WTFMove(validateConstraintsHandler)](uint64_t userMediaID, String&& deviceIdentifierHashSalt, bool originHasPersistentAccess) mutable {
322                                                     ^
323             Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:318:54: error: lambda capture 'frameID' is not used [-Werror,-Wunused-lambda-capture]
324                 auto haveDeviceSaltHandler = [this, userMediaID, frameID, validateConstraintsHandler = WTFMove(validateConstraintsHandler)](uint64_t userMediaID, String&& deviceIdentifierHashSalt, bool originHasPersistentAccess) mutable {
325                                                                  ^
326             Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp:362:37: error: lambda capture 'userMediaID' is not used [-Werror,-Wunused-lambda-capture]
327                 auto completionHandler = [this, userMediaID](uint64_t userMediaID, String&& deviceIdentifierHashSalt, bool originHasPersistentAccess) {
328                                                 ^
329
330         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
331         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
332         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
333         - Remove unused lambdas.
334
335 2017-05-16  Brent Fulgham  <bfulgham@apple.com>
336
337         [WK2][macOS] Support Flash Player DRM features
338         https://bugs.webkit.org/show_bug.cgi?id=172157
339         <rdar://problem/31889297>
340
341         Reviewed by Dean Jackson.
342
343         Relax the IOKit whitelist to support DRM features needed by
344         some websites.
345
346         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
347
348 2017-05-16  Brent Fulgham  <bfulgham@apple.com>
349
350         [WK2][macOS] Adopt a whitelist for XPC services
351         https://bugs.webkit.org/show_bug.cgi?id=172151
352         <rdar://problem/31916325>
353
354         Reviewed by Alex Christensen.
355
356         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
357         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
358         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
359         * WebProcess/com.apple.WebProcess.sb.in:
360
361 2017-05-16  Timothy Horton  <timothy_horton@apple.com>
362
363         Make it possible to adjust which edges are affected by safe area insets
364         https://bugs.webkit.org/show_bug.cgi?id=172149
365         <rdar://problem/31564729>
366
367         Reviewed by Beth Dakin.
368
369         * UIProcess/API/Cocoa/WKWebView.mm:
370         (-[WKWebView _initializeWithConfiguration:]):
371         (-[WKWebView _computedContentInset]):
372         (-[WKWebView _obscuredInsetEdgesAffectedBySafeArea]):
373         (-[WKWebView _setObscuredInsetEdgesAffectedBySafeArea:]):
374         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
375         Add SPI to adjust which edges are taken into account, and adjust the default.
376
377 2017-05-16  Zan Dobersek  <zdobersek@igalia.com>
378
379         [GLib] Use RunLoopSourcePriority::RunLoopDispatcher as the GSocketMonitor's GSource priority
380         https://bugs.webkit.org/show_bug.cgi?id=172160
381
382         Reviewed by Carlos Garcia Campos.
383
384         * Platform/IPC/glib/GSocketMonitor.cpp:
385         (IPC::GSocketMonitor::start): Explicitly set the priority for the GSocketMonitor's
386         GSource object to RunLoopSourcePriority::RunLoopDispatcher, equating it to the
387         priority that's used in RunLoop for dispatches of the queued functions.
388
389 2017-05-16  Zan Dobersek  <zdobersek@igalia.com>
390
391         [GLib] Name more GSource-based RunLoop::Timers
392         https://bugs.webkit.org/show_bug.cgi?id=172158
393
394         Reviewed by Carlos Garcia Campos.
395
396         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
397         (WebKit::CompositingRunLoop::CompositingRunLoop):
398         Specify 'CompositingRunLoop' as the name of this GSource-based RunLoop::Timer.
399         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
400         (WebKit::ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor):
401         Specify 'ThreadedDisplayRefreshMonitor' as the name of this GSource-based RunLoop::Timer.
402         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
403         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
404         Specify 'CoordinatedLayerTreeHost' as the name of this GSource-based RunLoop::Timer.
405
406 2017-05-16  Carlos Garcia Campos  <cgarcia@igalia.com>
407
408         Unreviewed. Revert change committed by mistakle in r216922.
409
410         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
411         (WebKit::ThreadedCompositor::forceRepaint):
412
413 2017-05-16  Youenn Fablet  <youenn@apple.com>
414
415         Remove MediaConstraintsData and MediaConstraintsImpl
416         https://bugs.webkit.org/show_bug.cgi?id=172132
417
418         Reviewed by Eric Carlson.
419
420         Removing MediaConstraintsData and MediaConstraintsImpl allows simplifying the code.
421         Further simplified the code by making MediaConstraints no longer ref counted and now a struct.
422
423         * Scripts/webkit/messages.py:
424         (headers_for_type):
425         * Shared/WebCoreArgumentCoders.cpp:
426         (IPC::ArgumentCoder<MediaConstraints>::encode):
427         (IPC::ArgumentCoder<MediaConstraints>::decode):
428         (IPC::ArgumentCoder<MediaConstraintsData>::encode): Deleted.
429         (IPC::ArgumentCoder<MediaConstraintsData>::decode): Deleted.
430         * Shared/WebCoreArgumentCoders.h:
431         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
432         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
433         (WebKit::UserMediaCaptureManagerProxy::applyConstraints):
434         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
435         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
436         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
437         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
438         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
439         * UIProcess/WebPageProxy.cpp:
440         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
441         * UIProcess/WebPageProxy.h:
442         * UIProcess/WebPageProxy.messages.in:
443         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
444         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
445         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
446         (WebKit::UserMediaCaptureManager::applyConstraints):
447
448 2017-05-16  Michael Catanzaro  <mcatanzaro@igalia.com>
449
450         [SOUP] Remove LATEST_RECORD_VERSION from GnuTLS priority string
451         https://bugs.webkit.org/show_bug.cgi?id=172153
452
453         Based on discussion with Nikos in https://bugzilla.gnome.org/show_bug.cgi?id=782218, we
454         should remove LATEST_RECORD_VERSION from our GnuTLS priority string. This causes GnuTLS to
455         use the latest TLS record version (the record format is separate from the TLS protocol
456         version), which we needed a couple years ago (after dropping SSLv3) for maximum
457         compatibility with broken web servers. But it's not needed anymore, and is causing new
458         compatibility problems with other broken web servers, so let's get rid of it.
459
460         Reviewed by Carlos Garcia Campos.
461
462         * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
463         (main):
464         * WebProcess/EntryPoint/unix/WebProcessMain.cpp:
465         (main):
466
467 2017-05-15  Andy Estes  <aestes@apple.com>
468
469         Make the application PID available to WebCore
470         https://bugs.webkit.org/show_bug.cgi?id=172133
471
472         Reviewed by Andreas Kling.
473
474         Added uiProcessPID to Web and Networking process creation parameters. The UI process
475         initializes these to getpid(), and the child processes call WebCore::setPresentingApplicationPID()
476         at initialization time.
477
478         This replaces presenterApplicationPid.
479
480         * NetworkProcess/NetworkProcess.cpp:
481         (WebKit::NetworkProcess::initializeNetworkProcess):
482         * NetworkProcess/NetworkProcessCreationParameters.cpp:
483         (WebKit::NetworkProcessCreationParameters::encode):
484         (WebKit::NetworkProcessCreationParameters::decode):
485         * NetworkProcess/NetworkProcessCreationParameters.h:
486         * Shared/WebProcessCreationParameters.cpp:
487         (WebKit::WebProcessCreationParameters::encode):
488         (WebKit::WebProcessCreationParameters::decode):
489         * Shared/WebProcessCreationParameters.h:
490         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
491         (WebKit::WebProcessPool::platformInitializeWebProcess):
492         * UIProcess/WebProcessPool.cpp:
493         (WebKit::WebProcessPool::ensureNetworkProcess):
494         (WebKit::WebProcessPool::createNewWebProcess):
495         * WebProcess/WebPage/mac/WebPageMac.mm:
496         (WebKit::WebPage::platformInitialize):
497         * WebProcess/WebProcess.cpp:
498         (WebKit::WebProcess::initializeWebProcess):
499         * WebProcess/WebProcess.h:
500         (WebKit::WebProcess::presenterApplicationPid): Deleted.
501         * WebProcess/cocoa/WebProcessCocoa.mm:
502         (WebKit::WebProcess::platformInitializeWebProcess):
503
504 2017-05-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
505
506         Do not delete asynchronously decoded frames for large images if their clients are in the viewport
507         https://bugs.webkit.org/show_bug.cgi?id=170640
508
509         Reviewed by Simon Fraser.
510
511         Enable the async decoding for large images.
512
513         * WebProcess/WebPage/WebPage.cpp:
514         (WebKit::WebPage::updatePreferences):
515
516 2017-05-15  Youenn Fablet  <youenn@apple.com>
517
518         Simplify RealtimeMediaSource data production and state
519         https://bugs.webkit.org/show_bug.cgi?id=171999
520
521         Reviewed by Eric Carlson.
522
523         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
524         (WebKit::UserMediaCaptureManagerProxy::startProducingData):
525         (WebKit::UserMediaCaptureManagerProxy::stopProducingData):
526         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
527
528 2017-05-15  Brent Fulgham  <bfulgham@apple.com>
529
530         Correct typo (part of r216790).
531
532         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: The check-in missed part of a
533         regular expression needed to fix the audio playback.
534
535 2017-05-15  Jer Noble  <jer.noble@apple.com>
536
537         Add experimental setting to allow document gesture interaction to fulfill media playback gesture requirement
538         https://bugs.webkit.org/show_bug.cgi?id=172131
539
540         Reviewed by Eric Carlson.
541
542         * Shared/WebPreferencesDefinitions.h:
543         * UIProcess/API/C/WKPreferences.cpp:
544         (WKPreferencesSetMediaUserGestureInheritsFromDocument):
545         (WKPreferencesGetMediaUserGestureInheritsFromDocument):
546         * UIProcess/API/C/WKPreferencesRefPrivate.h:
547         * WebProcess/WebPage/WebPage.cpp:
548         (WebKit::WebPage::updatePreferences):
549
550 2017-05-15  Brent Fulgham  <bfulgham@apple.com>
551
552         [WK2][macOS][iOS] Allow Network process to access nsurlstoraged's top level domain data cache 
553         https://bugs.webkit.org/show_bug.cgi?id=172128
554         <rdar://problem/30871490>
555
556         Reviewed by Alex Christensen.
557
558         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
559         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
560
561 2017-05-15  David Kilzer  <ddkilzer@apple.com>
562
563         Update json.hpp to v2.1.1
564         <https://webkit.org/b/172085>
565         <rdar://problem/32180980>
566
567         Reviewed by Alex Christensen.
568
569         * NetworkProcess/capture/NetworkCaptureEvent.cpp:
570         - Define JSON_NOEXCEPTION as 1 to disable exceptions in
571           json.hpp.
572         (WebKit::NetworkCapture::JSONCoder<String>::encode):
573         (WebKit::NetworkCapture::JSONCoder<WebCore::SharedBuffer>::encode):
574         - Build std::string passing in length to avoid the need for a
575           custom basic_json() constructor, and for efficiency.
576
577         * NetworkProcess/capture/json.hpp:
578         - Update to v2.1.1 and remove customizations.
579
580 2017-05-15  Brent Fulgham  <bfulgham@apple.com>
581
582         Unreviewed build fix.
583
584         Debugging code was accidentally left in the Plugin sandbox profile.
585
586         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
587
588 2017-05-15  Gwang Yoon Hwang  <yoon@igalia.com>
589
590         [WPE] Unreviewed debug build fix
591         https://bugs.webkit.org/show_bug.cgi?id=172118
592
593         Unreviewed, remove a dead code accidentally committed in r215259.
594
595         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
596         Remove deprecated CompositingRunLoop::isCurrent.
597         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
598         (WebKit::ThreadedCompositor::frameComplete):
599
600 2017-05-14  Daewoong Jang  <daewoong.jang@navercorp.com>
601
602         [CoordinatedGraphics] Remove unused files and lines
603         https://bugs.webkit.org/show_bug.cgi?id=172080
604
605         Reviewed by Darin Adler.
606
607         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp: Removed.
608         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h: Removed.
609         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp: Removed.
610         * Shared/CoordinatedGraphics/WebCoordinatedSurface.h: Removed.
611         * UIProcess/CoordinatedGraphics/WKCoordinatedSceneAPICast.h: Removed.
612         * UIProcess/WebPageProxy.h:
613         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
614         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.messages.in: Removed.
615
616 2017-05-14  Andreas Kling  <akling@apple.com>
617
618         Always reset the assisted node when the main frame commits a new load.
619         https://bugs.webkit.org/show_bug.cgi?id=172088
620
621         Reviewed by Antti Koivisto.
622
623         WebPage::m_assistedNode could extend the lifetime of the document it pointed into
624         if the main frame was navigated while the assisted node was in one of its subframes.
625         The life-supported document wouldn't be reachable from JavaScript but nevertheless
626         would consume memory and other resources.
627
628         This patch fixes the issue by always clearing WebPage::m_assistedNode when the main
629         frame commits a new load.
630
631         * WebProcess/WebPage/WebPage.cpp:
632         (WebKit::WebPage::resetAssistedNodeForFrame):
633
634 2017-05-14  Csaba Osztrogonác  <ossy@webkit.org>
635
636         Unreviewed Mac cmake buildfix after r216690, just for fun.
637
638         * PlatformMac.cmake:
639
640 2017-05-14  David Kilzer  <ddkilzer@apple.com>
641
642         Fix unused lambdas in WebKit2
643         <https://webkit.org/b/172090>
644
645         Reviewed by Chris Dumez.
646
647         Fixes unused lambda warnings found with newer clang.
648
649         * NetworkProcess/cache/NetworkCache.cpp:
650         (WebKit::NetworkCache::Cache::retrieve):
651         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
652         (WebKit::NetworkCache::Statistics::initialize):
653         - Use UNUSED_PARAM() to silence unused lambda warning since
654           'startTime' is used in Debug builds.
655
656         * NetworkProcess/capture/NetworkCaptureManager.cpp:
657         (WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
658         - Remove unused 'this' from lambda capture.
659
660         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
661         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
662         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
663         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
664         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
665         - Use UNUSED_PARAM() to silence unused lambda warning since
666           'taskIdentifier' is used in Debug builds.
667
668         * UIProcess/WebResourceLoadStatisticsStore.cpp:
669         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
670         (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
671         - Remove unused 'this' from lambda captures.
672
673         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
674         (WebKit::WebsiteDataStore::fetchData):
675         - Remove unused 'fetchOptions' from lambda capture.
676         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains):
677         - Remove unused 'this' from lambda capture.
678
679         * UIProcess/mac/ViewGestureControllerMac.mm:
680         (WebKit::ViewGestureController::forceRepaintIfNeeded):
681         - Remove unused 'this' from lambda capture.
682
683         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
684         (WebKit::WebVideoFullscreenManager::didExitFullscreen):
685         - Remove unused 'this' from nested lambda captures.
686
687 2017-05-13  Eric Carlson  <eric.carlson@apple.com>
688
689         [MediaStream] deviceId constraint doesn't work with getUserMedia
690         https://bugs.webkit.org/show_bug.cgi?id=171877
691         <rdar://problem/31899730>
692
693         Reviewed by Jer Noble.
694
695         * Shared/WebCoreArgumentCoders.cpp:
696         (IPC::ArgumentCoder<MediaConstraintsData>::encode): Encode deviceIDHashSalt.
697         (IPC::ArgumentCoder<MediaConstraintsData>::decode): Decode deviceIDHashSalt.
698
699         * UIProcess/UserMediaPermissionCheckProxy.cpp:
700         (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy): Initialize
701         completion handler, frame ID, and security origins.
702         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): Complete by calling
703         completion handler because we now sometimes request access info before calling gUM.
704         (WebKit::UserMediaPermissionCheckProxy::invalidate): Clear completion handler.
705         * UIProcess/UserMediaPermissionCheckProxy.h:
706
707         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
708         (WebKit::FrameAuthorizationState::FrameAuthorizationState): Take security origins, not
709         UserMediaPermissionRequestProxy, so it can be constructed with a UserMediaPermissionCheckProxy.
710         (WebKit::FrameAuthorizationState::ensureSecurityOriginsAreEqual): Ditto. Clear has salt
711         when origins don't match.
712         (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest): Templatize.
713         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): Fix typo.
714         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Ditto.
715         Don't set state for empty UIDs. Pass hash salt to web process.
716         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
717         The device ID hash salt is now required to validate constraints, so get it first.
718         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Helper
719         method used to get the device ID hash salt.
720         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Restructure
721         to use getUserMediaPermissionInfo.
722         (WebKit::UserMediaPermissionRequestManagerProxy::didCompleteUserMediaPermissionCheck): Deleted.
723         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
724
725         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
726         (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted): Add device ID
727         hash salt parameter.
728         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
729
730         * WebProcess/WebPage/WebPage.cpp:
731         (WebKit::WebPage::userMediaAccessWasGranted): Ditto.
732         * WebProcess/WebPage/WebPage.h:
733         * WebProcess/WebPage/WebPage.messages.in:
734
735         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
736         (WebKit::UserMediaCaptureManager::createCaptureSource): Use new MediaConstraintsData 
737         constructor.
738
739 2017-05-13  Chris Dumez  <cdumez@apple.com>
740
741         Stop using RefPtr::release()
742         https://bugs.webkit.org/show_bug.cgi?id=172074
743
744         Reviewed by Geoffrey Garen.
745
746         * Platform/unix/SharedMemoryUnix.cpp:
747         (WebKit::SharedMemory::create):
748         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
749         (WebKit::CoordinatedGraphicsScene::createImageBacking):
750         * Shared/cairo/ShareableBitmapCairo.cpp:
751         (WebKit::ShareableBitmap::createCairoSurface):
752         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeFilter.cpp:
753         (WebKit::core):
754         * WebProcess/WebPage/WebPage.cpp:
755         (WebKit::WebPage::getContentsAsMHTMLData):
756
757 2017-05-12  Chris Dumez  <cdumez@apple.com>
758
759         Drop remaining uses of PassRefPtr in WebKit2/WebProcess
760         https://bugs.webkit.org/show_bug.cgi?id=172055
761
762         Reviewed by Alex Christensen.
763
764         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm:
765         (+[WKWebProcessPlugInScriptWorld normalWorld]):
766         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
767         (contextMenuItems):
768         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
769         (WKBundleScriptWorldNormalWorld):
770         * WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp:
771         (webkitScriptWorldCreate):
772         * WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp:
773         (WebKit::InjectedBundleCSSStyleDeclarationHandle::getOrCreate):
774         * WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.h:
775         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
776         (WebKit::InjectedBundleRangeHandle::getOrCreate):
777         (WebKit::InjectedBundleRangeHandle::create):
778         (WebKit::InjectedBundleRangeHandle::coreRange):
779         (WebKit::InjectedBundleRangeHandle::renderedImage):
780         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h:
781         * WebProcess/InjectedBundle/InjectedBundle.cpp:
782         (WebKit::InjectedBundle::create):
783         (WebKit::InjectedBundle::createWebDataFromUint8Array):
784         * WebProcess/InjectedBundle/InjectedBundle.h:
785         * WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp:
786         (WebKit::InjectedBundleBackForwardList::itemAtIndex):
787         * WebProcess/InjectedBundle/InjectedBundleBackForwardList.h:
788         (WebKit::InjectedBundleBackForwardList::detach):
789         * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h:
790         (WebKit::InjectedBundleBackForwardListItem::create):
791         (WebKit::InjectedBundleBackForwardListItem::InjectedBundleBackForwardListItem):
792         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
793         (WebKit::InjectedBundleHitTestResult::nodeHandle):
794         (WebKit::InjectedBundleHitTestResult::urlElementHandle):
795         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.h:
796         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
797         (WebKit::InjectedBundleNavigationAction::create):
798         (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
799         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
800         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
801         (WebKit::InjectedBundleScriptWorld::getOrCreate):
802         (WebKit::InjectedBundleScriptWorld::normalWorld):
803         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
804         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
805         (WebKit::NetscapePlugin::create):
806         (WebKit::NetscapePlugin::NetscapePlugin):
807         (WebKit::NetscapePlugin::supportsSnapshotting):
808         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
809         * WebProcess/Plugins/PDF/PDFPluginAnnotation.h:
810         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
811         (WebKit::PDFPluginAnnotation::create):
812         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.h:
813         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
814         (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement):
815         * WebProcess/Plugins/PDF/PDFPluginPasswordField.h:
816         * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm:
817         (WebKit::PDFPluginPasswordField::createAnnotationElement):
818         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h:
819         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
820         (WebKit::PDFPluginTextAnnotation::createAnnotationElement):
821         * WebProcess/UserContent/WebUserContentController.cpp:
822         (WebKit::worldMap):
823         (WebKit::WebUserMessageHandlerDescriptorProxy::create):
824         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
825         (WebKit::convertImageToBitmap):
826         * WebProcess/WebPage/WebPage.cpp:
827         (WebKit::WebPage::addUserScript):
828         (WebKit::WebPage::addUserStyleSheet):
829         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
830         (WebKit::WebPrintOperationGtk::create):
831         * WebProcess/WebPage/gtk/WebPrintOperationGtk.h:
832         * WebProcess/WebPage/ios/WebPageIOS.mm:
833         (WebKit::rangeForPosition):
834         (WebKit::rangeAtWordBoundaryForPosition):
835         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
836
837 2017-05-12  Alex Christensen  <achristensen@webkit.org>
838
839         Rename WKContentExtension to WKContentRuleList
840         https://bugs.webkit.org/show_bug.cgi?id=172053
841         <rdar://problem/32141005>
842
843         Reviewed by Geoffrey Garen.
844
845         * Shared/API/APIObject.h:
846         * Shared/API/Cocoa/WebKit.h:
847         * Shared/API/c/WKDeprecatedFunctions.cpp:
848         (WKPageGroupAddUserContentFilter):
849         (WKPageGroupRemoveUserContentFilter):
850         * Shared/Cocoa/APIObject.mm:
851         (API::Object::newObject):
852         * Shared/WebCompiledContentExtension.cpp: Removed.
853         * Shared/WebCompiledContentExtension.h: Removed.
854         * Shared/WebCompiledContentExtensionData.cpp: Removed.
855         * Shared/WebCompiledContentExtensionData.h: Removed.
856         * Shared/WebCompiledContentRuleList.cpp: Copied from Source/WebKit2/Shared/WebCompiledContentExtension.cpp.
857         (WebKit::WebCompiledContentRuleList::create):
858         (WebKit::WebCompiledContentRuleList::WebCompiledContentRuleList):
859         (WebKit::WebCompiledContentRuleList::~WebCompiledContentRuleList):
860         (WebKit::WebCompiledContentRuleList::conditionsApplyOnlyToDomain):
861         (WebKit::WebCompiledContentRuleList::filtersWithoutConditionsBytecode):
862         (WebKit::WebCompiledContentRuleList::filtersWithoutConditionsBytecodeLength):
863         (WebKit::WebCompiledContentRuleList::filtersWithConditionsBytecode):
864         (WebKit::WebCompiledContentRuleList::filtersWithConditionsBytecodeLength):
865         (WebKit::WebCompiledContentRuleList::topURLFiltersBytecode):
866         (WebKit::WebCompiledContentRuleList::topURLFiltersBytecodeLength):
867         (WebKit::WebCompiledContentRuleList::actions):
868         (WebKit::WebCompiledContentRuleList::actionsLength):
869         (WebKit::WebCompiledContentExtension::create): Deleted.
870         (WebKit::WebCompiledContentExtension::WebCompiledContentExtension): Deleted.
871         (WebKit::WebCompiledContentExtension::~WebCompiledContentExtension): Deleted.
872         (WebKit::WebCompiledContentExtension::conditionsApplyOnlyToDomain): Deleted.
873         (WebKit::WebCompiledContentExtension::filtersWithoutConditionsBytecode): Deleted.
874         (WebKit::WebCompiledContentExtension::filtersWithoutConditionsBytecodeLength): Deleted.
875         (WebKit::WebCompiledContentExtension::filtersWithConditionsBytecode): Deleted.
876         (WebKit::WebCompiledContentExtension::filtersWithConditionsBytecodeLength): Deleted.
877         (WebKit::WebCompiledContentExtension::topURLFiltersBytecode): Deleted.
878         (WebKit::WebCompiledContentExtension::topURLFiltersBytecodeLength): Deleted.
879         (WebKit::WebCompiledContentExtension::actions): Deleted.
880         (WebKit::WebCompiledContentExtension::actionsLength): Deleted.
881         * Shared/WebCompiledContentRuleList.h: Copied from Source/WebKit2/Shared/WebCompiledContentExtension.h.
882         * Shared/WebCompiledContentRuleListData.cpp: Copied from Source/WebKit2/Shared/WebCompiledContentExtensionData.cpp.
883         (WebKit::WebCompiledContentRuleListData::encode):
884         (WebKit::WebCompiledContentRuleListData::decode):
885         (WebKit::WebCompiledContentExtensionData::encode): Deleted.
886         (WebKit::WebCompiledContentExtensionData::decode): Deleted.
887         * Shared/WebCompiledContentRuleListData.h: Copied from Source/WebKit2/Shared/WebCompiledContentExtensionData.h.
888         (WebKit::WebCompiledContentRuleListData::WebCompiledContentRuleListData):
889         (WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData): Deleted.
890         * Shared/WebPageCreationParameters.cpp:
891         (WebKit::WebPageCreationParameters::encode):
892         (WebKit::WebPageCreationParameters::decode):
893         * Shared/WebPageCreationParameters.h:
894         * UIProcess/API/APIContentExtension.cpp: Removed.
895         * UIProcess/API/APIContentExtension.h: Removed.
896         * UIProcess/API/APIContentExtensionStore.cpp: Removed.
897         * UIProcess/API/APIContentExtensionStore.h: Removed.
898         * UIProcess/API/APIContentRuleList.cpp: Copied from Source/WebKit2/UIProcess/API/APIContentExtension.cpp.
899         (API::ContentRuleList::ContentRuleList):
900         (API::ContentRuleList::~ContentRuleList):
901         (API::ContentExtension::ContentExtension): Deleted.
902         (API::ContentExtension::~ContentExtension): Deleted.
903         * UIProcess/API/APIContentRuleList.h: Copied from Source/WebKit2/UIProcess/API/APIContentExtension.h.
904         * UIProcess/API/APIContentRuleListStore.cpp: Copied from Source/WebKit2/UIProcess/API/APIContentExtensionStore.cpp.
905         (API::ContentRuleListStore::legacyDefaultStore):
906         (API::ContentRuleListStore::nonLegacyDdefaultStore):
907         (API::ContentRuleListStore::defaultStore):
908         (API::ContentRuleListStore::storeWithPath):
909         (API::ContentRuleListStore::ContentRuleListStore):
910         (API::ContentRuleListStore::~ContentRuleListStore):
911         (API::constructedPathPrefix):
912         (API::ContentRuleListMetaData::fileSize):
913         (API::encodeContentRuleListMetaData):
914         (API::decodeContentRuleListMetaData):
915         (API::openAndMapContentRuleList):
916         (API::compiledToFile):
917         (API::createExtension):
918         (API::ContentRuleListStore::lookupContentRuleList):
919         (API::ContentRuleListStore::getAvailableContentRuleListIdentifiers):
920         (API::ContentRuleListStore::compileContentRuleList):
921         (API::ContentRuleListStore::removeContentRuleList):
922         (API::ContentRuleListStore::synchronousRemoveAllContentRuleLists):
923         (API::ContentRuleListStore::invalidateContentRuleListVersion):
924         (API::ContentRuleListStore::getContentRuleListSource):
925         (API::contentRuleListStoreErrorCategory):
926         (API::ContentExtensionStore::defaultStore): Deleted.
927         (API::ContentExtensionStore::storeWithPath): Deleted.
928         (API::ContentExtensionStore::ContentExtensionStore): Deleted.
929         (API::ContentExtensionStore::~ContentExtensionStore): Deleted.
930         (API::ContentExtensionMetaData::fileSize): Deleted.
931         (API::encodeContentExtensionMetaData): Deleted.
932         (API::decodeContentExtensionMetaData): Deleted.
933         (API::openAndMapContentExtension): Deleted.
934         (API::ContentExtensionStore::lookupContentExtension): Deleted.
935         (API::ContentExtensionStore::getAvailableContentExtensionIdentifiers): Deleted.
936         (API::ContentExtensionStore::compileContentExtension): Deleted.
937         (API::ContentExtensionStore::removeContentExtension): Deleted.
938         (API::ContentExtensionStore::synchronousRemoveAllContentExtensions): Deleted.
939         (API::ContentExtensionStore::invalidateContentExtensionVersion): Deleted.
940         (API::ContentExtensionStore::getContentExtensionSource): Deleted.
941         (API::contentExtensionStoreErrorCategory): Deleted.
942         * UIProcess/API/APIContentRuleListStore.h: Copied from Source/WebKit2/UIProcess/API/APIContentExtensionStore.h.
943         (API::make_error_code):
944         * UIProcess/API/C/WKAPICast.h:
945         * UIProcess/API/C/WKPageGroup.cpp:
946         * UIProcess/API/C/WKUserContentControllerRef.cpp:
947         (WKUserContentControllerAddUserContentFilter):
948         (WKUserContentControllerRemoveAllUserContentFilters):
949         * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp:
950         (WKUserContentExtensionStoreGetTypeID):
951         * UIProcess/API/Cocoa/APIUserContentExtensionStoreCocoa.mm:
952         (API::ContentRuleListStore::defaultStorePath):
953         (API::ContentExtensionStore::defaultStorePath): Deleted.
954         * UIProcess/API/Cocoa/WKContentExtension.h: Removed.
955         * UIProcess/API/Cocoa/WKContentExtension.mm: Removed.
956         * UIProcess/API/Cocoa/WKContentExtensionInternal.h: Removed.
957         * UIProcess/API/Cocoa/WKContentExtensionStore.h: Removed.
958         * UIProcess/API/Cocoa/WKContentExtensionStore.mm: Removed.
959         * UIProcess/API/Cocoa/WKContentExtensionStoreInternal.h: Removed.
960         * UIProcess/API/Cocoa/WKContentExtensionStorePrivate.h: Removed.
961         * UIProcess/API/Cocoa/WKContentRuleList.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtension.h.
962         * UIProcess/API/Cocoa/WKContentRuleList.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtension.mm.
963         (-[WKContentRuleList dealloc]):
964         (-[WKContentRuleList _apiObject]):
965         (-[WKContentRuleList identifier]):
966         (-[WKContentExtension dealloc]): Deleted.
967         (-[WKContentExtension _apiObject]): Deleted.
968         (-[WKContentExtension identifier]): Deleted.
969         * UIProcess/API/Cocoa/WKContentRuleListInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtensionInternal.h.
970         (WebKit::wrapper):
971         * UIProcess/API/Cocoa/WKContentRuleListStore.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtensionStore.h.
972         * UIProcess/API/Cocoa/WKContentRuleListStore.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtensionStore.mm.
973         (toWKErrorCode):
974         (-[WKContentRuleListStore dealloc]):
975         (+[WKContentRuleListStore defaultStore]):
976         (+[WKContentRuleListStore storeWithURL:]):
977         (-[WKContentRuleListStore compileContentRuleListForIdentifier:encodedContentRuleList:completionHandler:]):
978         (-[WKContentRuleListStore _compileContentRuleListForIdentifier:encodedContentRuleList:completionHandler:releasesArgument:]):
979         (-[WKContentRuleListStore lookUpContentRuleListForIdentifier:completionHandler:]):
980         (-[WKContentRuleListStore getAvailableContentRuleListIdentifiers:]):
981         (-[WKContentRuleListStore removeContentRuleListForIdentifier:completionHandler:]):
982         (-[WKContentRuleListStore _apiObject]):
983         (-[WKContentRuleListStore _removeAllContentRuleLists]):
984         (-[WKContentRuleListStore _invalidateContentRuleListVersionForIdentifier:]):
985         (-[WKContentRuleListStore _getContentRuleListSourceForIdentifier:completionHandler:]):
986         (-[WKContentRuleListStore _compileContentRuleListForIdentifier:encodedContentRuleList:completionHandler:]):
987         (-[WKContentExtensionStore dealloc]): Deleted.
988         (+[WKContentExtensionStore defaultStore]): Deleted.
989         (+[WKContentExtensionStore storeWithURL:]): Deleted.
990         (-[WKContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]): Deleted.
991         (-[WKContentExtensionStore _compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:releasesArgument:]): Deleted.
992         (-[WKContentExtensionStore lookUpContentExtensionForIdentifier:completionHandler:]): Deleted.
993         (-[WKContentExtensionStore getAvailableContentExtensionIdentifiers:]): Deleted.
994         (-[WKContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]): Deleted.
995         (-[WKContentExtensionStore _apiObject]): Deleted.
996         (-[WKContentExtensionStore _removeAllContentExtensions]): Deleted.
997         (-[WKContentExtensionStore _invalidateContentExtensionVersionForIdentifier:]): Deleted.
998         (-[WKContentExtensionStore _getContentExtensionSourceForIdentifier:completionHandler:]): Deleted.
999         (-[WKContentExtensionStore _compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]): Deleted.
1000         * UIProcess/API/Cocoa/WKContentRuleListStoreInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtensionStoreInternal.h.
1001         (WebKit::wrapper):
1002         * UIProcess/API/Cocoa/WKContentRuleListStorePrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKContentExtensionStorePrivate.h.
1003         * UIProcess/API/Cocoa/WKError.h:
1004         * UIProcess/API/Cocoa/WKError.mm:
1005         (localizedDescriptionForErrorCode):
1006         * UIProcess/API/Cocoa/WKUserContentController.h:
1007         * UIProcess/API/Cocoa/WKUserContentController.mm:
1008         (-[WKUserContentController addContentRuleList:]):
1009         (-[WKUserContentController removeContentRuleList:]):
1010         (-[WKUserContentController removeAllContentRuleLists]):
1011         (-[WKUserContentController _addUserContentFilter:]):
1012         (-[WKUserContentController _removeUserContentFilter:]):
1013         (-[WKUserContentController _removeAllUserContentFilters]):
1014         (-[WKUserContentController addContentExtension:]): Deleted.
1015         (-[WKUserContentController removeContentExtension:]): Deleted.
1016         (-[WKUserContentController removeAllContentExtensions]): Deleted.
1017         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
1018         (toUserContentRuleListStoreError):
1019         (+[_WKUserContentExtensionStore defaultStore]):
1020         (+[_WKUserContentExtensionStore storeWithURL:]):
1021         (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
1022         (-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]):
1023         (-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
1024         (-[_WKUserContentExtensionStore _apiObject]):
1025         (-[_WKUserContentExtensionStore _removeAllContentExtensions]):
1026         (-[_WKUserContentExtensionStore _invalidateContentExtensionVersionForIdentifier:]):
1027         (-[_WKUserContentExtensionStore _initWithWKContentRuleListStore:]):
1028         (toUserContentExtensionStoreError): Deleted.
1029         (-[_WKUserContentExtensionStore _initWithWKContentExtensionStore:]): Deleted.
1030         * UIProcess/API/Cocoa/_WKUserContentExtensionStoreInternal.h:
1031         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
1032         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
1033         (-[_WKUserContentFilter _apiObject]):
1034         (-[_WKUserContentFilter _initWithWKContentRuleList:]):
1035         (-[_WKUserContentFilter _initWithWKContentExtension:]): Deleted.
1036         * UIProcess/API/Cocoa/_WKUserContentFilterInternal.h:
1037         * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
1038         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
1039         (WebKit::WebUserContentControllerProxy::addProcess):
1040         (WebKit::WebUserContentControllerProxy::addContentRuleList):
1041         (WebKit::WebUserContentControllerProxy::removeContentRuleList):
1042         (WebKit::WebUserContentControllerProxy::removeAllContentRuleLists):
1043         (WebKit::WebUserContentControllerProxy::addContentExtension): Deleted.
1044         (WebKit::WebUserContentControllerProxy::removeContentExtension): Deleted.
1045         (WebKit::WebUserContentControllerProxy::removeAllContentExtensions): Deleted.
1046         * UIProcess/UserContent/WebUserContentControllerProxy.h:
1047         * UIProcess/WebPageGroup.cpp:
1048         * WebKit2.xcodeproj/project.pbxproj:
1049         * WebProcess/UserContent/WebUserContentController.cpp:
1050         (WebKit::WebUserContentController::addContentRuleLists):
1051         (WebKit::WebUserContentController::removeContentRuleList):
1052         (WebKit::WebUserContentController::removeAllContentRuleLists):
1053         (WebKit::WebUserContentController::addContentExtensions): Deleted.
1054         (WebKit::WebUserContentController::removeContentExtension): Deleted.
1055         (WebKit::WebUserContentController::removeAllContentExtensions): Deleted.
1056         * WebProcess/UserContent/WebUserContentController.h:
1057         * WebProcess/UserContent/WebUserContentController.messages.in:
1058         * WebProcess/WebPage/WebPage.cpp:
1059         (WebKit::m_backgroundCPULimit):
1060
1061 2017-05-12  Jeremy Jones  <jeremyj@apple.com>
1062
1063         Add objc version of WK2 UIPageClient setHasVideoInPictureInPicture and rename it to hasVideoInPictureInPictureDidChange.
1064         https://bugs.webkit.org/show_bug.cgi?id=172048
1065         rdar://problem/32163054
1066
1067         Reviewed by Simon Fraser.
1068
1069         Rename UIPageClient setHasVideoInPictureInPicture to hasVideoInPictureInPictureDidChange.
1070         Add missing _allowsPictureInPictureMediaPlayback property to WKPreferences.
1071         Add -hasVideoInPictureInPictureDidChange to UIDelegate.
1072
1073         * UIProcess/API/APIUIClient.h:
1074         (API::UIClient::hasVideoInPictureInPictureDidChange):
1075         * UIProcess/API/C/WKPage.cpp:
1076         (WKPageSetPageUIClient):
1077         * UIProcess/API/C/WKPageUIClient.h:
1078         * UIProcess/API/Cocoa/WKPreferences.mm:
1079         (-[WKPreferences _allowsPictureInPictureMediaPlayback]):
1080         (-[WKPreferences _setAllowsPictureInPictureMediaPlayback:]):
1081         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1082         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1083         * UIProcess/Cocoa/UIDelegate.h:
1084         * UIProcess/Cocoa/UIDelegate.mm:
1085         (WebKit::UIDelegate::setDelegate):
1086         (WebKit::UIDelegate::UIClient::hasVideoInPictureInPictureDidChange):
1087         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
1088         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
1089         (WebKit::WebVideoFullscreenManagerProxy::fullscreenModeChanged):
1090
1091 2017-05-12  David Quesada  <david_quesada@apple.com>
1092
1093         Add SPI for overriding WKWebView's clipping behavior for _visibleContentRect
1094         https://bugs.webkit.org/show_bug.cgi?id=172000
1095         rdar://problem/32144756
1096
1097         Reviewed by Simon Fraser.
1098
1099         Extract -[WKWebView _visibleContentRect]'s use of -_scroller to a new property
1100         _enclosingViewForExposedRectComputation, which is declared in the private
1101         header for subclasses to implement custom logic for determining the view to
1102         clip rendering to.
1103
1104         * UIProcess/API/Cocoa/WKWebView.mm:
1105         (-[WKWebView _enclosingViewForExposedRectComputation]):
1106         (-[WKWebView _visibleRectInEnclosingView:]):
1107         (-[WKWebView _visibleContentRect]):
1108         (-[WKWebView _visibleRectInEnclosingScrollView:]): Deleted.
1109         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1110
1111 2017-05-12  Chris Dumez  <cdumez@apple.com>
1112
1113         Stop using PassRefPtr under WebKit2/UIProcess
1114         https://bugs.webkit.org/show_bug.cgi?id=172029
1115
1116         Reviewed by Alex Christensen.
1117
1118         * UIProcess/API/Cocoa/WKWebView.mm:
1119         (-[WKWebView _takeViewSnapshot]):
1120         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1121         * UIProcess/API/gtk/PageClientImpl.cpp:
1122         (WebKit::PageClientImpl::registerEditCommand):
1123         * UIProcess/API/gtk/PageClientImpl.h:
1124         * UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
1125         (getIconSurfaceSynchronously):
1126         * UIProcess/API/gtk/WebKitWebContext.cpp:
1127         * UIProcess/API/wpe/PageClientImpl.cpp:
1128         (WebKit::PageClientImpl::registerEditCommand):
1129         * UIProcess/API/wpe/PageClientImpl.h:
1130         * UIProcess/Cocoa/WebViewImpl.h:
1131         * UIProcess/Cocoa/WebViewImpl.mm:
1132         (WebKit::WebViewImpl::registerEditCommand):
1133         * UIProcess/DefaultUndoController.cpp:
1134         (WebKit::DefaultUndoController::registerEditCommand):
1135         * UIProcess/DefaultUndoController.h:
1136         * UIProcess/Downloads/DownloadProxy.cpp:
1137         (WebKit::DownloadProxy::create):
1138         * UIProcess/Downloads/DownloadProxy.h:
1139         * UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
1140         (WebKit::GeolocationPermissionRequestManagerProxy::createRequest):
1141         * UIProcess/GeolocationPermissionRequestManagerProxy.h:
1142         * UIProcess/InspectorServer/HTTPRequest.cpp:
1143         (WebKit::HTTPRequest::parseHTTPRequestFromBuffer):
1144         * UIProcess/InspectorServer/HTTPRequest.h:
1145         * UIProcess/InspectorServer/WebInspectorServer.cpp:
1146         (WebKit::WebInspectorServer::didReceiveUnrecognizedHTTPRequest):
1147         (WebKit::WebInspectorServer::didReceiveWebSocketUpgradeHTTPRequest):
1148         (WebKit::WebInspectorServer::didEstablishWebSocketConnection):
1149         * UIProcess/InspectorServer/WebInspectorServer.h:
1150         * UIProcess/InspectorServer/WebSocketServerClient.h:
1151         (WebKit::WebSocketServerClient::didReceiveUnrecognizedHTTPRequest):
1152         (WebKit::WebSocketServerClient::didReceiveWebSocketUpgradeHTTPRequest):
1153         (WebKit::WebSocketServerClient::didEstablishWebSocketConnection):
1154         * UIProcess/InspectorServer/WebSocketServerConnection.cpp:
1155         (WebKit::WebSocketServerConnection::readHTTPMessage):
1156         (WebKit::WebSocketServerConnection::upgradeToWebSocketServerConnection):
1157         * UIProcess/InspectorServer/WebSocketServerConnection.h:
1158         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
1159         (WebKit::NotificationPermissionRequestManagerProxy::createRequest):
1160         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h:
1161         * UIProcess/Notifications/WebNotificationProvider.cpp:
1162         (WebKit::WebNotificationProvider::notificationPermissions):
1163         * UIProcess/Notifications/WebNotificationProvider.h:
1164         * UIProcess/PageClient.h:
1165         * UIProcess/Storage/LocalStorageDatabase.cpp:
1166         * UIProcess/WebContextMenuListenerProxy.h:
1167         * UIProcess/WebCookieManagerProxy.h:
1168         * UIProcess/WebEditCommandProxy.cpp:
1169         (WebKit::WebEditCommandProxy::unapply):
1170         (WebKit::WebEditCommandProxy::reapply):
1171         * UIProcess/WebEditCommandProxy.h:
1172         * UIProcess/WebGrammarDetail.cpp:
1173         (WebKit::WebGrammarDetail::create):
1174         * UIProcess/WebGrammarDetail.h:
1175         * UIProcess/WebPageProxy.cpp:
1176         (WebKit::ExceededDatabaseQuotaRecords::createRecord):
1177         (WebKit::WebPageProxy::registerEditCommand):
1178         (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
1179         (WebKit::WebPageProxy::exceededDatabaseQuota):
1180         (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
1181         (WebKit::WebPageProxy::takeViewSnapshot):
1182         * UIProcess/WebPageProxy.h:
1183         * UIProcess/WebProcessPool.cpp:
1184         (WebKit::WebProcessPool::plugInAutoStartOriginHashes):
1185         * UIProcess/WebProcessPool.h:
1186         * UIProcess/WebProcessProxy.h:
1187         * UIProcess/ios/PageClientImplIOS.h:
1188         * UIProcess/ios/PageClientImplIOS.mm:
1189         (-[WKEditCommandObjC initWithWebEditCommandProxy:]):
1190         (WebKit::PageClientImpl::registerEditCommand):
1191         (WebKit::PageClientImpl::saveImageToLibrary):
1192         (WebKit::PageClientImpl::setDragImage):
1193         (WebKit::PageClientImpl::takeViewSnapshot):
1194         * UIProcess/ios/WKGeolocationProviderIOS.mm:
1195         (-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]):
1196         * UIProcess/ios/WebPageProxyIOS.mm:
1197         (WebKit::WebPageProxy::saveImageToLibrary):
1198         * UIProcess/mac/PageClientImpl.h:
1199         * UIProcess/mac/PageClientImpl.mm:
1200         (WebKit::PageClientImpl::registerEditCommand):
1201         (WebKit::PageClientImpl::setDragImage):
1202         (WebKit::PageClientImpl::setPromisedDataForImage):
1203         (WebKit::PageClientImpl::takeViewSnapshot):
1204         * UIProcess/mac/WKImmediateActionController.mm:
1205         (-[WKImmediateActionController _webHitTestResult]):
1206         * UIProcess/mac/WebPageProxyMac.mm:
1207         (WebKit::WebPageProxy::setDragImage):
1208         (WebKit::WebPageProxy::setPromisedDataForImage):
1209         * WebProcess/IconDatabase/WebIconDatabaseProxy.h:
1210
1211 2017-05-12  Jeremy Jones  <jeremyj@apple.com>
1212
1213         Add UIClient callback for when picture-in-picture is activated.
1214         https://bugs.webkit.org/show_bug.cgi?id=172023
1215
1216         Reviewed by Simon Fraser.
1217
1218         Add WKUIPageClientV10 with setHasVideoInPictureInPicture.
1219
1220         * UIProcess/API/APIUIClient.h:
1221         (API::UIClient::setHasVideoInPictureInPicture):
1222         * UIProcess/API/C/WKPage.cpp:
1223         (WKPageSetPageUIClient):
1224         * UIProcess/API/C/WKPageUIClient.h:
1225         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
1226         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
1227         (WebKit::WebVideoFullscreenManagerProxy::fullscreenModeChanged):
1228
1229 2017-05-12  Brent Fulgham  <bfulgham@apple.com>
1230
1231         REGRESSION(r213564): Flash audio playback failures
1232         https://bugs.webkit.org/show_bug.cgi?id=171876
1233         <rdar://problem/32082745>
1234
1235         Reviewed by Alexey Proskuryakov.
1236
1237         The IOKit property filters added in r213564 need to be expanded to support
1238         some Flash features.
1239
1240         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1241
1242 2017-05-12  Brent Fulgham  <bfulgham@apple.com>
1243
1244         [WK2][macOS] Add a mach-lookup exception for 'com.apple.analyticsd'
1245         https://bugs.webkit.org/show_bug.cgi?id=172040
1246         <rdar://problem/31765514>
1247
1248         Reviewed by Alexey Proskuryakov.
1249
1250         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
1251         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1252         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1253         * WebProcess/com.apple.WebProcess.sb.in:
1254
1255 2017-05-12  Simon Fraser  <simon.fraser@apple.com>
1256
1257         Add some logging for layer tree commits, and resize and orientation change events
1258         https://bugs.webkit.org/show_bug.cgi?id=172041
1259
1260         Reviewed by Tim Horton.
1261
1262         Add some logging that's useful during rotation investigations.
1263
1264         * UIProcess/API/Cocoa/WKWebView.mm:
1265         (-[WKWebView _didCommitLayerTree:]):
1266         * UIProcess/ios/WKContentView.mm:
1267         (-[WKContentView _didCommitLayerTree:]):
1268
1269 2017-05-12  Andy Estes  <aestes@apple.com>
1270
1271         [Cocoa] Stop setting a status on PKPaymentRequestShippingContactUpdate when there are errors
1272         https://bugs.webkit.org/show_bug.cgi?id=172036
1273         <rdar://problem/31587957>
1274
1275         Reviewed by Anders Carlsson.
1276
1277         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1278         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
1279
1280 2017-05-12  Chris Dumez  <cdumez@apple.com>
1281
1282         Stop using PassRefPtr under WebKit2/Shared
1283         https://bugs.webkit.org/show_bug.cgi?id=172017
1284
1285         Reviewed by Antti Koivisto.
1286
1287         * Shared/API/APIDictionary.cpp:
1288         (API::Dictionary::add):
1289         (API::Dictionary::set):
1290         * Shared/API/APIDictionary.h:
1291         * Shared/API/APISecurityOrigin.h:
1292         (API::SecurityOrigin::createFromString):
1293         (API::SecurityOrigin::create):
1294         (API::SecurityOrigin::securityOrigin):
1295         (API::SecurityOrigin::SecurityOrigin):
1296         * Shared/API/APISerializedScriptValue.h:
1297         (API::SerializedScriptValue::create):
1298         (API::SerializedScriptValue::SerializedScriptValue):
1299         * Shared/API/c/WKSharedAPICast.h:
1300         (WebKit::ProxyingRefPtr::ProxyingRefPtr):
1301         * Shared/APIWebArchiveResource.h:
1302         * Shared/APIWebArchiveResource.mm:
1303         (API::WebArchiveResource::create):
1304         (API::WebArchiveResource::WebArchiveResource):
1305         * Shared/AsyncRequest.h:
1306         (WebKit::AsyncRequestMap::add):
1307         * Shared/BlobDataFileReferenceWithSandboxExtension.cpp:
1308         (WebKit::BlobDataFileReferenceWithSandboxExtension::BlobDataFileReferenceWithSandboxExtension):
1309         * Shared/BlobDataFileReferenceWithSandboxExtension.h:
1310         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
1311         (WebKit::CoordinatedBackingStoreTile::setBackBuffer):
1312         (WebKit::CoordinatedBackingStore::updateTile):
1313         * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
1314         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1315         (WebKit::CoordinatedGraphicsScene::createUpdateAtlas):
1316         (WebKit::CoordinatedGraphicsScene::updateImageBacking):
1317         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1318         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
1319         (WebKit::NetscapePluginModule::getOrCreate):
1320         * Shared/Plugins/Netscape/NetscapePluginModule.h:
1321         * Shared/VisitedLinkTable.cpp:
1322         (WebKit::VisitedLinkTable::setSharedMemory):
1323         * Shared/VisitedLinkTable.h:
1324         * Shared/WebBackForwardListItem.h:
1325         (WebKit::WebBackForwardListItem::setSnapshot):
1326         * Shared/WebContextMenuItem.cpp:
1327         (WebKit::WebContextMenuItem::create):
1328         * Shared/WebContextMenuItem.h:
1329         * Shared/WebGeolocationPosition.h:
1330         * Shared/WebRenderLayer.cpp:
1331         (WebKit::WebRenderLayer::create):
1332         (WebKit::WebRenderLayer::createArrayFromLayerList):
1333         (WebKit::WebRenderLayer::WebRenderLayer):
1334         * Shared/WebRenderLayer.h:
1335         * Shared/WebRenderObject.cpp:
1336         (WebKit::WebRenderObject::create):
1337         (WebKit::WebRenderObject::WebRenderObject):
1338         * Shared/WebRenderObject.h:
1339         * UIProcess/VisitedLinkStore.cpp:
1340         (WebKit::VisitedLinkStore::resizeTable):
1341         * WebProcess/WebPage/VisitedLinkTableController.cpp:
1342         (WebKit::VisitedLinkTableController::setVisitedLinkTable):
1343
1344 2017-05-11  Brady Eidson  <beidson@apple.com>
1345
1346         [WKWebsiteDataStore removeDataOfTypes:...] doesn't work for IndexedDB if the data store has a custom IDB path.
1347         <rdar://problem/30612463> and https://bugs.webkit.org/show_bug.cgi?id=171994
1348
1349         Reviewed by Andy Estes.
1350         Informal review by Maureen Daum.
1351
1352         * DatabaseProcess/DatabaseProcess.cpp:
1353         (WebKit::DatabaseProcess::deleteWebsiteData): Instead of accessing the m_idbServers set directly, make
1354           the method call that creates the server on demand.
1355         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): Ditto.
1356
1357         * UIProcess/WebProcessPool.cpp:
1358         (WebKit::WebProcessPool::ensureDatabaseProcessAndWebsiteDataStore): Not only create the DatabaseProcess if necessary,
1359           but also notify it about the passed-in WebsiteDataStore.
1360         (WebKit::WebProcessPool::getDatabaseProcessConnection):
1361         (WebKit::WebProcessPool::ensureDatabaseProcess): Deleted.
1362         * UIProcess/WebProcessPool.h:
1363         (WebKit::WebProcessPool::sendToDatabaseProcessRelaunchingIfNecessary):
1364
1365         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1366         (WebKit::WebsiteDataStore::fetchData):
1367         (WebKit::WebsiteDataStore::removeData):
1368         (WebKit::WebsiteDataStore::databaseProcessParameters):
1369
1370 2017-05-11  Dean Jackson  <dino@apple.com>
1371
1372         Modern Media Controls shouldn't be an experimental feature
1373         https://bugs.webkit.org/show_bug.cgi?id=172004
1374         <rdar://problem/32146522>
1375
1376         Reviewed by Simon Fraser.
1377
1378         This is either always on or always off, so shouldn't
1379         show up in an Experimental Features menu.
1380
1381         * Shared/WebPreferencesDefinitions.h: Move ModernMediaControlsEnabled
1382         to a normal preference.
1383
1384 2017-05-11  Tim Horton  <timothy_horton@apple.com>
1385
1386         Mail spins launching spell checker when typing
1387         https://bugs.webkit.org/show_bug.cgi?id=171986
1388         <rdar://problem/26305327>
1389
1390         Reviewed by Beth Dakin.
1391
1392         * UIProcess/API/Cocoa/WKWebView.mm:
1393         (-[WKWebView _setEditable:]):
1394         * UIProcess/Cocoa/WebViewImpl.h:
1395         * UIProcess/Cocoa/WebViewImpl.mm:
1396         (WebKit::WebViewImpl::didBecomeEditable):
1397         (WebKit::WebViewImpl::startObservingFontPanel): Deleted.
1398         Asynchronously pre-warm the spell checker when a WKWebView becomes editable.
1399
1400 2017-05-11  Chris Dumez  <cdumez@apple.com>
1401
1402         Stop using PassRefPtr in platform/graphics
1403         https://bugs.webkit.org/show_bug.cgi?id=171977
1404
1405         Reviewed by Alex Christensen.
1406
1407         Build fix.
1408
1409         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1410         (WebKit::CoordinatedGraphicsScene::createBackingStoreIfNeeded):
1411         (WebKit::CoordinatedGraphicsScene::removeBackingStoreIfNeeded):
1412         * Shared/WebCoreArgumentCoders.cpp:
1413         (IPC::ArgumentCoder<Cursor>::decode):
1414         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1415         (WebKit::CompositingCoordinator::createImageBackingIfNeeded):
1416         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1417         * WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp:
1418         (WebKit::GraphicsLayerCARemote::createPlatformCALayer):
1419         (WebKit::GraphicsLayerCARemote::createPlatformCAAnimation):
1420         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
1421         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
1422         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
1423         (WebKit::PlatformCAAnimationRemote::copy):
1424
1425 2017-05-11  Tim Horton  <timothy_horton@apple.com>
1426
1427         Data loss when saving a PDF form where only radio buttons/checkboxes were modified
1428         https://bugs.webkit.org/show_bug.cgi?id=171991
1429         <rdar://problem/32115945>
1430
1431         Reviewed by Andy Estes.
1432
1433         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
1434         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1435         (-[WKPDFLayerControllerDelegate didChangeAnnotationState]):
1436         Mark the PDF as dirty (so we re-encode it when asked to save) if annotations
1437         that only PDFKit knows about change.
1438
1439 2017-05-11  Joseph Pecoraro  <pecoraro@apple.com>
1440
1441         Remove Vibration API
1442         https://bugs.webkit.org/show_bug.cgi?id=171766
1443
1444         Rubber-stamped by Alexey Proskuryakov.
1445
1446         * CMakeLists.txt:
1447         * Shared/API/APIObject.h:
1448         * Shared/API/c/WKBase.h:
1449         * UIProcess/API/C/WKAPICast.h:
1450         * UIProcess/API/C/WKPage.cpp:
1451         (WKPageGetVibration): Deleted.
1452         * UIProcess/API/C/WKPage.h:
1453         * UIProcess/API/C/WKVibration.cpp: Removed.
1454         * UIProcess/API/C/WKVibration.h: Removed.
1455         * UIProcess/WebPageProxy.cpp:
1456         (WebKit::m_weakPtrFactory):
1457         (WebKit::WebPageProxy::resetState):
1458         * UIProcess/WebPageProxy.h:
1459         (WebKit::WebPageProxy::vibration): Deleted.
1460         * UIProcess/WebVibrationProvider.cpp: Removed.
1461         * UIProcess/WebVibrationProvider.h: Removed.
1462         * UIProcess/WebVibrationProxy.cpp: Removed.
1463         * UIProcess/WebVibrationProxy.h: Removed.
1464         * UIProcess/WebVibrationProxy.messages.in: Removed.
1465         * WebProcess/WebCoreSupport/WebVibrationClient.cpp: Removed.
1466         * WebProcess/WebCoreSupport/WebVibrationClient.h: Removed.
1467         * WebProcess/WebPage/WebPage.cpp:
1468
1469 2017-05-11  Andy Estes  <aestes@apple.com>
1470
1471         Fix a spelling mistake in ApplePayErrorCode
1472         https://bugs.webkit.org/show_bug.cgi?id=171981
1473         <rdar://problem/32136567>
1474
1475         Reviewed by Beth Dakin.
1476
1477         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1478         (WebKit::toPKPaymentErrorCode):
1479         (WebKit::toPKPaymentAuthorizationStatus):
1480
1481 2017-05-11  John Wilander  <wilander@apple.com>
1482
1483         Resource Load Statistics: Enable configuration through preferences
1484         https://bugs.webkit.org/show_bug.cgi?id=171949
1485         <rdar://problem/31894518>
1486
1487         Reviewed by Alex Christensen.
1488
1489         * Shared/WebPreferencesDefinitions.h:
1490             Added ResourceLoadStatisticsTimeToLiveUserInteraction,
1491             ResourceLoadStatisticsTimeToLiveCookiePartitionFree, and
1492             ResourceLoadStatisticsReducedTimestampResolution.
1493         * UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm: Added.
1494         (WebKit::WebResourceLoadStatisticsManager::registerUserDefaultsIfNeeded):
1495         * UIProcess/WebResourceLoadStatisticsManager.h:
1496         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1497         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
1498             Now calls WebResourceLoadStatisticsManager::registerUserDefaultsIfNeeded().
1499         * WebKit2.xcodeproj/project.pbxproj:
1500
1501 2017-05-11  Claudio Saavedra  <csaavedra@igalia.com>
1502
1503         [GTK] Remove notifications guards from GTK API layer
1504         https://bugs.webkit.org/show_bug.cgi?id=170014
1505
1506         Reviewed by Michael Catanzaro.
1507
1508         ENABLE_NOTIFICATIONS in the GTK port is a private option and
1509         disabling it is unsupported, hence remove its guards from the GTK API
1510         layer.
1511
1512         * UIProcess/API/gtk/WebKitWebContext.cpp:
1513         (webkitWebContextConstructed):
1514
1515 2017-05-11  Carlos Garcia Campos  <cgarcia@igalia.com>
1516
1517         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.2 release.
1518
1519         * gtk/NEWS: Add release notes for 2.17.2.
1520
1521 2017-05-11  Claudio Saavedra  <csaavedra@igalia.com>
1522
1523         [GTK] JavaScript prompt uses title of page to be loaded rather than title of current page
1524         https://bugs.webkit.org/show_bug.cgi?id=152690
1525
1526         Reviewed by Michael Catanzaro.
1527
1528         webkit_web_view_get_uri() returns the page to be loaded, use
1529         internal api for this.
1530         * UIProcess/API/gtk/WebKitWebView.cpp:
1531         (webkitWebViewCreateJavaScriptDialog):
1532
1533 2017-05-10  Tim Horton  <timothy_horton@apple.com>
1534
1535         Null deref in WebPage::dictionaryPopupInfoForRange
1536         https://bugs.webkit.org/show_bug.cgi?id=171959
1537         <rdar://problem/20886282>
1538
1539         Reviewed by Beth Dakin.
1540
1541         * WebProcess/WebPage/mac/WebPageMac.mm:
1542         (WebKit::WebPage::dictionaryPopupInfoForRange):
1543         Speculative fix for non-reproducible crash when the startContainer of
1544         the range is in an anonymous node.
1545
1546 2017-05-09  Sam Weinig  <sam@webkit.org>
1547
1548         Remove support for legacy Notifications
1549         https://bugs.webkit.org/show_bug.cgi?id=171487
1550
1551         Reviewed by Jon Lee.
1552
1553         * Configurations/FeatureDefines.xcconfig:
1554         * Shared/WebProcessCreationParameters.cpp:
1555         * Shared/WebProcessCreationParameters.h:
1556         * UIProcess/WebProcessPool.cpp:
1557         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1558         * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
1559         * WebProcess/Notifications/NotificationPermissionRequestManager.h:
1560         * WebProcess/Notifications/WebNotificationManager.cpp:
1561         * WebProcess/Notifications/WebNotificationManager.h:
1562         * WebProcess/WebCoreSupport/WebNotificationClient.cpp:
1563         * WebProcess/WebCoreSupport/WebNotificationClient.h:
1564         * WebProcess/WebPage/WebPage.cpp:
1565         * WebProcess/WebProcess.cpp:
1566         Remove legacy notification specific code.
1567
1568 2017-05-10  Tim Horton  <timothy_horton@apple.com>
1569
1570         Add an experimental feature flag for viewport-fit
1571         https://bugs.webkit.org/show_bug.cgi?id=171948
1572         <rdar://problem/31995518>
1573
1574         Reviewed by Simon Fraser.
1575
1576         * Shared/WebPreferencesDefinitions.h:
1577         * WebProcess/WebPage/WebPage.cpp:
1578         (WebKit::WebPage::updatePreferences):
1579         Add an experimental feature flag.
1580
1581 2017-05-10  Alex Christensen  <achristensen@webkit.org>
1582
1583         Include headers in WebKit.h
1584         https://bugs.webkit.org/show_bug.cgi?id=171943
1585
1586         Reviewed by Dan Bernstein.
1587
1588         * Shared/API/Cocoa/WebKit.h:
1589
1590 2017-05-10  Timothy Horton  <timothy_horton@apple.com>
1591
1592         Disable block selection for dynamic selection granularity
1593         https://bugs.webkit.org/show_bug.cgi?id=171908
1594         <rdar://problem/32098024>
1595
1596         Reviewed by Enrica Casucci.
1597
1598         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1599         (-[WKWebViewConfiguration init]):
1600         (-[WKWebViewConfiguration copyWithZone:]):
1601         (-[WKWebViewConfiguration _allowsBlockSelection]):
1602         (-[WKWebViewConfiguration _setAllowsBlockSelection:]):
1603         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1604         Add a private configuration parameter to re-enable block selection.
1605
1606         * Shared/WebPageCreationParameters.cpp:
1607         (WebKit::WebPageCreationParameters::encode):
1608         (WebKit::WebPageCreationParameters::decode):
1609         * Shared/WebPageCreationParameters.h:
1610         * UIProcess/API/Cocoa/WKWebView.mm:
1611         (-[WKWebView _allowsBlockSelection]):
1612         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1613         * UIProcess/Cocoa/VersionChecks.h:
1614         * UIProcess/PageClient.h:
1615         * UIProcess/WebPageProxy.cpp:
1616         (WebKit::WebPageProxy::creationParameters):
1617         * UIProcess/ios/PageClientImplIOS.h:
1618         * UIProcess/ios/PageClientImplIOS.mm:
1619         (WebKit::PageClientImpl::allowsBlockSelection):
1620         * WebProcess/WebPage/WebPage.cpp:
1621         * WebProcess/WebPage/WebPage.h:
1622         Plumb allowsBlockSelection through from WKWebViewConfiguration to WebPage.
1623
1624         * UIProcess/ios/WKContentViewInteraction.mm:
1625         (-[WKContentView setupInteraction]):
1626         (-[WKContentView useSelectionAssistantWithGranularity:]):
1627         (-[WKContentView _startAssistingKeyboard]):
1628         (-[WKContentView _stopAssistingKeyboard]):
1629         (toUIWebSelectionMode): Deleted.
1630         (-[WKContentView useSelectionAssistantWithMode:]): Deleted.
1631         Stop needlessly converting to UIWebSelectionMode.
1632         
1633         * WebProcess/WebPage/ios/WebPageIOS.mm:
1634         (WebKit::WebPage::shouldSwitchToBlockModeForHandle):
1635         Don't switch to block selection unless allowsBlockSelection is set.
1636
1637 2017-05-10  Tim Horton  <timothy_horton@apple.com>
1638
1639         Add an experimental feature flag for constant properties
1640         https://bugs.webkit.org/show_bug.cgi?id=171913
1641         <rdar://problem/31995518>
1642
1643         Reviewed by Ryosuke Niwa.
1644
1645         * Shared/WebPreferencesDefinitions.h:
1646         * WebProcess/WebPage/WebPage.cpp:
1647         (WebKit::WebPage::updatePreferences):
1648         Add an experimental feature flag.
1649
1650 2017-05-09  Dean Jackson  <dino@apple.com>
1651
1652         Disable WebGL2 by default
1653         https://bugs.webkit.org/show_bug.cgi?id=171894
1654         <rdar://problem/32089917>
1655
1656         Reviewed by Tim Horton.
1657
1658         Some WASM and WebGL2 content is failing because it
1659         detects our WebGL2RenderingContext, but doesn't realise
1660         that we don't implement enough of it to be useful.
1661
1662         * Shared/WebPreferencesDefinitions.h:
1663
1664 2017-05-10  Matt Lewis  <jlewis3@apple.com>
1665
1666         Unreviewed, rolling out r216563.
1667
1668         Revision caused 2 api failures
1669
1670         Reverted changeset:
1671
1672         "[MediaStream] deviceId constraint doesn't work with
1673         getUserMedia"
1674         https://bugs.webkit.org/show_bug.cgi?id=171877
1675         http://trac.webkit.org/changeset/216563
1676
1677 2017-05-10  Claudio Saavedra  <csaavedra@igalia.com>
1678
1679         [GTK] HTTP authentication dialog should focus on first input field
1680         https://bugs.webkit.org/show_bug.cgi?id=151349
1681
1682         Reviewed by Michael Catanzaro.
1683
1684         Setting focus on a widget before it's mapped does nothing. Move
1685         the call to the right place.
1686
1687         * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp:
1688         (webkitAuthenticationDialogInitialize):
1689         (webkitAuthenticationDialogMap):
1690
1691 2017-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>
1692
1693         [GTK] -Wmissing-field-initializers triggered by RemoteInspectorServer.cpp:128
1694         https://bugs.webkit.org/show_bug.cgi?id=171273
1695
1696         Reviewed by Carlos Garcia Campos.
1697
1698         * UIProcess/glib/RemoteInspectorClient.cpp:
1699         (WebKit::RemoteInspectorClient::RemoteInspectorClient):
1700
1701 2017-05-09  Eric Carlson  <eric.carlson@apple.com>
1702
1703         [MediaStream] deviceId constraint doesn't work with getUserMedia
1704         https://bugs.webkit.org/show_bug.cgi?id=171877
1705         <rdar://problem/31899730>
1706
1707         Reviewed by Jer Noble.
1708
1709         * Shared/WebCoreArgumentCoders.cpp:
1710         (IPC::ArgumentCoder<MediaConstraintsData>::encode): Encode deviceIDHashSalt.
1711         (IPC::ArgumentCoder<MediaConstraintsData>::decode): Decode deviceIDHashSalt.
1712
1713         * UIProcess/UserMediaPermissionCheckProxy.cpp:
1714         (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy): Initialize
1715         completion handler, frame ID, and security origins.
1716         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): Complete by calling
1717         completion handler because we now sometimes request access info before calling gUM.
1718         (WebKit::UserMediaPermissionCheckProxy::invalidate): Clear completion handler.
1719         * UIProcess/UserMediaPermissionCheckProxy.h:
1720
1721         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1722         (WebKit::FrameAuthorizationState::FrameAuthorizationState): Take security origins, not
1723         UserMediaPermissionRequestProxy, so it can be constructed with a UserMediaPermissionCheckProxy.
1724         (WebKit::FrameAuthorizationState::ensureSecurityOriginsAreEqual): Ditto. Clear has salt
1725         when origins don't match.
1726         (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest): Templatize.
1727         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): Fix typo.
1728         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Ditto.
1729         Don't set state for empty UIDs. Pass hash salt to web process.
1730         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1731         The device ID hash salt is now required to validate constraints, so get it first.
1732         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Helper
1733         method used to get the device ID hash salt.
1734         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Restructure
1735         to use getUserMediaPermissionInfo.
1736         (WebKit::UserMediaPermissionRequestManagerProxy::didCompleteUserMediaPermissionCheck): Deleted.
1737         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1738
1739         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1740         (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted): Add device ID
1741         hash salt parameter.
1742         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
1743
1744         * WebProcess/WebPage/WebPage.cpp:
1745         (WebKit::WebPage::userMediaAccessWasGranted): Ditto.
1746         * WebProcess/WebPage/WebPage.h:
1747         * WebProcess/WebPage/WebPage.messages.in:
1748
1749         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1750         (WebKit::UserMediaCaptureManager::createCaptureSource): Use new MediaConstraintsData 
1751         constructor.
1752
1753 2017-05-09  Alex Christensen  <achristensen@webkit.org>
1754
1755         Buffer media in NetworkProcess to reduce IPC overhead
1756         https://bugs.webkit.org/show_bug.cgi?id=171834
1757         <rdar://problem/31485485>
1758
1759         Reviewed by Jer Noble.
1760
1761         I have measured a significant CPU usage reduction when buffering media data in the NetworkProcess,
1762         especially on arm64 processors.  Buffering data in the NetworkProcess introduces no additional data
1763         copies after r215686, and it reduces the number of messages sent from the NetworkProcess to the WebProcess,
1764         each of which must also be forwarded to mediaserverd by AVFoundation.  This reduces the number of messages
1765         from thousands per second to a maximum of 20 per second.  This adds 1/20 second additional latency in
1766         media loading, which will probably not be noticed by most users.  This also adds the possibility of large
1767         allocations when decoding IPC messages in the WebProcess, and if that becomes the source of crashes we can
1768         add a maximum buffered amount in addition to a maximum buffered time, but we are likely not to receive
1769         so much data in 1/20 second to have problems allocating the buffer.
1770
1771         * WebProcess/Network/WebLoaderStrategy.cpp:
1772         (WebKit::maximumBufferingTime):
1773         Buffer data in the NetworkProcess for up to 50ms before sending it to the WebProcess in one message.
1774         This value is used in NetworkResourceLoader::didReceiveBuffer to append to m_bufferedData instead of
1775         sending the small chunks immediately.
1776
1777 2017-05-09  Commit Queue  <commit-queue@webkit.org>
1778
1779         Unreviewed, rolling out r216545.
1780         https://bugs.webkit.org/show_bug.cgi?id=171889
1781
1782         Caused a test failure (Requested by eric_carlson on #webkit).
1783
1784         Reverted changeset:
1785
1786         "[MediaStream] deviceId constraint doesn't work with
1787         getUserMedia"
1788         https://bugs.webkit.org/show_bug.cgi?id=171877
1789         http://trac.webkit.org/changeset/216545
1790
1791 2017-05-09  Eric Carlson  <eric.carlson@apple.com>
1792
1793         [MediaStream] deviceId constraint doesn't work with getUserMedia
1794         https://bugs.webkit.org/show_bug.cgi?id=171877
1795         <rdar://problem/31899730>
1796
1797         Reviewed by Jer Noble.
1798
1799         * Shared/WebCoreArgumentCoders.cpp:
1800         (IPC::ArgumentCoder<MediaConstraintsData>::encode): Encode deviceIDHashSalt.
1801         (IPC::ArgumentCoder<MediaConstraintsData>::decode): Decode deviceIDHashSalt.
1802
1803         * UIProcess/UserMediaPermissionCheckProxy.cpp:
1804         (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy): Initialize
1805         completion handler, frame ID, and security origins.
1806         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): Complete by calling
1807         completion handler because we now sometimes request access info before calling gUM.
1808         (WebKit::UserMediaPermissionCheckProxy::invalidate): Clear completion handler.
1809         * UIProcess/UserMediaPermissionCheckProxy.h:
1810
1811         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1812         (WebKit::FrameAuthorizationState::FrameAuthorizationState): Take security origins, not
1813         UserMediaPermissionRequestProxy, so it can be constructed with a UserMediaPermissionCheckProxy.
1814         (WebKit::FrameAuthorizationState::ensureSecurityOriginsAreEqual): Ditto. Clear has salt
1815         when origins don't match.
1816         (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest): Templatize.
1817         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): Fix typo.
1818         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Ditto.
1819         Don't set state for empty UIDs. Pass hash salt to web process.
1820         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1821         The device ID hash salt is now required to validate constraints, so get it first.
1822         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Helper
1823         method used to get the device ID hash salt.
1824         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Restructure
1825         to use getUserMediaPermissionInfo.
1826         (WebKit::UserMediaPermissionRequestManagerProxy::didCompleteUserMediaPermissionCheck): Deleted.
1827         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1828
1829         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1830         (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted): Add device ID
1831         hash salt parameter.
1832         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
1833
1834         * WebProcess/WebPage/WebPage.cpp:
1835         (WebKit::WebPage::userMediaAccessWasGranted): Ditto.
1836         * WebProcess/WebPage/WebPage.h:
1837         * WebProcess/WebPage/WebPage.messages.in:
1838
1839         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1840         (WebKit::UserMediaCaptureManager::createCaptureSource): Use new MediaConstraintsData 
1841         constructor.
1842
1843 2017-05-10  Dean Jackson  <dino@apple.com>
1844
1845         Restrict SVG filters to accessible security origins
1846         https://bugs.webkit.org/show_bug.cgi?id=118689
1847         <rdar://problem/27362159>
1848
1849         Reviewed by Brent Fulgham.
1850
1851         Update parameter lists.
1852
1853         * WebProcess/Plugins/PluginView.cpp:
1854         (WebKit::PluginView::paint):
1855         * WebProcess/Plugins/PluginView.h:
1856
1857 2017-05-09  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
1858
1859         [Coordinated Graphics] Debug Visuals don't hide
1860         https://bugs.webkit.org/show_bug.cgi?id=162704
1861
1862         Reviewed by Žan Doberšek.
1863
1864         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
1865         (IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::encode):
1866         (IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::decode):
1867         (IPC::ArgumentCoder<DebugVisuals>::encode):
1868         (IPC::ArgumentCoder<DebugVisuals>::decode):
1869         The encoder and decoder for DebugVisuals have been added.
1870
1871         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h:
1872         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1873         (WebKit::CoordinatedGraphicsScene::setLayerState):
1874         Update the debug visuals of a layer according to the DebugVisuals information
1875         if the debugVisualsChanged flag is set to true.
1876
1877 2017-05-09  Zan Dobersek  <zdobersek@igalia.com>
1878
1879         Upstream the WPE port
1880         https://bugs.webkit.org/show_bug.cgi?id=171110
1881
1882         Reviewed by Alex Christensen.
1883
1884         webkit-dev thread:
1885         https://lists.webkit.org/pipermail/webkit-dev/2017-April/028923.html
1886
1887         Existing files changed to properly use PLATFORM(WPE) build guards or other
1888         WPE-specific additions (e.g. pasteboard support).
1889         In-file changes removed from this ChangeLog entry for brevity.
1890
1891         * Platform/IPC/glib/GSocketMonitor.cpp:
1892         * PlatformWPE.cmake: Added.
1893         * Scripts/generate-forwarding-headers.pl:
1894         * Shared/API/c/WKBase.h:
1895         * Shared/API/c/wpe/WKBaseWPE.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1896         * Shared/API/c/wpe/WebKit.h: Added.
1897         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
1898         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
1899         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1900         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1901         * Shared/DrawingAreaInfo.h:
1902         * Shared/NativeWebKeyboardEvent.h:
1903         * Shared/NativeWebMouseEvent.h:
1904         * Shared/NativeWebTouchEvent.h:
1905         * Shared/NativeWebWheelEvent.h:
1906         * Shared/WebCoreArgumentCoders.cpp:
1907         * Shared/WebCoreArgumentCoders.h:
1908         * Shared/WebPreferencesDefinitions.h:
1909         * Shared/wpe/NativeWebKeyboardEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1910         * Shared/wpe/NativeWebMouseEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1911         * Shared/wpe/NativeWebTouchEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1912         * Shared/wpe/NativeWebWheelEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1913         * Shared/wpe/ProcessExecutablePathWPE.cpp: Added.
1914         * Shared/wpe/WebEventFactory.cpp: Added.
1915         * Shared/wpe/WebEventFactory.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1916         * UIProcess/API/C/WKAPICast.h:
1917         * UIProcess/API/C/wpe/WKAPICastWPE.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1918         * UIProcess/API/C/wpe/WKView.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1919         * UIProcess/API/C/wpe/WKView.h: Copied from Source/WebKit2/Shared/NativeWebWheelEvent.h.
1920         * UIProcess/API/wpe/CompositingManagerProxy.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1921         * UIProcess/API/wpe/CompositingManagerProxy.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1922         * UIProcess/API/wpe/CompositingManagerProxy.messages.in: Added.
1923         * UIProcess/API/wpe/DrawingAreaProxyWPE.cpp: Added.
1924         * UIProcess/API/wpe/DrawingAreaProxyWPE.h: Copied from Source/WebKit2/Shared/NativeWebWheelEvent.h.
1925         * UIProcess/API/wpe/PageClientImpl.cpp: Added.
1926         * UIProcess/API/wpe/PageClientImpl.h: Added.
1927         * UIProcess/API/wpe/ScrollGestureController.cpp: Added.
1928         * UIProcess/API/wpe/ScrollGestureController.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1929         * UIProcess/API/wpe/WPEView.cpp: Added.
1930         * UIProcess/API/wpe/WPEView.h: Added.
1931         * UIProcess/API/wpe/WPEViewClient.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1932         * UIProcess/API/wpe/WPEViewClient.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1933         * UIProcess/API/wpe/WebKit2InspectorGResourceBundle.xml: Added.
1934         * UIProcess/ChildProcessProxy.cpp:
1935         * UIProcess/Launcher/ProcessLauncher.h:
1936         * UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp: Added.
1937         * UIProcess/WebInspectorProxy.h:
1938         * UIProcess/WebPasteboardProxy.h:
1939         * UIProcess/WebPasteboardProxy.messages.in:
1940         * UIProcess/WebProcessPool.cpp:
1941         * UIProcess/wpe/TextCheckerWPE.cpp: Added.
1942         * UIProcess/wpe/WebInspectorProxyWPE.cpp: Added.
1943         * UIProcess/wpe/WebPageProxyWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1944         * UIProcess/wpe/WebPasteboardProxyWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1945         * UIProcess/wpe/WebPreferencesWPE.cpp: Copied from Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h.
1946         * UIProcess/wpe/WebProcessPoolWPE.cpp: Added.
1947         * WebKit2.xcodeproj/project.pbxproj:
1948         * WebKit2Prefix.h:
1949         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1950         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1951         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1952         * WebProcess/WebCoreSupport/wpe/WebContextMenuClientWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1953         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp: Added.
1954         * WebProcess/WebCoreSupport/wpe/WebPopupMenuWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1955         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
1956         * WebProcess/WebPage/DrawingArea.cpp:
1957         * WebProcess/WebPage/WebPage.cpp:
1958         * WebProcess/WebPage/WebPage.h:
1959         * WebProcess/WebPage/wpe/CompositingManager.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1960         * WebProcess/WebPage/wpe/CompositingManager.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1961         * WebProcess/WebPage/wpe/DrawingAreaWPE.cpp: Added.
1962         * WebProcess/WebPage/wpe/DrawingAreaWPE.h: Added.
1963         * WebProcess/WebPage/wpe/WebInspectorUIWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1964         * WebProcess/WebPage/wpe/WebInspectorWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1965         * WebProcess/WebPage/wpe/WebPageWPE.cpp: Copied from Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h.
1966         * WebProcess/wpe/WebProcessMainWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
1967         * wpe/wpe-webkit.pc.in: Added.
1968
1969 2017-05-09  Carlos Garcia Campos  <cgarcia@igalia.com>
1970
1971         [GTK] Building Webkit2Gtk without OpenGL fails.
1972         https://bugs.webkit.org/show_bug.cgi?id=170959
1973
1974         Reviewed by Žan Doberšek.
1975
1976         * UIProcess/gtk/HardwareAccelerationManager.cpp:
1977         (WebKit::HardwareAccelerationManager::HardwareAccelerationManager):
1978
1979 2017-05-08  Youenn Fablet  <youenn@apple.com>
1980
1981         Follow-up to bug 171710: use more references and reject if either audio or video source creation is failing
1982         https://bugs.webkit.org/show_bug.cgi?id=171824
1983
1984         Reviewed by Alex Christensen.
1985
1986         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
1987         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
1988
1989 2017-05-08  Brent Fulgham  <bfulgham@apple.com>
1990
1991         REGRESSION(r213564): Flash video playback failures
1992         https://bugs.webkit.org/show_bug.cgi?id=171840
1993         <rdar://problem/32041569>
1994
1995         Reviewed by Alexey Proskuryakov.
1996
1997         The sandbox restrictions added in r213564 to prevent access to unused iokit properties
1998         blocked some items needed for Flash video playback. This change relaxes the sandbox
1999         to allow this software to run properly.
2000
2001         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2002
2003 2017-05-08  Alex Christensen  <achristensen@webkit.org>
2004
2005         Reduce PassRefPtr use in WebKit2
2006         https://bugs.webkit.org/show_bug.cgi?id=171831
2007
2008         Reviewed by Chris Dumez.
2009
2010         * UIProcess/API/C/WKPageGroup.cpp:
2011         (WKPageGroupCreateWithIdentifier):
2012         * UIProcess/GenericCallback.h:
2013         (WebKit::GenericCallback::create):
2014         (WebKit::CallbackMap::put):
2015         * UIProcess/StatisticsRequest.cpp:
2016         (WebKit::StatisticsRequest::StatisticsRequest):
2017         * UIProcess/StatisticsRequest.h:
2018         (WebKit::StatisticsRequest::create):
2019         * UIProcess/TextChecker.h:
2020         * UIProcess/TextCheckerCompletion.cpp:
2021         (WebKit::TextCheckerCompletion::create):
2022         * UIProcess/TextCheckerCompletion.h:
2023         * UIProcess/WebColorPicker.h:
2024         (WebKit::WebColorPicker::create):
2025         * UIProcess/WebConnectionToWebProcess.cpp:
2026         (WebKit::WebConnectionToWebProcess::create):
2027         * UIProcess/WebConnectionToWebProcess.h:
2028         * UIProcess/WebContextInjectedBundleClient.cpp:
2029         (WebKit::WebContextInjectedBundleClient::getInjectedBundleInitializationUserData):
2030         * UIProcess/WebContextInjectedBundleClient.h:
2031         * UIProcess/WebContextMenuListenerProxy.h:
2032         (WebKit::WebContextMenuListenerProxy::create):
2033         * UIProcess/WebCookieManagerProxy.cpp:
2034         (WebKit::WebCookieManagerProxy::create):
2035         * UIProcess/WebCookieManagerProxy.h:
2036         * UIProcess/WebEditCommandProxy.h:
2037         (WebKit::WebEditCommandProxy::create):
2038         * UIProcess/WebFormSubmissionListenerProxy.h:
2039         (WebKit::WebFormSubmissionListenerProxy::create):
2040         * UIProcess/WebFrameListenerProxy.h:
2041         * UIProcess/WebFrameProxy.h:
2042         (WebKit::WebFrameProxy::create):
2043         * UIProcess/WebFullScreenManagerProxy.cpp:
2044         (WebKit::WebFullScreenManagerProxy::create):
2045         * UIProcess/WebFullScreenManagerProxy.h:
2046         * UIProcess/WebGeolocationManagerProxy.cpp:
2047         (WebKit::WebGeolocationManagerProxy::create):
2048         * UIProcess/WebGeolocationManagerProxy.h:
2049         * UIProcess/WebIconDatabase.cpp:
2050         (WebKit::WebIconDatabase::create):
2051         (WebKit::WebIconDatabase::iconDataForPageURL):
2052         * UIProcess/WebIconDatabase.h:
2053         * UIProcess/WebMediaSessionFocusManager.cpp:
2054         (WebKit::WebMediaSessionFocusManager::create):
2055         * UIProcess/WebMediaSessionFocusManager.h:
2056         * UIProcess/WebOpenPanelResultListenerProxy.h:
2057         (WebKit::WebOpenPanelResultListenerProxy::create):
2058         * UIProcess/WebPageGroup.cpp:
2059         (WebKit::WebPageGroup::create):
2060         * UIProcess/WebPageGroup.h:
2061         * UIProcess/WebPageProxy.cpp:
2062         (WebKit::WebPageProxy::forceRepaint):
2063         (WebKit::WebPageProxy::computePagesForPrinting):
2064         (WebKit::WebPageProxy::drawRectToImage):
2065         (WebKit::WebPageProxy::drawPagesToPDF):
2066         (WebKit::WebPageProxy::drawPagesForPrinting):
2067         (WebKit::WebPageProxy::callAfterNextPresentationUpdate):
2068         * UIProcess/WebPageProxy.h:
2069         * UIProcess/ios/TextCheckerIOS.mm:
2070         (WebKit::TextChecker::requestCheckingOfString):
2071         * UIProcess/mac/TextCheckerMac.mm:
2072         (WebKit::TextChecker::requestCheckingOfString):
2073         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
2074         * UIProcess/mac/WKFullScreenWindowController.mm:
2075         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
2076         * UIProcess/mac/WKPrintingView.mm:
2077         (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]):
2078         (-[WKPrintingView _drawPreview:]):
2079         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2080         (WebKit::NetscapePlugin::loadURL):
2081         (WebKit::NetscapePlugin::manualStreamDidReceiveResponse):
2082         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
2083         (WebKit::NetscapePluginStream::NetscapePluginStream):
2084         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
2085         (WebKit::NetscapePluginStream::create):
2086         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
2087         (WebKit::toFormData):
2088
2089 2017-05-08  Youenn Fablet  <youenn@apple.com>
2090
2091         Add support for reading and writing settings from UIProcess audio capture
2092         https://bugs.webkit.org/show_bug.cgi?id=171633
2093
2094         Reviewed by Eric Carlson.
2095
2096         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2097         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
2098         (WebKit::UserMediaCaptureManagerProxy::applyConstraints):
2099         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
2100         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
2101         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2102         (WebKit::UserMediaCaptureManager::Source::setSettings):
2103         (WebKit::UserMediaCaptureManager::Source::applyConstraintsSucceeded):
2104         (WebKit::UserMediaCaptureManager::Source::applyConstraintsFailed):
2105         (WebKit::UserMediaCaptureManager::createCaptureSource):
2106         (WebKit::UserMediaCaptureManager::sourceSettingsChanged):
2107         (WebKit::UserMediaCaptureManager::applyConstraints):
2108         (WebKit::UserMediaCaptureManager::applyConstraintsSucceeded):
2109         (WebKit::UserMediaCaptureManager::applyConstraintsFailed):
2110         (WebKit::UserMediaCaptureManager::Source::setMuted): Deleted.
2111         (WebKit::UserMediaCaptureManager::Source::setEnabled): Deleted.
2112         * WebProcess/cocoa/UserMediaCaptureManager.h:
2113         * WebProcess/cocoa/UserMediaCaptureManager.messages.in:
2114
2115 2017-05-08  Alex Christensen  <achristensen@webkit.org>
2116
2117         Reduce PassRefPtr use
2118         https://bugs.webkit.org/show_bug.cgi?id=171809
2119
2120         Reviewed by Chris Dumez.
2121
2122         * PluginProcess/PluginControllerProxy.cpp:
2123         (WebKit::PluginControllerProxy::setInitializationReply):
2124         * PluginProcess/PluginControllerProxy.h:
2125         * PluginProcess/WebProcessConnection.cpp:
2126         (WebKit::WebProcessConnection::destroyPlugin):
2127         (WebKit::WebProcessConnection::createPlugin):
2128         * PluginProcess/WebProcessConnection.h:
2129         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2130         (WebKit::WebChromeClient::runOpenPanel):
2131         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2132         (WebKit::WebEditorClient::registerUndoStep):
2133         * WebProcess/WebPage/VisitedLinkTableController.cpp:
2134         (WebKit::VisitedLinkTableController::getOrCreate):
2135         * WebProcess/WebPage/VisitedLinkTableController.h:
2136         * WebProcess/WebPage/WebFrame.cpp:
2137         (WebKit::WebFrame::hitTest):
2138         (WebKit::WebFrame::createSelectionSnapshot):
2139         * WebProcess/WebPage/WebFrame.h:
2140         * WebProcess/WebPage/WebOpenPanelResultListener.cpp:
2141         (WebKit::WebOpenPanelResultListener::create):
2142         (WebKit::WebOpenPanelResultListener::WebOpenPanelResultListener):
2143         * WebProcess/WebPage/WebOpenPanelResultListener.h:
2144         * WebProcess/WebPage/WebPage.cpp:
2145         (WebKit::WebPage::unapplyEditCommand):
2146         (WebKit::WebPage::reapplyEditCommand):
2147         * WebProcess/WebPage/WebPageGroupProxy.cpp:
2148         (WebKit::WebPageGroupProxy::create):
2149         * WebProcess/WebPage/WebPageGroupProxy.h:
2150         * WebProcess/WebPage/WebUndoStep.cpp:
2151         (WebKit::WebUndoStep::create):
2152         * WebProcess/WebPage/WebUndoStep.h:
2153         (WebKit::WebUndoStep::step):
2154         (WebKit::WebUndoStep::WebUndoStep):
2155         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2156         (WebKit::PlatformCALayerRemote::create):
2157         (WebKit::PlatformCALayerRemote::clone):
2158         (WebKit::PlatformCALayerRemote::animationForKey):
2159         (WebKit::PlatformCALayerRemote::createCompatibleLayer):
2160         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2161         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
2162         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
2163         (WebKit::PlatformCALayerRemoteCustom::create):
2164         (WebKit::PlatformCALayerRemoteCustom::clone):
2165
2166 2017-05-08  Jer Noble  <jer.noble@apple.com>
2167
2168         [Mac] Audio capture fails when shouldCaptureAudioInUIProcess is set.
2169         https://bugs.webkit.org/show_bug.cgi?id=171710
2170
2171         Reviewed by Eric Carlson.
2172
2173         RealtimeMediaSourceCenterMac's setUseAVFoundationAudioCapture() is now accessed via a singleton.
2174
2175         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2176         (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs):
2177
2178 2017-05-08  Andy Estes  <aestes@apple.com>
2179
2180         [macOS] com.macromedia.Flash Player ESR.plugin.sb is installed outside of PlugInSandboxProfiles
2181         https://bugs.webkit.org/show_bug.cgi?id=171774
2182
2183         Reviewed by Dan Bernstein.
2184
2185         * WebKit2.xcodeproj/project.pbxproj:
2186
2187 2017-05-08  Youenn Fablet  <youenn@apple.com>
2188
2189         Clean UserMediaCaptureManager::capabilities return value
2190         https://bugs.webkit.org/show_bug.cgi?id=171808
2191
2192         Reviewed by Eric Carlson.
2193
2194         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2195         (WebKit::UserMediaCaptureManager::capabilities):
2196         * WebProcess/cocoa/UserMediaCaptureManager.h:
2197
2198 2017-05-08  Chris Dumez  <cdumez@apple.com>
2199
2200         Move 'style' from Element to HTMLElement / SVGElement and make it settable
2201         https://bugs.webkit.org/show_bug.cgi?id=171795
2202
2203         Reviewed by Alex Christensen.
2204
2205         Build fix.
2206
2207         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2208         (WebKit::WebEditorClient::shouldApplyStyle):
2209
2210 2017-05-07  Simon Fraser  <simon.fraser@apple.com>
2211
2212         [iOS] REGRESSION (r209409): getBoundingClientRect is wrong for fixed-position elements in resize/orientationchange
2213         https://bugs.webkit.org/show_bug.cgi?id=171140
2214         rdar://problem/31765167
2215
2216         Reviewed by Sam Weinig.
2217
2218         WebPage::dynamicViewportSizeUpdate() is called during rotation, and does a layout which needs to have
2219         an up-to-date layout viewport, since the layout viewport state is detectable in orientationchange and
2220         resize events via fetching the client rect of fixed elements. Normally we send in the layout viewport
2221         from the UI process, but in this case we need to compute one in the web process. So factor code
2222         into FrameView to do the computation, called from both places.
2223
2224         * UIProcess/WebPageProxy.h:
2225         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2226         (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect):
2227         * UIProcess/ios/WKContentView.mm:
2228         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2229         * UIProcess/ios/WebPageProxyIOS.mm:
2230         (WebKit::WebPageProxy::computeCustomFixedPositionRect):
2231         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2232         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2233         * WebProcess/WebPage/ios/WebPageIOS.mm:
2234         (WebKit::WebPage::dynamicViewportSizeUpdate):
2235
2236 2017-05-07  Youenn Fablet  <youenn@apple.com>
2237
2238         [MediaStream] r216197 caused some webrtc tests to fail
2239         https://bugs.webkit.org/show_bug.cgi?id=171728
2240
2241         Reviewed by Eric Carlson.
2242
2243         * UIProcess/UserMediaProcessManager.cpp:
2244         (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Removing muting streams of the page requesting
2245         additional capture streams. This is now done in the WebProcess.
2246
2247 2017-05-07  Tim Horton  <timothy_horton@apple.com>
2248
2249         Clean up some WebProcessProxy, WebPage, and message handler includes
2250         https://bugs.webkit.org/show_bug.cgi?id=171791
2251
2252         Reviewed by Sam Weinig.
2253
2254         This is worth another ~10% off WebKit2 clean build time on Mac.
2255         This time, the most impactful change is the removal of
2256         UserMediaPermissionRequestManager.h from WebPage.h, which completely
2257         eradicates JSC's VM.h (which is enormous) from WebPage.h (at least on Mac).
2258
2259         * Scripts/webkit/messages.py:
2260         (headers_for_type):
2261         Stop specializing CompositionUnderline now that it has its own file.
2262
2263         * Shared/API/c/WKDeprecatedFunctions.cpp:
2264         * Shared/WebCoreArgumentCoders.cpp:
2265         * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
2266         * UIProcess/Gamepad/UIGamepadProvider.cpp:
2267         * UIProcess/HiddenPageThrottlingAutoIncreasesCounter.h: Added.
2268         * UIProcess/HighPerformanceGraphicsUsageSampler.cpp:
2269         * UIProcess/Network/NetworkProcessProxy.cpp:
2270         * UIProcess/PerActivityStateCPUUsageSampler.cpp:
2271         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
2272         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2273         (WebKit::toWebCore):
2274         * UIProcess/VisibleWebPageCounter.h: Added.
2275         * UIProcess/VisitedLinkStore.h:
2276         * UIProcess/WebPageGroup.h:
2277         * UIProcess/WebPageProxy.h:
2278         * UIProcess/WebProcessLifetimeTracker.cpp:
2279         * UIProcess/WebProcessPool.h:
2280         * UIProcess/WebProcessProxy.h:
2281         Remove WebPageProxy and forward-declare a whole bunch of things.
2282
2283         * WebKit2.xcodeproj/project.pbxproj:
2284         * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
2285         * WebProcess/WebPage/WebPage.cpp:
2286         (WebKit::WebPage::userMediaAccessWasGranted):
2287         (WebKit::WebPage::userMediaAccessWasDenied):
2288         (WebKit::WebPage::didCompleteMediaDeviceEnumeration):
2289         (WebKit::WebPage::grantUserMediaDeviceSandboxExtensions):
2290         (WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions):
2291         * WebProcess/WebPage/WebPage.h:
2292         (WebKit::WebPage::userMediaPermissionRequestManager):
2293         * WebProcess/WebPage/ios/FindControllerIOS.mm:
2294         * WebProcess/WebPage/ios/WebPageIOS.mm:
2295         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
2296         (WebKit::RemoteLayerTreeContext::deviceScaleFactor): Deleted.
2297         (WebKit::RemoteLayerTreeContext::layerHostingMode): Deleted.
2298         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
2299         (WebKit::RemoteLayerTreeContext::deviceScaleFactor):
2300         (WebKit::RemoteLayerTreeContext::layerHostingMode):
2301
2302 2017-05-06  Chris Dumez  <cdumez@apple.com>
2303
2304         Align our IDL files with the latest DOM specification
2305         https://bugs.webkit.org/show_bug.cgi?id=171777
2306
2307         Reviewed by Sam Weinig.
2308
2309         GTK build fix.
2310
2311         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
2312         (webkit_dom_document_get_ready_state):
2313
2314 2017-05-06  Tim Horton  <timothy_horton@apple.com>
2315
2316         Reduce the number of includes in WebPage.h and WebProcess.h
2317         https://bugs.webkit.org/show_bug.cgi?id=171779
2318
2319         Reviewed by Sam Weinig.
2320
2321         * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
2322         * WebProcess/Network/NetworkProcessConnection.cpp:
2323         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
2324         * WebProcess/Network/webrtc/LibWebRTCResolver.cpp:
2325         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
2326         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
2327         * WebProcess/WebPage/FindController.cpp:
2328         * WebProcess/WebPage/WebFrame.cpp:
2329         * WebProcess/WebPage/WebPage.cpp:
2330         (WebKit::WebPage::disableEnumeratingAllNetworkInterfaces):
2331         (WebKit::WebPage::enableEnumeratingAllNetworkInterfaces):
2332         (WebKit::WebPage::didReceivePolicyDecision):
2333         * WebProcess/WebPage/WebPage.h:
2334         (WebKit::WebPage::disableEnumeratingAllNetworkInterfaces): Deleted.
2335         (WebKit::WebPage::enableEnumeratingAllNetworkInterfaces): Deleted.
2336         * WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
2337         * WebProcess/WebProcess.cpp:
2338         * WebProcess/WebProcess.h:
2339         In my measurement, this improves WebKit2 debug clean build time by
2340         ~10% for Mac and ~5% for iOS. The most valuable change is the one to
2341         remove LibWebRTC headers..
2342
2343 2017-05-06  Alexey Proskuryakov  <ap@apple.com>
2344
2345         REGRESSION (r216294): The new test fails on WebKit1
2346         https://bugs.webkit.org/show_bug.cgi?id=171780
2347
2348         Rolling back https://trac.webkit.org/r216294, https://trac.webkit.org/r216296,
2349         https://trac.webkit.org/216299, https://trac.webkit.org/216330
2350
2351         * WebProcess/Plugins/PluginView.cpp:
2352         (WebKit::PluginView::paint):
2353         * WebProcess/Plugins/PluginView.h:
2354
2355 2017-05-06  Simon Fraser  <simon.fraser@apple.com>
2356
2357         [iOS WK2] Make rotation tests more reliable
2358         https://bugs.webkit.org/show_bug.cgi?id=171778
2359
2360         Reviewed by Tim Horton.
2361
2362         Switching between "safari-style" rotation and normal rotation left state on the WKWebView
2363         that would cause later viewport-sensitive tests to fail. The WKWebView would be left
2364         with override layout parameters, and an override orientation, and these caused viewport
2365         size to leak into later tests, and WebCore orientation to not get reset correctly.
2366
2367         Also, WKWebView was unregistering for UIWindowDidRotateNotification notifications when
2368         an override orientation was set, and would never re-register, causing lost orientationchanged
2369         events.
2370
2371         Fix by exposing WKWebView SPI to clear the various bits of overide state. Also don't unregister
2372         from the UIWindowDidRotateNotification notification; it's already ignored anyway if it fires.
2373
2374         Also wait for a visible content rect update after resizing the WKWebVeiw between tests, to make sure
2375         the WebProcess is caught up before proceeding with the test.
2376
2377         * UIProcess/API/Cocoa/WKWebView.mm:
2378         (-[WKWebView _setInterfaceOrientationOverride:]):
2379         (-[WKWebView _clearInterfaceOrientationOverride]):
2380         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
2381         (-[WKWebView _clearOverrideLayoutParameters]):
2382         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2383
2384 2017-05-06  Konstantin Tokarev  <annulen@yandex.ru>
2385
2386         Remove unused lambda capture
2387         https://bugs.webkit.org/show_bug.cgi?id=171772
2388
2389         Reviewed by Yusuke Suzuki.
2390
2391         * DatabaseProcess/DatabaseProcess.cpp:
2392         (WebKit::DatabaseProcess::fetchWebsiteData):
2393
2394 2017-05-06  David Kilzer  <ddkilzer@apple.com>
2395
2396         messages_unittest.py should support a [-r|--reset-results] switch
2397         <https://webkit.org/b/171627>
2398
2399         Reviewed by Daniel Bates.
2400
2401         This change adds support for a [-r|--reset-results] switch when
2402         running messages_unittest.py to make it easy to update the
2403         expected file results.
2404
2405         This also cleans up a lot of duplicate code in
2406         messages_unittest.py by extracting common code into new methods
2407         and by pushing code down into methods where it's actually used.
2408
2409         * Scripts/webkit/LegacyMessageReceiver-expected.cpp:
2410         * Scripts/webkit/LegacyMessages-expected.h:
2411         * Scripts/webkit/MessageReceiver-expected.cpp:
2412         * Scripts/webkit/MessageReceiverSuperclass-expected.cpp:
2413         * Scripts/webkit/Messages-expected.h:
2414         * Scripts/webkit/MessagesSuperclass-expected.h:
2415         - Update expected files using the new --reset-results switch.
2416
2417         * Scripts/webkit/messages_unittest.py:
2418         - Remove what appears to be a debugging print statement.
2419         - Replace the code that reads in expected files with variables
2420           that contain the expected file names.  The code to read in the
2421           contents moved into
2422           GeneratedFileContentsTest.assertGeneratedFileContentsEqual().
2423         (ParsingTest.check_message):
2424         - Drive-by fix to change "!= None" to "is not None".
2425         (GeneratedFileContentsTest.assertGeneratedFileContentsEqual):
2426         - Add support for [-r|--reset-results] switch here.  This will
2427           write out updated expected file contents when the switch is
2428           used.
2429         - Push down most of the global code that reads in file contents
2430           into this method.
2431         - Change use of split('\n') into splitlines(False).
2432         (GeneratedFileContentsTest.assertHeaderEqual): Add.
2433         - Extracts common code from test_receiver_headers().
2434         (GeneratedFileContentsTest.assertImplementationEqual): Add.
2435         - Extracts common code from test_receiver_implementations().
2436         (HeaderTest):
2437         (HeaderTest.test_receiver_headers):
2438         - Rename from HeaderTest.test_header().
2439         - Simplify by calling assertHeaderEqual().
2440         (ReceiverImplementationTest):
2441         (ReceiverImplementationTest.test_receiver_implementations):
2442         - Rename from
2443           ReceiverImplementationTest.test_receiver_implementation().
2444         - Simplify by calling assertImplementationEqual().
2445         (add_reset_results_to_unittest_help): Add.
2446         - Inserts help text for [-r|--reset-results] switch.
2447         (parse_sys_argv): Add.
2448         - Parses [-r|--reset-results] switch, and then removes it from
2449           sys.argv.  We do this instead of using argparse so that the
2450           original help for the unittest module is still shown when
2451           using --help.
2452
2453 2017-05-05  Timothy Horton  <timothy_horton@apple.com>
2454
2455         [Mac] Adjust cursor position for dragged link (and stop it from moving based on how fast you are dragging)
2456         https://bugs.webkit.org/show_bug.cgi?id=171764
2457         <rdar://problem/32005865>
2458
2459         Reviewed by Simon Fraser.
2460
2461         * UIProcess/Cocoa/WebViewImpl.mm:
2462         (WebKit::WebViewImpl::dragImageForView):
2463         Always use the last mouse down event to originate the drag; this was a 2004 hack
2464         to work around a seemingly-fixed macOS bug that somehow propagated into WebKit2.
2465         With WebKit2, this would cause trouble because currentEvent could move on
2466         during the bounce to the Web Content process and back, causing the delta between
2467         clientPoint and the mouse point to be dependent on timing, and thus causing the
2468         link to sit at timing-dependent distance from the cursor, instead of exactly
2469         where dragOffsetForLinkDragImage placed it.
2470
2471 2017-05-05  Brady Eidson  <beidson@apple.com>
2472
2473         API test WebKit2.WebsiteDataStoreCustomPaths is failing on ios-simulator.
2474         <rdar://problem/31977294> and https://bugs.webkit.org/show_bug.cgi?id=171513
2475
2476         Reviewed by Andy Estes.
2477
2478         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2479         (WebKit::NetworkProcess::syncAllCookies):
2480
2481 2017-05-05  Dean Jackson  <dino@apple.com>
2482
2483         Restrict SVG filters to accessible security origins
2484         https://bugs.webkit.org/show_bug.cgi?id=118689
2485         <rdar://problem/27362159>
2486
2487         Reviewed by Brent Fulgham.
2488
2489         Update parameter lists.
2490
2491         * WebProcess/Plugins/PluginView.cpp:
2492         (WebKit::PluginView::paint):
2493         * WebProcess/Plugins/PluginView.h:
2494
2495 2017-05-05  Beth Dakin  <bdakin@apple.com>
2496
2497         Ensure NSColorPickerTouchBarItem only uses sRGB colors
2498         https://bugs.webkit.org/show_bug.cgi?id=171758
2499         -and corresponding-
2500         rdar://problem/28314183
2501
2502         Reviewed by Tim Horton.
2503
2504         * UIProcess/Cocoa/WebViewImpl.mm:
2505         (-[WKTextTouchBarItemController itemForIdentifier:]):
2506
2507 2017-05-05  Brent Fulgham  <bfulgham@apple.com>
2508
2509         [WK2][iOS][macOS] Expand sandbox to access vm.footprint_suspend 
2510         https://bugs.webkit.org/show_bug.cgi?id=171749
2511         <rdar://problem/32019494>
2512
2513         Reviewed by Geoffrey Garen.
2514
2515         The 'sysctl' whitelist needs to be extended to support an additional VM-related feature.
2516
2517         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
2518         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2519         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2520         * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb:
2521         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2522         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2523         * WebProcess/com.apple.WebProcess.sb.in:
2524
2525 2017-05-05  John Wilander  <wilander@apple.com>
2526
2527         Resource Load Statistics: Don't cover in-memory and disk caches during website data removal
2528         https://bugs.webkit.org/show_bug.cgi?id=171741
2529         <rdar://problem/32020691>
2530
2531         Reviewed by Brent Fulgham.
2532
2533         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2534         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
2535             No longer removes WebsiteDataType::DiskCache or WebsiteDataType::MemoryCache.
2536
2537 2017-05-05  Brian Burg  <bburg@apple.com>
2538
2539         CrashTracer: [USER] com.apple.WebKit.WebContent.Development at com.apple.WebCore: WebCore::commonVMSlow + 57
2540         https://bugs.webkit.org/show_bug.cgi?id=171669
2541         <rdar://problem/31967684>
2542
2543         Reviewed by Mark Lam.
2544
2545         safaridriver's AutomaticInspection capability causes us to call WebInspectorProxy::connect()
2546         underneath the Automation.inspectBrowsingContext command. This fires a NeedDebuggerBreak
2547         interrupt for the web content's VM, but this is racy because the web content process may
2548         not yet be fully initialized when this interrupt is handled.
2549
2550         To work around this, just don't deliver any interrupts if the VM singleton is still null.
2551         This is a reliable signal that the web content process is not fully initialized yet. Not delivering
2552         is harmless; the interrupt only exists to break out of infinite loops in JS code, but there
2553         could not be any such infinite loop yet if the web content process is not fully initialized.
2554
2555         * WebProcess/WebPage/WebInspectorInterruptDispatcher.cpp:
2556         (WebKit::WebInspectorInterruptDispatcher::notifyNeedDebuggerBreak):
2557
2558 2017-05-05  Brian Burg  <bburg@apple.com>
2559
2560         Web Automation: cookie-related commands don't work correctly
2561         https://bugs.webkit.org/show_bug.cgi?id=171713
2562         <rdar://problem/29829930>
2563
2564         Reviewed by Alexey Proskuryakov.
2565
2566         Commands that use WebCookieManager directly should complete when
2567         the manager's completion handler is called. Otherwise, this will race
2568         with subsequent accesses to cookies via the web process (document.cookie).
2569
2570         Also, these commands need to use the active browsing context's session ID.
2571         They currently use the process pool's storage session, which is wrong
2572         since we specially configure automation instances with an ephemeral store.
2573
2574         * UIProcess/Automation/WebAutomationSession.cpp:
2575         (WebKit::WebAutomationSession::addSingleCookie):
2576         (WebKit::WebAutomationSession::deleteAllCookies):
2577
2578 2017-05-05  Chris Dumez  <cdumez@apple.com>
2579
2580         Rename webProcessDidCrashWithReason callback to webProcessDidTerminate and stop calling webProcessDidCrash for client terminations
2581         https://bugs.webkit.org/show_bug.cgi?id=171624
2582
2583         Reviewed by Dan Bernstein.
2584
2585         Follow-up fixes after r216129 based on feedback I have received:
2586         - Rename webProcessDidCrashWithReason callback function to webProcessDidTerminate given that this is called
2587           for non-crashes (e.g. terminations requested by the client).
2588         - Rename WKProcessCrashReason / ProcessCrashReason to WKProcessTerminationReason / ProcessTerminationReason
2589           for consistency with the new naming.
2590         - Stop calling processDidCrash / webProcessDidCrash for terminations requested by the client, to maintain
2591           pre-r216129 behavior. Those are not crashes (The client used an API such as WKPageTerminateProcess()).
2592           webProcessDidTerminate will still be called though.
2593         - Fix a bug where - for terminations due to resource limits - WebPageProxy::processDidCrash() was getting
2594           called twice: First by WebProcessProxy::requestTermination() with reason "RequestedByClient" then a
2595           second time by WebProcessProxy::terminateProcessDueToResourceLimits() with the proper reason.
2596
2597         * Shared/ProcessTerminationReason.h: Renamed from Source/WebKit2/Shared/ProcessCrashReason.h.
2598         * UIProcess/API/APINavigationClient.h:
2599         (API::NavigationClient::processDidTerminate):
2600         * UIProcess/API/C/WKAPICast.h:
2601         (WebKit::toAPI):
2602         * UIProcess/API/C/WKPage.cpp:
2603         (WKPageTerminate):
2604         (WKPageSetPageNavigationClient):
2605         * UIProcess/API/C/WKPageNavigationClient.h:
2606         * UIProcess/API/C/WKProcessTerminationReason.h: Renamed from Source/WebKit2/UIProcess/API/C/WKProcessCrashReason.h.
2607         * UIProcess/API/Cocoa/WKWebView.mm:
2608         (-[WKWebView _killWebContentProcessAndResetState]):
2609         * UIProcess/Cocoa/NavigationState.h:
2610         * UIProcess/Cocoa/NavigationState.mm:
2611         (WebKit::NavigationState::NavigationClient::processDidTerminate):
2612         * UIProcess/WebPageProxy.cpp:
2613         (WebKit::WebPageProxy::processDidTerminate):
2614         * UIProcess/WebPageProxy.h:
2615         * UIProcess/WebProcessProxy.cpp:
2616         (WebKit::WebProcessProxy::didClose):
2617         (WebKit::WebProcessProxy::requestTermination):
2618         (WebKit::WebProcessProxy::logDiagnosticMessageForResourceLimitTermination):
2619         (WebKit::WebProcessProxy::didExceedActiveMemoryLimit):
2620         (WebKit::WebProcessProxy::didExceedInactiveMemoryLimit):
2621         (WebKit::WebProcessProxy::didExceedBackgroundCPULimit):
2622         * UIProcess/WebProcessProxy.h:
2623         * WebKit2.xcodeproj/project.pbxproj:
2624
2625 2017-05-05  Derek Schuff  <dschuff@chromium.org>
2626
2627         Mac cmake buildfix after r216037
2628         https://bugs.webkit.org/show_bug.cgi?id=171558
2629
2630         Reviewed by JF Bastien.
2631
2632         * PlatformMac.cmake:
2633
2634 2017-05-05  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2635
2636         [GTK] Enable runtime flag for MediaDevices with enable-media-stream property.
2637         https://bugs.webkit.org/show_bug.cgi?id=171730
2638
2639         Reviewed by Michael Catanzaro.
2640
2641         After r215939 the MediaDevices runtime setting has to be enabled
2642         also to use MediaStream / WebRTC.
2643
2644         Enable it as part of the enable-media-stream property of the
2645         WebKitGTK+ API.
2646
2647         * UIProcess/API/gtk/WebKitSettings.cpp:
2648         (webkit_settings_set_enable_media_stream):
2649
2650 2017-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2651
2652         [GTK] Assertion failure in Inspector::RemoteInspector::setRemoteInspectorClient when disposing WebKitWebContext
2653         https://bugs.webkit.org/show_bug.cgi?id=171644
2654
2655         Reviewed by Michael Catanzaro.
2656
2657         Ensure that it's not possible to enable automation in more than one WebKitWebContext at the same time. Instead
2658         of creating the AutomationClient unconditionally when the context is constructed, it's now created only when
2659         automation is enabled, and deleted if it's disabled.
2660
2661         * UIProcess/API/gtk/WebKitWebContext.cpp:
2662         (webkitWebContextConstructed):
2663         (webkit_web_context_is_automation_allowed):
2664         (webkit_web_context_set_automation_allowed):
2665         * UIProcess/Cocoa/AutomationClient.mm:
2666         (WebKit::AutomationClient::AutomationClient):
2667         (WebKit::AutomationClient::~AutomationClient):
2668
2669 2017-05-04  Commit Queue  <commit-queue@webkit.org>
2670
2671         Unreviewed, rolling out r216206.
2672         https://bugs.webkit.org/show_bug.cgi?id=171714
2673
2674         Multiple LayoutTests crashing in Document::page() (Requested
2675         by ap on #webkit).
2676
2677         Reverted changeset:
2678
2679         "Remove support for legacy Notifications"
2680         https://bugs.webkit.org/show_bug.cgi?id=171487
2681         http://trac.webkit.org/changeset/216206
2682
2683 2017-05-04  Mark Lam  <mark.lam@apple.com>
2684
2685         NeverDestroyed<String>(ASCIILiteral(...)) is not thread safe.
2686         https://bugs.webkit.org/show_bug.cgi?id=171586
2687         <rdar://problem/31873190>
2688
2689         Reviewed by Yusuke Suzuki.
2690
2691         * Shared/API/APIError.cpp:
2692         (API::Error::webKitErrorDomain):
2693         (API::Error::webKitNetworkErrorDomain):
2694         (API::Error::webKitPolicyErrorDomain):
2695         (API::Error::webKitPluginErrorDomain):
2696         (API::Error::webKitDownloadErrorDomain):
2697         (API::Error::webKitPrintErrorDomain):
2698         * Shared/WebPreferencesKeys.cpp:
2699         * UIProcess/WebPageProxy.cpp:
2700         (WebKit::WebPageProxy::executeEditCommand):
2701         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2702         (WebKit::WebEditorClient::didBeginEditing):
2703         (WebKit::WebEditorClient::respondToChangedContents):
2704         (WebKit::WebEditorClient::respondToChangedSelection):
2705         (WebKit::WebEditorClient::didEndEditing):
2706
2707 2017-05-04  Jeremy Jones  <jeremyj@apple.com>
2708
2709         Add mute to WebPlaybackSessionModel.
2710         https://bugs.webkit.org/show_bug.cgi?id=171592
2711         rdar://problem/31814074
2712
2713         Reviewed by Jer Noble.
2714
2715         Plumb through muted.
2716
2717         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
2718         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in:
2719         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
2720         (WebKit::WebPlaybackSessionModelContext::toggleMuted):
2721         (WebKit::WebPlaybackSessionModelContext::setMuted):
2722         (WebKit::WebPlaybackSessionManagerProxy::setMuted):
2723         (WebKit::WebPlaybackSessionManagerProxy::toggleMuted):
2724         * WebProcess/cocoa/WebPlaybackSessionManager.h:
2725         * WebProcess/cocoa/WebPlaybackSessionManager.messages.in:
2726         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
2727         (WebKit::WebPlaybackSessionInterfaceContext::mutedChanged):
2728         (WebKit::WebPlaybackSessionManager::mutedChanged):
2729         (WebKit::WebPlaybackSessionManager::toggleMuted):
2730
2731 2017-05-04  Wenson Hsieh  <wenson_hsieh@apple.com>
2732
2733         [WK2] Image action sheets sometimes do not dismiss when beginning data interaction
2734         https://bugs.webkit.org/show_bug.cgi?id=171687
2735         <rdar://problem/31996534>
2736
2737         Reviewed by Beth Dakin.
2738
2739         When presenting an image sheet using WKActionSheetAssistant, we may present the popover asynchronously. In this
2740         case, even if -cleanupSheet is invoked after -showImageSheet, the popover will still be presented. To fix this,
2741         add a flag, _hasPendingActionSheet, that is set to true when an image action sheet will be presented in the
2742         future.
2743
2744         In cleanupSheet, we revert this flag to NO, and in the sheet presentation block, we first check to see if there
2745         is a pending action sheet. If there is not, then simply do not invoke the image sheet presentation block.
2746
2747         * UIProcess/ios/WKActionSheetAssistant.mm:
2748         (-[WKActionSheetAssistant showImageSheet]):
2749         (-[WKActionSheetAssistant cleanupSheet]):
2750
2751 2017-05-04  Wenson Hsieh  <wenson_hsieh@apple.com>
2752
2753         [WK2] Add support for keeping the selection in a focused editable element when dragging begins
2754         https://bugs.webkit.org/show_bug.cgi?id=171585
2755         <rdar://problem/31544320>
2756
2757         Reviewed by Beth Dakin and Zalan Bujtas.
2758
2759         Minor adjustments and refactoring in WebKit2. See WebCore ChangeLog for more details.
2760
2761         * UIProcess/WebPageProxy.cpp:
2762         (WebKit::WebPageProxy::startDrag):
2763         (WebKit::WebPageProxy::didStartDrag):
2764
2765         Factor out code in WebPageProxy that sends a WebPage::DidStartDrag message to the web process into a separate
2766         helper, and tweak the places where we directly send this IPC message to the web process to instead call this
2767         helper.
2768
2769         * UIProcess/WebPageProxy.h:
2770         * UIProcess/mac/WebPageProxyMac.mm:
2771         (WebKit::WebPageProxy::setDragImage):
2772         * WebProcess/WebPage/WebPage.cpp:
2773         (WebKit::WebPage::didStartDrag):
2774         (WebKit::WebPage::dragCancelled):
2775
2776         Clear out state in the web process and call out to the EventHandler to handle drag cancellation and the drag
2777         start response from the UI process.
2778
2779         * WebProcess/WebPage/WebPage.h:
2780         (WebKit::WebPage::didStartDrag): Deleted.
2781         (WebKit::WebPage::dragCancelled): Deleted.
2782
2783 2017-05-04  Sam Weinig  <sam@webkit.org>
2784
2785         Remove support for legacy Notifications
2786         https://bugs.webkit.org/show_bug.cgi?id=171487
2787
2788         Reviewed by Jon Lee.
2789
2790         * Configurations/FeatureDefines.xcconfig:
2791         * Shared/WebProcessCreationParameters.cpp:
2792         * Shared/WebProcessCreationParameters.h:
2793         * UIProcess/WebProcessPool.cpp:
2794         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2795         * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
2796         * WebProcess/Notifications/NotificationPermissionRequestManager.h:
2797         * WebProcess/Notifications/WebNotificationManager.cpp:
2798         * WebProcess/Notifications/WebNotificationManager.h:
2799         * WebProcess/WebCoreSupport/WebNotificationClient.cpp:
2800         * WebProcess/WebCoreSupport/WebNotificationClient.h:
2801         * WebProcess/WebPage/WebPage.cpp:
2802         * WebProcess/WebProcess.cpp:
2803         Remove legacy notification specific code.
2804
2805 2017-05-04  Eric Carlson  <eric.carlson@apple.com>
2806
2807         [MediaStream] Allow host application to enable/disable media capture
2808         https://bugs.webkit.org/show_bug.cgi?id=171292
2809         <rdar://problem/31821492>
2810
2811         Reviewed by Jer Noble.
2812
2813         * UIProcess/API/C/WKPage.cpp:
2814         (WKPageSetMediaCaptureEnabled): New.
2815         (WKPageGetMediaCaptureEnabled): New.
2816         * UIProcess/API/C/WKPagePrivate.h:
2817
2818         * UIProcess/API/Cocoa/WKWebView.mm:
2819         (-[WKWebView _setMediaCaptureEnabled:]): New.
2820         (-[WKWebView _mediaCaptureEnabled]): New.
2821         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2822
2823         * UIProcess/Cocoa/UIDelegate.mm:
2824         (WebKit::UIDelegate::setDelegate): Initialize webViewRequestUserMediaAuthorizationForDevicesURLMainFrameURLDecisionHandler
2825         and webViewCheckUserMediaPermissionForURLMainFrameURLFrameIdentifierDecisionHandler on macOS
2826         and iOS.
2827
2828         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2829         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
2830         Initialize the rejection timer.
2831         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
2832         Call invalidatePendingRequests.
2833         (WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests): Invalidate all
2834         pending requests.
2835         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
2836         (WebKit::UserMediaPermissionRequestManagerProxy::rejectionTimerFired): Reject a promise and
2837         schedule the timer if there are any others pending.
2838         (WebKit::UserMediaPermissionRequestManagerProxy::scheduleNextRejection): 
2839         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Don't
2840         prompt the user if capture is disabled.
2841         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Deleted.
2842         (WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState): Deleted.
2843         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2844
2845         * UIProcess/UserMediaProcessManager.cpp:
2846         (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Stop capture in the current
2847         page on iOS.
2848         (WebKit::UserMediaProcessManager::setCaptureEnabled):
2849         * UIProcess/UserMediaProcessManager.h:
2850
2851         * UIProcess/WebPageProxy.cpp:
2852         (WebKit::WebPageProxy::setMediaCaptureEnabled):
2853
2854         * UIProcess/WebPageProxy.h:
2855         (WebKit::WebPageProxy::mediaCaptureEnabled):
2856
2857         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2858         (WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): New, cancel all pending
2859         requests.
2860         (WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest): Deny the request.
2861         (WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration):
2862         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
2863
2864         * WebProcess/WebPage/WebPage.cpp:
2865         (WebKit::WebPage::stopMediaCapture):
2866         * WebProcess/WebPage/WebPage.h:
2867         * WebProcess/WebPage/WebPage.messages.in:
2868
2869 2017-05-04  Konstantin Tokarev  <annulen@yandex.ru>
2870
2871         Fix compilation with ICU 59.1
2872         https://bugs.webkit.org/show_bug.cgi?id=171612
2873
2874         Reviewed by Mark Lam.
2875
2876         ICU 59.1 has broken source compatibility. Now it defines UChar as
2877         char16_t, which does not allow automatic type conversion from unsigned
2878         short in C++ code.
2879
2880         * Shared/API/c/WKString.cpp:
2881         (WKStringGetCharacters):
2882
2883 2017-05-04  Dan Bernstein  <mitz@apple.com>
2884
2885         [Cocoa] -[WKWebsiteDataStore httpCookieStore] is declared in the main @interface but implemented in a category
2886         https://bugs.webkit.org/show_bug.cgi?id=171657
2887
2888         Reviewed by Sam Weinig.
2889
2890         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2891         (-[WKWebsiteDataStore httpCookieStore]): Moved from the WKPrivate category into the main
2892           @implementation block.
2893
2894 2017-05-04  Andy Estes  <aestes@apple.com>
2895
2896         [Cocoa] Add an optional width parameter to -[WKWebProcessPlugInNodeHandle renderedImageWithOptions:]
2897         https://bugs.webkit.org/show_bug.cgi?id=171646
2898         <rdar://problem/30306321>
2899
2900         Reviewed by Tim Horton.
2901
2902         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
2903         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
2904         (-[WKWebProcessPlugInNodeHandle renderedImageWithOptions:]): Called
2905         -renderedImageWithOptions:width: with a nil width.
2906         (-[WKWebProcessPlugInNodeHandle renderedImageWithOptions:width:]): Passed an optional width
2907         to InjectedBundleNodeHandle::renderedImage().
2908         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
2909         (WebKit::imageForRect): If a width is specified, create an image graphics context at that
2910         width, preserving the aspect ratio of paintingRect.
2911         (WebKit::InjectedBundleNodeHandle::renderedImage):
2912         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
2913
2914 2017-05-04  Commit Queue  <commit-queue@webkit.org>
2915
2916         Unreviewed, rolling out r216172.
2917         https://bugs.webkit.org/show_bug.cgi?id=171654
2918
2919         FTBFS for iOS due to missing WebPageProxy::stopMediaCapture()
2920         implementation. (Requested by ddkilzer on #webkit).
2921
2922         Reverted changeset:
2923
2924         "[MediaStream] Allow host application to enable/disable media
2925         capture"
2926         https://bugs.webkit.org/show_bug.cgi?id=171292
2927         http://trac.webkit.org/changeset/216172
2928
2929 2017-05-04  Carlos Garcia Campos  <cgarcia@igalia.com>
2930
2931         [Threaded Compositor] SHOULD NEVER BE REACHED in WebKit::CompositingRunLoop::updateCompleted
2932         https://bugs.webkit.org/show_bug.cgi?id=171336
2933
2934         Reviewed by Michael Catanzaro.
2935
2936         We are assuming that all calls to ThreadedCompositor::renderLayerTree() happen because of an scheduled update,
2937         but that's not true in the case of ThreadedCompositor::forceRepaint(). In that case we never want to call
2938         CompositingRunLoop::updateCompleted().
2939
2940         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2941         (WebKit::ThreadedCompositor::forceRepaint):
2942         (WebKit::ThreadedCompositor::sceneUpdateFinished):
2943         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
2944
2945 2017-05-04  David Kilzer  <ddkilzer@apple.com>
2946
2947         check-webkit-style exits with an error while parsing Source/WebKit2/Scripts/webkit/ directory: KeyError: 'st'
2948         <https://bugs.webkit.org/show_bug.cgi?id=171510>
2949
2950         Reviewed by Daniel Bates.
2951
2952         The problem was that 'import parser' was ambiguous since there
2953         is a built-in parser module that comes with Python.  Changing
2954         'import parser' to 'from webkit import parser' fixed the error
2955         in check-webkit-style (and pylint) by forcing it to load the
2956         local 'parser' module, but then running messages_unittest.py
2957         directly would fail because .../Source/WebKit2/Scripts was not
2958         in the module search path by default.  This is fixed by using
2959         sys.path.append() to add .../Source/WebKit2/Scripts to the
2960         module search path based on the path to messages_unittest.py.
2961
2962         As an added bonus, this patch also fixes all webkit-style issues
2963         in Source/WebKit2/Scripts/webkit/*.py files.
2964
2965         * Scripts/webkit/messages.py:
2966         - Separate local module imports from built-in modules for
2967           consistency.
2968         - Fix whitespace issues for check-webkit-style, and remove stray
2969           semi-colon.
2970         * Scripts/webkit/messages_unittest.py:
2971         - Update sys.path to find the 'webkit' module based on the path
2972           to messages_unittest.py.  This makes 'from webkit import ...'
2973           statements work when running messages_unittest.py directly.
2974         - Change 'messages' and 'parser' modules to use
2975           'from webkit import ...' format for consistency.
2976         - Fix whitespace issues for check-webkit-style.
2977         * Scripts/webkit/model.py:
2978         - Fix whitespace issue for check-webkit-style.
2979         * Scripts/webkit/parser.py:
2980         - Fix whitespace issue for check-webkit-style.
2981
2982 2017-05-03  Eric Carlson  <eric.carlson@apple.com>
2983
2984         [MediaStream] Allow host application to enable/disable media capture
2985         https://bugs.webkit.org/show_bug.cgi?id=171292
2986         <rdar://problem/31821492>
2987
2988         Reviewed by Jer Noble.
2989
2990         * UIProcess/API/C/WKPage.cpp:
2991         (WKPageSetMediaCaptureEnabled): New.
2992         (WKPageGetMediaCaptureEnabled): New.
2993         * UIProcess/API/C/WKPagePrivate.h:
2994
2995         * UIProcess/API/Cocoa/WKWebView.mm:
2996         (-[WKWebView _setMediaCaptureEnabled:]): New.
2997         (-[WKWebView _mediaCaptureEnabled]): New.
2998         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2999
3000         * UIProcess/Cocoa/UIDelegate.mm:
3001         (WebKit::UIDelegate::setDelegate): Initialize webViewRequestUserMediaAuthorizationForDevicesURLMainFrameURLDecisionHandler
3002         and webViewCheckUserMediaPermissionForURLMainFrameURLFrameIdentifierDecisionHandler on macOS
3003         and iOS.
3004
3005         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3006         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
3007         Initialize the rejection timer.
3008         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
3009         Call invalidatePendingRequests.
3010         (WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests): Invalidate all
3011         pending requests.
3012         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
3013         (WebKit::UserMediaPermissionRequestManagerProxy::rejectionTimerFired): Reject a promise and
3014         schedule the timer if there are any others pending.
3015         (WebKit::UserMediaPermissionRequestManagerProxy::scheduleNextRejection): 
3016         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Don't
3017         prompt the user if capture is disabled.
3018         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Deleted.
3019         (WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState): Deleted.
3020         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
3021
3022         * UIProcess/UserMediaProcessManager.cpp:
3023         (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Stop capture in the current
3024         page on iOS.
3025         (WebKit::UserMediaProcessManager::setCaptureEnabled):
3026         * UIProcess/UserMediaProcessManager.h:
3027
3028         * UIProcess/WebPageProxy.cpp:
3029         (WebKit::WebPageProxy::setMediaCaptureEnabled):
3030
3031         * UIProcess/WebPageProxy.h:
3032         (WebKit::WebPageProxy::mediaCaptureEnabled):
3033
3034         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
3035         (WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): New, cancel all pending
3036         requests.
3037         (WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest): Deny the request.
3038         (WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration):
3039         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
3040
3041         * WebProcess/WebPage/WebPage.cpp:
3042         (WebKit::WebPage::stopMediaCapture):
3043         * WebProcess/WebPage/WebPage.h:
3044         * WebProcess/WebPage/WebPage.messages.in:
3045
3046 2017-05-03  John Wilander  <wilander@apple.com>
3047
3048         Resource Load Statistics: Remove all statistics for modifiedSince website data removals
3049         https://bugs.webkit.org/show_bug.cgi?id=171584
3050         <rdar://problem/24702576>
3051
3052         Reviewed by Brent Fulgham.
3053
3054         These are all test infrastructure changes.
3055
3056         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
3057         (WKResourceLoadStatisticsManagerClearInMemoryAndPersistentStoreModifiedSinceHours):
3058         * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
3059         * UIProcess/WebResourceLoadStatisticsManager.cpp:
3060         (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStoreModifiedSinceHours):
3061         * UIProcess/WebResourceLoadStatisticsManager.h:
3062
3063 2017-05-03  Timothy Horton  <timothy_horton@apple.com>
3064
3065         Maintain interaction information imageURL as a URL, not a string
3066         https://bugs.webkit.org/show_bug.cgi?id=171639
3067
3068         Reviewed by Sam Weinig.
3069
3070         * Shared/ios/InteractionInformationAtPosition.h:
3071         * UIProcess/ios/WKContentViewInteraction.mm:
3072         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
3073         (-[WKContentView _previewItemController:commitPreview:]):
3074         * WebProcess/WebPage/ios/WebPageIOS.mm:
3075         (WebKit::WebPage::getPositionInformation):
3076
3077 2017-05-03  Commit Queue  <commit-queue@webkit.org>
3078
3079         Unreviewed, rolling out r216160 and r216161.
3080         https://bugs.webkit.org/show_bug.cgi?id=171640
3081
3082         These changes broke the iOS build. (Requested by mlewis13 on
3083         #webkit).
3084
3085         Reverted changesets:
3086
3087         "[MediaStream] Allow host application to enable/disable media
3088         capture"
3089         https://bugs.webkit.org/show_bug.cgi?id=171292
3090         http://trac.webkit.org/changeset/216160
3091
3092         "[MediaStream] Allow host application to enable/disable media
3093         capture"
3094         https://bugs.webkit.org/show_bug.cgi?id=171292
3095         http://trac.webkit.org/changeset/216161
3096
3097 2017-05-03  Eric Carlson  <eric.carlson@apple.com>
3098
3099         [MediaStream] Allow host application to enable/disable media capture
3100         https://bugs.webkit.org/show_bug.cgi?id=171292
3101         <rdar://problem/31821492>
3102
3103         Unreviewed build fix.
3104
3105         * UIProcess/WebPageProxy.cpp:
3106         (WebKit::WebPageProxy::clearUserMediaState):
3107         * UIProcess/WebPageProxy.h:
3108
3109 2017-05-03  Eric Carlson  <eric.carlson@apple.com>
3110
3111         [MediaStream] Allow host application to enable/disable media capture
3112         https://bugs.webkit.org/show_bug.cgi?id=171292
3113         <rdar://problem/31821492>
3114
3115         Reviewed by Jer Noble.
3116
3117         * UIProcess/API/C/WKPage.cpp:
3118         (WKPageSetMediaCaptureEnabled): New.
3119         (WKPageGetMediaCaptureEnabled): New.
3120         (WKPageClearUserMediaState): Deleted, unused.
3121         * UIProcess/API/C/WKPagePrivate.h:
3122
3123         * UIProcess/API/Cocoa/WKWebView.mm:
3124         (-[WKWebView _setMediaCaptureEnabled:]): New.
3125         (-[WKWebView _mediaCaptureEnabled]): New.
3126         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3127
3128         * UIProcess/Cocoa/UIDelegate.mm:
3129         (WebKit::UIDelegate::setDelegate): Initialize webViewRequestUserMediaAuthorizationForDevicesURLMainFrameURLDecisionHandler
3130         and webViewCheckUserMediaPermissionForURLMainFrameURLFrameIdentifierDecisionHandler on macOS
3131         and iOS.
3132
3133         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3134         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
3135         Initialize the rejection timer.
3136         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
3137         Call invalidatePendingRequests.
3138         (WebKit::UserMediaPermissionRequestManagerProxy::invalidatePendingRequests): Invalidate all
3139         pending requests.
3140         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
3141         (WebKit::UserMediaPermissionRequestManagerProxy::rejectionTimerFired): Reject a promise and
3142         schedule the timer if there are any others pending.
3143         (WebKit::UserMediaPermissionRequestManagerProxy::scheduleNextRejection): 
3144         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Don't
3145         prompt the user if capture is disabled.
3146         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Deleted.
3147         (WebKit::UserMediaPermissionRequestManagerProxy::clearCachedState): Deleted.
3148         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
3149
3150         * UIProcess/UserMediaProcessManager.cpp:
3151         (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Stop capture in the current
3152         page on iOS.
3153         (WebKit::UserMediaProcessManager::setCaptureEnabled):
3154         * UIProcess/UserMediaProcessManager.h:
3155
3156         * UIProcess/WebPageProxy.cpp:
3157         (WebKit::WebPageProxy::setMediaCaptureEnabled):
3158         (WebKit::WebPageProxy::clearUserMediaState): Deleted.
3159
3160         * UIProcess/WebPageProxy.h:
3161         (WebKit::WebPageProxy::mediaCaptureEnabled):
3162
3163         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
3164         (WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): New, cancel all pending
3165         requests.
3166         (WebKit::UserMediaPermissionRequestManager::cancelUserMediaRequest): Deny the request.
3167         (WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration):
3168         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
3169
3170         * WebProcess/WebPage/WebPage.cpp:
3171         (WebKit::WebPage::stopMediaCapture):
3172         * WebProcess/WebPage/WebPage.h:
3173         * WebProcess/WebPage/WebPage.messages.in:
3174
3175 2017-05-03  Tim Horton  <timothy_horton@apple.com>
3176
3177         Maintain interaction information URL as a URL, not a string
3178         https://bugs.webkit.org/show_bug.cgi?id=171623
3179
3180         Reviewed by Simon Fraser.
3181
3182         * Shared/ios/InteractionInformationAtPosition.h:
3183         * UIProcess/ios/WKContentViewInteraction.mm:
3184         (-[WKContentView _showAttachmentSheet]):
3185         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
3186         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
3187         * UIProcess/ios/WKPDFView.mm:
3188         (-[WKPDFView annotation:isBeingPressedAtPoint:controller:]):
3189         (-[WKPDFView actionSheetAssistant:performAction:]):
3190         * WebProcess/WebPage/ios/WebPageIOS.mm:
3191         (WebKit::WebPage::getPositionInformation):
3192
3193 2017-05-03  Simon Fraser  <simon.fraser@apple.com>
3194
3195         Have WKWebView call _updateVisibleContentRects for the current transaction if possible, rather than always delaying
3196         https://bugs.webkit.org/show_bug.cgi?id=171619
3197         
3198         Also fixes webkit.org/b/170153 and webkit.org/b/170195
3199
3200         Reviewed by Tim Horton.
3201
3202         In r214391 we started adding the pre-commit handler in a dispatch_async() to ensure that
3203         the handler would always run, since we couldn't reliably test the phase of the current
3204         transaction. Now that problem has been solved (rdar://problem/31253952) we can go back to
3205         checking the transaction phase on newer iOS versions. If we're too late for the current transaction
3206         we still need to dispatch_async() to get into the next one.
3207
3208         * UIProcess/API/Cocoa/WKWebView.mm:
3209         (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]):
3210         (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
3211
3212 2017-05-03  Chris Dumez  <cdumez@apple.com>
3213
3214         REGRESSION (r216129): ASSERTION FAILED: m_process->state() == WebProcessProxy::State::Terminated
3215         https://bugs.webkit.org/show_bug.cgi?id=171616
3216
3217         Reviewed by Brady Eidson.
3218
3219         Stop calling resetStateAfterProcessExited() in WebPageProxy::terminateProcess() as the call to
3220         WebProcessProxy::requestTermination() already causes WebPageProxy::processDidCrash() to be called
3221         after r216129. WebPageProxy::processDidCrash() already takes care of calling
3222         resetStateAfterProcessExited().
3223
3224         * UIProcess/WebPageProxy.cpp:
3225         (WebKit::WebPageProxy::terminateProcess):
3226
3227 2017-05-03  Brady Eidson  <beidson@apple.com>
3228
3229         Handle KVO updating of the "hasOnlySecureContent" before a page results in an HTTP auth challenge.
3230         https://bugs.webkit.org/show_bug.cgi?id=171607
3231
3232         Reviewed by Andy Estes.
3233         
3234         To test this fix we'd need the combination of an HTTPD inside API tests, so no test for now.
3235
3236         * UIProcess/PageLoadState.cpp:
3237         (WebKit::PageLoadState::hasOnlySecureContent): If the state is provisional, check the provisional URL instead.
3238
3239 2017-05-03  Chris Dumez  <cdumez@apple.com>
3240
3241         [WK2] Extend processDidCrash delegate to let the client know the reason for the crash
3242         https://bugs.webkit.org/show_bug.cgi?id=171565
3243         <rdar://problem/31204417>
3244
3245         Reviewed by Sam Weinig.
3246
3247         Extend processDidCrash delegate to let the client know the reason for the crash. This
3248         is needed by some clients to distinguish actual crashes from terminations due to
3249         resource limits.
3250
3251         * Shared/ProcessCrashReason.h: Added.
3252         * UIProcess/API/APINavigationClient.h:
3253         (API::NavigationClient::processDidCrash):
3254         * UIProcess/API/C/WKAPICast.h:
3255         (WebKit::toAPI):
3256         * UIProcess/API/C/WKPage.cpp:
3257         (WKPageSetPageNavigationClient):
3258         * UIProcess/API/C/WKPageNavigationClient.h:
3259         * UIProcess/API/C/WKProcessCrashReason.h: Added.
3260         * UIProcess/Cocoa/NavigationState.h:
3261         * UIProcess/Cocoa/NavigationState.mm:
3262         (WebKit::NavigationState::NavigationClient::processDidCrash):
3263         * UIProcess/WebPageProxy.cpp:
3264         (WebKit::WebPageProxy::processDidCrash):
3265         * UIProcess/WebPageProxy.h:
3266         * UIProcess/WebProcessProxy.cpp:
3267         (WebKit::WebProcessProxy::didClose):
3268         (WebKit::WebProcessProxy::requestTermination):
3269         (WebKit::diagnosticLoggingKeyForTerminationReason):
3270         (WebKit::toProcessCrashReason):
3271         (WebKit::WebProcessProxy::terminateProcessDueToResourceLimits):
3272         (WebKit::WebProcessProxy::didExceedActiveMemoryLimit):
3273         (WebKit::WebProcessProxy::didExceedInactiveMemoryLimit):
3274         (WebKit::WebProcessProxy::didExceedBackgroundCPULimit):
3275         * UIProcess/WebProcessProxy.h:
3276         * WebKit2.xcodeproj/project.pbxproj:
3277
3278 2017-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3279
3280         [GTK] Add GTK+ implementation of WebAutomationSession
3281         https://bugs.webkit.org/show_bug.cgi?id=171431
3282
3283         Reviewed by Michael Catanzaro.
3284
3285         Add platform dependent methods for GTK+ to synthesize events.
3286
3287         * PlatformGTK.cmake:
3288         * UIProcess/API/gtk/WebKitUIClient.cpp: Always resize the window for web views controlled by automation.
3289         * UIProcess/Automation/WebAutomationSession.cpp:
3290         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
3291         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
3292         (WebKit::WebAutomationSession::performMouseInteraction):
3293         (WebKit::WebAutomationSession::performKeyboardInteractions):
3294         * UIProcess/Automation/WebAutomationSession.h:
3295         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp: Added.
3296         (WebKit::modifiersToEventState):
3297         (WebKit::mouseButtonToGdkButton):
3298         (WebKit::doMouseEvent):
3299         (WebKit::doMotionEvent):
3300         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
3301         (WebKit::doKeyStrokeEvent):
3302         (WebKit::keyCodeForVirtualKey):
3303         (WebKit::WebAutomationSession::platformSimulateKeyStroke):
3304         (WebKit::WebAutomationSession::platformSimulateKeySequence):
3305         (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
3306
3307 2017-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3308
3309         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.1 release.
3310
3311         * gtk/NEWS: Add release notes for 2.17.1.
3312
3313 2017-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3314
3315         [Soup] Add request headers to network load metrics
3316         https://bugs.webkit.org/show_bug.cgi?id=171545
3317
3318         Reviewed by Sergio Villar Senin.
3319
3320         This will make the headers to appear in the web inspector.
3321
3322         Fixes: http/tests/inspector/network/resource-request-headers.html
3323
3324         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3325         (WebKit::NetworkDataTaskSoup::didGetHeaders):
3326
3327 2017-05-02  Simon Fraser  <simon.fraser@apple.com>
3328
3329         Dynamically added position:fixed element is in the wrong place
3330         https://bugs.webkit.org/show_bug.cgi?id=170280
3331         rdar://problem/31374008
3332
3333         Reviewed by Tim Horton.
3334
3335         Layers for position:fixed elements have their positions reconciled after scrolls
3336         via AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions() and GraphicsLayerCA::syncPosition(),
3337         which updates the GraphicsLayer's position, but does not push it to the PlatformCALayer.
3338
3339         This bug was a case where a position:fixed element gained a fixed ancestor, so had a GraphicsLayerCA whose
3340         position had been updated via syncPosition() in the past. A subsequent layout updated the GraphicsLayerCA position,
3341         but to a value that was the same as its pre-sync position, so the PlatformCALayerRemote's position didn't change,
3342         but there was no signal to the UI process to restore the layer's pre-scrolled position.
3343
3344         Fix by avoiding the early return in PlatformCALayerRemote::setPosition(), to ensure that GraphicsLayerCA
3345         geometry updates in the web process always send new positions to the UI process.
3346
3347         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3348         (WebKit::PlatformCALayerRemote::setPosition):
3349
3350 2017-05-02  Gwang Yoon Hwang  <yoon@igalia.com>
3351
3352         [GTK] Drop coordinated surfaces from the compositing thread as soon as possible
3353         https://bugs.webkit.org/show_bug.cgi?id=171544
3354
3355         Reviewed by Žan Doberšek.
3356
3357         Released coordinated surface from the main thread didn't be freed until
3358         next commit message because the deletion of coordinated surfaces is
3359         considered as a part of scene state.  We need to release corresponding
3360         surfaces whenever the compositing coordinator drops update atlases to
3361         reduce memory usages.
3362
3363         No new tests, only an optimization.
3364
3365         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
3366         Remove atlasesToRemove from the GraphicsState. it is not a commit
3367         state anymore.
3368         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
3369         (WebKit::CoordinatedGraphicsScene::syncUpdateAtlases):
3370         (WebKit::CoordinatedGraphicsScene::releaseUpdateAtlases):
3371         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
3372         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3373         (WebKit::CompositingCoordinator::releaseAtlases): Pass the list of
3374         released update atlases to the compositing thread right after cleaning
3375         up deactivated update atlases.
3376         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
3377         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
3378         (WebKit::CompositingCoordinator::clearPendingStateChanges):
3379         (WebKit::CompositingCoordinator::removeUpdateAtlas):
3380         (WebKit::CompositingCoordinator::releaseAtlases):
3381         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
3382         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
3383         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
3384         (WebKit::ThreadedCoordinatedLayerTreeHost::releaseUpdateAtlases):
3385         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
3386
3387 2017-05-02  Timothy Horton  <timothy_horton@apple.com>
3388
3389         Inform clients when viewport-fit state changes, so they can recompute insets
3390         https://bugs.webkit.org/show_bug.cgi?id=171573
3391         <rdar://problem/31947614>
3392
3393         Reviewed by Simon Fraser.
3394
3395         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3396         * UIProcess/API/Cocoa/WKWebView.mm:
3397         (-[WKWebView _didChangeAvoidsUnsafeArea]):
3398         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3399         * UIProcess/ios/PageClientImplIOS.mm:
3400         (WebKit::PageClientImpl::didChangeAvoidsUnsafeArea):
3401         For clients who use setObscuredInsets/setUnobscuredSafeAreaInsets
3402         themselves, we need to let them know when the current state of
3403         viewport-fit changes so that they can recompute the insets.
3404
3405 2017-05-02  Gwang Yoon Hwang  <yoon@igalia.com>
3406
3407         [GTK] Recycle textures while handling tiles
3408         https://bugs.webkit.org/show_bug.cgi?id=171541
3409
3410         Reviewed by Žan Doberšek.
3411
3412         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
3413         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
3414         Whenever we create new tiles or delete tiles, CoordGfx creates and
3415         deletes textures accordingly.  We should avoid this kind of heavy
3416         operations whenever possible.  This patch modifies to use the texture
3417         pool to reduce texture allocations.  Also this patch reduces number of
3418         resetting textures, which is also expensive operation.
3419         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp: