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