ServiceWorkerClientFetch should send data to its resource loader once the didReceiveR...
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-03-09  Youenn Fablet  <youenn@apple.com>
2
3         ServiceWorkerClientFetch should send data to its resource loader once the didReceiveResponse completion handler is called
4         https://bugs.webkit.org/show_bug.cgi?id=183110
5
6         Reviewed by Chris Dumez.
7
8         Buffering data/finish event/fail event until the response completion handler is called.
9
10         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
11         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
12         (WebKit::ServiceWorkerClientFetch::didReceiveData):
13         (WebKit::ServiceWorkerClientFetch::didFinish):
14         (WebKit::ServiceWorkerClientFetch::didFail):
15         (WebKit::ServiceWorkerClientFetch::didNotHandle):
16         (WebKit::ServiceWorkerClientFetch::cancel):
17         (WebKit::ServiceWorkerClientFetch::continueLoadingAfterCheckingResponse):
18         * WebProcess/Storage/ServiceWorkerClientFetch.h:
19
20 2018-03-09  Jer Noble  <jer.noble@apple.com>
21
22         Add new CSS env constants for use with fullscreen
23         https://bugs.webkit.org/show_bug.cgi?id=183498
24
25         Reviewed by Dean Jackson.
26
27         Pass the values given to WebFullScreenManagerProxy through the process boundary and
28         into WebCore.
29
30         * UIProcess/WebFullScreenManagerProxy.cpp:
31         (WebKit::WebFullScreenManagerProxy::setFullscreenInsetTop):
32         (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideDelay):
33         * UIProcess/WebFullScreenManagerProxy.h:
34         * WebProcess/FullScreen/WebFullScreenManager.cpp:
35         (WebKit::WebFullScreenManager::didExitFullScreen):
36         (WebKit::WebFullScreenManager::setFullscreenInsetTop):
37         (WebKit::WebFullScreenManager::setFullscreenAutoHideDelay):
38         * WebProcess/FullScreen/WebFullScreenManager.h:
39         * WebProcess/FullScreen/WebFullScreenManager.messages.in:
40
41 2018-03-09  Jer Noble  <jer.noble@apple.com>
42
43         Add isPictureInPictureActive messaging across WebKit process boundary
44         https://bugs.webkit.org/show_bug.cgi?id=183499
45
46         Reviewed by Eric Carlson.
47
48         * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
49         * UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in:
50         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
51         (WebKit::PlaybackSessionModelContext::pictureInPictureActiveChanged):
52         (WebKit::PlaybackSessionManagerProxy::pictureInPictureActiveChanged):
53
54 2018-03-09  Stephan Szabo  <stephan.szabo@sony.com>
55
56         Add guard for wtf/glib include
57         https://bugs.webkit.org/show_bug.cgi?id=183521
58
59         Reviewed by Alex Christensen.
60
61         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
62
63 2018-03-09  Andy Estes  <aestes@apple.com>
64
65         [Mac] WebKit fails to receive file promises when the embedding app is sandboxed
66         https://bugs.webkit.org/show_bug.cgi?id=183489
67         <rdar://problem/38267517>
68
69         WebKit calls -[NSFilePromiseReceiver receivePromisedFilesAtDestination:...] with
70         NSTemporaryDirectory() as the destination for receiving file promise drops. AppKit attempts
71         to issue a sandbox extension for this directory, but for security reasons App Sandbox
72         refuses to do so for NSTemporaryDirectory() itself. As a result, AppKit will call our reader
73         block with a nil error and a valid file URL, but no file will actually exist at that URL.
74
75         In order for App Sandbox to grant issuing the sandbox extension needed by AppKit, we need to
76         use some other destination directory. This patch uses FileSystem::createTemporaryDirectory()
77         to securely create a unique temporary directory inside NSTemporaryDirectory() for use as the
78         drop destination.
79
80         Reviewed by Wenson Hsieh.
81
82         * UIProcess/Cocoa/WebViewImpl.mm:
83         (WebKit::WebViewImpl::performDragOperation):
84
85 2018-03-09  Carlos Garcia Campos  <cgarcia@igalia.com>
86
87         [GTK] Do not use WebKitDOMHTMLFormElement as argument of signal WebKitWebPage::will-submit-form
88         https://bugs.webkit.org/show_bug.cgi?id=183510
89
90         Reviewed by Michael Catanzaro.
91
92         In 2.22 WebKitDOMHTMLFormElement will be deprecated in GTK+ port and won't still exist in WPE. The new
93         JavaScript GLib API will be used to replace most of the DOM API, but a few classes will remain with a minimal
94         API for things that can't be done with JavaScript. WebKitDOMElement will stay and will be added to WPE as well,
95         so if we change the signal parameter to WebKitDOMElement we will be able to keep using
96         WebKitWebPage::will-submit-form without any changes. WPE will gain this signal and the rest of the API that uses
97         DOM.
98
99         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
100         (webkit_web_page_class_init):
101
102 2018-03-09  Carlos Garcia Campos  <cgarcia@igalia.com>
103
104         Unreviewed. [GTK][WPE] Bump Since tags of resource load stats API.
105
106         The functionality hasn't been properly tested to be released in WebKitGTK+ 2.20.
107
108         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
109         (webkit_website_data_manager_class_init):
110         * UIProcess/API/gtk/WebKitWebsiteData.h:
111         * UIProcess/API/wpe/WebKitWebsiteData.h:
112
113 2018-03-08  Zan Dobersek  <zdobersek@igalia.com>
114
115         Unreviewed. Suppress GCC warnings in SystemPreviewController.cpp by
116         using the cross-platform #include directives for header inclusion,
117         instead of #import.
118
119         * UIProcess/SystemPreviewController.cpp:
120
121 2018-03-08  Megan Gardner  <megan_gardner@apple.com>
122
123         Allow WebViews to disable system appearance
124         https://bugs.webkit.org/show_bug.cgi?id=183418
125         <rdar://problem/36975642>
126
127         Reviewed by Tim Horton.
128         
129         Allow webviews to choose whether or not to follow the default system appearance.
130
131         * Shared/WebPageCreationParameters.cpp:
132         (WebKit::WebPageCreationParameters::encode const):
133         (WebKit::WebPageCreationParameters::decode):
134         * Shared/WebPageCreationParameters.h:
135         * UIProcess/API/Cocoa/WKWebView.mm:
136         (-[WKWebView _useSystemAppearance]):
137         (-[WKWebView _setUseSystemAppearance:]):
138         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
139         * UIProcess/WebPageProxy.cpp:
140         (WebKit::WebPageProxy::creationParameters):
141         (WebKit::WebPageProxy::setUseSystemAppearance):
142         * UIProcess/WebPageProxy.h:
143         (WebKit::WebPageProxy::useSystemAppearance const):
144         * WebProcess/WebPage/WebPage.cpp:
145         (WebKit::WebPage::setUseSystemAppearance):
146         * WebProcess/WebPage/WebPage.h:
147         * WebProcess/WebPage/WebPage.messages.in:
148
149 2018-03-08  Michael Catanzaro  <mcatanzaro@igalia.com>
150
151         Unreviewed, speculative attempt to fix CMake build after r229426
152         https://bugs.webkit.org/show_bug.cgi?id=183382
153         <rdar://problem/38191450>
154
155         * CMakeLists.txt:
156
157 2018-03-08  Wenson Hsieh  <wenson_hsieh@apple.com>
158
159         [Extra zoom mode] Support resigning first responder status when focusing a form control
160         https://bugs.webkit.org/show_bug.cgi?id=183477
161         <rdar://problem/38225994>
162
163         Reviewed by Tim Horton.
164
165         Currently, when presenting an input view controller in extra zoom mode, if the web view loses first responder
166         status, we will blur the focused element, which dismisses all focused form control UI. For certain types of form
167         controls, this prevents the user from using key pieces of functionality.
168
169         To address this, disconnect the notion of first responder status from DOM element focus while the form control
170         overlay is shown. Later, when the active input session ends, if the web content view was first responder before
171         upon focusing the element, restore first responder status on the web view. This extra tweak is needed to ensure
172         that certain UI affordances which require first responder status on the web view continue to work after
173         interacting with a form control that changes the first responder.
174
175         * UIProcess/ios/WKContentViewInteraction.h:
176         * UIProcess/ios/WKContentViewInteraction.mm:
177         (-[WKContentView presentFocusedFormControlViewController:]):
178         (-[WKContentView dismissFocusedFormControlViewController:]):
179
180 2018-03-08  John Wilander  <wilander@apple.com>
181
182         Resource Load Statistics: Revert defaults read of zero values
183         https://bugs.webkit.org/show_bug.cgi?id=183476
184
185         Unreviewed revert of three small changes landed in r229427.
186
187         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
188         (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
189             Reverted back to strict check of greater than zero for defaults reads.
190
191 2018-03-08  Tim Horton  <timothy_horton@apple.com>
192
193         Don't have SafariServices in minimal simulator build
194         https://bugs.webkit.org/show_bug.cgi?id=183436
195         <rdar://problem/38254778>
196
197         Reviewed by Dan Bernstein.
198
199         * config.h:
200
201 2018-03-08  John Wilander  <wilander@apple.com>
202
203         Resource Load Statistics: Make debug mode always partition prevalent resources
204         https://bugs.webkit.org/show_bug.cgi?id=183468
205         <rdar://problem/38269437>
206
207         Reviewed by Brent Fulgham.
208
209         After some testing we decided that a 30 second timeout in ITP debug mode just makes
210         it confusing. We should instead always partition prevalent resources in debug mode
211         to make it easy to understand. The partitioned state is what developers want to test
212         anyway.
213
214         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
215         (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
216             Minor change to include 0 as valid setting.
217         * UIProcess/WebResourceLoadStatisticsStore.cpp:
218         (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
219             Now just stores the setting of debug mode instead of changing the timeout.
220         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
221             Now does not disable partitioning under debug mode.
222         (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies const):
223             Now returns true for prevalent resources with user interaction under debug mode.            
224         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
225             Removed duplicate debug logging statement.
226         * UIProcess/WebResourceLoadStatisticsStore.h:
227             Added member m_debugModeEnabled.
228
229 2018-03-08  Brent Fulgham  <bfulgham@apple.com>
230
231         Remove WebCookieManager and messaging from WebContent process.
232         https://bugs.webkit.org/show_bug.cgi?id=183382
233         <rdar://problem/38191450>
234
235         Reviewed by Alex Christensen.
236
237         Networking access was fully removed from the WebContent process in Bug 183192 (and related bugs). The
238         UIProcess no longer needs to ask the WebContent process about networking-related things, and shouldn't
239         waste everyone's time doing so.
240
241         This bug removes some left-over WebCookieManager API stuff, and is a first step in purging the
242         WebContent Process from accessing cookie data.
243
244         * NetworkProcess/Cookies: Copied from WebProcess/Cookies.
245         * NetworkProcess/Cookies/WebCookieManager.h:
246         * WebKit.xcodeproj/project.pbxproj:
247         * WebProcess/Cookies: Removed.
248         * WebProcess/Cookies/WebCookieManager.cpp: Removed.
249         * WebProcess/Cookies/WebCookieManager.h: Removed.
250         * WebProcess/Cookies/WebCookieManager.messages.in: Removed.
251         * WebProcess/Cookies/curl: Removed.
252         * WebProcess/Cookies/curl/WebCookieManagerCurl.cpp: Removed.
253         * WebProcess/Cookies/mac: Removed.
254         * WebProcess/Cookies/mac/WebCookieManagerMac.mm: Removed.
255         * WebProcess/Cookies/soup: Removed.
256         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp: Removed.
257         * WebProcess/InjectedBundle/InjectedBundle.cpp: Remove 'WebCookieManager.h" header.
258         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: Ditto.
259         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: Ditto.
260         * WebProcess/WebProcess.cpp:
261         (WebKit::WebProcess::WebProcess): Remove call to add WebCookieManager as a
262         WebProcessSupplement.
263         * CMakeLists.txt: Revised paths.
264         * DerivedSources.make: Ditto.
265         * PlatformMac.cmake: Ditto.
266         * PlatformWin.cmake: Ditto.
267         * SourcesGTK.txt: Ditto.
268         * SourcesWPE.txt: Ditto.
269
270 2018-03-08  Youenn Fablet  <youenn@apple.com>
271
272         libwebrtc update broke internal builds
273         https://bugs.webkit.org/show_bug.cgi?id=183454
274
275         Reviewed by Eric Carlson.
276
277         * Configurations/BaseTarget.xcconfig:
278
279 2018-03-08  Youenn Fablet  <youenn@apple.com>
280
281         PluginInfoStore::isSupportedPlugin should check for empty mime type
282         https://bugs.webkit.org/show_bug.cgi?id=183457
283         <rdar://problem/38159575>
284
285         Reviewed by Chris Dumez.
286
287         * UIProcess/Plugins/PluginInfoStore.cpp:
288         (WebKit::PluginInfoStore::isSupportedPlugin):
289
290 2018-03-08  Yusuke Suzuki  <utatane.tea@gmail.com>
291
292         [JSC][WebCore] Extend jsDynamicCast for WebCore types in WebCore and remove jsDynamicDowncast
293         https://bugs.webkit.org/show_bug.cgi?id=183449
294
295         Reviewed by Mark Lam.
296
297         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
298         (WebKit::WebAutomationSessionProxy::elementForNodeHandle):
299         * WebProcess/WebPage/WebFrame.cpp:
300         (WebKit::WebFrame::frameForContext):
301
302 2018-03-08  Yusuke Suzuki  <utatane.tea@gmail.com>
303
304         [JSC] Add inherits<T>(VM&) leveraging JSCast fast path
305         https://bugs.webkit.org/show_bug.cgi?id=183429
306
307         Reviewed by Mark Lam.
308
309         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
310         (WebKit::callMethod):
311         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
312         (WebKit::callNPJSObject):
313         (WebKit::constructWithConstructor):
314         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
315         (WebKit::NPJSObject::create):
316         * WebProcess/WebPage/WebFrame.cpp:
317         (WebKit::WebFrame::counterValue):
318
319 2018-03-08  Zan Dobersek  <zdobersek@igalia.com>
320
321         Remove WebCore::TextureMapperAnimation as a special case in WebKit IPC
322         generation. Values of this type aren't being transferred across IPC.
323
324         Rubber-stamped by Carlos Garcia Campos.
325
326         * Scripts/webkit/messages.py:
327
328 2018-03-08  Tim Horton  <timothy_horton@apple.com>
329
330         Stop linking ApplicationServices directly
331         https://bugs.webkit.org/show_bug.cgi?id=182867
332         <rdar://problem/38252142>
333
334         Reviewed by Alex Christensen.
335
336         The frameworks that we use that live inside ApplicationServices
337         have mostly moved out, so import them directly.
338
339         * Configurations/WebKit.xcconfig:
340
341 2018-03-08  Wenson Hsieh  <wenson_hsieh@apple.com>
342
343         [Extra zoom mode] Specify password mode as needed when inputting text
344         https://bugs.webkit.org/show_bug.cgi?id=183428
345         <rdar://problem/37609386>
346
347         Reviewed by Tim Horton.
348
349         If the focused element is a password field, or the input delegate has forced secure text entry, set a flag on
350         the text input view controller to opt in to password text input mode.
351
352         * UIProcess/ios/WKContentViewInteraction.mm:
353         (-[WKContentView presentTextInputViewController:]):
354
355 2018-03-07  Tim Horton  <timothy_horton@apple.com>
356
357         Sort and separate FeatureDefines.xcconfig
358         https://bugs.webkit.org/show_bug.cgi?id=183427
359
360         Reviewed by Dan Bernstein.
361
362         * Configurations/FeatureDefines.xcconfig:
363         Sort and split FeatureDefines into paragraphs
364         (to make it easier to sort later).
365
366 2018-03-07  Carlos Garcia Campos  <cgarcia@igalia.com>
367
368         REGRESSION(r218089): [GTK] webkit_web_view_get_inspector() needs to be called, otherwise inspector does not close
369         https://bugs.webkit.org/show_bug.cgi?id=181126
370
371         Reviewed by Carlos Alberto Lopez Perez.
372
373         Fix the condition to decide whether to detach the inspector view ourselves.
374
375         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
376         (WebKit::WebInspectorProxy::platformDetach): Remove the inspector view from its parent if we don't have a client
377         or the client didn't detach it.
378
379 2018-03-07  Carlos Garcia Campos  <cgarcia@igalia.com>
380
381         [GTK][WPE] Leak checker is not working in WebKitGLib web process tests
382         https://bugs.webkit.org/show_bug.cgi?id=183404
383
384         Reviewed by Michael Catanzaro.
385
386         Add private helper for testing to do a garbage collection when the page is closing.
387
388         * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp:
389         (webkitWebExtensionSetGarbageCollectOnPageDestroy):
390         * WebProcess/InjectedBundle/API/glib/WebKitWebExtensionPrivate.h:
391         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.h: Fix annotation of
392         webkit_dom_client_rect_list_item(), it should be transfer full.
393
394 2018-03-07  Youenn Fablet  <youenn@apple.com>
395
396         Match unsupported plugins based on domains and not origin
397         https://bugs.webkit.org/show_bug.cgi?id=183384
398
399         Reviewed by Chris Dumez.
400
401         Moved from a HashMap of plugins to a Vector of plugins since we cannot match exactly based on the origin.
402
403         * Scripts/webkit/messages.py:
404         * UIProcess/API/C/WKContext.cpp:
405         (WKContextAddSupportedPlugin):
406         * UIProcess/API/Cocoa/WKProcessPool.mm:
407         (-[WKProcessPool _addSupportedPlugin:named:withMimeTypes:withExtensions:]):
408         * UIProcess/Plugins/PluginInfoStore.cpp:
409         (WebKit::PluginInfoStore::isSupportedPlugin):
410         (WebKit::PluginInfoStore::supportedPluginNames):
411         (WebKit::PluginInfoStore::addSupportedPlugin):
412         * UIProcess/Plugins/PluginInfoStore.h:
413         * UIProcess/WebProcessPool.cpp:
414         (WebKit::WebProcessPool::addSupportedPlugin):
415         * UIProcess/WebProcessPool.h:
416         * UIProcess/WebProcessProxy.cpp:
417         (WebKit::WebProcessProxy::getPlugins):
418         * UIProcess/WebProcessProxy.h:
419         * UIProcess/WebProcessProxy.messages.in:
420         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
421         (WebKit::WebPluginInfoProvider::getPluginInfo):
422         (WebKit::WebPluginInfoProvider::getWebVisiblePluginInfo):
423         * WebProcess/Plugins/WebPluginInfoProvider.h:
424
425 2018-03-07  Brent Fulgham  <bfulgham@apple.com>
426
427         REGRESSION (r229093): Media playback on Facebook and Hulu require mDNSResponder access
428         https://bugs.webkit.org/show_bug.cgi?id=183421
429         <rdar://problem/38191574>
430
431         Reviewed by Dean Jackson.
432
433         CoreMedia fails to properly play back media on Facebook and Hulu if access to the
434         mDNSResponder is blocked by the sandbox. This Bug unblocks that access while we
435         investigate the underlying issue.
436
437         * WebProcess/com.apple.WebProcess.sb.in:
438
439 2018-03-07  Dean Jackson  <dino@apple.com>
440
441         Try to fix build for watchOS and tvOS.
442
443         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
444         * UIProcess/SystemPreviewController.cpp:
445
446 2018-03-07  Dean Jackson  <dino@apple.com>
447
448         Add SystemPreviewController for showing system-level views of special file types
449         https://bugs.webkit.org/show_bug.cgi?id=183413
450         <rdar://problem/37800834>
451
452         Reviewed by Tim Horton.
453
454         Add a new controller class that hangs off WebPageProxy, with the goal
455         of providing system-level viewing of some some file types. Specifically
456         those that can't be shown by WebKit.
457
458         This is the initial implementation which is quite simple. The controller
459         can be queried about whether it supports a MIME type, then it can be
460         asked to show a URL.
461
462         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: Added.
463         (-[_WKPreviewControllerDataSource initWithURL:]):
464         (-[_WKPreviewControllerDataSource numberOfPreviewItemsInPreviewController:]):
465         (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
466         (WebKit::SystemPreviewController::canPreview const):
467         (WebKit::SystemPreviewController::showPreview):
468         * UIProcess/SystemPreviewController.cpp: Added.
469         (WebKit::SystemPreviewController::SystemPreviewController):
470         (WebKit::SystemPreviewController::canPreview const):
471         (WebKit::SystemPreviewController::showPreview):
472         * UIProcess/SystemPreviewController.h: Added.
473         * UIProcess/WebPageProxy.cpp:
474         (WebKit::m_configurationPreferenceValues):
475         (WebKit::WebPageProxy::reattachToWebProcess):
476         (WebKit::WebPageProxy::resetState):
477         * UIProcess/WebPageProxy.h:
478         (WebKit::WebPageProxy::systemPreviewController):
479         * WebKit.xcodeproj/project.pbxproj:
480
481 2018-03-07  Alejandro G. Castro  <alex@igalia.com>
482
483         Make NetworkRTCResolver port agnostic
484         https://bugs.webkit.org/show_bug.cgi?id=178855
485
486         Reviewed by Youenn Fablet.
487
488         Create a specific Cocoa class to isolate the generic code in the base class, make the base implementation port
489         agnostic and dependent on DNS API in the platform directory which encapsulates the platform specific details.
490
491         * NetworkProcess/webrtc/NetworkRTCProvider.cpp: Create an alias class name defined per platform to instantiate the resolver.
492         (WebKit::NetworkRTCProvider::createResolver): Used the alias class name and receive a new IPAddress class that is not
493         dependent on rtc libwebrtc library.
494         * NetworkProcess/webrtc/NetworkRTCResolver.cpp: Remove the platform specific code. Use the DNS API to implement the
495         platform specific code in the default start and stop methods. Add the identifier of the resolve operation to the class.
496         (WebKit::NetworkRTCResolver::NetworkRTCResolver): Add the identifier in the initialization.
497         (WebKit::NetworkRTCResolver::~NetworkRTCResolver): Remove the platform specific code.
498         (WebKit::NetworkRTCResolver::completed): Ditto.
499         (WebKit::NetworkRTCResolver::start): Add a new implementation using the DNS API.
500         (WebKit::NetworkRTCResolver::stop): Ditto
501         * NetworkProcess/webrtc/NetworkRTCResolver.h: Remove the platform specific code and use the DNSResolveQueue for a general
502         solution to implement the platform specific code. Avoid using the IPAddress class that depends on libwertc classes to make
503         it more general regarding DNS name resolution.
504         (WebKit::NetworkRTCResolver::start): Make this class virtual.
505         (WebKit::NetworkRTCResolver::stop): Ditto.
506         * NetworkProcess/webrtc/NetworkRTCResolverCocoa.cpp: Copied Cocoa code from Source/WebKit/NetworkProcess/webrtc/NetworkRTCResolver.cpp.
507         Now this class overrides the start and stop methods that use DNS, cocoa implementation should use the DNS methods in the future and
508         remove this class, making sure all the platform specific class is in the platform directory.
509         * NetworkProcess/webrtc/NetworkRTCResolverCocoa.h: Copied Cocoa code from Source/WebKit/NetworkProcess/webrtc/NetworkRTCResolver.h.
510         * PlatformGTK.cmake: Add NetworkRTCResolver compilation for GTK.
511         * WebKit.xcodeproj/project.pbxproj: Add the NetworkRTCResolverCocoa class to the compilation.
512
513 2018-03-06  Brent Fulgham  <bfulgham@apple.com>
514
515         NetworkDataTask should enable logging for automation clients
516         https://bugs.webkit.org/show_bug.cgi?id=183378
517         <rdar://problem/38189556>
518
519         Reviewed by Brian Burg.
520
521         The NetworkDataTaskCocoa class was only logging if the SessionID object allowed logging.
522         It should also be considering whether the current session is working on behalf of an
523         automation client. If so, it should allow logging.
524
525         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
526         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
527         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
528         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
529         (WebKit::NetworkDataTaskCocoa::isAlwaysOnLoggingAllowed const):
530
531 2018-03-06  Ryan Haddad  <ryanhaddad@apple.com>
532
533         Unreviewed build fix.
534
535         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
536         (-[WKFullScreenWindowController _EVOrganizationName]):
537
538 2018-03-06  Antoine Quint  <graouts@apple.com>
539
540         [Web Animations] Add a new runtime flag to control whether CSS Animations and CSS Transitions should run using the Web Animations timeline
541         https://bugs.webkit.org/show_bug.cgi?id=183370
542         <rdar://problem/38180729>
543
544         Reviewed by Dean Jackson.
545
546         Before we start creating WebAnimation objects to perform CSS Animations and CSS Transitions, which will replace the existing codepath
547         involving CSSAnimationController and CompositeAnimation, we need a runtime flag that will allow all the new code to be turned off by
548         default while we bring this feature up.
549
550         * Shared/WebPreferences.yaml:
551         * UIProcess/API/C/WKPreferences.cpp:
552         (WKPreferencesSetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
553         (WKPreferencesGetCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
554         * UIProcess/API/C/WKPreferencesRefPrivate.h:
555         * UIProcess/API/Cocoa/WKPreferences.mm:
556         (-[WKPreferences _setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled:]):
557         (-[WKPreferences _cssAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled]):
558         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
559         * WebProcess/InjectedBundle/InjectedBundle.cpp:
560         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
561         (WebKit::InjectedBundle::setCSSAnimationsAndCSSTransitionsBackedByWebAnimationsEnabled):
562         * WebProcess/InjectedBundle/InjectedBundle.h:
563
564 2018-03-06  Ms2ger  <Ms2ger@igalia.com>
565
566         [GLib] Implement WebsiteDataStore::defaultServiceWorkerRegistrationDirectory().
567         https://bugs.webkit.org/show_bug.cgi?id=183364
568
569         Reviewed by Michael Catanzaro.
570
571         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
572         (API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory): implement.
573
574 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
575
576         Unreviewed. Addressing further review feedback for patch landed in r229315.
577
578         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
579         (WebKit::CoordinatedGraphicsScene::commitSceneState): There's no need for
580         explicit calls of the clear() method on both containers in the CommitScope
581         objects, the destructors invoked for these objects from the CommitScope
582         destructor will have the same effect.
583
584 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
585
586         [CoordGraphics] Remove unused scrolling-related code in TextureMapperLayer, CoordinatedGraphics stack
587         https://bugs.webkit.org/show_bug.cgi?id=183340
588
589         Reviewed by Michael Catanzaro.
590
591         With most of the scrolling-related code in TextureMapperLayer on the
592         chopping block, we can now drop the ScrollingClient inheritance and the
593         commitScrollOffset() virtual method implementation. This enables
594         removing the whole commitScrollOffset() call chain that ran from
595         CoordinatedGraphicsScene through CoordinatedLayerTreeHost and
596         CompositingCoordinator to the affected CoordinatedGraphicsLayer object.
597
598         The CoordinatedGraphicsScene::findScrollableContentsLayerAt() method is
599         also unused and can be deleted.
600
601         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
602         (WebKit::CoordinatedGraphicsScene::setLayerState):
603         (WebKit::CoordinatedGraphicsScene::createLayer):
604         (WebKit::CoordinatedGraphicsScene::commitScrollOffset): Deleted.
605         (WebKit::CoordinatedGraphicsScene::findScrollableContentsLayerAt): Deleted.
606         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
607         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
608         (WebKit::ThreadedCompositor::commitScrollOffset): Deleted.
609         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
610         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
611         (WebKit::CompositingCoordinator::commitScrollOffset): Deleted.
612         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
613         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
614         (WebKit::CoordinatedLayerTreeHost::commitScrollOffset): Deleted.
615         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
616         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
617
618 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
619
620         [CoordGraphics] Apply TextureMapperLayer animations with a single MonotonicTime value
621         https://bugs.webkit.org/show_bug.cgi?id=183360
622
623         Reviewed by Sergio Villar Senin.
624
625         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
626         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
627         Pass the monotic time value, as returned by MonotonicTime::now(), to the
628         TextureMapperLayer::applyAnimationsRecursively() call.
629
630 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
631
632         [CoordGraphics] Clean up CoordinatedImageBacking
633         https://bugs.webkit.org/show_bug.cgi?id=183332
634
635         Reviewed by Carlos Garcia Campos.
636
637         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
638         (WebKit::CompositingCoordinator::createImageBackingIfNeeded):
639         Adjust call to CoordinatedImageBacking::getCoordinatedImageBackingID().
640
641 2018-03-06  Zan Dobersek  <zdobersek@igalia.com>
642
643         CoordinatedGraphicsScene: properly limit data specific to state commit operation
644         https://bugs.webkit.org/show_bug.cgi?id=183326
645
646         Reviewed by Sergio Villar Senin.
647
648         In the process of state commit in CoordinatedGraphicsScene, the released
649         image backings and backing stores with pending updates are stored in
650         Vector and HashSet objects, respectively. Instead of these two objects
651         being member variables on the CoordinatedGraphicsScene class, keep them
652         in the CommitScope structure that's limited to the operations done in
653         the commitSceneState() method.
654
655         The two member variables are dropped, and the CommitScope object is
656         passed by reference to any helper method that needs to append either
657         kind of object to the respective container. At the end of the state
658         commit, backing stores with pending updates have those updates applied,
659         and the two containers are cleared out as the CommitScope object is
660         destroyed.
661
662         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
663         (WebKit::CoordinatedGraphicsScene::setLayerState):
664         (WebKit::CoordinatedGraphicsScene::prepareContentBackingStore):
665         (WebKit::CoordinatedGraphicsScene::resetBackingStoreSizeToLayerSize):
666         (WebKit::CoordinatedGraphicsScene::removeTilesIfNeeded):
667         (WebKit::CoordinatedGraphicsScene::updateTilesIfNeeded):
668         (WebKit::CoordinatedGraphicsScene::syncImageBackings):
669         (WebKit::CoordinatedGraphicsScene::updateImageBacking):
670         (WebKit::CoordinatedGraphicsScene::clearImageBackingContents):
671         (WebKit::CoordinatedGraphicsScene::removeImageBacking):
672         (WebKit::CoordinatedGraphicsScene::commitSceneState):
673         (WebKit::CoordinatedGraphicsScene::purgeGLResources):
674         (WebKit::CoordinatedGraphicsScene::removeReleasedImageBackingsIfNeeded): Deleted.
675         (WebKit::CoordinatedGraphicsScene::commitPendingBackingStoreOperations): Deleted.
676         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
677
678 2018-03-05  Yusuke Suzuki  <utatane.tea@gmail.com>
679
680         Fix std::make_unique / new[] using system malloc
681         https://bugs.webkit.org/show_bug.cgi?id=182975
682
683         Reviewed by JF Bastien.
684
685         Use Vector instead.
686
687         * NetworkProcess/win/SystemProxyWin.cpp:
688         (WindowsSystemProxy::getSystemHttpProxy):
689         * Platform/IPC/unix/ConnectionUnix.cpp:
690         (IPC::Connection::processMessage):
691         (IPC::Connection::sendOutputMessage):
692         * Platform/win/LoggingWin.cpp:
693         (WebKit::logLevelString):
694         * Shared/SandboxExtension.h:
695         * Shared/mac/SandboxExtensionMac.mm:
696         (WebKit::SandboxExtension::HandleArray::allocate):
697         (WebKit::SandboxExtension::HandleArray::operator[]):
698         (WebKit::SandboxExtension::HandleArray::operator[] const):
699         (WebKit::SandboxExtension::HandleArray::size const):
700         (WebKit::SandboxExtension::HandleArray::encode const):
701
702 2018-03-05  Andy Estes  <aestes@apple.com>
703
704         [Mac] Teach WebCore::Pasteboard about file promise drags
705         https://bugs.webkit.org/show_bug.cgi?id=183314
706         <rdar://problem/38105493>
707
708         Reviewed by Darin Adler.
709
710         Added a FIXME comment.
711
712         * UIProcess/Cocoa/WebViewImpl.mm:
713         (WebKit::WebViewImpl::performDragOperation):
714
715 2018-03-05  Jeff Miller  <jeffm@apple.com>
716
717         Expose still more WKPreferences SPI to match C SPI
718         https://bugs.webkit.org/show_bug.cgi?id=183045
719
720         Reviewed by Alex Christensen.
721
722         * UIProcess/API/Cocoa/WKPreferences.mm:
723         (-[WKPreferences _setAllowsInlineMediaPlayback:]):
724         (-[WKPreferences _allowsInlineMediaPlayback]):
725         (-[WKPreferences _setApplePayEnabled:]):
726         (-[WKPreferences _applePayEnabled]):
727         (-[WKPreferences _setDNSPrefetchingEnabled:]):
728         (-[WKPreferences _dnsPrefetchingEnabled]):
729         (-[WKPreferences _setInlineMediaPlaybackRequiresPlaysInlineAttribute:]):
730         (-[WKPreferences _inlineMediaPlaybackRequiresPlaysInlineAttribute]):
731         (-[WKPreferences _setInvisibleMediaAutoplayNotPermitted:]):
732         (-[WKPreferences _invisibleMediaAutoplayNotPermitted]):
733         (-[WKPreferences _setLegacyEncryptedMediaAPIEnabled:]):
734         (-[WKPreferences _legacyEncryptedMediaAPIEnabled]):
735         (-[WKPreferences _setMainContentUserGestureOverrideEnabled:]):
736         (-[WKPreferences _mainContentUserGestureOverrideEnabled]):
737         (-[WKPreferences _setMediaStreamEnabled:]):
738         (-[WKPreferences _mediaStreamEnabled]):
739         (-[WKPreferences _setNeedsStorageAccessFromFileURLsQuirk:]):
740         (-[WKPreferences _needsStorageAccessFromFileURLsQuirk]):
741         (-[WKPreferences _setPDFPluginEnabled:]):
742         (-[WKPreferences _pdfPluginEnabled]):
743         (-[WKPreferences _setRequiresUserGestureForAudioPlayback:]):
744         (-[WKPreferences _requiresUserGestureForAudioPlayback]):
745         (-[WKPreferences _setRequiresUserGestureForVideoPlayback:]):
746         (-[WKPreferences _requiresUserGestureForVideoPlayback]):
747         (-[WKPreferences _setServiceControlsEnabled:]):
748         (-[WKPreferences _serviceControlsEnabled]):
749         (-[WKPreferences _setShowsToolTipOverTruncatedText:]):
750         (-[WKPreferences _showsToolTipOverTruncatedText]):
751         (-[WKPreferences _setTextAreasAreResizable:]):
752         (-[WKPreferences _textAreasAreResizable]):
753         (-[WKPreferences _setUseGiantTiles:]):
754         (-[WKPreferences _useGiantTiles]):
755         (-[WKPreferences _setWantsBalancedSetDefersLoadingBehavior:]):
756         (-[WKPreferences _wantsBalancedSetDefersLoadingBehavior]):
757         (-[WKPreferences _setWebAudioEnabled:]):
758         (-[WKPreferences _webAudioEnabled]):
759         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
760
761 2018-03-05  Carlos Garcia Campos  <cgarcia@igalia.com>
762
763         Automation: clicking on a disabled option element shouldn't produce an error
764         https://bugs.webkit.org/show_bug.cgi?id=183284
765
766         Reviewed by Brian Burg.
767
768         This was expected by selenium, but the WebDriver spec says we should simply do nothing in those cases.
769
770         14.1 Element Click.
771         https://w3c.github.io/webdriver/webdriver-spec.html#element-click
772
773         Fixes: imported/w3c/webdriver/tests/element_click/select.py::test_option_disabled
774
775         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
776         (WebKit::WebAutomationSessionProxy::selectOptionElement):
777
778 2018-03-05  Carlos Garcia Campos  <cgarcia@igalia.com>
779
780         Automation: stale elements not detected when removed from the DOM
781         https://bugs.webkit.org/show_bug.cgi?id=183278
782
783         Reviewed by Brian Burg.
784
785         We detect stale elements when the page is reloaded because the maps are recreated, but if an element is removed
786         from the DOM for the same document we keep the nodes in the maps. We should clear stale elements before
787         accessing the maps.
788
789         Fixes: imported/selenium/py/test/selenium/webdriver/common/webdriverwait_tests.py::testExpectedConditionStalenessOf
790
791         * WebProcess/Automation/WebAutomationSessionProxy.js:
792         (let.AutomationSessionProxy.prototype.evaluateJavaScriptFunction): Call _clearStaleNodes()
793         (let.AutomationSessionProxy.prototype.nodeForIdentifier): Ditto.
794         (let.AutomationSessionProxy.prototype._clearStaleNodes): Check if cached nodes are still in document and remove them
795         from the maps if they aren't.
796
797 2018-03-04  Yusuke Suzuki  <utatane.tea@gmail.com>
798
799         [WTF] Move currentCPUTime and sleep(Seconds) to CPUTime.h and Seconds.h respectively
800         https://bugs.webkit.org/show_bug.cgi?id=183312
801
802         Reviewed by Mark Lam.
803
804         Remove wtf/CurrentTime.h include pragma.
805
806         * NetworkProcess/NetworkResourceLoader.cpp:
807         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
808         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
809         * Platform/IPC/Connection.cpp:
810         * Platform/unix/SharedMemoryUnix.cpp:
811         * PluginProcess/WebProcessConnection.cpp:
812         * Shared/ios/NativeWebTouchEventIOS.mm:
813         * UIProcess/DrawingAreaProxyImpl.cpp:
814         * UIProcess/ios/WKContentView.mm:
815         * UIProcess/linux/MemoryPressureMonitor.cpp:
816         * WebProcess/Gamepad/WebGamepad.cpp:
817         * WebProcess/Plugins/PDF/PDFPlugin.mm:
818         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
819         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
820         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
821         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
822         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
823         * WebProcess/WebProcess.cpp:
824         * WebProcess/cocoa/WebProcessCocoa.mm:
825         * WebProcess/gtk/WebProcessMainGtk.cpp:
826         * WebProcess/win/WebProcessMainWin.cpp:
827         * WebProcess/wpe/WebProcessMainWPE.cpp:
828
829 2018-03-02  Brian Burg  <bburg@apple.com>
830
831         Web Automation: script evaluations via WebDriver should have a user gesture indicator
832         https://bugs.webkit.org/show_bug.cgi?id=183230
833         <rdar://problem/37959739>
834
835         Reviewed by Andy Estes.
836
837         APIs that normally require a user gesture should just work when using via WebDriver.
838         To support cases where tests need to simulate user actions with JavaScript, use a
839         fake user gesture, similar to how -[WKWebView evaluateJavaScript:] forces a user
840         gesture when clients evaluate JavaScript in their web view.
841
842         No new tests, this is covered by W3C tests that use the Fullscreen API.
843         This API does nothing if there is no user gesture; with this patch, it just works.
844
845         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
846         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
847
848 2018-03-04  Tim Horton  <timothy_horton@apple.com>
849
850         Make !ENABLE(DATA_DETECTION) iOS build actually succeed
851         https://bugs.webkit.org/show_bug.cgi?id=183283
852         <rdar://problem/38062148>
853
854         Reviewed by Sam Weinig.
855
856         * UIProcess/ios/WKContentViewInteraction.mm:
857         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
858         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
859         Guard some more code with ENABLE(DATA_DETECTION).
860
861 2018-03-04  Dan Bernstein  <mitz@apple.com>
862
863         Building with ONLY_ACTIVE_ARCH=NO and ARCHS=x86_64 fails
864         https://bugs.webkit.org/show_bug.cgi?id=183320
865
866         Reviewed by Tim Horton.
867
868         * Configurations/PluginService.32.xcconfig: If the Apple build tool specifies
869           RC_ARCHS=x86_64, then let the service build for x86_64, but don’t install it.
870
871 2018-03-03  Brent Fulgham  <bfulgham@apple.com>
872
873         Notify the NetworkProcess when a session is servicing an automation client
874         https://bugs.webkit.org/show_bug.cgi?id=183306
875         <rdar://problem/37835783>
876
877         Reviewed by Brian Burg.
878
879         Network loads servicing WebDriver are done through an ephemeral session. While this is great
880         for protecting a developer's machine from sharing state with test runs, it has the unintended
881         effect of blocking certain logging operations.
882
883         We do not log content in ephemeral sessions to protect user privacy. However, ephemeral sessions
884         generated by WebDriver should participate in logging so that proper testing (with logging) can
885         be done.
886
887         This patch signals the NetworkProcess when an ephemeral session (created for automation purposes)
888         is created, so that it can allow logging.
889
890         * NetworkProcess/NetworkProcess.cpp:
891         (WebKit::NetworkProcess::destroySession): Remove controlled-by-automation entry.
892         (WebKit::NetworkProcess::sessionIsControlledByAutomation const): Added.
893         (WebKit::NetworkProcess::setSessionIsControlledByAutomation): Added.
894         * NetworkProcess/NetworkProcess.h:
895         * NetworkProcess/NetworkProcess.messages.in:
896         * NetworkProcess/NetworkResourceLoader.cpp:
897         (WebKit::NetworkResourceLoader::isAlwaysOnLoggingAllowed const): Checks if the relevant session
898         is servicing an automation client, and returns true if it is.
899         * UIProcess/WebPageProxy.cpp:
900         (WebKit::WebPageProxy::WebPageProxy): Signal the network process if this page is being created
901         for an automation client.
902
903 2018-03-02  Yusuke Suzuki  <utatane.tea@gmail.com>
904
905         [WTF] Remove RunLoop and RunLoop::Timer's interface using double as seconds
906         https://bugs.webkit.org/show_bug.cgi?id=183293
907
908         Reviewed by Alex Christensen.
909
910         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
911         (WebKit::CompositingRunLoop::scheduleUpdate):
912         (WebKit::CompositingRunLoop::compositionCompleted):
913         (WebKit::CompositingRunLoop::updateCompleted):
914         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
915         (WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback):
916
917 2018-03-02  Don Olmstead  <don.olmstead@sony.com>
918
919         Share common WebError implementation
920         https://bugs.webkit.org/show_bug.cgi?id=183303
921
922         Reviewed by Ryosuke Niwa.
923
924         * Shared/WebErrors.cpp:
925         (WebKit::cancelledError):
926         (WebKit::fileDoesNotExistError):
927         * Shared/glib/WebErrorsGlib.cpp: Removed.
928         * SourcesGTK.txt:
929         * SourcesWPE.txt:
930
931 2018-03-02  Youenn Fablet  <youenn@apple.com>
932
933         LayoutTest imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-within-sw.https.html is a flaky failure
934         https://bugs.webkit.org/show_bug.cgi?id=179248
935         <rdar://problem/35377756>
936
937         Reviewed by Chris Dumez.
938
939         In case we go up to the initializeSize step and Caches was cleared
940         between the time we stated to initialize and the time we got there,
941         we need to make as if Caches was not initialized,
942         thus keeping m_isInitialized to false and m_storage to nullptr.
943
944         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
945         (WebKit::CacheStorage::Caches::initializeSize):
946
947 2018-03-02  Youenn Fablet  <youenn@apple.com>
948
949         Clients should register to StorageProcess with their service worker registration identifier
950         https://bugs.webkit.org/show_bug.cgi?id=182313
951         <rdar://problem/38044403>
952
953         Reviewed by Chris Dumez.
954
955         Relanding.
956
957         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
958         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
959         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
960         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
961         * WebProcess/Storage/WebSWClientConnection.cpp:
962         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
963         * WebProcess/Storage/WebSWClientConnection.h:
964
965 2018-03-02  Tim Horton  <timothy_horton@apple.com>
966
967         Make it possible to disable WKPDFView
968         https://bugs.webkit.org/show_bug.cgi?id=183281
969         <rdar://problem/38060815>
970
971         Reviewed by Dan Bates.
972
973         * UIProcess/API/Cocoa/WKWebView.mm:
974         (-[WKWebView _isBackground]):
975         (-[WKWebView _isDisplayingPDF]):
976         (-[WKWebView _dataForDisplayedPDF]):
977         (-[WKWebView _suggestedFilenameForDisplayedPDF]):
978         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
979         (-[WKWebViewContentProviderRegistry init]):
980         * UIProcess/ios/WKPDFView.h:
981         * UIProcess/ios/WKPDFView.mm:
982
983 2018-03-02  Youenn Fablet  <youenn@apple.com>
984
985         WebProcessProxy should handle its completion handler at destruction time
986         https://bugs.webkit.org/show_bug.cgi?id=183224
987
988         Reviewed by Brady Eidson.
989
990         * UIProcess/WebProcessProxy.cpp:
991         (WebKit::WebProcessProxy::~WebProcessProxy):
992         * UIProcess/WebProcessProxy.h:
993
994 2018-03-02  Brent Fulgham  <bfulgham@apple.com>
995
996         Update WebContent process sandbox IOKit properties
997         https://bugs.webkit.org/show_bug.cgi?id=183269
998         <rdar://problem/37853282>
999
1000         Reviewed by Eric Carlson.
1001
1002         * WebProcess/com.apple.WebProcess.sb.in:
1003
1004 2018-03-01  Yusuke Suzuki  <utatane.tea@gmail.com>
1005
1006         Remove monotonicallyIncreasingTime
1007         https://bugs.webkit.org/show_bug.cgi?id=182911
1008
1009         Reviewed by Michael Catanzaro.
1010
1011         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
1012         (WebKit::CacheStorage::Cache::toRecordInformation):
1013         * Platform/IPC/ArgumentCoders.cpp:
1014         (IPC::ArgumentCoder<Seconds>::encode):
1015         (IPC::ArgumentCoder<Seconds>::decode):
1016         (IPC::ArgumentCoder<MonotonicTime>::encode):
1017         (IPC::ArgumentCoder<MonotonicTime>::decode):
1018         * Platform/IPC/ArgumentCoders.h:
1019         * Shared/Gamepad/GamepadData.cpp:
1020         (WebKit::GamepadData::GamepadData):
1021         * Shared/Gamepad/GamepadData.h:
1022         (WebKit::GamepadData::lastUpdateTime const):
1023         * Shared/WebCoreArgumentCoders.cpp:
1024         (IPC::ArgumentCoder<MonotonicTime>::encode): Deleted.
1025         (IPC::ArgumentCoder<MonotonicTime>::decode): Deleted.
1026         (IPC::ArgumentCoder<Seconds>::encode): Deleted.
1027         (IPC::ArgumentCoder<Seconds>::decode): Deleted.
1028         ArgumentCoders for MonotonicTime and Seconds are now used internally.
1029         Move them to Platform/IPC/ArgumentCoders.h.
1030
1031         * Shared/WebCoreArgumentCoders.h:
1032         * UIProcess/API/glib/IconDatabase.cpp:
1033         (WebKit::IconDatabase::iconDatabaseSyncThread):
1034         * UIProcess/DrawingAreaProxyImpl.cpp:
1035         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::start):
1036         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::stop):
1037         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::didDraw):
1038         * UIProcess/DrawingAreaProxyImpl.h:
1039         * UIProcess/Gamepad/UIGamepad.h:
1040         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
1041         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
1042         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
1043         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
1044         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
1045         (WebKit::RemoteLayerTreeHost::animationDidStart):
1046         * WebProcess/WebPage/DrawingArea.h:
1047         (WebKit::DrawingArea::acceleratedAnimationDidStart):
1048         * WebProcess/WebPage/DrawingArea.messages.in:
1049         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h:
1050         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
1051         (mediaTimeToCurrentTime):
1052         (-[WKAnimationDelegate animationDidStart:]):
1053         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
1054         (WebKit::PlatformCALayerRemote::animationStarted):
1055         This argument `beginTime` is not CFTimeInverval actually. We add currentTimeToMediaTime
1056         conversion here to fix this issue.
1057
1058         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
1059         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
1060         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
1061         (WebKit::RemoteLayerTreeContext::animationDidStart):
1062         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
1063         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1064         (WebKit::RemoteLayerTreeDrawingArea::acceleratedAnimationDidStart):
1065         * WebProcess/cocoa/WebProcessCocoa.mm:
1066         (WebKit::WebProcess::destroyRenderingResources):
1067
1068 2018-03-02  Brent Fulgham  <bfulgham@apple.com>
1069
1070         [iOS] whitelist missing AppleJPEG logging feature
1071         https://bugs.webkit.org/show_bug.cgi?id=183270
1072         <rdar://problem/37808612>
1073
1074         Reviewed by Alex Christensen.
1075
1076         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1077
1078 2018-03-02  Youenn Fablet  <youenn@apple.com>
1079
1080         IOChannel::read and IOChannel::write can destroy the completion handler in the thread used to manipulate thread
1081         https://bugs.webkit.org/show_bug.cgi?id=183261
1082
1083         Reviewed by Antti Koivisto.
1084
1085         Moving the completion handler when being called so that it gets desttroyed in the thread it is called.
1086
1087         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1088         (WebKit::NetworkCache::IOChannel::read):
1089         (WebKit::NetworkCache::IOChannel::write):
1090
1091 2018-03-02  Dan Bernstein  <mitz@apple.com>
1092
1093         Safari uses WebContent.Development when loading injected bundle embedded in its app bundle
1094         https://bugs.webkit.org/show_bug.cgi?id=183275
1095
1096         Reviewed by Tim Horton.
1097
1098         * UIProcess/mac/WebProcessProxyMac.mm:
1099         (WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Return false if this is
1100           a platform binary. We can also return false unconditionally when building for any shipping
1101           major macOS release.
1102
1103 2018-03-01  Commit Queue  <commit-queue@webkit.org>
1104
1105         Unreviewed, rolling out r229153.
1106         https://bugs.webkit.org/show_bug.cgi?id=183274
1107
1108         it is breaking imported/w3c/web-platform-tests/service-workers
1109         /service-worker/clients-matchall-exact-controller.https.html
1110         (Requested by youenn on #webkit).
1111
1112         Reverted changeset:
1113
1114         "Clients should register to StorageProcess with their service
1115         worker registration identifier"
1116         https://bugs.webkit.org/show_bug.cgi?id=182313
1117         https://trac.webkit.org/changeset/229153
1118
1119 2018-03-01  Brent Fulgham  <bfulgham@apple.com>
1120
1121         Add the "com.apple.security.cs.disable-library-validation” entitlement to the Plugin Process
1122         https://bugs.webkit.org/show_bug.cgi?id=183252
1123         <rdar://problem/37887136>
1124
1125         Reviewed by David Kilzer.
1126
1127         * Configurations/PluginService.entitlements:
1128
1129 2018-03-01  Youenn Fablet  <youenn@apple.com>
1130
1131         Clients should register to StorageProcess with their service worker registration identifier
1132         https://bugs.webkit.org/show_bug.cgi?id=182313
1133
1134         Reviewed by Chris Dumez.
1135
1136         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1137         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
1138         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1139         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1140         * WebProcess/Storage/WebSWClientConnection.cpp:
1141         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
1142         * WebProcess/Storage/WebSWClientConnection.h:
1143
1144 2018-03-01  Youenn Fablet  <youenn@apple.com>
1145
1146         LayoutTest imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-within-sw.https.html is a flaky failure
1147         https://bugs.webkit.org/show_bug.cgi?id=179248
1148         <rdar://problem/35377756>
1149
1150         Reviewed by Chris Dumez.
1151
1152         WebKitTestRunner is clearing caches for every test but there might still be some on-going cache activity due to a previous test.
1153         In that case, the activity might try to open the Caches object at the same time the files are deleted by the clearing task.
1154         If the new test is trying to open the same caches, it will also receive the same error, hence the console log message.
1155
1156         To fix that issue, we clear the initialization pending callbacks when clearing the caches.
1157         This prevents the new test to receive the error since the new test should only start some cache activity after the cache clear task is done.
1158         Made refactoring to append the first callback into the list of pending callbacks.
1159
1160         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1161         (WebKit::CacheStorage::Caches::initialize):
1162         (WebKit::CacheStorage::Caches::initializeSize):
1163         (WebKit::CacheStorage::Caches::clear):
1164         * NetworkProcess/cache/CacheStorageEngineCaches.h:
1165
1166 2018-03-01  Youenn Fablet  <youenn@apple.com>
1167
1168         Add API test to validate setting of service worker and cache storage directories
1169         https://bugs.webkit.org/show_bug.cgi?id=182543
1170
1171         Reviewed by Chris Dumez.
1172
1173         Add cache engine directory path to its representation dump.
1174         This is used in API tests to check that the path is correctly set.
1175
1176         Add a way for to know whether a service worker was registered from a WKWebsiteDataStore.
1177         This is used in API tests to check that the path is correctly set.
1178
1179         * NetworkProcess/cache/CacheStorageEngine.cpp:
1180         (WebKit::CacheStorage::Engine::representation):
1181         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1182         (-[WKWebsiteDataStore _hasRegisteredServiceWorker]):
1183         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1184
1185 2018-03-01  Wenson Hsieh  <wenson_hsieh@apple.com>
1186
1187         Fix some errors due to some mach port APIs being unavailable on watchOS
1188         https://bugs.webkit.org/show_bug.cgi?id=183262
1189         <rdar://problem/38028521>
1190
1191         Reviewed by Tim Horton.
1192
1193         Minor build fix; mach_port_guard and mach_port_unguard are not available on this platform.
1194
1195         * Platform/IPC/mac/ConnectionMac.mm:
1196         (IPC::Connection::platformInvalidate):
1197         (IPC::Connection::platformInitialize):
1198         (IPC::Connection::open):
1199
1200 2018-03-01  Per Arne Vollan  <pvollan@apple.com>
1201
1202         Unreviewed build fix after r229140.
1203
1204         * WebProcess/cocoa/WebProcessCocoa.mm:
1205
1206 2018-03-01  Per Arne Vollan  <pvollan@apple.com>
1207
1208         Scrollbar preferences are ignored when the WebContent process doesn't have access to the WindowServer.
1209         https://bugs.webkit.org/show_bug.cgi?id=183231
1210         <rdar://problem/37793457>
1211
1212         Reviewed by Brent Fulgham.
1213
1214         When the WebContent process doesn't have access to the WindowServer, the scrollbars are always of the overlay type.
1215         The notification about scrollbar preferences is never received by the WebContent process when there is no
1216         WindowServer access. This can be fixed by adding an observer of scrollbar preferences in the UI process, and
1217         notifying the WebProcess about this by sending it a message. This message should also contain the preferred
1218         scrollbar type, since the call '[NSScroller preferredScrollerStyle]' will always return the overlay style when
1219         there is no WindowServer access.
1220
1221         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1222         (WebKit::WebProcessPool::registerNotificationObservers):
1223         (WebKit::WebProcessPool::unregisterNotificationObservers):
1224         * UIProcess/WebProcessPool.h:
1225         * WebProcess/WebProcess.cpp:
1226         (WebKit::WebProcess::initializeProcess):
1227         * WebProcess/WebProcess.h:
1228         * WebProcess/WebProcess.messages.in:
1229         * WebProcess/cocoa/WebProcessCocoa.mm:
1230         (WebKit::WebProcess::scrollerStylePreferenceChanged):
1231
1232 2018-03-01  Antti Koivisto  <antti@apple.com>
1233
1234         Crash when updating cache entry after validation in apps that uses class A file protection
1235         https://bugs.webkit.org/show_bug.cgi?id=183242
1236         <rdar://problem/33289058>
1237
1238         Reviewed by Chris Dumez.
1239
1240         When validating a cache entry, we keep it alive until we get a network response. With 304 response
1241         we then update the headers of this existing entry. This accesses the body data of the entry which
1242         may be backed by a mapped file. If the app uses class A protection, user might have locked
1243         the device and the entry might have become inaccessible, leading to a crash.
1244
1245         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1246         (WebKit::NetworkCache::Entry::setNeedsValidation):
1247
1248         In case of class A protection, pull the data to a memory buffer immediately before starting a revalidation request.
1249         This makes the window where the file could become inaccessible much shorter (since it no longer depends on network).
1250
1251 2018-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1252
1253         REGRESSION(r221514): [GTK] UI process crash in WebKit::WaylandCompositor::Surface::flushPendingFrameCallbacks
1254         https://bugs.webkit.org/show_bug.cgi?id=183091
1255
1256         Reviewed by Michael Catanzaro.
1257
1258         Invalidate the surface in the page map when the backing store is destroyed.
1259
1260         * UIProcess/gtk/WaylandCompositor.cpp:
1261         (WebKit::WaylandCompositor::willDestroySurface):
1262         * UIProcess/gtk/WaylandCompositor.h:
1263
1264 2018-02-28  Brian Burg  <bburg@apple.com>
1265
1266         [Cocoa] Web Automation: provide a way to ask clients the type of a JavaScript dialog
1267         https://bugs.webkit.org/show_bug.cgi?id=182660
1268         <rdar://problem/37408183>
1269
1270         Reviewed by Tim Horton and Carlos Garcia Campos.
1271
1272         Add another delegate method to ask what type of dialog is being shown.
1273         This is used to implement §18.4 Step 5, where sending text to a dialog
1274         without a prompt will return several different kinds of errors.
1275
1276         No new tests, covered by web platform tests once Safari side has landed.
1277
1278         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: Update FIXME radar numbers.
1279         * UIProcess/Cocoa/AutomationSessionClient.h:
1280         * UIProcess/Cocoa/AutomationSessionClient.mm:
1281         (WebKit::AutomationSessionClient::AutomationSessionClient):
1282         (WebKit::toImpl):
1283         (WebKit::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage):
1284         If there is no current dialog to be checked, the client can return the 'None'
1285         type. This gets converted into a std::nullopt and causes a command error later.
1286
1287 2018-02-28  John Wilander  <wilander@apple.com>
1288
1289         Remove assertion from ResourceLoadStatisticsClassifier::calculateResourcePrevalence() which causes crashes when domains are explicitly set as prevalent without the associated statistics
1290         https://bugs.webkit.org/show_bug.cgi?id=183233
1291
1292         Unreviewed removal of an assertion that's causing layout test crashes.
1293
1294         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
1295         (WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
1296             Removed ASSERT(currentPrevalence == Low).
1297
1298 2018-02-28  John Wilander  <wilander@apple.com>
1299
1300         Add a second tier of prevalence to facilitate telemetry on very prevalent domains
1301         https://bugs.webkit.org/show_bug.cgi?id=183218
1302         <rdar://problem/37992388>
1303
1304         Reviewed by Brent Fulgham.
1305
1306         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
1307         (WebKit::vectorLength):
1308             New convenience function.
1309         (WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
1310             Renamed from ResourceLoadStatisticsClassifier::hasPrevalentResourceCharacteristics().
1311             Now returns a value from the enum ResourceLoadPrevalence.
1312         (WebKit::ResourceLoadStatisticsClassifier::classifyWithVectorThreshold):
1313             Now uses the new vectorLength() convenience function.
1314         (WebKit::ResourceLoadStatisticsClassifier::hasPrevalentResourceCharacteristics): Deleted.
1315             Renamed to ResourceLoadStatisticsClassifier::calculateResourcePrevalence().
1316         * Platform/classifier/ResourceLoadStatisticsClassifier.h:
1317             Added enum ResourceLoadPrevalence.
1318         * Shared/WebCoreArgumentCoders.cpp:
1319         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
1320         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
1321             Handling of the new boolean field isVeryPrevalentResource.
1322         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1323         (WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
1324         (WKWebsiteDataStoreIsStatisticsVeryPrevalentResource):
1325             Test infrastructure.
1326         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1327         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1328         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
1329         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
1330         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
1331         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
1332         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
1333             All of these are for handling of the two-tier classification.
1334             Also bumped the statisticsModelVersion to 12.
1335         * UIProcess/WebResourceLoadStatisticsStore.h:
1336
1337 2018-02-28  Alex Christensen  <achristensen@webkit.org>
1338
1339         Reduce use of NetworkingContext in WebKit
1340         https://bugs.webkit.org/show_bug.cgi?id=183213
1341
1342         Reviewed by Brady Eidson.
1343
1344         * NetworkProcess/RemoteNetworkingContext.h:
1345         * WebProcess/Network/WebLoaderStrategy.cpp:
1346         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
1347         (WebKit::WebLoaderStrategy::preconnectTo):
1348         * WebProcess/Network/WebLoaderStrategy.h:
1349         * WebProcess/Plugins/PluginView.cpp:
1350         (WebKit::PluginView::proxiesForURL):
1351         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1352         * WebProcess/WebPage/WebFrame.cpp:
1353
1354 2018-02-28  Brent Fulgham  <bfulgham@apple.com>
1355
1356         Remove network access from the WebContent process sandbox
1357         https://bugs.webkit.org/show_bug.cgi?id=183192
1358         <rdar://problem/35369115>
1359
1360         Reviewed by Alex Christensen.
1361
1362         Remove the 'system-network', 'allow-network-common', and 'network-client' access from the WebContent process.
1363         That's why we have a Network Process! 
1364
1365         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1366         * WebProcess/com.apple.WebProcess.sb.in:
1367
1368 2018-02-27  Tim Horton  <timothy_horton@apple.com>
1369
1370         Ensure target triple is propagated correctly to DerivedSources.make
1371         https://bugs.webkit.org/show_bug.cgi?id=183189
1372         <rdar://problem/37959694>
1373
1374         Reviewed by Dan Bernstein.
1375
1376         * Configurations/Base.xcconfig:
1377         * DerivedSources.make:
1378         Ditto the WebCore ChangeLog.
1379
1380 2018-02-27  Yongjun Zhang  <yongjun_zhang@apple.com>
1381
1382         Make it possible to set suggestions in extra zoom mode.
1383         https://bugs.webkit.org/show_bug.cgi?id=183154
1384         <rdar://problem/35227450>
1385
1386         Reviewed by Tim Horton.
1387
1388         In extra zoom mode, when presenting WKFocusedFormControlViewController, make it the inputDelegate for
1389         WKContentView. This is needed to ensure we can capture/cache the suggestions when _WKInputSession's
1390         suggestions is updated. Later, when we present WKTextInputViewController, we can pass the cached
1391         suggestions.
1392
1393         * UIProcess/ios/WKContentViewInteraction.mm:
1394         (-[WKContentView presentFocusedFormControlViewController:]): Set _focusedFormControlViewController as
1395             the inputDelegate for WKContentView.
1396         (-[WKContentView dismissFocusedFormControlViewController:]): Null the inputDelegate on dismissal.
1397         (-[WKContentView presentTextInputViewController:]): Pass the suggestions from WKFocusedFormControlViewController to
1398             WKTextInputViewController when the latter is presented.
1399         (-[WKContentView textInputController:didCommitText:]): Call the new delegate method textInputController:didCommitText:withSuggestion:.
1400         (-[WKContentView textInputController:didCommitText:withSuggestion:]): When a suggestions is selected, insert the
1401             suggestion which will notify the client.
1402         (-[WKContentView focusedFormControllerDidUpdateSuggestions:]): Called when the suggestion is updated after the input
1403             view controller is presented.
1404
1405 2018-02-27  Tim Horton  <timothy_horton@apple.com>
1406
1407         Stop using deprecated CADisplay SPI
1408         https://bugs.webkit.org/show_bug.cgi?id=183150
1409         <rdar://problem/37918297>
1410
1411         Reviewed by Simon Fraser.
1412
1413         * Platform/spi/ios/FrontBoardServicesSPI.h: Added.
1414         * Platform/spi/ios/UIKitSPI.h:
1415         * UIProcess/API/Cocoa/WKWebView.mm:
1416         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
1417         * WebKit.xcodeproj/project.pbxproj:
1418         Switch to the more modern way of getting the display name.
1419
1420 2018-02-27  Ryan Haddad  <ryanhaddad@apple.com>
1421
1422         Unreviewed, rolling out r229055.
1423
1424         Breaks internal builds.
1425
1426         Reverted changeset:
1427
1428         "Stop using deprecated CADisplay SPI"
1429         https://bugs.webkit.org/show_bug.cgi?id=183150
1430         https://trac.webkit.org/changeset/229055
1431
1432 2018-02-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1433
1434         [Extra zoom mode] Implement additional SPI for adjusting viewport shrink-to-fit behavior
1435         https://bugs.webkit.org/show_bug.cgi?id=183100
1436         <rdar://problem/37840987>
1437
1438         Reviewed by Tim Horton.
1439
1440         Add new SPI hooks to provide finer control over certain aspects of the shrink-to-fit viewport heuristic.
1441         Currently, in certain cases of iPad multitasking, Safari allows shrinking content to fit by default. This means
1442         that even when "width=device-width" is used, if the contents of the page are too wide to fit within the
1443         viewport's width, we'll adjust the initial scale such that the viewport can fit all of the content.
1444
1445         However, in certain viewport dimensions, this heuristic is insufficient to ensure that pages are laid out and
1446         displayed properly within the viewport. Namely, one could imagine that an element with a hard-coded width that
1447         is larger than the real viewport width would cause all other elements with dimensions relative to the body to be
1448         excessively shrunk down once shrink-to-fit is applied, so the page would still look broken even if the contents
1449         of the page all fit within the viewport.
1450
1451         To mitigate this, we decouple the notions of minimum layout size from the size of the actual viewport (which we
1452         simply refer to as "view size"). This allows us to introduce a mechanism where we lay out the page at a given
1453         minimum layout size that is larger than the size of the view; later, when we determine the initial scale, we
1454         then apply shrink-to-fit scaling using the view size rather than the minimum layout size. This grants us the
1455         ability to lay out content as if our view were large, but still ensure that the contents of the page fit within
1456         the actual view.
1457
1458         * Shared/VisibleContentRectUpdateInfo.cpp:
1459         (WebKit::VisibleContentRectUpdateInfo::encode const):
1460         (WebKit::VisibleContentRectUpdateInfo::decode):
1461         (WebKit::operator<<):
1462         * Shared/VisibleContentRectUpdateInfo.h:
1463         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
1464         (WebKit::VisibleContentRectUpdateInfo::forceHorizontalShrinkToFit const):
1465         (WebKit::operator==):
1466
1467         Plumb the forceHorizontalShrinkToFit flag through VisibleContentRectUpdateInfo.
1468
1469         * Shared/WebPageCreationParameters.cpp:
1470         (WebKit::WebPageCreationParameters::encode const):
1471         (WebKit::WebPageCreationParameters::decode):
1472         * Shared/WebPageCreationParameters.h:
1473
1474         Plumb viewSize through IPC to WebPage.
1475
1476         * UIProcess/API/Cocoa/WKWebView.mm:
1477         (-[WKWebView _initializeWithConfiguration:]):
1478
1479         Start off WKWebView flags at their initial values.
1480
1481         (-[WKWebView _minimumAllowedLayoutWidth]):
1482         (-[WKWebView _setMinimumAllowedLayoutWidth:]):
1483
1484         This provides the minimum width at which the page will lay out, such that if the view width dips below this
1485         value, we'll use this minimum allowed layout width instead. 0 by default.
1486
1487         (-[WKWebView activeMinimumLayoutSizes:]):
1488
1489         Refactor this from a static function to a helper method on WKWebView that computes both the minimum layout size
1490         (which takes minimum allowed layout width into account) as well as the real view size. Refactor all call sites
1491         to use this new method, and also propagate the view size down via IPC, alongside the minimum layout size.
1492
1493         (-[WKWebView _dispatchSetMinimumLayoutSize:viewSize:]):
1494         (-[WKWebView _frameOrBoundsChanged]):
1495         (-[WKWebView _setMinimumLayoutSizeOverride:]):
1496         (-[WKWebView _setForceHorizontalViewportShrinkToFit:]):
1497         (-[WKWebView _forceHorizontalViewportShrinkToFit]):
1498
1499         Setting this flag to YES forces us to always shrink-to-fit in the horizontal axis. NO by default.
1500
1501         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1502         (-[WKWebView _endAnimatedResize]):
1503         (activeMinimumLayoutSize): Deleted.
1504
1505         More refactoring to replace activeMinimumLayoutSize() with -activeMinimumLayoutSizes:.
1506
1507         (-[WKWebView _dispatchSetMinimumLayoutSize:]): Deleted.
1508         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1509         * UIProcess/WebPageProxy.cpp:
1510         (WebKit::WebPageProxy::creationParameters):
1511         * UIProcess/WebPageProxy.h:
1512         * UIProcess/ios/WKContentView.mm:
1513         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
1514
1515         Pass _forceHorizontalViewportShrinkToFit into the visible content rect update.
1516
1517         * UIProcess/ios/WebPageProxyIOS.mm:
1518         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
1519         (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
1520
1521         Plumb viewSize alongside the existing minimumLayoutSize.
1522
1523         * WebProcess/WebPage/WebPage.cpp:
1524         (WebKit::m_credentialsMessenger):
1525         * WebProcess/WebPage/WebPage.h:
1526         * WebProcess/WebPage/WebPage.messages.in:
1527         * WebProcess/WebPage/ios/WebPageIOS.mm:
1528         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
1529         (WebKit::WebPage::dynamicViewportSizeUpdate):
1530         (WebKit::WebPage::updateVisibleContentRects):
1531
1532         Set forceHorizontalShrinkToFit on the viewport configuration here.
1533
1534 2018-02-27  Tim Horton  <timothy_horton@apple.com>
1535
1536         Stop using deprecated CADisplay SPI
1537         https://bugs.webkit.org/show_bug.cgi?id=183150
1538         <rdar://problem/37918297>
1539
1540         Reviewed by Simon Fraser.
1541
1542         * Platform/spi/ios/FrontBoardServicesSPI.h: Added.
1543         * Platform/spi/ios/UIKitSPI.h:
1544         * UIProcess/API/Cocoa/WKWebView.mm:
1545         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
1546         * WebKit.xcodeproj/project.pbxproj:
1547         Switch to the more modern way of getting the display name.
1548
1549 2018-02-26  Youenn Fablet  <youenn@apple.com>
1550
1551         Caches::m_storage should be set to null in case of error at initialization time
1552         https://bugs.webkit.org/show_bug.cgi?id=183068
1553
1554         Reviewed by Chris Dumez.
1555
1556         In case of error, we need to set m_storage back to nullptr so that
1557         next tries to initialize it will restart from scratch.
1558         If we do not set it to nullptr, we end up storing the initialize
1559         callback in a queue and the callback will never be called.
1560
1561         This is difficult to test as we need the following conditions:
1562         - we need to have an error case, like a disk writing error
1563         - we need the web app to open a cache in two different pages/frames at about the same time.
1564
1565         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1566         (WebKit::CacheStorage::Caches::initialize):
1567
1568 2018-02-26  Commit Queue  <commit-queue@webkit.org>
1569
1570         Unreviewed, rolling out r226330.
1571         https://bugs.webkit.org/show_bug.cgi?id=183152
1572
1573         incorrectly assumes enumeration callback happens once
1574         (Requested by alexchristensen on #webkit).
1575
1576         Reverted changeset:
1577
1578         "Use BlockPtrs and lambdas instead of new/delete to pass
1579         parameters to blocks in WebViewImpl::performDragOperation"
1580         https://bugs.webkit.org/show_bug.cgi?id=180795
1581         https://trac.webkit.org/changeset/226330
1582
1583 2018-02-26  Ryosuke Niwa  <rniwa@webkit.org>
1584
1585         Release assertion in WebPage::updatePreferences
1586         https://bugs.webkit.org/show_bug.cgi?id=183075
1587
1588         Reviewed by Youenn Fablet and Chris Dumez.
1589
1590         Replaced the release assertion added in r228589 with a more graceful disabling of the feature when the entitlement is missing.
1591
1592         * StorageProcess/StorageProcess.cpp:
1593         (WebKit::StorageProcess::didReceiveMessage): Added an early exit with an entitlement check to disable the feature.
1594         (WebKit::StorageProcess::initializeWebsiteDataStore): Ditto.
1595         (WebKit::StorageProcess::createStorageToWebProcessConnection): Replaced the release assertion with a debug assertion.
1596         (WebKit::StorageProcess::swServerForSession): Removed the assertion. This code can be reached when the service worker is disabled.
1597         (WebKit::StorageProcess::registerSWServerConnection): Replaced the release assertion with a debug assertion.
1598         * WebProcess/WebPage/WebPage.cpp:
1599         (WebKit::WebPage::updatePreferences): Disable the feature instead of crashing when the entitlement is missing.
1600
1601 2018-02-26  Chris Dumez  <cdumez@apple.com>
1602
1603         Regression(r223431): Crash under didReceiveChallenge in NetworkSessionCocoa
1604         https://bugs.webkit.org/show_bug.cgi?id=183134
1605         <rdar://problem/36339049>
1606
1607         Reviewed by Alex Christensen.
1608
1609         Like other delegates functions in this file, it is possible for didReceiveChallenge to get called
1610         after _session has been nulled out. Other delegate functions already had early returns when
1611         _session is null. However, such early return was missing in didReceiveChallenge.
1612
1613         This patch ends the early return to didReceiveChallenge so that we do not end up calling
1614         _session->downloadID(taskIdentifier) on a null _session.
1615
1616         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1617         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
1618
1619 2018-02-26  Youenn Fablet  <youenn@apple.com>
1620
1621         MessagePort is not always destroyed in the right thread
1622         https://bugs.webkit.org/show_bug.cgi?id=183053
1623
1624         Reviewed by Chris Dumez.
1625
1626         Update code to pass a lambda to MessagePort::existingMessagePortForIdentifier.
1627
1628         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp:
1629         (WebKit::WebMessagePortChannelProvider::checkProcessLocalPortForActivity):
1630         * WebProcess/WebProcess.cpp:
1631         (WebKit::WebProcess::messagesAvailableForPort):
1632
1633 2018-02-25  Alexey Proskuryakov  <ap@apple.com>
1634
1635         Font smoothing doesn't get disabled if the preference is set before launching WebContent process
1636         https://bugs.webkit.org/show_bug.cgi?id=183108
1637
1638         Reviewed by Tim Horton.
1639
1640         * WebProcess/WebProcess.cpp: (WebKit::WebProcess::initializeWebProcess):
1641         Fix the bug. While at it, also avoid the anti-pattern in setAlwaysUsesComplexTextCodePath.
1642
1643 2018-02-25  Philippe Normand  <pnormand@igalia.com>
1644
1645         Unreviewed GTK Debug build fix after r228942.
1646
1647         * UIProcess/API/glib/IconDatabase.cpp:
1648         (WebKit::IconDatabase::iconDatabaseSyncThread):
1649         (WebKit::IconDatabase::syncThreadMainLoop):
1650         (WebKit::IconDatabase::readFromDatabase):
1651         (WebKit::IconDatabase::writeToDatabase):
1652         (WebKit::IconDatabase::cleanupSyncThread):
1653
1654 2018-02-25  Chris Dumez  <cdumez@apple.com>
1655
1656         Service workers do not work well inside Web.app
1657         https://bugs.webkit.org/show_bug.cgi?id=183105
1658         <rdar://problem/37864140>
1659
1660         Reviewed by Youenn Fablet.
1661
1662         * StorageProcess/StorageProcess.cpp:
1663         (WebKit::StorageProcess::didReceiveMessage):
1664         We were failing to forward IPC messages to the ChildProcess class here. As a result,
1665         the ChildProcess::RegisterURLSchemeServiceWorkersCanHandle IPC was being ignored
1666         by the StorageProcess.
1667
1668 2018-02-24  Zan Dobersek  <zdobersek@igalia.com>
1669
1670         Unreviewed WPE breakage fix.
1671
1672         * WebProcess/wpe/WebProcessMainWPE.cpp: Call g_set_prgname() in WebProcess 
1673         to prepare the GLib state for subsequent GStreamer initialization.
1674
1675 2018-02-23  John Wilander  <wilander@apple.com>
1676
1677         Introduce ITP debug logging as an opt-in developer feature
1678         https://bugs.webkit.org/show_bug.cgi?id=183065
1679         <rdar://problem/37803761>
1680
1681         Reviewed by Brent Fulgham.
1682
1683         * Platform/Logging.h:
1684             Added a dedicated channel for Resource Load Statistics debug logging
1685             since this will be part of a developer-facing feature and should not
1686             be mixed with general Resource Load Statistics logging.
1687         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
1688         (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
1689             Now picks up the user default setting for
1690             ResourceLoadStatisticsDebugLoggingEnabled.
1691         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1692         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
1693             Now logs for which domains it purges website data if
1694             ResourceLoadStatisticsDebugLoggingEnabled is set.
1695         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
1696             Now logs for which domains it partitions and blocks cookies
1697             in third-party contexts if ResourceLoadStatisticsDebugLoggingEnabled
1698             is set.
1699         * UIProcess/WebResourceLoadStatisticsStore.h:
1700
1701 2018-02-23  Brent Fulgham  <bfulgham@apple.com>
1702
1703         [macOS] Correct sandbox violation during media playback
1704         https://bugs.webkit.org/show_bug.cgi?id=183092
1705         <rdar://problem/37718495>
1706
1707         Reviewed by Eric Carlson.
1708
1709         * WebProcess/com.apple.WebProcess.sb.in:
1710
1711 2018-02-23  Yousuke Kimoto  <yousuke.kimoto@sony.com>
1712
1713         [MSVC] Unknown a type definition error in WebResourceLoadStatisticsStore on wincairo webkit
1714         https://bugs.webkit.org/show_bug.cgi?id=182873
1715
1716         Reviewed by Yusuke Suzuki.
1717
1718         * UIProcess/WebResourceLoadStatisticsStore.h:
1719
1720 2018-02-23  Carlos Garcia Campos  <cgarcia@igalia.com>
1721
1722         [GStreamer][MiniBrowser] Honor GStreamer command line parameters in MiniBrowser
1723         https://bugs.webkit.org/show_bug.cgi?id=173655
1724         <rdar://problem/37706341>
1725
1726         Reviewed by Philippe Normand.
1727
1728         Actually pass the gst command line options to the WebProcess. The options in /proc/self/cmdline are separated by
1729         null characters, so we are effectively passing always the first option only, which is the program name. Then, in
1730         the web process we always ignore the first option and providing WebProcess unconditionally, so we were doing
1731         nothing.
1732
1733         * UIProcess/gtk/WebProcessPoolGtk.cpp:
1734         (WebKit::WebProcessPool::platformInitializeWebProcess): Use WebCore::extractGStreamerOptionsFromCommandLine()
1735         * UIProcess/wpe/WebProcessPoolWPE.cpp:
1736         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
1737         * WebProcess/soup/WebProcessSoup.cpp:
1738         (WebKit::WebProcess::platformInitializeWebProcess): Move the vector.
1739
1740 2018-02-22  Yusuke Suzuki  <utatane.tea@gmail.com>
1741
1742         Remove currentTime() / currentTimeMS()
1743         https://bugs.webkit.org/show_bug.cgi?id=183052
1744
1745         Reviewed by Mark Lam.
1746
1747         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
1748         * PluginProcess/WebProcessConnection.cpp:
1749         * Shared/WebProcessCreationParameters.h:
1750         * Shared/linux/WebMemorySamplerLinux.cpp:
1751         (WebKit::WebMemorySampler::sampleWebKit const):
1752         * Shared/mac/WebMemorySampler.mac.mm:
1753         (WebKit::WebMemorySampler::sampleWebKit const):
1754         * UIProcess/API/C/WKContext.cpp:
1755         (WKContextSetPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime):
1756         * UIProcess/API/glib/IconDatabase.cpp:
1757         (WebKit::IconDatabase::setIconDataForIconURL):
1758         (WebKit::IconDatabase::synchronousLoadDecisionForIconURL):
1759         (WebKit::IconDatabase::performURLImport):
1760         * UIProcess/DrawingAreaProxyImpl.cpp:
1761         * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
1762         (WebKit::expirationTimeFromNow):
1763         (WebKit::PlugInAutoStartProvider::addAutoStartOriginHash):
1764         (WebKit::PlugInAutoStartProvider::autoStartOriginsTableCopy const):
1765         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTable):
1766         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsFilteringOutEntriesAddedAfterTime):
1767         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest):
1768         (WebKit::PlugInAutoStartProvider::didReceiveUserInteraction):
1769         * UIProcess/Plugins/PlugInAutoStartProvider.h:
1770         * UIProcess/WebProcessPool.cpp:
1771         (WebKit::WebProcessPool::processDidFinishLaunching):
1772         (WebKit::WebProcessPool::startMemorySampler):
1773         (WebKit::WebProcessPool::setPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime):
1774         * UIProcess/WebProcessPool.h:
1775         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
1776         (API::InjectedBundle::PageLoaderClient::willPerformClientRedirectForFrame):
1777         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
1778         (WebKit::InjectedBundlePageLoaderClient::willPerformClientRedirectForFrame):
1779         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
1780         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1781         (WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect):
1782         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1783         * WebProcess/WebProcess.cpp:
1784         (WebKit::m_webSQLiteDatabaseTracker):
1785         (WebKit::WebProcess::isPlugInAutoStartOriginHash):
1786         (WebKit::WebProcess::plugInDidStartFromOrigin):
1787         (WebKit::WebProcess::didAddPlugInAutoStartOriginHash):
1788         (WebKit::WebProcess::resetPlugInAutoStartOriginDefaultHashes):
1789         (WebKit::WebProcess::resetPlugInAutoStartOriginHashes):
1790         (WebKit::WebProcess::plugInDidReceiveUserInteraction):
1791         * WebProcess/WebProcess.h:
1792         * WebProcess/WebProcess.messages.in:
1793         * WebProcess/cocoa/WebProcessCocoa.mm:
1794         * WebProcess/wpe/WebProcessMainWPE.cpp:
1795
1796 2018-02-22  Matt Baker  <mattbaker@apple.com>
1797
1798         Web Inspector: REGRESSION (r228349): ImageBitmap builtin is now runtime guarded
1799         https://bugs.webkit.org/show_bug.cgi?id=183056
1800         <rdar://problem/37799067>
1801
1802         Reviewed by Joseph Pecoraro.
1803
1804         * WebProcess/WebPage/WebInspectorUI.cpp:
1805         (WebKit::WebInspectorUI::WebInspectorUI):
1806
1807 2018-02-22  Youenn Fablet  <youenn@apple.com>
1808
1809         Caches::initialize should call all pending initialization callbacks in case of error
1810         https://bugs.webkit.org/show_bug.cgi?id=183062
1811
1812         Reviewed by Chris Dumez.
1813
1814         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1815         (WebKit::CacheStorage::Caches::initialize):
1816         (WebKit::CacheStorage::Caches::initializeSize):
1817
1818 2018-02-22  Youenn Fablet  <youenn@apple.com>
1819
1820         CacheStorage::Engine::Caches::writeRecord is not always calling the completion handler
1821         https://bugs.webkit.org/show_bug.cgi?id=183055
1822
1823         Reviewed by Chris Dumez.
1824
1825         Add a completion handler to Storage::store.
1826         Use it instead in Caches::writeRecord.
1827         This ensures that the Cache add/put promise will be called once all write operations have been done.
1828
1829         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1830         (WebKit::CacheStorage::Caches::writeRecord):
1831         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1832         (WebKit::NetworkCache::Storage::WriteOperation::WriteOperation):
1833         (WebKit::NetworkCache::Storage::finishWriteOperation):
1834         (WebKit::NetworkCache::Storage::store):
1835         * NetworkProcess/cache/NetworkCacheStorage.h:
1836         (WebKit::NetworkCache::Storage::store):
1837
1838 2018-02-22  Ryosuke Niwa  <rniwa@webkit.org>
1839
1840         Add an entitlement check for service worker on iOS
1841         https://bugs.webkit.org/show_bug.cgi?id=182865
1842
1843         Reviewed by Dan Bernstein.
1844
1845         Addressed Dan's comment by using xpc_connection_copy_entitlement_value instead of obtaining the audit token first.
1846
1847         * Shared/mac/SandboxUtilities.h:
1848         * Shared/mac/SandboxUtilities.mm:
1849         (WebKit::connectedProcessHasEntitlement):
1850         * StorageProcess/ios/StorageProcessIOS.mm:
1851         (WebKit::StorageProcess::parentProcessHasServiceWorkerEntitlement const):
1852         * WebProcess/WebPage/ios/WebPageIOS.mm:
1853         (WebKit::WebPage::parentProcessHasServiceWorkerEntitlement const):
1854
1855 2018-02-22  Youenn Fablet  <youenn@apple.com>
1856
1857         Fetch event release assert should take into account the fetch mode
1858         https://bugs.webkit.org/show_bug.cgi?id=183047
1859
1860         Reviewed by Chris Dumez.
1861
1862         In case of navigation tasks, we should use the request URL and not the origin of the loading client.
1863
1864         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1865         (WebKit::isValidFetch):
1866         (WebKit::WebSWContextManagerConnection::startFetch):
1867
1868 2018-02-22  Yousuke Kimoto  <yousuke.kimoto@sony.com>
1869
1870         [WinCairo] Fix compile errors in WebPageWin.cpp and WebProcessWin.cpp due to WebCore forwarding header paths
1871         https://bugs.webkit.org/show_bug.cgi?id=182969
1872
1873         Reviewed by Konstantin Tokarev.
1874
1875         * WebProcess/WebPage/win/WebPageWin.cpp:
1876         * WebProcess/win/WebProcessWin.cpp:
1877
1878 2018-02-22  Yusuke Suzuki  <utatane.tea@gmail.com>
1879
1880         Remove sleep(double) and sleepMS(double) interfaces
1881         https://bugs.webkit.org/show_bug.cgi?id=183038
1882
1883         Reviewed by Mark Lam.
1884
1885         * PluginProcess/WebProcessConnection.cpp:
1886         (WebKit::WebProcessConnection::createPluginAsynchronously):
1887         * UIProcess/linux/MemoryPressureMonitor.cpp:
1888         (WebKit::pollIntervalForUsedMemoryPercentage):
1889         (WebKit::MemoryPressureMonitor::MemoryPressureMonitor):
1890         * WebProcess/wpe/WebProcessMainWPE.cpp:
1891
1892 2018-02-22  Youenn Fablet  <youenn@apple.com>
1893
1894         Add release logging for CacheStorage::Engine disk related functions
1895         https://bugs.webkit.org/show_bug.cgi?id=183042
1896
1897         Reviewed by Chris Dumez.
1898
1899         * NetworkProcess/cache/CacheStorageEngine.cpp:
1900         (WebKit::CacheStorage::Engine::writeFile):
1901         (WebKit::CacheStorage::Engine::readFile):
1902
1903 2018-02-22  Matt Lewis  <jlewis3@apple.com>
1904
1905         Unreviewed, rolling out r228902.
1906
1907         This broke internal builds.
1908
1909         Reverted changeset:
1910
1911         "[Cocoa] Web Automation: provide a way to ask clients the type
1912         of a JavaScript dialog"
1913         https://bugs.webkit.org/show_bug.cgi?id=182660
1914         https://trac.webkit.org/changeset/228902
1915
1916 2018-02-22  Youenn Fablet  <youenn@apple.com>
1917
1918         Add release asserts for service worker fetch and postMessage events
1919         https://bugs.webkit.org/show_bug.cgi?id=183025
1920         rdar://problem/37765052
1921
1922         Reviewed by Daniel Bates.
1923
1924         Add assertion to protect interception of a fetch load by a service worker with
1925         a different origin from the page.
1926
1927         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1928         (WebKit::WebSWContextManagerConnection::startFetch):
1929
1930 2018-02-22  Ms2ger  <Ms2ger@igalia.com>
1931
1932         [GTK][WPE] Fix some build errors in service workers code
1933         https://bugs.webkit.org/show_bug.cgi?id=182966
1934
1935         Reviewed by Žan Doberšek.
1936
1937         * CMakeLists.txt: add missing files.
1938         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: add missing includes.
1939         * UIProcess/ServiceWorkerProcessProxy.cpp: use #include rather than #import in C++; add missing ifdef.
1940         * UIProcess/ServiceWorkerProcessProxy.h: add missing ifdef.
1941         * WebProcess/Storage/WebSWClientConnection.cpp: add missing includes.
1942         * WebProcess/Storage/WebSWContextManagerConnection.cpp: add missing includes.
1943         (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
1944           call the function that exists outside cocoa.
1945
1946 2018-02-21  Per Arne Vollan  <pvollan@apple.com>
1947
1948         The WebContent process should not use NSScreen in the screenAvailableRect/screenRect implementations.
1949         https://bugs.webkit.org/show_bug.cgi?id=182855
1950
1951         Reviewed by Brent Fulgham.
1952
1953         On macOS, the functions screenAvailableRect and screenRect is implemented using NSScreen, which is communicating
1954         with the WindowServer. To avoid this WindowServer communication from the WebContent process when calling
1955         screenAvailableRect and screenRect, it is possible to let the UIProcess send a message to the WebContent
1956         process whenever there is a change in the display properties, and have the WebContent process cache these
1957         display properties. This message should also be sent to a newly started WebContent process.
1958
1959         * UIProcess/WebProcessPool.cpp:
1960         (WebKit::displayReconfigurationCallBack):
1961         (WebKit::registerDisplayConfigurationCallback):
1962         (WebKit::WebProcessPool::initializeNewWebProcess):
1963         (WebKit::WebProcessPool::warmInitialProcess):
1964         * WebProcess/WebProcess.cpp:
1965         (WebKit::WebProcess::setScreenProperties):
1966         * WebProcess/WebProcess.h:
1967         * WebProcess/WebProcess.messages.in:
1968
1969 2018-02-21  Christopher Reid  <chris.reid@sony.com>
1970
1971         [Curl] Curl Cookie Database File should be configurable using NetworkProcessCreationParameters
1972         https://bugs.webkit.org/show_bug.cgi?id=182751
1973
1974         Reviewed by Youenn Fablet.
1975
1976         Adding a cookiePersistentStorageFile parameter to Curl's NetworkProcessCreationParameters.
1977         This parameter is based on Soup's cookiePersistentStoragePath.
1978         This parameter is not used yet, it is added to prepare for WinCairo WebKit support.
1979
1980         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1981         * NetworkProcess/NetworkProcessCreationParameters.h:
1982         * NetworkProcess/curl/NetworkProcessCurl.cpp:
1983         * WebProcess/Cookies/WebCookieManager.h:
1984         * WebProcess/Cookies/curl/WebCookieManagerCurl.cpp:
1985
1986 2018-02-21  Brian Burg  <bburg@apple.com>
1987
1988         [Cocoa] Web Automation: provide a way to ask clients the type of a JavaScript dialog
1989         https://bugs.webkit.org/show_bug.cgi?id=182660
1990         <rdar://problem/37408183>
1991
1992         Reviewed by Tim Horton and Carlos Garcia Campos.
1993
1994         Add another delegate method to ask what type of dialog is being shown.
1995         This is used to implement §18.4 Step 5, where sending text to a dialog
1996         without a prompt will return several different kinds of errors.
1997
1998         No new tests, covered by web platform tests once Safari side has landed.
1999
2000         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: Update FIXME radar numbers.
2001         * UIProcess/Cocoa/AutomationSessionClient.h:
2002         * UIProcess/Cocoa/AutomationSessionClient.mm:
2003         (WebKit::AutomationSessionClient::AutomationSessionClient):
2004         (WebKit::toImpl):
2005         (WebKit::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage):
2006         If there is no current dialog to be checked, the client can return the 'None'
2007         type. This gets converted into a std::nullopt and causes a command error later.
2008
2009 2018-02-21  Yousuke Kimoto  <yousuke.kimoto@sony.com>
2010
2011         [WinCairo] Fix compile errors of WebProcess and NetworkProcess due to no implementation for windows
2012         https://bugs.webkit.org/show_bug.cgi?id=182870
2013
2014         Reviewed by Youenn Fablet.
2015
2016         * NetworkProcess/NetworkProcess.cpp:
2017         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
2018         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
2019         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
2020         * WebProcess/WebPage/WebInspector.cpp:
2021         (WebKit::WebInspector::openFrontendConnection):
2022         * WebProcess/WebPage/WebInspectorUI.cpp:
2023         (WebKit::WebInspectorUI::establishConnection):
2024         * WebProcess/WebProcess.cpp:
2025         (WebKit::WebProcess::ensureNetworkProcessConnection):
2026
2027 2018-02-21  Don Olmstead  <don.olmstead@sony.com>
2028
2029         [CMake][Win] Use cmakeconfig.h rather than config.h and Platform.h
2030         https://bugs.webkit.org/show_bug.cgi?id=182883
2031
2032         Reviewed by Per Arne Vollan.
2033
2034         * config.h:
2035
2036 2018-02-21  Brian Burg  <bburg@apple.com>
2037
2038         Web Automation: failed provisional loads cause "Navigate To" command to hang
2039         https://bugs.webkit.org/show_bug.cgi?id=183007
2040         <rdar://problem/37751819>
2041
2042         Reviewed by Andy Estes.
2043
2044         This hang was revealed by WPT test current_url.py::get_current_url_file_protocol. Now the
2045         test simply fails because Safari chooses a policy of 'Ignore' for externally-opened files.
2046         I filed an upstream issue with the test here: https://github.com/w3c/webdriver/issues/1232
2047
2048         * UIProcess/WebPageProxy.cpp:
2049         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
2050         Notify the session that the load failed in the frame, just like we do
2051         for non-provisional failed loads and successful loads.
2052
2053 2018-02-20  Nan Wang  <n_wang@apple.com>
2054
2055         AX: Keyboard focus not following VoiceOver cursor into web content or within web content.
2056         https://bugs.webkit.org/show_bug.cgi?id=182752
2057         <rdar://problem/37518233>
2058
2059         Reviewed by Ryosuke Niwa.
2060
2061         * UIProcess/PageClient.h:
2062         * UIProcess/WebPageProxy.h:
2063         * UIProcess/WebPageProxy.messages.in:
2064         * UIProcess/ios/PageClientImplIOS.h:
2065         * UIProcess/ios/PageClientImplIOS.mm:
2066         (WebKit::PageClientImpl::assistiveTechnologyMakeFirstResponder):
2067         * UIProcess/ios/WebPageProxyIOS.mm:
2068         (WebKit::WebPageProxy::assistiveTechnologyMakeFirstResponder):
2069         * UIProcess/mac/PageClientImplMac.h:
2070         * UIProcess/mac/PageClientImplMac.mm:
2071         (WebKit::PageClientImpl::assistiveTechnologyMakeFirstResponder):
2072         * UIProcess/mac/WebPageProxyMac.mm:
2073         (WebKit::WebPageProxy::assistiveTechnologyMakeFirstResponder):
2074         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2075         (WebKit::WebChromeClient::assistiveTechnologyMakeFirstResponder):
2076         * WebProcess/WebCoreSupport/WebChromeClient.h:
2077
2078 2018-02-14  Brian Burg  <bburg@apple.com>
2079
2080         Web Automation: combine session commands to resize and move top-level browsing contexts
2081         https://bugs.webkit.org/show_bug.cgi?id=182749
2082         <rdar://problem/37515170>
2083
2084         Reviewed by Andy Estes.
2085
2086         Since moving and resizing the window are both accomplished by setting the window frame,
2087         and the W3C WebDriver specification has a Get/Set Window Rect command, it's time to
2088         deduplicate these two methods which basically do the same thing.
2089
2090         Adopt modern JSON::Value getters that return std::optional<float>. I have been trying
2091         to move the protocol over to this style wholesale, but it is probably easier to do
2092         this conversion in smaller pieces. And so, I have started to do so.
2093
2094         This change is covered by existing WebDriver tests.
2095
2096         * UIProcess/Automation/Automation.json: Add new command.
2097         * UIProcess/Automation/WebAutomationSession.cpp:
2098         (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext): Added.
2099         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext): Deleted.
2100         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext): Deleted.
2101         * UIProcess/Automation/WebAutomationSession.h:
2102
2103 2018-02-20  Brian Burg  <bburg@apple.com>
2104
2105         ASSERT under WebAutomationSession::setProcessPool() when running W3C test suite a second time
2106         https://bugs.webkit.org/show_bug.cgi?id=182991
2107         <rdar://problem/37620578>
2108
2109         Reviewed by Timothy Hatcher.
2110
2111         Sometimes when running more than one session end-to-end with the same browser instance,
2112         UIProcess would crash under addMessageReceiver because another WebAutomationSession was still
2113         registered. This is hard to reproduce, but upon code inspection, the receiver management code
2114         is somewhat problematic because it only runs when the WebAutomationSession destructor runs.
2115         In some cases the client could retain two sessions and cause the first one to never remove itself
2116         as the message receiver.
2117
2118         Instead of unregistering the session as a message receiver underneath the session's destructor,
2119         do this whenever a new session supplants an old session since there is only one active session at a time.
2120
2121         * UIProcess/Automation/WebAutomationSession.cpp:
2122         (WebKit::WebAutomationSession::~WebAutomationSession):
2123         * UIProcess/WebProcessPool.cpp:
2124         (WebKit::WebProcessPool::setAutomationSession):
2125
2126 2018-02-20  Tim Horton  <timothy_horton@apple.com>
2127
2128         Introduce HAVE(IOSURFACE_ACCELERATOR)
2129         https://bugs.webkit.org/show_bug.cgi?id=182955
2130         <rdar://problem/37699510>
2131
2132         Reviewed by Sam Weinig.
2133
2134         * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
2135         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
2136         * Shared/cg/ShareableBitmapCG.cpp:
2137         * UIProcess/API/Cocoa/WKWebView.mm:
2138         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2139         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
2140         * UIProcess/mac/ViewSnapshotStore.h:
2141         * UIProcess/mac/ViewSnapshotStore.mm:
2142
2143 2018-02-20  Chris Dumez  <cdumez@apple.com>
2144
2145         Provisional load may get committed before receiving the decidePolicyForNavigationResponse response
2146         https://bugs.webkit.org/show_bug.cgi?id=182720
2147         <rdar://problem/37515204>
2148
2149         Reviewed by Alex Christensen.
2150
2151         * WebProcess/Network/WebResourceLoader.cpp:
2152         (WebKit::WebResourceLoader::didReceiveResponse):
2153         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2154         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
2155         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
2156         (WebKit::WebURLSchemeTaskProxy::didReceiveResponse):
2157
2158 2018-02-20  Matt Lewis  <jlewis3@apple.com>
2159
2160         Unreviewed, rolling out r228829.
2161
2162         This caused a consistent failure in the API test
2163         WebKit.InteractionDeadlockAfterCrash on iOS Simulator
2164
2165         Reverted changeset:
2166
2167         "Switch to UIWKTextInteractionAssistant for non-editable text"
2168         https://bugs.webkit.org/show_bug.cgi?id=182834
2169         https://trac.webkit.org/changeset/228829
2170
2171 2018-02-20  Megan Gardner  <megan_gardner@apple.com>
2172
2173         Switch to UIWKTextInteractionAssistant for non-editable text
2174         https://bugs.webkit.org/show_bug.cgi?id=182834
2175         
2176         Reviewed by Wenson Hsieh and Tim Horton.
2177         
2178         Switching to only using the UIWKTextInteractionAssistant. Only character granularity is now supported. 
2179         Also keep the from regressing gating the keyboard bring up on user interaction. The presents of a  
2180         textInteractionAssistant can no longer be used as proxy for the presence of the keyboard.
2181
2182         * UIProcess/ios/WKContentViewInteraction.mm:
2183         (-[WKContentView useSelectionAssistantWithGranularity:]):
2184         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2185
2186 2018-02-20  John Wilander  <wilander@apple.com>
2187
2188         Make WebResourceLoadStatisticsStore::processStatisticsAndDataRecords() call WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed() in a proper callback
2189         https://bugs.webkit.org/show_bug.cgi?id=182719
2190         <rdar://problem/37517370>
2191
2192         Reviewed by Brent Fulgham.
2193
2194         This will allow the page notification, statistics pruning, and persistence write
2195         to be done at the right time and hopefully stabilize the layout tests including:
2196         http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html
2197
2198         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2199         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
2200             Now takes a callback parameter.
2201         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
2202         * UIProcess/WebResourceLoadStatisticsStore.h:
2203             Now calls WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed()
2204             in a callback provided to WebResourceLoadStatisticsStore::removeDataRecords().
2205
2206 2018-02-20  Zan Dobersek  <zdobersek@igalia.com>
2207
2208         [Cairo] Drop target GraphicsContext usage in Cairo operations
2209         https://bugs.webkit.org/show_bug.cgi?id=182964
2210
2211         Reviewed by Carlos Garcia Campos.
2212
2213         The GraphicsContext parameters in various Cairo operations are not used
2214         anymore, so they can be removed. Callsites are updated to reflect this.
2215
2216         * Shared/cairo/ShareableBitmapCairo.cpp:
2217         (WebKit::ShareableBitmap::paint):
2218         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
2219         (WebKit::convertCairoSurfaceToShareableBitmap):
2220
2221 2018-02-20  Philippe Normand  <pnormand@igalia.com>
2222
2223         [GStreamer][MiniBrowser] Honor GStreamer command line parameters in MiniBrowser
2224         https://bugs.webkit.org/show_bug.cgi?id=173655
2225
2226         Reviewed by Xabier Rodriguez-Calvar.
2227
2228         The FIXME in GStreamerUtilities.cpp asks to pass the command line
2229         parameters to the GStreamer initialization function.
2230
2231         Based on initial patch by: Vanessa Chipirrás Navalón  <vchipirras@igalia.com>
2232
2233         * Shared/WebProcessCreationParameters.cpp:
2234         (WebKit::WebProcessCreationParameters::encode const):
2235         (WebKit::WebProcessCreationParameters::decode):
2236         * Shared/WebProcessCreationParameters.h: Define the vector which contains the GStreamer options.
2237         * UIProcess/gtk/WebProcessPoolGtk.cpp:
2238         (WebKit::WebProcessPool::platformInitializeWebProcess): Read from cmdline file
2239         the GStreamer options written by console.
2240         * WebProcess/soup/WebProcessSoup.cpp:
2241         (WebKit::WebProcess::platformInitializeWebProcess): Call initializeGStreamer() method passing
2242         the vector which contains the options.
2243
2244 2018-02-20  Yousuke Kimoto  <yousuke.kimoto@sony.com>
2245
2246         [Win] Fix MSVC's treating __attribute__((warn_unused_result))
2247         https://bugs.webkit.org/show_bug.cgi?id=182479
2248
2249         Reviewed by Darin Adler.
2250
2251         Since MSVC doesn't understand "__attribute__", "_Check_return_" is used instead.
2252         If clang and VisualStudio 2017 are used, a macro with "__attriute__" will be chosen.
2253
2254         * UIProcess/API/cpp/WKRetainPtr.h:
2255
2256 2018-02-19  Brady Eidson  <beidson@apple.com>
2257
2258         Add WebProcessPool option for process swapping on navigation.
2259         https://bugs.webkit.org/show_bug.cgi?id=182945
2260
2261         Reviewed by Alex Christensen.
2262
2263         Just the most basic groundwork for testing a new WK2 feature.
2264
2265         * UIProcess/API/APIProcessPoolConfiguration.h:
2266
2267         * UIProcess/API/C/WKContextConfigurationRef.cpp:
2268         (WKContextConfigurationProcessSwapsOnNavigation):
2269         (WKContextConfigurationSetProcessSwapsOnNavigation):
2270         * UIProcess/API/C/WKContextConfigurationRef.h:
2271
2272         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2273         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2274         (-[_WKProcessPoolConfiguration setProcessSwapsOnNavigation:]):
2275         (-[_WKProcessPoolConfiguration processSwapsOnNavigation]):
2276
2277 2018-02-19  Daniel Bates  <dabates@apple.com>
2278
2279         Null pointer dereference in WebPageProxy::urlSchemeHandlerForScheme()
2280         https://bugs.webkit.org/show_bug.cgi?id=182905
2281         <rdar://problem/37676775>
2282
2283         Reviewed by Alex Christensen.
2284
2285         Return nullptr when querying for the scheme handler of the null string.
2286
2287         Before a navigation is performed WebKit checks if the destination URL is associated with an app
2288         unless the embedding client overrides the WKNavigationDelegate delegate callback -webView:decidePolicyForNavigationAction:decisionHandler.
2289         If the URL is not associated with an app then WebKit may fall back to checking if the embedding
2290         client registered a scheme handler for it. Currently we assume that the scheme is a non-null
2291         string when checking the scheme handler registry. However the scheme can be a null string if
2292         it is part of a malformed URL. And this leads to bad news bears when we try to use it to look
2293         for a scheme handler. Instead check that the scheme is a non-null string before checking to see
2294         if it is in the scheme handler registry.
2295
2296         * UIProcess/WebPageProxy.cpp:
2297         (WebKit::WebPageProxy::urlSchemeHandlerForScheme):
2298
2299 2018-02-19  Eric Carlson  <eric.carlson@apple.com>
2300
2301         [Extra zoom mode] Don't allow PiP media playback
2302         https://bugs.webkit.org/show_bug.cgi?id=182930
2303         <rdar://problem/37676259>
2304
2305         Reviewed by Andy Estes.
2306
2307         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2308         (-[WKWebViewConfiguration init]): Don't enable PiP mode. Require user interaction for
2309         all media types.
2310
2311 2018-02-19  Ryan Haddad  <ryanhaddad@apple.com>
2312
2313         Unreviewed, rolling out r228696.
2314
2315         The API test added with this change is timing out on macOS.
2316
2317         Reverted changeset:
2318
2319         "Null pointer dereference in
2320         WebPageProxy::urlSchemeHandlerForScheme()"
2321         https://bugs.webkit.org/show_bug.cgi?id=182905
2322         https://trac.webkit.org/changeset/228696
2323
2324 2018-02-19  Daniel Bates  <dabates@apple.com>
2325
2326         Null pointer dereference in WebPageProxy::urlSchemeHandlerForScheme()
2327         https://bugs.webkit.org/show_bug.cgi?id=182905
2328
2329         Reviewed by Alex Christensen.
2330
2331         Return nullptr when querying for the scheme handler of the null string.
2332
2333         Before a navigation is performed WebKit checks if the destination URL is associated with an app
2334         unless the embedding client overrides the WKNavigationDelegate delegate callback -webView:decidePolicyForNavigationAction:decisionHandler.
2335         If the URL is not associated with an app then WebKit may fall back to checking if the embedding
2336         client registered a scheme handler for it. Currently we assume that the scheme is a non-null
2337         string when checking the scheme handler registry. However the scheme can be a null string if
2338         it is part of a malformed URL. And this leads to bad news bears when we try to use it to look
2339         for a scheme handler. Instead check that the scheme is a non-null string before checking to see
2340         if it is in the scheme handler registry.
2341
2342         * UIProcess/WebPageProxy.cpp:
2343         (WebKit::WebPageProxy::urlSchemeHandlerForScheme):
2344
2345 2018-02-19  Ms2ger  <Ms2ger@igalia.com>
2346
2347         Explicitly qualify some method calls on this in lamdas in Service Worker code.
2348         https://bugs.webkit.org/show_bug.cgi?id=182875
2349
2350         Reviewed by Chris Dumez.
2351
2352         This is necessary for the code to build with GCC 5. Other code already
2353         appears to have been adapted similarly.
2354
2355         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2356         (WebKit::WebSWServerConnection::startFetch):
2357
2358 2018-02-18  Reza Abbasian  <rabbasian@apple.com>
2359
2360         Set the appropriate AutoFill context for suggested passwords.
2361         https://bugs.webkit.org/show_bug.cgi?id=182718
2362         <rdar://problem/36326863>
2363
2364         Reviewed by Wenson Hsieh and Tim Horton.
2365
2366         Before starting the input session, call the new delegate to query if AutoFill password suggestion assistance
2367         is required for the focused element.
2368
2369         * UIProcess/API/Cocoa/_WKFormInputSession.h:
2370         * UIProcess/API/Cocoa/_WKInputDelegate.h:
2371         Introduce a new delegate to be called  before starting an input session to query if AutoFill password suggestion
2372         assistance is required for the focused element.
2373         * UIProcess/ios/WKContentViewInteraction.h:
2374         * UIProcess/ios/WKContentViewInteraction.mm:
2375         (-[WKFormInputSession initWithContentView:focusedElementInfo:requiresStrongPasswordAssistance:]):
2376         (-[WKFormInputSession requiresStrongPasswordAssistance]):
2377         (-[WKContentView cleanupInteraction]):
2378         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2379         Call the delegate to find out if AutoFill suggested password assistance is required.
2380         (-[WKContentView _stopAssistingNode]):
2381         (-[WKContentView _autofillContext]): If the first responder is a password element and requires
2382         assistance for AutoFill suggested password, set the appropriate AutoFill context.
2383         (-[WKFormInputSession initWithContentView:focusedElementInfo:]): Deleted.
2384
2385 2018-02-17  Wenson Hsieh  <wenson_hsieh@apple.com>
2386
2387         [Extra zoom mode] Form control values are stale after dismissing and representing input view controllers
2388         https://bugs.webkit.org/show_bug.cgi?id=182877
2389         <rdar://problem/37604395>
2390
2391         Reviewed by Tim Horton.
2392
2393         Currently, when presenting an input view controller for a focused element, we populate the initial form control
2394         value using the WKContentView's assisted node information when it was last focused. However, if the user edits
2395         the value of a form control, dismisses to the form control view controller (while the element is still focused)
2396         and then begins editing the field again, the initial text will be the previous value of the input, since the
2397         AssistedNodeInformation isn't up to date.
2398
2399         To fix this, we introduce a mechanism to update WKContentView's AssistedNodeInformation for the current assisted
2400         node. This overwrites _assistedNodeInformation with new information computed from the web process, as long as
2401         the assisted node before and after the request is made in the UI process has not changed. We accomplish this by
2402         adding an identifier to AssistedNodeInformation, which is monotonically incremented when an element is focused
2403         in the web process. The UI process may then use this identifier to determine whether AssistedNodeInformations
2404         are describing the same focused element.
2405
2406         One interesting consideration here is that a normal AssistedNodeInformation update (propagated when focusing an
2407         element) may be deferred in the UI process until the next layer tree commit. In the absence of the assisted node
2408         identifier check, one could imagine a scenario in which the assisted node information in the UI process gets
2409         "updated" from a new value to an old value:
2410
2411         1. The web process focuses an element and sends AssistedNodeInformation `A`.
2412         2. WKContentView calls -updateCurrentAssistedNodeInformation.
2413         3. The web process sends AssistedNodeInformation `B`.
2414         4. `A` is received in the UI process, but deferred.
2415         5. The UI process receives `B` and sets _assistedNodeInformation to `B`.
2416         6. The UI process calls -_startAssistingNode: and sets _assistedNodeInformation to `A`.
2417
2418         This would mean that the _assistedNodeInformation is set to an earlier value, `A`, after being set to a later
2419         value, `B`. However, because the AssistedNodeInformation identifier in step (2) refers to the assisted node
2420         prior to step (1), the assisted node identifier in (5) would not match this identifier, and we would simply bail
2421         instead of overwriting assisted node information.
2422
2423         We use this AssistedNodeInformation update mechanism after inserting text via input view controllers, and also
2424         after reentering edit mode from the focused form control view controller. This fixes two issues where changing
2425         the size of the focused element after editing it results in the focused form overlay highlighting a stale frame,
2426         and also when setting the initial text when reentering edit mode for a form control that is already focused.
2427
2428         * Shared/AssistedNodeInformation.cpp:
2429         (WebKit::AssistedNodeInformation::encode const):
2430         (WebKit::AssistedNodeInformation::decode):
2431         * Shared/AssistedNodeInformation.h:
2432
2433         Add a new monotonically increasing identifier (per WebPage) which associates a AssistedNodeInformation with a
2434         focused element. In the event that the web process crashes and relaunches (thus resetting this identifier),
2435         AssistedNodeInformation state in the UI process is now also reset (see -cleanupInteraction), so we won't end up
2436         confusing AssistedNodeInformations computed by different WebPages between a web process crash.
2437
2438         * UIProcess/WebPageProxy.h:
2439
2440         A bit of related refactoring here to remove an unnecessary bool flag that indicates whether we have a deferred
2441         assisted node information. Instead, just use the presence of m_deferredNodeAssistanceArguments.
2442
2443         * UIProcess/WebPageProxy.messages.in:
2444
2445         Add a AssistedNodeInformationCallback IPC message.
2446
2447         * UIProcess/ios/WKContentViewInteraction.mm:
2448         (-[WKContentView cleanupInteraction]):
2449
2450         Clear out the previous AssistedNodeInformation. See above for details.
2451
2452         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
2453         (-[WKContentView updateCurrentAssistedNodeInformation:]):
2454
2455         Tries to update AssistedNodeInformation for the current assisted node, invoking the completion callback when
2456         finished. This may result in the assisted node information not being updated due to the current assisted node
2457         changing in the time between the start of the request and the information being received in the UI process.
2458
2459         (-[WKContentView presentViewControllerForCurrentAssistedNode]):
2460
2461         Refactored from -presentViewControllerForAssistedNode:, such that it no longer takes an AssistedNodeInformation
2462         as an argument, but rather just uses WKContentView's current _assistedNodeInformation. This was just being
2463         called with _assistedNodeInformation from all call sites anyways.
2464
2465         (-[WKContentView textInputController:didCommitText:]):
2466
2467         Request an AssistedNodeInformation update after setting the value of a form control; if the assisted node hasn't
2468         changed, update the focused form control overlay. This is needed to handle cases where the focused element's
2469         frame may have changed after inserting text (e.g. due to line wrapping), and the focused form control overlay
2470         needs to be updated to reflect this change.
2471
2472         (-[WKContentView focusedFormControlControllerDidBeginEditing:]):
2473
2474         Request an AssistedNodeInformation update before reentering edit mode; if the assisted node hasn't changed since
2475         the start of the request, present the appropriate input view controller.
2476
2477         (-[WKContentView presentViewControllerForAssistedNode:]): Deleted.
2478         * UIProcess/ios/WebPageProxyIOS.mm:
2479         (WebKit::WebPageProxy::assistedNodeInformationCallback):
2480         (WebKit::WebPageProxy::requestAssistedNodeInformation):
2481         (WebKit::WebPageProxy::didCommitLayerTree):
2482         (WebKit::WebPageProxy::startAssistingNode):
2483         (WebKit::WebPageProxy::stopAssistingNode):
2484         * WebProcess/WebPage/WebPage.cpp:
2485         (WebKit::WebPage::elementDidFocus):
2486
2487         Increment the assisted node identifier.
2488
2489         * WebProcess/WebPage/WebPage.h:
2490         * WebProcess/WebPage/WebPage.messages.in:
2491         * WebProcess/WebPage/ios/WebPageIOS.mm:
2492         (WebKit::WebPage::requestAssistedNodeInformation):
2493
2494         Compute and return an AssistedNodeInformation.
2495
2496         (WebKit::WebPage::getAssistedNodeInformation):
2497
2498 2018-02-16  Dean Jackson  <dino@apple.com>
2499
2500         Use OPENGL macros to be more clear about which OpenGL/ES WebGL uses on Cocoa
2501         https://bugs.webkit.org/show_bug.cgi?id=182894
2502
2503         Reviewed by Tim Horton.
2504
2505         Rename OPENGL_ES_2 to OPENGL_ES.
2506
2507         * CMakeLists.txt:
2508         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2509         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
2510         (WebKit::AcceleratedBackingStoreWayland::paint):
2511         * UIProcess/gtk/WaylandCompositor.cpp:
2512         (WebKit::WaylandCompositor::initializeEGL):
2513
2514 2018-02-16  Ryosuke Niwa  <rniwa@webkit.org>
2515
2516         Add an entitlement check for service worker on iOS
2517         https://bugs.webkit.org/show_bug.cgi?id=182865
2518         <rdar://problem/37505903>
2519
2520         Reviewed by Brady Eidson.
2521
2522         Added an entitlement check to enable service workers on iOS.
2523
2524         * Shared/mac/SandboxUtilities.h:
2525         * Shared/mac/SandboxUtilities.mm:
2526         (WebKit::connectedProcessHasEntitlement): Added.
2527         * StorageProcess/StorageProcess.cpp:
2528         (WebKit::StorageProcess::createStorageToWebProcessConnection): Enforce the entitlement check by crashing
2529         when this code is executed without the parent process having the service worker entitlement. This should
2530         never happen unless someone is trying to bypass the entitlement check in UI Process since we ordinarily
2531         disable service worker gracefully in WKWebView _initializeWithConfiguration.
2532         (WebKit::StorageProcess::swServerForSession): Ditto.
2533         (WebKit::StorageProcess::registerSWServerConnection): Ditto.
2534         * StorageProcess/StorageProcess.h:
2535         (WebKit::StorageProcess::parentProcessHasServiceWorkerEntitlement const): Added.
2536         * StorageProcess/ios/StorageProcessIOS.mm:
2537         (WebKit::StorageProcess::parentProcessHasServiceWorkerEntitlement const): Added.
2538         * UIProcess/API/Cocoa/WKWebView.mm:
2539         (-[WKWebView _initializeWithConfiguration:]): Disable the service workers when the entitlement is
2540         missing from the current process. The entitlement is enforced by WebContent and Storage process.
2541         This check avoids crashing WebContent process and gracefully disabling the feature.
2542         * WebProcess/WebPage/WebPage.cpp:
2543         (WebKit::WebPage::updatePreferences): Enforce the entitlement check.
2544         * WebProcess/WebPage/WebPage.h:
2545         (WebKit::WebPage::parentProcessHasServiceWorkerEntitlement const): Added.
2546         * WebProcess/WebPage/ios/WebPageIOS.mm:
2547         (WebKit::WebPage::parentProcessHasServiceWorkerEntitlement const): Added.
2548
2549 2018-02-16  Youenn Fablet  <youenn@apple.com>
2550
2551         Allow specifying which plug-ins are supported
2552         https://bugs.webkit.org/show_bug.cgi?id=182748
2553
2554         Reviewed by Chris Dumez.
2555
2556         Add a C and ObjC API to set which plug-ins are specified.
2557         Plug-ins may be allowed by origin of the main page or for all origins.
2558
2559         If the API to set a supported plug-in is called, WebKit enters a mode
2560         where it will block any plug-in that is not on the list.
2561
2562         The list of supported plug-ins is stored in UIProcess and sent to WebProcess.
2563         This allows to compute the list of visible plug-ins according supported plugins.
2564
2565         PluginInfoStore is storing the list of supported plugins and can
2566         answer whether a plug-in creation request is to be made unsupported or not.
2567         It also creates the structure sent to WebProcess for computing plugin visibility.
2568
2569         Updated ArgumentCoders to accept modern HashSet decoders.
2570
2571         * Platform/IPC/ArgumentCoders.h:
2572         * UIProcess/API/C/WKContext.cpp:
2573         (WKContextAddSupportedPlugin):
2574         (WKContextClearSupportedPlugins):
2575         * UIProcess/API/C/WKContextPrivate.h:
2576         * UIProcess/API/Cocoa/WKProcessPool.mm:
2577         (-[WKProcessPool _addSupportedPlugin:named:withMimeTypes:withExtensions:]):
2578         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2579         * UIProcess/Plugins/PluginInfoStore.cpp:
2580         (WebKit::PluginInfoStore::isSupportedPlugin):
2581         (WebKit::PluginInfoStore::SupportedPlugins::isSupported):
2582         (WebKit::PluginInfoStore::SupportedPlugin::isSupported):
2583         (WebKit::PluginInfoStore::supportedPluginNames):
2584         (WebKit::PluginInfoStore::addSupportedPlugin):
2585         * UIProcess/Plugins/PluginInfoStore.h:
2586         (WebKit::PluginInfoStore::clearSupportedPlugins):
2587         * UIProcess/WebPageProxy.cpp:
2588         (WebKit::WebPageProxy::findPlugin):
2589         (WebKit::WebPageProxy::unavailablePluginButtonClicked):
2590         * UIProcess/WebPageProxy.h:
2591         * UIProcess/WebPageProxy.messages.in:
2592         * UIProcess/WebProcessPool.cpp:
2593         (WebKit::WebProcessPool::addSupportedPlugin):
2594         (WebKit::WebProcessPool::clearSupportedPlugins):
2595         * UIProcess/WebProcessPool.h:
2596         * UIProcess/WebProcessProxy.cpp:
2597         (WebKit::WebProcessProxy::getPlugins):
2598         * UIProcess/WebProcessProxy.h:
2599         * UIProcess/WebProcessProxy.messages.in:
2600         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
2601         (WebKit::WebPluginInfoProvider::getPluginInfo):
2602         (WebKit::WebPluginInfoProvider::getWebVisiblePluginInfo):
2603         (WebKit::WebPluginInfoProvider::populatePluginCache):
2604         * WebProcess/Plugins/WebPluginInfoProvider.h:
2605         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2606         (WebKit::WebChromeClient::shouldUnavailablePluginMessageBeButton const):
2607         * WebProcess/WebPage/WebPage.cpp:
2608         (WebKit::WebPage::createPlugin):
2609         (WebKit::WebPage::canPluginHandleResponse):
2610
2611 2018-02-16  Jiewen Tan  <jiewen_tan@apple.com>
2612
2613         [WebAuthN] Implement PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()
2614         https://bugs.webkit.org/show_bug.cgi?id=182771
2615         <rdar://problem/36459988>
2616
2617         Reviewed by Brent Fulgham.
2618
2619         This patch utilizes LocalAuthentication Framework to determine if biometrics
2620         are enrolled on a device, which is the user verifying platform authenticator.
2621         To do so, it links the framework to WebKit.
2622
2623         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp:
2624         (WebKit::WebCredentialsMessengerProxy::isUserVerifyingPlatformAuthenticatorAvailable):
2625         (WebKit::WebCredentialsMessengerProxy::isUserVerifyingPlatformAuthenticatorAvailableReply):
2626         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h:
2627         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in:
2628         * UIProcess/CredentialManagement/cocoa/WebCredentialsMessengerProxyCocoa.mm:
2629         (WebKit::WebCredentialsMessengerProxy::platformIsUserVerifyingPlatformAuthenticatorAvailable):
2630         * WebKit.xcodeproj/project.pbxproj:
2631         * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp:
2632         (WebKit::WebCredentialsMessenger::isUserVerifyingPlatformAuthenticatorAvailable):
2633         (WebKit::WebCredentialsMessenger::isUserVerifyingPlatformAuthenticatorAvailableReply):
2634         * WebProcess/CredentialManagement/WebCredentialsMessenger.h:
2635         * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in:
2636
2637 2018-02-16  Per Arne Vollan  <pvollan@apple.com>
2638
2639         Implement stopping of run loop in the WebContent process when using NSRunLoop.
2640         https://bugs.webkit.org/show_bug.cgi?id=182499
2641         <rdar://problem/37247424>
2642
2643         Reviewed by Brent Fulgham.
2644
2645         Add the method ChildProcess::stopNSRunLoop to end the WebContent process by executing a block
2646         with 'exit(0)' on the main run loop. 
2647
2648         * Shared/ChildProcess.h:
2649         * Shared/mac/ChildProcessMac.mm:
2650         (WebKit::ChildProcess::stopNSRunLoop):
2651         * WebProcess/cocoa/WebProcessCocoa.mm:
2652         (WebKit::WebProcess::platformInitializeWebProcess):
2653         (WebKit::WebProcess::stopRunLoop):
2654
2655 2018-02-16  Yousuke Kimoto  <yousuke.kimoto@sony.com>
2656
2657         [WinCario] Add NetworkSessionCurl
2658         https://bugs.webkit.org/show_bug.cgi?id=182680
2659
2660         Reviewed by Konstantin Tokarev.
2661
2662         * NetworkProcess/NetworkSession.cpp:
2663         (WebKit::NetworkSession::create):
2664         * PlatformWin.cmake:
2665
2666 2018-02-16  Chris Dumez  <cdumez@apple.com>
2667
2668         ASSERTION FAILED: !m_processes[i] || *m_processes[i] == process in MessagePortChannel::entanglePortWithProcess()
2669         https://bugs.webkit.org/show_bug.cgi?id=182054
2670         <rdar://problem/36871207>
2671
2672         Reviewed by Brady Eidson.
2673
2674         Pipe postMessage messages to and from service workers via the UIProcess instead of going
2675         directly to the StorageProcess. This is temporarily needed to avoid races due to the
2676         MessagePort registry currently living in the UIProcess and postMessage messages potentially
2677         sending MessagePort objects.
2678
2679         This change is covered by tests on the bots that currently flakily crash in debug.
2680
2681         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2682         * StorageProcess/StorageProcess.cpp:
2683         (WebKit::StorageProcess::postMessageToServiceWorker):
2684         * StorageProcess/StorageProcess.h:
2685         * StorageProcess/StorageProcess.messages.in:
2686         * UIProcess/WebProcessPool.cpp:
2687         (WebKit::WebProcessPool::postMessageToServiceWorkerClient):
2688         (WebKit::WebProcessPool::postMessageToServiceWorker):
2689         * UIProcess/WebProcessPool.h:
2690         * UIProcess/WebProcessPool.messages.in:
2691         * WebProcess/Storage/WebSWClientConnection.cpp:
2692         (WebKit::WebSWClientConnection::postMessageToServiceWorker):
2693         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2694         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
2695
2696 2018-02-16  Wenson Hsieh  <wenson_hsieh@apple.com>
2697
2698         [Extra zoom mode] Add basic support for <input type='date'> using date picker UI
2699         https://bugs.webkit.org/show_bug.cgi?id=182847
2700         <rdar://problem/35143111>
2701
2702         Reviewed by Tim Horton.
2703
2704         Add support for presenting date pickers when focusing a date input.
2705
2706         * UIProcess/ios/WKContentViewInteraction.h:
2707         * UIProcess/ios/WKContentViewInteraction.mm:
2708         (-[WKContentView _stopAssistingNode]):
2709         (-[WKContentView dismissAllInputViewControllers]):
2710
2711         Pull logic to dismiss input view controllers into a single helper.
2712
2713         (-[WKContentView presentDatePickerViewController:]):
2714         (-[WKContentView dismissDatePickerViewController:]):
2715         (-[WKContentView presentViewControllerForAssistedNode:]):
2716         (-[WKContentView textInputController:didCommitText:]):
2717         (-[WKContentView _wheelChangedWithEvent:]):
2718
2719         Delegate wheel events to the date picker.
2720
2721         * UIProcess/ios/forms/WKDatePickerViewController.h: Added.
2722         * UIProcess/ios/forms/WKDatePickerViewController.mm: Added.
2723
2724         Add harness files for the WKDatePickerViewController implementation in WebKitAdditions.
2725
2726         * WebKit.xcodeproj/project.pbxproj:
2727
2728 2018-02-15  Youenn Fablet  <youenn@apple.com>
2729
2730         Resources loaded from service workers are not downloadable
2731         https://bugs.webkit.org/show_bug.cgi?id=182848
2732
2733         Reviewed by Chris Dumez.
2734
2735         Downloads are not supporting resources loaded through service worker.
2736         As a temporary solution, we will let network process handle it.
2737         Note that this would not work if the URL can only be loaded through service worker.
2738         Note also that for navigation loads, if the content type is the default one (application/octet-stream) we are overriding it to
2739         text/html as we do not support mime sniffing yet from service worker responses.
2740         This might interfere with automatic downloads from navigation.
2741
2742         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2743         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
2744
2745 2018-02-15  Megan Gardner  <megan_gardner@apple.com>
2746
2747         Support scrolling for non-editable web-selection and start autoscroll when near screen edges
2748         https://bugs.webkit.org/show_bug.cgi?id=182815
2749
2750         Add support for autoscrolling during a selection. This also takes into account the edges of the screen
2751         and starts autoscrolling when you get close, while still allowing autoscrolling when you are past the bounds
2752         of the WebView.
2753
2754         Reviewed by Tim Horton.
2755
2756         * UIProcess/ios/WKContentViewInteraction.mm:
2757         (-[WKContentView startAutoscroll:]):
2758         (-[WKContentView resignFirstResponderForWebView]):
2759         (-[WKContentView useSelectionAssistantWithGranularity:]):
2760         (-[WKContentView selectedTextRange]):
2761         * UIProcess/ios/WebPageProxyIOS.mm:
2762         (WebKit::WebPageProxy::startAutoscrollAtPosition):
2763         * WebProcess/WebPage/ios/WebPageIOS.mm:
2764         (WebKit::WebPage::startAutoscrollAtPosition):
2765         (WebKit::WebPage::cancelAutoscroll):
2766
2767 2018-02-15  John Wilander  <wilander@apple.com>
2768
2769         Resource Load Statistics: Make sure WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can ingest older plist versions and not reset the database
2770         https://bugs.webkit.org/show_bug.cgi?id=182812
2771         <rdar://problem/37511406>
2772
2773         Reviewed by Brent Fulgham.
2774
2775         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2776         (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
2777             Now does the following:
2778             - Logs when there is a model version mismatch.
2779             - Does not ingest statistics if the version on disk is newer than the supported one.
2780             - Does ingest statistics if the version on disk is older than the supported one.
2781             - Passes on the version found on disk to WebCore::ResourceLoadStatistics::decode().
2782
2783 2018-02-15  Jiewen Tan  <jiewen_tan@apple.com>
2784
2785         [WebAuthN] Revisit the whole async model of task dispatching, timeout and aborting
2786         https://bugs.webkit.org/show_bug.cgi?id=181946
2787         <rdar://problem/37258262>
2788
2789         Reviewed by Chris Dumez.
2790
2791         Dummy WebCredentialsMessenger and WebCredentialsMessengerProxy are crafted to establish
2792         a message exchange channel between UIProcess and WebProcess.
2793
2794         * DerivedSources.make:
2795         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
2796         (WebKit::WebCredentialsMessengerProxy::WebCredentialsMessengerProxy):
2797         (WebKit::WebCredentialsMessengerProxy::~WebCredentialsMessengerProxy):
2798         (WebKit::WebCredentialsMessengerProxy::makeCredential):
2799         (WebKit::WebCredentialsMessengerProxy::getAssertion):
2800         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
2801         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in: Added.
2802         * UIProcess/WebPageProxy.cpp:
2803         (WebKit::m_configurationPreferenceValues):
2804         (WebKit::WebPageProxy::reattachToWebProcess):
2805         (WebKit::WebPageProxy::resetState):
2806         * UIProcess/WebPageProxy.h:
2807         * WebKit.xcodeproj/project.pbxproj:
2808         * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
2809         (WebKit::WebCredentialsMessenger::WebCredentialsMessenger):
2810         (WebKit::WebCredentialsMessenger::~WebCredentialsMessenger):
2811         (WebKit::WebCredentialsMessenger::makeCredential):
2812         (WebKit::WebCredentialsMessenger::getAssertion):
2813         (WebKit::WebCredentialsMessenger::makeCredentialReply):
2814         (WebKit::WebCredentialsMessenger::getAssertionReply):
2815         * WebProcess/CredentialManagement/WebCredentialsMessenger.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
2816         * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in: Added.
2817         * WebProcess/WebPage/WebPage.cpp:
2818         (WebKit::m_credentialsMessenger):
2819         (WebKit::m_cpuLimit): Deleted.
2820         * WebProcess/WebPage/WebPage.h:
2821
2822 2018-02-15  Michael Catanzaro  <mcatanzaro@igalia.com>
2823
2824         [WPE] Unify build of platform-specific files in WebKit layer
2825         https://bugs.webkit.org/show_bug.cgi?id=182696
2826
2827         Reviewed by Žan Doberšek.
2828
2829         This is easy, because all needed changes were made in the previously-landed patch.
2830
2831         * CMakeLists.txt:
2832         * PlatformWPE.cmake:
2833
2834 2018-02-15  Don Olmstead  <don.olmstead@sony.com>
2835
2836         WebCore headers should not be included relatively within dependent projects
2837         https://bugs.webkit.org/show_bug.cgi?id=182805
2838
2839         Reviewed by Chris Dumez.
2840
2841         * NetworkProcess/capture/NetworkCaptureManager.cpp:
2842         * NetworkProcess/webrtc/NetworkRTCMonitor.h:
2843         * Shared/gtk/WebEventFactory.cpp:
2844         * UIProcess/API/gtk/PageClientImpl.cpp:
2845         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2846         * UIProcess/gtk/WebPageProxyGtk.cpp:
2847         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
2848         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
2849         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
2850         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
2851         * WebProcess/WebPage/wpe/WebPageWPE.cpp:
2852
2853 2018-02-15  Matt Lewis  <jlewis3@apple.com>
2854
2855         Unreviewed, rolling out r228495.
2856
2857         This caused mulitple perf tests to fail consistently.
2858
2859         Reverted changeset:
2860
2861         "Resource Load Statistics: Make sure
2862         WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can
2863         ingest older plist versions and not reset the database"
2864         https://bugs.webkit.org/show_bug.cgi?id=182812
2865         https://trac.webkit.org/changeset/228495
2866
2867 2018-02-14  Ross Kirsling  <ross.kirsling@sony.com>
2868
2869         Default definition of InjectedBundle::PlatformBundle should not be Windows-specific.
2870         https://bugs.webkit.org/show_bug.cgi?id=182810
2871
2872         Reviewed by Michael Catanzaro.
2873
2874         This branch was added in r228455, but should not be limited to OS(WINDOWS).
2875
2876         * WebProcess/InjectedBundle/InjectedBundle.h:
2877
2878 2018-02-14  Ross Kirsling  <ross.kirsling@sony.com>
2879
2880         Default implementations of nativeEvent() should be platform-agnostic.
2881         https://bugs.webkit.org/show_bug.cgi?id=182806
2882
2883         Reviewed by Darin Adler.
2884
2885         * Shared/NativeWebKeyboardEvent.h:
2886         * Shared/NativeWebMouseEvent.h:
2887         * Shared/NativeWebWheelEvent.h:
2888
2889 2018-02-14  John Wilander  <wilander@apple.com>
2890
2891         Resource Load Statistics: Make sure WebResourceLoadStatisticsStore::mergeWithDataFromDecoder() can ingest older plist versions and not reset the database
2892         https://bugs.webkit.org/show_bug.cgi?id=182812
2893         <rdar://problem/37511406>
2894
2895         Reviewed by Brent Fulgham.
2896
2897         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2898         (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
2899             Now does the following:
2900             - Logs when there is a model version mismatch.
2901             - Does not ingest statistics if the version on disk is newer than the supported one.
2902             - Does ingest statistics if the version on disk is older than the supported one.
2903             - Passes on the version found on disk to WebCore::ResourceLoadStatistics::decode().
2904
2905 2018-02-14  Daniel Bates  <dabates@apple.com>
2906
2907         Disallow cross-origin subresources from asking for credentials
2908         https://bugs.webkit.org/show_bug.cgi?id=182579
2909         <rdar://problem/36162271>
2910
2911         Reviewed by Andy Estes.
2912
2913         Add a private preference to toggle allowing non-mixed content cross-origin subresources to load.
2914         WebKitTestRunner toggles this preference when it sees the test option allowCrossOriginSubresourcesToAskForCredential.
2915
2916         * Shared/WebPreferences.yaml:
2917         * UIProcess/API/C/WKPreferences.cpp:
2918         (WKPreferencesSetAllowCrossOriginSubresourcesToAskForCredentials):
2919         (WKPreferencesGetAllowCrossOriginSubresourcesToAskForCredentials):
2920         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2921
2922 2018-02-14  John Wilander  <wilander@apple.com>
2923
2924         Make maximumParallelReadCount static to fix lambda capture error in WebKit::NetworkCache::Storage::traverse()
2925         https://bugs.webkit.org/show_bug.cgi?id=182797
2926         <rdar://problem/37540594>
2927
2928         Reviewed by Tim Horton.
2929
2930         This capture was added in r228455 and causes a build failure when
2931         run with -Wunused-lambda-capture. Xcode also warns about it.
2932
2933         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2934         (WebKit::NetworkCache::Storage::traverse):
2935
2936 2018-02-14  Ryosuke Niwa  <rniwa@webkit.org>
2937
2938         EventDispatcher::wheelEvent uses a wrong enum values in switch
2939         https://bugs.webkit.org/show_bug.cgi?id=182796
2940
2941         Reviewed by Chris Dumez.
2942
2943         EventDispatcher::wheelEvent is using PlatformWheelEventPhaseBegan and PlatformWheelEventPhaseEnded
2944         but the enum type of wheelEvent.phase() is WebWheelEvent::Phase.
2945
2946         The enum values are indentical for both so there is no behavioral change.
2947
2948         * WebProcess/WebPage/EventDispatcher.cpp:
2949         (WebKit::EventDispatcher::wheelEvent):
2950
2951 2018-02-14  Maureen Daum  <mdaum@apple.com>
2952
2953         Add C SPI for support of Website Data Store in Website Policies
2954         https://bugs.webkit.org/show_bug.cgi?id=182698
2955         <rdar://problem/37412008>
2956
2957         Reviewed by Andy Estes.
2958
2959         Expand the API added for _WKWebsitePolicies.websiteDataStore in r225989 and r226325
2960         to be available in the C API. In the ObjC API, we handle setting the website data
2961         store in NavigationState::NavigationClient::decidePolicyForNavigationAction. There
2962         we throw an exception if setting the website data store isn't supported, and then
2963         change the website data store. The equivalent place to do this work in the C API is
2964         in WKFramePolicyListenerUseWithPolicies. However, instead of throwing exceptions,
2965         release asserts are used.
2966
2967         * UIProcess/API/C/WKFramePolicyListener.cpp:
2968         (WKFramePolicyListenerUseWithPolicies):
2969         If the website policies data contains a website data store, do the same checks that
2970         are done in NavigationState::NavigationClient::decidePolicyForNavigationAction. Namely,
2971         that it is a valid website data store and it is a policy decision for a main frame navigation.
2972         If these checks are met, change the website data store.
2973         * UIProcess/API/C/WKPage.cpp:
2974         (WKPageUpdateWebsitePolicies):
2975         * UIProcess/API/C/WKWebsitePolicies.cpp:
2976         (WKWebsitePoliciesGetDataStore):
2977         (WKWebsitePoliciesSetDataStore):
2978         * UIProcess/API/C/WKWebsitePolicies.h:
2979         * UIProcess/WebFrameListenerProxy.cpp:
2980         (WebKit::WebFrameListenerProxy::changeWebsiteDataStore):
2981         (WebKit::WebFrameListenerProxy::isMainFrame):
2982         Expose whether the frame proxy is for a main frame, which is required to verify that
2983         website policies only specify a website data store for main frame policy decisions.
2984         * UIProcess/WebFrameListenerProxy.h:
2985         * UIProcess/WebFramePolicyListenerProxy.cpp:
2986         * UIProcess/WebFrameProxy.cpp:
2987         (WebKit::WebFrameProxy::changeWebsiteDataStore):
2988         * UIProcess/WebFrameProxy.h:
2989
2990 2018-02-14  Ryan Haddad  <ryanhaddad@apple.com>
2991
2992         Unreviewed, rolling out r228444.
2993
2994         Introduced API and Layout test failures.
2995
2996         Reverted changeset:
2997
2998         "[WebAuthN] Revisit the whole async model of task dispatching,
2999         timeout and aborting"
3000         https://bugs.webkit.org/show_bug.cgi?id=181946
3001         https://trac.webkit.org/changeset/228444
3002
3003 2018-02-13  Yousuke Kimoto  <yousuke.kimoto@sony.com>
3004
3005         [WinCairo] Fix build errors which come from including headers and not suitable implementation for windows
3006         https://bugs.webkit.org/show_bug.cgi?id=182679
3007
3008         Reviewed by Michael Catanzaro.
3009
3010         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
3011         (WebKit::NetworkCache::BlobStorage::add):
3012         * NetworkProcess/cache/NetworkCacheData.cpp:
3013         (WebKit::NetworkCache::Data::mapToFile const):
3014         (WebKit::NetworkCache::mapFile):
3015         (WebKit::NetworkCache::adoptAndMapFile):
3016         (WebKit::NetworkCache::readOrMakeSalt):
3017         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
3018         (WebKit::NetworkCache::directoryEntryType):
3019         (WebKit::NetworkCache::traverseDirectory):
3020         (WebKit::NetworkCache::fileTimes):
3021         (WebKit::NetworkCache::updateFileModificationTimeIfNeeded):
3022         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3023         (WebKit::NetworkCache::Storage::traverse):
3024         * NetworkProcess/win/SystemProxyWin.h:
3025         * Platform/IPC/Attachment.h:
3026         * Platform/Module.h:
3027         * Platform/SharedMemory.h:
3028         * PluginProcess/WebProcessConnection.cpp:
3029         * Shared/API/c/WKBase.h:
3030         * Shared/ChildProcess.cpp:
3031         * Shared/WebCoreArgumentCoders.h:
3032         * UIProcess/ProcessAssertion.h:
3033         * WebProcess/InjectedBundle/InjectedBundle.h:
3034         * WebProcess/WebProcess.cpp:
3035
3036 2018-02-13  Commit Queue  <commit-queue@webkit.org>
3037
3038         Unreviewed, rolling out r228431.
3039         https://bugs.webkit.org/show_bug.cgi?id=182766
3040
3041         Regressed CMake build stability (Requested by dolmstead on
3042         #webkit).
3043
3044         Reverted changeset:
3045
3046         "[CMake] Make WebCore headers copies"
3047         https://bugs.webkit.org/show_bug.cgi?id=182512
3048         https://trac.webkit.org/changeset/228431
3049
3050 2018-02-13  Jiewen Tan  <jiewen_tan@apple.com>
3051
3052         [WebAuthN] Revisit the whole async model of task dispatching, timeout and aborting
3053         https://bugs.webkit.org/show_bug.cgi?id=181946
3054         <rdar://problem/37258262>
3055
3056         Reviewed by Chris Dumez.
3057
3058         Dummy WebCredentialsMessenger and WebCredentialsMessengerProxy are crafted to establish
3059         a message exchange channel between UIProcess and WebProcess.
3060
3061         * DerivedSources.make:
3062         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
3063         (WebKit::WebCredentialsMessengerProxy::WebCredentialsMessengerProxy):
3064         (WebKit::WebCredentialsMessengerProxy::~WebCredentialsMessengerProxy):
3065         (WebKit::WebCredentialsMessengerProxy::makeCredential):
3066         (WebKit::WebCredentialsMessengerProxy::getAssertion):
3067         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
3068         * UIProcess/CredentialManagement/WebCredentialsMessengerProxy.messages.in: Added.
3069         * UIProcess/WebPageProxy.cpp:
3070         (WebKit::m_configurationPreferenceValues):
3071         (WebKit::WebPageProxy::reattachToWebProcess):
3072         * UIProcess/WebPageProxy.h:
3073         * WebKit.xcodeproj/project.pbxproj:
3074         * WebProcess/CredentialManagement/WebCredentialsMessenger.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
3075         (WebKit::WebCredentialsMessenger::WebCredentialsMessenger):
3076         (WebKit::WebCredentialsMessenger::~WebCredentialsMessenger):
3077         (WebKit::WebCredentialsMessenger::makeCredential):
3078         (WebKit::WebCredentialsMessenger::getAssertion):
3079         (WebKit::WebCredentialsMessenger::makeCredentialReply):
3080         (WebKit::WebCredentialsMessenger::getAssertionReply):
3081         * WebProcess/CredentialManagement/WebCredentialsMessenger.h: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.h.
3082         * WebProcess/CredentialManagement/WebCredentialsMessenger.messages.in: Added.
3083         * WebProcess/WebPage/WebPage.cpp:
3084         (WebKit::m_credentialsMessenger):
3085         (WebKit::m_cpuLimit): Deleted.
3086         * WebProcess/WebPage/WebPage.h:
3087
3088 2018-02-13  Youenn Fablet  <youenn@apple.com>
3089
3090         Add support for configuring WebsiteDatastore service worker and cache storage path
3091         https://bugs.webkit.org/show_bug.cgi?id=182674
3092
3093         Reviewed by Chris Dumez.
3094
3095         Beef up WKWebsiteDataStoreConfiguration to easily set the WebsiteDataStore
3096         service worker registration and cache storage directory path.
3097
3098         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3099         (-[WKWebsiteDataStore _initWithConfiguration:]):
3100         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h:
3101         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
3102         (-[_WKWebsiteDataStoreConfiguration _cacheStorageDirectory]):
3103         (-[_WKWebsiteDataStoreConfiguration _setCacheStorageDirectory:]):
3104         (-[_WKWebsiteDataStoreConfiguration _serviceWorkerRegistrationDirectory]):
3105         (-[_WKWebsiteDataStoreConfiguration _setServiceWorkerRegistrationDirectory:]):
3106
3107 2018-02-13  Brian Burg  <bburg@apple.com>
3108
3109         Web Automation: don't return an error if resizing/moving a window has no effect
3110         https://bugs.webkit.org/show_bug.cgi?id=182742
3111
3112         Reviewed by Tim Horton.
3113
3114         * UIProcess/Automation/WebAutomationSession.cpp:
3115         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
3116         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
3117         Unify the behavior for all ports. Don't raise an error if the command was
3118         idempotent (by mistake or not). It should not be an error to re-maximize a window.
3119
3120 2018-02-13  Don Olmstead  <don.olmstead@sony.com>
3121
3122         [CMake] Make WebCore headers copies
3123         https://bugs.webkit.org/show_bug.cgi?id=182512
3124
3125         Reviewed by Keith Miller.
3126
3127         * CMakeLists.txt:
3128         * NetworkProcess/capture/NetworkCaptureManager.cpp:
3129         * NetworkProcess/webrtc/NetworkRTCMonitor.h:
3130         * PlatformWPE.cmake:
3131         * Scripts/generate-forwarding-headers.pl:
3132         * Shared/gtk/WebEventFactory.cpp:
3133         * UIProcess/API/gtk/PageClientImpl.cpp:
3134         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3135         * UIProcess/gtk/WebPageProxyGtk.cpp:
3136         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
3137         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
3138         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
3139         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
3140         * WebProcess/WebPage/wpe/WebPageWPE.cpp:
3141
3142 2018-02-13  Brent Fulgham  <bfulgham@apple.com>
3143
3144         [iOS] whitelist iokit-get-properties
3145         https://bugs.webkit.org/show_bug.cgi?id=182722
3146         <rdar://problem/30929165>
3147
3148         Reviewed by Eric Carlson.
3149
3150         Update the iOS sandbox to block access to IOKit properties that are not needed for
3151         legitimate WebContent process use. This brings the iOS sandbox in line with the
3152         work done under macOS.
3153
3154         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3155
3156 2018-02-12  John Wilander  <wilander@apple.com>
3157
3158         Resource Load Statistics: Classify resources as prevalent based on redirects to other prevalent resources
3159         https://bugs.webkit.org/show_bug.cgi?id=182664
3160         <rdar://problem/37372572>
3161
3162         Reviewed by Brent Fulgham.
3163
3164         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
3165         (WebKit::ResourceLoadStatisticsClassifier::hasPrevalentResourceCharacteristics):
3166             Unique top frame redirects now counts toward classification as prevalent.
3167         * Shared/WebCoreArgumentCoders.cpp:
3168         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
3169         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
3170         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3171         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
3172         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
3173         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
3174             Test infrastructure.
3175         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
3176         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3177             Bumped the statistics model to 11 because of the added fields.
3178         (WebKit::WebResourceLoadStatisticsStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain):
3179             This function back traces redirect chains to classify domains
3180             that have redirected to a newly classified prevalent resource.
3181         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
3182             Now uses the new convenience function WebResourceLoadStatisticsStore::setPrevalentResource().
3183         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
3184             New convenience function to make sure we always call
3185             WebResourceLoadStatisticsStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain()
3186             and capture redirect chains backward.
3187         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
3188         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
3189         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
3190         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
3191         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
3192         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
3193             Test infrastructure.
3194         * UIProcess/WebResourceLoadStatisticsStore.h:
3195
3196 2018-02-12  Antti Koivisto  <antti@apple.com>
3197
3198         Update NetworkCache::Storage::lastStableVersion after r226349
3199         https://bugs.webkit.org/show_bug.cgi?id=182723
3200         <rdar://problem/37469554>
3201         
3202         Reviewed by Ryosuke Niwa.
3203
3204         * NetworkProcess/cache/NetworkCacheStorage.h:
3205
3206         Allow deleting version 11 caches.
3207
3208 2018-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
3209
3210         [Extra zoom mode] Add support for <input type='time'> using time picker UI
3211         https://bugs.webkit.org/show_bug.cgi?id=182683
3212         <rdar://problem/35143162>
3213
3214         Reviewed by Tim Horton.
3215
3216         Adds support for showing a time picker when an input of type time is focused in extra zoomed mode.
3217
3218         * UIProcess/ios/WKContentViewInteraction.h:
3219         * UIProcess/ios/WKContentViewInteraction.mm:
3220         (-[WKContentView _stopAssistingNode]):
3221         (-[WKContentView presentTimePickerViewController:]):
3222         (-[WKContentView dismissTimePickerViewController:]):
3223
3224         Add helpers to dismiss and present the time picker view controller.
3225
3226         (-[WKContentView presentViewControllerForAssistedNode:]):
3227
3228         When focusing InputType::Time, present a time picker. Additionally, tweak the logic here to use the generic text
3229         input view controller as a fallback when the other input view controllers (number pads, select menus and time
3230         pickers thus far) are not relevant. This prevents us from completely being unable to edit form controls that are
3231         currently unsupported.
3232
3233         (-[WKContentView textInputController:didCommitText:]):
3234         (-[WKContentView textInputControllerDidRequestDismissal:]):
3235
3236         Tweak WKContentView for changes to WKTextFormControlViewControllerDelegate.
3237
3238         (-[WKContentView actionNameForFocusedFormControlController:]):
3239
3240         Adjust this implementation to hide the focused form control "Go" button for selects and time inputs. This
3241         currently doesn't work for these form controls because it relies on implicit form submission; this should be
3242         fixed by future changes, after which we should revert this adjustment.
3243
3244         (-[WKContentView _wheelChangedWithEvent:]):
3245
3246         Delegate wheel events to the time picker if needed.
3247
3248         (-[WKContentView textInputController:didRequestDismissalWithAction:]): Deleted.
3249
3250         Renamed to -textInputControllerDidRequestDismissal:.
3251
3252         * UIProcess/ios/forms/WKTimePickerViewController.h: Added.
3253         * UIProcess/ios/forms/WKTimePickerViewController.mm: Added.
3254         * WebKit.xcodeproj/project.pbxproj:
3255
3256 2018-02-11  Michael Catanzaro  <mcatanzaro@igalia.com>
3257
3258         [GTK] Unify builds for platform-specific files in WebKit layer
3259         https://bugs.webkit.org/show_bug.cgi?id=182450
3260
3261         Reviewed by Carlos Garcia Campos.
3262
3263         Add most GTK-specific sources to unified build. API files are exempted, except for the DOM
3264         API. Files shared with PluginProcessGTK2 are also exempted. Finally, files with name
3265         conflicts in headers, which appears difficult to fix, are also exempted.
3266
3267         * CMakeLists.txt:
3268         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
3269         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3270         * NetworkProcess/soup/NetworkProcessSoup.cpp:
3271         * NetworkProcess/soup/NetworkSessionSoup.cpp:
3272         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
3273         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
3274         * PlatformGTK.cmake:
3275         * PluginProcess/unix/PluginControllerProxyUnix.cpp:
3276         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
3277         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
3278         * Shared/CoordinatedGraphics/SimpleViewportController.cpp:
3279         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3280         * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
3281         * Shared/Plugins/unix/PluginSearchPath.cpp:
3282         * Shared/cairo/ShareableBitmapCairo.cpp:
3283         * Shared/glib/WebContextMenuItemGlib.cpp:
3284         * Shared/glib/WebErrorsGlib.cpp:
3285         * Shared/gtk/ArgumentCodersGtk.cpp:
3286         * Shared/gtk/NativeWebKeyboardEventGtk.cpp:
3287         * Shared/gtk/ProcessExecutablePathGtk.cpp:
3288         * Shared/gtk/WebErrorsGtk.cpp:
3289         * Shared/gtk/WebEventFactory.cpp:
3290         * Shared/linux/WebMemorySamplerLinux.cpp:
3291         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
3292         * Shared/soup/WebErrorsSoup.cpp:
3293         * SourcesGTK.txt: Added.
3294         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
3295         * UIProcess/Automation/cairo/WebAutomationSessionCairo.cpp:
3296         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
3297         * UIProcess/BackingStore.cpp:
3298         * UIProcess/DrawingAreaProxyImpl.cpp:
3299         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
3300         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
3301         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
3302         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3303         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
3304         * UIProcess/WebStorage/StorageManager.cpp:
3305         * UIProcess/cairo/BackingStoreCairo.cpp:
3306         * UIProcess/gtk/AcceleratedBackingStore.cpp:
3307         * UIProcess/gtk/DragAndDropHandler.cpp:
3308         * UIProcess/gtk/GestureController.cpp:
3309         * UIProcess/gtk/HardwareAccelerationManager.cpp:
3310         * UIProcess/gtk/InputMethodFilter.cpp:
3311         * UIProcess/gtk/TextCheckerGtk.cpp:
3312         * UIProcess/gtk/WaylandCompositor.cpp:
3313         * UIProcess/gtk/WebColorPickerGtk.cpp:
3314         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
3315         * UIProcess/gtk/WebPasteboardProxyGtk.cpp:
3316         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
3317         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
3318         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
3319         (webkit_dom_attr_dom_event_target_init):
3320         (webkit_dom_attr_set_property):
3321         (webkit_dom_attr_get_property):
3322         (webkit_dom_attr_class_init):
3323         (webkit_dom_event_target_init): Deleted.
3324         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
3325         (webkit_dom_cdata_section_dom_event_target_init):
3326         (webkit_dom_event_target_init): Deleted.
3327         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
3328         (webkit_dom_css_rule_set_property):
3329         (webkit_dom_css_rule_get_property):
3330         (webkit_dom_css_rule_class_init):
3331         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
3332         (webkit_dom_css_rule_list_get_property):
3333         (webkit_dom_css_rule_list_class_init):
3334         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
3335         (webkit_dom_css_style_declaration_set_property):
3336         (webkit_dom_css_style_declaration_get_property):
3337         (webkit_dom_css_style_declaration_class_init):
3338         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
3339         (webkit_dom_css_style_sheet_get_property):
3340         (webkit_dom_css_style_sheet_class_init):
3341         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
3342         (webkit_dom_css_value_set_property):
3343         (webkit_dom_css_value_get_property):
3344         (webkit_dom_css_value_class_init):
3345         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
3346         (webkit_dom_character_data_dom_event_target_init):
3347         (webkit_dom_character_data_set_property):
3348         (webkit_dom_character_data_get_property):
3349         (webkit_dom_character_data_class_init):
3350         (webkit_dom_event_target_init): Deleted.
3351         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
3352         (webkit_dom_client_rect_get_property):
3353         (webkit_dom_client_rect_class_init):
3354         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
3355         (webkit_dom_client_rect_list_get_property):
3356         (webkit_dom_client_rect_list_class_init):
3357         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
3358         (webkit_dom_comment_dom_event_target_init):
3359         (webkit_dom_event_target_init): Deleted.
3360         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
3361         (webkit_dom_dom_selection_get_property):
3362         (webkit_dom_dom_selection_class_init):
3363         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
3364         (webkit_dom_dom_token_list_set_property):
3365         (webkit_dom_dom_token_list_get_property):
3366         (webkit_dom_dom_token_list_class_init):
3367         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
3368         (webkit_dom_dom_window_dom_event_target_init):
3369         (webkit_dom_dom_window_set_property):
3370         (webkit_dom_dom_window_get_property):
3371         (webkit_dom_dom_window_class_init):
3372         (webkit_dom_event_target_init): Deleted.
3373         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
3374         (webkit_dom_document_dom_event_target_init):
3375         (webkit_dom_document_set_property):
3376         (webkit_dom_document_get_property):
3377         (webkit_dom_document_class_init):
3378         (webkit_dom_event_target_init): Deleted.
3379         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
3380         (webkit_dom_document_fragment_dom_event_target_init):
3381         (webkit_dom_document_fragment_get_property):
3382         (webkit_dom_document_fragment_class_init):
3383         (webkit_dom_event_target_init): Deleted.
3384         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
3385         (webkit_dom_document_type_dom_event_target_init):
3386         (webkit_dom_document_type_get_property):
3387         (webkit_dom_document_type_class_init):
3388         (webkit_dom_event_target_init): Deleted.
3389         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
3390         (webkit_dom_element_dom_event_target_init):
3391         (webkit_dom_element_set_property):
3392         (webkit_dom_element_get_property):
3393         (webkit_dom_element_class_init):
3394         (webkit_dom_event_target_init): Deleted.
3395         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
3396         (webkit_dom_event_set_property):
3397         (webkit_dom_event_get_property):
3398         (webkit_dom_event_class_init):
3399         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
3400         (webkit_dom_file_get_property):
3401         (webkit_dom_file_class_init):
3402         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
3403         (webkit_dom_file_list_get_property):
3404         (webkit_dom_file_list_class_init):
3405         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
3406         (webkit_dom_html_anchor_element_dom_event_target_init):
3407         (webkit_dom_html_anchor_element_set_property):
3408         (webkit_dom_html_anchor_element_get_property):
3409         (webkit_dom_html_anchor_element_class_init):
3410         (webkit_dom_event_target_init): Deleted.
3411         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
3412         (webkit_dom_html_applet_element_dom_event_target_init):
3413         (webkit_dom_html_applet_element_set_property):
3414         (webkit_dom_html_applet_element_get_property):
3415         (webkit_dom_html_applet_element_class_init):
3416         (webkit_dom_event_target_init): Deleted.
3417         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
3418         (webkit_dom_html_area_element_dom_event_target_init):
3419         (webkit_dom_html_area_element_set_property):
3420         (webkit_dom_html_area_element_get_property):
3421         (webkit_dom_html_area_element_class_init):
3422         (webkit_dom_event_target_init): Deleted.
3423         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
3424         (webkit_dom_html_br_element_dom_event_target_init):
3425         (webkit_dom_html_br_element_set_property):
3426         (webkit_dom_html_br_element_get_property):
3427         (webkit_dom_html_br_element_class_init):
3428         (webkit_dom_event_target_init): Deleted.
3429         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
3430         (webkit_dom_html_base_element_dom_event_target_init):