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