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