3fed073c3de0249edd8d710276f96a3c2682f95b
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2017-06-19  Konstantin Tokarev  <annulen@yandex.ru>
2
3         Removed unused lambda captures from WebKit2
4         https://bugs.webkit.org/show_bug.cgi?id=173555
5
6         Reviewed by Alex Christensen.
7
8         * UIProcess/Network/NetworkProcessProxy.cpp:
9         (WebKit::NetworkProcessProxy::fetchWebsiteData):
10         (WebKit::NetworkProcessProxy::deleteWebsiteData):
11         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
12         * UIProcess/WebProcessProxy.cpp:
13         (WebKit::WebProcessProxy::fetchWebsiteData):
14         (WebKit::WebProcessProxy::deleteWebsiteData):
15         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
16         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
17         (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData):
18
19 2017-06-19  Chris Dumez  <cdumez@apple.com>
20
21         Use WTF::Function instead of std::function in more places in WebCore/
22         https://bugs.webkit.org/show_bug.cgi?id=173535
23
24         Reviewed by Antti Koivisto.
25
26         Use WTF::Function instead of std::function in more places in WebCore/ to avoid copying.
27
28         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
29         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
30         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
31         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
32         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
33         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
34         * WebProcess/WebPage/WebFrame.cpp:
35         (WebKit::WebFrame::setUpPolicyListener):
36         (WebKit::WebFrame::invalidatePolicyListener):
37         * WebProcess/WebPage/WebFrame.h:
38
39 2017-06-19  Chris Dumez  <cdumez@apple.com>
40
41         [WK2] Add WKProcessPool SPI to efficiently reset all plugin load client policies
42         https://bugs.webkit.org/show_bug.cgi?id=173472
43         <rdar://problem/28858817>
44
45         Reviewed by Antti Koivisto.
46
47         Follow-up to r218419 to avoid copying the HashMap unnecessarily.
48
49         * UIProcess/WebProcessPool.cpp:
50         (WebKit::WebProcessPool::resetPluginLoadClientPolicies):
51         * UIProcess/WebProcessPool.h:
52
53 2017-06-19  Youenn Fablet  <youenn@apple.com>
54
55         A cloned MediaStreamTrack should mute independently other tracks using the same source
56         https://bugs.webkit.org/show_bug.cgi?id=172831
57         <rdar://problem/32518527>
58
59         Reviewed by Eric Carlson.
60
61         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
62         (WebKit::UserMediaCaptureManager::Source::setStorage):
63
64 2017-06-19  Carlos Garcia Campos  <cgarcia@igalia.com>
65
66         [GTK] Move GTK+ API files that could be shared to glib dirs
67         https://bugs.webkit.org/show_bug.cgi?id=173545
68
69         Reviewed by Žan Doberšek.
70
71         Most of the files don't use GTK+ at all, or only for a few things that could be ifdefed. Public headers can
72         never be shared, so move only private headers and cpp files. This patch moves the files without any
73         modification to make everything easier, in follow up commits we will add the required ifdefs and refactorings to
74         ensure the code can actually be shared.
75
76         * PlatformGTK.cmake:
77         * Shared/API/glib/WebKitContextMenu.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenu.cpp.
78         * Shared/API/glib/WebKitContextMenuActions.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.cpp.
79         * Shared/API/glib/WebKitContextMenuActionsPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h.
80         * Shared/API/glib/WebKitContextMenuItem.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItem.cpp.
81         * Shared/API/glib/WebKitContextMenuItemPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItemPrivate.h.
82         * Shared/API/glib/WebKitContextMenuPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuPrivate.h.
83         * Shared/API/glib/WebKitHitTestResult.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.cpp.
84         * Shared/API/glib/WebKitHitTestResultPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResultPrivate.h.
85         * Shared/API/glib/WebKitURIRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURIRequest.cpp.
86         * Shared/API/glib/WebKitURIRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURIRequestPrivate.h.
87         * Shared/API/glib/WebKitURIResponse.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp.
88         * Shared/API/glib/WebKitURIResponsePrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURIResponsePrivate.h.
89         * UIProcess/API/glib/WebKitAuthenticationRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitAuthenticationRequest.cpp.
90         * UIProcess/API/glib/WebKitAuthenticationRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitAuthenticationRequestPrivate.h.
91         * UIProcess/API/glib/WebKitAutomationSession.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitAutomationSession.cpp.
92         * UIProcess/API/glib/WebKitAutomationSessionPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitAutomationSessionPrivate.h.
93         * UIProcess/API/glib/WebKitBackForwardList.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardList.cpp.
94         * UIProcess/API/glib/WebKitBackForwardListItem.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListItem.cpp.
95         * UIProcess/API/glib/WebKitBackForwardListPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListPrivate.h.
96         * UIProcess/API/glib/WebKitContextMenuClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuClient.cpp.
97         * UIProcess/API/glib/WebKitContextMenuClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuClient.h.
98         * UIProcess/API/glib/WebKitCookieManager.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp.
99         * UIProcess/API/glib/WebKitCookieManagerPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCookieManagerPrivate.h.
100         * UIProcess/API/glib/WebKitCredential.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCredential.cpp.
101         * UIProcess/API/glib/WebKitCredentialPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCredentialPrivate.h.
102         * UIProcess/API/glib/WebKitCustomProtocolManagerClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp.
103         * UIProcess/API/glib/WebKitCustomProtocolManagerClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCustomProtocolManagerClient.h.
104         * UIProcess/API/glib/WebKitDownload.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp.
105         * UIProcess/API/glib/WebKitDownloadClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitDownloadClient.cpp.
106         * UIProcess/API/glib/WebKitDownloadClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitDownloadClient.h.
107         * UIProcess/API/glib/WebKitDownloadPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitDownloadPrivate.h.
108         * UIProcess/API/glib/WebKitEditorState.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitEditorState.cpp.
109         * UIProcess/API/glib/WebKitEditorStatePrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitEditorStatePrivate.h.
110         * UIProcess/API/glib/WebKitError.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitError.cpp.
111         * UIProcess/API/glib/WebKitFaviconDatabase.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFaviconDatabase.cpp.
112         * UIProcess/API/glib/WebKitFaviconDatabasePrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFaviconDatabasePrivate.h.
113         * UIProcess/API/glib/WebKitFileChooserRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequest.cpp.
114         * UIProcess/API/glib/WebKitFileChooserRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h.
115         * UIProcess/API/glib/WebKitFindController.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFindController.cpp.
116         * UIProcess/API/glib/WebKitFormClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFormClient.cpp.
117         * UIProcess/API/glib/WebKitFormClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFormClient.h.
118         * UIProcess/API/glib/WebKitFormSubmissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp.
119         * UIProcess/API/glib/WebKitFormSubmissionRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h.
120         * UIProcess/API/glib/WebKitGeolocationPermissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp.
121         * UIProcess/API/glib/WebKitGeolocationPermissionRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequestPrivate.h.
122         * UIProcess/API/glib/WebKitGeolocationProvider.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.cpp.
123         * UIProcess/API/glib/WebKitGeolocationProvider.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.h.
124         * UIProcess/API/glib/WebKitInjectedBundleClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitInjectedBundleClient.cpp.
125         * UIProcess/API/glib/WebKitInjectedBundleClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitInjectedBundleClient.h.
126         * UIProcess/API/glib/WebKitInstallMissingMediaPluginsPermissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.cpp.
127         * UIProcess/API/glib/WebKitInstallMissingMediaPluginsPermissionRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequestPrivate.h.
128         * UIProcess/API/glib/WebKitJavascriptResult.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResult.cpp.
129         * UIProcess/API/glib/WebKitJavascriptResultPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResultPrivate.h.
130         * UIProcess/API/glib/WebKitLoaderClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp.
131         * UIProcess/API/glib/WebKitLoaderClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.h.
132         * UIProcess/API/glib/WebKitMimeInfo.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitMimeInfo.cpp.
133         * UIProcess/API/glib/WebKitMimeInfoPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitMimeInfoPrivate.h.
134         * UIProcess/API/glib/WebKitNavigationAction.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNavigationAction.cpp.
135         * UIProcess/API/glib/WebKitNavigationActionPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNavigationActionPrivate.h.
136         * UIProcess/API/glib/WebKitNavigationPolicyDecision.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp.
137         * UIProcess/API/glib/WebKitNavigationPolicyDecisionPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h.
138         * UIProcess/API/glib/WebKitNetworkProxySettings.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNetworkProxySettings.cpp.
139         * UIProcess/API/glib/WebKitNetworkProxySettingsPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNetworkProxySettingsPrivate.h.
140         * UIProcess/API/glib/WebKitNotification.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotification.cpp.
141         * UIProcess/API/glib/WebKitNotificationPermissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPermissionRequest.cpp.
142         * UIProcess/API/glib/WebKitNotificationPermissionRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPermissionRequestPrivate.h.
143         * UIProcess/API/glib/WebKitNotificationPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPrivate.h.
144         * UIProcess/API/glib/WebKitNotificationProvider.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.cpp.
145         * UIProcess/API/glib/WebKitNotificationProvider.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.h.
146         * UIProcess/API/glib/WebKitPermissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPermissionRequest.cpp.
147         * UIProcess/API/glib/WebKitPlugin.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPlugin.cpp.
148         * UIProcess/API/glib/WebKitPluginPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPluginPrivate.h.
149         * UIProcess/API/glib/WebKitPolicyClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.cpp.
150         * UIProcess/API/glib/WebKitPolicyClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.h.
151         * UIProcess/API/glib/WebKitPolicyDecision.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecision.cpp.
152         * UIProcess/API/glib/WebKitPolicyDecisionPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecisionPrivate.h.
153         * UIProcess/API/glib/WebKitPrivate.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.cpp.
154         * UIProcess/API/glib/WebKitPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h.
155         * UIProcess/API/glib/WebKitResponsePolicyDecision.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp.
156         * UIProcess/API/glib/WebKitResponsePolicyDecisionPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h.
157         * UIProcess/API/glib/WebKitScriptDialog.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitScriptDialog.cpp.
158         * UIProcess/API/glib/WebKitScriptDialogPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitScriptDialogPrivate.h.
159         * UIProcess/API/glib/WebKitSecurityManager.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManager.cpp.
160         * UIProcess/API/glib/WebKitSecurityManagerPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManagerPrivate.h.
161         * UIProcess/API/glib/WebKitSecurityOrigin.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSecurityOrigin.cpp.
162         * UIProcess/API/glib/WebKitSecurityOriginPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSecurityOriginPrivate.h.
163         * UIProcess/API/glib/WebKitSettings.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp.
164         * UIProcess/API/glib/WebKitSettingsPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSettingsPrivate.h.
165         * UIProcess/API/glib/WebKitUIClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp.
166         * UIProcess/API/glib/WebKitUIClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.h.
167         * UIProcess/API/glib/WebKitURISchemeRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp.
168         * UIProcess/API/glib/WebKitURISchemeRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h.
169         * UIProcess/API/glib/WebKitUserContent.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserContent.cpp.
170         * UIProcess/API/glib/WebKitUserContentManager.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserContentManager.cpp.
171         * UIProcess/API/glib/WebKitUserContentManagerPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserContentManagerPrivate.h.
172         * UIProcess/API/glib/WebKitUserContentPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserContentPrivate.h.
173         * UIProcess/API/glib/WebKitUserMediaPermissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserMediaPermissionRequest.cpp.
174         * UIProcess/API/glib/WebKitUserMediaPermissionRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserMediaPermissionRequestPrivate.h.
175         * UIProcess/API/glib/WebKitWebContext.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp.
176         * UIProcess/API/glib/WebKitWebContextPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebContextPrivate.h.
177         * UIProcess/API/glib/WebKitWebResource.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebResource.cpp.
178         * UIProcess/API/glib/WebKitWebResourcePrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebResourcePrivate.h.
179         * UIProcess/API/glib/WebKitWebView.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp.
180         * UIProcess/API/glib/WebKitWebViewPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h.
181         * UIProcess/API/glib/WebKitWebViewSessionState.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebViewSessionState.cpp.
182         * UIProcess/API/glib/WebKitWebViewSessionStatePrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebViewSessionStatePrivate.h.
183         * UIProcess/API/glib/WebKitWebsiteData.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteData.cpp.
184         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteDataManager.cpp.
185         * UIProcess/API/glib/WebKitWebsiteDataManagerPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteDataManagerPrivate.h.
186         * UIProcess/API/glib/WebKitWebsiteDataPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteDataPrivate.h.
187         * UIProcess/API/glib/WebKitWindowProperties.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp.
188         * UIProcess/API/glib/WebKitWindowPropertiesPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h.
189         * WebProcess/InjectedBundle/API/glib/WebKitConsoleMessage.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessage.cpp.
190         * WebProcess/InjectedBundle/API/glib/WebKitConsoleMessagePrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessagePrivate.h.
191         * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitFrame.cpp.
192         * WebProcess/InjectedBundle/API/glib/WebKitFramePrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitFramePrivate.h.
193         * WebProcess/InjectedBundle/API/glib/WebKitScriptWorld.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp.
194         * WebProcess/InjectedBundle/API/glib/WebKitScriptWorldPrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitScriptWorldPrivate.h.
195         * WebProcess/InjectedBundle/API/glib/WebKitWebEditor.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp.
196         * WebProcess/InjectedBundle/API/glib/WebKitWebEditorPrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebEditorPrivate.h.
197         * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp.
198         * WebProcess/InjectedBundle/API/glib/WebKitWebExtensionPrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionPrivate.h.
199         * WebProcess/InjectedBundle/API/glib/WebKitWebHitTestResult.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.cpp.
200         * WebProcess/InjectedBundle/API/glib/WebKitWebHitTestResultPrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResultPrivate.h.
201         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp.
202         * WebProcess/InjectedBundle/API/glib/WebKitWebPagePrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPagePrivate.h.
203
204 2017-05-14 Frederic Wang  <fwang@igalia.com>
205
206         Add heuristic to avoid flattening "fullscreen" iframes
207         https://bugs.webkit.org/show_bug.cgi?id=171914
208
209         Reviewed by Simon Fraser.
210
211         This commit ajusts the preference API to internally treat frame flattening as an enum.
212         However, the "partial frame flattening" value is not exposed to GTK, C or InjectedBundle APIs yet.
213
214         * Shared/WebPreferencesDefinitions.h: Define frame flattening as an enum.
215         * UIProcess/API/C/WKPreferences.cpp:
216         (WKPreferencesSetFrameFlatteningEnabled): Treat frame flattening as an enum.
217         (WKPreferencesGetFrameFlatteningEnabled): Ditto.
218         * UIProcess/API/gtk/WebKitSettings.cpp:
219         (webkit_settings_get_enable_frame_flattening): Ditto.
220         (webkit_settings_set_enable_frame_flattening): Ditto.
221         * WebProcess/InjectedBundle/InjectedBundle.cpp:
222         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Do not handle frame flattening since it is an enum.
223         For now, this breaks one test checking preference overriding because of bug 128594.
224         (WebKit::InjectedBundle::setFrameFlatteningEnabled): Treat frame flattening as an enum.
225         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
226         (WebKit::WebChromeClient::contentsSizeChanged): Use enum value.
227         * WebProcess/WebPage/WebPage.cpp:
228         (WebKit::WebPage::updatePreferences): Ditto.
229
230 2017-06-18  Carlos Garcia Campos  <cgarcia@igalia.com>
231
232         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.4 release.
233
234         * gtk/NEWS: Add release notes for 2.17.4.
235
236 2017-06-18  Chris Dumez  <cdumez@apple.com>
237
238         Drop redundant IPC in WebPage::tryClose()
239         https://bugs.webkit.org/show_bug.cgi?id=173533
240
241         Reviewed by Sam Weinig.
242
243         Drop redundant IPC to stop the responsiveness timer in WebPage::tryClose(). The
244         destructor for the SendStopResponsivenessTimer already takes care of sending the
245         IPC.
246
247         * WebProcess/WebPage/WebPage.cpp:
248         (WebKit::WebPage::tryClose):
249
250 2017-06-18  Chris Dumez  <cdumez@apple.com>
251
252         Drop unused UserMediaPermissionRequestManager::cancelPendingRequests()
253         https://bugs.webkit.org/show_bug.cgi?id=173529
254         <rdar://problem/32836986>
255
256         Reviewed by Sam Weinig.
257
258         Drop UserMediaPermissionRequestManager::cancelPendingRequests() as it is unused
259         and its implementation is wrong (modifies the hash maps it is iterating on).
260
261         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
262         (WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): Deleted.
263         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
264
265 2017-06-17  Chris Dumez  <cdumez@apple.com>
266
267         Unreviewed, follow-up build fix after r218457.
268
269         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
270         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
271
272 2017-06-17  Chris Dumez  <cdumez@apple.com>
273
274         Unreviewed, follow-up build fix after r218457.
275
276         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
277         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
278
279 2017-06-17  Chris Dumez  <cdumez@apple.com>
280
281         Use WTF::Function instead of std::function in WebKit2/
282         https://bugs.webkit.org/show_bug.cgi?id=173504
283
284         Reviewed by Darin Adler.
285
286         Use WTF::Function instead of std::function in WebKit2/ to avoid
287         unnecessary copying.
288
289         * DatabaseProcess/DatabaseProcess.cpp:
290         (WebKit::DatabaseProcess::getSandboxExtensionsForBlobFiles):
291         * DatabaseProcess/DatabaseProcess.h:
292         * NetworkProcess/cache/NetworkCacheData.h:
293         * NetworkProcess/cache/NetworkCacheFileSystem.h:
294         * Platform/IPC/Connection.cpp:
295         (IPC::Connection::installIncomingSyncMessageCallback):
296         * Platform/IPC/Connection.h:
297         * Platform/IPC/glib/GSocketMonitor.h:
298         * Platform/Logging.h:
299         * Shared/API/APIObject.h:
300         * Shared/AsyncRequest.cpp:
301         (WebKit::AsyncRequest::AsyncRequest):
302         (WebKit::AsyncRequest::setAbortHandler):
303         * Shared/AsyncRequest.h:
304         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
305         (WebKit::CompositingRunLoop::CompositingRunLoop):
306         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
307         * Shared/WebContextMenuItemData.h:
308         * UIProcess/API/APIDownloadClient.h:
309         (API::DownloadClient::willSendRequest):
310         * UIProcess/API/APIIconLoadingClient.h:
311         (API::IconLoadingClient::getLoadDecisionForIcon):
312         * UIProcess/API/APIUIClient.h:
313         (API::UIClient::createNewPageAsync):
314         * UIProcess/API/C/WKPage.cpp:
315         (toGenericCallbackFunction):
316         * UIProcess/API/Cocoa/WKWebView.mm:
317         * UIProcess/API/mac/WKView.mm:
318         (-[WKView maybeInstallIconLoadingClient]):
319         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
320         (WebKit::AcceleratedDrawingAreaProxy::dispatchAfterEnsuringDrawing):
321         * UIProcess/AcceleratedDrawingAreaProxy.h:
322         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
323         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
324         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
325         (WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup):
326         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
327         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
328         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
329         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
330         * UIProcess/Automation/WebAutomationSession.cpp:
331         (WebKit::WebAutomationSession::performKeyboardInteractions):
332         * UIProcess/Cocoa/IconLoadingDelegate.h:
333         * UIProcess/Cocoa/IconLoadingDelegate.mm:
334         (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):
335         * UIProcess/Cocoa/NavigationState.mm:
336         (WebKit::tryAppLink):
337         * UIProcess/Cocoa/UIDelegate.h:
338         * UIProcess/Cocoa/UIDelegate.mm:
339         (WebKit::UIDelegate::UIClient::createNewPageCommon):
340         (WebKit::UIDelegate::UIClient::createNewPageAsync):
341         * UIProcess/Cocoa/ViewGestureController.cpp:
342         (WebKit::ViewGestureController::SnapshotRemovalTracker::start):
343         * UIProcess/Cocoa/ViewGestureController.h:
344         * UIProcess/Cocoa/WebViewImpl.h:
345         * UIProcess/Cocoa/WebViewImpl.mm:
346         (WebKit::WebViewImpl::prepareForMoveToWindow):
347         * UIProcess/Databases/DatabaseProcessProxy.cpp:
348         (WebKit::DatabaseProcessProxy::fetchWebsiteData):
349         (WebKit::DatabaseProcessProxy::deleteWebsiteData):
350         (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins):
351         * UIProcess/Databases/DatabaseProcessProxy.h:
352         * UIProcess/DrawingAreaProxy.h:
353         (WebKit::DrawingAreaProxy::dispatchAfterEnsuringDrawing):
354         * UIProcess/DrawingAreaProxyImpl.cpp:
355         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::start):
356         (WebKit::DrawingAreaProxyImpl::dispatchAfterEnsuringDrawing):
357         * UIProcess/DrawingAreaProxyImpl.h:
358         * UIProcess/GenericCallback.h:
359         * UIProcess/Network/NetworkProcessProxy.cpp:
360         (WebKit::NetworkProcessProxy::fetchWebsiteData):
361         (WebKit::NetworkProcessProxy::deleteWebsiteData):
362         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
363         * UIProcess/Network/NetworkProcessProxy.h:
364         * UIProcess/PageClient.h:
365         * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
366         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest):
367         * UIProcess/Plugins/PlugInAutoStartProvider.h:
368         * UIProcess/Plugins/PluginProcessManager.cpp:
369         (WebKit::PluginProcessManager::fetchWebsiteData):
370         (WebKit::PluginProcessManager::deleteWebsiteData):
371         (WebKit::PluginProcessManager::deleteWebsiteDataForHostNames):
372         * UIProcess/Plugins/PluginProcessManager.h:
373         * UIProcess/Plugins/PluginProcessProxy.cpp:
374         (WebKit::PluginProcessProxy::fetchWebsiteData):
375         (WebKit::PluginProcessProxy::deleteWebsiteData):
376         (WebKit::PluginProcessProxy::deleteWebsiteDataForHostNames):
377         * UIProcess/Plugins/PluginProcessProxy.h:
378         * UIProcess/ProcessAssertion.h:
379         * UIProcess/WebBackForwardList.cpp:
380         (WebKit::WebBackForwardList::backForwardListState):
381         * UIProcess/WebBackForwardList.h:
382         * UIProcess/WebCookieManagerProxy.cpp:
383         (WebKit::WebCookieManagerProxy::setCookieObserverCallback):
384         (WebKit::WebCookieManagerProxy::cookiesDidChange):
385         * UIProcess/WebCookieManagerProxy.h:
386         * UIProcess/WebPageProxy.cpp:
387         (WebKit::WebPageProxy::setInitialFocus):
388         (WebKit::WebPageProxy::validateCommand):
389         (WebKit::WebPageProxy::sessionState):
390         (WebKit::WebPageProxy::runJavaScriptInMainFrame):
391         (WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
392         (WebKit::WebPageProxy::getSourceForFrame):
393         (WebKit::WebPageProxy::getContentsAsString):
394         (WebKit::WebPageProxy::getBytecodeProfile):
395         (WebKit::WebPageProxy::getSamplingProfilerOutput):
396         (WebKit::WebPageProxy::isWebProcessResponsive):
397         (WebKit::WebPageProxy::getSelectionOrContentsAsString):
398         (WebKit::WebPageProxy::createNewPage):
399         (WebKit::WebPageProxy::getMarkedRangeAsync):
400         (WebKit::WebPageProxy::getSelectedRangeAsync):
401         (WebKit::WebPageProxy::characterIndexForPointAsync):
402         (WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
403         (WebKit::WebPageProxy::takeSnapshot):
404         (WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
405         (WebKit::WebPageProxy::callAfterNextPresentationUpdate):
406         (WebKit::WebPageProxy::getLoadDecisionForIcon):
407         * UIProcess/WebPageProxy.h:
408         * UIProcess/WebProcessProxy.cpp:
409         (WebKit::WebProcessProxy::isResponsive):
410         * UIProcess/WebProcessProxy.h:
411         * UIProcess/WebsiteData/WebsiteDataStore.h:
412         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
413         (WebKit::XDamageNotifier::add):
414         * UIProcess/ios/PageClientImplIOS.h:
415         * UIProcess/ios/PageClientImplIOS.mm:
416         (WebKit::PageClientImpl::requestPasswordForQuickLookDocument):
417         * UIProcess/ios/WebPageProxyIOS.mm:
418         (WebKit::WebPageProxy::selectWithGesture):
419         (WebKit::WebPageProxy::updateSelectionWithTouches):
420         (WebKit::WebPageProxy::requestAutocorrectionData):
421         (WebKit::WebPageProxy::applyAutocorrection):
422         (WebKit::WebPageProxy::executeEditCommand):
423         (WebKit::WebPageProxy::selectTextWithGranularityAtPoint):
424         (WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection):
425         (WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection):
426         (WebKit::WebPageProxy::selectPositionAtPoint):
427         (WebKit::WebPageProxy::beginSelectionInDirection):
428         (WebKit::WebPageProxy::updateSelectionWithExtentPoint):
429         (WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary):
430         (WebKit::WebPageProxy::requestDictationContext):
431         (WebKit::WebPageProxy::requestAutocorrectionContext):
432         (WebKit::WebPageProxy::getSelectionContext):
433         (WebKit::WebPageProxy::selectWithTwoTouches):
434         (WebKit::WebPageProxy::requestRectsForGranularityWithSelectionOffset):
435         (WebKit::WebPageProxy::requestRectsAtSelectionOffsetWithText):
436         (WebKit::WebPageProxy::moveSelectionByOffset):
437         (WebKit::WebPageProxy::focusNextAssistedNode):
438         (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame):
439         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
440         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
441         (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
442         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
443         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
444         (WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing):
445         * UIProcess/mac/WKTextFinderClient.mm:
446         * UIProcess/mac/WebContextMenuProxyMac.mm:
447         (-[WKSelectionHandlerWrapper initWithSelectionHandler:]):
448         * UIProcess/mac/WebPageProxyMac.mm:
449         (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
450         (WebKit::WebPageProxy::fontAtSelection):
451         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
452         (WebKit::WebPaymentCoordinator::canMakePaymentsWithActiveCard):
453         (WebKit::WebPaymentCoordinator::openPaymentSetup):
454         * WebProcess/ApplePay/WebPaymentCoordinator.h:
455         * WebProcess/Plugins/PluginView.cpp:
456         (WebKit::PluginView::Stream::willSendRequest):
457         * WebProcess/WebPage/DrawingArea.cpp:
458         (WebKit::DrawingArea::dispatchAfterEnsuringUpdatedScrollPosition):
459         * WebProcess/WebPage/DrawingArea.h:
460         * WebProcess/WebPage/WebPage.cpp:
461         (WebKit::WebPage::markLayersVolatile):
462         * WebProcess/WebPage/WebPage.h:
463         (WebKit::WebPage::markLayersVolatile):
464         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
465         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
466         (WebKit::TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition):
467         * WebProcess/WebProcess.cpp:
468         (WebKit::WebProcess::markAllLayersVolatile):
469         * WebProcess/WebProcess.h:
470
471 2017-06-17  Alex Christensen  <achristensen@webkit.org>
472
473         Fix CMake build
474
475         * CMakeLists.txt:
476         * NetworkProcess/capture/NetworkCaptureEvent.cpp:
477         * PlatformGTK.cmake:
478         * PlatformWPE.cmake:
479
480 2017-06-17  Dan Bernstein  <mitz@apple.com>
481
482         Tried to fix non-iOS builds.
483
484         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
485
486 2017-06-17  Carlos Garcia Campos  <cgarcia@igalia.com>
487
488         [GTK] Rename WebContextMenuItemGtk as WebContextMenuItemGlib
489         https://bugs.webkit.org/show_bug.cgi?id=173469
490
491         Reviewed by Michael Catanzaro.
492
493         Now that we switched to GAction this is actually a glib implementation, we keep the GtkAction support only for
494         backwards compatibility. We could rename the file and make the GtkAction action conditional to the GTK+ port.
495
496         * PlatformGTK.cmake:
497         * Shared/glib/WebContextMenuItemGlib.cpp: Renamed from Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.cpp.
498         (WebKit::gtkStockIDFromContextMenuAction):
499         (WebKit::WebContextMenuItemGlib::WebContextMenuItemGlib):
500         (WebKit::WebContextMenuItemGlib::~WebContextMenuItemGlib):
501         (WebKit::WebContextMenuItemGlib::buildActionName):
502         (WebKit::WebContextMenuItemGlib::createActionIfNeeded):
503         * Shared/glib/WebContextMenuItemGlib.h: Renamed from Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.h.
504         * UIProcess/API/gtk/WebKitContextMenu.cpp:
505         (webkitContextMenuPopulate):
506         * UIProcess/API/gtk/WebKitContextMenuActions.cpp:
507         (webkitContextMenuActionGetForContextMenuItem):
508         * UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h:
509         * UIProcess/API/gtk/WebKitContextMenuItem.cpp:
510         (webkitContextMenuItemCreate):
511         (webkitContextMenuItemToWebContextMenuItemGlib):
512         (webkit_context_menu_item_new):
513         (webkit_context_menu_item_new_from_gaction):
514         (webkit_context_menu_item_new_from_stock_action):
515         (webkit_context_menu_item_new_from_stock_action_with_label):
516         (webkit_context_menu_item_new_with_submenu):
517         (webkit_context_menu_item_new_separator):
518         * UIProcess/API/gtk/WebKitContextMenuItemPrivate.h:
519         * UIProcess/API/gtk/WebKitContextMenuPrivate.h:
520         * UIProcess/API/gtk/WebKitWebView.cpp:
521         (webkitWebViewPopulateContextMenu):
522         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
523         (WebKit::WebContextMenuProxyGtk::append):
524         (WebKit::WebContextMenuProxyGtk::buildMenu):
525         (WebKit::WebContextMenuProxyGtk::populate):
526         * UIProcess/gtk/WebContextMenuProxyGtk.h:
527
528 2017-06-16  Dan Bernstein  <mitz@apple.com>
529
530         [Cocoa] Some declarations have missing or incorrect availability attributes
531         https://bugs.webkit.org/show_bug.cgi?id=173508
532
533         Reviewed by Tim Horton.
534
535         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: Removed a redundant attribute.
536
537         In all of the below files, added missing availability attributes for declarations that have
538         not appeared yet in any GM SDK, and fixed availability attributes for declarations that
539         have already appeared in the macOS 10.12.3 and iOS 10.3 SDKs.
540
541         * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h:
542         * UIProcess/API/Cocoa/WKHTTPCookieStore.h:
543         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
544         * UIProcess/API/Cocoa/WKPreferences.h: Also fixed capitalization in a comment.
545         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
546         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
547         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Also removed unnecessary conditionals.
548         * UIProcess/API/Cocoa/WKWebView.mm:
549         (-[WKWebView _draggableElementAtPosition:]): Prepended an underscore to this private method’s name.
550         (-[WKWebView _requestDraggableElementAtPosition:completionBlock:]): Ditto.
551         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
552         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Also updated for renames.
553         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
554         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
555         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
556         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
557         * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h:
558         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
559         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
560         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
561         * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
562         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
563         * UIProcess/_WKWebViewPrintFormatter.h:
564         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
565         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
566         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h:
567
568 2017-06-16  Youenn Fablet  <youenn@apple.com>
569
570         [WebRTC] CrashTracer: Regression : com.apple.WebKit.Networking at WebKit: WebKit::LibWebRTCSocketClient::sendTo
571         https://bugs.webkit.org/show_bug.cgi?id=173501
572
573         Reviewed by Eric Carlson.
574
575         When a libwebrtc socket fails to be created in the network process,
576         the network process sends back a close message, but it keeps it in a map.
577         If the web process sends a message dedicated to this socket, we will try
578         processing it and calling the socket which is null, hence the cache.
579         This patch makes it so that if the socket is null, it is not added to the map.
580
581         * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
582         (WebKit::LibWebRTCSocketClient::LibWebRTCSocketClient):
583         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
584         (WebKit::NetworkRTCProvider::createSocket):
585         (WebKit::NetworkRTCProvider::createUDPSocket):
586         (WebKit::NetworkRTCProvider::createServerTCPSocket):
587         (WebKit::NetworkRTCProvider::createClientTCPSocket):
588         * NetworkProcess/webrtc/NetworkRTCProvider.h:
589
590 2017-06-16  Antoine Quint  <graouts@apple.com>
591
592         Add a WebKit2 setting to control whether media documents should automatically enter fullscreen
593         https://bugs.webkit.org/show_bug.cgi?id=173503
594
595         Reviewed by Tim Horton.
596
597         New WebKit2 setting to specify whether a media document should automatically enter fullscreen.
598
599         * Shared/WebPreferencesDefinitions.h:
600         * UIProcess/API/Cocoa/WKPreferences.mm:
601         (-[WKPreferences _setMediaDocumentEntersFullscreenAutomatically:]):
602         (-[WKPreferences _mediaDocumentEntersFullscreenAutomatically]):
603         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
604         * WebProcess/WebPage/WebPage.cpp:
605         (WebKit::WebPage::updatePreferences):
606
607 2017-06-16  Sam Weinig  <sam@webkit.org>
608
609         [WebIDL] Remove custom bindings for HTMLDocument
610         https://bugs.webkit.org/show_bug.cgi?id=173444
611
612         Reviewed by Darin Adler.
613
614         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
615         (webkit_dom_html_document_get_link_color):
616         (webkit_dom_html_document_set_link_color):
617         Update for rename of linkColor to linkColorForBindings.
618
619 2017-06-16  Daniel Bates  <dabates@apple.com>
620
621         Cleanup: WebContextMenuClient::searchWithGoogle() should parse URL using URL { URL { }, ... }
622         instead of URL { ParsedURLString, ... }
623         https://bugs.webkit.org/show_bug.cgi?id=173495
624         <rdar://problem/32827445>
625
626         Reviewed by Alex Christensen.
627
628         URL(ParsedURLString, ...) should only be used with a string that was the result of URL::string().
629         Otherwise, it will cause an assertion failure if the canonicalized URL differs from the string.
630         Although it is unlikely that the hardcoded string in WebContextMenuClient::searchWithGoogle()
631         would differ from the canonicalized URL it is best practice to use URL(URL(), ...) to
632         parse an arbitrary string that looks like a URL.
633
634         Also modernize the code using C++14 idioms.
635
636         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
637         (WebKit::WebContextMenuClient::searchWithGoogle):
638
639 2017-06-16  Wenson Hsieh  <wenson_hsieh@apple.com>
640
641         [iOS DnD] Upstream iOS drag and drop implementation into OpenSource WebKit
642         https://bugs.webkit.org/show_bug.cgi?id=173366
643         <rdar://problem/32767014>
644
645         Reviewed by Tim Horton.
646
647         Move pieces of iOS WebKit2 drag and drop implementation into OpenSource. No change in behavior.
648
649         * Configurations/FeatureDefines.xcconfig:
650         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
651         (WebKit::WebPageProxy::setDragImage):
652         (WebKit::WebPageProxy::setPromisedDataForImage):
653         (WebKit::WebPageProxy::setPromisedDataForAttachment):
654         (WebKit::WebPageProxy::setDragCaretRect):
655         * UIProcess/ios/WKContentViewInteraction.h:
656         * UIProcess/ios/WKContentViewInteraction.mm:
657         (longPressActionDelayAfterLift):
658         (-[WKContentView webViewUIDelegate]):
659         (-[WKContentView setupDataInteractionDelegates]):
660         (-[WKContentView teardownDataInteractionDelegates]):
661         (-[WKContentView _startDataInteractionWithImage:withIndicatorData:atClientPosition:anchorPoint:action:]):
662         (-[WKContentView _didHandleStartDataInteractionRequest:]):
663         (uiImageForImage):
664         (shouldUseTextIndicatorToCreatePreviewForDragAction):
665         (-[WKContentView dragPreviewForImage:frameInRootViewCoordinates:clippingRectsInFrameCoordinates:backgroundColor:]):
666         (-[WKContentView dragPreviewForCurrentDataInteractionState]):
667         (-[WKContentView performDeferredActionAtDragOrigin]):
668         (-[WKContentView cancelDeferredActionAtDragOrigin]):
669         (-[WKContentView computeClientAndGlobalPointsForDropSession:outClientPoint:outGlobalPoint:]):
670         (dropOperationForWebCoreDragOperation):
671         (-[WKContentView dragDataForDropSession:dragDestinationAction:]):
672         (-[WKContentView cleanUpDragSourceSessionState]):
673         (extractItemProvidersFromDragItems):
674         (extractItemProvidersFromDropSession):
675         (-[WKContentView _didConcludeEditDataInteraction:]):
676         (-[WKContentView _didPerformDataInteractionControllerOperation:]):
677         (-[WKContentView _transitionDragPreviewToImageIfNecessary:]):
678         (-[WKContentView _didChangeDataInteractionCaretRect:currentRect:]):
679         (-[WKContentView _dragDestinationActionForDropSession:]):
680         (positionInformationMayStartDataInteraction):
681         (-[WKContentView currentDragOrDropSession]):
682         (-[WKContentView _dragInteraction:prepareForSession:completion:]):
683         (-[WKContentView dragInteraction:itemsForBeginningSession:]):
684         (-[WKContentView _api_dragInteraction:previewForLiftingItem:session:]):
685         (-[WKContentView dragInteraction:sessionWillBegin:]):
686         (-[WKContentView _api_dragInteraction:session:didEndWithOperation:]):
687         (-[WKContentView dragInteraction:previewForCancellingItem:withDefault:]):
688         (-[WKContentView _api_dragInteraction:item:willAnimateCancelWithAnimator:]):
689         (-[WKContentView dropInteraction:canHandleSession:]):
690         (-[WKContentView _api_dropInteraction:sessionDidEnter:]):
691         (-[WKContentView _api_dropInteraction:sessionDidUpdate:]):
692         (-[WKContentView dropInteraction:sessionDidExit:]):
693         (-[WKContentView dropInteraction:performDrop:]):
694         (-[WKContentView dropInteraction:previewForDroppingItem:withDefault:]):
695         (-[WKContentView dropInteraction:sessionDidEnd:]):
696         (-[WKContentView _simulateDataInteractionEntered:]):
697         (-[WKContentView _simulateDataInteractionUpdated:]):
698         (-[WKContentView _simulateDataInteractionEnded:]):
699         (-[WKContentView _simulateDataInteractionPerformOperation:]):
700         (-[WKContentView _simulateDataInteractionSessionDidEnd:]):
701         (-[WKContentView _simulateWillBeginDataInteractionWithSession:]):
702         (-[WKContentView _simulatedItemsForSession:]):
703         (-[WKContentView _simulatePrepareForDataInteractionSession:completion:]):
704         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
705         (WebKit::convertCGImageToBitmap):
706         (WebKit::WebDragClient::startDrag):
707         (WebKit::WebDragClient::declareAndWriteDragImage):
708         (WebKit::WebDragClient::didConcludeEditDrag):
709         (WebKit::WebDragClient::declareAndWriteAttachment):
710
711 2017-06-16  Youenn Fablet  <youenn@apple.com>
712
713         WebRTC sockets should be closed at destruction time if not closed explicitly
714         https://bugs.webkit.org/show_bug.cgi?id=173479
715
716         Reviewed by Eric Carlson.
717
718         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
719         (WebKit::LibWebRTCSocket::~LibWebRTCSocket):
720         (WebKit::LibWebRTCSocket::Close):
721
722 2017-06-16  Chris Dumez  <cdumez@apple.com>
723
724         [WK2] Add WKProcessPool SPI to efficiently reset all plugin load client policies
725         https://bugs.webkit.org/show_bug.cgi?id=173472
726         <rdar://problem/28858817>
727
728         Reviewed by Brady Eidson.
729
730         Add WKProcessPool SPI to efficiently reset all plugin load client policies:
731         [WKProcessPool _resetPluginLoadClientPolicies]. This new SPI clears all
732         existing policies and then sets all of them with new values, with a
733         minimal amount of IPC.
734
735         To achieve this, clients would previously have to call
736         1. WKContextClearPluginClientPolicies() which would cause a broadcast IPC to
737            every WebContent process.
738         2. WKContextSetPluginLoadClientPolicy() repeatedly to add each policy one by
739            one. Each call to WKContextSetPluginLoadClientPolicy() would cause a broadcast
740            IPC to every WebContent process.
741
742         The new SPI does the same job with a single broadcast IPC to every WebContent
743         process.
744
745         * UIProcess/API/Cocoa/WKProcessPool.mm:
746         (isPluginLoadClientPolicyAcceptable):
747         (toPluginLoadClientPoliciesHashMap):
748         (policiesHashMapToDictionary):
749         (-[WKProcessPool _resetPluginLoadClientPolicies:]):
750         (-[WKProcessPool _pluginLoadClientPolicies]):
751         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
752         * UIProcess/WebProcessPool.cpp:
753         (WebKit::WebProcessPool::setPluginLoadClientPolicy):
754         (WebKit::WebProcessPool::resetPluginLoadClientPolicies):
755         * UIProcess/WebProcessPool.h:
756         * WebProcess/WebProcess.cpp:
757         (WebKit::WebProcess::initializeWebProcess):
758         (WebKit::WebProcess::resetPluginLoadClientPolicies):
759         * WebProcess/WebProcess.h:
760         * WebProcess/WebProcess.messages.in:
761
762 2017-06-16  Brent Fulgham  <bfulgham@apple.com>
763
764         [WK2][macOS] Expand sandbox to better support video playback on mac mini
765         https://bugs.webkit.org/show_bug.cgi?id=173492
766         <rdar://problem/32804073>
767
768         Reviewed by Alex Christensen.
769
770         Hardware differences in Mac Mini's require some different IOKit preferences to be accessible.
771
772         * WebProcess/com.apple.WebProcess.sb.in:
773
774 2017-06-16  Brent Fulgham  <bfulgham@apple.com>
775
776         [WK2][iOS][macOS] Extend the sandbox to allow reading of AVFoundation's VideoPerformanceHUD preference
777         https://bugs.webkit.org/show_bug.cgi?id=173476
778         <rdar://problem/31594568>
779
780         Reviewed by Alex Christensen.
781
782         Update the sandbox to permit WebContent process to read the AVFoundation preferences for the performance HUD.
783
784         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
785         * WebProcess/com.apple.WebProcess.sb.in:
786
787 2017-06-16  Daniel Bates  <dabates@apple.com>
788
789         Use the term icon instead of favicon
790         https://bugs.webkit.org/show_bug.cgi?id=173400
791
792         Reviewed by Alex Christensen.
793
794         * WebProcess/Network/WebLoaderStrategy.cpp:
795         (WebKit::maximumBufferingTime):
796
797 2017-06-16  Carlos Garcia Campos  <cgarcia@igalia.com>
798
799         [GTK][WPE] Remove WKCookieManagerSoup
800         https://bugs.webkit.org/show_bug.cgi?id=173467
801
802         Reviewed by Michael Catanzaro.
803
804         It's unused.
805
806         * PlatformGTK.cmake:
807         * PlatformWPE.cmake:
808         * UIProcess/API/C/soup/WKCookieManagerSoup.cpp: Removed.
809         * UIProcess/API/C/soup/WKCookieManagerSoup.h: Removed.
810
811 2017-06-16  Carlos Garcia Campos  <cgarcia@igalia.com>
812
813         Unreviewed. Remove wrong headers check from some GTK+ API files.
814
815         Remove the __WEBKIT_WEB_EXTENSION_H_INSIDE__ check since these are not actually shared.
816
817         * UIProcess/API/gtk/WebKitEditorState.h:
818         * UIProcess/API/gtk/WebKitOptionMenu.h:
819         * UIProcess/API/gtk/WebKitPrintCustomWidget.h:
820
821 2017-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
822
823         REGRESSION(r218325): [GTK] Runtime critical warnings running layout tests that show a popup menu
824         https://bugs.webkit.org/show_bug.cgi?id=173421
825
826         Reviewed by Carlos Alberto Lopez Perez.
827
828         In r218325 I forgot to create a WebKitPopupMenu or WebPopupMenuProxyGtk depending on whether the view is a
829         WebKitWebView or not.
830
831         * UIProcess/API/gtk/PageClientImpl.cpp:
832         (WebKit::PageClientImpl::createPopupMenuProxy):
833
834 2017-06-15  Tim Horton  <timothy_horton@apple.com>
835
836         Null deref under ViewGestureController::endSwipeGesture (navigationGestureDidEnd)
837         https://bugs.webkit.org/show_bug.cgi?id=173441
838         <rdar://problem/25876512>
839
840         Reviewed by Simon Fraser.
841
842         This is a speculative fix for a crash that we don't have repro steps for.
843
844         In a few places, ViewGestureController looks itself up by pageID (in cases
845         where we're in an asynchronous callback), and then calls some
846         function on it (endSwipeGesture, or something that will get there).
847         However, if in the meantime an API client has turned the swipe gesture
848         on and off, the page's ViewGestureController will be a different one
849         than the one that originally started this process, with fresh state,
850         and nullptrs in all sorts of places, ripe for dereferencing.
851
852         To fix this, instead of just looking ViewGestureController up by 
853         pageID, also keep track of the current gestureID, process-wide (previously
854         the gestureID was per-ViewGestureController), and only return the
855         ViewGestureController if it's currently processing the same gesture
856         that started the asynchronous task.
857
858         * UIProcess/Cocoa/ViewGestureController.cpp:
859         (WebKit::ViewGestureController::controllerForGesture):
860         (WebKit::ViewGestureController::takeNextGestureID):
861         (WebKit::ViewGestureController::willBeginGesture):
862         (WebKit::ViewGestureController::didEndGesture):
863         (WebKit::ViewGestureController::gestureControllerForPage): Deleted.
864         * UIProcess/Cocoa/ViewGestureController.h:
865         Add helpers that set and reset activeGestureType and currentGestureID together.
866         Make gesture IDs process global, to avoid two ViewGestureControllers using the same IDs.
867
868         * UIProcess/ios/ViewGestureControllerIOS.mm:
869         (WebKit::ViewGestureController::beginSwipeGesture):
870         (WebKit::ViewGestureController::endSwipeGesture):
871         (WebKit::ViewGestureController::removeSwipeSnapshot):
872         * UIProcess/mac/ViewGestureControllerMac.mm:
873         (WebKit::ViewGestureController::didCollectGeometryForMagnificationGesture):
874         (WebKit::ViewGestureController::handleMagnificationGestureEvent):
875         (WebKit::ViewGestureController::endMagnificationGesture):
876         (WebKit::ViewGestureController::beginSwipeGesture):
877         (WebKit::ViewGestureController::forceRepaintIfNeeded):
878         (WebKit::ViewGestureController::removeSwipeSnapshot):
879         Adopt willBeginGesture/didEndGesture and controllerForGesture.
880
881 2017-06-15  Simon Fraser  <simon.fraser@apple.com>
882
883         [iOS WK2] YouTube videos flash at the wrong place at the end of rotation
884         https://bugs.webkit.org/show_bug.cgi?id=173445
885         rdar://problem/31584852
886
887         Reviewed by Tim Horton.
888
889         In MobileSafari where WKWebView rotation uses _dynamicViewportUpdateModes, we could do a
890         visibleContentRect update at the end of rotation which computed a bad layoutViewportRect,
891         because it used a m_baseLayoutViewportSize from the old orientation.
892
893         We have actually sent a new m_baseLayoutViewportSize to the UI process by this point in 
894         a layer tree commit, but _didCommitLayerTree: ignored it because we had a _dynamicViewportUpdateMode.
895
896         Fix is to always update the layout viewport data from the web process, since during dynamic
897         viewport updates, we still need these data to compute rectangles sent back to the web process via
898         visible content rect updates.
899
900         * UIProcess/API/Cocoa/WKWebView.mm:
901         (-[WKWebView _didCommitLayerTree:]):
902         * UIProcess/ios/WebPageProxyIOS.mm:
903         (WebKit::WebPageProxy::computeCustomFixedPositionRect):
904         (WebKit::WebPageProxy::updateLayoutViewportParameters): Cleanup.
905
906 2017-06-15  Wenson Hsieh  <wenson_hsieh@apple.com>
907
908         Using -[WebItemProviderPasteboard setItemProviders:] to swap out item providers before a drop breaks item provider loading
909         https://bugs.webkit.org/show_bug.cgi?id=173338
910         <rdar://problem/32777720>
911
912         Reviewed by Tim Horton.
913
914         Rename updatePreferredTypeIdentifiers to updateSupportedTypeIdentifiers. Also, introduce
915         _webView:willPerformDropWithSession: as SPI on WKUIDelegate.
916
917         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
918         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
919         (WebKit::WebPasteboardProxy::updateSupportedTypeIdentifiers):
920         (WebKit::WebPasteboardProxy::updatePreferredTypeIdentifiers): Deleted.
921         * UIProcess/WebPasteboardProxy.h:
922         * UIProcess/WebPasteboardProxy.messages.in:
923         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
924         (WebKit::WebPlatformStrategies::updateSupportedTypeIdentifiers):
925         (WebKit::WebPlatformStrategies::updatePreferredTypeIdentifiers): Deleted.
926         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
927
928 2017-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
929
930         [GTK] Cleanup headers includes in GTK+ API files
931         https://bugs.webkit.org/show_bug.cgi?id=173415
932
933         Reviewed by Michael Catanzaro.
934
935         - Remove WTFGType.h from WebKitPrivate.h and include it in all other files instead of WebKitPrivate if needed.
936         - Stop including WebKitPrivate.h in all other private headers.
937         - Remove all C API includes.
938
939         * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp:
940         * UIProcess/API/gtk/WebKitAuthenticationRequest.cpp:
941         * UIProcess/API/gtk/WebKitAuthenticationRequestPrivate.h:
942         * UIProcess/API/gtk/WebKitAutomationSession.cpp:
943         * UIProcess/API/gtk/WebKitBackForwardList.cpp:
944         * UIProcess/API/gtk/WebKitBackForwardListItem.cpp:
945         * UIProcess/API/gtk/WebKitColorChooser.h:
946         * UIProcess/API/gtk/WebKitColorChooserRequest.cpp:
947         * UIProcess/API/gtk/WebKitContextMenu.cpp:
948         * UIProcess/API/gtk/WebKitContextMenuItem.cpp:
949         * UIProcess/API/gtk/WebKitContextMenuItemPrivate.h:
950         * UIProcess/API/gtk/WebKitContextMenuPrivate.h:
951         * UIProcess/API/gtk/WebKitCookieManager.cpp:
952         * UIProcess/API/gtk/WebKitCookieManagerPrivate.h:
953         * UIProcess/API/gtk/WebKitCredentialPrivate.h:
954         * UIProcess/API/gtk/WebKitDownload.cpp:
955         * UIProcess/API/gtk/WebKitDownloadClient.cpp:
956         * UIProcess/API/gtk/WebKitDownloadPrivate.h:
957         * UIProcess/API/gtk/WebKitEditorState.cpp:
958         * UIProcess/API/gtk/WebKitEditorStatePrivate.h:
959         * UIProcess/API/gtk/WebKitError.cpp:
960         * UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
961         * UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
962         * UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h:
963         * UIProcess/API/gtk/WebKitFindController.cpp:
964         * UIProcess/API/gtk/WebKitFormClient.cpp:
965         * UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp:
966         * UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h:
967         * UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp:
968         * UIProcess/API/gtk/WebKitGeolocationPermissionRequestPrivate.h:
969         * UIProcess/API/gtk/WebKitHitTestResult.cpp:
970         * UIProcess/API/gtk/WebKitHitTestResultPrivate.h:
971         * UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.cpp:
972         * UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequestPrivate.h:
973         * UIProcess/API/gtk/WebKitJavascriptResult.cpp:
974         * UIProcess/API/gtk/WebKitJavascriptResultPrivate.h:
975         * UIProcess/API/gtk/WebKitMimeInfoPrivate.h:
976         * UIProcess/API/gtk/WebKitNavigationActionPrivate.h:
977         * UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp:
978         * UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h:
979         * UIProcess/API/gtk/WebKitNetworkProxySettings.cpp:
980         * UIProcess/API/gtk/WebKitNetworkProxySettingsPrivate.h:
981         * UIProcess/API/gtk/WebKitNotification.cpp:
982         * UIProcess/API/gtk/WebKitNotificationPermissionRequest.cpp:
983         * UIProcess/API/gtk/WebKitNotificationPermissionRequestPrivate.h:
984         * UIProcess/API/gtk/WebKitNotificationPrivate.h:
985         * UIProcess/API/gtk/WebKitOptionMenu.cpp:
986         * UIProcess/API/gtk/WebKitPlugin.cpp:
987         * UIProcess/API/gtk/WebKitPluginPrivate.h:
988         * UIProcess/API/gtk/WebKitPolicyDecision.cpp:
989         * UIProcess/API/gtk/WebKitPolicyDecisionPrivate.h:
990         * UIProcess/API/gtk/WebKitPrintCustomWidget.cpp:
991         * UIProcess/API/gtk/WebKitPrintCustomWidgetPrivate.h:
992         * UIProcess/API/gtk/WebKitPrintOperation.cpp:
993         * UIProcess/API/gtk/WebKitPrivate.h:
994         * UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp:
995         * UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h:
996         * UIProcess/API/gtk/WebKitSecurityManager.cpp:
997         * UIProcess/API/gtk/WebKitSecurityOrigin.cpp:
998         * UIProcess/API/gtk/WebKitSecurityOriginPrivate.h:
999         * UIProcess/API/gtk/WebKitSettings.cpp:
1000         * UIProcess/API/gtk/WebKitUIClient.cpp:
1001         * UIProcess/API/gtk/WebKitURIRequest.cpp:
1002         * UIProcess/API/gtk/WebKitURIResponse.cpp:
1003         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
1004         * UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h:
1005         * UIProcess/API/gtk/WebKitUserContent.cpp:
1006         * UIProcess/API/gtk/WebKitUserContentManager.cpp:
1007         * UIProcess/API/gtk/WebKitUserMediaPermissionRequest.cpp:
1008         * UIProcess/API/gtk/WebKitUserMediaPermissionRequestPrivate.h:
1009         * UIProcess/API/gtk/WebKitWebContext.cpp:
1010         * UIProcess/API/gtk/WebKitWebContextPrivate.h:
1011         * UIProcess/API/gtk/WebKitWebInspector.cpp:
1012         * UIProcess/API/gtk/WebKitWebInspectorPrivate.h:
1013         * UIProcess/API/gtk/WebKitWebResource.cpp:
1014         * UIProcess/API/gtk/WebKitWebResourcePrivate.h:
1015         * UIProcess/API/gtk/WebKitWebView.cpp:
1016         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1017         * UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp:
1018         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
1019         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
1020         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
1021         * UIProcess/API/gtk/WebKitWebsiteDataManagerPrivate.h:
1022         * UIProcess/API/gtk/WebKitWebsiteDataPrivate.h:
1023         * UIProcess/API/gtk/WebKitWindowProperties.cpp:
1024         * UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h:
1025         * WebProcess/InjectedBundle/API/gtk/WebKitFrame.cpp:
1026         * WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp:
1027         * WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp:
1028         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
1029         * WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.cpp:
1030         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
1031
1032 2017-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1033
1034         [GTK] Do not use the C API in WebGtkExtensionManager
1035         https://bugs.webkit.org/show_bug.cgi?id=173408
1036
1037         Reviewed by Michael Catanzaro.
1038
1039         Use the C++ API instead.
1040
1041         * WebProcess/gtk/WebGtkExtensionManager.cpp:
1042         (WebKit::parseUserData):
1043         (WebKit::WebGtkExtensionManager::initialize):
1044         * WebProcess/gtk/WebGtkExtensionManager.h:
1045         * WebProcess/gtk/WebGtkInjectedBundleMain.cpp:
1046         (WKBundleInitialize):
1047
1048 2017-06-15  Adrian Perez de Castro  <aperez@igalia.com>
1049
1050         [GTK] Stop using GtkAction in WebPopupMenuProxyGtk
1051         https://bugs.webkit.org/show_bug.cgi?id=173417
1052
1053         Reviewed by Carlos Garcia Campos.
1054
1055         This gets rid of GtkAction in WebPopupMenuProxyGtk, which was deprecated in GTK+ 3.10
1056         and will not be available in GTK+ 4.0. Using GtkMenuItem directly makes populating
1057         long menus slightly faster, which can be noticeable in lower-end machines.
1058
1059         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
1060         (WebKit::WebPopupMenuProxyGtk::populatePopupMenu):
1061         (WebKit::WebPopupMenuProxyGtk::menuItemActivated):
1062         (WebKit::WebPopupMenuProxyGtk::createGtkActionForMenuItem): Deleted.
1063         * UIProcess/gtk/WebPopupMenuProxyGtk.h:
1064         (WebKit::WebPopupMenuProxyGtk::setCurrentlySelectedMenuItem):
1065         Instantiate GtkMenuItem objects directly when populating the menu.
1066
1067 2017-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1068
1069         Unreviewed. Fix copy-paste error in GTK+ WEBKIT_JAVASCRIPT_ERROR definition.
1070
1071         The print one was copied there.
1072
1073         * UIProcess/API/gtk/WebKitError.h:
1074
1075 2017-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1076
1077         [GTK] Add API to allow overriding popup menus
1078         https://bugs.webkit.org/show_bug.cgi?id=172905
1079
1080         Reviewed by Michael Catanzaro.
1081
1082         The GTK+ API uses GTK+ for the default implementation of several UI elements like the file chooser, print dialog,
1083         color picker, context menu, etc. but in all those cases it allows to override the default implementation. It's
1084         not possible to override the popup menu used for select elements. This patch adds WebKitOptionMenu to represent
1085         a select dropdown menu. It's passed as an argument of the new signal WebKitWebView::show-option-menu, and
1086         contains WebKitOptionMenuItem elements representing the items to be displayed.
1087
1088         * PlatformGTK.cmake:
1089         * UIProcess/API/gtk/PageClientImpl.cpp:
1090         (WebKit::PageClientImpl::createPopupMenuProxy): Create a WebKitPopupMenu.
1091         * UIProcess/API/gtk/WebKitOptionMenu.cpp: Added.
1092         (webkitOptionMenuCreate):
1093         (webkit_option_menu_get_n_items):
1094         (webkit_option_menu_get_item):
1095         (webkit_option_menu_select_item):
1096         (webkit_option_menu_activate_item):
1097         (webkit_option_menu_close):
1098         * UIProcess/API/gtk/WebKitOptionMenu.h: Added.
1099         * UIProcess/API/gtk/WebKitOptionMenuItem.cpp: Added.
1100         (webkit_option_menu_item_copy):
1101         (webkit_option_menu_item_free):
1102         (webkit_option_menu_item_get_label):
1103         (webkit_option_menu_item_get_tooltip):
1104         (webkit_option_menu_item_is_group_label):
1105         (webkit_option_menu_item_is_group_child):
1106         (webkit_option_menu_item_is_enabled):
1107         (webkit_option_menu_item_is_selected):
1108         * UIProcess/API/gtk/WebKitOptionMenuItem.h: Added.
1109         * UIProcess/API/gtk/WebKitOptionMenuItemPrivate.h: Added.
1110         (_WebKitOptionMenuItem::_WebKitOptionMenuItem):
1111         * UIProcess/API/gtk/WebKitOptionMenuPrivate.h: Added.
1112         * UIProcess/API/gtk/WebKitPopupMenu.cpp: Added.
1113         (WebKit::WebKitPopupMenu::WebKitPopupMenu):
1114         (WebKit::menuCloseCallback):
1115         (WebKit::WebKitPopupMenu::showPopupMenu): Call webkitWebViewShowOptionMenu() falling back to default
1116         implementation if the user didn't handle the signal.
1117         (WebKit::WebKitPopupMenu::hidePopupMenu):
1118         (WebKit::WebKitPopupMenu::cancelTracking):
1119         (WebKit::WebKitPopupMenu::selectItem):
1120         (WebKit::WebKitPopupMenu::activateItem):
1121         * UIProcess/API/gtk/WebKitPopupMenu.h: Added.
1122         * UIProcess/API/gtk/WebKitWebView.cpp:
1123         (webkit_web_view_class_init):
1124         (webkitWebViewShowOptionMenu): Emit WebKitWebView::show-option-menu.
1125         * UIProcess/API/gtk/WebKitWebView.h:
1126         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
1127         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
1128         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types: Add new get_type functions.
1129         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new sections.
1130         * UIProcess/API/gtk/webkit2.h: Add new public headers.
1131         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
1132         (WebKit::WebPopupMenuProxyGtk::WebPopupMenuProxyGtk): Do not create the GtkMenu in constructor.
1133         (WebKit::WebPopupMenuProxyGtk::showPopupMenu): Create the GtkMenu and connect to the signals here.
1134         (WebKit::WebPopupMenuProxyGtk::hidePopupMenu): Return early if the Gtk hasn't been shown.
1135         * UIProcess/gtk/WebPopupMenuProxyGtk.h: Make constructor and webview protected.
1136
1137 2017-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1138
1139         [GTK] Use API::InjectedBundle::ResourceLoadClient in WebKitWebPage
1140         https://bugs.webkit.org/show_bug.cgi?id=173364
1141
1142         Reviewed by Michael Catanzaro.
1143
1144         Instead of the C API.
1145
1146         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
1147         (webkitWebPageCreate):
1148         (didInitiateLoadForResource): Deleted.
1149         (willSendRequestForFrame): Deleted.
1150         (didReceiveResponseForResource): Deleted.
1151         (didReceiveContentLengthForResource): Deleted.
1152         (didFinishLoadForResource): Deleted.
1153         (didFailLoadForResource): Deleted.
1154
1155 2017-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1156
1157         [GTK] Use API::InjectedBundle::Client in WebKitWebExtension
1158         https://bugs.webkit.org/show_bug.cgi?id=173358
1159
1160         Reviewed by Michael Catanzaro.
1161
1162         Instead of the C API.
1163
1164         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
1165         (webkitWebExtensionCreate):
1166         (webkitWebExtensionPageCreated): Deleted.
1167         (webkitWebExtensionPageDestroy): Deleted.
1168         (webkitWebExtensionDidReceiveMessage): Deleted.
1169         (didCreatePage): Deleted.
1170         (willDestroyPage): Deleted.
1171         (didReceiveMessage): Deleted.
1172         (didReceiveMessageToPage): Deleted.
1173
1174 2017-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1175
1176         [GTK] Use API::NotificationProvider
1177         https://bugs.webkit.org/show_bug.cgi?id=173312
1178
1179         Reviewed by Žan Doberšek.
1180
1181         Also cleanup a bit the WebKitNotificationProvider implementation, it doesn't need to be refcounted.
1182
1183         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
1184         (WebKitNotificationProvider::WebKitNotificationProvider):
1185         (WebKitNotificationProvider::~WebKitNotificationProvider):
1186         (WebKitNotificationProvider::show):
1187         (WebKitNotificationProvider::clearNotifications):
1188         (WebKitNotificationProvider::notificationPermissions):
1189         (WebKitNotificationProvider::setNotificationPermissions):
1190         * UIProcess/API/gtk/WebKitNotificationProvider.h:
1191         * UIProcess/API/gtk/WebKitWebContext.cpp:
1192         (webkitWebContextConstructed):
1193         (addOriginToMap):
1194         (webkit_web_context_initialize_notification_permissions):
1195
1196 2017-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1197
1198         Add API::InjectedBundle::ResourceLoadClient
1199         https://bugs.webkit.org/show_bug.cgi?id=173362
1200
1201         Reviewed by Alex Christensen.
1202
1203         It will be used by the GTK+ port instead of the C API.
1204
1205         * WebKit2.xcodeproj/project.pbxproj:
1206         * WebProcess/InjectedBundle/API/APIInjectedBundlePageResourceLoadClient.h: Copied from Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h.
1207         (API::InjectedBundle::ResourceLoadClient::didInitiateLoadForResource):
1208         (API::InjectedBundle::ResourceLoadClient::willSendRequestForFrame):
1209         (API::InjectedBundle::ResourceLoadClient::didReceiveResponseForResource):
1210         (API::InjectedBundle::ResourceLoadClient::didReceiveContentLengthForResource):
1211         (API::InjectedBundle::ResourceLoadClient::didFinishLoadForResource):
1212         (API::InjectedBundle::ResourceLoadClient::didFailLoadForResource):
1213         (API::InjectedBundle::ResourceLoadClient::shouldCacheResponse):
1214         (API::InjectedBundle::ResourceLoadClient::shouldUseCredentialStorage):
1215         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1216         (WKBundlePageSetResourceLoadClient):
1217         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1218         (setUpResourceLoadClient):
1219         (-[WKWebProcessPlugInBrowserContextController setLoadDelegate:]):
1220         * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp:
1221         (WebKit::InjectedBundlePageResourceLoadClient::InjectedBundlePageResourceLoadClient):
1222         (WebKit::InjectedBundlePageResourceLoadClient::didInitiateLoadForResource):
1223         (WebKit::InjectedBundlePageResourceLoadClient::willSendRequestForFrame):
1224         (WebKit::InjectedBundlePageResourceLoadClient::didReceiveResponseForResource):
1225         (WebKit::InjectedBundlePageResourceLoadClient::didReceiveContentLengthForResource):
1226         (WebKit::InjectedBundlePageResourceLoadClient::didFinishLoadForResource):
1227         (WebKit::InjectedBundlePageResourceLoadClient::didFailLoadForResource):
1228         (WebKit::InjectedBundlePageResourceLoadClient::shouldCacheResponse):
1229         (WebKit::InjectedBundlePageResourceLoadClient::shouldUseCredentialStorage):
1230         * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h:
1231         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1232         (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest):
1233         (WebKit::WebFrameLoaderClient::dispatchWillSendRequest):
1234         (WebKit::WebFrameLoaderClient::shouldUseCredentialStorage):
1235         (WebKit::WebFrameLoaderClient::dispatchDidReceiveResponse):
1236         (WebKit::WebFrameLoaderClient::dispatchDidReceiveContentLength):
1237         (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading):
1238         (WebKit::WebFrameLoaderClient::dispatchDidFailLoading):
1239         (WebKit::WebFrameLoaderClient::willCacheResponse):
1240         * WebProcess/WebPage/WebPage.cpp:
1241         (WebKit::WebPage::setInjectedBundleResourceLoadClient):
1242         (WebKit::WebPage::close):
1243         * WebProcess/WebPage/WebPage.h:
1244         (WebKit::WebPage::injectedBundleResourceLoadClient):
1245
1246 2017-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1247
1248         Add API::InjectedBundle::Client
1249         https://bugs.webkit.org/show_bug.cgi?id=173357
1250
1251         Reviewed by Alex Christensen.
1252
1253         It will be used by the GTK+ port instead of the C API.
1254
1255         * WebKit2.xcodeproj/project.pbxproj:
1256         * WebProcess/InjectedBundle/API/APIInjectedBundleBundleClient.h: Copied from Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.h.
1257         (API::InjectedBundle::Client::didCreatePage):
1258         (API::InjectedBundle::Client::willDestroyPage):
1259         (API::InjectedBundle::Client::didInitializePageGroup):
1260         (API::InjectedBundle::Client::didReceiveMessage):
1261         (API::InjectedBundle::Client::didReceiveMessageToPage):
1262         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1263         (WKBundleSetClient):
1264         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
1265         (webkitWebExtensionPageCreated): Deleted.
1266         (webkitWebExtensionPageDestroy): Deleted.
1267         (webkitWebExtensionDidReceiveMessage): Deleted.
1268         (didCreatePage): Deleted.
1269         (willDestroyPage): Deleted.
1270         (didReceiveMessage): Deleted.
1271         (didReceiveMessageToPage): Deleted.
1272         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1273         (WebKit::InjectedBundle::setClient):
1274         (WebKit::InjectedBundle::didCreatePage):
1275         (WebKit::InjectedBundle::willDestroyPage):
1276         (WebKit::InjectedBundle::didInitializePageGroup):
1277         (WebKit::InjectedBundle::didReceiveMessage):
1278         (WebKit::InjectedBundle::didReceiveMessageToPage):
1279         * WebProcess/InjectedBundle/InjectedBundle.h:
1280         * WebProcess/InjectedBundle/InjectedBundleClient.cpp:
1281         (WebKit::InjectedBundleClient::InjectedBundleClient):
1282         (WebKit::InjectedBundleClient::didCreatePage):
1283         (WebKit::InjectedBundleClient::willDestroyPage):
1284         (WebKit::InjectedBundleClient::didInitializePageGroup):
1285         (WebKit::InjectedBundleClient::didReceiveMessage):
1286         (WebKit::InjectedBundleClient::didReceiveMessageToPage):
1287         * WebProcess/InjectedBundle/InjectedBundleClient.h:
1288
1289 2017-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1290
1291         WKErrorGetErrorCode should not return the API::Error enum values directly
1292         https://bugs.webkit.org/show_bug.cgi?id=173367
1293
1294         Reviewed by Alex Christensen.
1295
1296         Even if the values are the same, we should use a switch to ensure we return the C API values, and not all
1297         API::Error enum values are exposed in the C API.
1298
1299         * Shared/API/c/WKErrorRef.cpp:
1300         (WKErrorGetErrorCode):
1301
1302 2017-06-14  Commit Queue  <commit-queue@webkit.org>
1303
1304         Unreviewed, rolling out r218285.
1305         https://bugs.webkit.org/show_bug.cgi?id=173391
1306
1307         API test fails on iOS (Requested by alexchristensen on
1308         #webkit).
1309
1310         Reverted changeset:
1311
1312         "Add SPI for immediate injection of user scripts"
1313         https://bugs.webkit.org/show_bug.cgi?id=173342
1314         http://trac.webkit.org/changeset/218285
1315
1316 2017-06-14  Commit Queue  <commit-queue@webkit.org>
1317
1318         Unreviewed, rolling out r218267.
1319         https://bugs.webkit.org/show_bug.cgi?id=173390
1320
1321         "The previous rollout of r218263, r218265, and r218266 by
1322         mlewis13 on bug 173383 missed r218267 and broke the GTK+
1323         build" (Requested by clopez_ on #webkit).
1324
1325         Reverted changeset:
1326
1327         "[GTK] Use API::InjectedBundle::ResourceLoadClient in
1328         WebKitWebPage"
1329         https://bugs.webkit.org/show_bug.cgi?id=173364
1330         http://trac.webkit.org/changeset/218267
1331
1332 2017-06-14  Chris Dumez  <cdumez@apple.com>
1333
1334         WebKit falsely reports that a web process is unresponsive if you close a page shortly after stopping a load
1335         https://bugs.webkit.org/show_bug.cgi?id=173384
1336         <rdar://problem/32723779>
1337
1338         Reviewed by Dan Bernstein.
1339
1340         WebKit falsely reports that a web process is unresponsive if you close a page shortly after stopping a load.
1341         This is because WebPageProxy::stopLoad() starts the responsiveness timer and expects a StopResponsinessTimer
1342         IPC from the WebProcess to stop the timer so we don't report the process as unresponsive. However, if
1343         WebPageProxy::close() is called before the StopResponsinessTimer IPC has been received, the page will remove
1344         itself from the message receiver map and we would no longer be able to receive the StopResponsinessTimer
1345         IPC and stop the timer, even if the WebProcess sent it to the UIProcess.
1346
1347         To address the issue, we now send the IPC Message to the WebProcessProxy instead of the WebPageProxy, so we
1348         can stop the responsiveness timer, even after the WebPageProxy has been called.
1349
1350         * UIProcess/WebPageProxy.cpp:
1351         * UIProcess/WebPageProxy.h:
1352         * UIProcess/WebPageProxy.messages.in:
1353         * UIProcess/WebProcessProxy.cpp:
1354         (WebKit::WebProcessProxy::stopResponsivenessTimer):
1355         * UIProcess/WebProcessProxy.h:
1356         * UIProcess/WebProcessProxy.messages.in:
1357         * WebProcess/WebPage/WebPage.cpp:
1358         (WebKit::SendStopResponsivenessTimer::~SendStopResponsivenessTimer):
1359         (WebKit::WebPage::tryClose):
1360         (WebKit::WebPage::loadRequest):
1361         (WebKit::WebPage::loadDataImpl):
1362         (WebKit::WebPage::stopLoading):
1363         (WebKit::WebPage::reload):
1364         (WebKit::WebPage::goForward):
1365         (WebKit::WebPage::goBack):
1366         (WebKit::WebPage::goToBackForwardItem):
1367
1368 2017-06-14  Commit Queue  <commit-queue@webkit.org>
1369
1370         Unreviewed, rolling out r218263, r218265, and r218266.
1371         https://bugs.webkit.org/show_bug.cgi?id=173383
1372
1373         "These revisions caused multiple API test to Time out on
1374         macOS" (Requested by mlewis13 on #webkit).
1375
1376         Reverted changesets:
1377
1378         "Add API::InjectedBundle::Client"
1379         https://bugs.webkit.org/show_bug.cgi?id=173357
1380         http://trac.webkit.org/changeset/218263
1381
1382         "[GTK] Use API::InjectedBundle::Client in WebKitWebExtension"
1383         https://bugs.webkit.org/show_bug.cgi?id=173358
1384         http://trac.webkit.org/changeset/218265
1385
1386         "Add API::InjectedBundle::ResourceLoadClient"
1387         https://bugs.webkit.org/show_bug.cgi?id=173362
1388         http://trac.webkit.org/changeset/218266
1389
1390 2017-06-14  Brent Fulgham  <bfulgham@apple.com>
1391
1392         [WK2][iOS] Remove dead-code "import "removed-dev-nodes.sb” from sandboxes (173378)
1393         https://bugs.webkit.org/show_bug.cgi?id=173378
1394         <rdar://problem/32773230>
1395
1396         Reviewed by Alexey Proskuryakov.
1397
1398         Clean up the sandboxes to remove a couple of dead functions (and imports):
1399         1. Remove the import "removed-dev-nodes.sb" from the sandbox, since this file is now empty.
1400         2. Also remove the call to "instruments-support" as this is a no-op function in modern iOS.
1401
1402         * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb:
1403         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1404         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1405
1406 2017-06-14  Alex Christensen  <achristensen@webkit.org>
1407
1408         Add SPI for immediate injection of user scripts
1409         https://bugs.webkit.org/show_bug.cgi?id=173342
1410         <rdar://problem/29202285>
1411
1412         Reviewed by Brady Eidson.
1413
1414         * UIProcess/API/C/WKPageGroup.cpp:
1415         (WKPageGroupAddUserScript):
1416         * UIProcess/API/C/WKUserContentControllerRef.cpp:
1417         (WKUserContentControllerAddUserScript):
1418         * UIProcess/API/Cocoa/WKUserContentController.mm:
1419         (-[WKUserContentController addUserScript:]):
1420         (-[WKUserContentController _addUserScriptImmediately:]):
1421         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
1422         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
1423         (WebKit::WebUserContentControllerProxy::addUserScript):
1424         * UIProcess/UserContent/WebUserContentControllerProxy.h:
1425         * WebProcess/UserContent/WebUserContentController.cpp:
1426         (WebKit::WebUserContentController::addUserScripts):
1427         (WebKit::WebUserContentController::addUserScriptInternal):
1428         If we are to inject the script internally, inject it into the appropriate pages.
1429         If we're injecting into the top frame only, there's no need to traverse the frame tree.
1430         (WebKit::WebUserContentController::addUserScript):
1431         * WebProcess/UserContent/WebUserContentController.h:
1432         * WebProcess/UserContent/WebUserContentController.messages.in:
1433         * WebProcess/WebPage/WebPage.cpp:
1434         (WebKit::m_cpuLimit):
1435
1436 2017-06-14  Jonathan Bedard  <jbedard@apple.com>
1437
1438         Configure screen scale for running layout tests on plus devices
1439         https://bugs.webkit.org/show_bug.cgi?id=173319
1440
1441         Reviewed by Tim Horton.
1442
1443         * Platform/spi/ios/UIKitSPI.h: Both this and UIKitTestSPI.h define UIKeyboard. Use
1444         a define guard to prevent re-definition.
1445
1446 2017-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1447
1448         [GTK] Use API::InjectedBundle::ResourceLoadClient in WebKitWebPage
1449         https://bugs.webkit.org/show_bug.cgi?id=173364
1450
1451         Reviewed by Michael Catanzaro.
1452
1453         Instead of the C API.
1454
1455         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
1456         (webkitWebPageCreate):
1457         (didInitiateLoadForResource): Deleted.
1458         (willSendRequestForFrame): Deleted.
1459         (didReceiveResponseForResource): Deleted.
1460         (didReceiveContentLengthForResource): Deleted.
1461         (didFinishLoadForResource): Deleted.
1462         (didFailLoadForResource): Deleted.
1463
1464 2017-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1465
1466         Add API::InjectedBundle::ResourceLoadClient
1467         https://bugs.webkit.org/show_bug.cgi?id=173362
1468
1469         Reviewed by Alex Christensen.
1470
1471         It will be used by the GTK+ port instead of the C API.
1472
1473         * WebKit2.xcodeproj/project.pbxproj:
1474         * WebProcess/InjectedBundle/API/APIInjectedBundlePageResourceLoadClient.h: Copied from Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h.
1475         (API::InjectedBundle::ResourceLoadClient::didInitiateLoadForResource):
1476         (API::InjectedBundle::ResourceLoadClient::willSendRequestForFrame):
1477         (API::InjectedBundle::ResourceLoadClient::didReceiveResponseForResource):
1478         (API::InjectedBundle::ResourceLoadClient::didReceiveContentLengthForResource):
1479         (API::InjectedBundle::ResourceLoadClient::didFinishLoadForResource):
1480         (API::InjectedBundle::ResourceLoadClient::didFailLoadForResource):
1481         (API::InjectedBundle::ResourceLoadClient::shouldCacheResponse):
1482         (API::InjectedBundle::ResourceLoadClient::shouldUseCredentialStorage):
1483         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1484         (WKBundlePageSetResourceLoadClient):
1485         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1486         (setUpResourceLoadClient):
1487         (-[WKWebProcessPlugInBrowserContextController setLoadDelegate:]):
1488         * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp:
1489         (WebKit::InjectedBundlePageResourceLoadClient::InjectedBundlePageResourceLoadClient):
1490         (WebKit::InjectedBundlePageResourceLoadClient::didInitiateLoadForResource):
1491         (WebKit::InjectedBundlePageResourceLoadClient::willSendRequestForFrame):
1492         (WebKit::InjectedBundlePageResourceLoadClient::didReceiveResponseForResource):
1493         (WebKit::InjectedBundlePageResourceLoadClient::didReceiveContentLengthForResource):
1494         (WebKit::InjectedBundlePageResourceLoadClient::didFinishLoadForResource):
1495         (WebKit::InjectedBundlePageResourceLoadClient::didFailLoadForResource):
1496         (WebKit::InjectedBundlePageResourceLoadClient::shouldCacheResponse):
1497         (WebKit::InjectedBundlePageResourceLoadClient::shouldUseCredentialStorage):
1498         * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h:
1499         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1500         (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest):
1501         (WebKit::WebFrameLoaderClient::dispatchWillSendRequest):
1502         (WebKit::WebFrameLoaderClient::shouldUseCredentialStorage):
1503         (WebKit::WebFrameLoaderClient::dispatchDidReceiveResponse):
1504         (WebKit::WebFrameLoaderClient::dispatchDidReceiveContentLength):
1505         (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading):
1506         (WebKit::WebFrameLoaderClient::dispatchDidFailLoading):
1507         (WebKit::WebFrameLoaderClient::willCacheResponse):
1508         * WebProcess/WebPage/WebPage.cpp:
1509         (WebKit::WebPage::setInjectedBundleResourceLoadClient):
1510         (WebKit::WebPage::close):
1511         * WebProcess/WebPage/WebPage.h:
1512         (WebKit::WebPage::injectedBundleResourceLoadClient):
1513
1514 2017-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1515
1516         [GTK] Use API::InjectedBundle::Client in WebKitWebExtension
1517         https://bugs.webkit.org/show_bug.cgi?id=173358
1518
1519         Reviewed by Michael Catanzaro.
1520
1521         Instead of the C API.
1522
1523         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
1524         (webkitWebExtensionCreate):
1525         (webkitWebExtensionPageCreated): Deleted.
1526         (webkitWebExtensionPageDestroy): Deleted.
1527         (webkitWebExtensionDidReceiveMessage): Deleted.
1528         (didCreatePage): Deleted.
1529         (willDestroyPage): Deleted.
1530         (didReceiveMessage): Deleted.
1531         (didReceiveMessageToPage): Deleted.
1532
1533 2017-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1534
1535         Add API::InjectedBundle::Client
1536         https://bugs.webkit.org/show_bug.cgi?id=173357
1537
1538         Reviewed by Alex Christensen.
1539
1540         It will be used by the GTK+ port instead of the C API.
1541
1542         * WebKit2.xcodeproj/project.pbxproj:
1543         * WebProcess/InjectedBundle/API/APIInjectedBundleBundleClient.h: Copied from Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.h.
1544         (API::InjectedBundle::Client::didCreatePage):
1545         (API::InjectedBundle::Client::willDestroyPage):
1546         (API::InjectedBundle::Client::didInitializePageGroup):
1547         (API::InjectedBundle::Client::didReceiveMessage):
1548         (API::InjectedBundle::Client::didReceiveMessageToPage):
1549         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1550         (WKBundleSetClient):
1551         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
1552         (webkitWebExtensionPageCreated): Deleted.
1553         (webkitWebExtensionPageDestroy): Deleted.
1554         (webkitWebExtensionDidReceiveMessage): Deleted.
1555         (didCreatePage): Deleted.
1556         (willDestroyPage): Deleted.
1557         (didReceiveMessage): Deleted.
1558         (didReceiveMessageToPage): Deleted.
1559         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1560         (WebKit::InjectedBundle::setClient):
1561         (WebKit::InjectedBundle::didCreatePage):
1562         (WebKit::InjectedBundle::willDestroyPage):
1563         (WebKit::InjectedBundle::didInitializePageGroup):
1564         (WebKit::InjectedBundle::didReceiveMessage):
1565         (WebKit::InjectedBundle::didReceiveMessageToPage):
1566         * WebProcess/InjectedBundle/InjectedBundle.h:
1567         * WebProcess/InjectedBundle/InjectedBundleClient.cpp:
1568         (WebKit::InjectedBundleClient::InjectedBundleClient):
1569         (WebKit::InjectedBundleClient::didCreatePage):
1570         (WebKit::InjectedBundleClient::willDestroyPage):
1571         (WebKit::InjectedBundleClient::didInitializePageGroup):
1572         (WebKit::InjectedBundleClient::didReceiveMessage):
1573         (WebKit::InjectedBundleClient::didReceiveMessageToPage):
1574         * WebProcess/InjectedBundle/InjectedBundleClient.h:
1575
1576 2017-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1577
1578         [GTK] Use API::InjectedBundleClient in WebKitInjectedBundleClient
1579         https://bugs.webkit.org/show_bug.cgi?id=173351
1580
1581         Reviewed by Michael Catanzaro.
1582
1583         Instead of the C API.
1584
1585         * UIProcess/API/gtk/WebKitInjectedBundleClient.cpp:
1586         (attachInjectedBundleClientToContext):
1587         (didReceiveWebViewMessageFromInjectedBundle): Deleted.
1588         (didReceiveMessageFromInjectedBundle): Deleted.
1589         (getInjectedBundleInitializationUserData): Deleted.
1590
1591 2017-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1592
1593         Add API::InjectedBundleClient
1594         https://bugs.webkit.org/show_bug.cgi?id=173350
1595
1596         Reviewed by Alex Christensen.
1597
1598         It will be used by the GTK+ port instead of the C API.
1599
1600         * UIProcess/API/APIInjectedBundleClient.h: Copied from Source/WebKit2/UIProcess/WebContextInjectedBundleClient.h.
1601         (API::InjectedBundleClient::didReceiveMessageFromInjectedBundle):
1602         (API::InjectedBundleClient::didReceiveSynchronousMessageFromInjectedBundle):
1603         (API::InjectedBundleClient::getInjectedBundleInitializationUserData):
1604         * UIProcess/API/C/WKContext.cpp:
1605         (WKContextSetInjectedBundleClient):
1606         * UIProcess/API/gtk/WebKitWebContext.cpp:
1607         (webkitWebContextDispose):
1608         * UIProcess/WebContextInjectedBundleClient.cpp:
1609         (WebKit::WebContextInjectedBundleClient::WebContextInjectedBundleClient):
1610         (WebKit::WebContextInjectedBundleClient::didReceiveMessageFromInjectedBundle):
1611         (WebKit::WebContextInjectedBundleClient::didReceiveSynchronousMessageFromInjectedBundle):
1612         (WebKit::WebContextInjectedBundleClient::getInjectedBundleInitializationUserData):
1613         * UIProcess/WebContextInjectedBundleClient.h:
1614         * UIProcess/WebProcessPool.cpp:
1615         (WebKit::WebProcessPool::WebProcessPool):
1616         (WebKit::WebProcessPool::setInjectedBundleClient):
1617         (WebKit::WebProcessPool::createNewWebProcess):
1618         (WebKit::WebProcessPool::handleMessage):
1619         (WebKit::WebProcessPool::handleSynchronousMessage):
1620         * UIProcess/WebProcessPool.h:
1621         * WebKit2.xcodeproj/project.pbxproj:
1622
1623 2017-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1624
1625         Add API::NotificationProvider
1626         https://bugs.webkit.org/show_bug.cgi?id=173309
1627
1628         Reviewed by Alex Christensen.
1629
1630         It will be used by the GTK+ port instead of the C API.
1631
1632         * UIProcess/API/APINotificationProvider.h: Copied from Source/WebKit2/UIProcess/Notifications/WebNotificationProvider.h.
1633         (API::NotificationProvider::show):
1634         (API::NotificationProvider::cancel):
1635         (API::NotificationProvider::didDestroyNotification):
1636         (API::NotificationProvider::clearNotifications):
1637         (API::NotificationProvider::addNotificationManager):
1638         (API::NotificationProvider::removeNotificationManager):
1639         (API::NotificationProvider::notificationPermissions):
1640         * UIProcess/API/C/WKNotificationManager.cpp:
1641         (WKNotificationManagerSetProvider):
1642         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
1643         (WebKit::WebNotificationManagerProxy::WebNotificationManagerProxy):
1644         (WebKit::WebNotificationManagerProxy::setProvider):
1645         (WebKit::WebNotificationManagerProxy::processPoolDestroyed):
1646         (WebKit::WebNotificationManagerProxy::notificationPermissions):
1647         (WebKit::WebNotificationManagerProxy::show):
1648         (WebKit::WebNotificationManagerProxy::cancel):
1649         (WebKit::WebNotificationManagerProxy::didDestroyNotification):
1650         (WebKit::WebNotificationManagerProxy::clearNotifications):
1651         * UIProcess/Notifications/WebNotificationManagerProxy.h:
1652         * UIProcess/Notifications/WebNotificationProvider.cpp:
1653         (WebKit::WebNotificationProvider::WebNotificationProvider):
1654         (WebKit::WebNotificationProvider::show):
1655         (WebKit::WebNotificationProvider::cancel):
1656         (WebKit::WebNotificationProvider::didDestroyNotification):
1657         (WebKit::WebNotificationProvider::addNotificationManager):
1658         (WebKit::WebNotificationProvider::removeNotificationManager):
1659         (WebKit::WebNotificationProvider::notificationPermissions):
1660         * UIProcess/Notifications/WebNotificationProvider.h:
1661         * UIProcess/WebProcessPool.cpp:
1662         (WebKit::WebProcessPool::createNewWebProcess):
1663         * WebKit2.xcodeproj/project.pbxproj:
1664
1665 2017-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1666
1667         API clients should not be passed by value to the setters
1668         https://bugs.webkit.org/show_bug.cgi?id=173266
1669
1670         Reviewed by Alex Christensen.
1671
1672         By using a rvalue reference we make it more explicit that the ownership is transferred and we avoid the
1673         parameter construction.
1674
1675         * UIProcess/Automation/WebAutomationSession.cpp:
1676         (WebKit::WebAutomationSession::setClient):
1677         * UIProcess/Automation/WebAutomationSession.h:
1678         * UIProcess/WebGeolocationManagerProxy.cpp:
1679         (WebKit::WebGeolocationManagerProxy::setProvider):
1680         * UIProcess/WebGeolocationManagerProxy.h:
1681         * UIProcess/WebIconDatabase.cpp:
1682         (WebKit::WebIconDatabase::setClient):
1683         * UIProcess/WebIconDatabase.h:
1684         * UIProcess/WebPageProxy.cpp:
1685         (WebKit::WebPageProxy::WebPageProxy):
1686         (WebKit::WebPageProxy::setHistoryClient):
1687         (WebKit::WebPageProxy::setNavigationClient):
1688         (WebKit::WebPageProxy::setLoaderClient):
1689         (WebKit::WebPageProxy::setPolicyClient):
1690         (WebKit::WebPageProxy::setFormClient):
1691         (WebKit::WebPageProxy::setUIClient):
1692         (WebKit::WebPageProxy::setIconLoadingClient):
1693         (WebKit::WebPageProxy::setFindClient):
1694         (WebKit::WebPageProxy::setFindMatchesClient):
1695         (WebKit::WebPageProxy::setDiagnosticLoggingClient):
1696         (WebKit::WebPageProxy::setContextMenuClient):
1697         (WebKit::WebPageProxy::close):
1698         (WebKit::WebPageProxy::setFullscreenClient):
1699         (WebKit::WebPageProxy::getLoadDecisionForIcon):
1700         * UIProcess/WebPageProxy.h:
1701         * UIProcess/WebProcessPool.cpp:
1702         (WebKit::WebProcessPool::setHistoryClient):
1703         (WebKit::WebProcessPool::setDownloadClient):
1704         (WebKit::WebProcessPool::setAutomationClient):
1705         * UIProcess/WebProcessPool.h:
1706         * WebProcess/WebPage/WebPage.cpp:
1707         (WebKit::WebPage::setInjectedBundleContextMenuClient):
1708         (WebKit::WebPage::setInjectedBundleEditorClient):
1709         (WebKit::WebPage::setInjectedBundleFormClient):
1710         (WebKit::WebPage::setInjectedBundlePageLoaderClient):
1711         (WebKit::WebPage::setInjectedBundleUIClient):
1712         * WebProcess/WebPage/WebPage.h:
1713
1714 2017-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1715
1716         [GTK] Use API::InjectedBundle::EditorClient in WebKitWebEditor
1717         https://bugs.webkit.org/show_bug.cgi?id=173355
1718
1719         Reviewed by Žan Doberšek.
1720
1721         Instead of the C API.
1722
1723         * WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp:
1724         (webkitWebEditorCreate):
1725         (didChangeSelection): Deleted.
1726
1727 2017-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1728
1729         Unreviewed. Fix GTK+ build with GCC 4.9 after r218244.
1730
1731         It seems that GCC 4.9 gets confused by enum named General and value of Print enum named General too. This
1732         renames the Print enum value as Generic.
1733
1734         * Shared/API/APIError.h:
1735         * Shared/gtk/WebErrorsGtk.cpp:
1736         (WebKit::printError):
1737         * UIProcess/API/gtk/WebKitPrivate.cpp:
1738         (toWebKitError):
1739         (toWebCoreError):
1740
1741 2017-06-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1742
1743         Do not mix C and C++ API error constants
1744         https://bugs.webkit.org/show_bug.cgi?id=173311
1745
1746         Reviewed by Alex Christensen.
1747
1748         In r214934 I added error constants to API::Error, but not for all errors exposed in the C API. Because of this
1749         we are mixing both constants in WebErrors and in GTk+ WebKitPrivate.
1750
1751         * Shared/API/APIError.h:
1752         * Shared/WebErrors.cpp:
1753         (WebKit::blockedError):
1754         (WebKit::blockedByContentBlockerError):
1755         (WebKit::cannotShowURLError):
1756         (WebKit::interruptedForPolicyChangeError):
1757         (WebKit::blockedByContentFilterError):
1758         (WebKit::cannotShowMIMETypeError):
1759         (WebKit::pluginWillHandleLoadError):
1760         (WebKit::internalError):
1761         * UIProcess/API/gtk/WebKitPrivate.cpp:
1762         (toWebKitError):
1763         (toWebCoreError):
1764
1765 2017-06-13  Matt Rajca  <mrajca@apple.com>
1766
1767         WebsitePolicies: let clients select specific autoplay quirks
1768         https://bugs.webkit.org/show_bug.cgi?id=173343
1769
1770         Reviewed by Alex Christensen.
1771         
1772         Replace the 'allowsAutoplayQuirks' bool with an OptionSet so clients can selectively
1773         pick auto-play quirks.
1774
1775         * Shared/WebsitePolicies.h:
1776         (WebKit::WebsitePolicies::encode):
1777         (WebKit::WebsitePolicies::decode):
1778         * UIProcess/API/APIWebsitePolicies.h:
1779         * UIProcess/API/C/WKWebsitePolicies.cpp:
1780         (WKWebsitePoliciesSetAllowedAutoplayQuirks):
1781         (WKWebsitePoliciesGetAllowedAutoplayQuirks):
1782         (WKWebsitePoliciesSetAllowsAutoplayQuirks): Deleted.
1783         (WKWebsitePoliciesGetAllowsAutoplayQuirks): Deleted.
1784         * UIProcess/API/C/WKWebsitePolicies.h:
1785         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1786         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
1787         (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]):
1788         (-[_WKWebsitePolicies allowedAutoplayQuirks]):
1789         (-[_WKWebsitePolicies setAllowsAutoplayQuirks:]): Deleted.
1790         (-[_WKWebsitePolicies allowsAutoplayQuirks]): Deleted.
1791         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1792         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1793         * WebProcess/WebPage/WebPage.cpp:
1794         (WebKit::WebPage::updateWebsitePolicies):
1795
1796 2017-06-13  Wenson Hsieh  <wenson_hsieh@apple.com>
1797
1798         Add missing availability declarations to SPI in WKUIDelegatePrivate.h
1799         https://bugs.webkit.org/show_bug.cgi?id=173336
1800
1801         Reviewed by Tim Horton.
1802
1803         Add missing availability macros to two recently-introduced SPI delegate methods.
1804         No change in behavior.
1805
1806         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1807
1808 2017-06-13  Chris Dumez  <cdumez@apple.com>
1809
1810         Add API::InjectedBundle::PageLoaderClient
1811         https://bugs.webkit.org/show_bug.cgi?id=173265
1812
1813         Reviewed by Alex Christensen.
1814
1815         Add missing null check that is causing crashes on iOS.
1816
1817         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
1818         (WebKit::InjectedBundlePageLoaderClient::userAgentForURL):
1819
1820 2017-06-13  Brent Fulgham  <bfulgham@apple.com>
1821
1822         [WK2][macOS] Allow AppleEvents in Citrix View Plugin
1823         https://bugs.webkit.org/show_bug.cgi?id=173280
1824         <rdar://problem/31913624>
1825
1826         Reviewed by Alexey Proskuryakov.
1827
1828         A slightly better fix: Allow AppleEvents for non-sandboxed plugins. This should
1829         avoid inadvertently breaking custom plugins, etc.
1830
1831         * PluginProcess/mac/PluginProcessMac.mm:
1832         (WebKit::PluginProcess::platformInitializeProcess): Switch check from a specific Citrix
1833         test, to just allowing non-sandboxed plugins to use AppleEvents.
1834
1835 2017-06-13  Chris Dumez  <cdumez@apple.com>
1836
1837         Include PID in some UIProcess-side release logging that relates to a particular WebProcess
1838         https://bugs.webkit.org/show_bug.cgi?id=173299
1839
1840         Reviewed by Ryosuke Niwa.
1841
1842         * UIProcess/BackgroundProcessResponsivenessTimer.cpp:
1843         (WebKit::BackgroundProcessResponsivenessTimer::setResponsive):
1844         * UIProcess/WebProcessProxy.cpp:
1845         (WebKit::WebProcessProxy::didExceedActiveMemoryLimit):
1846         (WebKit::WebProcessProxy::didExceedInactiveMemoryLimit):
1847         (WebKit::WebProcessProxy::didExceedCPULimit):
1848
1849 2017-06-13  Daniel Bates  <dabates@apple.com>
1850
1851         Implement W3C Secure Contexts Draft Specification
1852         https://bugs.webkit.org/show_bug.cgi?id=158121
1853         <rdar://problem/26012994>
1854
1855         Reviewed by Brent Fulgham.
1856
1857         Part 4
1858
1859         Adds a preference to toggle the runtime enabled feature flag isSecureContextAttributeEnabled.
1860
1861         * Shared/WebPreferencesDefinitions.h:
1862         * UIProcess/API/C/WKPreferences.cpp:
1863         (WKPreferencesSetIsSecureContextAttributeEnabled):
1864         (WKPreferencesGetIsSecureContextAttributeEnabled):
1865         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1866         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1867         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1868         * WebProcess/WebPage/WebPage.cpp:
1869         (WebKit::WebPage::updatePreferences):
1870
1871 2017-06-13  Brent Fulgham  <bfulgham@apple.com>
1872
1873         [WK2][macOS] Allow AppleEvents in Citrix View Plugin
1874         https://bugs.webkit.org/show_bug.cgi?id=173280
1875         <rdar://problem/31913624>
1876
1877         Reviewed by Alexey Proskuryakov.
1878
1879         Allow the Citrix Viewer plugin to issue Apple Events.
1880
1881         * PluginProcess/mac/PluginProcessMac.mm:
1882         (WebKit::PluginProcess::platformInitializeProcess): Allow AppleEvents for the Citrix Viewer plugin.
1883
1884 2017-06-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1885
1886         [GTK] Blob download doesn't work
1887         https://bugs.webkit.org/show_bug.cgi?id=172442
1888
1889         Reviewed by Carlos Alberto Lopez Perez.
1890
1891         GTK+ API uses URIs for download destination paths, and passes that URIs to the WebKit internals. But WebKit
1892         expects download destination location to be a local path. This is not a problem for normal downloads, because
1893         the soup backend handles the cases of download destination being a URI and a path. For blob downloads
1894         NetworkDataTaskBlob is used, and it always expects the download destination to be a local path, failing in
1895         FileSystem::openFile() when a URI is passed. We need to keep using local files internally and convert to URIs
1896         only when exposing those paths to the API.
1897
1898         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1899         (WebKit::NetworkDataTaskSoup::download): Stop handling URIs here, we should always expect local files.
1900         * UIProcess/API/gtk/WebKitDownload.cpp:
1901         (webkitDownloadDecideDestinationWithSuggestedFilename): Convert destination URI to filanme before pasing it to DownloadClient.
1902         (webkitDownloadDestinationCreated): Convert the destination path to a URI before passing it to WebKitDownload::created-destionation signal.
1903         * UIProcess/API/gtk/WebKitDownloadClient.cpp:
1904         * UIProcess/API/gtk/WebKitDownloadPrivate.h:
1905
1906 2017-06-13  Wenson Hsieh  <wenson_hsieh@apple.com>
1907
1908         Unable to paste text that was copied from a page into the universal search field
1909         https://bugs.webkit.org/show_bug.cgi?id=173293
1910         <rdar://problem/32440918>
1911
1912         Reviewed by Ryosuke Niwa.
1913
1914         Add boilerplate SPI on WKPreferences to enable JavaScript access to copy and paste.
1915
1916         * UIProcess/API/Cocoa/WKPreferences.mm:
1917         (-[WKPreferences _setJavaScriptCanAccessClipboard:]):
1918         (-[WKPreferences _javaScriptCanAccessClipboard]):
1919         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1920
1921 2017-06-13  Sam Weinig  <sam@webkit.org>
1922
1923         Rename JSDOMWindowShell to JSDOMWindowProxy to match the HTML5 spec.
1924         https://bugs.webkit.org/show_bug.cgi?id=80733
1925
1926         Reviewed by Chris Dumez.
1927
1928         * WebProcess/Plugins/PluginView.cpp:
1929         (WebKit::PluginView::windowScriptNPObject):
1930
1931 2017-06-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1932
1933         Unreviewed. Remove unused code from GTK+ WebKitPrivate.
1934
1935         * UIProcess/API/gtk/WebKitPrivate.cpp:
1936         (wkEventModifiersToGdkModifiers): Deleted.
1937         (wkEventMouseButtonToWebKitMouseButton): Deleted.
1938         * UIProcess/API/gtk/WebKitPrivate.h:
1939
1940 2017-06-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1941
1942         Unreviewed. Fix return value of PageLoaderClient::shouldGoToBackForwardListItem after r218164.
1943
1944         It should return true as InjectedBundlePageLoaderClient does. This caused several timeouts in GTK+ unit tests
1945         after r218171.
1946
1947         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
1948         (API::InjectedBundle::PageLoaderClient::shouldGoToBackForwardListItem):
1949
1950 2017-06-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1951
1952         [GTK] Use API::GeolocationProvider in WebKitGeolocationProvider
1953         https://bugs.webkit.org/show_bug.cgi?id=173151
1954
1955         Reviewed by Žan Doberšek.
1956
1957         Also cleanup a bit the WebKitGeolocationProvider implementation, it doesn't need to be refcounted.
1958
1959         * UIProcess/API/gtk/WebKitGeolocationProvider.cpp:
1960         (WebKit::GeolocationProvider::GeolocationProvider):
1961         (WebKit::WebKitGeolocationProvider::~WebKitGeolocationProvider):
1962         (WebKit::WebKitGeolocationProvider::WebKitGeolocationProvider):
1963         (toGeolocationProvider): Deleted.
1964         (startUpdatingCallback): Deleted.
1965         (stopUpdatingCallback): Deleted.
1966         (WebKitGeolocationProvider::~WebKitGeolocationProvider): Deleted.
1967         (WebKitGeolocationProvider::create): Deleted.
1968         (WebKitGeolocationProvider::WebKitGeolocationProvider): Deleted.
1969         (WebKitGeolocationProvider::startUpdating): Deleted.
1970         (WebKitGeolocationProvider::stopUpdating): Deleted.
1971         (WebKitGeolocationProvider::notifyPositionChanged): Deleted.
1972         (WebKitGeolocationProvider::notifyErrorOccurred): Deleted.
1973         * UIProcess/API/gtk/WebKitGeolocationProvider.h:
1974         * UIProcess/API/gtk/WebKitWebContext.cpp:
1975         (webkitWebContextConstructed):
1976
1977 2017-06-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1978
1979         [GTK] Use API::IconDatabaseClient in WebKitFaviconDatabase
1980         https://bugs.webkit.org/show_bug.cgi?id=173146
1981
1982         Reviewed by Žan Doberšek.
1983
1984         * UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
1985         (_WebKitFaviconDatabasePrivate::~_WebKitFaviconDatabasePrivate):
1986         (webkitFaviconDatabaseCreate):
1987         (didChangeIconForPageURLCallback): Deleted.
1988         (iconDataReadyForPageURLCallback): Deleted.
1989
1990 2017-06-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1991
1992         [GTK] Use API::InjectedBundle::PageLoaderClient in WebKitWebPage
1993         https://bugs.webkit.org/show_bug.cgi?id=173304
1994
1995         Reviewed by Alex Christensen.
1996
1997         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
1998         (webkitWebPageCreate):
1999         (getDocumentLoaderURL): Deleted.
2000         (didStartProvisionalLoadForFrame): Deleted.
2001         (didReceiveServerRedirectForProvisionalLoadForFrame): Deleted.
2002         (didSameDocumentNavigationForFrame): Deleted.
2003         (didCommitLoadForFrame): Deleted.
2004         (didFinishDocumentLoadForFrame): Deleted.
2005         (didClearWindowObjectForFrame): Deleted.
2006
2007 2017-06-13  Gwang Yoon Hwang  <yoon@igalia.com>
2008
2009         [GStreamerGL] Release GstVideoFrame when there is a flush event from the pipeline
2010         https://bugs.webkit.org/show_bug.cgi?id=172427
2011
2012         Reviewed by Žan Doberšek.
2013
2014         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2015         (WebKit::CoordinatedGraphicsScene::texmapGL):
2016         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
2017         Provides current texmapGL to platform layer proxies to create and copy
2018         bitmap textures.
2019
2020 2017-06-13  Youenn Fablet  <youenn@apple.com>
2021
2022         Switch off Legacy WebRTC API flag by default
2023         https://bugs.webkit.org/show_bug.cgi?id=173241
2024
2025         Reviewed by Sam Weinig.
2026
2027         * Shared/WebPreferencesDefinitions.h:
2028
2029 2017-06-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2030
2031         Add API::GeolocationProvider
2032         https://bugs.webkit.org/show_bug.cgi?id=173150
2033
2034         Reviewed by Alex Christensen.
2035
2036         It will be used by GTK+ port instead of the C API.
2037
2038         * UIProcess/API/APIGeolocationProvider.h: Added.
2039         (API::GeolocationProvider::~GeolocationProvider):
2040         (API::GeolocationProvider::startUpdating):
2041         (API::GeolocationProvider::stopUpdating):
2042         (API::GeolocationProvider::setEnableHighAccuracy):
2043         * UIProcess/API/C/WKGeolocationManager.cpp:
2044         (WKGeolocationManagerSetProvider):
2045         * UIProcess/WebGeolocationManagerProxy.cpp:
2046         (WebKit::WebGeolocationManagerProxy::WebGeolocationManagerProxy):
2047         (WebKit::WebGeolocationManagerProxy::setProvider):
2048         (WebKit::WebGeolocationManagerProxy::processPoolDestroyed):
2049         (WebKit::WebGeolocationManagerProxy::startUpdating):
2050         (WebKit::WebGeolocationManagerProxy::removeRequester):
2051         (WebKit::WebGeolocationManagerProxy::setEnableHighAccuracy):
2052         * UIProcess/WebGeolocationManagerProxy.h:
2053         * UIProcess/WebGeolocationProvider.cpp:
2054         (WebKit::WebGeolocationProvider::WebGeolocationProvider):
2055         (WebKit::WebGeolocationProvider::startUpdating):
2056         (WebKit::WebGeolocationProvider::stopUpdating):
2057         (WebKit::WebGeolocationProvider::setEnableHighAccuracy):
2058         * UIProcess/WebGeolocationProvider.h:
2059         * WebKit2.xcodeproj/project.pbxproj:
2060
2061 2017-06-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2062
2063         Add API::InjectedBundle::PageLoaderClient
2064         https://bugs.webkit.org/show_bug.cgi?id=173265
2065
2066         Reviewed by Alex Christensen.
2067
2068         It will be used by the GTK+ port instead of the C API.
2069
2070         * WebKit2.xcodeproj/project.pbxproj:
2071         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h: Added.
2072         (API::InjectedBundle::PageLoaderClient::willLoadURLRequest):
2073         (API::InjectedBundle::PageLoaderClient::willLoadDataRequest):
2074         (API::InjectedBundle::PageLoaderClient::shouldGoToBackForwardListItem):
2075         (API::InjectedBundle::PageLoaderClient::didStartProvisionalLoadForFrame):
2076         (API::InjectedBundle::PageLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
2077         (API::InjectedBundle::PageLoaderClient::didFailProvisionalLoadWithErrorForFrame):
2078         (API::InjectedBundle::PageLoaderClient::didCommitLoadForFrame):
2079         (API::InjectedBundle::PageLoaderClient::didFinishDocumentLoadForFrame):
2080         (API::InjectedBundle::PageLoaderClient::didFinishLoadForFrame):
2081         (API::InjectedBundle::PageLoaderClient::didFinishProgress):
2082         (API::InjectedBundle::PageLoaderClient::didFailLoadWithErrorForFrame):
2083         (API::InjectedBundle::PageLoaderClient::didSameDocumentNavigationForFrame):
2084         (API::InjectedBundle::PageLoaderClient::didReceiveTitleForFrame):
2085         (API::InjectedBundle::PageLoaderClient::didRemoveFrameFromHierarchy):
2086         (API::InjectedBundle::PageLoaderClient::didDisplayInsecureContentForFrame):
2087         (API::InjectedBundle::PageLoaderClient::didRunInsecureContentForFrame):
2088         (API::InjectedBundle::PageLoaderClient::didDetectXSSForFrame):
2089         (API::InjectedBundle::PageLoaderClient::didFirstLayoutForFrame):
2090         (API::InjectedBundle::PageLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame):
2091         (API::InjectedBundle::PageLoaderClient::didLayoutForFrame):
2092         (API::InjectedBundle::PageLoaderClient::didReachLayoutMilestone):
2093         (API::InjectedBundle::PageLoaderClient::didClearWindowObjectForFrame):
2094         (API::InjectedBundle::PageLoaderClient::didCancelClientRedirectForFrame):
2095         (API::InjectedBundle::PageLoaderClient::willPerformClientRedirectForFrame):
2096         (API::InjectedBundle::PageLoaderClient::didHandleOnloadEventsForFrame):
2097         (API::InjectedBundle::PageLoaderClient::globalObjectIsAvailableForFrame):
2098         (API::InjectedBundle::PageLoaderClient::willDisconnectDOMWindowExtensionFromGlobalObject):
2099         (API::InjectedBundle::PageLoaderClient::didReconnectDOMWindowExtensionToGlobalObject):
2100         (API::InjectedBundle::PageLoaderClient::willDestroyGlobalObjectForDOMWindowExtension):
2101         (API::InjectedBundle::PageLoaderClient::shouldForceUniversalAccessFromLocalURL):
2102         (API::InjectedBundle::PageLoaderClient::featuresUsedInPage):
2103         (API::InjectedBundle::PageLoaderClient::willDestroyFrame):
2104         (API::InjectedBundle::PageLoaderClient::userAgentForURL):
2105         (API::InjectedBundle::PageLoaderClient::layoutMilestones):
2106         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2107         (WKBundlePageSetPageLoaderClient):
2108         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
2109         (WebKit::InjectedBundlePageLoaderClient::InjectedBundlePageLoaderClient):
2110         (WebKit::InjectedBundlePageLoaderClient::willLoadURLRequest):
2111         (WebKit::InjectedBundlePageLoaderClient::willLoadDataRequest):
2112         (WebKit::InjectedBundlePageLoaderClient::shouldGoToBackForwardListItem):
2113         (WebKit::InjectedBundlePageLoaderClient::didStartProvisionalLoadForFrame):
2114         (WebKit::InjectedBundlePageLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
2115         (WebKit::InjectedBundlePageLoaderClient::didFailProvisionalLoadWithErrorForFrame):
2116         (WebKit::InjectedBundlePageLoaderClient::didCommitLoadForFrame):
2117         (WebKit::InjectedBundlePageLoaderClient::didFinishDocumentLoadForFrame):
2118         (WebKit::InjectedBundlePageLoaderClient::didFinishLoadForFrame):
2119         (WebKit::InjectedBundlePageLoaderClient::didFinishProgress):
2120         (WebKit::InjectedBundlePageLoaderClient::didFailLoadWithErrorForFrame):
2121         (WebKit::InjectedBundlePageLoaderClient::didSameDocumentNavigationForFrame):
2122         (WebKit::InjectedBundlePageLoaderClient::didReceiveTitleForFrame):
2123         (WebKit::InjectedBundlePageLoaderClient::didRemoveFrameFromHierarchy):
2124         (WebKit::InjectedBundlePageLoaderClient::didDisplayInsecureContentForFrame):
2125         (WebKit::InjectedBundlePageLoaderClient::didRunInsecureContentForFrame):
2126         (WebKit::InjectedBundlePageLoaderClient::didDetectXSSForFrame):
2127         (WebKit::InjectedBundlePageLoaderClient::didFirstLayoutForFrame):
2128         (WebKit::InjectedBundlePageLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame):
2129         (WebKit::InjectedBundlePageLoaderClient::didLayoutForFrame):
2130         (WebKit::InjectedBundlePageLoaderClient::didReachLayoutMilestone):
2131         (WebKit::InjectedBundlePageLoaderClient::didClearWindowObjectForFrame):
2132         (WebKit::InjectedBundlePageLoaderClient::didCancelClientRedirectForFrame):
2133         (WebKit::InjectedBundlePageLoaderClient::willPerformClientRedirectForFrame):
2134         (WebKit::InjectedBundlePageLoaderClient::didHandleOnloadEventsForFrame):
2135         (WebKit::InjectedBundlePageLoaderClient::globalObjectIsAvailableForFrame):
2136         (WebKit::InjectedBundlePageLoaderClient::willDisconnectDOMWindowExtensionFromGlobalObject):
2137         (WebKit::InjectedBundlePageLoaderClient::didReconnectDOMWindowExtensionToGlobalObject):
2138         (WebKit::InjectedBundlePageLoaderClient::willDestroyGlobalObjectForDOMWindowExtension):
2139         (WebKit::InjectedBundlePageLoaderClient::shouldForceUniversalAccessFromLocalURL):
2140         (WebKit::InjectedBundlePageLoaderClient::featuresUsedInPage):
2141         (WebKit::InjectedBundlePageLoaderClient::userAgentForURL):
2142         (WebKit::InjectedBundlePageLoaderClient::layoutMilestones):
2143         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
2144         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2145         (WebKit::WebFrameLoaderClient::detachedFromParent2):
2146         (WebKit::WebFrameLoaderClient::dispatchDidDispatchOnloadEvents):
2147         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
2148         (WebKit::WebFrameLoaderClient::dispatchDidCancelClientRedirect):
2149         (WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect):
2150         (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
2151         (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage):
2152         (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage):
2153         (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage):
2154         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
2155         (WebKit::WebFrameLoaderClient::dispatchDidReceiveTitle):
2156         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
2157         (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
2158         (WebKit::WebFrameLoaderClient::dispatchDidFailLoad):
2159         (WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad):
2160         (WebKit::WebFrameLoaderClient::dispatchDidFinishLoad):
2161         (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
2162         (WebKit::WebFrameLoaderClient::dispatchDidLayout):
2163         (WebKit::WebFrameLoaderClient::shouldGoToHistoryItem):
2164         (WebKit::WebFrameLoaderClient::didDisplayInsecureContent):
2165         (WebKit::WebFrameLoaderClient::didRunInsecureContent):
2166         (WebKit::WebFrameLoaderClient::didDetectXSS):
2167         (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
2168         (WebKit::WebFrameLoaderClient::dispatchGlobalObjectAvailable):
2169         (WebKit::WebFrameLoaderClient::dispatchWillDisconnectDOMWindowExtensionFromGlobalObject):
2170         (WebKit::WebFrameLoaderClient::dispatchDidReconnectDOMWindowExtensionToGlobalObject):
2171         (WebKit::WebFrameLoaderClient::dispatchWillDestroyGlobalObjectForDOMWindowExtension):
2172         (WebKit::WebFrameLoaderClient::shouldForceUniversalAccessFromLocalURL):
2173         * WebProcess/WebCoreSupport/WebProgressTrackerClient.cpp:
2174         (WebKit::WebProgressTrackerClient::progressFinished):
2175         * WebProcess/WebPage/WebPage.cpp:
2176         (WebKit::WebPage::setInjectedBundlePageLoaderClient):
2177         (WebKit::WebPage::close):
2178         (WebKit::WebPage::loadRequest):
2179         (WebKit::WebPage::loadDataImpl):
2180         (WebKit::WebPage::userAgent):
2181         (WebKit::WebPage::reportUsedFeatures):
2182         (WebKit::WebPage::dispatchDidReachLayoutMilestone):
2183         * WebProcess/WebPage/WebPage.h:
2184         (WebKit::WebPage::injectedBundleLoaderClient):
2185
2186 2017-06-12  Simon Fraser  <simon.fraser@apple.com>
2187
2188         [iOS WK2] Peeking on an image could result in a preview at the wrong size
2189         https://bugs.webkit.org/show_bug.cgi?id=173274
2190         rdar://problem/30404627
2191
2192         Reviewed by Tim Horton.
2193
2194         There were a couple of issues with the way the page scale is communicated between the web process
2195         and the UI process.
2196
2197         Generally, the page scale is computed by the web process, and sent to the UI process via
2198         layer tree commits. UI-side scale is them communicated back to the web process via visibleContentRect
2199         updates. When receiving a new scale, WebPage has a "scale was set by the UI process" flag to handle
2200         the case where user interaction overrides the viewport-computed page scale. However, this flag would
2201         get set erroneously in a couple of situations.
2202
2203         First, during page loading, layer flushing is suspended temporarily, so web process scale changes never
2204         make it to the UI process. In that scenario, the UI process could send an old scale back to the web process,
2205         setting the "scale was set by the UI process" when it really wasn't.
2206
2207         Secondly, web -> UI layer commit messages, and UI -> web updateVisibleContentRect messages can be in flight at the
2208         same time, again causing a stale scale to reach the web process.
2209
2210         Fix this by only setting the "scale was set by the UI process" when we know the UI scale should be in sync, by comparing
2211         commit IDs of sent and received scales.
2212
2213         * WebProcess/WebPage/WebPage.h:
2214         * WebProcess/WebPage/ios/WebPageIOS.mm:
2215         (WebKit::WebPage::scaleFromUIProcess):
2216         (WebKit::WebPage::updateVisibleContentRects):
2217         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2218         (WebKit::RemoteLayerTreeDrawingArea::lastCommittedTransactionID):
2219
2220 2017-06-12  Alex Christensen  <achristensen@webkit.org>
2221
2222         Modernize UserScript.h
2223         https://bugs.webkit.org/show_bug.cgi?id=173273
2224
2225         Reviewed by Tim Horton.
2226
2227         * Shared/WebCoreArgumentCoders.cpp:
2228         (IPC::ArgumentCoder<UserScript>::encode): Deleted.
2229         (IPC::ArgumentCoder<UserScript>::decode): Deleted.
2230         * Shared/WebCoreArgumentCoders.h:
2231         * UIProcess/API/C/WKPageGroup.cpp:
2232         (WKPageGroupAddUserScript):
2233         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2234         (WebKit::InjectedBundle::addUserScript):
2235         * WebProcess/InjectedBundle/InjectedBundle.h:
2236         * WebProcess/WebPage/WebPage.cpp:
2237         (WebKit::WebPage::addUserScript):
2238         * WebProcess/WebPage/WebPage.h:
2239
2240 2017-06-12  Tim Horton  <timothy_horton@apple.com>
2241
2242         [iOS] Cmd-C doesn't copy text from WKWebView
2243         https://bugs.webkit.org/show_bug.cgi?id=173277
2244         <rdar://problem/32396742>
2245
2246         Reviewed by Dan Bernstein.
2247
2248         * UIProcess/API/Cocoa/WKWebView.mm:
2249         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2250         * UIProcess/ios/WKContentViewInteraction.h:
2251         * UIProcess/ios/WKContentViewInteraction.mm:
2252         (-[WKContentView _lookupForWebView:]):
2253         (-[WKContentView _shareForWebView:]):
2254         (-[WKContentView _addShortcutForWebView:]):
2255         (-[WKContentView _promptForReplaceForWebView:]):
2256         (-[WKContentView _transliterateChineseForWebView:]):
2257         (-[WKContentView _reanalyzeForWebView:]):
2258         (-[WKContentView replaceForWebView:]):
2259         (-[WKContentView canPerformAction:withSender:]):
2260         (-[WKContentView copyForWebView:]):
2261         (-[WKContentView cutForWebView:]):
2262         (-[WKContentView pasteForWebView:]):
2263         (-[WKContentView selectForWebView:]):
2264         (-[WKContentView selectAllForWebView:]):
2265         (-[WKContentView toggleBoldfaceForWebView:]):
2266         (-[WKContentView toggleItalicsForWebView:]):
2267         (-[WKContentView toggleUnderlineForWebView:]):
2268         (-[WKContentView _showTextStyleOptionsForWebView:]):
2269         (-[WKContentView _defineForWebView:]):
2270         (-[WKContentView _arrowKeyForWebView:]):
2271         (-[WKContentView _lookup:]): Deleted.
2272         (-[WKContentView _share:]): Deleted.
2273         (-[WKContentView _addShortcut:]): Deleted.
2274         (-[WKContentView _promptForReplace:]): Deleted.
2275         (-[WKContentView _transliterateChinese:]): Deleted.
2276         (-[WKContentView _reanalyze:]): Deleted.
2277         (-[WKContentView replace:]): Deleted.
2278         (-[WKContentView copy:]): Deleted.
2279         (-[WKContentView cut:]): Deleted.
2280         (-[WKContentView paste:]): Deleted.
2281         (-[WKContentView select:]): Deleted.
2282         (-[WKContentView selectAll:]): Deleted.
2283         (-[WKContentView toggleBoldface:]): Deleted.
2284         (-[WKContentView toggleItalics:]): Deleted.
2285         (-[WKContentView toggleUnderline:]): Deleted.
2286         (-[WKContentView _showTextStyleOptions:]): Deleted.
2287         (-[WKContentView _define:]): Deleted.
2288         (-[WKContentView _arrowKey:]): Deleted.
2289         Similar to what r211897 did for canPerformAction, and other patches
2290         have done for other selectors, forward methods for standard editing
2291         commands from WKContentView up to WKWebView, and back down to WKContentView.
2292
2293         This is necessary because these are not treated as normal
2294         responder-chain-respecting methods, so they do not bubble up the view tree.
2295         
2296         In 211897, WKContentView (who is usually first responder and thus receives
2297         the actions) stopped claiming to be able to perform these actions, depending
2298         on this non-existent bubbling behavior to keep them working.
2299
2300 2017-06-12  Chris Dumez  <cdumez@apple.com>
2301
2302         Null dereference under WebProcessPool::pageRemovedFromProcess()
2303         https://bugs.webkit.org/show_bug.cgi?id=173271
2304         <rdar://problem/32038814>
2305
2306         Reviewed by Ryosuke Niwa.
2307
2308         Null-check networkProcess() before dereferencing it in WebProcessPool::pageRemovedFromProcess().
2309         This is the only place in this class where we failed to null check before dereferencing
2310         networkProcess(). To my knowledge, there is no guarantee there is a network process.
2311
2312         * UIProcess/WebProcessPool.cpp:
2313         (WebKit::WebProcessPool::pageRemovedFromProcess):
2314
2315 2017-06-12  Jiewen Tan  <jiewen_tan@apple.com>
2316
2317         [WebCrypto] Remove experimental feature flag of SubtleCrypto
2318         https://bugs.webkit.org/show_bug.cgi?id=173197
2319         <rdar://problem/32688148>
2320
2321         Reviewed by Brent Fulgham.
2322
2323         * Shared/WebPreferencesDefinitions.h:
2324         * UIProcess/API/C/WKPreferences.cpp:
2325         (WKPreferencesSetSubtleCryptoEnabled): Deleted.
2326         (WKPreferencesGetSubtleCryptoEnabled): Deleted.
2327         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2328         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2329         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2330         * WebProcess/WebPage/WebPage.cpp:
2331         (WebKit::WebPage::updatePreferences):
2332
2333 2017-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>
2334
2335         [iOS DnD] Allow the injected bundle to add client data when writing an image to the pasteboard
2336         https://bugs.webkit.org/show_bug.cgi?id=173238
2337         <rdar://problem/31943370>
2338
2339         Reviewed by Ryosuke Niwa and Tim Horton.
2340
2341         Send PasteboardImage.clientTypes and PasteboardImage.clientData over IPC.
2342
2343         * Shared/WebCoreArgumentCoders.cpp:
2344         (IPC::encodeClientTypesAndData):
2345         (IPC::decodeClientTypesAndData):
2346
2347         Factor out common logic used to encode and decode client types and data into static helpers.
2348
2349         (IPC::ArgumentCoder<PasteboardWebContent>::encode):
2350         (IPC::ArgumentCoder<PasteboardWebContent>::decode):
2351         (IPC::ArgumentCoder<PasteboardImage>::encode):
2352         (IPC::ArgumentCoder<PasteboardImage>::decode):
2353
2354 2017-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>
2355
2356         [iOS DnD] Introduce hooks to override targeted drag previews when lifting and cancelling
2357         https://bugs.webkit.org/show_bug.cgi?id=173240
2358         <rdar://problem/31943370>
2359
2360         Reviewed by Ryosuke Niwa and Tim Horton.
2361
2362         Adds two new delegate hooks: _webView:previewForLiftingItem:session: and
2363         _webView:previewForCancellingItem:withDefault:.
2364
2365         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2366
2367 2017-06-12  Chris Dumez  <cdumez@apple.com>
2368
2369         Regression(r217867): Legacy SessionHistoryEntryData format should not change
2370         https://bugs.webkit.org/show_bug.cgi?id=173267
2371         <rdar://problem/32701257>
2372
2373         Reviewed by Simon Fraser.
2374
2375         Revert changes to Legacy SessionHistoryEntryData format that were made in r217867,
2376         as this apparently breaks compatiblity.
2377
2378         * UIProcess/mac/LegacySessionStateCoding.cpp:
2379         (WebKit::encodeFrameStateNode):
2380         (WebKit::decodeBackForwardTreeNode):
2381
2382 2017-06-12  Brent Fulgham  <bfulgham@apple.com>
2383
2384         [WK2][macOS] Alow iokit-get-properties for additional media features
2385         https://bugs.webkit.org/show_bug.cgi?id=173082
2386         <rdar://problem/32597547>
2387
2388         Reviewed by Alex Christensen.
2389
2390         * WebProcess/com.apple.WebProcess.sb.in:
2391
2392 2017-06-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2393
2394         Add API::IconDatabaseClient
2395         https://bugs.webkit.org/show_bug.cgi?id=173145
2396
2397         Reviewed by Alex Christensen.
2398
2399         It will be used by GTK+ port instead of the C API.
2400
2401         * UIProcess/API/APIIconDatabaseClient.h:
2402         (API::IconDatabaseClient::~IconDatabaseClient):
2403         (API::IconDatabaseClient::didChangeIconForPageURL):
2404         (API::IconDatabaseClient::didRemoveAllIcons):
2405         (API::IconDatabaseClient::iconDataReadyForPageURL):
2406         * UIProcess/API/C/WKIconDatabase.cpp:
2407         (WKIconDatabaseSetIconDatabaseClient):
2408         * UIProcess/WebIconDatabase.cpp:
2409         (WebKit::WebIconDatabase::WebIconDatabase):
2410         (WebKit::WebIconDatabase::setClient):
2411         (WebKit::WebIconDatabase::didChangeIconForPageURL):
2412         (WebKit::WebIconDatabase::didRemoveAllIcons):
2413         (WebKit::WebIconDatabase::notifyIconDataReadyForPageURL):
2414         * UIProcess/WebIconDatabase.h:
2415         * UIProcess/WebIconDatabaseClient.cpp:
2416         (WebKit::WebIconDatabaseClient::WebIconDatabaseClient):
2417         (WebKit::WebIconDatabaseClient::didChangeIconForPageURL):
2418         (WebKit::WebIconDatabaseClient::didRemoveAllIcons):
2419         (WebKit::WebIconDatabaseClient::iconDataReadyForPageURL):
2420         * UIProcess/WebIconDatabaseClient.h:
2421         * WebKit2.xcodeproj/project.pbxproj:
2422
2423 2017-06-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2424
2425         [GTK] Stop dismissing menus attached to the web view for every injected event
2426         https://bugs.webkit.org/show_bug.cgi?id=172708
2427
2428         Reviewed by Alex Christensen.
2429
2430         To actually simulate a right-click event we should also send the button release after the press, and let the page
2431         handle the events in addition to sending the event to the context menu controller, like we do with normal
2432         events. So, this is mostly the same as a real right-click event but without actually showing the menu.
2433
2434         * WebProcess/WebPage/WebPage.cpp:
2435         (WebKit::WebPage::contextMenuAtPointInWindow):
2436
2437 2017-06-12  Daewoong Jang  <daewoong.jang@navercorp.com>
2438
2439         [CoordinatedGraphics] Behavior change of DrawingAreaImpl after r217779
2440         https://bugs.webkit.org/show_bug.cgi?id=173153
2441
2442         Reviewed by Carlos Garcia Campos.
2443
2444         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2445         (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged):
2446
2447 2017-06-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2448
2449         [GTK] Prefer to use private WebKitWebView API over WebKitWebViewBase
2450         https://bugs.webkit.org/show_bug.cgi?id=173254
2451
2452         Reviewed by Žan Doberšek.
2453
2454         WebKitWebViewBase is specific to the GTK+ API, but WebKitWebView should be present in any glib-based API. Add
2455         webkitWebViewCreatePage() and webkitWebViewGetPage() and use them when possible instead of the WebKitWebViewBase
2456         ones.
2457
2458         * UIProcess/API/gtk/WebKitAutomationSession.cpp:
2459         * UIProcess/API/gtk/WebKitContextMenuClient.cpp:
2460         (attachContextMenuClientToView):
2461         * UIProcess/API/gtk/WebKitFindController.cpp:
2462         (getPage):
2463         (webkitFindControllerDispose):
2464         (webkitFindControllerConstructed):
2465         (webKitFindControllerPerform):
2466         (webkit_find_controller_search_finish):
2467         * UIProcess/API/gtk/WebKitFormClient.cpp:
2468         (attachFormClientToView):
2469         * UIProcess/API/gtk/WebKitLoaderClient.cpp:
2470         (attachLoaderClientToView):
2471         * UIProcess/API/gtk/WebKitPolicyClient.cpp:
2472         (attachPolicyClientToView):
2473         * UIProcess/API/gtk/WebKitPrintOperation.cpp:
2474         (drawPagesForPrintingCompleted):
2475         (webkitPrintOperationPrintPagesForFrame):
2476         (webkit_print_operation_run_dialog):
2477         (webkit_print_operation_print):
2478         * UIProcess/API/gtk/WebKitUIClient.cpp:
2479         (attachUIClientToView):
2480         * UIProcess/API/gtk/WebKitWebContext.cpp:
2481         (webkitWebContextCreatePageForWebView):
2482         (webkitWebContextWebViewDestroyed):
2483         * UIProcess/API/gtk/WebKitWebView.cpp:
2484         (webkitWebViewCreatePage):
2485         (webkitWebViewGetPage):
2486         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
2487
2488 2017-06-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2489
2490         [GTK] getPage() in WebKitWebView should return a reference instead of a pointer
2491         https://bugs.webkit.org/show_bug.cgi?id=173251
2492
2493         Reviewed by Žan Doberšek.
2494
2495         The WebPageProxy is created on WebKitWebView construction, so getPage() can only return nullptr if it's called
2496         during construction. And that can only happen when construct properties are set. It's better to check that the
2497         view has been constructed only in these particular cases and make getPage() return a reference.
2498
2499         * UIProcess/API/gtk/WebKitWebView.cpp:
2500         (webkitWebViewCreateJavaScriptDialog):
2501         (allowModalDialogsChanged): Settings signals are only connected after the page has been created, so we don't
2502         need to check page is available here.
2503         (zoomTextOnlyChanged):
2504         (userAgentChanged):
2505         (webkitWebViewIsConstructed): Helper method to check if the view has been constructed.
2506         (webkitWebViewUpdateSettings): Return early if view hasn't been constructed.
2507         (webkitWebViewDisconnectSettingsSignalHandlers): Ditto.
2508         (webkitWebViewConstructed):
2509         (webkitWebViewDispose):
2510         (webkitWebViewCreateNewPage):
2511         (webkitWebViewSelectionDidChange):
2512         (webkit_web_view_try_close):
2513         (webkit_web_view_load_uri):
2514         (webkit_web_view_load_html):
2515         (webkit_web_view_load_alternate_html):
2516         (webkit_web_view_load_plain_text):
2517         (webkit_web_view_load_bytes):
2518         (webkit_web_view_load_request):
2519         (webkit_web_view_get_page_id):
2520         (webkit_web_view_reload):
2521         (webkit_web_view_reload_bypass_cache):
2522         (webkit_web_view_stop_loading):
2523         (webkit_web_view_is_playing_audio):
2524         (webkit_web_view_go_back):
2525         (webkit_web_view_can_go_back):
2526         (webkit_web_view_go_forward):
2527         (webkit_web_view_can_go_forward):
2528         (webkit_web_view_get_custom_charset):
2529         (webkit_web_view_set_custom_charset):
2530         (webkit_web_view_get_estimated_load_progress):
2531         (webkit_web_view_go_to_back_forward_list_item):
2532         (webkit_web_view_set_zoom_level):
2533         (webkit_web_view_get_zoom_level):
2534         (webkit_web_view_can_execute_editing_command):
2535         (webkit_web_view_execute_editing_command):
2536         (webkit_web_view_execute_editing_command_with_argument):
2537         (webkit_web_view_run_javascript):
2538         (resourcesStreamReadCallback):
2539         (webkit_web_view_get_inspector):
2540         (webkit_web_view_can_show_mime_type):
2541         (webkit_web_view_save):
2542         (webkit_web_view_save_to_file):
2543         (webkit_web_view_download_uri):
2544         (webkit_web_view_get_tls_info):
2545         (webkit_web_view_get_snapshot):
2546         (webkit_web_view_set_background_color):
2547         (webkit_web_view_get_background_color):
2548         (webkit_web_view_is_editable):
2549         (webkit_web_view_set_editable):
2550         (webkit_web_view_get_editor_state):
2551         (webkit_web_view_get_session_state):
2552         (webkit_web_view_restore_session_state):
2553
2554 2017-06-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2555
2556         [GTK] Move WebKit GType macros to WTF
2557         https://bugs.webkit.org/show_bug.cgi?id=173249
2558
2559         Reviewed by Žan Doberšek.
2560
2561         Moving to a common place where they could be shared by all ports using a glib-based API.
2562
2563         * UIProcess/API/gtk/WebKitPrivate.h:
2564
2565 2017-06-11  Carlos Garcia Campos  <cgarcia@igalia.com>
2566
2567         [GTK] Remove WKInspectorClientGtk
2568         https://bugs.webkit.org/show_bug.cgi?id=173142
2569
2570         Reviewed by Michael Catanzaro.
2571
2572         It's only used internally in GTk+ API, we can simplify it by using a C++ client instead.
2573
2574         * PlatformGTK.cmake:
2575         * UIProcess/API/C/gtk/WKInspectorClientGtk.cpp: Removed.
2576         * UIProcess/API/C/gtk/WKInspectorClientGtk.h: Removed.
2577         * UIProcess/API/gtk/WebKitPrivate.h:
2578         * UIProcess/API/gtk/WebKitWebInspector.cpp:
2579         (_WebKitWebInspectorPrivate::~_WebKitWebInspectorPrivate):
2580         (webkitWebInspectorCreate):
2581         * UIProcess/WebInspectorProxy.cpp:
2582         * UIProcess/WebInspectorProxy.h:
2583         * UIProcess/gtk/WebInspectorClientGtk.cpp: Removed.
2584         * UIProcess/gtk/WebInspectorProxyClient.h: Renamed from Source/WebKit2/UIProcess/gtk/WebInspectorClientGtk.h.
2585         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2586         (WebKit::WebInspectorProxy::setClient):
2587         (WebKit::WebInspectorProxy::createInspectorWindow):
2588         (WebKit::WebInspectorProxy::platformDidClose):
2589         (WebKit::WebInspectorProxy::platformBringToFront):
2590         (WebKit::WebInspectorProxy::platformInspectedURLChanged):
2591         (WebKit::WebInspectorProxy::platformAttach):
2592         (WebKit::WebInspectorProxy::platformDetach):
2593         (WebKit::WebInspectorProxy::platformSetAttachedWindowHeight):
2594         (WebKit::WebInspectorProxy::platformSetAttachedWindowWidth):
2595         (WebKit::WebInspectorProxy::platformAttachAvailabilityChanged):
2596
2597 2017-06-11  Tim Horton  <timothy_horton@apple.com>
2598
2599         REGRESSION (r217870): Null deref under PageOverlayController::uninstallPageOverlay using find in page
2600         https://bugs.webkit.org/show_bug.cgi?id=173196
2601         <rdar://problem/32686871>
2602
2603         Reviewed by Simon Fraser.
2604
2605         * WebProcess/WebPage/ios/FindControllerIOS.mm:
2606         (WebKit::FindController::updateFindIndicator):
2607         The reason this caused a crash instead of just a missing indicator
2608         is that FindControllerIOS would early return after uninstalling
2609         the old overlay, before installing a new one, and leave m_isShowingFindIndicator
2610         set to true. Instead, reset it (and m_findIndicatorOverlay, which
2611         we would never re-use but might as well be freed immediately).
2612
2613         This likely already crashed in other less reproducible cases where a
2614         TextIndicator was not created for a find match, so clean it up.
2615
2616 2017-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2617
2618         [GTK] Remove WKFullScreenClientGtk
2619         https://bugs.webkit.org/show_bug.cgi?id=173140
2620
2621         Reviewed by Michael Catanzaro.
2622
2623         It's only used internally in the GTK+ API. Implementation is a lot simpler without using it, we can simply use
2624         either WebKitWebView or WebKitWebViewBase from PageClient directly.
2625
2626         * PlatformGTK.cmake:
2627         * UIProcess/API/C/gtk/WKFullScreenClientGtk.cpp: Removed.
2628         * UIProcess/API/C/gtk/WKFullScreenClientGtk.h: Removed.
2629         * UIProcess/API/gtk/PageClientImpl.cpp:
2630         (WebKit::PageClientImpl::isFullScreen):
2631         (WebKit::PageClientImpl::enterFullScreen):
2632         (WebKit::PageClientImpl::exitFullScreen):
2633         * UIProcess/API/gtk/WebKitFullscreenClient.cpp: Removed.
2634         * UIProcess/API/gtk/WebKitFullscreenClient.h: Removed.
2635         * UIProcess/API/gtk/WebKitPrivate.h:
2636         * UIProcess/API/gtk/WebKitWebView.cpp:
2637         (webkitWebViewConstructed):
2638         (webkitWebViewEnterFullScreen):
2639         (webkitWebViewExitFullScreen):
2640         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2641         (webkitWebViewBaseEnterFullScreen):
2642         (webkitWebViewBaseExitFullScreen):
2643         (webkitWebViewBaseIsFullScreen):
2644         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
2645         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
2646         * UIProcess/gtk/WebFullScreenClientGtk.cpp: Removed.
2647         * UIProcess/gtk/WebFullScreenClientGtk.h: Removed.
2648
2649 2017-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2650
2651         [GTK] Handle page download request in WebKitWebView directly
2652         https://bugs.webkit.org/show_bug.cgi?id=173137
2653
2654         Reviewed by Žan Doberšek.
2655
2656         We don't need to pass through WebKitWebViewBase, since the base doesn't have an implementation.
2657
2658         * UIProcess/API/gtk/PageClientImpl.cpp:
2659         (WebKit::PageClientImpl::handleDownloadRequest):
2660         * UIProcess/API/gtk/WebKitWebView.cpp:
2661         (webkitWebViewConstructed):
2662         (webkitWebViewHandleDownloadRequest):
2663         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2664         (webkitWebViewBaseSetDownloadRequestHandler): Deleted.
2665         (webkitWebViewBaseHandleDownloadRequest): Deleted.
2666         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
2667         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
2668
2669 2017-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2670
2671         [GTK] Use a lambda in webkit_cookie_manager_get_accept_policy instead of toGenericCallbackFunction
2672         https://bugs.webkit.org/show_bug.cgi?id=173134
2673
2674         Reviewed by Žan Doberšek.
2675
2676         It's simpler and easier to read.
2677
2678         * UIProcess/API/gtk/WebKitCookieManager.cpp:
2679         (webkit_cookie_manager_get_accept_policy):
2680         (webkitCookieManagerGetAcceptPolicyCallback): Deleted.
2681
2682 2017-06-10  Dan Bernstein  <mitz@apple.com>
2683
2684         Reverted r218056 because it made the IDE reindex constantly.
2685
2686         * Configurations/DebugRelease.xcconfig:
2687
2688 2017-06-10  Dan Bernstein  <mitz@apple.com>
2689
2690         [Xcode] With Xcode 9 developer beta, everything rebuilds when switching between command-line and IDE
2691         https://bugs.webkit.org/show_bug.cgi?id=173223
2692
2693         Reviewed by Sam Weinig.
2694
2695         The rebuilds were happening due to a difference in the compiler options that the IDE and
2696         xcodebuild were specifying. Only the IDE was passing the -index-store-path option. To make
2697         xcodebuild pass that option, too, set CLANG_INDEX_STORE_ENABLE to YES if it is unset, and
2698         specify an appropriate path in CLANG_INDEX_STORE_PATH.
2699
2700         * Configurations/DebugRelease.xcconfig:
2701
2702 2017-06-09  Ryosuke Niwa  <rniwa@webkit.org>
2703
2704         Crash inside WebKit::PluginView::getAuthenticationInfo
2705         https://bugs.webkit.org/show_bug.cgi?id=173083
2706         <rdar://problem/32513144>
2707
2708         Address Darin's review comment.
2709
2710         * WebProcess/Plugins/PluginView.cpp:
2711         (WebKit::PluginView::getAuthenticationInfo):
2712
2713 2017-06-09  Chris Dumez  <cdumez@apple.com>
2714
2715         Use WTF::Function instead of std::function in NetworkProcess code
2716         https://bugs.webkit.org/show_bug.cgi?id=173182
2717
2718         Reviewed by Alex Christensen.
2719
2720         Use WTF::Function instead of std::function in NetworkProcess code to avoid
2721         unnecessary copying.
2722
2723         * NetworkProcess/NetworkProcess.h:
2724         * NetworkProcess/cache/NetworkCacheIOChannel.h:
2725         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
2726         (WebKit::NetworkCache::IOChannel::read):
2727         (WebKit::NetworkCache::IOChannel::write):
2728         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
2729         (WebKit::NetworkCache::IOChannel::read):
2730         (WebKit::NetworkCache::IOChannel::readSyncInThread):
2731         (WebKit::NetworkCache::IOChannel::write):
2732         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
2733         * NetworkProcess/cache/NetworkCacheStatistics.h:
2734         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2735         (WebKit::clearNSURLCache):
2736         (WebKit::NetworkProcess::clearDiskCache):
2737         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2738         (WebKit::NetworkProcess::clearDiskCache):
2739
2740 2017-06-09  Tim Horton  <timothy_horton@apple.com>
2741
2742         REGRESSION (r213584): WeChat app can not switch to next text field
2743         https://bugs.webkit.org/show_bug.cgi?id=173183
2744         <rdar://problem/32323478>
2745
2746         Reviewed by Wenson Hsieh.
2747
2748         * Platform/spi/ios/UIKitSPI.h:
2749         * UIProcess/ios/InputViewUpdateDeferrer.mm:
2750         (WebKit::InputViewUpdateDeferrer::~InputViewUpdateDeferrer):
2751         It turns out that _endIgnoringReloadInputViews doesn't actually perform
2752         the update if there was one ignored. It does, however, return whether
2753         there was a change ignored, and we can force an update.
2754
2755         This remains untestable without sizable additional API test infrastructure
2756         for the same reasons as the original patch.
2757
2758 2017-06-09  Chris Dumez  <cdumez@apple.com>
2759
2760         Make sure we protect |this| in lambdas in WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver()
2761         https://bugs.webkit.org/show_bug.cgi?id=173174
2762         <rdar://problem/32598919>
2763
2764         Reviewed by Darin Adler.
2765
2766         Follow-up fix to r218006, which caused a crash on the bots. We cannot WTFMove() protectedThis
2767         here because the callback gets called several times.
2768
2769         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2770         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
2771
2772 2017-06-09  Jer Noble  <jer.noble@apple.com>
2773
2774         Crash in -[WKWebView _initializeWithConfiguration:]
2775         https://bugs.webkit.org/show_bug.cgi?id=173126
2776         <rdar://problem/32664993>
2777
2778         Reviewed by Darin Adler.
2779
2780         Follow up to previous fix; when setting NSString properties, store a copy of
2781         the string rather than the NSString itself.
2782
2783         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2784         (-[WKWebViewConfiguration copyWithZone:]):
2785         (-[WKWebViewConfiguration _overrideContentSecurityPolicy]):
2786         (-[WKWebViewConfiguration _setOverrideContentSecurityPolicy:]):
2787         (-[WKWebViewConfiguration _setMediaContentTypesRequiringHardwareSupport:]):
2788
2789 2017-06-09  Chris Dumez  <cdumez@apple.com>
2790
2791         Use WTF::Function instead of std::function in StorageManager
2792         https://bugs.webkit.org/show_bug.cgi?id=173177
2793
2794         Reviewed by Brady Eidson.
2795
2796         Use WTF::Function instead of std::function in StorageManager. This eliminates some
2797         potential implicit copying of captured variables, which is important here because
2798         we pass those lambdas to other threads.
2799
2800         * UIProcess/Storage/StorageManager.cpp:
2801         (WebKit::StorageManager::getSessionStorageOrigins):
2802         (WebKit::StorageManager::deleteSessionStorageOrigins):
2803         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
2804         (WebKit::StorageManager::getLocalStorageOrigins):
2805         (WebKit::StorageManager::getLocalStorageOriginDetails):
2806         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
2807         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
2808         * UIProcess/Storage/StorageManager.h:
2809
2810 2017-06-09  Daniel Bates  <dabates@apple.com>
2811
2812         CSP: Apply img-src directive to favicon loads
2813         https://bugs.webkit.org/show_bug.cgi?id=172733
2814         <rdar://problem/32082654>
2815
2816         Reviewed by Brady Eidson.
2817
2818         Return 0 seconds for the maximum buffering time for favicons (no change in behavior).
2819
2820         * WebProcess/Network/WebLoaderStrategy.cpp:
2821         (WebKit::maximumBufferingTime):
2822
2823 2017-06-09  Wenson Hsieh  <wenson_hsieh@apple.com>
2824
2825         [iOS DnD] Add a hook to perform two-step drops in editable content
2826         https://bugs.webkit.org/show_bug.cgi?id=172992
2827         <rdar://problem/32590174>
2828
2829         Reviewed by Tim Horton.
2830
2831         Add plumbing to support an injected bundle hook for overriding two-step drops. See WebCore ChangeLog.
2832
2833         * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
2834         (API::InjectedBundle::EditorClient::performTwoStepDrop):
2835         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
2836         * WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h:
2837         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2838         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
2839         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
2840         (WebKit::InjectedBundlePageEditorClient::performTwoStepDrop):
2841         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
2842         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2843         (WebKit::WebEditorClient::performTwoStepDrop):
2844         * WebProcess/WebCoreSupport/WebEditorClient.h:
2845
2846 2017-06-09  Brent Fulgham  <bfulgham@apple.com>
2847
2848         Use Function rather than std::function for thread safety in WebsiteDataStore
2849         https://bugs.webkit.org/show_bug.cgi?id=173172
2850
2851         Reviewed by Chris Dumez.
2852         <rdar://problem/32679311>
2853
2854         Remove a few more instances of std::function in the WebsiteDataStore, and WTFMove completion handler to
2855         avoid unnecessary copies.
2856
2857         * Shared/WebsiteData/WebsiteDataType.h: Remove redundant WebsiteDataType from name.
2858         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
2859         (WebKit::toWebsiteDataType): Update for revised name.
2860         (WebKit::toWKWebsiteDataTypes): Ditto.
2861         * UIProcess/WebProcessProxy.cpp:
2862         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): ASSERT that
2863         this function, as well as its completion handler, are getting called from the main thread.
2864         (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebiteData): Ditto.
2865         (WebKit::WebProcessProxy::fetchWebsiteData): Move the completionHandler.
2866         (WebKit::WebProcessProxy::deleteWebsiteData): Ditto.
2867         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): Ditto.
2868         * UIProcess/WebProcessProxy.h:
2869         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2870         (WebKit::WebsiteDataStore::fetchData): Switch to Function, and move completion handler.
2871         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): Ditto.
2872         (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData): Ditto.
2873         (WebKit::WebsiteDataStore::removeData): Ditto.
2874         (WebKit::WebsiteDataStore::removeDataForTopPrivatelyControlledDomains): Ditto.
2875         * UIProcess/WebsiteData/WebsiteDataStore.h:
2876
2877 2017-06-09  Chris Dumez  <cdumez@apple.com>
2878
2879         Make sure we protect |this| in lambdas in WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver()
2880         https://bugs.webkit.org/show_bug.cgi?id=173174
2881         <rdar://problem/32598919>
2882
2883         Reviewed by Darin Adler.
2884
2885         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2886         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
2887
2888 2017-06-09  Chris Dumez  <cdumez@apple.com>
2889
2890         Avoid some ref counting churn in WebResourceLoadStatisticsStore
2891         https://bugs.webkit.org/show_bug.cgi?id=173168
2892
2893         Reviewed by Brent Fulgham.
2894
2895         Move the protectedThis around instead of ref'ing it every time we capture it
2896         in a lambda. Also add a missing protectedThis in WebResourceLoadStatisticsStore::removeDataRecords()
2897         which likely fixes crashes.
2898
2899         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2900         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
2901         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
2902
2903 2017-06-09  Sam Weinig  <sam@webkit.org>
2904
2905         Add SubresourceIntegrity as an experimental feature
2906         https://bugs.webkit.org/show_bug.cgi?id=173164
2907
2908         Reviewed by Darin Adler.
2909
2910         * Shared/WebPreferencesDefinitions.h:
2911         * WebProcess/WebPage/WebPage.cpp:
2912         (WebKit::WebPage::updatePreferences):
2913         Add SubresourceIntegrity to the list of experimental features. Also, sort the experimental features
2914         as requested by the comment above it.
2915
2916 2017-06-09  Chris Dumez  <cdumez@apple.com>
2917
2918         Make sure |this| is protected in lambda capture in WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData()
2919         https://bugs.webkit.org/show_bug.cgi?id=173163
2920
2921         Reviewed by Brent Fulgham.
2922
2923         Make sure |this| is protected in lambda capture in WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData()
2924         or it may end up getting destroyed before the lambda executing and crash when calling m_statisticsQueue->dispatch().
2925
2926         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2927         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
2928
2929 2017-06-09  Daewoong Jang  <daewoong.jang@navercorp.com>
2930
2931         [CoordinatedGraphics] Remove unneeded interfaces in PageClient
2932         https://bugs.webkit.org/show_bug.cgi?id=173149
2933
2934         Reviewed by Michael Catanzaro.
2935
2936         * UIProcess/PageClient.h:
2937
2938 2017-06-09  Chris Dumez  <cdumez@apple.com>
2939
2940         Use WTF::Function instead of std::function in SpeculativeLoadManager::ExpiringEntry
2941         https://bugs.webkit.org/show_bug.cgi?id=173125
2942
2943         Reviewed by Antti Koivisto.
2944
2945         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2946         (WebKit::NetworkCache::SpeculativeLoadManager::ExpiringEntry::ExpiringEntry):
2947         (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::PreloadedEntry):
2948
2949 2017-06-09  Daewoong Jang  <daewoong.jang@navercorp.com>
2950
2951         Use WTF::getCurrentProcessID() instead of getpid()
2952         https://bugs.webkit.org/show_bug.cgi?id=173130
2953
2954         Reviewed by Tim Horton.
2955
2956         * UIProcess/API/APIProcessPoolConfiguration.h:
2957
2958 2017-06-09  Claudio Saavedra  <csaavedra@igalia.com>
2959
2960         struct does not accept initializer-form if member has initializers in GCC 4.9
2961
2962         Unreviewed speculative build fix.
2963
2964         Remove the default initializers for DeniedRequest struct,
2965         since it's only initialized in one place, to keep gcc 4.9
2966         happy.
2967         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2968
2969 2017-06-09  Adrien Plazas  <aplazas@igalia.com>
2970
2971         [GTK] Add kinetic scrolling
2972         https://bugs.webkit.org/show_bug.cgi?id=155750
2973
2974         Reviewed by Carlos Garcia Campos.
2975
2976         Patch by Adrien Plazas and Yusuke Suzuki.
2977
2978         Add the notion of phase and momentum phase to WebWheelEvent.
2979
2980         Make WebWheelEvent manage the 'is_stop' attribute of GdkEventScroll to create the corresponding WebWheelEvent
2981         with the correct phases and deltas.
2982
2983         Make GestureController manage swipes to create the corresponding WebWheelEvent with the correct phases and
2984         deltas.
2985
2986         * Shared/NativeWebWheelEvent.h:
2987         * Shared/WebEvent.h:
2988         * Shared/WebEventConversion.cpp:
2989         (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
2990         * Shared/WebWheelEvent.cpp:
2991         (WebKit::WebWheelEvent::WebWheelEvent):
2992         (WebKit::WebWheelEvent::encode):
2993         (WebKit::WebWheelEvent::decode):
2994         * Shared/gtk/NativeWebWheelEventGtk.cpp:
2995         (WebKit::NativeWebWheelEvent::NativeWebWheelEvent):
2996         * Shared/gtk/WebEventFactory.cpp:
2997         (WebKit::WebEventFactory::createWebWheelEvent):
2998         * Shared/gtk/WebEventFactory.h:
2999         * UIProcess/WebPageProxy.cpp:
3000         (WebKit::WebPageProxy::handleWheelEvent):
3001         (WebKit::WebPageProxy::shouldProcessWheelEventNow):
3002         * UIProcess/WebPageProxy.h:
3003         * UIProcess/gtk/GestureController.cpp:
3004         (WebKit::GestureController::GestureController):
3005         (WebKit::GestureController::handleEvent):
3006         (WebKit::GestureController::isProcessingGestures):
3007         (WebKit::createScrollEvent):
3008         (WebKit::GestureController::DragGesture::startDrag):
3009         (WebKit::GestureController::DragGesture::handleDrag):
3010         (WebKit::GestureController::DragGesture::begin):
3011         (WebKit::GestureController::DragGesture::end):
3012         (WebKit::GestureController::SwipeGesture::startMomentumScroll):
3013         (WebKit::GestureController::SwipeGesture::swipe):
3014         (WebKit::GestureController::SwipeGesture::SwipeGesture):
3015         * UIProcess/gtk/GestureController.h:
3016
3017 2017-06-09  Jer Noble  <jer.noble@apple.com>
3018
3019         Crash in -[WKWebView _initializeWithConfiguration:]
3020         https://bugs.webkit.org/show_bug.cgi?id=173126
3021
3022         Reviewed by Antti Koivisto.
3023
3024         Crash occurs when passing an autoreleased NSString into _setMediaContentTypesRequiringHardwareSupport.
3025         The ivar should be a RetainPtr rather than a bare NSString *.
3026
3027         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3028         (-[WKWebViewConfiguration _mediaContentTypesRequiringHardwareSupport]):
3029
3030 2017-06-08  Carlos Garcia Campos  <cgarcia@igalia.com>
3031
3032         [GTK] Use API::FormClient instead of the C API in WebKitFormClient
3033         https://bugs.webkit.org/show_bug.cgi?id=173098
3034
3035         Reviewed by Žan Doberšek.
3036
3037         * UIProcess/API/gtk/WebKitFormClient.cpp:
3038         (attachFormClientToView):
3039         (willSubmitForm): Deleted.
3040         * UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp:
3041         (webkitFormSubmissionRequestCreate):
3042         (webkit_form_submission_request_get_text_fields):
3043         * UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h:
3044         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
3045         (webkitWebPageCreate):
3046
3047 2017-06-08  Carlos Garcia Campos  <cgarcia@igalia.com>
3048
3049         [GTK] Use API::Findclient instead of the C API in WebKitFindController
3050         https://bugs.webkit.org/show_bug.cgi?id=173095
3051
3052         Reviewed by Žan Doberšek.
3053
3054         * UIProcess/API/gtk/WebKitFindController.cpp:
3055         (getPage):
3056         (webkitFindControllerDispose):
3057         (webkitFindControllerConstructed):
3058         (webkit_find_controller_class_init):
3059
3060 2017-06-08  Carlos Garcia Campos  <cgarcia@igalia.com>
3061
3062         [GTK] Get rid of custom marshallers of signals
3063         https://bugs.webkit.org/show_bug.cgi?id=173094
3064
3065         Reviewed by Žan Doberšek.
3066
3067         Use g_cclosure_marshal_generic instead.
3068
3069         * PlatformGTK.cmake:
3070         * UIProcess/API/gtk/WebKitBackForwardList.cpp:
3071         * UIProcess/API/gtk/WebKitDownload.cpp:
3072         (webkit_download_class_init):
3073         * UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
3074         (webkit_favicon_database_class_init):
3075         * UIProcess/API/gtk/WebKitWebInspector.cpp:
3076         (webkit_web_inspector_class_init):
3077         * UIProcess/API/gtk/WebKitWebResource.cpp:
3078         (webkit_web_resource_class_init):
3079         * UIProcess/API/gtk/WebKitWebView.cpp:
3080         (webkit_web_view_class_init):
3081         * UIProcess/API/gtk/webkit2marshal.list: Removed.
3082         * WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp:
3083         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
3084         (webkit_web_page_class_init):
3085
3086 2017-06-08  Simon Fraser  <simon.fraser@apple.com>
3087
3088         Crash under -[WKWebView _updateVisibleContentRects]
3089         https://bugs.webkit.org/show_bug.cgi?id=173123
3090         rdar://problem/32650112
3091
3092         Reviewed by Tim Horton.
3093
3094         Make sure the WKWebView is valid in places where we dispatch_async or use
3095         a pre-commit handler.
3096
3097         Speculative fix for a rare crasher.
3098
3099         * UIProcess/API/Cocoa/WKWebView.mm:
3100         (-[WKWebView _isValid]):
3101         (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]):
3102         (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
3103
3104 2017-06-07  Simon Fraser  <simon.fraser@apple.com>
3105
3106         Use initializers in WebPageProxy
3107         https://bugs.webkit.org/show_bug.cgi?id=173073
3108
3109         Reviewed by Tim Horton.
3110
3111         Initialize the member variables the modern way.
3112
3113         * UIProcess/WebPageProxy.cpp:
3114         (WebKit::WebPageProxy::WebPageProxy):
3115         * UIProcess/WebPageProxy.h:
3116
3117 2017-06-08  Jeremy Jones  <jeremyj@apple.com>
3118
3119         Implement additional AVPlayerController interfaces for minTime and maxTime.
3120         https://bugs.webkit.org/show_bug.cgi?id=172396
3121         rdar://problem/30737452
3122
3123         Reviewed by Jer Noble.
3124
3125         Add support for new HLS UI in AVKit.
3126
3127         Plumb seekableTimeRangesLastModifiedTime and liveUpdateInterval across process boundaries.
3128
3129         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
3130         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in:
3131         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
3132         (WebKit::WebPlaybackSessionModelContext::setSeekableRanges):
3133         (WebKit::WebPlaybackSessionManagerProxy::setSeekableRangesVector):
3134         * WebProcess/cocoa/WebPlaybackSessionManager.h:
3135         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
3136         (WebKit::WebPlaybackSessionInterfaceContext::seekableRangesChanged):
3137         (WebKit::WebPlaybackSessionManager::seekableRangesChanged):
3138
3139 2017-06-08  Chris Dumez  <cdumez@apple.com>
3140
3141         Use WTF::Function more in SpeculativeLoadManager
3142         https://bugs.webkit.org/show_bug.cgi?id=173109
3143
3144         Reviewed by Antti Koivisto.
3145
3146         Use WTF::Function more in SpeculativeLoadManager.
3147
3148         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
3149         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::create):
3150         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::PendingFrameLoad):
3151         (WebKit::NetworkCache::SpeculativeLoadManager::registerLoad):
3152         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
3153         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
3154
3155 2017-06-08  Youenn Fablet  <youenn@apple.com>
3156
3157         getUserMedia should not be prompted again if user denied access
3158         https://bugs.webkit.org/show_bug.cgi?id=173104
3159
3160         Reviewed by Geoff Garen.
3161
3162         Store denied requests to be able to replay them.
3163         If mic is denied, user might be prompted for camera, not for mic and camera.
3164         Same principle applies to the case of denied camera.
3165         Clearing the stored denied requests when reloading/navigating away.
3166
3167         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3168         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
3169         (WebKit::UserMediaPermissionRequestManagerProxy::resetAccess):
3170         (WebKit::UserMediaPermissionRequestManagerProxy::isRequestDenied):
3171         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
3172         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
3173
3174 2017-06-08  Jer Noble  <jer.noble@apple.com>
3175
3176         Clients of the WK2 C-API don't have their mediaContentTypesRequiringHardwareSupport setting initialized correctly.
3177         https://bugs.webkit.org/show_bug.cgi?id=173091
3178
3179         Reviewed by Eric Carlson.
3180
3181         Rather than add yet a third way of setting this preference, centralize everything by moving the
3182         definition of the default value into WebCore.
3183
3184         * Shared/WebPreferencesDefinitions.h:
3185         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3186         (-[WKWebViewConfiguration init]):
3187         * WebProcess/WebPage/WebPage.cpp:
3188         (WebKit::WebPage::updatePreferences):
3189
3190 2017-06-08  Jer Noble  <jer.noble@apple.com>
3191
3192         [WK2] mediaContentTypesRequiringHardwareSupport setting not being propogated
3193         https://bugs.webkit.org/show_bug.cgi?id=173090
3194
3195         Reviewed by Eric Carlson.
3196
3197         Passing a NSString* into the WebPreferencesStore::Value constructor would rather cast the NSString*
3198         into a bool than a const String&. So explicitly cast the NSString* into a String before passing.
3199
3200         * UIProcess/API/Cocoa/WKWebView.mm:
3201         (-[WKWebView _initializeWithConfiguration:]):
3202
3203 2017-06-08  Youenn Fablet  <youenn@apple.com>
3204
3205         getUserMedia request should not be allowed for background tabs unless the tab is already capturing
3206         https://bugs.webkit.org/show_bug.cgi?id=172989
3207
3208         Reviewed by Eric Carlson.
3209
3210         Covered by updated test and manual testing.
3211
3212         In case a getUserMedia can be granted, we check for visbility of the view.
3213         If the view is visible, the getUserMedia request is allowed and promise is resolved.
3214         Otherwise we store the pregranted request and will allow it when the view gets visible.
3215         Pregranted requests will be cleared if the document of the view is changed.
3216
3217         Pregranted requests will not be used when capture page is muted.
3218         In that case, a prompt will appear.
3219
3220         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3221         (WebKit::UserMediaPermissionRequestManagerProxy::removeGrantedAccess):
3222         (WebKit::allowRequest):
3223         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
3224         (WebKit::UserMediaPermissionRequestManagerProxy::processPregrantedRequests):
3225         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
3226         * UIProcess/WebPageProxy.cpp:
3227         (WebKit::WebPageProxy::dispatchActivityStateChange):
3228         (WebKit::WebPageProxy::viewIsBecomingVisible):
3229         * UIProcess/WebPageProxy.h:
3230
3231 2017-06-07  Carlos Garcia Campos  <cgarcia@igalia.com>
3232
3233         [WPE] Enable resource usage
3234         https://bugs.webkit.org/show_bug.cgi?id=173054
3235
3236         Reviewed by Žan Doberšek.
3237
3238         Enable/disable the resources overlay with CTRL + Shift + G.
3239
3240         * UIProcess/API/wpe/WPEView.cpp:
3241         (WKWPE::m_compositingManagerProxy):
3242
3243 2017-06-07  Carlos Garcia Campos  <cgarcia@igalia.com>
3244
3245         Remove legacy INSPECTOR_SERVER implementation
3246         https://bugs.webkit.org/show_bug.cgi?id=172966
3247
3248         Reviewed by Žan Doberšek.
3249
3250         * CMakeLists.txt:
3251         * Platform/Logging.h:
3252         * PlatformWPE.cmake:
3253         * UIProcess/InspectorServer/HTTPRequest.cpp: Removed.
3254         * UIProcess/InspectorServer/HTTPRequest.h: Removed.
3255         * UIProcess/InspectorServer/WebInspectorServer.cpp: Removed.
3256         * UIProcess/InspectorServer/WebInspectorServer.h: Removed.
3257         * UIProcess/InspectorServer/WebSocketServer.cpp: Removed.
3258         * UIProcess/InspectorServer/WebSocketServer.h: Removed.
3259         * UIProcess/InspectorServer/WebSocketServerClient.h: Removed.
3260         * UIProcess/InspectorServer/WebSocketServerConnection.cpp: Removed.
3261         * UIProcess/InspectorServer/WebSocketServerConnection.h: Removed.
3262         * UIProcess/InspectorServer/front-end/inspectorPageIndex.html: Removed.
3263         * UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp: Removed.
3264         * UIProcess/WebInspectorProxy.cpp:
3265         (WebKit::WebInspectorProxy::invalidate):
3266         * UIProcess/WebInspectorProxy.h:
3267         * UIProcess/WebInspectorProxy.messages.in:
3268         * UIProcess/WebPageProxy.cpp:
3269         (WebKit::WebPageProxy::initializeWebPage):
3270         (WebKit::WebPageProxy::preferencesDidChange):
3271         * UIProcess/wpe/WebProcessPoolWPE.cpp:
3272         * WebProcess/WebPage/WebInspector.cpp:
3273         (WebKit::WebInspector::sendMessageToFrontend):
3274         * WebProcess/WebPage/WebInspector.h:
3275         * WebProcess/WebPage/WebInspector.messages.in:
3276
3277 2017-06-07  Dan Bernstein  <mitz@apple.com>
3278
3279         [Cocoa] additionalReadAccessAllowedURLs doesn’t preserve non-Latin-1 paths
3280         https://bugs.webkit.org/show_bug.cgi?id=173086
3281
3282         Reviewed by Andy Estes.
3283
3284         We were incorrectly passing the fileSystemRepresentation of an NSURL into the WTF::String
3285         constructor that expects a Latin-1 string. However, in general, fileSystemRepresentation is
3286         not Latin-1.
3287
3288         * UIProcess/API/APIProcessPoolConfiguration.h: Changed m_additionalReadAccessAllowedPaths
3289           from a Vector<WTF::String> into a Vector<WTF::CString>.
3290
3291         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3292         (-[_WKProcessPoolConfiguration additionalReadAccessAllowedURLs]): Updated for the change.
3293         (-[_WKProcessPoolConfiguration setAdditionalReadAccessAllowedURLs:]): Ditto.
3294
3295         * UIProcess/WebProcessPool.cpp:
3296         (WebKit::WebProcessPool::resolvePathsForSandboxExtensions): Ditto.
3297
3298 2017-06-07  Ryosuke Niwa  <rniwa@webkit.org>
3299
3300         Crash inside WebKit::PluginView::getAuthenticationInfo
3301         https://bugs.webkit.org/show_bug.cgi?id=173083
3302
3303         Reviewed by Chris Dumez.
3304
3305         Added a null pointer check. The content document may have went away by the time we get there from IPC.
3306
3307         * WebProcess/Plugins/PluginView.cpp:
3308         (WebKit::PluginView::getAuthenticationInfo):
3309
3310 2017-06-07  Youenn Fablet  <youenn@apple.com>
3311
3312         getUserMedia is prompting too often
3313         https://bugs.webkit.org/show_bug.cgi?id=172859
3314         <rdar://problem/32589950>
3315
3316         Reviewed by Eric Carlson.
3317
3318         Introduce a storage of granted requests to skip prompting when needed.
3319         This is a partial implementation as granted requests should not happen for background tabs.
3320         This will be covered in a follow-up patch.
3321         Covered by manual tests.
3322
3323         A granted request keeps its mainFrameID.
3324         Whenever the document of the main frame changes, the granted requests for that mainFrameID will be removed.
3325         This handles the case of navigating, reloading... while still supporting the case of granting getUserMedia after in page navigation.
3326
3327         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3328         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest):
3329         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
3330         (WebKit::UserMediaPermissionRequestManagerProxy::removeGrantedAccess):
3331         (WebKit::UserMediaPermissionRequestManagerProxy::searchForGrantedRequest):
3332         (WebKit::UserMediaPermissionRequestManagerProxy::grantAccess):
3333         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
3334         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
3335         * UIProcess/UserMediaPermissionRequestProxy.cpp:
3336         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
3337         * UIProcess/UserMediaPermissionRequestProxy.h:
3338         (WebKit::UserMediaPermissionRequestProxy::create):
3339         (WebKit::UserMediaPermissionRequestProxy::mainFrameID):
3340         (WebKit::UserMediaPermissionRequestProxy::frameID):
3341         (WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin):
3342         * UIProcess/WebPageProxy.cpp:
3343         (WebKit::WebPageProxy::didChangeMainDocument):
3344         (WebKit::WebPageProxy::backForwardGoToItem):
3345         * UIProcess/WebPageProxy.h:
3346         * UIProcess/WebPageProxy.messages.in:
3347         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3348         (WebKit::WebFrameLoaderClient::dispatchDidChangeMainDocument):
3349         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3350
3351 2017-06-07  Dan Bernstein  <mitz@apple.com>
3352
3353         [Cocoa] additionalReadAccessAllowedURLs should be consumed before loading the injected bundle
3354         https://bugs.webkit.org/show_bug.cgi?id=173078
3355
3356         Reviewed by Anders Carlsson.
3357
3358         * WebProcess/WebProcess.cpp:
3359         (WebKit::WebProcess::initializeWebProcess): Changed the order.
3360
3361 2017-06-07  Per Arne Vollan  <pvollan@apple.com>
3362
3363         Support removal of authentication data through the Website data store API.
3364         https://bugs.webkit.org/show_bug.cgi?id=171217
3365         <rdar://problem/29522573>
3366
3367         Reviewed by Brady Eidson.
3368
3369         Add support to remove and fetch credential data through the Website data store API.
3370         Credential data is removed and fetched from both the network process and web process.
3371         Authentication data stored in the keychain will not be cleared.
3372
3373         * NetworkProcess/NetworkProcess.cpp:
3374         (WebKit::NetworkProcess::fetchWebsiteData):
3375         (WebKit::NetworkProcess::deleteWebsiteData):
3376         * Shared/WebsiteData/WebsiteData.cpp:
3377         (WebKit::WebsiteData::encode):
3378         (WebKit::WebsiteData::decode):
3379         * Shared/WebsiteData/WebsiteData.h:
3380         * Shared/WebsiteData/WebsiteDataType.h:
3381         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
3382         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
3383         (dataTypesToString):
3384         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
3385         (WebKit::toWebsiteDataType):
3386         (WebKit::toWKWebsiteDataTypes):
3387         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3388         (+[WKWebsiteDataStore allWebsiteDataTypes]):
3389         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
3390         (WebKit::WebsiteDataRecord::addOriginWithCredential):
3391         * UIProcess/WebsiteData/WebsiteDataRecord.h:
3392         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3393         (WebKit::WebsiteDataStore::fetchData):
3394         * WebProcess/WebProcess.cpp:
3395         (WebKit::WebProcess::fetchWebsiteData):
3396         (WebKit::WebProcess::deleteWebsiteData):
3397
3398 2017-06-06  Dan Bernstein  <mitz@apple.com>
3399
3400         Fixed building with the macOS 10.13 Apple Internal SDK when targeting macOS 10.12.
3401
3402         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3403         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:handler:]):
3404         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]):
3405         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]):
3406         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]):
3407
3408 2017-06-06  Brent Fulgham  <bfulgham@apple.com>
3409
3410         [WK2][Cocoa] Allow network process to bind addresses without webrtc extension
3411         https://bugs.webkit.org/show_bug.cgi?id=173032
3412         <rdar://problem/32597426>
3413
3414         Reviewed by Youenn Fablet.
3415
3416         Remove the unnecessary WebRTC sandbox extension handle and conditional sandbox rules, since we've
3417         decided that all WebKit clients should be able to use the WebRTC protocol.
3418
3419         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3420         (WebKit::NetworkProcessCreationParameters::encode): Remove unused sandbox extension from serialization.
3421         (WebKit::NetworkProcessCreationParameters::decode): Ditto.
3422         * NetworkProcess/NetworkProcessCreationParameters.h:
3423         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3424         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): We no longer send the sandbox extension,
3425         so don't attempt to consume it.
3426         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: Remove check for 'com.apple.webkit.webrtc'
3427         extension. Make rules conditional on building with WEB_RTC feature enabled.
3428         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Remove check for 'com.apple.webkit.webrtc'
3429         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3430         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Do not create unnecessary sandbox extension
3431         handle.
3432
3433 2017-06-06  Tim Horton  <timothy_horton@apple.com>
3434
3435         Crash trying to drag the entire text of a long book out of Mail compose view
3436         https://bugs.webkit.org/show_bug.cgi?id=173042
3437         <rdar://problem/32382059>
3438
3439         Reviewed by Simon Fraser.
3440
3441         * WebProcess/WebPage/ios/FindControllerIOS.mm:
3442         * WebProcess/WebPage/ios/WebPageIOS.mm:
3443         (WebKit::WebPage::didConcludeEditDataInteraction):
3444         Adapt to the new name.
3445
3446 2017-06-06  Chris Dumez  <cdumez@apple.com>
3447
3448         RELEASE_ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values)) hit in convertEnumerationToJS<WebCore::History::ScrollRestoration>()
3449         https://bugs.webkit.org/show_bug.cgi?id=173033
3450         <rdar://problem/32591099>
3451
3452         Reviewed by Simon Fraser.
3453
3454         * Shared/SessionState.h:
3455         Make sure FrameState::shouldRestoreScrollPosition and other struct members are always
3456         intialized.
3457
3458         * UIProcess/mac/LegacySessionStateCoding.cpp:
3459         (WebKit::encodeFrameStateNode):
3460         (WebKit::decodeBackForwardTreeNode):
3461         Make sure FrameState::shouldRestoreScrollPosition is properly encoded / decoded.
3462
3463 2017-06-06  Andy Estes  <aestes@apple.com>
3464
3465         REGRESSION (r199558): WKWebView upload file which name contains Chinese character results in garbled code
3466         https://bugs.webkit.org/show_bug.cgi?id=172849
3467         <rdar://problem/32567454>
3468
3469         Reviewed by Darin Adler.
3470
3471         This is the Mac equivalent of what was fixed in r208295. This time we use -[NSURL path] to
3472         construct a WTF::String instead of calling String::fromUTF8() on -[NSURL fileSystemRepresentation].
3473
3474         * UIProcess/Cocoa/UIDelegate.mm:
3475         (WebKit::UIDelegate::UIClient::runOpenPanel):
3476
3477 2017-06-06  Yoav Weiss  <yoav@yoav.ws>
3478
3479         [preload] Conditional support for media preloading and align media `as` values.
3480         https://bugs.webkit.org/show_bug.cgi?id=172501
3481
3482         Reviewed by Dean Jackson.
3483
3484         Add media preloading preference and hook it up to runtime enabled features.
3485
3486         * Shared/WebPreferencesDefinitions.h: Added a macro defining media preloading preference.
3487         * UIProcess/API/C/WKPreferences.cpp:
3488         (WebKit2::WKPreferences::WKPreferencesSetMediaPreloadingEnabled):
3489         (WebKit2::WKPreferences::WKPreferencesGetMediaPreloadingEnabled):
3490         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3491         * WebProcess/WebPage/WebPage.cpp: Set runtime enabled feature based on preference.
3492
3493 2017-06-06  Don Olmstead  <don.olmstead@am.sony.com>
3494
3495         [WebCore] Enable REQUEST_ANIMATION_FRAME_TIMER for all ports
3496         https://bugs.webkit.org/show_bug.cgi?id=172780
3497
3498         Reviewed by Alex Christensen.
3499
3500         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3501         (WebKit::WebChromeClient::scheduleAnimation): Deleted.
3502         * WebProcess/WebCoreSupport/WebChromeClient.h:
3503         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
3504         (WebKit::CompositingCoordinator::syncDisplayState):
3505
3506 2017-06-06  Beth Dakin  <bdakin@apple.com>
3507
3508         Netflix seeking quirk should also apply to Now Playing, and should always use the 
3509         livestream UI
3510         https://bugs.webkit.org/show_bug.cgi?id=173030
3511         -and corresponding-
3512         rdar://problem/32228660
3513
3514         Reviewed by Darin Adler.
3515
3516         See WebCore ChangeLog for more details. We can roll out allowsTouchBarScrubbing() 
3517         and rely on supportsSeeking().
3518
3519         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
3520         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in:
3521         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
3522         (WebKit::WebPlaybackSessionModelContext::setAllowsTouchBarScrubbing): Deleted.
3523         (WebKit::WebPlaybackSessionManagerProxy::setAllowsTouchBarScrubbing): Deleted.
3524         * WebProcess/cocoa/WebPlaybackSessionManager.h:
3525         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
3526         (WebKit::WebPlaybackSessionInterfaceContext::allowsTouchBarScrubbingChanged): Deleted.
3527         (WebKit::WebPlaybackSessionManager::allowsTouchBarScrubbingChanged): Deleted.
3528
3529 2017-06-06  Jer Noble  <jer.noble@apple.com>
3530
3531         [Cocoa] Set defaults for mediaContentTypesRequiringHardwareSupport setting
3532         https://bugs.webkit.org/show_bug.cgi?id=173008
3533
3534         Reviewed by Eric Carlson.
3535
3536         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3537         (-[WKWebViewConfiguration init]):
3538
3539 2017-06-06  Joseph Pecoraro  <pecoraro@apple.com>
3540
3541         Move Resource Timing / User Timing from experimental features into main preferences
3542         https://bugs.webkit.org/show_bug.cgi?id=172950
3543
3544         Reviewed by Darin Adler.
3545
3546         * Shared/WebPreferencesDefinitions.h:
3547         Move Resource Timing and User Timing out of the Experimental Features section.
3548
3549 2017-06-06  Youenn Fablet  <youenn@apple.com>
3550
3551         Add an option to disable getUserMedia prompt in case of mock capture sources
3552         https://bugs.webkit.org/show_bug.cgi?id=172981
3553         <rdar://problem/32580325>
3554
3555         Reviewed by Eric Carlson.
3556
3557         Adding mockCaptureDevicesPromptEnabled option.
3558         Allowing any getUserMedia request if mock is on and prompt is off.
3559
3560         Renaming UserMediaProcessManager::willEnableMediaStreamInPage to muteCaptureMediaStreamsExceptIn.
3561         This eases reading the code.
3562         Making sure that a page for which a new getUserMedia MediaStream will be created is capture-unmuted.
3563
3564         * Shared/WebPreferencesDefinitions.h:
3565         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3566         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
3567         * UIProcess/UserMediaProcessManager.cpp:
3568         (WebKit::UserMediaProcessManager::muteCaptureMediaStreamsExceptIn):
3569         (WebKit::UserMediaProcessManager::willCreateMediaStream):
3570         * UIProcess/UserMediaProcessManager.h:
3571         * UIProcess/WebPageProxy.cpp:
3572         (WebKit::WebPageProxy::setMuted):
3573         * UIProcess/WebPageProxy.h:
3574         (WebKit::WebPageProxy::activateMediaStreamCaptureInPage):
3575
3576 2017-06-06  Carlos Garcia Campos  <cgarcia@igalia.com>
3577
3578         [WPE] Enable remote inspector
3579         https://bugs.webkit.org/show_bug.cgi?id=172971
3580
3581         Reviewed by Žan Doberšek.
3582
3583         Initialize the remote inpector if needed.
3584
3585         * UIProcess/wpe/WebProcessPoolWPE.cpp:
3586         (WebKit::initializeRemoteInspectorServer):
3587         (WebKit::WebProcessPool::platformInitialize):
3588
3589 2017-06-06  Carlos Garcia Campos  <cgarcia@igalia.com>
3590
3591         [GLIB] Make remote inspector DBus protocol common to all glib based ports
3592         https://bugs.webkit.org/show_bug.cgi?id=172970
3593
3594         Reviewed by Žan Doberšek.
3595
3596         Use webkit instead of webkitgtk and reomve platform idfeds.
3597
3598         * UIProcess/glib/RemoteInspectorClient.cpp:
3599
3600 2017-06-06  Zan Dobersek  <zdobersek@igalia.com>
3601
3602         [WPE] Don't disable Web security preference by default
3603         https://bugs.webkit.org/show_bug.cgi?id=172964
3604
3605         Reviewed by Carlos Garcia Campos.
3606
3607         * UIProcess/API/wpe/WPEView.cpp:
3608         (WKWPE::View::View): Don't disable Web security by default.
3609
3610 2017-06-05  Chris Dumez  <cdumez@apple.com>
3611
3612         ASSERTION FAILED: RunLoop::isMain() in com.apple.WebKit: IPC::Connection::sendSyncMessage + 128
3613         https://bugs.webkit.org/show_bug.cgi?id=172943
3614         <rdar://problem/31288058>
3615
3616         Reviewed by Alexey Proskuryakov.
3617
3618         In Connection::sendMessage(), make sure we only ever transform asynchronous messages into synchronous
3619         ones if sendMessage() is called on the main thread. This is necessary because we no longer support
3620         sending synchronous messages from a background thread since r205125.
3621
3622         * Platform/IPC/Connection.cpp:
3623         (IPC::Connection::sendMessage):
3624         (IPC::Connection::sendSyncMessage):
3625
3626 2017-06-05  Joseph Pecoraro  <pecoraro@apple.com>
3627
3628         Revert r217405, this headerpad increase is no longer needed.
3629
3630         Rubber-stamped by Dan Bernstein.
3631
3632         * Configurations/BaseXPCService.xcconfig:
3633
3634 2017-06-05  Dan Bernstein  <mitz@apple.com>
3635
3636         Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.
3637
3638         * UIProcess/Cocoa/WebViewImpl.h:
3639         * UIProcess/Cocoa/WebViewImpl.mm:
3640         (WebKit::WebViewImpl::mediaPlaybackControlsView):
3641
3642 2017-06-05  Jer Noble  <jer.noble@apple.com>
3643
3644         Allow clients to specify a list of codecs which should require hardware decode support.
3645         https://bugs.webkit.org/show_bug.cgi?id=172787
3646
3647         Reviewed by Alex Christensen.
3648
3649         Add a WKWebPageConfiguration (and associated WebPreferences and WKPreferencesRef) properties
3650         allowing clients to require specified codecs have hardware decode support. Also open up the
3651         sandbox on Cocoa ports to services required to check for hardware decode availability.
3652
3653         * Shared/WebPreferencesDefinitions.h:
3654         * UIProcess/API/C/WKPreferences.cpp:
3655         (WKPreferencesSetMediaCodecsRequiringHardwareSupport):
3656         (WKPreferencesCopyMediaCodecsRequiringHardwareSupport):
3657         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3658         * UIProcess/API/Cocoa/WKWebView.mm:
3659         (-[WKWebView _initializeWithConfiguration:]):
3660         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3661         (-[WKWebViewConfiguration copyWithZone:]):
3662         (-[WKWebViewConfiguration _mediaCodecsRequiringHardwareSupport]):
3663         (-[WKWebViewConfiguration _setMediaCodecsRequiringHardwareSupport:]):
3664         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3665         * WebProcess/com.apple.WebProcess.sb.in:
3666
3667 2017-06-05  Beth Dakin  <bdakin@apple.com>
3668
3669         Modify Netflix controlsManager quirk to prevent only scrubbing
3670         https://bugs.webkit.org/show_bug.cgi?id=172881
3671         -and corresponding-
3672         rdar://problem/32228660
3673
3674         Reviewed by Andy Estes.
3675
3676         Plumbing for allowsTouchBarScrubbing. See WebCore ChangeLog for more details.
3677
3678         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
3679         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in:
3680         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
3681         (WebKit::WebPlaybackSessionModelContext::setAllowsTouchBarScrubbing):
3682         (WebKit::WebPlaybackSessionManagerProxy::setAllowsTouchBarScrubbing):
3683         * WebProcess/cocoa/WebPlaybackSessionManager.h:
3684         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
3685         (WebKit::WebPlaybackSessionInterfaceContext::allowsTouchBarScrubbingChanged):
3686         (WebKit::WebPlaybackSessionManager::allowsTouchBarScrubbingChanged):
3687
3688 2017-06-05  Carlos Garcia Campos  <cgarcia@igalia.com>
3689
3690         Unreviewed. Fix GTK+ build with OpenGL disabled after r217779.
3691
3692         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
3693         (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged):
3694
3695 2017-06-05  Carlos Garcia Campos  <cgarcia@igalia.com>
3696
3697         [WPE] Use AcceleratedDrawingArea instead of its fork
3698         https://bugs.webkit.org/show_bug.cgi?id=172496
3699
3700         Reviewed by Žan Doberšek.
3701
3702         WPE uses its own drawing area implementation, which is actually a fork of AcceleratedDrawingArea, but simplified
3703         for the case of compositing being always forced. AcceleratedDrawingArea already handles the case of compositing
3704         being forced, so now that WPE is upstream we could simply use AcceleratedDrawingArea instead.
3705
3706         * PlatformWPE.cmake:
3707         * Shared/DrawingAreaInfo.h: Remove DrawingAreaTypeWPE type.
3708         * UIProcess/API/wpe/DrawingAreaProxyWPE.cpp: Removed.
3709         * UIProcess/API/wpe/DrawingAreaProxyWPE.h: Removed.
3710         * UIProcess/API/wpe/PageClientImpl.cpp:
3711         (WebKit::PageClientImpl::createDrawingAreaProxy): Create an AcceleratedDrawingAreaProxy.
3712         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
3713         (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged): Moved from DrawingAreaImpl since it actually
3714         belongs here.
3715         * WebProcess/WebPage/DrawingArea.cpp:
3716         (WebKit::DrawingArea::create): Create an AcceleratedDrawingArea for WPE port.
3717         * WebProcess/WebPage/DrawingAreaImpl.cpp: Remove mainFrameContentSizeChanged() that doesn't belong here.
3718         * WebProcess/WebPage/DrawingAreaImpl.h:
3719         * WebProcess/WebPage/wpe/DrawingAreaWPE.cpp: Removed.
3720         * WebProcess/WebPage/wpe/DrawingAreaWPE.h: Removed.
3721
3722 2017-06-03  Simon Fraser  <simon.fraser@apple.com>
3723
3724         Sort the project file.
3725
3726         * WebKit2.xcodeproj/project.pbxproj:
3727
3728 2017-06-02  Chris Dumez  <cdumez@apple.com>
3729
3730         ResourceLoadStatistics are not using unique paths during test runs
3731         https://bugs.webkit.org/show_bug.cgi?id=172861
3732         <rdar://problem/32442251>
3733
3734         Reviewed by Darin Adler.
3735
3736         Add WKContextConfigurationSetResourceLoadStatisticsDirectory() C API to allow
3737         WKTR to use a custom directory.
3738
3739         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3740         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
3741         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
3742         (API::ProcessPoolConfiguration::copy):
3743         * UIProcess/API/APIProcessPoolConfiguration.h:
3744         * UIProcess/API/C/WKContextConfigurationRef.cpp:
3745         (WKContextConfigurationCopyResourceLoadStatisticsDirectory):
3746         (WKContextConfigurationSetResourceLoadStatisticsDirectory):
3747         * UIProcess/API/C/WKContextConfigurationRef.h:
3748         * UIProcess/WebProcessPool.cpp:
3749         (WebKit::legacyWebsiteDataStoreConfiguration):
3750
3751 2017-06-02  Brady Eidson  <beidson@apple.com>
3752
3753         Prevent scheme handlers from handling all built-in URL schemes.
3754         <rdar://problem/32404790> and https://bugs.webkit.org/show_bug.cgi?id=172869
3755
3756         Reviewed by Andy Estes.
3757
3758         * UIProcess/API/Cocoa/WKWebView.mm:
3759         (+[WKWebView handlesURLScheme:]): Check against WebCore's new master list of URL schemes.
3760
3761 2017-06-02  Simon Fraser  <simon.fraser@apple.com>
3762
3763         All scroll peformance logging should happen in the UI process
3764         https://bugs.webkit.org/show_bug.cgi?id=172874
3765         rdar://problem/24474830
3766
3767         Reviewed by Tim Horton.
3768
3769         Printing to stdout from the WebProcess doesn't show up anywhere in non-development builds,
3770         so we have to log from the UI process.
3771
3772         Achieve this by adding a PerformanceLoggingClient to Page which forwards messages to
3773         WebPageProxy, which prints them with the same format they had before. Some plumbing through
3774         PlatformCALayerClient and GraphicsLayerClient is required to get messages from TileControllers
3775         through to something that can get to Page.
3776
3777         * UIProcess/WebPageProxy.cpp:
3778         (WebKit::WebPageProxy::logScrollingEvent):
3779         * UIProcess/WebPageProxy.h:
3780         * UIProcess/WebPageProxy.messages.in:
3781         * WebKit2.xcodeproj/project.pbxproj:
3782         * WebProcess/WebCoreSupport/WebPerformanceLoggingClient.cpp: Added.
3783         (WebKit::WebPerformanceLoggingClient::WebPerformanceLoggingClient):
3784         (WebKit::WebPerformanceLoggingClient::logScrollingEvent):
3785         * WebProcess/WebCoreSupport/WebPerformanceLoggingClient.h: Added.
3786         * WebProcess/WebPage/WebPage.cpp:
3787         (WebKit::m_cpuLimit):
3788
3789 2017-06-02  Chris Dumez  <cdumez@apple.com>
3790
3791         REGRESSION (r206386): Xactimate Website Crashes @ com.apple.WebKit: WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant + 255
3792         https://bugs.webkit.org/show_bug.cgi?id=172846
3793         <rdar://problem/31093005>
3794
3795         Reviewed by Mark Lam.
3796
3797         Follow-up to r217695 to deal with exceptions potentially thrown by
3798         NPRuntimeObjectMap::convertJSValueToNPVariant() as well.
3799
3800         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
3801         (WebKit::NPJSObject::invoke):
3802
3803 2017-06-02  Jeremy Jones  <jeremyj@apple.com>
3804
3805         Add abilility to specify presentingApplicationPID for a WebProcessPool.
3806         https://bugs.webkit.org/show_bug.cgi?id=172839
3807         rdar://problem/32247170
3808
3809         Reviewed by Tim Horton.
3810
3811         Expose presentingApplicationPID through WebProcessPoolConfiguration.
3812         This allows rehosted WebViews to specify the hosting application.
3813
3814         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3815         (API::ProcessPoolConfiguration::copy):
3816         * UIProcess/API/APIProcessPoolConfiguration.h:
3817         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
3818         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3819         (-[_WKProcessPoolConfiguration setPresentingApplicationPID:]):
3820         (-[_WKProcessPoolConfiguration presentingApplicationPID]):
3821         * UIProcess/WebProcessPool.cpp:
3822         (WebKit::WebProcessPool::ensureNetworkProcess):
3823         (WebKit::WebProcessPool::createNewWebProcess):
3824
3825 2017-06-02  Frederic Wang  <fwang@igalia.com>
3826
3827         [Mac] Use compositing for frames when ScrollingTreeIncludesFrames=true
3828         https://bugs.webkit.org/show_bug.cgi?id=172851
3829
3830         Reviewed by Simon Fraser.
3831
3832         When fast frame scrolling is supported on mac (bug 171667), scrollable frames will require
3833         special composited layer. This commit enables that on mac but only when
3834         ScrollingTreeIncludesFrames=true, so that the default behavior is unchanged.
3835
3836         * WebProcess/WebCoreSupport/WebChromeClient.h: Make scrollable inner frame trigger
3837         compositing on Mac by default. This is ignored on mac when ScrollingTreeIncludesFrames=false.
3838         Rename ScrollableInnerFrameTrigger to ScrollableNonMainFrameTrigger.
3839
3840 2017-06-02  Zalan Bujtas  <zalan@apple.com>
3841
3842         Allow clients to override viewport size for CSS viewport units.
3843         https://bugs.webkit.org/show_bug.cgi?id=172838
3844         <rdar://problem/32523441>
3845
3846         Reviewed by Tim Horton.
3847
3848         This enables auto-sizing clients to ensure that styles relative to the viewport are
3849         resolved to a set value (presumably the size of the container) as opposed to the preferred
3850         document size (which is set as the FrameView size).
3851
3852         * Shared/WebPageCreationParameters.cpp:
3853         (WebKit::WebPageCreationParameters::encode):
3854         (WebKit::WebPageCreationParameters::decode):
3855         * Shared/WebPageCreationParameters.h:
3856         * UIProcess/API/Cocoa/WKWebView.mm:
3857         (-[WKWebView _viewportSizeForCSSViewportUnits]):
3858         (-[WKWebView _setViewportSizeForCSSViewportUnits:]):
3859         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3860         * UIProcess/WebPageProxy.cpp:
3861         (WebKit::WebPageProxy::creationParameters):
3862         (WebKit::WebPageProxy::setViewportSizeForCSSViewportUnits):
3863         * UIProcess/WebPageProxy.h:
3864         (WebKit::WebPageProxy::viewportSizeForCSSViewportUnits):
3865         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3866         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
3867         * WebProcess/WebPage/WebPage.cpp:
3868         (WebKit::m_cpuLimit):
3869         (WebKit::WebPage::setViewportSizeForCSSViewportUnits):
3870         * WebProcess/WebPage/WebPage.h:
3871         (WebKit::WebPage::viewportSizeForCSSViewportUnits):
3872         * WebProcess/WebPage/WebPage.messages.in:
3873
3874 2017-06-02  Simon Fraser  <simon.fraser@apple.com>
3875
3876         Get <chrono> out of StdLibExtras.h
3877         https://bugs.webkit.org/show_bug.cgi?id=172744
3878
3879         Reviewed by Zalan Bujtas.
3880
3881         Only bring in <chrono> and namespace std::literals::chrono_literals when necessary.
3882
3883         * NetworkProcess/cache/NetworkCache.cpp:
3884         * NetworkProcess/cache/NetworkCacheFileSystem.h:
3885         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
3886         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3887         (WebKit::NetworkCache::computeRecordWorth):
3888         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
3889         * WebProcess/Cookies/WebCookieManager.h:
3890
3891 2017-06-02  Andy Estes  <aestes@apple.com>
3892
3893         [Cocoa] Add a "supportedCountries" property to ApplePayPaymentRequest
3894         https://bugs.webkit.org/show_bug.cgi?id=172832
3895         <rdar://problem/30735544>
3896
3897         Reviewed by Alex Christensen.
3898
3899         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
3900         (IPC::ArgumentCoder<PaymentRequest>::encode):
3901         (IPC::ArgumentCoder<PaymentRequest>::decode):
3902         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3903         (WebKit::toNSSet):
3904         (WebKit::toPKPaymentRequest):
3905
3906 2017-06-02  Dan Bernstein  <mitz@apple.com>
3907
3908         [Xcode] Header postprocessing should be based on the target OS version rather than the builder OS version
3909         https://bugs.webkit.org/show_bug.cgi?id=172860
3910
3911         Reviewed by Anders Carlsson.
3912
3913         * Configurations/WebKit.xcconfig: Use TARGET_MAC_OS_X_VERSION_MAJOR
3914
3915 2017-06-02  Gwang Yoon Hwang  <yoon@igalia.com>
3916
3917         REGRESSION(r217214): [Coordinated Graphics] UpdateAtlas didn't released while resetting testrunner
3918         https://bugs.webkit.org/show_bug.cgi?id=172746
3919
3920         Reviewed by Žan Doberšek.
3921
3922         After clearing update atlases in CompositingCoordinator, we should
3923         release update atlases at the compositing thread, too.
3924
3925         We cannot remove update atlases from the CoordinatedGraphicsScene
3926         without regard to update scheduling, since previously committed scene
3927         states can try to use already released update atlases.
3928         To prevent this timing problem, releasing update atlases should be done
3929         with a update scheduler.
3930
3931         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
3932         (WebKit::CoordinatedGraphicsScene::syncRemoteContent):
3933         (WebKit::CoordinatedGraphicsScene::appendUpdate):
3934         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
3935         Use WTF::Function instead of std::function
3936         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3937         (WebKit::ThreadedCompositor::updateSceneState):
3938         (WebKit::ThreadedCompositor::releaseUpdateAtlases):
3939         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
3940         (WebKit::ThreadedCompositor::flushPendingLayerChanges):
3941         Release UpdateAtlases at the end of compositing states update, too.
3942         (WebKit::CompositingCoordinator::clearUpdateAtlases):
3943
3944 2017-06-01  Andreas Kling  <akling@apple.com>
3945
3946         [Mac] Remove backing store for layers that are outside the viewport
3947         https://bugs.webkit.org/show_bug.cgi?id=170082
3948         <rdar://problem/31245009>
3949
3950         Reviewed by Simon Fraser.
3951
3952         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
3953
3954 2017-06-01  Chris Dumez  <cdumez@apple.com>
3955
3956         REGRESSION (r206386): Xactimate Website Crashes @ com.apple.WebKit: WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant + 255
3957         https://bugs.webkit.org/show_bug.cgi?id=172846
3958         <rdar://problem/31093005>
3959
3960         Reviewed by Andreas Kling.
3961
3962         In NPJSObject::invoke(), return early if there was an exception when calling JSC::call().
3963         Using the value returned by JSC::call() when an exception occurred is unsafe.
3964
3965         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
3966         (WebKit::NPJSObject::invoke):
3967
3968 2017-06-01  Jon Lee  <jonlee@apple.com>
3969
3970         Rename an experimental feature item
3971         https://bugs.webkit.org/show_bug.cgi?id=172830
3972
3973         Reviewed by Joseph Pecoraro.
3974
3975         * Shared/WebPreferencesDefinitions.h:
3976
3977 2017-06-01  Andy Estes  <aestes@apple.com>
3978
3979         REGRESSION (r217626): ENABLE_APPLE_PAY_SESSION_V3 was disabled by mistake
3980         https://bugs.webkit.org/show_bug.cgi?id=172828
3981
3982         Reviewed by Beth Dakin.
3983
3984         * Configurations/FeatureDefines.xcconfig:
3985
3986 2017-06-01  Chris Dumez  <cdumez@apple.com>
3987
3988         [WK2] Update plugin process sandbox profile for flash plugin on HBONow
3989         https://bugs.webkit.org/show_bug.cgi?id=172820
3990         <rdar://problem/32513297>
3991
3992         Reviewed by Brent Fulgham.
3993
3994         Relax the IOKit whitelist to silence sandbox violations by Flash plugin on
3995         HBONow.
3996
3997         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
3998
3999 2017-06-01  Andy Estes  <aestes@apple.com>
4000
4001         [Cocoa] Upstream support for JCB as a supported payment network
4002         https://bugs.webkit.org/show_bug.cgi?id=172819
4003
4004         Reviewed by Tim Horton.
4005
4006         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: