Resource Load Statistics: Communicate to the network process which domains to partition
[WebKit.git] / Source / WebKit2 / ChangeLog
1 2017-03-08  John Wilander  <wilander@apple.com>
2
3         Resource Load Statistics: Communicate to the network process which domains to partition
4         https://bugs.webkit.org/show_bug.cgi?id=169322
5         <rdar://problem/30768921>
6
7         Reviewed by Alex Christensen.
8
9         * NetworkProcess/NetworkProcess.cpp:
10         (WebKit::NetworkProcess::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
11         * NetworkProcess/NetworkProcess.h:
12         * NetworkProcess/NetworkProcess.messages.in:
13         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
14         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
15             Now consults WebCore::NetworkStorageSession::shouldPartitionCookiesForHost()
16             to decide whether partitioning should be applied or not.
17         * UIProcess/API/C/WKCookieManager.cpp:
18         (WKCookieManagerSetCookieStoragePartitioningEnabled):
19             To allow TestRunner to configure cookie partitioning.
20         * UIProcess/API/C/WKCookieManager.h:
21         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
22         (WKResourceLoadStatisticsManagerFireShouldPartitionCookiesHandler):
23             To allow TestRunner to set a domain for which
24             partitioning should be applied.
25         * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
26         * UIProcess/Network/NetworkProcessProxy.cpp:
27         (WebKit::NetworkProcessProxy::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
28         * UIProcess/Network/NetworkProcessProxy.h:
29         * UIProcess/Network/NetworkProcessProxy.messages.in:
30         * UIProcess/WebCookieManagerProxy.cpp:
31         (WebKit::WebCookieManagerProxy::setCookieStoragePartitioningEnabled):
32             To allow TestRunner to configure cookie partitioning.
33         * UIProcess/WebCookieManagerProxy.h:
34         * UIProcess/WebResourceLoadStatisticsManager.cpp:
35         (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler):
36             To allow TestRunner to set a domain for which
37             partitioning should be applied.
38         * UIProcess/WebResourceLoadStatisticsManager.h:
39         * UIProcess/WebResourceLoadStatisticsStore.cpp:
40         (WebKit::WebResourceLoadStatisticsStore::classifyResource):
41             Now tells the network process as soon as a domain
42             has been classified as prevalent.
43         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
44             Overloaded function to allow injection of handlers for communication with the
45             network process.
46         * UIProcess/WebResourceLoadStatisticsStore.h:
47         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
48         (WebKit::WebsiteDataStore::shouldPartitionCookiesForTopPrivatelyOwnedDomains):
49         (WebKit::WebsiteDataStore::registerSharedResourceLoadObserver):
50             Now sets two callback handlers for communication with the network process.
51         * UIProcess/WebsiteData/WebsiteDataStore.h:
52
53 2017-03-08  Michael Catanzaro  <mcatanzaro@igalia.com>
54
55         Fix -Wattributes warning spam
56         https://bugs.webkit.org/show_bug.cgi?id=169243
57
58         Reviewed by Alexey Proskuryakov.
59
60         * Shared/API/c/WKDeclarationSpecifiers.h: Add WK_UNAVAILABLE macro.
61         * UIProcess/API/C/WKPageGroup.h: Use it.
62
63 2017-03-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
64
65         Enable async image decoding for large images
66         https://bugs.webkit.org/show_bug.cgi?id=165039
67
68         Reviewed by Simon Fraser.
69
70         Add WK2 preferences for setting/getting LargeImageAsyncDecoding and
71         AnimatedImageAsyncDecoding.
72         
73         * UIProcess/API/C/WKPreferences.cpp:
74         (WKPreferencesSetLargeImageAsyncDecodingEnabled):
75         (WKPreferencesGetLargeImageAsyncDecodingEnabled):
76         (WKPreferencesSetAnimatedImageAsyncDecodingEnabled):
77         (WKPreferencesGetAnimatedImageAsyncDecodingEnabled):
78         * UIProcess/API/C/WKPreferencesRefPrivate.h:
79
80 2017-03-08  Wenson Hsieh  <wenson_hsieh@apple.com>
81
82         Add TextIndicator support for providing a snapshot excluding selected content
83         https://bugs.webkit.org/show_bug.cgi?id=169309
84         <rdar://problem/30883525>
85
86         Reviewed by Tim Horton.
87
88         Serialize the snapshot excluding the selection and the snapshot's bounds when sending TextIndicatorData over
89         IPC to the UI process.
90
91         * Shared/WebCoreArgumentCoders.cpp:
92         (IPC::ArgumentCoder<TextIndicatorData>::encode):
93         (IPC::ArgumentCoder<TextIndicatorData>::decode):
94
95 2017-03-08  Brent Fulgham  <bfulgham@apple.com>
96
97         REGRESSION(r213564): Netflix does not play content
98         https://bugs.webkit.org/show_bug.cgi?id=169391
99         <rdar://problem/30930190>
100
101         Reviewed by Alex Christensen.
102
103         Add the missing IOKit properties identified during testing on Netflix.
104
105         * WebProcess/com.apple.WebProcess.sb.in:
106
107 2017-03-08  Anders Carlsson  <andersca@apple.com>
108
109         Clean up WebPaymentCoordinatorProxy
110         https://bugs.webkit.org/show_bug.cgi?id=169393
111         Part of rdar://problem/28880714.
112
113         Reviewed by Beth Dakin.
114
115         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
116         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]):
117         Move this to where it belongs.
118
119         (WebKit::toPKPaymentSummaryItems):
120         Add a new helper function.
121
122         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
123         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
124         Use the new helper function.
125
126 2017-03-08  Brent Fulgham  <bfulgham@apple.com>
127
128         [Mac][WK2] Whitelist a local cache needed by CFNetwork
129         https://bugs.webkit.org/show_bug.cgi?id=169388
130         <rdar://problem/30224000>
131
132         Reviewed by Alex Christensen.
133
134         Whitelist access to a local cache needed by CFNetwork.
135
136         * WebProcess/com.apple.WebProcess.sb.in:
137
138 2017-03-08  Anders Carlsson  <andersca@apple.com>
139
140         Simplify the PaymentCoordinator interface
141         https://bugs.webkit.org/show_bug.cgi?id=169382
142         Part of rdar://problem/28880714.
143
144         Reviewed by Tim Horton.
145
146         Send the new structs over the wire to the UI process and update the various proxy object to take them instead of
147         multiple parameters.
148
149         * Scripts/webkit/messages.py:
150         (headers_for_type):
151         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
152         (IPC::ArgumentCoder<WebCore::PaymentAuthorizationResult>::encode):
153         (IPC::ArgumentCoder<WebCore::PaymentAuthorizationResult>::decode):
154         (IPC::ArgumentCoder<WebCore::PaymentError>::encode):
155         (IPC::ArgumentCoder<WebCore::PaymentError>::decode):
156         (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::encode):
157         (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):
158         (IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::encode):
159         (IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::decode):
160         (IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::encode):
161         (IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::decode):
162         * Shared/WebCoreArgumentCoders.h:
163         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
164         (WebKit::WebPaymentCoordinatorProxy::completeShippingMethodSelection):
165         (WebKit::WebPaymentCoordinatorProxy::completeShippingContactSelection):
166         (WebKit::WebPaymentCoordinatorProxy::completePaymentMethodSelection):
167         (WebKit::WebPaymentCoordinatorProxy::completePaymentSession):
168         (WebKit::isValidEnum): Deleted.
169         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
170         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
171         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
172         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
173         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
174         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
175         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
176         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
177         (WebKit::WebPaymentCoordinator::completeShippingMethodSelection):
178         (WebKit::WebPaymentCoordinator::completeShippingContactSelection):
179         (WebKit::WebPaymentCoordinator::completePaymentMethodSelection):
180         (WebKit::WebPaymentCoordinator::completePaymentSession):
181         * WebProcess/ApplePay/WebPaymentCoordinator.h:
182
183 2017-03-08  Brent Fulgham  <bfulgham@apple.com>
184
185         Remove the trace command from the sandbox profile.
186
187         * WebProcess/com.apple.WebProcess.sb.in: Unreviewed.
188
189 2017-03-08  Brent Fulgham  <bfulgham@apple.com>
190
191         REGRESSION(r212904): [WK2][Mac] Revise sandbox to support AES3
192         https://bugs.webkit.org/show_bug.cgi?id=169361
193         <rdar://problem/30927476>
194
195         Unreviewed sandbox revert. Avoid web compatibility issue by
196         restoring access to AES3 Plugin path.
197
198         Tests: Existing media tests, on older Mac hardware.
199
200         * WebProcess/com.apple.WebProcess.sb.in:
201
202 2017-03-08  Simon Fraser  <simon.fraser@apple.com>
203
204         Add support for history.scrollRestoration
205         https://bugs.webkit.org/show_bug.cgi?id=147782
206         rdar://problem/22614568
207
208         Reviewed by Sam Weinig.
209         
210         Need to send shouldRestoreScrollPosition to the UI process in SessionState,
211         WKWebView now stores _unobscuredCenterToRestore and _scrollOffsetToRestore as
212         std::optionals, and they will be nullopt if scroll restoration should not happen.
213
214         ViewGestureControllerIOS also needs knowledge of whether scroll restoration will
215         happen, and compares UI-process scroll position vs. the position at snapshot time
216         to know if the snapshot should be shown (this prevents showing a misleading snapshot
217         when swiping back on a navigation where scroll restoration is disabled).
218
219         * Shared/SessionState.cpp:
220         (WebKit::FrameState::encode):
221         (WebKit::FrameState::decode):
222         * Shared/SessionState.h:
223         * Shared/WebBackForwardListItem.h:
224         (WebKit::WebBackForwardListItem::pageState):
225         * UIProcess/API/Cocoa/WKWebView.mm:
226         (-[WKWebView _processDidExit]):
227         (-[WKWebView _didCommitLayerTree:]):
228         (-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]):
229         (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
230         * UIProcess/API/Cocoa/WKWebViewInternal.h:
231         * UIProcess/API/gtk/PageClientImpl.cpp:
232         (WebKit::PageClientImpl::viewScrollPosition):
233         * UIProcess/API/gtk/PageClientImpl.h:
234         * UIProcess/PageClient.h:
235         * UIProcess/WebPageProxy.cpp:
236         (WebKit::WebPageProxy::viewScrollPosition):
237         * UIProcess/WebPageProxy.h:
238         * UIProcess/WebPageProxy.messages.in:
239         * UIProcess/ios/PageClientImplIOS.h:
240         * UIProcess/ios/PageClientImplIOS.mm:
241         (WebKit::PageClientImpl::viewScrollPosition):
242         (WebKit::PageClientImpl::restorePageState):
243         (WebKit::PageClientImpl::restorePageCenterAndScale):
244         * UIProcess/ios/ViewGestureControllerIOS.mm:
245         (WebKit::ViewGestureController::beginSwipeGesture):
246         * UIProcess/ios/WebPageProxyIOS.mm:
247         (WebKit::WebPageProxy::restorePageState):
248         (WebKit::WebPageProxy::restorePageCenterAndScale):
249         * UIProcess/mac/PageClientImpl.h:
250         * UIProcess/mac/PageClientImpl.mm:
251         (WebKit::PageClientImpl::viewScrollPosition):
252         * UIProcess/mac/ViewSnapshotStore.h:
253         (WebKit::ViewSnapshot::setViewScrollPosition):
254         (WebKit::ViewSnapshot::viewScrollPosition):
255         * UIProcess/mac/ViewSnapshotStore.mm:
256         (WebKit::ViewSnapshotStore::recordSnapshot):
257         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
258         (WebKit::toFrameState):
259         (WebKit::applyFrameState):
260         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
261         (WebKit::WebFrameLoaderClient::restoreViewState):
262         * WebProcess/WebPage/ios/WebPageIOS.mm:
263         (WebKit::WebPage::restorePageState):
264
265 2017-03-08  Matt Rajca  <mrajca@apple.com>
266
267         Add support for updating autoplay policies after a page has been loaded.
268         https://bugs.webkit.org/show_bug.cgi?id=169360
269
270         Reviewed by Alex Christensen.
271
272         * WebProcess/WebPage/WebPage.cpp:
273         (WebKit::WebPage::updateWebsitePolicies):
274
275 2017-03-08  Tim Horton  <timothy_horton@apple.com>
276
277         Switching focus from a UITextField to an editable WKWebView causes the keyboard to dance
278         https://bugs.webkit.org/show_bug.cgi?id=168932
279         <rdar://problem/30193996>
280
281         Reviewed by Beth Dakin.
282
283         When WKWebView first becomes first responder from a tap, we don't have
284         enough information to immediately respond accurately to various questions
285         from UIKit, because we haven't had time to ask the Web Content process
286         what is under the touch. Defer updating input views until we get a
287         response or lose first responder status, so that the keyboard doesn't
288         start transitioning to its new state until we know what that is.
289
290         There is currently no test because TestWebKitAPI has no UIApplication,
291         and thus cannot generate mock events.
292
293         * Platform/spi/ios/UIKitSPI.h:
294         * WebKit2.xcodeproj/project.pbxproj:
295         * UIProcess/ios/InputViewUpdateDeferrer.h: Added.
296         * UIProcess/ios/InputViewUpdateDeferrer.mm: Added.
297         Add an RAII object that defers input view updates while alive.
298
299         * UIProcess/ios/WKContentView.mm:
300         * UIProcess/ios/WKContentViewInteraction.h:
301         * UIProcess/ios/WKContentViewInteraction.mm:
302         (-[WKContentView cleanupInteraction]):
303         (-[WKContentView _commitPotentialTapFailed]):
304         (-[WKContentView _didNotHandleTapAsClick:]):
305         (-[WKContentView _didCompleteSyntheticClick]):
306         (-[WKContentView _singleTapCommited:]):
307         (-[WKContentView _attemptClickAtLocation:]):
308         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
309         Create a InputViewUpdateDeferrer just before we become first responder
310         from a tap, and destroy it when we get a response (of any kind) or lose
311         first-responder status (or interaction is torn down).
312
313         * UIProcess/PageClient.h:
314         * UIProcess/WebPageProxy.h:
315         * UIProcess/WebPageProxy.messages.in:
316         * UIProcess/ios/PageClientImplIOS.h:
317         * UIProcess/ios/PageClientImplIOS.mm:
318         (WebKit::PageClientImpl::didCompleteSyntheticClick):
319         * UIProcess/ios/WebPageProxyIOS.mm:
320         (WebKit::WebPageProxy::didCompleteSyntheticClick):
321         * WebProcess/WebPage/ios/WebPageIOS.mm:
322         (WebKit::WebPage::completeSyntheticClick):
323         Plumb an indication that the synthetic click completed, regardless of
324         how it was handled.
325
326 2017-03-08  Zan Dobersek  <zdobersek@igalia.com>
327
328         [WK2] Guard GLib-specific code in Module, Connection files with USE(GLIB)
329         https://bugs.webkit.org/show_bug.cgi?id=169349
330
331         Reviewed by Carlos Garcia Campos.
332
333         Use the USE(GLIB) build guards for GLib-specific code in Connection and
334         Module header files and the ConnectionUnix implementation file, instead
335         of the PLATFORM(GTK) guard.
336
337         * Platform/IPC/Connection.h:
338         * Platform/IPC/unix/ConnectionUnix.cpp:
339         (IPC::Connection::platformInitialize):
340         (IPC::Connection::platformInvalidate):
341         (IPC::Connection::open):
342         (IPC::Connection::sendOutputMessage):
343         * Platform/Module.h:
344
345 2017-03-08  Tim Horton  <timothy_horton@apple.com>
346
347         Remove unused WebPageIOS::zoomToRect and plumbing
348         https://bugs.webkit.org/show_bug.cgi?id=169344
349
350         Reviewed by Alex Christensen.
351
352         * UIProcess/PageClient.h:
353         * UIProcess/WebPageProxy.h:
354         * UIProcess/WebPageProxy.messages.in:
355         * UIProcess/ios/PageClientImplIOS.h:
356         * UIProcess/ios/PageClientImplIOS.mm:
357         (WebKit::PageClientImpl::zoomToRect): Deleted.
358         * WebProcess/WebPage/WebPage.h:
359         * WebProcess/WebPage/ios/WebPageIOS.mm:
360         (WebKit::WebPage::zoomToRect): Deleted.
361
362 2017-03-08  Brad Wright  <bwright2@apple.com>
363
364         UIViewController with WKWebView presented modally causes the presented UIViewController to be dismissed.
365         https://bugs.webkit.org/show_bug.cgi?id=165225
366         
367         Reviewed by Wenson Hsieh.
368
369         The problem happens on an iPhone with a WKWebView inside a view controller presented modally. If the user selects an HTML file input 
370         tag button, a UIDocumentMenuViewController will appear. Anything the user does next causes the entire modal view controller to get dismissed.
371
372         To fix this problem, I prevent the UIDocumentMenuViewController from being dismissed by not saving a pointer to it. The UIDocumentMenuViewController 
373         always goes away by itself on any user interaction. Trying to dismiss the UIDocumentMenuViewController when it is already dismissed causes the modal view controller
374         to be dismissed.
375
376         * UIProcess/ios/forms/WKFileUploadPanel.mm:
377         (-[WKFileUploadPanel _cancel]):
378         (-[WKFileUploadPanel dismiss]):
379         (-[WKFileUploadPanel _showDocumentPickerMenu]):
380         (-[WKFileUploadPanel _presentMenuOptionForCurrentInterfaceIdiom:]):
381         (-[WKFileUploadPanel _presentForCurrentInterfaceIdiom:]): Deleted.
382
383 2017-03-08  Alexey Proskuryakov  <ap@apple.com>
384
385         WebKit should not export dyld install name hints on watchOS and tvOS
386         https://bugs.webkit.org/show_bug.cgi?id=169342
387
388         Reviewed by Dan Bernstein.
389
390         * Shared/API/Cocoa/WebKit.m:
391
392 2017-03-07  Simon Fraser  <simon.fraser@apple.com>
393
394         Have fixedPositionCreatesStackingContext be on by default everywhere
395         https://bugs.webkit.org/show_bug.cgi?id=169334
396
397         Reviewed by Zalan Bujtas.
398
399         It makes no sense to have web-exposed CSS functionality be different based on setting,
400         and other browser are now aligned with having position:fixed create stacking context.
401
402         So remove the fixedPositionCreatesStackingContext setting and have StyleResolver::adjustRenderStyle()
403         always force stacking context for position:fixed.
404
405         * WebProcess/WebPage/WebPage.cpp:
406         (WebKit::WebPage::setUseFixedLayout):
407         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
408         (WebKit::RemoteLayerTreeDrawingArea::updatePreferences):
409         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
410         (WebKit::TiledCoreAnimationDrawingArea::updatePreferences):
411
412 2017-03-07  Brent Fulgham  <bfulgham@apple.com>
413
414         [Mac][WK2] Whitelist iokit-get-properties
415         https://bugs.webkit.org/show_bug.cgi?id=169331
416         <rdar://problem/16363632>
417
418         Reviewed by Alex Christensen.
419
420         Block access to all IOKit properties by default. Turn on only those properties
421         that are actually needed by our engine.
422
423         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
424         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
425         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
426         * WebProcess/com.apple.WebProcess.sb.in:
427
428 2017-03-07  Simon Fraser  <simon.fraser@apple.com>
429
430         Enable SubpixelAntialiasedLayerTextEnabled by default on some versions of macOS
431         https://bugs.webkit.org/show_bug.cgi?id=169329
432
433         Reviewed by Tim Horton.
434
435         If the macOS version is > 101300, enable subpixelAntialiasedLayerTextEnabled.
436
437         * Shared/WebPreferencesDefinitions.h:
438
439 2017-03-07  Dean Jackson  <dino@apple.com>
440
441         Some platforms won't be able to create a GPUDevice
442         https://bugs.webkit.org/show_bug.cgi?id=169314
443         <rdar://problems/30907521>
444
445         Reviewed by Jon Lee.
446
447         Disable WEB_GPU on the iOS Simulator.
448
449         * Configurations/FeatureDefines.xcconfig:
450
451 2017-03-07  Brent Fulgham  <bfulgham@apple.com>
452
453         [Mac][iOS][WK2] Whitelist sysctl-read
454         https://bugs.webkit.org/show_bug.cgi?id=169306
455         <rdar://problem/16371458>
456
457         Reviewed by Alex Christensen.
458
459         Limit access to the 'sysctl' call to read-only cases of the very small
460         set of operations we actually use.
461
462         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
463         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
464         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
465         * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb:
466         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
467         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
468         * WebProcess/com.apple.WebProcess.sb.in:
469
470 2017-03-07  Alex Christensen  <achristensen@webkit.org>
471
472         [Content Extensions] Rename "Domain" to "Condition" where appropriate
473         https://bugs.webkit.org/show_bug.cgi?id=169297
474
475         Reviewed by Brady Eidson.
476
477         * Shared/WebCompiledContentExtension.cpp:
478         (WebKit::WebCompiledContentExtension::filtersWithoutConditionsBytecode):
479         (WebKit::WebCompiledContentExtension::filtersWithoutConditionsBytecodeLength):
480         (WebKit::WebCompiledContentExtension::filtersWithConditionsBytecode):
481         (WebKit::WebCompiledContentExtension::filtersWithConditionsBytecodeLength):
482         (WebKit::WebCompiledContentExtension::conditionedFiltersBytecode):
483         (WebKit::WebCompiledContentExtension::conditionedFiltersBytecodeLength):
484         (WebKit::WebCompiledContentExtension::filtersWithoutDomainsBytecode): Deleted.
485         (WebKit::WebCompiledContentExtension::filtersWithoutDomainsBytecodeLength): Deleted.
486         (WebKit::WebCompiledContentExtension::filtersWithDomainsBytecode): Deleted.
487         (WebKit::WebCompiledContentExtension::filtersWithDomainsBytecodeLength): Deleted.
488         (WebKit::WebCompiledContentExtension::domainFiltersBytecode): Deleted.
489         (WebKit::WebCompiledContentExtension::domainFiltersBytecodeLength): Deleted.
490         * Shared/WebCompiledContentExtension.h:
491         * Shared/WebCompiledContentExtensionData.cpp:
492         (WebKit::WebCompiledContentExtensionData::encode):
493         (WebKit::WebCompiledContentExtensionData::decode):
494         * Shared/WebCompiledContentExtensionData.h:
495         (WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData):
496         * UIProcess/API/APIUserContentExtensionStore.cpp:
497         (API::ContentExtensionMetaData::fileSize):
498         (API::encodeContentExtensionMetaData):
499         (API::decodeContentExtensionMetaData):
500         (API::compiledToFile):
501         (API::createExtension):
502         (API::UserContentExtensionStore::lookupContentExtension):
503         (API::UserContentExtensionStore::compileContentExtension):
504         (API::UserContentExtensionStore::removeContentExtension):
505         * UIProcess/API/APIUserContentExtensionStore.h:
506
507 2017-03-07  Brent Fulgham  <bfulgham@apple.com>
508
509         [Mac][WK2] Expand sandbox to support access to audio component registrar
510         https://bugs.webkit.org/show_bug.cgi?id=169283
511         <rdar://problem/30793512>
512
513         Reviewed by Alexey Proskuryakov.
514
515         * WebProcess/com.apple.WebProcess.sb.in:
516
517 2017-03-07  Chris Dumez  <cdumez@apple.com>
518
519         Port DOMTimer from std::chrono::milliseconds to WTF::Seconds type
520         https://bugs.webkit.org/show_bug.cgi?id=169236
521
522         Reviewed by Simon Fraser.
523
524         * UIProcess/WebProcessPool.cpp:
525         (WebKit::WebProcessPool::updateHiddenPageThrottlingAutoIncreaseLimit):
526         * WebProcess/WebPage/WebPage.h:
527         (WebKit::WebPage::setHiddenPageDOMTimerThrottlingIncreaseLimit):
528         * WebProcess/WebProcess.cpp:
529         (WebKit::WebProcess::setHiddenPageDOMTimerThrottlingIncreaseLimit):
530         * WebProcess/WebProcess.h:
531         * WebProcess/WebProcess.messages.in:
532
533 2017-03-06  Aakash Jain  <aakash_jain@apple.com>
534
535         Enable SUPPORTS_TEXT_BASED_API in WebKit2 for iOS
536         https://bugs.webkit.org/show_bug.cgi?id=169233
537
538         Reviewed by Alexey Proskuryakov.
539
540         * Configurations/Base.xcconfig: Enable SUPPORTS_TEXT_BASED_API.
541         * Configurations/WebKit.xcconfig: Pass information to TAPI about reexporting WebKitLegacy and few extra headers.
542         * WebKit2.xcodeproj/project.pbxproj: Run scripts which are run for installhdrs phase for installapi phase as well.
543
544 2017-03-06  Dan Bernstein  <mitz@apple.com>
545
546         [Cocoa] Expose API::InjectedBundle::EditorClient::didChange via the Objective-C bundle SPI
547         https://bugs.webkit.org/show_bug.cgi?id=169223
548
549         Reviewed by Tim Horton.
550
551         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h: Declared new
552           delegate method -_webProcessPlugInBrowserContextControllerDidChangeByEditing:.
553         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
554         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): Added an override
555           of API::InjectedBundle::EditorClient::didChange that calls the new delegate method.
556
557 2017-03-06  Michael Saboff  <msaboff@apple.com>
558
559         Unreviewed build fix after r213492.
560
561         * Configurations/Base.xcconfig:
562
563 2017-03-06  Aakash Jain  <aakash_jain@apple.com>
564
565         Add WK_CLASS_AVAILABLE to _WKLinkIconParameters and _WKWebViewPrintFormatter
566         https://bugs.webkit.org/show_bug.cgi?id=169225
567
568         Reviewed by Tim Horton.
569
570         * UIProcess/API/Cocoa/_WKLinkIconParameters.h:
571         * UIProcess/_WKWebViewPrintFormatter.h:
572
573 2017-03-06  Michael Saboff  <msaboff@apple.com>
574
575         Unreviewed build fix after r213483.
576
577         * Configurations/Base.xcconfig:
578
579 2017-03-06  Brent Fulgham  <bfulgham@apple.com>
580
581         [Mac][WK2] Support new CoreMedia routing features
582         https://bugs.webkit.org/show_bug.cgi?id=169241
583         <rdar://problem/30077969>
584
585         Reviewed by Alexey Proskuryakov.
586
587         * WebProcess/com.apple.WebProcess.sb.in:
588
589 2017-03-06  Michael Saboff  <msaboff@apple.com>
590
591         Take advantage of fast permissions switching of JIT memory for devices that support it
592         https://bugs.webkit.org/show_bug.cgi?id=169155
593
594         Reviewed by Saam Barati.
595
596         Updated the Xcode config files to match what is in the JavaScriptCore ones.
597
598         * Configurations/FeatureDefines.xcconfig:
599
600 2017-03-06  Aakash Jain  <aakash_jain@apple.com>
601
602         Make WKMenuItemIdentifiersPrivate.h private header
603         https://bugs.webkit.org/show_bug.cgi?id=168981
604
605         Reviewed by Tim Horton.
606
607         * WebKit2.xcodeproj/project.pbxproj: Made WKMenuItemIdentifiersPrivate.h private.
608
609 2017-03-06  Alexey Proskuryakov  <ap@apple.com>
610
611         Replace -sub_umbrella linker flag with a build setting
612         https://bugs.webkit.org/show_bug.cgi?id=169146
613
614         Reviewed by Tim Horton.
615
616         * Configurations/WebKit.xcconfig:
617
618 2017-03-03  Matt Rajca  <mrajca@apple.com>
619
620         Media: notify clients when the user never plays a media element that was prevented from auto-playing
621         https://bugs.webkit.org/show_bug.cgi?id=169150
622
623         Reviewed by Alex Christensen.
624
625         * UIProcess/API/C/WKPageUIClient.h:
626
627 2017-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
628
629         Expand font-weight and font-stretch to take any number
630         https://bugs.webkit.org/show_bug.cgi?id=168889
631
632         Reviewed by Simon Fraser.
633
634         Migrate off old enum types.
635
636         * WebProcess/WebPage/WebPage.cpp:
637         (WebKit::WebPage::editorState):
638
639 2017-03-06  Andreas Kling  <akling@apple.com>
640
641         [iOS] Report domains crashing under memory pressure via enhanced privacy logging.
642         <https://webkit.org/b/169133>
643         <rdar://problem/29964017>
644
645         Reviewed by Antti Koivisto.
646
647         Notify the UI process when the memory pressure status changes.
648         If a web process crashes while under memory pressure, log the domain of the last open page
649         using enhanced privacy logging.
650
651         * UIProcess/WebPageProxy.cpp:
652         (WebKit::WebPageProxy::processDidCrash):
653         * UIProcess/WebProcessProxy.h:
654         (WebKit::WebProcessProxy::memoryPressureStatusChanged):
655         (WebKit::WebProcessProxy::isUnderMemoryPressure):
656         * UIProcess/WebProcessProxy.messages.in:
657         * WebProcess/WebProcess.cpp:
658         (WebKit::WebProcess::initializeWebProcess):
659
660 2017-03-05  Brady Eidson  <beidson@apple.com>
661
662         Remove new files accidentally added in r213441
663
664         Unreviewed.
665
666         * UIProcess/WebLoadingProviderProxy.cpp: Removed.
667         * UIProcess/WebLoadingProviderProxy.h: Removed.
668         * UIProcess/WebLoadingProviderProxy.messages.in: Removed.
669
670 2017-03-05  Brady Eidson  <beidson@apple.com>
671
672         Rename CustomProtocolFoo to LegacyCustomProtocolFoo.
673         https://bugs.webkit.org/show_bug.cgi?id=169188
674
675         Reviewed by Andy Estes.
676
677         * CMakeLists.txt:
678         * DerivedSources.make:
679
680         * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm: Renamed from Source/WebKit2/NetworkProcess/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm.
681         (+[WKCustomProtocol canInitWithRequest:]):
682         (+[WKCustomProtocol canonicalRequestForRequest:]):
683         (+[WKCustomProtocol requestIsCacheEquivalent:toRequest:]):
684         (-[WKCustomProtocol initWithRequest:cachedResponse:client:]):
685         (-[WKCustomProtocol initializationRunLoop]):
686         (-[WKCustomProtocol startLoading]):
687         (-[WKCustomProtocol stopLoading]):
688         (WebKit::LegacyCustomProtocolManager::registerProtocolClass):
689         (WebKit::LegacyCustomProtocolManager::registerScheme):
690         (WebKit::LegacyCustomProtocolManager::unregisterScheme):
691         (WebKit::LegacyCustomProtocolManager::supportsScheme):
692         (WebKit::dispatchOnInitializationRunLoop):
693         (WebKit::LegacyCustomProtocolManager::didFailWithError):
694         (WebKit::LegacyCustomProtocolManager::didLoadData):
695         (WebKit::LegacyCustomProtocolManager::didReceiveResponse):
696         (WebKit::LegacyCustomProtocolManager::didFinishLoading):
697         (WebKit::LegacyCustomProtocolManager::wasRedirectedToRequest):
698         (WebKit::LegacyCustomProtocolManager::protocolForID):
699
700         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.cpp: Renamed from Source/WebKit2/NetworkProcess/CustomProtocols/CustomProtocolManager.cpp.
701         (WebKit::generateCustomProtocolID):
702         (WebKit::LegacyCustomProtocolManager::supplementName):
703         (WebKit::LegacyCustomProtocolManager::LegacyCustomProtocolManager):
704         (WebKit::LegacyCustomProtocolManager::initialize):
705         (WebKit::LegacyCustomProtocolManager::addCustomProtocol):
706         (WebKit::LegacyCustomProtocolManager::removeCustomProtocol):
707         (WebKit::LegacyCustomProtocolManager::startLoading):
708         (WebKit::LegacyCustomProtocolManager::stopLoading):
709         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h: Renamed from Source/WebKit2/NetworkProcess/CustomProtocols/CustomProtocolManager.h.
710         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.messages.in: Renamed from Source/WebKit2/NetworkProcess/CustomProtocols/CustomProtocolManager.messages.in.
711
712         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp: Renamed from Source/WebKit2/NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp.
713         (WebKit::CustomProtocolManager::WebSoupRequestAsyncData::WebSoupRequestAsyncData):
714         (WebKit::CustomProtocolManager::WebSoupRequestAsyncData::~WebSoupRequestAsyncData):
715         (WebKit::CustomProtocolManager::registerProtocolClass):
716         (WebKit::CustomProtocolManager::registerScheme):
717         (WebKit::CustomProtocolManager::unregisterScheme):
718         (WebKit::CustomProtocolManager::supportsScheme):
719         (WebKit::CustomProtocolManager::didFailWithError):
720         (WebKit::CustomProtocolManager::didLoadData):
721         (WebKit::CustomProtocolManager::didReceiveResponse):
722         (WebKit::CustomProtocolManager::didFinishLoading):
723         (WebKit::CustomProtocolManager::wasRedirectedToRequest):
724
725         * NetworkProcess/NetworkProcess.cpp:
726         (WebKit::NetworkProcess::NetworkProcess):
727
728         * NetworkProcess/NetworkSession.cpp:
729         (WebKit::NetworkSession::create):
730         * NetworkProcess/NetworkSession.h:
731
732         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
733         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
734         (WebKit::globalLegacyCustomProtocolManager):
735         (WebKit::NetworkSessionCocoa::setLegacyCustomProtocolManager):
736         (WebKit::NetworkSessionCocoa::create):
737         (WebKit::NetworkSessionCocoa::defaultSession):
738         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
739         (WebKit::globalCustomProtocolManager): Deleted.
740         (WebKit::NetworkSessionCocoa::setCustomProtocolManager): Deleted.
741
742         * NetworkProcess/mac/RemoteNetworkingContext.mm:
743         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
744
745         * UIProcess/API/APICustomProtocolManagerClient.h:
746         (API::LegacyCustomProtocolManagerClient::~LegacyCustomProtocolManagerClient):
747         (API::LegacyCustomProtocolManagerClient::startLoading):
748         (API::LegacyCustomProtocolManagerClient::stopLoading):
749         (API::LegacyCustomProtocolManagerClient::invalidate):
750         (API::CustomProtocolManagerClient::~CustomProtocolManagerClient): Deleted.
751         (API::CustomProtocolManagerClient::startLoading): Deleted.
752         (API::CustomProtocolManagerClient::stopLoading): Deleted.
753         (API::CustomProtocolManagerClient::invalidate): Deleted.
754
755         * UIProcess/Cocoa/LegacyCustomProtocolManagerClient.h: Renamed from Source/WebKit2/UIProcess/Cocoa/CustomProtocolManagerClient.h.
756         * UIProcess/Cocoa/LegacyCustomProtocolManagerClient.mm: Renamed from Source/WebKit2/UIProcess/Cocoa/CustomProtocolManagerClient.mm.
757         (-[WKCustomProtocolLoader initWithLegacyCustomProtocolManagerProxy:customProtocolID:request:]):
758         (-[WKCustomProtocolLoader dealloc]):
759         (-[WKCustomProtocolLoader customProtocolManagerProxyDestroyed]):
760         (-[WKCustomProtocolLoader connection:didFailWithError:]):
761         (-[WKCustomProtocolLoader connection:willCacheResponse:]):
762         (-[WKCustomProtocolLoader connection:didReceiveResponse:]):
763         (-[WKCustomProtocolLoader connection:didReceiveData:]):
764         (-[WKCustomProtocolLoader connection:willSendRequest:redirectResponse:]):
765         (-[WKCustomProtocolLoader connectionDidFinishLoading:]):
766         (WebKit::LegacyCustomProtocolManagerClient::startLoading):
767         (WebKit::LegacyCustomProtocolManagerClient::stopLoading):
768         (WebKit::LegacyCustomProtocolManagerClient::invalidate):
769
770         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
771         (WebKit::WebProcessPool::platformInitialize):
772
773         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.cpp: Removed.
774         * UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.cpp: Added.
775         (WebKit::LegacyCustomProtocolManagerProxy::LegacyCustomProtocolManagerProxy):
776         (WebKit::LegacyCustomProtocolManagerProxy::~LegacyCustomProtocolManagerProxy):
777         (WebKit::LegacyCustomProtocolManagerProxy::startLoading):
778         (WebKit::LegacyCustomProtocolManagerProxy::stopLoading):
779         (WebKit::LegacyCustomProtocolManagerProxy::processDidClose):
780         (WebKit::LegacyCustomProtocolManagerProxy::wasRedirectedToRequest):
781         (WebKit::LegacyCustomProtocolManagerProxy::didReceiveResponse):
782         (WebKit::LegacyCustomProtocolManagerProxy::didLoadData):
783         (WebKit::LegacyCustomProtocolManagerProxy::didFailWithError):
784         (WebKit::LegacyCustomProtocolManagerProxy::didFinishLoading):
785         * UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.h: Renamed from Source/WebKit2/UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h.
786         * UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.messages.in: Renamed from Source/WebKit2/UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.messages.in.
787
788         * UIProcess/Network/NetworkProcessProxy.cpp:
789         * UIProcess/Network/NetworkProcessProxy.h:
790
791         * UIProcess/WebProcessPool.cpp:
792         (WebKit::WebProcessPool::WebProcessPool):
793         (WebKit::WebProcessPool::setLegacyCustomProtocolManagerClient):
794         (WebKit::WebProcessPool::registerSchemeForCustomProtocol):
795         (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol):
796         (WebKit::WebProcessPool::setCustomProtocolManagerClient): Deleted.
797         * UIProcess/WebProcessPool.h:
798
799         * WebKit2.xcodeproj/project.pbxproj:
800
801         * WebProcess/cocoa/WebProcessCocoa.mm:
802
803 2017-03-04  Eric Carlson  <eric.carlson@apple.com>
804
805         [iOS] The web process should inherit application state from UI process
806         https://bugs.webkit.org/show_bug.cgi?id=169156
807         <rdar://problem/30845473>
808
809         Reviewed by Alexey Proskuryakov.
810
811         * Platform/spi/ios/CelestialSPI.h: Added.
812
813         * WebKit2.xcodeproj/project.pbxproj: Include CelestialSPI.h.
814
815         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist: Add entitlement.
816
817         * WebProcess/WebPage/ios/WebPageIOS.mm:
818         (WebKit::WebPage::platformInitialize): Set up PID proxying.
819
820 2017-03-04  Aakash Jain  <aakash_jain@apple.com>
821
822         Add symbols required by TAPI from Shared/API/Cocoa/WebKit.m in a header file
823         https://bugs.webkit.org/show_bug.cgi?id=169162
824
825         Reviewed by Alexey Proskuryakov.
826
827         The symbols from binary and headers should match precisely, otherwise TAPI would
828         complain. There are few symbols which are not actually needed in header file, but
829         we still need to add them in a header file to make TAPI happy.
830
831         * Platform/ExtraPublicSymbolsForTAPI.h: Added.
832         * WebKit2.xcodeproj/project.pbxproj: Added ExtraPublicSymbolsForTAPI.h
833
834 2017-03-04  Aakash Jain  <aakash_jain@apple.com>
835
836         Add symbols required by TAPI in a header file
837         https://bugs.webkit.org/show_bug.cgi?id=169113
838         <rdar://problem/30772033>
839
840         Reviewed by Alexey Proskuryakov.
841
842         The symbols from binary and headers should match precisely, otherwise TAPI would
843         complain. There are few symbols which are not actually needed in header file, but
844         we still need to add them in a header file to make TAPI happy.
845
846         * Platform/ExtraPrivateSymbolsForTAPI.h: Added.
847         * WebKit2.xcodeproj/project.pbxproj: Added Platform/ExtraPrivateSymbolsForTAPI.h
848
849 2017-03-04  Joseph Pecoraro  <pecoraro@apple.com>
850
851         Remove duplicate initialization guard in WebKit2 logging initialization
852         https://bugs.webkit.org/show_bug.cgi?id=169164
853
854         Reviewed by Dan Bernstein.
855
856         * Platform/Logging.cpp:
857         (WebKit::initializeLogChannelsIfNecessary):
858
859 2017-03-03  Youenn Fablet  <youenn@apple.com>
860
861         [WebRTC] Update libwebrtc source code
862         https://bugs.webkit.org/show_bug.cgi?id=168599
863
864         Reviewed by Alex Christensen.
865
866         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
867
868 2017-03-03  Dean Jackson  <dino@apple.com>
869
870         Add WebGPU compile flag and experimental feature flag
871         https://bugs.webkit.org/show_bug.cgi?id=169161
872         <rdar://problem/30846689>
873
874         Reviewed by Tim Horton.
875
876         Add ENABLE_WEBGPU, an experimental feature flag, a RuntimeEnabledFeature,
877         and an InternalSetting.
878
879         * Configurations/FeatureDefines.xcconfig:
880         * Shared/WebPreferencesDefinitions.h:
881         * WebProcess/InjectedBundle/InjectedBundle.cpp:
882         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
883         * WebProcess/WebPage/WebPage.cpp:
884         (WebKit::WebPage::updatePreferences):
885
886 2017-03-03  Dean Jackson  <dino@apple.com>
887
888         Move Input Events and Gamepad from experimental features into main preferences
889         https://bugs.webkit.org/show_bug.cgi?id=169157
890         <rdar://problems/30845587>
891
892         Reviewed by Myles C. Maxfield.
893
894         These are no longer experimental on trunk.
895
896         * Shared/WebPreferencesDefinitions.h:
897
898 2017-03-03  Brent Fulgham  <bfulgham@apple.com>
899
900         [MediaStream iOS] REGRESSION(r212883): Missing function definition breaks sandbox
901         https://bugs.webkit.org/show_bug.cgi?id=169148
902         <rdar://problem/30825728>
903
904         Reviewed by Alex Christensen.
905
906         The changes in r212883 added a call to 'shared-preferences-read', which is not defined
907         for iOS. In fact, it's not needed since 'user-preference-read' does everything we need on iOS.
908         Switch to the correct preference rule.
909
910         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Add missing function
911
912 2017-03-03  Aakash Jain  <aakash_jain@apple.com>
913
914         Move declaration of _WKSetCrashReportApplicationSpecificInformation to header file
915         https://bugs.webkit.org/show_bug.cgi?id=169043
916
917         Reviewed by Alex Christensen.
918
919         * WebKit2.xcodeproj/project.pbxproj: Added WebProcessCocoa.h
920         * WebProcess/cocoa/WebProcessCocoa.h: Added.
921         * WebProcess/cocoa/WebProcessCocoa.mm: Imported WebProcessCocoa.h
922         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm: Ditto.
923
924 2017-03-03  Carlos Garcia Campos  <cgarcia@igalia.com>
925
926         [GTK] Ensure WebKitWebView always have a user content manager
927         https://bugs.webkit.org/show_bug.cgi?id=169130
928
929         Reviewed by Michael Catanzaro.
930
931         User content manager is a construct only property, so if not set by the user the web view doesn't have any. We
932         can create a default one, like we do for settings, when user didn't provide one.
933
934         * UIProcess/API/gtk/WebKitWebView.cpp:
935         (webkitWebViewConstructed):
936
937 2017-03-02  Sam Weinig  <sam@webkit.org>
938
939         Rename htmlediting.h/cpp to Editing.h/cpp
940         https://bugs.webkit.org/show_bug.cgi?id=169103
941
942         Reviewed by Alex Christensen.
943
944         * WebProcess/WebPage/WebPage.cpp:
945         * WebProcess/WebPage/ios/WebPageIOS.mm:
946         * WebProcess/WebPage/mac/WebPageMac.mm:
947
948 2017-03-02  Joseph Pecoraro  <pecoraro@apple.com>
949
950         [Mac] Set the NSURLSessionTask priority to match the request's priority
951         https://bugs.webkit.org/show_bug.cgi?id=169115
952         <rdar://problem/28881392>
953
954         Reviewed by Alex Christensen.
955
956         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
957         (WebKit::toNSURLSessionTaskPriority):
958         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
959         Set the priority on the task based on the ResourceRequest's priority.
960         This is used for HTTP/2 request prioritization.
961
962 2017-03-02  Mark Lam  <mark.lam@apple.com>
963
964         Add WebKit2 hooks to notify the VM that the user has requested a debugger break.
965         https://bugs.webkit.org/show_bug.cgi?id=169089
966
967         Reviewed by Tim Horton and Joseph Pecoraro.
968
969         * CMakeLists.txt:
970         * DerivedSources.make:
971         * UIProcess/WebInspectorProxy.cpp:
972         (WebKit::WebInspectorProxy::connect):
973         * WebKit2.xcodeproj/project.pbxproj:
974         * WebProcess/WebPage/WebInspectorInterruptDispatcher.cpp: Added.
975         (WebKit::WebInspectorInterruptDispatcher::create):
976         (WebKit::WebInspectorInterruptDispatcher::WebInspectorInterruptDispatcher):
977         (WebKit::WebInspectorInterruptDispatcher::~WebInspectorInterruptDispatcher):
978         (WebKit::WebInspectorInterruptDispatcher::initializeConnection):
979         (WebKit::WebInspectorInterruptDispatcher::notifyNeedDebuggerBreak):
980         * WebProcess/WebPage/WebInspectorInterruptDispatcher.h: Added.
981         * WebProcess/WebPage/WebInspectorInterruptDispatcher.messages.in: Added.
982         * WebProcess/WebProcess.cpp:
983         (WebKit::WebProcess::WebProcess):
984         (WebKit::WebProcess::initializeConnection):
985         * WebProcess/WebProcess.h:
986
987 2017-03-02  Brady Eidson  <beidson@apple.com>
988
989         Update WKWebsiteDatastoreConfiguration SPI.
990         https://bugs.webkit.org/show_bug.cgi?id=169102
991
992         Reviewed by Tim Horton.
993         
994         Make these strings URLs, and throw exceptions if you try to use non-file URLs.
995
996         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
997         (-[WKWebsiteDataStore _initWithConfiguration:]):
998
999         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
1000         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
1001         (checkURLArgument):
1002         (-[_WKWebsiteDataStoreConfiguration _webStorageDirectory]):
1003         (-[_WKWebsiteDataStoreConfiguration _setWebStorageDirectory:]):
1004         (-[_WKWebsiteDataStoreConfiguration _indexedDBDatabaseDirectory]):
1005         (-[_WKWebsiteDataStoreConfiguration _setIndexedDBDatabaseDirectory:]):
1006         (-[_WKWebsiteDataStoreConfiguration _webSQLDatabaseDirectory]):
1007         (-[_WKWebsiteDataStoreConfiguration _setWebSQLDatabaseDirectory:]):
1008
1009 2017-03-02  Youenn Fablet  <youenn@apple.com>
1010
1011         Move part of NetworkRTCProvider::close implementation in NetworkRTCProvider destructor
1012         https://bugs.webkit.org/show_bug.cgi?id=169104
1013
1014         Reviewed by Alex Christensen.
1015
1016         Improving NetworkRTCProvider clean-up by moving some member field cleaning to the destructor.
1017         The remaining cleaning is still kept in NetworkRTCProvider::close as we need to go to the rtc network thread and
1018         for that, we take a ref of NetworkRTCProvider.
1019         Stopping any resolver before freeing them.
1020
1021         * NetworkProcess/webrtc/NetworkRTCMonitor.h:
1022         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
1023         (WebKit::NetworkRTCProvider::~NetworkRTCProvider):
1024         (WebKit::NetworkRTCProvider::close):
1025         * NetworkProcess/webrtc/NetworkRTCProvider.h:
1026
1027 2017-03-02  Youenn Fablet  <youenn@apple.com>
1028
1029         [iOS] Replicate NetworkProcess Mac sandboxing in iOS to allow TCP/UDP
1030         https://bugs.webkit.org/show_bug.cgi?id=169105
1031
1032         Reviewed by Alex Christensen.
1033
1034         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Adding sandbox extension support for TCP/UDP networking.
1035
1036 2017-03-02  Aakash Jain  <aakash_jain@apple.com>
1037
1038         Move stringMatchesWildcardString from WebKit2 to WebCore
1039         https://bugs.webkit.org/show_bug.cgi?id=169065
1040
1041         Reviewed by Alexey Proskuryakov.
1042
1043         * Platform/mac/StringUtilities.h: Moved stringMatchesWildcardString to WebCore.
1044         * WebKit2.xcodeproj/project.pbxproj: Make StringUtilities.h a project header.
1045         * Platform/mac/StringUtilities.mm:
1046         (WebKit::wildcardRegexPatternString): Moved to WebCore.
1047         (WebKit::stringMatchesWildcardString): Ditto.
1048         * WebProcess/Plugins/WebPluginInfoProvider.cpp: Using stringMatchesWildcardString from WebCore.
1049
1050 2017-03-02  Aakash Jain  <aakash_jain@apple.com>
1051
1052         IsSmartPtr<WKRetainPtr<T>>::value should not be exported
1053         https://bugs.webkit.org/show_bug.cgi?id=169047
1054
1055         Reviewed by Alexey Proskuryakov.
1056
1057         * UIProcess/API/cpp/WKRetainPtr.h:
1058
1059 2017-03-02  Youenn Fablet  <youenn@apple.com>
1060
1061         Activate some new webrtc tests
1062         https://bugs.webkit.org/show_bug.cgi?id=168850
1063
1064         Reviewed by Alex Christensen.
1065
1066         * Shared/WebPreferencesDefinitions.h: Activating peer connection by default when libwebrtc is on.
1067         This allows ensuring the network process will have its sandbox extension.
1068
1069 2017-03-02  Brian Burg  <bburg@apple.com>
1070
1071         Web Automation: _WKAutomationSessionDelegate should work with WKWebViews
1072         https://bugs.webkit.org/show_bug.cgi?id=169091
1073         <rdar://problem/30810538>
1074
1075         Reviewed by Tim Horton.
1076
1077         As a first step towards fixing the mistake of using WKPageRef in an Objective-C SPI,
1078         add the correct delegate methods that take WKWebView so that Objective-C clients can
1079         use this functionality.
1080
1081         In a future patch, we'll remove the WKPageRef delegate methods when they are no longer
1082         being used by clients. Clients should switch to using WKWebView, or wait for a C SPI
1083         with equivalent functionality (something like WKAutomationSessionClient) to be ported.
1084
1085         While I'm fixing this mess, make API::AutomationSessionClient use references instead
1086         of pointers. We null-check all WebPageProxy parameters before calling its methods.
1087
1088         * UIProcess/API/APIAutomationSessionClient.h:
1089         (API::AutomationSessionClient::didDisconnectFromRemote):
1090         (API::AutomationSessionClient::didRequestNewWindow):
1091         (API::AutomationSessionClient::isShowingJavaScriptDialogOnPage):
1092         (API::AutomationSessionClient::dismissCurrentJavaScriptDialogOnPage):
1093         (API::AutomationSessionClient::acceptCurrentJavaScriptDialogOnPage):
1094         (API::AutomationSessionClient::messageOfCurrentJavaScriptDialogOnPage):
1095         (API::AutomationSessionClient::setUserInputForCurrentJavaScriptPromptOnPage):
1096         Change pointer to reference.
1097
1098         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
1099         Add duplicate delegate methods that take/return WKWebView instead of WKPageRef.
1100         Adjust the delegate method names to reflect parameter type and avoid conflicts with the
1101         WKPageRef-using methods that we need to remove eventually.
1102
1103         * UIProcess/Automation/WebAutomationSession.cpp:
1104         (WebKit::WebAutomationSession::terminate):
1105         (WebKit::WebAutomationSession::createBrowsingContext):
1106         (WebKit::WebAutomationSession::isShowingJavaScriptDialog):
1107         (WebKit::WebAutomationSession::dismissCurrentJavaScriptDialog):
1108         (WebKit::WebAutomationSession::acceptCurrentJavaScriptDialog):
1109         (WebKit::WebAutomationSession::messageOfCurrentJavaScriptDialog):
1110         (WebKit::WebAutomationSession::setUserInputForCurrentJavaScriptPrompt):
1111         Dereference `this` and `webPageProxy` when calling API::AutomationSessionClient methods.
1112
1113         * UIProcess/Cocoa/AutomationSessionClient.h:
1114         * UIProcess/Cocoa/AutomationSessionClient.mm:
1115         (WebKit::AutomationSessionClient::AutomationSessionClient):
1116         (WebKit::AutomationSessionClient::didDisconnectFromRemote):
1117         (WebKit::AutomationSessionClient::didRequestNewWindow):
1118         (WebKit::AutomationSessionClient::isShowingJavaScriptDialogOnPage):
1119         (WebKit::AutomationSessionClient::dismissCurrentJavaScriptDialogOnPage):
1120         (WebKit::AutomationSessionClient::acceptCurrentJavaScriptDialogOnPage):
1121         (WebKit::AutomationSessionClient::messageOfCurrentJavaScriptDialogOnPage):
1122         (WebKit::AutomationSessionClient::setUserInputForCurrentJavaScriptPromptOnPage):
1123         Now there are two possible delegate methods for most of these, so try to use the
1124         WKWebView-based delegate method first and fall back to the WKPageRef delegate method.
1125
1126 2017-03-02  Alex Christensen  <achristensen@webkit.org>
1127
1128         Continue enabling WebRTC
1129         https://bugs.webkit.org/show_bug.cgi?id=169056
1130
1131         Reviewed by Jon Lee.
1132
1133         * Configurations/FeatureDefines.xcconfig:
1134
1135 2017-03-01  Megan Gardner  <megan_gardner@apple.com>
1136
1137         Data interaction support for WK1
1138         https://bugs.webkit.org/show_bug.cgi?id=169062
1139
1140         Reviewed by Wenson Hsieh.
1141
1142         Allow for separate additions files in WK1 and WK2
1143
1144         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1145
1146 2017-03-02  Youenn Fablet  <youenn@apple.com>
1147
1148         [WebRTC] Activate ICE candidate privacy policy
1149         https://bugs.webkit.org/show_bug.cgi?id=168975
1150
1151         Reviewed by Alex Christensen.
1152
1153         Disabling network enumeration by default.
1154         Enabling ICE candidate filtering by default.
1155         Chaning ICE candidate filtering according userMediaAccess policy:
1156         - If access is denied, filtering is on.
1157         - If access is granted, filtering is off.
1158
1159         * Shared/WebPageCreationParameters.cpp:
1160         (WebKit::WebPageCreationParameters::encode):
1161         (WebKit::WebPageCreationParameters::decode):
1162         * Shared/WebPageCreationParameters.h:
1163         * Shared/WebPreferencesDefinitions.h:
1164         * UIProcess/API/C/WKPreferences.cpp:
1165         (WKPreferencesSetICECandidateFilteringEnabled):
1166         (WKPreferencesGetICECandidateFilteringEnabled):
1167         (WKPreferencesSetEnumeratingAllNetworkInterfacesEnabled):
1168         (WKPreferencesGetEnumeratingAllNetworkInterfacesEnabled):
1169         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1170         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1171         (WebKit::toWebCore):
1172         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
1173         * UIProcess/UserMediaProcessManager.cpp:
1174         (WebKit::UserMediaProcessManager::willCreateMediaStream):
1175         (WebKit::UserMediaProcessManager::endedCaptureSession):
1176         * UIProcess/WebPageProxy.cpp:
1177         (WebKit::WebPageProxy::creationParameters):
1178         * WebProcess/WebPage/WebPage.cpp:
1179
1180 2017-03-02  Tomas Popela  <tpopela@redhat.com>
1181
1182         [WK2] Keyboard menu key should show context menu
1183         https://bugs.webkit.org/show_bug.cgi?id=72099
1184
1185         Reviewed by Carlos Garcia Campos.
1186
1187         Show the context menu when the GtkWidget::popup-menu signal is
1188         emitted. This signal is triggered by pressing a key (usually
1189         the Menu key or the Shift + F10 shortcut) or it could be emitted on
1190         WebKitWebView.
1191
1192         * UIProcess/API/gtk/WebKitWebView.cpp:
1193         (webkit_web_view_class_init):
1194         (webkit_web_view_class_init): Update the documentation for the
1195         context-menu signal
1196         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1197         (webkitWebViewBasePopupMenu): Connect to the popup-menu signal and
1198         save the event that was used to trigger the signal. If there is no
1199         such event create a new GdkEvent with GDK_NOTHING type.
1200         (webkitWebViewBasePopupMenu):
1201         (webkit_web_view_base_class_init):
1202         * UIProcess/WebPageProxy.cpp:
1203         (WebKit::WebPageProxy::handleContextMenuKeyEvent):
1204         * UIProcess/WebPageProxy.h:
1205         * WebProcess/WebPage/WebPage.cpp:
1206         (WebKit::WebPage::contextMenuForKeyEvent):
1207         * WebProcess/WebPage/WebPage.h:
1208         * WebProcess/WebPage/WebPage.messages.in:
1209
1210 2017-03-01  Wenson Hsieh  <wenson_hsieh@apple.com>
1211
1212         Replace -[WKWebView adjustedDataInteractionItemProviders:] with a UI delegate method
1213         https://bugs.webkit.org/show_bug.cgi?id=169013
1214
1215         Reviewed by Dan Bernstein.
1216
1217         Rather than introduce new SPI on WKWebView directly, we should follow convention and add the hook to the private
1218         version of the UI delegate.
1219
1220         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1221         * UIProcess/API/Cocoa/WKWebView.mm:
1222         (-[WKWebView _adjustedDataInteractionItemProviders:]): Deleted.
1223         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1224
1225 2017-03-01  Alex Christensen  <achristensen@webkit.org>
1226
1227         Unreviewed, rolling out r213259.
1228
1229         Broke an internal build
1230
1231         Reverted changeset:
1232
1233         "Continue enabling WebRTC"
1234         https://bugs.webkit.org/show_bug.cgi?id=169056
1235         http://trac.webkit.org/changeset/213259
1236
1237 2017-03-01  Alex Christensen  <achristensen@webkit.org>
1238
1239         Continue enabling WebRTC
1240         https://bugs.webkit.org/show_bug.cgi?id=169056
1241
1242         Reviewed by Jon Lee.
1243
1244         * Configurations/FeatureDefines.xcconfig:
1245
1246 2017-03-01  Chris Dumez  <cdumez@apple.com>
1247
1248         [WK2][!NETWORK_SESSION] Failure to download when using a download attribute with no value on an anchor
1249         https://bugs.webkit.org/show_bug.cgi?id=169060
1250         <rdar://problem/30773140>
1251
1252         Reviewed by Darin Adler.
1253
1254         In the !NETWORK_SESSION code path, we were failing to use the suggested filename coming from the
1255         network layer in the case where the download attribute is present but has no value. We were ending
1256         up passing an empty string as suggested filename to Safari which is not handled properly.
1257
1258         * UIProcess/Downloads/DownloadProxy.cpp:
1259         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
1260
1261 2017-02-28  Matt Rajca  <mrajca@apple.com>
1262
1263         Media: notify clients when autoplayed media is muted
1264         https://bugs.webkit.org/show_bug.cgi?id=168987
1265
1266         Reviewed by Alex Christensen.
1267
1268         * UIProcess/API/C/WKPageUIClient.h:
1269
1270 2017-03-01  Brady Eidson  <beidson@apple.com>
1271
1272         Add SPI to create WebsiteDataStore objects pointing to custom paths.
1273         https://bugs.webkit.org/show_bug.cgi?id=169044
1274
1275         Reviewed by Tim Horton.
1276
1277         * UIProcess/API/APIWebsiteDataStore.h:
1278
1279         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1280         (-[WKWebsiteDataStore _initWithConfiguration:]):
1281
1282         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1283
1284         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h.
1285         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h.
1286
1287         * UIProcess/WebsiteData/WebsiteDataStore.h:
1288
1289         * WebKit2.xcodeproj/project.pbxproj:
1290
1291 2017-03-01  Jon Lee  <jonlee@apple.com>
1292
1293         Update peer connection preference
1294         https://bugs.webkit.org/show_bug.cgi?id=169016
1295         rdar://problem/30773889
1296
1297         Reviewed by Eric Carlson.
1298
1299         * Shared/WebPreferencesDefinitions.h:
1300         * UIProcess/WebPreferences.cpp:
1301         (WebKit::WebPreferences::setEnabledForFeature):
1302         (WebKit::WebPreferences::setPeerConnectionAndMediaStreamEnabled): Deleted.
1303         * UIProcess/WebPreferences.h:
1304
1305 2017-03-01  Tomas Popela  <tpopela@redhat.com>
1306
1307         [GTK] Fix problems found by Coverity scan in WebPrintOperationGtk.cpp
1308         https://bugs.webkit.org/show_bug.cgi?id=169027
1309
1310         Reviewed by Carlos Garcia Campos.
1311
1312         Initialize the lastPagePosition variable and remove an unused one
1313         - totalToPrint.
1314
1315         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
1316         (WebKit::PrintPagesData::PrintPagesData):
1317
1318 2017-03-01  Andreas Kling  <akling@apple.com>
1319
1320         Move MemoryPressureHandler to WTF
1321         <https://webkit.org/b/168908>
1322
1323         Reviewed by Sam Weinig.
1324
1325         * NetworkProcess/NetworkProcess.h:
1326         * NetworkProcess/mac/NetworkProcessMac.mm:
1327         * PluginProcess/PluginProcess.cpp:
1328         * Shared/linux/WebMemorySamplerLinux.cpp:
1329         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1330         * WebProcess/WebPage/ios/WebPageIOS.mm:
1331
1332 2017-03-01  Joseph Pecoraro  <pecoraro@apple.com>
1333
1334         [WebRTC] Install libwebrtc.dylib inside of WebCore.framework
1335         https://bugs.webkit.org/show_bug.cgi?id=168859
1336
1337         Reviewed by Dan Bernstein.
1338
1339         * Configurations/BaseTarget.xcconfig:
1340         * Configurations/WebKit.xcconfig:
1341         Set library search path to find the libwebrtc.dylib inside of WebCore's Frameworks
1342         or in the WK_OVERRIDE_FRAMEWORKS_DIR.
1343
1344 2017-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1345
1346         NetworkProcess aborts in WebKit::NetworkLoad::didCompleteWithError at Source/WebKit2/NetworkProcess/NetworkLoad.cpp:423
1347         https://bugs.webkit.org/show_bug.cgi?id=168963
1348
1349         Reviewed by Antti Koivisto.
1350
1351         This is trying to call SpeculativeLoad::didFailLoading() after SpeculativeLoad has already been
1352         completed. SpeculativeLoad::didComplete() call its completion handler that removes the load from
1353         m_pendingPreloads. When the completion handler returns the SpeculativeLoad is deleted. So, we should always
1354         ensure that SpeculativeLoad is not used after didComplete() call. In SpeculativeLoad::willSendRedirectedRequest(),
1355         the call to NetworkLoad::continueWillSendRequest() causes SpeculativeLoad::didFailLoading() to be called. We
1356         don't really need to call continueWillSendRequest() though, since the network load is going to be deleted anyway
1357         by didComplete(), and the willSendRequest completion handler does nothing when the request is null.
1358
1359         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1360         (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
1361
1362 2017-02-28  Alexey Proskuryakov  <ap@apple.com>
1363
1364         https://bugs.webkit.org/show_bug.cgi?id=168899
1365         Re-add deprecated functions to WKPageGroup.h
1366
1367         Reviewed by Tim Horton.
1368
1369         * Shared/API/c/WKDeprecatedFunctions.cpp:
1370         (WKPageGroupRemoveUserContentFilter):
1371         (WKPageGroupRemoveAllUserContentFilters): Deleted. Unlike the other three, this
1372         function isn't used by any clients.
1373         * UIProcess/API/C/WKPageGroup.h:
1374
1375 2017-02-28  Alexey Proskuryakov  <ap@apple.com>
1376
1377         Expose _WKVisitedLinkProvider in a header
1378         https://bugs.webkit.org/show_bug.cgi?id=168955
1379
1380         Reviewed by Tim Horton.
1381
1382         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm:
1383         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
1384         The class needs to be visible in a header, as it is exported SPI.
1385
1386 2017-02-28  Brady Eidson  <beidson@apple.com>
1387
1388         Move resolving symlinks of some WebsiteDataStore paths from WebProcessPool to... WebsiteDataStore!.
1389         https://bugs.webkit.org/show_bug.cgi?id=168696.
1390
1391         Reviewed by Alex Christensen.
1392
1393         * UIProcess/WebProcessPool.cpp:
1394         (WebKit::WebProcessPool::createNewWebProcess):
1395
1396         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1397         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
1398         * UIProcess/WebsiteData/WebsiteDataStore.h:
1399         (WebKit::WebsiteDataStore::resolvedApplicationCacheDirectory):
1400         (WebKit::WebsiteDataStore::resolvedMediaCacheDirectory):
1401         (WebKit::WebsiteDataStore::resolvedMediaKeysDirectory):
1402         (WebKit::WebsiteDataStore::resolvedDatabaseDirectory):
1403
1404 2017-02-28  Alex Christensen  <achristensen@webkit.org>
1405
1406         LibWebRTCProvider should check existence of libwebrtc.dylib
1407         https://bugs.webkit.org/show_bug.cgi?id=168986
1408
1409         Reviewed by Youenn Fablet.
1410
1411         * Shared/WebPreferencesDefinitions.h:
1412         * Shared/WebPreferencesStore.cpp:
1413         * UIProcess/WebPreferences.cpp:
1414         (WebKit::checkWebRTCAvailability): Deleted.
1415
1416 2017-02-28  Wenson Hsieh  <wenson_hsieh@apple.com>
1417
1418         Unreviewed, build fix after r213176.
1419
1420         * Platform/spi/ios/UIKitSPI.h:
1421
1422 2017-02-28  Tim Horton  <timothy_horton@apple.com>
1423
1424         [iOS] Getting QLPreviewProtocol slows down first navigation in Web process
1425         https://bugs.webkit.org/show_bug.cgi?id=168940
1426         <rdar://problem/29468999>
1427
1428         Reviewed by Simon Fraser.
1429
1430         * WebProcess/Network/WebLoaderStrategy.cpp:
1431         (WebKit::WebLoaderStrategy::scheduleLoad):
1432         Make use of isQuickLookPreviewURL.
1433
1434 2017-02-28  Brady Eidson  <beidson@apple.com>
1435
1436         Fix API test regression(s):
1437         REGRESSION (r213168): API test WKUserContentController.ScriptMessageHandlerMultipleHandlerRemoval crashing
1438         https://bugs.webkit.org/show_bug.cgi?id=168991
1439
1440         Unreviewed.
1441
1442         * UIProcess/WebProcessPool.cpp:
1443         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
1444
1445 2017-02-28  Wenson Hsieh  <wenson_hsieh@apple.com>
1446
1447         Data interaction should support attachment elements
1448         https://bugs.webkit.org/show_bug.cgi?id=168916
1449         <rdar://problem/30664519>
1450
1451         Reviewed by Ryosuke Niwa.
1452
1453         Teaches WKContentView to recognize attachment elements as data interactive content, and add an internal hook to
1454         adjust the list of item providers before initiating data interaction.
1455
1456         * Platform/spi/ios/UIKitSPI.h:
1457         * UIProcess/API/Cocoa/WKWebView.mm:
1458         (-[WKWebView _adjustedDataInteractionItemProviders:]):
1459         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1460         * UIProcess/ios/WKContentViewInteraction.mm:
1461         (-[WKContentView pointIsInDataInteractionContent:]):
1462
1463 2017-02-28  Yongjun Zhang  <yongjun_zhang@apple.com>
1464
1465         Add delegate method to handle images with alternate data.
1466         https://bugs.webkit.org/show_bug.cgi?id=168785
1467         <rdar://problem/28776219>
1468
1469         Add delegate methods to WKUIDelegatePrivate so that a WebKit client can provide alternate URL or data for an image
1470         before long-press or preview. When an image has alternate URL or data, we can change the actions accordingly.
1471
1472         Reviewed by Enrica Casucci.
1473
1474         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Add two delegate methods _webView:getAlternateURLFromImage:completionHandler:
1475             and _webView:alternateURLFromImage:userInfo;
1476         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h: Add an readonly property userInfo so that alternate data can be
1477             carried by _WKActivatedElementInfo and be processed by WebKit client.
1478         * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
1479         (-[_WKActivatedElementInfo _initWithType:URL:location:title:ID:rect:image:]):
1480         (-[_WKActivatedElementInfo _initWithType:URL:location:title:ID:rect:image:userInfo:]): A new initializer that also takes userInfo.
1481         (-[_WKActivatedElementInfo userInfo]):
1482         * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h: A new delegate method for WKActionSheetAssistantDelegate to fetch
1483             alternate data before showing image sheet.
1484         * UIProcess/ios/WKActionSheetAssistant.h:
1485         * UIProcess/ios/WKActionSheetAssistant.mm:
1486         (-[WKActionSheetAssistant showImageSheet]): Before showing the image sheet, if the image doesn't have linked URL (i.e. not a image
1487             link), try to fetch its alternate URL and data.
1488         (-[WKActionSheetAssistant defaultActionsForImageSheet:]): Drive-by fix. We always use positionInformation's URL to populate the
1489             actions, however, we should use elementInfo's URL since the two URLs could mismatch.
1490         * UIProcess/ios/WKContentViewInteraction.mm:
1491         (-[WKContentView actionSheetAssistant:getAlternateURLForImage:completion:]):
1492         (-[WKContentView _presentedViewControllerForPreviewItemController:]): Before previewing an image, synchronously get alternate
1493             data for the image and update the actions accordingly.
1494
1495 2017-02-28  Brady Eidson  <beidson@apple.com>
1496         
1497         Refactor WebViewImpl creation in preparation for supporting multiple WebsiteDataStores.
1498         https://bugs.webkit.org/show_bug.cgi?id=168676
1499
1500         Reviewed by Alex Christensen and Sam Weinig.
1501
1502         * UIProcess/WebProcessPool.cpp:
1503         (WebKit::WebProcessPool::createNewWebProcess):
1504         (WebKit::WebProcessPool::warmInitialProcess):
1505         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
1506         (WebKit::WebProcessPool::createWebPage):
1507         * UIProcess/WebProcessPool.h:
1508
1509 2017-02-28  Youenn Fablet  <youenn@apple.com>
1510
1511         [WebRTC] Limit libwebrtc logging in Debug build
1512         https://bugs.webkit.org/show_bug.cgi?id=168974
1513
1514         Reviewed by Alex Christensen.
1515
1516         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
1517         (WebKit::NetworkRTCProvider::NetworkRTCProvider):
1518         * Platform/Logging.h:
1519
1520 2017-02-28  Youenn Fablet  <youenn@apple.com>
1521
1522         [WebRTC] NetworkRTCProvider should stop the network thread from the main thread
1523         https://bugs.webkit.org/show_bug.cgi?id=168972
1524
1525         Reviewed by Alex Christensen.
1526
1527         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
1528         (WebKit::NetworkRTCProvider::close): Ensuring to stop the network thread from the main thread when provider is
1529         getting closed.
1530
1531 2017-02-24  Matt Rajca  <mrajca@apple.com>
1532
1533         Media: notify clients when autoplayed media ends without being paused
1534         https://bugs.webkit.org/show_bug.cgi?id=168852
1535
1536         Reviewed by Alex Christensen.
1537
1538         * UIProcess/API/C/WKPageUIClient.h:
1539
1540 2017-02-28  Csaba Osztrogonác  <ossy@webkit.org>
1541
1542         Remove EFL leftover from WebPageProxy.messages.in
1543         https://bugs.webkit.org/show_bug.cgi?id=168828
1544
1545         Reviewed by Gyuyoung Kim.
1546
1547         * UIProcess/WebPageProxy.messages.in:
1548
1549 2017-02-28  Alex Christensen  <achristensen@webkit.org>
1550
1551         Main resource requests need cachePartition
1552         https://bugs.webkit.org/show_bug.cgi?id=168806
1553
1554         Reviewed by Brady Eidson.
1555
1556         * NetworkProcess/NetworkResourceLoader.cpp:
1557         (WebKit::NetworkResourceLoader::continueWillSendRequest):
1558
1559 2017-02-27  Alex Christensen  <achristensen@webkit.org>
1560
1561         Begin enabling WebRTC on 64-bit
1562         https://bugs.webkit.org/show_bug.cgi?id=168915
1563
1564         Reviewed by Eric Carlson.
1565
1566         * Configurations/FeatureDefines.xcconfig:
1567
1568 2017-02-27  Alexey Proskuryakov  <ap@apple.com>
1569
1570         Remove _WKWebsiteDataRecord.h
1571         https://bugs.webkit.org/show_bug.cgi?id=168954
1572
1573         Reviewed by Dan Bernstein.
1574
1575         This doesn't seem to have ever been used, so better to remove it than to add an
1576         implementation.
1577
1578         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h: Removed.
1579         * WebKit2.xcodeproj/project.pbxproj:
1580
1581 2017-02-27  Alexey Proskuryakov  <ap@apple.com>
1582
1583         WKPageIsPlayingVideoInEnhancedFullscreen availability mismatch
1584         https://bugs.webkit.org/show_bug.cgi?id=168952
1585
1586         Reviewed by Dan Bernstein.
1587
1588         * UIProcess/API/C/mac/WKPagePrivateMac.h: TARGET_OS_MAC is not the right thing to
1589         check, as it's true on both macOS and iOS.
1590
1591 2017-02-27  Alexey Proskuryakov  <ap@apple.com>
1592
1593         Export WKPluginInformationBundleShortVersionKey
1594         https://bugs.webkit.org/show_bug.cgi?id=168951
1595
1596         Reviewed by Dan Bernstein.
1597
1598         * Shared/API/c/WKPluginInformation.h: It was accidentally not exported when added.
1599
1600 2017-02-27  Youenn Fablet  <youenn@apple.com>
1601
1602         [WebRTC] Add support for libwebrtc TCP incoming connections
1603         https://bugs.webkit.org/show_bug.cgi?id=168748
1604
1605         Reviewed by Alex Christensen.
1606
1607         Covered by added layout tests.
1608
1609         When a libwebrtc server socket is signalling a new connnection through SignalNewConnection, we do:
1610         - Wrap the incoming socket into a LibWebRTCSocketClient
1611         - Store it into a pending socket map with an identifier
1612         - Send a message to the web process of a new connection with the server socket identifier and new connection socket identifier.
1613         The Web process then creates a WebRTCSocket wrapper around it by sendinig a WrapNewTCPConnection message.
1614         It then propagates the SignalNewConnection to libwebrtc code path.
1615
1616         * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
1617         (WebKit::LibWebRTCSocketClient::LibWebRTCSocketClient):
1618         (WebKit::LibWebRTCSocketClient::signalReadPacket):
1619         (WebKit::LibWebRTCSocketClient::signalSentPacket):
1620         (WebKit::LibWebRTCSocketClient::signalNewConnection):
1621         (WebKit::LibWebRTCSocketClient::signalAddressReady):
1622         (WebKit::LibWebRTCSocketClient::signalConnect):
1623         (WebKit::LibWebRTCSocketClient::signalClose):
1624         * NetworkProcess/webrtc/LibWebRTCSocketClient.h:
1625         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
1626         (WebKit::NetworkRTCProvider::wrapNewTCPConnection):
1627         (WebKit::NetworkRTCProvider::newConnection):
1628         * NetworkProcess/webrtc/NetworkRTCProvider.h:
1629         * NetworkProcess/webrtc/NetworkRTCProvider.messages.in:
1630         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
1631         (WebKit::LibWebRTCSocket::signalNewConnection):
1632         * WebProcess/Network/webrtc/LibWebRTCSocket.h:
1633         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
1634         (WebKit::LibWebRTCSocketFactory::createNewConnectionSocket):
1635         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
1636         * WebProcess/Network/webrtc/WebRTCSocket.cpp:
1637         (WebKit::WebRTCSocket::signalNewConnection):
1638         * WebProcess/Network/webrtc/WebRTCSocket.h:
1639         * WebProcess/Network/webrtc/WebRTCSocket.messages.in:
1640
1641 2017-02-27  Brent Fulgham  <bfulgham@apple.com>
1642
1643         [Mac] Don't use undefined sandbox rule on macOS 10.11 or earlier
1644         https://bugs.webkit.org/show_bug.cgi?id=168942
1645         <rdar://problem/30743376>
1646
1647         Reviewed by Ryosuke Niwa.
1648
1649         * WebProcess/com.apple.WebProcess.sb.in:
1650
1651 2017-02-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1652
1653         Unreviewed, roll out r213065.
1654
1655         * UIProcess/ios/WKContentViewInteraction.h:
1656
1657 2017-02-27  Alexey Proskuryakov  <ap@apple.com>
1658
1659         Remove some deprecated WKPage plug-in information functions
1660         https://bugs.webkit.org/show_bug.cgi?id=168897
1661
1662         Reviewed by Tim Horton.
1663
1664         * UIProcess/API/C/WKPage.cpp:
1665         (WKPageGetProcessIdentifier):
1666         (WKPageGetPluginInformationBundleIdentifierKey): Deleted.
1667         (WKPageGetPluginInformationBundleVersionKey): Deleted.
1668         (WKPageGetPluginInformationDisplayNameKey): Deleted.
1669         (WKPageGetPluginInformationFrameURLKey): Deleted.
1670         (WKPageGetPluginInformationMIMETypeKey): Deleted.
1671         (WKPageGetPluginInformationPageURLKey): Deleted.
1672         (WKPageGetPluginInformationPluginspageAttributeURLKey): Deleted.
1673         (WKPageGetPluginInformationPluginURLKey): Deleted.
1674         * UIProcess/API/C/WKPage.h:
1675
1676 2017-02-27  Alexey Proskuryakov  <ap@apple.com>
1677
1678         Stop exporting C++ member variables from class extensions in WKDOMInternals.h
1679         https://bugs.webkit.org/show_bug.cgi?id=168886
1680
1681         Reviewed by Tim Horton.
1682
1683         * WebProcess/InjectedBundle/API/mac/WKDOMInternals.h: These are @package variables.
1684
1685 2017-02-27  Alex Christensen  <achristensen@webkit.org>
1686
1687         Optimize checkWebRTCAvailability
1688         https://bugs.webkit.org/show_bug.cgi?id=168913
1689
1690         Reviewed by Darin Adler.
1691
1692         We can optimize startup time by using RTLD_LAZY instead of RTLD_NOW because we don't need to load all the symbols.
1693         We just need to check whether libwebrtc.dylib can be found and is a valid dylib for the current architecture.
1694         Also, initialize a static bool so it only needs to be checked once.  Right now it's only used when initializing settings,
1695         but if we use it for other things in the future there will be no need to reopen the dylib.
1696
1697         * UIProcess/WebPreferences.cpp:
1698         (WebKit::checkWebRTCAvailability):
1699
1700 2017-02-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1701
1702         Unreviewed, revert all temporary build fixes for data interaction
1703
1704         Rolls out r212990, r212988 and r212984.
1705
1706         * UIProcess/ios/WKContentViewInteraction.h:
1707
1708 2017-02-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1709
1710         [GTK] Rendering artifacts when resizing the window in X11 with AC mode enabled
1711         https://bugs.webkit.org/show_bug.cgi?id=168728
1712
1713         Reviewed by Žan Doberšek.
1714
1715         This happens because the pixmap we create from the redirected window is uninitialized until the threaded
1716         compositor renders into it. We should always initialize the pixmap right after it's created.
1717
1718         * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp:
1719         (WebKit::defaultVisual): Helper static method to get the default GdkVisual.
1720         (WebKit::AcceleratedSurfaceX11::AcceleratedSurfaceX11): Use createPixmap().
1721         (WebKit::AcceleratedSurfaceX11::createPixmap): Create and initialize the pixmap.
1722         (WebKit::AcceleratedSurfaceX11::resize): Use createPixmap().
1723         * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h:
1724
1725 2017-02-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1726
1727         [GTK] Flickering when leaving accelerated compositing mode
1728         https://bugs.webkit.org/show_bug.cgi?id=168911
1729
1730         Reviewed by Žan Doberšek.
1731
1732         It doesn't always happen, and it's too fast, more noticeable in websites with a dark background, because we are
1733         drawing a single white frame. This happens when we leave AC mode during the layer flush that schedules an update
1734         on the compositor, which at that point only clears the area and renders nothing. However,
1735         CoordinatedGraphicsScene::paintToCurrentGLContext() always renders a white background when no web view color has
1736         been set. And that's the white frame we get. We could prevent that last update from happening by checking if we
1737         still have a graphics root layer after syncDisplayState() in the layer flush, the same way we check the layer
1738         tree host is still valid.
1739
1740         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1741         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1742         (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired):
1743
1744 2017-02-27  Alex Christensen  <achristensen@webkit.org>
1745
1746         [libwebrtc] Enable WebRTC in some Production Builds
1747         https://bugs.webkit.org/show_bug.cgi?id=168858
1748
1749         * Configurations/FeatureDefines.xcconfig:
1750
1751 2017-02-27  Andy Estes  <aestes@apple.com>
1752
1753         Links cannot be activated when running Mobile Safari with external SDK build of WebKit for iOS Simulator
1754         https://bugs.webkit.org/show_bug.cgi?id=141906
1755
1756         Reviewed by Tim Horton.
1757
1758         Even if Touch Events are disabled, we still need to register a
1759         UIWebTouchEventsGestureRecognizer to record the layer tree transaction ID when a touch
1760         begins. Click events are only generated for touches that occur after the current frame's
1761         load has committed, and we use the transaction ID from when the touch began to implement
1762         this check.
1763
1764         * UIProcess/WebPageProxy.cpp:
1765         (WebKit::WebPageProxy::handleTouchEventSynchronously):
1766         (WebKit::WebPageProxy::resetState):
1767         * UIProcess/WebPageProxy.h:
1768         * UIProcess/ios/WKContentViewInteraction.h: Declared _layerTreeTransactionIdAtLastTouchStart.
1769         * UIProcess/ios/WKContentViewInteraction.mm:
1770         (-[WKContentView setupInteraction]): Register a UIWebTouchEventsGestureRecognizer even if
1771         Touch Events are disabled.
1772         (-[WKContentView cleanupInteraction]): Reset _layerTreeTransactionIdAtLastTouchStart to 0.
1773         (-[WKContentView _webTouchEventsRecognized:]): Update _layerTreeTransactionIdAtLastTouchStart
1774         when a touch begins, even if Touch Events are disabled.
1775         (-[WKContentView _singleTapCommited:]): Passed _layerTreeTransactionIdAtLastTouchStart to
1776         WebPageProxy::commitPotentialTap().
1777         (-[WKContentView _attemptClickAtLocation:]): Ditto for WebPageProxy::handleTap().
1778         * UIProcess/ios/WebPageProxyIOS.mm:
1779         (WebKit::WebPageProxy::commitPotentialTap):
1780         (WebKit::WebPageProxy::handleTap):
1781
1782 2017-02-26  Zan Dobersek  <zdobersek@igalia.com>
1783
1784         [CoordinatedGraphics] Remove CoordinatedGraphicsScene::paintToGraphicsContext()
1785         https://bugs.webkit.org/show_bug.cgi?id=168903
1786
1787         Reviewed by Carlos Garcia Campos.
1788
1789         Remove the CoordinatedGraphicsScene::paintToGraphicsContext() method as it
1790         is not used anywhere. Also enables removing the GraphicsContext pointer
1791         member from the TextureMapper class.
1792
1793         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1794         (WebKit::CoordinatedGraphicsScene::paintToGraphicsContext): Deleted.
1795         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1796
1797 2017-02-26  Carlos Garcia Campos  <cgarcia@igalia.com>
1798
1799         [GTK] Hangs when showing Google search results
1800         https://bugs.webkit.org/show_bug.cgi?id=168699
1801
1802         Reviewed by Žan Doberšek.
1803
1804         Connection::sendOutgoingMessage() can poll forever if sendmsg fails with EAGAIN or EWOULDBLOCK. For example if
1805         socket read buffers are full, poll will be blocked until we read the pending data, but we can't read because
1806         the thread is blocked in the poll. In case of EAGAIN/EWOULDBLOCK we should poll using the run loop, to allow
1807         reads to happen in thread while we wait for the socket to be writable again. In the GTK+ port we use
1808         GSocketMonitor to poll socket file descriptor without blocking, using the run loop. This patch renames the
1809         socket monitor as readSocketMonitor and adds another one for polling output. When sendmsg fails with
1810         EAGAIN/EWOULDBLOCK, the pending message is saved and the write monitor starts polling. Once the socket is
1811         writable again we send the pending message. Helper class MessageInfo and a new one UnixMessage have been moved
1812         to its own header file to be able to use std::unique_ptr member to save the pending message.
1813
1814         * Platform/IPC/Connection.cpp: Include UnixMessage.h as required by std::unique_ptr.
1815         * Platform/IPC/Connection.h: Add write socket monitor and also keep the GSocket as a member to reuse it.
1816         * Platform/IPC/glib/GSocketMonitor.cpp: Use Function instead of std::function.
1817         (IPC::GSocketMonitor::start):
1818         * Platform/IPC/glib/GSocketMonitor.h:
1819         * Platform/IPC/unix/ConnectionUnix.cpp:
1820         (IPC::Connection::platformInitialize): Initialize the GSocket here since we rely on it to take the ownership of
1821         the descriptor. We were leaking it if the connection was invalidated without being opened.
1822         (IPC::Connection::platformInvalidate): Destroy the GSocket even when not connected. Also stop the write monitor.
1823         (IPC::Connection::processMessage):
1824         (IPC::Connection::open):
1825         (IPC::Connection::platformCanSendOutgoingMessages): Return false if we have a pending message to ensure
1826         Connection doesn't try to send more messages until the pending message is dispatched. We don't need to check
1827         m_isConnected because the caller already checks that.
1828         (IPC::Connection::sendOutgoingMessage): Split it in two. This creates and prepares a UnixMessage and then calls
1829         sendOutputMessage() to do the rest.
1830         (IPC::Connection::sendOutputMessage): Send the message, or save it if sendmsg fails with EAGAIN or EWOULDBLOCK
1831         to be sent later when the socket is writable.
1832         * Platform/IPC/unix/UnixMessage.h: Added.
1833         (IPC::MessageInfo::MessageInfo):
1834         (IPC::MessageInfo::setMessageBodyIsOutOfLine):
1835         (IPC::MessageInfo::isMessageBodyIsOutOfLine):
1836         (IPC::MessageInfo::bodySize):
1837         (IPC::MessageInfo::attachmentCount):
1838         (IPC::UnixMessage::UnixMessage):
1839         (IPC::UnixMessage::~UnixMessage):
1840         (IPC::UnixMessage::attachments):
1841         (IPC::UnixMessage::messageInfo):
1842         (IPC::UnixMessage::body):
1843         (IPC::UnixMessage::bodySize):
1844         (IPC::UnixMessage::appendAttachment):
1845         * PlatformGTK.cmake:
1846
1847 2017-02-26  Devin Rousso  <dcrousso+webkit@gmail.com>
1848
1849         Web Inspector: RTL: Docking Left doesn't constrain the page width
1850         https://bugs.webkit.org/show_bug.cgi?id=168862
1851
1852         Reviewed by Brian Burg.
1853
1854         * UIProcess/mac/WebInspectorProxyMac.mm:
1855         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
1856         Calculate the inspectedViewFrame to be the remaining space after WebInspector is opened
1857         instead of using the original page size.
1858
1859 2017-02-26  Alexey Proskuryakov  <ap@apple.com>
1860
1861         Stop exporting C++ member variables from WKDOMTextIterator
1862         https://bugs.webkit.org/show_bug.cgi?id=168885
1863
1864         Reviewed by Dan Bernstein.
1865
1866         * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.mm:
1867
1868 2017-02-26  Alexey Proskuryakov  <ap@apple.com>
1869
1870         Add preprocessor guards to Mac specific files that are exposed as private headers on iOS
1871         https://bugs.webkit.org/show_bug.cgi?id=168878
1872
1873         Reviewed by Dan Bernstein.
1874
1875         * UIProcess/API/C/WKInspector.h:
1876         * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.h:
1877
1878 2017-02-26  Alexey Proskuryakov  <ap@apple.com>
1879
1880         Remove spurious C++ include from _WKTestingDelegate.h
1881         https://bugs.webkit.org/show_bug.cgi?id=168877
1882
1883         Reviewed by Dan Bernstein.
1884
1885         * UIProcess/API/Cocoa/_WKTestingDelegate.h:
1886
1887 2017-02-26  Alexey Proskuryakov  <ap@apple.com>
1888
1889         Remove unimplemented WKResourceLoadStatisticsManagerSetReducedTimestampResolution
1890         https://bugs.webkit.org/show_bug.cgi?id=168880
1891
1892         Reviewed by Dan Bernstein.
1893
1894         * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
1895
1896 2017-02-26  Alexey Proskuryakov  <ap@apple.com>
1897
1898         Remove leftover WebKit2 C API function declarations
1899         https://bugs.webkit.org/show_bug.cgi?id=168879
1900
1901         Reviewed by Tim Horton.
1902
1903         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1904
1905 2017-02-26  Alexey Proskuryakov  <ap@apple.com>
1906
1907         Remove some old WKSecurityOrigin binary compatibility stubs
1908         https://bugs.webkit.org/show_bug.cgi?id=168881
1909
1910         Reviewed by Dan Bernstein.
1911
1912         * Shared/API/c/WKSecurityOriginRef.cpp:
1913         (WKSecurityOriginGetHost): Deleted.
1914         (WKSecurityOriginGetProtocol): Deleted.
1915
1916 2017-02-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1917
1918         REGRESSION (r211312): Double-clicking a word selects it along with the space that follows it
1919         https://bugs.webkit.org/show_bug.cgi?id=168821
1920         <rdar://problem/30690431>
1921
1922         Reviewed by Tim Horton.
1923
1924         Actually encode and decode smartInsertDeleteEnabled when sending WebPageCreationParameters over XPC.
1925
1926         * Shared/WebPageCreationParameters.cpp:
1927         (WebKit::WebPageCreationParameters::encode):
1928         (WebKit::WebPageCreationParameters::decode):
1929
1930 2017-02-26  Chris Dumez  <cdumez@apple.com>
1931
1932         HitTestResult's linkSuggestedFilename should sanitize download attribute
1933         https://bugs.webkit.org/show_bug.cgi?id=168856
1934         <rdar://problem/30683109>
1935
1936         Reviewed by Antti Koivisto.
1937
1938         HitTestResult's linkSuggestedFilename should sanitize download attribute.
1939         This is used by the context menu's "Download Linked File" & "Download Linked
1940         File As..." actions.
1941
1942         * Shared/WebHitTestResultData.cpp:
1943         (WebKit::WebHitTestResultData::WebHitTestResultData):
1944         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
1945         (WebKit::InjectedBundleHitTestResult::linkSuggestedFilename):
1946
1947 2017-02-25  Michael Catanzaro  <mcatanzaro@igalia.com>
1948
1949         [GTK] Unreviewed, document deficiency in webkit_website_data_manager_clear() API
1950
1951         Document that this function cannot currently delete cookie data for a particular period of
1952         time.
1953
1954         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
1955
1956 2017-02-24  Joseph Pecoraro  <pecoraro@apple.com>
1957
1958         [Resource Timing] Gather timing information with reliable responseEnd time
1959         https://bugs.webkit.org/show_bug.cgi?id=168351
1960
1961         Reviewed by Alex Christensen.
1962
1963         Change from an unused `double finishTime` to a complete WebCore::NetworkLoadMetrics
1964         object in the didFinishLoad ResourceLoader path. We may also extend this in the
1965         didFail path later on. This allows the NetworkProcess to give complete timing
1966         information, and more final metrics about the load, to WebCore.
1967
1968         * NetworkProcess/NetworkDataTask.h:
1969         (WebKit::NetworkDataTaskClient::didCompleteWithError):
1970         Give the NetworkDataTaskClient a basic didCompleteWithError for a completion
1971         without metrics. For loads that complete with an error, or haven't populated
1972         any metrics, this will pass empty metrics onward.
1973
1974         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
1975         (WebKit::BlobDownloadClient::didFinishLoading):
1976         * NetworkProcess/Downloads/BlobDownloadClient.h:
1977         * NetworkProcess/Downloads/PendingDownload.h:
1978         * NetworkProcess/PingLoad.h:
1979         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1980         (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
1981         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
1982         * NetworkProcess/NetworkDataTaskBlob.cpp:
1983         (WebKit::NetworkDataTaskBlob::didFail):
1984         * NetworkProcess/NetworkLoad.cpp:
1985         (WebKit::NetworkLoad::continueWillSendRequest):
1986         (WebKit::NetworkLoad::didCompleteWithError):
1987         (WebKit::NetworkLoad::didFinishLoading):
1988         * NetworkProcess/NetworkLoad.h:
1989         * NetworkProcess/NetworkLoadClient.h:
1990         * NetworkProcess/NetworkResourceLoader.cpp:
1991         (WebKit::NetworkResourceLoader::didFinishLoading):
1992         (WebKit::NetworkResourceLoader::sendResultForCacheEntry):
1993         * NetworkProcess/NetworkResourceLoader.h:
1994         * WebProcess/Network/WebResourceLoader.cpp:
1995         (WebKit::WebResourceLoader::didFinishResourceLoad):
1996         (WebKit::WebResourceLoader::didReceiveResource):
1997         * WebProcess/Network/WebResourceLoader.h:
1998         * WebProcess/Network/WebResourceLoader.messages.in:
1999         Change didFinishLoad paths to take a NetworkLoadMetrics object instead of finishTime.
2000         Change didCompleteWithError pathes to include a NetworkLoadMetrics object instead of finishTime.
2001
2002         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2003         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2004         (WebKit::NetworkDataTaskCocoa::didCompleteWithError):
2005         Own a NetworkLoadTiming that will be populated with the load.
2006
2007         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
2008         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2009         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
2010         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
2011         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
2012         Populate NetworkLoadMetrics in the didFinishCollectingMetrics NSURLSessionTaskDelegate method.
2013
2014         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2015         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
2016         (WebKit::NetworkDataTaskSoup::timeoutFired):
2017         (WebKit::NetworkDataTaskSoup::didSendRequest):
2018         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
2019         (WebKit::NetworkDataTaskSoup::dispatchDidCompleteWithError):
2020         (WebKit::NetworkDataTaskSoup::tlsErrorsChanged):
2021         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
2022         (WebKit::NetworkDataTaskSoup::didFinishRead):
2023         (WebKit::NetworkDataTaskSoup::didFinishRequestNextPart):
2024         (WebKit::NetworkDataTaskSoup::didFailDownload):
2025         (WebKit::NetworkDataTaskSoup::didFail):
2026         (WebKit::NetworkDataTaskSoup::networkEvent):
2027         (WebKit::NetworkDataTaskSoup::didStartRequest):
2028         (WebKit::NetworkDataTaskSoup::didRestart):
2029         * NetworkProcess/soup/NetworkDataTaskSoup.h:
2030         Instead of populating the NetworkLoadMetrics on the ResourceResponse, populate
2031         a member variable during the entire load and dispatch didFinishCollectingMetrics
2032         right before didCompleteLoadWithError.
2033
2034 2017-02-24  Chris Dumez  <cdumez@apple.com>
2035
2036         Unreviewed, rolling out r212944.
2037
2038         Caused a lot of failures on the debug bots
2039
2040         Reverted changeset:
2041
2042         "[Resource Timing] Gather timing information with reliable
2043         responseEnd time"
2044         https://bugs.webkit.org/show_bug.cgi?id=168351
2045         http://trac.webkit.org/changeset/212944
2046
2047 2017-02-24  Wenson Hsieh  <wenson_hsieh@apple.com>
2048
2049         Unreviewed, fix the internal build
2050
2051         * UIProcess/ios/WKContentViewInteraction.h:
2052
2053 2017-02-24  Matt Rajca  <mrajca@apple.com>
2054
2055         Media: notify clients when autoplay is denied
2056         https://bugs.webkit.org/show_bug.cgi?id=168840
2057
2058         Reviewed by Alex Christensen.
2059
2060         * UIProcess/API/APIUIClient.h:
2061         (API::UIClient::handleAutoplayEvent):
2062         (API::UIClient::didPlayMediaPreventedFromPlayingWithoutUserGesture): Deleted.
2063         * UIProcess/API/C/WKPage.cpp:
2064         (WKPageSetPageUIClient):
2065         * UIProcess/API/C/WKPageUIClient.h:
2066         * UIProcess/WebPageProxy.cpp:
2067         (WebKit::WebPageProxy::handleAutoplayEvent):
2068         (WebKit::WebPageProxy::didPlayMediaPreventedFromPlayingWithoutUserGesture): Deleted.
2069         * UIProcess/WebPageProxy.h:
2070         * UIProcess/WebPageProxy.messages.in:
2071         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2072         (WebKit::WebChromeClient::handleAutoplayEvent):
2073         (WebKit::WebChromeClient::didPlayMediaPreventedFromPlayingWithoutUserGesture): Deleted.
2074         * WebProcess/WebCoreSupport/WebChromeClient.h:
2075
2076 2017-02-20  Wenson Hsieh  <wenson_hsieh@apple.com>
2077
2078         Refactor data interaction to use new WKDataInteraction SPI
2079         https://bugs.webkit.org/show_bug.cgi?id=168602
2080         Work towards <rdar://problem/30313681>
2081
2082         Reviewed by Tim Horton.
2083
2084         Adjust testing SPI to match new data interaction interfaces.
2085
2086         * Platform/spi/ios/UIKitSPI.h:
2087         * UIProcess/API/Cocoa/WKWebView.mm:
2088         (-[WKWebView _simulateDataInteractionEntered:]):
2089         (-[WKWebView _simulateDataInteractionUpdated:]):
2090         (-[WKWebView _simulateDataInteractionPerformOperation:]):
2091         (-[WKWebView _simulateDataInteractionEnded:]):
2092         (-[WKWebView _simulateDataInteractionSessionDidEnd:]):
2093         (-[WKWebView _simulateWillBeginDataInteractionWithSession:]):
2094         (-[WKWebView _simulatedItemsForSession:]):
2095         (-[WKWebView _simulatePrepareForDataInteractionSession:completion:]):
2096         (-[WKWebView _simulateDataInteractionSessionDidEnd:withOperation:]): Deleted.
2097         (-[WKWebView _simulateFailedDataInteractionWithIndex:]): Deleted.
2098         (-[WKWebView _simulateWillBeginDataInteractionWithIndex:withSession:]): Deleted.
2099         (-[WKWebView _simulatedItemsForDataInteractionWithIndex:]): Deleted.
2100         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2101         * UIProcess/ios/WKContentViewInteraction.h:
2102         * UIProcess/ios/WKContentViewInteraction.mm:
2103         (-[WKContentView _positionInformationDidChange:]):
2104         * UIProcess/ios/WKScrollView.h:
2105         * UIProcess/ios/WKScrollView.mm:
2106
2107 2017-02-20  Wenson Hsieh  <wenson_hsieh@apple.com>
2108
2109         Remove the data interaction gesture recognizer
2110         https://bugs.webkit.org/show_bug.cgi?id=168600
2111         <rdar://problem/30313681>
2112
2113         Reviewed by Anders Carlsson.
2114
2115         The data interaction gesture recognizer will no longer be needed moving forward.
2116
2117         * UIProcess/API/Cocoa/WKWebView.mm:
2118         (-[WKWebView _simulateDataInteractionGestureRecognized]): Deleted.
2119         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2120         * UIProcess/ios/WKContentViewInteraction.h:
2121         * UIProcess/ios/WKContentViewInteraction.mm:
2122         (-[WKContentView setupInteraction]):
2123         (-[WKContentView cleanupInteraction]):
2124         (-[WKContentView _removeDefaultGestureRecognizers]):
2125         (-[WKContentView _addDefaultGestureRecognizers]):
2126         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
2127         (-[WKContentView gestureRecognizerShouldBegin:]):
2128         (-[WKContentView _dataInteractionGestureRecognizer]): Deleted.
2129
2130 2017-02-24  Chris Dumez  <cdumez@apple.com>
2131
2132         [iOS][WK2] Disable network cache speculative revalidation / loading in low power mode
2133         https://bugs.webkit.org/show_bug.cgi?id=168832
2134         <rdar://problem/30697911>
2135
2136         Reviewed by Antti Koivisto.
2137
2138         Disable network cache speculative revalidation / loading in low power mode on iOS to
2139         save battery.
2140
2141         * NetworkProcess/cache/NetworkCache.cpp:
2142         (WebKit::NetworkCache::Cache::initialize):
2143         * NetworkProcess/cache/NetworkCache.h:
2144
2145 2017-02-24  John Wilander  <wilander@apple.com>
2146
2147         Resource Load Statistics: Add alternate classification method
2148         https://bugs.webkit.org/show_bug.cgi?id=168347
2149         <rdar://problem/30352793>
2150         <rdar://problem/30646710>
2151         <rdar://problem/30660708>
2152
2153         Reviewed by Alex Christensen.
2154
2155         This patch adds a CorePrediction-based classifier to the WebResourceLoadStatisticsStore.
2156         The CorePrediction framework is introduced as a dependency for macOS and iOS. The patch
2157         also adds functions to support layout tests of the feature.
2158
2159         * Platform/Logging.h:
2160             Added channel ResourceLoadStatistics.
2161         * Platform/classifier/ResourceLoadStatisticsClassifier.h: Added.
2162             Pulls in the Cocoa-specific classifier for Cocoa-based platforms.
2163         (WebKit::ResourceLoadStatisticsClassifier::ResourceLoadStatisticsClassifier):
2164         * Platform/classifier/ResourceLoadStatisticsClassifierBase.cpp: Added.
2165         (WebKit::ResourceLoadStatisticsClassifierBase::hasPrevalentResourceCharacteristics):
2166             Shared classifier logic.
2167         (WebKit::ResourceLoadStatisticsClassifierBase::classifyWithVectorThreshold):
2168             Fallback classifier for when we don't have CorePrediction.
2169         * Platform/classifier/ResourceLoadStatisticsClassifierBase.h: Added.
2170         (WebKit::ResourceLoadStatisticsClassifierBase::ResourceLoadStatisticsClassifierBase):
2171         (WebKit::ResourceLoadStatisticsClassifierBase::~ResourceLoadStatisticsClassifierBase):
2172         * Platform/classifier/cocoa/CorePredictionSoftLink.h: Added.
2173             Soft links to CorePrediction and the two functions we use from it.
2174         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: Added.
2175         (WebKit::ResourceLoadStatisticsClassifier::classify):
2176         (WebKit::ResourceLoadStatisticsClassifier::storagePath):
2177         (WebKit::ResourceLoadStatisticsClassifier::shouldUseCorePredictionAndHaveModelLoaded):
2178         (WebKit::ResourceLoadStatisticsClassifier::singletonPredictionModel):
2179             The new classifier for Cocoa platforms.
2180         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h: Added.
2181         * PlatformGTK.cmake:
2182             Added Platform/classifier directory and ResourceLoadStatisticsClassifierBase.cpp.
2183         * PlatformMac.cmake:
2184             Added Platform/classifier and Platform/classifier/cocoa directories, and
2185             source files ResourceLoadStatisticsClassifierBase.cpp and
2186             ResourceLoadStatisticsClassifierCocoa.cpp
2187         * Resources/ResourceLoadStatistics/corePrediction_model: Added.
2188             Model file to load into CorePrediction.
2189         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
2190         (WKResourceLoadStatisticsManagerSetSubframeUnderTopFrameOrigin):
2191         (WKResourceLoadStatisticsManagerSetSubresourceUnderTopFrameOrigin):
2192         (WKResourceLoadStatisticsManagerSetSubresourceUniqueRedirectTo):
2193             Test infrastructure.
2194         * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
2195         * UIProcess/WebResourceLoadStatisticsManager.cpp:
2196         (WebKit::WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin):
2197         (WebKit::WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin):
2198         (WebKit::WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo):
2199             Test infrastructure.
2200         * UIProcess/WebResourceLoadStatisticsManager.h:
2201         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2202         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2203             Renamed m_storagePath to m_statisticsStoragePath for clarity.
2204         (WebKit::WebResourceLoadStatisticsStore::classifyResource):
2205             Now calls the classifier through its ResourceLoadStatisticsClassifier
2206             member variable.
2207         (WebKit::WebResourceLoadStatisticsStore::persistentStoragePath):
2208             Renamed m_storagePath to m_statisticsStoragePath for clarity.
2209         (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
2210             Renamed m_storagePath to m_statisticsStoragePath for clarity.
2211         (WebKit::WebResourceLoadStatisticsStore::hasPrevalentResourceCharacteristics): Deleted.
2212         * UIProcess/WebResourceLoadStatisticsStore.h:
2213         * WebKit2.xcodeproj/project.pbxproj:
2214             Added the new classifier source files under Platform/classifier and the
2215             corePrediction_model file under Resources/ResourceLoadStatistics.
2216
2217 2017-02-23  Joseph Pecoraro  <pecoraro@apple.com>
2218
2219         [Resource Timing] Add Experimental Feature Flag
2220         https://bugs.webkit.org/show_bug.cgi?id=167147
2221
2222         Reviewed by Ryosuke Niwa.
2223
2224         * Shared/WebPreferencesDefinitions.h:
2225         Move ResourceTiming to experimental section.
2226         Disable it for El Capitan due to known issues.
2227
2228 2017-02-23  Joseph Pecoraro  <pecoraro@apple.com>
2229
2230         [Resource Timing] Gather timing information with reliable responseEnd time
2231         https://bugs.webkit.org/show_bug.cgi?id=168351
2232
2233         Reviewed by Alex Christensen.
2234
2235         Change from an unused `double finishTime` to a complete WebCore::NetworkLoadMetrics
2236         object in the didFinishLoad ResourceLoader path. We may also extend this in the
2237         didFail path later on. This allows the NetworkProcess to give complete timing
2238         information, and more final metrics about the load, to WebCore.
2239
2240         * NetworkProcess/NetworkDataTask.h:
2241         (WebKit::NetworkDataTaskClient::didCompleteWithError):
2242         Give the NetworkDataTaskClient a basic didCompleteWithError for a completion
2243         without metrics. For loads that complete with an error, or haven't populated
2244         any metrics, this will pass empty metrics onward.
2245
2246         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
2247         (WebKit::BlobDownloadClient::didFinishLoading):
2248         * NetworkProcess/Downloads/BlobDownloadClient.h:
2249         * NetworkProcess/Downloads/PendingDownload.h:
2250         * NetworkProcess/PingLoad.h:
2251         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2252         (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
2253         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
2254         * NetworkProcess/NetworkDataTaskBlob.cpp:
2255         (WebKit::NetworkDataTaskBlob::didFail):
2256         * NetworkProcess/NetworkLoad.cpp:
2257         (WebKit::NetworkLoad::continueWillSendRequest):
2258         (WebKit::NetworkLoad::didCompleteWithError):
2259         (WebKit::NetworkLoad::didFinishLoading):
2260         * NetworkProcess/NetworkLoad.h:
2261         * NetworkProcess/NetworkLoadClient.h:
2262         * NetworkProcess/NetworkResourceLoader.cpp:
2263         (WebKit::NetworkResourceLoader::didFinishLoading):
2264         (WebKit::NetworkResourceLoader::sendResultForCacheEntry):
2265         * NetworkProcess/NetworkResourceLoader.h:
2266         * WebProcess/Network/WebResourceLoader.cpp:
2267         (WebKit::WebResourceLoader::didFinishResourceLoad):
2268         (WebKit::WebResourceLoader::didReceiveResource):
2269         * WebProcess/Network/WebResourceLoader.h:
2270         * WebProcess/Network/WebResourceLoader.messages.in:
2271         Change didFinishLoad paths to take a NetworkLoadMetrics object instead of finishTime.
2272         Change didCompleteWithError pathes to include a NetworkLoadMetrics object instead of finishTime.
2273
2274         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2275         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2276         (WebKit::NetworkDataTaskCocoa::didCompleteWithError):
2277         Own a NetworkLoadTiming that will be populated with the load.
2278
2279         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
2280         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2281         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
2282         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
2283         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
2284         Populate NetworkLoadMetrics in the didFinishCollectingMetrics NSURLSessionTaskDelegate method.
2285
2286         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2287         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
2288         (WebKit::NetworkDataTaskSoup::timeoutFired):
2289         (WebKit::NetworkDataTaskSoup::didSendRequest):
2290         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
2291         (WebKit::NetworkDataTaskSoup::dispatchDidCompleteWithError):
2292         (WebKit::NetworkDataTaskSoup::tlsErrorsChanged):
2293         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
2294         (WebKit::NetworkDataTaskSoup::didFinishRead):
2295         (WebKit::NetworkDataTaskSoup::didFinishRequestNextPart):
2296         (WebKit::NetworkDataTaskSoup::didFailDownload):
2297         (WebKit::NetworkDataTaskSoup::didFail):
2298         (WebKit::NetworkDataTaskSoup::networkEvent):
2299         (WebKit::NetworkDataTaskSoup::didStartRequest):
2300         (WebKit::NetworkDataTaskSoup::didRestart):
2301         * NetworkProcess/soup/NetworkDataTaskSoup.h:
2302         Instead of populating the NetworkLoadMetrics on the ResourceResponse, populate
2303         a member variable during the entire load and dispatch didFinishCollectingMetrics
2304         right before didCompleteLoadWithError.
2305
2306 2017-02-23  Beth Dakin  <bdakin@apple.com> + Dan Saunders  <dasau@microsoft.com>
2307
2308         No reliable way to get a snapshot of WKWebView
2309         https://bugs.webkit.org/show_bug.cgi?id=161450
2310         -and corresponding-
2311         <rdar://problem/23846039>
2312
2313         Reviewed by Tim Horton.
2314
2315         This patch adds a new API to WKWebView to snapshot a rect:
2316         takeSnapshotWithConfiguration:completionHandler:
2317
2318         It also adds a new API object WKSnapshotConfiguration.
2319
2320         * UIProcess/API/Cocoa/WKSnapshotConfiguration.h: Added.
2321         * UIProcess/API/Cocoa/WKSnapshotConfiguration.mm: Added.
2322         (-[WKSnapshotConfiguration copyWithZone:]):
2323         * UIProcess/API/Cocoa/WKWebView.h:
2324         * UIProcess/API/Cocoa/WKWebView.mm:
2325         (-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):
2326         * WebKit2.xcodeproj/project.pbxproj:
2327
2328 2017-02-23  Jer Noble  <jer.noble@apple.com>
2329
2330         ASSERT in RTCNetwork::IPAddress::decode()
2331         https://bugs.webkit.org/show_bug.cgi?id=168792
2332
2333         Reviewed by Tim Horton.
2334
2335         An ASSERT added to RTCNetwork::IPAddress::decode in r212781 was hit due to a bad encode of SocketAddress; an
2336         extra boolean value was added to the encoder unnecessarily, leading to garbage data being decoded in the following
2337         IPAddress.
2338
2339         Drive-by-fix: allow the IPAddress encoder/decoder to pass through a value of AF_UNSPEC for an IPAddress to support
2340         passing through an "empty" IPAddress value.
2341
2342         * Shared/RTCNetwork.cpp:
2343         (WebKit::RTCNetwork::IPAddress::decode):
2344         (WebKit::RTCNetwork::IPAddress::encode):
2345         (WebKit::RTCNetwork::SocketAddress::encode):
2346
2347 2017-02-23  Eric Carlson  <eric.carlson@apple.com>
2348
2349         [WebRTC][Mac][WebKit2] WebRTC requires media capture
2350         https://bugs.webkit.org/show_bug.cgi?id=168782
2351         <rdar://problem/30675242>
2352
2353         Reviewed by Youenn Fablet.
2354
2355         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2356         (WebKit::WebProcessPool::platformInitializeWebProcess): Extend the sanbox to allow microphone access
2357         if media stream OR WebRTC is enabled.
2358
2359 2017-02-23  Brent Fulgham  <bfulgham@apple.com>
2360
2361         [Mac] Remove unneeded sandbox exceptions for media elements
2362         https://bugs.webkit.org/show_bug.cgi?id=168767
2363
2364         Reviewed by Alex Christensen.
2365
2366         Remove several sandbox exceptions that have not been needed for the past four
2367         or five macOS releases.
2368         
2369         * WebProcess/com.apple.WebProcess.sb.in:
2370
2371 2017-02-23  Brent Fulgham  <bfulgham@apple.com>
2372
2373         [Mac] Remove com.apple.audio.VDCAssistant from sandboxes
2374         https://bugs.webkit.org/show_bug.cgi?id=168764
2375         <rdar://problem/16736919>
2376
2377         Reviewed by Alex Christensen.
2378
2379         Remove unneeded sandbox class.
2380
2381         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2382         * WebProcess/com.apple.WebProcess.sb.in:
2383
2384 2017-02-22  Wenson Hsieh  <wenson_hsieh@apple.com>
2385
2386         Data interaction causes selection to fall out of sync between web/UI processes
2387         https://bugs.webkit.org/show_bug.cgi?id=168735
2388         <rdar://problem/30657817>
2389
2390         Reviewed by Tim Horton.
2391
2392         Fixes a bug with data interaction causing selection state to fall out of sync between the UI and web processes,
2393         and also introduces testing infrastructure and tests for grabbing UI-side selection view rects in TestWebKitAPI.
2394         While performing a data interaction operation, we now lift restrictions for assisting the focused node.
2395
2396         * UIProcess/ios/WKContentViewInteraction.h:
2397         * UIProcess/ios/WKContentViewInteraction.mm:
2398         (-[WKContentView cleanupInteraction]):
2399         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
2400
2401 2017-02-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2402
2403         [GTK] Crash attempting to load Flash plugin in Wayland
2404         https://bugs.webkit.org/show_bug.cgi?id=163159
2405
2406         Reviewed by Michael Catanzaro.
2407
2408         The problem is that we check if the current diplay is X11 or Wayland also in the plugin process, but with GTK2
2409         plugins the display is always X11. We should early reject plugins requiring GTK2 in the UI process when the
2410         current display is Wayland.
2411
2412         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
2413         (WebKit::PluginInfoStore::getPluginInfo):
2414         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
2415         (WebKit::PluginProcessProxy::scanPlugin):
2416         * UIProcess/gtk/WebPageProxyGtk.cpp:
2417         (WebKit::WebPageProxy::createPluginContainer): Add an assert to ensure this message is never received on a
2418         non-X11 display.
2419         * WebProcess/Plugins/PluginView.cpp:
2420         (WebKit::PluginView::createPluginContainer): Never send CreatePluginContainer message to the UI process if the
2421         display is not X11.
2422
2423 2017-02-23  Eric Carlson  <eric.carlson@apple.com>
2424
2425         [MediaStream iOS] Allow web process sandbox to be extended for media capture
2426         https://bugs.webkit.org/show_bug.cgi?id=168756
2427
2428         Reviewed by Brent Fulgham.
2429
2430         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Add rules to dynamically
2431         extend the sandbox to allow access to the camera and/or microphone.
2432
2433 2017-02-23  Tomas Popela  <tpopela@redhat.com>
2434
2435         [GTK] Drag and drop is always moving the content even if copy is requested
2436         https://bugs.webkit.org/show_bug.cgi?id=168424
2437
2438         Reviewed by Carlos Garcia Campos.
2439
2440         Drag and drop is always moving the content around even if the copy is
2441         requested (i.e. by pressing the Control key).
2442
2443         * UIProcess/gtk/DragAndDropHandler.cpp:
2444         (WebKit::DragAndDropHandler::drop):
2445
2446 2017-02-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2447
2448         Better handle Thread and RunLoop initialization
2449         https://bugs.webkit.org/show_bug.cgi?id=167828
2450
2451         Reviewed by Yusuke Suzuki.
2452
2453         Remove unnecessary call to WTF::initializeMainThread().
2454
2455         * Shared/WebKit2Initialize.cpp:
2456         (WebKit::InitializeWebKit2):
2457
2458 2017-02-22  Chris Dumez  <cdumez@apple.com>
2459
2460         Unreviewed, drop console logging landed by mistake as part of r212832.
2461
2462         * UIProcess/BackgroundProcessResponsivenessTimer.cpp:
2463         (WebKit::BackgroundProcessResponsivenessTimer::timerFired):
2464
2465 2017-02-22  Brent Fulgham  <bfulgham@apple.com>
2466
2467         [Mac] Tighten sandbox to deny process-info* access
2468         https://bugs.webkit.org/show_bug.cgi?id=168704
2469         <rdar://problem/16371441>
2470
2471         Reviewed by Alex Christensen.
2472
2473         Tighten the various WebKit sandboxes by denying access to process-info.
2474         Add back specific features needed to run WebKit tests and to do browsing
2475         of websites (including plugins).
2476
2477         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
2478         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2479         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2480         * WebProcess/com.apple.WebProcess.sb.in:
2481
2482 2017-02-22  Anders Carlsson  <andersca@apple.com>
2483
2484         Crash if there's a mismatch between the WebKit used by the UI process and child processes respectively
2485         https://bugs.webkit.org/show_bug.cgi?id=168739
2486         Part of rdar://problem/30631411.
2487
2488         Reviewed by Geoffrey Garen.
2489
2490         If the UI process and web process for some reason end up using different versions of the WebKit framework, weird things happen
2491         because the message format is different between versions. To avoid this, send along the WebKit bundle version from the UI process
2492         in the XPC bootstrap message, check that it matches inside the XPC main functions. If there's a mismatch, crash.
2493
2494         * Shared/Cocoa/ChildProcessCocoa.mm:
2495         (WebKit::ChildProcess::didReceiveInvalidMessage):
2496         Fix parameters.
2497
2498         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
2499         (main):
2500         Check for the bundle version and crash if it's not what we expect.
2501
2502         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2503         (WebKit::ProcessLauncher::launchProcess):
2504         Initialize the bundle version.
2505
2506         * WebProcess/cocoa/WebProcessCocoa.mm:
2507         (WebKit::_WKSetCrashReportApplicationSpecificInformation):
2508         Export this so we can call it from the XPC services without having to link WKSI.
2509
2510 2017-02-22  Chris Dumez  <cdumez@apple.com>
2511
2512         [WK2] Call processDidBecomeUnresponsive delegate when a background process is unresponsive
2513         https://bugs.webkit.org/show_bug.cgi?id=168683
2514         <rdar://problem/30558745>
2515
2516         Reviewed by Dan Bernstein.
2517
2518         Call processDidBecomeUnresponsive delegate when a background process is unresponsive
2519         instead of killing it on WebKit side. This gives the client the choice about what it
2520         wants to do about this process.
2521
2522         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2523         (API::ProcessPoolConfiguration::copy):
2524         * UIProcess/API/APIProcessPoolConfiguration.h:
2525         * UIProcess/API/C/WKContext.cpp:
2526         * UIProcess/API/C/WKContextPrivate.h:
2527         * UIProcess/BackgroundProcessResponsivenessTimer.cpp: Renamed from Source/WebKit2/UIProcess/UnresponsiveWebProcessTerminator.cpp.
2528         (WebKit::BackgroundProcessResponsivenessTimer::BackgroundProcessResponsivenessTimer):
2529         (WebKit::BackgroundProcessResponsivenessTimer::updateState):
2530         (WebKit::BackgroundProcessResponsivenessTimer::timerFired):
2531         * UIProcess/BackgroundProcessResponsivenessTimer.h: Renamed from Source/WebKit2/UIProcess/UnresponsiveWebProcessTerminator.h.
2532         * UIProcess/WebPageProxy.cpp:
2533         (WebKit::WebPageProxy::reattachToWebProcess):
2534         (WebKit::WebPageProxy::dispatchActivityStateChange):
2535         (WebKit::WebPageProxy::terminateProcess):
2536         * UIProcess/WebPageProxy.h:
2537         * UIProcess/WebProcessProxy.cpp:
2538         (WebKit::m_backgroundResponsivenessTimer):
2539         * UIProcess/WebProcessProxy.h:
2540         * WebKit2.xcodeproj/project.pbxproj:
2541
2542 2017-02-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2543
2544         NetworkProcess: Stop disabling buffering when NETWORK_CACHE is disabled in build
2545         https://bugs.webkit.org/show_bug.cgi?id=168637
2546
2547         Reviewed by Alex Christensen.
2548
2549         It was added in r193752 as part of bug #137692 to fix an infinite loop in network process that happened in EFL
2550         because they didn't enable the network cache at that time. I think that was actually a workaround, and it was
2551         added without any comment so it has stayed there even when EFL enabled disk cache, and now that is gone. Looking
2552         at current code I see no reason why buffering can't work with the disk cache disabled, so I think it's time to
2553         remove that workaround.
2554
2555         * WebProcess/Network/WebLoaderStrategy.cpp:
2556         (WebKit::maximumBufferingTime):
2557
2558 2017-02-21  Youenn Fablet  <youenn@apple.com>
2559
2560         [WebRTC][Mac] Activate libwebrtc
2561         https://bugs.webkit.org/show_bug.cgi?id=167293
2562         <rdar://problem/30401864>
2563
2564         Reviewed by Alex Christensen.
2565
2566         Activating PeerConnection runtime flag based on successful loading of libwebrtc.dylib.
2567
2568         * Configurations/WebKit.xcconfig:
2569         * Configurations/FeatureDefines.xcconfig:
2570         * Shared/WebPreferencesDefinitions.h:
2571         * UIProcess/WebPreferences.cpp:
2572         (WebKit::checkWebRTCAvailability):
2573
2574 2017-02-21  Commit Queue  <commit-queue@webkit.org>
2575
2576         Unreviewed, rolling out r212786.
2577         https://bugs.webkit.org/show_bug.cgi?id=168710
2578
2579         It broke GTK+ port when using single shared process model
2580         (Requested by KaL on #webkit).
2581
2582         Reverted changeset:
2583
2584         "Refactor WebViewImpl creation in preparation for supporting
2585         multiple WebsiteDataStores."
2586         https://bugs.webkit.org/show_bug.cgi?id=168676
2587         http://trac.webkit.org/changeset/212786
2588
2589 2017-02-21  Brady Eidson  <beidson@apple.com>
2590
2591         Refactor WebViewImpl creation in preparation for supporting multiple WebsiteDataStores.
2592         https://bugs.webkit.org/show_bug.cgi?id=168676
2593
2594         Reviewed by Alex Christensen.
2595
2596         * UIProcess/API/Cocoa/WKWebView.mm:
2597         (-[WKWebView _initializeWithConfiguration:]): Allow for WebViewImpl creation to fail.
2598
2599         * UIProcess/API/mac/WKView.mm:
2600         (-[WKView initWithFrame:processPool:configuration:]): Ditto.
2601
2602         * UIProcess/Cocoa/WebViewImpl.h:
2603         * UIProcess/Cocoa/WebViewImpl.mm:
2604         (WebKit::WebViewImpl::maybeCreate):
2605         (WebKit::WebViewImpl::WebViewImpl):
2606
2607         * UIProcess/WebPageProxy.cpp:
2608         (WebKit::WebPageProxy::reattachToWebProcess): New WebProcess creation might fail. Handle it.
2609         * UIProcess/WebProcessPool.cpp:
2610         (WebKit::WebProcessPool::createNewWebProcess):
2611         (WebKit::WebProcessPool::warmInitialProcess):
2612         (WebKit::WebProcessPool::maybeCreateNewWebProcessRespectingProcessCountLimit): This can now fail
2613           if the process will have a non-default WebsiteDataStore but we've already reached the process cap.
2614         (WebKit::WebProcessPool::createWebPage):
2615         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit): Deleted.
2616         * UIProcess/WebProcessPool.h:
2617
2618 2017-02-21  Youenn Fablet  <youenn@apple.com>
2619
2620         [WebRTC] WebKit2 should assert that libwebrtc transmitted IP addresses family is IP4 or IP6
2621         https://bugs.webkit.org/show_bug.cgi?id=168691
2622
2623         Reviewed by Alex Christensen.
2624
2625         Adding some asserts that family is IPv4 or IPv6.
2626
2627         * Shared/RTCNetwork.cpp:
2628         (WebKit::RTCNetwork::IPAddress::decode):
2629         (WebKit::RTCNetwork::IPAddress::encode):
2630
2631 2017-02-20  Simon Fraser  <simon.fraser@apple.com>
2632
2633         Add support to PlatformCALayer/GraphicsLayerCA for subpixel-antialiased text, with a Setting and a MiniBrowser switch
2634         https://bugs.webkit.org/show_bug.cgi?id=168620
2635         <rdar://problem/30617772>
2636
2637         Reviewed by Tim Horton.
2638
2639         Add a Setting for subpixel-antialiased layer text. Plumb this through GraphicsLayerCA and
2640         PlatformCALayer, where it ultimately affects the layer contents format.
2641         
2642         This is not supported with UI-side compositing.
2643
2644         * Shared/WebPreferencesDefinitions.h:
2645         * UIProcess/API/C/WKPreferences.cpp:
2646         (WKPreferencesSetSubpixelAntialiasedLayerTextEnabled):
2647         (WKPreferencesGetSubpixelAntialiasedLayerTextEnabled):
2648         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2649         * UIProcess/API/Cocoa/WKPreferences.mm:
2650         (-[WKPreferences _subpixelAntialiasedLayerTextEnabled]):
2651         (-[WKPreferences _setSubpixelAntialiasedLayerTextEnabled:]):
2652         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2653         * WebProcess/WebPage/WebPage.cpp:
2654         (WebKit::WebPage::updatePreferences):
2655         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2656         (WebKit::PlatformCALayerRemote::supportsSubpixelAntialiasedText):
2657         (WebKit::PlatformCALayerRemote::setSupportsSubpixelAntialiasedText):
2658         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2659         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
2660         (WebKit::PlatformCALayerRemoteTiledBacking::supportsSubpixelAntialiasedText):
2661         (WebKit::PlatformCALayerRemoteTiledBacking::setSupportsSubpixelAntialiasedText):
2662         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
2663
2664 2017-02-21  John Wilander  <wilander@apple.com>
2665
2666         Resource Load Statistics: Only scan website data store once per session ID + reinstate removal counting
2667         https://bugs.webkit.org/show_bug.cgi?id=168541
2668
2669         Reviewed by Alex Christensen.
2670
2671         * UIProcess/WebProcessProxy.cpp:
2672         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyOwnedDomainsInAllPersistentDataStores):
2673             The CallbackAggregator now merges a list of domains for which we
2674             have removed data records and eventually reports this back to the
2675             caller.
2676         * UIProcess/WebProcessProxy.h:
2677         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2678         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
2679             Now reports back to its WebCore::ResourceLoadStatisticsStore
2680             which domains have had data records removed.
2681         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2682         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyOwnedDomains):
2683             The completion handler now handles data record removal counting.
2684         (WebKit::WebsiteDataStore::removeDataForTopPrivatelyOwnedDomains):
2685             The completion handler now handles data record removal counting.
2686         * UIProcess/WebsiteData/WebsiteDataStore.h:
2687
2688 2017-02-21  Alex Christensen  <achristensen@webkit.org>
2689
2690         Fix CMake build.
2691
2692         * PlatformMac.cmake:
2693
2694 2017-02-21  Youenn Fablet  <youenn@apple.com>
2695
2696         [WebRTC][Mac] Network process sandbox does not allow WebRTC networking
2697         https://bugs.webkit.org/show_bug.cgi?id=168594
2698
2699         Reviewed by Brent Fulgham.
2700
2701         UIProcess was passing a boolean to know whether WebRTC networking is allowed or not to the network process.
2702         This boolean was known to late for the sandbox to be relaxed.
2703         A sandbox extension is now used instead to relax the sandbox.
2704
2705         * NetworkProcess/NetworkProcess.h:
2706         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2707         (WebKit::NetworkProcessCreationParameters::encode):
2708         (WebKit::NetworkProcessCreationParameters::decode):
2709         * NetworkProcess/NetworkProcessCreationParameters.h:
2710         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2711         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
2712         * NetworkProcess/mac/NetworkProcessMac.mm:
2713         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
2714         (WebKit::NetworkProcess::initializeSandbox):
2715         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2716         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2717         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2718
2719 2017-02-21  Youenn Fablet  <youenn@apple.com>
2720
2721         [WebRTC] ICE candidates should be filtered according a policy
2722         https://bugs.webkit.org/show_bug.cgi?id=168348
2723
2724         Reviewed by Alex Christensen.
2725
2726         Adding the possibility for the UI process to control the ICE candidate filtering and whether libwebrtc can
2727         enumerate all interfaces or not.
2728
2729         Disabling ICE candidate filtering for the moment.
2730         Enabling to enumerate all interfaces for the moment.
2731
2732         In the future, ICE candidate filtering should be tied to getUserMedia.
2733         Interface enumeration should be disabled with the default configuration.
2734         We should do that once we have sufficient testing in various network infrastructures.
2735
2736         * UIProcess/WebPageProxy.cpp:
2737         (WebKit::WebPageProxy::initializeWebPage):
2738         * WebKit2.xcodeproj/project.pbxproj:
2739         * WebProcess/WebPage/WebPage.h:
2740         (WebKit::WebPage::disableICECandidateFiltering):
2741         (WebKit::WebPage::enableICECandidateFiltering):
2742         (WebKit::WebPage::disableEnumeratingAllNetworkInterfaces):
2743         (WebKit::WebPage::enableEnumeratingAllNetworkInterfaces):
2744         * WebProcess/WebPage/WebPage.messages.in:
2745
2746 2017-02-21  Youenn Fablet  <youenn@apple.com>
2747
2748         [WebRTC] NetworkRTCMonitor should ensure clearing its manager only once
2749         https://bugs.webkit.org/show_bug.cgi?id=168661
2750
2751         Reviewed by Alex Christensen.
2752
2753         Making sure NetworkRTCMonitor manager is cleared only once.
2754         ALso ensuring that manager does not get destroyed as part of NetworkRTCMonitor destructor.
2755         The manager needs to be destroyed in the RTC network thread.
2756
2757         * NetworkProcess/webrtc/NetworkRTCMonitor.cpp:
2758         (WebKit::NetworkRTCMonitor::~NetworkRTCMonitor):
2759         (WebKit::NetworkRTCMonitor::stopUpdating):
2760         * NetworkProcess/webrtc/NetworkRTCMonitor.h:
2761
2762 2017-02-21  Brent Fulgham  <bfulgham@apple.com>
2763
2764         [WebRTC][Mac][WebKit2] Revise sandbox to limit connections to UDP and TCP
2765         https://bugs.webkit.org/show_bug.cgi?id=168664
2766         <rdar://problem/30600587>
2767
2768         Reviewed by Youenn Fablet.
2769
2770         Add filters to the WebRTC rule to limit network traffic to UDP and TCP.
2771
2772         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2773
2774 2017-02-21  Maureen Daum  <mdaum@apple.com>
2775
2776         Check what LocalStorage data exists in deleteDatabasesModifiedSince() before attempting deletion.
2777         https://bugs.webkit.org/show_bug.cgi?id=168659
2778         rdar://problem/22781730
2779
2780         Reviewed by Brady Eidson.
2781
2782         Check what LocalStorage data exists in deleteDatabasesModifiedSince() before attempting deletion.
2783         It is possible that another process has caused information to be added to LocalStorage
2784         after we created this LocalStorageDatabaseTracker instance, so we should update our
2785         internal state by checking the contents of StorageTracker.db and the other local
2786         storage files so we know what databases actually exist. By calling importOriginIdentifiers()
2787         at the start of deleteDatabasesModifiedSince(), m_origins will now have the up-to-date
2788         list of origins LocalStorage contains data for.
2789
2790         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
2791         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
2792
2793 2017-02-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2794
2795         Reduce platform ifdefs in WebKit2 custom protocols implementation
2796         https://bugs.webkit.org/show_bug.cgi?id=165028
2797
2798         Reviewed by Darin Adler.
2799
2800         Make mac implementation use the APICustomProtocolManagerClient to share more code with the soup based ports.
2801
2802         * CMakeLists.txt: Add CustomProtocolManagerProxy.cpp.
2803         * PlatformEfl.cmake: Remove CustomProtocolManagerProxySoup.cpp.
2804         * PlatformGTK.cmake: Ditto.
2805         * PlatformMac.cmake: Remove CustomProtocolManagerProxyMac.mm.
2806         * UIProcess/API/APICustomProtocolManagerClient.h:
2807         (API::CustomProtocolManagerClient::startLoading): Make it void, since we were always returning true and the
2808         returned value was ignored.
2809         * UIProcess/API/efl/ewk_url_scheme_request.cpp:
2810         (EwkUrlSchemeRequest::finish): Update to new CustomProtocolManagerProxy API.
2811         * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp:
2812         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
2813         (webkitURISchemeRequestReadCallback): Ditto.
2814         * UIProcess/Cocoa/CustomProtocolManagerClient.h: Added.
2815         * UIProcess/Cocoa/CustomProtocolManagerClient.mm: Added.
2816         (-[WKCustomProtocolLoader initWithCustomProtocolManagerProxy:customProtocolID:request:]):
2817         (-[WKCustomProtocolLoader dealloc]):
2818         (-[WKCustomProtocolLoader connection:didFailWithError:]):
2819         (-[WKCustomProtocolLoader connection:didReceiveResponse:]):
2820         (-[WKCustomProtocolLoader connection:didReceiveData:]):
2821         (-[WKCustomProtocolLoader connection:willSendRequest:redirectResponse:]):
2822         (-[WKCustomProtocolLoader connectionDidFinishLoading:]):
2823         (WebKit::CustomProtocolManagerClient::startLoading):
2824         (WebKit::CustomProtocolManagerClient::stopLoading):
2825         (WebKit::CustomProtocolManagerClient::invalidate):
2826         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2827         (WebKit::WebProcessPool::platformInitialize): Set the CustomProtocolManagerClient.
2828         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Remove code that is now shared.
2829         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.cpp: Added.
2830         (WebKit::CustomProtocolManagerProxy::startLoading):
2831         (WebKit::CustomProtocolManagerProxy::processDidClose):
2832         (WebKit::CustomProtocolManagerProxy::wasRedirectedToRequest):
2833         (WebKit::CustomProtocolManagerProxy::didReceiveResponse):
2834         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
2835         * UIProcess/WebProcessPool.cpp:
2836         (WebKit::globalURLSchemesWithCustomProtocolHandlers): Just moved here to use it from ensureNetworkProcess().
2837         (WebKit::WebProcessPool::WebProcessPool): Remove soup ifdefs.
2838         (WebKit::WebProcessPool::setCustomProtocolManagerClient): Moved from the soup implementation.
2839         (WebKit::WebProcessPool::ensureNetworkProcess): Initialize custom protocols parameters.
2840         (WebKit::WebProcessPool::registerSchemeForCustomProtocol): Register the protocol if not already registered globally.
2841         (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): Remove soup ifdefs.
2842         * UIProcess/WebProcessPool.h: Remove soup ifdefs.
2843         * UIProcess/efl/RequestManagerClientEfl.cpp:
2844         * UIProcess/soup/WebProcessPoolSoup.cpp:
2845         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Remove code that is now shared.
2846         * WebKit2.xcodeproj/project.pbxproj:
2847
2848 2017-02-21  Daewoong Jang  <daewoong.jang@navercorp.com>
2849
2850         Remove unused files.
2851         https://bugs.webkit.org/show_bug.cgi?id=168656.
2852
2853         Reviewed by Csaba Osztrogonác.
2854
2855         Remove files which became unused after removal of EFL port.
2856
2857         * UIProcess/CoordinatedGraphics/PageViewportController.cpp: Removed.
2858         * UIProcess/CoordinatedGraphics/PageViewportController.h: Removed.
2859         * UIProcess/PageViewportControllerClient.h: Removed.
2860
2861 2017-02-21  Youenn Fablet  <youenn@apple.com>
2862
2863         [WebRTC] LibWebRTCSocket::SendTo message should have a correct SocketAddress
2864         https://bugs.webkit.org/show_bug.cgi?id=168636
2865
2866         Reviewed by Eric Carlson.
2867
2868         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
2869         (WebKit::LibWebRTCSocket::SendTo): Ensuring address remains valid during SendTo message lifetime.
2870
2871 2017-02-21  Alex Christensen  <achristensen@webkit.org>
2872
2873         Unreviewed, rolling out r212699.
2874
2875         Internal build not ready
2876
2877         Reverted changeset:
2878
2879         "[WebRTC][Mac] Activate libwebrtc"
2880         https://bugs.webkit.org/show_bug.cgi?id=167293
2881         http://trac.webkit.org/changeset/212699
2882
2883 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2884
2885         Remove ENABLE_THREADED_COMPOSITOR build option
2886         https://bugs.webkit.org/show_bug.cgi?id=168606
2887
2888         Reviewed by Michael Catanzaro.
2889
2890         Now that we have AC mode on demand with the threaded compositor there's no reason to keep the old AC code.
2891
2892         * PlatformGTK.cmake:
2893         * WebProcess/WebPage/LayerTreeHost.cpp:
2894         (WebKit::LayerTreeHost::create):
2895         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: Removed.
2896         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h: Removed.
2897
2898 2017-02-20  Youenn Fablet  <youenn@apple.com>
2899
2900         [WebRTC][Mac] Activate libwebrtc
2901         https://bugs.webkit.org/show_bug.cgi?id=167293
2902         <rdar://problem/30401864>
2903
2904         Reviewed by Alex Christensen.
2905
2906         Activating PeerConnection runtime flag based on successful loading of libwebrtc.dylib.
2907
2908         * Configurations/WebKit.xcconfig:
2909         * Shared/WebPreferencesDefinitions.h:
2910         * UIProcess/WebPreferences.cpp:
2911         (WebKit::checkWebRTCAvailability):
2912
2913 2017-02-20  Ryan Haddad  <ryanhaddad@apple.com>
2914
2915         Unreviewed, rolling out r212685.
2916
2917         This change broke the 32-bit Sierra build.
2918
2919         Reverted changeset:
2920
2921         "Resource Load Statistics: Add alternate classification
2922         method"
2923         https://bugs.webkit.org/show_bug.cgi?id=168347
2924         http://trac.webkit.org/changeset/212685
2925
2926 2017-02-20  John Wilander  <wilander@apple.com>
2927
2928         Resource Load Statistics: Add alternate classification method
2929         https://bugs.webkit.org/show_bug.cgi?id=168347
2930         <rdar://problem/30352793>
2931
2932         Reviewed by Alex Christensen.
2933
2934         This patch adds a CorePrediction-based classifier to the WebResourceLoadStatisticsStore.
2935         The CorePrediction framework is introduced as a dependency for macOS and iOS. The patch
2936         also adds functions to support layout tests of the feature.
2937
2938         * Configurations/BaseTarget.xcconfig:
2939         * Configurations/WebKit.xcconfig:
2940             Added dependency on CorePrediction.
2941         * Platform/classifier: Added.
2942         * Platform/classifier/ResourceLoadStatisticsClassifier.h: Added.
2943             Pulls in the Cocoa-specific classifier for Cocoa-based platforms.
2944         (WebKit::ResourceLoadStatisticsClassifier::ResourceLoadStatisticsClassifier):
2945         * Platform/classifier/ResourceLoadStatisticsClassifierBase.cpp: Added.
2946         (WebKit::ResourceLoadStatisticsClassifierBase::hasPrevalentResourceCharacteristics):
2947             Shared classifier logic.
2948         (WebKit::ResourceLoadStatisticsClassifierBase::classifyWithVectorThreshold):
2949             Fallback classifier for when we don't have CorePrediction.
2950         * Platform/classifier/ResourceLoadStatisticsClassifierBase.h: Added.
2951         (WebKit::ResourceLoadStatisticsClassifierBase::ResourceLoadStatisticsClassifierBase):
2952         (WebKit::ResourceLoadStatisticsClassifierBase::~ResourceLoadStatisticsClassifierBase):
2953         * Platform/classifier/cocoa: Added.
2954         * Platform/classifier/cocoa/CorePredictionSPI.h: Added.
2955             Includes CorePrediction if available, otherwise declares needed symbols.
2956             Always redeclares the functions so we'll get a build error if
2957             CorePrediction changes.
2958         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: Added.
2959         (WebKit::ResourceLoadStatisticsClassifier::classify):
2960         (WebKit::ResourceLoadStatisticsClassifier::storagePath):
2961         (WebKit::ResourceLoadStatisticsClassifier::shouldUseCorePrediction):
2962             The new classifier for Cocoa platforms.
2963         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h: Added.
2964         (WebKit::ResourceLoadStatisticsClassifier::ResourceLoadStatisticsClassifier):
2965         * PlatformGTK.cmake:
2966            Added Platform/classifier directory and ResourceLoadStatisticsClassifierBase.cpp.
2967         * PlatformMac.cmake:
2968            Added Platform/classifier and Platform/classifier/cocoa directories, and
2969            source files ResourceLoadStatisticsClassifierBase.cpp and
2970            ResourceLoadStatisticsClassifierCocoa.cpp
2971         * Resources/ResourceLoadStatistics: Added.
2972         * Resources/ResourceLoadStatistics/corePrediction_model: Added.
2973             Model file to load into CorePrediction.
2974         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
2975         (WKResourceLoadStatisticsManagerSetSubframeUnderTopFrameOrigin):
2976         (WKResourceLoadStatisticsManagerSetSubresourceUnderTopFrameOrigin):
2977         (WKResourceLoadStatisticsManagerSetSubresourceUniqueRedirectTo):
2978             Test infrastructure.
2979         * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
2980         * UIProcess/WebResourceLoadStatisticsManager.cpp:
2981         (WebKit::WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin):
2982         (WebKit::WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin):
2983         (WebKit::WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo):
2984             Test infrastructure.
2985         * UIProcess/WebResourceLoadStatisticsManager.h:
2986         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2987         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2988             Renamed m_storagePath to m_statisticsStoragePath for clarity.
2989         (WebKit::WebResourceLoadStatisticsStore::classifyResource):
2990             Now calls the classifier through its ResourceLoadStatisticsClassifier
2991             member variable.
2992         (WebKit::WebResourceLoadStatisticsStore::persistentStoragePath):
2993             Renamed m_storagePath to m_statisticsStoragePath for clarity.
2994         (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
2995             Renamed m_storagePath to m_statisticsStoragePath for clarity.
2996         (WebKit::WebResourceLoadStatisticsStore::hasPrevalentResourceCharacteristics): Deleted.
2997         * UIProcess/WebResourceLoadStatisticsStore.h:
2998         * WebKit2.xcodeproj/project.pbxproj:
2999             Added the new classifier source files under Platform/classifier and the
3000             corePrediction_model file under Resources/ResourceLoadStatistics.
3001
3002 2017-02-20  Wenson Hsieh  <wenson_hsieh@apple.com>
3003
3004         Add plumbing to the UI process for TextIndicatorData when computing the drag image
3005         https://bugs.webkit.org/show_bug.cgi?id=168583
3006         Work towards <rdar://problem/30313681>
3007
3008         Reviewed by Tim Horton.
3009
3010         Changes the SetDragImage IPC message to send TextIndicatorData over to the UI process. Also changes the boolean
3011         isLink parameter to be a DragSourceAction instead, leaving it up to the receiving end (in the UI process) to
3012         special case links.
3013
3014         Additionally, renames hasDataInteractionAtPosition to hasSelectionAtPosition to better reflect its purpose.
3015
3016         These changes are only infrastructural should not alter any behaviors.
3017
3018         * Shared/ios/InteractionInformationAtPosition.h:
3019         * Shared/ios/InteractionInformationAtPosition.mm:
3020         (WebKit::InteractionInformationAtPosition::encode):
3021         (WebKit::InteractionInformationAtPosition::decode):
3022         * UIProcess/API/Cocoa/WKWebView.mm:
3023         (-[WKWebView _simulateDataInteractionGestureRecognized]):
3024         (-[WKWebView _simulateDataInteractionEntered:]):
3025         (-[WKWebView _simulateDataInteractionUpdated:]):
3026         (-[WKWebView _simulateDataInteractionPerformOperation:]):
3027         (-[WKWebView _simulateDataInteractionEnded:]):
3028         (-[WKWebView _simulateDataInteractionSessionDidEnd:withOperation:]):
3029         (-[WKWebView _simulateFailedDataInteractionWithIndex:]):
3030         (-[WKWebView _simulateWillBeginDataInteractionWithIndex:withSession:]):
3031         (-[WKWebView _simulatedItemsForDataInteractionWithIndex:]):
3032         * UIProcess/API/Cocoa/_WKTestingDelegate.h:
3033         * UIProcess/PageClient.h:
3034         * UIProcess/WebPageProxy.h:
3035         * UIProcess/WebPageProxy.messages.in:
3036         * UIProcess/ios/PageClientImplIOS.h:
3037         * UIProcess/ios/PageClientImplIOS.mm:
3038         (WebKit::PageClientImpl::setDragImage):
3039         (WebKit::PageClientImpl::startDataInteractionWithImage):
3040         * UIProcess/ios/WKContentViewInteraction.h:
3041         * UIProcess/ios/WKContentViewInteraction.mm:
3042         (-[WKContentView hasSelectablePositionAtPoint:]):
3043         (-[WKContentView pointIsInDataInteractionContent:]):
3044         (-[WKContentView _dataInteractionGestureRecognizer]):
3045         (-[WKContentView pointIsInAssistedNode:]):
3046         * UIProcess/mac/PageClientImpl.h:
3047         * UIProcess/mac/PageClientImpl.mm:
3048         (WebKit::PageClientImpl::setDragImage):
3049         * UIProcess/mac/WebPageProxyMac.mm:
3050         (WebKit::WebPageProxy::setDragImage):
3051         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
3052         (WebKit::WebDragClient::startDrag):
3053         * WebProcess/WebPage/ios/WebPageIOS.mm:
3054         (WebKit::WebPage::getPositionInformation):
3055
3056 2017-02-20  David Quesada  <david_quesada@apple.com>
3057
3058         Don’t set NSURLSessionConfiguration’s _sourceApplicationAuditTokenData if _sourceApplicationBundleIdentifier is also set.
3059         https://bugs.webkit.org/show_bug.cgi?id=168607
3060
3061         rdar://problem/30239618
3062
3063         Reviewed by Geoffrey Garen.
3064
3065         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3066         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3067         If the process pool configuration sets a source application bundle identifier, don't give the NSURLSession configuration
3068         the audit token from the UI process, as it may be associated with an application with a conflicting bundle identifier.
3069
3070 2017-02-20  Ryan Haddad  <ryanhaddad@apple.com>
3071
3072         Unreviewed, rolling out r212632.
3073
3074         This change appears to have caused API test failures.
3075
3076         Reverted changeset:
3077
3078         "Reduce platform ifdefs in WebKit2 custom protocols
3079         implementation"
3080         https://bugs.webkit.org/show_bug.cgi?id=165028
3081         http://trac.webkit.org/changeset/212632
3082
3083 2017-02-20  Youenn Fablet  <youenn@apple.com>
3084
3085         [WebRTC] Fix some memory leaks in libwebrtc binding code
3086         https://bugs.webkit.org/show_bug.cgi?id=168596
3087
3088         Reviewed by Eric Carlson.
3089
3090         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
3091         (WebKit::NetworkRTCProvider::OnMessage):
3092
3093 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3094
3095         Remove code under USE(GRAPHICS_SURFACE)
3096         https://bugs.webkit.org/show_bug.cgi?id=168592
3097
3098         Reviewed by Michael Catanzaro.
3099
3100         This was only used by EFL port.
3101
3102         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
3103         (IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::encode):
3104         (IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::decode):
3105         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h:
3106         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
3107         (WebKit::CoordinatedGraphicsScene::syncPlatformLayerIfNeeded):
3108         (WebKit::CoordinatedGraphicsScene::deleteLayer):
3109         (WebKit::CoordinatedGraphicsScene::assignImageBackingToLayer):
3110         (WebKit::CoordinatedGraphicsScene::purgeGLResources):
3111         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
3112         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:
3113         (WebKit::WebCoordinatedSurface::Handle::encode):
3114         (WebKit::WebCoordinatedSurface::Handle::decode):
3115         (WebKit::WebCoordinatedSurface::create):
3116         (WebKit::WebCoordinatedSurface::createGraphicsContext):
3117         (WebKit::WebCoordinatedSurface::createHandle):
3118         (WebKit::WebCoordinatedSurface::copyToTexture):
3119         * Shared/CoordinatedGraphics/WebCoordinatedSurface.h:
3120
3121 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3122
3123         Reduce platform ifdefs in WebKit2 custom protocols implementation
3124         https://bugs.webkit.org/show_bug.cgi?id=165028
3125
3126         Reviewed by Darin Adler.
3127
3128         Make mac implementation use the APICustomProtocolManagerClient to share more code with the soup based ports.
3129
3130         * CMakeLists.txt: Add CustomProtocolManagerProxy.cpp.
3131         * PlatformEfl.cmake: Remove CustomProtocolManagerProxySoup.cpp.
3132         * PlatformGTK.cmake: Ditto.
3133         * PlatformMac.cmake: Remove CustomProtocolManagerProxyMac.mm.
3134         * UIProcess/API/APICustomProtocolManagerClient.h:
3135         (API::CustomProtocolManagerClient::startLoading): Make it void, since we were always returning true and the
3136         returned value was ignored.
3137         * UIProcess/API/efl/ewk_url_scheme_request.cpp:
3138         (EwkUrlSchemeRequest::finish): Update to new CustomProtocolManagerProxy API.
3139         * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp:
3140         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
3141         (webkitURISchemeRequestReadCallback): Ditto.
3142         * UIProcess/Cocoa/CustomProtocolManagerClient.h: Added.
3143         * UIProcess/Cocoa/CustomProtocolManagerClient.mm: Added.
3144         (-[WKCustomProtocolLoader initWithCustomProtocolManagerProxy:customProtocolID:request:]):
3145         (-[WKCustomProtocolLoader dealloc]):
3146         (-[WKCustomProtocolLoader connection:didFailWithError:]):
3147         (-[WKCustomProtocolLoader connection:didReceiveResponse:]):
3148         (-[WKCustomProtocolLoader connection:didReceiveData:]):
3149         (-[WKCustomProtocolLoader connection:willSendRequest:redirectResponse:]):
3150         (-[WKCustomProtocolLoader connectionDidFinishLoading:]):
3151         (WebKit::CustomProtocolManagerClient::startLoading):
3152         (WebKit::CustomProtocolManagerClient::stopLoading):
3153         (WebKit::CustomProtocolManagerClient::invalidate):
3154         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3155         (WebKit::WebProcessPool::platformInitialize): Set the CustomProtocolManagerClient.
3156         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Remove code that is now shared.
3157         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.cpp: Added.
3158         (WebKit::CustomProtocolManagerProxy::startLoading):
3159         (WebKit::CustomProtocolManagerProxy::processDidClose):
3160         (WebKit::CustomProtocolManagerProxy::wasRedirectedToRequest):
3161         (WebKit::CustomProtocolManagerProxy::didReceiveResponse):
3162         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
3163         * UIProcess/WebProcessPool.cpp:
3164         (WebKit::globalURLSchemesWithCustomProtocolHandlers): Just moved here to use it from ensureNetworkProcess().
3165         (WebKit::WebProcessPool::WebProcessPool): Remove soup ifdefs.
3166         (WebKit::WebProcessPool::setCustomProtocolManagerClient): Moved from the soup implementation.
3167         (WebKit::WebProcessPool::ensureNetworkProcess): Initialize custom protocols parameters.
3168         (WebKit::WebProcessPool::registerSchemeForCustomProtocol): Register the protocol if not already registered globally.
3169         (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): Remove soup ifdefs.
3170         * UIProcess/WebProcessPool.h: Remove soup ifdefs.
3171         * UIProcess/efl/RequestManagerClientEfl.cpp:
3172         * UIProcess/soup/WebProcessPoolSoup.cpp:
3173         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Remove code that is now shared.
3174         * WebKit2.xcodeproj/project.pbxproj:
3175
3176 2017-02-20  Manuel Rego Casasnovas  <rego@igalia.com>
3177
3178         [css-grid] Remove compilation flag ENABLE_CSS_GRID_LAYOUT
3179         https://bugs.webkit.org/show_bug.cgi?id=167693
3180
3181         Reviewed by Sergio Villar Senin.
3182
3183         * Configurations/FeatureDefines.xcconfig:
3184         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3185         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3186         * WebProcess/WebPage/WebPage.cpp:
3187         (WebKit::WebPage::updatePreferences):
3188
3189 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3190
3191         REGRESSION(r212345): [GTK] ASSERT(cookieChangeCallbackMap().contains(jar)) failed in WebCore::stopObservingCookieChanges:54
3192         https://bugs.webkit.org/show_bug.cgi?id=168375
3193
3194         Reviewed by Alex Christensen.
3195
3196         Simplify the cookies change notification. The current approach of the UI process telling the network process
3197         when to start and stop observing cookie changes is quite fragile and error prone. In the GTK+ port we always
3198         observe cookies, so our cookie manager always calls start in the constructor and stop in the destructor.
3199         Everything would be a lot simpler if the network process always monitored cookies.
3200
3201         * NetworkProcess/soup/NetworkSessionSoup.cpp:
3202         (WebKit::NetworkSessionSoup::NetworkSessionSoup): Set cookies observer handler for the session.
3203         (WebKit::NetworkSessionSoup::~NetworkSessionSoup): Remove the cookies observer handler.
3204         * UIProcess/API/gtk/WebKitCookieManager.cpp:
3205         (_WebKitCookieManagerPrivate::~_WebKitCookieManagerPrivate): Remove the cookies observer callback.
3206         (webkit_cookie_manager_class_init): Remove dispose implementation that is no longer needed.
3207         (webkitCookieManagerCreate): Set the cookies observer callback.
3208         (webkit_cookie_manager_set_persistent_storage): Remove code to start/stop observing cookies when the jar
3209         changes, the network process deals with that now.
3210         (webkitCookieManagerDispose): Deleted.
3211         * UIProcess/WebCookieManagerProxy.cpp:
3212         (WebKit::WebCookieManagerProxy::startObservingCookieChanges): Remove the optional callback method in favor of an
3213         explicit method to the set the callback that doesn't send the StartObservingCookieChanges message to the network
3214         process.
3215         (WebKit::WebCookieManagerProxy::stopObservingCookieChanges): Do not change the callback map here.
3216         (WebKit::WebCookieManagerProxy::setCookieObserverCallback): Add the callback to the map or remove the session if
3217         nullptr is given.
3218         * UIProcess/WebCookieManagerProxy.h:
3219         * WebProcess/Cookies/WebCookieManager.cpp:
3220         (WebKit::WebCookieManager::notifyCookiesDidChange): Send CookiesDidChange message to the UI process.
3221         (WebKit::WebCookieManager::startObservingCookieChanges): Use notifyCookiesDidChange().
3222         * WebProcess/Cookies/WebCookieManager.h:
3223         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
3224         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy): Set the policy on all sessions. Code moved from
3225         WebFrameNetworkingContext since it doesn't belong there.
3226         (WebKit::WebCookieManager::setCookiePersistentStorage): Use new method to set the cookie storage in the
3227         NetworkStorageSession.
3228         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
3229         (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts): Deleted.
3230         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
3231
3232 2017-02-19  Chris Dumez  <cdumez@apple.com>
3233
3234         [WK2] Support termination of unresponsive WebContent processes that are in the background
3235         https://bugs.webkit.org/show_bug.cgi?id=168479
3236         <rdar://problem/30558745>
3237
3238         Reviewed by Antti Koivisto.
3239
3240         Support termination of unresponsive WebContent processes that are in the background.
3241         This protects us against cases where a background tab is unresponsive and has high CPU
3242         usage, thus draining the battery without the user knowing about it (e.g.
3243         <rdar://problem/29808005>).
3244
3245         The feature works as follows:
3246         - If a WebProcessProxy has pages but none of them are visible, then it will check
3247           regularly if its associated WebContent process is still responsive.
3248         - Every time we find that the WebContent process is responsive, we exponentially
3249           back off the timer to avoid waking up the process too often. The timer initially
3250           uses a 20 seconds interval and can back off up to 8 hours.
3251         - If the WebContent process is unresponsive, then we terminate it. No notification
3252           is shown to the user and the termination is not immediately observable since the
3253           tab is not visible and its title remains. The tab is not immediately reloaded
3254           so as to avoid getting back into a bad state in the background (and have a
3255           yo-yo effect).
3256         - If the user switches to a tab that was previously killed for being unresponsive
3257           while in the background, we will then reload the tab in a fresh WebContent
3258           process. The crash banner will only be shown if the tab has ever been visible.
3259           If it wasn't ever visible (e.g. session restore case), then it will look as if
3260           the tab loads for the first time when the user switches to it.
3261
3262         The functionality is disabled by default and can be enabled by the client via the new
3263         WKContextSetUnresponsiveBackgroundProcessesTerminationEnabled() private API.
3264
3265         * CMakeLists.txt:
3266         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3267         (API::ProcessPoolConfiguration::copy):
3268         * UIProcess/API/APIProcessPoolConfiguration.h:
3269         * UIProcess/API/C/WKContext.cpp:
3270         (WKContextSetUnresponsiveBackgroundProcessesTerminationEnabled):
3271         * UIProcess/API/C/WKContextPrivate.h:
3272         * UIProcess/UnresponsiveWebProcessTerminator.cpp: Added.
3273         (WebKit::UnresponsiveWebProcessTerminator::UnresponsiveWebProcessTerminator):
3274         (WebKit::UnresponsiveWebProcessTerminator::updateState):
3275         (WebKit::pagesCopy):
3276         (WebKit::UnresponsiveWebProcessTerminator::timerFired):
3277         * UIProcess/UnresponsiveWebProcessTerminator.h: Added.
3278         (WebKit::UnresponsiveWebProcessTerminator::shouldBeActive):
3279         * UIProcess/WebPageProxy.cpp:
3280         (WebKit::WebPageProxy::reattachToWebProcess):
3281         (WebKit::WebPageProxy::reloadAfterBeingKilledInBackground):
3282         (WebKit::WebPageProxy::dispatchActivityStateChange):
3283         (WebKit::WebPageProxy::terminateProcess):
3284         (WebKit::WebPageProxy::resetStateAfterProcessExited):
3285         * UIProcess/WebPageProxy.h:
3286         * UIProcess/WebProcessProxy.cpp:
3287         (WebKit::WebProcessProxy::WebProcessProxy):
3288         (WebKit::m_backgroundResponsivenessTimer):
3289         (WebKit::WebProcessProxy::createWebPage):
3290         (WebKit::WebProcessProxy::addExistingWebPage):
3291         (WebKit::WebProcessProxy::removeWebPage):
3292         (WebKit::WebProcessProxy::updateBackgroundResponsivenessTimer):
3293         * UIProcess/WebProcessProxy.h:
3294         (WebKit::WebProcessProxy::visiblePageCount):
3295         * WebKit2.xcodeproj/project.pbxproj:
3296
3297 2017-02-18  Michael Catanzaro  <mcatanzaro@igalia.com>
3298
3299         Remove COORDINATED_GRAPHICS_MULTIPROCESS
3300         https://bugs.webkit.org/show_bug.cgi?id=168514
3301
3302         Reviewed by Darin Adler.
3303
3304         * Shared/DrawingAreaInfo.h:
3305         * UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
3306         (WKViewFindZoomableAreaForRect):
3307         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
3308         (WebKit::AcceleratedDrawingAreaProxy::AcceleratedDrawingAreaProxy):
3309         * UIProcess/AcceleratedDrawingAreaProxy.h:
3310         (WebKit::AcceleratedDrawingAreaProxy::coordinatedLayerTreeHostProxy): Deleted.
3311         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp: Removed.
3312         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h: Removed.
3313         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in: Removed.
3314         * UIProcess/CoordinatedGraphics/PageViewportController.cpp:
3315         (WebKit::PageViewportController::pageTransitionViewportReady):
3316         * UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp: Removed.
3317         * UIProcess/DrawingAreaProxy.h:
3318         * UIProcess/PageClient.h:
3319         * UIProcess/WebPageProxy.cpp:
3320         (WebKit::WebPageProxy::pageDidRequestScroll): Deleted.
3321         (WebKit::WebPageProxy::pageTransitionViewportReady): Deleted.
3322         (WebKit::WebPageProxy::didRenderFrame): Deleted.
3323         (WebKit::WebPageProxy::commitPageTransitionViewport): Deleted.
3324         * UIProcess/WebPageProxy.h:
3325         * UIProcess/WebPageProxy.messages.in:
3326         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
3327         (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea):
3328         (WebKit::AcceleratedDrawingArea::updateBackingStoreState):
3329         (WebKit::AcceleratedDrawingArea::didReceiveCoordinatedLayerTreeHostMessage): Deleted.
3330         * WebProcess/WebPage/AcceleratedDrawingArea.h:
3331         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
3332         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
3333         (WebKit::CoordinatedLayerTreeHost::commitSceneState):
3334         (WebKit::CoordinatedLayerTreeHost::createCoordinatedSurface):
3335         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
3336         * WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp: Removed.
3337         * WebProcess/WebPage/DrawingArea.cpp:
3338         (WebKit::DrawingArea::create):
3339         * WebProcess/WebPage/DrawingArea.h:
3340         * WebProcess/WebPage/LayerTreeHost.cpp:
3341         (WebKit::LayerTreeHost::create):
3342         * WebProcess/WebPage/LayerTreeHost.h:
3343         * WebProcess/WebPage/WebPage.cpp:
3344         (WebKit::WebPage::~WebPage):
3345         (WebKit::WebPage::pageDidRequestScroll):
3346         (WebKit::WebPage::didCompletePageTransition):
3347         (WebKit::WebPage::didReceiveMessage):
3348         (WebKit::WebPage::commitPageTransitionViewport): Deleted.
3349         * WebProcess/WebPage/WebPage.h:
3350         * WebProcess/WebPage/WebPage.messages.in:
3351
3352 2017-02-18  Michael Catanzaro  <mcatanzaro@igalia.com>
3353
3354         [GTK] Cannot paste primary selection into web view in Wayland
3355         https://bugs.webkit.org/show_bug.cgi?id=166949
3356
3357         Reviewed by Carlos Garcia Campos.
3358
3359         Once upon a time, primary selection (middle-click paste) was not supported in Wayland. At
3360         the time, I changed this function to report that primary selection was unsupported. But
3361         nowadays, primary selection works fine in all GTK+ applications except WebKit. All we have
3362         to do to make it work in WebKit is change this return value.
3363
3364         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3365         (WebKit::WebEditorClient::supportsGlobalSelection):
3366
3367 2017-02-17  Brian Burg  <bburg@apple.com>
3368
3369         Web Inspector: RTL: Inspector window should dock to the left when using RTL layout direction
3370         https://bugs.webkit.org/show_bug.cgi?id=168273
3371         <rdar://problem/29949325>
3372
3373         Reviewed by Matt Baker.
3374
3375         Add the ability to dock Web Inspector to the left of the inspected view.
3376         The frontend decides whether the Dock to Side button docks left or right
3377         based on the current layout direction.
3378
3379         * UIProcess/WebInspectorProxy.cpp:
3380         (WebKit::WebInspectorProxy::attachLeft):
3381         (WebKit::WebInspectorProxy::attach):
3382         (WebKit::WebInspectorProxy::createInspectorPage):
3383         * UIProcess/WebInspectorProxy.h:
3384         * UIProcess/WebInspectorProxy.messages.in:
3385         Add plumbing for new dock configuration.
3386
3387         * UIProcess/mac/WebInspectorProxyMac.mm:
3388         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3389         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
3390         (WebKit::WebInspectorProxy::platformAttach):
3391         Adapt existing sizing logic to work for docking to left.
3392
3393         * WebProcess/WebPage/WebInspectorUI.cpp:
3394         (WebKit::WebInspectorUI::requestSetDockSide):
3395         (WebKit::WebInspectorUI::setDockSide):
3396         * WebProcess/WebPage/WebInspectorUI.h:
3397         (WebKit::WebInspectorUI::attachedLeft):
3398         * WebProcess/WebPage/WebInspectorUI.messages.in:
3399         Add plumbing for new dock configuration.
3400
3401 2017-02-16  Simon Fraser  <simon.fraser@apple.com>
3402
3403         Allow PlatformCALayers to specify that they want deep color backing store
3404         https://bugs.webkit.org/show_bug.cgi?id=168495
3405
3406         Reviewed by Tim Horton.
3407
3408         Currently capable iOS devices get deep color backing store by virtue of a supports
3409         check in PlatformCALayerCocoa::PlatformCALayerCocoa(), and LegacyTileGridTile.
3410
3411         Future work will make layer contents format selection more complex, so express the need
3412         for deep color on PlatformCALayer, and have the creators of PlatformCALayer (mainly the
3413         flavors of GraphicsLayerCA) choose for them to support deep color. A bit of special-casing
3414         is needed to propagte the state to TileControllers.
3415         
3416         The deep-colorness now propagates from PlatformCALayerRemote to RemoteLayerBackingStore,
3417         instead of RemoteLayerBackingStore looking at the properties of the screen directly.
3418
3419         Remove PlatformCALayer::LayerTypeWebTiledLayer which was only used for the old CATiledLayers
3420         that we no longer use.
3421
3422         * Shared/mac/RemoteLayerBackingStore.h:
3423         * Shared/mac/RemoteLayerBackingStore.mm:
3424         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
3425         (WebKit::RemoteLayerBackingStore::bytesPerPixel):
3426         (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
3427         (WebKit::RemoteLayerBackingStore::drawInContext):
3428         (WebKit::RemoteLayerBackingStore::surfaceBufferFormat):
3429         (WebKit::bufferFormat): Deleted.
3430         * WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp:
3431         (WebKit::GraphicsLayerCARemote::createPlatformCALayer):
3432         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
3433         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3434         (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
3435         (WebKit::PlatformCALayerRemote::updateBackingStore):
3436         (WebKit::PlatformCALayerRemote::wantsDeepColorBackingStore):
3437         (WebKit::PlatformCALayerRemote::setWantsDeepColorBackingStore):
3438         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
3439         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
3440         (WebKit::PlatformCALayerRemoteTiledBacking::wantsDeepColorBackingStore):
3441         (WebKit::PlatformCALayerRemoteTiledBacking::setWantsDeepColorBackingStore):
3442         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
3443
3444 2017-02-17  Wenson Hsieh  <wenson_hsieh@apple.com>
3445
3446         [WK2] Action sheet should not dismiss when a DDAction with user interface is being presented
3447         https://bugs.webkit.org/show_bug.cgi?id=168528
3448         <rdar://problem/30515324>
3449
3450         Reviewed by Beth Dakin.
3451
3452         After r211643, -[WKActionSheet doneWithSheet] now dismisses the presenting view controller. This is called when
3453         interaction with the sheet is finished and is a reasonable thing to do in most cases. However, when using data
3454         detectors, we don't want to dismiss the presenting view controller, since DataDetector handles dismissing on its
3455         own and expects that its completion handler will be invoked.
3456
3457         To fix this, we add a parameter to doneWithSheet: to indicate whether or not we should additionally dismiss the
3458         presenting view controller, and pass in NO in the case where we are handing control over to DataDetector.
3459
3460         * UIProcess/ios/WKActionSheet.h:
3461         * UIProcess/ios/WKActionSheet.mm:
3462         (-[WKActionSheet doneWithSheet:]):
3463         (-[WKActionSheet doneWithSheet]): Deleted.
3464         * UIProcess/ios/WKActionSheetAssistant.mm:
3465         (-[WKActionSheetAssistant showDataDetectorsSheet]):
3466         (-[WKActionSheetAssistant cleanupSheet]):
3467
3468 2017-02-17  Michael Catanzaro  <mcatanzaro@igalia.com>
3469
3470         Remove EFL from WebKit2
3471         https://bugs.webkit.org/show_bug.cgi?id=168511
3472
3473         Reviewed by Alex Christensen.
3474
3475         * Platform/IPC/unix/ConnectionUnix.cpp:
3476         (IPC::Connection::platformInvalidate):
3477         (IPC::Connection::open):
3478         * Platform/Module.h:
3479         * PlatformEfl.cmake: Removed.
3480         * PluginProcess/unix/PluginProcessMainUnix.cpp:
3481         * Shared/API/APIObject.h:
3482         * Shared/API/c/WKBase.h:
3483         * Shared/API/c/WKSharedAPICast.h:
3484         (WebKit::toAPI):
3485         (WebKit::toImpl):
3486         * Shared/NativeWebKeyboardEvent.h:
3487         (WebKit::NativeWebKeyboardEvent::isFakeEventForComposition):
3488         (WebKit::NativeWebKeyboardEvent::isFiltered): Deleted.
3489         * Shared/NativeWebMouseEvent.h:
3490         (WebKit::NativeWebMouseEvent::nativeEvent):
3491         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent): Deleted.
3492         * Shared/NativeWebTouchEvent.h:
3493         (WebKit::NativeWebTouchEvent::nativeEvent):
3494         * Shared/NativeWebWheelEvent.h:
3495         (WebKit::NativeWebWheelEvent::nativeEvent):
3496         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
3497         (WebKit::NetscapePluginModule::determineQuirks):
3498         * Shared/WebPreferencesDefinitions.h:
3499         * UIProcess/API/APIWebsiteDataStore.cpp:
3500         * UIProcess/API/C/WKAPICast.h:
3501         * UIProcess/API/C/WKTextChecker.cpp:
3502         * UIProcess/API/C/WKTextChecker.h:
3503         * UIProcess/ChildProcessProxy.cpp:
3504         (WebKit::ChildProcessProxy::getLaunchOptions):
3505         * UIProcess/CoordinatedGraphics/PageViewportController.cpp:
3506         (WebKit::PageViewportController::pixelAlignedFloatPoint):
3507         * UIProcess/InspectorServer/WebInspectorServer.h:
3508         * UIProcess/Launcher/ProcessLauncher.h:
3509         * UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp:
3510         * UIProcess/PageClient.h:
3511         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
3512         (WebKit::PluginProcessProxy::scanPlugin):
3513         * UIProcess/WebInspectorProxy.h:
3514         * UIProcess/WebPageProxy.h:
3515         * WebKit2.xcodeproj/project.pbxproj:
3516         * WebProcess/InjectedBundle/InjectedBundle.h: