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