[MediaStream] 'devicechange' event should not fire in frames that can't access captur...
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-12-07  Eric Carlson  <eric.carlson@apple.com>
2
3         [MediaStream] 'devicechange' event should not fire in frames that can't access capture devices
4         https://bugs.webkit.org/show_bug.cgi?id=192511
5         <rdar://problem/46562063>
6
7         Reviewed by Youenn Fablet.
8
9         * UIProcess/UserMediaPermissionCheckProxy.cpp:
10         (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy): Remove userMediaID parameter.
11         (WebKit::UserMediaPermissionCheckProxy::setUserMediaAccessInfo): ID not passed to callback.
12         * UIProcess/UserMediaPermissionCheckProxy.h:
13         (WebKit::UserMediaPermissionCheckProxy::create):
14         (WebKit::UserMediaPermissionCheckProxy::completionHandler): Deleted.
15
16         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
17         (WebKit::generateRequestID): New.
18         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged): Don't notify if
19         the page does not have a granted request and does not have persistent access.
20         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Use generateRequestID.
21         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Change variable name.
22         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Use generateRequestID.
23         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
24
25 2018-12-07  Saam Barati  <sbarati@apple.com>
26
27         WKWebProcessPlugInLoadDelegate should have API for saying which rendering events it wants to listen for
28         https://bugs.webkit.org/show_bug.cgi?id=192473
29
30         Reviewed by Andy Estes.
31
32         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
33         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
34         (PageLoaderClient::layoutMilestones const):
35
36 2018-12-07  Youenn Fablet  <youenn@apple.com>
37
38         Update libwebrtc up to 0d007d7c4f
39         https://bugs.webkit.org/show_bug.cgi?id=192316
40
41         Reviewed by Eric Carlson.
42
43         Update code base according new libwebrtc backend
44         In particular, use directly int64_t for packet time.
45
46         * Configurations/WebKit.xcconfig:
47         * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
48         (WebKit::LibWebRTCSocketClient::signalReadPacket):
49         * NetworkProcess/webrtc/LibWebRTCSocketClient.h:
50         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
51         * NetworkProcess/webrtc/NetworkRTCSocket.h:
52         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
53         (WebKit::LibWebRTCSocket::signalReadPacket):
54
55 2018-12-07  Truitt Savell  <tsavell@apple.com>
56
57         Unreviewed, rolling out r238947.
58
59         Revision caused fast/visual-viewport/tiled-drawing/zoomed-
60         fixed-scrolling-layers-state.html to constantly fail
61
62         Reverted changeset:
63
64         "Allow control over child order when adding nodes to the
65         scrolling tree"
66         https://bugs.webkit.org/show_bug.cgi?id=176914
67         https://trac.webkit.org/changeset/238947
68
69 2018-12-06  David Kilzer  <ddkilzer@apple.com>
70
71         Injected bundle for WebKitTestRunner leaks WKTypeRef objects
72         <https://webkit.org/b/192481>
73         <rdar://problem/46539059>
74
75         Reviewed by Simon Fraser.
76
77         Change function parameter name from `returnData[Ref]` to
78         `returnRetainedData[Ref]` to document that the value returned is
79         a +1 retained WKTypeRef object.
80
81         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
82         (WKBundlePostSynchronousMessage):
83         * WebProcess/InjectedBundle/API/c/WKBundle.h:
84         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
85         (WKBundlePagePostSynchronousMessageForTesting):
86         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
87
88 2018-12-06  Frederic Wang  <fwang@igalia.com>
89
90         Allow control over child order when adding nodes to the scrolling tree
91         https://bugs.webkit.org/show_bug.cgi?id=176914
92
93         Reviewed by Simon Fraser.
94
95         Based on an earlier patch by Simon Fraser.
96
97         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
98         (WebKit::RemoteScrollingCoordinatorTransaction::decode): Make explicit that we want to append
99         the new node at the end of child list.
100
101 2018-12-06  Yongjun Zhang  <yongjun_zhang@apple.com>
102
103         We should ignore minimumEffectiveDeviceWidth if the page specifies device-width in viewport meta-tag.
104         https://bugs.webkit.org/show_bug.cgi?id=192377
105         <rdar://problem/46364206>
106
107         Reviewed by Tim Horton.
108
109         Since we are using page's viewport arguments to decide the default viewport parameters and
110         whether we can use mininum effective device width, we should always call setViewportArguments()
111         regardless of shouldIgnoreMetaViewport settings.
112
113         * WebProcess/WebPage/WebPage.cpp:
114         (WebKit::WebPage::viewportPropertiesDidChange): Always call setViewportArguments().
115         (WebKit::WebPage::didCommitLoad): Ditto.
116
117 2018-12-06  Tim Horton  <timothy_horton@apple.com>
118
119         Web Share API: share overlay does not stick to the Safari window
120         https://bugs.webkit.org/show_bug.cgi?id=192469
121         <rdar://problem/46074833>
122
123         Reviewed by Wenson Hsieh.
124
125         * UIProcess/Cocoa/WKShareSheet.mm:
126         (-[WKShareSheet sharingServicePicker:didChooseSharingService:]):
127         (-[WKShareSheet sharingServicePicker:delegateForSharingService:]):
128         (-[WKShareSheet sharingService:sourceWindowForShareItems:sharingContentScope:]):
129         (-[WKShareSheet sharingService:didFailToShareItems:error:]):
130         (-[WKShareSheet sharingService:didShareItems:]):
131         Implement another NSSharingServicePickerDelegate method to return
132         an *NSSharingService* delegate when needed.
133
134         Implement an NSSharingServiceDelegate method to return the window that
135         the service's UI should attach to.
136
137         Also, instead of notifying the Web Content process when a service is picked
138         (or not) in the NSSharingServicePicker, wait until the share has completed
139         (or failed) to send didComplete. This both makes the return completion
140         value more accurate (matching iOS, if you cancel the share during the
141         recipient choice step, it will now fail), and avoids explicitly tearing
142         down the NSSharingServicePicker too early, which breaks the UI attaching mechanism.
143
144 2018-12-06  Wenson Hsieh  <wenson_hsieh@apple.com>
145
146         [iOS] WKWebView should match UITextView behavior when editing text with an RTL keyboard
147         https://bugs.webkit.org/show_bug.cgi?id=187554
148         <rdar://problem/42075638>
149
150         Reviewed by Tim Horton.
151
152         Add support for automatically switching the base writing direction to the default writing direction with respect
153         to the current keyboard in an editable WKWebView by implementing `-setBaseWritingDirection:forRange:`. On iOS 12
154         and earlier, UIKit invokes this protocol method whenever the keyboard is changed to one with a different writing
155         direction, although in some other versions of iOS, this only happens when first focusing an editable area.
156
157         Test: editing/input/ios/rtl-keyboard-input-on-focus.html
158
159         * Platform/spi/ios/UIKitSPI.h:
160
161         Declare UIKeyboardImpl IPI methods mostly for use in WebKitTestRunner (with the exception of
162         `-setInitialDirection`, which we may invoke when we receive the first post-layout EditorState update after
163         focusing an editable element).
164
165         * UIProcess/PageClient.h:
166         * UIProcess/WebPageProxy.cpp:
167         (WebKit::WebPageProxy::increaseListLevel):
168         (WebKit::WebPageProxy::decreaseListLevel):
169         (WebKit::WebPageProxy::changeListType):
170         (WebKit::WebPageProxy::setBaseWritingDirection):
171
172         Drive-by style fixes: make these bail and return early if `!isValid()`.
173
174         (WebKit::WebPageProxy::resetStateAfterProcessExited):
175
176         Reset assisted node state in the UI process upon web process termination.
177
178         * UIProcess/WebPageProxy.h:
179
180         Add plumbing for `setBaseWritingDirection`, from `WebPageProxy` to `WebPage` to `Editor`.
181
182         * UIProcess/ios/PageClientImplIOS.h:
183         * UIProcess/ios/PageClientImplIOS.mm:
184         (WebKit::PageClientImpl::didReceiveEditorStateUpdateAfterFocus):
185         * UIProcess/ios/WKContentViewInteraction.h:
186         * UIProcess/ios/WKContentViewInteraction.mm:
187         (-[WKContentView baseWritingDirectionForPosition:inDirection:]):
188         (coreWritingDirection):
189         (-[WKContentView setBaseWritingDirection:forRange:]):
190
191         Support `-setBaseWritingDirectionForPosition:forRange:`, but only in the case where the given range is the
192         selected range. This is all that's currently needed to fulfill the requirements in <rdar://problem/42075638>,
193         though we could potentially add full support for this in the future by mapping the given text range to a DOM
194         range and moving the selection prior to setting the base writing direction.
195
196         (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]):
197
198         Add a hook to notify WKContentView when the first post-layout EditorState has been received in the UI process.
199         When this is invoked, if the web view is editable and the selection is not a range, we call into `UIKeyboardImpl`
200         to change the initial writing direction if necessary.
201
202         * UIProcess/ios/WebPageProxyIOS.mm:
203         (WebKit::WebPageProxy::startAssistingNode):
204         (WebKit::WebPageProxy::stopAssistingNode):
205         (WebKit::WebPageProxy::editorStateChanged):
206         * WebProcess/WebPage/WebPage.cpp:
207         (WebKit::WebPage::setBaseWritingDirection):
208         * WebProcess/WebPage/WebPage.h:
209         * WebProcess/WebPage/WebPage.messages.in:
210
211 2018-12-06  David Quesada  <david_quesada@apple.com>
212
213         -[WKProcessPool _resumeDownloadFromData:path:] should allow specifying the originating web view
214         https://bugs.webkit.org/show_bug.cgi?id=192411
215         rdar://problem/46492487
216
217         Reviewed by Alex Christensen.
218
219         * UIProcess/API/C/WKContext.cpp:
220         (WKContextResumeDownload):
221         * UIProcess/API/Cocoa/WKProcessPool.mm:
222         (-[WKProcessPool _resumeDownloadFromData:path:originatingWebView:]):
223         (-[WKProcessPool _resumeDownloadFromData:path:]): Deleted.
224         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
225         * UIProcess/WebProcessPool.cpp:
226         (WebKit::WebProcessPool::resumeDownload):
227          - Set the originating page of the DownloadProxy.
228          - If the originating page is non-null, use its session ID for the download.
229          - Remove a FIXME. It's possible to do this now by providing the web view whose session
230            should be used for the download.
231         * UIProcess/WebProcessPool.h:
232
233 2018-12-06  Jiewen Tan  <jiewen_tan@apple.com>
234
235         Unreviewed, a quick fix after r238919
236
237         Add an early return such that the error message is actually meaningful.
238
239         * UIProcess/WebAuthentication/Mock/MockHidService.cpp:
240         (WebKit::MockHidService::platformStartDiscovery):
241
242 2018-12-06  Alex Christensen  <achristensen@webkit.org>
243
244         Remove unused LoaderStrategy::storeDerivedDataToCache and associated dead code
245         https://bugs.webkit.org/show_bug.cgi?id=192452
246
247         Reviewed by Anders Carlsson.
248
249         This was introduced in r210835 but never used.
250         It's preventing me from making the disk cache associated with a SessionID/NetworkSession.
251
252         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
253         (WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache): Deleted.
254         * NetworkProcess/NetworkConnectionToWebProcess.h:
255         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
256         * NetworkProcess/NetworkResourceLoadParameters.cpp:
257         (WebKit::NetworkResourceLoadParameters::encode const):
258         (WebKit::NetworkResourceLoadParameters::decode):
259         * NetworkProcess/NetworkResourceLoadParameters.h:
260         * NetworkProcess/NetworkResourceLoader.cpp:
261         (WebKit::NetworkResourceLoader::continueDidReceiveResponse):
262         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
263         (WebKit::NetworkResourceLoader::continueProcessingCachedEntryAfterDidReceiveResponse): Deleted.
264         * NetworkProcess/NetworkResourceLoader.h:
265         * WebProcess/Network/WebLoaderStrategy.cpp:
266         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
267         (WebKit::WebLoaderStrategy::storeDerivedDataToCache): Deleted.
268         * WebProcess/Network/WebLoaderStrategy.h:
269         * WebProcess/Network/WebResourceLoader.cpp:
270         (WebKit::WebResourceLoader::didRetrieveDerivedData): Deleted.
271         * WebProcess/Network/WebResourceLoader.messages.in:
272
273 2018-12-06  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
274
275         REGRESSION(r231043): [GTK] Undefined references to WebCore::LayerRepresentation::* with -DENABLE_OPENGL=OFF builds
276         https://bugs.webkit.org/show_bug.cgi?id=191997
277
278         Reviewed by Philippe Normand.
279
280         Fix build with -DENABLE_OPENGL=OFF and -DENABLE_VIDEO=OFF.
281
282         * Shared/WebEventConversion.cpp:
283         (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): add required #if ENABLE(ASYNC_SCROLLING)
284
285 2018-12-05  Ryosuke Niwa  <rniwa@webkit.org>
286
287         REGRESSION(PSON): Process swapping code doesn't set DisplayID in WebContent process
288         https://bugs.webkit.org/show_bug.cgi?id=192290
289
290         Reviewed by Simon Fraser.
291
292         Fixed the bug by updating the DisplayID upon attaching to a WebContent process
293         after a process swap as well as after the previous WebContent process had crashed.
294
295         Unfortunately no new tests since WebKitTestRunner / DumpRenderTree should use 0 as DisplayID
296         as they have an off-screen NSWindow. The issue that this results in no fallback for
297         the animation timer is tracked by webkit.org/b/192448.
298
299         * UIProcess/Cocoa/WebViewImpl.mm:
300         (WebKit::WebViewImpl::didRelaunchProcess):
301
302 2018-12-05  Youenn Fablet  <youenn@apple.com>
303
304         Remove a document entry from NetworkMDNSRegister::m_services when document goes away
305         https://bugs.webkit.org/show_bug.cgi?id=192429
306
307         Reviewed by Eric Carlson.
308
309         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
310         (WebKit::NetworkMDNSRegister::unregisterMDNSNames):
311         We should remove the entry to limit the size of the map.
312
313 2018-12-05  Jiewen Tan  <jiewen_tan@apple.com>
314
315         [Mac] Layout Test http/wpt/webauthn/public-key-credential-create-success-hid.https.html and http/wpt/webauthn/public-key-credential-get-success-hid.https.html are flaky
316         https://bugs.webkit.org/show_bug.cgi?id=192061
317
318         Reviewed by Dewei Zhu.
319
320         Part 1.
321
322         Add some loggings to determine possible causes for the flakiness.
323
324         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
325         (WebKit::HidService::continueAddDeviceAfterGetInfo):
326         * UIProcess/WebAuthentication/Mock/MockHidService.cpp:
327         (WebKit::MockHidService::platformStartDiscovery):
328
329 2018-12-05  Chris Dumez  <cdumez@apple.com>
330
331         Simplify logic inside WebPageProxy::continueNavigationInNewProcess()
332         https://bugs.webkit.org/show_bug.cgi?id=192404
333
334         Reviewed by Alex Christensen.
335
336         Simplify get the item state from the current back/forward list item, instead of
337         relying on WebBackForwardList::filteredItemStates().
338
339         * UIProcess/WebPageProxy.cpp:
340         (WebKit::WebPageProxy::continueNavigationInNewProcess):
341
342 2018-12-05  Youenn Fablet  <youenn@apple.com>
343
344         Enable the possibility to do video capture in UIProcess
345         https://bugs.webkit.org/show_bug.cgi?id=192394
346
347         Reviewed by Eric Carlson.
348
349         Add two web preferences to toggle audio/video capture in UIProcess or WebProcess.
350         Add mechanism for video capture that was not implemented yet.
351
352         * Shared/WebPreferences.yaml:
353         * Shared/WebPreferencesDefaultValues.h:
354         * Shared/WebProcessCreationParameters.cpp:
355         (WebKit::WebProcessCreationParameters::encode const):
356         (WebKit::WebProcessCreationParameters::decode):
357         * Shared/WebProcessCreationParameters.h:
358         * UIProcess/API/APIProcessPoolConfiguration.h:
359         * UIProcess/API/C/WKPreferences.cpp:
360         (WKPreferencesSetCaptureAudioInUIProcessEnabled):
361         (WKPreferencesGetCaptureAudioInUIProcessEnabled):
362         (WKPreferencesSetCaptureVideoInUIProcessEnabled):
363         (WKPreferencesGetCaptureVideoInUIProcessEnabled):
364         * UIProcess/API/C/WKPreferencesRef.h:
365         * UIProcess/WebPreferences.cpp:
366         (WebKit::WebPreferences::updateBoolValueForInternalDebugFeatureKey):
367         * UIProcess/WebProcessPool.cpp:
368         (WebKit::WebProcessPool::initializeNewWebProcess):
369         (WebKit::WebProcessPool::createWebPage):
370         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
371         (WebKit::UserMediaCaptureManager::initialize):
372
373 2018-12-05  Alex Christensen  <achristensen@webkit.org>
374
375         Make WebsiteDataStoreConfiguration a proper API object
376         https://bugs.webkit.org/show_bug.cgi?id=192380
377
378         Reviewed by Youenn Fablet.
379
380         In the immediate future I'll need to add things to _WKWebsiteDataStoreConfiguration.
381         Instead of making ivars, setting them, copying them to a local object, make this a wrapper of an API::Object
382         like all our other ObjC API objects are.
383
384         * Shared/API/APIObject.h:
385         (API::Object::wrapper const):
386         (API::Object::wrapper): Deleted.
387         * Shared/Cocoa/APIObject.mm:
388         (API::Object::ref const):
389         (API::Object::deref const):
390         (API::Object::newObject):
391         (API::Object::ref): Deleted.
392         (API::Object::deref): Deleted.
393         * Sources.txt:
394         * UIProcess/API/APIProcessPoolConfiguration.cpp:
395         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
396         * UIProcess/API/APIProcessPoolConfiguration.h:
397         * UIProcess/API/APIWebsiteDataStore.cpp:
398         (API::WebsiteDataStore::createLegacy):
399         (API::WebsiteDataStore::WebsiteDataStore):
400         (API::WebsiteDataStore::legacyDefaultDataStoreConfiguration):
401         * UIProcess/API/APIWebsiteDataStore.h:
402         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
403         (API::WebsiteDataStore::defaultDataStoreConfiguration):
404         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
405         (-[WKWebsiteDataStore _initWithConfiguration:]):
406         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
407         (-[_WKWebsiteDataStoreConfiguration _webStorageDirectory]):
408         (-[_WKWebsiteDataStoreConfiguration _setWebStorageDirectory:]):
409         (-[_WKWebsiteDataStoreConfiguration _indexedDBDatabaseDirectory]):
410         (-[_WKWebsiteDataStoreConfiguration _setIndexedDBDatabaseDirectory:]):
411         (-[_WKWebsiteDataStoreConfiguration _webSQLDatabaseDirectory]):
412         (-[_WKWebsiteDataStoreConfiguration _setWebSQLDatabaseDirectory:]):
413         (-[_WKWebsiteDataStoreConfiguration _cookieStorageFile]):
414         (-[_WKWebsiteDataStoreConfiguration _setCookieStorageFile:]):
415         (-[_WKWebsiteDataStoreConfiguration _resourceLoadStatisticsDirectory]):
416         (-[_WKWebsiteDataStoreConfiguration _setResourceLoadStatisticsDirectory:]):
417         (-[_WKWebsiteDataStoreConfiguration _cacheStorageDirectory]):
418         (-[_WKWebsiteDataStoreConfiguration _setCacheStorageDirectory:]):
419         (-[_WKWebsiteDataStoreConfiguration _serviceWorkerRegistrationDirectory]):
420         (-[_WKWebsiteDataStoreConfiguration _setServiceWorkerRegistrationDirectory:]):
421         (-[_WKWebsiteDataStoreConfiguration setSourceApplicationBundleIdentifier:]):
422         (-[_WKWebsiteDataStoreConfiguration sourceApplicationBundleIdentifier]):
423         (-[_WKWebsiteDataStoreConfiguration sourceApplicationSecondaryIdentifier]):
424         (-[_WKWebsiteDataStoreConfiguration setSourceApplicationSecondaryIdentifier:]):
425         (-[_WKWebsiteDataStoreConfiguration _apiObject]):
426         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfigurationInternal.h: Added.
427         * UIProcess/Network/NetworkProcessProxy.cpp:
428         (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
429         * UIProcess/WebProcessPool.cpp:
430         (WebKit::legacyWebsiteDataStoreConfiguration):
431         (WebKit::WebProcessPool::mayHaveRegisteredServiceWorkers):
432         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
433         (WebKit::WebsiteDataStore::parameters):
434         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
435         (WebKit::WebsiteDataStore::create):
436         (WebKit::WebsiteDataStore::WebsiteDataStore):
437         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
438         (WebKit::WebsiteDataStore::fetchDataAndApply):
439         (WebKit::WebsiteDataStore::removeData):
440         (WebKit::WebsiteDataStore::parameters):
441         (WebKit::WebsiteDataStore::Configuration::Configuration): Deleted.
442         * UIProcess/WebsiteData/WebsiteDataStore.h:
443         (WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const):
444         (WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota):
445         (WebKit::WebsiteDataStore::cacheStorageDirectory const):
446         (WebKit::WebsiteDataStore::setCacheStorageDirectory):
447         (WebKit::WebsiteDataStore::serviceWorkerRegistrationDirectory const):
448         (WebKit::WebsiteDataStore::setServiceWorkerRegistrationDirectory):
449         (WebKit::WebsiteDataStore::resolvedApplicationCacheDirectory const):
450         (WebKit::WebsiteDataStore::resolvedMediaCacheDirectory const):
451         (WebKit::WebsiteDataStore::resolvedMediaKeysDirectory const):
452         (WebKit::WebsiteDataStore::resolvedDatabaseDirectory const):
453         (WebKit::WebsiteDataStore::resolvedJavaScriptConfigurationDirectory const):
454         (WebKit::WebsiteDataStore::resolvedCookieStorageFile const):
455         (WebKit::WebsiteDataStore::resolvedIndexedDatabaseDirectory const):
456         (WebKit::WebsiteDataStore::resolvedServiceWorkerRegistrationDirectory const):
457         (WebKit::WebsiteDataStore::resolvedResourceLoadStatisticsDirectory const):
458         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp: Added.
459         (WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration):
460         * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h: Added.
461         (WebKit::WebsiteDataStoreConfiguration::create):
462         (WebKit::WebsiteDataStoreConfiguration::cacheStoragePerOriginQuota):
463         (WebKit::WebsiteDataStoreConfiguration::setCacheStoragePerOriginQuota):
464         (WebKit::WebsiteDataStoreConfiguration::applicationCacheDirectory const):
465         (WebKit::WebsiteDataStoreConfiguration::setApplicationCacheDirectory):
466         (WebKit::WebsiteDataStoreConfiguration::mediaCacheDirectory const):
467         (WebKit::WebsiteDataStoreConfiguration::setMediaCacheDirectory):
468         (WebKit::WebsiteDataStoreConfiguration::mediaKeysStorageDirectory const):
469         (WebKit::WebsiteDataStoreConfiguration::setMediaKeysStorageDirectory):
470         (WebKit::WebsiteDataStoreConfiguration::javaScriptConfigurationDirectory const):
471         (WebKit::WebsiteDataStoreConfiguration::setJavaScriptConfigurationDirectory):
472         (WebKit::WebsiteDataStoreConfiguration::webStorageDirectory const):
473         (WebKit::WebsiteDataStoreConfiguration::setWebStorageDirectory):
474         (WebKit::WebsiteDataStoreConfiguration::indexedDBDatabaseDirectory const):
475         (WebKit::WebsiteDataStoreConfiguration::setIndexedDBDatabaseDirectory):
476         (WebKit::WebsiteDataStoreConfiguration::webSQLDatabaseDirectory const):
477         (WebKit::WebsiteDataStoreConfiguration::setWebSQLDatabaseDirectory):
478         (WebKit::WebsiteDataStoreConfiguration::localStorageDirectory const):
479         (WebKit::WebsiteDataStoreConfiguration::setLocalStorageDirectory):
480         (WebKit::WebsiteDataStoreConfiguration::cookieStorageFile const):
481         (WebKit::WebsiteDataStoreConfiguration::setCookieStorageFile):
482         (WebKit::WebsiteDataStoreConfiguration::resourceLoadStatisticsDirectory const):
483         (WebKit::WebsiteDataStoreConfiguration::setResourceLoadStatisticsDirectory):
484         (WebKit::WebsiteDataStoreConfiguration::networkCacheDirectory const):
485         (WebKit::WebsiteDataStoreConfiguration::setNetworkCacheDirectory):
486         (WebKit::WebsiteDataStoreConfiguration::cacheStorageDirectory const):
487         (WebKit::WebsiteDataStoreConfiguration::setCacheStorageDirectory):
488         (WebKit::WebsiteDataStoreConfiguration::applicationCacheFlatFileSubdirectoryName const):
489         (WebKit::WebsiteDataStoreConfiguration::setApplicationCacheFlatFileSubdirectoryName):
490         (WebKit::WebsiteDataStoreConfiguration::serviceWorkerRegistrationDirectory const):
491         (WebKit::WebsiteDataStoreConfiguration::setServiceWorkerRegistrationDirectory):
492         (WebKit::WebsiteDataStoreConfiguration::sourceApplicationBundleIdentifier const):
493         (WebKit::WebsiteDataStoreConfiguration::setSourceApplicationBundleIdentifier):
494         (WebKit::WebsiteDataStoreConfiguration::sourceApplicationSecondaryIdentifier const):
495         (WebKit::WebsiteDataStoreConfiguration::setSourceApplicationSecondaryIdentifier):
496         * WebKit.xcodeproj/project.pbxproj:
497
498 2018-12-05  Wenson Hsieh  <wenson_hsieh@apple.com>
499
500         Turn WritingDirection into an enum class
501         https://bugs.webkit.org/show_bug.cgi?id=192401
502         Work towards <rdar://problem/42075638>
503
504         Reviewed by Dan Bernstein.
505
506         Change WritingDirection from an enum to an enum class. No change in behavior.
507
508         * WebProcess/WebPage/WebFrame.cpp:
509         (WebKit::WebFrame::setTextDirection):
510
511 2018-12-05  Rob Buis  <rbuis@igalia.com>
512
513         [Mac] HEAD requests changed to GET after 301, 302, and 303 redirections (http/tests/xmlhttprequest/head-redirection.html)
514         https://bugs.webkit.org/show_bug.cgi?id=114965
515
516         Reviewed by Frédéric Wang.
517
518         HEAD requests should not be changed to GET after 303 redirects, see [1].
519         This was fixed earlier for GTK [2].
520
521         Behavior matches Firefox and Chrome.
522
523         [1] http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-21#section-7.4
524         [2] https://bugs.webkit.org/show_bug.cgi?id=110127
525
526         Tests: web-platform-tests/fetch/api/redirect/redirect-method.html
527                web-platform-tests/fetch/api/redirect/redirect-method-worker.html
528                http/tests/xmlhttprequest/head-redirection.html
529
530         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
531         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
532
533 2018-12-04  Fujii Hironori  <Hironori.Fujii@sony.com>
534
535         Remove using namespace WebCore and WebKit under WebKit/Shared/API
536         https://bugs.webkit.org/show_bug.cgi?id=192352
537
538         Reviewed by Alex Christensen.
539
540         Removed using namespace statements, and use namespace prefix
541         instead.
542
543         * Shared/API/APIURLRequest.cpp:
544         * Shared/API/APIURLResponse.cpp:
545         * Shared/API/c/WKArray.cpp:
546         * Shared/API/c/WKCertificateInfo.cpp:
547         * Shared/API/c/WKConnectionRef.cpp:
548         * Shared/API/c/WKContextMenuItem.cpp:
549         * Shared/API/c/WKData.cpp:
550         * Shared/API/c/WKDictionary.cpp:
551         * Shared/API/c/WKErrorRef.cpp:
552         * Shared/API/c/WKGeometry.cpp:
553         * Shared/API/c/WKImage.cpp:
554         * Shared/API/c/WKMutableArray.cpp:
555         * Shared/API/c/WKMutableDictionary.cpp:
556         * Shared/API/c/WKNumber.cpp:
557         * Shared/API/c/WKPluginInformation.cpp:
558         * Shared/API/c/WKRenderLayer.cpp:
559         * Shared/API/c/WKRenderObject.cpp:
560         * Shared/API/c/WKSecurityOriginRef.cpp:
561         * Shared/API/c/WKSerializedScriptValue.cpp:
562         * Shared/API/c/WKString.cpp:
563         * Shared/API/c/WKType.cpp:
564         * Shared/API/c/WKURL.cpp:
565         * Shared/API/c/WKURLRequest.cpp:
566         * Shared/API/c/WKURLResponse.cpp:
567         * Shared/API/c/WKUserContentURLPattern.cpp:
568         * Shared/API/c/cairo/WKImageCairo.cpp:
569         * Shared/API/c/curl/WKCertificateInfoCurl.cpp:
570
571 2018-12-04  Alex Christensen  <achristensen@webkit.org>
572
573         Remove source application identifiers from NetworkProcessCreationParameters
574         https://bugs.webkit.org/show_bug.cgi?id=192372
575
576         Reviewed by Brady Eidson.
577
578         The _WKWebProcessPoolConfiguration way of setting these was deprecated in http://trac.webkit.org/r235127
579         The replacement was adopted in <rdar://problem/46359330>
580         The transition process is done!  Time to remove the old code.
581
582         * NetworkProcess/NetworkProcessCreationParameters.cpp:
583         (WebKit::NetworkProcessCreationParameters::encode const):
584         (WebKit::NetworkProcessCreationParameters::decode):
585         * NetworkProcess/NetworkProcessCreationParameters.h:
586         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
587         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
588         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
589         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
590         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
591         (WebKit::globalSourceApplicationAuditTokenData): Deleted.
592         (WebKit::globalSourceApplicationBundleIdentifier): Deleted.
593         (WebKit::globalSourceApplicationSecondaryIdentifier): Deleted.
594         (WebKit::NetworkSessionCocoa::setSourceApplicationAuditTokenData): Deleted.
595         (WebKit::NetworkSessionCocoa::setSourceApplicationBundleIdentifier): Deleted.
596         (WebKit::NetworkSessionCocoa::setSourceApplicationSecondaryIdentifier): Deleted.
597         * UIProcess/API/APIProcessPoolConfiguration.cpp:
598         (API::ProcessPoolConfiguration::copy):
599         * UIProcess/API/APIProcessPoolConfiguration.h:
600         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
601         (-[_WKProcessPoolConfiguration sourceApplicationBundleIdentifier]):
602         (-[_WKProcessPoolConfiguration setSourceApplicationBundleIdentifier:]):
603         (-[_WKProcessPoolConfiguration sourceApplicationSecondaryIdentifier]):
604         (-[_WKProcessPoolConfiguration setSourceApplicationSecondaryIdentifier:]):
605         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
606         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
607         (WebKit::toPKPaymentRequest):
608         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
609         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
610         * UIProcess/WebsiteData/WebsiteDataStore.h:
611         (WebKit::WebsiteDataStore::configuration):
612
613 2018-12-04  Youenn Fablet  <youenn@apple.com>
614
615         Calling getUserMedia in a link that was opened with target="_blank" does not work the second time
616         https://bugs.webkit.org/show_bug.cgi?id=188088
617         <rdar://problem/42681448>
618
619         Reviewed by Eric Carlson.
620
621         On closing a page, we need to make sure to consider that the capture is ended,
622         as otherwise WebPageProxy will not get noticed from WebPage, since WebPageProxy is no longer an IPC receiver.
623
624         * UIProcess/UserMediaProcessManager.cpp:
625         (WebKit::UserMediaProcessManager::endedCaptureSession):
626         * UIProcess/WebPageProxy.cpp:
627         (WebKit::WebPageProxy::close):
628
629 2018-12-04  Chris Dumez  <cdumez@apple.com>
630
631         Regression(r238817) PSON Page Cache API tests are failing
632         https://bugs.webkit.org/show_bug.cgi?id=192348
633
634         Reviewed by Alex Christensen.
635
636         Before suspending a WebProcess on iOS, we normally fake a memory pressure signal
637         so that the suspended process uses as little memory as possible while suspended.
638         Among other things, this will clear the page cache. This is an issue in the case
639         of process-swap on navigation because we keep suspended web processes around to
640         keep Page Cache functional.
641
642         To address the issue, when a WebProcess is about to get suspended, we check if
643         the process has any suspended WebPage (WebPage used for PSON PageCache support)
644         and we bypass the PageCache clearing if it does.
645
646         Our API tests did not catch this before r238817 because the NavigationState's
647         assertion was preventing the old WebProcesses from suspending for 3 seconds,
648         which was enough for those tests to complete.
649
650         * UIProcess/SuspendedPageProxy.cpp:
651         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
652         (WebKit::SuspendedPageProxy::didFinishLoad):
653         * UIProcess/SuspendedPageProxy.h:
654         Take a background assertion until the suspension load is complete, to make sure
655         the suspension load has a chance to complete before the process gets suspended.
656
657         * WebProcess/WebProcess.cpp:
658         (WebKit::WebProcess::initializeWebProcess):
659         (WebKit::WebProcess::hasPageRequiringPageCacheWhileSuspended const):
660         (WebKit::WebProcess::actualPrepareToSuspend):
661         * WebProcess/WebProcess.h:
662
663 2018-12-04  Youenn Fablet  <youenn@apple.com>
664
665         Device orientation may be wrong on page reload after crash
666         https://bugs.webkit.org/show_bug.cgi?id=192349
667         <rdar://problem/46359466>
668
669         Reviewed by Eric Carlson.
670
671         On page crash, the process is relaunched and the page is reloaded.
672         At that point, the orientation information of the page is not reset until the next device orientation change.
673         To fix that, add the device orientation to the page creation parameters so that we pass it everytime we create a page.
674         Covered by manual testing.
675
676         * Shared/WebPageCreationParameters.cpp:
677         (WebKit::WebPageCreationParameters::encode const):
678         (WebKit::WebPageCreationParameters::decode):
679         * Shared/WebPageCreationParameters.h:
680         * UIProcess/WebPageProxy.cpp:
681         (WebKit::WebPageProxy::creationParameters):
682         * WebProcess/WebPage/WebPage.cpp:
683
684 2018-12-04  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>
685
686         [WPE] Add gtk-doc
687         https://bugs.webkit.org/show_bug.cgi?id=178900
688
689         Reviewed by Michael Catanzaro.
690
691         Add gtk-doc to WPE port. This patch tries to reuse as much code from
692         WebKitGTK+ as possible.
693
694         * PlatformWPE.cmake: Write variables to gtkdoc-wpe.cfg and gtkdoc-webextensions that is used by python script later.
695         * UIProcess/API/wpe/WebKitWebContext.h: Placed sandbox functions in the same location as in the WebKitGTK+ for consistency.
696         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt: Added.
697         * UIProcess/API/wpe/docs/wpe-docs.sgml: Added.
698         * WebProcess/InjectedBundle/API/wpe/WebKitWebPage.h: Placed webkit_web_page_get_dom_document
699         in the same position as in the WebKitGTK+ for consistency.
700         * WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-0.1-sections.txt: Added.
701         * WebProcess/InjectedBundle/API/wpe/docs/wpe-webextensions-docs.sgml: Added.
702
703 2018-12-04  Carlos Garcia Campos  <cgarcia@igalia.com>
704
705         [SOUP] Move URLSoup back to WebCore after r238771
706         https://bugs.webkit.org/show_bug.cgi?id=192306
707
708         Reviewed by Michael Catanzaro.
709
710         Include GUniquePtrSoup from WebCore again and fix several build failures that showed up after removing the soup
711         includes from URL header.
712
713         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
714         (WebKit::NetworkDataTaskSoup::tlsConnectionAcceptCertificate):
715         * PluginProcess/PluginProcess.cpp:
716         * Shared/API/glib/WebKitURIRequest.cpp:
717         * Shared/API/glib/WebKitURIResponse.cpp:
718         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
719         * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
720         (webkit_uri_scheme_request_finish_error): Use soupURIToURL().
721         * UIProcess/API/glib/WebKitWebView.cpp:
722         (webkit_web_view_load_uri): Use soupURIToURL().
723         * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp:
724         * UIProcess/Launcher/glib/BubblewrapLauncher.h:
725         * UIProcess/Launcher/glib/FlatpakLauncher.cpp:
726         * UIProcess/Launcher/glib/FlatpakLauncher.h:
727
728 2018-12-04  Tim Horton  <timothy_horton@apple.com>
729
730         Fix the watchOS build; stop unnecessarily linking CorePDF
731         https://bugs.webkit.org/show_bug.cgi?id=192356
732         <rdar://problem/46427844>
733
734         Reviewed by Wenson Hsieh.
735
736         * Configurations/WebKit.xcconfig:
737         * Platform/spi/ios/CorePDFSPI.h:
738
739 2018-12-03  Tim Horton  <timothy_horton@apple.com>
740
741         Make it possible to disable animated keyboard scrolling behavior
742         https://bugs.webkit.org/show_bug.cgi?id=192331
743         <rdar://problem/45586859>
744
745         Reviewed by Simon Fraser.
746
747         * UIProcess/API/Cocoa/WKWebView.mm:
748         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
749         (-[WKKeyboardScrollingAnimator invalidate]):
750         (-[WKKeyboardScrollingAnimator beginWithEvent:]):
751         (-[WKKeyboardScrollingAnimator stopAnimatedScroll]):
752         (-[WKKeyboardScrollingAnimator willStartInteractiveScroll]):
753         (-[WKKeyboardScrollingAnimator startRepeatTimerIfNeeded]):
754         (-[WKKeyboardScrollingAnimator stopRepeatTimer]):
755         (-[WKKeyboardScrollingAnimator performDiscreteScroll]):
756         (-[WKKeyboardScrollViewAnimator scrollToContentOffset:animated:]):
757         (-[WKKeyboardScrollViewAnimator scrollWithScrollToExtentAnimationTo:]):
758         * WebKit.xcodeproj/project.pbxproj:
759
760 2018-12-03  Fujii Hironori  <Hironori.Fujii@sony.com>
761
762         Remove "using namespace WebKit" under Source/WebKit/WebProcess/InjectedBundle/API
763         https://bugs.webkit.org/show_bug.cgi?id=192301
764
765         Reviewed by Alex Christensen.
766
767         Removed "using namespace WebKit" statement, and use "WebKit::"
768         namespace prefix instead.
769
770         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
771         * WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.cpp:
772         * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp:
773         * WebProcess/InjectedBundle/API/c/WKBundleDOMWindowExtension.cpp:
774         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
775         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
776         * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
777         * WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp:
778         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
779         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
780         * WebProcess/InjectedBundle/API/c/WKBundlePageBanner.cpp:
781         * WebProcess/InjectedBundle/API/c/WKBundlePageGroup.cpp:
782         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
783         * WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp:
784         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
785
786 2018-12-03  Chris Dumez  <cdumez@apple.com>
787
788         Regression(PSON) Google OAuth is broken in private sessions
789         https://bugs.webkit.org/show_bug.cgi?id=192337
790         <rdar://problem/46353558>
791
792         Reviewed by Alex Christensen.
793
794         In WebPageProxy::swapToWebProcess(), we would call removeWebPage() on the old WebProcessProxy and then
795         addExistingWebPage() on the new WebProcessProxy, as you would expect in case of process swap.
796
797         The issue is that WebProcessProxy::removeWebPage() calls WebProcessPool::pageEndUsingWebsiteDataStore()
798         which would cause the session to get destroyed assuming this was the last page using it. We would
799         therefore lose session cookies after a process-swap in private session.
800
801         To address the issue, a parameter to WebProcessPool::pageEndUsingWebsiteDataStore() and
802         WebProcessPool::pageBeginUsingWebsiteDataStore() to control if we want to tell the WebProcessPool
803         about the page beginning / ending its use of the session. In the case of a process-swap, we make
804         sure the process pool is not notified.
805
806         * UIProcess/WebPageProxy.cpp:
807         (WebKit::WebPageProxy::reattachToWebProcess):
808         (WebKit::WebPageProxy::swapToWebProcess):
809         (WebKit::WebPageProxy::finishAttachingToWebProcess):
810         (WebKit::WebPageProxy::close):
811         * UIProcess/WebProcessProxy.cpp:
812         (WebKit::WebProcessProxy::createWebPage):
813         (WebKit::WebProcessProxy::addExistingWebPage):
814         (WebKit::WebProcessProxy::removeWebPage):
815         * UIProcess/WebProcessProxy.h:
816
817 2018-12-03  Chris Dumez  <cdumez@apple.com>
818
819         [PSON] Request by the client to process-swap is ignored if the window has an opener
820         https://bugs.webkit.org/show_bug.cgi?id=192267
821         <rdar://problem/46386886>
822
823         Reviewed by Brady Eidson.
824
825         If the client forces a process-swap, we should process-swap, even if the browsing
826         context has an opener (or openees). Previously, we would only bypass the cross-site
827         check, not the openee / openees checks.
828
829         The issue when doing so is that the openee still has a opener link to the window
830         in the old process. They would see that the window is still there and navigated
831         to 'about:blank' due to our page suspension logic. To address the issue, we no
832         longer suspend the old WebPage if the process swap was forced by the client and
833         we make sure that the old WebPage gets closed.
834
835         * UIProcess/WebPageProxy.cpp:
836         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
837         (WebKit::WebPageProxy::swapToWebProcess):
838         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
839         (WebKit::WebPageProxy::continueNavigationInNewProcess):
840         * UIProcess/WebPageProxy.h:
841         * UIProcess/WebProcessPool.cpp:
842         (WebKit::WebProcessPool::processForNavigationInternal):
843
844 2018-12-03  Keith Rollin  <krollin@apple.com>
845
846         Add .xcfilelist files
847         https://bugs.webkit.org/show_bug.cgi?id=192082
848         <rdar://problem/46312533>
849
850         Reviewed by Brent Fulgham.
851
852         Add .xcfilelist files for Generate Derived Sources and Generate
853         Unified Sources build phases in Xcode. These are just being staged for
854         now; they'll be added to the Xcode projects later.
855
856         * DerivedSources-input.xcfilelist: Added.
857         * DerivedSources-output.xcfilelist: Added.
858         * UnifiedSources-input.xcfilelist: Added.
859         * UnifiedSources-output.xcfilelist: Added.
860
861 2018-12-03  Zalan Bujtas  <zalan@apple.com>
862
863         [iOS] Unreviewed build fix.
864
865         * Platform/Logging.h:
866
867 2018-12-03  Alex Christensen  <achristensen@webkit.org>
868
869         Remove unused NetworkProcessCreationParameters.diskCacheSizeOverride
870         https://bugs.webkit.org/show_bug.cgi?id=192246
871
872         Reviewed by Chris Dumez.
873
874         The last use of this functionality was removed in rdar://problem/46344871
875
876         * NetworkProcess/NetworkProcess.cpp:
877         (WebKit::NetworkProcess::initializeNetworkProcess):
878         (WebKit::NetworkProcess::setCacheModel):
879         * NetworkProcess/NetworkProcess.h:
880         * NetworkProcess/NetworkProcessCreationParameters.cpp:
881         (WebKit::NetworkProcessCreationParameters::encode const):
882         (WebKit::NetworkProcessCreationParameters::decode):
883         * NetworkProcess/NetworkProcessCreationParameters.h:
884         * UIProcess/API/APIProcessPoolConfiguration.cpp:
885         (API::ProcessPoolConfiguration::copy):
886         * UIProcess/API/APIProcessPoolConfiguration.h:
887         * UIProcess/API/C/WKContextConfigurationRef.cpp:
888         (WKContextConfigurationDiskCacheSizeOverride):
889         (WKContextConfigurationSetDiskCacheSizeOverride):
890         * UIProcess/API/C/WKContextConfigurationRef.h:
891         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
892         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
893         (-[_WKProcessPoolConfiguration diskCacheSizeOverride]):
894         (-[_WKProcessPoolConfiguration setDiskCacheSizeOverride:]):
895         * UIProcess/WebProcessPool.cpp:
896         (WebKit::WebProcessPool::ensureNetworkProcess):
897
898 2018-12-03  Alex Christensen  <achristensen@webkit.org>
899
900         Add WKWebProcessPlugInLoadDelegate SPI willStartProvisionalLoadForFrame with a completion handler
901         https://bugs.webkit.org/show_bug.cgi?id=192272
902
903         Reviewed by Brady Eidson.
904
905         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
906         (API::InjectedBundle::PageLoaderClient::didStartProvisionalLoadForFrame):
907         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
908         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
909         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
910         (ResourceLoadClient::ResourceLoadClient):
911         (ResourceLoadClient::loadDelegate const):
912         (ResourceLoadClient::pluginContextController const):
913         (PageLoaderClient::PageLoaderClient):
914         (PageLoaderClient::loadDelegate const):
915         (PageLoaderClient::pluginContextController const):
916         (PageLoaderClient::didStartProvisionalLoadForFrame):
917         (PageLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
918         (PageLoaderClient::didFinishLoadForFrame):
919         (PageLoaderClient::globalObjectIsAvailableForFrame):
920         (PageLoaderClient::didRemoveFrameFromHierarchy):
921         (PageLoaderClient::didCommitLoadForFrame):
922         (PageLoaderClient::didFinishDocumentLoadForFrame):
923         (PageLoaderClient::didFailProvisionalLoadWithErrorForFrame):
924         (PageLoaderClient::didFailLoadWithErrorForFrame):
925         (PageLoaderClient::didSameDocumentNavigationForFrame):
926         (PageLoaderClient::didLayoutForFrame):
927         (PageLoaderClient::didReachLayoutMilestone):
928         (PageLoaderClient::didFirstVisuallyNonEmptyLayoutForFrame):
929         (PageLoaderClient::didHandleOnloadEventsForFrame):
930         (PageLoaderClient::userAgentForURL const):
931         (ResourceLoadClient::willSendRequestForFrame):
932         (ResourceLoadClient::didInitiateLoadForResource):
933         (ResourceLoadClient::didFinishLoadForResource):
934         (ResourceLoadClient::didFailLoadForResource):
935         (-[WKWebProcessPlugInBrowserContextController setLoadDelegate:]):
936         (didStartProvisionalLoadForFrame): Deleted.
937         (didReceiveServerRedirectForProvisionalLoadForFrame): Deleted.
938         (didFinishLoadForFrame): Deleted.
939         (globalObjectIsAvailableForFrame): Deleted.
940         (didRemoveFrameFromHierarchy): Deleted.
941         (didCommitLoadForFrame): Deleted.
942         (didFinishDocumentLoadForFrame): Deleted.
943         (didFailProvisionalLoadWithErrorForFrame): Deleted.
944         (didFailLoadWithErrorForFrame): Deleted.
945         (didSameDocumentNavigationForFrame): Deleted.
946         (didLayoutForFrame): Deleted.
947         (didReachLayoutMilestone): Deleted.
948         (didFirstVisuallyNonEmptyLayoutForFrame): Deleted.
949         (didHandleOnloadEventsForFrame): Deleted.
950         (userAgentForURL): Deleted.
951         (setUpPageLoaderClient): Deleted.
952         (willSendRequestForFrame): Deleted.
953         (didInitiateLoadForResource): Deleted.
954         (didFinishLoadForResource): Deleted.
955         (didFailLoadForResource): Deleted.
956         (setUpResourceLoadClient): Deleted.
957         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
958         (WebKit::InjectedBundlePageLoaderClient::didStartProvisionalLoadForFrame):
959         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
960         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
961         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
962         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
963
964 2018-12-03  Tim Horton  <timothy_horton@apple.com>
965
966         Swipe snapshot stays up too long swiping around on apple.com (waiting for first paint)
967         https://bugs.webkit.org/show_bug.cgi?id=192319
968         <rdar://problem/45928708>
969
970         Reviewed by Simon Fraser.
971
972         * UIProcess/Cocoa/ViewGestureController.cpp:
973         (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
974         * UIProcess/Cocoa/ViewGestureController.h:
975         * UIProcess/ios/ViewGestureControllerIOS.mm:
976         (WebKit::ViewGestureController::endSwipeGesture):
977         In r236966, I reverted slightly too much of r232416.
978         We still need to defer requesting a presentation update callback until
979         after the provisional load starts. Otherwise, we could get the callback
980         while we're in the 'paused' state, and drop it on the floor. That would
981         then mean that we time out instead of promptly removing the snapshot.
982
983 2018-12-03  Alex Christensen  <achristensen@webkit.org>
984
985         Update process assertions after swapping processes
986         https://bugs.webkit.org/show_bug.cgi?id=192318
987         <rdar://problem/46377552>
988
989         Reviewed by Chris Dumez.
990
991         If the previous WebProcess had a ProcessAssertion to prevent it from being suspended,
992         after navigation and process swapping we need the new WebProcess to update its process assertions.
993
994         * UIProcess/API/Cocoa/PageLoadStateObserver.h:
995         * UIProcess/Cocoa/NavigationState.h:
996         * UIProcess/Cocoa/NavigationState.mm:
997         (WebKit::NavigationState::didSwapWebProcesses):
998         * UIProcess/PageLoadState.cpp:
999         (WebKit::PageLoadState::didSwapWebProcesses):
1000         * UIProcess/PageLoadState.h:
1001         * UIProcess/WebPageProxy.cpp:
1002         (WebKit::WebPageProxy::finishAttachingToWebProcess):
1003
1004 2018-12-03  Daniel Bates  <dabates@apple.com>
1005
1006         [iOS] Do not handle key events that are key commands
1007         https://bugs.webkit.org/show_bug.cgi?id=191608
1008         <rdar://problem/46046013>
1009
1010         Reviewed by Ryosuke Niwa.
1011
1012         A key down event may be associated with a key command. If it is then we want to execute the
1013         key command instead of inserting or deleting text. We need to ask UIKit to handle the current
1014         event as a key command to find out.
1015
1016         * UIProcess/ios/WKContentViewInteraction.mm:
1017         (-[WKContentView _interpretKeyEvent:isCharEvent:]): Ask UIKit to handle the current event
1018         as a key command. If it handles it then we're done. Otherwise, do what we do now.
1019
1020 2018-12-03  Zalan Bujtas  <zalan@apple.com>
1021
1022         [iOS] Add logging channel for hover related content observation
1023         https://bugs.webkit.org/show_bug.cgi?id=192312
1024
1025         Reviewed by Simon Fraser.
1026
1027         * WebProcess/WebPage/ios/WebPageIOS.mm:
1028         (WebKit::WebPage::handleSyntheticClick):
1029         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
1030
1031 2018-12-03  Tim Horton  <timothy_horton@apple.com>
1032
1033         Enable swipe snapshot removal logging in release builds
1034         https://bugs.webkit.org/show_bug.cgi?id=192313
1035
1036         Reviewed by Dean Jackson.
1037
1038         * UIProcess/Cocoa/ViewGestureController.cpp:
1039         (WebKit::ViewGestureController::SnapshotRemovalTracker::log const):
1040         This is super-low-traffic and super-helpful logging.
1041         Turn it on all the time.
1042
1043 2018-12-03  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1044
1045         Use WallTime for file time
1046         https://bugs.webkit.org/show_bug.cgi?id=192287
1047
1048         Reviewed by Darin Adler.
1049
1050         * Shared/SessionState.h:
1051         * Shared/WebCoreArgumentCoders.cpp:
1052         (IPC::ArgumentCoder<DatabaseDetails>::decode):
1053         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
1054         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
1055         * UIProcess/API/glib/WebKitWebViewSessionState.cpp:
1056         (decodeHTTPBody):
1057         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
1058         (WebKit::PluginInfoCache::getPluginInfo):
1059         (WebKit::PluginInfoCache::updatePluginInfo):
1060         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
1061         (WebKit::hasFileChangedSince):
1062         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
1063         (WebKit::LocalStorageDatabaseTracker::databasesModifiedSince):
1064         (WebKit::LocalStorageDatabaseTracker::originDetails):
1065         * UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
1066         * UIProcess/mac/LegacySessionStateCoding.cpp:
1067         (WebKit::encodeFormDataElement):
1068         (WebKit::decodeFormDataElement):
1069         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
1070         (WebKit::removeAllMediaKeyStorageForOriginPath):
1071         (WebKit::WebMediaKeyStorageManager::deleteMediaKeyEntriesForOrigin):
1072         (WebKit::WebMediaKeyStorageManager::deleteMediaKeyEntriesModifiedBetweenDates):
1073         (WebKit::WebMediaKeyStorageManager::deleteAllMediaKeyEntries):
1074         * WebProcess/MediaCache/WebMediaKeyStorageManager.h:
1075         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
1076         (WebKit::toHTTPBody):
1077         (WebKit::toFormData):
1078
1079 2018-12-03  Darin Adler  <darin@apple.com>
1080
1081         [Cocoa] Check message IDs when decoding Mach messages in IPC::Connection
1082         https://bugs.webkit.org/show_bug.cgi?id=192300
1083         rdar://problem/46215523
1084
1085         Reviewed by Chris Dumez.
1086
1087         * Platform/IPC/mac/ConnectionMac.mm:
1088         (IPC::Connection::sendOutgoingMessage): Use message IDs other than 0 and 1 for
1089         the messages, as suggested by an expert at Apple.
1090         (IPC::createMessageDecoder): Update for the new message IDs.
1091         (IPC::Connection::receiveSourceEventHandler): Ignore messages with unexpected
1092         message IDs.
1093
1094 2018-12-03  Darin Adler  <darin@apple.com>
1095
1096         [Cocoa] Check descriptor types in createMessageDecoder
1097         https://bugs.webkit.org/show_bug.cgi?id=192302
1098
1099         Reviewed by Chris Dumez.
1100
1101         Not sure how to construct a test case for Connection, so not adding any
1102         tests at this time.
1103
1104         * Platform/IPC/mac/ConnectionMac.mm:
1105         (IPC::createMessageDecoder): Check descriptor types and return nullptr if they
1106         are incorrect. Retained the assertions to help with debugging.
1107         (IPC::Connection::receiveSourceEventHandler): Ignore the message if no decoder
1108         is created, which means the message is invalid.
1109
1110 2018-12-03  Darin Adler  <darin@apple.com>
1111
1112         Alignment padding needs to be zeroed out in IPC::Encoder
1113         https://bugs.webkit.org/show_bug.cgi?id=192304
1114
1115         Reviewed by Chris Dumez.
1116
1117         Might be useful to make a regression test for this, but I couldn't find any
1118         other tests for this code.
1119
1120         * Platform/IPC/Encoder.cpp:
1121         (IPC::Encoder::grow): Use std::memset to zero-fill padding bytes.
1122
1123         * UIProcess/mac/LegacySessionStateCoding.cpp:
1124         (WebKit::HistoryEntryDataEncoder::grow): Ditto.
1125
1126 2018-12-03  Darin Adler  <darin@apple.com>
1127
1128         [Cocoa] Streamline sandbox code a tiny bit
1129         https://bugs.webkit.org/show_bug.cgi?id=192299
1130
1131         Reviewed by Anders Carlsson.
1132
1133         * Shared/mac/SandboxUtilities.mm:
1134         (WebKit::processHasContainer): Removed separate function, just use the
1135         pathForProcessContainer instead of repeating logic. This costs a tiny
1136         bit of memory allocation overhead the first time this function is called,
1137         but in return we can eliminate a second copy of the code to call
1138         sandbox_container_path_for_pid.
1139
1140 2018-12-03  Eric Carlson  <eric.carlson@apple.com>
1141
1142         [MediaStream] 'devicechange' event when more capture device information are revealed.
1143         https://bugs.webkit.org/show_bug.cgi?id=192268
1144
1145         Reviewed by Youenn Fablet.
1146
1147         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1148         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Call captureDevicesChanged
1149         if a filtered device list was returned previously.
1150         (WebKit::UserMediaPermissionRequestManagerProxy::resetAccess): Clear m_hasFilteredDeviceList.
1151         (WebKit::UserMediaPermissionRequestManagerProxy::wasGrantedVideoOrAudioAccess): New.
1152         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Filter device
1153         list and strip device IDs if gUM permission hasn't been given.
1154         (WebKit::UserMediaPermissionRequestManagerProxy::watchdogTimerFired): Clear m_hasFilteredDeviceList.
1155         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1156
1157 2018-12-03  Keith Rollin  <krollin@apple.com>
1158
1159         Remove Network Capture
1160         https://bugs.webkit.org/show_bug.cgi?id=192296
1161         <rdar://problem/46408648>
1162
1163         Reviewed by Daniel Bates.
1164
1165         r209498 introduced an embedded record and replay facility for network
1166         resource loading. This facility was added in order to support a new
1167         implementation of the PLT and related performance tests. The PLT is
1168         currenty taking a different direction, and so this record/replace
1169         facility is no longer needed. Removing it as unused code.
1170
1171         * CMakeLists.txt:
1172         * NetworkProcess/NetworkLoad.cpp:
1173         (WebKit::NetworkLoad::NetworkLoad):
1174         (WebKit::NetworkLoad::setDefersLoading):
1175         (WebKit::NetworkLoad::continueWillSendRequest):
1176         (WebKit::NetworkLoad::willPerformHTTPRedirection):
1177         (WebKit::NetworkLoad::notifyDidReceiveResponse):
1178         (WebKit::NetworkLoad::didReceiveData):
1179         (WebKit::NetworkLoad::didCompleteWithError):
1180         (WebKit::NetworkLoad::initializeForRecord): Deleted.
1181         (WebKit::NetworkLoad::initializeForReplay): Deleted.
1182         * NetworkProcess/NetworkLoad.h:
1183         * NetworkProcess/NetworkProcess.cpp:
1184         (WebKit::NetworkProcess::initializeNetworkProcess):
1185         (WebKit::NetworkProcess::terminate):
1186         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1187         (WebKit::NetworkProcessCreationParameters::encode const):
1188         (WebKit::NetworkProcessCreationParameters::decode):
1189         * NetworkProcess/NetworkProcessCreationParameters.h:
1190         * NetworkProcess/capture/NetworkCaptureEvent.cpp: Removed.
1191         * NetworkProcess/capture/NetworkCaptureEvent.h: Removed.
1192         * NetworkProcess/capture/NetworkCaptureLogging.h: Removed.
1193         * NetworkProcess/capture/NetworkCaptureManager.cpp: Removed.
1194         * NetworkProcess/capture/NetworkCaptureManager.h: Removed.
1195         * NetworkProcess/capture/NetworkCaptureRecorder.cpp: Removed.
1196         * NetworkProcess/capture/NetworkCaptureRecorder.h: Removed.
1197         * NetworkProcess/capture/NetworkCaptureReplayer.cpp: Removed.
1198         * NetworkProcess/capture/NetworkCaptureReplayer.h: Removed.
1199         * NetworkProcess/capture/NetworkCaptureResource.cpp: Removed.
1200         * NetworkProcess/capture/NetworkCaptureResource.h: Removed.
1201         * NetworkProcess/capture/NetworkDataTaskReplay.cpp: Removed.
1202         * NetworkProcess/capture/NetworkDataTaskReplay.h: Removed.
1203         * NetworkProcess/capture/json.hpp: Removed.
1204         * Sources.txt:
1205         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1206         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1207         * WebKit.xcodeproj/project.pbxproj:
1208         * config.h:
1209
1210 2018-12-02  Zalan Bujtas  <zalan@apple.com>
1211
1212         Add a runtime feature flag for LayoutFormattingContext.
1213         https://bugs.webkit.org/show_bug.cgi?id=192280
1214
1215         Reviewed by Simon Fraser.
1216
1217         * Configurations/FeatureDefines.xcconfig:
1218         * Shared/WebPreferences.yaml:
1219         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1220         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1221
1222 2018-12-01  Chris Dumez  <cdumez@apple.com>
1223
1224         [PSON] process-swapping may occur even though opener has handle to openee
1225         https://bugs.webkit.org/show_bug.cgi?id=192277
1226
1227         Reviewed by Antti Koivisto.
1228
1229         * Shared/NavigationActionData.cpp:
1230         (WebKit::NavigationActionData::encode const):
1231         (WebKit::NavigationActionData::decode):
1232         * Shared/NavigationActionData.h:
1233         * UIProcess/API/APINavigation.h:
1234         (API::Navigation::openedByDOMWithOpener const):
1235         (API::Navigation::openedViaWindowOpenWithOpener const): Deleted.
1236         (API::Navigation::opener const): Deleted.
1237         * UIProcess/WebProcessPool.cpp:
1238         (WebKit::WebProcessPool::processForNavigationInternal):
1239         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1240         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1241
1242 2018-12-01  Alexey Proskuryakov  <ap@apple.com>
1243
1244         Modernize version check for _suppressedAutoAddedHTTPHeaders
1245         https://bugs.webkit.org/show_bug.cgi?id=192175
1246
1247         Reviewed by Tim Horton.
1248
1249         * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1250         Also removed selector check - we only need to support running on 10.13.0 when building
1251         with 10.13.0 SDK.
1252
1253 2018-11-30  Alex Christensen  <achristensen@webkit.org>
1254
1255         Fix Windows build.
1256
1257         * UIProcess/API/C/curl/WKWebsiteDataStoreRefCurl.cpp:
1258         (WKWebsiteDataStoreEnableCustomNetworkProxySettings):
1259
1260 2018-11-30  Alex Christensen  <achristensen@webkit.org>
1261
1262         Move URL from WebCore to WTF
1263         https://bugs.webkit.org/show_bug.cgi?id=190234
1264
1265         Reviewed by Keith Miller.
1266
1267         * NetworkProcess/Cookies/WebCookieManager.cpp:
1268         * NetworkProcess/Cookies/WebCookieManager.h:
1269         * NetworkProcess/Cookies/WebCookieManager.messages.in:
1270         * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm:
1271         * NetworkProcess/Downloads/Download.h:
1272         * NetworkProcess/Downloads/DownloadManager.cpp:
1273         (WebKit::DownloadManager::publishDownloadProgress):
1274         * NetworkProcess/Downloads/DownloadManager.h:
1275         * NetworkProcess/Downloads/PendingDownload.cpp:
1276         (WebKit::PendingDownload::publishProgress):
1277         * NetworkProcess/Downloads/PendingDownload.h:
1278         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
1279         (WebKit::Download::publishProgress):
1280         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
1281         (WebKit::NetworkBlobRegistry::registerBlobURL):
1282         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
1283         (WebKit::NetworkBlobRegistry::unregisterBlobURL):
1284         (WebKit::NetworkBlobRegistry::blobSize):
1285         (WebKit::NetworkBlobRegistry::filesInBlob):
1286         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
1287         * NetworkProcess/NetworkConnectionToWebProcess.h:
1288         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1289         * NetworkProcess/NetworkDataTask.cpp:
1290         (WebKit::NetworkDataTask::didReceiveResponse):
1291         * NetworkProcess/NetworkDataTaskBlob.cpp:
1292         * NetworkProcess/NetworkLoadChecker.h:
1293         (WebKit::NetworkLoadChecker::setContentExtensionController):
1294         (WebKit::NetworkLoadChecker::url const):
1295         * NetworkProcess/NetworkProcess.cpp:
1296         (WebKit::NetworkProcess::writeBlobToFilePath):
1297         (WebKit::NetworkProcess::publishDownloadProgress):
1298         (WebKit::NetworkProcess::preconnectTo):
1299         * NetworkProcess/NetworkProcess.h:
1300         * NetworkProcess/NetworkProcess.messages.in:
1301         * NetworkProcess/NetworkResourceLoadParameters.h:
1302         * NetworkProcess/NetworkResourceLoader.cpp:
1303         (WebKit::logBlockedCookieInformation):
1304         (WebKit::logCookieInformationInternal):
1305         * NetworkProcess/NetworkResourceLoader.h:
1306         * NetworkProcess/NetworkSocketStream.cpp:
1307         (WebKit::NetworkSocketStream::create):
1308         * NetworkProcess/NetworkSocketStream.h:
1309         * NetworkProcess/PingLoad.h:
1310         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
1311         * NetworkProcess/ServiceWorker/WebSWServerConnection.messages.in:
1312         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
1313         * NetworkProcess/cache/CacheStorageEngine.cpp:
1314         (WebKit::CacheStorage::Engine::retrieveRecords):
1315         * NetworkProcess/cache/CacheStorageEngine.h:
1316         * NetworkProcess/cache/CacheStorageEngineCache.h:
1317         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
1318         (WebKit::CacheStorageEngineConnection::retrieveRecords):
1319         * NetworkProcess/cache/CacheStorageEngineConnection.h:
1320         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
1321         * NetworkProcess/cache/NetworkCache.h:
1322         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
1323         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
1324         (WebKit::NetworkCache::Statistics::recordRevalidationSuccess):
1325         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
1326         (WebKit::NetworkCache::SubresourceInfo::firstPartyForCookies const):
1327         * NetworkProcess/capture/NetworkCaptureEvent.cpp:
1328         (WebKit::NetworkCapture::Request::operator WebCore::ResourceRequest const):
1329         (WebKit::NetworkCapture::Response::operator WebCore::ResourceResponse const):
1330         (WebKit::NetworkCapture::Error::operator WebCore::ResourceError const):
1331         * NetworkProcess/capture/NetworkCaptureManager.cpp:
1332         (WebKit::NetworkCapture::Manager::findBestFuzzyMatch):
1333         (WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
1334         (WebKit::NetworkCapture::Manager::urlIdentifyingCommonDomain):
1335         * NetworkProcess/capture/NetworkCaptureManager.h:
1336         * NetworkProcess/capture/NetworkCaptureResource.cpp:
1337         (WebKit::NetworkCapture::Resource::url):
1338         (WebKit::NetworkCapture::Resource::queryParameters):
1339         * NetworkProcess/capture/NetworkCaptureResource.h:
1340         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1341         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
1342         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1343         (WebKit::NetworkProcess::deleteHSTSCacheForHostNames):
1344         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1345         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
1346         * PluginProcess/mac/PluginProcessMac.mm:
1347         (WebKit::openCFURLRef):
1348         (WebKit::replacedNSWorkspace_launchApplicationAtURL_options_configuration_error):
1349         * Shared/API/APIURL.h:
1350         (API::URL::create):
1351         (API::URL::equals):
1352         (API::URL::URL):
1353         (API::URL::url const):
1354         (API::URL::parseURLIfNecessary const):
1355         * Shared/API/APIUserContentURLPattern.h:
1356         (API::UserContentURLPattern::matchesURL const):
1357         * Shared/API/c/WKURLRequest.cpp:
1358         * Shared/API/c/WKURLResponse.cpp:
1359         * Shared/API/c/cf/WKURLCF.mm:
1360         (WKURLCreateWithCFURL):
1361         (WKURLCopyCFURL):
1362         * Shared/API/glib/WebKitURIRequest.cpp:
1363         * Shared/API/glib/WebKitURIResponse.cpp:
1364         * Shared/APIWebArchiveResource.mm:
1365         (API::WebArchiveResource::WebArchiveResource):
1366         * Shared/AssistedNodeInformation.h:
1367         * Shared/Cocoa/WKNSURLExtras.mm:
1368         (-[NSURL _web_originalDataAsWTFString]):
1369         (): Deleted.
1370         * Shared/SessionState.h:
1371         * Shared/WebBackForwardListItem.cpp:
1372         (WebKit::WebBackForwardListItem::itemIsInSameDocument const):
1373         * Shared/WebCoreArgumentCoders.cpp:
1374         * Shared/WebCoreArgumentCoders.h:
1375         * Shared/WebErrors.h:
1376         * Shared/WebHitTestResultData.cpp:
1377         * Shared/cf/ArgumentCodersCF.cpp:
1378         (IPC::encode):
1379         (IPC::decode):
1380         * Shared/gtk/WebErrorsGtk.cpp:
1381         * Shared/ios/InteractionInformationAtPosition.h:
1382         * UIProcess/API/APIHTTPCookieStore.h:
1383         * UIProcess/API/APINavigation.cpp:
1384         (API::Navigation::appendRedirectionURL):
1385         * UIProcess/API/APINavigation.h:
1386         (API::Navigation::takeRedirectChain):
1387         * UIProcess/API/APINavigationAction.h:
1388         * UIProcess/API/APINavigationClient.h:
1389         (API::NavigationClient::signedPublicKeyAndChallengeString):
1390         (API::NavigationClient::contentRuleListNotification):
1391         (API::NavigationClient::webGLLoadPolicy const):
1392         (API::NavigationClient::resolveWebGLLoadPolicy const):
1393         * UIProcess/API/APIUIClient.h:
1394         (API::UIClient::saveDataToFileInDownloadsFolder):
1395         * UIProcess/API/APIUserScript.cpp:
1396         (API::UserScript::generateUniqueURL):
1397         * UIProcess/API/APIUserScript.h:
1398         * UIProcess/API/APIUserStyleSheet.cpp:
1399         (API::UserStyleSheet::generateUniqueURL):
1400         * UIProcess/API/APIUserStyleSheet.h:
1401         * UIProcess/API/C/WKOpenPanelResultListener.cpp:
1402         (filePathsFromFileURLs):
1403         * UIProcess/API/C/WKPage.cpp:
1404         (WKPageLoadPlainTextStringWithUserData):
1405         (WKPageSetPageUIClient):
1406         (WKPageSetPageNavigationClient):
1407         * UIProcess/API/C/WKPageGroup.cpp:
1408         (WKPageGroupAddUserStyleSheet):
1409         (WKPageGroupAddUserScript):
1410         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1411         (WKWebsiteDataStoreSetResourceLoadStatisticsPrevalentResourceForDebugMode):
1412         (WKWebsiteDataStoreSetStatisticsLastSeen):
1413         (WKWebsiteDataStoreSetStatisticsPrevalentResource):
1414         (WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
1415         (WKWebsiteDataStoreIsStatisticsPrevalentResource):
1416         (WKWebsiteDataStoreIsStatisticsVeryPrevalentResource):
1417         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubresourceUnder):
1418         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
1419         (WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
1420         (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
1421         (WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
1422         (WKWebsiteDataStoreSetStatisticsGrandfathered):
1423         (WKWebsiteDataStoreIsStatisticsGrandfathered):
1424         (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
1425         (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
1426         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
1427         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectFrom):
1428         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectTo):
1429         (WKWebsiteDataStoreSetStatisticsTopFrameUniqueRedirectFrom):
1430         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
1431         * UIProcess/API/Cocoa/WKUserScript.mm:
1432         (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:associatedURL:userContentWorld:]):
1433         * UIProcess/API/Cocoa/WKWebView.mm:
1434         (-[WKWebView _showSafeBrowsingWarning:completionHandler:]):
1435         (-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]):
1436         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1437         (-[WKWebViewConfiguration setURLSchemeHandler:forURLScheme:]):
1438         (-[WKWebViewConfiguration urlSchemeHandlerForURLScheme:]):
1439         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1440         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1441         * UIProcess/API/Cocoa/_WKApplicationManifest.mm:
1442         (-[_WKApplicationManifest initWithCoder:]):
1443         (+[_WKApplicationManifest applicationManifestFromJSON:manifestURL:documentURL:]):
1444         * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
1445         (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]):
1446         * UIProcess/API/glib/IconDatabase.cpp:
1447         * UIProcess/API/glib/WebKitCookieManager.cpp:
1448         (webkit_cookie_manager_get_cookies):
1449         * UIProcess/API/glib/WebKitFileChooserRequest.cpp:
1450         * UIProcess/API/glib/WebKitSecurityOrigin.cpp:
1451         (webkit_security_origin_new_for_uri):
1452         * UIProcess/API/glib/WebKitUIClient.cpp:
1453         * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
1454         * UIProcess/API/glib/WebKitWebView.cpp:
1455         (webkit_web_view_load_plain_text):
1456         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
1457         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
1458         (WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
1459         (WebKit::WebPaymentCoordinatorProxy::validateMerchant):
1460         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
1461         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
1462         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1463         (WebKit::toPKPaymentRequest):
1464         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
1465         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
1466         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
1467         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
1468         * UIProcess/Automation/WebAutomationSession.cpp:
1469         (WebKit::WebAutomationSession::navigateBrowsingContext):
1470         (WebKit::domainByAddingDotPrefixIfNeeded):
1471         (WebKit::WebAutomationSession::addSingleCookie):
1472         (WebKit::WebAutomationSession::deleteAllCookies):
1473         * UIProcess/Cocoa/DownloadClient.mm:
1474         (WebKit::DownloadClient::didFinish):
1475         * UIProcess/Cocoa/NavigationState.h:
1476         * UIProcess/Cocoa/NavigationState.mm:
1477         (WebKit::NavigationState::NavigationClient::webGLLoadPolicy const):
1478         (WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const):
1479         (WebKit::NavigationState::NavigationClient::contentRuleListNotification):
1480         (WebKit::NavigationState::NavigationClient::willPerformClientRedirect):
1481         (WebKit::NavigationState::NavigationClient::didPerformClientRedirect):
1482         (WebKit::NavigationState::NavigationClient::signedPublicKeyAndChallengeString):
1483         * UIProcess/Cocoa/SafeBrowsingResultCocoa.mm: Copied from Source/WebKit/WebProcess/Network/WebSocketProvider.h.
1484         (WebKit::SafeBrowsingResult::SafeBrowsingResult):
1485         * UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm:
1486         (WebKit::reportAnErrorURL):
1487         (WebKit::malwareDetailsURL):
1488         (WebKit::safeBrowsingDetailsText):
1489         (WebKit::SafeBrowsingWarning::SafeBrowsingWarning):
1490         * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
1491         (-[_WKPreviewControllerDataSource finish:]):
1492         (WebKit::SystemPreviewController::finish):
1493         * UIProcess/Cocoa/UIDelegate.h:
1494         * UIProcess/Cocoa/UIDelegate.mm:
1495         (WebKit::UIDelegate::UIClient::createNewPage):
1496         (WebKit::UIDelegate::UIClient::saveDataToFileInDownloadsFolder):
1497         (WebKit::requestUserMediaAuthorizationForDevices):
1498         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
1499         * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm:
1500         (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]):
1501         * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
1502         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
1503         (-[WKSafeBrowsingWarning initWithFrame:safeBrowsingWarning:completionHandler:]):
1504         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1505         * UIProcess/Cocoa/WebViewImpl.h:
1506         * UIProcess/Cocoa/WebViewImpl.mm:
1507         (WebKit::WebViewImpl::showSafeBrowsingWarning):
1508         (WebKit::WebViewImpl::writeToURLForFilePromiseProvider):
1509         * UIProcess/Downloads/DownloadProxy.cpp:
1510         (WebKit::DownloadProxy::publishProgress):
1511         * UIProcess/Downloads/DownloadProxy.h:
1512         (WebKit::DownloadProxy::setRedirectChain):
1513         (WebKit::DownloadProxy::redirectChain const):
1514         * UIProcess/FrameLoadState.cpp:
1515         (WebKit::FrameLoadState::didStartProvisionalLoad):
1516         (WebKit::FrameLoadState::didReceiveServerRedirectForProvisionalLoad):
1517         (WebKit::FrameLoadState::didSameDocumentNotification):
1518         (WebKit::FrameLoadState::setUnreachableURL):
1519         * UIProcess/FrameLoadState.h:
1520         (WebKit::FrameLoadState::url const):
1521         (WebKit::FrameLoadState::setURL):
1522         (WebKit::FrameLoadState::provisionalURL const):
1523         (WebKit::FrameLoadState::unreachableURL const):
1524         * UIProcess/Network/NetworkProcessProxy.cpp:
1525         (WebKit::NetworkProcessProxy::writeBlobToFilePath):
1526         * UIProcess/Network/NetworkProcessProxy.h:
1527         * UIProcess/PageClient.h:
1528         (WebKit::PageClient::showSafeBrowsingWarning):
1529         * UIProcess/PageLoadState.cpp:
1530         (WebKit::PageLoadState::hasOnlySecureContent):
1531         * UIProcess/Plugins/PluginInfoStore.cpp:
1532         * UIProcess/Plugins/PluginInfoStore.h:
1533         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1534         * UIProcess/SafeBrowsingResult.h: Copied from Source/WebKit/UIProcess/SystemPreviewController.h.
1535         (WebKit::SafeBrowsingResult::create):
1536         (WebKit::SafeBrowsingResult::url const):
1537         (WebKit::SafeBrowsingResult::provider const):
1538         (WebKit::SafeBrowsingResult::isPhishing const):
1539         (WebKit::SafeBrowsingResult::isMalware const):
1540         (WebKit::SafeBrowsingResult::isUnwantedSoftware const):
1541         (WebKit::SafeBrowsingResult::isKnownToBeUnsafe const):
1542         * UIProcess/SafeBrowsingWarning.h:
1543         (WebKit::SafeBrowsingWarning::create):
1544         * UIProcess/SuspendedPageProxy.cpp:
1545         * UIProcess/SystemPreviewController.h:
1546         * UIProcess/WebCookieManagerProxy.h:
1547         * UIProcess/WebFrameProxy.h:
1548         (WebKit::WebFrameProxy::url const):
1549         (WebKit::WebFrameProxy::provisionalURL const):
1550         (WebKit::WebFrameProxy::unreachableURL const):
1551         * UIProcess/WebInspectorProxy.h:
1552         * UIProcess/WebOpenPanelResultListenerProxy.cpp:
1553         * UIProcess/WebPageProxy.cpp:
1554         (WebKit::WebPageProxy::loadDataWithNavigation):
1555         (WebKit::WebPageProxy::loadAlternateHTML):
1556         (WebKit::WebPageProxy::loadWebArchiveData):
1557         (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
1558         (WebKit::WebPageProxy::continueNavigationInNewProcess):
1559         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
1560         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
1561         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
1562         (WebKit::WebPageProxy::contentRuleListNotification):
1563         (WebKit::WebPageProxy::processDidTerminate):
1564         (WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
1565         (WebKit::WebPageProxy::setURLSchemeHandlerForScheme):
1566         * UIProcess/WebPageProxy.h:
1567         * UIProcess/WebPageProxy.messages.in:
1568         * UIProcess/WebProcessPool.cpp:
1569         (WebKit::WebProcessPool::tryPrewarmWithDomainInformation):
1570         * UIProcess/WebProcessPool.h:
1571         * UIProcess/WebProcessProxy.cpp:
1572         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
1573         * UIProcess/WebProcessProxy.h:
1574         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1575         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
1576         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
1577         * UIProcess/WebResourceLoadStatisticsStore.h:
1578         * UIProcess/ios/DragDropInteractionState.h:
1579         * UIProcess/ios/PageClientImplIOS.h:
1580         * UIProcess/ios/PageClientImplIOS.mm:
1581         (WebKit::PageClientImpl::showSafeBrowsingWarning):
1582         * UIProcess/ios/WKActionSheetAssistant.mm:
1583         (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]):
1584         * UIProcess/ios/WKContentViewInteraction.mm:
1585         (-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]):
1586         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
1587         * UIProcess/ios/WKGeolocationProviderIOS.mm:
1588         (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
1589         * UIProcess/ios/WKLegacyPDFView.mm:
1590         (-[WKLegacyPDFView actionSheetAssistant:shareElementWithURL:rect:]):
1591         * UIProcess/ios/WKPDFView.mm:
1592         (-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]):
1593         * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
1594         (-[WKFullScreenWindowController _updateLocationInfo]):
1595         * UIProcess/mac/LegacySessionStateCoding.cpp:
1596         (WebKit::decodeLegacySessionState):
1597         * UIProcess/mac/PageClientImplMac.h:
1598         * UIProcess/mac/PageClientImplMac.mm:
1599         (WebKit::PageClientImpl::showSafeBrowsingWarning):
1600         * UIProcess/mac/WKImmediateActionController.mm:
1601         (-[WKImmediateActionController _defaultAnimationController]):
1602         * UIProcess/win/WebInspectorProxyWin.cpp:
1603         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
1604         (WebKit::WebPaymentCoordinator::showPaymentUI):
1605         (WebKit::WebPaymentCoordinator::validateMerchant):
1606         * WebProcess/ApplePay/WebPaymentCoordinator.h:
1607         * WebProcess/Cache/WebCacheStorageConnection.cpp:
1608         (WebKit::WebCacheStorageConnection::doRetrieveRecords):
1609         * WebProcess/Cache/WebCacheStorageConnection.h:
1610         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
1611         (WebKit::BlobRegistryProxy::registerFileBlobURL):
1612         * WebProcess/FileAPI/BlobRegistryProxy.h:
1613         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
1614         (API::InjectedBundle::PageLoaderClient::willLoadDataRequest):
1615         (API::InjectedBundle::PageLoaderClient::userAgentForURL const):
1616         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1617         (WKBundleFrameAllowsFollowingLink):
1618         (WKBundleFrameCopySuggestedFilenameForResourceWithURL):
1619         (WKBundleFrameCopyMIMETypeForResourceWithURL):
1620         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1621         (WKBundlePageHasLocalDataForURL):
1622         * WebProcess/InjectedBundle/API/gtk/DOM/ConvertToUTF8String.cpp:
1623         (convertToUTF8String):
1624         * WebProcess/InjectedBundle/API/gtk/DOM/ConvertToUTF8String.h:
1625         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
1626         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
1627         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
1628         * WebProcess/Network/WebLoaderStrategy.cpp:
1629         (WebKit::WebLoaderStrategy::preconnectTo):
1630         * WebProcess/Network/WebLoaderStrategy.h:
1631         * WebProcess/Network/WebSocketProvider.h:
1632         * WebProcess/Network/WebSocketStream.cpp:
1633         (WebKit::WebSocketStream::WebSocketStream):
1634         * WebProcess/Network/WebSocketStream.h:
1635         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1636         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
1637         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
1638         * WebProcess/Plugins/PDF/PDFPlugin.h:
1639         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1640         (WebKit::PDFPlugin::clickedLink):
1641         * WebProcess/Plugins/Plugin.h:
1642         * WebProcess/Plugins/PluginController.h:
1643         * WebProcess/Plugins/PluginProxy.h:
1644         * WebProcess/Plugins/PluginView.cpp:
1645         (WebKit::PluginView::performURLRequest):
1646         (WebKit::PluginView::performJavaScriptURLRequest):
1647         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
1648         (WebKit::WebPluginInfoProvider::webVisiblePluginInfo):
1649         * WebProcess/Plugins/WebPluginInfoProvider.h:
1650         * WebProcess/Storage/WebSWClientConnection.h:
1651         * WebProcess/Storage/WebSWContextManagerConnection.h:
1652         * WebProcess/UserContent/WebUserContentController.h:
1653         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1654         (WebKit::WebChromeClient::signedPublicKeyAndChallengeString const):
1655         * WebProcess/WebCoreSupport/WebChromeClient.h:
1656         * WebProcess/WebCoreSupport/WebContextMenuClient.h:
1657         * WebProcess/WebCoreSupport/WebDragClient.h:
1658         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1659         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1660         (WebKit::WebFrameLoaderClient::shouldForceUniversalAccessFromLocalURL):
1661         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1662         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1663         (WebKit::WebPlatformStrategies::readURLFromPasteboard):
1664         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1665         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1666         (WebKit::WebDragClient::declareAndWriteDragImage):
1667         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
1668         * WebProcess/WebPage/VisitedLinkTableController.h:
1669         * WebProcess/WebPage/WebFrame.cpp:
1670         (WebKit::WebFrame::allowsFollowingLink const):
1671         * WebProcess/WebPage/WebFrame.h:
1672         * WebProcess/WebPage/WebPage.cpp:
1673         (WebKit::WebPage::loadURLInFrame):
1674         (WebKit::WebPage::loadData):
1675         (WebKit::WebPage::loadAlternateHTML):
1676         (WebKit::WebPage::dumpHistoryForTesting):
1677         (WebKit::WebPage::sendCSPViolationReport):
1678         (WebKit::WebPage::addUserScript):
1679         (WebKit::WebPage::addUserStyleSheet):
1680         * WebProcess/WebPage/WebPage.h:
1681         * WebProcess/WebPage/WebPage.messages.in:
1682         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
1683         (WebKit::WebPrintOperationGtk::frameURL const):
1684         * WebProcess/WebPage/gtk/WebPrintOperationGtk.h:
1685         * WebProcess/WebProcess.cpp:
1686         (WebKit::WebProcess::sendPrewarmInformation):
1687         * WebProcess/WebProcess.h:
1688         * WebProcess/cocoa/WebProcessCocoa.mm:
1689         (WebKit::activePagesOrigins):
1690
1691 2018-11-30  Per Arne Vollan  <pvollan@apple.com>
1692
1693         [macOS] Add more logging of sandbox call entries.
1694         https://bugs.webkit.org/show_bug.cgi?id=192261
1695         rdar://problem/45772445
1696
1697         Reviewed by Dean Jackson.
1698
1699         * WebProcess/com.apple.WebProcess.sb.in:
1700
1701 2018-11-30  Tim Horton  <timothy_horton@apple.com>
1702
1703         Editable images should always return some data, even if the canvas doesn't have a size yet
1704         https://bugs.webkit.org/show_bug.cgi?id=192265
1705         <rdar://problem/46385911>
1706
1707         Reviewed by Wenson Hsieh.
1708
1709         * UIProcess/ios/WKDrawingView.mm:
1710         (-[WKDrawingView layoutSubviews]):
1711         (emptyImage):
1712         (-[WKDrawingView renderedDrawing]):
1713         (-[WKDrawingView PNGRepresentation]):
1714         Some clients strongly depend on there being some data in an image, even if
1715         it's not of a usable size yet. We'll invalidate the attachment when the
1716         canvas size changes, so it will eventually settle at a usable size (after
1717         the first layer tree commit that includes the editable image).
1718
1719 2018-11-30  Don Olmstead  <don.olmstead@sony.com>
1720
1721         Rename ENABLE_SUBTLE_CRYPTO to ENABLE_WEB_CRYPTO
1722         https://bugs.webkit.org/show_bug.cgi?id=192197
1723
1724         Reviewed by Jiewen Tan.
1725
1726         * Configurations/FeatureDefines.xcconfig:
1727         * UIProcess/API/C/WKPage.cpp:
1728         (WKPageSetPageNavigationClient):
1729         * UIProcess/WebPageProxy.cpp:
1730         * UIProcess/WebPageProxy.h:
1731         * UIProcess/WebPageProxy.messages.in:
1732         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1733         * WebProcess/WebCoreSupport/WebChromeClient.h:
1734
1735 2018-11-30  Alexey Proskuryakov  <ap@apple.com>
1736
1737         Move USE_CFNETWORK_IGNORE_HSTS to its proper place
1738         https://bugs.webkit.org/show_bug.cgi?id=192173
1739
1740         Reviewed by Tim Horton.
1741
1742         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1743         (updateIgnoreStrictTransportSecuritySettingIfNecessary):
1744         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
1745         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
1746
1747 2018-11-30  Alex Christensen  <achristensen@webkit.org>
1748
1749         Remove unused WebProcessCreationParameters.uiProcessCookieStorageIdentifier
1750         https://bugs.webkit.org/show_bug.cgi?id=192157
1751
1752         Reviewed by Chris Dumez.
1753
1754         * Shared/WebProcessCreationParameters.cpp:
1755         (WebKit::WebProcessCreationParameters::encode const):
1756         (WebKit::WebProcessCreationParameters::decode):
1757         * Shared/WebProcessCreationParameters.h:
1758         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1759         (WebKit::WebProcessPool::platformInitializeWebProcess):
1760
1761 2018-11-30  Alex Christensen  <achristensen@webkit.org>
1762
1763         Remove privateBrowsingEnabled from NetworkProcessCreationParameters
1764         https://bugs.webkit.org/show_bug.cgi?id=192156
1765
1766         Reviewed by Chris Dumez.
1767
1768         * NetworkProcess/NetworkProcess.cpp:
1769         (WebKit::NetworkProcess::initializeNetworkProcess):
1770         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1771         (WebKit::NetworkProcessCreationParameters::encode const):
1772         (WebKit::NetworkProcessCreationParameters::decode):
1773         * NetworkProcess/NetworkProcessCreationParameters.h:
1774         * UIProcess/WebProcessPool.cpp:
1775         (WebKit::WebProcessPool::ensureNetworkProcess):
1776
1777 2018-11-30  Basuke Suzuki  <basuke.suzuki@sony.com>
1778
1779         [Curl] Add API for ProtectionSpace.
1780         https://bugs.webkit.org/show_bug.cgi?id=191648
1781
1782         Reviewed by Alex Christensen.
1783
1784         Added API to get certificate information from protection space.
1785
1786         * PlatformWin.cmake:
1787         * Shared/curl/WebCoreArgumentCodersCurl.cpp:
1788         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
1789         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData):
1790         * UIProcess/API/C/curl/WKProtectionSpaceCurl.cpp: Added.
1791         (WKProtectionSpaceCopyCertificateInfo):
1792         * UIProcess/API/C/curl/WKProtectionSpaceCurl.h: Added.
1793
1794 2018-11-30  David Quesada  <david_quesada@apple.com>
1795
1796         -[WKProcessPool _downloadURLRequest:] should allow specifying the initiating web view
1797         https://bugs.webkit.org/show_bug.cgi?id=192212
1798         rdar://problem/46363706
1799
1800         Reviewed by Alex Christensen.
1801
1802         * UIProcess/API/Cocoa/WKProcessPool.mm:
1803         (-[WKProcessPool _downloadURLRequest:originatingWebView:]):
1804         (-[WKProcessPool _downloadURLRequest:]): Deleted.
1805         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1806
1807 2018-11-30  Per Arne Vollan  <pvollan@apple.com>
1808
1809         Remove invalid character in sandbox introduced in r238703.
1810
1811         Unreviewed sandbox fix.
1812
1813         * WebProcess/com.apple.WebProcess.sb.in:
1814
1815 2018-11-30  Andy Estes  <aestes@apple.com>
1816
1817         [Cocoa] Add some WKA extension points
1818         https://bugs.webkit.org/show_bug.cgi?id=192131
1819         <rdar://problem/46330293>
1820
1821         Reviewed by Tim Horton.
1822
1823         * DerivedSources.make: Added an extension point for WebPreferences.yaml.
1824         * Platform/IPC/MessageSender.h:
1825         (IPC::MessageSender::sendWithAsyncReply): Send async messages via IPC::MessageSender.
1826         * Platform/cocoa/WebKitAdditions.mm: A an extension point for additional WebKit sources.
1827         * SourcesCocoa.txt: Added WebKitAdditions.mm as non-unified source.
1828         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
1829         (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Called finishConstruction.
1830         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Added an extension point for
1831         WebPaymentCoordinatorProxy.
1832         * WebKit.xcodeproj/project.pbxproj: Added WebKitAdditions.mm.
1833         * WebProcess/ApplePay/WebPaymentCoordinator.h: Added an extension point for
1834         WebPaymentCoordinator.
1835
1836 2018-11-30  Frederic Wang  <fwang@igalia.com>
1837
1838         [WebAuthN] Support CTAP HID authenticators on macOS
1839         https://bugs.webkit.org/show_bug.cgi?id=188623
1840
1841         Unreviewed build fix.
1842
1843         * UIProcess/WebAuthentication/Cocoa/HidConnection.mm: Add missing header.
1844
1845 2018-11-29  Wenson Hsieh  <wenson_hsieh@apple.com>
1846
1847         REGRESSION (r238635): Dragging a text selection within WKWebView causes the selection highlight to get into a bad state
1848         https://bugs.webkit.org/show_bug.cgi?id=192165
1849         <rdar://problem/46346682>
1850
1851         Reviewed by Daniel Bates.
1852
1853         Fixes a bug in PageClientImpl::isViewFocused. Consider the following scenario:
1854         1. WKWebView is hosted within the view hierarchy
1855         2. First responder is *not* WKContentView
1856         3. The active focus retain count is nonzero
1857
1858         Before r238635, we would return true, due to condition (3). However, after r238635, we only consider whether the
1859         first responder is WKContentView, since the web view is in the view hierarchy. This breaks scenarios where
1860         WebKit or UIKit attempts to retain focus and later restore the content view to be the first responder (an
1861         example of this is dragging a text selection between editable elements in the same web view).
1862
1863         To fix this, simply bail early and return true if focus is being retained.
1864
1865         * UIProcess/ios/PageClientImplIOS.mm:
1866         (WebKit::PageClientImpl::isViewFocused):
1867
1868 2018-11-29  Tim Horton  <timothy_horton@apple.com>
1869
1870         Inform clients when editable image attachment backing data changes
1871         https://bugs.webkit.org/show_bug.cgi?id=192206
1872         <rdar://problem/46350277>
1873
1874         Reviewed by Wenson Hsieh.
1875
1876         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
1877         (API::Attachment::invalidateGeneratedFileWrapper):
1878         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1879         * UIProcess/API/Cocoa/WKWebView.mm:
1880         (-[WKWebView _didInvalidateDataForAttachment:]):
1881         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1882         * UIProcess/Cocoa/PageClientImplCocoa.h:
1883         * UIProcess/Cocoa/PageClientImplCocoa.mm:
1884         (WebKit::PageClientImplCocoa::didInvalidateDataForAttachment):
1885         * UIProcess/PageClient.h:
1886         (WebKit::PageClient::didInvalidateDataForAttachment):
1887         * UIProcess/WebPageProxy.cpp:
1888         (WebKit::WebPageProxy::didInvalidateDataForAttachment):
1889         * UIProcess/WebPageProxy.h:
1890         Plumb file-wrapper-invalidation through from APIAttachment to WKUIDelegate.
1891
1892 2018-11-29  Eric Carlson  <eric.carlson@apple.com>
1893
1894         [MediaStream] DeviceIdHashSaltStorage should use iframe and top level documents
1895         https://bugs.webkit.org/show_bug.cgi?id=192182
1896
1897         Reviewed by Youenn Fablet.
1898
1899         * UIProcess/DeviceIdHashSaltStorage.cpp:
1900         (WebKit::DeviceIdHashSaltStorage::deviceIdHashSaltForOrigin): Key off of request and top 
1901         level documents.
1902         (WebKit::DeviceIdHashSaltStorage::deleteDeviceIdHashSaltForOrigins): Ditto.
1903         * UIProcess/DeviceIdHashSaltStorage.h:
1904         (WebKit::DeviceIdHashSaltStorage::HashSaltForOrigin::HashSaltForOrigin):
1905
1906         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1907         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Pass both documents.
1908         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Ditto.
1909         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Ditto.
1910
1911 2018-11-29  Ryan Haddad  <ryanhaddad@apple.com>
1912
1913         Unreviewed, rolling out r238713.
1914
1915         Breaks internal builds.
1916
1917         Reverted changeset:
1918
1919         "[Cocoa] Add some WKA extension points"
1920         https://bugs.webkit.org/show_bug.cgi?id=192131
1921         https://trac.webkit.org/changeset/238713
1922
1923 2018-11-29  Simon Fraser  <simon.fraser@apple.com>
1924
1925         Add an internal feature flag to enable async overflow scrolling
1926         https://bugs.webkit.org/show_bug.cgi?id=192184
1927
1928         Reviewed by Tim Horton.
1929
1930         Add a new internal feature flag that will enable async overflow-scrolling for
1931         most overflow:scroll elements. Defaults to off.
1932
1933         * Shared/WebPreferences.yaml:
1934
1935 2018-11-29  Andy Estes  <aestes@apple.com>
1936
1937         [Cocoa] Add some WKA extension points
1938         https://bugs.webkit.org/show_bug.cgi?id=192131
1939         <rdar://problem/46330293>
1940
1941         Reviewed by Tim Horton.
1942
1943         * DerivedSources.make: Added an extension point for WebPreferences.yaml.
1944         * Platform/IPC/MessageSender.h:
1945         (IPC::MessageSender::sendWithAsyncReply): Send async messages via IPC::MessageSender.
1946         * Platform/cocoa/WebKitAdditions.mm: A an extension point for additional WebKit sources.
1947         * SourcesCocoa.txt: Added WebKitAdditions.mm as non-unified source.
1948         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
1949         (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Called finishConstruction.
1950         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Added an extension point for
1951         WebPaymentCoordinatorProxy.
1952         * WebKit.xcodeproj/project.pbxproj: Added WebKitAdditions.mm.
1953         * WebProcess/ApplePay/WebPaymentCoordinator.h: Added an extension point for
1954         WebPaymentCoordinator.
1955
1956 2018-11-29  Tim Horton  <timothy_horton@apple.com>
1957
1958         Try to fix the build.
1959
1960         * Platform/spi/ios/PencilKitSPI.h:
1961
1962 2018-11-29  David Quesada  <david_quesada@apple.com>
1963
1964         Add SPI to publish NSProgress on active downloads
1965         https://bugs.webkit.org/show_bug.cgi?id=192021
1966         rdar://problem/44405661
1967
1968         Reviewed by Alex Christensen.
1969
1970         Make it possible for clients to allow other processes to monitor the state of active
1971         downloads. On Cocoa platforms, this can be done by creating an NSProgress, publishing
1972         it on an appropriate file URL (potentially a different file URL than where the download
1973         data is being written), updating properties on it as the download makes progress, and
1974         wiring up a cancellation handler that allows it to be remotely canceled. Interested
1975         clients can then subscribe to progress on that URL and receive a proxy to the progress
1976         that WebKit publishes.
1977
1978         * NetworkProcess/Downloads/Download.cpp:
1979         (WebKit::Download::~Download):
1980         (WebKit::Download::platformDestroyDownload):
1981             Add a platform-customizable hook for destructing the Download. DownloadCocoa.mm
1982             will interact with its Objective-C NSProgress instance at this point.
1983
1984         * NetworkProcess/Downloads/Download.h:
1985         * NetworkProcess/Downloads/DownloadManager.cpp:
1986         (WebKit::DownloadManager::dataTaskBecameDownloadTask):
1987             See comments for publishDownloadProgress().
1988         (WebKit::DownloadManager::publishDownloadProgress):
1989             If the provided downloadID corresponds to a non-Pending Download, hand the URL
1990             and a matching sandbox extension to the Download so it can create its progress.
1991             Otherwise, store the URL and sandbox extension on the PendingDownload to be used
1992             later when the full Download is created. When this happens, dataTaskBecameDownloadTask()
1993             will tell the PendingDownload about the Download it has become. The PendingDownload
1994             will then relay the progress URL and sandbox extension to the Download.
1995
1996         * NetworkProcess/Downloads/DownloadManager.h:
1997         * NetworkProcess/Downloads/PendingDownload.cpp:
1998         (WebKit::PendingDownload::publishProgress):
1999             Store the progress info for later use, when the proper Download is created.
2000         (WebKit::PendingDownload::didBecomeDownload):
2001             If there was a progress URL provided earlier, tell the Download corresponding to this
2002             PendingDownload to publish its progress using that URL.
2003
2004         * NetworkProcess/Downloads/PendingDownload.h:
2005         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
2006         (WebKit::Download::platformDestroyDownload):
2007             When the Download is destroyed (i.e. when the download succeeds, fails, or is canceled),
2008             unpublish the progress, since there is no longer any activity to report.
2009         (WebKit::Download::publishProgress):
2010             Resolve the sandbox extension, create a progress configured to reflect the progress of
2011             this Download's NSURLSessionDownloadTask, and publish it at the given file URL.
2012
2013         * NetworkProcess/Downloads/cocoa/WKDownloadProgress.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKDownload.h.
2014         * NetworkProcess/Downloads/cocoa/WKDownloadProgress.mm: Added.
2015         (-[WKDownloadProgress initWithDownloadTask:download:URL:sandboxExtension:]):
2016             Configure this progress, start observing properties on the download task that this
2017             progress will reflect, and connect the cancellation handler of the progress to cancel
2018             the corresponding Download.
2019         (-[WKDownloadProgress publish]):
2020         (-[WKDownloadProgress unpublish]):
2021             Override these methods to consume and revoke the sandbox extension to make sure the
2022             process has access to the progress file while the progress will be published.
2023         (-[WKDownloadProgress dealloc]):
2024         (-[WKDownloadProgress observeValueForKeyPath:ofObject:change:context:]):
2025             When either byte count (number received, or number expected to receive) of the download
2026             task changes, update this progress to reflect that.
2027
2028         * NetworkProcess/NetworkProcess.cpp:
2029         (WebKit::NetworkProcess::publishDownloadProgress):
2030         * NetworkProcess/NetworkProcess.h:
2031         * NetworkProcess/NetworkProcess.messages.in:
2032
2033         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2034         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2035             Allow looking up the services that manages published NSProgresses.
2036
2037         * UIProcess/API/Cocoa/_WKDownload.h:
2038         * UIProcess/API/Cocoa/_WKDownload.mm:
2039         (-[_WKDownload publishProgressAtURL:]):
2040         * UIProcess/Downloads/DownloadProxy.cpp:
2041         (WebKit::DownloadProxy::publishProgress):
2042         * UIProcess/Downloads/DownloadProxy.h:
2043         * WebKit.xcodeproj/project.pbxproj:
2044
2045 2018-11-29  Tim Horton  <timothy_horton@apple.com>
2046
2047         Make drawing tools available when an editable image is focused
2048         https://bugs.webkit.org/show_bug.cgi?id=192172
2049         <rdar://problem/30337960>
2050
2051         Reviewed by Dean Jackson.
2052
2053         * Platform/spi/ios/PencilKitSPI.h:
2054         Add some more SPI.
2055
2056         * Shared/AssistedNodeInformation.cpp:
2057         (WebKit::AssistedNodeInformation::encode const):
2058         (WebKit::AssistedNodeInformation::decode):
2059         * Shared/AssistedNodeInformation.h:
2060         * WebProcess/WebPage/ios/WebPageIOS.mm:
2061         (WebKit::WebPage::handleStylusSingleTapAtPoint):
2062         (WebKit::isAssistableElement):
2063         (WebKit::WebPage::getAssistedNodeInformation):
2064         Plumb the assisted node's embedded view ID, if available.
2065         Also add a new input type for drawings, and use it when appropriate.
2066
2067         * SourcesCocoa.txt:
2068         * UIProcess/API/Cocoa/_WKFocusedElementInfo.h:
2069         Add WKInputTypeDrawing.
2070
2071         * UIProcess/ios/PencilKitSoftLink.h: Added.
2072         * UIProcess/ios/PencilKitSoftLink.mm: Added.
2073         Pull soft-linking out into its own file, to fix unified sources.
2074
2075         * UIProcess/ios/WKContentViewInteraction.mm:
2076         (-[WKFocusedElementInfo initWithAssistedNodeInformation:isUserInitiated:userObject:]):
2077         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
2078         (-[WKContentView requiresAccessoryView]):
2079         Install a keyboard when a drawing is focused.
2080         Also, deduplicate one "curretUserInterfaceIdiomIsPad"; just fall through.
2081
2082         (-[WKContentView inputView]):
2083         Make a WKInkPickerControl when a drawing is focused.
2084
2085         (-[WKContentView textInputTraits]):
2086         (isAssistableInputType):
2087         * UIProcess/ios/WKDrawingView.h:
2088         * UIProcess/ios/WKDrawingView.mm:
2089         (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
2090         (-[WKDrawingView PNGRepresentation]):
2091         (-[WKDrawingView loadDrawingFromPNGRepresentation:]):
2092         Adopt PencilKitSoftLink.
2093
2094         (-[WKDrawingView canvasView]):
2095         Expose the internal canvas view for use by WKInkPickerControl.
2096
2097         * UIProcess/ios/WKInkPickerControl.h: Copied from Source/WebKit/Platform/spi/ios/PencilKitSPI.h.
2098         * UIProcess/ios/WKInkPickerControl.mm: Added.
2099         (-[WKInkPickerView initWithFrame:drawingView:]):
2100         (-[WKInkPickerView didPickInk]):
2101         (-[WKInkPickerView inlineInkPickerDidToggleRuler:]):
2102         (-[WKInkPickerView inlineInkPicker:didSelectTool:]):
2103         (-[WKInkPickerView inlineInkPicker:didSelectColor:]):
2104         (-[WKInkPickerView inkPickerSize]):
2105         (-[WKInkPickerView layoutSubviews]):
2106         (-[WKInkPickerView sizeThatFits:]):
2107         (-[WKInkPickerView viewControllerForPopoverPresentationFromInlineInkPicker:]):
2108         (-[WKInkPickerControl initWithDrawingView:]):
2109         (-[WKInkPickerControl beginEditing]):
2110         (-[WKInkPickerControl endEditing]):
2111         (-[WKInkPickerControl assistantView]):
2112         Install and hook up a PKInlineInkPicker.
2113         Center it in the keyboard.
2114         Plumb changes through to the canvas view.
2115
2116         * WebKit.xcodeproj/project.pbxproj:
2117
2118 2018-11-29  Per Arne Vollan  <pvollan@apple.com>
2119
2120         [macOS] Add logging for some sandbox entries.
2121         https://bugs.webkit.org/show_bug.cgi?id=192126
2122
2123         Reviewed by Brent Fulgham.
2124
2125         Add logging for sandbox entries which are possibly not needed.
2126
2127         * WebProcess/com.apple.WebProcess.sb.in:
2128
2129 2018-11-29  Alex Christensen  <achristensen@webkit.org>
2130
2131         Fix _WKWebsiteDataStoreConfiguration. sourceApplicationBundleIdentifier and sourceApplicationSecondaryIdentifier SPI introduced in r235127
2132         https://bugs.webkit.org/show_bug.cgi?id=192191
2133
2134         Reviewed by Andy Estes.
2135
2136         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2137         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2138         When trying to adopt the new SPI and verify it worked, I found that the strings are not copied in one place where they should be.
2139
2140 2018-11-29  Megan Gardner  <megan_gardner@apple.com>
2141
2142         Move Lookup Code for better cross platform usage
2143         https://bugs.webkit.org/show_bug.cgi?id=191732
2144
2145         Reviewed by Alex Christensen.
2146
2147         Lookup is being replaced by Reveal. This framework should work on all platforms.
2148         The patch moves the code that we expect will be needed for all platforms to the more
2149         general cocoa area. This patch changes no funcationality, and should not change
2150         anything currently. This work will be build on later when Reveal is ready to support
2151         multiple platforms.
2152
2153         * Platform/spi/ios/UIKitSPI.h:
2154         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2155         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
2156         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
2157         * UIProcess/ios/WKContentViewInteraction.h:
2158         * UIProcess/ios/WKContentViewInteraction.mm:
2159         (-[WKContentView setupInteraction]):
2160         (-[WKContentView cleanupInteraction]):
2161         (-[WKContentView _removeDefaultGestureRecognizers]):
2162         (-[WKContentView _addDefaultGestureRecognizers]):
2163         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
2164         (-[WKContentView _lookupGestureRecognized:]):
2165         * UIProcess/ios/WebPageProxyIOS.mm:
2166         (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
2167         * UIProcess/mac/WebPageProxyMac.mm:
2168         (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
2169         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): Deleted.
2170         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
2171         (WebKit::WebPage::performDictionaryLookupAtLocation):
2172         (WebKit::WebPage::performDictionaryLookupForSelection):
2173         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection):
2174         (WebKit::WebPage::performDictionaryLookupForRange):
2175         (WebKit::WebPage::dictionaryPopupInfoForRange):
2176         * WebProcess/WebPage/WebPage.messages.in:
2177         * WebProcess/WebPage/ios/WebPageIOS.mm:
2178         (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
2179         (WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
2180         (WebKit::WebPage::performDictionaryLookupForRange): Deleted.
2181         * WebProcess/WebPage/mac/WebPageMac.mm:
2182         (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
2183         (WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
2184         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Deleted.
2185         (WebKit::WebPage::dictionaryPopupInfoForRange): Deleted.
2186         (WebKit::WebPage::performDictionaryLookupForRange): Deleted.
2187
2188 2018-11-29  Zalan Bujtas  <zalan@apple.com>
2189
2190         [ContentObservation] Decouple content change and DOM timer scheduling observation
2191         https://bugs.webkit.org/show_bug.cgi?id=192170
2192
2193         Reviewed by Simon Fraser.
2194
2195         * WebProcess/WebPage/ios/WebPageIOS.mm:
2196         (WebKit::WebPage::handleSyntheticClick):
2197
2198 2018-11-29  Eric Carlson  <eric.carlson@apple.com>
2199
2200         [iOS] Tell AirPlay picker when a file has video
2201         https://bugs.webkit.org/show_bug.cgi?id=192155
2202         <rdar://problem/43843865>
2203
2204         Reviewed by Jer Noble.
2205
2206         * UIProcess/ios/WKContentViewInteraction.mm:
2207         (-[WKContentView _showPlaybackTargetPicker:fromRect:routeSharingPolicy:routingContextUID:]):
2208         Add hasVideo parameter.
2209
2210         * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
2211         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
2212         (-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:hasVideo:]): Add
2213         hasVideo parameter, pass info to MPMediaControlsViewController.
2214         (-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:]): Deleted.
2215
2216 2018-11-29  Alexey Proskuryakov  <ap@apple.com>
2217
2218         Modernize the check for kCFURLRequestContentDecoderSkipURLCheck existence
2219         https://bugs.webkit.org/show_bug.cgi?id=192041
2220
2221         Reviewed by Tim Horton.
2222
2223         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2224         (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
2225
2226 2018-11-29  Ryan Haddad  <ryanhaddad@apple.com>
2227
2228         Unreviewed, rolling out r238678.
2229
2230         Breaks internal builds.
2231
2232         Reverted changeset:
2233
2234         "Move Lookup Code for better cross platform usage"
2235         https://bugs.webkit.org/show_bug.cgi?id=191732
2236         https://trac.webkit.org/changeset/238678
2237
2238 2018-11-29  Suresh Koppisetty  <skoppisetty@apple.com>
2239
2240         Addressed a FIXME by removing an unnecessary call to [NSApplication sharedApplication].
2241         https://bugs.webkit.org/show_bug.cgi?id=192099
2242
2243         Reviewed by Geoffrey Garen.
2244
2245         [NSApplication sharedApplication] call is no longer needed in platformInitializeWebProcess as [NSApplication _accessibilityInitialize] calls [NSApplication sharedApplication].
2246
2247         * WebProcess/cocoa/WebProcessCocoa.mm:
2248         (WebKit::WebProcess::platformInitializeWebProcess):
2249
2250 2018-11-29  Megan Gardner  <megan_gardner@apple.com>
2251
2252         Move Lookup Code for better cross platform usage
2253         https://bugs.webkit.org/show_bug.cgi?id=191732
2254
2255         Reviewed by Alex Christensen.
2256
2257         Lookup is being replaced by Reveal. This framework should work on all platforms.
2258         The patch moves the code that we expect will be needed for all platforms to the more
2259         general cocoa area. This patch changes no funcationality, and should not change
2260         anything currently. This work will be build on later when Reveal is ready to support
2261         multiple platforms.
2262
2263         * Platform/spi/ios/UIKitSPI.h:
2264         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2265         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
2266         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
2267         * UIProcess/ios/WKContentViewInteraction.h:
2268         * UIProcess/ios/WKContentViewInteraction.mm:
2269         (-[WKContentView setupInteraction]):
2270         (-[WKContentView cleanupInteraction]):
2271         (-[WKContentView _removeDefaultGestureRecognizers]):
2272         (-[WKContentView _addDefaultGestureRecognizers]):
2273         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
2274         (-[WKContentView _lookupGestureRecognized:]):
2275         * UIProcess/ios/WebPageProxyIOS.mm:
2276         (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
2277         * UIProcess/mac/WebPageProxyMac.mm:
2278         (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
2279         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): Deleted.
2280         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
2281         (WebKit::WebPage::performDictionaryLookupAtLocation):
2282         (WebKit::WebPage::performDictionaryLookupForSelection):
2283         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection):
2284         (WebKit::WebPage::performDictionaryLookupForRange):
2285         (WebKit::WebPage::dictionaryPopupInfoForRange):
2286         * WebProcess/WebPage/WebPage.messages.in:
2287         * WebProcess/WebPage/ios/WebPageIOS.mm:
2288         (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
2289         (WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
2290         (WebKit::WebPage::performDictionaryLookupForRange): Deleted.
2291         * WebProcess/WebPage/mac/WebPageMac.mm:
2292         (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
2293         (WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
2294         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Deleted.
2295         (WebKit::WebPage::dictionaryPopupInfoForRange): Deleted.
2296         (WebKit::WebPage::performDictionaryLookupForRange): Deleted.
2297
2298 2018-11-29  Conrad Shultz  <conrad_shultz@apple.com>
2299
2300         Factor out configuration of the file upload image picker
2301         https://bugs.webkit.org/show_bug.cgi?id=192138
2302         <rdar://problem/46334871>
2303
2304         Reviewed by Tim Horton.
2305
2306         By factoring configuration of the picker into its own method, it makes it easier
2307         to apply custom configuration in subclasses in the future.
2308
2309         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2310         (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
2311         (-[WKFileUploadPanel _configureImagePicker:]):
2312
2313 2018-11-29  Tomas Popela  <tpopela@redhat.com>
2314
2315         [GTK][WPE] Fix BubblewrapLauncher clang warnings
2316         https://bugs.webkit.org/show_bug.cgi?id=192086
2317
2318         Reviewed by Michael Catanzaro.
2319
2320         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
2321         (WebKit::bindPathVar): Initialize the i variable to 0.
2322         (WebKit::setupSeccomp): Initialize the optional datum_b member.
2323
2324 2018-11-28  Joseph Pecoraro  <pecoraro@apple.com>
2325
2326         Web Inspector: REGRESSION(?): all "Show *" develop menu items cause the page to crash
2327         https://bugs.webkit.org/show_bug.cgi?id=192016
2328         <rdar://problem/46284417>
2329
2330         Reviewed by Devin Rousso.
2331
2332         Previously calling the Page's inspectorController.show()
2333         would create a frontend connection on the WebProcess side.
2334         However now the frontend connection is handed to the WebProcess
2335         once the UIProcess creates it. So queue actions that take place
2336         immediately after showing the inspector until we have a frontend
2337         to send the actions to.
2338
2339         * WebProcess/WebPage/WebInspector.h:
2340         * WebProcess/WebPage/WebInspector.cpp:
2341         (WebKit::WebInspector::setFrontendConnection):
2342         (WebKit::WebInspector::closeFrontendConnection):
2343         (WebKit::WebInspector::whenFrontendConnectionEstablished):
2344         (WebKit::WebInspector::showConsole):
2345         (WebKit::WebInspector::showResources):
2346         (WebKit::WebInspector::showTimelines):
2347         (WebKit::WebInspector::showMainResourceForFrame):
2348         (WebKit::WebInspector::startPageProfiling):
2349         (WebKit::WebInspector::stopPageProfiling):
2350         (WebKit::WebInspector::startElementSelection):
2351         (WebKit::WebInspector::stopElementSelection):
2352
2353 2018-11-28  Vivek Seth  <v_seth@apple.com>
2354
2355         Consult dummy storage for HTTPS Upgrade, Apply If Appropriate
2356         https://bugs.webkit.org/show_bug.cgi?id=192094
2357         <rdar://problem/45851103> HTTPS Upgrade: Consult dummy storage for HTTPS Upgrade, Apply If Appropriate
2358
2359         Reviewed by Chris Dumez.
2360
2361         For main page loads upgrade HTTP requests to HTTPS if the hostname belongs to a set of upgradable hostnames.
2362
2363         * NetworkProcess/NetworkLoadChecker.cpp:
2364         (WebKit::NetworkLoadChecker::applyHTTPSUpgradeIfNeeded):
2365         (WebKit::NetworkLoadChecker::checkRequest):
2366         * NetworkProcess/NetworkLoadChecker.h:
2367         * NetworkProcess/NetworkResourceLoader.cpp:
2368         (WebKit::NetworkResourceLoader::start):
2369
2370 2018-11-28  Simon Fraser  <simon.fraser@apple.com>
2371
2372         REGRESSION (r234980): Crash in -[WKWebView _restorePageStateToUnobscuredCenter:scale:]
2373         https://bugs.webkit.org/show_bug.cgi?id=192127
2374         rdar://problem/44194179
2375
2376         Reviewed by Tim Horton.
2377         
2378         _restorePageStateToUnobscuredCenter: could receive an Optional<FloatRect> from the
2379         web process, and unconditionally called .value() even though it may not be engaged.
2380         
2381         No repro steps known, so no testcase.
2382
2383         * UIProcess/API/Cocoa/WKWebView.mm:
2384         (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
2385
2386 2018-11-28  Commit Queue  <commit-queue@webkit.org>
2387
2388         Unreviewed, rolling out r238653 and r238656.
2389         https://bugs.webkit.org/show_bug.cgi?id=192130
2390
2391         Breaks iOS build (Requested by smfr on #webkit).
2392
2393         Reverted changesets:
2394
2395         "Move Lookup Code for better cross platform usage"
2396         https://bugs.webkit.org/show_bug.cgi?id=191732
2397         https://trac.webkit.org/changeset/238653
2398
2399         "Attempt to fix the iOS build by only including RevealSPI.h
2400         when it's needed."
2401         https://trac.webkit.org/changeset/238656
2402
2403 2018-11-28  Alex Christensen  <achristensen@webkit.org>
2404
2405         Modernize BlobRegistry::writeBlobsToTemporaryFiles
2406         https://bugs.webkit.org/show_bug.cgi?id=192117
2407
2408         Reviewed by Dean Jackson.
2409
2410         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2411         (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
2412         (WebKit::NetworkBlobRegistry::writeBlobToFilePath):
2413         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
2414         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2415         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
2416         * NetworkProcess/NetworkConnectionToWebProcess.h:
2417         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2418         * NetworkProcess/NetworkProcess.cpp:
2419         (WebKit::NetworkProcess::writeBlobToFilePath):
2420         * NetworkProcess/NetworkProcess.h:
2421         * NetworkProcess/NetworkProcess.messages.in:
2422         * UIProcess/ChildProcessProxy.h:
2423         (WebKit::ChildProcessProxy::sendWithAsyncReply):
2424         * UIProcess/Network/NetworkProcessProxy.cpp:
2425         (WebKit::NetworkProcessProxy::didClose):
2426         (WebKit::NetworkProcessProxy::writeBlobToFilePath):
2427         (WebKit::NetworkProcessProxy::didWriteBlobToFilePath): Deleted.
2428         * UIProcess/Network/NetworkProcessProxy.h:
2429         * UIProcess/Network/NetworkProcessProxy.messages.in:
2430         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
2431         (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
2432         * WebProcess/FileAPI/BlobRegistryProxy.h:
2433         * WebProcess/Network/NetworkProcessConnection.cpp:
2434         (WebKit::NetworkProcessConnection::didClose):
2435         (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
2436         (WebKit::NetworkProcessConnection::didWriteBlobsToTemporaryFiles): Deleted.
2437         * WebProcess/Network/NetworkProcessConnection.h:
2438         * WebProcess/Network/NetworkProcessConnection.messages.in:
2439
2440 2018-11-28  Alex Christensen  <achristensen@webkit.org>
2441
2442         Move loadThrottleLatency from NetworkProcessCreationParameters to NetworkSessionCreationParameters
2443         https://bugs.webkit.org/show_bug.cgi?id=192122
2444
2445         Reviewed by Dean Jackson.
2446
2447         This is part of an effort to reduce global variables in the NetworkProcess.
2448
2449         * NetworkProcess/NetworkLoad.cpp:
2450         (WebKit::NetworkLoad::NetworkLoad):
2451         (WebKit::NetworkLoad::didReceiveResponse):
2452         * NetworkProcess/NetworkLoad.h:
2453         * NetworkProcess/NetworkProcess.cpp:
2454         (WebKit::NetworkProcess::initializeNetworkProcess):
2455         * NetworkProcess/NetworkProcess.h:
2456         (WebKit::NetworkProcess::loadThrottleLatency const): Deleted.
2457         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2458         (WebKit::NetworkProcessCreationParameters::encode const):
2459         (WebKit::NetworkProcessCreationParameters::decode):
2460         * NetworkProcess/NetworkSession.h:
2461         (WebKit::NetworkSession::loadThrottleLatency const):
2462         * NetworkProcess/NetworkSessionCreationParameters.cpp: Added.
2463         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
2464         (WebKit::NetworkSessionCreationParameters::encode const):
2465         (WebKit::NetworkSessionCreationParameters::decode):
2466         * NetworkProcess/NetworkSessionCreationParameters.h:
2467         (WebKit::NetworkSessionCreationParameters::encode const): Deleted.
2468         (WebKit::NetworkSessionCreationParameters::decode): Deleted.
2469         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
2470         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2471         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2472         * Shared/WebsiteDataStoreParameters.cpp:
2473         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
2474         * Sources.txt:
2475         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2476         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2477         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2478         (WebKit::WebsiteDataStore::parameters):
2479         * WebKit.xcodeproj/project.pbxproj:
2480
2481 2018-11-15  Megan Gardner  <megan_gardner@apple.com>
2482
2483         Move Lookup Code for better cross platform usage
2484         https://bugs.webkit.org/show_bug.cgi?id=191732
2485
2486         Reviewed by Alex Christensen.
2487
2488         Lookup is being replaced by Reveal. This framework should work on all platforms.
2489         The patch moves the code that we expect will be needed for all platforms to the more
2490         general cocoa area. This patch changes no funcationality, and should not change
2491         anything currently. This work will be build on later when Reveal is ready to support
2492         multiple platforms.
2493
2494         * Platform/spi/ios/UIKitSPI.h:
2495         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2496         (WebKit::WebPageProxy::performDictionaryLookupAtLocation):
2497         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection):
2498         * UIProcess/ios/WKContentViewInteraction.h:
2499         * UIProcess/ios/WKContentViewInteraction.mm:
2500         (-[WKContentView setupInteraction]):
2501         (-[WKContentView cleanupInteraction]):
2502         (-[WKContentView _removeDefaultGestureRecognizers]):
2503         (-[WKContentView _addDefaultGestureRecognizers]):
2504         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
2505         (-[WKContentView _lookupGestureRecognized:]):
2506         * UIProcess/ios/WebPageProxyIOS.mm:
2507         (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
2508         * UIProcess/mac/WebPageProxyMac.mm:
2509         (WebKit::WebPageProxy::performDictionaryLookupAtLocation): Deleted.
2510         (WebKit::WebPageProxy::performDictionaryLookupOfCurrentSelection): Deleted.
2511         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
2512         (WebKit::WebPage::performDictionaryLookupAtLocation):
2513         (WebKit::WebPage::performDictionaryLookupForSelection):
2514         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection):
2515         (WebKit::WebPage::performDictionaryLookupForRange):
2516         (WebKit::WebPage::dictionaryPopupInfoForRange):
2517         * WebProcess/WebPage/WebPage.messages.in:
2518         * WebProcess/WebPage/ios/WebPageIOS.mm:
2519         (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
2520         (WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
2521         (WebKit::WebPage::performDictionaryLookupForRange): Deleted.
2522         * WebProcess/WebPage/mac/WebPageMac.mm:
2523         (WebKit::WebPage::performDictionaryLookupAtLocation): Deleted.
2524         (WebKit::WebPage::performDictionaryLookupForSelection): Deleted.
2525         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Deleted.
2526         (WebKit::WebPage::dictionaryPopupInfoForRange): Deleted.
2527         (WebKit::WebPage::performDictionaryLookupForRange): Deleted.
2528
2529 2018-11-28  Keith Rollin  <krollin@apple.com>
2530
2531         Update generate-{derived,unified}-sources scripts to support generating .xcfilelist files
2532         https://bugs.webkit.org/show_bug.cgi?id=192031
2533         <rdar://problem/46286816>
2534
2535         Reviewed by Alex Christensen.
2536
2537         The Generate Derived Sources and Generate Unified Sources build phases
2538         in Xcode need to have their inputs and outputs specified. This
2539         specification will come in the form of .xcfilelist files that will be
2540         attached to these build phases. There is one .xcfilelist file that
2541         lists the input file and one that lists the output files. As part of
2542         this work, the various generate-{derived,unified}-sources scripts that
2543         are executed in these Generate build phases are modified to help in
2544         the creation of these .xcfilelist files. In particular, they can now
2545         be invoked with command-line parameters. These parameters are then
2546         used to alter the normal execution of these scripts, causing them to
2547         produce the .xcfilelist files as opposed to actually generating the
2548         files that are listed in those files.
2549
2550         * Scripts/generate-derived-sources.sh:
2551         * Scripts/generate-unified-sources.sh:
2552
2553 2018-11-28  Keith Rollin  <krollin@apple.com>
2554
2555         Revert print_all_generated_files work in r238008; tighten up target specifications
2556         https://bugs.webkit.org/show_bug.cgi?id=192025
2557         <rdar://problem/46284301>
2558
2559         Reviewed by Alex Christensen.
2560
2561         In r238008, I added a facility for DerivedSources.make makefiles to
2562         print out the list of files that they generate. This output was used
2563         in the generation of .xcfilelist files used to specify the output of
2564         the associated Generate Derived Sources build phases in Xcode. This
2565         approach worked, but it meant that people would need to follow a
2566         specific convention to keep this mechanism working.
2567
2568         Instead of continuing this approach, I'm going to implement a new
2569         facility based on the output of `make` when passed the -d flag (which
2570         prints dependency information). This new mechanism is completely
2571         automatic and doesn't need maintainers to follow a convention. To that
2572         end, remove most of the work performed in r238008 that supports the
2573         print_all_generated_files target.
2574
2575         At the same time, it's important for the sets of targets and their
2576         dependencies to be complete and correct. Therefore, also include
2577         changes to bring those up-to-date. As part of that, you'll see
2578         prevalent use of a particular technique. Here's an example:
2579
2580             BYTECODE_FILES = \
2581                 Bytecodes.h \
2582                 BytecodeIndices.h \
2583                 BytecodeStructs.h \
2584                 InitBytecodes.asm \
2585             #
2586             BYTECODE_FILES_PATTERNS = $(subst .,%,$(BYTECODE_FILES))
2587
2588             all : $(BYTECODE_FILES)
2589
2590             $(BYTECODE_FILES_PATTERNS): $(wildcard $(JavaScriptCore)/generator/*.rb) $(JavaScriptCore)/bytecode/BytecodeList.rb
2591                 ...
2592
2593         These lines indicate a set of generated files (those specified in
2594         BYTECODE_FILES). These files are generated by the BytecodeList.rb
2595         tool. But, as opposed to the normal rule where a single foo.output is
2596         generated by foo.input plus some additional dependencies, this rule
2597         produces multiple output files from a tool whose connection to the
2598         output files is not immediately clear. A special approach is needed
2599         where a single rule produces multiple output files. The normal way to
2600         implement this is to use an .INTERMEDIATE target. However, we used
2601         this approach in the past and ran into a problem with it, addressing
2602         it with an alternate approach in r210507. The above example shows this
2603         approach. The .'s in the list of target files are replaced with %'s,
2604         and the result is used as the left side of the dependency rule.
2605
2606         * DerivedSources.make:
2607
2608 2018-11-28  Daniel Bates  <dabates@apple.com>
2609
2610         [iOS] Page not defocused when Find-in-page becomes first responder
2611         https://bugs.webkit.org/show_bug.cgi?id=192084
2612         <rdar://problem/46146777>
2613
2614         Reviewed by Tim Horton.
2615
2616         When -becomeFirstResponder and -resignFirstResponder is called the page should become focused
2617         and defocused, respectively. WebKit adjusts it behavior depending on whether it knows it has
2618         focus. This includes decisions about whether to allow an element to be focused. We need to
2619         ensure that WebKit knows whether the web view is focused for it to make good decisions.
2620
2621         * UIProcess/ios/PageClientImplIOS.mm:
2622         (WebKit::PageClientImpl::isViewFocused): Check if the content view is the first responder and
2623         hence is accepting keyboard input. Note that picture-in-picture views do not accept keyboard
2624         input.
2625         * UIProcess/ios/WKContentViewInteraction.mm:
2626         (-[WKContentView becomeFirstResponderForWebView]): Update activity state when the view
2627         becomes focused.
2628         (-[WKContentView resignFirstResponderForWebView]): Update activity state when the view
2629         becomes defocused.
2630
2631 2018-11-28  Alex Christensen  <achristensen@webkit.org>
2632
2633         Remove dead code from an earlier attempt at implementing safe browsing
2634         https://bugs.webkit.org/show_bug.cgi?id=192067
2635
2636         Reviewed by Chris Dumez.
2637
2638         * Shared/LoadParameters.cpp:
2639         (WebKit::LoadParameters::encode const):
2640         (WebKit::LoadParameters::decode):
2641         * Shared/LoadParameters.h:
2642         * UIProcess/WebPageProxy.cpp:
2643         (WebKit::WebPageProxy::loadAlternateHTML):
2644         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
2645         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2646         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
2647         * UIProcess/WebPageProxy.h:
2648         * UIProcess/WebPageProxy.messages.in:
2649         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2650         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2651         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2652
2653 2018-11-28  Alex Christensen  <achristensen@webkit.org>
2654
2655         Move logCookieInformation bool from NetworkProcess to NetworkSession
2656         https://bugs.webkit.org/show_bug.cgi?id=192049
2657
2658         Reviewed by Chris Dumez.
2659
2660         Part of an effort to remove globals in the NetworkProcess.
2661
2662         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2663         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
2664         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
2665         * NetworkProcess/NetworkProcess.cpp:
2666         (WebKit::NetworkProcess::initializeNetworkProcess):
2667         * NetworkProcess/NetworkProcess.h:
2668         (WebKit::NetworkProcess::shouldLogCookieInformation const): Deleted.
2669         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2670         (WebKit::NetworkProcessCreationParameters::encode const):
2671         (WebKit::NetworkProcessCreationParameters::decode):
2672         * NetworkProcess/NetworkProcessCreationParameters.h:
2673         * NetworkProcess/NetworkResourceLoader.cpp:
2674         (WebKit::NetworkResourceLoader::didFinishLoading):
2675         (WebKit::NetworkResourceLoader::sendResultForCacheEntry):
2676         (WebKit::NetworkResourceLoader::shouldLogCookieInformation):
2677         (WebKit::NetworkResourceLoader::logCookieInformation const):
2678         (WebKit::logBlockedCookieInformation):
2679         (WebKit::logCookieInformationInternal):
2680         (WebKit::NetworkResourceLoader::logCookieInformation):
2681         * NetworkProcess/NetworkResourceLoader.h:
2682         * NetworkProcess/NetworkSession.h:
2683         (WebKit::NetworkSession::logCookieInformation const):
2684         * NetworkProcess/NetworkSessionCreationParameters.h:
2685         (WebKit::NetworkSessionCreationParameters::encode const):
2686         (WebKit::NetworkSessionCreationParameters::decode):
2687         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2688         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
2689         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
2690         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
2691         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2692         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2693         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2694         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2695         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2696         (WebKit::WebsiteDataStore::parameters):
2697
2698 2018-11-28  Ryan Haddad  <ryanhaddad@apple.com>
2699
2700         Unreviewed, rolling out r238620.
2701
2702         Broke internal builds again.
2703
2704         Reverted changeset:
2705
2706         "Remove @no-unify of InjectedBundleRangeHandle.cpp and
2707         InjectedBundleNodeHandle.cpp"
2708         https://bugs.webkit.org/show_bug.cgi?id=191853
2709         https://trac.webkit.org/changeset/238620
2710
2711 2018-11-28  Yongjun Zhang  <yongjun_zhang@apple.com>
2712
2713         Allow WebKit clients to specify a minimum effective width for layout.
2714         https://bugs.webkit.org/show_bug.cgi?id=191499
2715         <rdar://problem/45362678>
2716
2717         Reviewed by Wenson Hsieh.
2718
2719         If we ignore the meta viewport (_shouldIgnoreMetaViewport is true), the default layout width will be device
2720         width. For clients that wish to lay out the content with a different width value, we would need to add a way
2721         to specify the effective width for layout.
2722
2723         * UIProcess/API/Cocoa/WKWebView.mm: Add an iVar _minimumEffectiveDeviceWidth.
2724         (-[WKWebView _dispatchSetViewLayoutSize:]): Call the new setViewportConfigurationViewLayoutSize method.
2725         (-[WKWebView _setViewScale:]): Ditto.
2726         (-[WKWebView _setMinimumEffectiveWidth:]): The setter for _minimumEffectiveDeviceWidth.
2727         (-[WKWebView _minimumEffectiveWidth]): Getter for _minimumEffectiveDeviceWidth
2728         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add a property _minimumEffectiveDeviceWidth to WKWebView.
2729         * UIProcess/WebPageProxy.h: Change setViewportConfigurationViewLayoutSize to take another argument minimumEffectiveDeviceWidth.
2730         * UIProcess/ios/WebPageProxyIOS.mm:
2731         (WebKit::WebPageProxy::setViewportConfigurationViewLayoutSize): Also send effectiveWidth to WebContent process.
2732         * WebProcess/WebPage/WebPage.cpp:
2733         (WebKit::WebPage::WebPage): Set the initial effective width to 0 when creating a web page, this tells ViewportConfiguration
2734              to ignore the minimum effective width value.
2735         * WebProcess/WebPage/WebPage.h: Change setViewportConfigurationViewLayoutSize to take another argument effectiveWidth.
2736         * WebProcess/WebPage/WebPage.messages.in:
2737         * WebProcess/WebPage/ios/WebPageIOS.mm:
2738         (WebKit::WebPage::setViewportConfigurationViewLayoutSize): Also pass effectiveWidth value to ViewportConfiguration.
2739
2740 2018-11-28  Fujii Hironori  <Hironori.Fujii@sony.com>
2741
2742         Remove @no-unify of InjectedBundleRangeHandle.cpp and InjectedBundleNodeHandle.cpp
2743         https://bugs.webkit.org/show_bug.cgi?id=191853
2744
2745         Reviewed by Michael Catanzaro.
2746
2747         In r235845, I excluded InjectedBundleRangeHandle.cpp and
2748         InjectedBundleNodeHandle.cpp from unify source builds in order to
2749         work around a MSVC bug.
2750
2751         Then, I commited a different workaround for the MSVC bug in
2752         r238386. Now, we can include InjectedBundleRangeHandle.cpp and
2753         InjectedBundleNodeHandle.cpp in unified source builds. Revert
2754         r235845.
2755
2756         * Sources.txt: Removed @no-unify of InjectedBundleRangeHandle.cpp
2757         and InjectedBundleNodeHandle.cpp
2758         * WebKit.xcodeproj/project.pbxproj: Unchecked Target Membership
2759         not to be compiled by XCode.
2760
2761 2018-11-28  Joseph Pecoraro  <pecoraro@apple.com>
2762
2763         Web Inspector: REGRESSION(r238378): reloading WebInspector after a settings change doesn't re-show WebInspector
2764         https://bugs.webkit.org/show_bug.cgi?id=191971
2765
2766         Reviewed by Matt Baker.
2767
2768         * WebProcess/WebPage/WebInspector.cpp:
2769         (WebKit::WebInspector::reopen): Deleted.
2770         * WebProcess/WebPage/WebInspector.h:
2771         * WebProcess/WebPage/WebInspector.messages.in:
2772         Move reopen out of the WebProcess...
2773
2774         * UIProcess/WebInspectorProxy.cpp:
2775         (WebKit::WebInspectorProxy::reopen):
2776         * UIProcess/WebInspectorProxy.h:
2777         * UIProcess/WebInspectorProxy.messages.in:
2778         And into the UIProcess where the order of messages won't
2779         be as problematic.
2780
2781         * WebProcess/WebPage/WebInspectorUI.cpp:
2782         (WebKit::WebInspectorUI::reopen):
2783         Send a message to the WebInspectorProxy instead.
2784
2785 2018-11-28  Alexey Proskuryakov  <ap@apple.com>
2786
2787         Remove another OS version check from NetworkDataTaskCocoa.mm
2788         https://bugs.webkit.org/show_bug.cgi?id=192046
2789
2790         Reviewed by Alex Christensen.
2791
2792         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2793         (WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
2794
2795 2018-11-28  Alexey Proskuryakov  <ap@apple.com>
2796
2797         Modernize version checks for same site cookie support
2798         https://bugs.webkit.org/show_bug.cgi?id=192054
2799
2800         Reviewed by Tim Horton.
2801
2802         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::updateTaskWithFirstPartyForSameSiteCookies):
2803         Also removed runtime checks, which are no longer relevant.
2804
2805 2018-11-27  Mark Lam  <mark.lam@apple.com>
2806
2807         ENABLE_FAST_JIT_PERMISSIONS should be false for iosmac.
2808         https://bugs.webkit.org/show_bug.cgi?id=192055
2809         <rdar://problem/46288783>
2810
2811         Reviewed by Saam Barati.
2812
2813         * Configurations/FeatureDefines.xcconfig:
2814
2815 2018-11-27  Alex Christensen  <achristensen@webkit.org>
2816
2817         Make synchronous IPC introduced in r237267 asynchronous
2818         https://bugs.webkit.org/show_bug.cgi?id=190757
2819
2820         Reviewed by Chris Dumez.
2821
2822         * UIProcess/API/Cocoa/WKProcessPool.mm:
2823         (-[WKProcessPool _getActivePagesOriginsInWebProcessForTesting:completionHandler:]):
2824         (-[WKProcessPool _getActivePagesOriginsInWebProcessForTesting:]): Deleted.
2825         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2826         * UIProcess/WebProcessPool.cpp:
2827         (WebKit::WebProcessPool::activePagesOriginsInWebProcessForTesting):
2828         * UIProcess/WebProcessPool.h:
2829         * UIProcess/WebProcessProxy.cpp:
2830         (WebKit::WebProcessProxy::activePagesDomainsForTesting):
2831         * UIProcess/WebProcessProxy.h:
2832         * WebProcess/WebProcess.cpp:
2833         (WebKit::WebProcess::getActivePagesOriginsForTesting):
2834         * WebProcess/WebProcess.messages.in:
2835         * WebProcess/cocoa/WebProcessCocoa.mm:
2836         (WebKit::WebProcess::getActivePagesOriginsForTesting):
2837
2838 2018-11-27  Alex Christensen  <achristensen@webkit.org>
2839
2840         Safe browsing warning text needs to be visible on High Sierra
2841         https://bugs.webkit.org/show_bug.cgi?id=192022
2842
2843         Reviewed by Tim Horton.
2844
2845         Something about AppKit, autolayout, view insertion order, and NSTextView makes the text lay
2846         out with initial size of {0, 0} on High Sierra. Using an NSTextField instead makes the details visible.
2847
2848         Covered by an API test.
2849
2850         * UIProcess/Cocoa/WKSafeBrowsingWarning.h:
2851         * UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
2852         (makeLabel):
2853         (-[WKSafeBrowsingWarning addContent]):
2854         (-[WKSafeBrowsingWarning showDetailsClicked]):
2855         (-[WKSafeBrowsingWarning layoutText]):
2856         (makeTitleLabel): Deleted.
2857
2858 2018-11-27  Tim Horton  <timothy_horton@apple.com>
2859
2860         WKNavigation.AutomaticViewReloadAfterWebProcessCrash asserts after r238538
2861         https://bugs.webkit.org/show_bug.cgi?id=192038
2862         <rdar://problem/46288457>
2863
2864         Reviewed by Wenson Hsieh.
2865
2866         * UIProcess/WebPageProxy.cpp:
2867         (WebKit::m_resetRecentCrashCountTimer):
2868         (WebKit::WebPageProxy::finishAttachingToWebProcess):
2869         (WebKit::WebPageProxy::resetState):
2870         (WebKit::m_editableImageController): Deleted.
2871         Properly invalidate m_editableImageController when resetting WebPageProxy.
2872         Otherwise, the MessageReceiverMaps get invalidated, then later when
2873         EditableImageController goes away we assert trying to remove the receiver.
2874
2875 2018-11-27  Jiewen Tan  <jiewen_tan@apple.com>
2876
2877         (r238246) [ MacOS Debug ] Layout Test http/wpt/webauthn/ctap-hid-failure.https.html is Crashing
2878         https://bugs.webkit.org/show_bug.cgi?id=191757
2879
2880         Reviewed by Chris Dumez.
2881
2882         Wrong nonce error causes retransmission, which then trigger wrong nonce error. This is expected
2883         behavior for mock testing. However, the main thread could time out when MockHidConnection::send
2884         is excuting the block on another thread. The block will then return without invoking the callback,
2885         which triggers this WTFCrash. The solution is always invoking the callback before return in the
2886         block.
2887
2888         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
2889         (WebKit::MockHidConnection::send):
2890
2891 2018-11-27  Keith Rollin  <krollin@apple.com>
2892
2893         Better parsing of comments in generate-message*.py
2894         https://bugs.webkit.org/show_bug.cgi?id=191866
2895         <rdar://problem/46189563>
2896
2897         Reviewed by Chris Dumez.
2898
2899         The script parsing the *.messages.in files would treat a line starting
2900         with '#' as a comment, but not a line starting with '<whitespace>#'.
2901         This means that jamming a '#' right in front of the first character of
2902         a message definition (as opposed to the beginning of a line) will have
2903         no effect and the line will get treated just the same as a
2904         non-commented line. Fix this by trimming all white space from the
2905         beginning and ending of the line before processing it.
2906
2907         * Scripts/webkit/parser.py:
2908         (parse):
2909         * Scripts/webkit/test-messages.in:
2910
2911 2018-11-27  Thibault Saunier  <tsaunier@igalia.com>
2912
2913         [GTK|WPE] Allow disabling WebRTC unified plan SDP through an env var
2914         https://bugs.webkit.org/show_bug.cgi?id=192024
2915
2916         Reviewed by Michael Catanzaro.
2917
2918         * UIProcess/API/glib/WebKitSettings.cpp:
2919         (webKitSettingsConstructed):
2920
2921 2018-11-27  Alexey Proskuryakov  <ap@apple.com>
2922
2923         Modernize the check for async _saveCookies existence
2924         https://bugs.webkit.org/show_bug.cgi?id=191987
2925
2926         Reviewed by Dean Jackson.
2927
2928         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2929         (WebKit::NetworkProcess::platformSyncAllCookies):
2930
2931 2018-11-27  Tim Horton  <timothy_horton@apple.com>
2932
2933         Serialize and deserialize editable image strokes
2934         https://bugs.webkit.org/show_bug.cgi?id=192002
2935         <rdar://problem/30900149>
2936
2937         Reviewed by Dean Jackson.
2938
2939         * UIProcess/API/APIAttachment.cpp:
2940         (API::Attachment::updateAttributes):
2941         * UIProcess/WebPageProxy.cpp:
2942         (WebKit::WebPageProxy::willUpdateAttachmentAttributes):
2943         * UIProcess/WebPageProxy.h:
2944         When an attachment would update its DOM attributes, plumb a notification
2945         to EditableImageController, and allow it to block the update (because
2946         we don't really want to set src for editable image attachments,
2947         we just want the UI process to fully own the data).
2948
2949         * Platform/spi/ios/PencilKitSPI.h:
2950         Add some SPI.
2951
2952         * UIProcess/ios/EditableImageController.h:
2953         * UIProcess/ios/EditableImageController.mm:
2954         (WebKit::EditableImageController::loadStrokesFromAttachment):
2955         Add a helper to load strokes from an attachment.
2956
2957         (WebKit::EditableImageController::associateWithAttachment):
2958         Try to load strokes from the attachment when initially associated.
2959         Don't create a file wrapper around a null image, so it will be regenerated later.
2960
2961         (WebKit::EditableImageController::willUpdateAttachmentAttributes):
2962         The aforementioned plumbing at update time.
2963
2964         * UIProcess/ios/WKDrawingView.h:
2965         * UIProcess/ios/WKDrawingView.mm:
2966         (-[WKDrawingView layoutSubviews]):
2967         Invalidate the attachment (so it will be regenerated upon request) if the
2968         canvas size changes.
2969
2970         (-[WKDrawingView PNGRepresentation]):
2971         Serialize strokes into the EXIF User Comment field.
2972         We will find a different field to use (ideally a custom vendor-specific
2973         field that nobody else will use for anything), but this works for now.
2974
2975         Don't try to render an image if we don't have a size or scale;
2976         PKImageRenderer will just fail anyway, so bail early.
2977
2978         In the iOS Simulator, PKImageRenderer currently returns an unusable image.
2979         Instead, so that we have a image on which to serialize the strokes,
2980         create a transparent 1x1 image. This makes it possible to serialize strokes
2981         even though we don't have a usable rendered image, so that we can still test
2982         this change (and future changes).
2983
2984         (-[WKDrawingView loadDrawingFromPNGRepresentation:]):
2985         If available, deserialize strokes from the EXIF User Comment field.
2986
2987         (-[WKDrawingView drawingDidChange:]):
2988         (-[WKDrawingView invalidateAttachment]):
2989         Factor invalidateAttachment out of drawingDidChange so we can call
2990         it from layoutSubviews too!
2991
2992 2018-11-27  Chris Dumez  <cdumez@apple.com>
2993
2994         Regression(PSON) crash under WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame()
2995         https://bugs.webkit.org/show_bug.cgi?id=191983
2996         <rdar://problem/46246863>
2997
2998         Reviewed by Geoffrey Garen.
2999
3000         * UIProcess/WebPageProxy.cpp:
3001         (WebKit::WebPageProxy::continueNavigationInNewProcess):
3002         Make sure the navigation still exists in m_mainFrameCreationHandler and return early if it
3003         does not.
3004
3005         (WebKit::WebPageProxy::resetState):
3006         Clear out m_mainFrameCreationHandler / m_mainFrameWindowCreationHandler if we resetting the state
3007         after a crash. At this point, there is no chance the WebProcess will send us the IPC that will
3008         cause these to get called and we do not want old state to remain for future navigations.
3009
3010 2018-11-16  Jiewen Tan  <jiewen_tan@apple.com>
3011
3012         Disallow loading webarchives as iframes
3013         https://bugs.webkit.org/show_bug.cgi?id=191728
3014         <rdar://problem/45524528>
3015
3016         Reviewed by Youenn Fablet.
3017
3018         * UIProcess/WebPageProxy.cpp:
3019         (WebKit::WebPageProxy::unableToImplementPolicy):
3020         Add a check to prevent null pointer dereference.
3021
3022 2018-11-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3023
3024         WebKit.AddAndRemoveDataDetectors hits a debug assertion after r238515
3025         https://bugs.webkit.org/show_bug.cgi?id=191996
3026
3027         Reviewed by Tim Horton.
3028
3029         This assertion is hit because `decode(Decoder& decoder, NSArray<Class> *allowedClasses)` expects the decoded
3030         object (of class `_NSArrayM`) to be equal to `NSArray.class`.
3031
3032         We fix the crash by relaxing the debug assertion when decoding securely-codable objects over IPC. Instead of
3033         checking that the class of the decoded object is equal to one of the allowed classes, check that the object is a
3034         kind of any of the allowed classes.
3035
3036         * Shared/Cocoa/ArgumentCodersCocoa.h:
3037         (IPC::isObjectClassAllowed):
3038         (IPC::decode):
3039
3040 2018-11-27  Tomas Popela  <tpopela@redhat.com>
3041
3042         [GTK][WPE] Remove temporary workaround in Source/WebKit/Platform*.cmake
3043         https://bugs.webkit.org/show_bug.cgi?id=192008
3044
3045         Reviewed by Michael Catanzaro.
3046
3047         Looks like it's not needed anymore as the code compiles fine without
3048         it.
3049
3050         * PlatformGTK.cmake:
3051         * PlatformWPE.cmake:
3052
3053 2018-11-27  Antti Koivisto  <antti@apple.com>
3054
3055         Factor mask layer applying in RemoteLayerTreePropertyApplier into a shared function
3056         https://bugs.webkit.org/show_bug.cgi?id=192001
3057
3058         Reviewed by Tim Horton.
3059
3060         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
3061         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
3062         (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
3063         (WebKit::RemoteLayerTreePropertyApplier::updateMask):
3064
3065         Shared function, with some special tricks for iOS backdrop layers.
3066
3067         (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToUIView):
3068
3069 2018-11-27  Antti Koivisto  <antti@apple.com>
3070
3071         Stop collecting related layers in RemoteLayerTreeHost::updateLayerTree
3072         https://bugs.webkit.org/show_bug.cgi?id=192003
3073
3074         Reviewed by Tim Horton.
3075
3076         We can pass the node hash directly to RemoteLayerTreePropertyApplier. The collection step doesn't seem
3077         to add anything except an extra hash lookup.
3078
3079         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
3080         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
3081         (WebKit::RemoteLayerTreeHost::updateLayerTree):
3082
3083         Pass m_nodes directly.
3084         Some random cleanups.
3085
3086 2018-11-27  Antti Koivisto  <antti@apple.com>
3087
3088         Remote tile layers shouldn't be UIViews
3089         https://bugs.webkit.org/show_bug.cgi?id=191953
3090
3091         Reviewed by Tim Horton.
3092
3093         They don't need any UIView functionality, nor do they ever have UIView descendants.
3094         We can use lighter weight objects.
3095
3096         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
3097         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
3098         (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
3099         (WebKit::RemoteLayerTreePropertyApplier::updateChildren):
3100
3101         Factor to a function shared between platforms.
3102         Support having both views and plain layers in the same tree.
3103         Assert that all siblings are of the same type and that we don't attempt to add views to layers.
3104
3105         (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToUIView):
3106         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
3107         (WebKit::RemoteLayerTreeHost::makeNode):
3108
3109         Use new plain layer on Mac too.
3110
3111         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h:
3112         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
3113         (-[WKPlainRemoteLayer description]):
3114
3115         Add a CALayer subclass so we can have a description, similar to WKCompositingView and pals.
3116
3117         (WebKit::RemoteLayerTreeNode::createWithPlainLayer):
3118         (WebKit::RemoteLayerTreeNode::detachFromParent):
3119
3120         Support having null view.
3121
3122         (WebKit::RemoteLayerTreeNode::appendLayerDescription):
3123
3124         Helper for layer descriptions.
3125
3126         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
3127         (WebKit::RemoteLayerTreeHost::makeNode):
3128
3129         Construct plain layers for tiles.
3130
3131         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
3132         (-[WKCompositingView description]):
3133         (-[WKUIRemoteView description]):
3134         (-[WKBackdropView description]):
3135
3136 2018-11-27  Fujii Hironori  <Hironori.Fujii@sony.com>
3137
3138         Remove "using namespace WebCore" under Source/WebKit/WebProcess/InjectedBundle/API
3139         https://bugs.webkit.org/show_bug.cgi?id=191995
3140
3141         Reviewed by Alex Christensen.
3142
3143         The statement "using namespace WebCore" should be placed inside
3144         namespace WebKit for unified source builds. But, source files
3145         defining WebKit API can't be enclosed by namespace WebKit { }
3146         becuase they are defined in the global scope.
3147
3148         "using namespace WebCore" in global scope and unified source
3149         builds may cause build breaks (Bug 191853).
3150
3151         Remove "using namespace WebCore" in the global scope. Use
3152         "WebCore::" prefix instead.
3153
3154         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3155         (WKBundleClearAllDatabases):
3156         (WKBundleSetDatabaseQuota):
3157         (WKBundleClearResourceLoadStatistics):
3158         (WKBundleResourceLoadStatisticsNotifyObserver):
3159         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
3160         (WKBundleFrameGetFrameLoadState):
3161         (WKBundleFrameClearOpener):
3162         (WKBundleFrameCallShouldCloseOnWebView):
3163         (WKBundleFrameCopySecurityOrigin):
3164         (WKBundleFrameFocus):
3165         * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
3166         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
3167
3168 2018-11-26  Wenson Hsieh  <wenson_hsieh@apple.com>
3169
3170         [Cocoa] No way for clients to tell whether the content view is in the responder chain when the web view is
3171         https://bugs.webkit.org/show_bug.cgi?id=169212
3172         <rdar://problem/30899656>
3173
3174         Reviewed by Tim Horton.
3175
3176         Add an SPI hook to allow internal WKWebView clients to determine whether the WKWebView's content view is the
3177         first responder. Intended for use by clients, such as Mail, that embed native text input views and other views
3178         that may become first responder within the view hierarchy of the WKWebView.
3179
3180         * UIProcess/API/Cocoa/WKWebView.mm:
3181         (-[WKWebView _contentViewIsFirstResponder]):
3182         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3183
3184 2018-11-26  Tim Horton  <timothy_horton@apple.com>
3185
3186         Insert <attachment> elements under editable images to make their backing data accessible
3187         https://bugs.webkit.org/show_bug.cgi?id=191844
3188         <rdar://problem/30900149>
3189
3190         Reviewed by Simon Fraser.
3191
3192         * DerivedSources.make:
3193         * SourcesCocoa.txt:
3194         * UIProcess/API/APIAttachment.h:
3195         fileWrapper() is no longer a trivial getter; it can now construct
3196         the file wrapper from a file wrapper generator if necessary.
3197
3198         Add setFileWrapperGenerator() and invalidateGeneratedFileWrapper().
3199
3200         Make m_fileWrapper mutable so it can be adjusted inside its own getter.
3201
3202         * UIProcess/API/Cocoa/APIAttachmentCocoa.mm:
3203         (API::Attachment::fileWrapper const):
3204         If we have a fileWrapperGenerator and don't have a cached file wrapper,
3205         create one before returning it.
3206
3207         (API::Attachment::invalidateGeneratedFileWrapper):
3208         Invalidate the currently-cached file wrapper. The next time a client
3209         requests the file wrapper it will be regenerated.
3210
3211         (API::Attachment::fileName const):
3212         (API::Attachment::fileSizeForDisplay const):
3213         (API::Attachment::enclosingImageData const):
3214         (API::Attachment::isEmpty const):
3215         (API::Attachment::createSerializedRepresentation const):
3216         Make use of fileWrapper() instead of m_fileWrapper directly, to ensure
3217         that it is created lazily if necessary.
3218
3219         (API::Attachment::setFileWrapperGenerator):
3220         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
3221         (WebKit::RemoteLayerTreeHost::createEmbeddedView):
3222         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
3223         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
3224         (-[WKEmbeddedView initWithEmbeddedViewID:]):
3225         Defer to EditableImageController for creating WKDrawingViews for
3226         editable images. This is done primarily so we don't have to pollute
3227         Remote Layer Tree and DrawingArea interfaces with editable-image-specific messages.
3228
3229         * UIProcess/WebPageProxy.cpp:
3230         (WebKit::m_editableImageController):
3231         (WebKit::m_resetRecentCrashCountTimer): Deleted.
3232         * UIProcess/WebPageProxy.h:
3233         (WebKit::WebPageProxy::editableImageController):
3234         Keep an EditableImageController on the WebPageProxy.
3235
3236         * UIProcess/ios/EditableImageController.h: Added.
3237         * UIProcess/ios/EditableImageController.messages.in: Added.
3238         * UIProcess/ios/EditableImageController.mm: Added.
3239         (WebKit::EditableImageController::EditableImageController):
3240         (WebKit::EditableImageController::~EditableImageController):
3241         (WebKit::EditableImageController::ensureEditableImage):
3242         (WebKit::EditableImageController::editableImage):
3243         (WebKit::EditableImageController::didCreateEditableImage):
3244         (WebKit::EditableImageController::didDestroyEditableImage):
3245         (WebKit::EditableImageController::associateWithAttachment):
3246         (WebKit::EditableImageController::invalidateAttachmentForEditableImage):
3247         Add EditableImageController, which keeps track of EditableImages.
3248         It can be messaged directly to create or destroy the UI-side state
3249         of an editable image, and also to associate a WKDrawingView with
3250         a particular attachment.
3251
3252         * UIProcess/ios/WKDrawingView.h:
3253         * UIProcess/ios/WKDrawingView.mm:
3254         (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
3255         Store the WebPageProxy (weakly) so that we can get to the EditableImageController.
3256
3257         (-[WKDrawingView layoutSubviews]):
3258         (-[WKDrawingView PNGRepresentation]):
3259         Synchronously render the PKCanvasView to PNG.
3260
3261         (-[WKDrawingView drawingDidChange:]):
3262         If the drawing changes, inform the APIAttachment that it needs
3263         to discard its NSFileWrapper; a new one will be generated lazily.
3264
3265         (-[WKDrawingView init]): Deleted.
3266         * WebKit.xcodeproj/project.pbxproj:
3267         * WebProcess/WebCoreSupport/WebChromeClient.h:
3268         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
3269         (WebKit::WebChromeClient::associateEditableImageWithAttachment):
3270         (WebKit::WebChromeClient::didCreateEditableImage):
3271         (WebKit::WebChromeClient::didDestroyEditableImage):
3272
3273 2018-11-26  Jer Noble  <jer.noble@apple.com>
3274
3275         Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI
3276         https://bugs.webkit.org/show_bug.cgi?id=190951
3277         <rdar://problem/45213065>
3278
3279         Reviewed by Alex Christensen.
3280
3281         Add an asyncronous reply request to VideoFullscreenManager.
3282
3283         * Platform/IPC/MessageSender.h:
3284         (IPC::MessageSender::sendWithAsyncReply):
3285         * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
3286         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
3287         (WebKit::VideoFullscreenModelContext::requestRouteSharingPolicyAndContextUID):
3288         * WebProcess/cocoa/VideoFullscreenManager.h:
3289         * WebProcess/cocoa/VideoFullscreenManager.messages.in:
3290         * WebProcess/cocoa/VideoFullscreenManager.mm:
3291         (WebKit::VideoFullscreenManager::requestRouteSharingPolicyAndContextUID):
3292
3293 2018-11-26  Alex Christensen  <achristensen@webkit.org>
3294
3295         Rename WKWebView._safeBrowsingWarningForTesting to _safeBrowsingWarning to use it for more than testing
3296         https://bugs.webkit.org/show_bug.cgi?id=191981
3297
3298         Reviewed by Tim Horton.
3299
3300         * UIProcess/API/Cocoa/WKWebView.mm:
3301         (-[WKWebView _safeBrowsingWarning]):
3302         (-[WKWebView _safeBrowsingWarningForTesting]): Deleted.
3303         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3304
3305 2018-11-26  Daniel Bates  <dabates@apple.com>
3306
3307         REGRESSION (r237738): Command Down Arrow doesn't scroll to the end of a page anymore
3308         https://bugs.webkit.org/show_bug.cgi?id=191967
3309         <rdar://problem/45976390>
3310
3311         Reviewed by Tim Horton.
3312
3313         Fixes an issue where pressing Command + Down Arrow does not scroll the view to the end of the page.
3314
3315         Following r237738 the value of the enumerations used to identify modifier keys (e.g. Shift) changed
3316         to match the values of the corresponding enumerations in GraphicsServices, which are the
3317         enumerations UIKit uses to computes the modifier flags bitmask when instantiating a WebEvent to
3318         pass to WebKit. Before r237738 WebKit was using enumerations whose values matched the values
3319         of the corresponding UIKit public API UIKeyModifier* enumerations. For non-content editable elements,
3320         WebKit intercepts UIKit events in -_handleKeyUIEvent, synthesizes and dispatches its own WebEvent.
3321         However it was creating WebEvents with a modifier flags bitmask built from the UIKeyModifier* enumerations,
3322         -_modifierFlags, as opposed to a bitmask from the GraphicsServices enumerations, -_gsModifierFlags.
3323         Instead WebKit should call -_gsModifierFlags to compute the GraphicsServices-compatible modifier
3324         flags bitmask when instantiating a WebEvent.
3325
3326         * Platform/spi/ios/UIKitSPI.h: Expose -_gsModifierFlags and remove -_modifierFlags.
3327         * UIProcess/ios/WKContentViewInteraction.mm:
3328         (-[WKContentView _handleKeyUIEvent:]): Remove unnecessary code to update the current modifier state.
3329         This will be done by the WebProcess when it receives the keyboard event.
3330         (-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Do not pass modifier flags changed events
3331         to the scrolling animator as it does not know how to handle these kinds of events and triggers an
3332         assertion failure when it tries to read the input string from the event (calls -charactersIgnoringModifiers).
3333         FlagsChanged WebEvents events do not have an input string just like a FlagsChanged NSEvent that
3334         they model on Mac.
3335         * UIProcess/ios/WKWebEvent.mm:
3336         (-[WKWebEvent initWithEvent:]): Pass the value of -_gsModifierFlags for the modifier flags bitmask
3337         instead of the value of -_modifierFlags.
3338
3339 2018-11-26  Chris Dumez  <cdumez@apple.com>
3340
3341         [PSON] process pre-warming should not be on for everyone
3342         https://bugs.webkit.org/show_bug.cgi?id=191966
3343         <rdar://problem/46138499>
3344
3345         Reviewed by Ryosuke Niwa.
3346
3347         If automatic process-prewarming is not explicitly turned on/off by the client, then we now only
3348         turn it on automatically after the first process swap. Previously, it was always enabled if
3349         process-swap on cross-site navigation was enabled (which is the case by default for all apps).
3350
3351         This is important because some apps do not actually browse (only display static content) or never
3352         browse cross-site, and thus would not benefit from process prewarming and yet pay a memory cost.
3353
3354         * UIProcess/API/APIProcessPoolConfiguration.h:
3355         Add m_clientWouldBenefitFromAutomaticProcessPrewarming flag which is false by default and is used
3356         as a fallback if the client did not call setIsAutomaticProcessWarmingEnabled().
3357
3358         * UIProcess/API/C/WKContextConfigurationRef.cpp:
3359         (WKContextConfigurationPrewarmsProcessesAutomatically):
3360         (WKContextConfigurationSetPrewarmsProcessesAutomatically):
3361         Add C API to toggle automatic process prewarming. It is needed for Safari to turn on this feature
3362         by default for browsing. This way Safari does not have to wait for the first process swap to
3363         start prewarming.
3364
3365         * UIProcess/API/C/WKContextConfigurationRef.h:
3366         * UIProcess/WebProcessPool.cpp:
3367         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
3368         Only do automatic process prewarming if process-swap on cross-site navigation is also enabled.
3369         This is needed for clients like Safari that explicitly enable automatic process prewarming but
3370         only want to have it enabled if PSON is also enabled via experimental features.
3371
3372         (WebKit::WebProcessPool::processForNavigation):
3373         On first process swap, if the client did not explicitly turn on or off automatic process prewarming
3374         then we enable it then. This avoids paying the cost of process prewarming in apps that would not
3375         benefit from it.
3376
3377 2018-11-26  Andy Estes  <aestes@apple.com>
3378
3379         [Cocoa] Make it easier to encode NSObjects
3380         https://bugs.webkit.org/show_bug.cgi?id=191948
3381
3382         Reviewed by Dean Jackson.
3383
3384         It should be easier to encode objects that conform to NSSecureCoding for WebKit IPC. Right
3385         now, several argument coders duplicate the logic for encoding and decoding objects using
3386         NSKeyedArchiver and NSKeyedUnarchiver.
3387
3388         This patch adds encodeObject() and decodeObject() primitives for encoding and decoding using
3389         Foundation keyed archiving. It then partially specializes ArgumentCoder for raw pointers and
3390         RetainPtrs whose pointee conforms to NSSecureCoding to call these new primitives.
3391
3392         This allows us to use Encoder::operator<< to encode raw pointers or RetainPtrs and use
3393         Decoder::operator>> to decode to an optional RetainPtr. By default, IPC::decode infers the
3394         allowed class for decoding by calling `[T class]`. We can also specify the allowed classes
3395         explicitly for containers and classes that are loaded at runtime.
3396
3397         * Shared/Cocoa/ArgumentCodersCocoa.h: Added.
3398         * Shared/Cocoa/ArgumentCodersCocoa.mm: Added.
3399         * Shared/Cocoa/DataDetectionResult.mm:
3400         (WebKit::DataDetectionResult::encode const): Removed custom encoding code and used ArgumentCodersCocoa instead.
3401         (WebKit::DataDetectionResult::decode): Ditto.
3402         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
3403         (IPC::ArgumentCoder<WebCore::Payment>::encode): Ditto.
3404         (IPC::ArgumentCoder<WebCore::Payment>::decode): Ditto.
3405         (IPC::ArgumentCoder<WebCore::PaymentAuthorizationResult>::decode): Ditto.
3406         (IPC::ArgumentCoder<WebCore::PaymentContact>::encode): Ditto.
3407         (IPC::ArgumentCoder<WebCore::PaymentContact>::decode): Ditto.
3408         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode): Ditto.
3409         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::decode): Ditto.
3410         (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode): Ditto.
3411         (IPC::ArgumentCoder<WebCore::PaymentMethod>::decode): Ditto.
3412         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode): Ditto.
3413         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
3414         (WebKit::RemoteLayerTreeTransaction::description const): Added some needed namespaces due to unified source shuffling.
3415         * Shared/WebCoreArgumentCoders.h: Modernized several decoders.
3416         * Shared/ios/InteractionInformationAtPosition.mm:
3417         (WebKit::InteractionInformationAtPosition::encode const): Removed custom encoding code and used ArgumentCodersCocoa instead.
3418         (WebKit::InteractionInformationAtPosition::decode): Ditto.