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