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