Clean up AuthenticationChallengeProxy
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-09-18  Alex Christensen  <achristensen@webkit.org>
2
3         Clean up AuthenticationChallengeProxy
4         https://bugs.webkit.org/show_bug.cgi?id=189668
5
6         Reviewed by Youenn Fablet.
7
8         At its core, it's a CompletionHandler with some information.
9         Make it more elegant and simple with no change in behavior and reduce the complexity of this security-sensitive object.
10
11         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
12         (toNSURLSessionAuthChallengeDisposition):
13         * Shared/Authentication/AuthenticationManager.cpp:
14         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
15         * Shared/Authentication/AuthenticationManager.h:
16         * UIProcess/API/C/WKAuthenticationChallenge.cpp:
17         (WKAuthenticationChallengeGetDecisionListener):
18         (WKAuthenticationChallengeGetProtectionSpace):
19         (WKAuthenticationChallengeGetProposedCredential):
20         (WKAuthenticationChallengeGetPreviousFailureCount):
21         * UIProcess/API/C/WKPage.cpp:
22         (WKPageSetPageNavigationClient):
23         * UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.mm:
24         (-[WKNSURLAuthenticationChallengeSender cancelAuthenticationChallenge:]):
25         (-[WKNSURLAuthenticationChallengeSender continueWithoutCredentialForAuthenticationChallenge:]):
26         (-[WKNSURLAuthenticationChallengeSender useCredential:forAuthenticationChallenge:]):
27         (-[WKNSURLAuthenticationChallengeSender performDefaultHandlingForAuthenticationChallenge:]):
28         (-[WKNSURLAuthenticationChallengeSender rejectProtectionSpaceAndContinueWithChallenge:]):
29         * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
30         (WebKit::AuthenticationChallengeProxy::AuthenticationChallengeProxy):
31         (WebKit::AuthenticationChallengeProxy::~AuthenticationChallengeProxy): Deleted.
32         (WebKit::AuthenticationChallengeProxy::useCredential): Deleted.
33         (WebKit::AuthenticationChallengeProxy::cancel): Deleted.
34         (WebKit::AuthenticationChallengeProxy::performDefaultHandling): Deleted.
35         (WebKit::AuthenticationChallengeProxy::rejectProtectionSpaceAndContinue): Deleted.
36         (WebKit::AuthenticationChallengeProxy::proposedCredential const): Deleted.
37         (WebKit::AuthenticationChallengeProxy::protectionSpace const): Deleted.
38         (WebKit::AuthenticationChallengeProxy::setSecKeyProxyStore): Deleted.
39         * UIProcess/Authentication/AuthenticationChallengeProxy.h:
40         (WebKit::AuthenticationChallengeProxy::create):
41         (WebKit::AuthenticationChallengeProxy::listener const):
42         (WebKit::AuthenticationChallengeProxy::previousFailureCount const): Deleted.
43         * UIProcess/Authentication/AuthenticationDecisionListener.cpp:
44         (WebKit::AuthenticationDecisionListener::AuthenticationDecisionListener):
45         (WebKit::AuthenticationDecisionListener::~AuthenticationDecisionListener):
46         (WebKit::AuthenticationDecisionListener::useCredential):
47         (WebKit::AuthenticationDecisionListener::cancel):
48         (WebKit::AuthenticationDecisionListener::performDefaultHandling):
49         (WebKit::AuthenticationDecisionListener::rejectProtectionSpaceAndContinue):
50         (WebKit::AuthenticationDecisionListener::detachChallenge): Deleted.
51         * UIProcess/Authentication/AuthenticationDecisionListener.h:
52         (WebKit::AuthenticationDecisionListener::create):
53         * UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm:
54         (WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc):
55         (WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc const): Deleted.
56         * UIProcess/Cocoa/DownloadClient.mm:
57         (WebKit::DownloadClient::didReceiveAuthenticationChallenge):
58         * UIProcess/Cocoa/NavigationState.mm:
59         (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
60         * UIProcess/Downloads/DownloadProxy.cpp:
61         (WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
62         * UIProcess/Network/NetworkProcessProxy.cpp:
63         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
64         * UIProcess/ServiceWorkerProcessProxy.cpp:
65         (WebKit::ServiceWorkerProcessProxy::didReceiveAuthenticationChallenge):
66         * UIProcess/WebPageProxy.cpp:
67         (WebKit::WebPageProxy::secKeyProxyStore):
68         (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
69         * UIProcess/WebPageProxy.h:
70
71 2018-09-18  Ben Richards  <benton_richards@apple.com>
72
73         Add script to generate WebContent service resource files and change XPC service main SPI to have it's own header
74         https://bugs.webkit.org/show_bug.cgi?id=188601
75
76         Reviewed by Dan Bernstein.
77
78         Added a script to the process entitlements build phase of the WebContent service that copies resource
79         files to WebKit.framework/PrivateHeaders/CustomWebContentResources. These resource files are to
80         be used by clients who would like to make a custom WebContent service.
81
82         * Scripts/copy-webcontent-resources-to-private-headers.sh: Added.
83         * WebKit.xcodeproj/project.pbxproj:
84         * WebProcess/API/Cocoa/WKWebProcess.h: Drive-by fix to make this header compileable alone.
85
86 2018-09-18  Ryan Haddad  <ryanhaddad@apple.com>
87
88         Unreviewed, rolling out r236138.
89
90         Caused API test and layout test failures on iOS.
91
92         Reverted changeset:
93
94         "REGRESSION (PSON): White or Black flash occurs when process
95         swapping on navigation on Mac"
96         https://bugs.webkit.org/show_bug.cgi?id=189663
97         https://trac.webkit.org/changeset/236138
98
99 2018-09-18  Eric Carlson  <eric.carlson@apple.com>
100
101         Always log when granting/revoking capture sandbox extensions
102         https://bugs.webkit.org/show_bug.cgi?id=189701
103         <rdar://problem/44564029>
104
105         Reviewed by Youenn Fablet.
106
107         * UIProcess/UserMediaProcessManager.cpp:
108         (WebKit::UserMediaProcessManager::willCreateMediaStream): Always log.
109         (WebKit::UserMediaProcessManager::endedCaptureSession): Ditto.
110
111         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
112         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Ditto.
113         (WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): Ditto.
114
115 2018-09-18  Youenn Fablet  <youenn@apple.com>
116
117         Enable Unified Plan by default
118         https://bugs.webkit.org/show_bug.cgi?id=189675
119
120         Reviewed by Eric Carlson.
121
122         * Shared/WebPreferences.yaml:
123
124 2018-09-18  Antti Koivisto  <antti@apple.com>
125
126         REGRESSION (PSON): White or Black flash occurs when process swapping on navigation on Mac
127         https://bugs.webkit.org/show_bug.cgi?id=189663
128         <rdar://problem/44184955>
129
130         Reviewed by Geoff Garen.
131
132         We need to keep the layer tree of the previous page alive and visible until we have something
133         to render on the new page. With PSON on Mac this means that we should keep displaying the
134         layer tree from the previus process.
135
136         This patch moves the management of 'attaching' the drawing area (Mac only concept) from web process
137         to UI process. This is when we parent the layer tree to the view root layer. It also ensures that
138         the layer tree is not deleted too early on process swap and that it still eventually gets deleted.
139
140         * UIProcess/DrawingAreaProxy.h:
141         (WebKit::DrawingAreaProxy::attachInWebProcess):
142         * UIProcess/SuspendedPageProxy.cpp:
143         (WebKit::messageNamesToIgnoreWhileSuspended):
144         (WebKit::SuspendedPageProxy::tearDownDrawingAreaInWebProcess):
145
146         We no longer tear down drawing area (layer tree) for suspended pages automatically. Send an explicit
147         message for it.
148
149         * UIProcess/SuspendedPageProxy.h:
150         * UIProcess/WebPageProxy.cpp:
151         (WebKit::WebPageProxy::reattachToWebProcess):
152
153         Only call didRelaunchProcess when process actually relaunched (not navigation process launch) to
154         match not calling processDidExit in resetStateAfterProcessExited.
155
156         (WebKit::WebPageProxy::didCompletePageTransition):
157
158         Attach the drawing area if appropriate.
159
160         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
161
162         Send suspend message to WebPage immediately instead waiting for the runloop callback. This is needed so we
163         can avoid flashing the initial empty document load when the new Page object is created.
164
165         (WebKit::WebPageProxy::resetStateAfterProcessExited):
166
167         Don't call processDidExit when suspending, not exiting the process (this function needs a new name or rafactoring).
168         This avoids clearing the drawing area and flashing to black.
169
170         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
171
172         This is called when we have switched to the new layer tree.
173         Tear down the drawing area in the previus process.
174
175         * UIProcess/WebPageProxy.h:
176         * UIProcess/WebPageProxy.messages.in:
177         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
178         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
179         (WebKit::TiledCoreAnimationDrawingAreaProxy::attachInWebProcess):
180
181         Send a message to the web process to attach the drawing area.
182
183         * WebProcess/WebPage/DrawingArea.h:
184         (WebKit::DrawingArea::attach):
185         (WebKit::DrawingArea::attachDrawingArea): Deleted.
186
187         Rename to be less redundant.
188
189         * WebProcess/WebPage/DrawingArea.messages.in:
190         * WebProcess/WebPage/WebPage.cpp:
191         (WebKit::WebPage::reinitializeWebPage):
192
193         Don't attach drawing area automatically. It will be done by a message from UI process.
194
195         (WebKit::WebPage::setLayerTreeStateIsFrozen):
196
197         Layer tree is always frozen in a suspended process (if it exists).
198
199         (WebKit::WebPage::didStartPageTransition):
200         (WebKit::WebPage::didCompletePageTransition):
201
202         Notify UI process of transition completion.
203
204         (WebKit::WebPage::setIsSuspended):
205         (WebKit::WebPage::tearDownDrawingAreaForSuspend):
206         * WebProcess/WebPage/WebPage.h:
207         * WebProcess/WebPage/WebPage.messages.in:
208         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
209         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
210         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
211
212         Don't attach drawing area automatically. It will be done by a message from UI process.
213
214         (WebKit::TiledCoreAnimationDrawingArea::attach):
215         (WebKit::TiledCoreAnimationDrawingArea::attachDrawingArea): Deleted.
216
217 2018-09-18  Claudio Saavedra  <csaavedra@igalia.com>
218
219         [WPE] Implement mouse event modifiers
220         https://bugs.webkit.org/show_bug.cgi?id=189697
221
222         Reviewed by Carlos Garcia Campos.
223
224         Only "CapsLocks" is missing, as WPE doesn't support that modifier.
225         * Shared/wpe/WebEventFactory.cpp:
226         (WebKit::modifiersForEventModifiers):
227         (WebKit::WebEventFactory::createWebKeyboardEvent):
228         (WebKit::WebEventFactory::createWebMouseEvent):
229         (WebKit::modifiersForEvent): Deleted.
230
231 2018-09-17  Zan Dobersek  <zdobersek@igalia.com>
232
233         Unreviewed build fix after r236101.
234
235         * UIProcess/WebResourceLoadStatisticsStore.cpp:
236         (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
237         Correct a BinarySemaphore::wait() call which now accepts no arguments.
238
239 2018-09-17  Yusuke Suzuki  <utatane.tea@gmail.com>
240
241         [WTF] Use Semaphore and BinarySemaphore instead of dispatch_semaphore_t
242         https://bugs.webkit.org/show_bug.cgi?id=185339
243
244         Reviewed by Mark Lam.
245
246         * Platform/IPC/Connection.cpp:
247         (IPC::Connection::SyncMessageState::wait):
248         * Shared/mac/SecItemShim.cpp:
249         (WebKit::sendSecItemRequest):
250         Use BinarySemaphore.
251
252         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
253         (WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously):
254         * UIProcess/WebStorage/StorageManager.cpp:
255         (WebKit::StorageManager::applicationWillTerminate):
256         * UIProcess/ios/WKActionSheetAssistant.mm:
257         (appLinkForURL):
258         Use BinarySemaphore to wait for async completion handler. We also fix memory leak
259         since the old code does not call dispatch_release for the used semaphore.
260
261 2018-09-17  Simon Fraser  <simon.fraser@apple.com>
262
263         Many modern media control tests leak documents in testing
264         https://bugs.webkit.org/show_bug.cgi?id=189437
265
266         Reviewed by Darin Adler.
267
268         In order to accurately detect leaks in media controls tests which use lots of
269         SVGImages, we have to:
270         - Fire a zero-delay timer after the postTask, in order for ImagesLoader's m_derefElementTimer
271           to clear references to elements.
272         - Have releaseCriticalMemory() call CachedResourceLoader's garbageCollectDocumentResources()
273           to drop the last handle to the CachedResource for an SVGImage.
274         - Call WKBundleReleaseMemory() after the GC and timer, since we need garbageCollectDocumentResources()
275           to run again after that timer has fired.
276         
277         This should fix most of the spurious leak reports involving SVGImage documents.
278
279         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
280         (WKBundlePageCallAfterTasksAndTimers):
281         (WKBundlePagePostTask): Deleted.
282         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
283
284 2018-09-17  Dan Bernstein  <mitz@apple.com>
285
286         Try to fix Apple internal builds with the iOS 12.0 SDK.
287
288         * Configurations/WebKit.xcconfig: Disable framework header postprocessing for iOS 12.0.
289
290 2018-09-17  Ryan Haddad  <ryanhaddad@apple.com>
291
292         Unreviewed, rolling out r236092 because it breaks internal builds. Also,  remove stray '+' character from ChangeLog file.
293
294         * Scripts/copy-webcontent-resources-to-private-headers.sh: Removed.
295         * WebKit.xcodeproj/project.pbxproj:
296
297 2018-08-17  Ben Richards  <benton_richards@apple.com>
298
299         Add script to generate WebContent service resource files and change XPC service main SPI to have it's own header
300         https://bugs.webkit.org/show_bug.cgi?id=188601
301
302         Reviewed by Dan Bernstein.
303
304         Added a script to the process entitlements build phase of the WebContent service that copies resource
305         files to WebKit.framework/PrivateHeaders/CustomWebContentResources. These resource files are to
306         be used by clients who would like to make a custom WebContent service.
307
308         * Scripts/copy-webcontent-resources-to-private-headers.sh: Added.
309         * WebKit.xcodeproj/project.pbxproj:
310
311
312 2018-09-17  Simon Fraser  <simon.fraser@apple.com>
313
314         Add more Fullscreen logging
315         https://bugs.webkit.org/show_bug.cgi?id=189656
316
317         Reviewed by Jer Noble.
318
319         Add some fullscreen logging so I can tell whether WebFullScreenManager ever releases
320         the fullscreen element.
321
322         * WebProcess/FullScreen/WebFullScreenManager.cpp:
323         (WebKit::WebFullScreenManager::WebFullScreenManager):
324         (WebKit::WebFullScreenManager::videoControlsManagerDidChange):
325         (WebKit::WebFullScreenManager::setPIPStandbyElement):
326         (WebKit::WebFullScreenManager::enterFullScreenForElement):
327         (WebKit::WebFullScreenManager::exitFullScreenForElement):
328         (WebKit::WebFullScreenManager::willEnterFullScreen):
329         (WebKit::WebFullScreenManager::didEnterFullScreen):
330         (WebKit::WebFullScreenManager::willExitFullScreen):
331         (WebKit::WebFullScreenManager::didExitFullScreen):
332         (WebKit::WebFullScreenManager::close):
333         * WebProcess/FullScreen/WebFullScreenManager.h:
334
335 2018-09-17  Tim Horton  <timothy_horton@apple.com>
336
337         Swipe snapshot can get stuck if swiping is disabled while it is visible
338         https://bugs.webkit.org/show_bug.cgi?id=189667
339         <rdar://problem/40367780>
340
341         Reviewed by Simon Fraser.
342
343         If navigation gestures are disabled while a swipe snapshot is visible,
344         WKWebView will tear down the ViewGestureController, which means that
345         the SnapshotRemovalTracker will no longer be around to ever remove
346         the snapshot.
347
348         It's currently very hard to write a test for this because we have
349         yet to come up with a good mechanism for testing swiping on iOS.
350
351         * UIProcess/API/Cocoa/WKWebView.mm:
352         (-[WKWebView setAllowsBackForwardNavigationGestures:]):
353         Instead of tearing down the ViewGestureController when navigation
354         gestures are disabled, just set a bit on it that disables gestures.
355
356         * UIProcess/Cocoa/ViewGestureController.cpp:
357         (WebKit::ViewGestureController::canSwipeInDirection const):
358         * UIProcess/Cocoa/ViewGestureController.h:
359         (WebKit::ViewGestureController::setSwipeGestureEnabled):
360         (WebKit::ViewGestureController::isSwipeGestureEnabled):
361         Add a bit to ViewGestureController that makes starting new gestures
362         always fail, but allows e.g. snapshots from existing swipes to continue
363         their usual behavior.
364
365 2018-09-17  Alex Christensen  <achristensen@webkit.org>
366
367         Expose WKWebProcess.h as a private header
368         https://bugs.webkit.org/show_bug.cgi?id=189636
369
370         * WebKit.xcodeproj/project.pbxproj:
371
372 2018-09-17  Alex Christensen  <achristensen@webkit.org>
373
374         Expose XPCServiceMain in a WebProcess header rather than WKProcessPool
375         https://bugs.webkit.org/show_bug.cgi?id=189636
376
377         Reviewed by Dan Bernstein.
378
379         Fix a few build failures along the way.
380
381         * PluginProcess/mac/PluginControllerProxyMac.mm:
382         (WebKit::PluginControllerProxy::windowAndViewFramesChanged):
383         (WebKit::PluginControllerProxy::updateLayerHostingContext):
384         * PluginProcess/mac/PluginProcessMac.mm:
385         (WebKit::replacedNSWorkspace_launchApplicationAtURL_options_configuration_error):
386         (WebKit::PluginProcess::platformInitializeProcess):
387         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
388         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
389         (WebKit::XPCServiceMain):
390         (main):
391         * SourcesCocoa.txt:
392         * UIProcess/API/Cocoa/WKProcessPool.mm:
393         (+[WKProcessPool _webContentProcessXPCMain]): Deleted.
394         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
395         * WebKit.xcodeproj/project.pbxproj:
396         * WebProcess/API: Added.
397         * WebProcess/API/Cocoa: Added.
398         * WebProcess/API/Cocoa/WKWebProcess.cpp: Added.
399         (WKWebProcessMain):
400         * WebProcess/API/Cocoa/WKWebProcess.h: Added.
401         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
402         (-[WKAccessibilityWebPageObject convertScreenPointToRootView:]):
403         (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
404         (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
405
406 2018-09-17  Basuke Suzuki  <Basuke.Suzuki@sony.com>
407
408         [Curl] Respond with requested authentication scheme for authentication challenge.
409         https://bugs.webkit.org/show_bug.cgi?id=189318
410
411         Reviewed by Alex Christensen.
412
413         Curl port depends on libcurl's authentication handling by enabling CURLAUTH_ANY. With this
414         mode, the round-trip communication between the client and the server is handled by libcurl
415         internally. That's okay for many cases. But when initial request has a credentials
416         (i.e. XMLHttpRequest), there's no valid chance to store credential to the storage because
417         the returned response is not 401.
418
419         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
420         (WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl):
421         (WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
422         (WebKit::NetworkDataTaskCurl::tryHttpAuthentication):
423         (WebKit::NetworkDataTaskCurl::tryProxyAuthentication):
424         (WebKit::NetworkDataTaskCurl::restartWithCredential):
425         * NetworkProcess/curl/NetworkDataTaskCurl.h:
426
427 2018-09-17  Woodrow Wang  <woodrow_wang@apple.com>
428
429         Clear pending resource load statistics' writes after tests
430         https://bugs.webkit.org/show_bug.cgi?id=189632
431         <rdar://problem/44469275>
432
433         Reviewed by Chris Dumez.
434
435         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
436         (WKWebsiteDataStoreStatisticsResetToConsistentState):
437
438 2018-09-17  Chris Dumez  <cdumez@apple.com>
439
440         PSON: window.open() with 'noopener' should only process-swap cross-site, not cross-origin
441         https://bugs.webkit.org/show_bug.cgi?id=189602
442         <rdar://problem/44430549>
443
444         Reviewed by Geoff Garen.
445
446         The following fixes were made to our process swap on navigation logic:
447         - Browsing contexts opened via window.open() with 'noopener' option now only same if
448           they are cross-site, instead of doing a stricter cross-origin check.
449         - Support process swapping when opening a new window via <a target="_blank" rel="noopener">
450           that is cross-site.
451
452         In order to support this, the following changes were made:
453         - Stop passing a 'isCrossOriginWindowOpenNavigation' flag to the UIProcess when navigating because:
454           - This is specific to window.open() and does not apply to other windows opened by DOM
455           - This forces the origin check to happens on WebContent process side instead of relying on the
456             one in WebProcessPool in the UIProcess
457         - Pass the origin of the requester to the UIProcess when navigating, so that the WebProcessPool
458           can use the requester's host for the cross-site check for the initial navigation in a new window
459           created by DOM.
460         - Add 2 flags to WebPageProxy which indicate if the page was created by the DOM and if any provisional
461           loads have been committed. The WebProcessPool uses theses flags to recognize initial loads in
462           new windows created by the DOM, so that it uses the requester's origin for the cross-site check.
463
464         * Shared/NavigationActionData.cpp:
465         (WebKit::NavigationActionData::encode const):
466         (WebKit::NavigationActionData::decode):
467         * Shared/NavigationActionData.h:
468         * UIProcess/API/APINavigation.h:
469         (API::Navigation::setRequesterOrigin):
470         (API::Navigation::requesterOrigin const):
471         * UIProcess/WebPageProxy.cpp:
472         (WebKit::WebPageProxy::continueNavigationInNewProcess):
473         (WebKit::WebPageProxy::didCommitLoadForFrame):
474         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
475         (WebKit::WebPageProxy::createNewPage):
476         * UIProcess/WebPageProxy.h:
477         (WebKit::WebPageProxy::setOpenedByDOM):
478         (WebKit::WebPageProxy::openedByDOM const):
479         (WebKit::WebPageProxy::hasCommittedAnyProvisionalLoads const):
480         * UIProcess/WebProcessPool.cpp:
481         (WebKit::shouldUseSameProcessBasedOnURLs):
482         (WebKit::WebProcessPool::processForNavigationInternal):
483         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
484         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
485
486 2018-09-17  Alexey Proskuryakov  <ap@apple.com>
487
488         Revert https://trac.webkit.org/r235910, because the new test times out.
489         Crash under PlatformPopupMenuData::encode when interacting with a select menu that has variable fonts
490         https://bugs.webkit.org/show_bug.cgi?id=188008
491
492         * Shared/cf/ArgumentCodersCF.cpp:
493         (IPC::encode):
494         (IPC::decode):
495
496 2018-09-17  Alex Christensen  <achristensen@webkit.org>
497
498         Refactoring related to Safe Browsing
499         https://bugs.webkit.org/show_bug.cgi?id=189631
500
501         Reviewed by Tim Horton.
502
503         Make SafeBrowsingResult RefCounted.
504         Move logic from an unnamed lambda to WebPageProxy::receivedNavigationPolicyDecision.
505
506         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
507         (WebKit::WebPageProxy::beginSafeBrowsingCheck):
508         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame): Deleted.
509         (WebKit::WebPageProxy::addPlatformLoadParameters): Deleted.
510         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded): Deleted.
511         (WebKit::WebPageProxy::startDrag): Deleted.
512         (WebKit::WebPageProxy::setPromisedDataForImage): Deleted.
513         (WebKit::WebPageProxy::setDragCaretRect): Deleted.
514         (WebKit::WebPageProxy::platformRegisterAttachment): Deleted.
515         (WebKit::WebPageProxy::platformCloneAttachment): Deleted.
516         * UIProcess/SafeBrowsingResult.h:
517         (WebKit::SafeBrowsingResult::create):
518         * UIProcess/WebFramePolicyListenerProxy.cpp:
519         (WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
520         * UIProcess/WebFramePolicyListenerProxy.h:
521         * UIProcess/WebFrameProxy.cpp:
522         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
523         * UIProcess/WebFrameProxy.h:
524         * UIProcess/WebPageProxy.cpp:
525         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
526         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
527         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
528         (WebKit::WebPageProxy::decidePolicyForResponse):
529         * UIProcess/WebPageProxy.h:
530
531 2018-09-17  Darin Adler  <darin@apple.com>
532
533         Use OpaqueJSString rather than JSRetainPtr inside WebKit
534         https://bugs.webkit.org/show_bug.cgi?id=189652
535
536         Reviewed by Saam Barati.
537
538         * Shared/API/c/WKString.cpp: Removed unneeded include of JSStringRef.h.
539
540         * WebProcess/Automation/WebAutomationSessionProxy.cpp: Removed unneeded
541         include of JSRetainPtr.
542         (WebKit::toJSString): Deleted.
543         (WebKit::toJSValue): Use OpaqueJSString::create.
544         (WebKit::callPropertyFunction): Ditto.
545         (WebKit::evaluate): Use adoptRef.
546         (WebKit::evaluateJavaScriptCallback): Ditto.
547         (WebKit::WebAutomationSessionProxy::scriptObjectForFrame):
548         Use OpaqueJSString::create.
549         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Use
550         String rather than JSStringRef.
551
552         * WebProcess/Plugins/PDF/PDFPlugin.mm: Removed unneeded includes.
553         (WebKit::PDFPlugin::runScriptsInPDFDocument): Use OpaqueJSString::create.
554
555 2018-09-17  Michael Catanzaro  <mcatanzaro@igalia.com>
556
557         Unreviewed, fix incorrect WPE build fix made in r236009
558
559         This isn't the right place to add the typedef. I failed to notice that the WebKitWebView
560         type is not actually used anywhere in this header. Actually, the problematic function is no
561         longer declared or used anywhere and was just missed when WebKitScriptDialog was refactored,
562         so remove it.
563
564         * UIProcess/API/wpe/WebKitScriptDialog.h:
565         * UIProcess/API/wpe/WebKitScriptDialogWPE.cpp:
566         (webkitScriptDialogRun): Deleted.
567
568 2018-09-17  Sihui Liu  <sihui_liu@apple.com>
569
570         Move IndexedDB to Network Process
571         https://bugs.webkit.org/show_bug.cgi?id=189415
572         <rdar://problem/44396973>
573
574         Reviewed by Chris Dumez.
575
576         We are going to eliminate storage process and move its functionality to network process. 
577         The reasons why we want to do this:
578         1. Lower resource usage of having an additional process for storage operations, especially
579         memory. Single storage process takes about 5MB memory on macOS.
580         2. Reduce latency of Service Workers. After enabling Service Workers, we've seen
581         regression in app launch. The launch time of storage process is partly attributed to this:
582         Service Workers delay page loading until receiving response from storage process.
583         3. We choose network process because UI process may have broader access in file system
584         that we don't want the storage operations to have.
585
586         This patch is the first piece towards the goal. It mainly moves indexedDB from storage process
587         to corresponding components of network process. Moving of Service Worker and stopping to 
588         launch storage process will be done in following patches.
589
590         We expect to see the higher cpu and memory usage of network process as it is taking more work,
591         but the overall gain in memory and latency after we completely remove storage process should be 
592         positive.
593
594         * CMakeLists.txt:
595         * DerivedSources.make:
596         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp.
597         (WebKit::WebIDBConnectionToClient::create):
598         (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
599         (WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient):
600         (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
601         (WebKit::WebIDBConnectionToClient::messageSenderConnection):
602         (WebKit::WebIDBConnectionToClient::connectionToClient):
603         (WebKit::WebIDBConnectionToClient::didDeleteDatabase):
604         (WebKit::WebIDBConnectionToClient::didOpenDatabase):
605         (WebKit::WebIDBConnectionToClient::didAbortTransaction):
606         (WebKit::WebIDBConnectionToClient::didCommitTransaction):
607         (WebKit::WebIDBConnectionToClient::didCreateObjectStore):
608         (WebKit::WebIDBConnectionToClient::didDeleteObjectStore):
609         (WebKit::WebIDBConnectionToClient::didRenameObjectStore):
610         (WebKit::WebIDBConnectionToClient::didClearObjectStore):
611         (WebKit::WebIDBConnectionToClient::didCreateIndex):
612         (WebKit::WebIDBConnectionToClient::didDeleteIndex):
613         (WebKit::WebIDBConnectionToClient::didRenameIndex):
614         (WebKit::WebIDBConnectionToClient::didPutOrAdd):
615         (WebKit::WebIDBConnectionToClient::handleGetResult):
616         (WebKit::WebIDBConnectionToClient::didGetRecord):
617         (WebKit::WebIDBConnectionToClient::didGetAllRecords):
618         (WebKit::WebIDBConnectionToClient::didGetCount):
619         (WebKit::WebIDBConnectionToClient::didDeleteRecord):
620         (WebKit::WebIDBConnectionToClient::didOpenCursor):
621         (WebKit::WebIDBConnectionToClient::didIterateCursor):
622         (WebKit::WebIDBConnectionToClient::fireVersionChangeEvent):
623         (WebKit::WebIDBConnectionToClient::didStartTransaction):
624         (WebKit::WebIDBConnectionToClient::didCloseFromServer):
625         (WebKit::WebIDBConnectionToClient::notifyOpenDBRequestBlocked):
626         (WebKit::WebIDBConnectionToClient::didGetAllDatabaseNames):
627         (WebKit::WebIDBConnectionToClient::deleteDatabase):
628         (WebKit::WebIDBConnectionToClient::openDatabase):
629         (WebKit::WebIDBConnectionToClient::abortTransaction):
630         (WebKit::WebIDBConnectionToClient::commitTransaction):
631         (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
632         (WebKit::WebIDBConnectionToClient::createObjectStore):
633         (WebKit::WebIDBConnectionToClient::deleteObjectStore):
634         (WebKit::WebIDBConnectionToClient::renameObjectStore):
635         (WebKit::WebIDBConnectionToClient::clearObjectStore):
636         (WebKit::WebIDBConnectionToClient::createIndex):
637         (WebKit::WebIDBConnectionToClient::deleteIndex):
638         (WebKit::WebIDBConnectionToClient::renameIndex):
639         (WebKit::WebIDBConnectionToClient::putOrAdd):
640         (WebKit::WebIDBConnectionToClient::getRecord):
641         (WebKit::WebIDBConnectionToClient::getAllRecords):
642         (WebKit::WebIDBConnectionToClient::getCount):
643         (WebKit::WebIDBConnectionToClient::deleteRecord):
644         (WebKit::WebIDBConnectionToClient::openCursor):
645         (WebKit::WebIDBConnectionToClient::iterateCursor):
646         (WebKit::WebIDBConnectionToClient::establishTransaction):
647         (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
648         (WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
649         (WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
650         (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
651         (WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
652         (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
653         (WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
654         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.h.
655         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.messages.in.
656         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
657         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
658
659         Code moved from StorageToWebProcessConnection::didReceiveMessage.
660
661         (WebKit::NetworkConnectionToWebProcess::didClose):
662         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
663
664         Network process receives and stores sandbox extension of temporary files for later indexedDB
665         use.
666
667         (WebKit::NetworkConnectionToWebProcess::didClose):
668         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
669         (WebKit::generateIDBConnectionToServerIdentifier):
670         (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
671         (WebKit::NetworkConnectionToWebProcess::removeIDBConnectionToServer):
672         * NetworkProcess/NetworkConnectionToWebProcess.h:
673         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
674         * NetworkProcess/NetworkProcess.cpp:
675         (WebKit::NetworkProcess::NetworkProcess):
676         (WebKit::NetworkProcess::initializeNetworkProcess):
677         (WebKit::NetworkProcess::addWebsiteDataStore):
678         (WebKit::NetworkProcess::fetchWebsiteData):
679         (WebKit::NetworkProcess::deleteWebsiteData):
680         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
681         (WebKit::NetworkProcess::idbServer):
682         (WebKit::NetworkProcess::ensurePathExists):
683         (WebKit::NetworkProcess::postStorageTask):
684         (WebKit::NetworkProcess::performNextStorageTask):
685         (WebKit::NetworkProcess::prepareForAccessToTemporaryFile):
686         (WebKit::NetworkProcess::accessToTemporaryFileComplete):
687         (WebKit::NetworkProcess::indexedDatabaseOrigins):
688         (WebKit::NetworkProcess::addIndexedDatabaseSession):
689         (WebKit::NetworkProcess::getSandboxExtensionsForBlobFiles):
690
691         Instead of asking UI process to grant sandbox extension to storage process, now network 
692         process just asks for sandbox extension fot itself.
693
694         (WebKit::NetworkProcess::didGetSandboxExtensionsForBlobFiles):
695         (WebKit::NetworkProcess::updateTemporaryFileSandboxExtensions):
696         (WebKit::NetworkProcess::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
697         (WebKit::NetworkProcess::didGrantSandboxExtensionsToStorageProcessForBlobs): Deleted.
698         * NetworkProcess/NetworkProcess.h:
699         * NetworkProcess/NetworkProcess.messages.in:
700         * NetworkProcess/NetworkProcessCreationParameters.cpp:
701         (WebKit::NetworkProcessCreationParameters::encode const):
702         (WebKit::NetworkProcessCreationParameters::decode):
703         * NetworkProcess/NetworkProcessCreationParameters.h:
704         * Shared/Storage/StorageProcessCreationParameters.cpp:
705         (WebKit::StorageProcessCreationParameters::encode const):
706         (WebKit::StorageProcessCreationParameters::decode):
707         * Shared/Storage/StorageProcessCreationParameters.h:
708         * Shared/WebsiteDataStoreParameters.cpp:
709         (WebKit::WebsiteDataStoreParameters::encode const):
710         (WebKit::WebsiteDataStoreParameters::decode):
711         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
712         * Shared/WebsiteDataStoreParameters.h:
713         * Sources.txt:
714         * StorageProcess/StorageProcess.cpp:
715         (WebKit::StorageProcess::initializeWebsiteDataStore):
716         (WebKit::StorageProcess::fetchWebsiteData):
717         (WebKit::StorageProcess::deleteWebsiteData):
718         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
719         (WebKit::StorageProcess::idbServer): Deleted.
720         (WebKit::StorageProcess::grantSandboxExtensionsForBlobs): Deleted.
721         (WebKit::StorageProcess::prepareForAccessToTemporaryFile): Deleted.
722         (WebKit::StorageProcess::accessToTemporaryFileComplete): Deleted.
723         (WebKit::StorageProcess::indexedDatabaseOrigins): Deleted.
724         (WebKit::StorageProcess::getSandboxExtensionsForBlobFiles): Deleted.
725         (WebKit::StorageProcess::didGetSandboxExtensionsForBlobFiles): Deleted.
726         * StorageProcess/StorageProcess.h:
727         (WebKit::StorageProcess::queue): Deleted.
728         * StorageProcess/StorageProcess.messages.in:
729         * StorageProcess/StorageToWebProcessConnection.cpp:
730         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
731         (WebKit::StorageToWebProcessConnection::didClose):
732         (WebKit::generateIDBConnectionToServerIdentifier): Deleted.
733         (WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer): Deleted.
734         (WebKit::StorageToWebProcessConnection::removeIDBConnectionToServer): Deleted.
735         * StorageProcess/StorageToWebProcessConnection.h:
736         * StorageProcess/StorageToWebProcessConnection.messages.in:
737         * UIProcess/Network/NetworkProcessProxy.cpp:
738         (WebKit::NetworkProcessProxy::getSandboxExtensionsForBlobFiles):
739         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
740         * UIProcess/Network/NetworkProcessProxy.h:
741         * UIProcess/Network/NetworkProcessProxy.messages.in:
742         * UIProcess/Storage/StorageProcessProxy.cpp:
743         (WebKit::StorageProcessProxy::getSandboxExtensionsForBlobFiles): Deleted.
744         * UIProcess/Storage/StorageProcessProxy.h:
745         * UIProcess/Storage/StorageProcessProxy.messages.in:
746         * UIProcess/WebProcessPool.cpp:
747         (WebKit::WebProcessPool::ensureNetworkProcess):
748         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
749         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
750         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
751         (WebKit::WebsiteDataStore::parameters):
752         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
753         (WebKit::computeNetworkProcessAccessTypeForDataFetch):
754         (WebKit::WebsiteDataStore::fetchDataAndApply):
755         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
756         (WebKit::WebsiteDataStore::removeData):
757         (WebKit::WebsiteDataStore::storageProcessParameters):
758         (WebKit::WebsiteDataStore::parameters):
759         * WebKit.xcodeproj/project.pbxproj:
760         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
761         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
762         (WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
763         (WebKit::WebIDBConnectionToServer::messageSenderConnection):
764         * WebProcess/Databases/WebDatabaseProvider.cpp:
765         (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
766         * WebProcess/Network/NetworkProcessConnection.cpp:
767         (WebKit::NetworkProcessConnection::didReceiveMessage):
768         (WebKit::NetworkProcessConnection::didClose):
769         (WebKit::NetworkProcessConnection::idbConnectionToServerForSession):
770         * WebProcess/Network/NetworkProcessConnection.h:
771         (WebKit::NetworkProcessConnection::existingIDBConnectionToServerForIdentifier const):
772         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
773         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
774         (WebKit::WebToStorageProcessConnection::didClose):
775         (WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession): Deleted.
776         * WebProcess/Storage/WebToStorageProcessConnection.h:
777         (WebKit::WebToStorageProcessConnection::existingIDBConnectionToServerForIdentifier): Deleted.
778         * WebProcess/WebProcess.cpp:
779         (WebKit::WebProcess::networkProcessConnectionClosed):
780         (WebKit::WebProcess::webToStorageProcessConnectionClosed):
781
782 2018-09-08  Darin Adler  <darin@apple.com>
783
784         Streamline JSRetainPtr, fix leaks of JSString and JSGlobalContext
785         https://bugs.webkit.org/show_bug.cgi?id=189455
786
787         Reviewed by Keith Miller.
788
789         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
790         (WebKit::toJSString): Use adopt function instead of adopt construuctor.
791         (WebKit::evaluate): Ditto.
792         (WebKit::evaluateJavaScriptCallback): Ditto.
793         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Ditto.
794
795 2018-09-14  Matt Lewis  <jlewis3@apple.com>
796
797         Unreviewed, rolling out r236020.
798
799         This caused an api failure on High Sierra
800
801         Reverted changeset:
802
803         "Refactoring related to Safe Browsing"
804         https://bugs.webkit.org/show_bug.cgi?id=189631
805         https://trac.webkit.org/changeset/236020
806
807 2018-09-14  Basuke Suzuki  <Basuke.Suzuki@sony.com>
808
809         [Curl] Bug fix on some inaccurate values in NetworkLoadMetrics.
810         https://bugs.webkit.org/show_bug.cgi?id=189530
811
812         Reviewed by Alex Christensen.
813
814         Curl port uses the start time libcurl provided. But there's a lug between main thread and Curl thread.
815         Record the start time of request instead of libcurl's start timing and use it to measure the metrics.
816
817         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
818         (WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl):
819         (WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
820         (WebKit::NetworkDataTaskCurl::restartWithCredential):
821         * NetworkProcess/curl/NetworkDataTaskCurl.h:
822
823 2018-09-14  Alex Christensen  <achristensen@webkit.org>
824
825         Refactoring related to Safe Browsing
826         https://bugs.webkit.org/show_bug.cgi?id=189631
827
828         Reviewed by Tim Horton.
829
830         Make SafeBrowsingResult RefCounted.
831         Move logic from an unnamed lambda to WebPageProxy::receivedNavigationPolicyDecision.
832
833         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
834         (WebKit::WebPageProxy::beginSafeBrowsingCheck):
835         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame): Deleted.
836         (WebKit::WebPageProxy::addPlatformLoadParameters): Deleted.
837         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded): Deleted.
838         (WebKit::WebPageProxy::startDrag): Deleted.
839         (WebKit::WebPageProxy::setPromisedDataForImage): Deleted.
840         (WebKit::WebPageProxy::setDragCaretRect): Deleted.
841         (WebKit::WebPageProxy::platformRegisterAttachment): Deleted.
842         (WebKit::WebPageProxy::platformCloneAttachment): Deleted.
843         * UIProcess/SafeBrowsingResult.h:
844         (WebKit::SafeBrowsingResult::create):
845         * UIProcess/WebFramePolicyListenerProxy.cpp:
846         (WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
847         * UIProcess/WebFramePolicyListenerProxy.h:
848         * UIProcess/WebFrameProxy.cpp:
849         (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
850         * UIProcess/WebFrameProxy.h:
851         * UIProcess/WebPageProxy.cpp:
852         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
853         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
854         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
855         (WebKit::WebPageProxy::decidePolicyForResponse):
856         * UIProcess/WebPageProxy.h:
857
858 2018-09-14  Geoffrey Garen  <ggaren@apple.com>
859
860         Clarify the configuration used by WKUIDelegate's createWebViewWithConfiguration
861         https://bugs.webkit.org/show_bug.cgi?id=189634
862
863         Reviewed by Tim Horton.
864
865         * UIProcess/API/Cocoa/WKUIDelegate.h:
866
867 2018-09-11  Simon Fraser  <simon.fraser@apple.com>
868
869         Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings
870         https://bugs.webkit.org/show_bug.cgi?id=189521
871
872         Reviewed by Tim Horton.
873
874         Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>.
875         
876         RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>.
877         
878         Added some helper functions to null out a RefPtr<GraphicsLayer> after removing from the tree,
879         clearing the client. GraphicsLayer.m_client becomes a pointer, so it can be set to point to a singleton
880         empty client when a GraphicsLayer gets detached from its owner. More explicit layer unparenting,
881         and removed some unnecessary parent checks, and redundant unparenting.
882         
883         Other changes are just to adapt to the new ownership patterns.
884         
885         I verified that no GraphicsLayers were leaked or abandoned after this change.
886
887         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
888         (WebKit::WebInspectorClient::~WebInspectorClient):
889         (WebKit::WebInspectorClient::showPaintRect):
890         (WebKit::WebInspectorClient::animationEndedForLayer):
891         * WebProcess/WebCoreSupport/WebInspectorClient.h:
892         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
893         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
894         (WebKit::RemoteLayerTreeContext::createGraphicsLayer):
895         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
896         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
897         (WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
898         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
899
900 2018-09-14  Eric Carlson  <eric.carlson@apple.com>
901
902         Support arbitrary video resolution in getUserMedia API
903         https://bugs.webkit.org/show_bug.cgi?id=178109
904         <rdar://problem/35083128>
905
906         Reviewed by Youenn Fablet.
907
908         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
909
910 2018-09-14  Basuke Suzuki  <Basuke.Suzuki@sony.com>
911
912         [Curl][WebKit] Bug fix for continuously retrying with empty credentials.
913         https://bugs.webkit.org/show_bug.cgi?id=189601
914
915         Reviewed by Alex Christensen.
916
917         Added stop condition for empty credentials passed by client.
918
919         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
920         (WebKit::NetworkDataTaskCurl::curlDidReceiveResponse):
921         (WebKit::NetworkDataTaskCurl::invokeDidReceiveResponse):
922         (WebKit::NetworkDataTaskCurl::tryHttpAuthentication):
923         (WebKit::NetworkDataTaskCurl::tryProxyAuthentication):
924         * NetworkProcess/curl/NetworkDataTaskCurl.h:
925
926 2018-09-14  Jer Noble  <jer.noble@apple.com>
927
928         Turn SourceBufferChangeTypeEnabled on by default
929         https://bugs.webkit.org/show_bug.cgi?id=189527
930
931         Reviewed by Eric Carlson.
932
933         * Shared/WebPreferences.yaml:
934         * UIProcess/API/C/WKPreferencesRefPrivate.h:
935
936 2018-09-14  Michael Catanzaro  <mcatanzaro@igalia.com>
937
938         Unreviewed, speculative WPE build fix after r236004
939         https://bugs.webkit.org/show_bug.cgi?id=189545
940
941         * UIProcess/API/wpe/WebKitScriptDialog.h:
942
943 2018-09-14  Carlos Garcia Campos  <cgarcia@igalia.com>
944
945         [GTK] Make script dialogs modal to the current web view only
946         https://bugs.webkit.org/show_bug.cgi?id=189545
947
948         Reviewed by Michael Catanzaro.
949
950         Change the default implementation of script dialogs to use an embedded window, like the HTTP auth dialog,
951         instead of a GtkMessageDialog. This patch adds a base class WebKitWebViewDialog shared by
952         WebKitAuthenticationDialog and the new WebKitScriptDialogImpl.
953
954         * SourcesGTK.txt: Add new files to compilation.
955         * UIProcess/API/glib/WebKitScriptDialogPrivate.h:
956         * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp:
957         (webkitAuthenticationDialogInitialize): Do not use a frame and use a better styled title.
958         (webkit_authentication_dialog_class_init): Remove implementation of vfuncs that are now implemented by the
959         parent.
960         * UIProcess/API/gtk/WebKitAuthenticationDialog.h:
961         * UIProcess/API/gtk/WebKitScriptDialogGtk.cpp:
962         (webkitScriptDialogAccept): Use WebKitScriptDialogImpl API.
963         (webkitScriptDialogDismiss): Ditto.
964         (webkitScriptDialogSetUserInput): Ditto.
965         * UIProcess/API/gtk/WebKitScriptDialogImpl.cpp: Added.
966         (webkitScriptDialogImplClose):
967         (webkitScriptDialogImplKeyPressEvent):
968         (webkitScriptDialogImplMap):
969         (webkitScriptDialogImplConstructed):
970         (webkitScriptDialogImplDispose):
971         (webkit_script_dialog_impl_class_init):
972         (webkitScriptDialogImplAddButton):
973         (webkitScriptDialogImplNew):
974         (webkitScriptDialogImplCancel):
975         (webkitScriptDialogImplConfirm):
976         (webkitScriptDialogImplSetEntryText):
977         * UIProcess/API/gtk/WebKitScriptDialogImpl.h: Added.
978         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
979         (webkitWebViewChildIsInternalWidget): Rename authenticationDialog as just dialog.
980         (webkitWebViewBaseAddDialog): Ditto.
981         (webkitWebViewBaseContainerRemove): Ditto.
982         (webkitWebViewBaseContainerForall): Ditto.
983         (webkitWebViewBaseConstructed): Ditto.
984         (webkitWebViewBaseSizeAllocate): Ditto.
985         (webkitWebViewBaseKeyPressEvent): Ditto.
986         (webkitWebViewBaseHandleMouseEvent): Ditto.
987         (webkitWebViewBaseButtonPressEvent): Ditto.
988         (webkitWebViewBaseButtonReleaseEvent): Ditto.
989         (webkitWebViewBaseHandleWheelEvent): Ditto.
990         (webkitWebViewBaseScrollEvent): Ditto.
991         (webkitWebViewBaseMotionNotifyEvent): Ditto.
992         (webkitWebViewBaseCrossingNotifyEvent): Ditto.
993         (webkitWebViewBaseTouchEvent): Ditto.
994         (webkitWebViewBaseFocus): Ditto.
995         (webkitWebViewBaseDestroy): Ditto.
996         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
997         * UIProcess/API/gtk/WebKitWebViewDialog.cpp: Added.
998         (webkitWebViewDialogDraw):
999         (webkitWebViewDialogSizeAllocate):
1000         (webkitWebViewDialogConstructed):
1001         (webkit_web_view_dialog_class_init):
1002         * UIProcess/API/gtk/WebKitWebViewDialog.h: Added.
1003         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
1004         (webkitWebViewAuthenticate):
1005         (webkitWebViewScriptDialog):
1006
1007 2018-09-13  Ryan Haddad  <ryanhaddad@apple.com>
1008
1009         Unreviewed, rolling out r235954.
1010
1011         Breaks the watchOS build.
1012
1013         Reverted changeset:
1014
1015         "Move IndexedDB to Network Process"
1016         https://bugs.webkit.org/show_bug.cgi?id=189415
1017         https://trac.webkit.org/changeset/235954
1018
1019 2018-09-13  Chris Dumez  <cdumez@apple.com>
1020
1021         Regression(PSON): setting window.opener to null allows process swapping in cases that are not web-compatible
1022         https://bugs.webkit.org/show_bug.cgi?id=189590
1023         <rdar://problem/44422725>
1024
1025         Reviewed by Geoffrey Garen.
1026
1027         If script calls window.open() without 'noopener' and the newly navigated window gets navigated cross-site,
1028         we are currently unable to process-swap because the opener has a WindowProxy handle to this new Window and
1029         may interact with it (which we currently do not support cross-process). We were dealing with this by not
1030         process-swapping if window.opener is not null. This works most of the time but is not sufficient because the
1031         opener may get nulled out, while the opener still has a valid WindowProxy handle to its openee.
1032
1033         Therefore, we now also check for a flag indicating if the frame was opened via window.open() without
1034         'nooopener'. We still need to check if the browsing context has an opener for browsing context created
1035         via <a target="_blank"> for example (the opener does not have a handle to the new window but the openee
1036         has access to its opener).
1037
1038         * Shared/NavigationActionData.cpp:
1039         (WebKit::NavigationActionData::encode const):
1040         (WebKit::NavigationActionData::decode):
1041         * Shared/NavigationActionData.h:
1042         * UIProcess/API/APINavigation.h:
1043         (API::Navigation::openedViaWindowOpenWithOpener const):
1044         (API::Navigation::setOpenedViaWindowOpenWithOpener):
1045         * UIProcess/WebPageProxy.cpp:
1046         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1047         * UIProcess/WebProcessPool.cpp:
1048         (WebKit::WebProcessPool::processForNavigationInternal):
1049         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1050         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1051
1052 2018-09-13  Dean Jackson  <dino@grorg.org>
1053
1054         Generate warnings for Preferences files
1055         https://bugs.webkit.org/show_bug.cgi?id=189573
1056
1057         Reviewed by Sam Weinig.
1058
1059         Generate the "DO NOT EDIT" warnings, rather than have
1060         them in the template (which was confusing).
1061
1062         While here, simplify some of the templating generation code
1063         to avoid duplication.
1064
1065         * Scripts/GeneratePreferences.rb:
1066         * Scripts/PreferencesTemplates/WebPageUpdatePreferences.cpp.erb:
1067         * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb:
1068         * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
1069         * Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb:
1070         * Scripts/PreferencesTemplates/WebPreferencesKeys.cpp.erb:
1071         * Scripts/PreferencesTemplates/WebPreferencesKeys.h.erb:
1072         * Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb:
1073
1074 2018-09-13  Keith Rollin  <krollin@apple.com>
1075
1076         WebPageProxy::reportPageLoadResult can crash on some code paths
1077         https://bugs.webkit.org/show_bug.cgi?id=189568
1078
1079         Reviewed by Chris Dumez.
1080
1081         WebPageProxy::reportPageLoadResult (which is called from
1082         WebPageProxy::didFinishLoadForFrame) can sometimes crash when
1083         accessing m_pageLoadStart (a std::optional) in its unloaded state.
1084         Normally, m_pageLoadStart is initialized in
1085         WebPageProxy::didStartProvisionalLoadForFrame, which one would expect
1086         would be called before WebPageProxy::didFinishLoadForFrame. But that
1087         turns out to not always be the case. It's not apparent under what
1088         conditions didStartProvisionalLoadForFrame will not be called, but
1089         it's happening in the wild, leading to crashes now that std::optional
1090         asserts in release builds on bad accesses (see
1091         https://bugs.webkit.org/show_bug.cgi?id=189568).
1092
1093         Fix this by checking m_pageLoadState on entry to reportPageLoadResult.
1094
1095         * UIProcess/WebPageProxy.cpp:
1096         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
1097         (WebKit::WebPageProxy::didFinishLoadForFrame):
1098         (WebKit::WebPageProxy::didFailLoadForFrame):
1099         (WebKit::WebPageProxy::reportPageLoadResult):
1100
1101 2018-09-13  Chris Dumez  <cdumez@apple.com>
1102
1103         ProcessSwap.BackWithoutSuspendedPage API test hits assertion under WebPageProxy::didCreateMainFrame()
1104         https://bugs.webkit.org/show_bug.cgi?id=189599
1105
1106         Reviewed by Geoffrey Garen.
1107
1108         The code in WebPageProxy::reattachToWebProcess() was re-initializing m_mainFrame unconditionally in case
1109         of a HistoryNavigation. The reason we need to initialize m_mainFrame in reattachToWebProcess() is if the
1110         process we're reattaching to already has a WebPage (with a main frame), in which case
1111         WebPageProxy::didCreateMainFrame() would not get called to initialize WebPageProxy::m_mainFrame.
1112
1113         The process we're reattaching to can be in such a state only if it comes from a SuspendedPageProxy (we
1114         detached the WebProcessProxy from the WebPageProxy but kept the WebPage in the "suspended" WebProcess).
1115         It is true that we're only reattaching to a SuspendedPageProxy's process in the event of history
1116         navigations. However, it is not true that all history navigations will use a SuspendedPageProxy's process.
1117         For example, no SuspendedPageProxy may be available for the history navigation because the history
1118         was restored to a new view from disk, or because the WebBackForwardListItem no longer has a
1119         SuspendedPageProxy (we currently only keep a single SuspendedPageProxy for the last HistoryItem).
1120
1121         Therefore, unconditionally initializating m_mainFrame in reattachToWebProcess() for history navigations
1122         is incorrect and we should instead check if we're reattaching to a SuspendedPage's process.
1123
1124         Change is covered by ProcessSwap.BackWithoutSuspendedPage API test which is no longer crashes and
1125         existing Back/Forward PSON API tests which are still passing.
1126
1127         * UIProcess/WebPageProxy.cpp:
1128         (WebKit::WebPageProxy::reattachToWebProcess):
1129         (WebKit::WebPageProxy::continueNavigationInNewProcess):
1130         * UIProcess/WebPageProxy.h:
1131
1132 2018-09-13  Chris Dumez  <cdumez@apple.com>
1133
1134         Add release logging to help debug PSON issues
1135         https://bugs.webkit.org/show_bug.cgi?id=189562
1136
1137         Reviewed by Ryosuke Niwa.
1138
1139         Add release logging to help debug issues related to process swap on navigation.
1140
1141         * UIProcess/WebPageProxy.cpp:
1142         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1143         * UIProcess/WebProcessPool.cpp:
1144         (WebKit::WebProcessPool::processForNavigation):
1145         (WebKit::WebProcessPool::processForNavigationInternal):
1146         * UIProcess/WebProcessPool.h:
1147
1148 2018-09-13  Chris Dumez  <cdumez@apple.com>
1149
1150         Add null check for drawing area in WebPage::didCompletePageTransition() after r235867
1151         https://bugs.webkit.org/show_bug.cgi?id=189587
1152
1153         Reviewed by Geoffrey Garen.
1154
1155         Add null check for drawing area in WebPage::didCompletePageTransition() after r235867
1156         as this is causing crashes on the bots.
1157
1158         * WebProcess/WebPage/WebPage.cpp:
1159         (WebKit::WebPage::didCompletePageTransition):
1160
1161 2018-09-13  Ryan Haddad  <ryanhaddad@apple.com>
1162
1163         Unreviewed, rolling out r235953.
1164
1165         Caused layout test crashes under GuardMalloc.
1166
1167         Reverted changeset:
1168
1169         "Make GraphicsLayers ref-counted, so their tree can persist
1170         when disconnected from RenderLayerBackings"
1171         https://bugs.webkit.org/show_bug.cgi?id=189521
1172         https://trac.webkit.org/changeset/235953
1173
1174 2018-09-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1175
1176         [GTK][WPE] Allow to run script dialogs asynchronously in the UI process
1177         https://bugs.webkit.org/show_bug.cgi?id=189544
1178
1179         Reviewed by Michael Catanzaro.
1180
1181         Script dialogs are sync in the WebProcess, but we don't need to block the UI process while they are running. Our
1182         current API doesn't allow it, because it always expects the dialog to be closed in the signal handler. API
1183         changes are backwards compatible.
1184
1185         * UIProcess/API/glib/WebKitScriptDialog.cpp:
1186         (webkitScriptDialogCreate): Added to heap allocate a WebKitScriptDialog.
1187         (webkitScriptDialogIsRunning): Common implementation here, a script dialog is considered to be running if it has
1188         a competion handler pending.
1189         (webkit_script_dialog_ref): WebKitScriptDialog is now refcounted.
1190         (webkit_script_dialog_unref): Ditto.
1191         (webkit_script_dialog_close): New method to notify that we are done with the dialog.
1192         * UIProcess/API/glib/WebKitScriptDialogPrivate.h:
1193         (_WebKitScriptDialog::_WebKitScriptDialog): Use a single constructor and keep the completion handler.
1194         * UIProcess/API/glib/WebKitUIClient.cpp: Do not call the completion handler, pass it to the web view.
1195         * UIProcess/API/glib/WebKitWebView.cpp:
1196         (webkitWebViewDispose): Close the current script dialog if there's any.
1197         (webkit_web_view_class_init): Document how to handle dialogs asynchronously.
1198         (webkitWebViewRunJavaScriptAlert): Do not stack allocate the WebKitScriptDialog, create it with
1199         webkitScriptDialogCreate() passing the completion handler.
1200         (webkitWebViewRunJavaScriptConfirm): Ditto.
1201         (webkitWebViewRunJavaScriptPrompt): Ditto.
1202         (webkitWebViewRunJavaScriptBeforeUnloadConfirm): Ditto.
1203         * UIProcess/API/glib/WebKitWebViewPrivate.h:
1204         * UIProcess/API/gtk/WebKitScriptDialog.h:
1205         * UIProcess/API/gtk/WebKitScriptDialogGtk.cpp:
1206         (scriptDialogResponseCallback): Hnadle the response callback.
1207         (webkitScriptDialogRun): Do not use gtk_dialog_run(), connect to response signal and show the dialogs instead.
1208         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1209         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
1210         * UIProcess/API/wpe/WebKitScriptDialogWPE.cpp:
1211
1212 2018-09-12  Dan Bernstein  <mitz@apple.com>
1213
1214         Update availability annotations to match the macOS and iOS SDKs in the Xcode 10 GM seed
1215         https://bugs.webkit.org/show_bug.cgi?id=189561
1216
1217         Reviewed by Tim Horton.
1218
1219         Changed WK_MAC_TBA and WK_IOS_TBA to 10.14 and 12.0, respectively, in all declarations that
1220         appear in the GM seed SDKs.
1221
1222         * Shared/API/Cocoa/_WKRenderingProgressEvents.h:
1223         * UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h:
1224         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1225         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1226         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1227         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1228         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
1229         * UIProcess/API/Cocoa/WKViewPrivate.h:
1230         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1231         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1232         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
1233         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1234         * UIProcess/API/Cocoa/_WKAttachment.h:
1235         * UIProcess/API/Cocoa/_WKAutomationDelegate.h:
1236         * UIProcess/API/Cocoa/_WKAutomationSession.h:
1237         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
1238         * UIProcess/API/Cocoa/_WKFormInputSession.h:
1239         * UIProcess/API/Cocoa/_WKInputDelegate.h:
1240         * UIProcess/API/Cocoa/_WKLinkIconParameters.h:
1241         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1242         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1243         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
1244         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
1245         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
1246         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
1247
1248 2018-09-12  Dan Bernstein  <mitz@apple.com>
1249
1250         [Cocoa] Complete support for Paste as Quotation
1251         https://bugs.webkit.org/show_bug.cgi?id=189504
1252
1253         Reviewed by Wenson Hsieh.
1254
1255         * UIProcess/API/Cocoa/WKWebView.mm:
1256         (-[WKWebView canPerformAction:withSender:]): Handle _pasteAsQuotation:. It’s not included
1257           in FOR_EACH_WKCONTENTVIEW_ACTION, because it’s declared and implemented in the WKPrivate
1258           category. If we add more actions in the category, it could make sense to fold them into
1259           a new FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION.
1260         (-[WKWebView targetForAction:withSender:]): Handle _pasteAsQuotation:.
1261         (-[WKWebView _pasteAsQuotation:]): Send to the WebViewImpl or the WKContentView.
1262         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared a new _pasteAsQuotation: action.
1263
1264         * UIProcess/Cocoa/WebViewImpl.mm:
1265         (WebKit::selectorExceptionMap): Added a custom mapping from the new selector to the
1266           PasteAsQuotation command.
1267
1268         * UIProcess/ios/WKContentViewInteraction.h: Declare methods for the new action.
1269         * UIProcess/ios/WKContentViewInteraction.mm:
1270           Forward _pasteAsQuotation: to the WKWebView so that clients get a chance to override its
1271           behavior.
1272         (-[WKContentView _pasteAsQuotationForWebView:]): Send the command to the page.
1273
1274 2018-09-12  Sihui Liu  <sihui_liu@apple.com>
1275
1276         Move IndexedDB to Network Process
1277         https://bugs.webkit.org/show_bug.cgi?id=189415
1278
1279         Reviewed by Geoffrey Garen.
1280
1281         We are going to eliminate storage process and move its functionality to network process. 
1282         The reasons why we want to do this:
1283         1. Lower resource usage of having an additional process for storage operations, especially
1284         memory. Single storage process takes about 5MB memory on macOS.
1285         2. Reduce latency of Service Workers. After enabling Service Workers, we've seen
1286         regression in app launch. The launch time of storage process is partly attributed to this:
1287         Service Workers delay page loading until receiving response from storage process.
1288         3. We choose network process because UI process may have broader access in file system
1289         that we don't want the storage operations to have.
1290
1291         This patch is the first piece towards the goal. It mainly moves indexedDB from storage process
1292         to corresponding components of network process. Moving of Service Worker and stopping to 
1293         launch storage process will be done in following patches.
1294
1295         We expect to see the higher cpu and memory usage of network process as it is taking more work,
1296         but the overall gain in memory and latency after we completely remove storage process should be 
1297         positive.
1298
1299
1300         * CMakeLists.txt:
1301         * DerivedSources.make:
1302
1303         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp.
1304         (WebKit::WebIDBConnectionToClient::create):
1305         (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
1306         (WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient):
1307         (WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
1308         (WebKit::WebIDBConnectionToClient::messageSenderConnection):
1309         (WebKit::WebIDBConnectionToClient::connectionToClient):
1310         (WebKit::WebIDBConnectionToClient::didDeleteDatabase):
1311         (WebKit::WebIDBConnectionToClient::didOpenDatabase):
1312         (WebKit::WebIDBConnectionToClient::didAbortTransaction):
1313         (WebKit::WebIDBConnectionToClient::didCommitTransaction):
1314         (WebKit::WebIDBConnectionToClient::didCreateObjectStore):
1315         (WebKit::WebIDBConnectionToClient::didDeleteObjectStore):
1316         (WebKit::WebIDBConnectionToClient::didRenameObjectStore):
1317         (WebKit::WebIDBConnectionToClient::didClearObjectStore):
1318         (WebKit::WebIDBConnectionToClient::didCreateIndex):
1319         (WebKit::WebIDBConnectionToClient::didDeleteIndex):
1320         (WebKit::WebIDBConnectionToClient::didRenameIndex):
1321         (WebKit::WebIDBConnectionToClient::didPutOrAdd):
1322         (WebKit::WebIDBConnectionToClient::handleGetResult):
1323         (WebKit::WebIDBConnectionToClient::didGetRecord):
1324         (WebKit::WebIDBConnectionToClient::didGetAllRecords):
1325         (WebKit::WebIDBConnectionToClient::didGetCount):
1326         (WebKit::WebIDBConnectionToClient::didDeleteRecord):
1327         (WebKit::WebIDBConnectionToClient::didOpenCursor):
1328         (WebKit::WebIDBConnectionToClient::didIterateCursor):
1329         (WebKit::WebIDBConnectionToClient::fireVersionChangeEvent):
1330         (WebKit::WebIDBConnectionToClient::didStartTransaction):
1331         (WebKit::WebIDBConnectionToClient::didCloseFromServer):
1332         (WebKit::WebIDBConnectionToClient::notifyOpenDBRequestBlocked):
1333         (WebKit::WebIDBConnectionToClient::didGetAllDatabaseNames):
1334         (WebKit::WebIDBConnectionToClient::deleteDatabase):
1335         (WebKit::WebIDBConnectionToClient::openDatabase):
1336         (WebKit::WebIDBConnectionToClient::abortTransaction):
1337         (WebKit::WebIDBConnectionToClient::commitTransaction):
1338         (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
1339         (WebKit::WebIDBConnectionToClient::createObjectStore):
1340         (WebKit::WebIDBConnectionToClient::deleteObjectStore):
1341         (WebKit::WebIDBConnectionToClient::renameObjectStore):
1342         (WebKit::WebIDBConnectionToClient::clearObjectStore):
1343         (WebKit::WebIDBConnectionToClient::createIndex):
1344         (WebKit::WebIDBConnectionToClient::deleteIndex):
1345         (WebKit::WebIDBConnectionToClient::renameIndex):
1346         (WebKit::WebIDBConnectionToClient::putOrAdd):
1347         (WebKit::WebIDBConnectionToClient::getRecord):
1348         (WebKit::WebIDBConnectionToClient::getAllRecords):
1349         (WebKit::WebIDBConnectionToClient::getCount):
1350         (WebKit::WebIDBConnectionToClient::deleteRecord):
1351         (WebKit::WebIDBConnectionToClient::openCursor):
1352         (WebKit::WebIDBConnectionToClient::iterateCursor):
1353         (WebKit::WebIDBConnectionToClient::establishTransaction):
1354         (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
1355         (WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
1356         (WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
1357         (WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
1358         (WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
1359         (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
1360         (WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
1361         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.h.
1362         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Renamed from Source/WebKit/StorageProcess/IndexedDB/WebIDBConnectionToClient.messages.in.
1363         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1364         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
1365
1366         Code moved from StorageToWebProcessConnection::didReceiveMessage.
1367
1368         (WebKit::NetworkConnectionToWebProcess::didClose):
1369         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
1370
1371         Network process receives and stores sandbox extension of temporary files for later indexedDB
1372         use.
1373
1374         (WebKit::generateIDBConnectionToServerIdentifier):
1375         (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):
1376         (WebKit::NetworkConnectionToWebProcess::removeIDBConnectionToServer):
1377         * NetworkProcess/NetworkConnectionToWebProcess.h:
1378         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1379         * NetworkProcess/NetworkProcess.cpp:
1380         (WebKit::NetworkProcess::NetworkProcess):
1381         (WebKit::NetworkProcess::initializeNetworkProcess):
1382         (WebKit::NetworkProcess::addWebsiteDataStore):
1383         (WebKit::NetworkProcess::fetchWebsiteData):
1384         (WebKit::NetworkProcess::deleteWebsiteData):
1385         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
1386         (WebKit::NetworkProcess::idbServer):
1387         (WebKit::NetworkProcess::ensurePathExists):
1388         (WebKit::NetworkProcess::postStorageTask):
1389         (WebKit::NetworkProcess::performNextStorageTask):
1390         (WebKit::NetworkProcess::prepareForAccessToTemporaryFile):
1391         (WebKit::NetworkProcess::accessToTemporaryFileComplete):
1392         (WebKit::NetworkProcess::indexedDatabaseOrigins):
1393         (WebKit::NetworkProcess::addIndexedDatabaseSession):
1394         (WebKit::NetworkProcess::getSandboxExtensionsForBlobFiles):
1395
1396         Instead of asking UI process to grant sandbox extension to storage process, now network 
1397         process just asks for sandbox extension fot itself.
1398
1399         (WebKit::NetworkProcess::didGetSandboxExtensionsForBlobFiles):
1400         (WebKit::NetworkProcess::updateTemporaryFileSandboxExtensions):
1401         (WebKit::NetworkProcess::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
1402         (WebKit::NetworkProcess::didGrantSandboxExtensionsToStorageProcessForBlobs): Deleted.
1403         * NetworkProcess/NetworkProcess.h:
1404         (WebKit::NetworkProcess::queue):
1405         * NetworkProcess/NetworkProcess.messages.in:
1406         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1407         (WebKit::NetworkProcessCreationParameters::encode const):
1408         (WebKit::NetworkProcessCreationParameters::decode):
1409         * NetworkProcess/NetworkProcessCreationParameters.h:
1410         * Shared/Storage/StorageProcessCreationParameters.cpp:
1411         (WebKit::StorageProcessCreationParameters::encode const):
1412         (WebKit::StorageProcessCreationParameters::decode):
1413         * Shared/Storage/StorageProcessCreationParameters.h:
1414         * Shared/WebsiteDataStoreParameters.cpp:
1415         (WebKit::WebsiteDataStoreParameters::encode const):
1416         (WebKit::WebsiteDataStoreParameters::decode):
1417         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
1418         * Shared/WebsiteDataStoreParameters.h:
1419         * Sources.txt:
1420         * StorageProcess/StorageProcess.cpp:
1421         (WebKit::StorageProcess::initializeWebsiteDataStore):
1422         (WebKit::StorageProcess::fetchWebsiteData):
1423         (WebKit::StorageProcess::deleteWebsiteData):
1424         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
1425         (WebKit::StorageProcess::idbServer): Deleted.
1426         (WebKit::StorageProcess::grantSandboxExtensionsForBlobs): Deleted.
1427         (WebKit::StorageProcess::prepareForAccessToTemporaryFile): Deleted.
1428         (WebKit::StorageProcess::accessToTemporaryFileComplete): Deleted.
1429         (WebKit::StorageProcess::indexedDatabaseOrigins): Deleted.
1430         (WebKit::StorageProcess::getSandboxExtensionsForBlobFiles): Deleted.
1431         (WebKit::StorageProcess::didGetSandboxExtensionsForBlobFiles): Deleted.
1432         * StorageProcess/StorageProcess.h:
1433         (WebKit::StorageProcess::queue): Deleted.
1434         * StorageProcess/StorageProcess.messages.in:
1435         * StorageProcess/StorageToWebProcessConnection.cpp:
1436         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
1437         (WebKit::StorageToWebProcessConnection::didClose):
1438         (WebKit::generateIDBConnectionToServerIdentifier): Deleted.
1439         (WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer): Deleted.
1440         (WebKit::StorageToWebProcessConnection::removeIDBConnectionToServer): Deleted.
1441         * StorageProcess/StorageToWebProcessConnection.h:
1442         * StorageProcess/StorageToWebProcessConnection.messages.in:
1443         * UIProcess/Network/NetworkProcessProxy.cpp:
1444         (WebKit::NetworkProcessProxy::getSandboxExtensionsForBlobFiles):
1445         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs): Deleted.
1446         * UIProcess/Network/NetworkProcessProxy.h:
1447         * UIProcess/Network/NetworkProcessProxy.messages.in:
1448         * UIProcess/Storage/StorageProcessProxy.cpp:
1449         (WebKit::StorageProcessProxy::getSandboxExtensionsForBlobFiles): Deleted.
1450         * UIProcess/Storage/StorageProcessProxy.h:
1451         * UIProcess/Storage/StorageProcessProxy.messages.in:
1452         * UIProcess/WebProcessPool.cpp:
1453         (WebKit::WebProcessPool::ensureNetworkProcess):
1454         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
1455         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
1456         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1457         (WebKit::WebsiteDataStore::parameters):
1458         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1459         (WebKit::computeNetworkProcessAccessTypeForDataFetch):
1460         (WebKit::WebsiteDataStore::fetchDataAndApply):
1461         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
1462         (WebKit::WebsiteDataStore::removeData):
1463         (WebKit::WebsiteDataStore::storageProcessParameters):
1464         (WebKit::WebsiteDataStore::parameters):
1465         * WebKit.xcodeproj/project.pbxproj:
1466         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1467         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
1468         (WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
1469         (WebKit::WebIDBConnectionToServer::messageSenderConnection):
1470         * WebProcess/Databases/WebDatabaseProvider.cpp:
1471         (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
1472         * WebProcess/Network/NetworkProcessConnection.cpp:
1473         (WebKit::NetworkProcessConnection::didReceiveMessage):
1474         (WebKit::NetworkProcessConnection::didClose):
1475         (WebKit::NetworkProcessConnection::idbConnectionToServerForSession):
1476         * WebProcess/Network/NetworkProcessConnection.h:
1477         (WebKit::NetworkProcessConnection::existingIDBConnectionToServerForIdentifier):
1478         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
1479         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
1480
1481         Code moved from WebToStorageProcessConnection::didReceiveMessage.
1482
1483         (WebKit::WebToStorageProcessConnection::didClose):
1484         (WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession): Deleted.
1485         * WebProcess/Storage/WebToStorageProcessConnection.h:
1486         (WebKit::WebToStorageProcessConnection::existingIDBConnectionToServerForIdentifier): Deleted.
1487         * WebProcess/WebProcess.cpp:
1488         (WebKit::WebProcess::networkProcessConnectionClosed):
1489         (WebKit::WebProcess::webToStorageProcessConnectionClosed):
1490
1491 2018-09-11  Simon Fraser  <simon.fraser@apple.com>
1492
1493         Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings
1494         https://bugs.webkit.org/show_bug.cgi?id=189521
1495
1496         Reviewed by Tim Horton.
1497
1498         Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>.
1499         
1500         RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>.
1501         
1502         All the other changes are just to adapt to the new ownership patterns.
1503         
1504         I verified that no GraphicsLayers were leaked or abandoned after this change.
1505
1506         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
1507         (WebKit::WebInspectorClient::~WebInspectorClient):
1508         (WebKit::WebInspectorClient::showPaintRect):
1509         (WebKit::WebInspectorClient::animationEndedForLayer):
1510         * WebProcess/WebCoreSupport/WebInspectorClient.h:
1511         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
1512         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
1513         (WebKit::RemoteLayerTreeContext::createGraphicsLayer):
1514         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
1515         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1516         (WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
1517         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
1518
1519 2018-09-12  Chris Dumez  <cdumez@apple.com>
1520
1521         PSON: No process swap on back navigation after URL bar navigation
1522         https://bugs.webkit.org/show_bug.cgi?id=189557
1523         <rdar://problem/44353108>
1524
1525         Reviewed by Alex Christensen.
1526
1527         Our logic in WebProcessPool::processForNavigationInternal() was wrongly using
1528         WebBackForwardList::currentItem() as source item of the navigation, instead of
1529         using Navigation::fromItem(). In case of back navigation, by the time
1530         processForNavigation() is called, the WebBackForwardList's currentItem has already
1531         been updated to be the target item, via a Sync IPC from the WebProcess. As a result,
1532         the source and target items would be the same in the following check:
1533         ` if (currentItem->itemID().processIdentifier == backForwardListItem->itemID().processIdentifier)`
1534
1535         This would cause us to reuse the same process incorrectly. Our existing API test coverage
1536         did not catch this because our target HistoryItem usually has a SuspendedPage and we decide
1537         to use the SuspendedPage's process a few lines above in WebProcessPool::processForNavigationInternal().
1538
1539         * UIProcess/WebProcessPool.cpp:
1540         (WebKit::WebProcessPool::processForNavigationInternal):
1541
1542 2018-09-12  Alex Christensen  <achristensen@webkit.org>
1543
1544         Make IPC::SharedBufferDataReference a type that decodes into but does not inherit from IPC::DataReference
1545         https://bugs.webkit.org/show_bug.cgi?id=189519
1546
1547         Reviewed by Chris Dumez.
1548
1549         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1550         * NetworkProcess/NetworkResourceLoader.cpp:
1551         (WebKit::NetworkResourceLoader::bufferingTimerFired):
1552         (WebKit::NetworkResourceLoader::sendBuffer):
1553         * Platform/IPC/DataReference.cpp:
1554         (IPC::SharedBufferDataReference::encode const): Deleted.
1555         * Platform/IPC/DataReference.h:
1556         (IPC::SharedBufferDataReference::SharedBufferDataReference): Deleted.
1557         * Platform/IPC/HandleMessage.h:
1558         * Platform/IPC/SharedBufferDataReference.h: Added.
1559         (IPC::SharedBufferDataReference::SharedBufferDataReference):
1560         (IPC::SharedBufferDataReference::encode const):
1561         * Scripts/webkit/messages.py:
1562         * Shared/API/APIData.h:
1563         * StorageProcess/StorageProcess.messages.in:
1564         * UIProcess/WebPageProxy.messages.in:
1565         * UIProcess/WebURLSchemeTask.cpp:
1566         (WebKit::WebURLSchemeTask::didReceiveData):
1567         * WebKit.xcodeproj/project.pbxproj:
1568         * WebProcess/Network/WebLoaderStrategy.cpp:
1569         (WebKit::WebLoaderStrategy::storeDerivedDataToCache):
1570         * WebProcess/Network/WebResourceLoader.messages.in:
1571         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
1572         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
1573         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveBlobChunk):
1574         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1575         (WebKit::WebEditorClient::registerAttachmentIdentifier):
1576         * WebProcess/WebPage/WebPage.cpp:
1577         (WebKit::WebPage::getContentsAsMHTMLData):
1578         (WebKit::WebPage::getSelectionAsWebArchiveData):
1579         (WebKit::WebPage::getMainResourceDataOfFrame):
1580         (WebKit::WebPage::getResourceDataFromFrame):
1581         (WebKit::WebPage::getWebArchiveOfFrame):
1582         (WebKit::WebPage::drawPagesToPDF):
1583         * WebProcess/WebPage/WebPage.messages.in:
1584
1585 2018-09-11  Dean Jackson  <dino@apple.com>
1586
1587         Header parsing for experimental and internal debug features
1588         https://bugs.webkit.org/show_bug.cgi?id=189486
1589         <rdar://problem/44320618>
1590
1591         Reviewed by Tim Horton.
1592
1593         Provide key-based (string) access to experimental and internal features.
1594
1595         * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
1596         * Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb:
1597         * UIProcess/API/C/WKPreferences.cpp:
1598         (WKPreferencesSetExperimentalFeatureForKey):
1599         (WKPreferencesResetAllInternalDebugFeatures):
1600         (WKPreferencesSetInternalDebugFeatureForKey):
1601         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1602         * UIProcess/WebPreferences.h:
1603
1604 2018-09-10  Matt Rajca  <mrajca@apple.com>
1605
1606         Expose a few WebPlaybackControlsManager-driven PIP APIs to clients
1607         https://bugs.webkit.org/show_bug.cgi?id=189478
1608         <rdar://problem/44312650>
1609
1610         Reviewed by Eric Carlson.
1611
1612         This patch exposes APIs necessary to toggle PIP and query its status from clients of WKWebView.
1613         The existing PIP test has been updated to use the new APIs instead of simulating mouse clicks.
1614         I also increased the size of the video element in the test page so it gets picked up by the
1615         main content heuristics.
1616
1617         * UIProcess/API/Cocoa/WKWebView.mm:
1618         (-[WKWebView _updateMediaPlaybackControlsManager]): Create a media playback controls manager if necessary.
1619         (-[WKWebView _isPictureInPictureActive]): Return true if the "active" media element is in PIP.
1620         (-[WKWebView _togglePictureInPicture]): Toggle PIP on the "active" media element.
1621         (-[WKWebView _canTogglePictureInPicture]): Renamed from...
1622         (-[WKWebView _canTogglePictureInPictureForTesting]):
1623         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1624         * UIProcess/Cocoa/WebViewImpl.h:
1625         * UIProcess/Cocoa/WebViewImpl.mm:
1626         (WebKit::WebViewImpl::isPictureInPictureActive): Return true if the "active" media element is in PIP.
1627         (WebKit::WebViewImpl::togglePictureInPicture): Toggle PIP on the "active" media element.
1628         (WebKit::WebViewImpl::updateMediaPlaybackControlsManager): Let clients create a playback
1629          controls manager even when there is no Touch Bar present.
1630         (WebKit::WebViewImpl::updateMediaTouchBar): Extract some code into a helper method.
1631         (WebKit::WebViewImpl::canTogglePictureInPicture): Renamed from...
1632         (WebKit::WebViewImpl::canTogglePictureInPictureForTesting):
1633
1634 2018-09-12  Fujii Hironori  <Hironori.Fujii@sony.com>
1635
1636         [Win][Clang] error: non-constant-expression cannot be narrowed from type 'int' to 'SHORT'
1637         https://bugs.webkit.org/show_bug.cgi?id=189542
1638
1639         Reviewed by Alex Christensen.
1640
1641         * UIProcess/win/WebInspectorProxyWin.cpp:
1642         (WebKit::WebInspectorProxy::platformCreateFrontendPage): Narrowed initialWindowWidth and initialWindowHeight by using static_cast.
1643
1644 2018-09-12  Chris Dumez  <cdumez@apple.com>
1645
1646         Clean up SuspendedPageProxy
1647         https://bugs.webkit.org/show_bug.cgi?id=189517
1648
1649         Reviewed by Alex Christensen.
1650
1651         Clean up SuspendedPageProxy:
1652         1. SuspendedPageProxy does not need to be RefCounted. It is even dangerous given that WebPageProxy
1653            owns the SuspendedPageProxy and SuspendedPageProxy has a WebPageProxy& data member. We definitely
1654            do not want it to outlive its WebPageProxy.
1655         2. The SuspendedPageProxy destructor does not need to be virtual.
1656         3. Have WebBackForwardListItem keep a WeakPtr<SuspendedPageProxy> instead of a SuspendedPageProxy*.
1657            This is safer and avoid having to explicitly clear the pointer.
1658         4. m_finishedSuspending data member does not need a getter and is only needed if !LOG_DISABLED.
1659
1660         * Shared/WebBackForwardListItem.cpp:
1661         (WebKit::WebBackForwardListItem::setSuspendedPage):
1662         * Shared/WebBackForwardListItem.h:
1663         (WebKit::WebBackForwardListItem::suspendedPage const):
1664         * UIProcess/SuspendedPageProxy.cpp:
1665         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
1666         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
1667         (WebKit::SuspendedPageProxy::webProcessDidClose):
1668         (WebKit::SuspendedPageProxy::didFinishLoad):
1669         * UIProcess/SuspendedPageProxy.h:
1670         (WebKit::SuspendedPageProxy::process const):
1671         * UIProcess/WebPageProxy.cpp:
1672         (WebKit::WebPageProxy::maybeCreateSuspendedPage):
1673         (WebKit::WebPageProxy::reattachToWebProcess):
1674         * UIProcess/WebPageProxy.h:
1675
1676 2018-09-12  Guillaume Emont  <guijemont@igalia.com>
1677
1678         Add IGNORE_WARNING_.* macros
1679         https://bugs.webkit.org/show_bug.cgi?id=188996
1680
1681         Reviewed by Michael Catanzaro.
1682
1683         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1684         (WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
1685         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1686         (WebKit::NetworkProcess::platformSyncAllCookies):
1687         * PluginProcess/mac/PluginProcessMac.mm:
1688         (WebKit::beginModal):
1689         * PluginProcess/mac/PluginProcessShim.mm:
1690         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
1691         (WebKit::NetscapePluginModule::tryLoad):
1692         * Shared/ios/ChildProcessIOS.mm:
1693         (WebKit::ChildProcess::initializeSandbox):
1694         * Shared/mac/ChildProcessMac.mm:
1695         (WebKit::compileAndApplySandboxSlowCase):
1696         * Shared/mac/ColorSpaceData.mm:
1697         (WebKit::ColorSpaceData::decode):
1698         * Shared/mac/SandboxExtensionMac.mm:
1699         (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
1700         * UIProcess/API/Cocoa/WKWebView.mm:
1701         (-[WKWebView _web_superAccessibilityAttributeValue:]):
1702         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1703         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
1704         * UIProcess/API/glib/WebKitWebView.cpp:
1705         (webkitWebViewRunAsModal):
1706         * UIProcess/API/mac/WKView.mm:
1707         (-[WKView _web_superAccessibilityAttributeValue:]):
1708         * UIProcess/Cocoa/DownloadClient.mm:
1709         (WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
1710         * UIProcess/Cocoa/LegacyCustomProtocolManagerClient.mm:
1711         (-[WKCustomProtocolLoader initWithLegacyCustomProtocolManagerProxy:customProtocolID:request:]):
1712         * UIProcess/Cocoa/NavigationState.mm:
1713         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1714         * UIProcess/Cocoa/UIDelegate.mm:
1715         (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
1716         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1717         (WebKit::WebProcessPool::platformInitializeWebProcess):
1718         * UIProcess/Cocoa/WebViewImpl.mm:
1719         (-[WKTextListTouchBarViewController initWithWebViewImpl:]):
1720         (WebKit::WebViewImpl::updateWindowAndViewFrames):
1721         (WebKit::WebViewImpl::sendDragEndToPage):
1722         (WebKit::WebViewImpl::startDrag):
1723         (WebKit::WebViewImpl::characterIndexForPoint):
1724         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1725         (WebKit::PluginProcessProxy::getPluginProcessSerialNumber):
1726         (WebKit::PluginProcessProxy::makePluginProcessTheFrontProcess):
1727         (WebKit::PluginProcessProxy::makeUIProcessTheFrontProcess):
1728         (WebKit::PluginProcessProxy::exitFullscreen):
1729         * UIProcess/ios/SmartMagnificationController.mm:
1730         * UIProcess/ios/WKGeolocationProviderIOS.mm:
1731         * UIProcess/ios/WKLegacyPDFView.mm:
1732         * UIProcess/ios/WKPDFPageNumberIndicator.mm:
1733         (-[WKPDFPageNumberIndicator _makeRoundedCorners]):
1734         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
1735         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1736         (-[WKFileUploadPanel _presentPopoverWithContentViewController:animated:]):
1737         * UIProcess/ios/forms/WKFormColorControl.mm:
1738         (-[WKColorPopover initWithView:]):
1739         * UIProcess/ios/forms/WKFormInputControl.mm:
1740         (-[WKDateTimePopover initWithView:datePickerMode:]):
1741         * UIProcess/ios/forms/WKFormPopover.h:
1742         * UIProcess/ios/forms/WKFormPopover.mm:
1743         * UIProcess/ios/forms/WKFormSelectPopover.mm:
1744         (-[WKSelectPopover initWithView:hasGroups:]):
1745         * UIProcess/mac/PageClientImplMac.mm:
1746         (WebKit::PageClientImpl::screenToRootView):
1747         (WebKit::PageClientImpl::rootViewToScreen):
1748         * UIProcess/mac/WKFullScreenWindowController.mm:
1749         (-[WKFullScreenWindowController enterFullScreen:]):
1750         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
1751         (-[WKFullScreenWindowController exitFullScreen]):
1752         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
1753         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
1754         (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]):
1755         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
1756         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
1757         * UIProcess/mac/WKPrintingView.mm:
1758         (-[WKPrintingView _setAutodisplay:]):
1759         (-[WKPrintingView _drawPDFDocument:page:atPoint:]):
1760         (-[WKPrintingView _drawPreview:]):
1761         (-[WKPrintingView drawRect:]):
1762         * UIProcess/mac/WKTextInputWindowController.mm:
1763         (-[WKTextInputPanel _interpretKeyEvent:usingLegacyCocoaTextInput:string:]):
1764         (-[WKTextInputPanel _hasMarkedText]):
1765         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1766         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
1767         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
1768         (WebKit::initializeEventRecord):
1769         (WebKit::NetscapePlugin::sendComplexTextInput):
1770         (WebKit::makeCGLPresentLayerOpaque):
1771         (WebKit::NetscapePlugin::nullEventTimerFired):
1772         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1773         (-[WKPDFPluginAccessibilityObject accessibilityFocusedUIElement]):
1774         (-[WKPDFLayerControllerDelegate writeItemsToPasteboard:withTypes:]):
1775         (WebKit::PDFPlugin::handleEditingCommand):
1776         (WebKit::PDFPlugin::setActiveAnnotation):
1777         (WebKit:: const):
1778         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.h:
1779         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
1780         (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement):
1781         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h:
1782         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
1783         (WebKit::PDFPluginTextAnnotation::createAnnotationElement):
1784         * WebProcess/WebCoreSupport/WebAlternativeTextClient.h:
1785         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1786         (WebKit::convertImageToBitmap):
1787         (WebKit::WebDragClient::declareAndWriteDragImage):
1788         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
1789         * WebProcess/WebPage/mac/WebPageMac.mm:
1790         (WebKit::drawPDFPage):
1791
1792 2018-09-11  Olivia Barnett  <obarnett@apple.com>
1793
1794         Implement the Web Share API for mac
1795         https://bugs.webkit.org/show_bug.cgi?id=189443
1796
1797         Reviewed by Tim Horton.
1798
1799         * Shared/WebPreferencesDefaultValues.h:
1800         * UIProcess/API/Cocoa/WKWebView.mm:
1801         (-[WKWebView shareSheetDidDismiss:]):
1802         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1803         * UIProcess/API/mac/WKView.mm:
1804         (-[WKView shareSheetDidDismiss:]):
1805         * UIProcess/Cocoa/WebViewImpl.h:
1806         * UIProcess/Cocoa/WebViewImpl.mm:
1807         (WebKit::WebViewImpl::showShareSheet):
1808         (WebKit::WebViewImpl::shareSheetDidDismiss):
1809         Implemented function for WKShareSheetDelegate.
1810
1811         * UIProcess/Cocoa/WKShareSheet.h:
1812         * UIProcess/Cocoa/WKShareSheet.mm:
1813         (-[WKShareSheet initWithView:initWithView:]):
1814         (-[WKShareSheet presentWithParameters:completionHandler:]):
1815         (-[WKShareSheet sharingServicePicker:didChooseSharingService:]):
1816         (-[WKShareSheet _cancel]):
1817         (-[WKShareSheet dismiss]):
1818         (-[WKShareSheet _dismissDisplayAnimated:]):
1819         (-[WKShareSheet invokeShareSheetWithResolution:]):
1820         (-[WKShareSheet initWithView:]): Deleted.
1821         Added mac platform checks and share sheet functionality.
1822
1823         * UIProcess/mac/PageClientImplMac.h:
1824         * UIProcess/mac/PageClientImplMac.mm:
1825         (WebKit::PageClientImpl::showShareSheet):
1826         Allows macos to invoke the system share sheet.
1827
1828 2018-09-07  Dean Jackson  <dino@apple.com>
1829
1830         Add and expose Internal features from WebKit
1831         https://bugs.webkit.org/show_bug.cgi?id=189442
1832         <rdar://problem/44243404>
1833
1834         Reviewed by Simon Fraser.
1835
1836         Experimental features have become a mess. People are using them for
1837         anything that they want to be easily toggled from a host app (e.g.
1838         Safari), which means the user-facing menu has become large and
1839         confusing.
1840
1841         Introduce the idea of Internal features, that will be exposed in a way
1842         that end-users are not expected to ever see (unless they really want
1843         to).
1844
1845         * CMakeLists.txt: Add new files.
1846         * Sources.txt:
1847         * SourcesCocoa.txt:
1848         * WebKit.xcodeproj/project.pbxproj:
1849
1850         * DerivedSources.make: Add new generated files.
1851         * Scripts/GeneratePreferences.rb: Generate the preferences stuff for Internal Debug features.
1852         * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb:
1853         * Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb: Added.
1854
1855         * Shared/API/APIObject.h: New API object for InternalDebugFeature.
1856         * Shared/Cocoa/APIObject.mm:
1857         (API::Object::newObject):
1858
1859         * Shared/WebPreferences.yaml: Change some of the existing experimental features to "internal".
1860
1861         * UIProcess/API/APIInternalDebugFeature.cpp: New API type - just like APIExperimentalFeature.
1862         (API::InternalDebugFeature::create):
1863         (API::InternalDebugFeature::InternalDebugFeature):
1864         (API::InternalDebugFeature::~InternalDebugFeature):
1865         * UIProcess/API/APIInternalDebugFeature.h:
1866         * UIProcess/API/C/WKAPICast.h:
1867
1868         * UIProcess/API/Cocoa/WKPreferences.mm: Change the naming of the experimental feature API so that it
1869         won't clash with internal debug features. We can remove the old API once Safari has adopted.
1870         (+[WKPreferences _internalDebugFeatures]):
1871         (-[WKPreferences _isEnabledForInternalDebugFeature:]):
1872         (-[WKPreferences _setEnabled:forInternalDebugFeature:]):
1873         (-[WKPreferences _isEnabledForFeature:]):
1874         (-[WKPreferences _setEnabled:forFeature:]):
1875         (-[WKPreferences _isEnabledForExperimentalFeature:]):
1876         (-[WKPreferences _setEnabled:forExperimentalFeature:]):
1877         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1878
1879         * UIProcess/API/Cocoa/_WKInternalDebugFeature.h: New object - same as _WKExperimentalFeature.
1880         * UIProcess/API/Cocoa/_WKInternalDebugFeature.mm:
1881         (-[_WKInternalDebugFeature dealloc]):
1882         (-[_WKInternalDebugFeature description]):
1883         (-[_WKInternalDebugFeature name]):
1884         (-[_WKInternalDebugFeature key]):
1885         (-[_WKInternalDebugFeature details]):
1886         (-[_WKInternalDebugFeature defaultValue]):
1887         (-[_WKInternalDebugFeature isHidden]):
1888         (-[_WKInternalDebugFeature _apiObject]):
1889         * UIProcess/API/Cocoa/_WKInternalDebugFeatureInternal.h:
1890
1891         * UIProcess/WebPreferences.cpp: Add support for Internal Debug features.
1892         (WebKit::WebPreferences::updateBoolValueForInternalDebugFeatureKey):
1893         (WebKit::WebPreferences::updateBoolValueForExperimentalFeatureKey):
1894         * UIProcess/WebPreferences.h:
1895
1896         * UIProcess/WebProcessPool.cpp: Change a comment now that it is an internal feature.
1897         (WebKit::WebProcessPool::createWebPage):
1898
1899 2018-09-11  Eric Carlson  <eric.carlson@apple.com>
1900
1901         WebPage::close should clear UserMediaPermissionRequestManager
1902         https://bugs.webkit.org/show_bug.cgi?id=189369
1903         <rdar://problem/44196724>
1904
1905         Reviewed by Youenn Fablet.
1906
1907         * WebProcess/WebPage/WebPage.cpp:
1908         (WebKit::WebPage::close): Clear m_userMediaPermissionRequestManager.
1909
1910 2018-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1911
1912         [macOS] [WK2] Support changing foreground colors via color panel
1913         https://bugs.webkit.org/show_bug.cgi?id=189382
1914         <rdar://problem/44227311>
1915
1916         Reviewed by Ryosuke Niwa.
1917
1918         Adds support for changing font color in a richly editable element in WebKit2 via NSColorPanel. See below for
1919         more detail, as well as the WebCore ChangeLog.
1920
1921         * UIProcess/API/Cocoa/WKWebView.mm:
1922         (-[WKWebView changeColor:]):
1923
1924         Implement this selector; AppKit calls into this when changing font color using NSColorPanel.
1925
1926         * UIProcess/Cocoa/WebViewImpl.h:
1927         * UIProcess/Cocoa/WebViewImpl.mm:
1928         (WebKit::WebViewImpl::changeFontColorFromSender):
1929
1930         Creates and populates new FontAttributeChanges, with only the foreground color determined by asking the sender
1931         object for its -color.
1932
1933         * WebProcess/WebPage/mac/WebPageMac.mm:
1934
1935         Use the relevant EditAction for the incoming FontAttributeChanges, instead of always specifying
1936         EditAction::ChangeAttributes.
1937
1938         (WebKit::WebPage::changeFontAttributes):
1939
1940 2018-09-11  Myles C. Maxfield  <mmaxfield@apple.com>
1941
1942         Crash under PlatformPopupMenuData::encode when interacting with a select menu that has variable fonts
1943         https://bugs.webkit.org/show_bug.cgi?id=188008
1944
1945         Reviewed by Alex Christensen.
1946
1947         This patch is a follow-up to https://bugs.webkit.org/show_bug.cgi?id=180307.
1948         Variable fonts have CFDictionaries with non-string keys. We need to support that in our IPC code.
1949
1950         * Shared/cf/ArgumentCodersCF.cpp:
1951         (IPC::encode):
1952         (IPC::decode):
1953
1954 2018-09-11  Adrian Perez de Castro  <aperez@igalia.com>
1955
1956         [WPE][GTK] API documentation is unclear about how to modify requests before sending them
1957         https://bugs.webkit.org/show_bug.cgi?id=189505
1958
1959         Reviewed by Michael Catanzaro.
1960
1961         Add notes to the API documentation to make explicit where modification
1962         of WebKitURIRequest instances affects the request data sent over the
1963         network.
1964
1965         * UIProcess/API/glib/WebKitNavigationAction.cpp: Clarify that
1966         modifications to the associated WebKitURIRequest do not affect the
1967         actual request. Point to WebKitPage::send-request instead.
1968         * UIProcess/API/glib/WebKitResponsePolicyDecision.cpp: Ditto.
1969         * UIProcess/API/glib/WebKitWebView.cpp:
1970         (webkit_web_view_class_init): Ditto for the description of the
1971         WebKitWebView::decide-policy signal. Also fix the syntax of example.
1972         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
1973         (webkit_web_page_class_init): Indicate that modifications to the
1974         WebKitURIRequest will change the actual network request data.
1975
1976 2018-09-11  Michael Catanzaro  <mcatanzaro@igalia.com>
1977
1978         Unreviewed, attempt to fix Apple builds after r235903
1979         https://bugs.webkit.org/show_bug.cgi?id=188872
1980
1981         If it really needs to be inlined, it will need to move to the header....
1982
1983         * UIProcess/WebPageProxy.cpp:
1984         (WebKit::WebPageProxy::pageClient const):
1985
1986 2018-09-11  Michael Catanzaro  <mcatanzaro@igalia.com>
1987
1988         Unreviewed, fix build after r235903
1989         https://bugs.webkit.org/show_bug.cgi?id=188872
1990
1991         This broke all ports except GTK. Need to add a missing header.
1992
1993         * UIProcess/PageClient.h:
1994
1995 2018-09-11  Pablo Saavedra  <psaavedra@igalia.com>
1996
1997         Add missing #if ENABLE(VIDEO) WebProcess/FullScreen/WebFullScreenManager.cpp
1998         https://bugs.webkit.org/show_bug.cgi?id=189506
1999
2000         Reviewed by Tim Horton.
2001
2002         m_pipStandbyElement is only defined in
2003         WebKit/WebProcess/FullScreen/WebFullScreenManager.h
2004         only when ENABLE(VIDEO) (see
2005         https://bugs.webkit.org/show_bug.cgi?id=181338)
2006
2007         * WebProcess/FullScreen/WebFullScreenManager.cpp:
2008         (WebKit::WebFullScreenManager::setPIPStandbyElement):
2009
2010 2018-09-11  Michael Catanzaro  <mcatanzaro@igalia.com>
2011
2012         WebPageProxy should hold a WeakPtr to its PageClient
2013         https://bugs.webkit.org/show_bug.cgi?id=188872
2014
2015         Reviewed by Ryosuke Niwa.
2016
2017         This ensures the PageClient reference is always valid when used.
2018
2019         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2020         (WebKit::WebPageProxy::startDrag):
2021         (WebKit::WebPageProxy::setDragCaretRect):
2022         * UIProcess/PageClient.h:
2023         * UIProcess/WebPageProxy.cpp:
2024         (WebKit::PageClientProtector::PageClientProtector):
2025         (WebKit::PageClientProtector::~PageClientProtector):
2026         (WebKit::WebPageProxy::WebPageProxy):
2027         (WebKit::m_resetRecentCrashCountTimer):
2028         (WebKit::WebPageProxy::pageClient const):
2029         (WebKit::WebPageProxy::reattachToWebProcess):
2030         (WebKit::WebPageProxy::initializeWebPage):
2031         (WebKit::WebPageProxy::close):
2032         (WebKit::WebPageProxy::didChangeBackForwardList):
2033         (WebKit::WebPageProxy::willGoToBackForwardListItem):
2034         (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList):
2035         (WebKit::WebPageProxy::setViewNeedsDisplay):
2036         (WebKit::WebPageProxy::requestScroll):
2037         (WebKit::WebPageProxy::viewScrollPosition const):
2038         (WebKit::WebPageProxy::updateActivityState):
2039         (WebKit::WebPageProxy::activityStateDidChange):
2040         (WebKit::WebPageProxy::viewDidEnterWindow):
2041         (WebKit::WebPageProxy::dispatchActivityStateChange):
2042         (WebKit::WebPageProxy::layerHostingModeDidChange):
2043         (WebKit::WebPageProxy::viewSize const):
2044         (WebKit::WebPageProxy::startDrag):
2045         (WebKit::WebPageProxy::didPerformDragOperation):
2046         (WebKit::WebPageProxy::processNextQueuedMouseEvent):
2047         (WebKit::WebPageProxy::findPlugin):
2048         (WebKit::WebPageProxy::handleTouchEventSynchronously):
2049         (WebKit::WebPageProxy::handleTouchEvent):
2050         (WebKit::WebPageProxy::preferencesDidChange):
2051         (WebKit::WebPageProxy::didCreateMainFrame):
2052         (WebKit::WebPageProxy::didCreateSubframe):
2053         (WebKit::WebPageProxy::didStartProgress):
2054         (WebKit::WebPageProxy::didChangeProgress):
2055         (WebKit::WebPageProxy::didFinishProgress):
2056         (WebKit::WebPageProxy::didDestroyNavigation):
2057         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
2058         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
2059         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
2060         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
2061         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
2062         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
2063         (WebKit::WebPageProxy::didCommitLoadForFrame):
2064         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
2065         (WebKit::WebPageProxy::didFinishLoadForFrame):
2066         (WebKit::WebPageProxy::didFailLoadForFrame):
2067         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
2068         (WebKit::WebPageProxy::didReceiveTitleForFrame):
2069         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
2070         (WebKit::WebPageProxy::didReachLayoutMilestone):
2071         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
2072         (WebKit::WebPageProxy::didRunInsecureContentForFrame):
2073         (WebKit::WebPageProxy::frameDidBecomeFrameSet):
2074         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2075         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
2076         (WebKit::WebPageProxy::decidePolicyForResponse):
2077         (WebKit::WebPageProxy::unableToImplementPolicy):
2078         (WebKit::WebPageProxy::didNavigateWithNavigationData):
2079         (WebKit::WebPageProxy::didPerformClientRedirect):
2080         (WebKit::WebPageProxy::didPerformServerRedirect):
2081         (WebKit::WebPageProxy::didUpdateHistoryTitle):
2082         (WebKit::WebPageProxy::closePage):
2083         (WebKit::WebPageProxy::setWindowFrame):
2084         (WebKit::WebPageProxy::getWindowFrame):
2085         (WebKit::WebPageProxy::getWindowFrameWithCallback):
2086         (WebKit::WebPageProxy::screenToRootView):
2087         (WebKit::WebPageProxy::rootViewToScreen):
2088         (WebKit::WebPageProxy::syncRootViewToScreen):
2089         (WebKit::WebPageProxy::accessibilityScreenToRootView):
2090         (WebKit::WebPageProxy::rootViewToAccessibilityScreen):
2091         (WebKit::WebPageProxy::didChangeViewportProperties):
2092         (WebKit::WebPageProxy::runOpenPanel):
2093         (WebKit::WebPageProxy::showShareSheet):
2094         (WebKit::WebPageProxy::handleDownloadRequest):
2095         (WebKit::WebPageProxy::didChangeContentSize):
2096         (WebKit::WebPageProxy::showColorPicker):
2097         (WebKit::WebPageProxy::showDataListSuggestions):
2098         (WebKit::WebPageProxy::compositionWasCanceled):
2099         (WebKit::WebPageProxy::registerInsertionUndoGrouping):
2100         (WebKit::WebPageProxy::canUndoRedo):
2101         (WebKit::WebPageProxy::executeUndoRedo):
2102         (WebKit::WebPageProxy::clearAllEditCommands):
2103         (WebKit::WebPageProxy::setTextIndicator):
2104         (WebKit::WebPageProxy::clearTextIndicator):
2105         (WebKit::WebPageProxy::setTextIndicatorAnimationProgress):
2106         (WebKit::WebPageProxy::showPopupMenu):
2107         (WebKit::WebPageProxy::showContextMenu):
2108         (WebKit::WebPageProxy::registerEditCommand):
2109         (WebKit::WebPageProxy::canUndo):
2110         (WebKit::WebPageProxy::canRedo):
2111         (WebKit::WebPageProxy::setToolTip):
2112         (WebKit::WebPageProxy::setCursor):
2113         (WebKit::WebPageProxy::setCursorHiddenUntilMouseMoves):
2114         (WebKit::WebPageProxy::didReceiveEvent):
2115         (WebKit::WebPageProxy::resetState):
2116         (WebKit::WebPageProxy::resetStateAfterProcessExited):
2117         (WebKit::WebPageProxy::creationParameters):
2118         (WebKit::WebPageProxy::enterAcceleratedCompositingMode):
2119         (WebKit::WebPageProxy::exitAcceleratedCompositingMode):
2120         (WebKit::WebPageProxy::updateAcceleratedCompositingMode):
2121         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
2122         (WebKit::WebPageProxy::recommendedScrollbarStyleDidChange):
2123         (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
2124         (WebKit::WebPageProxy::didFinishLoadingDataForCustomContentProvider):
2125         (WebKit::WebPageProxy::updateBackingStoreDiscardableState):
2126         (WebKit::WebPageProxy::showCorrectionPanel):
2127         (WebKit::WebPageProxy::dismissCorrectionPanel):
2128         (WebKit::WebPageProxy::dismissCorrectionPanelSoon):
2129         (WebKit::WebPageProxy::recordAutocorrectionResponse):
2130         (WebKit::WebPageProxy::useDarkAppearance const):
2131         (WebKit::WebPageProxy::showDictationAlternativeUI):
2132         (WebKit::WebPageProxy::removeDictationAlternatives):
2133         (WebKit::WebPageProxy::dictationAlternatives):
2134         (WebKit::WebPageProxy::setEditableElementIsFocused):
2135         (WebKit::WebPageProxy::takeViewSnapshot):
2136         (WebKit::WebPageProxy::wrapCryptoKey):
2137         (WebKit::WebPageProxy::unwrapCryptoKey):
2138         (WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
2139         (WebKit::WebPageProxy::navigationGestureDidBegin):
2140         (WebKit::WebPageProxy::navigationGestureWillEnd):
2141         (WebKit::WebPageProxy::navigationGestureDidEnd):
2142         (WebKit::WebPageProxy::willRecordNavigationSnapshot):
2143         (WebKit::WebPageProxy::navigationGestureSnapshotWasRemoved):
2144         (WebKit::WebPageProxy::isPlayingMediaDidChange):
2145         (WebKit::WebPageProxy::videoControlsManagerDidChange):
2146         (WebKit::WebPageProxy::handleControlledElementIDResponse const):
2147         (WebKit::WebPageProxy::didPerformImmediateActionHitTest):
2148         (WebKit::WebPageProxy::immediateActionAnimationControllerForHitTestResult):
2149         (WebKit::WebPageProxy::didHandleAcceptedCandidate):
2150         (WebKit::WebPageProxy::addPlaybackTargetPickerClient):
2151         (WebKit::WebPageProxy::removePlaybackTargetPickerClient):
2152         (WebKit::WebPageProxy::showPlaybackTargetPicker):
2153         (WebKit::WebPageProxy::playbackTargetPickerClientStateDidChange):
2154         (WebKit::WebPageProxy::setMockMediaPlaybackTargetPickerEnabled):
2155         (WebKit::WebPageProxy::setMockMediaPlaybackTargetPickerState):
2156         (WebKit::WebPageProxy::didChangeBackgroundColor):
2157         (WebKit::WebPageProxy::didRestoreScrollPosition):
2158         (WebKit::WebPageProxy::userInterfaceLayoutDirection):
2159         (WebKit::WebPageProxy::didInsertAttachment):
2160         (WebKit::WebPageProxy::didRemoveAttachment):
2161         * UIProcess/WebPageProxy.h:
2162         * UIProcess/gstreamer/WebPageProxyGStreamer.cpp:
2163         (WebKit::WebPageProxy::requestInstallMissingMediaPlugins):
2164         * UIProcess/gtk/WebPageProxyGtk.cpp:
2165         (WebKit::WebPageProxy::viewWidget):
2166         (WebKit::WebPageProxy::editorStateChanged):
2167         * UIProcess/ios/WebPageProxyIOS.mm:
2168         (WebKit::WebPageProxy::computeCustomFixedPositionRect const):
2169         (WebKit::WebPageProxy::overflowScrollViewWillStartPanGesture):
2170         (WebKit::WebPageProxy::overflowScrollViewDidScroll):
2171         (WebKit::WebPageProxy::overflowScrollWillStartScroll):
2172         (WebKit::WebPageProxy::overflowScrollDidEndScroll):
2173         (WebKit::WebPageProxy::didCommitLayerTree):
2174         (WebKit::WebPageProxy::layerTreeCommitComplete):
2175         (WebKit::WebPageProxy::didReceivePositionInformation):
2176         (WebKit::WebPageProxy::saveImageToLibrary):
2177         (WebKit::WebPageProxy::interpretKeyEvent):
2178         (WebKit::WebPageProxy::registerWebProcessAccessibilityToken):
2179         (WebKit::WebPageProxy::couldNotRestorePageState):
2180         (WebKit::WebPageProxy::restorePageState):
2181         (WebKit::WebPageProxy::restorePageCenterAndScale):
2182         (WebKit::WebPageProxy::didGetTapHighlightGeometries):
2183         (WebKit::WebPageProxy::startAssistingNode):
2184         (WebKit::WebPageProxy::stopAssistingNode):
2185         (WebKit::WebPageProxy::showInspectorHighlight):
2186         (WebKit::WebPageProxy::hideInspectorHighlight):
2187         (WebKit::WebPageProxy::showInspectorIndication):
2188         (WebKit::WebPageProxy::hideInspectorIndication):
2189         (WebKit::WebPageProxy::enableInspectorNodeSearch):
2190         (WebKit::WebPageProxy::disableInspectorNodeSearch):
2191         (WebKit::WebPageProxy::setAcceleratedCompositingRootLayer):
2192         (WebKit::WebPageProxy::showPlaybackTargetPicker):
2193         (WebKit::WebPageProxy::commitPotentialTapFailed):
2194         (WebKit::WebPageProxy::didNotHandleTapAsClick):
2195         (WebKit::WebPageProxy::didCompleteSyntheticClick):
2196         (WebKit::WebPageProxy::disableDoubleTapGesturesDuringTapIfNecessary):
2197         (WebKit::WebPageProxy::editorStateChanged):
2198         (WebKit::WebPageProxy::showValidationMessage):
2199         (WebKit::WebPageProxy::didHandleStartDataInteractionRequest):
2200         (WebKit::WebPageProxy::didHandleAdditionalDragItemsRequest):
2201         (WebKit::WebPageProxy::didConcludeEditDataInteraction):
2202         (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame):
2203         * UIProcess/mac/WebPageProxyMac.mm:
2204         (WebKit::WebPageProxy::windowAndViewFramesChanged):
2205         (WebKit::WebPageProxy::insertDictatedTextAsync):
2206         (WebKit::WebPageProxy::setPromisedDataForImage):
2207         (WebKit::WebPageProxy::didPerformDictionaryLookup):
2208         (WebKit::WebPageProxy::registerWebProcessAccessibilityToken):
2209         (WebKit::WebPageProxy::makeFirstResponder):
2210         (WebKit::WebPageProxy::assistiveTechnologyMakeFirstResponder):
2211         (WebKit::WebPageProxy::colorSpace):
2212         (WebKit::WebPageProxy::pluginFocusOrWindowFocusChanged):
2213         (WebKit::WebPageProxy::setPluginComplexTextInputState):
2214         (WebKit::WebPageProxy::executeSavedCommandBySelector):
2215         (WebKit::WebPageProxy::intrinsicContentSizeDidChange):
2216         (WebKit::WebPageProxy::setAcceleratedCompositingRootLayer):
2217         (WebKit::WebPageProxy::acceleratedCompositingRootLayer const):
2218         (WebKit::WebPageProxy::showPDFContextMenu):
2219         (WebKit::WebPageProxy::showTelephoneNumberMenu):
2220         (WebKit::WebPageProxy::boundsOfLayerInLayerBackedWindowCoordinates const):
2221         (WebKit::WebPageProxy::editorStateChanged):
2222         (WebKit::WebPageProxy::startWindowDrag):
2223         (WebKit::WebPageProxy::platformWindow):
2224         (WebKit::WebPageProxy::rootViewToWindow):
2225         (WebKit::WebPageProxy::showValidationMessage):
2226         (WebKit::WebPageProxy::inspectorAttachmentView):
2227         (WebKit::WebPageProxy::remoteObjectRegistry):
2228         * UIProcess/win/WebPageProxyWin.cpp:
2229         (WebKit::WebPageProxy::viewWidget):
2230         * UIProcess/wpe/WebPageProxyWPE.cpp:
2231         (WebKit::WebPageProxy::viewBackend):
2232
2233 2018-09-11  Chris Dumez  <cdumez@apple.com>
2234
2235         Regression(PSON): "Swipe back" snapshot is missing when navigating back cross-process
2236         https://bugs.webkit.org/show_bug.cgi?id=189482
2237         <rdar://problem/44317222>
2238
2239         Reviewed by Geoffrey Garen.
2240
2241         The issue was that when we swap process on navigation, we:
2242         1. Call processDidTerminate() which calls resetState() and clears the displayed content
2243         2. Reattach the WebPageProxy to a new WebProcess
2244         3. Trigger the navigation
2245         4. Take the navigation snapshot
2246
2247         When the navigation snapshot occurs at step 4, the view is already blank in the case of
2248         process swap. To avoid the issue, we take the navigation snapshot earlier, before calling
2249         processDidTerminate() and we suppress the next navigation snapshot as it would be blank.
2250
2251         At some point, we will likely want to display the previous' WebProcess content longer,
2252         until the new WebProcess has something interesting to display. Once this is implemented,
2253         we'll likely be able to drop the early snapshotting logic.
2254
2255         * UIProcess/WebPageProxy.cpp:
2256         (WebKit::WebPageProxy::recordAutomaticNavigationSnapshot):
2257         (WebKit::WebPageProxy::continueNavigationInNewProcess):
2258         (WebKit::WebPageProxy::restoreFromSessionState):
2259         (WebKit::WebPageProxy::didCommitLoadForFrame):
2260         * UIProcess/WebPageProxy.h:
2261         (WebKit::WebPageProxy::suppressNextAutomaticNavigationSnapshot):
2262
2263 2018-09-11  Woodrow Wang  <woodrow_wang@apple.com>
2264
2265         Add Web API Statistics Collection
2266         https://bugs.webkit.org/show_bug.cgi?id=187773
2267         <rdar://problem/44155162>
2268
2269         Reviewed by Brent Fulgham.
2270
2271         * Shared/WebCoreArgumentCoders.cpp:
2272         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
2273         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
2274         * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
2275
2276 == Rolled over to ChangeLog-2018-09-11 ==