[WTF] Introduce Thread class and use RefPtr<Thread> and align Windows Threading imple...
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2017-04-12  Yusuke Suzuki  <utatane.tea@gmail.com>
2
3         [WTF] Introduce Thread class and use RefPtr<Thread> and align Windows Threading implementation semantics to Pthread one
4         https://bugs.webkit.org/show_bug.cgi?id=170502
5
6         Reviewed by Mark Lam.
7
8         Mechanical change. Use Thread:: APIs.
9
10         * NetworkProcess/NetworkProcess.cpp:
11         (WebKit::NetworkProcess::initializeNetworkProcess):
12         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
13         (WebKit::NetworkCache::IOChannel::readSyncInThread):
14         * Platform/IPC/Connection.cpp:
15         (IPC::Connection::processIncomingMessage):
16         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
17         (WebKit::XPCServiceInitializer):
18         * UIProcess/linux/MemoryPressureMonitor.cpp:
19         (WebKit::MemoryPressureMonitor::MemoryPressureMonitor):
20         * WebProcess/WebProcess.cpp:
21         (WebKit::WebProcess::initializeWebProcess):
22
23 2017-04-10  Antti Koivisto  <antti@apple.com>
24
25         Cache small media resources in disk cache
26         https://bugs.webkit.org/show_bug.cgi?id=170676
27         <rdar://problem/31532649>
28
29         Reviewed by Andreas Kling.
30
31         * NetworkProcess/cache/NetworkCache.cpp:
32         (WebKit::NetworkCache::makeRetrieveDecision):
33
34             Allow retrieving media resources.
35
36         (WebKit::NetworkCache::expectedTotalResourceSizeFromContentRange):
37         (WebKit::NetworkCache::expectedTotalResourceSize):
38         (WebKit::NetworkCache::makeStoreDecision):
39
40             Store media resource if we can figure out its total size and it is less than 5MB
41             (and it is cacheable by the usual rules).
42
43 2017-04-12  Alex Christensen  <achristensen@webkit.org>
44
45         Modernize vector adoption
46         https://bugs.webkit.org/show_bug.cgi?id=170758
47
48         Reviewed by Geoffrey Garen.
49
50         * NetworkProcess/capture/NetworkCaptureEvent.cpp:
51         (WebKit::NetworkCapture::JSONCoder<WebCore::SharedBuffer>::decode):
52         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
53         (WebKit::WebPlatformStrategies::bufferForType):
54
55 2017-04-12  Zan Dobersek  <zdobersek@igalia.com>
56
57         Unreviewed GTK+ debug build fix. Drop an unused debug-only member
58         variable in the CompositingRunLoop class.
59
60         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
61
62 2017-04-11  Zan Dobersek  <zdobersek@igalia.com>
63
64         [GTK] Use the DisplayRefreshMonitor facilities
65         https://bugs.webkit.org/show_bug.cgi?id=170599
66
67         Reviewed by Carlos Garcia Campos.
68
69         ThreadedCompositor gains a DisplayRefreshMonitor member that it can use
70         to better coordinate display refresh callbacks on the main thread. Still,
71         because currently the GTK+ port doesn't have a reliable way of notifying
72         the ThreadedCompositor of a vsync event, a timer targeting 60FPS is used
73         in order to keep the updates at a reasonable rate. When the timer is fired,
74         the ThreadedCompositor decides how to proceed based on state changes that
75         might have occurred during composition or whether there's any display
76         refresh callbacks that require handling on the main thread.
77
78         CompositingRunLoop now stores its state in an atomic variable that's then
79         inspected whenever a new update is scheduled or completed. When scheduled,
80         if there's no update in progress, a new update is requested through the
81         timer. If there's already an update in progress, a new update is marked
82         as pending after the current one completes. In that case, when the update
83         is completed, a new update is requested through the timer.
84
85         ThreadedDisplayRefreshMonitor is used to coordinate updates between the
86         main and the composition thread whenever the CoordinatedGraphics state
87         demands it, or whenever there are clients registered to that monitor that
88         require an update (e.g. a requestAnimationFrame() callback). After the
89         update on the composition thread is finished, and the DisplayRefreshMonitor
90         object requires an update, a callback at the same priority as the layer
91         flush timer is scheduled on the main thread. In that callback we handle
92         any clients registered for this DisplayRefreshMonitor before proceeding
93         to handle any changes to the CoordinatedGraphics scene. In case the
94         DisplayRefreshMonitor clients or the layer flushes already queued up
95         any changes to the state, we immediately ask the ThreadedCompositor for
96         an update.
97
98         * PlatformGTK.cmake:
99         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
100         (WebKit::CoordinatedGraphicsScene::updateViewport):
101         (WebKit::CoordinatedGraphicsScene::commitSceneState):
102         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
103         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
104         (WebKit::CompositingRunLoop::CompositingRunLoop):
105         (WebKit::CompositingRunLoop::isActive):
106         (WebKit::CompositingRunLoop::scheduleUpdate):
107         (WebKit::CompositingRunLoop::stopUpdates):
108         (WebKit::CompositingRunLoop::updateCompleted):
109         (WebKit::CompositingRunLoop::updateTimerFired):
110         (WebKit::CompositingRunLoop::isCurrent):
111         (WebKit::CompositingRunLoop::startUpdateTimer): Deleted.
112         (WebKit::CompositingRunLoop::stopUpdateTimer): Deleted.
113         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
114         (): Deleted.
115         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
116         (WebKit::m_displayRefreshMonitor):
117         (WebKit::ThreadedCompositor::invalidate):
118         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing):
119         (WebKit::ThreadedCompositor::updateViewport):
120         (WebKit::ThreadedCompositor::scheduleDisplayImmediately):
121         (WebKit::ThreadedCompositor::renderLayerTree):
122         (WebKit::ThreadedCompositor::sceneUpdateFinished):
123         (WebKit::ThreadedCompositor::updateSceneState):
124         (WebKit::ThreadedCompositor::displayRefreshMonitor):
125         (WebKit::ThreadedCompositor::renderNextFrameIfNeeded):
126         (WebKit::ThreadedCompositor::completeCoordinatedUpdateIfNeeded):
127         (WebKit::ThreadedCompositor::coordinateUpdateCompletionWithClient):
128         (WebKit::ThreadedCompositor::performFrameCompletion):
129         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
130         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp: Added.
131         (WebKit::ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor):
132         (WebKit::ThreadedDisplayRefreshMonitor::requestRefreshCallback):
133         (WebKit::ThreadedDisplayRefreshMonitor::requiresDisplayRefreshCallback):
134         (WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback):
135         (WebKit::ThreadedDisplayRefreshMonitor::invalidate):
136         (WebKit::ThreadedDisplayRefreshMonitor::displayRefreshCallback):
137         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h: Copied from Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h.
138         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
139         (WebKit::AcceleratedDrawingArea::createDisplayRefreshMonitor):
140         * WebProcess/WebPage/AcceleratedDrawingArea.h:
141         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
142         (WebKit::ThreadedCoordinatedLayerTreeHost::createDisplayRefreshMonitor):
143         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
144         * WebProcess/WebPage/LayerTreeHost.h:
145         (WebKit::LayerTreeHost::createDisplayRefreshMonitor):
146
147 2017-04-11  Alex Christensen  <achristensen@webkit.org>
148
149         Modernize and clean up code
150         https://bugs.webkit.org/show_bug.cgi?id=170752
151
152         Reviewed by Sam Weinig.
153
154         * NetworkProcess/NetworkResourceLoader.h:
155         * Shared/WebPreferencesStore.h:
156         * UIProcess/API/APIHitTestResult.cpp:
157         (API::HitTestResult::create):
158         * UIProcess/API/APIHitTestResult.h:
159         * UIProcess/API/C/WKPreferences.cpp:
160         (WKPreferencesCreate):
161         (WKPreferencesCreateWithIdentifier):
162         (WKPreferencesCreateCopy):
163         * UIProcess/Authentication/AuthenticationChallengeProxy.h:
164         * UIProcess/WebPreferences.cpp:
165         (WebKit::WebPreferences::createWithLegacyDefaults):
166         (WebKit::WebPreferences::copy):
167         * UIProcess/WebPreferences.h:
168         * WebProcess/Network/WebLoaderStrategy.h:
169         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
170         (WebKit::WebEditorClient::requestCheckingOfString):
171         * WebProcess/WebPage/WebPage.cpp:
172         (WebKit::WebPage::addTextCheckingRequest):
173         * WebProcess/WebPage/WebPage.h:
174         * WebProcess/WebPage/ios/WebPageIOS.mm:
175         (WebKit::WebPage::rangeForWebSelectionAtPosition):
176         (WebKit::WebPage::rangeForBlockAtPoint):
177         (WebKit::WebPage::expandedRangeFromHandle):
178         (WebKit::WebPage::contractedRangeFromHandle):
179         (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle):
180         (WebKit::WebPage::changeBlockSelection):
181         (WebKit::WebPage::rangeForGranularityAtPoint):
182         (WebKit::WebPage::computePagesForPrintingAndDrawToPDF):
183
184 2017-04-11  Dean Jackson  <dino@apple.com>
185
186         Disable outdated WritableStream API
187         https://bugs.webkit.org/show_bug.cgi?id=170749
188         <rdar://problem/31446233>
189
190         Reviewed by Tim Horton.
191
192         The API we implement is no longer accurate. Disable it until we
193         are compatible with the new specification
194
195         * Configurations/FeatureDefines.xcconfig:
196
197 2017-04-11  Dan Bernstein  <mitz@apple.com>
198
199         [Cocoa] WebKit unnecessarily soft-links CorePrediction
200         https://bugs.webkit.org/show_bug.cgi?id=170644
201
202         Reviewed by Sam Weinig.
203
204         * Configurations/BaseTarget.xcconfig: Defined HAVE_CORE_PREDICTION and added
205           HAVE_CORE_PREDICTION to the preprocessor defintions when the former is YES.
206
207         * Configurations/WebKit.xcconfig: Have the linker link against CorePrediction where
208           available. On macOS, use weak linking, because CorePrediction is not available in the
209           Base System.
210
211         * Platform/classifier/cocoa/CorePredictionSoftLink.h: Removed.
212
213         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: Guarded with
214           #if HAVE(CORE_PREDICTION).
215         (WebKit::isNullFunctionPointer): Added this helper.
216         (WebKit::ResourceLoadStatisticsClassifierCocoa::canUseCorePrediction): Replaced
217           dlopen()-based runtime check with a null check.
218
219         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h: Guarded with #if
220           HAVE(CORE_PREDICTION).
221
222         * Platform/spi/Cocoa/CorePredictionSPI.h: Added.
223
224         * UIProcess/WebResourceLoadStatisticsStore.h: Updated guards to include HAVE(CORE_PREDICTION).
225
226         * WebKit2.xcodeproj/project.pbxproj: pdated file references for removal and addition.
227
228 2017-04-11  David Quesada  <david_quesada@apple.com>
229
230         Add SPI for handling geolocation authorization requests
231         https://bugs.webkit.org/show_bug.cgi?id=170362
232         rdar://problem/17508627
233
234         Reviewed by Alex Christensen.
235
236         Add a new WKUIDelegate method for the WKGeolocationProviderIOS to call when a web page
237         requests geolocation access. To support testing this change, make it possible to override
238         the CoreLocation abstraction WKGeolocationProviderIOS uses. There is now a configurable
239         object on the process pool that implements a protocol for providing location updates for
240         web views in the process pool. If the client doesn't provide this object,
241         WKGeolocationProviderIOS falls back to an object that wraps the existing WebKit1
242         WebGeolocationCoreLocationProvider and conforms to the new protocol.
243
244         * Shared/Cocoa/APIObject.mm:
245         (API::Object::newObject):
246         * Shared/WebGeolocationPosition.h:
247         (WebKit::WebGeolocationPosition::create):
248         * UIProcess/API/C/WKGeolocationPosition.cpp:
249         (WKGeolocationPositionCreate_b):
250         * UIProcess/API/Cocoa/WKProcessPool.mm:
251         (-[WKProcessPool _coreLocationProvider]):
252         (-[WKProcessPool _setCoreLocationProvider:]):
253         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
254         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
255         * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp.
256         * UIProcess/API/Cocoa/_WKGeolocationPosition.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp.
257         * UIProcess/API/Cocoa/_WKGeolocationPosition.mm: Added.
258         (WebKit::if):
259         (-[_WKGeolocationPosition dealloc]):
260         (-[_WKGeolocationPosition _apiObject]):
261         * UIProcess/API/Cocoa/_WKGeolocationPositionInternal.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp.
262         (WebKit::wrapper):
263         * UIProcess/ios/WKGeolocationProviderIOS.mm:
264         (kit):
265         (-[WKGeolocationProviderIOS initWithProcessPool:]):
266         (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
267         (-[WKGeolocationProviderIOS positionChanged:]):
268         (-[WKLegacyCoreLocationProvider setListener:]):
269         (-[WKLegacyCoreLocationProvider requestGeolocationAuthorization]):
270         (-[WKLegacyCoreLocationProvider start]):
271         (-[WKLegacyCoreLocationProvider stop]):
272         (-[WKLegacyCoreLocationProvider setEnableHighAccuracy:]):
273         (-[WKLegacyCoreLocationProvider geolocationAuthorizationGranted]):
274         (-[WKLegacyCoreLocationProvider geolocationAuthorizationDenied]):
275         (-[WKLegacyCoreLocationProvider positionChanged:]):
276         (-[WKLegacyCoreLocationProvider errorOccurred:]):
277         (-[WKLegacyCoreLocationProvider resetGeolocation]):
278         Implement a new class that bridges the currently used WebGeolocationCoreLocationProvider
279         to conform to the _WKGeolocationCoreLocationProvider protocol that WKGeolocationProviderIOS
280         expects.
281         * WebKit2.xcodeproj/project.pbxproj:
282
283 2017-04-11  Eric Carlson  <eric.carlson@apple.com>
284
285         [MediaStream] Set correct audio session category when capturing audio
286         https://bugs.webkit.org/show_bug.cgi?id=170736
287         <rdar://problem/31559405>
288
289         Reviewed by Jer Noble.
290
291         * UIProcess/WebPageProxy.cpp:
292         (WebKit::WebPageProxy::isPlayingMediaDidChange):
293
294 2017-04-11  Youenn Fablet  <youenn@apple.com>
295
296         Activate WebRTC data channel tests for WK1
297         https://bugs.webkit.org/show_bug.cgi?id=170710
298
299         Reviewed by Eric Carlson.
300
301         * WebProcess/Network/webrtc/LibWebRTCProvider.h: Making sure networking is not done in the Web process.
302
303 2017-04-11  Chris Fleizach  <cfleizach@apple.com>
304
305         AX: PDF plugin needs to support PDF-DOM Mode
306         https://bugs.webkit.org/show_bug.cgi?id=170589
307
308         Reviewed by Tim Horton.
309
310         Provide access to DOM objects with PDF document. This mean:
311            1) Support a different set of attributes for WKPDFPluginAccessibilityObject.
312                 WKPDFPluginAccessibilityObject is now a group instead of forwarding attribute calls to the pdf layer.
313            2) Connect the focused UI element to the active annotation if possible.
314            3) Mark the PDF associated nodes with an attribute so they can be identified later so their correct parent can be found.
315
316         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
317         * WebProcess/Plugins/PDF/PDFPlugin.h:
318         * WebProcess/Plugins/PDF/PDFPlugin.mm:
319         (-[WKPDFPluginAccessibilityObject pdfLayerController]):
320         (-[WKPDFPluginAccessibilityObject setPdfLayerController:]):
321         (-[WKPDFPluginAccessibilityObject convertRectToScreenSpace:]):
322         (-[WKPDFPluginAccessibilityObject accessibilityAttributeValue:]):
323         (-[WKPDFPluginAccessibilityObject accessibilityAttributeNames]):
324         (-[WKPDFPluginAccessibilityObject accessibilityActionNames]):
325         (-[WKPDFPluginAccessibilityObject accessibilityParameterizedAttributeNames]):
326         (-[WKPDFPluginAccessibilityObject accessibilityFocusedUIElement]):
327         (-[WKPDFPluginAccessibilityObject accessibilityAssociatedControlForAnnotation:]):
328         (-[WKPDFPluginAccessibilityObject accessibilityHitTest:]):
329         (WebKit::PDFPlugin::convertFromRootViewToPDFView):
330         (WebKit::PDFPlugin::convertFromPDFViewToScreen):
331         (WebKit::PDFPlugin::pluginHandlesContentOffsetForAccessibilityHitTest):
332         (WebKit::PDFPlugin::axObjectCache):
333         (WebKit::PDFPlugin::accessibilityShadowPluginParentForElement):
334         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
335         (WebKit::PDFPluginAnnotation::attach):
336         * WebProcess/Plugins/Plugin.h:
337         (WebKit::Plugin::accessibilityShadowPluginParentForElement):
338         (WebKit::Plugin::pluginHandlesContentOffsetForAccessibilityHitTest):
339         * WebProcess/Plugins/PluginView.cpp:
340         (WebKit::PluginView::accessibilityShadowPluginParentForElement):
341         * WebProcess/Plugins/PluginView.h:
342         * WebProcess/WebPage/WebPage.h:
343         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
344         (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
345
346 2017-04-11  Adrian Perez de Castro  <aperez@igalia.com>
347
348         [GTK] Attach popup menu to web view widget
349         https://bugs.webkit.org/show_bug.cgi?id=145866
350
351         Use gtk_menu_attach_to_widget() to let GTK+ know that popup menus belong to a certain web view.
352         This improves the positioning choices that the toolkit can do, and solves a long-standing issue
353         that caused long popup menus to hang outside of the available display area under Wayland.
354
355         Based on a patch by Jonas Ådahl <jadahl@gmail.com>.
356
357         Reviewed by Carlos Garcia Campos.
358
359         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
360         (WebKit::WebPopupMenuProxyGtk::showPopupMenu):
361
362 2017-04-10  Alex Christensen  <achristensen@webkit.org>
363
364         Revert r215217
365         https://bugs.webkit.org/show_bug.cgi?id=170703
366
367         * Configurations/FeatureDefines.xcconfig:
368
369 2017-04-10  Alex Christensen  <achristensen@webkit.org>
370
371         Continue enabling WebRTC
372         https://bugs.webkit.org/show_bug.cgi?id=170703
373
374         Reviewed by Youenn Fablet.
375
376         * Configurations/FeatureDefines.xcconfig:
377
378 2017-04-10  Alex Christensen  <achristensen@webkit.org>
379
380         REGRESSION(r195479) First main resource load in new WebProcess bypasses content extensions
381         https://bugs.webkit.org/show_bug.cgi?id=170707
382         <rdar://problem/27788755>
383
384         Reviewed by Tim Horton.
385
386         We fix this by sending the UserContentController with the WebPageCreationParameters
387         instead of in a IPC message immediately following creation.  By the time the WebPage
388         receives its second message, it has already started loading the first main resource.
389         
390         I also changed all instances of calling ChildProcessProxy::connection() to send a message
391         in favor of calling ChildProcessProxy::send, which does the same thing except if a child
392         process has not started, it will put the message in a queue and send it when the process
393         is finished launching.  This was necessary because the UserContentController is now connected
394         to the process sooner, so there were some API tests that would try to send messages between
395         initiating a process launch and finishing a process launch, and this change preserves the
396         existing behavior in those cases.
397
398         * Shared/WebPageCreationParameters.cpp:
399         (WebKit::WebPageCreationParameters::encode):
400         (WebKit::WebPageCreationParameters::decode):
401         * Shared/WebPageCreationParameters.h:
402         * UIProcess/Databases/DatabaseProcessProxy.cpp:
403         (WebKit::DatabaseProcessProxy::getDatabaseProcessConnection):
404         (WebKit::DatabaseProcessProxy::didFinishLaunching):
405         * UIProcess/Downloads/DownloadProxy.cpp:
406         (WebKit::DownloadProxy::cancel):
407         (WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace):
408         (WebKit::DownloadProxy::willSendRequest):
409         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
410         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
411         (WebKit::WebUserContentControllerProxy::addProcess):
412         (WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
413         (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
414         (WebKit::WebUserContentControllerProxy::addUserScript):
415         (WebKit::WebUserContentControllerProxy::removeUserScript):
416         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
417         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
418         (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
419         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
420         (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
421         (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
422         (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
423         (WebKit::WebUserContentControllerProxy::addContentExtension):
424         (WebKit::WebUserContentControllerProxy::removeContentExtension):
425         (WebKit::WebUserContentControllerProxy::removeAllContentExtensions):
426         * UIProcess/UserContent/WebUserContentControllerProxy.h:
427         * UIProcess/VisitedLinkStore.cpp:
428         (WebKit::VisitedLinkStore::removeAll):
429         (WebKit::VisitedLinkStore::pendingVisitedLinksTimerFired):
430         (WebKit::VisitedLinkStore::sendTable):
431         * UIProcess/WebPageProxy.cpp:
432         (WebKit::WebPageProxy::finishInitializingWebPageAfterProcessLaunch):
433         (WebKit::WebPageProxy::creationParameters):
434         * UIProcess/WebProcessProxy.cpp:
435         (WebKit::WebProcessProxy::addWebUserContentControllerProxy):
436         * UIProcess/WebProcessProxy.h:
437         * WebProcess/UserContent/WebUserContentController.h:
438         * WebProcess/WebPage/WebPage.cpp:
439         (WebKit::m_backgroundCPULimit):
440
441 2017-04-10  Alex Christensen  <achristensen@webkit.org>
442
443         Add API to get available content extension identifiers in a WKContentExtensionStore
444         https://bugs.webkit.org/show_bug.cgi?id=170093
445
446         Reviewed by Geoffrey Garen.
447
448         * UIProcess/API/APIContentExtensionStore.cpp:
449         (API::constructedPathPrefix):
450         (API::constructedPathFilter):
451         (API::constructedPath):
452         (API::ContentExtensionStore::getAvailableContentExtensionIdentifiers):
453         * UIProcess/API/APIContentExtensionStore.h:
454         * UIProcess/API/Cocoa/WKContentExtensionStore.h:
455         * UIProcess/API/Cocoa/WKContentExtensionStore.mm:
456         (-[WKContentExtensionStore _compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:releasesArgument:]):
457         (-[WKContentExtensionStore lookUpContentExtensionForIdentifier:completionHandler:]):
458         (-[WKContentExtensionStore getAvailableContentExtensionIdentifiers:]):
459         (-[WKContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
460
461 2017-04-10  Jeremy Jones  <jeremyj@apple.com>
462
463         Add CoreAudioCaptureSource.
464         https://bugs.webkit.org/show_bug.cgi?id=170112
465         rdar://problem/30293338
466
467         Reviewed by Tim Horton.
468
469         Add UseAVFoundationAudioCapture preference to switch back from the new default of CoreAudio.
470
471         * Shared/WebPreferencesDefinitions.h:
472         * UIProcess/API/C/WKPreferences.cpp:
473         (WKPreferencesSetUseAVFoundationAudioCapture):
474         (WKPreferencesGetUseAVFoundationAudioCapture):
475         * UIProcess/API/C/WKPreferencesRefPrivate.h:
476         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
477         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
478         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
479         (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs):
480         * WebProcess/WebPage/WebPage.cpp:
481         (WebKit::WebPage::updatePreferences):
482
483 2017-04-10  Brent Fulgham  <bfulgham@apple.com>
484
485         [WK2][macOS] Block access to Apple Events before launch.
486         https://bugs.webkit.org/show_bug.cgi?id=170626
487         <rdar://problem/16079334>
488
489         Reviewed by Alexey Proskuryakov.
490
491         Clear the environment of the AppleEvent server name before initializing
492         AppKit so we never bother connecting.
493
494         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
495         (main):
496
497 2017-04-10  Adrian Perez de Castro  <aperez@igalia.com>
498
499         [GTK] Misplaced right click menu on web page due to deprecated gtk_menu_popup()
500         https://bugs.webkit.org/show_bug.cgi?id=170553
501
502         Reviewed by Michael Catanzaro.
503
504         Use gtk_menu_popup_at_pointer() and gtk_menu_popup_at_rect() when building with GTK+ 3.22 or
505         newer. This allows the Wayland GTK+ backend to properly position popup menus, and also avoids
506         using functions which were deprecated starting at that GTK+ release.
507
508         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
509         (WebKit::WebContextMenuProxyGtk::show): Use gtk_menu_popup_at_pointer() as there is always a
510         pointer event that can be passed to it.
511         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
512         (WebKit::WebPopupMenuProxyGtk::showPopupMenu): Use gtk_menu_popup_at_rect(), using the coordinates
513         of the control passed as reference rectangle. Some conditional code is needed because with newer
514         GTK+ versions a relative offset instead of an absolute position is needed.
515
516 2017-04-10  Adrian Perez de Castro  <aperez@igalia.com>
517
518         [GTK] Opening a popup menu does not pre-select the active item
519         https://bugs.webkit.org/show_bug.cgi?id=170680
520
521         Reviewed by Michael Catanzaro.
522
523         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
524         (WebKit::WebPopupMenuProxyGtk::showPopupMenu): Use gtk_menu_shell_select_item() to
525         ensure that the active item appears selected right after popping up the menu.
526
527 2017-04-10  Carlos Garcia Campos  <cgarcia@igalia.com>
528
529         [GTK] Enable DOM timer throttling and CSS animations suspension
530         https://bugs.webkit.org/show_bug.cgi?id=170669
531
532         Reviewed by Žan Doberšek.
533
534         * Shared/WebPreferencesDefinitions.h:
535
536 2017-04-10  Chris Dumez  <cdumez@apple.com>
537
538         Drop Timer::startOneShot() overload taking a double
539         https://bugs.webkit.org/show_bug.cgi?id=170659
540
541         Reviewed by Yusuke Suzuki.
542
543         Drop Timer::startOneShot() overload taking a double as people should use Seconds type now.
544
545         * NetworkProcess/PingLoad.h:
546         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
547         (WebKit::NetworkDataTaskSoup::startTimeout):
548         * Platform/IPC/Connection.h:
549         * Platform/IPC/mac/ConnectionMac.mm:
550         (IPC::ConnectionTerminationWatchdog::createConnectionTerminationWatchdog):
551         (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
552         (IPC::Connection::terminateSoon):
553         * PluginProcess/PluginProcess.cpp:
554         (WebKit::PluginProcess::setMinimumLifetime):
555         * PluginProcess/PluginProcess.h:
556         * Shared/ChildProcess.cpp:
557         (WebKit::ChildProcess::ChildProcess):
558         * Shared/ChildProcess.h:
559         (WebKit::ChildProcess::setTerminationTimeout):
560         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
561         (WebKit::CompositingRunLoop::startUpdateTimer):
562         * Shared/Plugins/PluginProcessCreationParameters.h:
563         * Shared/WebMemorySampler.cpp:
564         (WebKit::WebMemorySampler::initializeTimers):
565         * Shared/WebProcessCreationParameters.h:
566         * UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm:
567         (API::SharedJSContext::ensureContext):
568         * UIProcess/ChildProcessProxy.cpp:
569         (WebKit::ChildProcessProxy::shutDownProcess):
570         * UIProcess/Cocoa/NavigationState.mm:
571         (WebKit::NavigationState::didChangeIsLoading):
572         * UIProcess/Cocoa/ViewGestureController.cpp:
573         (WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog):
574         * UIProcess/Cocoa/ViewGestureController.h:
575         * UIProcess/DrawingAreaProxyImpl.cpp:
576         (WebKit::DrawingAreaProxyImpl::discardBackingStoreSoon):
577         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::start):
578         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::didDraw):
579         * UIProcess/Gamepad/UIGamepadProvider.cpp:
580         * UIProcess/Plugins/PluginProcessProxy.cpp:
581         * UIProcess/ProcessThrottler.cpp:
582         * UIProcess/ResponsivenessTimer.cpp:
583         * UIProcess/WebProcessPool.cpp:
584         (WebKit::WebProcessPool::createNewWebProcess):
585         * UIProcess/gtk/GestureController.cpp:
586         (WebKit::GestureController::DragGesture::begin):
587         * UIProcess/mac/WebInspectorProxyMac.mm:
588         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
589         (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow):
590         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
591         (WebKit::CoordinatedLayerTreeHost::scheduleAnimation):
592         * WebProcess/WebPage/WebPage.cpp:
593         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
594         * WebProcess/WebProcess.cpp:
595
596 2017-04-09  Wenson Hsieh  <wenson_hsieh@apple.com>
597
598         [WK2] Add infrastructure to perform actions after an asynchronous position information request finishes
599         https://bugs.webkit.org/show_bug.cgi?id=170658
600         <rdar://problem/31431450>
601
602         Reviewed by Tim Horton.
603
604         Introduces doAfterPositionInformationUpdate:forRequest:, which WKContentView can use internally to perform
605         an action requiring InteractionInformationAtPosition asynchronously. See below for additional details.
606
607         New API unit test: DataInteractionTests.UnresponsivePageDoesNotHangUI.
608
609         * UIProcess/ios/WKContentViewInteraction.h:
610         * UIProcess/ios/WKContentViewInteraction.mm:
611         (-[WKContentView _actionForLongPressFromPositionInformation:]):
612         (-[WKContentView _actionForLongPress]):
613         (-[WKContentView doAfterPositionInformationUpdate:forRequest:]):
614
615         If current position information satisfies the request, then perform the given block immediately; otherwise, we
616         save the block and request as a pair in a list of pending position information handlers, and then make a new
617         request to the web process for position information if the currently outgoing request does not already satisfy
618         the given request.
619
620         (-[WKContentView ensurePositionInformationIsUpToDate:]):
621
622         Fire all asynchronous position information handlers that are satisfied by the incoming position information.
623
624         (-[WKContentView requestAsynchronousPositionInformationUpdate:]):
625         (-[WKContentView _currentPositionInformationIsValidForRequest:]):
626         (-[WKContentView _hasValidOutstandingPositionInformationRequest:]):
627
628         Pulled out common logic for managing InteractionInformationRequests into separate helper methods.
629
630         (-[WKContentView _invokeAndRemovePendingHandlersValidForCurrentPositionInformation]):
631         (-[WKContentView gestureRecognizerShouldBegin:]):
632
633         Refactored to use ensurePositionInformationIsUpToDate:. There is no behavior change here, but it makes sure that
634         this particular request will also any valid pending position information handlers.
635
636         (-[WKContentView _positionInformationDidChange:]):
637
638         Fire all asynchronous position information handlers that are satisfied by the incoming position information.
639
640         (-[WKContentView pointIsInDataInteractionContent:]): Deleted.
641
642         We should no longer use this method, since it makes a synchronous request to the web process -- see
643         positionInformationMayStartDataInteraction.
644
645 2017-04-09  Chris Dumez  <cdumez@apple.com>
646
647         Drop Timer::startRepeating() overload taking a double
648         https://bugs.webkit.org/show_bug.cgi?id=170656
649
650         Reviewed by Yusuke Suzuki.
651
652         Drop Timer::startRepeating() overload taking a double as people should use Seconds type now.
653
654         * Shared/WebMemorySampler.cpp:
655         (WebKit::WebMemorySampler::initializeTimers):
656         * UIProcess/Cocoa/ViewGestureController.cpp:
657         * UIProcess/HighPerformanceGraphicsUsageSampler.cpp:
658         * UIProcess/PerActivityStateCPUUsageSampler.cpp:
659         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
660         (WebKit::NetscapePlugin::Timer::start):
661         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
662         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
663         (WebKit::CompositingCoordinator::scheduleReleaseInactiveAtlases):
664
665 2017-04-09  Jon Lee  <jonlee@apple.com>
666
667         [WK2][iOS] Add CoreMedia entitlement for WebProcess
668         https://bugs.webkit.org/show_bug.cgi?id=170623
669         rdar://problem/30020073
670
671         Reviewed by Youenn Fablet.
672
673         * Configurations/WebContent-iOS.entitlements: Update entitlement to an array of strings instead of bool.
674
675 2017-04-09  Chris Dumez  <cdumez@apple.com>
676
677         Start dropping Timer API dealing with double
678         https://bugs.webkit.org/show_bug.cgi?id=170649
679
680         Reviewed by Yusuke Suzuki.
681
682         Start dropping Timer API dealing with double as people should use Seconds now.
683
684         * NetworkProcess/NetworkDataTask.cpp:
685         (WebKit::NetworkDataTask::scheduleFailure):
686         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
687         (WebKit::NetworkDataTaskCocoa::resume):
688         * PluginProcess/PluginControllerProxy.cpp:
689         (WebKit::PluginControllerProxy::destroy):
690         (WebKit::PluginControllerProxy::startPaintTimer):
691         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
692         (webkitWebViewBaseScheduleUpdateActivityState):
693         * UIProcess/DrawingAreaProxy.cpp:
694         (WebKit::DrawingAreaProxy::setViewExposedRect):
695         * UIProcess/DrawingAreaProxyImpl.cpp:
696         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::start):
697         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
698         (WebKit::PluginInfoCache::updatePluginInfo):
699         * UIProcess/VisitedLinkStore.cpp:
700         (WebKit::VisitedLinkStore::addVisitedLinkHash):
701         * UIProcess/WebProcessPool.cpp:
702         (WebKit::m_hiddenPageThrottlingAutoIncreasesCounter):
703         * UIProcess/gtk/GestureController.cpp:
704         (WebKit::GestureController::ZoomGesture::scaleChanged):
705         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
706         (WebKit::WebPopupMenuProxyGtk::menuUnmappedCallback):
707         * WebProcess/Network/WebLoaderStrategy.cpp:
708         (WebKit::WebLoaderStrategy::scheduleInternallyFailedLoad):
709         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
710         (WebKit::NPRuntimeObjectMap::addToInvalidationQueue):
711         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
712         (WebKit::NetscapePluginStream::deliverDataToPlugin):
713         * WebProcess/Plugins/PluginView.cpp:
714         (WebKit::PluginView::pendingURLRequestsTimerFired):
715         (WebKit::PluginView::loadURL):
716         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
717         (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeSoon):
718         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
719         (WebKit::CoordinatedLayerTreeHost::scheduleLayerFlush):
720         * WebProcess/WebPage/DrawingAreaImpl.cpp:
721         (WebKit::DrawingAreaImpl::scheduleDisplay):
722         * WebProcess/WebPage/WebPage.cpp:
723         (WebKit::WebPage::updateIsInWindow):
724         (WebKit::WebPage::addPluginView):
725         (WebKit::WebPage::setMayStartMediaWhenInWindow):
726         (WebKit::WebPage::didFinishLoad):
727         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
728         (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange):
729
730 2017-04-08  Chris Dumez  <cdumez@apple.com>
731
732         Drop std::chrono support from Timer class
733         https://bugs.webkit.org/show_bug.cgi?id=170645
734
735         Reviewed by Sam Weinig.
736
737         Drop std::chrono support from Timer class now that we prefer using Seconds type.
738
739         * NetworkProcess/NetworkLoad.cpp:
740         (WebKit::NetworkLoad::Throttle::Throttle):
741         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
742         * NetworkProcess/NetworkProcess.h:
743         (WebKit::NetworkProcess::loadThrottleLatency):
744         * NetworkProcess/NetworkProcessCreationParameters.cpp:
745         * NetworkProcess/NetworkProcessCreationParameters.h:
746         * NetworkProcess/NetworkResourceLoadParameters.h:
747         * NetworkProcess/NetworkResourceLoader.cpp:
748         (WebKit::NetworkResourceLoader::startNetworkLoad):
749         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
750         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
751         * NetworkProcess/cache/NetworkCacheStorage.cpp:
752         (WebKit::NetworkCache::Storage::dispatchReadOperation):
753         (WebKit::NetworkCache::Storage::store):
754         * Shared/CacheModel.cpp:
755         (WebKit::calculateMemoryCacheSizes):
756         * Shared/CacheModel.h:
757         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
758         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
759         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
760         * WebProcess/Network/WebLoaderStrategy.cpp:
761         (WebKit::maximumBufferingTime):
762         * WebProcess/Plugins/PluginView.cpp:
763         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
764         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately):
765         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
766         * WebProcess/WebProcess.cpp:
767         (WebKit::m_resourceLoadStatisticsStore):
768         (WebKit::WebProcess::setCacheModel):
769
770 2017-04-08  Chris Dumez  <cdumez@apple.com>
771
772         Unreviewed attempt to fix GTK build after r215138.
773
774         * UIProcess/API/gtk/WebKitUIClient.cpp:
775
776 2017-04-08  Youenn Fablet  <youenn@apple.com>
777
778         WebRTC tests gardening
779         https://bugs.webkit.org/show_bug.cgi?id=170508
780
781         Reviewed by Eric Carlson.
782
783         * Configurations/FeatureDefines.xcconfig:
784
785 2017-04-08  Chris Dumez  <cdumez@apple.com>
786
787         Timer's nextFireInterval() / repeatInterval() should return Seconds
788         https://bugs.webkit.org/show_bug.cgi?id=170639
789
790         Reviewed by Simon Fraser.
791
792         Timer's nextFireInterval() / repeatInterval() should return Seconds, not double.
793
794         * WebProcess/WebPage/WebPage.cpp:
795         (WebKit::WebPage::layerVolatilityTimerFired):
796         (WebKit::WebPage::markLayersVolatile):
797
798 2017-04-07  Alex Christensen  <achristensen@webkit.org>
799
800         Modernize WebPage.h
801         https://bugs.webkit.org/show_bug.cgi?id=170633
802
803         Reviewed by Joseph Pecoraro.
804
805         * UIProcess/API/APIUIClient.h:
806         (API::UIClient::createNewPage):
807         * UIProcess/API/C/WKPage.cpp:
808         (WebKit::RunBeforeUnloadConfirmPanelResultListener::create):
809         (WebKit::RunJavaScriptAlertResultListener::create):
810         (WebKit::RunJavaScriptConfirmResultListener::create):
811         (WebKit::RunJavaScriptConfirmResultListener::RunJavaScriptConfirmResultListener):
812         (WebKit::RunJavaScriptPromptResultListener::create):
813         (WebKit::RunJavaScriptPromptResultListener::RunJavaScriptPromptResultListener):
814         (WKPageSetPageUIClient):
815         * UIProcess/Cocoa/UIDelegate.h:
816         * UIProcess/Cocoa/UIDelegate.mm:
817         (WebKit::UIDelegate::UIClient::createNewPage):
818         * WebProcess/WebPage/WebPage.cpp:
819         (WebKit::WebPage::loadDataImpl):
820         (WebKit::WebPage::loadStringImpl):
821         (WebKit::WebPage::loadData):
822         (WebKit::WebPage::scaledSnapshotWithOptions):
823         (WebKit::WebPage::SandboxExtensionTracker::willPerformLoadDragDestinationAction):
824         (WebKit::WebPage::SandboxExtensionTracker::setPendingProvisionalSandboxExtension):
825         * WebProcess/WebPage/WebPage.h:
826
827 2017-04-07  Alex Christensen  <achristensen@webkit.org>
828
829         Use audit_token_t instead of pid_t for checking sandbox of other processes
830         https://bugs.webkit.org/show_bug.cgi?id=170616
831         <rdar://problem/31158189>
832
833         Reviewed by Daniel Bates.
834
835         pid's can be reused, so it's theoretically unsafe to use the pid of another process to check whether it's sandboxed.
836         Use an audit_token_t instead to be more sure that we are not mistakenly checking a new process that has reused the
837         old process's pid. For the current process, though, we have no xpc_connection_t to the process because we are the process.
838
839         * PluginProcess/mac/PluginProcessMac.mm:
840         (WebKit::PluginProcess::initializeSandbox):
841         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
842         (WebKit::XPCServiceInitializerDelegate::isClientSandboxed):
843         * Shared/mac/SandboxUtilities.h:
844         * Shared/mac/SandboxUtilities.mm:
845         (WebKit::currentProcessIsSandboxed):
846         (WebKit::connectedProcessIsSandboxed):
847         (WebKit::processIsSandboxed): Deleted.
848         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
849         (WebKit::WebProcessProxy::platformIsBeingDebugged):
850         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
851         (WebKit::PluginInfoStore::shouldUsePlugin):
852         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
853         (WebKit::PluginProcessProxy::platformGetLaunchOptions):
854
855 2017-04-07  Brent Fulgham  <bfulgham@apple.com>
856
857         [WK2][iOS] Add CoreMedia entitlement for WebProcess
858         https://bugs.webkit.org/show_bug.cgi?id=170623
859         <rdar://problem/30020073>
860
861         Reviewed by Youenn Fablet.
862
863         Add new "com.apple.tcc.delegated-services" entitlement to allow CoreMedia
864         to work properly in WebRTC.
865
866         * Configurations/WebContent-iOS.entitlements:
867
868 2017-04-07  Alex Christensen  <achristensen@webkit.org>
869
870         Private browsing sessions should not look in keychain for client certificates
871         https://bugs.webkit.org/show_bug.cgi?id=170618
872         <rdar://problem/18457427>
873
874         Reviewed by Dan Bernstein.
875
876         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
877         (WebKit::configurationForSessionID):
878
879 2017-04-07  Chris Dumez  <cdumez@apple.com>
880
881         We should log how much CPU a background process was using when killing it due to CPU limiting
882         https://bugs.webkit.org/show_bug.cgi?id=170619
883
884         Reviewed by Andreas Kling.
885
886         * WebProcess/cocoa/WebProcessCocoa.mm:
887         (WebKit::WebProcess::updateBackgroundCPUMonitorState):
888
889 2017-04-07  Wenson Hsieh  <wenson_hsieh@apple.com>
890
891         Missing conversion from window to content coordinates when adjusting unobscured content rects for input view
892         https://bugs.webkit.org/show_bug.cgi?id=170603
893
894         Reviewed by Simon Fraser.
895
896         Refactors -[WKContentView _computeUnobscuredContentRectRespectingInputViewBounds:unobscuredContentRect:inputViewBounds:scale:]
897         to convert the input view bounds into content coordinates instead of using the zoom scale to adjust the height of inputViewBounds.
898         Covered by the existing LayoutTest, fixed-element-on-bottom-with-keyboard.html.
899
900         * UIProcess/ios/WKContentView.mm:
901         (-[WKContentView _computeUnobscuredContentRectRespectingInputViewBounds:unobscuredContentRect:inputViewBounds:scale:]):
902
903 2017-04-07  Michael Catanzaro  <mcatanzaro@igalia.com>
904
905         [GTK] Various build errors when plugin support is disabled
906         https://bugs.webkit.org/show_bug.cgi?id=170015
907
908         Reviewed by Carlos Garcia Campos.
909
910         * PluginProcess/unix/PluginControllerProxyUnix.cpp:
911         * UIProcess/API/gtk/WebKitWebsiteData.cpp:
912         (recordContainsSupportedDataTypes):
913         (toWebKitWebsiteDataTypes):
914         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
915         (toWebsiteDataTypes):
916
917 2017-04-07  John Wilander  <wilander@apple.com>
918
919         WebSocket streams should have network usage attributed to correct process
920         https://bugs.webkit.org/show_bug.cgi?id=170322
921         <rdar://problem/26413551>
922
923         Reviewed by Alex Christensen.
924
925         Changes here are due to the added WebCore::SourceApplicationAuditToken parameter
926         in WebCore::SocketStreamHandleImpl::create().
927         WebKit::NetworkSocketStream takes it and passes it on.
928
929         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
930         (WebKit::NetworkConnectionToWebProcess::createSocketStream):
931         * NetworkProcess/NetworkSocketStream.cpp:
932         (WebKit::NetworkSocketStream::create):
933         (WebKit::NetworkSocketStream::NetworkSocketStream):
934         * NetworkProcess/NetworkSocketStream.h:
935
936 2017-04-07  Michael Catanzaro  <mcatanzaro@igalia.com>
937
938         Unreviewed, fix missing return value warning
939
940         * UIProcess/WebProcessProxy.cpp:
941         (WebKit::diagnosticLoggingKeyForSimulatedCrashReason):
942
943 2017-04-07  Carlos Garcia Campos  <cgarcia@igalia.com>
944
945         [GTK] Update the priorities used in glib main loop sources
946         https://bugs.webkit.org/show_bug.cgi?id=170457
947
948         Reviewed by Žan Doberšek.
949
950         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
951         (WebKit::CompositingRunLoop::CompositingRunLoop):
952         * UIProcess/DrawingAreaProxyImpl.cpp:
953         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
954         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::DrawingMonitor):
955         * UIProcess/gtk/WaylandCompositor.cpp:
956         (WebKit::createWaylandLoopSource):
957         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
958         (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea):
959         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
960         (WebKit::CompositingCoordinator::CompositingCoordinator):
961         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
962         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
963         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
964         * WebProcess/WebPage/DrawingAreaImpl.cpp:
965         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
966
967 2017-04-06  Alex Christensen  <achristensen@webkit.org>
968
969         Add WKContentExtensionStore.h and WKContentExtension.h to public WebKit.h
970         https://bugs.webkit.org/show_bug.cgi?id=170533
971
972         Reviewed by Daniel Bates.
973
974         * Shared/API/Cocoa/WebKit.h:
975         In r213696 I added two public headers.  All public headers in WebKit are included with
976         #import <WebKit/WebKit.h>
977
978 2017-04-06  Joseph Pecoraro  <pecoraro@apple.com>
979
980         Web Inspector: Hangs when loading under SpeculativeLoad::shouldCaptureExtraNetworkLoadMetrics
981         https://bugs.webkit.org/show_bug.cgi?id=170575
982
983         Rubber-stamped by Brian Burg.
984
985         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
986         (WebKit::NetworkCache::SpeculativeLoad::shouldCaptureExtraNetworkLoadMetrics): Deleted.
987         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
988         m_networkLoad is a wrapper around `this` as the client, so we would infinite loop here.
989
990 2017-04-06  Commit Queue  <commit-queue@webkit.org>
991
992         Unreviewed, rolling out r214973.
993         https://bugs.webkit.org/show_bug.cgi?id=170578
994
995         Causes issues in Safari (Requested by bradee-oh on #webkit).
996
997         Reverted changeset:
998
999         "Refactor so WebsiteDataStores always have a StorageManager."
1000         https://bugs.webkit.org/show_bug.cgi?id=170521
1001         http://trac.webkit.org/changeset/214973
1002
1003 2017-04-06  Ryan Haddad  <ryanhaddad@apple.com>
1004
1005         Unreviewed, rolling out r215046.
1006
1007         This change broke internal builds.
1008
1009         Reverted changeset:
1010
1011         "WebRTC tests gardening"
1012         https://bugs.webkit.org/show_bug.cgi?id=170508
1013         http://trac.webkit.org/changeset/215046
1014
1015 2017-04-06  Joseph Pecoraro  <pecoraro@apple.com>
1016
1017         Web Inspector: Only Capture Extra Network Load Metrics when there is a Web Inspector Frontend
1018         https://bugs.webkit.org/show_bug.cgi?id=170525
1019
1020         Reviewed by Youenn Fablet.
1021
1022         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1023         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
1024         Only collect extra metrics if the WebProcess this load is for has enabled
1025         collecting extra metrics.
1026
1027         * WebProcess/Network/WebLoaderStrategy.cpp:
1028         (WebKit::WebLoaderStrategy::setCaptureExtraNetworkLoadMetricsEnabled):
1029         * WebProcess/Network/WebLoaderStrategy.h:
1030         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1031         (WebKit::NetworkConnectionToWebProcess::setCaptureExtraNetworkLoadMetricsEnabled):
1032         * NetworkProcess/NetworkConnectionToWebProcess.h:
1033         (WebKit::NetworkConnectionToWebProcess::captureExtraNetworkLoadMetricsEnabled):
1034         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1035         New bool state toggled through the loader policy.
1036
1037         * NetworkProcess/NetworkDataTask.cpp:
1038         (WebKit::NetworkDataTask::shouldCaptureExtraNetworkLoadMetrics):
1039         * NetworkProcess/NetworkDataTask.h:
1040         (WebKit::NetworkDataTaskClient::shouldCaptureExtraNetworkLoadMetrics):
1041         * NetworkProcess/NetworkLoad.cpp:
1042         (WebKit::NetworkLoad::shouldCaptureExtraNetworkLoadMetrics):
1043         * NetworkProcess/NetworkLoad.h:
1044         * NetworkProcess/NetworkLoadClient.h:
1045         (WebKit::NetworkLoadClient::shouldCaptureExtraNetworkLoadMetrics):
1046         * NetworkProcess/NetworkResourceLoader.cpp:
1047         (WebKit::NetworkResourceLoader::shouldCaptureExtraNetworkLoadMetrics):
1048         * NetworkProcess/NetworkResourceLoader.h:
1049         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1050         (WebKit::NetworkCache::SpeculativeLoad::shouldCaptureExtraNetworkLoadMetrics):
1051         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
1052         Default handling for network loads is to not include extra data. Thread
1053         client messages back from the NetworkLoads / SpeculativeLoads to check
1054         the NetworkConnectionToWebProcess state on whether or not we should collect
1055         extra metrics.
1056
1057 2017-04-06  Joseph Pecoraro  <pecoraro@apple.com>
1058
1059         Web Inspector: Show all headers in the Request Headers section of the Resource details sidebar
1060         https://bugs.webkit.org/show_bug.cgi?id=16531
1061         <rdar://problem/5712895>
1062
1063         Reviewed by Timothy Hatcher.
1064
1065         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1066         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
1067         Include a complete list of the request headers sent for this load.
1068         There may be headers that WebCore did not know about and developer
1069         tools should be informed of.
1070
1071 2017-04-06  Anders Carlsson  <andersca@apple.com>
1072
1073         OptionSet options need to be powers of two
1074         https://bugs.webkit.org/show_bug.cgi?id=170565
1075
1076         Reviewed by Chris Dumez.
1077
1078         Change Cache::Option to be powers of two.
1079
1080         * NetworkProcess/cache/NetworkCache.h:
1081
1082 2017-04-06  Youenn Fablet  <youenn@apple.com>
1083
1084         WebRTC tests gardening
1085         https://bugs.webkit.org/show_bug.cgi?id=170508
1086
1087         Reviewed by Eric Carlson.
1088
1089         * Configurations/FeatureDefines.xcconfig:
1090
1091 2017-04-06  Antti Koivisto  <antti@apple.com>
1092
1093         Implement testing mode for disk cache
1094         https://bugs.webkit.org/show_bug.cgi?id=170547
1095
1096         Reviewed by Andreas Kling.
1097
1098         Disable read timeouts and cache shrinking in TestRunner to eliminate potential sources of randomness.
1099
1100         Cache directories are deleted by TestRunner so lack of shrinking does not consume the disk.
1101
1102         This is enabled by the existing WKContextUseTestingNetworkSession SPI.
1103
1104         * NetworkProcess/cache/NetworkCache.cpp:
1105         (WebKit::NetworkCache::Cache::initialize):
1106         * NetworkProcess/cache/NetworkCache.h:
1107         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1108         (WebKit::NetworkCache::Storage::open):
1109         (WebKit::NetworkCache::Storage::Storage):
1110         (WebKit::NetworkCache::Storage::dispatchReadOperation):
1111         (WebKit::NetworkCache::Storage::shrinkIfNeeded):
1112         * NetworkProcess/cache/NetworkCacheStorage.h:
1113         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1114         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1115
1116 2017-04-06  Chris Dumez  <cdumez@apple.com>
1117
1118         [WK2] Add C private API to toggle invisibleAutoplayNotPermitted setting
1119         https://bugs.webkit.org/show_bug.cgi?id=170524
1120         <rdar://problem/31461472>
1121
1122         Reviewed by Eric Carlson.
1123
1124         Add C private API to toggle invisibleAutoplayNotPermitted setting.
1125
1126         * UIProcess/API/C/WKPreferences.cpp:
1127         (WKPreferencesSetInvisibleMediaAutoplayPermitted):
1128         (WKPreferencesGetInvisibleMediaAutoplayPermitted):
1129         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1130
1131 2017-04-06  Adrian Perez de Castro  <aperez@igalia.com>
1132
1133         [GTK] Fix build with MEDIA_CAPTURE enabled
1134         https://bugs.webkit.org/show_bug.cgi?id=170539
1135
1136         Reviewed by Carlos Garcia Campos.
1137
1138         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
1139         (webkit_dom_html_input_element_get_capture): Add missing namespace in usage of WebCore::MediaCaptureTypeNone.
1140
1141 2017-04-05  Brent Fulgham  <bfulgham@apple.com>
1142
1143         [WK2][iOS] Remove access to features not present on iOS 
1144         https://bugs.webkit.org/show_bug.cgi?id=170531
1145         <rdar://problem/31352258>
1146
1147         Reviewed by Alexey Proskuryakov.
1148
1149         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1150
1151 2017-04-05  Eric Carlson  <eric.carlson@apple.com>
1152
1153         [MediaStream] Host application should be able to mute and unmute media streams
1154         https://bugs.webkit.org/show_bug.cgi?id=170519
1155         <rdar://problem/31174326>
1156
1157         Reviewed by Youenn Fablet.
1158
1159         * UIProcess/API/C/WKPage.cpp:
1160         (WKPageGetMediaState): Support new media stream state flags.
1161         * UIProcess/API/C/WKPagePrivate.h:
1162         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Ditto.
1163         * UIProcess/Cocoa/UIDelegate.mm: Ditto.
1164
1165 2017-04-05  Brady Eidson  <beidson@apple.com>
1166
1167         Refactor so WebsiteDataStores always have a StorageManager.
1168         https://bugs.webkit.org/show_bug.cgi?id=170521
1169
1170         Reviewed by Geoff Garen.
1171
1172         This basically involves teaching StorageManager how to work without a LocalStorageDatabaseTracker,
1173         since there will never be ephemeral bits on disk to track.
1174         
1175         * UIProcess/Storage/StorageManager.cpp:
1176         (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
1177         (WebKit::StorageManager::createEphemeral):
1178         (WebKit::StorageManager::StorageManager):
1179         (WebKit::StorageManager::getLocalStorageOrigins):
1180         (WebKit::StorageManager::getLocalStorageOriginDetails):
1181         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
1182         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
1183         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
1184         * UIProcess/Storage/StorageManager.h:
1185         
1186         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1187         (WebKit::WebsiteDataStore::WebsiteDataStore):
1188
1189 2017-04-05  Brent Fulgham  <bfulgham@apple.com>
1190
1191         [WK2][iOS] Add entitlements to enable audio/video capture in WebProcess
1192         https://bugs.webkit.org/show_bug.cgi?id=170507
1193         <rdar://problem/31121248>
1194
1195         Reviewed by Youenn Fablet.
1196
1197         Add two entitlements that are required to access audio/video capture on iOS.
1198
1199         * Configurations/WebContent-iOS.entitlements:
1200
1201 2017-04-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1202
1203         Show a log message when an invalid message is received in non cocoa ports
1204         https://bugs.webkit.org/show_bug.cgi?id=170506
1205
1206         Reviewed by Michael Catanzaro.
1207
1208         We just crash, but without knowing the details about the message it's impossible to debug.
1209
1210         * Shared/ChildProcess.cpp:
1211         (WebKit::ChildProcess::didReceiveInvalidMessage):
1212
1213 2017-04-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1214
1215         Move WebErrors from WebProcess to Shared and get rid of ErrorsGtk in WebCore
1216         https://bugs.webkit.org/show_bug.cgi?id=156974
1217
1218         Reviewed by Sam Weinig.
1219
1220         WebErrors are not only used by the frame loader client in the web process, but also by the network process. So,
1221         move them to Shared make most of the implementation cross-platform.
1222
1223         * CMakeLists.txt: Add new files to compilation.
1224         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1225         (WebKit::NetworkDataTaskSoup::download): Use WebErrors directly instead of platform methods that are no longer needed.
1226         (WebKit::NetworkDataTaskSoup::writeDownloadCallback): Ditto.
1227         (WebKit::NetworkDataTaskSoup::didFinishDownload): Ditto.
1228         (WebKit::NetworkDataTaskSoup::didFail): Ditto.
1229         * PlatformGTK.cmake: Add new files to compilation and remove DownloadSoupErrorsGtk.cpp
1230         * PlatformMac.cmake:
1231         * Shared/API/APIError.cpp: Add error domains used by glib based ports.
1232         (API::Error::webKitNetworkErrorDomain):
1233         (API::Error::webKitPolicyErrorDomain):
1234         (API::Error::webKitPluginErrorDomain):
1235         (API::Error::webKitDownloadErrorDomain):
1236         (API::Error::webKitPrintErrorDomain):
1237         * Shared/API/APIError.h:
1238         * Shared/Cocoa/WebErrorsCocoa.mm: Copied from Source/WebKit2/WebProcess/WebCoreSupport/WebErrors.h.
1239         (WebKit::createNSError):
1240         (WebKit::cancelledError):
1241         (WebKit::fileDoesNotExistError):
1242         * Shared/WebErrors.cpp: Copied from Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp.
1243         (WebKit::blockedError):
1244         (WebKit::blockedByContentBlockerError):
1245         (WebKit::cannotShowURLError):
1246         (WebKit::interruptedForPolicyChangeError):
1247         (WebKit::blockedByContentFilterError):
1248         (WebKit::cannotShowMIMETypeError):
1249         (WebKit::pluginWillHandleLoadError):
1250         (WebKit::internalError):
1251         * Shared/WebErrors.h: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebErrors.h.
1252         * Shared/glib/WebErrorsGlib.cpp: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp.
1253         (WebKit::cancelledError):
1254         (WebKit::fileDoesNotExistError):
1255         * Shared/gtk/WebErrorsGtk.cpp: Copied from Source/WebKit2/NetworkProcess/Downloads/gtk/DownloadSoupErrorsGtk.cpp.
1256         (WebKit::printError):
1257         (WebKit::printerNotFoundError):
1258         (WebKit::invalidPageRangeToPrint):
1259         * Shared/soup/WebErrorsSoup.cpp: Renamed from Source/WebKit2/NetworkProcess/Downloads/gtk/DownloadSoupErrorsGtk.cpp.
1260         (WebKit::downloadNetworkError):
1261         (WebKit::downloadCancelledByUserError):
1262         (WebKit::downloadDestinationError):
1263         * UIProcess/API/gtk/WebKitDownload.cpp:
1264         * UIProcess/API/gtk/WebKitError.cpp:
1265         (webkit_network_error_quark):
1266         (webkit_policy_error_quark):
1267         (webkit_plugin_error_quark):
1268         (webkit_download_error_quark):
1269         (webkit_print_error_quark):
1270         * UIProcess/API/gtk/WebKitPrivate.cpp:
1271         (toWebKitError):
1272         (toWebCoreError):
1273         * WebKit2.xcodeproj/project.pbxproj:
1274         * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm: Removed.
1275         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
1276
1277 2017-04-04  Youenn Fablet  <youenn@apple.com>
1278
1279         [Mac] Add back web audio support for getUserMedia MediaStreamTrack
1280         https://bugs.webkit.org/show_bug.cgi?id=170482
1281
1282         Reviewed by Eric Carlson.
1283
1284         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1285         (WebKit::UserMediaCaptureManager::Source::setStorage):
1286
1287 2017-04-04  Tim Horton  <timothy_horton@apple.com>
1288
1289         [Mac] -[WKWebView findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:] invokes the resultCollector with didWrap = NO even when it wraps
1290         https://bugs.webkit.org/show_bug.cgi?id=165801
1291         <rdar://problem/29649535>
1292
1293         Reviewed by Wenson Hsieh.
1294
1295         Previously, when doing an incremental find that wrapped, we would 
1296         say that it did not, leading NSTextFinder to not provide its usual
1297         wrapping UI, and other clients of the NSTextFinderClient protocol to
1298         get confused by the lack of wrapping.
1299
1300         * UIProcess/WebPageProxy.cpp:
1301         (WebKit::WebPageProxy::didFindString):
1302         * UIProcess/WebPageProxy.h:
1303         * UIProcess/WebPageProxy.messages.in:
1304         * UIProcess/API/APIFindClient.h:
1305         (API::FindClient::didFindString):
1306         * UIProcess/API/C/WKPage.cpp:
1307         (WKPageSetPageFindClient):
1308         * UIProcess/Cocoa/FindClient.h:
1309         * UIProcess/Cocoa/FindClient.mm:
1310         (WebKit::FindClient::didFindString):
1311         * WebProcess/WebPage/FindController.cpp:
1312         (WebKit::FindController::updateFindUIAfterPageScroll):
1313         (WebKit::FindController::findString):
1314         * WebProcess/WebPage/FindController.h:
1315         Plumb DidWrap from FindController's call to findString back through
1316         the DidFindString message.
1317
1318         * UIProcess/mac/WKTextFinderClient.mm:
1319         (-[WKTextFinderClient didFindStringMatchesWithRects:didWrapAround:]):
1320         (-[WKTextFinderClient didFindStringMatchesWithRects:]): Deleted.
1321         Make use of the new DidWrap information to stop lying to NSTextFinder
1322         about whether a wrap actually occurred.
1323
1324 2017-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
1325
1326         Data interaction should register type identifiers in order of priority
1327         https://bugs.webkit.org/show_bug.cgi?id=170428
1328         <rdar://problem/30633296>
1329
1330         Reviewed by Tim Horton.
1331
1332         Serialize PasteboardWebContent.dataInAttributedStringFormat when sending over IPC. Refer to WebCore ChangeLog
1333         for more details.
1334
1335         * Shared/WebCoreArgumentCoders.cpp:
1336         (IPC::ArgumentCoder<PasteboardWebContent>::encode):
1337         (IPC::ArgumentCoder<PasteboardWebContent>::decode):
1338         * UIProcess/API/Cocoa/WKWebView.mm:
1339
1340 2017-04-03  Joseph Pecoraro  <pecoraro@apple.com>
1341
1342         Remove no longer needed forward declarations
1343         https://bugs.webkit.org/show_bug.cgi?id=170415
1344
1345         Reviewed by Dan Bernstein.
1346
1347         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1348
1349 2017-04-03  Anders Carlsson  <andersca@apple.com>
1350
1351         Tweak ApplePaySession API
1352         https://bugs.webkit.org/show_bug.cgi?id=170409
1353         rdar://problem/31405459
1354
1355         Reviewed by Tim Horton.
1356
1357         Update for WebCore changes.
1358
1359         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1360         (WebKit::toNSError):
1361
1362 2017-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1363
1364         [SOUP] URI Fragment is lost after redirect
1365         https://bugs.webkit.org/show_bug.cgi?id=170058
1366
1367         Reviewed by Michael Catanzaro.
1368
1369         In case of redirection check if the current request has a fragment identifier and apply it to the redirection
1370         only when it doesn't have a fragment identifier yet.
1371
1372         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1373         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
1374         (WebKit::NetworkDataTaskSoup::createRequest):
1375         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
1376         * NetworkProcess/soup/NetworkDataTaskSoup.h:
1377
1378 2017-04-03  Antti Koivisto  <antti@apple.com>
1379
1380         Mutex may be freed too late in NetworkCache::Storage::traverse
1381         https://bugs.webkit.org/show_bug.cgi?id=170400
1382         <rdar://problem/30515865>
1383
1384         Reviewed by Carlos Garcia Campos and Andreas Kling.
1385
1386         Fix a race.
1387
1388         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1389         (WebKit::NetworkCache::Storage::traverse):
1390
1391             Ensure the mutex is not accessed after we dispatch to the main thread.
1392             The main thread call deletes the owning TraverseOperation.
1393
1394 2017-04-01  Dan Bernstein  <mitz@apple.com>
1395
1396         [iOS] <input type=file> label should be specified using plural rules
1397         https://bugs.webkit.org/show_bug.cgi?id=170388
1398
1399         Reviewed by Alexey Proskuryakov.
1400
1401         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1402         (-[WKFileUploadPanel _processMediaInfoDictionaries:atIndex:processedResults:processedImageCount:processedVideoCount:successBlock:failureBlock:]):
1403           Instead of calling -_displayStringForPhotos:videos:, use
1404           +[NSString localizedStringWithFormat:] with the new format string "%lu photo(s) and
1405           %lu video(s)" for which there are plural rules.
1406         (-[WKFileUploadPanel _displayStringForPhotos:videos:]): Deleted.
1407
1408 2017-04-01  Dan Bernstein  <mitz@apple.com>
1409
1410         [Xcode] In engineering builds, linker warns about libwebrtc.dylib’s install name being invalid
1411         https://bugs.webkit.org/show_bug.cgi?id=170385
1412
1413         Reviewed by Tim Horton.
1414
1415         * Configurations/WebKit.xcconfig: When WebKit is relocatable, tell the linker that it’s
1416           not going to be in the shared cache, even if its install name implies that it might be.
1417
1418 2017-03-31  Simon Fraser  <simon.fraser@apple.com>
1419
1420         Remove a logging statement left in by mistake.
1421
1422         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1423         (WebKit::WebFrameLoaderClient::restoreViewState):
1424
1425 2017-03-31  Wenson Hsieh  <wenson_hsieh@apple.com>
1426
1427         Address post-review feedback after r214692
1428         https://bugs.webkit.org/show_bug.cgi?id=170328
1429
1430         Reviewed by Dan Bernstein.
1431
1432         Clearing the selection when UIKit calls into WKContentView to set its selected text range to nil is a rule
1433         that should be applied when using a text interaction assistant, not just when using character granularity
1434         for selecting text.
1435
1436         * UIProcess/ios/WKContentViewInteraction.mm:
1437         (-[WKContentView setSelectedTextRange:]):
1438
1439 2017-03-31  Wenson Hsieh  <wenson_hsieh@apple.com>
1440
1441         [WK2] Tapping away to dismiss the selection does not update the selected DOM range using character granularity
1442         https://bugs.webkit.org/show_bug.cgi?id=170328
1443         <rdar://problem/30904558>
1444
1445         Reviewed by Tim Horton.
1446
1447         When UIKit clears the selection while in text interaction mode, it notifies its document view (i.e., the
1448         WKContentView) by setting its selected text range to nil. When character granularity selection is enabled, use
1449         this as a cue to notify the web process that the selection is being cleared out.
1450
1451         -setSelectedTextRange: is a noop in the general case because the web process acts as the source of truth for what
1452         the selection currently consists of, and notifies the UI process and UIKit via WKTextPosition and WKTextRange.
1453         However, in the case of character granularity selections, tapping away to clear the selection is handled by
1454         UIKit's text gesture recognizer cluster, which then informs the document (via -setSelectedTextRange:) that the
1455         selection should be cleared out.
1456
1457         Adds a new Layout test: editing/selection/character-granularity-selected-range-after-dismissing-selection.html.
1458
1459         * UIProcess/ios/WKContentViewInteraction.mm:
1460         (-[WKContentView setSelectedTextRange:]):
1461
1462 2017-03-31  Wenson Hsieh  <wenson_hsieh@apple.com>
1463
1464         [WK2] Tapping editable text inside of a range selection no longer changes the selection to a caret
1465         https://bugs.webkit.org/show_bug.cgi?id=170327
1466         <rdar://problem/31363816>
1467
1468         Reviewed by Tim Horton.
1469
1470         Currently, we're forcing all text interaction gestures to duck in lieu of data interaction gestures
1471         when we should only be doing so for gestures that begin a loupe. This prevents other gestures, such as
1472         single taps, from changing the selection when they should be allowed to.
1473
1474         Hooks into new UIKit SPI to make this tweak.
1475         Introduces a new LayoutTest: editing/selection/caret-after-tap-in-editable-selection.html.
1476
1477         * UIProcess/ios/WKContentViewInteraction.mm:
1478         (-[WKContentView pointIsInAssistedNode:]):
1479         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
1480
1481 2017-03-31  Tim Horton  <timothy_horton@apple.com>
1482
1483         Mail can get stuck underneath FindController::findStringMatches after searching in a long message
1484         https://bugs.webkit.org/show_bug.cgi?id=170326
1485         <rdar://problem/30330395>
1486
1487         Reviewed by Simon Fraser.
1488
1489         * UIProcess/mac/WKTextFinderClient.mm:
1490         (-[WKTextFinderClient findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:]):
1491         Cap the number of find matches at 1000, the same maximum that Safari uses.
1492
1493 2017-03-31  Brady Eidson  <beidson@apple.com>
1494
1495         Clean up the "StorageType" enum.
1496         https://bugs.webkit.org/show_bug.cgi?id=170349
1497
1498         Reviewed by Tim Horton.
1499
1500         * WebProcess/Storage/StorageAreaMap.cpp:
1501         (WebKit::StorageAreaMap::StorageAreaMap):
1502         (WebKit::StorageAreaMap::dispatchStorageEvent):
1503         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
1504         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
1505         
1506         * WebProcess/Storage/StorageNamespaceImpl.cpp:
1507         (WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
1508         (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
1509         (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):
1510
1511 2017-03-31  Tim Horton  <timothy_horton@apple.com>
1512
1513         Remove bundle checks for attachmentElementEnabled
1514         https://bugs.webkit.org/show_bug.cgi?id=170329
1515         <rdar://problem/25135244>
1516
1517         Reviewed by Simon Fraser.
1518
1519         * UIProcess/API/Cocoa/WKWebView.mm:
1520         (-[WKWebView _initializeWithConfiguration:]):
1521         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1522         (-[WKWebViewConfiguration init]):
1523         Remove bundle checks.
1524
1525 2017-03-29  Anders Carlsson  <andersca@apple.com>
1526
1527         Adopt PKCanMakePaymentsWithMerchantIdentifierAndDomainAndSourceApplication
1528         https://bugs.webkit.org/show_bug.cgi?id=170257
1529         rdar://problem/31289764
1530
1531         Reviewed by Beth Dakin.
1532
1533         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1534         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
1535
1536 2017-03-31  Csaba Osztrogonác  <ossy@webkit.org>
1537
1538         Mac cmake buildfix after r214403
1539         https://bugs.webkit.org/show_bug.cgi?id=170346
1540
1541         Unreviewed speculative buildfix.
1542
1543         * UIProcess/API/Cocoa/WKWebView.mm:
1544
1545 2017-03-31  Brady Eidson  <beidson@apple.com>
1546
1547         Remove erroneously committed changes from r214078
1548
1549         Unreviewed.
1550
1551         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1552         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Whoops!
1553
1554 2017-03-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1555
1556         Modern media controls should never be enabled in non cocoa ports
1557         https://bugs.webkit.org/show_bug.cgi?id=170338
1558
1559         Reviewed by Michael Catanzaro.
1560
1561         It's currently enabled, because it uses the default value for all other runtime features, but modern media
1562         controls are not a cross-platform feature. I think this is why media/video-click-dblckick-standalone.html
1563         started to fail in GTK+ port after r214426. I can't reprouduce the failure locally, so I can't confirm it,
1564         though.
1565
1566         * Shared/WebPreferencesDefinitions.h:
1567
1568 2017-03-30  Zan Dobersek  <zdobersek@igalia.com>
1569
1570         Unreviewed GTK+ build fix. List WebCore before JavaScriptCore as the
1571         two WebKit2 dependency libraries to avoid WTF directiories being
1572         listed for inclusion before WebCore directories at compile-time.
1573
1574         * CMakeLists.txt:
1575
1576 2017-03-30  Megan Gardner  <megan_gardner@apple.com>
1577
1578         Allow for extended color in snapshots
1579         https://bugs.webkit.org/show_bug.cgi?id=170314
1580         <rdar://problem/28676092> WKImageCreateCGImage should support WideGamut in WebKit2 on macOS
1581
1582         Reviewed by Simon Fraser.
1583
1584         Piping options through snapshots to allow for wide gamut support.
1585
1586         * Shared/API/c/WKImage.h:
1587         * Shared/API/c/WKSharedAPICast.h:
1588         (WebKit::snapshotOptionsFromImageOptions):
1589         * Shared/ImageOptions.h:
1590         (WebKit::snapshotOptionsToImageOptions):
1591         * Shared/WebImage.cpp:
1592         (WebKit::WebImage::create):
1593
1594 2017-03-30  Sam Weinig  <sam@webkit.org>
1595
1596         Expose the WKView SPI, _prepareForMoveToWindow:withCompletionHandler as WKWebView SPI
1597         <rdar://problem/31350588>
1598         https://bugs.webkit.org/show_bug.cgi?id=170315
1599
1600         Reviewed by Simon Fraser.
1601
1602         * UIProcess/API/Cocoa/WKWebView.mm:
1603         (-[WKWebView _prepareForMoveToWindow:completionHandler:]):
1604         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1605         Copy SPI to WKWebView. Remove 'with' prefix to match conventions.
1606
1607 2017-03-30  Wenson Hsieh  <wenson_hsieh@apple.com>
1608
1609         [WK2] Touches should not cancel when showing a custom action sheet while data interaction is active
1610         https://bugs.webkit.org/show_bug.cgi?id=170291
1611         <rdar://problem/31301388>
1612
1613         Reviewed by Tim Horton.
1614
1615         Currently, when presenting a custom popover, we will cancel all touches in the application. This makes data
1616         interaction when a custom popover is shown impossible -- to address this, we should only cancel touches when
1617         the view is not an active data interaction source.
1618
1619         New API test: DataInteractionTests.CustomActionSheetPopover.
1620
1621         * UIProcess/ios/WKContentViewInteraction.mm:
1622         (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]):
1623
1624 2017-03-30  Youenn Fablet  <youenn@apple.com>
1625
1626         NetworkConnectionToWebProcess should stop web sockets when being destroyed
1627         https://bugs.webkit.org/show_bug.cgi?id=170286
1628
1629         Reviewed by Brady Eidson.
1630
1631         * NetworkProcess/NetworkSocketStream.cpp:
1632         (WebKit::NetworkSocketStream::~NetworkSocketStream): Stopping the socket handle if not done already.
1633         * NetworkProcess/NetworkSocketStream.h:
1634
1635 2017-03-29  Tim Horton  <timothy_horton@apple.com>
1636
1637         Remove unused PageClient::removeNavigationGestureSnapshot
1638         https://bugs.webkit.org/show_bug.cgi?id=170249
1639
1640         Reviewed by Beth Dakin.
1641
1642         * UIProcess/PageClient.h:
1643         * UIProcess/WebPageProxy.cpp:
1644         (WebKit::WebPageProxy::removeNavigationGestureSnapshot): Deleted.
1645         * UIProcess/WebPageProxy.h:
1646         * UIProcess/mac/PageClientImpl.h:
1647         * UIProcess/mac/PageClientImpl.mm:
1648         (WebKit::PageClientImpl::removeNavigationGestureSnapshot): Deleted.
1649
1650 2017-03-29  Antti Koivisto  <antti@apple.com>
1651
1652         Increment the last stable network cache version on Mac
1653         https://bugs.webkit.org/show_bug.cgi?id=170248
1654         <rdar://problem/31326040>
1655
1656         Reviewed by Chris Dumez.
1657
1658         Bump to the latest release.
1659
1660         * NetworkProcess/cache/NetworkCacheStorage.h:
1661
1662 2017-03-28  Timothy Horton  <timothy_horton@apple.com>
1663
1664         Stop overriding scroll view inset defaults
1665         https://bugs.webkit.org/show_bug.cgi?id=170221
1666         <rdar://problem/31260325>
1667
1668         Reviewed by Simon Fraser.
1669
1670         * Platform/spi/ios/UIKitSPI.h:
1671         * UIProcess/API/Cocoa/WKWebView.mm:
1672         (-[WKWebView _initializeWithConfiguration:]):
1673         The default behavior is sufficient for us.
1674
1675 2017-03-28  Timothy Horton  <timothy_horton@apple.com>
1676
1677         Safari crashes when attempting to close tab that is displaying PDF
1678         https://bugs.webkit.org/show_bug.cgi?id=170201
1679         <rdar://problem/31242019>
1680
1681         Reviewed by Wenson Hsieh.
1682
1683         * UIProcess/API/Cocoa/WKWebView.mm:
1684         (-[WKWebView _doAfterNextStablePresentationUpdate:]):
1685         Adopt BlockPtr to fix a leak.
1686
1687         (-[WKWebView _firePresentationUpdateForPendingStableStatePresentationCallbacks]):
1688         dispatch_async in the doAfterNextPresentationUpdate callback; since this
1689         recursively calls itself, in cases where doAfterNextPresentationUpdate
1690         returns synchronously (e.g. if the Web Process is missing), we would
1691         recurse infinitely.
1692
1693 2017-03-27  Youenn Fablet  <youenn@apple.com>
1694
1695         Remove WebPage::m_shouldDoICECandidateFiltering
1696         https://bugs.webkit.org/show_bug.cgi?id=170150
1697
1698         Reviewed by Sam Weinig.
1699
1700         It is redundant with RTCController::m_shouldFilterICECandidates.
1701         Manually tested on webrtc test samples.
1702         This code path is currently untested by rwt as we hook it to getUserMedia which is mocked in rwt.
1703         Additional testing will be added as a follow-up patch.
1704
1705         * WebProcess/WebPage/WebPage.cpp:
1706         (WebKit::WebPage::disableICECandidateFiltering):
1707         (WebKit::WebPage::enableICECandidateFiltering):
1708         * WebProcess/WebPage/WebPage.h:
1709
1710 2017-03-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1711
1712         [WK2] UIKit assertion when rotating device after dismissing popover
1713         https://bugs.webkit.org/show_bug.cgi?id=170159
1714         <rdar://problem/31283829>
1715
1716         Reviewed by Tim Horton.
1717
1718         Ensure that when we are finished presenting a WKActionSheet, we unregister with the shared notifications center.
1719
1720         * UIProcess/ios/WKActionSheet.mm:
1721         (-[WKActionSheet dealloc]):
1722         (-[WKActionSheet _cleanup]):
1723         (-[WKActionSheet doneWithSheet:]):
1724
1725 2017-03-27  Andy Estes  <aestes@apple.com>
1726
1727         [iOS] Suppress page count recalc when setting a snapshot paper rect
1728         https://bugs.webkit.org/show_bug.cgi?id=170156
1729         <rdar://problem/30787872>
1730
1731         Reviewed by Tim Horton.
1732
1733         When _WKWebViewPrintFormatter computes a page count for snapshotting, it updates the paper
1734         rect, which triggers UIKit to ask for the page count again while we're in the middle of
1735         printing, putting us in a bad state.
1736
1737         Suppress page count recalc while setting the new paper rect, since we know this will not
1738         cause it to change.
1739
1740         * UIProcess/_WKWebViewPrintFormatter.mm:
1741         (-[_WKWebViewPrintFormatter _setSnapshotPaperRect:]): Temporarily set
1742         _suppressPageCountRecalc to YES before updating the paper rect.
1743         (-[_WKWebViewPrintFormatter _setNeedsRecalc]): Only call [super _setNeedsRecalc] if
1744         _suppressPageCountRecalc is NO.
1745         * UIProcess/_WKWebViewPrintFormatterInternal.h: Declared -_setNeedsRecalc.
1746
1747 2017-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1748
1749         [WK2] Callout Bar should be dismissed during data interaction
1750         https://bugs.webkit.org/show_bug.cgi?id=170109
1751         <rdar://problem/31171570>
1752
1753         Reviewed by Tim Horton.
1754
1755         Minor tweak to get the callout bar to duck during data interaction. Import a new UIKit SPI header in WebKit2.
1756
1757         * Platform/spi/ios/UIKitSPI.h:
1758
1759 2017-03-27  Keith Rollin  <krollin@apple.com>
1760
1761         Update NetworkResourceLoader logging statement
1762         https://bugs.webkit.org/show_bug.cgi?id=170126
1763
1764         Reviewed by Alex Christensen.
1765
1766         NetworkResourceLoader contains a logging statement that prints, in
1767         part: "start: Retrieving resource from cache". This is misleading,
1768         since it's not necessarily the case that the resource will be loaded
1769         from the cache. What is actually happening at the point where that is
1770         logged is that the cache is being checked for the resource. It still
1771         remains to be seen if the resource will be found in it. To address
1772         this, change the logging to say "start: Checking cache for resource".
1773
1774         * NetworkProcess/NetworkResourceLoader.cpp:
1775         (WebKit::NetworkResourceLoader::start):
1776
1777 2017-03-27  Joseph Pecoraro  <pecoraro@apple.com>
1778
1779         Web Inspector: Saving files should not suggest the top level directory
1780         https://bugs.webkit.org/show_bug.cgi?id=170085
1781         <rdar://problem/30197794>
1782
1783         Reviewed by Matt Baker.
1784
1785         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
1786         (WebKit::RemoteWebInspectorProxy::platformSave):
1787         * UIProcess/mac/WebInspectorProxyMac.mm:
1788         (WebKit::WebInspectorProxy::platformSave):
1789         Don't set panel.directoryURL unless we have a good suggestion.
1790
1791 2017-03-27  Yongjun Zhang  <yongjun_zhang@apple.com>
1792
1793         Add delegate method to let an WebKit client provide a custom image preview controller.
1794         https://bugs.webkit.org/show_bug.cgi?id=170076
1795         rdar://problem/31153051
1796
1797         Add a new delegate method (_webView:previewViewControllerForImage:alternateURL:defaultActions:elementInfo:) to
1798         WKUIDelegatePrivate, an client can use this method to provide a custom image preview view controller if the image
1799         has alternated URL or custom image info.
1800
1801         Reviewed by Beth Dakin.
1802
1803         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Add delegate method _webView:previewViewControllerForImage:alternateURL:defaultActions:elementInfo:.
1804         * UIProcess/ios/WKContentViewInteraction.mm:
1805         (-[WKContentView _presentedViewControllerForPreviewItemController:]): If the image has alternated URL or custom info, try to use the client-provided
1806             preview view controller. Otherwise, use the default WKImagePreviewViewController.
1807
1808 2017-03-27  Anders Carlsson  <andersca@apple.com>
1809
1810         Fix uses of deprecated API
1811         https://bugs.webkit.org/show_bug.cgi?id=170138
1812         rdar://problem/28882449
1813
1814         Reviewed by Tim Horton.
1815
1816         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1817         (WebKit::toPKContactFields):
1818         (WebKit::toPKAddressField):
1819         (WebKit::toPKPaymentRequest):
1820         Don't use deprecated APIs.
1821
1822         (WebKit::toNSError):
1823         Don't try to insert nil in a dictionary.
1824
1825 2017-03-27  Alex Christensen  <achristensen@webkit.org>
1826
1827         Make WebSockets work in network process
1828         https://bugs.webkit.org/show_bug.cgi?id=169930
1829
1830         Reviewed by Youenn Fablet.
1831
1832         This adds WebSocketStream, which is a SocketStreamHandle that sends asynchronous 
1833         messages to a NetworkSocketStream in the NetworkProcess.  WebKit1 uses a SocketStreamHandleImpl
1834         still, but WebKit2 now has a SocketStreamHandleImpl in the NetworkProcess owned by the 
1835         NetworkSocketStream, which is a SocketStreamHandleClient that sends asynchronous messages back
1836         to the WebProcess.  WebSocketStream's implementation of SocketStreamHandle::platformSend is special
1837         because it stores the completion handler in a map and asynchronously reports to the caller whether
1838         it succeeded or not.  If the network processes crashes before the completion handlers are called,
1839         then they are called indicating failure and an error is reported, but that never happens, right?
1840
1841         * CMakeLists.txt:
1842         * DerivedSources.make:
1843         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1844         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
1845         (WebKit::NetworkConnectionToWebProcess::createSocketStream):
1846         (WebKit::NetworkConnectionToWebProcess::destroySocketStream):
1847         * NetworkProcess/NetworkConnectionToWebProcess.h:
1848         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1849         * NetworkProcess/NetworkProcess.cpp:
1850         (WebKit::NetworkProcess::setAllowsAnySSLCertificateForWebSocket):
1851         * NetworkProcess/NetworkProcess.h:
1852         * NetworkProcess/NetworkProcess.messages.in:
1853         * NetworkProcess/NetworkSocketStream.cpp: Added.
1854         (WebKit::NetworkSocketStream::create):
1855         (WebKit::NetworkSocketStream::NetworkSocketStream):
1856         (WebKit::NetworkSocketStream::sendData):
1857         (WebKit::NetworkSocketStream::close):
1858         (WebKit::NetworkSocketStream::didOpenSocketStream):
1859         (WebKit::NetworkSocketStream::didCloseSocketStream):
1860         (WebKit::NetworkSocketStream::didReceiveSocketStreamData):
1861         (WebKit::NetworkSocketStream::didFailToReceiveSocketStreamData):
1862         (WebKit::NetworkSocketStream::didUpdateBufferedAmount):
1863         (WebKit::NetworkSocketStream::didFailSocketStream):
1864         (WebKit::NetworkSocketStream::messageSenderConnection):
1865         (WebKit::NetworkSocketStream::messageSenderDestinationID):
1866         * NetworkProcess/NetworkSocketStream.h: Added.
1867         * NetworkProcess/NetworkSocketStream.messages.in: Added.
1868         * UIProcess/API/C/WKContext.cpp:
1869         (WKContextSetAllowsAnySSLCertificateForWebSocketTesting):
1870         (WKContextTerminateNetworkProcess):
1871         * UIProcess/API/C/WKContextPrivate.h:
1872         * UIProcess/WebProcessPool.cpp:
1873         (WebKit::WebProcessPool::sendSyncToNetworkingProcess):
1874         (WebKit::WebProcessPool::setAllowsAnySSLCertificateForWebSocket):
1875         (WebKit::WebProcessPool::terminateNetworkProcess):
1876         * UIProcess/WebProcessPool.h:
1877         * WebKit2.xcodeproj/project.pbxproj:
1878         * WebProcess/Network/NetworkProcessConnection.cpp:
1879         (WebKit::NetworkProcessConnection::didReceiveMessage):
1880         * WebProcess/Network/WebSocketProvider.cpp:
1881         (WebKit::WebSocketProvider::createSocketStreamHandle):
1882         * WebProcess/Network/WebSocketStream.cpp: Added.
1883         (WebKit::globalWebSocketStreamMap):
1884         (WebKit::WebSocketStream::streamWithIdentifier):
1885         (WebKit::WebSocketStream::networkProcessCrashed):
1886         (WebKit::WebSocketStream::create):
1887         (WebKit::WebSocketStream::WebSocketStream):
1888         (WebKit::WebSocketStream::~WebSocketStream):
1889         (WebKit::WebSocketStream::messageSenderConnection):
1890         (WebKit::WebSocketStream::messageSenderDestinationID):
1891         (WebKit::WebSocketStream::platformSend):
1892         (WebKit::WebSocketStream::didSendData):
1893         (WebKit::WebSocketStream::platformClose):
1894         (WebKit::WebSocketStream::bufferedAmount):
1895         (WebKit::WebSocketStream::didOpenSocketStream):
1896         (WebKit::WebSocketStream::didCloseSocketStream):
1897         (WebKit::WebSocketStream::didReceiveSocketStreamData):
1898         (WebKit::WebSocketStream::didFailToReceiveSocketStreamData):
1899         (WebKit::WebSocketStream::didUpdateBufferedAmount):
1900         (WebKit::WebSocketStream::didFailSocketStream):
1901         * WebProcess/Network/WebSocketStream.h: Added.
1902         * WebProcess/Network/WebSocketStream.messages.in: Added.
1903         * WebProcess/WebProcess.cpp:
1904         (WebKit::WebProcess::networkProcessConnectionClosed):
1905
1906 2017-03-27  Adrian Perez de Castro  <aperez@igalia.com>
1907
1908         [GTK] NetscapePluginX11::m_windowID is unused/unneeded
1909         https://bugs.webkit.org/show_bug.cgi?id=170115
1910
1911         Reviewed by Michael Catanzaro.
1912
1913         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
1914         (WebKit::NetscapePluginX11::NetscapePluginX11):
1915         Remove the unneeded NetscapePluginX11::m_windowID member.
1916         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.h:
1917         Remove the unneeded NetscapePluginX11::m_windowID member.
1918
1919 2017-03-25  Andy Estes  <aestes@apple.com>
1920
1921         [iOS] Use snapshotting instead of printing to draw single-page PDFs
1922         https://bugs.webkit.org/show_bug.cgi?id=170103
1923         <rdar://problem/30542960>
1924
1925         Reviewed by Tim Horton.
1926
1927         * WebProcess/WebPage/WebPage.cpp:
1928         (WebKit::paintSnapshotAtSize): Moved the painting logic from WebPage::snapshotAtSize() to here.
1929         (WebKit::WebPage::snapshotAtSize): Changed to call paintSnapshotAtSize() with the
1930         WebImage's graphics context.
1931         (WebKit::WebPage::pdfSnapshotAtSize): Created a CGPDFGraphicsContext, passed it to
1932         paintSnapshotAtSize(), and returned the context's data.
1933         * WebProcess/WebPage/WebPage.h: Made snapshotAtSize() and snapshotNode() private, changed
1934         their return values from PassRefPtr to RefPtr, and declared pdfSnapshotAtSize().
1935         * WebProcess/WebPage/ios/WebPageIOS.mm:
1936         (WebKit::WebPage::computePagesForPrintingAndDrawToPDF): If snapshotting the first page,
1937         returned a page count of 1 and created a PDF using pdfSnapshotAtSize().
1938
1939 2017-03-25  John Wilander  <wilander@apple.com>
1940
1941         Re-enable the web process' keychain access to fix client certificate authentication
1942         https://bugs.webkit.org/show_bug.cgi?id=170074
1943         <rdar://problem/31095987>
1944
1945         Reviewed by Brent Fulgham.
1946
1947         This is a follow-up patch to
1948         https://trac.webkit.org/changeset/214389/webkit
1949         since according to Alexey Proskuryakov, resource
1950         loading has always required identical sandbox
1951         rules in WebContent and Networking processes.
1952
1953         * WebProcess/com.apple.WebProcess.sb.in:
1954             Reverted remaining change from
1955             https://trac.webkit.org/changeset/208702/webkit and
1956             https://trac.webkit.org/changeset/208707/webkit.
1957
1958 2017-03-24  Wenson Hsieh  <wenson_hsieh@apple.com>
1959
1960         [WK2] Add a UI delegate SPI hook to enable or disable navigation on drop
1961         https://bugs.webkit.org/show_bug.cgi?id=169168
1962         <rdar://problem/30688374>
1963
1964         Reviewed by Tim Horton.
1965
1966         Support customizing the set of allowed actions on drop in WebKit2 by introducing a new method to WKUIDelegatePrivate
1967         that returns a WKDragDestinationAction given platform dragging info. These flags are then used to initialize the
1968         DragData sent over to the web process, where they update DragController's view of the allowed destination actions.
1969
1970         Moving forward, the default action mask for WKWebViews will include everything except WKDragDestinationActionLoad,
1971         though for applciations linked on or before 10.12, we will still default to WKDragDestinationActionAny to mitigate
1972         any compatibility risk.
1973
1974         * Shared/API/Cocoa/WKDragDestinationAction.h:
1975
1976         Introduce WK2 client-facing versions of WebCore::DragDestinationAction flags.
1977
1978         * Shared/WebCoreArgumentCoders.cpp:
1979         (IPC::ArgumentCoder<DragData>::encode):
1980         (IPC::ArgumentCoder<DragData>::decode):
1981
1982         Serialize DragData's destination actions when sending DragData over IPC.
1983
1984         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1985         * UIProcess/API/Cocoa/WKWebView.mm:
1986         (-[WKWebView _web_dragDestinationActionForDraggingInfo:]):
1987
1988         For WKWebView, allow all drag destination actions except for loading (i.e. drop-to-navigate).
1989
1990         * UIProcess/API/mac/WKView.mm:
1991         (-[WKView _web_dragDestinationActionForDraggingInfo:]):
1992
1993         For WKView, allow all types of drag destination actions.
1994
1995         * UIProcess/Cocoa/VersionChecks.h:
1996         * UIProcess/Cocoa/WebViewImpl.h:
1997         * UIProcess/Cocoa/WebViewImpl.mm:
1998         (WebKit::WebViewImpl::draggingEntered):
1999         (WebKit::WebViewImpl::draggingUpdated):
2000         * WebKit2.xcodeproj/project.pbxproj:
2001         * WebProcess/WebCoreSupport/WebDragClient.cpp:
2002         (WebKit::WebDragClient::actionMaskForDrag):
2003         * WebProcess/WebCoreSupport/WebDragClient.h:
2004
2005 2017-03-24  Simon Fraser  <simon.fraser@apple.com>
2006
2007         [iOS WK2] Move from a pre-commit handler to dispatch_async for visible content rect updates
2008         https://bugs.webkit.org/show_bug.cgi?id=170091
2009         rdar://problem/30682584
2010
2011         Reviewed by Tim Horton.
2012         
2013         [CATransaction addCommitHandler:forPhase:] is sometimes not called when running inside another
2014         commit callback (rdar://problem/31253952), and we don't yet have a reliable way to detect this.
2015
2016         So dispatch_async() to postpone the call to [CATransaction addCommitHandler:forPhase:] to a known-
2017         good time.
2018
2019         * UIProcess/API/Cocoa/WKWebView.mm:
2020         (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
2021
2022 2017-03-24  John Wilander  <wilander@apple.com>
2023
2024         Re-enable the network process' keychain access to fix client certificate authentication
2025         https://bugs.webkit.org/show_bug.cgi?id=170074
2026         <rdar://problem/31095987>
2027
2028         Reviewed by Brent Fulgham.
2029
2030         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2031             Reverted remaining change from
2032             https://trac.webkit.org/changeset/208702/webkit and
2033             https://trac.webkit.org/changeset/208707/webkit.
2034
2035 2017-03-24  Eric Carlson  <eric.carlson@apple.com>
2036
2037         [MediaStream] "ideal" constraints passed to getUserMedia should affect fitness score
2038         https://bugs.webkit.org/show_bug.cgi?id=170056
2039
2040         Reviewed by Youenn Fablet.
2041
2042         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2043         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): When
2044         short-circuiting the user prompt because the page is already authorized, return the first
2045         audio and/or video device because so the page gets the one with the best fitness distance.
2046
2047 2017-03-24  Simon Fraser  <simon.fraser@apple.com>
2048
2049         Make UI-side compositing on macOS a bit more usable
2050         https://bugs.webkit.org/show_bug.cgi?id=170073
2051
2052         Reviewed by Tim Horton.
2053         
2054         Mach port as layer contents doesn't work on macOS, so don't use it there.
2055
2056         Also remove two assertions that hit with UI-side compositing in MiniBrowser.
2057
2058         * UIProcess/DrawingAreaProxy.cpp:
2059         (WebKit::DrawingAreaProxy::createFence):
2060         * UIProcess/mac/PageClientImpl.mm:
2061         (WebKit::PageClientImpl::requestScroll):
2062         * UIProcess/mac/RemoteLayerTreeHost.mm:
2063         (WebKit::RemoteLayerTreeHost::updateLayerTree):
2064
2065 2017-03-24  Alex Christensen  <achristensen@webkit.org>
2066
2067         Fix assertions after r214358.
2068         https://bugs.webkit.org/show_bug.cgi?id=169167
2069
2070         * UIProcess/API/APIContentExtensionStore.cpp:
2071         (API::ContentExtensionStore::compileContentExtension):
2072         AtomicString::init must be called for the first time from the main thread.
2073         We were calling it for the first time from a non-main thread sometimes.
2074         Call it from the main thread before initiating compiling on another thread.
2075
2076 == Rolled over to ChangeLog-2017-03-23 ==