Replace staging-prefixed UIKit drag and drop delegate methods with their public SDK...
[WebKit.git] / Source / WebKit2 / ChangeLog
1 2017-06-29  Wenson Hsieh  <wenson_hsieh@apple.com>
2
3         Replace staging-prefixed UIKit drag and drop delegate methods with their public SDK versions
4         https://bugs.webkit.org/show_bug.cgi?id=173959
5
6         Reviewed by Sam Weinig.
7
8         Remove references to _api_-prefixed UIDragInteractionDelegate and UIDropInteractionDelegate methods,
9         and replace them with their counterparts in the public SDK.
10
11         * UIProcess/ios/WKContentViewInteraction.mm:
12         (-[WKContentView dragInteraction:previewForLiftingItem:session:]):
13         (-[WKContentView dragInteraction:session:didEndWithOperation:]):
14         (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
15         (-[WKContentView dropInteraction:sessionDidEnter:]):
16         (-[WKContentView dropInteraction:sessionDidUpdate:]):
17         (-[WKContentView _simulateDataInteractionEntered:]):
18         (-[WKContentView _simulateDataInteractionUpdated:]):
19         (-[WKContentView _simulateDataInteractionSessionDidEnd:]):
20         (-[WKContentView _api_dragInteraction:previewForLiftingItem:session:]): Deleted.
21         (-[WKContentView _api_dragInteraction:session:didEndWithOperation:]): Deleted.
22         (-[WKContentView _api_dragInteraction:item:willAnimateCancelWithAnimator:]): Deleted.
23         (-[WKContentView _api_dropInteraction:sessionDidEnter:]): Deleted.
24         (-[WKContentView _api_dropInteraction:sessionDidUpdate:]): Deleted.
25
26 2017-06-29  Carlos Garcia Campos  <cgarcia@igalia.com>
27
28         Unreviewed. Fix GTK+ unit tests crashing after r218922.
29
30         We need to check if icon database exists and is open now on dispose and API entry points.
31
32         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
33         (webkitFaviconDatabaseDispose):
34         (webkit_favicon_database_get_favicon_uri):
35         (webkit_favicon_database_clear):
36
37 2017-06-29  Carlos Garcia Campos  <cgarcia@igalia.com>
38
39         [GTK][WPE] Implement API::IconLoadingClient and rework WebKitFaviconDatabase to use IconDatabase directly
40         https://bugs.webkit.org/show_bug.cgi?id=173877
41
42         Reviewed by Brady Eidson.
43
44         This way IconDatabase and its related classes can be removed from WebCore, as well as the WebKit2 implementation
45         and C API. For now I've copied IconDatabase from WebCore to WebKit2 under the glib API directory, adding the
46         related classes as private inside IconDatabase, and removing some methods that are not used by the GLib API.
47
48         * PlatformGTK.cmake:
49         * UIProcess/API/glib/IconDatabase.cpp: Added.
50         (WebKit::urlForLogging):
51         (WebKit::defaultClient):
52         (WebKit::IconDatabase::IconRecord::IconRecord):
53         (WebKit::IconDatabase::IconRecord::~IconRecord):
54         (WebKit::IconDatabase::IconRecord::image):
55         (WebKit::IconDatabase::IconRecord::setImageData):
56         (WebKit::IconDatabase::IconRecord::loadImageFromResource):
57         (WebKit::IconDatabase::IconRecord::imageDataStatus):
58         (WebKit::IconDatabase::IconRecord::snapshot):
59         (WebKit::IconDatabase::PageURLRecord::PageURLRecord):
60         (WebKit::IconDatabase::PageURLRecord::~PageURLRecord):
61         (WebKit::IconDatabase::PageURLRecord::setIconRecord):
62         (WebKit::IconDatabase::PageURLRecord::snapshot):
63         (WebKit::IconDatabase::setClient):
64         (WebKit::IconDatabase::open):
65         (WebKit::IconDatabase::close):
66         (WebKit::IconDatabase::removeAllIcons):
67         (WebKit::documentCanHaveIcon):
68         (WebKit::IconDatabase::synchronousIconForPageURL):
69         (WebKit::IconDatabase::synchronousIconURLForPageURL):
70         (WebKit::IconDatabase::retainIconForPageURL):
71         (WebKit::IconDatabase::performRetainIconForPageURL):
72         (WebKit::IconDatabase::releaseIconForPageURL):
73         (WebKit::IconDatabase::performReleaseIconForPageURL):
74         (WebKit::IconDatabase::setIconDataForIconURL):
75         (WebKit::IconDatabase::setIconURLForPageURL):
76         (WebKit::IconDatabase::synchronousLoadDecisionForIconURL):
77         (WebKit::IconDatabase::synchronousIconDataKnownForIconURL):
78         (WebKit::IconDatabase::setEnabled):
79         (WebKit::IconDatabase::isEnabled):
80         (WebKit::IconDatabase::setPrivateBrowsingEnabled):
81         (WebKit::IconDatabase::isPrivateBrowsingEnabled):
82         (WebKit::IconDatabase::delayDatabaseCleanup):
83         (WebKit::IconDatabase::allowDatabaseCleanup):
84         (WebKit::IconDatabase::checkIntegrityBeforeOpening):
85         (WebKit::IconDatabase::IconDatabase):
86         (WebKit::IconDatabase::~IconDatabase):
87         (WebKit::IconDatabase::wakeSyncThread):
88         (WebKit::IconDatabase::scheduleOrDeferSyncTimer):
89         (WebKit::IconDatabase::syncTimerFired):
90         (WebKit::IconDatabase::isOpen):
91         (WebKit::IconDatabase::isOpenBesidesMainThreadCallbacks):
92         (WebKit::IconDatabase::databasePath):
93         (WebKit::IconDatabase::defaultDatabaseFilename):
94         (WebKit::IconDatabase::getOrCreateIconRecord):
95         (WebKit::IconDatabase::getOrCreatePageURLRecord):
96         (WebKit::IconDatabase::shouldStopThreadActivity):
97         (WebKit::IconDatabase::iconDatabaseSyncThread):
98         (WebKit::databaseVersionNumber):
99         (WebKit::isValidDatabase):
100         (WebKit::createDatabaseTables):
101         (WebKit::IconDatabase::performOpenInitialization):
102         (WebKit::IconDatabase::checkIntegrity):
103         (WebKit::IconDatabase::performURLImport):
104         (WebKit::IconDatabase::syncThreadMainLoop):
105         (WebKit::IconDatabase::performPendingRetainAndReleaseOperations):
106         (WebKit::IconDatabase::readFromDatabase):
107         (WebKit::IconDatabase::writeToDatabase):
108         (WebKit::IconDatabase::pruneUnretainedIcons):
109         (WebKit::IconDatabase::checkForDanglingPageURLs):
110         (WebKit::IconDatabase::removeAllIconsOnThread):
111         (WebKit::IconDatabase::deleteAllPreparedStatements):
112         (WebKit::IconDatabase::cleanupSyncThread):
113         (WebKit::readySQLiteStatement):
114         (WebKit::IconDatabase::setIconURLForPageURLInSQLDatabase):
115         (WebKit::IconDatabase::setIconIDForPageURLInSQLDatabase):
116         (WebKit::IconDatabase::removePageURLFromSQLDatabase):
117         (WebKit::IconDatabase::getIconIDForIconURLFromSQLDatabase):
118         (WebKit::IconDatabase::addIconURLToSQLDatabase):
119         (WebKit::IconDatabase::getImageDataForIconURLFromSQLDatabase):
120         (WebKit::IconDatabase::removeIconFromSQLDatabase):
121         (WebKit::IconDatabase::writeIconSnapshotToSQLDatabase):
122         (WebKit::IconDatabase::checkClosedAfterMainThreadCallback):
123         (WebKit::IconDatabase::dispatchDidImportIconURLForPageURLOnMainThread):
124         (WebKit::IconDatabase::dispatchDidImportIconDataForPageURLOnMainThread):
125         (WebKit::IconDatabase::dispatchDidRemoveAllIconsOnMainThread):
126         (WebKit::IconDatabase::dispatchDidFinishURLImportOnMainThread):
127         * UIProcess/API/glib/IconDatabase.h: Added.
128         (WebKit::IconDatabaseClient::didImportIconURLForPageURL):
129         (WebKit::IconDatabaseClient::didImportIconDataForPageURL):
130         (WebKit::IconDatabaseClient::didChangeIconForPageURL):
131         (WebKit::IconDatabaseClient::didRemoveAllIcons):
132         (WebKit::IconDatabaseClient::didFinishURLImport):
133         (WebKit::IconDatabaseClient::didClose):
134         (WebKit::IconDatabase::IconSnapshot::IconSnapshot):
135         (WebKit::IconDatabase::IconSnapshot::iconURL):
136         (WebKit::IconDatabase::IconSnapshot::timestamp):
137         (WebKit::IconDatabase::IconSnapshot::data):
138         (WebKit::IconDatabase::IconRecord::create):
139         (WebKit::IconDatabase::IconRecord::getTimestamp):
140         (WebKit::IconDatabase::IconRecord::setTimestamp):
141         (WebKit::IconDatabase::IconRecord::iconURL):
142         (WebKit::IconDatabase::IconRecord::retainingPageURLs):
143         (WebKit::IconDatabase::PageURLSnapshot::PageURLSnapshot):
144         (WebKit::IconDatabase::PageURLSnapshot::pageURL):
145         (WebKit::IconDatabase::PageURLSnapshot::iconURL):
146         (WebKit::IconDatabase::PageURLRecord::url):
147         (WebKit::IconDatabase::PageURLRecord::iconRecord):
148         (WebKit::IconDatabase::PageURLRecord::retain):
149         (WebKit::IconDatabase::PageURLRecord::release):
150         (WebKit::IconDatabase::PageURLRecord::retainCount):
151         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
152         (_WebKitFaviconDatabasePrivate::~_WebKitFaviconDatabasePrivate):
153         (getIconSurfaceSynchronously):
154         (webkitFaviconDatabaseSetIconURLForPageURL):
155         (webkitFaviconDatabaseCreate):
156         (webkitFaviconDatabaseOpen):
157         (webkitFaviconDatabaseIsOpen):
158         (webkitFaviconDatabaseSetPrivateBrowsingEnabled):
159         (webkitFaviconDatabaseGetLoadDecisionForIcon):
160         (webkitFaviconDatabaseSetIconForPageURL):
161         (webkit_favicon_database_get_favicon):
162         (webkit_favicon_database_get_favicon_uri):
163         * UIProcess/API/glib/WebKitFaviconDatabasePrivate.h:
164         * UIProcess/API/glib/WebKitIconLoadingClient.cpp: Added.
165         (IconLoadingClient::IconLoadingClient):
166         (attachIconLoadingClientToView):
167         * UIProcess/API/glib/WebKitIconLoadingClient.h: Copied from Source/WebKit2/UIProcess/API/glib/WebKitFaviconDatabasePrivate.h.
168         * UIProcess/API/glib/WebKitWebContext.cpp:
169         (ensureFaviconDatabase):
170         (webkitWebContextEnableIconDatabasePrivateBrowsingIfNeeded):
171         (webkitWebContextDisableIconDatabasePrivateBrowsingIfNeeded):
172         (webkit_web_context_set_favicon_database_directory):
173         * UIProcess/API/glib/WebKitWebView.cpp:
174         (webkitWebViewConstructed):
175         (webkitWebViewGetLoadDecisionForIcon):
176         (webkitWebViewSetIcon):
177         * UIProcess/API/glib/WebKitWebViewPrivate.h:
178
179 2017-06-28  Tim Horton  <timothy_horton@apple.com>
180
181         MobileSafari was constantly using 10-15% CPU viewing a PDF
182         https://bugs.webkit.org/show_bug.cgi?id=173944
183         <rdar://problem/33039910>
184
185         Reviewed by Simon Fraser.
186
187         * UIProcess/API/Cocoa/WKWebView.mm:
188         (-[WKWebView _doAfterNextStablePresentationUpdate:]):
189         (-[WKWebView _doAfterNextPresentationUpdate:]):
190         (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForPainting:]):
191         Bail early and just dispatch_async the completion block if we are using a custom
192         content view; these methods are very specific to the implementation of WKContentView
193         and don't make sense with custom content views.
194
195         doAfterNextStablePresentationUpdate is particularly egregious because, since
196         we will never call the stable update callbacks (because we bail from didCommitLayerTree
197         if we aren't using WKContentView), it will keep calling doAfterNextPresentationUpdate
198         over and over again.
199
200 2017-06-28  Brent Fulgham  <bfulgham@apple.com>
201
202         [WK2][macOS][iOS] Don't request microphone access for clients that don't need it.
203         https://bugs.webkit.org/show_bug.cgi?id=173948
204         <rdar://problem/32103275>
205
206         Reviewed by Eric Carlson.
207
208         Don't bother requesting a sandbox extension to access the microphone for any clients
209         on the Cocoa platform that are not Safari. Other clients don't have the necessary
210         system entitlements, and always fail leading to annoying SandboxViolation reports.
211
212         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
213         (WebKit::WebProcessPool::platformInitializeWebProcess): 
214
215 2017-06-29  Zalan Bujtas  <zalan@apple.com>
216
217         Move RenderEmbeddedObject::isReplacementObscured to HTMLPlugInElement
218         https://bugs.webkit.org/show_bug.cgi?id=173802
219         <rdar://problem/32884389>
220
221         Reviewed by Simon Fraser.
222
223         * WebProcess/WebPage/WebPage.cpp:
224         (WebKit::WebPage::createPlugin):
225
226 2017-06-28  Ryosuke Niwa  <rniwa@webkit.org>
227
228         REGRESSION (r218842): com.apple.WebKit crash in WebKit::ProcessLauncher::launchProcess
229         https://bugs.webkit.org/show_bug.cgi?id=173950
230
231         Reviewed by Chris Dumez.
232
233         Added a null check as m_xpcConnection could be nullptr here in the case platformInvalidate had been called.
234
235         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
236         (WebKit::ProcessLauncher::launchProcess):
237
238 2017-06-28  Youenn Fablet  <youenn@apple.com>
239
240         Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration
241         https://bugs.webkit.org/show_bug.cgi?id=169389
242
243         Reviewed by Alex Christensen.
244
245         Updating according new WebCore LIbWebRTCProvider API.
246
247         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
248         (WebKit::LibWebRTCProvider::createPeerConnection):
249         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
250
251 2017-06-28  Chris Dumez  <cdumez@apple.com>
252
253         [iOS] Allow WKWebView clients to play audio in the background
254         https://bugs.webkit.org/show_bug.cgi?id=173932
255         <rdar://problem/32851547>
256
257         Reviewed by Ryosuke Niwa.
258
259         Allow WKWebView clients (such as MobileSafari) to play audio in the background
260         by taking a process assertion whenever a WebPage is audible.
261
262         * UIProcess/WebPageProxy.cpp:
263         (WebKit::WebPageProxy::updateThrottleState):
264
265 2017-06-28  Brent Fulgham  <bfulgham@apple.com>
266
267         Teach ResourceLoadStatistics to recognize changes in the file system
268         https://bugs.webkit.org/show_bug.cgi?id=173800
269         <rdar://problem/32937842>
270
271         Reviewed by Chris Dumez.
272
273         We want to support the case where multiple UI processes choose to share the same
274         statistics file. To support this, update the ResourceLoadStatistics logic to be aware
275         that the statistics data file might change underneath it, and to take appropriate
276         action when it does.
277
278         * UIProcess/WebResourceLoadStatisticsStore.cpp:
279         (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsEnabled): When we enable
280         the statistics, read in the data and then watch for changes.
281         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Add a
282         'delete data' handler to remove the file on disk, not just write an empty store.
283         (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): Use ASCIILiteral.
284         (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk): Convenience function.
285         (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk): Sync with any on-disk
286         storage before writing out.
287         (WebKit::openAndLockFile): Convenience function.
288         (WebKit::closeAndUnlockFile): Ditto.
289         (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk): Revise to lock file (on
290         platforms that support it) before writing to disk.
291         (WebKit::WebResourceLoadStatisticsStore::deleteStoreFromDisk): Added convenience function.
292         (WebKit::WebResourceLoadStatisticsStore::clearInMemoryData): Ditto.
293         (WebKit::WebResourceLoadStatisticsStore::startMonitoringStatisticsStorage): Create a
294         file system monitor to watch for file changes.
295         (WebKit::WebResourceLoadStatisticsStore::syncWithExistingStatisticsStorageIfNeeded): Added
296         convenience function.
297         (WebKit::WebResourceLoadStatisticsStore::createDecoderFromDisk): Revise to read data
298         directly so we can control file locking.
299         * UIProcess/WebResourceLoadStatisticsStore.h:
300
301 2017-06-28  Wenson Hsieh  <wenson_hsieh@apple.com>
302
303         Followup to r218885: adjust for further UIKit SPI changes
304         https://bugs.webkit.org/show_bug.cgi?id=173927
305         <rdar://problem/33020792>
306
307         Reviewed by Tim Horton.
308
309         On ToT, UIKit now invokes -_dragInteraction:item:shouldDelaySetDownAnimationWithCompletion: before the
310         completion block of -dragInteraction:willAnimateLiftWithAnimator:session: is called. This means we now need to
311         store the completion block in -shouldDelaySetDownAnimationWithCompletion: and wait until the UIDragAnimating
312         completion block in -willAnimateCancelWithAnimator: before invoking it.
313
314         * UIProcess/ios/WKContentViewInteraction.h:
315         * UIProcess/ios/WKContentViewInteraction.mm:
316         (-[WKContentView cleanUpDragSourceSessionState]):
317
318         Ensure that the set-down completion block is invoked when a drag session ends (e.g., if the web content process
319         crashes).
320
321         (-[WKContentView _dragInteraction:item:shouldDelaySetDownAnimationWithCompletion:]):
322         (-[WKContentView _api_dragInteraction:item:willAnimateCancelWithAnimator:]):
323
324 2017-06-28  Wenson Hsieh  <wenson_hsieh@apple.com>
325
326         dropInteraction:sessionDidEnd: invokes dragEnded with a UIDragOperation rather than a WebCore::DragOperation
327         https://bugs.webkit.org/show_bug.cgi?id=173935
328
329         Reviewed by Tim Horton.
330
331         Replaces a use of UIDragOperationNone with DragOperationNone.
332         Currently, there is no change in behavior since these are currently the same value (0).
333
334         * UIProcess/ios/WKContentViewInteraction.mm:
335         (-[WKContentView dropInteraction:sessionDidEnd:]):
336
337 2017-06-28  Alex Christensen  <achristensen@webkit.org>
338
339         WebsitePolicies given with navigation policy for redirects should apply to the provisional document
340         https://bugs.webkit.org/show_bug.cgi?id=173886
341         <rdar://problem/32543191>
342
343         Reviewed by Andy Estes.
344         
345         If, for example, we deny video autoplay for the initial request but allow it for the redirect destination
346         location, the document should allow video autoplay.  We were putting these settings onto the wrong DocumentLoader.
347         When a navigation policy is given to a response of a redirect location, we currently have the DocumentLoader
348         for the loading document in the FrameLoader's provisionalDocumentLoader, not the documentLoader.
349         
350         Covered by a new API test.
351
352         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
353         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
354
355 2017-06-28  Konstantin Tokarev  <annulen@yandex.ru>
356
357         [cmake] Improve configuration tests for librt and libatomic
358         https://bugs.webkit.org/show_bug.cgi?id=173921
359
360         Reviewed by Michael Catanzaro.
361
362         1. Both tests are converted to use specialized CMake modules
363         2. Both libraries are now linked only if they are really needed and usable
364            by compiler
365         3. librt is no more required to be detected by find_library(), which may fail
366            in case of cross-compilation
367         4. libatomic test moved to port-independent CMakeLists.txt
368
369         * CMakeLists.txt:
370         * PlatformGTK.cmake:
371
372 2017-06-28  Alex Christensen  <achristensen@webkit.org>
373
374         Fix CMake build.
375
376         * PlatformMac.cmake:
377
378 2017-06-28  Wenson Hsieh  <wenson_hsieh@apple.com>
379
380         [iOS DnD] [WK2] Dragged content flashes after the preview sets down when cancelling a drag
381         https://bugs.webkit.org/show_bug.cgi?id=173927
382         <rdar://problem/33020792>
383
384         Reviewed by Tim Horton.
385
386         When a drag is cancelled, UIKit normally animates fly-back and set-down animations back-to-back. However, for
387         WebKit2, we need to call out to the web process in order to trigger a repaint of the dragged content at normal
388         opacity when the drag cancel animation completes. Thus, we can hook into UIKit SPI to split the cancellation
389         animation into two discrete phases: the fly-back and the set-down (the latter of which may be deferred using a
390         completion block).
391
392         To do this, we implement a new SPI hook, _dragInteraction:item:shouldDelaySetDownAnimationWithCompletion:, to
393         indicate that the set-down should be deferred, and call the completion block after the next layer tree commit.
394         Since -shouldDelaySetDownAnimationWithCompletion: is invoked after the UIDragAnimating completion block in
395         -willAnimateCancelWithAnimator:, this layer tree commit is guaranteed to come after we've told the web process
396         to repaint at full opacity.
397
398         This patch also accounts for additional changes in UIKit. Once -shouldDelaySetDownAnimationWithCompletion:
399         becomes available, -sessionDidEnd: will no longer be invoked after a cancelled drag lift if the user did not
400         begin moving. This means that our cleanup logic in -sessionDidEnd: will no longer be executed in this case,
401         leaving the view with an inconsistent dragging state. To fix this, we need to implement
402         -dragInteraction:willAnimateLiftWithAnimator:session: to perform drag session cleanup following a cancelled drag
403         lift, for which the drag animator's final position will be UIViewAnimatingPositionStart.
404
405         * UIProcess/ios/WKContentViewInteraction.mm:
406         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
407         (-[WKContentView _dragInteraction:item:shouldDelaySetDownAnimationWithCompletion:]):
408
409 2017-06-28  Chris Dumez  <cdumez@apple.com>
410
411         Avoid double thread dispatch in WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains()
412         https://bugs.webkit.org/show_bug.cgi?id=173904
413
414         Reviewed by Brent Fulgham.
415
416         Avoid double thread dispatch in WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains().
417         It calls fetchData() which dispatches to the main queue, then fetchDataForTopPrivatelyControlledDomains()
418         dispatches to the background queue. It should be possible to get fetchData() to dispatch directly
419         on the right queue.
420
421         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
422         (WebKit::WebsiteDataStore::fetchData):
423         (WebKit::WebsiteDataStore::fetchDataAndApply):
424         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains):
425         * UIProcess/WebsiteData/WebsiteDataStore.h:
426
427 2017-06-27  Chris Dumez  <cdumez@apple.com>
428
429         [ResourceLoadStatistics] Update minimumTimeBetweeenDataRecordsRemoval to 1 hour instead of 1 minute
430         https://bugs.webkit.org/show_bug.cgi?id=173895
431         <rdar://problem/32984366>
432
433         Reviewed by Brent Fulgham.
434
435         Update minimumTimeBetweeenDataRecordsRemoval to 1 hour instead of 1 minute to save battery.
436         Also port code to modern time types.
437
438         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
439         (WKResourceLoadStatisticsManagerSetTimeToLiveUserInteraction):
440         (WKResourceLoadStatisticsManagerSetTimeToLiveCookiePartitionFree):
441         (WKResourceLoadStatisticsManagerSetMinimumTimeBetweeenDataRecordsRemoval):
442         (WKResourceLoadStatisticsManagerSetGrandfatheringTime):
443         * UIProcess/WebResourceLoadStatisticsManager.cpp:
444         (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveUserInteraction):
445         (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveCookiePartitionFree):
446         (WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval):
447         (WebKit::WebResourceLoadStatisticsManager::setGrandfatheringTime):
448         * UIProcess/WebResourceLoadStatisticsManager.h:
449         * UIProcess/WebResourceLoadStatisticsStore.h:
450
451 2017-06-27  Chris Dumez  <cdumez@apple.com>
452
453         Port HysteresisActivity to Seconds type
454         https://bugs.webkit.org/show_bug.cgi?id=173902
455
456         Reviewed by Simon Fraser.
457
458         * WebProcess/WebPage/WebPage.cpp:
459         (WebKit::m_pageScrolledHysteresis):
460
461 2017-06-27  Chris Dumez  <cdumez@apple.com>
462
463         Move WebsiteDataRecord processing off-thread in WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains()
464         https://bugs.webkit.org/show_bug.cgi?id=173882
465         <rdar://problem/32984366>
466
467         Reviewed by Darin Adler.
468
469         Move WebsiteDataRecord processing off-thread in WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains()
470         as we have data showing it is slow and hangs the UIProcess' main thread.
471
472         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
473         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains):
474
475 2017-06-27  Brent Fulgham  <bfulgham@apple.com>
476
477         [WK2][macOS] Expand sandbox to allow access to the CoreMedia volume control endpoint
478         https://bugs.webkit.org/show_bug.cgi?id=173898
479         <rdar://problem/32930754>
480
481         Reviewed by Ryosuke Niwa.
482
483         * WebProcess/com.apple.WebProcess.sb.in:
484
485 2017-06-27  Wenson Hsieh  <wenson_hsieh@apple.com>
486
487         [iOS DnD] Support dragging out of contenteditable areas without a prior selection
488         https://bugs.webkit.org/show_bug.cgi?id=173854
489         <rdar://problem/32236827>
490
491         Reviewed by Ryosuke Niwa and Tim Horton.
492
493         Instead of allowing a drag to occur only if a position information request discovers a clickable node, remove
494         the position information request entirely and just call into WebCore to try and begin the drag. Currently, the
495         position information request serves two purposes:
496         1. To adjust the hit-test location to account for nearby clickable nodes.
497         2. To obtain information about the content being dragged.
498
499         The first requirement is fulfilled by performing the drag location adjustment in WebCore instead (see
500         ChangeLogs for more detail). The second requirement is fulfilled by refactoring in
501         https://bugs.webkit.org/show_bug.cgi?id=173832 to fold all information relevant to starting a drag into the
502         DragItem struct, and then propagating the DragItem struct. The relevant information from the position
503         information update is now populated when the UI process receives the drag start response.
504
505         * UIProcess/ios/WKContentViewInteraction.h:
506         * UIProcess/ios/WKContentViewInteraction.mm:
507         (-[WKContentView _startDrag:item:]):
508         (-[WKContentView computeClientAndGlobalPointsForDropSession:outClientPoint:outGlobalPoint:]):
509         (-[WKContentView _dragInteraction:prepareForSession:completion:]):
510         (-[WKContentView _api_dropInteraction:sessionDidEnter:]):
511         (-[WKContentView _api_dropInteraction:sessionDidUpdate:]):
512         (positionInformationMayStartDataInteraction): Deleted.
513
514 2017-06-27  Chris Dumez  <cdumez@apple.com>
515
516         [iOS] Avoid taking / releasing process assertions too quickly due to database activity
517         https://bugs.webkit.org/show_bug.cgi?id=173879
518         <rdar://problem/32412701>
519
520         Reviewed by Antti Koivisto.
521
522         Specify an activity name when taking the process assertion to facilitate
523         debugging in the future. It took me a while to figure out this assertion
524         was the one that was too aggressive because it was anonymous.
525
526         * UIProcess/API/Cocoa/WKWebView.mm:
527         (-[WKWebView _setUpSQLiteDatabaseTrackerClient]):
528
529 2017-06-27  Don Olmstead  <don.olmstead@sony.com>
530
531         [PAL] Add symbol export macros for PAL
532         https://bugs.webkit.org/show_bug.cgi?id=171519
533
534         Reviewed by Konstantin Tokarev.
535
536         * config.h:
537
538 2017-06-27  Ryosuke Niwa  <rniwa@webkit.org>
539
540         ProcessLauncherMac could leak a xpc connection when the process had failed to launch
541         https://bugs.webkit.org/show_bug.cgi?id=173865
542
543         Reviewed by Antti Koivisto.
544
545         Explicitly cancel the XPC connection even When the process launch had failed to avoid a leak.
546
547         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
548         (WebKit::ProcessLauncher::launchProcess):
549
550 2017-06-27  John Wilander  <wilander@apple.com>
551
552         Resource Load Statistics: Add telemetry
553         https://bugs.webkit.org/show_bug.cgi?id=173499
554         <rdar://problem/32826094>
555
556         Reviewed by Brent Fulgham.
557
558         * PlatformGTK.cmake:
559             Added UIProcess/WebResourceLoadStatisticsTelemetry.cpp
560         * PlatformMac.cmake:
561             Added UIProcess/WebResourceLoadStatisticsTelemetry.cpp
562         * PlatformWPE.cmake:
563             Added UIProcess/WebResourceLoadStatisticsTelemetry.cpp
564         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
565         (WKResourceLoadStatisticsManagerFireTelemetryHandler):
566         (WKResourceLoadStatisticsManagerSetNotifyPagesWhenTelemetryWasCaptured):
567             Test infrastructure.
568         * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
569         * UIProcess/WebProcessProxy.cpp:
570         (WebKit::WebProcessProxy::notifyPageStatisticsTelemetryFinished):
571             Test infrastructure.
572         * UIProcess/WebProcessProxy.h:
573         * UIProcess/WebResourceLoadStatisticsManager.cpp:
574         (WebKit::WebResourceLoadStatisticsManager::fireTelemetryHandler):
575         (WebKit::WebResourceLoadStatisticsManager::setNotifyPagesWhenTelemetryWasCaptured):
576         (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState):
577             Test infrastructure.
578         * UIProcess/WebResourceLoadStatisticsManager.h:
579         * UIProcess/WebResourceLoadStatisticsStore.cpp:
580         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
581             Configures a timer for telemetry capture. Fires 5 seconds after launch
582             and then every 24 hours.
583         (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
584             Variable renamed notifyPages -> notifyPagesWhenDataRecordsWereScanned.
585         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
586             Variable renamed notifyPages -> notifyPagesWhenDataRecordsWereScanned.
587         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
588             Variable renamed notifyPages -> notifyPagesWhenDataRecordsWereScanned.
589         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
590             Variable renamed notifyPages -> notifyPagesWhenDataRecordsWereScanned.
591         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
592             Variable renamed notifyPages -> notifyPagesWhenDataRecordsWereScanned.
593         (WebKit::WebResourceLoadStatisticsStore::telemetryTimerFired):
594              Calls WebResourceLoadStatisticsTelemetry::calculateAndSubmit().
595         * UIProcess/WebResourceLoadStatisticsStore.h:
596         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp: Added.
597         (WebKit::numberOfResourcesWithUserInteraction):
598         (WebKit::median):
599         (WebKit::nonEphemeralWebPageProxy):
600         (WebKit::submitTopList):
601         (WebKit::submitTopLists):
602         (WebKit::notifyPages):
603         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
604         (WebKit::WebResourceLoadStatisticsTelemetry::setNotifyPagesWhenTelemetryWasCaptured):
605         * UIProcess/WebResourceLoadStatisticsTelemetry.h: Added.
606         * WebKit2.xcodeproj/project.pbxproj:
607
608 2017-06-27  Ting-Wei Lan  <lantw44@gmail.com>
609
610         Add missing includes to fix compilation error on FreeBSD
611         https://bugs.webkit.org/show_bug.cgi?id=172919
612
613         Reviewed by Mark Lam.
614
615         * UIProcess/API/C/WKContextPrivate.h:
616         * UIProcess/API/C/WKPagePrivate.h:
617         * UIProcess/ProcessAssertion.h:
618
619 2017-06-27  Wenson Hsieh  <wenson_hsieh@apple.com>
620
621         Refactor drag start codepaths to plumb a DragItem to client layers
622         https://bugs.webkit.org/show_bug.cgi?id=173832
623         Work towards <rdar://problem/32236827>
624
625         Reviewed by Ryosuke Niwa and Tim Horton.
626
627         Add support for serializing a DragItem over IPC. This encodes and decodes all members of DragItem except for the
628         PasteboardWriterData and the DragImage's image. The DragItem is sent over to the UI process in
629         WebDragClient::startDrag via the WebPageProxy::startDrag IPC message (renamed from WebPageProxy::setDragImage)
630         which now takes a DragItem.
631
632         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
633         (WebKit::WebPageProxy::startDrag):
634         (WebKit::WebPageProxy::setDragImage): Deleted.
635         * UIProcess/PageClient.h:
636         * UIProcess/WebPageProxy.h:
637         * UIProcess/WebPageProxy.messages.in:
638
639         Rename SetDragImage to StartDrag and refactor to receive only a DragItem and shareable bitmap handle.
640
641         * UIProcess/ios/PageClientImplIOS.h:
642         * UIProcess/ios/PageClientImplIOS.mm:
643         (WebKit::PageClientImpl::startDrag):
644         (WebKit::PageClientImpl::startDataInteractionWithImage): Deleted.
645         * UIProcess/ios/WKContentViewInteraction.h:
646         * UIProcess/ios/WKContentViewInteraction.mm:
647         (-[WKContentView _startDrag:item:]):
648         (-[WKContentView _startDataInteractionWithImage:withIndicatorData:atClientPosition:anchorPoint:action:]): Deleted.
649
650         Rename startDataInteractionWithImage to startDrag.
651
652         * UIProcess/mac/WebPageProxyMac.mm:
653         (WebKit::WebPageProxy::startDrag):
654         (WebKit::WebPageProxy::setDragImage): Deleted.
655         * WebProcess/WebCoreSupport/WebDragClient.cpp:
656         (WebKit::WebDragClient::startDrag):
657         * WebProcess/WebCoreSupport/WebDragClient.h:
658         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
659         (WebKit::WebDragClient::startDrag):
660         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
661         (WebKit::WebDragClient::startDrag):
662
663 2017-06-27  Wenson Hsieh  <wenson_hsieh@apple.com>
664
665         [iOS DnD] [WK2] WKWebView does not handle drag sessions that exit and re-enter
666         https://bugs.webkit.org/show_bug.cgi?id=173856
667         <rdar://problem/32957100>
668
669         Reviewed by Ryosuke Niwa.
670
671         Upon exiting a WKContentView, the dropSession tracked by _dataInteractionState is not cleared out. If the drag
672         session re-enters the WKWebView, a _different_ UIDropSession is sent to the drop delegate, causing us to bail
673         from handling the session altogether in -dropInteraction:canHandleSession:. To fix this, we need to clear out
674         the dropSession when the drag session exits the view.
675
676         * UIProcess/ios/WKContentViewInteraction.mm:
677         (-[WKContentView dropInteraction:sessionDidExit:]):
678
679 2017-06-26  Chris Dumez  <cdumez@apple.com>
680
681         WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains() is inefficient
682         https://bugs.webkit.org/show_bug.cgi?id=173850
683
684         Reviewed by Ryosuke Niwa.
685
686         Update WebsiteDataRecord::matchesTopPrivatelyControlledDomain() to rely on
687         SecurityOriginData::host rather than SecurityOriginData::securityOrigin()->host().
688         SecurityOriginData::securityOrigin() is expensive and it seems unnecessary to call
689         it here since we already have the host.
690
691         Also update WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains() to return
692         domains as a HashSet rather than a Vector to avoid having duplicate domains.
693
694         * UIProcess/WebProcessProxy.cpp:
695         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
696         * UIProcess/WebProcessProxy.h:
697         * UIProcess/WebResourceLoadStatisticsStore.cpp:
698         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
699         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
700         (WebKit::WebsiteDataRecord::matchesTopPrivatelyControlledDomain):
701         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
702         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains):
703         (WebKit::WebsiteDataStore::removeDataForTopPrivatelyControlledDomains):
704         * UIProcess/WebsiteData/WebsiteDataStore.h:
705
706 2017-06-26  Jeremy Jones  <jeremyj@apple.com>
707
708         Invalidate WebVideoFullscreenManager when WebPage is destroyed.
709         https://bugs.webkit.org/show_bug.cgi?id=173835
710         rdar://problem/32969161
711
712         Reviewed by Jer Noble.
713
714         WebVideoFullscreenManager has a pointer to WebPage, and even null checks it in a few places,
715         but the only place it is nulled out is in the destructor. This allows a dangling reference.
716
717         This changes invalidates that reference when WebPage is destructed and adds nullchecks
718         or asserts throughout WebVideoFullscreenManager as appropriate.
719
720         * WebProcess/WebPage/WebPage.cpp:
721         (WebKit::WebPage::~WebPage):
722         * WebProcess/cocoa/WebVideoFullscreenManager.h:
723         (WebKit::WebVideoFullscreenManager::invalidate):
724         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
725         (WebKit::WebVideoFullscreenManager::~WebVideoFullscreenManager):
726         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
727         (WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement):
728         (WebKit::WebVideoFullscreenManager::exitVideoFullscreenToModeWithoutAnimation):
729         (WebKit::WebVideoFullscreenManager::hasVideoChanged):
730         (WebKit::WebVideoFullscreenManager::videoDimensionsChanged):
731         (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
732         (WebKit::WebVideoFullscreenManager::didEnterFullscreen):
733         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen):
734         (WebKit::WebVideoFullscreenManager::fullscreenMayReturnToInline):
735
736 2017-06-26  Chris Dumez  <cdumez@apple.com>
737
738         Disable diagnostic logging in ephemeral sessions
739         https://bugs.webkit.org/show_bug.cgi?id=173849
740         <rdar://problem/32987341>
741
742         Reviewed by Geoffrey Garen.
743
744         * UIProcess/WebPageProxy.cpp:
745         (WebKit::WebPageProxy::setDiagnosticLoggingClient):
746         Construct a dummy logging client if the page's session is ephemeral.
747
748         (WebKit::WebPageProxy::logDiagnosticMessage):
749         (WebKit::WebPageProxy::logDiagnosticMessageWithResult):
750         (WebKit::WebPageProxy::logDiagnosticMessageWithValue):
751         (WebKit::WebPageProxy::logDiagnosticMessageWithEnhancedPrivacy):
752         Slight cleanup to make the code look a bit safer.
753
754 2017-06-26  Zan Dobersek  <zdobersek@igalia.com>
755
756         [GCrypt] Properly initialize libgcrypt before using it
757         https://bugs.webkit.org/show_bug.cgi?id=173589
758
759         Reviewed by Michael Catanzaro.
760
761         Initialize libgcrypt in the Unix-specific main() entrypoint. This is early enough
762         to ensure no other libgcrypt API function is invoked and to also ensure this is
763         done in a thread-safe manner.
764
765         Initialization is initiated through the gcry_check_version() call. 16 kilobytes of
766         secure memory is pre-allocated before we mark the initialization as complete, as
767         recommended by the libgcrypt documentation.
768
769         * WebProcess/EntryPoint/unix/WebProcessMain.cpp:
770         (main):
771
772 2017-06-26  Jeremy Jones  <jeremyj@apple.com>
773
774         When Mission Control closes fullscreen window, allow media element to update its state.
775         https://bugs.webkit.org/show_bug.cgi?id=173671
776         rdar://problem/32892671
777
778         Reviewed by Eric Carlson.
779
780         When Mission Control closes element fullscreen without an animation, we need to notify the
781         media element that fullscreen has exited.
782
783         Without this change, the page still behaves like the element is in fullscreen.
784
785         * UIProcess/mac/WKFullScreenWindowController.mm:
786         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
787         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
788
789 2017-06-26  Wenson Hsieh  <wenson_hsieh@apple.com>
790
791         [iOS DnD] [WK2] Beginning a drag session should prevent clicking via long press
792         https://bugs.webkit.org/show_bug.cgi?id=173838
793
794         Reviewed by Tim Horton.
795
796         After r218579, WebKit no longer attempts to replace out-of-the-box UIKit long-press/drag lift disambiguation by
797         firing events immediately. However, this means that dragging will defer the highlight long press gesture
798         recognizer until dragging ends rather than cancel it immediately, which causes WKContentView to dispatch a
799         synthetic click immediately upon lift. To fix this, we should bail out of the highlight long press gesture when
800         beginning a drag.
801
802         * UIProcess/ios/WKContentViewInteraction.mm:
803         (-[WKContentView _dragInteraction:prepareForSession:completion:]):
804
805 2017-06-26  Konstantin Tokarev  <annulen@yandex.ru>
806
807         Unreviewed, add missing header icncludes
808
809         * WebProcess/soup/WebKitSoupRequestInputStream.cpp:
810
811 2017-06-26  Konstantin Tokarev  <annulen@yandex.ru>
812
813         [GTK] Unreviewed, added missing includes to fix debug build
814
815         * NetworkProcess/NetworkSession.cpp:
816
817 2017-06-25  Konstantin Tokarev  <annulen@yandex.ru>
818
819         Remove excessive headers from WebCore/platform
820         https://bugs.webkit.org/show_bug.cgi?id=173822
821
822         Reviewed by Tim Horton.
823
824         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
825
826 2017-06-25  Michael Catanzaro  <mcatanzaro@igalia.com>
827
828         Unreviewed, rolling out r215190.
829
830         Broke product select element on GNOME Bugzilla
831
832         Reverted changeset:
833
834         "[GTK] Misplaced right click menu on web page due to
835         deprecated gtk_menu_popup()"
836         https://bugs.webkit.org/show_bug.cgi?id=170553
837         http://trac.webkit.org/changeset/215190
838
839 2017-06-25  Michael Catanzaro  <mcatanzaro@igalia.com>
840
841         [GTK][WPE] Unreviewed, fix typo in translatable string
842
843         Thanks to Yuri Chornoivan for reporting this typo.
844
845         * UIProcess/API/glib/WebKitWebView.cpp:
846         (webkit_web_view_class_init):
847
848 2017-06-25  Konstantin Tokarev  <annulen@yandex.ru>
849
850         Remove excessive headers from JavaScriptCore
851         https://bugs.webkit.org/show_bug.cgi?id=173812
852
853         Reviewed by Darin Adler.
854
855         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
856
857 2017-06-24  Chris Dumez  <cdumez@apple.com>
858
859         [WK2] Make sure encodeClientTypesAndData() / decodeClientTypesAndData() match exactly
860         https://bugs.webkit.org/show_bug.cgi?id=173813
861
862         Reviewed by Ryosuke Niwa.
863
864         Make sure encodeClientTypesAndData() / decodeClientTypesAndData() match exactly. The previous
865         IPC encoder code would assume types and data vector have the same length. It would first encode
866         the length of data using |data.size()| but then would encode types.size() values from the
867         data vector. While there are debug assertions to ensure both vectors have the same size, this
868         seems unnecessarily fragile in release builds. If both vectors happen to have different sizes,
869         this will lead to weird IPC bugs.
870
871         * Shared/WebCoreArgumentCoders.cpp:
872         (IPC::encodeClientTypesAndData):
873         (IPC::decodeClientTypesAndData):
874
875 2017-06-24  Michael Catanzaro  <mcatanzaro@igalia.com>
876
877         [GTK] Introspection: webkit_web_view_new_with_related_view needs to be marked as a constructor
878         https://bugs.webkit.org/show_bug.cgi?id=173765
879
880         Reviewed by Carlos Garcia Campos.
881
882         Because the first parameter to this WebKitWebView constructor is itself a WebKitWebView,
883         the gi-scanner's heuristics decide that it's probably an object method rather than a
884         constructor, resulting in improper introspection generation. Annotate it with (constructor)
885         to override this behavior.
886
887         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
888         * UIProcess/API/wpe/WebKitWebViewWPE.cpp:
889
890 2017-06-24  Commit Queue  <commit-queue@webkit.org>
891
892         Unreviewed, rolling out r218785.
893         https://bugs.webkit.org/show_bug.cgi?id=173808
894
895         This change broke the macOS Sierra build (Requested by
896         annulen|home on #webkit).
897
898         Reverted changeset:
899
900         "Removed unused lambda captures from WebKit2"
901         https://bugs.webkit.org/show_bug.cgi?id=173555
902         http://trac.webkit.org/changeset/218785
903
904 2017-06-24  Konstantin Tokarev  <annulen@yandex.ru>
905
906         Removed unused lambda captures from WebKit2
907         https://bugs.webkit.org/show_bug.cgi?id=173555
908
909         Reviewed by Alex Christensen.
910
911         * UIProcess/Network/NetworkProcessProxy.cpp:
912         (WebKit::NetworkProcessProxy::fetchWebsiteData):
913         (WebKit::NetworkProcessProxy::deleteWebsiteData):
914         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
915         * UIProcess/WebProcessProxy.cpp:
916         (WebKit::WebProcessProxy::fetchWebsiteData):
917         (WebKit::WebProcessProxy::deleteWebsiteData):
918         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
919         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
920         (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData):
921
922 2017-06-23  Chris Dumez  <cdumez@apple.com>
923
924         Add release assertion to make sure callbackIdentifier is not 0 in DocumentLoader::finishedLoadingIcon()
925         https://bugs.webkit.org/show_bug.cgi?id=173792
926
927         Reviewed by Ryosuke Niwa.
928
929         Add release assertion to make sure callbackIdentifier is not 0 in DocumentLoader::finishedLoadingIcon()
930         as this could cause HashTable corruption on WebPageProxy side.
931
932         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
933         (WebKit::WebFrameLoaderClient::finishedLoadingIcon):
934         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
935
936 2017-06-23  Chris Dumez  <cdumez@apple.com>
937
938         Stop passing Vector by value in WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores()
939         https://bugs.webkit.org/show_bug.cgi?id=173782
940
941         Reviewed by Brent Fulgham.
942
943         * UIProcess/WebProcessProxy.cpp:
944         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
945         * UIProcess/WebProcessProxy.h:
946         * UIProcess/WebResourceLoadStatisticsStore.cpp:
947         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
948
949 2017-06-23  Chris Dumez  <cdumez@apple.com>
950
951         Avoid copying HashSet to Vector in WebPageProxy::clearLoadDependentCallbacks()
952         https://bugs.webkit.org/show_bug.cgi?id=173786
953
954         Reviewed by Geoffrey Garen.
955
956         Avoid copying HashSet to Vector in WebPageProxy::clearLoadDependentCallbacks().
957         Instead, just move the HashSet and iterate on that. This is OK since we were
958         clearing the HashSet right after copying it to the vector anyway.
959
960         * UIProcess/WebPageProxy.cpp:
961         (WebKit::WebPageProxy::clearLoadDependentCallbacks):
962
963 2017-06-23  Chris Dumez  <cdumez@apple.com>
964
965         Unreviewed, fix Debug build after r218763
966
967         * NetworkProcess/NetworkDataTask.cpp:
968
969 2017-06-23  Chris Dumez  <cdumez@apple.com>
970
971         Add more release logging for process assertions
972         https://bugs.webkit.org/show_bug.cgi?id=173624
973         <rdar://problem/32412701>
974
975         Reviewed by Geoffrey Garen.
976
977         Add more release logging for process assertions to help debug issues such
978         as <rdar://problem/32412701>.
979
980         * UIProcess/ProcessThrottler.cpp:
981         (WebKit::ProcessThrottler::didConnectToProcess):
982         * UIProcess/ios/ProcessAssertionIOS.mm:
983         (WebKit::ProcessAssertion::ProcessAssertion):
984         (WebKit::ProcessAssertion::~ProcessAssertion):
985         (WebKit::ProcessAssertion::setState):
986
987 2017-06-23  Chris Dumez  <cdumez@apple.com>
988
989         Consistently use RunLoop::isMain() in WebKit2
990         https://bugs.webkit.org/show_bug.cgi?id=173745
991         <rdar://problem/32936527>
992
993         Reviewed by Brent Fulgham.
994
995         Consistently use RunLoop:isMain() on WebKit2 instead of WTF::isMainThread().
996         WTF::isMainThread() returns true for the WebThread instead of the UIThread
997         in WebKit1. Therefore WTF::isMainThread() is unsafe to use in the UIProcess
998         as the application may be using WebKit1 as well and have a WebThread.
999
1000         Technically, we only *need* to move from WTF::isMainThread() to
1001         RunLoop::isMain() in the UIProcess code but I ported all of WebKit2 for
1002         consistency. RunLoop::isMain() is always safe in WebKit2.
1003
1004         * NetworkProcess/NetworkDataTask.cpp:
1005         (WebKit::NetworkDataTask::NetworkDataTask):
1006         (WebKit::NetworkDataTask::~NetworkDataTask):
1007         * NetworkProcess/NetworkDataTaskBlob.cpp:
1008         (WebKit::NetworkDataTaskBlob::getSizeForNext):
1009         (WebKit::NetworkDataTaskBlob::didGetSize):
1010         (WebKit::NetworkDataTaskBlob::seek):
1011         (WebKit::NetworkDataTaskBlob::read):
1012         * NetworkProcess/NetworkLoad.cpp:
1013         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
1014         (WebKit::NetworkLoad::notifyDidReceiveResponse):
1015         * NetworkProcess/NetworkSession.cpp:
1016         (WebKit::NetworkSession::defaultSession):
1017         * NetworkProcess/cache/NetworkCache.cpp:
1018         (WebKit::NetworkCache::resourceType):
1019         (WebKit::NetworkCache::Cache::initialize):
1020         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
1021         (WebKit::NetworkCache::IOChannel::read):
1022         (WebKit::NetworkCache::IOChannel::readSyncInThread):
1023         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1024         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
1025         (WebKit::NetworkSessionCocoa::defaultSession):
1026         (WebKit::NetworkSessionCocoa::dataTaskForIdentifier):
1027         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1028         (WebKit::CoordinatedGraphicsScene::dispatchOnMainThread):
1029         (WebKit::CoordinatedGraphicsScene::syncRemoteContent):
1030         (WebKit::CoordinatedGraphicsScene::detach):
1031         (WebKit::CoordinatedGraphicsScene::appendUpdate):
1032         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
1033         (WebKit::WorkQueuePool::singleton):
1034         (WebKit::WorkQueuePool::dispatch):
1035         (WebKit::CompositingRunLoop::~CompositingRunLoop):
1036         (WebKit::CompositingRunLoop::performTask):
1037         (WebKit::CompositingRunLoop::performTaskSync):
1038         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1039         (WebKit::ThreadedCompositor::createGLContext):
1040         (WebKit::ThreadedCompositor::renderNextFrame):
1041         (WebKit::ThreadedCompositor::commitScrollOffset):
1042         (WebKit::ThreadedCompositor::updateSceneState):
1043         (WebKit::ThreadedCompositor::releaseUpdateAtlases):
1044         (WebKit::ThreadedCompositor::frameComplete):
1045         * Shared/Plugins/NPObjectProxy.cpp:
1046         (WebKit::NPObjectProxy::NP_Deallocate):
1047         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1048         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
1049         * UIProcess/WebProcessProxy.cpp:
1050         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
1051         (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebiteData):
1052         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1053         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
1054         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
1055         (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk):
1056         (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
1057         * UIProcess/ios/WKPDFView.mm:
1058         (-[WKPDFView _highlightLinkAnnotation:forDuration:completionHandler:]):
1059         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1060         (-[WKFileUploadPanel _uploadItemForImageData:imageName:successBlock:failureBlock:]):
1061         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
1062         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
1063         * WebProcess/soup/WebKitSoupRequestInputStream.cpp:
1064         (webkitSoupRequestInputStreamReadAsync):
1065
1066 2017-06-23  David Kilzer  <ddkilzer@apple.com>
1067
1068         v3: REGRESSION (r218419): 3 NSMutableDictionary leaks calling -[WKProcessPool _pluginLoadClientPolicies]
1069         <https://webkit.org/b/173689>
1070
1071         Reviewed by Tim Horton.
1072
1073         * UIProcess/API/Cocoa/WKProcessPool.mm:
1074         (policiesHashMapToDictionary): Use adoptNS().get() to avoid
1075         dumping objects into autoreleasepools unnecessarily.
1076         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1077         (-[WKProcessPool _pluginLoadClientPolicies]): Add back 'copy'
1078         attribute to document that we're returning a new object on each
1079         invocation.  I shouldn't have removed it in the v2 patch.
1080
1081 2017-06-23  Youenn Fablet  <youenn@apple.com>
1082
1083         LibWebRTCSocketClient should not destroy its socket within signalClose callback
1084         https://bugs.webkit.org/show_bug.cgi?id=173739
1085
1086         Reviewed by Brent Fulgham.
1087
1088         * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
1089         (WebKit::LibWebRTCSocketClient::signalClose): Destroy 'this' asynchronously to make the caller of signalClose valid until it is not used.
1090
1091 2017-06-23  Chris Dumez  <cdumez@apple.com>
1092
1093         Fix typo in WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData() naming
1094         https://bugs.webkit.org/show_bug.cgi?id=173781
1095
1096         Reviewed by Brent Fulgham.
1097
1098         * UIProcess/WebProcessProxy.cpp:
1099         (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData):
1100         (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebiteData): Deleted.
1101         * UIProcess/WebProcessProxy.h:
1102         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1103         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
1104
1105 2017-06-23  Jer Noble  <jer.noble@apple.com>
1106
1107         [WK2] Support -[WebAVPlayerController setMuted:]
1108         https://bugs.webkit.org/show_bug.cgi?id=173777
1109
1110         Reviewed by Eric Carlson.
1111
1112         Add a SetMuted message to WebPlaybackSessionManager.
1113
1114         Drive-by refactoring: Because the new setMuted() method conflicts with the existing setMuted()
1115         notification, do a giant rename of the notificiation methods from set(Value) -> (value)Changed.
1116
1117         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
1118         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in:
1119         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
1120         (WebKit::WebPlaybackSessionModelContext::setMuted):
1121         (WebKit::WebPlaybackSessionModelContext::playbackStartedTimeChanged):
1122         (WebKit::WebPlaybackSessionModelContext::durationChanged):
1123         (WebKit::WebPlaybackSessionModelContext::currentTimeChanged):
1124         (WebKit::WebPlaybackSessionModelContext::bufferedTimeChanged):
1125         (WebKit::WebPlaybackSessionModelContext::rateChanged):
1126         (WebKit::WebPlaybackSessionModelContext::seekableRangesChanged):
1127         (WebKit::WebPlaybackSessionModelContext::canPlayFastReverseChanged):
1128         (WebKit::WebPlaybackSessionModelContext::audioMediaSelectionOptionsChanged):
1129         (WebKit::WebPlaybackSessionModelContext::legibleMediaSelectionOptionsChanged):
1130         (WebKit::WebPlaybackSessionModelContext::audioMediaSelectionIndexChanged):
1131         (WebKit::WebPlaybackSessionModelContext::legibleMediaSelectionIndexChanged):
1132         (WebKit::WebPlaybackSessionModelContext::externalPlaybackChanged):
1133         (WebKit::WebPlaybackSessionModelContext::wirelessVideoPlaybackDisabledChanged):
1134         (WebKit::WebPlaybackSessionModelContext::mutedChanged):
1135         (WebKit::WebPlaybackSessionManagerProxy::currentTimeChanged):
1136         (WebKit::WebPlaybackSessionManagerProxy::bufferedTimeChanged):
1137         (WebKit::WebPlaybackSessionManagerProxy::seekableRangesVectorChanged):
1138         (WebKit::WebPlaybackSessionManagerProxy::canPlayFastReverseChanged):
1139         (WebKit::WebPlaybackSessionManagerProxy::audioMediaSelectionOptionsChanged):
1140         (WebKit::WebPlaybackSessionManagerProxy::legibleMediaSelectionOptionsChanged):
1141         (WebKit::WebPlaybackSessionManagerProxy::audioMediaSelectionIndexChanged):
1142         (WebKit::WebPlaybackSessionManagerProxy::legibleMediaSelectionIndexChanged):
1143         (WebKit::WebPlaybackSessionManagerProxy::externalPlaybackPropertiesChanged):
1144         (WebKit::WebPlaybackSessionManagerProxy::wirelessVideoPlaybackDisabledChanged):
1145         (WebKit::WebPlaybackSessionManagerProxy::mutedChanged):
1146         (WebKit::WebPlaybackSessionManagerProxy::durationChanged):
1147         (WebKit::WebPlaybackSessionManagerProxy::playbackStartedTimeChanged):
1148         (WebKit::WebPlaybackSessionManagerProxy::rateChanged):
1149         (WebKit::WebPlaybackSessionManagerProxy::setMuted):
1150         (WebKit::WebPlaybackSessionManagerProxy::controlsManagerInterface):
1151         (WebKit::WebPlaybackSessionModelContext::setPlaybackStartedTime): Deleted.
1152         (WebKit::WebPlaybackSessionModelContext::setDuration): Deleted.
1153         (WebKit::WebPlaybackSessionModelContext::setCurrentTime): Deleted.
1154         (WebKit::WebPlaybackSessionModelContext::setBufferedTime): Deleted.
1155         (WebKit::WebPlaybackSessionModelContext::setRate): Deleted.
1156         (WebKit::WebPlaybackSessionModelContext::setSeekableRanges): Deleted.
1157         (WebKit::WebPlaybackSessionModelContext::setCanPlayFastReverse): Deleted.
1158         (WebKit::WebPlaybackSessionModelContext::setAudioMediaSelectionOptions): Deleted.
1159         (WebKit::WebPlaybackSessionModelContext::setLegibleMediaSelectionOptions): Deleted.
1160         (WebKit::WebPlaybackSessionModelContext::setAudioMediaSelectionIndex): Deleted.
1161         (WebKit::WebPlaybackSessionModelContext::setLegibleMediaSelectionIndex): Deleted.
1162         (WebKit::WebPlaybackSessionModelContext::setExternalPlayback): Deleted.
1163         (WebKit::WebPlaybackSessionModelContext::setWirelessVideoPlaybackDisabled): Deleted.
1164         (WebKit::WebPlaybackSessionManagerProxy::setCurrentTime): Deleted.
1165         (WebKit::WebPlaybackSessionManagerProxy::setBufferedTime): Deleted.
1166         (WebKit::WebPlaybackSessionManagerProxy::setSeekableRangesVector): Deleted.
1167         (WebKit::WebPlaybackSessionManagerProxy::setCanPlayFastReverse): Deleted.
1168         (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionOptions): Deleted.
1169         (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionOptions): Deleted.
1170         (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionIndex): Deleted.
1171         (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionIndex): Deleted.
1172         (WebKit::WebPlaybackSessionManagerProxy::setExternalPlaybackProperties): Deleted.
1173         (WebKit::WebPlaybackSessionManagerProxy::setWirelessVideoPlaybackDisabled): Deleted.
1174         (WebKit::WebPlaybackSessionManagerProxy::setDuration): Deleted.
1175         (WebKit::WebPlaybackSessionManagerProxy::setPlaybackStartedTime): Deleted.
1176         (WebKit::WebPlaybackSessionManagerProxy::setRate): Deleted.
1177         * WebProcess/cocoa/WebPlaybackSessionManager.h:
1178         * WebProcess/cocoa/WebPlaybackSessionManager.messages.in:
1179         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
1180         (WebKit::WebPlaybackSessionManager::durationChanged):
1181         (WebKit::WebPlaybackSessionManager::currentTimeChanged):
1182         (WebKit::WebPlaybackSessionManager::bufferedTimeChanged):
1183         (WebKit::WebPlaybackSessionManager::playbackStartedTimeChanged):
1184         (WebKit::WebPlaybackSessionManager::rateChanged):
1185         (WebKit::WebPlaybackSessionManager::seekableRangesChanged):
1186         (WebKit::WebPlaybackSessionManager::canPlayFastReverseChanged):
1187         (WebKit::WebPlaybackSessionManager::audioMediaSelectionOptionsChanged):
1188         (WebKit::WebPlaybackSessionManager::legibleMediaSelectionOptionsChanged):
1189         (WebKit::WebPlaybackSessionManager::externalPlaybackChanged):
1190         (WebKit::WebPlaybackSessionManager::audioMediaSelectionIndexChanged):
1191         (WebKit::WebPlaybackSessionManager::legibleMediaSelectionIndexChanged):
1192         (WebKit::WebPlaybackSessionManager::wirelessVideoPlaybackDisabledChanged):
1193         (WebKit::WebPlaybackSessionManager::mutedChanged):
1194         (WebKit::WebPlaybackSessionManager::setMuted):
1195
1196 2017-06-23  Frederic Wang  <fwang@igalia.com>
1197
1198         Use window.internals instead of overridePreference to set WebCore settings in tests
1199         https://bugs.webkit.org/show_bug.cgi?id=173714
1200
1201         Reviewed by Simon Fraser.
1202
1203         This commit remove preference to settings mapping in overrideBoolPreferenceForTestRunner that
1204         are no longer necessary after the changes done in LayoutTests.
1205
1206         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1207         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Remove mapping for preferences
1208         that no longer require testRunner.overridePreference calls in tests.
1209
1210 2017-06-23  Brent Fulgham  <bfulgham@apple.com>
1211
1212         Avoid moving the same vector multiple times
1213         https://bugs.webkit.org/show_bug.cgi?id=173748
1214         <rdar://problem/32936804>
1215
1216         Reviewed by Chris Dumez.
1217
1218         We discovered that a Vector<String> was being moved inside a loop, causing it to be moved more than once.
1219         We should never do this!
1220
1221         * UIProcess/WebProcessProxy.cpp:
1222         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
1223         Do not perform a move at each step of the iteration.
1224         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1225         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): Receive vector of top privately
1226         controlled domains as a const reference. Copy this vector into the completion handler. Do not move
1227         origins out of the vector in the inner loop.
1228         (WebKit::WebsiteDataStore::removeDataForTopPrivatelyControlledDomains): Receive vector of top privately
1229         controlled domains as a const reference.
1230         * UIProcess/WebsiteData/WebsiteDataStore.h:
1231
1232 2017-06-23  Alex Christensen  <achristensen@webkit.org>
1233
1234         Add SPI to WKURLSchemeTask for redirection
1235         https://bugs.webkit.org/show_bug.cgi?id=173730
1236
1237         Reviewed by Brady Eidson.
1238
1239         This is needed for testing an upcoming fix for redirect callbacks, and it might be
1240         necessary for loading with custom schemes in general. Right now just responding with
1241          an HTTP 301/302/307/308 response code doesn't work because there is nothing that
1242         synthesizes an NSURLRequest from the Location header like we do in 
1243         SynchronousResourceHandleCFURLConnectionDelegate::willSendRequest et al. for HSTS, 
1244         and that would require using an NSHTTPURLResponse for non-HTTP responses, which is 
1245         conceptually wrong.  Instead of waiting for a completion handler in the API, we are
1246         following the pattern of WKNavigationDelegate.didReceiveServerRedirectForProvisionalNavigation
1247         and allowing the SPI to indicate that a redirect has happened to update the state of
1248         WebKit, but not allowing the SPI to wait for a processed request and slow down loading.
1249
1250         This adds WKURLSchemeTaskPrivate._didPerformRedirection which is covered by new API tests.
1251
1252         * UIProcess/API/Cocoa/WKURLSchemeTask.mm:
1253         (raiseExceptionIfNecessary):
1254         (-[WKURLSchemeTaskImpl _didPerformRedirection:newRequest:completionHandler:]):
1255         * UIProcess/API/Cocoa/WKURLSchemeTaskInternal.h:
1256         * UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h: Added.
1257         * UIProcess/WebPageProxy.cpp:
1258         (WebKit::WebPageProxy::startURLSchemeTask):
1259         (WebKit::WebPageProxy::stopURLSchemeTask):
1260         * UIProcess/WebPageProxy.h:
1261         * UIProcess/WebPageProxy.messages.in:
1262         * UIProcess/WebURLSchemeHandler.cpp:
1263         (WebKit::WebURLSchemeHandler::startTask):
1264         (WebKit::WebURLSchemeHandler::stopTask):
1265         * UIProcess/WebURLSchemeHandler.h:
1266         * UIProcess/WebURLSchemeTask.cpp:
1267         (WebKit::WebURLSchemeTask::didReceiveResponse): Deleted.
1268         (WebKit::WebURLSchemeTask::didReceiveData): Deleted.
1269         (WebKit::WebURLSchemeTask::didComplete): Deleted.
1270         * UIProcess/WebURLSchemeTask.h:
1271         * WebKit2.xcodeproj/project.pbxproj:
1272         * WebProcess/WebPage/WebPage.cpp:
1273         (WebKit::WebPage::urlSchemeTaskDidPerformRedirection):
1274         * WebProcess/WebPage/WebPage.h:
1275         * WebProcess/WebPage/WebPage.messages.in:
1276         * WebProcess/WebPage/WebURLSchemeHandlerProxy.cpp:
1277         (WebKit::WebURLSchemeHandlerProxy::taskDidPerformRedirection):
1278         * WebProcess/WebPage/WebURLSchemeHandlerProxy.h:
1279         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
1280         (WebKit::WebURLSchemeTaskProxy::didPerformRedirection):
1281         * WebProcess/WebPage/WebURLSchemeTaskProxy.h:
1282
1283 2017-06-23  Brent Fulgham  <bfulgham@apple.com>
1284
1285         [WK2][macOS] Support Mac Mini Flash Player Features
1286         https://bugs.webkit.org/show_bug.cgi?id=173581
1287         <rdar://problem/32804073>
1288
1289         Reviewed by Dean Jackson.
1290
1291         Revise the sandboxes for additional IOKit properties identified during Flash video player
1292         testing.
1293
1294         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1295         * WebProcess/com.apple.WebProcess.sb.in:
1296
1297 2017-06-23  Zan Dobersek  <zdobersek@igalia.com>
1298
1299         [CoordinatedGraphics] Clean up type aliases in CoordinatedGraphicsScene
1300         https://bugs.webkit.org/show_bug.cgi?id=173764
1301
1302         Reviewed by Carlos Garcia Campos.
1303
1304         Drop the various type aliases created in the CoordinatedGraphicsScene
1305         class. We can leave without these by leveraging `auto` where necessary.
1306
1307         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1308         (WebKit::CoordinatedGraphicsScene::updateTilesIfNeeded):
1309         (WebKit::CoordinatedGraphicsScene::updateImageBacking):
1310         (WebKit::CoordinatedGraphicsScene::clearImageBackingContents):
1311         (WebKit::CoordinatedGraphicsScene::assignImageBackingToLayer):
1312         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1313
1314 2017-06-23  Carlos Garcia Campos  <cgarcia@igalia.com>
1315
1316         [WPE] Crash in wpe_view_backend_get_renderer_host_fd
1317         https://bugs.webkit.org/show_bug.cgi?id=173760
1318
1319         Reviewed by Žan Doberšek.
1320
1321         This can happen if views are created and destroyed quickly. The problem is that CompositingManagerProxy adds a
1322         message receiver but never removes it, so it's possible that the message arrives right after the view has been
1323         destroyed. This is happening most of the times running /wpe/WebKitAutomationSession/request-session that creates
1324         3 web views in a row that are deleted when the test finishes.
1325
1326         Fixes /wpe/WebKitAutomationSession/request-session.
1327
1328         * UIProcess/API/wpe/CompositingManagerProxy.cpp:
1329         (WebKit::CompositingManagerProxy::finalize): Remove the message handler.
1330         * UIProcess/API/wpe/CompositingManagerProxy.h:
1331         * UIProcess/API/wpe/WPEView.cpp:
1332         (WKWPE::View::~View): Call CompositingManagerProxy::finalize().
1333
1334 2017-06-23  Carlos Garcia Campos  <cgarcia@igalia.com>
1335
1336         [WPE] User script messages don't work
1337         https://bugs.webkit.org/show_bug.cgi?id=173712
1338
1339         Reviewed by Žan Doberšek.
1340
1341         When a user script message is received we need to create a WebKitJavascriptResult to deserialize the script
1342         value. WebKitJavascriptResult is created with a WebKitWebView for two reasons: to get its JavaScript global
1343         context and to take a reference that ensures the JavaScript context will be alive while the results is
1344         alive. However, we could create the WebKitJavascriptResult with the JavaScript global context and take a
1345         reference of the context itself. This way we don't need to access the WebKitWebView from the
1346         WebScriptMessageHandler client. But we still need access to the JavaScript context, so I've added a
1347         javascriptGlobalContext() method to WebPageProxy for GTK+ and WPE that is implemented from the page client.
1348
1349         Fixes /wpe/WebKitUserContentManager/script-message-received.
1350
1351         * UIProcess/API/glib/WebKitJavascriptResult.cpp:
1352         (_WebKitJavascriptResult::_WebKitJavascriptResult): Create the WebKitJavascriptResult with a JSGlobalContextRef
1353         instead of a WEbKitWebView.
1354         (webkitJavascriptResultCreate): Pass the js context to the constructor.
1355         (webkit_javascript_result_get_global_context): Return the js context.
1356         * UIProcess/API/glib/WebKitJavascriptResultPrivate.h:
1357         * UIProcess/API/glib/WebKitUserContentManager.cpp:
1358         * UIProcess/API/glib/WebKitWebView.cpp:
1359         (_WebKitWebViewPrivate::~_WebKitWebViewPrivate): Use JSRetainPtr
1360         (webkit_web_view_get_javascript_global_context):
1361         (webkitWebViewRunJavaScriptCallback):
1362         * UIProcess/API/gtk/PageClientImpl.cpp:
1363         (WebKit::PageClientImpl::javascriptGlobalContext):
1364         * UIProcess/API/gtk/PageClientImpl.h:
1365         * UIProcess/API/wpe/APIViewClient.h:
1366         (API::ViewClient::javascriptGlobalContext):
1367         * UIProcess/API/wpe/PageClientImpl.cpp:
1368         (WebKit::PageClientImpl::javascriptGlobalContext):
1369         * UIProcess/API/wpe/PageClientImpl.h:
1370         * UIProcess/API/wpe/WPEView.cpp:
1371         (WKWPE::View::javascriptGlobalContext):
1372         * UIProcess/API/wpe/WPEView.h:
1373         * UIProcess/PageClient.h:
1374         (WebKit::PageClient::javascriptGlobalContext):
1375         * UIProcess/WebPageProxy.h:
1376         * UIProcess/gtk/WebPageProxyGtk.cpp:
1377         (WebKit::WebPageProxy::javascriptGlobalContext):
1378         * UIProcess/wpe/WebPageProxyWPE.cpp:
1379         (WebKit::WebPageProxy::javascriptGlobalContext):
1380
1381 2017-06-22  Wenson Hsieh  <wenson_hsieh@apple.com>
1382
1383         [iOS DnD] [WK2] Enable in-app dragging from WKWebView on the phone
1384         https://bugs.webkit.org/show_bug.cgi?id=173736
1385         <rdar://problem/32873545>
1386
1387         Reviewed by Tim Horton.
1388
1389         Flip the drag interaction enabled switch on when initializing WKContentView's UIDragInteraction.
1390
1391         * UIProcess/ios/WKContentViewInteraction.mm:
1392         (-[WKContentView setupDataInteractionDelegates]):
1393
1394 2017-06-22  Chris Dumez  <cdumez@apple.com>
1395
1396         isMainThread() assertions in CallbackMap are incorrectly failing on some iOS apps
1397         https://bugs.webkit.org/show_bug.cgi?id=173738
1398         <rdar://problem/32923933>
1399
1400         Reviewed by Brady Eidson.
1401
1402         The assertions hit on certain iOS apps even though the crash traces clearly
1403         show them on the main thread. We have verified locally that RunLoop::isMain()
1404         propertly return true in this case (while WTF::isMainThread() returns false).
1405         Update the assertions to use RunLoop::isMain() instead.
1406
1407         * UIProcess/GenericCallback.h:
1408         (WebKit::CallbackMap::put):
1409         (WebKit::CallbackMap::take):
1410         (WebKit::CallbackMap::invalidate):
1411
1412 2017-06-22  Daniel Bates  <dabates@apple.com>
1413
1414         Make FrameLoadRequest a move-only type
1415         https://bugs.webkit.org/show_bug.cgi?id=173682
1416
1417         Reviewed by Alex Christensen and Darin Adler.
1418
1419         A FrameLoadRequest groups together the information to perform a load into a single object
1420         that is more manageable to pass around than its constituent parts. Code that receives a
1421         FrameLoadRequest is expected to extract out the information it needs to complete its task.
1422         And it does not make sense to re-use the same FrameLoadRequest object for more than one
1423         load. Therefore, it is sufficient to make FrameLoadRequest a move-only type.
1424
1425         * WebProcess/Plugins/PluginView.cpp:
1426         (WebKit::PluginView::URLRequest::create):
1427         (WebKit::PluginView::URLRequest::URLRequest):
1428         (WebKit::PluginView::performFrameLoadURLRequest):
1429         (WebKit::PluginView::loadURL):
1430         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1431         (WebKit::WebFrameLoaderClient::dispatchCreatePage):
1432         * WebProcess/WebPage/WebInspector.cpp:
1433         (WebKit::WebInspector::openInNewTab):
1434         * WebProcess/WebPage/WebPage.cpp:
1435         (WebKit::WebPage::loadRequest):
1436
1437 2017-06-22  Chris Dumez  <cdumez@apple.com>
1438
1439         Add release assertion in CallbackMap::invalidate()
1440         https://bugs.webkit.org/show_bug.cgi?id=173722
1441
1442         Reviewed by Brady Eidson.
1443
1444         Add release assertion in CallbackMap::invalidate() to make sure it is called on the main thread.
1445
1446         * UIProcess/GenericCallback.h:
1447         (WebKit::CallbackMap::invalidate):
1448
1449 2017-06-22  Brady Eidson  <beidson@apple.com>
1450
1451         Add some thread safety guards to GenericCallback.
1452         https://bugs.webkit.org/show_bug.cgi?id=173693
1453
1454         Reviewed by Sam Weinig.
1455
1456         A callback should be created, performed, invalidated, and/or destroyed all on the same thread.
1457         Let's write code to notify us if that doesn't happen.
1458
1459         * UIProcess/GenericCallback.h:
1460         (WebKit::GenericCallback::~GenericCallback):
1461         (WebKit::GenericCallback::performCallbackWithReturnValue):
1462         (WebKit::GenericCallback::invalidate):
1463
1464 2017-06-22  David Kilzer  <ddkilzer@apple.com>
1465
1466         v2: REGRESSION (r218419): 3 NSMutableDictionary leaks calling -[WKProcessPool _pluginLoadClientPolicies]
1467         <https://webkit.org/b/173689>
1468
1469         Reviewed by Chris Dumez.
1470
1471         * UIProcess/API/Cocoa/WKProcessPool.mm:
1472         (policiesHashMapToDictionary): Use -dictionaryWithCapacity:
1473         instead of -new since the former returns an autoreleased object
1474         while the latter does not.  This has the added benefit of tuning
1475         the size of each NSMutableDictionary.
1476         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1477         (-[WKProcessPool _pluginLoadClientPolicies]): Remove 'copy'
1478         attribute from @property declaration since it is read-only.
1479
1480 2017-06-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1481
1482         [WPE] Downloads never have a web view associated in WPE
1483         https://bugs.webkit.org/show_bug.cgi?id=173709
1484
1485         Reviewed by Žan Doberšek.
1486
1487         Convert the WPE view client into an API client and add handleDownloadRequest(). WebKitWebView now uses it to
1488         associate itself to the download like the GTK+ port does.
1489
1490         * PlatformWPE.cmake:
1491         * UIProcess/API/C/wpe/WKView.cpp:
1492         (WKViewSetViewClient): Add C API client implementation here.
1493         * UIProcess/API/glib/WebKitWebView.cpp:
1494         (webkitWebViewConstructed): Set the view client in WPE.
1495         * UIProcess/API/wpe/APIViewClient.h: Renamed from Source/WebKit2/UIProcess/API/wpe/WPEViewClient.h.
1496         (API::ViewClient::frameDisplayed):
1497         (API::ViewClient::handleDownloadRequest):
1498         * UIProcess/API/wpe/PageClientImpl.cpp:
1499         (WebKit::PageClientImpl::handleDownloadRequest): Call WKWPE::View::handleDownloadRequest().
1500         * UIProcess/API/wpe/WPEView.cpp:
1501         (WKWPE::View::View): Initialize the view client.
1502         (WKWPE::View::setClient): Set or reset the client.
1503         (WKWPE::View::handleDownloadRequest): Notify the client.
1504         * UIProcess/API/wpe/WPEView.h:
1505         * UIProcess/API/wpe/WPEViewClient.cpp: Removed.
1506
1507 2017-06-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1508
1509         [WPE] Page should be closed on WebKitWebView dispose
1510         https://bugs.webkit.org/show_bug.cgi?id=173707
1511
1512         Reviewed by Žan Doberšek.
1513
1514         In the GTK+ port it's done in the WebKitWebViewBase dispose implementation. It fixes TestMultiprocess.
1515
1516         * UIProcess/API/glib/WebKitWebView.cpp:
1517         (webkitWebViewDispose): Call WKWPE::View::close().
1518         * UIProcess/API/wpe/WPEView.cpp:
1519         (WKWPE::View::close): Close the WebPageProxy.
1520         * UIProcess/API/wpe/WPEView.h:
1521
1522 2017-06-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1523
1524         Remove unused coordinated graphics C API
1525         https://bugs.webkit.org/show_bug.cgi?id=173706
1526
1527         Reviewed by Žan Doberšek.
1528
1529         * UIProcess/API/C/CoordinatedGraphics/WKView.cpp: Removed.
1530         * UIProcess/API/C/CoordinatedGraphics/WKView.h: Removed.
1531         * UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.cpp: Removed.
1532         * UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.h: Removed.
1533
1534 2017-06-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1535
1536         [WPE] Add initial web extensions API
1537         https://bugs.webkit.org/show_bug.cgi?id=173640
1538
1539         Reviewed by Žan Doberšek.
1540
1541         Build the glib web extensions API files and the builtin injected bundle library for WPE.
1542
1543         * PlatformWPE.cmake:
1544         * UIProcess/API/glib/WebKitWebContext.cpp:
1545         (webkitWebContextConstructed): Use a different injected bundle filename in WPE and GTK+.
1546         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
1547         (webkit_web_page_class_init): Do not expose DOM bindings in WPE.
1548         (webkitWebPageCreate): Ditto.
1549         * WebProcess/InjectedBundle/API/wpe/WebKitConsoleMessage.h: Added.
1550         * WebProcess/InjectedBundle/API/wpe/WebKitFrame.h: Added.
1551         * WebProcess/InjectedBundle/API/wpe/WebKitScriptWorld.h: Added.
1552         * WebProcess/InjectedBundle/API/wpe/WebKitWebEditor.h: Added.
1553         * WebProcess/InjectedBundle/API/wpe/WebKitWebExtension.h: Added.
1554         * WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h: Added.
1555         * WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h: Added.
1556
1557 2017-06-21  David Kilzer  <ddkilzer@apple.com>
1558
1559         REGRESSION (r218419): 3 NSMutableDictionary leaks calling -[WKProcessPool _pluginLoadClientPolicies]
1560         <https://webkit.org/b/173689>
1561
1562         Reviewed by Chris Dumez.
1563
1564         Caught by the clang static analyzer.
1565
1566         * UIProcess/API/Cocoa/WKProcessPool.mm:
1567         (policiesHashMapToDictionary): Switch from using
1568         [[NSMutableDictionary alloc] init] which returns a +1 retained
1569         object in MRR to [NSMutableDictionary new] which returns an
1570         autoreleased object under MRR.  This bug caused 3 leaks when
1571         calling -[WKProcessPool _pluginLoadClientPolicies], which should
1572         return an autoreleased object based on its signature.
1573
1574 2017-06-21  Ryosuke Niwa  <rniwa@webkit.org>
1575
1576         Add release assertions help diagnose a hang in CallbackMap
1577         https://bugs.webkit.org/show_bug.cgi?id=173680
1578         <rdar://problem/32911286>
1579
1580         Reviewed by Chris Dumez.
1581
1582         Assert that these functions are only called in the main thread and the empty value is never used as a key.
1583
1584         * UIProcess/GenericCallback.h:
1585         (WebKit::CallbackMap::put):
1586         (WebKit::CallbackMap::take):
1587
1588 2017-06-21  Wenson Hsieh  <wenson_hsieh@apple.com>
1589
1590         [iOS DnD] [WK2] Cancelling a drag interaction using the ObjC SPI causes subsequent dragging to fail
1591         https://bugs.webkit.org/show_bug.cgi?id=173659
1592         <rdar://problem/32879788>
1593
1594         Reviewed by Tim Horton.
1595
1596         Currently, a drag session that failed to begin is cleaned up either when the web process responds in
1597         -[WKContentView _didHandleStartDataInteractionRequest:] with started = NO, or if started is YES, in
1598         -dragInteraction:session:didEndWithOperation: instead. However, it is possible that even when the pasteboard has
1599         items and the drag has started in the web process, something in the UI process may then cause the drag to be
1600         cancelled (for instance, an SPI client returning empty arrays for all adjusted item providers, or UIKit not even
1601         calling into -dragInteraction:itemsForBeginningSession: when we invoke their completion block).
1602
1603         In any case, if the drag session is drag-item-less after calling the drag start completion block, clean up and
1604         cancel the drag.
1605
1606         * UIProcess/ios/WKContentViewInteraction.mm:
1607         (-[WKContentView _didHandleStartDataInteractionRequest:]):
1608         (-[WKContentView dragInteraction:itemsForBeginningSession:]):
1609
1610 2017-06-21  Tim Horton  <timothy_horton@apple.com>
1611
1612         REGRESSION (r218606): 3D Touch action menu for links is missing items
1613         https://bugs.webkit.org/show_bug.cgi?id=173669
1614         <rdar://problem/32905541>
1615
1616         Reviewed by Wenson Hsieh.
1617
1618         * UIProcess/ios/WKActionSheetAssistant.mm:
1619         (-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
1620         defaultActionsForLinkSheet is used outside the usual action sheet flow,
1621         by 3D Touch code. Therefore, we're not guaranteed to have a _positionInformation.
1622         We don't need one, though -- we can get the URL from the passed-in
1623         _WKActivatedElementInfo, exactly like defaultActionsForImageSheet already did.
1624
1625         (-[WKActionSheetAssistant defaultActionsForImageSheet:]):
1626         Remove the delegate null check, which isn't used after r218606.
1627
1628 2017-06-21  Daniel Bates  <dabates@apple.com>
1629
1630         Cleanup FrameLoadRequest
1631         https://bugs.webkit.org/show_bug.cgi?id=173564
1632         <rdar://problem/32903570>
1633
1634         Reviewed by Brent Fulgham.
1635
1636         * WebProcess/Plugins/PluginView.cpp:
1637         (WebKit::PluginView::loadURL): Explicitly pass the null-string for the target frame
1638         name as we do not have one. Use C++11 brace initialization syntax.
1639         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1640         (WebKit::WebFrameLoaderClient::dispatchCreatePage): Ditto.
1641         * WebProcess/WebPage/WebInspector.cpp:
1642         (WebKit::WebInspector::openInNewTab): It is no longer necessary to pass ReplaceDocumentIfJavaScriptURL
1643         when instantiating the FrameLoadRequest as it defaults to this policy. Use C++11 brace initialization syntax.
1644
1645 2017-06-21  Wenson Hsieh  <wenson_hsieh@apple.com>
1646
1647         [iOS DnD] [WK2] Add drag-and-drop release logging around WKContentView
1648         https://bugs.webkit.org/show_bug.cgi?id=173636
1649
1650         Reviewed by Tim Horton.
1651
1652         Add logging at key points in the drag-and-drop lifecycle in the UI process, so that sysdiagnoses will contain
1653         sufficient information to debug sparse failures.
1654
1655         * Platform/Logging.h:
1656         * UIProcess/ios/WKContentViewInteraction.mm:
1657         (-[WKContentView _didHandleStartDataInteractionRequest:]):
1658         (-[WKContentView cleanUpDragSourceSessionState]):
1659         (-[WKContentView _didPerformDataInteractionControllerOperation:]):
1660         (-[WKContentView _dragInteraction:prepareForSession:completion:]):
1661         (-[WKContentView dragInteraction:itemsForBeginningSession:]):
1662         (-[WKContentView dragInteraction:sessionWillBegin:]):
1663         (-[WKContentView _api_dragInteraction:session:didEndWithOperation:]):
1664         (-[WKContentView dropInteraction:canHandleSession:]):
1665         (-[WKContentView _api_dropInteraction:sessionDidEnter:]):
1666         (-[WKContentView dropInteraction:sessionDidExit:]):
1667         (-[WKContentView dropInteraction:performDrop:]):
1668         (-[WKContentView dropInteraction:sessionDidEnd:]):
1669
1670 2017-06-21  Jeremy Jones  <jeremyj@apple.com>
1671
1672         Don't clear audio mute when muting capture.
1673         https://bugs.webkit.org/show_bug.cgi?id=173639
1674         rdar://problem/32749737
1675
1676         Reviewed by Eric Carlson.
1677
1678         Setting capture mute was clearing audio mute.
1679         Added setMediaStreamCaptureMuted to set just the capture mute bit.
1680
1681         * UIProcess/API/Cocoa/WKWebView.mm:
1682         (-[WKWebView _muteMediaCapture]):
1683         * UIProcess/UserMediaProcessManager.cpp:
1684         (WebKit::UserMediaProcessManager::muteCaptureMediaStreamsExceptIn):
1685         * UIProcess/WebPageProxy.cpp:
1686         (WebKit::WebPageProxy::setMediaStreamCaptureMuted):
1687         * UIProcess/WebPageProxy.h:
1688
1689 2017-06-21  Miguel Gomez  <magomez@igalia.com>
1690
1691         [GTK][WAYLAND] Create WaylandCompositorDisplay unconditionally when initializing the WebProcess
1692         https://bugs.webkit.org/show_bug.cgi?id=173598
1693
1694         Reviewed by Carlos Garcia Campos.
1695
1696         Move WaylandCompositorDisplay code to its own files so it can be used from other classes. Then, instead of
1697         storing the waylandCompositorDisplayName in the WebProcess, keep a WaylandCompositorDisplay instance that
1698         is created during the initialization. This way the appropriate sharedDisplayForCompositing will be set
1699         since the creation of the WebProcess.
1700
1701         * PlatformGTK.cmake:
1702         * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.cpp:
1703         (WebKit::AcceleratedSurfaceWayland::create):
1704         (WebKit::AcceleratedSurfaceWayland::AcceleratedSurfaceWayland):
1705         * WebProcess/WebProcess.cpp:
1706         (WebKit::WebProcess::initializeWebProcess):
1707         * WebProcess/WebProcess.h:
1708         (WebKit::WebProcess::waylandCompositorDisplay):
1709         * WebProcess/gtk/WaylandCompositorDisplay.cpp: Added.
1710         (WebKit::WaylandCompositorDisplay::create):
1711         (WebKit::WaylandCompositorDisplay::bindSurfaceToPage):
1712         (WebKit::WaylandCompositorDisplay::WaylandCompositorDisplay):
1713         (WebKit::WaylandCompositorDisplay::registryGlobal):
1714         * WebProcess/gtk/WaylandCompositorDisplay.h: Added.
1715         * WebProcess/soup/WebProcessSoup.cpp:
1716         (WebKit::WebProcess::platformInitializeWebProcess):
1717
1718 2017-06-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1719
1720         [GTK] Move WebGtkExtensionManager and WebGtkInjectedBundleMain to glib API dir
1721         https://bugs.webkit.org/show_bug.cgi?id=173606
1722
1723         Reviewed by Žan Doberšek.
1724
1725         And rename them to use WebKit prefix instead of WebGtk.
1726
1727         * PlatformGTK.cmake:
1728         * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp: Renamed from Source/WebKit2/WebProcess/gtk/WebGtkExtensionManager.cpp.
1729         (WebKit::WebKitExtensionManager::singleton):
1730         (WebKit::WebKitExtensionManager::WebKitExtensionManager):
1731         (WebKit::WebKitExtensionManager::scanModules):
1732         (WebKit::WebKitExtensionManager::initializeWebExtension):
1733         (WebKit::WebKitExtensionManager::initialize):
1734         * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.h: Renamed from Source/WebKit2/WebProcess/gtk/WebGtkExtensionManager.h.
1735         * WebProcess/InjectedBundle/API/glib/WebKitInjectedBundleMain.cpp: Renamed from Source/WebKit2/WebProcess/gtk/WebGtkInjectedBundleMain.cpp.
1736         (WKBundleInitialize):
1737
1738 2017-06-20  Frederic Wang  <fwang@igalia.com>
1739
1740         Pass the argument of DrawingArea::shouldUseTiledBackingForFrameView by reference
1741         https://bugs.webkit.org/show_bug.cgi?id=173605
1742
1743         DrawingArea::shouldUseTiledBackingForFrameView is only called from
1744         WebChromeClient::shouldUseTiledBackingForFrameView where the frame view is already available
1745         as a reference. This patch makes the argument of
1746         DrawingArea::shouldUseTiledBackingForFrameView a reference, so it does not need to be
1747         converted to a pointer or to perform nullchecks.
1748
1749         Reviewed by Simon Fraser.
1750
1751         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1752         (WebKit::WebChromeClient::shouldUseTiledBackingForFrameView): Just pass the reference.
1753         * WebProcess/WebPage/DrawingArea.h: Make the parameter a reference.
1754         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: Ditto.
1755         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: Ditto.
1756         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1757         (WebKit::RemoteLayerTreeDrawingArea::shouldUseTiledBackingForFrameView): Use the reference
1758         to frame view and remove the nullcheck.
1759         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1760         (WebKit::TiledCoreAnimationDrawingArea::shouldUseTiledBackingForFrameView): Ditto.
1761
1762 2017-06-20  Myles C. Maxfield  <mmaxfield@apple.com>
1763
1764         Disable font variations on macOS Sierra and iOS 10
1765         https://bugs.webkit.org/show_bug.cgi?id=173618
1766         <rdar://problem/32879164>
1767
1768         Reviewed by Jon Lee.
1769
1770         * Configurations/FeatureDefines.xcconfig:
1771
1772 2017-06-20  Daniel Bates  <dabates@apple.com>
1773
1774         Have FrameLoadRequest takes a Frame& instead of a Frame*
1775         https://bugs.webkit.org/show_bug.cgi?id=173614
1776         <rdar://problem/32884890>
1777
1778         Reviewed by Brent Fulgham.
1779
1780         * WebProcess/Plugins/PluginView.cpp:
1781         (WebKit::PluginView::performFrameLoadURLRequest):
1782         * WebProcess/WebPage/WebPage.cpp:
1783         (WebKit::WebPage::loadURLInFrame):
1784         (WebKit::WebPage::loadRequest):
1785         (WebKit::WebPage::loadDataImpl):
1786
1787 2017-06-20  Tim Horton  <timothy_horton@apple.com>
1788
1789         Occasional deadlocks under ensurePositionInformationIsUpToDate (incoming sync message with waitForAndDispatchImmediately)
1790         https://bugs.webkit.org/show_bug.cgi?id=173570
1791         <rdar://problem/32720928>
1792
1793         Reviewed by Wenson Hsieh.
1794
1795         * UIProcess/WebPageProxy.h:
1796         * UIProcess/ios/WebPageProxyIOS.mm:
1797         (WebKit::WebPageProxy::getPositionInformation): Deleted.
1798         Get rid of getPositionInformation; it only has one caller, and it's easier
1799         to reason about the code if it's all in one place. Also, we shouldn't
1800         add more callers...
1801
1802         * UIProcess/ios/WKContentViewInteraction.h:
1803         * UIProcess/ios/WKContentViewInteraction.mm:
1804         (-[WKContentView ensurePositionInformationIsUpToDate:]):
1805         Add a return value to ensurePositionInformationIsUpToDate that indicates
1806         whether we succeeded in that effort.
1807
1808         Add the flag to our waitForAndDispatchImmediately that causes the wait
1809         to be interrupted if a sync message arrives.
1810
1811         (-[WKContentView gestureRecognizerShouldBegin:]):
1812         (-[WKContentView hasSelectablePositionAtPoint:]):
1813         (-[WKContentView pointIsNearMarkedText:]):
1814         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
1815         (-[WKContentView positionInformationForActionSheetAssistant:]):
1816         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
1817         If anything happens to interrupt our position information update, fail
1818         in the most graceful possible way at each callsite (generally by bailing
1819         from doing whatever action required position information).
1820
1821         * UIProcess/ios/WKPDFView.mm:
1822         (-[WKPDFView positionInformationForActionSheetAssistant:]):
1823         * UIProcess/ios/WKActionSheetAssistant.h:
1824         * UIProcess/ios/WKActionSheetAssistant.mm:
1825         (-[WKActionSheetAssistant synchronouslyRetrievePositionInformation]):
1826         (-[WKActionSheetAssistant presentationRectForElementUsingClosestIndicatedRect]):
1827         (-[WKActionSheetAssistant presentationRectForIndicatedElement]):
1828         (-[WKActionSheetAssistant initialPresentationRectInHostViewForSheet]):
1829         (-[WKActionSheetAssistant presentationRectInHostViewForSheet]):
1830         (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]):
1831         (-[WKActionSheetAssistant showImageSheet]):
1832         (-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
1833         (-[WKActionSheetAssistant showLinkSheet]):
1834         (-[WKActionSheetAssistant showDataDetectorsSheet]):
1835         (-[WKActionSheetAssistant cleanupSheet]):
1836         Instead of constantly re-querying the position information, save it aside
1837         when presenting an action sheet, and use it to respond to all of the
1838         subsequent questions. Also, bail from presenting the action sheet if we fail
1839         to retrieve correct position information.
1840
1841 2017-06-20  Matt Lewis  <jlewis3@apple.com>
1842
1843         Unreviewed, rolling out r218530.
1844
1845         This revision caused multiple media stream test crashes on
1846         Debug builds.
1847
1848         Reverted changeset:
1849
1850         "Merge MediaDevicesRequest and MediaDevicesEnumerationRequest
1851         to tighten up code and object lifetime"
1852         https://bugs.webkit.org/show_bug.cgi?id=173527
1853         http://trac.webkit.org/changeset/218530
1854
1855 2017-06-20  Wenson Hsieh  <wenson_hsieh@apple.com>
1856
1857         [iOS DnD] [WK2] Remove custom logic for disambiguating long press action sheet gestures and drag lift
1858         https://bugs.webkit.org/show_bug.cgi?id=173578
1859         <rdar://problem/32825028>
1860
1861         Reviewed by Tim Horton.
1862
1863         Custom logic to cancel the long press action gesture recognizer in WebKit2 was added months ago to achieve
1864         spec'ed behavior when initiating a drag on an element with an action sheet to show on long press. Now that UIKit
1865         defers firing long-press gesture recognizers while a drag lift is recognizing, no extra work in WebKit is needed
1866         to achieve expected behavior.
1867
1868         * UIProcess/API/Cocoa/WKWebView.mm:
1869         (-[WKWebView _simulateLongPressActionAtLocation:]):
1870         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1871
1872         Add testing SPI for showing an action sheet popover at a given location in content view coordinates.
1873
1874         * UIProcess/ios/WKContentViewInteraction.h:
1875         * UIProcess/ios/WKContentViewInteraction.mm:
1876         (-[WKContentView _startDataInteractionWithImage:withIndicatorData:atClientPosition:anchorPoint:action:]):
1877         (-[WKContentView _didHandleStartDataInteractionRequest:]):
1878         (-[WKContentView _dragInteraction:prepareForSession:completion:]):
1879         (-[WKContentView dragInteraction:sessionWillBegin:]):
1880         (-[WKContentView _api_dragInteraction:session:didEndWithOperation:]):
1881         (-[WKContentView _simulateLongPressActionAtLocation:]):
1882         (longPressActionDelayAfterLift): Deleted.
1883         (-[WKContentView performDeferredActionAtDragOrigin]): Deleted.
1884         (-[WKContentView cancelDeferredActionAtDragOrigin]): Deleted.
1885
1886 2017-06-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1887
1888         [WPE] Add initial implementation of glib API
1889         https://bugs.webkit.org/show_bug.cgi?id=173546
1890
1891         Reviewed by Žan Doberšek.
1892
1893         Make current API files under glib directories build in WPE, and add the minimum implementation to make it
1894         work. For now it doesn't have web extensions API, and there are a few FIXMEs that will be fixed in follow up
1895         commits. It doesn't include install rules yet, since it's still not ready to be installed.
1896
1897         * PlatformGTK.cmake:
1898         * PlatformWPE.cmake:
1899         * Shared/API/glib/WebKitContextMenuActions.cpp:
1900         (webkitContextMenuActionGetActionTag):
1901         (webkitContextMenuActionGetForContextMenuItem):
1902         (webkitContextMenuActionGetLabel):
1903         * Shared/API/glib/WebKitContextMenuItem.cpp:
1904         * UIProcess/API/glib/WebKitEditorState.cpp:
1905         (webkitEditorStateChanged):
1906         * UIProcess/API/glib/WebKitError.cpp:
1907         * UIProcess/API/glib/WebKitFileChooserRequest.cpp:
1908         (webkitFileChooserRequestGetProperty):
1909         (webkit_file_chooser_request_class_init):
1910         * UIProcess/API/glib/WebKitInstallMissingMediaPluginsPermissionRequest.cpp:
1911         (createGstInstallPluginsContext):
1912         (webkitInstallMissingMediaPluginsPermissionRequestAllow):
1913         * UIProcess/API/glib/WebKitNavigationAction.cpp:
1914         * UIProcess/API/glib/WebKitNavigationActionPrivate.h:
1915         (_WebKitNavigationAction::_WebKitNavigationAction):
1916         * UIProcess/API/glib/WebKitNotificationPrivate.h:
1917         * UIProcess/API/glib/WebKitNotificationProvider.cpp:
1918         (WebKitNotificationProvider::show):
1919         * UIProcess/API/glib/WebKitPrivate.cpp:
1920         (toPlatformModifiers):
1921         (toWebKitError):
1922         (toWebCoreError):
1923         * UIProcess/API/glib/WebKitPrivate.h:
1924         * UIProcess/API/glib/WebKitSettings.cpp:
1925         (webKitSettingsSetProperty):
1926         (webKitSettingsGetProperty):
1927         (webkit_settings_class_init):
1928         (webkit_settings_set_user_agent):
1929         (webkit_settings_set_user_agent_with_application_details):
1930         * UIProcess/API/glib/WebKitUIClient.cpp:
1931         * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
1932         (webkit_uri_scheme_request_get_web_view):
1933         * UIProcess/API/glib/WebKitUserContentManager.cpp:
1934         * UIProcess/API/glib/WebKitWebContext.cpp:
1935         (webkitWebContextConstructed):
1936         * UIProcess/API/glib/WebKitWebView.cpp:
1937         (webkitWebViewCreate):
1938         (webkit_web_view_class_init):
1939         (webkitWebViewCreatePage):
1940         (webkitWebViewRunAsModal):
1941         (webkitWebViewMouseTargetChanged):
1942         (webkitWebViewEnterFullScreen):
1943         (webkitWebViewExitFullScreen):
1944         (webkitWebViewPopulateContextMenu):
1945         * UIProcess/API/glib/WebKitWebViewPrivate.h:
1946         * UIProcess/API/glib/WebKitWindowProperties.cpp:
1947         (webkitWindowPropertiesGetProperty):
1948         (webkitWindowPropertiesSetProperty):
1949         (webkit_window_properties_class_init):
1950         (webkitWindowPropertiesUpdateFromWebWindowFeatures):
1951         * UIProcess/API/glib/WebKitWindowPropertiesPrivate.h:
1952         * UIProcess/API/gtk/WebKitWebViewGtk.cpp: Added.
1953         (webkitWebViewAuthenticate):
1954         (webkitWebViewCreateJavaScriptDialog):
1955         (webkitWebViewScriptDialog):
1956         (fileChooserDialogResponseCallback):
1957         (webkitWebViewRunFileChooser):
1958         (webkit_web_view_new):
1959         (webkit_web_view_new_with_context):
1960         (webkit_web_view_new_with_related_view):
1961         (webkit_web_view_new_with_settings):
1962         (webkit_web_view_new_with_user_content_manager):
1963         * UIProcess/API/wpe/WPEView.h:
1964         * UIProcess/API/wpe/WebKitAuthenticationRequest.h: Added.
1965         * UIProcess/API/wpe/WebKitAutomationSession.h: Added.
1966         * UIProcess/API/wpe/WebKitBackForwardList.h: Added.
1967         * UIProcess/API/wpe/WebKitBackForwardListItem.h: Added.
1968         * UIProcess/API/wpe/WebKitContextMenu.h: Added.
1969         * UIProcess/API/wpe/WebKitContextMenuActions.h: Added.
1970         * UIProcess/API/wpe/WebKitContextMenuItem.h: Added.
1971         * UIProcess/API/wpe/WebKitCookieManager.h: Added.
1972         * UIProcess/API/wpe/WebKitCredential.h: Added.
1973         * UIProcess/API/wpe/WebKitDefines.h: Copied from Source/WebKit2/UIProcess/API/glib/WebKitPrivate.h.
1974         * UIProcess/API/wpe/WebKitDownload.h: Added.
1975         * UIProcess/API/wpe/WebKitEditingCommands.h: Added.
1976         * UIProcess/API/wpe/WebKitEditorState.h: Added.
1977         * UIProcess/API/wpe/WebKitEnumTypes.cpp.template: Added.
1978         * UIProcess/API/wpe/WebKitEnumTypes.h.template: Copied from Source/WebKit2/UIProcess/API/glib/WebKitNotificationPrivate.h.
1979         * UIProcess/API/wpe/WebKitError.h: Added.
1980         * UIProcess/API/wpe/WebKitFaviconDatabase.h: Added.
1981         * UIProcess/API/wpe/WebKitFileChooserRequest.h: Added.
1982         * UIProcess/API/wpe/WebKitFindController.h: Added.
1983         * UIProcess/API/wpe/WebKitFormSubmissionRequest.h: Added.
1984         * UIProcess/API/wpe/WebKitGeolocationPermissionRequest.h: Added.
1985         * UIProcess/API/wpe/WebKitHitTestResult.h: Added.
1986         * UIProcess/API/wpe/WebKitInstallMissingMediaPluginsPermissionRequest.h: Added.
1987         * UIProcess/API/wpe/WebKitJavascriptResult.h: Added.
1988         * UIProcess/API/wpe/WebKitMimeInfo.h: Added.
1989         * UIProcess/API/wpe/WebKitNavigationAction.h: Added.
1990         * UIProcess/API/wpe/WebKitNavigationPolicyDecision.h: Added.
1991         * UIProcess/API/wpe/WebKitNetworkProxySettings.h: Added.
1992         * UIProcess/API/wpe/WebKitNotification.h: Added.
1993         * UIProcess/API/wpe/WebKitNotificationPermissionRequest.h: Added.
1994         * UIProcess/API/wpe/WebKitPermissionRequest.h: Added.
1995         * UIProcess/API/wpe/WebKitPlugin.h: Added.
1996         * UIProcess/API/wpe/WebKitPolicyDecision.h: Added.
1997         * UIProcess/API/wpe/WebKitResponsePolicyDecision.h: Added.
1998         * UIProcess/API/wpe/WebKitScriptDialog.h: Added.
1999         * UIProcess/API/wpe/WebKitSecurityManager.h: Added.
2000         * UIProcess/API/wpe/WebKitSecurityOrigin.h: Added.
2001         * UIProcess/API/wpe/WebKitSettings.h: Added.
2002         * UIProcess/API/wpe/WebKitURIRequest.h: Added.
2003         * UIProcess/API/wpe/WebKitURIResponse.h: Added.
2004         * UIProcess/API/wpe/WebKitURISchemeRequest.h: Added.
2005         * UIProcess/API/wpe/WebKitUserContent.h: Added.
2006         * UIProcess/API/wpe/WebKitUserContentManager.h: Added.
2007         * UIProcess/API/wpe/WebKitUserMediaPermissionRequest.h: Added.
2008         * UIProcess/API/wpe/WebKitWebContext.h: Added.
2009         * UIProcess/API/wpe/WebKitWebResource.h: Added.
2010         * UIProcess/API/wpe/WebKitWebView.h: Added.
2011         * UIProcess/API/wpe/WebKitWebViewSessionState.h: Added.
2012         * UIProcess/API/wpe/WebKitWebViewWPE.cpp: Added.
2013         (webkitWebViewAuthenticate):
2014         (webkitWebViewScriptDialog):
2015         (webkitWebViewRunFileChooser):
2016         (webkit_web_view_new):
2017         (webkit_web_view_new_with_context):
2018         (webkit_web_view_new_with_related_view):
2019         (webkit_web_view_new_with_settings):
2020         (webkit_web_view_new_with_user_content_manager):
2021         * UIProcess/API/wpe/WebKitWebsiteData.h: Added.
2022         * UIProcess/API/wpe/WebKitWebsiteDataManager.h: Added.
2023         * UIProcess/API/wpe/WebKitWindowProperties.h: Added.
2024         * UIProcess/API/wpe/webkit.h: Added.
2025
2026 2017-06-19  Frederic Wang  <fwang@igalia.com>
2027
2028         [iOS] Always include frames in the scrolling tree when async frame scrolling is enabled
2029         https://bugs.webkit.org/show_bug.cgi?id=173405
2030
2031         Reviewed by Simon Fraser.
2032
2033         * WebProcess/WebCoreSupport/WebChromeClient.h: Set the ScrollableNonMainFrameTrigger bit by
2034         default on iOS too. RenderLayerCompositor::requiresCompositingForScrollableFrame will ignore
2035         this change when async frame scrolling is disabled.
2036
2037 2017-06-19  Frederic Wang  <fred.wang@free.fr>
2038
2039         [Mac] Add an experimental feature setting for async frame scrolling
2040         https://bugs.webkit.org/show_bug.cgi?id=173359
2041
2042         Reviewed by Simon Fraser.
2043
2044         * Shared/WebPreferencesDefinitions.h: Add experimental feature "async frame scrolling".
2045         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2046         (WKBundleSetAsyncFrameScrollingEnabled): Add setter for async frame scrolling.
2047         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: Declare setter.
2048         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2049         (WebKit::InjectedBundle::setAsyncFrameScrollingEnabled): Add setter for async frame scrolling.
2050         * WebProcess/InjectedBundle/InjectedBundle.h: Declare setter.
2051         * WebProcess/WebPage/WebPage.cpp:
2052         (WebKit::WebPage::updatePreferences): Take into account preference update for async frame
2053         scrolling.
2054
2055 2017-06-19  Darin Adler  <darin@apple.com>
2056
2057         Merge MediaDevicesRequest and MediaDevicesEnumerationRequest to tighten up code and object lifetime
2058         https://bugs.webkit.org/show_bug.cgi?id=173527
2059
2060         Reviewed by Sam Weinig.
2061
2062         * UIProcess/API/C/WKUserMediaPermissionCheck.h: Fixed incorrect file name in comment.
2063
2064         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2065         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices): Use the new frame
2066         function from MediaDevicesEnumerationRequest rather than finding the frame with our
2067         own code.
2068
2069         * WebProcess/WebCoreSupport/WebUserMediaClient.cpp: Removed unneeded include of UserMediaController.h.
2070
2071 2017-06-19  Chris Dumez  <cdumez@apple.com>
2072
2073         Regression(r217570): com.apple.WebKit.Networking crash at com.apple.WebKit: WebKit::ChildProcess::didReceiveInvalidMessage (Breaks 32-bit apps)
2074         https://bugs.webkit.org/show_bug.cgi?id=173576
2075         <rdar://problem/32416291>
2076
2077         Reviewed by Tim Horton.
2078
2079         The IPC encoding / decoding code cannot be architecture-specific because a 32bit UIProcess
2080         talks to a 64bit NetworkProcess. The WEB_RTC build time flag is enabled on 64bit only.
2081         Therefore, we should not use #if ENABLE(WEB_RTC) in IPC encoding / decoding code.
2082
2083         * Shared/WebPageCreationParameters.cpp:
2084         (WebKit::WebPageCreationParameters::encode):
2085         (WebKit::WebPageCreationParameters::decode):
2086         * Shared/WebPageCreationParameters.h:
2087
2088 2017-06-19  Chris Dumez  <cdumez@apple.com>
2089
2090         Unreviewed, partial rollout of r218501 to address crashes on iOS.
2091
2092         * UIProcess/Cocoa/NavigationState.mm:
2093         (WebKit::tryAppLink):
2094
2095 2017-06-19  Darin Adler  <darin@apple.com>
2096
2097         [Cocoa] implement URLSession:task:needNewBodyStream: delegate method
2098         https://bugs.webkit.org/show_bug.cgi?id=173551
2099         rdar://problem/32250512
2100
2101         Reviewed by Alex Christensen.
2102
2103         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2104         (-[WKNetworkSessionDelegate existingTask:]): Added helper method.
2105         (-[WKNetworkSessionDelegate URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:]):
2106         Updated to use existingTask: method.
2107         (-[WKNetworkSessionDelegate URLSession:task:needNewBodyStream:]): Added.
2108         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
2109         Updated to use existingTask: method.
2110         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]): Ditto.
2111         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]): Ditto.
2112         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]): Ditto.
2113         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]): Ditto.
2114         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]): Ditto.
2115         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]): Ditto.
2116         (-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]): Ditto.
2117         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]): Ditto.
2118         (WebKit::globalAllowsCellularAccess): Deleted. Just use a normal global.
2119         (WebKit::globalLegacyCustomProtocolManager): Deleted. Just use a normal global.
2120         (WebKit::NetworkSessionCocoa::setLegacyCustomProtocolManager): Updated for normal global.
2121         (WebKit::NetworkSessionCocoa::setAllowsCellularAccess): Ditto.
2122         (WebKit::NetworkSessionCocoa::defaultSession): Ditto.
2123         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Ditto.
2124
2125 2017-06-19  Ryan Haddad  <ryanhaddad@apple.com>
2126
2127         Unreviewed, rolling out r218503.
2128
2129         This change broke the macOS Sierra build.
2130
2131         Reverted changeset:
2132
2133         "Removed unused lambda captures from WebKit2"
2134         https://bugs.webkit.org/show_bug.cgi?id=173555
2135         http://trac.webkit.org/changeset/218503
2136
2137 2017-06-19  Wenson Hsieh  <wenson_hsieh@apple.com>
2138
2139         [iOS DnD] [WK2] Add an internal hook to change the drag lift delay
2140         https://bugs.webkit.org/show_bug.cgi?id=173523
2141         <rdar://problem/32224510>
2142
2143         Reviewed by Tim Horton.
2144
2145         Add a new private property on WKWebViewConfiguration, _dragLiftDelay, for changing the UIDragInteraction's lift
2146         delay to one of three values: short, medium or long. The short setting simply uses UIKit's default drag lift
2147         delay (at the time of writing, this is 325ms); medium and long are 500ms and 650ms, respectively.
2148
2149         In combination with an internal switch to toggle between lift delays, the purpose of this change is to make it
2150         easier to choose a drag lift delay for web content that doesn't easily cause unintended dragging while panning.
2151
2152         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2153         (toDragLiftDelay):
2154
2155         Converts an integer (e.g. retrieved from user defaults) to a drag lift delay type.
2156
2157         (-[WKWebViewConfiguration init]):
2158         (-[WKWebViewConfiguration encodeWithCoder:]):
2159         (-[WKWebViewConfiguration initWithCoder:]):
2160         (-[WKWebViewConfiguration copyWithZone:]):
2161         (-[WKWebViewConfiguration _dragLiftDelay]):
2162
2163         Add boilerplate plumbing for the _dragLiftDelay setting.
2164
2165         (-[WKWebViewConfiguration _setDragLiftDelay:]):
2166         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2167
2168         Add _dragLiftDelay to as a private property of WKWebViewConiguration.
2169
2170         * UIProcess/ios/WKContentViewInteraction.mm:
2171         (-[WKContentView dragLiftDelay]):
2172
2173         Convert the web view configuration's _WKDragLiftDelay to an actual time interval.
2174
2175         (-[WKContentView setupDataInteractionDelegates]):
2176
2177 2017-06-19  Konstantin Tokarev  <annulen@yandex.ru>
2178
2179         Removed unused lambda captures from WebKit2
2180         https://bugs.webkit.org/show_bug.cgi?id=173555
2181
2182         Reviewed by Alex Christensen.
2183
2184         * UIProcess/Network/NetworkProcessProxy.cpp:
2185         (WebKit::NetworkProcessProxy::fetchWebsiteData):
2186         (WebKit::NetworkProcessProxy::deleteWebsiteData):
2187         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
2188         * UIProcess/WebProcessProxy.cpp:
2189         (WebKit::WebProcessProxy::fetchWebsiteData):
2190         (WebKit::WebProcessProxy::deleteWebsiteData):
2191         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
2192         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2193         (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData):
2194
2195 2017-06-19  Chris Dumez  <cdumez@apple.com>
2196
2197         Use WTF::Function instead of std::function in more places in WebCore/
2198         https://bugs.webkit.org/show_bug.cgi?id=173535
2199
2200         Reviewed by Antti Koivisto.
2201
2202         Use WTF::Function instead of std::function in more places in WebCore/ to avoid copying.
2203
2204         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2205         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2206         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
2207         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2208         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
2209         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2210         * WebProcess/WebPage/WebFrame.cpp:
2211         (WebKit::WebFrame::setUpPolicyListener):
2212         (WebKit::WebFrame::invalidatePolicyListener):
2213         * WebProcess/WebPage/WebFrame.h:
2214
2215 2017-06-19  Chris Dumez  <cdumez@apple.com>
2216
2217         [WK2] Add WKProcessPool SPI to efficiently reset all plugin load client policies
2218         https://bugs.webkit.org/show_bug.cgi?id=173472
2219         <rdar://problem/28858817>
2220
2221         Reviewed by Antti Koivisto.
2222
2223         Follow-up to r218419 to avoid copying the HashMap unnecessarily.
2224
2225         * UIProcess/WebProcessPool.cpp:
2226         (WebKit::WebProcessPool::resetPluginLoadClientPolicies):
2227         * UIProcess/WebProcessPool.h:
2228
2229 2017-06-19  Youenn Fablet  <youenn@apple.com>
2230
2231         A cloned MediaStreamTrack should mute independently other tracks using the same source
2232         https://bugs.webkit.org/show_bug.cgi?id=172831
2233         <rdar://problem/32518527>
2234
2235         Reviewed by Eric Carlson.
2236
2237         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
2238         (WebKit::UserMediaCaptureManager::Source::setStorage):
2239
2240 2017-06-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2241
2242         [GTK] Move GTK+ API files that could be shared to glib dirs
2243         https://bugs.webkit.org/show_bug.cgi?id=173545
2244
2245         Reviewed by Žan Doberšek.
2246
2247         Most of the files don't use GTK+ at all, or only for a few things that could be ifdefed. Public headers can
2248         never be shared, so move only private headers and cpp files. This patch moves the files without any
2249         modification to make everything easier, in follow up commits we will add the required ifdefs and refactorings to
2250         ensure the code can actually be shared.
2251
2252         * PlatformGTK.cmake:
2253         * Shared/API/glib/WebKitContextMenu.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenu.cpp.
2254         * Shared/API/glib/WebKitContextMenuActions.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.cpp.
2255         * Shared/API/glib/WebKitContextMenuActionsPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h.
2256         * Shared/API/glib/WebKitContextMenuItem.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItem.cpp.
2257         * Shared/API/glib/WebKitContextMenuItemPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItemPrivate.h.
2258         * Shared/API/glib/WebKitContextMenuPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuPrivate.h.
2259         * Shared/API/glib/WebKitHitTestResult.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResult.cpp.
2260         * Shared/API/glib/WebKitHitTestResultPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitHitTestResultPrivate.h.
2261         * Shared/API/glib/WebKitURIRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURIRequest.cpp.
2262         * Shared/API/glib/WebKitURIRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURIRequestPrivate.h.
2263         * Shared/API/glib/WebKitURIResponse.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURIResponse.cpp.
2264         * Shared/API/glib/WebKitURIResponsePrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURIResponsePrivate.h.
2265         * UIProcess/API/glib/WebKitAuthenticationRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitAuthenticationRequest.cpp.
2266         * UIProcess/API/glib/WebKitAuthenticationRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitAuthenticationRequestPrivate.h.
2267         * UIProcess/API/glib/WebKitAutomationSession.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitAutomationSession.cpp.
2268         * UIProcess/API/glib/WebKitAutomationSessionPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitAutomationSessionPrivate.h.
2269         * UIProcess/API/glib/WebKitBackForwardList.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardList.cpp.
2270         * UIProcess/API/glib/WebKitBackForwardListItem.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListItem.cpp.
2271         * UIProcess/API/glib/WebKitBackForwardListPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitBackForwardListPrivate.h.
2272         * UIProcess/API/glib/WebKitContextMenuClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuClient.cpp.
2273         * UIProcess/API/glib/WebKitContextMenuClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuClient.h.
2274         * UIProcess/API/glib/WebKitCookieManager.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCookieManager.cpp.
2275         * UIProcess/API/glib/WebKitCookieManagerPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCookieManagerPrivate.h.
2276         * UIProcess/API/glib/WebKitCredential.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCredential.cpp.
2277         * UIProcess/API/glib/WebKitCredentialPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCredentialPrivate.h.
2278         * UIProcess/API/glib/WebKitCustomProtocolManagerClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp.
2279         * UIProcess/API/glib/WebKitCustomProtocolManagerClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitCustomProtocolManagerClient.h.
2280         * UIProcess/API/glib/WebKitDownload.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp.
2281         * UIProcess/API/glib/WebKitDownloadClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitDownloadClient.cpp.
2282         * UIProcess/API/glib/WebKitDownloadClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitDownloadClient.h.
2283         * UIProcess/API/glib/WebKitDownloadPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitDownloadPrivate.h.
2284         * UIProcess/API/glib/WebKitEditorState.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitEditorState.cpp.
2285         * UIProcess/API/glib/WebKitEditorStatePrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitEditorStatePrivate.h.
2286         * UIProcess/API/glib/WebKitError.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitError.cpp.
2287         * UIProcess/API/glib/WebKitFaviconDatabase.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFaviconDatabase.cpp.
2288         * UIProcess/API/glib/WebKitFaviconDatabasePrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFaviconDatabasePrivate.h.
2289         * UIProcess/API/glib/WebKitFileChooserRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequest.cpp.
2290         * UIProcess/API/glib/WebKitFileChooserRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h.
2291         * UIProcess/API/glib/WebKitFindController.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFindController.cpp.
2292         * UIProcess/API/glib/WebKitFormClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFormClient.cpp.
2293         * UIProcess/API/glib/WebKitFormClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFormClient.h.
2294         * UIProcess/API/glib/WebKitFormSubmissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp.
2295         * UIProcess/API/glib/WebKitFormSubmissionRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h.
2296         * UIProcess/API/glib/WebKitGeolocationPermissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp.
2297         * UIProcess/API/glib/WebKitGeolocationPermissionRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationPermissionRequestPrivate.h.
2298         * UIProcess/API/glib/WebKitGeolocationProvider.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.cpp.
2299         * UIProcess/API/glib/WebKitGeolocationProvider.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitGeolocationProvider.h.
2300         * UIProcess/API/glib/WebKitInjectedBundleClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitInjectedBundleClient.cpp.
2301         * UIProcess/API/glib/WebKitInjectedBundleClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitInjectedBundleClient.h.
2302         * UIProcess/API/glib/WebKitInstallMissingMediaPluginsPermissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.cpp.
2303         * UIProcess/API/glib/WebKitInstallMissingMediaPluginsPermissionRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequestPrivate.h.
2304         * UIProcess/API/glib/WebKitJavascriptResult.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResult.cpp.
2305         * UIProcess/API/glib/WebKitJavascriptResultPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitJavascriptResultPrivate.h.
2306         * UIProcess/API/glib/WebKitLoaderClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp.
2307         * UIProcess/API/glib/WebKitLoaderClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.h.
2308         * UIProcess/API/glib/WebKitMimeInfo.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitMimeInfo.cpp.
2309         * UIProcess/API/glib/WebKitMimeInfoPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitMimeInfoPrivate.h.
2310         * UIProcess/API/glib/WebKitNavigationAction.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNavigationAction.cpp.
2311         * UIProcess/API/glib/WebKitNavigationActionPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNavigationActionPrivate.h.
2312         * UIProcess/API/glib/WebKitNavigationPolicyDecision.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp.
2313         * UIProcess/API/glib/WebKitNavigationPolicyDecisionPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h.
2314         * UIProcess/API/glib/WebKitNetworkProxySettings.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNetworkProxySettings.cpp.
2315         * UIProcess/API/glib/WebKitNetworkProxySettingsPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNetworkProxySettingsPrivate.h.
2316         * UIProcess/API/glib/WebKitNotification.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotification.cpp.
2317         * UIProcess/API/glib/WebKitNotificationPermissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPermissionRequest.cpp.
2318         * UIProcess/API/glib/WebKitNotificationPermissionRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPermissionRequestPrivate.h.
2319         * UIProcess/API/glib/WebKitNotificationPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotificationPrivate.h.
2320         * UIProcess/API/glib/WebKitNotificationProvider.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.cpp.
2321         * UIProcess/API/glib/WebKitNotificationProvider.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitNotificationProvider.h.
2322         * UIProcess/API/glib/WebKitPermissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPermissionRequest.cpp.
2323         * UIProcess/API/glib/WebKitPlugin.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPlugin.cpp.
2324         * UIProcess/API/glib/WebKitPluginPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPluginPrivate.h.
2325         * UIProcess/API/glib/WebKitPolicyClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.cpp.
2326         * UIProcess/API/glib/WebKitPolicyClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.h.
2327         * UIProcess/API/glib/WebKitPolicyDecision.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecision.cpp.
2328         * UIProcess/API/glib/WebKitPolicyDecisionPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPolicyDecisionPrivate.h.
2329         * UIProcess/API/glib/WebKitPrivate.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.cpp.
2330         * UIProcess/API/glib/WebKitPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitPrivate.h.
2331         * UIProcess/API/glib/WebKitResponsePolicyDecision.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp.
2332         * UIProcess/API/glib/WebKitResponsePolicyDecisionPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h.
2333         * UIProcess/API/glib/WebKitScriptDialog.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitScriptDialog.cpp.
2334         * UIProcess/API/glib/WebKitScriptDialogPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitScriptDialogPrivate.h.
2335         * UIProcess/API/glib/WebKitSecurityManager.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManager.cpp.
2336         * UIProcess/API/glib/WebKitSecurityManagerPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSecurityManagerPrivate.h.
2337         * UIProcess/API/glib/WebKitSecurityOrigin.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSecurityOrigin.cpp.
2338         * UIProcess/API/glib/WebKitSecurityOriginPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSecurityOriginPrivate.h.
2339         * UIProcess/API/glib/WebKitSettings.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp.
2340         * UIProcess/API/glib/WebKitSettingsPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitSettingsPrivate.h.
2341         * UIProcess/API/glib/WebKitUIClient.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.cpp.
2342         * UIProcess/API/glib/WebKitUIClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUIClient.h.
2343         * UIProcess/API/glib/WebKitURISchemeRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequest.cpp.
2344         * UIProcess/API/glib/WebKitURISchemeRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h.
2345         * UIProcess/API/glib/WebKitUserContent.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserContent.cpp.
2346         * UIProcess/API/glib/WebKitUserContentManager.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserContentManager.cpp.
2347         * UIProcess/API/glib/WebKitUserContentManagerPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserContentManagerPrivate.h.
2348         * UIProcess/API/glib/WebKitUserContentPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserContentPrivate.h.
2349         * UIProcess/API/glib/WebKitUserMediaPermissionRequest.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserMediaPermissionRequest.cpp.
2350         * UIProcess/API/glib/WebKitUserMediaPermissionRequestPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitUserMediaPermissionRequestPrivate.h.
2351         * UIProcess/API/glib/WebKitWebContext.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp.
2352         * UIProcess/API/glib/WebKitWebContextPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebContextPrivate.h.
2353         * UIProcess/API/glib/WebKitWebResource.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebResource.cpp.
2354         * UIProcess/API/glib/WebKitWebResourcePrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebResourcePrivate.h.
2355         * UIProcess/API/glib/WebKitWebView.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp.
2356         * UIProcess/API/glib/WebKitWebViewPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebViewPrivate.h.
2357         * UIProcess/API/glib/WebKitWebViewSessionState.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebViewSessionState.cpp.
2358         * UIProcess/API/glib/WebKitWebViewSessionStatePrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebViewSessionStatePrivate.h.
2359         * UIProcess/API/glib/WebKitWebsiteData.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteData.cpp.
2360         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteDataManager.cpp.
2361         * UIProcess/API/glib/WebKitWebsiteDataManagerPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteDataManagerPrivate.h.
2362         * UIProcess/API/glib/WebKitWebsiteDataPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWebsiteDataPrivate.h.
2363         * UIProcess/API/glib/WebKitWindowProperties.cpp: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWindowProperties.cpp.
2364         * UIProcess/API/glib/WebKitWindowPropertiesPrivate.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h.
2365         * WebProcess/InjectedBundle/API/glib/WebKitConsoleMessage.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessage.cpp.
2366         * WebProcess/InjectedBundle/API/glib/WebKitConsoleMessagePrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitConsoleMessagePrivate.h.
2367         * WebProcess/InjectedBundle/API/glib/WebKitFrame.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitFrame.cpp.
2368         * WebProcess/InjectedBundle/API/glib/WebKitFramePrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitFramePrivate.h.
2369         * WebProcess/InjectedBundle/API/glib/WebKitScriptWorld.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp.
2370         * WebProcess/InjectedBundle/API/glib/WebKitScriptWorldPrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitScriptWorldPrivate.h.
2371         * WebProcess/InjectedBundle/API/glib/WebKitWebEditor.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp.
2372         * WebProcess/InjectedBundle/API/glib/WebKitWebEditorPrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebEditorPrivate.h.
2373         * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp.
2374         * WebProcess/InjectedBundle/API/glib/WebKitWebExtensionPrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionPrivate.h.
2375         * WebProcess/InjectedBundle/API/glib/WebKitWebHitTestResult.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.cpp.
2376         * WebProcess/InjectedBundle/API/glib/WebKitWebHitTestResultPrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResultPrivate.h.
2377         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp.
2378         * WebProcess/InjectedBundle/API/glib/WebKitWebPagePrivate.h: Renamed from Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPagePrivate.h.
2379
2380 2017-05-14 Frederic Wang  <fwang@igalia.com>
2381
2382         Add heuristic to avoid flattening "fullscreen" iframes
2383         https://bugs.webkit.org/show_bug.cgi?id=171914
2384
2385         Reviewed by Simon Fraser.
2386
2387         This commit ajusts the preference API to internally treat frame flattening as an enum.
2388         However, the "partial frame flattening" value is not exposed to GTK, C or InjectedBundle APIs yet.
2389
2390         * Shared/WebPreferencesDefinitions.h: Define frame flattening as an enum.
2391         * UIProcess/API/C/WKPreferences.cpp:
2392         (WKPreferencesSetFrameFlatteningEnabled): Treat frame flattening as an enum.
2393         (WKPreferencesGetFrameFlatteningEnabled): Ditto.
2394         * UIProcess/API/gtk/WebKitSettings.cpp:
2395         (webkit_settings_get_enable_frame_flattening): Ditto.
2396         (webkit_settings_set_enable_frame_flattening): Ditto.
2397         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2398         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Do not handle frame flattening since it is an enum.
2399         For now, this breaks one test checking preference overriding because of bug 128594.
2400         (WebKit::InjectedBundle::setFrameFlatteningEnabled): Treat frame flattening as an enum.
2401         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2402         (WebKit::WebChromeClient::contentsSizeChanged): Use enum value.
2403         * WebProcess/WebPage/WebPage.cpp:
2404         (WebKit::WebPage::updatePreferences): Ditto.
2405
2406 2017-06-18  Carlos Garcia Campos  <cgarcia@igalia.com>
2407
2408         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.17.4 release.
2409
2410         * gtk/NEWS: Add release notes for 2.17.4.
2411
2412 2017-06-18  Chris Dumez  <cdumez@apple.com>
2413
2414         Drop redundant IPC in WebPage::tryClose()
2415         https://bugs.webkit.org/show_bug.cgi?id=173533
2416
2417         Reviewed by Sam Weinig.
2418
2419         Drop redundant IPC to stop the responsiveness timer in WebPage::tryClose(). The
2420         destructor for the SendStopResponsivenessTimer already takes care of sending the
2421         IPC.
2422
2423         * WebProcess/WebPage/WebPage.cpp:
2424         (WebKit::WebPage::tryClose):
2425
2426 2017-06-18  Chris Dumez  <cdumez@apple.com>
2427
2428         Drop unused UserMediaPermissionRequestManager::cancelPendingRequests()
2429         https://bugs.webkit.org/show_bug.cgi?id=173529
2430         <rdar://problem/32836986>
2431
2432         Reviewed by Sam Weinig.
2433
2434         Drop UserMediaPermissionRequestManager::cancelPendingRequests() as it is unused
2435         and its implementation is wrong (modifies the hash maps it is iterating on).
2436
2437         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2438         (WebKit::UserMediaPermissionRequestManager::cancelPendingRequests): Deleted.
2439         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
2440
2441 2017-06-17  Chris Dumez  <cdumez@apple.com>
2442
2443         Unreviewed, follow-up build fix after r218457.
2444
2445         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2446         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
2447
2448 2017-06-17  Chris Dumez  <cdumez@apple.com>
2449
2450         Unreviewed, follow-up build fix after r218457.
2451
2452         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2453         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
2454
2455 2017-06-17  Chris Dumez  <cdumez@apple.com>
2456
2457         Use WTF::Function instead of std::function in WebKit2/
2458         https://bugs.webkit.org/show_bug.cgi?id=173504
2459
2460         Reviewed by Darin Adler.
2461
2462         Use WTF::Function instead of std::function in WebKit2/ to avoid
2463         unnecessary copying.
2464
2465         * DatabaseProcess/DatabaseProcess.cpp:
2466         (WebKit::DatabaseProcess::getSandboxExtensionsForBlobFiles):
2467         * DatabaseProcess/DatabaseProcess.h:
2468         * NetworkProcess/cache/NetworkCacheData.h:
2469         * NetworkProcess/cache/NetworkCacheFileSystem.h:
2470         * Platform/IPC/Connection.cpp:
2471         (IPC::Connection::installIncomingSyncMessageCallback):
2472         * Platform/IPC/Connection.h:
2473         * Platform/IPC/glib/GSocketMonitor.h:
2474         * Platform/Logging.h:
2475         * Shared/API/APIObject.h:
2476         * Shared/AsyncRequest.cpp:
2477         (WebKit::AsyncRequest::AsyncRequest):
2478         (WebKit::AsyncRequest::setAbortHandler):
2479         * Shared/AsyncRequest.h:
2480         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
2481         (WebKit::CompositingRunLoop::CompositingRunLoop):
2482         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
2483         * Shared/WebContextMenuItemData.h:
2484         * UIProcess/API/APIDownloadClient.h:
2485         (API::DownloadClient::willSendRequest):
2486         * UIProcess/API/APIIconLoadingClient.h:
2487         (API::IconLoadingClient::getLoadDecisionForIcon):
2488         * UIProcess/API/APIUIClient.h:
2489         (API::UIClient::createNewPageAsync):
2490         * UIProcess/API/C/WKPage.cpp:
2491         (toGenericCallbackFunction):
2492         * UIProcess/API/Cocoa/WKWebView.mm:
2493         * UIProcess/API/mac/WKView.mm:
2494         (-[WKView maybeInstallIconLoadingClient]):
2495         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
2496         (WebKit::AcceleratedDrawingAreaProxy::dispatchAfterEnsuringDrawing):
2497         * UIProcess/AcceleratedDrawingAreaProxy.h:
2498         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
2499         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2500         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
2501         (WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup):
2502         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
2503         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
2504         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
2505         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
2506         * UIProcess/Automation/WebAutomationSession.cpp:
2507         (WebKit::WebAutomationSession::performKeyboardInteractions):
2508         * UIProcess/Cocoa/IconLoadingDelegate.h:
2509         * UIProcess/Cocoa/IconLoadingDelegate.mm:
2510         (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):
2511         * UIProcess/Cocoa/NavigationState.mm:
2512         (WebKit::tryAppLink):
2513         * UIProcess/Cocoa/UIDelegate.h:
2514         * UIProcess/Cocoa/UIDelegate.mm:
2515         (WebKit::UIDelegate::UIClient::createNewPageCommon):
2516         (WebKit::UIDelegate::UIClient::createNewPageAsync):
2517         * UIProcess/Cocoa/ViewGestureController.cpp:
2518         (WebKit::ViewGestureController::SnapshotRemovalTracker::start):
2519         * UIProcess/Cocoa/ViewGestureController.h:
2520         * UIProcess/Cocoa/WebViewImpl.h:
2521         * UIProcess/Cocoa/WebViewImpl.mm:
2522         (WebKit::WebViewImpl::prepareForMoveToWindow):
2523         * UIProcess/Databases/DatabaseProcessProxy.cpp:
2524         (WebKit::DatabaseProcessProxy::fetchWebsiteData):
2525         (WebKit::DatabaseProcessProxy::deleteWebsiteData):
2526         (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins):
2527         * UIProcess/Databases/DatabaseProcessProxy.h:
2528         * UIProcess/DrawingAreaProxy.h:
2529         (WebKit::DrawingAreaProxy::dispatchAfterEnsuringDrawing):
2530         * UIProcess/DrawingAreaProxyImpl.cpp:
2531         (WebKit::DrawingAreaProxyImpl::DrawingMonitor::start):
2532         (WebKit::DrawingAreaProxyImpl::dispatchAfterEnsuringDrawing):
2533         * UIProcess/DrawingAreaProxyImpl.h:
2534         * UIProcess/GenericCallback.h:
2535         * UIProcess/Network/NetworkProcessProxy.cpp:
2536         (WebKit::NetworkProcessProxy::fetchWebsiteData):
2537         (WebKit::NetworkProcessProxy::deleteWebsiteData):
2538         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
2539         * UIProcess/Network/NetworkProcessProxy.h:
2540         * UIProcess/PageClient.h:
2541         * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
2542         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest):
2543         * UIProcess/Plugins/PlugInAutoStartProvider.h:
2544         * UIProcess/Plugins/PluginProcessManager.cpp:
2545         (WebKit::PluginProcessManager::fetchWebsiteData):
2546         (WebKit::PluginProcessManager::deleteWebsiteData):
2547         (WebKit::PluginProcessManager::deleteWebsiteDataForHostNames):
2548         * UIProcess/Plugins/PluginProcessManager.h:
2549         * UIProcess/Plugins/PluginProcessProxy.cpp:
2550         (WebKit::PluginProcessProxy::fetchWebsiteData):
2551         (WebKit::PluginProcessProxy::deleteWebsiteData):
2552         (WebKit::PluginProcessProxy::deleteWebsiteDataForHostNames):
2553         * UIProcess/Plugins/PluginProcessProxy.h:
2554         * UIProcess/ProcessAssertion.h:
2555         * UIProcess/WebBackForwardList.cpp:
2556         (WebKit::WebBackForwardList::backForwardListState):
2557         * UIProcess/WebBackForwardList.h:
2558         * UIProcess/WebCookieManagerProxy.cpp:
2559         (WebKit::WebCookieManagerProxy::setCookieObserverCallback):
2560         (WebKit::WebCookieManagerProxy::cookiesDidChange):
2561         * UIProcess/WebCookieManagerProxy.h:
2562         * UIProcess/WebPageProxy.cpp:
2563         (WebKit::WebPageProxy::setInitialFocus):
2564         (WebKit::WebPageProxy::validateCommand):
2565         (WebKit::WebPageProxy::sessionState):
2566         (WebKit::WebPageProxy::runJavaScriptInMainFrame):
2567         (WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
2568         (WebKit::WebPageProxy::getSourceForFrame):
2569         (WebKit::WebPageProxy::getContentsAsString):
2570         (WebKit::WebPageProxy::getBytecodeProfile):
2571         (WebKit::WebPageProxy::getSamplingProfilerOutput):
2572         (WebKit::WebPageProxy::isWebProcessResponsive):
2573         (WebKit::WebPageProxy::getSelectionOrContentsAsString):
2574         (WebKit::WebPageProxy::createNewPage):
2575         (WebKit::WebPageProxy::getMarkedRangeAsync):
2576         (WebKit::WebPageProxy::getSelectedRangeAsync):
2577         (WebKit::WebPageProxy::characterIndexForPointAsync):
2578         (WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
2579         (WebKit::WebPageProxy::takeSnapshot):
2580         (WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
2581         (WebKit::WebPageProxy::callAfterNextPresentationUpdate):
2582         (WebKit::WebPageProxy::getLoadDecisionForIcon):
2583         * UIProcess/WebPageProxy.h:
2584         * UIProcess/WebProcessProxy.cpp:
2585         (WebKit::WebProcessProxy::isResponsive):
2586         * UIProcess/WebProcessProxy.h:
2587         * UIProcess/WebsiteData/WebsiteDataStore.h:
2588         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
2589         (WebKit::XDamageNotifier::add):
2590         * UIProcess/ios/PageClientImplIOS.h:
2591         * UIProcess/ios/PageClientImplIOS.mm:
2592         (WebKit::PageClientImpl::requestPasswordForQuickLookDocument):
2593         * UIProcess/ios/WebPageProxyIOS.mm:
2594         (WebKit::WebPageProxy::selectWithGesture):
2595         (WebKit::WebPageProxy::updateSelectionWithTouches):
2596         (WebKit::WebPageProxy::requestAutocorrectionData):
2597         (WebKit::WebPageProxy::applyAutocorrection):
2598         (WebKit::WebPageProxy::executeEditCommand):
2599         (WebKit::WebPageProxy::selectTextWithGranularityAtPoint):
2600         (WebKit::WebPageProxy::selectPositionAtBoundaryWithDirection):
2601         (WebKit::WebPageProxy::moveSelectionAtBoundaryWithDirection):
2602         (WebKit::WebPageProxy::selectPositionAtPoint):
2603         (WebKit::WebPageProxy::beginSelectionInDirection):
2604         (WebKit::WebPageProxy::updateSelectionWithExtentPoint):
2605         (WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary):
2606         (WebKit::WebPageProxy::requestDictationContext):
2607         (WebKit::WebPageProxy::requestAutocorrectionContext):
2608         (WebKit::WebPageProxy::getSelectionContext):
2609         (WebKit::WebPageProxy::selectWithTwoTouches):
2610         (WebKit::WebPageProxy::requestRectsForGranularityWithSelectionOffset):
2611         (WebKit::WebPageProxy::requestRectsAtSelectionOffsetWithText):
2612         (WebKit::WebPageProxy::moveSelectionByOffset):
2613         (WebKit::WebPageProxy::focusNextAssistedNode):
2614         (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame):
2615         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2616         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2617         (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
2618         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
2619         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2620         (WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing):
2621         * UIProcess/mac/WKTextFinderClient.mm:
2622         * UIProcess/mac/WebContextMenuProxyMac.mm:
2623         (-[WKSelectionHandlerWrapper initWithSelectionHandler:]):
2624         * UIProcess/mac/WebPageProxyMac.mm:
2625         (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
2626         (WebKit::WebPageProxy::fontAtSelection):
2627         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
2628         (WebKit::WebPaymentCoordinator::canMakePaymentsWithActiveCard):
2629         (WebKit::WebPaymentCoordinator::openPaymentSetup):
2630         * WebProcess/ApplePay/WebPaymentCoordinator.h:
2631         * WebProcess/Plugins/PluginView.cpp:
2632         (WebKit::PluginView::Stream::willSendRequest):
2633         * WebProcess/WebPage/DrawingArea.cpp:
2634         (WebKit::DrawingArea::dispatchAfterEnsuringUpdatedScrollPosition):
2635         * WebProcess/WebPage/DrawingArea.h:
2636         * WebProcess/WebPage/WebPage.cpp:
2637         (WebKit::WebPage::markLayersVolatile):
2638         * WebProcess/WebPage/WebPage.h:
2639         (WebKit::WebPage::markLayersVolatile):
2640         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2641         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2642         (WebKit::TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition):
2643         * WebProcess/WebProcess.cpp:
2644         (WebKit::WebProcess::markAllLayersVolatile):
2645         * WebProcess/WebProcess.h:
2646
2647 2017-06-17  Alex Christensen  <achristensen@webkit.org>
2648
2649         Fix CMake build
2650
2651         * CMakeLists.txt:
2652         * NetworkProcess/capture/NetworkCaptureEvent.cpp:
2653         * PlatformGTK.cmake:
2654         * PlatformWPE.cmake:
2655
2656 2017-06-17  Dan Bernstein  <mitz@apple.com>
2657
2658         Tried to fix non-iOS builds.
2659
2660         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2661
2662 2017-06-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2663
2664         [GTK] Rename WebContextMenuItemGtk as WebContextMenuItemGlib
2665         https://bugs.webkit.org/show_bug.cgi?id=173469
2666
2667         Reviewed by Michael Catanzaro.
2668
2669         Now that we switched to GAction this is actually a glib implementation, we keep the GtkAction support only for
2670         backwards compatibility. We could rename the file and make the GtkAction action conditional to the GTK+ port.
2671
2672         * PlatformGTK.cmake:
2673         * Shared/glib/WebContextMenuItemGlib.cpp: Renamed from Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.cpp.
2674         (WebKit::gtkStockIDFromContextMenuAction):
2675         (WebKit::WebContextMenuItemGlib::WebContextMenuItemGlib):
2676         (WebKit::WebContextMenuItemGlib::~WebContextMenuItemGlib):
2677         (WebKit::WebContextMenuItemGlib::buildActionName):
2678         (WebKit::WebContextMenuItemGlib::createActionIfNeeded):
2679         * Shared/glib/WebContextMenuItemGlib.h: Renamed from Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.h.
2680         * UIProcess/API/gtk/WebKitContextMenu.cpp:
2681         (webkitContextMenuPopulate):
2682         * UIProcess/API/gtk/WebKitContextMenuActions.cpp:
2683         (webkitContextMenuActionGetForContextMenuItem):
2684         * UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h:
2685         * UIProcess/API/gtk/WebKitContextMenuItem.cpp:
2686         (webkitContextMenuItemCreate):
2687         (webkitContextMenuItemToWebContextMenuItemGlib):
2688         (webkit_context_menu_item_new):
2689         (webkit_context_menu_item_new_from_gaction):
2690         (webkit_context_menu_item_new_from_stock_action):
2691         (webkit_context_menu_item_new_from_stock_action_with_label):
2692         (webkit_context_menu_item_new_with_submenu):
2693         (webkit_context_menu_item_new_separator):
2694         * UIProcess/API/gtk/WebKitContextMenuItemPrivate.h:
2695         * UIProcess/API/gtk/WebKitContextMenuPrivate.h:
2696         * UIProcess/API/gtk/WebKitWebView.cpp:
2697         (webkitWebViewPopulateContextMenu):
2698         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
2699         (WebKit::WebContextMenuProxyGtk::append):
2700         (WebKit::WebContextMenuProxyGtk::buildMenu):
2701         (WebKit::WebContextMenuProxyGtk::populate):
2702         * UIProcess/gtk/WebContextMenuProxyGtk.h:
2703
2704 2017-06-16  Dan Bernstein  <mitz@apple.com>
2705
2706         [Cocoa] Some declarations have missing or incorrect availability attributes
2707         https://bugs.webkit.org/show_bug.cgi?id=173508
2708
2709         Reviewed by Tim Horton.
2710
2711         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: Removed a redundant attribute.
2712
2713         In all of the below files, added missing availability attributes for declarations that have
2714         not appeared yet in any GM SDK, and fixed availability attributes for declarations that
2715         have already appeared in the macOS 10.12.3 and iOS 10.3 SDKs.
2716
2717         * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h:
2718         * UIProcess/API/Cocoa/WKHTTPCookieStore.h:
2719         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2720         * UIProcess/API/Cocoa/WKPreferences.h: Also fixed capitalization in a comment.
2721         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2722         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2723         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Also removed unnecessary conditionals.
2724         * UIProcess/API/Cocoa/WKWebView.mm:
2725         (-[WKWebView _draggableElementAtPosition:]): Prepended an underscore to this private method’s name.
2726         (-[WKWebView _requestDraggableElementAtPosition:completionBlock:]): Ditto.
2727         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2728         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Also updated for renames.
2729         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2730         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
2731         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
2732         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
2733         * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h:
2734         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2735         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
2736         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
2737         * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
2738         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
2739         * UIProcess/_WKWebViewPrintFormatter.h:
2740         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
2741         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
2742         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h:
2743
2744 2017-06-16  Youenn Fablet  <youenn@apple.com>
2745
2746         [WebRTC] CrashTracer: Regression : com.apple.WebKit.Networking at WebKit: WebKit::LibWebRTCSocketClient::sendTo
2747         https://bugs.webkit.org/show_bug.cgi?id=173501
2748
2749         Reviewed by Eric Carlson.
2750
2751         When a libwebrtc socket fails to be created in the network process,
2752         the network process sends back a close message, but it keeps it in a map.
2753         If the web process sends a message dedicated to this socket, we will try
2754         processing it and calling the socket which is null, hence the cache.
2755         This patch makes it so that if the socket is null, it is not added to the map.
2756
2757         * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
2758         (WebKit::LibWebRTCSocketClient::LibWebRTCSocketClient):
2759         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
2760         (WebKit::NetworkRTCProvider::createSocket):
2761         (WebKit::NetworkRTCProvider::createUDPSocket):
2762         (WebKit::NetworkRTCProvider::createServerTCPSocket):
2763         (WebKit::NetworkRTCProvider::createClientTCPSocket):
2764         * NetworkProcess/webrtc/NetworkRTCProvider.h:
2765
2766 2017-06-16  Antoine Quint  <graouts@apple.com>
2767
2768         Add a WebKit2 setting to control whether media documents should automatically enter fullscreen
2769         https://bugs.webkit.org/show_bug.cgi?id=173503
2770
2771         Reviewed by Tim Horton.
2772
2773         New WebKit2 setting to specify whether a media document should automatically enter fullscreen.
2774
2775         * Shared/WebPreferencesDefinitions.h:
2776         * UIProcess/API/Cocoa/WKPreferences.mm:
2777         (-[WKPreferences _setMediaDocumentEntersFullscreenAutomatically:]):
2778         (-[WKPreferences _mediaDocumentEntersFullscreenAutomatically]):
2779         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2780         * WebProcess/WebPage/WebPage.cpp:
2781         (WebKit::WebPage::updatePreferences):
2782
2783 2017-06-16  Sam Weinig  <sam@webkit.org>
2784
2785         [WebIDL] Remove custom bindings for HTMLDocument
2786         https://bugs.webkit.org/show_bug.cgi?id=173444
2787
2788         Reviewed by Darin Adler.
2789
2790         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
2791         (webkit_dom_html_document_get_link_color):
2792         (webkit_dom_html_document_set_link_color):
2793         Update for rename of linkColor to linkColorForBindings.
2794
2795 2017-06-16  Daniel Bates  <dabates@apple.com>
2796
2797         Cleanup: WebContextMenuClient::searchWithGoogle() should parse URL using URL { URL { }, ... }
2798         instead of URL { ParsedURLString, ... }
2799         https://bugs.webkit.org/show_bug.cgi?id=173495
2800         <rdar://problem/32827445>
2801
2802         Reviewed by Alex Christensen.
2803
2804         URL(ParsedURLString, ...) should only be used with a string that was the result of URL::string().
2805         Otherwise, it will cause an assertion failure if the canonicalized URL differs from the string.
2806         Although it is unlikely that the hardcoded string in WebContextMenuClient::searchWithGoogle()
2807         would differ from the canonicalized URL it is best practice to use URL(URL(), ...) to
2808         parse an arbitrary string that looks like a URL.
2809
2810         Also modernize the code using C++14 idioms.
2811
2812         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
2813         (WebKit::WebContextMenuClient::searchWithGoogle):
2814
2815 2017-06-16  Wenson Hsieh  <wenson_hsieh@apple.com>
2816
2817         [iOS DnD] Upstream iOS drag and drop implementation into OpenSource WebKit
2818         https://bugs.webkit.org/show_bug.cgi?id=173366
2819         <rdar://problem/32767014>
2820
2821         Reviewed by Tim Horton.
2822
2823         Move pieces of iOS WebKit2 drag and drop implementation into OpenSource. No change in behavior.
2824
2825         * Configurations/FeatureDefines.xcconfig:
2826         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2827         (WebKit::WebPageProxy::setDragImage):
2828         (WebKit::WebPageProxy::setPromisedDataForImage):
2829         (WebKit::WebPageProxy::setPromisedDataForAttachment):
2830         (WebKit::WebPageProxy::setDragCaretRect):
2831         * UIProcess/ios/WKContentViewInteraction.h:
2832         * UIProcess/ios/WKContentViewInteraction.mm:
2833         (longPressActionDelayAfterLift):
2834         (-[WKContentView webViewUIDelegate]):
2835         (-[WKContentView setupDataInteractionDelegates]):
2836         (-[WKContentView teardownDataInteractionDelegates]):
2837         (-[WKContentView _startDataInteractionWithImage:withIndicatorData:atClientPosition:anchorPoint:action:]):
2838         (-[WKContentView _didHandleStartDataInteractionRequest:]):
2839         (uiImageForImage):
2840         (shouldUseTextIndicatorToCreatePreviewForDragAction):
2841         (-[WKContentView dragPreviewForImage:frameInRootViewCoordinates:clippingRectsInFrameCoordinates:backgroundColor:]):
2842         (-[WKContentView dragPreviewForCurrentDataInteractionState]):
2843         (-[WKContentView performDeferredActionAtDragOrigin]):
2844         (-[WKContentView cancelDeferredActionAtDragOrigin]):
2845         (-[WKContentView computeClientAndGlobalPointsForDropSession:outClientPoint:outGlobalPoint:]):
2846         (dropOperationForWebCoreDragOperation):
2847         (-[WKContentView dragDataForDropSession:dragDestinationAction:]):
2848         (-[WKContentView cleanUpDragSourceSessionState]):
2849         (extractItemProvidersFromDragItems):
2850         (extractItemProvidersFromDropSession):
2851         (-[WKContentView _didConcludeEditDataInteraction:]):
2852         (-[WKContentView _didPerformDataInteractionControllerOperation:]):
2853         (-[WKContentView _transitionDragPreviewToImageIfNecessary:]):
2854         (-[WKContentView _didChangeDataInteractionCaretRect:currentRect:]):
2855         (-[WKContentView _dragDestinationActionForDropSession:]):
2856         (positionInformationMayStartDataInteraction):
2857         (-[WKContentView currentDragOrDropSession]):
2858         (-[WKContentView _dragInteraction:prepareForSession:completion:]):
2859         (-[WKContentView dragInteraction:itemsForBeginningSession:]):
2860         (-[WKContentView _api_dragInteraction:previewForLiftingItem:session:]):
2861         (-[WKContentView dragInteraction:sessionWillBegin:]):
2862         (-[WKContentView _api_dragInteraction:session:didEndWithOperation:]):
2863         (-[WKContentView dragInteraction:previewForCancellingItem:withDefault:]):
2864         (-[WKContentView _api_dragInteraction:item:willAnimateCancelWithAnimator:]):
2865         (-[WKContentView dropInteraction:canHandleSession:]):
2866         (-[WKContentView _api_dropInteraction:sessionDidEnter:]):
2867         (-[WKContentView _api_dropInteraction:sessionDidUpdate:]):
2868         (-[WKContentView dropInteraction:sessionDidExit:]):
2869         (-[WKContentView dropInteraction:performDrop:]):
2870         (-[WKContentView dropInteraction:previewForDroppingItem:withDefault:]):
2871         (-[WKContentView dropInteraction:sessionDidEnd:]):
2872         (-[WKContentView _simulateDataInteractionEntered:]):
2873         (-[WKContentView _simulateDataInteractionUpdated:]):
2874         (-[WKContentView _simulateDataInteractionEnded:]):
2875         (-[WKContentView _simulateDataInteractionPerformOperation:]):
2876         (-[WKContentView _simulateDataInteractionSessionDidEnd:]):
2877         (-[WKContentView _simulateWillBeginDataInteractionWithSession:]):
2878         (-[WKContentView _simulatedItemsForSession:]):
2879         (-[WKContentView _simulatePrepareForDataInteractionSession:completion:]):
2880         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2881         (WebKit::convertCGImageToBitmap):
2882         (WebKit::WebDragClient::startDrag):
2883         (WebKit::WebDragClient::declareAndWriteDragImage):
2884         (WebKit::WebDragClient::didConcludeEditDrag):
2885         (WebKit::WebDragClient::declareAndWriteAttachment):
2886
2887 2017-06-16  Youenn Fablet  <youenn@apple.com>
2888
2889         WebRTC sockets should be closed at destruction time if not closed explicitly
2890         https://bugs.webkit.org/show_bug.cgi?id=173479
2891
2892         Reviewed by Eric Carlson.
2893
2894         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
2895         (WebKit::LibWebRTCSocket::~LibWebRTCSocket):
2896         (WebKit::LibWebRTCSocket::Close):
2897
2898 2017-06-16  Chris Dumez  <cdumez@apple.com>
2899
2900         [WK2] Add WKProcessPool SPI to efficiently reset all plugin load client policies
2901         https://bugs.webkit.org/show_bug.cgi?id=173472
2902         <rdar://problem/28858817>
2903
2904         Reviewed by Brady Eidson.
2905
2906         Add WKProcessPool SPI to efficiently reset all plugin load client policies:
2907         [WKProcessPool _resetPluginLoadClientPolicies]. This new SPI clears all
2908         existing policies and then sets all of them with new values, with a
2909         minimal amount of IPC.
2910
2911         To achieve this, clients would previously have to call
2912         1. WKContextClearPluginClientPolicies() which would cause a broadcast IPC to
2913            every WebContent process.
2914         2. WKContextSetPluginLoadClientPolicy() repeatedly to add each policy one by
2915            one. Each call to WKContextSetPluginLoadClientPolicy() would cause a broadcast
2916            IPC to every WebContent process.
2917
2918         The new SPI does the same job with a single broadcast IPC to every WebContent
2919         process.
2920
2921         * UIProcess/API/Cocoa/WKProcessPool.mm:
2922         (isPluginLoadClientPolicyAcceptable):
2923         (toPluginLoadClientPoliciesHashMap):
2924         (policiesHashMapToDictionary):
2925         (-[WKProcessPool _resetPluginLoadClientPolicies:]):
2926         (-[WKProcessPool _pluginLoadClientPolicies]):
2927         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2928         * UIProcess/WebProcessPool.cpp:
2929         (WebKit::WebProcessPool::setPluginLoadClientPolicy):
2930         (WebKit::WebProcessPool::resetPluginLoadClientPolicies):
2931         * UIProcess/WebProcessPool.h:
2932         * WebProcess/WebProcess.cpp:
2933         (WebKit::WebProcess::initializeWebProcess):
2934         (WebKit::WebProcess::resetPluginLoadClientPolicies):
2935         * WebProcess/WebProcess.h:
2936         * WebProcess/WebProcess.messages.in:
2937
2938 2017-06-16  Brent Fulgham  <bfulgham@apple.com>
2939
2940         [WK2][macOS] Expand sandbox to better support video playback on mac mini
2941         https://bugs.webkit.org/show_bug.cgi?id=173492
2942         <rdar://problem/32804073>
2943
2944         Reviewed by Alex Christensen.
2945
2946         Hardware differences in Mac Mini's require some different IOKit preferences to be accessible.
2947
2948         * WebProcess/com.apple.WebProcess.sb.in:
2949
2950 2017-06-16  Brent Fulgham  <bfulgham@apple.com>
2951
2952         [WK2][iOS][macOS] Extend the sandbox to allow reading of AVFoundation's VideoPerformanceHUD preference
2953         https://bugs.webkit.org/show_bug.cgi?id=173476
2954         <rdar://problem/31594568>
2955
2956         Reviewed by Alex Christensen.
2957
2958         Update the sandbox to permit WebContent process to read the AVFoundation preferences for the performance HUD.
2959
2960         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2961         * WebProcess/com.apple.WebProcess.sb.in:
2962
2963 2017-06-16  Daniel Bates  <dabates@apple.com>
2964
2965         Use the term icon instead of favicon
2966         https://bugs.webkit.org/show_bug.cgi?id=173400
2967
2968         Reviewed by Alex Christensen.
2969
2970         * WebProcess/Network/WebLoaderStrategy.cpp:
2971         (WebKit::maximumBufferingTime):
2972
2973 2017-06-16  Carlos Garcia Campos  <cgarcia@igalia.com>
2974
2975         [GTK][WPE] Remove WKCookieManagerSoup
2976         https://bugs.webkit.org/show_bug.cgi?id=173467
2977
2978         Reviewed by Michael Catanzaro.
2979
2980         It's unused.
2981
2982         * PlatformGTK.cmake:
2983         * PlatformWPE.cmake:
2984         * UIProcess/API/C/soup/WKCookieManagerSoup.cpp: Removed.
2985         * UIProcess/API/C/soup/WKCookieManagerSoup.h: Removed.
2986
2987 2017-06-16  Carlos Garcia Campos  <cgarcia@igalia.com>
2988
2989         Unreviewed. Remove wrong headers check from some GTK+ API files.
2990
2991         Remove the __WEBKIT_WEB_EXTENSION_H_INSIDE__ check since these are not actually shared.
2992
2993         * UIProcess/API/gtk/WebKitEditorState.h:
2994         * UIProcess/API/gtk/WebKitOptionMenu.h:
2995         * UIProcess/API/gtk/WebKitPrintCustomWidget.h:
2996
2997 2017-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
2998
2999         REGRESSION(r218325): [GTK] Runtime critical warnings running layout tests that show a popup menu
3000         https://bugs.webkit.org/show_bug.cgi?id=173421
3001
3002         Reviewed by Carlos Alberto Lopez Perez.
3003
3004         In r218325 I forgot to create a WebKitPopupMenu or WebPopupMenuProxyGtk depending on whether the view is a
3005         WebKitWebView or not.
3006
3007         * UIProcess/API/gtk/PageClientImpl.cpp:
3008         (WebKit::PageClientImpl::createPopupMenuProxy):
3009
3010 2017-06-15  Tim Horton  <timothy_horton@apple.com>
3011
3012         Null deref under ViewGestureController::endSwipeGesture (navigationGestureDidEnd)
3013         https://bugs.webkit.org/show_bug.cgi?id=173441
3014         <rdar://problem/25876512>
3015
3016         Reviewed by Simon Fraser.
3017
3018         This is a speculative fix for a crash that we don't have repro steps for.
3019
3020         In a few places, ViewGestureController looks itself up by pageID (in cases
3021         where we're in an asynchronous callback), and then calls some
3022         function on it (endSwipeGesture, or something that will get there).
3023         However, if in the meantime an API client has turned the swipe gesture
3024         on and off, the page's ViewGestureController will be a different one
3025         than the one that originally started this process, with fresh state,
3026         and nullptrs in all sorts of places, ripe for dereferencing.
3027
3028         To fix this, instead of just looking ViewGestureController up by 
3029         pageID, also keep track of the current gestureID, process-wide (previously
3030         the gestureID was per-ViewGestureController), and only return the
3031         ViewGestureController if it's currently processing the same gesture
3032         that started the asynchronous task.
3033
3034         * UIProcess/Cocoa/ViewGestureController.cpp:
3035         (WebKit::ViewGestureController::controllerForGesture):
3036         (WebKit::ViewGestureController::takeNextGestureID):
3037         (WebKit::ViewGestureController::willBeginGesture):
3038         (WebKit::ViewGestureController::didEndGesture):
3039         (WebKit::ViewGestureController::gestureControllerForPage): Deleted.
3040         * UIProcess/Cocoa/ViewGestureController.h:
3041         Add helpers that set and reset activeGestureType and currentGestureID together.
3042         Make gesture IDs process global, to avoid two ViewGestureControllers using the same IDs.
3043
3044         * UIProcess/ios/ViewGestureControllerIOS.mm:
3045         (WebKit::ViewGestureController::beginSwipeGesture):
3046         (WebKit::ViewGestureController::endSwipeGesture):
3047         (WebKit::ViewGestureController::removeSwipeSnapshot):
3048         * UIProcess/mac/ViewGestureControllerMac.mm:
3049         (WebKit::ViewGestureController::didCollectGeometryForMagnificationGesture):
3050         (WebKit::ViewGestureController::handleMagnificationGestureEvent):
3051         (WebKit::ViewGestureController::endMagnificationGesture):
3052         (WebKit::ViewGestureController::beginSwipeGesture):
3053         (WebKit::ViewGestureController::forceRepaintIfNeeded):
3054         (WebKit::ViewGestureController::removeSwipeSnapshot):
3055         Adopt willBeginGesture/didEndGesture and controllerForGesture.
3056
3057 2017-06-15  Simon Fraser  <simon.fraser@apple.com>
3058
3059         [iOS WK2] YouTube videos flash at the wrong place at the end of rotation
3060         https://bugs.webkit.org/show_bug.cgi?id=173445
3061         rdar://problem/31584852
3062
3063         Reviewed by Tim Horton.
3064
3065         In MobileSafari where WKWebView rotation uses _dynamicViewportUpdateModes, we could do a
3066         visibleContentRect update at the end of rotation which computed a bad layoutViewportRect,
3067         because it used a m_baseLayoutViewportSize from the old orientation.
3068
3069         We have actually sent a new m_baseLayoutViewportSize to the UI process by this point in 
3070         a layer tree commit, but _didCommitLayerTree: ignored it because we had a _dynamicViewportUpdateMode.
3071
3072         Fix is to always update the layout viewport data from the web process, since during dynamic
3073         viewport updates, we still need these data to compute rectangles sent back to the web process via
3074         visible content rect updates.
3075
3076         * UIProcess/API/Cocoa/WKWebView.mm:
3077         (-[WKWebView _didCommitLayerTree:]):
3078         * UIProcess/ios/WebPageProxyIOS.mm:
3079         (WebKit::WebPageProxy::computeCustomFixedPositionRect):
3080         (WebKit::WebPageProxy::updateLayoutViewportParameters): Cleanup.
3081
3082 2017-06-15  Wenson Hsieh  <wenson_hsieh@apple.com>
3083
3084         Using -[WebItemProviderPasteboard setItemProviders:] to swap out item providers before a drop breaks item provider loading
3085         https://bugs.webkit.org/show_bug.cgi?id=173338
3086         <rdar://problem/32777720>
3087
3088         Reviewed by Tim Horton.
3089
3090         Rename updatePreferredTypeIdentifiers to updateSupportedTypeIdentifiers. Also, introduce
3091         _webView:willPerformDropWithSession: as SPI on WKUIDelegate.
3092
3093         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3094         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
3095         (WebKit::WebPasteboardProxy::updateSupportedTypeIdentifiers):
3096         (WebKit::WebPasteboardProxy::updatePreferredTypeIdentifiers): Deleted.
3097         * UIProcess/WebPasteboardProxy.h:
3098         * UIProcess/WebPasteboardProxy.messages.in:
3099         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3100         (WebKit::WebPlatformStrategies::updateSupportedTypeIdentifiers):
3101         (WebKit::WebPlatformStrategies::updatePreferredTypeIdentifiers): Deleted.
3102         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3103
3104 2017-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
3105
3106         [GTK] Cleanup headers includes in GTK+ API files
3107         https://bugs.webkit.org/show_bug.cgi?id=173415
3108
3109         Reviewed by Michael Catanzaro.
3110
3111         - Remove WTFGType.h from WebKitPrivate.h and include it in all other files instead of WebKitPrivate if needed.
3112         - Stop including WebKitPrivate.h in all other private headers.
3113         - Remove all C API includes.
3114
3115         * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp:
3116         * UIProcess/API/gtk/WebKitAuthenticationRequest.cpp:
3117         * UIProcess/API/gtk/WebKitAuthenticationRequestPrivate.h:
3118         * UIProcess/API/gtk/WebKitAutomationSession.cpp:
3119         * UIProcess/API/gtk/WebKitBackForwardList.cpp:
3120         * UIProcess/API/gtk/WebKitBackForwardListItem.cpp:
3121         * UIProcess/API/gtk/WebKitColorChooser.h:
3122         * UIProcess/API/gtk/WebKitColorChooserRequest.cpp:
3123         * UIProcess/API/gtk/WebKitContextMenu.cpp:
3124         * UIProcess/API/gtk/WebKitContextMenuItem.cpp:
3125         * UIProcess/API/gtk/WebKitContextMenuItemPrivate.h:
3126         * UIProcess/API/gtk/WebKitContextMenuPrivate.h:
3127         * UIProcess/API/gtk/WebKitCookieManager.cpp:
3128         * UIProcess/API/gtk/WebKitCookieManagerPrivate.h:
3129         * UIProcess/API/gtk/WebKitCredentialPrivate.h:
3130         * UIProcess/API/gtk/WebKitDownload.cpp:
3131         * UIProcess/API/gtk/WebKitDownloadClient.cpp:
3132         * UIProcess/API/gtk/WebKitDownloadPrivate.h:
3133         * UIProcess/API/gtk/WebKitEditorState.cpp:
3134         * UIProcess/API/gtk/WebKitEditorStatePrivate.h:
3135         * UIProcess/API/gtk/WebKitError.cpp:
3136         * UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
3137         * UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
3138         * UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h:
3139         * UIProcess/API/gtk/WebKitFindController.cpp:
3140         * UIProcess/API/gtk/WebKitFormClient.cpp:
3141         * UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp:
3142         * UIProcess/API/gtk/WebKitFormSubmissionRequestPrivate.h:
3143         * UIProcess/API/gtk/WebKitGeolocationPermissionRequest.cpp:
3144         * UIProcess/API/gtk/WebKitGeolocationPermissionRequestPrivate.h:
3145         * UIProcess/API/gtk/WebKitHitTestResult.cpp:
3146         * UIProcess/API/gtk/WebKitHitTestResultPrivate.h:
3147         * UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.cpp:
3148         * UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequestPrivate.h:
3149         * UIProcess/API/gtk/WebKitJavascriptResult.cpp:
3150         * UIProcess/API/gtk/WebKitJavascriptResultPrivate.h:
3151         * UIProcess/API/gtk/WebKitMimeInfoPrivate.h:
3152         * UIProcess/API/gtk/WebKitNavigationActionPrivate.h:
3153         * UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp:
3154         * UIProcess/API/gtk/WebKitNavigationPolicyDecisionPrivate.h:
3155         * UIProcess/API/gtk/WebKitNetworkProxySettings.cpp:
3156         * UIProcess/API/gtk/WebKitNetworkProxySettingsPrivate.h:
3157         * UIProcess/API/gtk/WebKitNotification.cpp:
3158         * UIProcess/API/gtk/WebKitNotificationPermissionRequest.cpp:
3159         * UIProcess/API/gtk/WebKitNotificationPermissionRequestPrivate.h:
3160         * UIProcess/API/gtk/WebKitNotificationPrivate.h:
3161         * UIProcess/API/gtk/WebKitOptionMenu.cpp:
3162         * UIProcess/API/gtk/WebKitPlugin.cpp:
3163         * UIProcess/API/gtk/WebKitPluginPrivate.h:
3164         * UIProcess/API/gtk/WebKitPolicyDecision.cpp:
3165         * UIProcess/API/gtk/WebKitPolicyDecisionPrivate.h:
3166         * UIProcess/API/gtk/WebKitPrintCustomWidget.cpp:
3167         * UIProcess/API/gtk/WebKitPrintCustomWidgetPrivate.h:
3168         * UIProcess/API/gtk/WebKitPrintOperation.cpp:
3169         * UIProcess/API/gtk/WebKitPrivate.h:
3170         * UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp:
3171         * UIProcess/API/gtk/WebKitResponsePolicyDecisionPrivate.h:
3172         * UIProcess/API/gtk/WebKitSecurityManager.cpp:
3173         * UIProcess/API/gtk/WebKitSecurityOrigin.cpp:
3174         * UIProcess/API/gtk/WebKitSecurityOriginPrivate.h:
3175         * UIProcess/API/gtk/WebKitSettings.cpp:
3176         * UIProcess/API/gtk/WebKitUIClient.cpp:
3177         * UIProcess/API/gtk/WebKitURIRequest.cpp:
3178         * UIProcess/API/gtk/WebKitURIResponse.cpp:
3179         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
3180         * UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h:
3181         * UIProcess/API/gtk/WebKitUserContent.cpp:
3182         * UIProcess/API/gtk/WebKitUserContentManager.cpp:
3183         * UIProcess/API/gtk/WebKitUserMediaPermissionRequest.cpp:
3184         * UIProcess/API/gtk/WebKitUserMediaPermissionRequestPrivate.h:
3185         * UIProcess/API/gtk/WebKitWebContext.cpp:
3186         * UIProcess/API/gtk/WebKitWebContextPrivate.h:
3187         * UIProcess/API/gtk/WebKitWebInspector.cpp:
3188         * UIProcess/API/gtk/WebKitWebInspectorPrivate.h:
3189         * UIProcess/API/gtk/WebKitWebResource.cpp:
3190         * UIProcess/API/gtk/WebKitWebResourcePrivate.h:
3191         * UIProcess/API/gtk/WebKitWebView.cpp:
3192         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3193         * UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp:
3194         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
3195         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
3196         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
3197         * UIProcess/API/gtk/WebKitWebsiteDataManagerPrivate.h:
3198         * UIProcess/API/gtk/WebKitWebsiteDataPrivate.h:
3199         * UIProcess/API/gtk/WebKitWindowProperties.cpp:
3200         * UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h:
3201         * WebProcess/InjectedBundle/API/gtk/WebKitFrame.cpp:
3202         * WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp:
3203         * WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp:
3204         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
3205         * WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.cpp:
3206         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
3207
3208 2017-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
3209
3210         [GTK] Do not use the C API in WebGtkExtensionManager
3211         https://bugs.webkit.org/show_bug.cgi?id=173408
3212
3213         Reviewed by Michael Catanzaro.
3214
3215         Use the C++ API instead.
3216
3217         * WebProcess/gtk/WebGtkExtensionManager.cpp:
3218         (WebKit::parseUserData):
3219         (WebKit::WebGtkExtensionManager::initialize):
3220         * WebProcess/gtk/WebGtkExtensionManager.h:
3221         * WebProcess/gtk/WebGtkInjectedBundleMain.cpp:
3222         (WKBundleInitialize):
3223
3224 2017-06-15  Adrian Perez de Castro  <aperez@igalia.com>
3225
3226         [GTK] Stop using GtkAction in WebPopupMenuProxyGtk
3227         https://bugs.webkit.org/show_bug.cgi?id=173417
3228
3229         Reviewed by Carlos Garcia Campos.
3230
3231         This gets rid of GtkAction in WebPopupMenuProxyGtk, which was deprecated in GTK+ 3.10
3232         and will not be available in GTK+ 4.0. Using GtkMenuItem directly makes populating
3233         long menus slightly faster, which can be noticeable in lower-end machines.
3234
3235         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
3236         (WebKit::WebPopupMenuProxyGtk::populatePopupMenu):
3237         (WebKit::WebPopupMenuProxyGtk::menuItemActivated):
3238         (WebKit::WebPopupMenuProxyGtk::createGtkActionForMenuItem): Deleted.
3239         * UIProcess/gtk/WebPopupMenuProxyGtk.h:
3240         (WebKit::WebPopupMenuProxyGtk::setCurrentlySelectedMenuItem):
3241         Instantiate GtkMenuItem objects directly when populating the menu.
3242
3243 2017-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
3244
3245         Unreviewed. Fix copy-paste error in GTK+ WEBKIT_JAVASCRIPT_ERROR definition.
3246
3247         The print one was copied there.
3248
3249         * UIProcess/API/gtk/WebKitError.h:
3250
3251 2017-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
3252
3253         [GTK] Add API to allow overriding popup menus
3254         https://bugs.webkit.org/show_bug.cgi?id=172905
3255
3256         Reviewed by Michael Catanzaro.
3257
3258         The GTK+ API uses GTK+ for the default implementation of several UI elements like the file chooser, print dialog,
3259         color picker, context menu, etc. but in all those cases it allows to override the default implementation. It's
3260         not possible to override the popup menu used for select elements. This patch adds WebKitOptionMenu to represent
3261         a select dropdown menu. It's passed as an argument of the new signal WebKitWebView::show-option-menu, and
3262         contains WebKitOptionMenuItem elements representing the items to be displayed.
3263
3264         * PlatformGTK.cmake:
3265         * UIProcess/API/gtk/PageClientImpl.cpp:
3266         (WebKit::PageClientImpl::createPopupMenuProxy): Create a WebKitPopupMenu.
3267         * UIProcess/API/gtk/WebKitOptionMenu.cpp: Added.
3268         (webkitOptionMenuCreate):
3269         (webkit_option_menu_get_n_items):
3270         (webkit_option_menu_get_item):
3271         (webkit_option_menu_select_item):
3272         (webkit_option_menu_activate_item):
3273         (webkit_option_menu_close):
3274         * UIProcess/API/gtk/WebKitOptionMenu.h: Added.
3275         * UIProcess/API/gtk/WebKitOptionMenuItem.cpp: Added.
3276         (webkit_option_menu_item_copy):
3277         (webkit_option_menu_item_free):
3278         (webkit_option_menu_item_get_label):
3279         (webkit_option_menu_item_get_tooltip):
3280         (webkit_option_menu_item_is_group_label):
3281         (webkit_option_menu_item_is_group_child):
3282         (webkit_option_menu_item_is_enabled):
3283         (webkit_option_menu_item_is_selected):
3284         * UIProcess/API/gtk/WebKitOptionMenuItem.h: Added.
3285         * UIProcess/API/gtk/WebKitOptionMenuItemPrivate.h: Added.
3286         (_WebKitOptionMenuItem::_WebKitOptionMenuItem):
3287         * UIProcess/API/gtk/WebKitOptionMenuPrivate.h: Added.
3288         * UIProcess/API/gtk/WebKitPopupMenu.cpp: Added.
3289         (WebKit::WebKitPopupMenu::WebKitPopupMenu):
3290         (WebKit::menuCloseCallback):
3291         (WebKit::WebKitPopupMenu::showPopupMenu): Call webkitWebViewShowOptionMenu() falling back to default
3292         implementation if the user didn't handle the signal.
3293         (WebKit::WebKitPopupMenu::hidePopupMenu):
3294         (WebKit::WebKitPopupMenu::cancelTracking):
3295         (WebKit::WebKitPopupMenu::selectItem):
3296         (WebKit::WebKitPopupMenu::activateItem):
3297         * UIProcess/API/gtk/WebKitPopupMenu.h: Added.
3298         * UIProcess/API/gtk/WebKitWebView.cpp:
3299         (webkit_web_view_class_init):
3300         (webkitWebViewShowOptionMenu): Emit WebKitWebView::show-option-menu.
3301         * UIProcess/API/gtk/WebKitWebView.h:
3302         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
3303         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
3304         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types: Add new get_type functions.
3305         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new sections.
3306         * UIProcess/API/gtk/webkit2.h: Add new public headers.
3307         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
3308         (WebKit::WebPopupMenuProxyGtk::WebPopupMenuProxyGtk): Do not create the GtkMenu in constructor.
3309         (WebKit::WebPopupMenuProxyGtk::showPopupMenu): Create the GtkMenu and connect to the signals here.
3310         (WebKit::WebPopupMenuProxyGtk::hidePopupMenu): Return early if the Gtk hasn't been shown.
3311         * UIProcess/gtk/WebPopupMenuProxyGtk.h: Make constructor and webview protected.
3312
3313 2017-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3314
3315         [GTK] Use API::InjectedBundle::ResourceLoadClient in WebKitWebPage
3316         https://bugs.webkit.org/show_bug.cgi?id=173364
3317
3318         Reviewed by Michael Catanzaro.
3319
3320         Instead of the C API.
3321
3322         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
3323         (webkitWebPageCreate):
3324         (didInitiateLoadForResource): Deleted.
3325         (willSendRequestForFrame): Deleted.
3326         (didReceiveResponseForResource): Deleted.
3327         (didReceiveContentLengthForResource): Deleted.
3328         (didFinishLoadForResource): Deleted.
3329         (didFailLoadForResource): Deleted.
3330
3331 2017-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3332
3333         [GTK] Use API::InjectedBundle::Client in WebKitWebExtension
3334         https://bugs.webkit.org/show_bug.cgi?id=173358
3335
3336         Reviewed by Michael Catanzaro.
3337
3338         Instead of the C API.
3339
3340         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
3341         (webkitWebExtensionCreate):
3342         (webkitWebExtensionPageCreated): Deleted.
3343         (webkitWebExtensionPageDestroy): Deleted.
3344         (webkitWebExtensionDidReceiveMessage): Deleted.
3345         (didCreatePage): Deleted.
3346         (willDestroyPage): Deleted.
3347         (didReceiveMessage): Deleted.
3348         (didReceiveMessageToPage): Deleted.
3349
3350 2017-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
3351
3352         [GTK] Use API::NotificationProvider
3353         https://bugs.webkit.org/show_bug.cgi?id=173312
3354
3355         Reviewed by Žan Doberšek.
3356
3357         Also cleanup a bit the WebKitNotificationProvider implementation, it doesn't need to be refcounted.
3358
3359         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
3360         (WebKitNotificationProvider::WebKitNotificationProvider):
3361         (WebKitNotificationProvider::~WebKitNotificationProvider):
3362         (WebKitNotificationProvider::show):
3363         (WebKitNotificationProvider::clearNotifications):
3364         (WebKitNotificationProvider::notificationPermissions):
3365         (WebKitNotificationProvider::setNotificationPermissions):
3366         * UIProcess/API/gtk/WebKitNotificationProvider.h:
3367         * UIProcess/API/gtk/WebKitWebContext.cpp:
3368         (webkitWebContextConstructed):
3369         (addOriginToMap):
3370         (webkit_web_context_initialize_notification_permissions):
3371
3372 2017-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3373
3374         Add API::InjectedBundle::ResourceLoadClient
3375         https://bugs.webkit.org/show_bug.cgi?id=173362
3376
3377         Reviewed by Alex Christensen.
3378
3379         It will be used by the GTK+ port instead of the C API.
3380
3381         * WebKit2.xcodeproj/project.pbxproj:
3382         * WebProcess/InjectedBundle/API/APIInjectedBundlePageResourceLoadClient.h: Copied from Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h.
3383         (API::InjectedBundle::ResourceLoadClient::didInitiateLoadForResource):
3384         (API::InjectedBundle::ResourceLoadClient::willSendRequestForFrame):
3385         (API::InjectedBundle::ResourceLoadClient::didReceiveResponseForResource):
3386         (API::InjectedBundle::ResourceLoadClient::didReceiveContentLengthForResource):
3387         (API::InjectedBundle::ResourceLoadClient::didFinishLoadForResource):
3388         (API::InjectedBundle::ResourceLoadClient::didFailLoadForResource):
3389         (API::InjectedBundle::ResourceLoadClient::shouldCacheResponse):
3390         (API::InjectedBundle::ResourceLoadClient::shouldUseCredentialStorage):
3391         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3392         (WKBundlePageSetResourceLoadClient):
3393         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3394         (setUpResourceLoadClient):
3395         (-[WKWebProcessPlugInBrowserContextController setLoadDelegate:]):
3396         * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp:
3397         (WebKit::InjectedBundlePageResourceLoadClient::InjectedBundlePageResourceLoadClient):
3398         (WebKit::InjectedBundlePageResourceLoadClient::didInitiateLoadForResource):
3399         (WebKit::InjectedBundlePageResourceLoadClient::willSendRequestForFrame):
3400         (WebKit::InjectedBundlePageResourceLoadClient::didReceiveResponseForResource):
3401         (WebKit::InjectedBundlePageResourceLoadClient::didReceiveContentLengthForResource):
3402         (WebKit::InjectedBundlePageResourceLoadClient::didFinishLoadForResource):
3403         (WebKit::InjectedBundlePageResourceLoadClient::didFailLoadForResource):
3404         (WebKit::InjectedBundlePageResourceLoadClient::shouldCacheResponse):
3405         (WebKit::InjectedBundlePageResourceLoadClient::shouldUseCredentialStorage):
3406         * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h:
3407         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3408         (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest):
3409         (WebKit::WebFrameLoaderClient::dispatchWillSendRequest):
3410         (WebKit::WebFrameLoaderClient::shouldUseCredentialStorage):
3411         (WebKit::WebFrameLoaderClient::dispatchDidReceiveResponse):
3412         (WebKit::WebFrameLoaderClient::dispatchDidReceiveContentLength):
3413         (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading):
3414         (WebKit::WebFrameLoaderClient::dispatchDidFailLoading):
3415         (WebKit::WebFrameLoaderClient::willCacheResponse):
3416         * WebProcess/WebPage/WebPage.cpp:
3417         (WebKit::WebPage::setInjectedBundleResourceLoadClient):
3418         (WebKit::WebPage::close):
3419         * WebProcess/WebPage/WebPage.h:
3420         (WebKit::WebPage::injectedBundleResourceLoadClient):
3421
3422 2017-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3423
3424         Add API::InjectedBundle::Client
3425         https://bugs.webkit.org/show_bug.cgi?id=173357
3426
3427         Reviewed by Alex Christensen.
3428
3429         It will be used by the GTK+ port instead of the C API.
3430
3431         * WebKit2.xcodeproj/project.pbxproj: