[GTK] Switch to use ENABLE_REMOTE_INSPECTOR instead of ENABLE_INSPECTOR_SERVER for...
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2017-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2
3         [GTK] Switch to use ENABLE_REMOTE_INSPECTOR instead of ENABLE_INSPECTOR_SERVER for the remote inspector
4         https://bugs.webkit.org/show_bug.cgi?id=166680
5
6         Reviewed by Michael Catanzaro.
7
8         Remove INSPECTOR_SERVER code and add new classes to implement REMOTE_INSPECTOR. The WebKitWebContext registers a
9         custom protocol "inspector" that loads a page with the list of debuggable targets.
10
11         * PlatformGTK.cmake: Add new files to compilation and remove the old ones.
12         * UIProcess/API/gtk/WebKit2InspectorGResourceBundle.xml: Removed.
13         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp: Added.
14         (WebKit::RemoteInspectorProtocolHandler::RemoteInspectorProtocolHandler):
15         (WebKit::RemoteInspectorProtocolHandler::~RemoteInspectorProtocolHandler):
16         (WebKit::RemoteInspectorProtocolHandler::webViewDestroyed):
17         (WebKit::RemoteInspectorProtocolHandler::userContentManagerDestroyed):
18         (WebKit::RemoteInspectorProtocolHandler::handleRequest):
19         (WebKit::RemoteInspectorProtocolHandler::inspect):
20         (WebKit::RemoteInspectorProtocolHandler::targetListChanged):
21         (WebKit::RemoteInspectorProtocolHandler::connectionClosed):
22         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.h: Added.
23         * UIProcess/API/gtk/WebKitWebContext.cpp:
24         (webkitWebContextConstructed):
25         * UIProcess/InspectorServer/HTTPRequest.cpp: Add missing ENABLE(INSPECTOR_SERVER) ifdefs.
26         * UIProcess/InspectorServer/HTTPRequest.h:
27         * UIProcess/InspectorServer/WebInspectorServer.h:
28         * UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp: Removed.
29         * UIProcess/RemoteWebInspectorProxy.cpp:
30         * UIProcess/RemoteWebInspectorProxy.h:
31         * UIProcess/WebProcessPool.cpp:
32         * UIProcess/glib/RemoteInspectorClient.cpp: Added.
33         (WebKit::RemoteInspectorClient::RemoteInspectorClient):
34         (WebKit::RemoteInspectorClient::~RemoteInspectorClient):
35         (WebKit::dbusConnectionCallAsyncReadyCallback):
36         (WebKit::RemoteInspectorClient::connectionClosedCallback):
37         (WebKit::RemoteInspectorClient::setupConnection):
38         (WebKit::RemoteInspectorClient::connectionClosed):
39         (WebKit::RemoteInspectorClient::inspect):
40         (WebKit::RemoteInspectorClient::sendMessageToBackend):
41         (WebKit::RemoteInspectorClient::closeFromFrontend):
42         (WebKit::RemoteInspectorClient::setTargetList):
43         (WebKit::RemoteInspectorClient::sendMessageToFrontend):
44         * UIProcess/glib/RemoteInspectorClient.h: Added.
45         (WebKit::RemoteInspectorObserver::~RemoteInspectorObserver):
46         (WebKit::RemoteInspectorClient::targets):
47         (WebKit::RemoteInspectorClient::hostAndPort):
48         * UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp: Added.
49         (WebKit::RemoteWebInspectorProxy::updateWindowTitle):
50         (WebKit::inspectorViewDestroyed):
51         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
52         (WebKit::RemoteWebInspectorProxy::platformCloseFrontendPageAndWindow):
53         (WebKit::RemoteWebInspectorProxy::platformBringToFront):
54         (WebKit::RemoteWebInspectorProxy::platformSave):
55         (WebKit::RemoteWebInspectorProxy::platformAppend):
56         (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag):
57         (WebKit::RemoteWebInspectorProxy::platformOpenInNewTab):
58         * UIProcess/gtk/WebProcessPoolGtk.cpp:
59         (WebKit::initializeRemoteInspectorServer):
60         (WebKit::WebProcessPool::platformInitialize):
61         (WebKit::WebProcessPool::platformInitializeWebProcess):
62         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
63         (didReceiveMessageToPage): Updated after the GRefPtr hash traitds changes.
64         * config.h:
65
66 2017-04-23  Dan Bernstein  <mitz@apple.com>
67
68         [macOS] WKWebInspectorProxyObjCAdapter has a public ivar
69         https://bugs.webkit.org/show_bug.cgi?id=171200
70
71         Reviewed by Geoffrey Garen.
72
73         * UIProcess/API/C/mac/WKInspectorPrivateMac.h: Made ivar private.
74
75 2017-04-23  Commit Queue  <commit-queue@webkit.org>
76
77         Unreviewed, rolling out r215657 and r215676.
78         https://bugs.webkit.org/show_bug.cgi?id=171201
79
80         Broke the build (Requested by ap on #webkit).
81
82         Reverted changesets:
83
84         "[macOS] Enable media selection button on AVTouchBarScrubber"
85         https://bugs.webkit.org/show_bug.cgi?id=171149
86         http://trac.webkit.org/changeset/215657
87
88         "Build fix after r215657."
89         http://trac.webkit.org/changeset/215676
90
91 2017-04-23  Alexey Proskuryakov  <ap@apple.com>
92
93         Build fix after r215657.
94
95         * UIProcess/Cocoa/WebViewImpl.mm:
96
97 2017-04-23  Andy Estes  <aestes@apple.com>
98
99         [macOS] AVTouchBarMediaSelectionOptions should be created with the correct type
100         https://bugs.webkit.org/show_bug.cgi?id=171192
101         <rdar://problem/29875010>
102
103         Reviewed by Wenson Hsieh.
104
105         * Shared/WebCoreArgumentCoders.cpp:
106         (IPC::ArgumentCoder<MediaSelectionOption>::encode):
107         (IPC::ArgumentCoder<MediaSelectionOption>::decode):
108         * Shared/WebCoreArgumentCoders.h:
109         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
110         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in:
111         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
112         (WebKit::WebPlaybackSessionModelContext::setAudioMediaSelectionOptions):
113         (WebKit::WebPlaybackSessionModelContext::setLegibleMediaSelectionOptions):
114         (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionOptions):
115         (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionOptions):
116         * WebProcess/cocoa/WebPlaybackSessionManager.h:
117         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
118         (WebKit::WebPlaybackSessionInterfaceContext::audioMediaSelectionOptionsChanged):
119         (WebKit::WebPlaybackSessionInterfaceContext::legibleMediaSelectionOptionsChanged):
120         (WebKit::WebPlaybackSessionManager::audioMediaSelectionOptionsChanged):
121         (WebKit::WebPlaybackSessionManager::legibleMediaSelectionOptionsChanged):
122
123 2017-04-21  Wenson Hsieh  <wenson_hsieh@apple.com>
124
125         Support writing link titles to the pasteboard when beginning data interaction on a link
126         https://bugs.webkit.org/show_bug.cgi?id=171154
127         <rdar://problem/31356937>
128
129         Reviewed by Andy Estes.
130
131         Adds support for setting the _title attribute of NSURLs written to the pasteboard. See WebCore ChangeLog for more details.
132
133         * Scripts/webkit/messages.py:
134         (headers_for_type):
135         * Shared/WebCoreArgumentCoders.cpp:
136         (IPC::ArgumentCoder<PasteboardURL>::encode):
137         (IPC::ArgumentCoder<PasteboardURL>::decode):
138         * Shared/WebCoreArgumentCoders.h:
139
140         Teach PasteboardURL to be serialized in IPC. For now, we just send across the absolute string of the link and
141         its title.
142
143         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
144         (WebKit::WebPasteboardProxy::writeURLToPasteboard):
145         * UIProcess/WebPasteboardProxy.h:
146         * UIProcess/WebPasteboardProxy.messages.in:
147
148         Add IPC plumbing for writing PasteboarURLs to the pasteboard.
149
150         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
151         (WebKit::WebPlatformStrategies::writeToPasteboard):
152         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
153
154 2017-04-21  Michael Catanzaro  <mcatanzaro@igalia.com>
155
156         Unreviewed, rolling out r215608.
157
158         Hundreds of test failures on GTK bot
159
160         Reverted changeset:
161
162         "Reduce copies and allocations in SharedBuffer::append"
163         https://bugs.webkit.org/show_bug.cgi?id=170956
164         http://trac.webkit.org/changeset/215608
165
166 2017-04-21  Andy Estes  <aestes@apple.com>
167
168         [macOS] Enable media selection button on AVTouchBarScrubber
169         https://bugs.webkit.org/show_bug.cgi?id=171149
170         <rdar://problem/29875010>
171
172         Reviewed by Beth Dakin.
173
174         * UIProcess/Cocoa/WebViewImpl.mm:
175         (WebKit::WebViewImpl::updateMediaTouchBar):
176
177 2017-04-21  Wenson Hsieh  <wenson_hsieh@apple.com>
178
179         [WK2] Add delegate hooks for overriding unhanded data interaction operations
180         https://bugs.webkit.org/show_bug.cgi?id=171005
181         <rdar://problem/31669646>
182
183         Reviewed by Tim Horton.
184
185         Adds support for overriding data interaction operations through two new delegate methods:
186         _webView:willUpdateDataInteractionOperationToOperation:forSession:, and
187         _webView:dataInteractionOperationWasHandled:forSession:. The former may be overridden to return a different
188         operation type than what WebKit would originally have returned, and the latter may be overridden to run custom
189         logic after the web process has handled a data interaction operation.
190
191         Additionally, includes some minor cleanup around WKContentViewInteraction. With the new
192         _webView:dataInteractionOperationWasHandled:forSession: delegate method, the last method on _WKTestingDelegate
193         may be removed. This means _WKTestingDelegate is no longer needed, so this patch removes its header entirely.
194         Also, relocates some state variables formerly on WKContentView to WKContentView's WKDataInteractionState struct
195         instead, so that all state associated with data interaction may be cleaned up at the same time.
196
197         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
198         * UIProcess/API/Cocoa/WKWebView.mm:
199         (-[WKWebView _testingDelegate]): Deleted.
200         (-[WKWebView _setTestingDelegate:]): Deleted.
201         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
202         * UIProcess/API/Cocoa/_WKTestingDelegate.h: Removed.
203         * UIProcess/PageClient.h:
204         * UIProcess/WebPageProxy.h:
205         * UIProcess/WebPageProxy.messages.in:
206
207         Add a new "handled" IPC argument to DidPerformDataInteractionControllerOperation. This lets the UI process
208         know whether or not the data interaction operation was handled by the web process, and is eventually plumbed
209         through to the UI delegate via the new SPI.
210
211         * UIProcess/ios/PageClientImplIOS.h:
212         * UIProcess/ios/PageClientImplIOS.mm:
213         (WebKit::PageClientImpl::didPerformDataInteractionControllerOperation):
214         * UIProcess/ios/WKContentViewInteraction.h:
215         * UIProcess/ios/WKContentViewInteraction.mm:
216         (-[WKContentView cleanupInteraction]):
217         (-[WKContentView _displayFormNodeInputView]):
218         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
219         * UIProcess/ios/WebPageProxyIOS.mm:
220         (WebKit::WebPageProxy::didPerformDataInteractionControllerOperation):
221         * WebKit2.xcodeproj/project.pbxproj:
222         * WebProcess/WebPage/WebPage.cpp:
223         (WebKit::WebPage::performDragControllerAction):
224
225 2017-04-21  Anders Carlsson  <andersca@apple.com>
226
227         Stop using deprecated APIs, part 5
228         https://bugs.webkit.org/show_bug.cgi?id=171134
229         rdar://problem/31589635
230
231         Reviewed by Tim Horton.
232
233         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
234         (WebKit::toPKPaymentAuthorizationStatus):
235         Remove this and add a new version that doesn't use any deprecated values.
236
237         (WebKit::toPKPaymentAuthorizationStatus):
238         New function that takes a WebCore::PaymentAuthorizationResult and converts it to a status, for older OSes.
239
240         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
241         Use the new toPKPaymentAuthorizationStatus versions.
242
243         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
244         Ditto.
245
246         (WebKit::status): Deleted.
247
248 2017-04-21  David Kilzer  <ddkilzer@apple.com>
249
250         Switch from -std=gnu++11 to -std=gnu++14 for consistency in DerivedSources.make
251         <https://webkit.org/b/171122>
252
253         Reviewed by Brent Fulgham.
254
255         * DerivedSources.make: Switch to -std=gnu++14 for preprocessing
256         headers to check for build settings.
257
258 2017-04-21  Jer Noble  <jer.noble@apple.com>
259
260         [WK2][MediaCapture] Pass muted and enabled state across process boundary when capturing in UIProcess
261         https://bugs.webkit.org/show_bug.cgi?id=170846
262
263         Reviewed by Jon Lee.
264
265         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
266         (WebKit::UserMediaCaptureManagerProxy::setMuted):
267         (WebKit::UserMediaCaptureManagerProxy::setEnabled):
268         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
269         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
270         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
271         (WebKit::UserMediaCaptureManager::Source::setMuted):
272         (WebKit::UserMediaCaptureManager::Source::setEnabled):
273         (WebKit::UserMediaCaptureManager::setMuted):
274         (WebKit::UserMediaCaptureManager::setEnabled):
275         * WebProcess/cocoa/UserMediaCaptureManager.h:
276
277 2017-04-21  Jer Noble  <jer.noble@apple.com>
278
279         [WK2][MediaCapture] Remove now-unused WKWebViewConfiguration property for shouldCaptureAudioInUIProcess
280         https://bugs.webkit.org/show_bug.cgi?id=170847
281
282         Reviewed by Jon Lee.
283
284         * Shared/WebPreferencesDefinitions.h:
285         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
286         (-[WKWebViewConfiguration copyWithZone:]):
287         (-[WKWebViewConfiguration _shouldCaptureAudioInUIProcess]): Deleted.
288         (-[WKWebViewConfiguration _setShouldCaptureAudioInUIProcess:]): Deleted.
289
290 2017-04-21  Anders Carlsson  <andersca@apple.com>
291
292         Stop using deprecated APIs, part 4
293         https://bugs.webkit.org/show_bug.cgi?id=171125
294         rdar://problem/31589635
295
296         Reviewed by Tim Horton.
297
298         It doesn't really matter what we pass to these completion functions, since the sheet has already been dismissed at this point
299         so just remove the status parameter.
300
301         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
302         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]):
303         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]):
304         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]):
305
306 2017-04-21  Andrew Gold  <agold@apple.com>
307
308         -[WKUIDelegatePrivate _webView:requestUserMediaAuthorizationForMicrophone:camera:url:mainFrameURL:decisionHandler:] 
309         decision handler should only have one parameter.
310         https://bugs.webkit.org/show_bug.cgi?id=171081
311
312         Reviewed by Tim Horton.
313
314         Because user media authorization is all or nothing, we should not have separate booleans
315         to indicate authorization. Additionally, rather than passing two separate booleans to the
316         UIDelegate, we now pass an NS_OPTIONS parameter.
317
318         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
319         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Added _WKCaptureDevice NS_OPTIONS.
320
321         * UIProcess/Cocoa/UIDelegate.mm:
322         * UIProcess/Cocoa/UIDelegate.mm:
323         (WebKit::UIDelegate::setDelegate): Uses new WKUIDelegatePrivate method.
324         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Ditto.
325
326 2017-04-21  Konstantin Tokarev  <annulen@yandex.ru>
327
328         Unreviewed, added missing file to PlatformMac.cmake
329
330         * PlatformMac.cmake:
331
332 2017-04-21  Konstantin Tokarev  <annulen@yandex.ru>
333
334         Unreviewed follow-up for r215609
335
336         * UIProcess/API/Cocoa/WKWebView.mm: Move internal header include too.
337
338 2017-04-21  Konstantin Tokarev  <annulen@yandex.ru>
339
340         Include iOS-specific headers inside preprocessor guard
341         https://bugs.webkit.org/show_bug.cgi?id=171104
342
343         Reviewed by Michael Catanzaro.
344
345         This patch should fix Mac cmake build.
346
347         * UIProcess/API/Cocoa/WKWebView.mm:
348
349 2017-04-21  Alex Christensen  <achristensen@webkit.org>
350
351         Reduce copies and allocations in SharedBuffer::append
352         https://bugs.webkit.org/show_bug.cgi?id=170956
353
354         Reviewed by Andreas Kling.
355
356         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
357         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
358         * Platform/IPC/DataReference.cpp:
359         (IPC::SharedBufferDataReference::encode):
360         * Shared/ShareableResource.cpp:
361         (WebKit::ShareableResource::wrapInSharedBuffer):
362         * UIProcess/API/Cocoa/WKURLSchemeHandlerTask.mm:
363         (-[WKURLSchemeHandlerTaskImpl didReceiveData:]):
364         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
365         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
366         * WebProcess/Plugins/PDF/PDFPlugin.mm:
367         (WebKit::PDFPlugin::addArchiveResource):
368         (WebKit::PDFPlugin::liveResourceData):
369         (WebKit::PDFPlugin::writeItemsToPasteboard):
370         * WebProcess/Plugins/PluginView.cpp:
371         (WebKit::PluginView::redeliverManualStream):
372         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
373         (WebKit::WebDragClient::declareAndWriteDragImage):
374         * WebProcess/WebPage/mac/WebPageMac.mm:
375         (WebKit::WebPage::cachedResponseDataForURL):
376
377 2017-04-20  Konstantin Tokarev  <annulen@yandex.ru>
378
379         [cmake] Define FORWARDING_HEADERS_DIR in WebKitFS and use it everywhere
380         https://bugs.webkit.org/show_bug.cgi?id=171071
381
382         Reviewed by Michael Catanzaro.
383
384         "${DERIVED_SOURCES_DIR}/ForwardingHeaders" path occurs very often in the
385         build system files. GTK-specifc FORWARDING_HEADERS_DIR variable should
386         be available for all ports.
387
388         * CMakeLists.txt:
389         * PlatformMac.cmake:
390
391 2017-04-20  Brady Eidson  <beidson@apple.com>
392
393         WebContent process becomes unresponsive after returning nil from async version of -webView:createWebViewWithConfiguration:...
394         <rdar://problem/31739023> and https://bugs.webkit.org/show_bug.cgi?id=171090
395
396         Reviewed by Andy Estes.
397
398         * UIProcess/Cocoa/UIDelegate.mm:
399         (WebKit::UIDelegate::UIClient::createNewPageCommon): Handle the perfectly valid "nil webView" case correctly.
400
401 2017-04-20  Dan Bernstein  <mitz@apple.com>
402
403         Disable header postprocessing when building for Sierra
404
405         Absolutely rubber-stamped by Anders Carlsson.
406
407         * Configurations/WebKit.xcconfig:
408
409 2017-04-20  Matt Rajca  <mrajca@apple.com>
410
411         Cocoa: add private API for suppressing first responder changes
412         https://bugs.webkit.org/show_bug.cgi?id=171069
413         <rdar://problem/31658967>
414
415         Reviewed by Tim Horton.
416
417         Some clients may not want the web view to be programmatically made the first responder
418         and invoking -makeFirstResponder: unconditionally posts 'first responder did change'
419         notifications.
420
421         Added API test.
422
423         * UIProcess/API/Cocoa/WKWebView.mm:
424         (-[WKWebView _setShouldSuppressFirstResponderChanges:]):
425         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
426         * UIProcess/Cocoa/WebViewImpl.h:
427         * UIProcess/Cocoa/WebViewImpl.mm:
428         (WebKit::WebViewImpl::setShouldSuppressFirstResponderChanges):
429         * UIProcess/PageClient.h:
430         * UIProcess/mac/PageClientImpl.h:
431         * UIProcess/mac/PageClientImpl.mm:
432         (WebKit::PageClientImpl::makeFirstResponder):
433
434 2017-04-20  Eric Carlson  <eric.carlson@apple.com>
435
436         [MediaStream iOS] Hold process assertion while media capture is active
437         https://bugs.webkit.org/show_bug.cgi?id=171017
438         <rdar://problem/31719177>
439
440         Reviewed by Dean Jackson.
441
442         * UIProcess/WebPageProxy.cpp:
443         (WebKit::WebPageProxy::updateActivityState): Update IsCapturingMedia when necessary.
444         (WebKit::WebPageProxy::updateThrottleState): Hold a token when capture is active.
445         (WebKit::WebPageProxy::setMuted): Capture state may change when the page is muted,
446         so pass IsCapturingMedia to activityStateDidChange.
447         (WebKit::WebPageProxy::isPlayingMediaDidChange): Ditto.
448
449         * WebProcess/WebPage/WebPage.cpp:
450         (WebKit::WebPage::updateThrottleState): Don't allow page suppression when capture
451         is active. 
452
453 2017-04-20  Anders Carlsson  <andersca@apple.com>
454
455         Fix build.
456
457         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
458         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
459
460 2017-04-20  Brady Eidson  <beidson@apple.com>
461
462         Add CompletionHandlerCallChecker to SPI added in r215545.
463         https://bugs.webkit.org/show_bug.cgi?id=171067
464
465         Reviewed by Dan Bernstein.
466
467         * UIProcess/Cocoa/UIDelegate.mm:
468         (WebKit::UIDelegate::UIClient::createNewPageCommon):
469
470 2017-04-20  Anders Carlsson  <andersca@apple.com>
471
472         Replace isFinalStateStatus with isFinalStateResult
473         https://bugs.webkit.org/show_bug.cgi?id=171072
474         rdar://problem/31589635
475
476         Reviewed by Tim Horton.
477
478         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
479         (WebKit::WebPaymentCoordinatorProxy::completePaymentSession):
480
481 2017-04-20  Wenson Hsieh  <wenson_hsieh@apple.com>
482
483         [WK2] -[WKContentView doAfterPositionInformationUpdate:atPosition:] should be robust against synchronous reentrancy
484         https://bugs.webkit.org/show_bug.cgi?id=170922
485         <rdar://problem/31634990>
486
487         Reviewed by Tim Horton.
488
489         Refactors part of the asynchronous position information mechanism introduced in
490         <https://trac.webkit.org/changeset/215171>, and introduces infrastructure for unit testing UI-side position
491         information requests.
492
493         _invokeAndRemovePendingHandlersValidForCurrentPositionInformation is a helper method on WKContentView
494         responsible for invoking queued position information handlers after receiving a position information response
495         from the web process. Previously, this method would iterate over the list of pending callbacks and invoke all
496         callbacks whose requests are satisfied by the incoming position information update, saving the indices of these
497         handled callbacks in the process. At the end, it would then remove callbacks at these indices from the array of
498         pending callbacks. This is problematic when a synchronous position update (via
499         ensurePositionInformationIsUpToDate:) is triggered from within one of these callbacks, since
500         _invokeAndRemovePendingHandlersValidForCurrentPositionInformation will be called from within itself, and then we
501         will attempt to remove a callback at the same index twice.
502
503         To fix this, we change the array of pending position information handlers to be an array of optionals instead.
504         When invoking and removing pending handlers after a position information response arrives, we now mark callbacks
505         as handled by setting them to std::nullopt. Then, when the top-level invocation to
506         _invokeAndRemovePendingHandlersValidForCurrentPositionInformation is finished, we remove all marked handlers
507         from the pending vector.
508
509         Covered by 6 new unit tests:
510         - PositionInformationTests.FindDraggableLinkAtPosition
511         - PositionInformationTests.RequestDraggableLinkAtPosition
512         - PositionInformationTests.FindDraggableLinkAtDifferentPositionWithinRequestBlock
513         - PositionInformationTests.FindDraggableLinkAtSamePositionWithinRequestBlock
514         - PositionInformationTests.RequestDraggableLinkAtSamePositionWithinRequestBlock
515         - PositionInformationTests.RequestDraggableLinkAtDifferentPositionWithinRequestBlock
516
517         * UIProcess/API/Cocoa/WKWebView.mm:
518         (-[WKWebView draggableElementAtPosition:]):
519         (-[WKWebView requestDraggableElementAtPosition:completionBlock:]):
520
521         Uses WKContentView's position information request helpers to search for draggable elements on the page. There
522         are both synchronous and asynchronous versions of this, both of which retrieve a _WKDraggableElementInfo.
523
524         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
525         * UIProcess/API/Cocoa/_WKDraggableElementInfo.h: Added.
526         * UIProcess/API/Cocoa/_WKDraggableElementInfo.mm: Added.
527
528         Exposes what elements are draggable at a given position as SPI (only for use in testing code, at the moment).
529
530         (-[_WKDraggableElementInfo initWithInteractionInformationAtPosition:]):
531         (-[_WKDraggableElementInfo copyWithZone:]):
532         * UIProcess/API/Cocoa/_WKDraggableElementInfoInternal.h: Added.
533         * UIProcess/ios/WKContentViewInteraction.h:
534         * UIProcess/ios/WKContentViewInteraction.mm:
535         (-[WKContentView currentPositionInformation]):
536         (-[WKContentView doAfterPositionInformationUpdate:forRequest:]):
537         (-[WKContentView _invokeAndRemovePendingHandlersValidForCurrentPositionInformation]):
538         * WebKit2.xcodeproj/project.pbxproj:
539
540 2017-04-20  Anders Carlsson  <andersca@apple.com>
541
542         Fix a PassKit function declaration typo
543         https://bugs.webkit.org/show_bug.cgi?id=171068
544         rdar://problem/31635008
545
546         Reviewed by Tim Horton.
547
548         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
549         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
550
551 2017-04-20  Jer Noble  <jer.noble@apple.com>
552
553         [MediaCapture] gUM() with CoreAudio fails if capturing audio in the UIProcess.
554         https://bugs.webkit.org/show_bug.cgi?id=171021
555
556         Reviewed by Eric Carlson.
557
558         Pass a deviceID rather than a CaptureDevice across the process boundary.
559
560         * Shared/WebCoreArgumentCoders.h:
561         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
562         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
563         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
564         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
565         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
566         (WebKit::UserMediaCaptureManager::createMediaSourceForCaptureDeviceWithConstraints):
567         * WebProcess/cocoa/UserMediaCaptureManager.h:
568
569 2017-04-20  Alex Christensen  <achristensen@webkit.org>
570
571         Fix assertions in webProcessProxyFromConnection
572         https://bugs.webkit.org/show_bug.cgi?id=171025
573         <rdar://problem/31184073>
574
575         Reviewed by Brady Eidson.
576
577         * UIProcess/WebProcessPool.cpp:
578         (WebKit::webProcessProxyFromConnection):
579         If we have a Connection, then we have a valid process attached to that connection,
580         unless it's a Connection to a different type of child process.
581         Calling ChildProcessProxy::connection on other web processes that are in State::Launching,
582         then we get an assertion.  Luckily, ChildProcessProxy::hasConnection was introduced in r210861
583         for this reason.
584
585 2017-04-20  Brent Fulgham  <bfulgham@apple.com>
586
587         [WK2][macOS] Allow iokit-get-properties for IOAudioControlValue
588         https://bugs.webkit.org/show_bug.cgi?id=171020
589         <rdar://problem/30878974>
590
591         Reviewed by Alexey Proskuryakov.
592
593         * WebProcess/com.apple.WebProcess.sb.in: Add missing property name.
594
595 2017-04-19  Joseph Pecoraro  <pecoraro@apple.com>
596
597         Remove WebKitTestRunner code for enabling features that are already enabled by default
598         https://bugs.webkit.org/show_bug.cgi?id=171033
599
600         Reviewed by Ryosuke Niwa.
601
602         * WebProcess/InjectedBundle/InjectedBundle.cpp:
603         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
604
605 2017-04-19  Youenn Fablet  <youenn@apple.com>
606
607         [Mac] Allow customizing H264 encoder
608         https://bugs.webkit.org/show_bug.cgi?id=170829
609
610         Reviewed by Alex Christensen.
611
612         * Configurations/FeatureDefines.xcconfig:
613         * WebKit2.xcodeproj/project.pbxproj:
614
615 2017-04-19  Brady Eidson  <beidson@apple.com>
616
617         Add asynchronous equivalent of -[<WKUIDelegate> webView:createWebViewWithConfiguration:...].
618         <rdar://problem/30699851> and https://bugs.webkit.org/show_bug.cgi?id=171018
619
620         Reviewed by Tim Horton.
621
622         * UIProcess/API/APIUIClient.h:
623         (API::UIClient::createNewPageAsync):
624
625         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
626
627         * UIProcess/Cocoa/UIDelegate.h:
628         * UIProcess/Cocoa/UIDelegate.mm:
629         (WebKit::UIDelegate::setDelegate):
630         (WebKit::UIDelegate::UIClient::createNewPageCommon):
631         (WebKit::UIDelegate::UIClient::createNewPage):
632         (WebKit::UIDelegate::UIClient::createNewPageAsync):
633
634         * UIProcess/WebPageProxy.cpp:
635         (WebKit::WebPageProxy::createNewPage):
636         * UIProcess/WebPageProxy.h:
637         * UIProcess/WebPageProxy.messages.in:
638
639 2017-04-19  Anders Carlsson  <andersca@apple.com>
640
641         Stop using deprecated APIs, part 3
642         https://bugs.webkit.org/show_bug.cgi?id=171003
643         rdar://problem/31589635
644
645         Reviewed by Tim Horton.
646
647         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
648         (IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::encode):
649         (IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::decode):
650         Don't encode/decode status.
651
652         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
653         (WebKit::WebPaymentCoordinatorProxy::cancelPaymentSession):
654         Hide the UI and report back.
655
656         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
657         Add new member.
658
659         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
660         Add new message.
661
662         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
663         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
664         Always pass success in the old code path. Stop using the deprecated method.
665
666         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
667         (WebKit::WebPaymentCoordinator::cancelPaymentSession):
668         Send a message to the UI process.
669
670         * WebProcess/ApplePay/WebPaymentCoordinator.h:
671         Add new member.
672
673 2017-04-19  Eric Carlson  <eric.carlson@apple.com>
674
675         [MediaStream] Limit capture to one tab at a time
676         https://bugs.webkit.org/show_bug.cgi?id=171009
677
678         Reviewed by Jon Lee.
679
680         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
681         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): Deleted, not used.
682         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
683
684         * UIProcess/UserMediaProcessManager.cpp:
685         (WebKit::UserMediaProcessManager::willEnableMediaStreamInPage): Mute media streams
686         on other pages.
687         (WebKit::UserMediaProcessManager::willCreateMediaStream): Call willEnableMediaStreamInPage.
688         * UIProcess/UserMediaProcessManager.h:
689
690         * UIProcess/WebPageProxy.cpp:
691         (WebKit::WebPageProxy::setMuted): If media streams in the page will be unmuted, call
692         willEnableMediaStreamInPage so streams in other pages are muted first.
693
694 2017-04-19  Brady Eidson  <beidson@apple.com>
695
696         REGRESSION (r213168): An extra Web Content process is spun up on launch and is never closed.
697         <rdar://problem/30774839> and https://bugs.webkit.org/show_bug.cgi?id=171002
698
699         Reviewed by Alex Christensen.
700
701         The original change unnecessarily avoided using the initial warmed process if an explicit
702         data store was set on the new WKWebView.
703         
704         Fixing that fixes the regression.
705         
706         * UIProcess/API/Cocoa/WKProcessPool.mm:
707         (-[WKProcessPool _webProcessCount]):
708         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
709
710         * UIProcess/WebProcessPool.cpp:
711         (WebKit::WebProcessPool::createWebPage):
712
713 2017-04-19  Anders Carlsson  <andersca@apple.com>
714
715         Rename cancelPayment to cancelPaymentSession
716         https://bugs.webkit.org/show_bug.cgi?id=171007
717
718         Reviewed by Tim Horton.
719
720         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
721         (WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
722         (WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession):
723         (WebKit::WebPaymentCoordinatorProxy::didCancelPayment): Deleted.
724         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
725         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
726         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]):
727         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
728         (WebKit::WebPaymentCoordinator::didCancelPaymentSession):
729         (WebKit::WebPaymentCoordinator::didCancelPayment): Deleted.
730         * WebProcess/ApplePay/WebPaymentCoordinator.h:
731         * WebProcess/ApplePay/WebPaymentCoordinator.messages.in:
732
733 2017-04-19  David Kilzer  <ddkilzer@apple.com>
734
735         Stop using strcpy() in WebKit::EnvironmentUtilities::stripValuesEndingWithString()
736         <https://webkit.org/b/170994>
737         <rdar://problem/29889932>
738
739         Reviewed by Brent Fulgham.
740
741         * Platform/unix/EnvironmentUtilities.cpp:
742         (WebKit::EnvironmentUtilities::stripValuesEndingWithString):
743         Switch from using strcpy() to strlcpy().  Also switch from using
744         strstr() to strnstr().
745         * Platform/unix/EnvironmentUtilities.h: Switch to #pragma once.
746         (WebKit::EnvironmentUtilities::stripValuesEndingWithString):
747         Export function for testing.
748         * WebKit2.xcodeproj/project.pbxproj:
749         (EnvironmentUtilitiesTest.h): Make header private for testing.
750
751 2017-04-19  Eric Carlson  <eric.carlson@apple.com>
752
753         Provide a way for clients to unmute a media stream.
754         https://bugs.webkit.org/show_bug.cgi?id=170855
755         <rdar://problem/31656855>
756
757         Unreviewed, fix a typo missed in the review of r215420.
758
759         * UIProcess/API/Cocoa/WKWebView.mm:
760         (-[WKWebView _setPageMuted:]):
761
762 2017-04-19  Adrian Perez de Castro  <aperez@igalia.com>
763
764         [GTK] WebKitAutocleanups.h regression in v2.16.1 release
765         https://bugs.webkit.org/show_bug.cgi?id=170987
766
767         Reviewed by Carlos Garcia Campos.
768
769         * UIProcess/API/gtk/WebKitAutocleanups.h: Remove stray semicolon.
770
771 2017-04-18  Per Arne Vollan  <pvollan@apple.com>
772
773         Dragging a few items over MiniBrowser has 0 in the red indicator.
774         https://bugs.webkit.org/show_bug.cgi?id=170874
775
776         Reviewed by Tim Horton.
777
778         When WebKit does not accept the drag items, the drag count badge should not be updated.
779         Also, if WebKit changes the drag count badge, it should be restored to its original
780         value when the drag exits.
781
782         * UIProcess/Cocoa/WebViewImpl.h:
783         * UIProcess/Cocoa/WebViewImpl.mm:
784         (WebKit::WebViewImpl::draggingEntered):
785         (WebKit::WebViewImpl::draggingUpdated):
786         (WebKit::WebViewImpl::draggingExited):
787
788 2017-04-18  Wenson Hsieh  <wenson_hsieh@apple.com>
789
790         [WK2] Add infrastructure and unit tests for file uploads using data interaction
791         https://bugs.webkit.org/show_bug.cgi?id=170903
792         <rdar://problem/31314689>
793
794         Reviewed by Tim Horton.
795
796         See Tools/ChangeLog for more details. Makes a small adjustment to _simulateDataInteractionUpdated: to return a
797         BOOL indicating whether or not to allow the operation to proceed. This is necessary for testing scenarios where
798         multiple files are being "data interacted" onto an element. See <https://bugs.webkit.org/show_bug.cgi?id=170880>
799         for more details about the change this patch is testing.
800
801         * UIProcess/API/Cocoa/WKWebView.mm:
802         (-[WKWebView _simulateDataInteractionUpdated:]):
803         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
804         * UIProcess/ios/WKContentViewInteraction.h:
805
806 2017-04-18  Wenson Hsieh  <wenson_hsieh@apple.com>
807
808         [WK2] Support DataTransfer::files() when performing a DHTML data interaction
809         https://bugs.webkit.org/show_bug.cgi?id=170880
810         <rdar://problem/31314689>
811
812         Reviewed by Tim Horton.
813
814         See the WebCore ChangeLog for more details.
815
816         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
817         (WebKit::WebPasteboardProxy::getFilenamesForDataInteraction):
818         * UIProcess/WebPageProxy.cpp:
819         (WebKit::WebPageProxy::didPerformDragControllerAction):
820         (WebKit::WebPageProxy::resetCurrentDragInformation):
821         * UIProcess/WebPageProxy.h:
822         (WebKit::WebPageProxy::documentIsHandlingNonDefaultDrag):
823         * UIProcess/WebPageProxy.messages.in:
824
825         Adds an IPC argument to DidPerformDragControllerAction specifying whether the page prevented the default behavior.
826
827         * UIProcess/WebPasteboardProxy.h:
828         * UIProcess/WebPasteboardProxy.messages.in:
829
830         Adds IPC plumbing for the new filenamesForDataInteraction Pasteboard codepath.
831
832         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
833         (WebKit::WebPlatformStrategies::getFilenamesForDataInteraction):
834         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
835         * WebProcess/WebPage/WebPage.cpp:
836         (WebKit::WebPage::performDragControllerAction):
837
838 2017-04-18  John Wilander  <wilander@apple.com>
839
840         Resource Load Statistics: Check both origins and cookieHostNames for domain matches in data removal
841         https://bugs.webkit.org/show_bug.cgi?id=170763
842         <rdar://problem/31573091>
843
844         Reviewed by Alex Christensen.
845
846         * UIProcess/WebProcessProxy.cpp:
847         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
848             Move semantics for topPrivatelyControlledDomains vector.
849         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyOwnedDomainsInAllPersistentDataStores): Deleted.
850             Renamed 'PrivatelyControlled' instead of 'PrivatelyOwned.'
851         * UIProcess/WebProcessProxy.h:
852         * UIProcess/WebResourceLoadStatisticsStore.cpp:
853         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
854             Move semantics for prevalentResourceDomains vector.
855         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
856         (WebKit::hostIsInDomain):
857             Static convenience function.
858         (WebKit::WebsiteDataRecord::matchesTopPrivatelyControlledDomain):
859             Checks for matching cookieHostNames if types contains WebsiteDataType::Cookies.
860             Also checks origins.
861         * UIProcess/WebsiteData/WebsiteDataRecord.h:
862         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
863         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains):
864             Now makes use of the new function
865             WebKit::WebsiteDataRecord::validForTopPrivatelyControlledDomain().
866         (WebKit::WebsiteDataStore::removeDataForTopPrivatelyControlledDomains):
867             Move semantics for topPrivatelyControlledDomains vector.
868         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyOwnedDomains): Deleted.
869             Renamed 'PrivatelyControlled' instead of 'PrivatelyOwned.'
870         (WebKit::WebsiteDataStore::removeDataForTopPrivatelyOwnedDomains): Deleted.
871             Renamed 'PrivatelyControlled' instead of 'PrivatelyOwned.'
872         * UIProcess/WebsiteData/WebsiteDataStore.h:
873
874 2017-04-18  Brent Fulgham  <bfulgham@apple.com>
875
876         [iOS][WK2] Prevent ephemeral files from being backed up
877         https://bugs.webkit.org/show_bug.cgi?id=170963
878         <rdar://problem/30470332>
879
880         Reviewed by Brady Eidson.
881
882         Tell the OS to skip temporary data files when performing backups.
883
884         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm: Added.
885         (WebKit::WebResourceLoadStatisticsStore::platformExcludeFromBackup): Added.
886         * UIProcess/WebResourceLoadStatisticsStore.cpp:
887         (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
888         (WebKit::WebResourceLoadStatisticsStore::platformExcludeFromBackup): Add stub for
889         non-iOS platforms.
890         * UIProcess/WebResourceLoadStatisticsStore.h:
891         * WebKit2.xcodeproj/project.pbxproj: Add new file.
892
893 2017-04-18  Wenson Hsieh  <wenson_hsieh@apple.com>
894
895         [WK2] Cannot select text on nytimes.com when the selection granularity is WKSelectionGranularityCharacter
896         https://bugs.webkit.org/show_bug.cgi?id=170968
897         <rdar://problem/31692560>
898
899         Reviewed by Dan Bernstein.
900
901         Makes a small adjustment to textInteractionGesture:shouldBeginAtPoint:. When determining whether to allow the
902         text interaction assistant to recognize at a given point, instead of depending on whether or not the hit node is
903         the same as the assisted node, only enforce this restriction when editing an assisted node. Otherwise, default
904         to allowing the selection gesture.
905
906         Note that character granularity selection was working on most pages before, due to the fact that
907         nodeAtPositionIsAssistedNode was true in many cases when there is no assisted node at all. This is because, in
908         WebPage.mm, we compute the hit-tested node responding to click events to be null, and then set
909         nodeAtPositionIsAssistedNode to be equal to hitNode == m_assistedNode, which ends up being true because both of
910         these values are null.
911
912         This allowed text selection to work in the simple case when selection granularity character is used, but not
913         when the node containing the selected point actually does respond to click events, since the comparison returns
914         false.
915
916         New layout test: LayoutTests/editing/selection/character-granularity-select-text-with-click-handler.html.
917
918         * UIProcess/ios/WKContentViewInteraction.mm:
919         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
920
921 2017-04-18  Keith Rollin  <krollin@apple.com>
922
923         Add additional information when logging URL disposition in WebLoaderStrategy::scheduleLoad
924         https://bugs.webkit.org/show_bug.cgi?id=170813
925
926         Reviewed by Alex Christensen.
927
928         There are a few logging statements in WebLoaderStrategy::scheduleLoad
929         that report, for example, "URL will be loaded as data". These
930         statements also log the address of the frame doing the loading and the
931         identifier of the resource. For consistency with other logging and to
932         make scripted analysis of the logs more robust, also include the
933         pageID and frameID in the logging.
934
935         * WebProcess/Network/WebLoaderStrategy.cpp:
936         (WebKit::WebLoaderStrategy::scheduleLoad):
937
938 2017-04-18  Anders Carlsson  <andersca@apple.com>
939
940         Stop using deprecated APIs, part 2
941         https://bugs.webkit.org/show_bug.cgi?id=170965
942
943         Reviewed by Tim Horton.
944
945         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
946         (IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::encode):
947         (IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::decode):
948         Remove the status member variable.
949
950         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
951         (WebKit::status):
952         New function to be used by older OSes. This will recreate a PKPaymentAuthorizationStatus given a ShippingContactUpdate.
953
954         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
955         Stop using the deprecated API.
956
957 2017-04-18  Timothy Horton  <timothy_horton@apple.com>
958
959         Force scroll view insets to be respected regardless of rubber-banding state
960         https://bugs.webkit.org/show_bug.cgi?id=170937
961         <rdar://problem/31412788>
962
963         Reviewed by Simon Fraser.
964
965         * Platform/spi/ios/UIKitSPI.h:
966         * UIProcess/API/Cocoa/WKWebView.mm:
967         (-[WKWebView _initializeWithConfiguration:]):
968
969 2017-04-18  Carlos Garcia Campos  <cgarcia@igalia.com>
970
971         [GLIB] Define priorities also for async network IO tasks
972         https://bugs.webkit.org/show_bug.cgi?id=170905
973
974         Reviewed by Žan Doberšek.
975
976         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
977         (WebKit::NetworkCache::inputStreamReadReadyCallback):
978         (WebKit::NetworkCache::IOChannel::read):
979         (WebKit::NetworkCache::outputStreamWriteReadyCallback):
980         (WebKit::NetworkCache::IOChannel::write):
981         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
982         (WebKit::NetworkDataTaskSoup::skipInputStreamForRedirection):
983         (WebKit::NetworkDataTaskSoup::read):
984         (WebKit::NetworkDataTaskSoup::requestNextPart):
985         (WebKit::NetworkDataTaskSoup::writeDownload):
986         (WebKit::NetworkDataTaskSoup::didFinishDownload):
987         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
988         (webkitURISchemeRequestReadCallback):
989         (webkit_uri_scheme_request_finish):
990
991 2017-04-17  Timothy Horton  <timothy_horton@apple.com>
992
993         Plumb all four obscured insets to WebCore, instead of just top/left
994         https://bugs.webkit.org/show_bug.cgi?id=170913
995
996         Reviewed by Wenson Hsieh.
997
998         * Shared/VisibleContentRectUpdateInfo.cpp:
999         (WebKit::VisibleContentRectUpdateInfo::encode):
1000         (WebKit::VisibleContentRectUpdateInfo::decode):
1001         (WebKit::operator<<):
1002         * Shared/VisibleContentRectUpdateInfo.h:
1003         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
1004         (WebKit::VisibleContentRectUpdateInfo::obscuredInsets):
1005         (WebKit::operator==):
1006         (WebKit::VisibleContentRectUpdateInfo::obscuredInset): Deleted.
1007         * Shared/WebCoreArgumentCoders.cpp:
1008         (IPC::ArgumentCoder<FloatRectInsets>::encode):
1009         (IPC::ArgumentCoder<FloatRectInsets>::decode):
1010         * Shared/WebCoreArgumentCoders.h:
1011         * UIProcess/API/Cocoa/WKWebView.mm:
1012         (-[WKWebView _didCommitLayerTree:]):
1013         (-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]):
1014         (-[WKWebView _updateVisibleContentRects]):
1015         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1016         * UIProcess/PageClient.h:
1017         * UIProcess/WebPageProxy.cpp:
1018         * UIProcess/WebPageProxy.h:
1019         * UIProcess/WebPageProxy.messages.in:
1020         * UIProcess/ios/PageClientImplIOS.h:
1021         * UIProcess/ios/PageClientImplIOS.mm:
1022         (WebKit::PageClientImpl::restorePageState):
1023         * UIProcess/ios/WKContentView.h:
1024         * UIProcess/ios/WKContentView.mm:
1025         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
1026         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): Deleted.
1027         * UIProcess/ios/WebPageProxyIOS.mm:
1028         (WebKit::WebPageProxy::restorePageState):
1029         * WebProcess/WebPage/ios/WebPageIOS.mm:
1030         (WebKit::WebPage::restorePageState):
1031         (WebKit::WebPage::updateVisibleContentRects):
1032         Adopt FloatBoxExtent for obscuredInsets (and adjust pluralization).
1033
1034 2017-04-17  Joseph Pecoraro  <pecoraro@apple.com>
1035
1036         Web Inspector: Doesn't show size of compressed content correctly
1037         https://bugs.webkit.org/show_bug.cgi?id=155112
1038         <rdar://problem/25006728>
1039
1040         Reviewed by Alex Christensen and Timothy Hatcher.
1041
1042         * NetworkProcess/NetworkResourceLoader.cpp:
1043         (WebKit::NetworkResourceLoader::sendResultForCacheEntry):
1044         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1045         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
1046         Include size information in network load metrics.
1047
1048 2017-04-17  Youenn Fablet  <youenn@apple.com>
1049
1050         com.apple.WebKit.Networking.Development crashed in com.apple.WebKit: WebKit::NetworkRTCProvider::resolvedName
1051         https://bugs.webkit.org/show_bug.cgi?id=170889
1052
1053         Reviewed by Alex Christensen.
1054
1055         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
1056         (WebKit::NetworkRTCProvider::Resolver::~Resolver): Unschedule the host resolution in addition to cancelling it.
1057         Providing a test would need to stop the resolver between the time the resolver is created and gets
1058         data in the network process. Or we would need to change Resolver to be instantiated/tested on its own.
1059         * NetworkProcess/webrtc/NetworkRTCProvider.h:
1060
1061 2017-04-17  Brady Eidson  <beidson@apple.com>
1062
1063         Make WKHTTPCookieStore public.
1064         <rdar://problem/31024691> and https://bugs.webkit.org/show_bug.cgi?id=170920
1065
1066         Reviewed by Geoffrey Garen.
1067
1068         * UIProcess/API/Cocoa/WKHTTPCookieStore.h:
1069         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
1070         (-[WKHTTPCookieStore getAllCookies:]):
1071         (-[WKHTTPCookieStore allCookies:]): Deleted.
1072
1073         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
1074         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1075         (-[WKWebsiteDataStore httpCookieStore]):
1076         (-[WKWebsiteDataStore _httpCookieStore]): Deleted.
1077         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1078
1079         * WebKit2.xcodeproj/project.pbxproj:
1080
1081 2017-04-17  Eric Carlson  <eric.carlson@apple.com>
1082
1083         [MediaStream] Fix typo in UIDelegate::mediaCaptureStateDidChange
1084         https://bugs.webkit.org/show_bug.cgi?id=170911
1085
1086         Reviewed by Youenn Fablet.
1087
1088         * UIProcess/Cocoa/UIDelegate.mm:
1089         (WebKit::UIDelegate::UIClient::mediaCaptureStateDidChange): Fix typo.
1090
1091 2017-04-17  Keith Rollin  <krollin@apple.com>
1092
1093         Move and update WebLoaderStrategy logging statement
1094         https://bugs.webkit.org/show_bug.cgi?id=170140
1095
1096         Reviewed by Alex Christensen.
1097
1098         WebLoaderStrategy::scheduleLoad has a logging statement that says, in
1099         part: "Resource has been queued for scheduling with the
1100         NetworkProcess". This statement is emitted after the
1101         ScheduleResourceLoad message has been successfully sent to the
1102         NetworkProcess. The logging statement was added at this location to
1103         indicate that the resource-load had been successfully handed off; it
1104         pairs a similar logging statement that is emitted if the sending of
1105         the ScheduleResourceLoad message fails.
1106
1107         I think it would be better to move this logging statement before the
1108         ScheduleResourceLoad message is sent to the NetworkProcess (and change
1109         its wording to "Resource is being scheduled with the NetworkProcess").
1110         The reason for this change is to help make sure that the sequence of
1111         logging statements is more deterministic. In the current form, the
1112         message "Resource has been queued for scheduling with the
1113         NetworkProcess" normally appears before any NetworkProcess logging
1114         statements that indicate that the resource-loading is continuing
1115         there, but in rare occasions the logging statements can be reversed.
1116         This change in the ordering of the statements has caused a problem in
1117         a script I've written that examines the resource-loading process and
1118         looks for errors. By ensuring that the WebLoaderStrategy statement
1119         always appears before the NetworkResourceLoader statement, the flow
1120         makes better sense and the script can be more robust.
1121
1122         In making this change, we are probably not giving up any assurance
1123         that the ScheduleResourceLoad message has been sent to the
1124         NetworkResourceLoader. If the message is successfully sent, we'll see
1125         logging in the NetworkProcess. If the message has not been sent, we'll
1126         see WebLoaderStrategy logging an error.
1127
1128         * WebProcess/Network/WebLoaderStrategy.cpp:
1129         (WebKit::WebLoaderStrategy::scheduleLoad):
1130
1131 2017-04-17  Anders Carlsson  <andersca@apple.com>
1132
1133         Stop using deprecated APIs, part 1
1134         https://bugs.webkit.org/show_bug.cgi?id=170915
1135         rdar://problem/31589635
1136
1137         Reviewed by Tim Horton.
1138
1139         Stop using the PKPaymentRequestPaymentMethodUpdate initializer that takes a status, it's been deprecated
1140         and we always passed PKPaymentAuthorizationStatusSuccess anyway.
1141
1142         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
1143         (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::encode):
1144         (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):
1145         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1146         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
1147
1148 2017-04-17  Youenn Fablet  <youenn@apple.com>
1149
1150         Disable outdated WritableStream API
1151         https://bugs.webkit.org/show_bug.cgi?id=170749
1152         <rdar://problem/31446233>
1153
1154         Reviewed by Alex Christensen.
1155
1156         Replacing READABLE_STREAM_API, READABLE_BYTE_STREAM_API and WRITABLE_STREAM_API compilation flag by:
1157         - A STREAMS_API compilation flag.
1158         - A ReadableByteStreamAPI and WritableStreamAPI runtime flags, turned off except for RWT and DRT.
1159
1160         * Configurations/FeatureDefines.xcconfig:
1161         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1162         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1163
1164 2017-04-17  Tim Horton  <timothy_horton@apple.com>
1165
1166         Provide a viewport parameter to disable clipping to the safe area
1167         https://bugs.webkit.org/show_bug.cgi?id=170766
1168         <rdar://problem/31564634>
1169
1170         Reviewed by Beth Dakin.
1171
1172         * UIProcess/WebPageProxy.cpp:
1173         (WebKit::WebPageProxy::resetState):
1174         (WebKit::WebPageProxy::setClipToSafeArea):
1175         * UIProcess/WebPageProxy.h:
1176         (WebKit::WebPageProxy::clipToSafeArea):
1177         * UIProcess/WebPageProxy.messages.in:
1178         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1179         (WebKit::WebChromeClient::didChangeClipToSafeArea):
1180         * WebProcess/WebCoreSupport/WebChromeClient.h:
1181         * UIProcess/API/gtk/PageClientImpl.h:
1182         * UIProcess/PageClient.h:
1183         * UIProcess/ios/PageClientImplIOS.h:
1184         * UIProcess/ios/PageClientImplIOS.mm:
1185         (WebKit::PageClientImpl::didChangeClipToSafeArea):
1186         * UIProcess/mac/PageClientImpl.h:
1187         Forward clip-to-safe-area changes from ChromeClient to WKWebView.
1188         Update visible content rects when it changes, which will
1189         result in a call to updateFixedClippingView, as below.
1190         Keep track of the current state in the UI process.
1191
1192         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1193         * UIProcess/API/Cocoa/WKWebView.mm:
1194         (-[WKWebView _contentMayDrawInObscuredInsets]):
1195         Expose the current state of the clip-to-safe-area bit as SPI.
1196
1197         * UIProcess/ios/WKContentView.mm:
1198         (-[WKContentView updateFixedClippingView:]):
1199         Disable fixed clipping when clip-to-safe-area is disabled.
1200         
1201         * WebProcess/WebPage/ios/WebPageIOS.mm:
1202         (WebKit::WebPage::viewportConfigurationChanged):
1203         Push the viewport's clip-to-safe-area bit onto the main frame's FrameView.
1204
1205 2017-04-17  Dan Bernstein  <mitz@apple.com>
1206
1207         [Cocoa] Move isNullFunctionPointer down into WTF
1208         https://bugs.webkit.org/show_bug.cgi?id=170892
1209
1210         Reviewed by Sam Weinig.
1211
1212         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp:
1213         (WebKit::ResourceLoadStatisticsClassifierCocoa::canUseCorePrediction): Changed to use
1214           WTF::isNullFunctionPointer.
1215         (WebKit::isNullFunctionPointer): Deleted.
1216
1217 2017-04-17  Wenson Hsieh  <wenson_hsieh@apple.com>
1218
1219         [WK2] Respect a new internal setting for defaulting to character selection granularity
1220         https://bugs.webkit.org/show_bug.cgi?id=170904
1221         <rdar://problem/31364280>
1222
1223         Reviewed by Dan Bernstein.
1224
1225         Respect a new WebKitDebugDefaultSelectionGranularityCharacter user default by initializing
1226         WKWebViewConfiguration with WKSelectionGranularityCharacter, but only when linked on or after the first iOS to
1227         use WKSelectionGranularityCharacter by default.
1228
1229         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1230         (-[WKWebViewConfiguration init]):
1231         * UIProcess/Cocoa/VersionChecks.h:
1232
1233 2017-04-17  Eric Carlson  <eric.carlson@apple.com>
1234
1235         Provide a way for clients to unmute a media stream.
1236         https://bugs.webkit.org/show_bug.cgi?id=170855
1237         <rdar://problem/31656855>
1238
1239         Reviewed by Jon Lee.
1240
1241         * UIProcess/API/Cocoa/WKWebView.mm:
1242         (-[WKWebView _setPageMuted:]): New.
1243         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1244
1245 2017-04-17  Jeremy Jones  <jeremyj@apple.com>
1246
1247         Refactor enumerateDevices to allow separate CaptureDeviceManagers for audio and video.
1248         https://bugs.webkit.org/show_bug.cgi?id=170778
1249
1250         Reviewed by Tim Horton.
1251
1252         setUseAVFoundationAudioCapture is moved from AVCaptureDeviceManager to RealtimeMediaSourceCenterMac.
1253
1254         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1255         (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs):
1256
1257 2017-04-15  Keith Rollin  <krollin@apple.com>
1258
1259         Include resource size in some existing logging
1260         https://bugs.webkit.org/show_bug.cgi?id=170866
1261
1262         Reviewed by Alex Christensen.
1263
1264         In order to correlate resource load times with resource size, we log
1265         when the resource is starting to be loaded and when the resource is
1266         finished loading. In NetworkResourceLoader::didReceiveResponse, we
1267         also log the expected resource length. However, we can only log the
1268         length if it is provided in Content-Length, which is not always the
1269         case. If it's not provided, we end up logging "length = -1". To make
1270         up for this, change NetworkResourceLoader::didFinishLoading and
1271         WebResourceLoader:: didFinishLoading to log the length once we know
1272         it.
1273
1274         * NetworkProcess/NetworkResourceLoader.cpp:
1275         (WebKit::NetworkResourceLoader::didReceiveBuffer):
1276         (WebKit::NetworkResourceLoader::didFinishLoading):
1277         * NetworkProcess/NetworkResourceLoader.h:
1278         * WebProcess/Network/WebResourceLoader.cpp:
1279         (WebKit::WebResourceLoader::didReceiveData):
1280         (WebKit::WebResourceLoader::didFinishResourceLoad):
1281         * WebProcess/Network/WebResourceLoader.h:
1282
1283 2017-04-15  Wenson Hsieh  <wenson_hsieh@apple.com>
1284
1285         [WK2] Support data interaction of files into file inputs
1286         https://bugs.webkit.org/show_bug.cgi?id=170803
1287         <rdar://problem/31286130>
1288
1289         Reviewed by Tim Horton.
1290
1291         Implements remaining support for performing data interaction onto file inputs. There are two main changes at
1292         this layer: plumbing the number of files in the pasteboard to the web process, and pulling the implementation of
1293         createSandboxExtensionsIfNeeded out of Mac-specific WebViewImpl::createSandboxExtensionsIfNeeded and into
1294         WebPageProxy::createSandboxExtensionsIfNeeded.
1295
1296         * Shared/WebCoreArgumentCoders.cpp:
1297         (IPC::ArgumentCoder<DragData>::encode):
1298         (IPC::ArgumentCoder<DragData>::decode):
1299
1300         Relax special-casing of encoding and decoding filenames to be PLATFORM(COCOA) rather than PLATFORM(MAC).
1301
1302         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1303         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
1304         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1305         (WebKit::WebPasteboardProxy::getNumberOfFiles):
1306
1307         More boilerplate plumbing to deliver the number of files in the pasteboard to the web process.
1308
1309         * UIProcess/Cocoa/WebViewImpl.h:
1310         * UIProcess/Cocoa/WebViewImpl.mm:
1311         (WebKit::WebViewImpl::performDragOperation):
1312         (WebKit::WebViewImpl::createSandboxExtensionsIfNeeded): Deleted.
1313
1314         Move the logic in WebViewImpl::createSandboxExtensionsIfNeeded over to WebPageProxy::createSandboxExtensionsIfNeeded.
1315
1316         * UIProcess/WebPageProxy.h:
1317         * UIProcess/WebPasteboardProxy.h:
1318         * UIProcess/WebPasteboardProxy.messages.in:
1319         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1320         (WebKit::WebPlatformStrategies::getNumberOfFiles):
1321         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1322
1323 2017-04-14  Mark Lam  <mark.lam@apple.com>
1324
1325         Update architectures in xcconfig files.
1326         https://bugs.webkit.org/show_bug.cgi?id=170867
1327         <rdar://problem/31628104>
1328
1329         Reviewed by Joseph Pecoraro.
1330
1331         * Configurations/FeatureDefines.xcconfig:
1332
1333 2017-04-14  Wenson Hsieh  <wenson_hsieh@apple.com>
1334
1335         [WK2] Support Icon creation from file URLs on iOS
1336         https://bugs.webkit.org/show_bug.cgi?id=170809
1337         <rdar://problem/31286130>
1338
1339         Reviewed by Tim Horton.
1340
1341         Refactors file icon generation logic to support showing an Icon representing the content at a list of file paths
1342         on iOS. Pulls out logic in WKFileUploadPanel responsible for generating the thumbnail image for a file input into
1343         separate helpers in WebIconUtilities, and then uses these utilities in both WKFileUploadPanel and
1344         WebChromeClientIOS.
1345
1346         * Shared/ios/WebIconUtilities.h: Added.
1347         * Shared/ios/WebIconUtilities.mm: Added.
1348         (WebKit::squareCropRectForSize):
1349         (WebKit::squareImage):
1350         (WebKit::thumbnailSizedImageForImage):
1351         (WebKit::fallbackIconForFile):
1352         (WebKit::iconForImageFile):
1353         (WebKit::iconForVideoFile):
1354         (WebKit::iconForFile):
1355
1356         Add logic for generating thumbnail icons, moved from WKFileUploadPanel.mm.
1357
1358         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1359         (squareCropRectForSize): Deleted.
1360         (squareImage): Deleted.
1361         (thumbnailSizedImageForImage): Deleted.
1362         (fallbackIconForFile): Deleted.
1363         (iconForImageFile): Deleted.
1364         (iconForVideoFile): Deleted.
1365         (iconForFile): Deleted.
1366
1367         Remove logic for generating thumbnail icons.
1368
1369         * WebKit2.xcodeproj/project.pbxproj:
1370         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1371         (WebKit::WebChromeClient::loadIconForFiles):
1372         (WebKit::WebChromeClient::createIconForFiles):
1373
1374         Rather than call Icon::createIconForFiles directly, loadIconForFiles now consults ChromeClient::createIconForFiles
1375         instead. On other platforms, this just turns around and calls Icon::createIconForFiles, but on iOS, we use the
1376         utilities introduced in WebIconUtilities to generate a file icon.
1377
1378         * WebProcess/WebCoreSupport/WebChromeClient.h:
1379         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
1380         (WebKit::WebChromeClient::createIconForFiles):
1381
1382 2017-04-14  Brady Eidson  <beidson@apple.com>
1383
1384         Fix basic WKURLSchemeHandler bugs.
1385         <rdar://problem/30647559> and https://bugs.webkit.org/show_bug.cgi?id=170862
1386
1387         Reviewed by Andy Estes.
1388
1389         * UIProcess/Cocoa/NavigationState.mm:
1390         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1391
1392         * UIProcess/WebURLSchemeHandlerTask.cpp:
1393         (WebKit::WebURLSchemeHandlerTask::didReceiveResponse):
1394
1395         * WebProcess/Network/WebLoaderStrategy.cpp:
1396         (WebKit::WebLoaderStrategy::addURLSchemeHandlerTaskProxy):
1397         (WebKit::WebLoaderStrategy::removeURLSchemeHandlerTaskProxy):
1398         (WebKit::WebLoaderStrategy::remove):
1399         * WebProcess/Network/WebLoaderStrategy.h:
1400
1401         * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp:
1402         (WebKit::WebURLSchemeHandlerProxy::startNewTask):
1403         (WebKit::WebURLSchemeHandlerProxy::taskDidComplete):
1404         (WebKit::WebURLSchemeHandlerProxy::taskDidStopLoading):
1405         * WebProcess/WebPage/WebURLSchemeHandlerProxy.h:
1406
1407         * WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.cpp:
1408         (WebKit::WebURLSchemeHandlerTaskProxy::WebURLSchemeHandlerTaskProxy):
1409         (WebKit::WebURLSchemeHandlerTaskProxy::stopLoading):
1410         (WebKit::WebURLSchemeHandlerTaskProxy::didReceiveResponse):
1411         (WebKit::WebURLSchemeHandlerTaskProxy::didReceiveData):
1412         (WebKit::WebURLSchemeHandlerTaskProxy::didComplete):
1413         (WebKit::WebURLSchemeHandlerTaskProxy::hasLoader):
1414         * WebProcess/WebPage/WebURLSchemeHandlerTaskProxy.h:
1415         (WebKit::WebURLSchemeHandlerTaskProxy::identifier):
1416
1417 2017-04-14  Jer Noble  <jer.noble@apple.com>
1418
1419         [MediaSource] Push capabilities across process boundary during UIProcess capture.
1420         https://bugs.webkit.org/show_bug.cgi?id=170814
1421
1422         Reviewed by Eric Carlson.
1423
1424         Make a new synchronous getter for capabilities(), moderated by only requesting the capabilities() cross-process
1425         the first time called.
1426
1427         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
1428         (WebKit::UserMediaCaptureManagerProxy::capabilities):
1429         (WebKit::UserMediaCaptureManagerProxy::supportedConstraints):
1430         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
1431         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.messages.in:
1432         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1433         (WebKit::UserMediaCaptureManager::Source::setCapabilities):
1434         (WebKit::UserMediaCaptureManager::capabilities):
1435         * WebProcess/cocoa/UserMediaCaptureManager.h:
1436
1437 2017-04-13  Dan Bernstein  <mitz@apple.com>
1438
1439         [Cocoa] Allow clients to specify in _WKProcessPoolConfiguration additional directory sandbox extensions
1440         https://bugs.webkit.org/show_bug.cgi?id=170387
1441
1442         Reviewed by Sam Weinig.
1443
1444         Test: TestWebKitAPI/Tests/WebKit2Cocoa/AdditionalReadAccessAllowedURLs.mm
1445
1446         Added an additionalReadAccessAllowedURLs property to _WKProcessPoolConfiguration.
1447
1448         * Shared/WebProcessCreationParameters.cpp:
1449         (WebKit::WebProcessCreationParameters::encode): Encode the new
1450           additionalSandboxExtensionHandles member.
1451         (WebKit::WebProcessCreationParameters::decode): Decode it.
1452         * Shared/WebProcessCreationParameters.h: Added additionalSandboxExtensionHandles member.
1453
1454         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1455         (API::ProcessPoolConfiguration::copy): Copy new m_additionalReadAccessAllowedPaths member.
1456         * UIProcess/API/APIProcessPoolConfiguration.h: Added m_additionalReadAccessAllowedPaths
1457           member and accessor functions.
1458
1459         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: Declared new
1460           additionalReadAccessAllowedURLs property whose value is an array of URLs to which the Web
1461           Content process will be given read access.
1462         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1463         (-[_WKProcessPoolConfiguration additionalReadAccessAllowedURLs]): New getter that returns
1464           an array of file URLs from the ProcessPoolConfiguration’s additionalReadAccessAllowedPaths().
1465         (-[_WKProcessPoolConfiguration setAdditionalReadAccessAllowedURLs:]): New setter that checks
1466           that the given URLs are file URLs and populates the ProcessPoolConfiguration’s
1467           additionalReadAccessAllowedPaths with their paths.
1468
1469         * UIProcess/WebProcessPool.cpp:
1470         (WebKit::WebProcessPool::resolvePathsForSandboxExtensions): Populate the new
1471           m_resolvedPaths.additionalWebProcessSandboxExtensionPaths with resolved paths from the
1472           ProcessPoolConfiguration’s additionalReadAccessAllowedPaths.
1473         (WebKit::WebProcessPool::createNewWebProcess): Populate the WebProcessCreationParameters’s
1474           additionalSandboxExtensionHandles member with read-only sandbox extensions created from
1475           the resolved paths.
1476         * UIProcess/WebProcessPool.h: Added additionalWebProcessSandboxExtensionPaths member to
1477           the Paths struct.
1478
1479         * WebProcess/WebProcess.cpp:
1480         (WebKit::WebProcess::initializeWebProcess): Consume the additional sandbox extensions.
1481
1482 2017-04-13  Alex Christensen  <achristensen@webkit.org>
1483
1484         Fix CMake build
1485         https://bugs.webkit.org/show_bug.cgi?id=170815
1486
1487         Reviewed by Beth Dakin.
1488
1489         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1490         (-[WKWebViewConfiguration _setShouldCaptureAudioInUIProcess:]):
1491
1492 2017-04-12  Dan Bernstein  <mitz@apple.com>
1493
1494         [Mac] Future-proof .xcconfig files
1495         https://bugs.webkit.org/show_bug.cgi?id=170802
1496
1497         Reviewed by Tim Horton.
1498
1499         * Configurations/Base.xcconfig:
1500         * Configurations/DebugRelease.xcconfig:
1501         * Configurations/FeatureDefines.xcconfig:
1502         * Configurations/Version.xcconfig:
1503
1504 2017-04-12  Brady Eidson  <beidson@apple.com>
1505
1506         QuotaExceededError when saving to localStorage in private mode.
1507         https://bugs.webkit.org/show_bug.cgi?id=157010
1508
1509         Reviewed by Alex Christensen.
1510
1511         * WebProcess/Storage/StorageAreaMap.cpp:
1512         (WebKit::StorageAreaMap::StorageAreaMap):
1513         (WebKit::StorageAreaMap::~StorageAreaMap):
1514
1515         * WebProcess/Storage/StorageNamespaceImpl.cpp:
1516         (WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace):
1517         (WebKit::StorageNamespaceImpl::storageArea):
1518         (WebKit::StorageNamespaceImpl::ephemeralLocalStorageArea):
1519         (WebKit::StorageNamespaceImpl::copy):
1520         * WebProcess/Storage/StorageNamespaceImpl.h:
1521
1522         * WebProcess/Storage/WebStorageNamespaceProvider.cpp:
1523         (WebKit::WebStorageNamespaceProvider::createEphemeralLocalStorageNamespace):
1524         * WebProcess/Storage/WebStorageNamespaceProvider.h:
1525
1526 2017-04-12  Yusuke Suzuki  <utatane.tea@gmail.com>
1527
1528         Unreviewed, fix build failure on Ubuntu LTS GTK bot
1529         https://bugs.webkit.org/show_bug.cgi?id=170781
1530
1531         * UIProcess/WebProcessPool.cpp:
1532         (WebKit::WebProcessPool::createNewWebProcess):
1533
1534 2017-04-12  Eric Carlson  <eric.carlson@apple.com>
1535
1536         [MediaStream] rename -[WKWebView _stopMediaCapture]
1537         https://bugs.webkit.org/show_bug.cgi?id=170791
1538         <rdar://problem/31589204>
1539
1540         Reviewed by Youenn Fablet.
1541
1542         * UIProcess/API/Cocoa/WKWebView.mm:
1543         (-[WKWebView _muteMediaCapture]):
1544         (-[WKWebView _stopMediaCapture]): Deleted.
1545         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1546
1547 2017-04-12  Ryan Haddad  <ryanhaddad@apple.com>
1548
1549         Unreviewed build fix.
1550
1551         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1552         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]):
1553         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]):
1554         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]):
1555         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
1556         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
1557         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
1558
1559 2017-04-12  Jer Noble  <jer.noble@apple.com>
1560
1561         [WK2] Add a C-API for creating a WKContextConfigurationRef with legacy options.
1562         https://bugs.webkit.org/show_bug.cgi?id=170790
1563
1564         Reviewed by Alex Christensen.
1565
1566         * UIProcess/API/C/WKContextConfigurationRef.cpp:
1567         (WKContextConfigurationCreate):
1568         (WKContextConfigurationCreateWithLegacyOptions):
1569         * UIProcess/API/C/WKContextConfigurationRef.h:
1570
1571 2017-04-12  Jer Noble  <jer.noble@apple.com>
1572
1573         [WK2] Do not pass microphone sandbox extension to WebProcess if capturing is happening in UIProcess.
1574         https://bugs.webkit.org/show_bug.cgi?id=170781
1575
1576         Reviewed by Alex Christensen.
1577
1578         Simultaneously, allow clients to configure whether capturing will occur in the UIProcess through
1579         _WKProcessPoolConfiguration.
1580
1581         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1582         (API::ProcessPoolConfiguration::copy):
1583         * UIProcess/API/APIProcessPoolConfiguration.h:
1584         * UIProcess/API/C/WKContextConfigurationRef.cpp:
1585         (WKContextConfigurationShouldCaptureAudioInUIProcess):
1586         (WKContextConfigurationSetShouldCaptureAudioInUIProcess):
1587         * UIProcess/API/C/WKContextConfigurationRef.h:
1588         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1589         (-[WKWebViewConfiguration copyWithZone:]):
1590         (-[WKWebViewConfiguration _shouldCaptureAudioInUIProcess]):
1591         (-[WKWebViewConfiguration _setShouldCaptureAudioInUIProcess:]):
1592         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1593         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1594         (-[_WKProcessPoolConfiguration shouldCaptureAudioInUIProcess]):
1595         (-[_WKProcessPoolConfiguration setShouldCaptureAudioInUIProcess:]):
1596         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1597         (WebKit::WebProcessPool::platformInitializeWebProcess):
1598         * UIProcess/WebProcessPool.cpp:
1599         (WebKit::WebProcessPool::createNewWebProcess):
1600
1601 2017-04-12  Keith Rollin  <krollin@apple.com>
1602
1603         Add some missing NetworkResourceLoader logging
1604         https://bugs.webkit.org/show_bug.cgi?id=170139
1605
1606         Reviewed by Alex Christensen.
1607
1608         Once execution enters the lambda in
1609         NetworkResourceLoader::retrieveCacheEntry, there is little indication
1610         of which exit point was taken. If flow enters into startNetworkLoad,
1611         we'll get some logging from that function, but not from the others.
1612         Add some logging so that we know what the result was from looking up
1613         the resource in the cache.
1614
1615         * NetworkProcess/NetworkResourceLoader.cpp:
1616         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
1617
1618 2017-04-12  Anders Carlsson  <andersca@apple.com>
1619
1620         Tweak WebCore::setMetadataURL function
1621         https://bugs.webkit.org/show_bug.cgi?id=170786
1622
1623         Reviewed by Beth Dakin.
1624
1625         Update for WebCore changes.
1626
1627         * UIProcess/Cocoa/WebViewImpl.mm:
1628         (WebKit::WebViewImpl::namesOfPromisedFilesDroppedAtDestination):
1629
1630 2017-04-12  Brent Fulgham  <bfulgham@apple.com>
1631
1632         [WK2][Mac] Stop allowing access to disk arbitration process
1633         https://bugs.webkit.org/show_bug.cgi?id=170517
1634         <rdar://problem/31071151>
1635
1636         Reviewed by Alex Christensen.
1637
1638         * WebProcess/com.apple.WebProcess.sb.in:
1639
1640 2017-04-12  Beth Dakin  <bdakin@apple.com>
1641
1642         32-bit build fix.
1643
1644         * UIProcess/API/mac/WKView.mm:
1645         (-[WKView _mediaPlaybackControlsView]):
1646
1647 2017-04-12  Beth Dakin  <bdakin@apple.com>
1648
1649         More 32-bit build fix.
1650
1651         * UIProcess/API/Cocoa/WKWebView.mm:
1652         (-[WKWebView _mediaPlaybackControlsView]):
1653         (-[WKWebView _addMediaPlaybackControlsView:]):
1654         * UIProcess/API/mac/WKView.mm:
1655         (-[WKView _mediaPlaybackControlsView]):
1656         (-[WKView _addMediaPlaybackControlsView:]):
1657
1658 2017-04-12  Beth Dakin  <bdakin@apple.com>
1659
1660         Another 32 bit build fix.
1661
1662         * UIProcess/Cocoa/WebViewImpl.h:
1663         * UIProcess/Cocoa/WebViewImpl.mm:
1664         (WebKit::WebViewImpl::mediaPlaybackControlsView):
1665
1666 2017-04-12  Alex Christensen  <achristensen@webkit.org>
1667
1668         Stop using didReceiveDataArray callback on El Capitan
1669         https://bugs.webkit.org/show_bug.cgi?id=170780
1670
1671         Reviewed by Brady Eidson.
1672
1673         * NetworkProcess/NetworkLoad.cpp:
1674         (WebKit::NetworkLoad::supportsDataArray): Deleted.
1675         (WebKit::NetworkLoad::didReceiveDataArray): Deleted.
1676         * NetworkProcess/NetworkLoad.h:
1677
1678 2017-04-12  Beth Dakin  <bdakin@apple.com>
1679
1680         Speculative build fix.
1681
1682         * UIProcess/API/Cocoa/WKViewPrivate.h:
1683
1684 2017-04-12  Beth Dakin  <bdakin@apple.com>
1685
1686         Attempted build fix.
1687
1688         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1689
1690 2017-04-12  Beth Dakin  <bdakin@apple.com>
1691
1692         Adopt AVKit name change from AVFunctionBar* to AVTouchBar*
1693         https://bugs.webkit.org/show_bug.cgi?id=170693
1694         -and corresponding-
1695         rdar://problem/31230018
1696
1697         Reviewed by Sam Weinig.
1698
1699         Since the new names only apply to some versions of macOS, this patch uses typedefs 
1700         for the older OS’s. SO:
1701
1702         AVFunctionBarScrubber is now AVTouchBarScrubber
1703
1704         AVFunctionBarPlaybackControlsProvider is now AVTouchBarPlaybackControlsProvider
1705
1706         AVFunctionBarMediaSelectionOption is now AVTouchBarMediaSelectionOption
1707
1708         And the protocol AVFunctionBarPlaybackControlsControlling is now 
1709         AVTouchBarPlaybackControlsControlling
1710
1711         Use the new name.
1712         * UIProcess/API/Cocoa/WKViewPrivate.h:
1713         * UIProcess/API/Cocoa/WKWebView.mm:
1714         (-[WKWebView _mediaPlaybackControlsView]):
1715         (-[WKWebView _addMediaPlaybackControlsView:]):
1716         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1717         * UIProcess/API/mac/WKView.mm:
1718         (-[WKView _mediaPlaybackControlsView]):
1719         (-[WKView _addMediaPlaybackControlsView:]):
1720         * UIProcess/Cocoa/WebViewImpl.h:
1721
1722         Soft links and allocations cannot use the typedefs.
1723         * UIProcess/Cocoa/WebViewImpl.mm:
1724         (WebKit::WebViewImpl::mediaPlaybackControlsView):
1725         (WebKit::WebViewImpl::updateMediaTouchBar):
1726
1727 2017-04-12  Eric Carlson  <eric.carlson@apple.com>
1728
1729         [MediaStream] Audio source in UI process not identified as capture source
1730         https://bugs.webkit.org/show_bug.cgi?id=170776
1731
1732         Reviewed by Youenn Fablet.
1733
1734         * WebProcess/cocoa/UserMediaCaptureManager.cpp: Override isCaptureSource.
1735
1736 2017-04-12  Andrew Gold  <agold@apple.com>
1737
1738         Allow iOS to toggle webRTCAPI legacy flag.
1739         https://bugs.webkit.org/show_bug.cgi?id=170735
1740
1741         Reviewed by Eric Carlson.
1742
1743         * UIProcess/API/Cocoa/WKPreferences.mm:
1744         (-[WKPreferences _webRTCLegacyAPIEnabled]):
1745         (-[WKPreferences _setWebRTCLegacyAPIEnabled:]):
1746         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1747
1748 2017-04-12  Yusuke Suzuki  <utatane.tea@gmail.com>
1749
1750         Unreviewed, build fix for GTK port after r215262
1751         https://bugs.webkit.org/show_bug.cgi?id=170758
1752
1753         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1754         (WebKit::NetworkDataTaskSoup::didRead):
1755
1756 2017-04-12  Yusuke Suzuki  <utatane.tea@gmail.com>
1757
1758         [WTF] Introduce Thread class and use RefPtr<Thread> and align Windows Threading implementation semantics to Pthread one
1759         https://bugs.webkit.org/show_bug.cgi?id=170502
1760
1761         Reviewed by Mark Lam.
1762
1763         Mechanical change. Use Thread:: APIs.
1764
1765         * NetworkProcess/NetworkProcess.cpp:
1766         (WebKit::NetworkProcess::initializeNetworkProcess):
1767         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
1768         (WebKit::NetworkCache::IOChannel::readSyncInThread):
1769         * Platform/IPC/Connection.cpp:
1770         (IPC::Connection::processIncomingMessage):
1771         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
1772         (WebKit::XPCServiceInitializer):
1773         * UIProcess/linux/MemoryPressureMonitor.cpp:
1774         (WebKit::MemoryPressureMonitor::MemoryPressureMonitor):
1775         * WebProcess/WebProcess.cpp:
1776         (WebKit::WebProcess::initializeWebProcess):
1777
1778 2017-04-10  Antti Koivisto  <antti@apple.com>
1779
1780         Cache small media resources in disk cache
1781         https://bugs.webkit.org/show_bug.cgi?id=170676
1782         <rdar://problem/31532649>
1783
1784         Reviewed by Andreas Kling.
1785
1786         * NetworkProcess/cache/NetworkCache.cpp:
1787         (WebKit::NetworkCache::makeRetrieveDecision):
1788
1789             Allow retrieving media resources.
1790
1791         (WebKit::NetworkCache::expectedTotalResourceSizeFromContentRange):
1792         (WebKit::NetworkCache::expectedTotalResourceSize):
1793         (WebKit::NetworkCache::makeStoreDecision):
1794
1795             Store media resource if we can figure out its total size and it is less than 5MB
1796             (and it is cacheable by the usual rules).
1797
1798 2017-04-12  Alex Christensen  <achristensen@webkit.org>
1799
1800         Modernize vector adoption
1801         https://bugs.webkit.org/show_bug.cgi?id=170758
1802
1803         Reviewed by Geoffrey Garen.
1804
1805         * NetworkProcess/capture/NetworkCaptureEvent.cpp:
1806         (WebKit::NetworkCapture::JSONCoder<WebCore::SharedBuffer>::decode):
1807         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1808         (WebKit::WebPlatformStrategies::bufferForType):
1809
1810 2017-04-12  Zan Dobersek  <zdobersek@igalia.com>
1811
1812         Unreviewed GTK+ debug build fix. Drop an unused debug-only member
1813         variable in the CompositingRunLoop class.
1814
1815         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
1816
1817 2017-04-11  Zan Dobersek  <zdobersek@igalia.com>
1818
1819         [GTK] Use the DisplayRefreshMonitor facilities
1820         https://bugs.webkit.org/show_bug.cgi?id=170599
1821
1822         Reviewed by Carlos Garcia Campos.
1823
1824         ThreadedCompositor gains a DisplayRefreshMonitor member that it can use
1825         to better coordinate display refresh callbacks on the main thread. Still,
1826         because currently the GTK+ port doesn't have a reliable way of notifying
1827         the ThreadedCompositor of a vsync event, a timer targeting 60FPS is used
1828         in order to keep the updates at a reasonable rate. When the timer is fired,
1829         the ThreadedCompositor decides how to proceed based on state changes that
1830         might have occurred during composition or whether there's any display
1831         refresh callbacks that require handling on the main thread.
1832
1833         CompositingRunLoop now stores its state in an atomic variable that's then
1834         inspected whenever a new update is scheduled or completed. When scheduled,
1835         if there's no update in progress, a new update is requested through the
1836         timer. If there's already an update in progress, a new update is marked
1837         as pending after the current one completes. In that case, when the update
1838         is completed, a new update is requested through the timer.
1839
1840         ThreadedDisplayRefreshMonitor is used to coordinate updates between the
1841         main and the composition thread whenever the CoordinatedGraphics state
1842         demands it, or whenever there are clients registered to that monitor that
1843         require an update (e.g. a requestAnimationFrame() callback). After the
1844         update on the composition thread is finished, and the DisplayRefreshMonitor
1845         object requires an update, a callback at the same priority as the layer
1846         flush timer is scheduled on the main thread. In that callback we handle
1847         any clients registered for this DisplayRefreshMonitor before proceeding
1848         to handle any changes to the CoordinatedGraphics scene. In case the
1849         DisplayRefreshMonitor clients or the layer flushes already queued up
1850         any changes to the state, we immediately ask the ThreadedCompositor for
1851         an update.
1852
1853         * PlatformGTK.cmake:
1854         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1855         (WebKit::CoordinatedGraphicsScene::updateViewport):
1856         (WebKit::CoordinatedGraphicsScene::commitSceneState):
1857         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1858         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
1859         (WebKit::CompositingRunLoop::CompositingRunLoop):
1860         (WebKit::CompositingRunLoop::isActive):
1861         (WebKit::CompositingRunLoop::scheduleUpdate):
1862         (WebKit::CompositingRunLoop::stopUpdates):
1863         (WebKit::CompositingRunLoop::updateCompleted):
1864         (WebKit::CompositingRunLoop::updateTimerFired):
1865         (WebKit::CompositingRunLoop::isCurrent):
1866         (WebKit::CompositingRunLoop::startUpdateTimer): Deleted.
1867         (WebKit::CompositingRunLoop::stopUpdateTimer): Deleted.
1868         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
1869         (): Deleted.
1870         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1871         (WebKit::m_displayRefreshMonitor):
1872         (WebKit::ThreadedCompositor::invalidate):
1873         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing):
1874         (WebKit::ThreadedCompositor::updateViewport):
1875         (WebKit::ThreadedCompositor::scheduleDisplayImmediately):
1876         (WebKit::ThreadedCompositor::renderLayerTree):
1877         (WebKit::ThreadedCompositor::sceneUpdateFinished):
1878         (WebKit::ThreadedCompositor::updateSceneState):
1879         (WebKit::ThreadedCompositor::displayRefreshMonitor):
1880         (WebKit::ThreadedCompositor::renderNextFrameIfNeeded):
1881         (WebKit::ThreadedCompositor::completeCoordinatedUpdateIfNeeded):
1882         (WebKit::ThreadedCompositor::coordinateUpdateCompletionWithClient):
1883         (WebKit::ThreadedCompositor::performFrameCompletion):
1884         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1885         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp: Added.
1886         (WebKit::ThreadedDisplayRefreshMonitor::ThreadedDisplayRefreshMonitor):
1887         (WebKit::ThreadedDisplayRefreshMonitor::requestRefreshCallback):
1888         (WebKit::ThreadedDisplayRefreshMonitor::requiresDisplayRefreshCallback):
1889         (WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback):
1890         (WebKit::ThreadedDisplayRefreshMonitor::invalidate):
1891         (WebKit::ThreadedDisplayRefreshMonitor::displayRefreshCallback):
1892         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h: Copied from Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h.
1893         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1894         (WebKit::AcceleratedDrawingArea::createDisplayRefreshMonitor):
1895         * WebProcess/WebPage/AcceleratedDrawingArea.h:
1896         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
1897         (WebKit::ThreadedCoordinatedLayerTreeHost::createDisplayRefreshMonitor):
1898         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
1899         * WebProcess/WebPage/LayerTreeHost.h:
1900         (WebKit::LayerTreeHost::createDisplayRefreshMonitor):
1901
1902 2017-04-11  Alex Christensen  <achristensen@webkit.org>
1903
1904         Modernize and clean up code
1905         https://bugs.webkit.org/show_bug.cgi?id=170752
1906
1907         Reviewed by Sam Weinig.
1908
1909         * NetworkProcess/NetworkResourceLoader.h:
1910         * Shared/WebPreferencesStore.h:
1911         * UIProcess/API/APIHitTestResult.cpp:
1912         (API::HitTestResult::create):
1913         * UIProcess/API/APIHitTestResult.h:
1914         * UIProcess/API/C/WKPreferences.cpp:
1915         (WKPreferencesCreate):
1916         (WKPreferencesCreateWithIdentifier):
1917         (WKPreferencesCreateCopy):
1918         * UIProcess/Authentication/AuthenticationChallengeProxy.h:
1919         * UIProcess/WebPreferences.cpp:
1920         (WebKit::WebPreferences::createWithLegacyDefaults):
1921         (WebKit::WebPreferences::copy):
1922         * UIProcess/WebPreferences.h:
1923         * WebProcess/Network/WebLoaderStrategy.h:
1924         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1925         (WebKit::WebEditorClient::requestCheckingOfString):
1926         * WebProcess/WebPage/WebPage.cpp:
1927         (WebKit::WebPage::addTextCheckingRequest):
1928         * WebProcess/WebPage/WebPage.h:
1929         * WebProcess/WebPage/ios/WebPageIOS.mm:
1930         (WebKit::WebPage::rangeForWebSelectionAtPosition):
1931         (WebKit::WebPage::rangeForBlockAtPoint):
1932         (WebKit::WebPage::expandedRangeFromHandle):
1933         (WebKit::WebPage::contractedRangeFromHandle):
1934         (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle):
1935         (WebKit::WebPage::changeBlockSelection):
1936         (WebKit::WebPage::rangeForGranularityAtPoint):
1937         (WebKit::WebPage::computePagesForPrintingAndDrawToPDF):
1938
1939 2017-04-11  Dean Jackson  <dino@apple.com>
1940
1941         Disable outdated WritableStream API
1942         https://bugs.webkit.org/show_bug.cgi?id=170749
1943         <rdar://problem/31446233>
1944
1945         Reviewed by Tim Horton.
1946
1947         The API we implement is no longer accurate. Disable it until we
1948         are compatible with the new specification
1949
1950         * Configurations/FeatureDefines.xcconfig:
1951
1952 2017-04-11  Dan Bernstein  <mitz@apple.com>
1953
1954         [Cocoa] WebKit unnecessarily soft-links CorePrediction
1955         https://bugs.webkit.org/show_bug.cgi?id=170644
1956
1957         Reviewed by Sam Weinig.
1958
1959         * Configurations/BaseTarget.xcconfig: Defined HAVE_CORE_PREDICTION and added
1960           HAVE_CORE_PREDICTION to the preprocessor defintions when the former is YES.
1961
1962         * Configurations/WebKit.xcconfig: Have the linker link against CorePrediction where
1963           available. On macOS, use weak linking, because CorePrediction is not available in the
1964           Base System.
1965
1966         * Platform/classifier/cocoa/CorePredictionSoftLink.h: Removed.
1967
1968         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: Guarded with
1969           #if HAVE(CORE_PREDICTION).
1970         (WebKit::isNullFunctionPointer): Added this helper.
1971         (WebKit::ResourceLoadStatisticsClassifierCocoa::canUseCorePrediction): Replaced
1972           dlopen()-based runtime check with a null check.
1973
1974         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h: Guarded with #if
1975           HAVE(CORE_PREDICTION).
1976
1977         * Platform/spi/Cocoa/CorePredictionSPI.h: Added.
1978
1979         * UIProcess/WebResourceLoadStatisticsStore.h: Updated guards to include HAVE(CORE_PREDICTION).
1980
1981         * WebKit2.xcodeproj/project.pbxproj: pdated file references for removal and addition.
1982
1983 2017-04-11  David Quesada  <david_quesada@apple.com>
1984
1985         Add SPI for handling geolocation authorization requests
1986         https://bugs.webkit.org/show_bug.cgi?id=170362
1987         rdar://problem/17508627
1988
1989         Reviewed by Alex Christensen.
1990
1991         Add a new WKUIDelegate method for the WKGeolocationProviderIOS to call when a web page
1992         requests geolocation access. To support testing this change, make it possible to override
1993         the CoreLocation abstraction WKGeolocationProviderIOS uses. There is now a configurable
1994         object on the process pool that implements a protocol for providing location updates for
1995         web views in the process pool. If the client doesn't provide this object,
1996         WKGeolocationProviderIOS falls back to an object that wraps the existing WebKit1
1997         WebGeolocationCoreLocationProvider and conforms to the new protocol.
1998
1999         * Shared/Cocoa/APIObject.mm:
2000         (API::Object::newObject):
2001         * Shared/WebGeolocationPosition.h:
2002         (WebKit::WebGeolocationPosition::create):
2003         * UIProcess/API/C/WKGeolocationPosition.cpp:
2004         (WKGeolocationPositionCreate_b):
2005         * UIProcess/API/Cocoa/WKProcessPool.mm:
2006         (-[WKProcessPool _coreLocationProvider]):
2007         (-[WKProcessPool _setCoreLocationProvider:]):
2008         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2009         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2010         * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp.
2011         * UIProcess/API/Cocoa/_WKGeolocationPosition.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp.
2012         * UIProcess/API/Cocoa/_WKGeolocationPosition.mm: Added.
2013         (WebKit::if):
2014         (-[_WKGeolocationPosition dealloc]):
2015         (-[_WKGeolocationPosition _apiObject]):
2016         * UIProcess/API/Cocoa/_WKGeolocationPositionInternal.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp.
2017         (WebKit::wrapper):
2018         * UIProcess/ios/WKGeolocationProviderIOS.mm:
2019         (kit):
2020         (-[WKGeolocationProviderIOS initWithProcessPool:]):
2021         (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
2022         (-[WKGeolocationProviderIOS positionChanged:]):
2023         (-[WKLegacyCoreLocationProvider setListener:]):
2024         (-[WKLegacyCoreLocationProvider requestGeolocationAuthorization]):
2025         (-[WKLegacyCoreLocationProvider start]):
2026         (-[WKLegacyCoreLocationProvider stop]):
2027         (-[WKLegacyCoreLocationProvider setEnableHighAccuracy:]):
2028         (-[WKLegacyCoreLocationProvider geolocationAuthorizationGranted]):
2029         (-[WKLegacyCoreLocationProvider geolocationAuthorizationDenied]):
2030         (-[WKLegacyCoreLocationProvider positionChanged:]):
2031         (-[WKLegacyCoreLocationProvider errorOccurred:]):
2032         (-[WKLegacyCoreLocationProvider resetGeolocation]):
2033         Implement a new class that bridges the currently used WebGeolocationCoreLocationProvider
2034         to conform to the _WKGeolocationCoreLocationProvider protocol that WKGeolocationProviderIOS
2035         expects.
2036         * WebKit2.xcodeproj/project.pbxproj:
2037
2038 2017-04-11  Eric Carlson  <eric.carlson@apple.com>
2039
2040         [MediaStream] Set correct audio session category when capturing audio
2041         https://bugs.webkit.org/show_bug.cgi?id=170736
2042         <rdar://problem/31559405>
2043
2044         Reviewed by Jer Noble.
2045
2046         * UIProcess/WebPageProxy.cpp:
2047         (WebKit::WebPageProxy::isPlayingMediaDidChange):
2048
2049 2017-04-11  Youenn Fablet  <youenn@apple.com>
2050
2051         Activate WebRTC data channel tests for WK1
2052         https://bugs.webkit.org/show_bug.cgi?id=170710
2053
2054         Reviewed by Eric Carlson.
2055
2056         * WebProcess/Network/webrtc/LibWebRTCProvider.h: Making sure networking is not done in the Web process.
2057
2058 2017-04-11  Chris Fleizach  <cfleizach@apple.com>
2059
2060         AX: PDF plugin needs to support PDF-DOM Mode
2061         https://bugs.webkit.org/show_bug.cgi?id=170589
2062
2063         Reviewed by Tim Horton.
2064
2065         Provide access to DOM objects with PDF document. This mean:
2066            1) Support a different set of attributes for WKPDFPluginAccessibilityObject.
2067                 WKPDFPluginAccessibilityObject is now a group instead of forwarding attribute calls to the pdf layer.
2068            2) Connect the focused UI element to the active annotation if possible.
2069            3) Mark the PDF associated nodes with an attribute so they can be identified later so their correct parent can be found.
2070
2071         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
2072         * WebProcess/Plugins/PDF/PDFPlugin.h:
2073         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2074         (-[WKPDFPluginAccessibilityObject pdfLayerController]):
2075         (-[WKPDFPluginAccessibilityObject setPdfLayerController:]):
2076         (-[WKPDFPluginAccessibilityObject convertRectToScreenSpace:]):
2077         (-[WKPDFPluginAccessibilityObject accessibilityAttributeValue:]):
2078         (-[WKPDFPluginAccessibilityObject accessibilityAttributeNames]):
2079         (-[WKPDFPluginAccessibilityObject accessibilityActionNames]):
2080         (-[WKPDFPluginAccessibilityObject accessibilityParameterizedAttributeNames]):
2081         (-[WKPDFPluginAccessibilityObject accessibilityFocusedUIElement]):
2082         (-[WKPDFPluginAccessibilityObject accessibilityAssociatedControlForAnnotation:]):
2083         (-[WKPDFPluginAccessibilityObject accessibilityHitTest:]):
2084         (WebKit::PDFPlugin::convertFromRootViewToPDFView):
2085         (WebKit::PDFPlugin::convertFromPDFViewToScreen):
2086         (WebKit::PDFPlugin::pluginHandlesContentOffsetForAccessibilityHitTest):
2087         (WebKit::PDFPlugin::axObjectCache):
2088         (WebKit::PDFPlugin::accessibilityShadowPluginParentForElement):
2089         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
2090         (WebKit::PDFPluginAnnotation::attach):
2091         * WebProcess/Plugins/Plugin.h:
2092         (WebKit::Plugin::accessibilityShadowPluginParentForElement):
2093         (WebKit::Plugin::pluginHandlesContentOffsetForAccessibilityHitTest):
2094         * WebProcess/Plugins/PluginView.cpp:
2095         (WebKit::PluginView::accessibilityShadowPluginParentForElement):
2096         * WebProcess/Plugins/PluginView.h:
2097         * WebProcess/WebPage/WebPage.h:
2098         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
2099         (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
2100
2101 2017-04-11  Adrian Perez de Castro  <aperez@igalia.com>
2102
2103         [GTK] Attach popup menu to web view widget
2104         https://bugs.webkit.org/show_bug.cgi?id=145866
2105
2106         Use gtk_menu_attach_to_widget() to let GTK+ know that popup menus belong to a certain web view.
2107         This improves the positioning choices that the toolkit can do, and solves a long-standing issue
2108         that caused long popup menus to hang outside of the available display area under Wayland.
2109
2110         Based on a patch by Jonas Ådahl <jadahl@gmail.com>.
2111
2112         Reviewed by Carlos Garcia Campos.
2113
2114         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
2115         (WebKit::WebPopupMenuProxyGtk::showPopupMenu):
2116
2117 2017-04-10  Alex Christensen  <achristensen@webkit.org>
2118
2119         Revert r215217
2120         https://bugs.webkit.org/show_bug.cgi?id=170703
2121
2122         * Configurations/FeatureDefines.xcconfig:
2123
2124 2017-04-10  Alex Christensen  <achristensen@webkit.org>
2125
2126         Continue enabling WebRTC
2127         https://bugs.webkit.org/show_bug.cgi?id=170703
2128
2129         Reviewed by Youenn Fablet.
2130
2131         * Configurations/FeatureDefines.xcconfig:
2132
2133 2017-04-10  Alex Christensen  <achristensen@webkit.org>
2134
2135         REGRESSION(r195479) First main resource load in new WebProcess bypasses content extensions
2136         https://bugs.webkit.org/show_bug.cgi?id=170707
2137         <rdar://problem/27788755>
2138
2139         Reviewed by Tim Horton.
2140
2141         We fix this by sending the UserContentController with the WebPageCreationParameters
2142         instead of in a IPC message immediately following creation.  By the time the WebPage
2143         receives its second message, it has already started loading the first main resource.
2144         
2145         I also changed all instances of calling ChildProcessProxy::connection() to send a message
2146         in favor of calling ChildProcessProxy::send, which does the same thing except if a child
2147         process has not started, it will put the message in a queue and send it when the process
2148         is finished launching.  This was necessary because the UserContentController is now connected
2149         to the process sooner, so there were some API tests that would try to send messages between
2150         initiating a process launch and finishing a process launch, and this change preserves the
2151         existing behavior in those cases.
2152
2153         * Shared/WebPageCreationParameters.cpp:
2154         (WebKit::WebPageCreationParameters::encode):
2155         (WebKit::WebPageCreationParameters::decode):
2156         * Shared/WebPageCreationParameters.h:
2157         * UIProcess/Databases/DatabaseProcessProxy.cpp:
2158         (WebKit::DatabaseProcessProxy::getDatabaseProcessConnection):
2159         (WebKit::DatabaseProcessProxy::didFinishLaunching):
2160         * UIProcess/Downloads/DownloadProxy.cpp:
2161         (WebKit::DownloadProxy::cancel):
2162         (WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace):
2163         (WebKit::DownloadProxy::willSendRequest):
2164         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
2165         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
2166         (WebKit::WebUserContentControllerProxy::addProcess):
2167         (WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
2168         (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
2169         (WebKit::WebUserContentControllerProxy::addUserScript):
2170         (WebKit::WebUserContentControllerProxy::removeUserScript):
2171         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
2172         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
2173         (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
2174         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
2175         (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
2176         (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
2177         (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
2178         (WebKit::WebUserContentControllerProxy::addContentExtension):
2179         (WebKit::WebUserContentControllerProxy::removeContentExtension):
2180         (WebKit::WebUserContentControllerProxy::removeAllContentExtensions):
2181         * UIProcess/UserContent/WebUserContentControllerProxy.h:
2182         * UIProcess/VisitedLinkStore.cpp:
2183         (WebKit::VisitedLinkStore::removeAll):
2184         (WebKit::VisitedLinkStore::pendingVisitedLinksTimerFired):
2185         (WebKit::VisitedLinkStore::sendTable):
2186         * UIProcess/WebPageProxy.cpp:
2187         (WebKit::WebPageProxy::finishInitializingWebPageAfterProcessLaunch):
2188         (WebKit::WebPageProxy::creationParameters):
2189         * UIProcess/WebProcessProxy.cpp:
2190         (WebKit::WebProcessProxy::addWebUserContentControllerProxy):
2191         * UIProcess/WebProcessProxy.h:
2192         * WebProcess/UserContent/WebUserContentController.h:
2193         * WebProcess/WebPage/WebPage.cpp:
2194         (WebKit::m_backgroundCPULimit):
2195
2196 2017-04-10  Alex Christensen  <achristensen@webkit.org>
2197
2198         Add API to get available content extension identifiers in a WKContentExtensionStore
2199         https://bugs.webkit.org/show_bug.cgi?id=170093
2200
2201         Reviewed by Geoffrey Garen.
2202
2203         * UIProcess/API/APIContentExtensionStore.cpp:
2204         (API::constructedPathPrefix):
2205         (API::constructedPathFilter):
2206         (API::constructedPath):
2207         (API::ContentExtensionStore::getAvailableContentExtensionIdentifiers):
2208         * UIProcess/API/APIContentExtensionStore.h:
2209         * UIProcess/API/Cocoa/WKContentExtensionStore.h:
2210         * UIProcess/API/Cocoa/WKContentExtensionStore.mm:
2211         (-[WKContentExtensionStore _compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:releasesArgument:]):
2212         (-[WKContentExtensionStore lookUpContentExtensionForIdentifier:completionHandler:]):
2213         (-[WKContentExtensionStore getAvailableContentExtensionIdentifiers:]):
2214         (-[WKContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
2215
2216 2017-04-10  Jeremy Jones  <jeremyj@apple.com>
2217
2218         Add CoreAudioCaptureSource.
2219         https://bugs.webkit.org/show_bug.cgi?id=170112
2220         rdar://problem/30293338
2221
2222         Reviewed by Tim Horton.
2223
2224         Add UseAVFoundationAudioCapture preference to switch back from the new default of CoreAudio.
2225
2226         * Shared/WebPreferencesDefinitions.h:
2227         * UIProcess/API/C/WKPreferences.cpp:
2228         (WKPreferencesSetUseAVFoundationAudioCapture):
2229         (WKPreferencesGetUseAVFoundationAudioCapture):
2230         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2231         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2232         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
2233         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2234         (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs):
2235         * WebProcess/WebPage/WebPage.cpp:
2236         (WebKit::WebPage::updatePreferences):
2237
2238 2017-04-10  Brent Fulgham  <bfulgham@apple.com>
2239
2240         [WK2][macOS] Block access to Apple Events before launch.
2241         https://bugs.webkit.org/show_bug.cgi?id=170626
2242         <rdar://problem/16079334>
2243
2244         Reviewed by Alexey Proskuryakov.
2245
2246         Clear the environment of the AppleEvent server name before initializing
2247         AppKit so we never bother connecting.
2248
2249         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
2250         (main):
2251
2252 2017-04-10  Adrian Perez de Castro  <aperez@igalia.com>
2253
2254         [GTK] Misplaced right click menu on web page due to deprecated gtk_menu_popup()
2255         https://bugs.webkit.org/show_bug.cgi?id=170553
2256
2257         Reviewed by Michael Catanzaro.
2258
2259         Use gtk_menu_popup_at_pointer() and gtk_menu_popup_at_rect() when building with GTK+ 3.22 or
2260         newer. This allows the Wayland GTK+ backend to properly position popup menus, and also avoids
2261         using functions which were deprecated starting at that GTK+ release.
2262
2263         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
2264         (WebKit::WebContextMenuProxyGtk::show): Use gtk_menu_popup_at_pointer() as there is always a
2265         pointer event that can be passed to it.
2266         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
2267         (WebKit::WebPopupMenuProxyGtk::showPopupMenu): Use gtk_menu_popup_at_rect(), using the coordinates
2268         of the control passed as reference rectangle. Some conditional code is needed because with newer
2269         GTK+ versions a relative offset instead of an absolute position is needed.
2270
2271 2017-04-10  Adrian Perez de Castro  <aperez@igalia.com>
2272
2273         [GTK] Opening a popup menu does not pre-select the active item
2274         https://bugs.webkit.org/show_bug.cgi?id=170680
2275
2276         Reviewed by Michael Catanzaro.
2277
2278         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
2279         (WebKit::WebPopupMenuProxyGtk::showPopupMenu): Use gtk_menu_shell_select_item() to
2280         ensure that the active item appears selected right after popping up the menu.
2281
2282 2017-04-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2283
2284         [GTK] Enable DOM timer throttling and CSS animations suspension
2285         https://bugs.webkit.org/show_bug.cgi?id=170669
2286
2287         Reviewed by Žan Doberšek.
2288
2289         * Shared/WebPreferencesDefinitions.h:
2290
2291 2017-04-10  Chris Dumez  <cdumez@apple.com>
2292
2293         Drop Timer::startOneShot() overload taking a double
2294         https://bugs.webkit.org/show_bug.cgi?id=170659
2295
2296         Reviewed by Yusuke Suzuki.
2297
2298         Drop Timer::startOneShot() overload taking a double as people should use Seconds type now.
2299
2300         * NetworkProcess/PingLoad.h:
2301         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2302         (WebKit::NetworkDataTaskSoup::startTimeout):
2303         * Platform/IPC/Connection.h:
2304         * Platform/IPC/mac/ConnectionMac.mm:
2305         (IPC::ConnectionTerminationWatchdog::createConnectionTerminationWatchdog):
2306         (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
2307         (IPC::Connection::terminateSoon):
2308         * PluginProcess/PluginProcess.cpp:
2309         (WebKit::PluginProcess::setMinimumLifetime):
2310         * PluginProcess/PluginProcess.h:
2311         * Shared/ChildProcess.cpp:
2312         (WebKit::ChildProcess::ChildProcess):
2313         * Shared/ChildProcess.h:
2314         (WebKit::ChildProcess::setTerminationTimeout):
2315         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
2316         (WebKit::CompositingRunLoop::startUpdateTimer):
2317         * Shared/Plugins/PluginProcessCreationParameters.h:
2318         * Shared/WebMemorySampler.cpp:
2319         (WebKit::WebMemorySampler::initializeTimers):
2320         * Shared/WebProcessCreationParameters.h:
2321         * UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm:
2322         (API::SharedJSContext::ensureContext):
2323         * UIProcess/ChildProcessProxy.cpp:
2324         (WebKit::ChildProcessProxy::shutDownProcess):
2325         * UIProcess/Cocoa/NavigationState.mm:
2326         (WebKit::NavigationState::didChangeIsLoading):
2327         * UIProcess/Cocoa/ViewGestureController.cpp:
2328         (WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog):
2329         * UIProcess/Cocoa/ViewGestureController.h:
2330         * UIProcess/DrawingAreaProxyImpl.cpp:
2331         (WebKit::DrawingAreaProxyImpl::discardBackingStoreSoon):
2332         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::start):
2333         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::didDraw):
2334         * UIProcess/Gamepad/UIGamepadProvider.cpp:
2335         * UIProcess/Plugins/PluginProcessProxy.cpp:
2336         * UIProcess/ProcessThrottler.cpp:
2337         * UIProcess/ResponsivenessTimer.cpp:
2338         * UIProcess/WebProcessPool.cpp:
2339         (WebKit::WebProcessPool::createNewWebProcess):
2340         * UIProcess/gtk/GestureController.cpp:
2341         (WebKit::GestureController::DragGesture::begin):
2342         * UIProcess/mac/WebInspectorProxyMac.mm:
2343         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2344         (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow):
2345         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2346         (WebKit::CoordinatedLayerTreeHost::scheduleAnimation):
2347         * WebProcess/WebPage/WebPage.cpp:
2348         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
2349         * WebProcess/WebProcess.cpp:
2350
2351 2017-04-09  Wenson Hsieh  <wenson_hsieh@apple.com>
2352
2353         [WK2] Add infrastructure to perform actions after an asynchronous position information request finishes
2354         https://bugs.webkit.org/show_bug.cgi?id=170658
2355         <rdar://problem/31431450>
2356
2357         Reviewed by Tim Horton.
2358
2359         Introduces doAfterPositionInformationUpdate:forRequest:, which WKContentView can use internally to perform
2360         an action requiring InteractionInformationAtPosition asynchronously. See below for additional details.
2361
2362         New API unit test: DataInteractionTests.UnresponsivePageDoesNotHangUI.
2363
2364         * UIProcess/ios/WKContentViewInteraction.h:
2365         * UIProcess/ios/WKContentViewInteraction.mm:
2366         (-[WKContentView _actionForLongPressFromPositionInformation:]):
2367         (-[WKContentView _actionForLongPress]):
2368         (-[WKContentView doAfterPositionInformationUpdate:forRequest:]):
2369
2370         If current position information satisfies the request, then perform the given block immediately; otherwise, we
2371         save the block and request as a pair in a list of pending position information handlers, and then make a new
2372         request to the web process for position information if the currently outgoing request does not already satisfy
2373         the given request.
2374
2375         (-[WKContentView ensurePositionInformationIsUpToDate:]):
2376
2377         Fire all asynchronous position information handlers that are satisfied by the incoming position information.
2378
2379         (-[WKContentView requestAsynchronousPositionInformationUpdate:]):
2380         (-[WKContentView _currentPositionInformationIsValidForRequest:]):
2381         (-[WKContentView _hasValidOutstandingPositionInformationRequest:]):
2382
2383         Pulled out common logic for managing InteractionInformationRequests into separate helper methods.
2384
2385         (-[WKContentView _invokeAndRemovePendingHandlersValidForCurrentPositionInformation]):
2386         (-[WKContentView gestureRecognizerShouldBegin:]):
2387
2388         Refactored to use ensurePositionInformationIsUpToDate:. There is no behavior change here, but it makes sure that
2389         this particular request will also any valid pending position information handlers.
2390
2391         (-[WKContentView _positionInformationDidChange:]):
2392
2393         Fire all asynchronous position information handlers that are satisfied by the incoming position information.
2394
2395         (-[WKContentView pointIsInDataInteractionContent:]): Deleted.
2396
2397         We should no longer use this method, since it makes a synchronous request to the web process -- see
2398         positionInformationMayStartDataInteraction.
2399
2400 2017-04-09  Chris Dumez  <cdumez@apple.com>
2401
2402         Drop Timer::startRepeating() overload taking a double
2403         https://bugs.webkit.org/show_bug.cgi?id=170656
2404
2405         Reviewed by Yusuke Suzuki.
2406
2407         Drop Timer::startRepeating() overload taking a double as people should use Seconds type now.
2408
2409         * Shared/WebMemorySampler.cpp:
2410         (WebKit::WebMemorySampler::initializeTimers):
2411         * UIProcess/Cocoa/ViewGestureController.cpp:
2412         * UIProcess/HighPerformanceGraphicsUsageSampler.cpp:
2413         * UIProcess/PerActivityStateCPUUsageSampler.cpp:
2414         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2415         (WebKit::NetscapePlugin::Timer::start):
2416         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2417         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2418         (WebKit::CompositingCoordinator::scheduleReleaseInactiveAtlases):
2419
2420 2017-04-09  Jon Lee  <jonlee@apple.com>
2421
2422         [WK2][iOS] Add CoreMedia entitlement for WebProcess
2423         https://bugs.webkit.org/show_bug.cgi?id=170623
2424         rdar://problem/30020073
2425
2426         Reviewed by Youenn Fablet.
2427
2428         * Configurations/WebContent-iOS.entitlements: Update entitlement to an array of strings instead of bool.
2429
2430 2017-04-09  Chris Dumez  <cdumez@apple.com>
2431
2432         Start dropping Timer API dealing with double
2433         https://bugs.webkit.org/show_bug.cgi?id=170649
2434
2435         Reviewed by Yusuke Suzuki.
2436
2437         Start dropping Timer API dealing with double as people should use Seconds now.
2438
2439         * NetworkProcess/NetworkDataTask.cpp:
2440         (WebKit::NetworkDataTask::scheduleFailure):
2441         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2442         (WebKit::NetworkDataTaskCocoa::resume):
2443         * PluginProcess/PluginControllerProxy.cpp:
2444         (WebKit::PluginControllerProxy::destroy):
2445         (WebKit::PluginControllerProxy::startPaintTimer):
2446         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2447         (webkitWebViewBaseScheduleUpdateActivityState):
2448         * UIProcess/DrawingAreaProxy.cpp:
2449         (WebKit::DrawingAreaProxy::setViewExposedRect):
2450         * UIProcess/DrawingAreaProxyImpl.cpp:
2451         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::start):
2452         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
2453         (WebKit::PluginInfoCache::updatePluginInfo):
2454         * UIProcess/VisitedLinkStore.cpp:
2455         (WebKit::VisitedLinkStore::addVisitedLinkHash):
2456         * UIProcess/WebProcessPool.cpp:
2457         (WebKit::m_hiddenPageThrottlingAutoIncreasesCounter):
2458         * UIProcess/gtk/GestureController.cpp:
2459         (WebKit::GestureController::ZoomGesture::scaleChanged):
2460         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
2461         (WebKit::WebPopupMenuProxyGtk::menuUnmappedCallback):
2462         * WebProcess/Network/WebLoaderStrategy.cpp:
2463         (WebKit::WebLoaderStrategy::scheduleInternallyFailedLoad):
2464         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
2465         (WebKit::NPRuntimeObjectMap::addToInvalidationQueue):
2466         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
2467         (WebKit::NetscapePluginStream::deliverDataToPlugin):
2468         * WebProcess/Plugins/PluginView.cpp:
2469         (WebKit::PluginView::pendingURLRequestsTimerFired):
2470         (WebKit::PluginView::loadURL):
2471         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2472         (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeSoon):
2473         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2474         (WebKit::CoordinatedLayerTreeHost::scheduleLayerFlush):
2475         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2476         (WebKit::DrawingAreaImpl::scheduleDisplay):
2477         * WebProcess/WebPage/WebPage.cpp:
2478         (WebKit::WebPage::updateIsInWindow):
2479         (WebKit::WebPage::addPluginView):
2480         (WebKit::WebPage::setMayStartMediaWhenInWindow):
2481         (WebKit::WebPage::didFinishLoad):
2482         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2483         (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange):
2484
2485 2017-04-08  Chris Dumez  <cdumez@apple.com>
2486
2487         Drop std::chrono support from Timer class
2488         https://bugs.webkit.org/show_bug.cgi?id=170645
2489
2490         Reviewed by Sam Weinig.
2491
2492         Drop std::chrono support from Timer class now that we prefer using Seconds type.
2493
2494         * NetworkProcess/NetworkLoad.cpp:
2495         (WebKit::NetworkLoad::Throttle::Throttle):
2496         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
2497         * NetworkProcess/NetworkProcess.h:
2498         (WebKit::NetworkProcess::loadThrottleLatency):
2499         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2500         * NetworkProcess/NetworkProcessCreationParameters.h:
2501         * NetworkProcess/NetworkResourceLoadParameters.h:
2502         * NetworkProcess/NetworkResourceLoader.cpp:
2503         (WebKit::NetworkResourceLoader::startNetworkLoad):
2504         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2505         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2506         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2507         (WebKit::NetworkCache::Storage::dispatchReadOperation):
2508         (WebKit::NetworkCache::Storage::store):
2509         * Shared/CacheModel.cpp:
2510         (WebKit::calculateMemoryCacheSizes):
2511         * Shared/CacheModel.h:
2512         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
2513         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2514         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2515         * WebProcess/Network/WebLoaderStrategy.cpp:
2516         (WebKit::maximumBufferingTime):
2517         * WebProcess/Plugins/PluginView.cpp:
2518         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2519         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately):
2520         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
2521         * WebProcess/WebProcess.cpp:
2522         (WebKit::m_resourceLoadStatisticsStore):
2523         (WebKit::WebProcess::setCacheModel):
2524
2525 2017-04-08  Chris Dumez  <cdumez@apple.com>
2526
2527         Unreviewed attempt to fix GTK build after r215138.
2528
2529         * UIProcess/API/gtk/WebKitUIClient.cpp:
2530
2531 2017-04-08  Youenn Fablet  <youenn@apple.com>
2532
2533         WebRTC tests gardening
2534         https://bugs.webkit.org/show_bug.cgi?id=170508
2535
2536         Reviewed by Eric Carlson.
2537
2538         * Configurations/FeatureDefines.xcconfig:
2539
2540 2017-04-08  Chris Dumez  <cdumez@apple.com>
2541
2542         Timer's nextFireInterval() / repeatInterval() should return Seconds
2543         https://bugs.webkit.org/show_bug.cgi?id=170639
2544
2545         Reviewed by Simon Fraser.
2546
2547         Timer's nextFireInterval() / repeatInterval() should return Seconds, not double.
2548
2549         * WebProcess/WebPage/WebPage.cpp:
2550         (WebKit::WebPage::layerVolatilityTimerFired):
2551         (WebKit::WebPage::markLayersVolatile):
2552
2553 2017-04-07  Alex Christensen  <achristensen@webkit.org>
2554
2555         Modernize WebPage.h
2556         https://bugs.webkit.org/show_bug.cgi?id=170633
2557
2558         Reviewed by Joseph Pecoraro.
2559
2560         * UIProcess/API/APIUIClient.h:
2561         (API::UIClient::createNewPage):
2562         * UIProcess/API/C/WKPage.cpp:
2563         (WebKit::RunBeforeUnloadConfirmPanelResultListener::create):
2564         (WebKit::RunJavaScriptAlertResultListener::create):
2565         (WebKit::RunJavaScriptConfirmResultListener::create):
2566         (WebKit::RunJavaScriptConfirmResultListener::RunJavaScriptConfirmResultListener):
2567         (WebKit::RunJavaScriptPromptResultListener::create):
2568         (WebKit::RunJavaScriptPromptResultListener::RunJavaScriptPromptResultListener):
2569         (WKPageSetPageUIClient):
2570         * UIProcess/Cocoa/UIDelegate.h:
2571         * UIProcess/Cocoa/UIDelegate.mm:
2572         (WebKit::UIDelegate::UIClient::createNewPage):
2573         * WebProcess/WebPage/WebPage.cpp:
2574         (WebKit::WebPage::loadDataImpl):
2575         (WebKit::WebPage::loadStringImpl):
2576         (WebKit::WebPage::loadData):
2577         (WebKit::WebPage::scaledSnapshotWithOptions):
2578         (WebKit::WebPage::SandboxExtensionTracker::willPerformLoadDragDestinationAction):
2579         (WebKit::WebPage::SandboxExtensionTracker::setPendingProvisionalSandboxExtension):
2580         * WebProcess/WebPage/WebPage.h:
2581
2582 2017-04-07  Alex Christensen  <achristensen@webkit.org>
2583
2584         Use audit_token_t instead of pid_t for checking sandbox of other processes
2585         https://bugs.webkit.org/show_bug.cgi?id=170616
2586         <rdar://problem/31158189>
2587
2588         Reviewed by Daniel Bates.
2589
2590         pid's can be reused, so it's theoretically unsafe to use the pid of another process to check whether it's sandboxed.
2591         Use an audit_token_t instead to be more sure that we are not mistakenly checking a new process that has reused the
2592         old process's pid. For the current process, though, we have no xpc_connection_t to the process because we are the process.
2593
2594         * PluginProcess/mac/PluginProcessMac.mm:
2595         (WebKit::PluginProcess::initializeSandbox):
2596         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
2597         (WebKit::XPCServiceInitializerDelegate::isClientSandboxed):
2598         * Shared/mac/SandboxUtilities.h:
2599         * Shared/mac/SandboxUtilities.mm:
2600         (WebKit::currentProcessIsSandboxed):
2601         (WebKit::connectedProcessIsSandboxed):
2602         (WebKit::processIsSandboxed): Deleted.
2603         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
2604         (WebKit::WebProcessProxy::platformIsBeingDebugged):
2605         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
2606         (WebKit::PluginInfoStore::shouldUsePlugin):
2607         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2608         (WebKit::PluginProcessProxy::platformGetLaunchOptions):
2609
2610 2017-04-07  Brent Fulgham  <bfulgham@apple.com>
2611
2612         [WK2][iOS] Add CoreMedia entitlement for WebProcess
2613         https://bugs.webkit.org/show_bug.cgi?id=170623
2614         <rdar://problem/30020073>
2615
2616         Reviewed by Youenn Fablet.
2617
2618         Add new "com.apple.tcc.delegated-services" entitlement to allow CoreMedia
2619         to work properly in WebRTC.
2620
2621         * Configurations/WebContent-iOS.entitlements:
2622
2623 2017-04-07  Alex Christensen  <achristensen@webkit.org>
2624
2625         Private browsing sessions should not look in keychain for client certificates
2626         https://bugs.webkit.org/show_bug.cgi?id=170618
2627         <rdar://problem/18457427>
2628
2629         Reviewed by Dan Bernstein.
2630
2631         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2632         (WebKit::configurationForSessionID):
2633
2634 2017-04-07  Chris Dumez  <cdumez@apple.com>
2635
2636         We should log how much CPU a background process was using when killing it due to CPU limiting
2637         https://bugs.webkit.org/show_bug.cgi?id=170619
2638
2639         Reviewed by Andreas Kling.
2640
2641         * WebProcess/cocoa/WebProcessCocoa.mm:
2642         (WebKit::WebProcess::updateBackgroundCPUMonitorState):
2643
2644 2017-04-07  Wenson Hsieh  <wenson_hsieh@apple.com>
2645
2646         Missing conversion from window to content coordinates when adjusting unobscured content rects for input view
2647         https://bugs.webkit.org/show_bug.cgi?id=170603
2648
2649         Reviewed by Simon Fraser.
2650
2651         Refactors -[WKContentView _computeUnobscuredContentRectRespectingInputViewBounds:unobscuredContentRect:inputViewBounds:scale:]
2652         to convert the input view bounds into content coordinates instead of using the zoom scale to adjust the height of inputViewBounds.
2653         Covered by the existing LayoutTest, fixed-element-on-bottom-with-keyboard.html.
2654
2655         * UIProcess/ios/WKContentView.mm:
2656         (-[WKContentView _computeUnobscuredContentRectRespectingInputViewBounds:unobscuredContentRect:inputViewBounds:scale:]):
2657
2658 2017-04-07  Michael Catanzaro  <mcatanzaro@igalia.com>
2659
2660         [GTK] Various build errors when plugin support is disabled
2661         https://bugs.webkit.org/show_bug.cgi?id=170015
2662
2663         Reviewed by Carlos Garcia Campos.
2664
2665         * PluginProcess/unix/PluginControllerProxyUnix.cpp:
2666         * UIProcess/API/gtk/WebKitWebsiteData.cpp:
2667         (recordContainsSupportedDataTypes):
2668         (toWebKitWebsiteDataTypes):
2669         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
2670         (toWebsiteDataTypes):
2671
2672 2017-04-07  John Wilander  <wilander@apple.com>
2673
2674         WebSocket streams should have network usage attributed to correct process
2675         https://bugs.webkit.org/show_bug.cgi?id=170322
2676         <rdar://problem/26413551>
2677
2678         Reviewed by Alex Christensen.
2679
2680         Changes here are due to the added WebCore::SourceApplicationAuditToken parameter
2681         in WebCore::SocketStreamHandleImpl::create().
2682         WebKit::NetworkSocketStream takes it and passes it on.
2683
2684         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2685         (WebKit::NetworkConnectionToWebProcess::createSocketStream):
2686         * NetworkProcess/NetworkSocketStream.cpp:
2687         (WebKit::NetworkSocketStream::create):
2688         (WebKit::NetworkSocketStream::NetworkSocketStream):
2689         * NetworkProcess/NetworkSocketStream.h:
2690
2691 2017-04-07  Michael Catanzaro  <mcatanzaro@igalia.com>
2692
2693         Unreviewed, fix missing return value warning
2694
2695         * UIProcess/WebProcessProxy.cpp:
2696         (WebKit::diagnosticLoggingKeyForSimulatedCrashReason):
2697
2698 2017-04-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2699
2700         [GTK] Update the priorities used in glib main loop sources
2701         https://bugs.webkit.org/show_bug.cgi?id=170457
2702
2703         Reviewed by Žan Doberšek.
2704
2705         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
2706         (WebKit::CompositingRunLoop::CompositingRunLoop):
2707         * UIProcess/DrawingAreaProxyImpl.cpp:
2708         (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl):
2709         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::DrawingMonitor):
2710         * UIProcess/gtk/WaylandCompositor.cpp:
2711         (WebKit::createWaylandLoopSource):
2712         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2713         (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea):
2714         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2715         (WebKit::CompositingCoordinator::CompositingCoordinator):
2716         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
2717         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2718         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
2719         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2720         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
2721
2722 2017-04-06  Alex Christensen  <achristensen@webkit.org>
2723
2724         Add WKContentExtensionStore.h and WKContentExtension.h to public WebKit.h
2725         https://bugs.webkit.org/show_bug.cgi?id=170533
2726
2727         Reviewed by Daniel Bates.
2728
2729         * Shared/API/Cocoa/WebKit.h:
2730         In r213696 I added two public headers.  All public headers in WebKit are included with
2731         #import <WebKit/WebKit.h>
2732
2733 2017-04-06  Joseph Pecoraro  <pecoraro@apple.com>
2734
2735         Web Inspector: Hangs when loading under SpeculativeLoad::shouldCaptureExtraNetworkLoadMetrics
2736         https://bugs.webkit.org/show_bug.cgi?id=170575
2737
2738         Rubber-stamped by Brian Burg.
2739
2740         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2741         (WebKit::NetworkCache::SpeculativeLoad::shouldCaptureExtraNetworkLoadMetrics): Deleted.
2742         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
2743         m_networkLoad is a wrapper around `this` as the client, so we would infinite loop here.
2744
2745 2017-04-06  Commit Queue  <commit-queue@webkit.org>
2746
2747         Unreviewed, rolling out r214973.
2748         https://bugs.webkit.org/show_bug.cgi?id=170578
2749
2750         Causes issues in Safari (Requested by bradee-oh on #webkit).
2751
2752         Reverted changeset:
2753
2754         "Refactor so WebsiteDataStores always have a StorageManager."
2755         https://bugs.webkit.org/show_bug.cgi?id=170521
2756         http://trac.webkit.org/changeset/214973
2757
2758 2017-04-06  Ryan Haddad  <ryanhaddad@apple.com>
2759
2760         Unreviewed, rolling out r215046.
2761
2762         This change broke internal builds.
2763
2764         Reverted changeset:
2765
2766         "WebRTC tests gardening"
2767         https://bugs.webkit.org/show_bug.cgi?id=170508
2768         http://trac.webkit.org/changeset/215046
2769
2770 2017-04-06  Joseph Pecoraro  <pecoraro@apple.com>
2771
2772         Web Inspector: Only Capture Extra Network Load Metrics when there is a Web Inspector Frontend
2773         https://bugs.webkit.org/show_bug.cgi?id=170525
2774
2775         Reviewed by Youenn Fablet.
2776
2777         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2778         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
2779         Only collect extra metrics if the WebProcess this load is for has enabled
2780         collecting extra metrics.
2781
2782         * WebProcess/Network/WebLoaderStrategy.cpp:
2783         (WebKit::WebLoaderStrategy::setCaptureExtraNetworkLoadMetricsEnabled):
2784         * WebProcess/Network/WebLoaderStrategy.h:
2785         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2786         (WebKit::NetworkConnectionToWebProcess::setCaptureExtraNetworkLoadMetricsEnabled):
2787         * NetworkProcess/NetworkConnectionToWebProcess.h:
2788         (WebKit::NetworkConnectionToWebProcess::captureExtraNetworkLoadMetricsEnabled):
2789         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2790         New bool state toggled through the loader policy.
2791
2792         * NetworkProcess/NetworkDataTask.cpp:
2793         (WebKit::NetworkDataTask::shouldCaptureExtraNetworkLoadMetrics):
2794         * NetworkProcess/NetworkDataTask.h:
2795         (WebKit::NetworkDataTaskClient::shouldCaptureExtraNetworkLoadMetrics):
2796         * NetworkProcess/NetworkLoad.cpp:
2797         (WebKit::NetworkLoad::shouldCaptureExtraNetworkLoadMetrics):
2798         * NetworkProcess/NetworkLoad.h:
2799         * NetworkProcess/NetworkLoadClient.h:
2800         (WebKit::NetworkLoadClient::shouldCaptureExtraNetworkLoadMetrics):
2801         * NetworkProcess/NetworkResourceLoader.cpp:
2802         (WebKit::NetworkResourceLoader::shouldCaptureExtraNetworkLoadMetrics):
2803         * NetworkProcess/NetworkResourceLoader.h:
2804         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2805         (WebKit::NetworkCache::SpeculativeLoad::shouldCaptureExtraNetworkLoadMetrics):
2806         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
2807         Default handling for network loads is to not include extra data. Thread
2808         client messages back from the NetworkLoads / SpeculativeLoads to check
2809         the NetworkConnectionToWebProcess state on whether or not we should collect
2810         extra metrics.
2811
2812 2017-04-06  Joseph Pecoraro  <pecoraro@apple.com>
2813
2814         Web Inspector: Show all headers in the Request Headers section of the Resource details sidebar
2815         https://bugs.webkit.org/show_bug.cgi?id=16531
2816         <rdar://problem/5712895>
2817
2818         Reviewed by Timothy Hatcher.
2819
2820         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2821         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
2822         Include a complete list of the request headers sent for this load.
2823         There may be headers that WebCore did not know about and developer
2824         tools should be informed of.
2825
2826 2017-04-06  Anders Carlsson  <andersca@apple.com>
2827
2828         OptionSet options need to be powers of two
2829         https://bugs.webkit.org/show_bug.cgi?id=170565
2830
2831         Reviewed by Chris Dumez.
2832
2833         Change Cache::Option to be powers of two.
2834
2835         * NetworkProcess/cache/NetworkCache.h:
2836
2837 2017-04-06  Youenn Fablet  <youenn@apple.com>
2838
2839         WebRTC tests gardening
2840         https://bugs.webkit.org/show_bug.cgi?id=170508
2841
2842         Reviewed by Eric Carlson.
2843
2844         * Configurations/FeatureDefines.xcconfig:
2845
2846 2017-04-06  Antti Koivisto  <antti@apple.com>
2847
2848         Implement testing mode for disk cache
2849         https://bugs.webkit.org/show_bug.cgi?id=170547
2850
2851         Reviewed by Andreas Kling.
2852
2853         Disable read timeouts and cache shrinking in TestRunner to eliminate potential sources of randomness.
2854
2855         Cache directories are deleted by TestRunner so lack of shrinking does not consume the disk.
2856
2857         This is enabled by the existing WKContextUseTestingNetworkSession SPI.
2858
2859         * NetworkProcess/cache/NetworkCache.cpp:
2860         (WebKit::NetworkCache::Cache::initialize):
2861         * NetworkProcess/cache/NetworkCache.h:
2862         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2863         (WebKit::NetworkCache::Storage::open):
2864         (WebKit::NetworkCache::Storage::Storage):
2865         (WebKit::NetworkCache::Storage::dispatchReadOperation):
2866         (WebKit::NetworkCache::Storage::shrinkIfNeeded):
2867         * NetworkProcess/cache/NetworkCacheStorage.h:
2868         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2869         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2870
2871 2017-04-06  Chris Dumez  <cdumez@apple.com>
2872
2873         [WK2] Add C private API to toggle invisibleAutoplayNotPermitted setting
2874         https://bugs.webkit.org/show_bug.cgi?id=170524
2875         <rdar://problem/31461472>
2876
2877         Reviewed by Eric Carlson.
2878
2879         Add C private API to toggle invisibleAutoplayNotPermitted setting.
2880
2881         * UIProcess/API/C/WKPreferences.cpp:
2882         (WKPreferencesSetInvisibleMediaAutoplayPermitted):
2883         (WKPreferencesGetInvisibleMediaAutoplayPermitted):
2884         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2885
2886 2017-04-06  Adrian Perez de Castro  <aperez@igalia.com>
2887
2888         [GTK] Fix build with MEDIA_CAPTURE enabled
2889         https://bugs.webkit.org/show_bug.cgi?id=170539
2890
2891         Reviewed by Carlos Garcia Campos.
2892
2893         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
2894         (webkit_dom_html_input_element_get_capture): Add missing namespace in usage of WebCore::MediaCaptureTypeNone.
2895
2896 2017-04-05  Brent Fulgham  <bfulgham@apple.com>
2897
2898         [WK2][iOS] Remove access to features not present on iOS 
2899         https://bugs.webkit.org/show_bug.cgi?id=170531
2900         <rdar://problem/31352258>
2901
2902         Reviewed by Alexey Proskuryakov.
2903
2904         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2905
2906 2017-04-05  Eric Carlson  <eric.carlson@apple.com>
2907
2908         [MediaStream] Host application should be able to mute and unmute media streams
2909         https://bugs.webkit.org/show_bug.cgi?id=170519
2910         <rdar://problem/31174326>
2911
2912         Reviewed by Youenn Fablet.
2913
2914         * UIProcess/API/C/WKPage.cpp:
2915         (WKPageGetMediaState): Support new media stream state flags.
2916         * UIProcess/API/C/WKPagePrivate.h:
2917         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Ditto.
2918         * UIProcess/Cocoa/UIDelegate.mm: Ditto.
2919
2920 2017-04-05  Brady Eidson  <beidson@apple.com>
2921
2922         Refactor so WebsiteDataStores always have a StorageManager.
2923         https://bugs.webkit.org/show_bug.cgi?id=170521
2924
2925         Reviewed by Geoff Garen.
2926
2927         This basically involves teaching StorageManager how to work without a LocalStorageDatabaseTracker,
2928         since there will never be ephemeral bits on disk to track.
2929         
2930         * UIProcess/Storage/StorageManager.cpp:
2931         (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
2932         (WebKit::StorageManager::createEphemeral):
2933         (WebKit::StorageManager::StorageManager):
2934         (WebKit::StorageManager::getLocalStorageOrigins):
2935         (WebKit::StorageManager::getLocalStorageOriginDetails):
2936         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
2937         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
2938         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
2939         * UIProcess/Storage/StorageManager.h:
2940         
2941         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2942         (WebKit::WebsiteDataStore::WebsiteDataStore):
2943
2944 2017-04-05  Brent Fulgham  <bfulgham@apple.com>
2945
2946         [WK2][iOS] Add entitlements to enable audio/video capture in WebProcess
2947         https://bugs.webkit.org/show_bug.cgi?id=170507
2948         <rdar://problem/31121248>
2949
2950         Reviewed by Youenn Fablet.
2951
2952         Add two entitlements that are required to access audio/video capture on iOS.
2953
2954         * Configurations/WebContent-iOS.entitlements:
2955
2956 2017-04-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2957
2958         Show a log message when an invalid message is received in non cocoa ports
2959         https://bugs.webkit.org/show_bug.cgi?id=170506
2960
2961         Reviewed by Michael Catanzaro.
2962
2963         We just crash, but without knowing the details about the message it's impossible to debug.
2964
2965         * Shared/ChildProcess.cpp:
2966         (WebKit::ChildProcess::didReceiveInvalidMessage):
2967
2968 2017-04-04  Carlos Garcia Campos  <cgarcia@igalia.com>
2969
2970         Move WebErrors from WebProcess to Shared and get rid of ErrorsGtk in WebCore
2971         https://bugs.webkit.org/show_bug.cgi?id=156974
2972
2973         Reviewed by Sam Weinig.
2974
2975         WebErrors are not only used by the frame loader client in the web process, but also by the network process. So,
2976         move them to Shared make most of the implementation cross-platform.
2977
2978         * CMakeLists.txt: Add new files to compilation.
2979         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2980         (WebKit::NetworkDataTaskSoup::download): Use WebErrors directly instead of platform methods that are no longer needed.
2981         (WebKit::NetworkDataTaskSoup::writeDownloadCallback): Ditto.
2982         (WebKit::NetworkDataTaskSoup::didFinishDownload): Ditto.
2983         (WebKit::NetworkDataTaskSoup::didFail): Ditto.
2984         * PlatformGTK.cmake: Add new files to compilation and remove DownloadSoupErrorsGtk.cpp
2985         * PlatformMac.cmake:
2986         * Shared/API/APIError.cpp: Add error domains used by glib based ports.
2987         (API::Error::webKitNetworkErrorDomain):
2988         (API::Error::webKitPolicyErrorDomain):
2989         (API::Error::webKitPluginErrorDomain):
2990         (API::Error::webKitDownloadErrorDomain):
2991         (API::Error::webKitPrintErrorDomain):
2992         * Shared/API/APIError.h:
2993         * Shared/Cocoa/WebErrorsCocoa.mm: Copied from Source/WebKit2/WebProcess/WebCoreSupport/WebErrors.h.
2994         (WebKit::createNSError):
2995         (WebKit::cancelledError):
2996         (WebKit::fileDoesNotExistError):
2997         * Shared/WebErrors.cpp: Copied from Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp.
2998         (WebKit::blockedError):
2999         (WebKit::blockedByContentBlockerError):
3000         (WebKit::cannotShowURLError):
3001         (WebKit::interruptedForPolicyChangeError):
3002         (WebKit::blockedByContentFilterError):
3003         (WebKit::cannotShowMIMETypeError):
3004         (WebKit::pluginWillHandleLoadError):
3005         (WebKit::internalError):
3006         * Shared/WebErrors.h: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/WebErrors.h.
3007         * Shared/glib/WebErrorsGlib.cpp: Renamed from Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp.
3008         (WebKit::cancelledError):
3009         (WebKit::fileDoesNotExistError):
3010         * Shared/gtk/WebErrorsGtk.cpp: Copied from Source/WebKit2/NetworkProcess/Downloads/gtk/DownloadSoupErrorsGtk.cpp.
3011         (WebKit::printError):
3012         (WebKit::printerNotFoundError):
3013         (WebKit::invalidPageRangeToPrint):
3014         * Shared/soup/WebErrorsSoup.cpp: Renamed from Source/WebKit2/NetworkProcess/Downloads/gtk/DownloadSoupErrorsGtk.cpp.
3015         (WebKit::downloadNetworkError):
3016         (WebKit::downloadCancelledByUserError):
3017         (WebKit::downloadDestinationError):
3018         * UIProcess/API/gtk/WebKitDownload.cpp:
3019         * UIProcess/API/gtk/WebKitError.cpp:
3020         (webkit_network_error_quark):
3021         (webkit_policy_error_quark):
3022         (webkit_plugin_error_quark):
3023         (webkit_download_error_quark):
3024         (webkit_print_error_quark):
3025         * UIProcess/API/gtk/WebKitPrivate.cpp:
3026         (toWebKitError):
3027         (toWebCoreError):
3028         * WebKit2.xcodeproj/project.pbxproj:
3029         * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm: Removed.
3030         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
3031
3032 2017-04-04  Youenn Fablet  <youenn@apple.com>
3033
3034         [Mac] Add back web audio support for getUserMedia MediaStreamTrack
3035         https://bugs.webkit.org/show_bug.cgi?id=170482
3036
3037         Reviewed by Eric Carlson.
3038
3039         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
3040         (WebKit::UserMediaCaptureManager::Source::setStorage):
3041
3042 2017-04-04  Tim Horton  <timothy_horton@apple.com>
3043
3044         [Mac] -[WKWebView findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:] invokes the resultCollector with didWrap = NO even when it wraps
3045         https://bugs.webkit.org/show_bug.cgi?id=165801
3046         <rdar://problem/29649535>
3047
3048         Reviewed by Wenson Hsieh.
3049
3050         Previously, when doing an incremental find that wrapped, we would 
3051         say that it did not, leading NSTextFinder to not provide its usual
3052         wrapping UI, and other clients of the NSTextFinderClient protocol to
3053         get confused by the lack of wrapping.
3054
3055         * UIProcess/WebPageProxy.cpp:
3056         (WebKit::WebPageProxy::didFindString):
3057         * UIProcess/WebPageProxy.h:
3058         * UIProcess/WebPageProxy.messages.in:
3059         * UIProcess/API/APIFindClient.h:
3060         (API::FindClient::didFindString):
3061         * UIProcess/API/C/WKPage.cpp:
3062         (WKPageSetPageFindClient):
3063         * UIProcess/Cocoa/FindClient.h:
3064         * UIProcess/Cocoa/FindClient.mm:
3065         (WebKit::FindClient::didFindString):
3066         * WebProcess/WebPage/FindController.cpp:
3067         (WebKit::FindController::updateFindUIAfterPageScroll):
3068         (WebKit::FindController::findString):
3069         * WebProcess/WebPage/FindController.h:
3070         Plumb DidWrap from FindController's call to findString back through
3071         the DidFindString message.
3072
3073         * UIProcess/mac/WKTextFinderClient.mm:
3074         (-[WKTextFinderClient didFindStringMatchesWithRects:didWrapAround:]):
3075         (-[WKTextFinderClient didFindStringMatchesWithRects:]): Deleted.
3076         Make use of the new DidWrap information to stop lying to NSTextFinder
3077         about whether a wrap actually occurred.
3078
3079 2017-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>
3080
3081         Data interaction should register type identifiers in order of priority
3082         https://bugs.webkit.org/show_bug.cgi?id=170428
3083         <rdar://problem/30633296>
3084
3085         Reviewed by Tim Horton.
3086
3087         Serialize PasteboardWebContent.dataInAttributedStringFormat when sending over IPC. Refer to WebCore ChangeLog
3088         for more details.
3089
3090         * Shared/WebCoreArgumentCoders.cpp:
3091         (IPC::ArgumentCoder<PasteboardWebContent>::encode):
3092         (IPC::ArgumentCoder<PasteboardWebContent>::decode):
3093         * UIProcess/API/Cocoa/WKWebView.mm:
3094
3095 2017-04-03  Joseph Pecoraro  <pecoraro@apple.com>
3096
3097         Remove no longer needed forward declarations
3098         https://bugs.webkit.org/show_bug.cgi?id=170415
3099
3100         Reviewed by Dan Bernstein.
3101
3102         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3103
3104 2017-04-03  Anders Carlsson  <andersca@apple.com>
3105
3106         Tweak ApplePaySession API
3107         https://bugs.webkit.org/show_bug.cgi?id=170409
3108         rdar://problem/31405459
3109
3110         Reviewed by Tim Horton.
3111
3112         Update for WebCore changes.
3113
3114         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3115         (WebKit::toNSError):
3116
3117 2017-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3118
3119         [SOUP] URI Fragment is lost after redirect
3120         https://bugs.webkit.org/show_bug.cgi?id=170058
3121
3122         Reviewed by Michael Catanzaro.
3123
3124         In case of redirection check if the current request has a fragment identifier and apply it to the redirection
3125         only when it doesn't have a fragment identifier yet.
3126
3127         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3128         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
3129         (WebKit::NetworkDataTaskSoup::createRequest):
3130         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
3131         * NetworkProcess/soup/NetworkDataTaskSoup.h:
3132
3133 2017-04-03  Antti Koivisto  <antti@apple.com>
3134
3135         Mutex may be freed too late in NetworkCache::Storage::traverse
3136         https://bugs.webkit.org/show_bug.cgi?id=170400
3137         <rdar://problem/30515865>
3138
3139         Reviewed by Carlos Garcia Campos and Andreas Kling.
3140
3141         Fix a race.
3142
3143         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3144         (WebKit::NetworkCache::Storage::traverse):
3145
3146             Ensure the mutex is not accessed after we dispatch to the main thread.
3147             The main thread call deletes the owning TraverseOperation.
3148
3149 2017-04-01  Dan Bernstein  <mitz@apple.com>
3150
3151         [iOS] <input type=file> label should be specified using plural rules
3152         https://bugs.webkit.org/show_bug.cgi?id=170388
3153
3154         Reviewed by Alexey Proskuryakov.
3155
3156         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3157         (-[WKFileUploadPanel _processMediaInfoDictionaries:atIndex:processedResults:processedImageCount:processedVideoCount:successBlock:failureBlock:]):
3158           Instead of calling -_displayStringForPhotos:videos:, use
3159           +[NSString localizedStringWithFormat:] with the new format string "%lu photo(s) and
3160           %lu video(s)" for which there are plural rules.
3161         (-[WKFileUploadPanel _displayStringForPhotos:videos:]): Deleted.
3162
3163 2017-04-01  Dan Bernstein  <mitz@apple.com>
3164
3165         [Xcode] In engineering builds, linker warns about libwebrtc.dylib’s install name being invalid
3166         https://bugs.webkit.org/show_bug.cgi?id=170385
3167
3168         Reviewed by Tim Horton.
3169
3170         * Configurations/WebKit.xcconfig: When WebKit is relocatable, tell the linker that it’s
3171           not going to be in the shared cache, even if its install name implies that it might be.
3172
3173 2017-03-31  Simon Fraser  <simon.fraser@apple.com>
3174
3175         Remove a logging statement left in by mistake.
3176
3177         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3178         (WebKit::WebFrameLoaderClient::restoreViewState):
3179
3180 2017-03-31  Wenson Hsieh  <wenson_hsieh@apple.com>
3181
3182         Address post-review feedback after r214692
3183         https://bugs.webkit.org/show_bug.cgi?id=170328
3184
3185         Reviewed by Dan Bernstein.
3186
3187         Clearing the selection when UIKit calls into WKContentView to set its selected text range to nil is a rule
3188         that should be applied when using a text interaction assistant, not just when using character granularity
3189         for selecting text.
3190
3191         * UIProcess/ios/WKContentViewInteraction.mm:
3192         (-[WKContentView setSelectedTextRange:]):
3193
3194 2017-03-31  Wenson Hsieh  <wenson_hsieh@apple.com>
3195
3196         [WK2] Tapping away to dismiss the selection does not update the selected DOM range using character granularity
3197         https://bugs.webkit.org/show_bug.cgi?id=170328
3198         <rdar://problem/30904558>
3199
3200         Reviewed by Tim Horton.
3201
3202         When UIKit clears the selection while in text interaction mode, it notifies its document view (i.e., the
3203         WKContentView) by setting its selected text range to nil. When character granularity selection is enabled, use
3204         this as a cue to notify the web process that the selection is being cleared out.
3205
3206         -setSelectedTextRange: is a noop in the general case because the web process acts as the source of truth for what
3207         the selection currently consists of, and notifies the UI process and UIKit via WKTextPosition and WKTextRange.
3208         However, in the case of character granularity selections, tapping away to clear the selection is handled by
3209         UIKit's text gesture recognizer cluster, which then informs the document (via -setSelectedTextRange:) that the
3210         selection should be cleared out.
3211
3212         Adds a new Layout test: editing/selection/character-granularity-selected-range-after-dismissing-selection.html.
3213
3214         * UIProcess/ios/WKContentViewInteraction.mm:
3215         (-[WKContentView setSelectedTextRange:]):
3216
3217 2017-03-31  Wenson Hsieh  <wenson_hsieh@apple.com>
3218
3219         [WK2] Tapping editable text inside of a range selection no longer changes the selection to a caret
3220         https://bugs.webkit.org/show_bug.cgi?id=170327
3221         <rdar://problem/31363816>
3222
3223         Reviewed by Tim Horton.
3224
3225         Currently, we're forcing all text interaction gestures to duck in lieu of data interaction gestures
3226         when we should only be doing so for gestures that begin a loupe. This prevents other gestures, such as
3227         single taps, from changing the selection when they should be allowed to.
3228
3229         Hooks into new UIKit SPI to make this tweak.
3230         Introduces a new LayoutTest: editing/selection/caret-after-tap-in-editable-selection.html.
3231
3232         * UIProcess/ios/WKContentViewInteraction.mm:
3233         (-[WKContentView pointIsInAssistedNode:]):
3234         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
3235
3236 2017-03-31  Tim Horton  <timothy_horton@apple.com>
3237
3238         Mail can get stuck underneath FindController::findStringMatches after searching in a long message
3239         https://bugs.webkit.org/show_bug.cgi?id=170326
3240         <rdar://problem/30330395>
3241
3242         Reviewed by Simon Fraser.
3243
3244         * UIProcess/mac/WKTextFinderClient.mm:
3245         (-[WKTextFinderClient findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:]):
3246         Cap the number of find matches at 1000, the same maximum that Safari uses.
3247
3248 2017-03-31  Brady Eidson  <beidson@apple.com>
3249
3250         Clean up the "StorageType" enum.
3251         https://bugs.webkit.org/show_bug.cgi?id=170349
3252
3253         Reviewed by Tim Horton.
3254
3255         * WebProcess/Storage/StorageAreaMap.cpp:
3256         (WebKit::StorageAreaMap::StorageAreaMap):
3257         (WebKit::StorageAreaMap::dispatchStorageEvent):
3258         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
3259         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
3260         
3261         * WebProcess/Storage/StorageNamespaceImpl.cpp:
3262         (WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
3263         (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
3264         (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):
3265
3266 2017-03-31  Tim Horton  <timothy_horton@apple.com>
3267
3268         Remove bundle checks for attachmentElementEnabled
3269         https://bugs.webkit.org/show_bug.cgi?id=170329
3270         <rdar://problem/25135244>
3271
3272         Reviewed by Simon Fraser.
3273
3274         * UIProcess/API/Cocoa/WKWebView.mm:
3275         (-[WKWebView _initializeWithConfiguration:]):
3276         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3277         (-[WKWebViewConfiguration init]):
3278         Remove bundle checks.
3279
3280 2017-03-29  Anders Carlsson  <andersca@apple.com>
3281
3282         Adopt PKCanMakePaymentsWithMerchantIdentifierAndDomainAndSourceApplication
3283         https://bugs.webkit.org/show_bug.cgi?id=170257
3284         rdar://problem/31289764
3285
3286         Reviewed by Beth Dakin.
3287
3288         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3289         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
3290
3291 2017-03-31  Csaba Osztrogonác  <ossy@webkit.org>
3292
3293         Mac cmake buildfix after r214403
3294         https://bugs.webkit.org/show_bug.cgi?id=170346
3295
3296         Unreviewed speculative buildfix.
3297
3298         * UIProcess/API/Cocoa/WKWebView.mm:
3299
3300 2017-03-31  Brady Eidson  <beidson@apple.com>
3301
3302         Remove erroneously committed changes from r214078
3303
3304         Unreviewed.
3305
3306         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3307         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Whoops!
3308
3309 2017-03-31  Carlos Garcia Campos  <cgarcia@igalia.com>
3310
3311         Modern media controls should never be enabled in non cocoa ports
3312         https://bugs.webkit.org/show_bug.cgi?id=170338
3313
3314         Reviewed by Michael Catanzaro.
3315
3316         It's currently enabled, because it uses the default value for all other runtime features, but modern media
3317         controls are not a cross-platform feature. I think this is why media/video-click-dblckick-standalone.html
3318         started to fail in GTK+ port after r214426. I can't reprouduce the failure locally, so I can't confirm it,
3319         though.
3320
3321         * Shared/WebPreferencesDefinitions.h:
3322
3323 2017-03-30  Zan Dobersek  <zdobersek@igalia.com>
3324
3325         Unreviewed GTK+ build fix. List WebCore before JavaScriptCore as the
3326         two WebKit2 dependency libraries to avoid WTF directiories being
3327         listed for inclusion before WebCore directories at compile-time.
3328
3329         * CMakeLists.txt:
3330
3331 2017-03-30  Megan Gardner  <megan_gardner@apple.com>
3332
3333         Allow for extended color in snapshots
3334         https://bugs.webkit.org/show_bug.cgi?id=170314
3335         <rdar://problem/28676092> WKImageCreateCGImage should support WideGamut in WebKit2 on macOS
3336
3337         Reviewed by Simon Fraser.
3338
3339         Piping options through snapshots to allow for wide gamut support.
3340
3341         * Shared/API/c/WKImage.h:
3342         * Shared/API/c/WKSharedAPICast.h:
3343         (WebKit::snapshotOptionsFromImageOptions):
3344         * Shared/ImageOptions.h:
3345         (WebKit::snapshotOptionsToImageOptions):
3346         * Shared/WebImage.cpp:
3347         (WebKit::WebImage::create):
3348
3349 2017-03-30  Sam Weinig  <sam@webkit.org>
3350
3351         Expose the WKView SPI, _prepareForMoveToWindow:withCompletionHandler as WKWebView SPI
3352         <rdar://problem/31350588>
3353         https://bugs.webkit.org/show_bug.cgi?id=170315
3354
3355         Reviewed by Simon Fraser.
3356
3357         * UIProcess/API/Cocoa/WKWebView.mm:
3358         (-[WKWebView _prepareForMoveToWindow:completionHandler:]):
3359         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3360         Copy SPI to WKWebView. Remove 'with' prefix to match conventions.
3361
3362 2017-03-30  Wenson Hsieh  <wenson_hsieh@apple.com>
3363
3364         [WK2] Touches should not cancel when showing a custom action sheet while data interaction is active
3365         https://bugs.webkit.org/show_bug.cgi?id=170291
3366         <rdar://problem/31301388>
3367
3368         Reviewed by Tim Horton.
3369
3370         Currently, when presenting a custom popover, we will cancel all touches in the application. This makes data
3371         interaction when a custom popover is shown impossible -- to address this, we should only cancel touches when
3372         the view is not an active data interaction source.
3373
3374         New API test: DataInteractionTests.CustomActionSheetPopover.
3375
3376         * UIProcess/ios/WKContentViewInteraction.mm:
3377         (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]):
3378
3379 2017-03-30  Youenn Fablet  <youenn@apple.com>
3380
3381         NetworkConnectionToWebProcess should stop web sockets when being destroyed
3382         https://bugs.webkit.org/show_bug.cgi?id=170286
3383
3384         Reviewed by Brady Eidson.
3385
3386         * NetworkProcess/NetworkSocketStream.cpp:
3387         (WebKit::NetworkSocketStream::~NetworkSocketStream): Stopping the socket handle if not done already.
3388         * NetworkProcess/NetworkSocketStream.h:
3389
3390 2017-03-29  Tim Horton  <timothy_horton@apple.com>
3391
3392         Remove unused PageClient::removeNavigationGestureSnapshot
3393         https://bugs.webkit.org/show_bug.cgi?id=170249
3394
3395         Reviewed by Beth Dakin.
3396
3397         * UIProcess/PageClient.h:
3398         * UIProcess/WebPageProxy.cpp:
3399         (WebKit::WebPageProxy::removeNavigationGestureSnapshot): Deleted.
3400         * UIProcess/WebPageProxy.h:
3401         * UIProcess/mac/PageClientImpl.h:
3402         * UIProcess/mac/PageClientImpl.mm:
3403         (WebKit::PageClientImpl::removeNavigationGestureSnapshot): Deleted.
3404
3405 2017-03-29  Antti Koivisto  <antti@apple.com>
3406
3407         Increment the last stable network cache version on Mac
3408         https://bugs.webkit.org/show_bug.cgi?id=170248
3409         <rdar://problem/31326040>
3410
3411         Reviewed by Chris Dumez.
3412
3413         Bump to the latest release.
3414
3415         * NetworkProcess/cache/NetworkCacheStorage.h:
3416
3417 2017-03-28  Timothy Horton  <timothy_horton@apple.com>
3418
3419         Stop overriding scroll view inset defaults
3420         https://bugs.webkit.org/show_bug.cgi?id=170221
3421         <rdar://problem/31260325>
3422
3423         Reviewed by Simon Fraser.
3424
3425         * Platform/spi/ios/UIKitSPI.h:
3426         * UIProcess/API/Cocoa/WKWebView.mm:
3427         (-[WKWebView _initializeWithConfiguration:]):
3428         The default behavior is sufficient for us.
3429
3430 2017-03-28  Timothy Horton  <timothy_horton@apple.com>
3431
3432         Safari crashes when attempting to close tab that is displaying PDF
3433         https://bugs.webkit.org/show_bug.cgi?id=170201
3434         <rdar://problem/31242019>
3435
3436         Reviewed by Wenson Hsieh.
3437
3438         * UIProcess/API/Cocoa/WKWebView.mm:
3439         (-[WKWebView _doAfterNextStablePresentationUpdate:]):
3440         Adopt BlockPtr to fix a leak.
3441
3442         (-[WKWebView _firePresentationUpdateForPendingStableStatePresentationCallbacks]):
3443         dispatch_async in the doAfterNextPresentationUpdate callback; since this
3444         recursively calls itself, in cases where doAfterNextPresentationUpdate
3445         returns synchronously (e.g. if the Web Process is missing), we would
3446         recurse infinitely.
3447
3448 2017-03-27  Youenn Fablet  <youenn@apple.com>
3449
3450         Remove WebPage::m_shouldDoICECandidateFiltering
3451         https://bugs.webkit.org/show_bug.cgi?id=170150
3452
3453         Reviewed by Sam Weinig.
3454
3455         It is redundant with RTCController::m_shouldFilterICECandidates.
3456         Manually tested on webrtc test samples.
3457         This code path is currently untested by rwt as we hook it to getUserMedia which is mocked in rwt.
3458         Additional testing will be added as a follow-up patch.
3459
3460         * WebProcess/WebPage/WebPage.cpp:
3461         (WebKit::WebPage::disableICECandidateFiltering):
3462         (WebKit::WebPage::enableICECandidateFiltering):
3463         * WebProcess/WebPage/WebPage.h:
3464
3465 2017-03-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3466
3467         [WK2] UIKit assertion when rotating device after dismissing popover
3468         https://bugs.webkit.org/show_bug.cgi?id=170159
3469         <rdar://problem/31283829>
3470
3471         Reviewed by Tim Horton.
3472
3473         Ensure that when we are finished presenting a WKActionSheet, we unregister with the shared notifications center.
3474
3475         * UIProcess/ios/WKActionSheet.mm:
3476         (-[WKActionSheet dealloc]):
3477         (-[WKActionSheet _cleanup]):
3478         (-[WKActionSheet doneWithSheet:]):
3479
3480 2017-03-27  Andy Estes  <aestes@apple.com>
3481
3482         [iOS] Suppress page count recalc when setting a snapshot paper rect
3483         https://bugs.webkit.org/show_bug.cgi?id=170156
3484         <rdar://problem/30787872>
3485
3486         Reviewed by Tim Horton.
3487
3488         When _WKWebViewPrintFormatter computes a page count for snapshotting, it updates the paper
3489         rect, which triggers UIKit to ask for the page count again while we're in the middle of
3490         printing, putting us in a bad state.
3491
3492         Suppress page count recalc while setting the new paper rect, since we know this will not
3493         cause it to change.
3494
3495         * UIProcess/_WKWebViewPrintFormatter.mm:
3496         (-[_WKWebViewPrintFormatter _setSnapshotPaperRect:]): Temporarily set
3497         _suppressPageCountRecalc to YES before updating the paper rect.
3498         (-[_WKWebViewPrintFormatter _setNeedsRecalc]): Only call [super _setNeedsRecalc] if
3499         _suppressPageCountRecalc is NO.
3500         * UIProcess/_WKWebViewPrintFormatterInternal.h: Declared -_setNeedsRecalc.
3501
3502 2017-03-26  Wenson Hsieh  <wenson_hsieh@apple.com>
3503
3504         [WK2] Callout Bar should be dismissed during data interaction
3505         https://bugs.webkit.org/show_bug.cgi?id=170109
3506         <rdar://problem/31171570>
3507
3508         Reviewed by Tim Horton.
3509
3510         Minor tweak to get the callout bar to duck during data interaction. Import a new UIKit SPI header in WebKit2.
3511
3512         * Platform/spi/ios/UIKitSPI.h:
3513
3514 2017-03-27  Keith Rollin  <krollin@apple.com>
3515
3516         Update NetworkResourceLoader logging statement
3517         https://bugs.webkit.org/show_bug.cgi?id=170126
3518
3519         Reviewed by Alex Christensen.
3520
3521         NetworkResourceLoader contains a logging statement that prints, in
3522         part: "start: Retrieving resource from cache". This is misleading,
3523         since it's not necessarily the case that the resource will be loaded
3524         from the cache. What is actually happening at the point where that is
3525         logged is that the cache is being checked for the resource. It still
3526         remains to be seen if the resource will be found in it. To address
3527         this, change the logging to say "start: Checking cache for resource".
3528
3529         * NetworkProcess/NetworkResourceLoader.cpp:
3530         (WebKit::NetworkResourceLoader::start):
3531
3532 2017-03-27  Joseph Pecoraro  <pecoraro@apple.com>
3533
3534         Web Inspector: Saving files should not suggest the top level directory
3535         https://bugs.webkit.org/show_bug.cgi?id=170085
3536         <rdar://problem/30197794>
3537
3538         Reviewed by Matt Baker.
3539
3540         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
3541         (WebKit::RemoteWebInspectorProxy::platformSave):
3542         * UIProcess/mac/WebInspectorProxyMac.mm:
3543         (WebKit::WebInspectorProxy::platformSave):
3544         Don't set panel.directoryURL unless we have a good suggestion.
3545
3546 2017-03-27  Yongjun Zhang  <yongjun_zhang@apple.com>
3547
3548         Add delegate method to let an WebKit client provide a custom image preview controller.
3549         https://bugs.webkit.org/show_bug.cgi?id=170076
3550         rdar://problem/31153051
3551
3552         Add a new delegate method (_webView:previewViewControllerForImage:alternateURL:defaultActions:elementInfo:) to
3553         WKUIDelegatePrivate, an client can use this method to provide a custom image preview view controller if the image
3554         has alternated URL or custom image info.
3555
3556         Reviewed by Beth Dakin.
3557
3558         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Add delegate method _webView:previewViewControllerForImage:alternateURL:defaultActions:elementInfo:.
3559         * UIProcess/ios/WKContentViewInteraction.mm:
3560         (-[WKContentView _presentedViewControllerForPreviewItemController:]): If the image has alternated URL or custom info, try to use the client-provided
3561             preview view controller. Otherwise, use the default WKImagePreviewViewController.
3562
3563 2017-03-27  Anders Carlsson  <andersca@apple.com>
3564
3565         Fix uses of deprecated API
3566         https://bugs.webkit.org/show_bug.cgi?id=170138
3567         rdar://problem/28882449
3568
3569         Reviewed by Tim Horton.
3570
3571         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3572         (WebKit::toPKContactFields):
3573         (WebKit::toPKAddressField):
3574         (WebKit::toPKPaymentRequest):
3575         Don't use deprecated APIs.
3576
3577         (WebKit::toNSError):
3578         Don't try to insert nil in a dictionary.
3579
3580 2017-03-27  Alex Christensen  <achristensen@webkit.org>
3581
3582         Make WebSockets work in network process
3583         https://bugs.webkit.org/show_bug.cgi?id=169930
3584
3585         Reviewed by Youenn Fablet.
3586
3587         This adds WebSocketStream, which is a SocketStreamHandle that sends asynchronous 
3588         messages to a NetworkSocketStream in the NetworkProcess.  WebKit1 uses a SocketStreamHandleImpl
3589         still, but WebKit2 now has a SocketStreamHandleImpl in the NetworkProcess owned by the 
3590         NetworkSocketStream, which is a SocketStreamHandleClient that sends asynchronous messages back
3591         to the WebProcess.  WebSocketStream's implementation of SocketStreamHandle::platformSend is special
3592         because it stores the completion handler in a map and asynchronously reports to the caller whether
3593         it succeeded or not.  If the network processes crashes before the completion handlers are called,
3594         then they are called indicating failure and an error is reported, but that never happens, right?
3595
3596         * CMakeLists.txt:
3597         * DerivedSources.make:
3598         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3599         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
3600         (WebKit::NetworkConnectionToWebProcess::createSocketStream):
3601         (WebKit::NetworkConnectionToWebProcess::destroySocketStream):
3602         * NetworkProcess/NetworkConnectionToWebProcess.h:
3603         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3604         * NetworkProcess/NetworkProcess.cpp:
3605         (WebKit::NetworkProcess::setAllowsAnySSLCertificateForWebSocket):
3606         * NetworkProcess/NetworkProcess.h:
3607         * NetworkProcess/NetworkProcess.messages.in:
3608         * NetworkProcess/NetworkSocketStream.cpp: Added.
3609         (WebKit::NetworkSocketStream::create):
3610         (WebKit::NetworkSocketStream::NetworkSocketStream):
3611         (WebKit::NetworkSocketStream::sendData):
3612         (WebKit::NetworkSocketStream::close):
3613         (WebKit::NetworkSocketStream::didOpenSocketStream):
3614         (WebKit::NetworkSocketStream::didCloseSocketStream):
3615         (WebKit::NetworkSocketStream::didReceiveSocketStreamData):
3616         (WebKit::NetworkSocketStream::didFailToReceiveSocketStreamData):
3617         (WebKit::NetworkSocketStream::didUpdateBufferedAmount):
3618         (WebKit::NetworkSocketStream::didFailSocketStream):
3619         (WebKit::NetworkSocketStream::messageSenderConnection):
3620         (WebKit::NetworkSocketStream::messageSenderDestinationID):
3621         * NetworkProcess/NetworkSocketStream.h: Added.
3622         * NetworkProcess/NetworkSocketStream.messages.in: Added.
3623         * UIProcess/API/C/WKContext.cpp:
3624         (WKContextSetAllowsAnySSLCertificateForWebSocketTesting):
3625         (WKContextTerminateNetworkProcess):
3626         * UIProcess/API/C/WKContextPrivate.h:
3627         * UIProcess/WebProcessPool.cpp:
3628         (WebKit::WebProcessPool::sendSyncToNetworkingProcess):
3629         (WebKit::WebProcessPool::setAllowsAnySSLCertificateForWebSocket):
3630         (WebKit::WebProcessPool::terminateNetworkProcess):
3631         * UIProcess/WebProcessPool.h:
3632         * WebKit2.xcodeproj/project.pbxproj:
3633         * WebProcess/Network/NetworkProcessConnection.cpp:
3634         (WebKit::NetworkProcessConnection::didReceiveMessage):
3635         * WebProcess/Network/WebSocketProvider.cpp:
3636         (WebKit::WebSocketProvider::createSocketStreamHandle):
3637         * WebProcess/Network/WebSocketStream.cpp: Added.
3638         (WebKit::globalWebSocketStreamMap):
3639         (WebKit::WebSocketStream::streamWithIdentifier):
3640         (WebKit::WebSocketStream::networkProcessCrashed):
3641         (WebKit::WebSocketStream::create):
3642         (WebKit::WebSocketStream::WebSocketStream):
3643         (WebKit::WebSocketStream::~WebSocketStream):
3644         (WebKit::WebSocketStream::messageSenderConnection):
3645         (WebKit::WebSocketStream::messageSenderDestinationID):
3646         (WebKit::WebSocketStream::platformSend):
3647         (WebKit::WebSocketStream::didSendData):
3648         (WebKit::WebSocketStream::platformClose):
3649         (WebKit::WebSocketStream::bufferedAmount):
3650         (WebKit::WebSocketStream::didOpenSocketStream):
3651         (WebKit::WebSocketStream::didCloseSocketStream):
3652         (WebKit::WebSocketStream::didReceiveSocketStreamData):
3653         (WebKit::WebSocketStream::didFailToReceiveSocketStreamData):
3654         (WebKit::WebSocketStream::didUpdateBufferedAmount):
3655         (WebKit::WebSocketStream::didFailSocketStream):
3656         * WebProcess/Network/WebSocketStream.h: Added.
3657         * WebProcess/Network/WebSocketStream.messages.in: Added.
3658         * WebProcess/WebProcess.cpp:
3659         (WebKit::WebProcess::networkProcessConnectionClosed):
3660
3661 2017-03-27  Adrian Perez de Castro  <aperez@igalia.com>
3662
3663         [GTK] NetscapePluginX11::m_windowID is unused/unneeded
3664         https://bugs.webkit.org/show_bug.cgi?id=170115
3665
3666         Reviewed by Michael Catanzaro.
3667
3668         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
3669         (WebKit::NetscapePluginX11::NetscapePluginX11):
3670         Remove the unneeded NetscapePluginX11::m_windowID member.
3671         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.h:
3672         Remove the unneeded NetscapePluginX11::m_windowID member.
3673
3674 2017-03-25  Andy Estes  <aestes@apple.com>
3675
3676         [iOS] Use snapshotting instead of printing to draw single-page PDFs
3677         https://bugs.webkit.org/show_bug.cgi?id=170103
3678         <rdar://problem/30542960>
3679
3680         Reviewed by Tim Horton.
3681
3682         * WebProcess/WebPage/WebPage.cpp:
3683         (WebKit::paintSnapshotAtSize): Moved the painting logic from WebPage::snapshotAtSize() to here.
3684         (WebKit::WebPage::snapshotAtSize): Changed to call paintSnapshotAtSize() with the
3685         WebImage's graphics context.
3686         (WebKit::WebPage::pdfSnapshotAtSize): Created a CGPDFGraphicsContext, passed it to
3687         paintSnapshotAtSize(), and returned the context's data.
3688         * WebProcess/WebPage/WebPage.h: Made snapshotAtSize() and snapshotNode() private, changed
3689         their return values from PassRefPtr to RefPtr, and declared pdfSnapshotAtSize().
3690         * WebProcess/WebPage/ios/WebPageIOS.mm:
3691         (WebKit::WebPage::computePagesForPrintingAndDrawToPDF): If snapshotting the first page,
3692         returned a page count of 1 and created a PDF using pdfSnapshotAtSize().
3693
3694 2017-03-25  John Wilander  <wilander@apple.com>
3695
3696         Re-enable the web process' keychain access to fix client certificate authentication
3697         https://bugs.webkit.org/show_bug.cgi?id=170074
3698         <rdar://problem/31095987>
3699
3700         Reviewed by Brent Fulgham.
3701
3702         This is a follow-up patch to
3703         https://trac.webkit.org/changeset/214389/webkit
3704         since according to Alexey Proskuryakov, resource
3705         loading has always required identical sandbox
3706         rules in WebContent and Networking processes.
3707
3708         * WebProcess/com.apple.WebProcess.sb.in:
3709             Reverted remaining change from
3710             https://trac.webkit.org/changeset/208702/webkit and
3711             https://trac.webkit.org/changeset/208707/webkit.
3712
3713 2017-03-24  Wenson Hsieh  <wenson_hsieh@apple.com>
3714
3715         [WK2] Add a UI delegate SPI hook to enable or disable navigation on drop
3716         https://bugs.webkit.org/show_bug.cgi?id=169168
3717         <rdar://problem/30688374>
3718
3719         Reviewed by Tim Horton.
3720
3721         Support customizing the set of allowed actions on drop in WebKit2 by introducing a new method to WKUIDelegatePrivate
3722         that returns a WKDragDestinationAction given platform dragging info. These flags are then used to initialize the
3723         DragData sent over to the web process, where they update DragController's view of the allowed destination actions.
3724
3725         Moving forward, the default action mask for WKWebViews will include everything except WKDragDestinationActionLoad,
3726         though for applciations linked on or before 10.12, we will still default to WKDragDestinationActionAny to mitigate
3727         any compatibility risk.
3728
3729         * Shared/API/Cocoa/WKDragDestinationAction.h:
3730
3731         Introduce WK2 client-facing versions of WebCore::DragDestinationAction flags.
3732
3733         * Shared/WebCoreArgumentCoders.cpp:
3734         (IPC::ArgumentCoder<DragData>::encode):
3735         (IPC::ArgumentCoder<DragData>::decode):
3736
3737         Serialize DragData's destination actions when sending DragData over IPC.
3738
3739         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3740         * UIProcess/API/Cocoa/WKWebView.mm:
3741         (-[WKWebView _web_dragDestinationActionForDraggingInfo:]):
3742
3743         For WKWebView, allow all drag destination actions except for loading (i.e. drop-to-navigate).
3744
3745         * UIProcess/API/mac/WKView.mm:
3746         (-[WKView _web_dragDestinationActionForDraggingInfo:]):
3747
3748         For WKView, allow all types of drag destination actions.
3749
3750         * UIProcess/Cocoa/VersionChecks.h:
3751         * UIProcess/Cocoa/WebViewImpl.h:
3752         * UIProcess/Cocoa/WebViewImpl.mm:
3753         (WebKit::WebViewImpl::draggingEntered):
3754         (WebKit::WebViewImpl::draggingUpdated):
3755         * WebKit2.xcodeproj/project.pbxproj:
3756         * WebProcess/WebCoreSupport/WebDragClient.cpp:
3757         (WebKit::WebDragClient::actionMaskForDrag):
3758         * WebProcess/WebCoreSupport/WebDragClient.h:
3759
3760 2017-03-24  Simon Fraser  <simon.fraser@apple.com>
3761
3762         [iOS WK2] Move from a pre-commit handler to dispatch_async for visible content rect updates
3763         https://bugs.webkit.org/show_bug.cgi?id=170091
3764         rdar://problem/30682584
3765
3766         Reviewed by Tim Horton.
3767         
3768         [CATransaction addCommitHandler:forPhase:] is sometimes not called when running inside another
3769         commit callback (rdar://problem/31253952), and we don't yet have a reliable way to detect this.
3770
3771         So dispatch_async() to postpone the call to [CATransaction addCommitHandler:forPhase:] to a known-
3772         good time.
3773
3774         * UIProcess/API/Cocoa/WKWebView.mm:
3775         (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
3776
3777 2017-03-24  John Wilander  <wilander@apple.com>
3778
3779         Re-enable the network process' keychain access to fix client certificate authentication
3780         https://bugs.webkit.org/show_bug.cgi?id=170074
3781         <rdar://problem/31095987>
3782
3783         Reviewed by Brent Fulgham.
3784
3785         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
3786             Reverted remaining change from
3787             https://trac.webkit.org/changeset/208702/webkit and
3788             https://trac.webkit.org/changeset/208707/webkit.
3789
3790 2017-03-24  Eric Carlson  <eric.carlson@apple.com>
3791
3792         [MediaStream] "ideal" constraints passed to getUserMedia should affect fitness score
3793         https://bugs.webkit.org/show_bug.cgi?id=170056
3794
3795         Reviewed by Youenn Fablet.
3796
3797         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3798         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): When
3799         short-circuiting the user prompt because the page is already authorized, return the first
3800         audio and/or video device because so the page gets the one with the best fitness distance.
3801
3802 2017-03-24  Simon Fraser  <simon.fraser@apple.com>
3803
3804         Make UI-side compositing on macOS a bit more usable
3805         https://bugs.webkit.org/show_bug.cgi?id=170073
3806
3807         Reviewed by Tim Horton.
3808         
3809         Mach port as layer contents doesn't work on macOS, so don't use it there.
3810
3811         Also remove two assertions that hit with UI-side compositing in MiniBrowser.
3812
3813         * UIProcess/DrawingAreaProxy.cpp:
3814         (WebKit::DrawingAreaProxy::createFence):
3815         * UIProcess/mac/PageClientImpl.mm:
3816         (WebKit::PageClientImpl::requestScroll):
3817         * UIProcess/mac/RemoteLayerTreeHost.mm:
3818         (WebKit::RemoteLayerTreeHost::updateLayerTree):
3819
3820 2017-03-24  Alex Christensen  <achristensen@webkit.org>
3821
3822         Fix assertions after r214358.
3823         https://bugs.webkit.org/show_bug.cgi?id=169167
3824
3825         * UIProcess/API/APIContentExtensionStore.cpp:
3826         (API::ContentExtensionStore::compileContentExtension):
3827         AtomicString::init must be called for the first time from the main thread.
3828         We were calling it for the first time from a non-main thread sometimes.
3829         Call it from the main thread before initiating compiling on another thread.
3830
3831 == Rolled over to ChangeLog-2017-03-23 ==