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