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