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