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