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