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