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