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