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