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