Regression(r248533) Assertion hit in isMainThread() for some clients using WTF becaus...
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-08-24  Chris Dumez  <cdumez@apple.com>
2
3         Make CacheStorageEngineCaches's decodeCachesNames() more robust against bad input data
4         https://bugs.webkit.org/show_bug.cgi?id=201102
5
6         Reviewed by Antti Koivisto.
7
8         Use Vector::tryReserveCapacity() instead of Vector::reserveInitialCapacity() in CacheStorage::decodeCachesNames()
9         since the size is read from disk and thus cannot be trusted. If the size is too large, reserveInitialCapacity()
10         would end up crashing the network process. Now, we merely discard the data if tryReserveCapacity() fails because
11         the size is too large.
12
13         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
14         (WebKit::CacheStorage::decodeCachesNames):
15
16 2019-08-23  Wenson Hsieh  <wenson_hsieh@apple.com>
17
18         [iOS] [WebKit2] Tapping on the “I’m” text suggestion after typing “i’” does nothing
19         https://bugs.webkit.org/show_bug.cgi?id=201085
20         <rdar://problem/53056118>
21
22         Reviewed by Tim Horton.
23
24         Currently, logic in applyAutocorrectionInternal only selects the range to autocorrect if the text of the range
25         matches the string to replace (delivered to us from UIKit). In the case of changing "I’" to "I’m", the string to
26         replace is "I'" (with a straight quote rather than an apostrophe), even though the DOM contains an apostrophe.
27
28         This is because kbd believes that the document context contains straight quotes (rather than apostrophes). For
29         native text views, this works out because UIKit uses relative UITextPositions to determine the replacement
30         range rather than by checking against the contents of the document. However, WKWebView does not have the ability
31         to synchronously compute and reason about arbitrary UITextPositions relative to the selection, so we instead
32         search for the string near the current selection when applying autocorrections.
33
34         Of course, this doesn't work in this scenario because the replacement string contains a straight quote, yet the
35         text node contains an apostrophe, so we bail and don't end up replacing any text. To address this, we repurpose
36         TextIterator helpers currently used to allow find-in-page to match straight quotes against apostrophes; instead
37         of matching the replacement string exactly, we instead match the quote-folded versions of these strings when
38         finding the range to replace.
39
40         Test: fast/events/ios/autocorrect-with-apostrophe.html
41
42         * WebProcess/WebPage/ios/WebPageIOS.mm:
43         (WebKit::WebPage::applyAutocorrectionInternal):
44
45 2019-08-23  Jiewen Tan  <jiewen_tan@apple.com>
46
47         Unreviewed, build fix after r249059
48
49         * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm:
50         (WebKit::NfcConnection::NfcConnection):
51         Remove the HAVE() macro.
52
53 2019-08-23  Chris Dumez  <cdumez@apple.com>
54
55         [geolocation] Rename interfaces and remove [NoInterfaceObject]
56         https://bugs.webkit.org/show_bug.cgi?id=200885
57
58         Reviewed by Alex Christensen.
59
60         * Shared/WebGeolocationPosition.cpp:
61         (WebKit::WebGeolocationPosition::create):
62         * Shared/WebGeolocationPosition.h:
63         (WebKit::WebGeolocationPosition::corePosition const):
64         (WebKit::WebGeolocationPosition::WebGeolocationPosition):
65         * UIProcess/API/C/WKGeolocationPosition.cpp:
66         (WKGeolocationPositionCreate_c):
67         * UIProcess/WebGeolocationManagerProxy.h:
68         (WebKit::WebGeolocationManagerProxy::lastPosition const):
69         * UIProcess/ios/WKGeolocationProviderIOS.mm:
70         (-[WKLegacyCoreLocationProvider positionChanged:]):
71         * WebProcess/Geolocation/WebGeolocationManager.cpp:
72         (WebKit::WebGeolocationManager::didChangePosition):
73         * WebProcess/Geolocation/WebGeolocationManager.h:
74         * WebProcess/Geolocation/WebGeolocationManager.messages.in:
75         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
76         (WebKit::WebGeolocationClient::lastPosition):
77         * WebProcess/WebCoreSupport/WebGeolocationClient.h:
78
79 2019-08-23  Ryan Haddad  <ryanhaddad@apple.com>
80
81         Unreviewed, rolling out r249001.
82
83         Caused one layout test to fail on all configurations and
84         another to time out on Catalina / iOS 13.
85
86         Reverted changeset:
87
88         "Add a WebsiteDataStore delegate to handle
89         AuthenticationChallenge that do not come from pages"
90         https://bugs.webkit.org/show_bug.cgi?id=196870
91         https://trac.webkit.org/changeset/249001
92
93 2019-08-23  Brian Burg  <bburg@apple.com>
94
95         REGRESSION(r248713): WebDriver commands which target the implicit main frame now hit an ASSERT
96         https://bugs.webkit.org/show_bug.cgi?id=200793
97         <rdar://problem/54516988>
98
99         Reviewed by Chris Dumez.
100
101         SimulatedInputDispatcher and its callers need to support Optional<FrameIdentifier>
102         and WTF::nullopt as an encoding for the implicit main frame.
103
104         * UIProcess/Automation/SimulatedInputDispatcher.h:
105         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
106         (WebKit::SimulatedInputDispatcher::resolveLocation):
107         (WebKit::SimulatedInputDispatcher::run):
108
109         * UIProcess/Automation/WebAutomationSession.h:
110         * UIProcess/Automation/WebAutomationSession.cpp:
111         (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
112         (WebKit::WebAutomationSession::performInteractionSequence):
113         (WebKit::WebAutomationSession::cancelInteractionSequence):
114
115 2019-08-20  Jiewen Tan  <jiewen_tan@apple.com>
116
117         [WebAuthn] Support NFC authenticators for iOS
118         https://bugs.webkit.org/show_bug.cgi?id=188624
119         <rdar://problem/43354214>
120
121         Reviewed by Chris Dumez.
122
123         This patch implements support for NFC authenticators including both FIDO2 and U2F ones. It utilizes a private
124         framework called NearField instead of CoreNFC to be able to supply a custom UI later if necessary.
125
126         The patch follows almost the same flow as previous HID and Local authenticator support.
127         1) Discovery is via NfcService which will invoke NFHardwareManager to start a generic NFC reader session.
128         2) Once a reader session is established, a NfcConnection is created to start the polling and register the WKNFReaderSessionDelegate
129         to wait for 'didDetectTags'.
130         3) When tags are detected, NfcConnection will determine if it meets our requriements: { type, connectability, fido applet availability }.
131         The first tag that meets all requirement will then be returned for WebAuthn operations.
132         4) The first WebAuthn operation is to send authenticatorGetInfo command to determine the supported protocol, and then initialize corresponding
133         authenticators. Noted, the sending/receiving of this command is now abstracted into FidoService which will be shared across HidService and NfcService.
134         5) From then, the actual WebAuthn request, either makeCredential or getAssertion will be sent.
135
136         For testing, this patch follows the same flow as well.
137         1) MockNfcService overrides NfcService to mock the behavior of NFC Tags discovery.
138         2) The same class also swizzles methods from NFReaderSession to mock tag connection and communication.
139
140         * Platform/spi/Cocoa/NearFieldSPI.h: Added.
141         * Sources.txt:
142         * SourcesCocoa.txt:
143         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
144         (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration):
145         * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
146         (WebKit::AuthenticatorManagerInternal::collectTransports):
147         * UIProcess/WebAuthentication/AuthenticatorTransportService.cpp:
148         (WebKit::AuthenticatorTransportService::create):
149         (WebKit::AuthenticatorTransportService::createMock):
150         * UIProcess/WebAuthentication/Cocoa/HidService.h:
151         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
152         (WebKit::HidService::HidService):
153         (WebKit::HidService::deviceAdded):
154         (WebKit::HidService::continueAddDeviceAfterGetInfo): Deleted.
155         * UIProcess/WebAuthentication/Cocoa/NearFieldSoftLink.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
156         * UIProcess/WebAuthentication/Cocoa/NearFieldSoftLink.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
157         * UIProcess/WebAuthentication/Cocoa/NfcConnection.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
158         * UIProcess/WebAuthentication/Cocoa/NfcConnection.mm: Added.
159         (WebKit::fido::compareVersion):
160         (WebKit::NfcConnection::NfcConnection):
161         (WebKit::NfcConnection::~NfcConnection):
162         (WebKit::NfcConnection::transact const):
163         (WebKit::NfcConnection::didDetectTags const):
164         * UIProcess/WebAuthentication/Cocoa/NfcService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
165         * UIProcess/WebAuthentication/Cocoa/NfcService.mm: Added.
166         (WebKit::NfcService::NfcService):
167         (WebKit::NfcService::~NfcService):
168         (WebKit::NfcService::didConnectTag):
169         (WebKit::NfcService::startDiscoveryInternal):
170         (WebKit::NfcService::platformStartDiscovery):
171         * UIProcess/WebAuthentication/Cocoa/WKNFReaderSessionDelegate.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
172         * UIProcess/WebAuthentication/Cocoa/WKNFReaderSessionDelegate.mm: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
173         (-[WKNFReaderSessionDelegate initWithConnection:]):
174         (-[WKNFReaderSessionDelegate readerSession:didDetectTags:]):
175         * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
176         (WebKit::MockHidConnection::send):
177         (WebKit::MockHidConnection::registerDataReceivedCallbackInternal):
178         (WebKit::MockHidConnection::parseRequest):
179         (WebKit::MockHidConnection::feedReports):
180         (WebKit::MockHidConnection::shouldContinueFeedReports):
181         * UIProcess/WebAuthentication/Mock/MockNfcService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
182         * UIProcess/WebAuthentication/Mock/MockNfcService.mm: Added.
183         (-[WKMockNFTag type]):
184         (-[WKMockNFTag initWithNFTag:]):
185         (-[WKMockNFTag description]):
186         (-[WKMockNFTag isEqualToNFTag:]):
187         (-[WKMockNFTag initWithType:]):
188         (WebKit::MockNfcService::MockNfcService):
189         (WebKit::MockNfcService::transceive):
190         (WebKit::MockNfcService::platformStartDiscovery):
191         (WebKit::MockNfcService::detectTags const):
192         * UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h:
193         * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp:
194         * UIProcess/WebAuthentication/fido/CtapAuthenticator.h:
195         * UIProcess/WebAuthentication/fido/CtapNfcDriver.cpp: Added.
196         (WebKit::CtapNfcDriver::CtapNfcDriver):
197         (WebKit::CtapNfcDriver::transact):
198         (WebKit::CtapNfcDriver::respondAsync const):
199         * UIProcess/WebAuthentication/fido/CtapNfcDriver.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
200         * UIProcess/WebAuthentication/fido/FidoService.cpp: Added.
201         (WebKit::FidoService::FidoService):
202         (WebKit::FidoService::getInfo):
203         (WebKit::FidoService::continueAfterGetInfo):
204         * UIProcess/WebAuthentication/fido/FidoService.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h.
205         * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp:
206         * UIProcess/WebAuthentication/fido/U2fAuthenticator.h:
207         * UIProcess/ios/WebPageProxyIOS.mm:
208         * WebKit.xcodeproj/project.pbxproj:
209
210 2019-08-23  Kate Cheney  <katherine_cheney@apple.com>
211
212         Support ITP on a per-session basis (198923)
213         https://bugs.webkit.org/show_bug.cgi?id=198923
214
215         Reviewed by Chris Dumez.
216
217         The original implementation of resourceLoadStatisticsUpdated
218         did not allow for ITP on a per session basis due to the sessionID
219         not being passed to the resourceLoadStatisticsUpdated function.
220         This patch allows access of the correct networkSession by passing
221         all resourceLoadStatistics in a new data structure of key-value
222         pairs, where the sessionID is the key.
223
224         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
225         (WebKit::NetworkConnectionToWebProcess::resourceLoadStatisticsUpdated):
226         * NetworkProcess/NetworkConnectionToWebProcess.h:
227         * WebProcess/WebProcess.cpp:
228
229 2019-08-23  Russell Epstein  <repstein@apple.com>
230
231         Unreviewed, rolling out r249031.
232
233         Causes multiple test failures on iOS simulator
234
235         Reverted changeset:
236
237         "[iOS] Should show input view when became first responder if
238         keyboard was showing when the view was resigned"
239         https://bugs.webkit.org/show_bug.cgi?id=200902
240         https://trac.webkit.org/changeset/249031
241
242 2019-08-22  Andy Estes  <aestes@apple.com>
243
244         [watchOS] Disable Content Filtering in the simulator build
245         https://bugs.webkit.org/show_bug.cgi?id=201047
246
247         Reviewed by Tim Horton.
248
249         * Configurations/FeatureDefines.xcconfig:
250
251 2019-08-22  Daniel Bates  <dabates@apple.com>
252
253         [iOS] Should show input view when became first responder if keyboard was showing when the view was resigned
254         https://bugs.webkit.org/show_bug.cgi?id=200902
255         <rdar://problem/54231756>
256
257         Reviewed by Wenson Hsieh.
258
259         When resigning first responder save whether the peripheral host has an input view on screen,
260         including the software keyboard, so that we show the input view(s) again when the WKWebView
261         is made first responder. In Safari, this avoids the need for a person to explicitly focus an
262         editable element again to bring up the keyboard when returning to a tab they were previously
263         typing in. It also makes the behavior of switching tabs in Safari with a software keyboard
264         match the behavior of doing the same thing when a hardware keyboard attached.
265
266         * UIProcess/PageClient.h:
267         * UIProcess/WebPageProxy.h:
268         * UIProcess/WebPageProxy.messages.in:
269         * UIProcess/ios/PageClientImplIOS.h:
270         * UIProcess/ios/PageClientImplIOS.mm:
271         (WebKit::PageClientImpl::focusedElementDidChangeInputMode):
272         Pass a diff of the activity state from the web process to the UI process so that we can
273         differentiate between an inputmode change as a result of page deactivation vs a change
274         caused by some other means. We need to differentiate these cases because we want to
275         ignore a page that sets inputmode "none" (i.e. a request to hide the keyboard) from inside
276         a focus event handler if the handler was called as part of the process of page activation
277         (i.e. switching to the tab). Google Docs is one example of a web site that sets inputmode
278         to "none" as a result of the page activation process.
279
280         * UIProcess/ios/WKContentViewInteraction.h:
281         * UIProcess/ios/WKContentViewInteraction.mm:
282         (-[WKContentView cleanupInteraction]): Clear out state.
283         (-[WKContentView resignFirstResponderForWebView]): Save whether the peripheral host is on screen
284         into a local before ending the editing session. We then copy the local into the ivar if we
285         actually will resign. This ordering is explicitly done because:
286                 1. Ending the editing session may dismiss the keyboard => we need to query the peripheral
287                    host first.
288                 2. If the view is being resigned as a result of a keyboard dismissal (i.e. a person pressed
289                    the hide keyboard button on iPad) then the user has indicated that they are finished
290                    with the keyboard and we do not want to show the keyboard on page re-activation => we
291                    do not want to copy the local to the ivar.
292                 3. If the view refuses to resign itself then it does not make sense to save the keyboard
293                    state as responder status hasn't changed.
294         (-[WKContentView shouldShowAutomaticKeyboardUI]): Ignore inputmode="none", if needed.
295         (-[WKContentView _didCommitLoadForMainFrame]): Clear out state.
296         (-[WKContentView isFirstResponderOrBecomingFirstResponder]): Added.
297         (-[WKContentView shouldShowInputViewOnPageActivation:]): Added.
298         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):
299         Update ivar if this element is being focused as a result of page activation.
300         (-[WKContentView _didUpdateInputMode:activityStateChanges:]): Modified to take the activity state
301         diff. If the input mode was changed as a result of page activation then we want to update our ivar
302         so that when we call -reloadInputViews and UIKit calls us back in -shouldShowAutomaticKeyboardUI we
303         will know to ignore inputmode set to "none" when determining whether to show the automatic keyboard UI.
304         Note that we do not need to check/track whether an earlier -_elementDidFocus actually started an
305         input session as part of updating the value of our ivar because if an input session was not started,
306         say the embedding client disallowed it, then we would not have a focused element => we early return from
307         this function. Also remove duplication and improve code readbility by making use of the convenience function
308         hasFocusedElement() instead of duplicating what it does.
309         (-[WKContentView _didUpdateInputMode:]): Deleted.
310         * UIProcess/ios/WebPageProxyIOS.mm:
311         (WebKit::WebPageProxy::focusedElementDidChangeInputMode): Modified to take the activity state diff
312         and pass it through.
313         (WebKit::WebPageProxy::didReleaseAllTouchPoints): Pass the empty set for the activity state diff to
314         keep our current behavior.
315         * WebProcess/WebPage/WebPage.cpp:
316         (WebKit::WebPage::focusedElementDidChangeInputMode): Send the activity state diff to the UI process.
317 2019-08-22  Keith Rollin  <krollin@apple.com>
318
319         Remove logging that contains a URL
320         https://bugs.webkit.org/show_bug.cgi?id=201052
321         <rdar://problem/54613204>
322
323         Reviewed by Chris Dumez.
324
325         checkURLReceivedFromWebProcess in WebProcessProxy.cpp contains an old
326         logging line that logs a URL. We don't log URLs any more for privacy
327         reasons, so remove this.
328
329         A search for WTFLogAlways.*url turns up other matches, but those are
330         either false positives or cases where the URLs are logged only on
331         demand by the developer as part of debugging.
332         checkURLReceivedFromWebProcess is the only place where a URL is logged
333         as a matter of course.
334
335         * UIProcess/WebProcessProxy.cpp:
336         (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess):
337
338 2019-08-22  Adrian Perez de Castro  <aperez@igalia.com>
339
340         [GTK][WPE] Fixes for non-unified builds after r248547
341         https://bugs.webkit.org/show_bug.cgi?id=201044
342
343         Reviewed by Philippe Normand.
344
345         * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp: Add missing inclusion of
346         the wtf/CrossThreadCopier.h header.
347         * WebProcess/WebStorage/StorageNamespaceImpl.h: Add missing inclusion of the
348         WebCore/PageIdentifier.h header.
349
350 2019-08-22  Alex Christensen  <achristensen@webkit.org>
351
352         Disable legacy TLS versions and add a temporary default to re-enable it
353         https://bugs.webkit.org/show_bug.cgi?id=200945
354
355         Reviewed by Brady Eidson.
356
357         * NetworkProcess/NetworkSessionCreationParameters.cpp:
358         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
359         (WebKit::NetworkSessionCreationParameters::encode const):
360         (WebKit::NetworkSessionCreationParameters::decode):
361         * NetworkProcess/NetworkSessionCreationParameters.h:
362         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
363         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
364         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
365         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
366         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
367         (WebKit::WebsiteDataStore::parameters):
368
369 2019-08-17  Darin Adler  <darin@apple.com>
370
371         Use makeString and multi-argument StringBuilder::append instead of less efficient multiple appends
372         https://bugs.webkit.org/show_bug.cgi?id=200862
373
374         Reviewed by Ryosuke Niwa.
375
376         * Shared/mac/AuxiliaryProcessMac.mm:
377         (WebKit::setAndSerializeSandboxParameters): Use one append instead of multiple.
378
379 2019-08-22  Wenson Hsieh  <wenson_hsieh@apple.com>
380
381         Typing Korean in title field after typing in the body inserts extraneous characters on blog.naver.com
382         https://bugs.webkit.org/show_bug.cgi?id=201023
383         <rdar://problem/54294794>
384
385         Reviewed by Ryosuke Niwa.
386
387         After r242833, we began to avoid sending redundant ElementDidFocus updates in the case where a focused element
388         was blurred and refocused within the same runloop. This was done to prevent the input view from flickering due
389         to input view reloading, as well as scrolling to reveal the focused element, when tapping to change selection on
390         Microsoft Word online.
391
392         However, on blog.naver.com, these ElementDidFocus messages were necessary in order to ensure that the platform
393         input context changes when moving between the title and body fields, or when tapping to change selection. This
394         is because blog.naver.com uses a hidden contenteditable area under a subframe (see WebCore ChangeLog for more
395         detail here). While text is never directly inserted into this hidden contenteditable, the events are observed
396         and used to "play back" editing in the main visible content area.
397
398         Thus, when moving between the title and body fields (or when changing selection within either), the only hint we
399         get is that the hidden editable element is blurred and immediately refocused. Since we no longer send
400         ElementDidFocus updates in this scenario, UIKeyboardImpl and kbd are not aware that the page has effectively
401         changed input contexts.
402
403         Combined with the fact that Korean IME on iOS may insert additional text given the document context (i.e. text
404         that the input manager, kbd, thinks we've previously inserted), this means that when typing several characters
405         into the body field on naver and then switching to edit the title, initial keystrokes may insert unexpected
406         text in the title field.
407
408         To fix this, we add some hooks to notify the UI process when an element that was blurred has been immediately
409         refocused. Upon receiving this message, the UI process then tells UIKeyboardImpl to re-retrieve its input
410         context, which calls into -requestAutocorrectionContextWithCompletionHandler: in WKContentView. While notorious
411         for being synchronous IPC, this is mitigated by (1) being limiting to only instances where we have a hidden
412         editable area, and (2) being limited by a batching mechanism in the web process, such that if the focused
413         element is blurred, refocused, re-blurred, and refocused many times in the same runloop, we'll only send a
414         single UpdateInputContextAfterBlurringAndRefocusingElement message (as opposed to the many ElementDidFocus
415         messages we would've sent in previous releases).
416
417         * Platform/spi/ios/UIKitSPI.h:
418         * UIProcess/PageClient.h:
419         * UIProcess/WebPageProxy.h:
420         * UIProcess/WebPageProxy.messages.in:
421
422         Add a new mechanism to update the platform input context (on iOS, UIKeyboardImpl's document state) when focus
423         moves away from and immediately returns to a hidden editable element.
424
425         * UIProcess/ios/PageClientImplIOS.h:
426         * UIProcess/ios/PageClientImplIOS.mm:
427         (WebKit::PageClientImpl::updateInputContextAfterBlurringAndRefocusingElement):
428         * UIProcess/ios/WKContentViewInteraction.h:
429         * UIProcess/ios/WKContentViewInteraction.mm:
430         (-[WKContentView _updateInputContextAfterBlurringAndRefocusingElement]):
431
432         Tell the active UIKeyboardImpl to refetch document state from the WKContentView. While this does result in a new
433         autocorrection context request (which, unfortunately, triggers synchronous IPC to the web process), this request
434         would've still happened anyways in the case where we would previously have sent an ElementDidFocus message.
435
436         * UIProcess/ios/WebPageProxyIOS.mm:
437         (WebKit::WebPageProxy::updateInputContextAfterBlurringAndRefocusingElement):
438         * WebProcess/WebPage/WebPage.cpp:
439         (WebKit::WebPage::elementDidFocus):
440
441         In the case where we avoid sending a full ElementDidFocus message to the UI process due to refocusing the same
442         element, we should still notify the UI process so that it can synchronize state between the application process
443         and kbd. See above for more details.
444
445         (WebKit::WebPage::elementDidBlur):
446         (WebKit::WebPage::updateInputContextAfterBlurringAndRefocusingElementIfNeeded):
447         * WebProcess/WebPage/WebPage.h:
448         * WebProcess/WebPage/ios/WebPageIOS.mm:
449         (WebKit::WebPage::updateInputContextAfterBlurringAndRefocusingElementIfNeeded):
450
451 2019-08-22  Youenn Fablet  <youenn@apple.com>
452
453         Add a WebsiteDataStore delegate to handle AuthenticationChallenge that do not come from pages
454         https://bugs.webkit.org/show_bug.cgi?id=196870
455
456         Reviewed by Alex Christensen.
457
458         Make NetworkProcess provide the session ID for any authentication challenge.
459         In case there is no associated page for the authentication challenge or this is related to a service worker,
460         ask the website data store to take a decision.
461         Add website data store delegate to allow applications to make the decision.
462         Restrict using the delegate to server trust evaluation only.
463
464         Make ping loads reuse the same mechanism.
465
466         Covered by service worker tests and updated beacon test.
467
468         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
469         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
470         * NetworkProcess/NetworkDataTask.cpp:
471         (WebKit::NetworkDataTask::sessionID const):
472         * NetworkProcess/NetworkDataTask.h:
473         * NetworkProcess/NetworkLoad.cpp:
474         (WebKit::NetworkLoad::didReceiveChallenge):
475         * NetworkProcess/NetworkLoadChecker.h:
476         (WebKit::NetworkLoadChecker::networkProcess):
477         * NetworkProcess/PingLoad.cpp:
478         (WebKit::PingLoad::didReceiveChallenge):
479         * Shared/Authentication/AuthenticationManager.cpp:
480         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
481         * Shared/Authentication/AuthenticationManager.h:
482         * Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.h: Copied from Tools/WebKitTestRunner/cocoa/TestWebsiteDataStoreDelegate.h.
483         * Shared/Authentication/cocoa/AuthenticationChallengeDispositionCocoa.mm: Copied from Source/WebKit/Shared/Authentication/cocoa/ClientCertificateAuthenticationXPCConstants.h.
484         (WebKit::toAuthenticationChallengeDisposition):
485         * SourcesCocoa.txt:
486         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
487         (WebsiteDataStoreClient::WebsiteDataStoreClient):
488         * UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
489         * UIProcess/Cocoa/NavigationState.mm:
490         (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
491         * UIProcess/Network/NetworkProcessProxy.cpp:
492         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
493         * UIProcess/Network/NetworkProcessProxy.h:
494         * UIProcess/Network/NetworkProcessProxy.messages.in:
495         * UIProcess/ServiceWorkerProcessProxy.cpp:
496         * UIProcess/ServiceWorkerProcessProxy.h:
497         * UIProcess/WebPageProxy.cpp:
498         * UIProcess/WebProcessPool.cpp:
499         (WebKit::WebProcessPool::isServiceWorkerPageID const):
500         * UIProcess/WebProcessPool.h:
501         * UIProcess/WebsiteData/WebsiteDataStoreClient.h:
502         (WebKit::WebsiteDataStoreClient::didReceiveAuthenticationChallenge):
503         * WebKit.xcodeproj/project.pbxproj:
504
505 2019-08-22  Claudio Saavedra  <csaavedra@igalia.com>
506
507         [SOUP] NetworkProcessSoup does not initialize CacheOptions correctly
508         https://bugs.webkit.org/show_bug.cgi?id=200886
509
510         Reviewed by Philippe Normand.
511
512         r247567 wrongly initializes CacheOptions in a local variable that is never used
513         instead of using NetworkProcess's member variable, that is later used by the
514         NetworkSession to initialize the cache.
515
516         * NetworkProcess/soup/NetworkProcessSoup.cpp:
517         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
518
519 2019-08-21  Tim Horton  <timothy_horton@apple.com>
520
521         [Mail] Tapping top of message scrolls back to copied text instead of top of the message
522         https://bugs.webkit.org/show_bug.cgi?id=200999
523         <rdar://problem/54564878>
524
525         Reviewed by Wenson Hsieh.
526
527         In the case where you have a WebCore selection but are not first responder,
528         when you tap the WKWebView to become first responder, EventHandler would
529         bail from setting the selection, assuming UIKit was going to do it. This
530         behavior was introduced in r233311.
531
532         However, since we are not first responder, UIKit does not change the
533         selection, since it considers the view to not be editable.
534
535         Fix this by letting WebCore set the selection in this case, as it used to.
536
537         * WebProcess/WebCoreSupport/WebEditorClient.h:
538         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
539         (WebKit::WebEditorClient::shouldAllowSingleClickToChangeSelection const):
540         * WebProcess/WebPage/WebPage.h:
541         (WebKit::WebPage::isShowingInputViewForFocusedElement const):
542         Copy the logic from EventHandler, with the added caveat (which fixes the
543         aforementioned behavior) that we will allow EventHandler to change the
544         selection if we don't have a focused node in the UIKit sense, because
545         we know that the platform text interaction code will *not* change the
546         selection if that is the case, so it's up to us.
547
548 2019-08-21  Chris Dumez  <cdumez@apple.com>
549
550         Crash under NetworkCache::Data::mapToFile()
551         https://bugs.webkit.org/show_bug.cgi?id=200996
552         <rdar://problem/54570421>
553
554         Reviewed by Geoffrey Garen.
555
556         Make sure NetworkCache::Data::mapToFile() calls makeSafeToUseMemoryMapForPath() between
557         creating the file and calling mmap().
558
559         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
560         (WebKit::NetworkCache::BlobStorage::add):
561         * NetworkProcess/cache/NetworkCacheData.cpp:
562         (WebKit::NetworkCache::Data::mapToFile const):
563
564 2019-08-21  Chris Dumez  <cdumez@apple.com>
565
566         Have NetworkCache::store() null check its completion handler before calling it
567         https://bugs.webkit.org/show_bug.cgi?id=200994
568
569         Reviewed by Geoffrey Garen.
570
571         * NetworkProcess/NetworkResourceLoader.cpp:
572         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
573         Stop passing nullptr for the completion handler now that the parameter has a default value.
574         Note that passing nullptr here was likely wrong since the NetworkCache::store() implementation
575         did not null-check the completion handler before calling it.
576
577         * NetworkProcess/cache/NetworkCache.cpp:
578         (WebKit::NetworkCache::Cache::store):
579         Have NetworkCache::store() null check its completion handler before calling it as calling
580         a null WTF::Function crashes.
581
582         * NetworkProcess/cache/NetworkCache.h:
583         Use nullptr as default parameter value for the completion handler.
584
585 2019-08-21  Rob Buis  <rbuis@igalia.com>
586
587         Verify Prefetch and credential behavior
588         https://bugs.webkit.org/show_bug.cgi?id=200000
589
590         Reviewed by Youenn Fablet.
591
592         Cancel cross-origin prefetches for Vary: Cookie.
593
594         Test: http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie.html
595
596         * NetworkProcess/NetworkResourceLoader.cpp:
597         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
598         (WebKit::NetworkResourceLoader::didReceiveResponse):
599         * NetworkProcess/cache/PrefetchCache.cpp:
600         (WebKit::PrefetchCache::take):
601
602 2019-08-21  Ryosuke Niwa  <rniwa@webkit.org>
603
604         Put keygen element behind a runtime flag and disable it by default
605         https://bugs.webkit.org/show_bug.cgi?id=200850
606
607         Reviewed by Antti Koivisto.
608
609         * Shared/WebPreferences.yaml:
610         * UIProcess/API/C/WKPreferences.cpp:
611         (WKPreferencesSetKeygenElementEnabled):
612         (WKPreferencesGetKeygenElementEnabled):
613         * UIProcess/API/C/WKPreferencesRefPrivate.h:
614
615 2019-08-21  Chris Dumez  <cdumez@apple.com>
616
617         Crash under StringImpl::~StringImpl() in NetworkProcess::deleteWebsiteDataForRegistrableDomains()
618         https://bugs.webkit.org/show_bug.cgi?id=200986
619         <rdar://problem/32850192>
620
621         Reviewed by Brent Fulgham.
622
623         Code was calling postStorageTask() with a lambda that captures Strings that are not isolated copied.
624         The lambda would get executed on another thread so this is not safe. The CrossThreadTask constructor
625         does not take care of this for you, despite its name (the createCrossThreadTask() function does though).
626
627         * NetworkProcess/NetworkProcess.cpp:
628         (WebKit::NetworkProcess::fetchWebsiteData):
629         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
630         (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
631
632 2019-08-21  Chris Dumez  <cdumez@apple.com>
633
634         Add internal setting to disable SecureContext checks
635         https://bugs.webkit.org/show_bug.cgi?id=200980
636         <rdar://problem/54438512>
637
638         Reviewed by Alex Christensen.
639
640         Add internal setting to disable SecureContext checks, in order to facilitate development
641         for features like Service workers or device orientation / motion.
642
643         * Shared/WebPreferences.yaml:
644         * UIProcess/API/Cocoa/WKPreferences.mm:
645         (-[WKPreferences _secureContextChecksEnabled]):
646         (-[WKPreferences _setSecureContextChecksEnabled:]):
647         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
648
649 2019-08-21  Chris Dumez  <cdumez@apple.com>
650
651         registrableDomainsToRemoveWebsiteDataFor() does not need to return a HashMap
652         https://bugs.webkit.org/show_bug.cgi?id=200985
653
654         Reviewed by John Wilander.
655
656         registrableDomainsToRemoveWebsiteDataFor() does not need to return a HashMap. It is more
657         efficient to simply return a Vector since we never need to look up keys.
658
659         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
660         (WebKit::ResourceLoadStatisticsDatabaseStore::registrableDomainsToRemoveWebsiteDataFor):
661         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
662         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
663         (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToRemoveWebsiteDataFor):
664         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
665         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
666         (WebKit::domainsToString):
667         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
668         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
669         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomains):
670         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
671         * NetworkProcess/NetworkProcess.cpp:
672         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
673         (WebKit::NetworkProcess::deleteCookiesForTesting):
674         * NetworkProcess/NetworkProcess.h:
675         * NetworkProcess/NetworkSession.cpp:
676         (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomains):
677         * NetworkProcess/NetworkSession.h:
678
679 2019-08-21  Russell Epstein  <repstein@apple.com>
680
681         Unreviewed, rolling out r248942.
682
683         Causes multiple layout test crashes on MacOS Bots
684
685         Reverted changeset:
686
687         "Verify Prefetch and credential behavior"
688         https://bugs.webkit.org/show_bug.cgi?id=200000
689         https://trac.webkit.org/changeset/248942
690
691 2019-08-21  Keith Rollin  <krollin@apple.com>
692
693         Remove support for watchOS < 6.0
694         https://bugs.webkit.org/show_bug.cgi?id=200937
695         <rdar://problem/54524009>
696
697         Reviewed by Darin Adler.
698
699         Update conditionals that reference __WATCH_OS_VERSION_MIN_REQUIRED and
700         __WATCH_OS_VERSION_MAX_ALLOWED, assuming that they both have values >=
701         60000. This means that expressions like
702         "__WATCH_OS_VERSION_MIN_REQUIRED < 60000" are always False and
703         "__WATCH_OS_VERSION_MIN_REQUIRED >= 60000" are always True.
704
705         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
706         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
707
708 2019-08-21  Adrian Perez de Castro  <aperez@igalia.com>
709
710         [GTK] Build failure due to unwieldy definition of “None” from X11 headers
711         https://bugs.webkit.org/show_bug.cgi?id=200984
712
713         Reviewed by Carlos Alberto Lopez Perez.
714
715         * SourcesGTK.txt: Mark AcceleratedBackingStore.cpp with @no-unify
716         because it includes AcceleratedSurfaceX11.h when building with
717         ENABLE_X11_TARGET=ON, which in turn will include the X11 headers.
718         It is just lucky that most of the time the order of the generated
719         #include statements in the unified sources has been masking this
720         problem.
721
722 2019-08-21  Rob Buis  <rbuis@igalia.com>
723
724         Verify Prefetch and credential behavior
725         https://bugs.webkit.org/show_bug.cgi?id=200000
726
727         Reviewed by Youenn Fablet.
728
729         Cancel cross-origin prefetches for Vary: Cookie.
730
731         Test: http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie.html
732
733         * NetworkProcess/NetworkResourceLoader.cpp:
734         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
735         (WebKit::NetworkResourceLoader::didReceiveResponse):
736         * NetworkProcess/cache/PrefetchCache.cpp:
737         (WebKit::PrefetchCache::take):
738
739 2019-08-21  Pablo Saavedra  <psaavedra@igalia.com>
740
741         [WPE] Build failure after r248846 ([WTF] Add makeUnique<T>, which ensures T is fast-allocated, makeUnique / makeUniqueWithoutFastMallocCheck part)
742         https://bugs.webkit.org/show_bug.cgi?id=200973
743
744         WPE fails to build with `-DENABLE_WPE_QT_API=ON` after changes done by r248846 in:
745
746           Source/WebKit/UIProcess/API/wpe/qt/WPEQtView.cpp
747           Source/WebKit/UIProcess/API/wpe/qt/WPEQtViewBackend.cpp
748
749         ; to forces FastMalloc use.
750
751         Related to:
752
753           https://bugs.webkit.org/show_bug.cgi?id=200611
754           https://bugs.webkit.org/show_bug.cgi?id=200620
755
756         This patch puts WPEQt... classes into FastMalloc in the same way it
757         was done by many others in r248603.
758
759         Reviewed by Philippe Normand.
760
761         * UIProcess/API/wpe/qt/WPEQtView.cpp:
762         (WPEQtView::runJavaScript):
763         * UIProcess/API/wpe/qt/WPEQtViewBackend.h:
764         * UIProcess/API/wpe/qt/WPEQtViewLoadRequest.h:
765
766 2019-08-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
767
768         [iOS] REGRESSION (248501): gmail.com images are still not shown on some versions of iPhone iOS13
769         https://bugs.webkit.org/show_bug.cgi?id=200948
770
771         Reviewed by Tim Horton.
772
773         Apply the gmail.com quirk for all iPhone iOS versions till the gmail.com
774         bug is fixed.
775
776         * WebProcess/WebPage/ios/WebPageIOS.mm:
777         (WebKit::WebPage::platformUserAgent const):
778
779 2019-08-20  Chris Dumez  <cdumez@apple.com>
780
781         WebSQLiteDatabaseTracker does not ensure it is still alive after dispatching to the main thread
782         https://bugs.webkit.org/show_bug.cgi?id=200925
783
784         Reviewed by Geoffrey Garen.
785
786         WebSQLiteDatabaseTracker does not ensure it is still alive after dispatching to the main thread,
787         which is not safe. Use WeakPtr to address the issue.
788
789         * Shared/WebSQLiteDatabaseTracker.cpp:
790         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
791         (WebKit::WebSQLiteDatabaseTracker::willBeginFirstTransaction):
792         (WebKit::WebSQLiteDatabaseTracker::didFinishLastTransaction):
793         * Shared/WebSQLiteDatabaseTracker.h:
794
795 2019-08-20  Brent Fulgham  <bfulgham@apple.com>
796
797         [FTW] Fix scrolling in modern WebKit views
798         https://bugs.webkit.org/show_bug.cgi?id=200923
799
800         Reviewed by Don Olmstead.
801
802         The initial implementation of scrolling in Direct2D had errors that
803         caused hilarious rendering glitches. This patch corrects the logic
804         so that page scroll is correct.
805
806         This patch also fixes a bug that would trigger when resizing windows.
807
808         * Shared/win/ShareableBitmapDirect2D.cpp:
809         (WebKit::ShareableBitmap::paint):
810         * UIProcess/BackingStore.h:
811         (WebKit::BackingStore::renderTarget): Deleted.
812         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
813         (WebKit::DrawingAreaProxyCoordinatedGraphics::sizeDidChange):
814         (WebKit::DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange):
815         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h:
816         * UIProcess/win/BackingStoreDirect2D.cpp:
817         (WebKit::BackingStore::paint):
818         (WebKit::BackingStore::incorporateUpdate):
819         (WebKit::BackingStore::scroll):
820         * UIProcess/win/WebView.cpp:
821         (WebKit::WebView::paint):
822         (WebKit::WebView::onSizeEvent):
823
824 2019-08-20  Chris Dumez  <cdumez@apple.com>
825
826         Unsafe usage of CookieStorageObserver from a background thread
827         https://bugs.webkit.org/show_bug.cgi?id=200920
828
829         Reviewed by Alex Christensen.
830
831         * UIProcess/API/APIHTTPCookieStore.h:
832         * UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm:
833         (API::HTTPCookieStore::startObservingChangesToDefaultUIProcessCookieStore):
834
835 2019-08-20  Chris Dumez  <cdumez@apple.com>
836
837         Use a strongly typed identifier for StorageNamespace's identifier
838         https://bugs.webkit.org/show_bug.cgi?id=200895
839
840         Reviewed by Alex Christensen and Youenn Fablet.
841
842         Use a strongly typed identifier for StorageNamespace's identifier instead of uint64_t, to
843         avoid type confusion.
844
845         * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
846         (WebKit::LocalStorageNamespace::LocalStorageNamespace):
847         * NetworkProcess/WebStorage/LocalStorageNamespace.h:
848         * NetworkProcess/WebStorage/StorageManager.cpp:
849         (WebKit::StorageManager::createSessionStorageNamespace):
850         (WebKit::StorageManager::destroySessionStorageNamespace):
851         (WebKit::StorageManager::cloneSessionStorageNamespace):
852         (WebKit::StorageManager::createLocalStorageArea):
853         (WebKit::StorageManager::createTransientLocalStorageArea):
854         (WebKit::StorageManager::createSessionStorageArea):
855         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
856         (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
857         (WebKit::StorageManager::getOrCreateSessionStorageNamespace):
858         * NetworkProcess/WebStorage/StorageManager.h:
859         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
860         (WebKit::StorageManagerSet::connectToLocalStorageArea):
861         (WebKit::StorageManagerSet::connectToTransientLocalStorageArea):
862         (WebKit::StorageManagerSet::connectToSessionStorageArea):
863         (WebKit::StorageManagerSet::cloneSessionStorageNamespace):
864         * NetworkProcess/WebStorage/StorageManagerSet.h:
865         * NetworkProcess/WebStorage/StorageManagerSet.messages.in:
866         * Scripts/webkit/messages.py:
867         * WebKit.xcodeproj/project.pbxproj:
868         * WebProcess/InjectedBundle/InjectedBundle.cpp:
869         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
870         * WebProcess/WebPage/WebPage.cpp:
871         (WebKit::m_textAutoSizingAdjustmentTimer):
872         * WebProcess/WebPage/WebPage.h:
873         (WebKit::WebPage::sessionStorageNamespaceIdentifier const):
874         * WebProcess/WebPage/WebPageGroupProxy.h:
875         (WebKit::WebPageGroupProxy::localStorageNamespaceIdentifier const):
876         * WebProcess/WebStorage/StorageAreaMap.cpp:
877         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
878         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
879         * WebProcess/WebStorage/StorageNamespaceIdentifier.h: Copied from Source/WebKit/WebProcess/WebStorage/WebStorageNamespaceProvider.h.
880         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
881         (WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
882         (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
883         (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):
884         (WebKit::StorageNamespaceImpl::StorageNamespaceImpl):
885         (WebKit::StorageNamespaceImpl::copy):
886         (WebKit::StorageNamespaceImpl::sessionStoragePageID const):
887         (WebKit::StorageNamespaceImpl::pageGroupID const):
888         * WebProcess/WebStorage/StorageNamespaceImpl.h:
889         (WebKit::StorageNamespaceImpl::storageNamespaceID const):
890         * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
891         (WebKit::WebStorageNamespaceProvider::getOrCreate):
892         (WebKit::WebStorageNamespaceProvider::WebStorageNamespaceProvider):
893         (WebKit::WebStorageNamespaceProvider::~WebStorageNamespaceProvider):
894         (WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):
895         (WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace):
896         (WebKit::WebStorageNamespaceProvider::createTransientLocalStorageNamespace):
897         * WebProcess/WebStorage/WebStorageNamespaceProvider.h:
898
899 2019-08-20  Dean Jackson  <dino@apple.com>
900
901         REGRESSION: Open in New Tab is missing from context menu
902         https://bugs.webkit.org/show_bug.cgi?id=200909
903         <rdar://problem/54476169>
904
905         Reviewed by Simon Fraser.
906
907         Don't assume the new API if webView:contextMenuWillPresentForElement:
908         is implemented.
909
910         * UIProcess/ios/WKContentViewInteraction.mm:
911         (needsDeprecatedPreviewAPI):
912
913 2019-08-20  Joseph Pecoraro  <pecoraro@apple.com>
914
915         Web Inspector: Support for JavaScript BigInt
916         https://bugs.webkit.org/show_bug.cgi?id=180731
917         <rdar://problem/36298748>
918
919         Reviewed by Devin Rousso.
920
921         * WebProcess/WebPage/WebInspectorUI.cpp:
922         (WebKit::WebInspectorUI::WebInspectorUI):
923         Enable BigInt in the Web Inspector process. It only makes use of
924         `globalThis.BigInt(...)` to hold the value.
925
926 2019-08-19  Fujii Hironori  <Hironori.Fujii@sony.com>
927
928         [CMake] WebKit2.dll can't link because of missing PAL's import symbols for WinCairo port
929         https://bugs.webkit.org/show_bug.cgi?id=200910
930
931         Unreviewed build fix for Windows port.
932
933         * CMakeLists.txt: Added -DSTATICALLY_LINKED_WITH_PAL=1 if PAL_LIBRARY_TYPE is STATIC.
934
935 2019-08-19  Fujii Hironori  <Hironori.Fujii@sony.com>
936
937         Unreviewed build fix for WinCairo port.
938
939         The base class of NetworkDataTask has been changed in r248874.
940
941         * NetworkProcess/curl/NetworkDataTaskCurl.h:
942         (ref):
943         (deref):
944         Call 'ref' and 'deref' of NetworkDataTask instead of RefCounted<NetworkDataTask>.
945
946 2019-08-19  Keith Rollin  <krollin@apple.com>
947
948         Unreviewed build fix for security entitlements.
949
950         Bug 200242 (r248164) changed the way that entitlements were generated
951         and applied during the build. In that refactoring, the codesign
952         parameter "-o library" was dropped. This change adds it back.
953
954         * Configurations/BaseXPCService.xcconfig:
955
956 2019-08-19  Chris Dumez  <cdumez@apple.com>
957
958         NetworkDataTask is being ref'd / deref'd from several threads and is not ThreadSafeRefCounted
959         https://bugs.webkit.org/show_bug.cgi?id=200897
960
961         Reviewed by Geoffrey Garen.
962
963         NetworkDataTask subclasses RefCounted and is ref'd / deref'd on the main thread. However, there
964         is code in NetworkDataTaskCocoa::resume() that was ref'ing / deref'ing it on a background thread,
965         which is unsafe. To address the issue, Have NetworkDataTask subclass ThreadSafeRefCounted, and
966         make sure it always gets destroyed on the main thread.
967
968         * NetworkProcess/NetworkDataTask.h:
969
970         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
971         (WebKit::NetworkDataTaskCocoa::resume):
972         Avoid some unnecessary refcounting churn.
973
974 2019-08-19  Alex Christensen  <achristensen@webkit.org>
975
976         Move call to initializeMainThread introduced in r248549 to after WebKit.framework has been loaded
977         https://bugs.webkit.org/show_bug.cgi?id=200896
978         <rdar://problem/54479065>
979
980         Reviewed by Chris Dumez.
981
982         In XPCServiceMain we haven't been told which WebKit.framework to load yet, so when using staged frameworks it
983         causes problems if we call a function from a WebKit framework.  We need to wait until after initializerFunctionPtr is called.
984
985         * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkServiceEntryPoint.mm:
986         (NetworkServiceInitializer):
987         * PluginProcess/EntryPoint/Cocoa/XPCService/PluginServiceEntryPoint.mm:
988         (PluginServiceInitializer):
989         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
990         (WebKit::XPCServiceMain):
991         * WebProcess/EntryPoint/Cocoa/XPCService/WebContentServiceEntryPoint.mm:
992         (WebContentServiceInitializer):
993
994 2019-08-19  Yusuke Suzuki  <ysuzuki@apple.com>
995
996         Unreviewed, build fix for PLATFORM_DRIVEN_TEXT_CHECKING
997         https://bugs.webkit.org/show_bug.cgi?id=200620
998
999         It is enabled if PLATFORM(MACCATALYST) is true.
1000
1001         * UIProcess/Cocoa/TextCheckingController.h:
1002
1003 2019-08-19  Sihui Liu  <sihui_liu@apple.com>
1004
1005         Remove IDB-specific quota
1006         https://bugs.webkit.org/show_bug.cgi?id=196545
1007         <rdar://problem/54201783>
1008
1009         Reviewed by Youenn Fablet.
1010
1011         * NetworkProcess/NetworkProcess.cpp:
1012         (WebKit::NetworkProcess::createIDBServer):
1013         (WebKit::NetworkProcess::addIndexedDatabaseSession):
1014         (WebKit::NetworkProcess::setIDBPerOriginQuota): Deleted.
1015         * NetworkProcess/NetworkProcess.h:
1016         * NetworkProcess/NetworkProcess.messages.in:
1017         * UIProcess/API/C/WKContext.cpp:
1018         (WKContextSetIDBPerOriginQuota): Deleted.
1019         * UIProcess/API/C/WKContextPrivate.h:
1020         * UIProcess/WebProcessPool.cpp:
1021         (WebKit::WebProcessPool::setIDBPerOriginQuota): Deleted.
1022         * UIProcess/WebProcessPool.h:
1023
1024 2019-08-19  Youenn Fablet  <youenn@apple.com>
1025
1026         Remove SessionID::emptySessionID()
1027         https://bugs.webkit.org/show_bug.cgi?id=200811
1028
1029         Reviewed by Alex Christensen.
1030
1031         Update SessionID call sites to use toUInt64.
1032         Remove debug asserts to isValid since construction of invalid session IDs can only happen in very specific cases
1033         typically for HashMaps.
1034
1035         * NetworkProcess/Downloads/DownloadManager.h:
1036         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1037         (WebKit::storageSession):
1038         (WebKit::NetworkConnectionToWebProcess::logUserInteraction):
1039         * NetworkProcess/NetworkProcess.cpp:
1040         (WebKit::NetworkProcess::networkSession const):
1041         (WebKit::NetworkProcess::networkSessionByConnection const):
1042         (WebKit::NetworkProcess::setSession):
1043         (WebKit::NetworkProcess::destroySession):
1044         (WebKit::NetworkProcess::fetchWebsiteData):
1045         (WebKit::NetworkProcess::deleteWebsiteData):
1046         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
1047         (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
1048         (WebKit::NetworkProcess::existingSWOriginStoreForSession const):
1049         (WebKit::NetworkProcess::webProcessWasDisconnected):
1050         * NetworkProcess/NetworkProcess.h:
1051         * NetworkProcess/NetworkResourceLoader.cpp:
1052         (WebKit::NetworkResourceLoader::startNetworkLoad):
1053         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1054         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
1055         * UIProcess/Network/NetworkProcessProxy.cpp:
1056         (WebKit::NetworkProcessProxy::retrieveCacheStorageParameters):
1057         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1058         (WebKit::WebsiteDataStore::~WebsiteDataStore):
1059         (WebKit::WebsiteDataStore::maybeRegisterWithSessionIDMap):
1060         (WebKit::WebsiteDataStore::existingNonDefaultDataStoreForSessionID):
1061         * WebProcess/Cache/WebCacheStorageProvider.cpp:
1062         (WebKit::WebCacheStorageProvider::createCacheStorageConnection):
1063         * WebProcess/Cache/WebCacheStorageProvider.h:
1064         * WebProcess/Storage/WebSWClientConnection.cpp:
1065         (WebKit::WebSWClientConnection::WebSWClientConnection):
1066         (WebKit::WebSWClientConnection::initializeConnectionIfNeeded):
1067         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
1068         (WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
1069         * WebProcess/WebPage/WebPage.cpp:
1070         (WebKit::m_textAutoSizingAdjustmentTimer):
1071
1072 2019-08-19  Yusuke Suzuki  <ysuzuki@apple.com>
1073
1074         Unreviewed, speculative build fix for GTK and WinCairo
1075         https://bugs.webkit.org/show_bug.cgi?id=200620
1076
1077         * UIProcess/socket/RemoteInspectorProtocolHandler.cpp:
1078
1079 2019-08-19  Yusuke Suzuki  <ysuzuki@apple.com>
1080
1081         Unreviewed, build fix in WinCairo and GTK ports
1082         https://bugs.webkit.org/show_bug.cgi?id=200767
1083
1084         * UIProcess/WebPageProxy.cpp:
1085         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
1086
1087 2019-08-19  Youenn Fablet  <youenn@apple.com>
1088
1089         enumerateDevices should return the same JS objects if called twice
1090         https://bugs.webkit.org/show_bug.cgi?id=200767
1091
1092         Reviewed by Eric Carlson.
1093
1094         Update code as enumerate device request is now gone.
1095         Make use of async IPC to simplify code since we are now passing a completion handler directly.
1096
1097         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1098         (WebKit::UserMediaPermissionRequestManagerProxy::captureDevicesChanged):
1099         (WebKit::UserMediaPermissionRequestManagerProxy::finishGrantingRequest):
1100         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
1101         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1102         * UIProcess/WebPageProxy.cpp:
1103         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
1104         * UIProcess/WebPageProxy.h:
1105         * UIProcess/WebPageProxy.messages.in:
1106         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1107         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
1108         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
1109         * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
1110         (WebKit::WebUserMediaClient::enumerateMediaDevices):
1111         * WebProcess/WebCoreSupport/WebUserMediaClient.h:
1112         * WebProcess/WebPage/WebPage.cpp:
1113         * WebProcess/WebPage/WebPage.h:
1114         * WebProcess/WebPage/WebPage.messages.in:
1115
1116 2019-08-18  Yusuke Suzuki  <ysuzuki@apple.com>
1117
1118         [WTF] Add makeUnique<T>, which ensures T is fast-allocated, makeUnique / makeUniqueWithoutFastMallocCheck part
1119         https://bugs.webkit.org/show_bug.cgi?id=200620
1120
1121         Reviewed by Geoffrey Garen.
1122
1123         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
1124         (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk):
1125         (WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
1126         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1127         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1128         * NetworkProcess/CustomProtocols/soup/LegacyCustomProtocolManagerSoup.cpp:
1129         * NetworkProcess/Downloads/DownloadManager.cpp:
1130         (WebKit::DownloadManager::startDownload):
1131         (WebKit::DownloadManager::convertNetworkLoadToDownload):
1132         (WebKit::DownloadManager::resumeDownload):
1133         * NetworkProcess/Downloads/DownloadMap.cpp:
1134         (WebKit::DownloadMap::add):
1135         * NetworkProcess/Downloads/PendingDownload.cpp:
1136         (WebKit::PendingDownload::PendingDownload):
1137         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1138         (WebKit::NetworkConnectionToWebProcess::establishSWServerConnection):
1139         * NetworkProcess/NetworkContentRuleListManager.cpp:
1140         (WebKit::NetworkContentRuleListManager::addContentRuleLists):
1141         * NetworkProcess/NetworkDataTaskBlob.cpp:
1142         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
1143         (WebKit::NetworkDataTaskBlob::download):
1144         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
1145         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
1146         * NetworkProcess/NetworkLoad.cpp:
1147         (WebKit::NetworkLoad::didReceiveResponse):
1148         * NetworkProcess/NetworkLoadChecker.cpp:
1149         (WebKit::NetworkLoadChecker::checkCORSRequestWithPreflight):
1150         (WebKit::NetworkLoadChecker::contentSecurityPolicy):
1151         * NetworkProcess/NetworkProcess.cpp:
1152         (WebKit::NetworkProcess::switchToNewTestingSession):
1153         (WebKit::NetworkProcess::ensureSession):
1154         (WebKit::NetworkProcess::swServerForSession):
1155         (WebKit::NetworkProcess::initializeQuotaUsers):
1156         (WebKit::NetworkProcess::storageQuotaManager):
1157         * NetworkProcess/NetworkProcess.h:
1158         (WebKit::NetworkProcess::addSupplement):
1159         * NetworkProcess/NetworkResourceLoader.cpp:
1160         (WebKit::m_shouldCaptureExtraNetworkLoadMetrics):
1161         (WebKit::NetworkResourceLoader::startNetworkLoad):
1162         * NetworkProcess/NetworkSocketChannel.cpp:
1163         (WebKit::NetworkSocketChannel::create):
1164         * NetworkProcess/PreconnectTask.cpp:
1165         * NetworkProcess/WebStorage/LocalStorageDatabase.cpp:
1166         (WebKit::LocalStorageDatabase::scheduleDatabaseUpdate):
1167         * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
1168         (WebKit::LocalStorageNamespace::getOrCreateStorageArea):
1169         * NetworkProcess/WebStorage/SessionStorageNamespace.cpp:
1170         (WebKit::SessionStorageNamespace::getOrCreateStorageArea):
1171         * NetworkProcess/WebStorage/StorageArea.cpp:
1172         (WebKit::StorageArea::clone const):
1173         * NetworkProcess/WebStorage/StorageManager.cpp:
1174         (WebKit::StorageManager::createSessionStorageNamespace):
1175         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
1176         (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
1177         (WebKit::StorageManager::getOrCreateSessionStorageNamespace):
1178         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
1179         (WebKit::StorageManagerSet::add):
1180         * NetworkProcess/WebStorage/TransientLocalStorageNamespace.cpp:
1181         (WebKit::TransientLocalStorageNamespace::getOrCreateStorageArea):
1182         * NetworkProcess/cache/NetworkCache.cpp:
1183         (WebKit::NetworkCache::Cache::Cache):
1184         (WebKit::NetworkCache::Cache::makeEntry):
1185         (WebKit::NetworkCache::Cache::makeRedirectEntry):
1186         (WebKit::NetworkCache::Cache::update):
1187         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1188         (WebKit::NetworkCache::Entry::decodeStorageRecord):
1189         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1190         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
1191         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
1192         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::registerSubresourceLoad):
1193         (WebKit::NetworkCache::SpeculativeLoadManager::retrieve):
1194         (WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry):
1195         (WebKit::NetworkCache::SpeculativeLoadManager::satisfyPendingRequests):
1196         (WebKit::NetworkCache::SpeculativeLoadManager::revalidateSubresource):
1197         (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
1198         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1199         (WebKit::NetworkCache::Storage::synchronize):
1200         (WebKit::NetworkCache::Storage::readRecord):
1201         (WebKit::NetworkCache::retrieveFromMemory):
1202         (WebKit::NetworkCache::Storage::retrieve):
1203         (WebKit::NetworkCache::Storage::store):
1204         (WebKit::NetworkCache::Storage::traverse):
1205         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
1206         (WebKit::NetworkCache::SubresourcesEntry::decodeStorageRecord):
1207         * NetworkProcess/cache/PrefetchCache.cpp:
1208         (WebKit::PrefetchCache::store):
1209         (WebKit::PrefetchCache::storeRedirect):
1210         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1211         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
1212         (WebKit::NetworkProcess::networkHTTPSUpgradeChecker):
1213         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1214         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
1215         (WebKit::NetworkSessionCocoa::create):
1216         (WebKit::NetworkSessionCocoa::createWebSocketTask):
1217         * NetworkProcess/curl/NetworkProcessCurl.cpp:
1218         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
1219         * NetworkProcess/curl/NetworkSessionCurl.h:
1220         * NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm:
1221         (WebKit::NetworkConnectionToWebProcess::paymentCoordinator):
1222         (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorAuthorizationPresenter):
1223         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1224         (WebKit::NetworkDataTaskSoup::download):
1225         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1226         (WebKit::NetworkProcess::platformCreateDefaultStorageSession const):
1227         * NetworkProcess/soup/NetworkSessionSoup.cpp:
1228         (WebKit::NetworkSessionSoup::NetworkSessionSoup):
1229         (WebKit::NetworkSessionSoup::createWebSocketTask):
1230         * NetworkProcess/soup/NetworkSessionSoup.h:
1231         * NetworkProcess/soup/WebKitSoupRequestInputStream.cpp:
1232         (webkitSoupRequestInputStreamReadAsync):
1233         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
1234         (WebKit::NetworkMDNSRegister::registerMDNSName):
1235         * NetworkProcess/webrtc/NetworkRTCMonitor.cpp:
1236         (WebKit::NetworkRTCMonitor::startUpdating):
1237         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
1238         (WebKit::NetworkRTCProvider::NetworkRTCProvider):
1239         (WebKit::NetworkRTCProvider::createSocket):
1240         (WebKit::NetworkRTCProvider::wrapNewTCPConnection):
1241         * Platform/IPC/Connection.cpp:
1242         (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
1243         (IPC::Connection::createSyncMessageEncoder):
1244         (IPC::Connection::enableIncomingMessagesThrottling):
1245         (IPC::Connection::dispatchSyncMessage):
1246         * Platform/IPC/Connection.h:
1247         (IPC::Connection::send):
1248         (IPC::Connection::sendWithAsyncReply):
1249         * Platform/IPC/Decoder.cpp:
1250         (IPC::Decoder::unwrapForTesting):
1251         * Platform/IPC/HandleMessage.h:
1252         (IPC::handleMessageAsync):
1253         * Platform/IPC/MessageSender.h:
1254         * Platform/IPC/cocoa/ConnectionCocoa.mm:
1255         (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
1256         (IPC::Connection::open):
1257         (IPC::createMessageDecoder):
1258         (IPC::Connection::receiveSourceEventHandler):
1259         * Platform/IPC/unix/ConnectionUnix.cpp:
1260         (IPC::Connection::processMessage):
1261         (IPC::Connection::sendOutputMessage):
1262         * Platform/IPC/win/ConnectionWin.cpp:
1263         (IPC::Connection::readEventHandler):
1264         * Platform/mac/LayerHostingContext.mm:
1265         (WebKit::LayerHostingContext::createForPort):
1266         (WebKit::LayerHostingContext::createForExternalHostingProcess):
1267         (WebKit::LayerHostingContext::createForExternalPluginHostingProcess):
1268         * PluginProcess/WebProcessConnection.cpp:
1269         (WebKit::WebProcessConnection::createPluginInternal):
1270         * Shared/API/APIURL.h:
1271         (API::URL::create):
1272         (API::URL::parseURLIfNecessary const):
1273         * Shared/API/Cocoa/RemoteObjectInvocation.mm:
1274         (WebKit::RemoteObjectInvocation::decode):
1275         * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
1276         (-[_WKRemoteObjectRegistry _initWithWebPage:]):
1277         (-[_WKRemoteObjectRegistry _initWithWebPageProxy:]):
1278         (-[_WKRemoteObjectRegistry _sendInvocation:interface:]):
1279         * Shared/API/glib/WebKitContextMenuItem.cpp:
1280         (webkitContextMenuItemCreate):
1281         (webkit_context_menu_item_new):
1282         (webkit_context_menu_item_new_from_gaction):
1283         (webkit_context_menu_item_new_from_stock_action):
1284         (webkit_context_menu_item_new_from_stock_action_with_label):
1285         (webkit_context_menu_item_new_with_submenu):
1286         (webkit_context_menu_item_new_separator):
1287         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
1288         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
1289         * Shared/Cocoa/SandboxExtensionCocoa.mm:
1290         (WebKit::SandboxExtension::Handle::decode):
1291         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1292         (WebKit::texmapLayer):
1293         (WebKit::CoordinatedGraphicsScene::ensureRootLayer):
1294         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1295         (WebKit::ThreadedCompositor::ThreadedCompositor):
1296         * Shared/Plugins/NPRemoteObjectMap.cpp:
1297         (WebKit::NPRemoteObjectMap::registerNPObject):
1298         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
1299         (WebKit::NetscapePluginModule::tryLoad):
1300         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
1301         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
1302         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
1303         (WebKit::RemoteLayerTreeTransaction::decode):
1304         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
1305         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
1306         * Shared/cairo/ShareableBitmapCairo.cpp:
1307         (WebKit::ShareableBitmap::createGraphicsContext):
1308         * Shared/cg/ShareableBitmapCG.cpp:
1309         (WebKit::ShareableBitmap::createGraphicsContext):
1310         * Shared/win/ShareableBitmapDirect2D.cpp:
1311         (WebKit::ShareableBitmap::createGraphicsContext):
1312         * UIProcess/API/APIHTTPCookieStore.cpp:
1313         (API::HTTPCookieStore::registerObserver):
1314         * UIProcess/API/C/WKContext.cpp:
1315         (WKContextSetInjectedBundleClient):
1316         (WKContextSetHistoryClient):
1317         (WKContextSetDownloadClient):
1318         * UIProcess/API/C/WKGeolocationManager.cpp:
1319         (WKGeolocationManagerSetProvider):
1320         * UIProcess/API/C/WKNotificationManager.cpp:
1321         (WKNotificationManagerSetProvider):
1322         * UIProcess/API/C/WKPage.cpp:
1323         (WKPageSetPageContextMenuClient):
1324         (WKPageSetPageDiagnosticLoggingClient):
1325         (WKPageSetPageFindClient):
1326         (WKPageSetPageFindMatchesClient):
1327         (WKPageSetPageFormClient):
1328         (WKPageSetPageLoaderClient):
1329         (WKPageSetPagePolicyClient):
1330         (WKPageSetPageUIClient):
1331         (WKPageSetPageStateClient):
1332         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
1333         (-[WKObservablePageState initWithPage:]):
1334         * UIProcess/API/C/wpe/WKView.cpp:
1335         (WKViewSetViewClient):
1336         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
1337         (-[WKBrowsingContextController _initWithPageRef:]):
1338         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
1339         (-[WKHTTPCookieStore addObserver:]):
1340         * UIProcess/API/Cocoa/WKProcessPool.mm:
1341         (-[WKProcessPool _setDownloadDelegate:]):
1342         (-[WKProcessPool _setAutomationDelegate:]):
1343         * UIProcess/API/Cocoa/WKUserContentController.mm:
1344         (-[WKUserContentController addScriptMessageHandler:name:]):
1345         (-[WKUserContentController _addScriptMessageHandler:name:userContentWorld:]):
1346         * UIProcess/API/Cocoa/WKWebView.mm:
1347         (-[WKWebView _initializeWithConfiguration:]):
1348         (-[WKWebView setAllowsBackForwardNavigationGestures:]):
1349         (-[WKWebView _setInputDelegate:]):
1350         * UIProcess/API/Cocoa/_WKAutomationSession.mm:
1351         (-[_WKAutomationSession setDelegate:]):
1352         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
1353         (-[_WKRemoteWebInspectorViewController init]):
1354         * UIProcess/API/glib/IconDatabase.cpp:
1355         (WebKit::readySQLiteStatement):
1356         * UIProcess/API/glib/WebKitAutomationSession.cpp:
1357         (webkitAutomationSessionConstructed):
1358         * UIProcess/API/glib/WebKitContextMenuClient.cpp:
1359         (attachContextMenuClientToView):
1360         * UIProcess/API/glib/WebKitCustomProtocolManagerClient.cpp:
1361         (attachCustomProtocolManagerClientToContext):
1362         * UIProcess/API/glib/WebKitDownloadClient.cpp:
1363         (attachDownloadClientToContext):
1364         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
1365         (webkitFaviconDatabaseOpen):
1366         * UIProcess/API/glib/WebKitFindController.cpp:
1367         (webkitFindControllerConstructed):
1368         * UIProcess/API/glib/WebKitFormClient.cpp:
1369         (attachFormClientToView):
1370         * UIProcess/API/glib/WebKitGeolocationManager.cpp:
1371         (webkitGeolocationManagerCreate):
1372         * UIProcess/API/glib/WebKitIconLoadingClient.cpp:
1373         (attachIconLoadingClientToView):
1374         * UIProcess/API/glib/WebKitInjectedBundleClient.cpp:
1375         (attachInjectedBundleClientToContext):
1376         * UIProcess/API/glib/WebKitNotificationProvider.cpp:
1377         (WebKitNotificationProvider::WebKitNotificationProvider):
1378         * UIProcess/API/glib/WebKitUIClient.cpp:
1379         (attachUIClientToView):
1380         * UIProcess/API/glib/WebKitUserContentManager.cpp:
1381         (webkit_user_content_manager_register_script_message_handler):
1382         (webkit_user_content_manager_register_script_message_handler_in_world):
1383         * UIProcess/API/glib/WebKitWebContext.cpp:
1384         (webkitWebContextConstructed):
1385         (webkit_web_context_set_automation_allowed):
1386         * UIProcess/API/glib/WebKitWebView.cpp:
1387         (webkitWebViewConstructed):
1388         * UIProcess/API/gtk/PageClientImpl.cpp:
1389         (WebKit::PageClientImpl::createDrawingAreaProxy):
1390         * UIProcess/API/gtk/WebKitEmojiChooser.cpp:
1391         (webkitEmojiChooserSetupEmojiSections):
1392         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
1393         (WebKit::RemoteInspectorProtocolHandler::handleRequest):
1394         * UIProcess/API/gtk/WebKitWebInspector.cpp:
1395         (webkitWebInspectorCreate):
1396         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1397         (webkitWebViewBaseConstructed):
1398         (webkitWebViewBaseGestureController):
1399         (webkitWebViewBaseDragAndDropHandler):
1400         (webkitWebViewBaseDidRelaunchWebProcess):
1401         * UIProcess/API/mac/WKView.mm:
1402         (-[WKView maybeInstallIconLoadingClient]):
1403         (-[WKView initWithFrame:processPool:configuration:]):
1404         * UIProcess/API/wpe/PageClientImpl.cpp:
1405         (WebKit::PageClientImpl::PageClientImpl):
1406         (WebKit::PageClientImpl::createDrawingAreaProxy):
1407         * UIProcess/API/wpe/WPEView.cpp:
1408         (WKWPE::View::View):
1409         (WKWPE::View::setClient):
1410         * UIProcess/API/wpe/qt/WPEQtView.cpp:
1411         (WPEQtView::notifyLoadChangedCallback):
1412         (WPEQtView::notifyLoadFailedCallback):
1413         (WPEQtView::runJavaScript):
1414         * UIProcess/API/wpe/qt/WPEQtViewBackend.cpp:
1415         (WPEQtViewBackend::create):
1416         * UIProcess/Automation/WebAutomationSession.cpp:
1417         (WebKit::WebAutomationSession::WebAutomationSession):
1418         * UIProcess/AuxiliaryProcessProxy.h:
1419         (WebKit::AuxiliaryProcessProxy::send):
1420         * UIProcess/Cocoa/IconLoadingDelegate.mm:
1421         (WebKit::IconLoadingDelegate::createIconLoadingClient):
1422         * UIProcess/Cocoa/UIDelegate.mm:
1423         (WebKit::UIDelegate::createContextMenuClient):
1424         (WebKit::UIDelegate::createUIClient):
1425         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
1426         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
1427         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1428         (WebKit::WebProcessPool::platformInitialize):
1429         (WebKit::WebProcessPool::startDisplayLink):
1430         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
1431         (WebKit::WebProcessProxy::processWasUnexpectedlyUnsuspended):
1432         * UIProcess/Cocoa/WebViewImpl.mm:
1433         (WebKit::WebViewImpl::WebViewImpl):
1434         (WebKit::WebViewImpl::createDrawingAreaProxy):
1435         (WebKit::WebViewImpl::setTextIndicator):
1436         (WebKit::WebViewImpl::ensureGestureController):
1437         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
1438         (WebKit::DrawingAreaProxyCoordinatedGraphics::incorporateUpdate):
1439         (WebKit::DrawingAreaProxyCoordinatedGraphics::dispatchAfterEnsuringDrawing):
1440         * UIProcess/DeviceIdHashSaltStorage.cpp:
1441         (WebKit::DeviceIdHashSaltStorage::getDataFromDecoder const):
1442         (WebKit::DeviceIdHashSaltStorage::completeDeviceIdHashSaltForOriginCall):
1443         * UIProcess/Downloads/DownloadProxyMap.cpp:
1444         (WebKit::DownloadProxyMap::createDownloadProxy):
1445         * UIProcess/Gamepad/UIGamepadProvider.cpp:
1446         (WebKit::UIGamepadProvider::setInitialConnectedGamepads):
1447         (WebKit::UIGamepadProvider::platformGamepadConnected):
1448         * UIProcess/Network/NetworkProcessProxy.cpp:
1449         (WebKit::NetworkProcessProxy::createDownloadProxy):
1450         (WebKit::NetworkProcessProxy::takeUploadAssertion):
1451         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
1452         (WebKit::WebNotificationManagerProxy::WebNotificationManagerProxy):
1453         (WebKit::WebNotificationManagerProxy::setProvider):
1454         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
1455         (WebKit::pluginRequiresGtk2):
1456         * UIProcess/ProcessThrottler.cpp:
1457         (WebKit::ProcessThrottler::didConnectToProcess):
1458         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
1459         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
1460         (WebKit::RemoteLayerTreeDrawingAreaProxy::initializeDebugIndicator):
1461         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
1462         (WebKit::RemoteLayerTreeHost::makeNode):
1463         * UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm:
1464         (WebKit::RemoteLayerTreeNode::createWithPlainLayer):
1465         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
1466         (WebKit::RemoteLayerTreeHost::makeNode):
1467         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
1468         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
1469         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1470         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::ScrollingTreeOverflowScrollingNodeIOS):
1471         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
1472         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::ScrollingTreeFrameScrollingNodeRemoteMac):
1473         * UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.cpp:
1474         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::ScrollingTreeOverflowScrollingNodeRemoteMac):
1475         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
1476         (WebKit::HidService::deviceAdded):
1477         * UIProcess/WebGeolocationManagerProxy.cpp:
1478         (WebKit::WebGeolocationManagerProxy::WebGeolocationManagerProxy):
1479         (WebKit::WebGeolocationManagerProxy::setProvider):
1480         * UIProcess/WebMediaSessionFocusManager.cpp:
1481         (WebKit::WebMediaSessionFocusManager::setFocusedMediaElement):
1482         * UIProcess/WebPageInspectorController.cpp:
1483         (WebKit::WebPageInspectorController::WebPageInspectorController):
1484         * UIProcess/WebPageProxy.cpp:
1485         (WebKit::WebPageProxy::WebPageProxy):
1486         (WebKit::m_resetRecentCrashCountTimer):
1487         (WebKit::WebPageProxy::setFormClient):
1488         (WebKit::WebPageProxy::setUIClient):
1489         (WebKit::WebPageProxy::setIconLoadingClient):
1490         (WebKit::WebPageProxy::setFindClient):
1491         (WebKit::WebPageProxy::setFindMatchesClient):
1492         (WebKit::WebPageProxy::setContextMenuClient):
1493         (WebKit::WebPageProxy::setInjectedBundleClient):
1494         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
1495         (WebKit::WebPageProxy::didAttachToRunningProcess):
1496         (WebKit::WebPageProxy::setDrawingArea):
1497         (WebKit::WebPageProxy::close):
1498         (WebKit::WebPageProxy::loadData):
1499         (WebKit::WebPageProxy::handleWheelEvent):
1500         (WebKit::WebPageProxy::processNextQueuedWheelEvent):
1501         (WebKit::WebPageProxy::continueNavigationInNewProcess):
1502         (WebKit::WebPageProxy::setFullscreenClient):
1503         (WebKit::WebPageProxy::userMediaPermissionRequestManager):
1504         (WebKit::WebPageProxy::setScrollPerformanceDataCollectionEnabled):
1505         (WebKit::WebPageProxy::speechSynthesisData):
1506         * UIProcess/WebProcessCache.cpp:
1507         (WebKit::WebProcessCache::addProcessIfPossible):
1508         * UIProcess/WebProcessPool.cpp:
1509         (WebKit::WebProcessPool::WebProcessPool):
1510         (WebKit::WebProcessPool::setInjectedBundleClient):
1511         (WebKit::WebProcessPool::setHistoryClient):
1512         (WebKit::WebProcessPool::setDownloadClient):
1513         (WebKit::WebProcessPool::setAutomationClient):
1514         (WebKit::WebProcessPool::setLegacyCustomProtocolManagerClient):
1515         (WebKit::WebProcessPool::ensureNetworkProcess):
1516         (WebKit::WebProcessPool::didCollectPrewarmInformation):
1517         (WebKit::WebProcessPool::setWebProcessHasUploads):
1518         (WebKit::WebProcessPool::setWebProcessIsPlayingAudibleMedia):
1519         * UIProcess/WebProcessProxy.cpp:
1520         * UIProcess/cairo/BackingStoreCairo.cpp:
1521         (WebKit::BackingStore::createBackend):
1522         * UIProcess/glib/RemoteInspectorClient.cpp:
1523         (WebKit::RemoteInspectorClient::inspect):
1524         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
1525         (WebKit::AcceleratedBackingStoreWayland::checkRequirements):
1526         * UIProcess/gtk/DragAndDropHandler.cpp:
1527         (WebKit::DragAndDropHandler::dragDataSelection):
1528         * UIProcess/gtk/WaylandCompositor.cpp:
1529         (WebKit::WaylandCompositor::initializeEGL):
1530         * UIProcess/ios/EditableImageController.mm:
1531         (WebKit::EditableImageController::ensureEditableImage):
1532         * UIProcess/ios/WKApplicationStateTrackingView.mm:
1533         (-[WKApplicationStateTrackingView didMoveToWindow]):
1534         * UIProcess/ios/WKContentView.mm:
1535         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
1536         (-[WKContentView initWithFrame:processPool:configuration:webView:]):
1537         (-[WKContentView _createDrawingAreaProxy:]):
1538         * UIProcess/ios/WKContentViewInteraction.mm:
1539         (-[WKContentView setupInteraction]):
1540         (-[WKContentView becomeFirstResponderForWebView]):
1541         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:]):
1542         * UIProcess/ios/WebPageProxyIOS.mm:
1543         (WebKit::WebPageProxy::elementDidFocus):
1544         (WebKit::WebPageProxy::paymentCoordinatorAuthorizationPresenter):
1545         * UIProcess/mac/PageClientImplMac.mm:
1546         (WebKit::PageClientImpl::PageClientImpl):
1547         * UIProcess/mac/WKFullScreenWindowController.mm:
1548         (-[WKFullScreenWindowController initWithWindow:webView:page:]):
1549         * UIProcess/mac/WKTextFinderClient.mm:
1550         (-[WKTextFinderClient initWithPage:view:usePlatformFindUI:]):
1551         * UIProcess/socket/RemoteInspectorClient.cpp:
1552         (WebKit::RemoteInspectorClient::inspect):
1553         * UIProcess/socket/RemoteInspectorProtocolHandler.cpp:
1554         (WebKit::RemoteInspectorProtocolHandler::platformStartTask):
1555         * UIProcess/win/BackingStoreDirect2D.cpp:
1556         (WebKit::BackingStore::createBackend):
1557         * UIProcess/win/PageClientImpl.cpp:
1558         (WebKit::PageClientImpl::createDrawingAreaProxy):
1559         * UIProcess/win/WebView.cpp:
1560         (WebKit::WebView::WebView):
1561         * WebProcess/Gamepad/WebGamepadProvider.cpp:
1562         (WebKit::WebGamepadProvider::setInitialGamepads):
1563         (WebKit::WebGamepadProvider::gamepadConnected):
1564         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1565         (WKBundleSetClient):
1566         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1567         (WKBundlePageSetContextMenuClient):
1568         (WKBundlePageSetEditorClient):
1569         (WKBundlePageSetFormClient):
1570         (WKBundlePageSetPageLoaderClient):
1571         (WKBundlePageSetResourceLoadClient):
1572         (WKBundlePageSetUIClient):
1573         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
1574         (WKBundlePageOverlayCreate):
1575         * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm:
1576         (WKBundlePageBannerCreateBannerWithCALayer):
1577         * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.cpp:
1578         (WebKit::getOrCreateDOMObjectCacheFrameObserver):
1579         (WebKit::DOMObjectCache::put):
1580         * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp:
1581         (WebKit::WebKitExtensionManager::initialize):
1582         * WebProcess/InjectedBundle/API/glib/WebKitWebEditor.cpp:
1583         (webkitWebEditorCreate):
1584         * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp:
1585         (webkitWebExtensionCreate):
1586         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
1587         (webkitFrameGetOrCreate):
1588         (webkitWebPageCreate):
1589         * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.mm:
1590         (-[WKDOMTextIterator initWithRange:]):
1591         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1592         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]):
1593         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
1594         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1595         (WebKit::InjectedBundle::InjectedBundle):
1596         (WebKit::InjectedBundle::setClient):
1597         * WebProcess/Network/WebSocketChannel.cpp:
1598         (WebKit::PendingMessage::PendingMessage):
1599         (WebKit::WebSocketChannel::send):
1600         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
1601         (WebKit::LibWebRTCProvider::createPeerConnection):
1602         (WebKit::LibWebRTCProvider::createSocketFactory):
1603         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
1604         (WebKit::LibWebRTCSocketFactory::createServerTcpSocket):
1605         (WebKit::LibWebRTCSocketFactory::createUdpSocket):
1606         (WebKit::LibWebRTCSocketFactory::createClientTcpSocket):
1607         (WebKit::LibWebRTCSocketFactory::createNewConnectionSocket):
1608         (WebKit::LibWebRTCSocketFactory::createAsyncResolver):
1609         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1610         (WebKit::PluginDestructionProtector::PluginDestructionProtector):
1611         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1612         (WebKit::NetscapePlugin::scheduleTimer):
1613         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
1614         (WebKit::NetscapePluginStream::deliverData):
1615         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
1616         (WebKit::NetscapePluginX11::create):
1617         * WebProcess/Plugins/PluginProxy.cpp:
1618         (WebKit::PluginProxy::initialize):
1619         * WebProcess/Plugins/PluginView.cpp:
1620         (WebKit::PluginView::createWebEvent const):
1621         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1622         (WebKit::WebSWContextManagerConnection::installServiceWorker):
1623         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1624         (WebKit::WebChromeClient::createColorChooser):
1625         (WebKit::WebChromeClient::createDataListSuggestionPicker):
1626         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
1627         (WebKit::WebInspectorClient::showPaintRect):
1628         * WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp:
1629         (WebKit::WebPasteboardOverrides::addOverride):
1630         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
1631         (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode):
1632         * WebProcess/WebPage/DrawingArea.cpp:
1633         (WebKit::DrawingArea::create):
1634         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
1635         (WebKit::PlatformCALayerRemote::ensureBackingStore):
1636         (WebKit::PlatformCALayerRemote::setTransform):
1637         (WebKit::PlatformCALayerRemote::setSublayerTransform):
1638         (WebKit::PlatformCALayerRemote::setFilters):
1639         (WebKit::PlatformCALayerRemote::setShapeRoundedRect):
1640         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteTiledBacking.cpp:
1641         (WebKit::PlatformCALayerRemoteTiledBacking::PlatformCALayerRemoteTiledBacking):
1642         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1643         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
1644         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
1645         * WebProcess/WebPage/WebFrame.cpp:
1646         (WebKit::WebFrame::createSubframe):
1647         * WebProcess/WebPage/WebPage.cpp:
1648         (WebKit::m_textAutoSizingAdjustmentTimer):
1649         (WebKit::WebPage::setInjectedBundleContextMenuClient):
1650         (WebKit::WebPage::setInjectedBundleEditorClient):
1651         (WebKit::WebPage::setInjectedBundleFormClient):
1652         (WebKit::WebPage::setInjectedBundlePageLoaderClient):
1653         (WebKit::WebPage::setInjectedBundleResourceLoadClient):
1654         (WebKit::WebPage::setInjectedBundleUIClient):
1655         (WebKit::WebPage::close):
1656         (WebKit::WebPage::beginPrinting):
1657         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
1658         (WebKit::WebPrintOperationGtk::print):
1659         * WebProcess/WebPage/ios/FindControllerIOS.mm:
1660         (WebKit::FindController::updateFindIndicator):
1661         * WebProcess/WebPage/mac/DrawingAreaMac.cpp:
1662         (WebKit::DisplayRefreshMonitorMac::requestRefreshCallback):
1663         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1664         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
1665         * WebProcess/WebProcess.cpp:
1666         (WebKit::WebProcess::markAllLayersVolatile):
1667         (WebKit::WebProcess::ensureAutomationSessionProxy):
1668         (WebKit::WebProcess::libWebRTCNetwork):
1669         (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess):
1670         * WebProcess/WebProcess.h:
1671         (WebKit::WebProcess::addSupplement):
1672         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1673         (WebKit::UserMediaCaptureManager::Source::Source):
1674         * WebProcess/cocoa/WebProcessCocoa.mm:
1675         (WebKit::WebProcess::processTaskStateDidChange):
1676         (WebKit::WebProcess::updateCPUMonitorState):
1677
1678 2019-08-18  Per Arne Vollan  <pvollan@apple.com>
1679
1680         [Mac] Use the PID of the WebContent process when issuing local file read sandbox extensions
1681         https://bugs.webkit.org/show_bug.cgi?id=200543
1682         <rdar://problem/49394015>
1683         
1684         Reviewed by Brent Fulgham.
1685
1686         Adopt SPI to issue a process-specific sandbox extension for local file read, passing it the process
1687         identifier of the WebContent process.
1688         
1689         * Shared/Cocoa/SandboxExtensionCocoa.mm:
1690         (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
1691         (WebKit::SandboxExtension::createHandleForReadByPid):
1692         * Shared/SandboxExtension.h:
1693         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1694         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
1695         * UIProcess/WebPageProxy.cpp:
1696         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
1697         (WebKit::WebPageProxy::loadFile):
1698
1699 2019-08-17  Tim Horton  <timothy_horton@apple.com>
1700
1701         Layout tests that call resizeTo() crash when run on iOS with IOSurface support enabled
1702         https://bugs.webkit.org/show_bug.cgi?id=200866
1703         <rdar://problem/50254021>
1704
1705         Reviewed by Simon Fraser.
1706
1707         * UIProcess/ios/PageClientImplIOS.mm:
1708         (WebKit::PageClientImpl::convertToDeviceSpace):
1709         (WebKit::PageClientImpl::convertToUserSpace):
1710         Implement convertTo{Device,User}Space in PageClientImplIOS.
1711         We don't actually do any conversion. For our purposes, the window is
1712         "device" space, and we never allow iOS WebKit clients to resize the window...
1713         except for in tests! So just pass the rects straight through, instead of
1714         returning an empty rect.
1715
1716 2019-08-17  Eric Liang  <ericliang@apple.com>
1717
1718         Use bundlePath SPI in AccessibilitySupport for WebProcessLoader
1719         https://bugs.webkit.org/show_bug.cgi?id=200367
1720
1721         Reviewed by Darin Adler.
1722
1723         * Platform/spi/ios/AccessibilitySupportSPI.h:
1724         * WebProcess/cocoa/WebProcessCocoa.mm:
1725         (WebKit::accessibilityWebProcessLoaderBundlePath):
1726         (WebKit::registerWithAccessibility):
1727
1728 2019-08-17  Sam Weinig  <weinig@apple.com>
1729
1730         Rename StringBuilder::flexibleAppend(...) to StringBuilder::append(...)
1731         https://bugs.webkit.org/show_bug.cgi?id=200756
1732
1733         Reviewed by Darin Adler.
1734
1735         Update call sites for rename from StringBuilder::flexibleAppend(...) to 
1736         StringBuilder::append(...).
1737
1738         * WebProcess/WebPage/WebPage.cpp:
1739         (WebKit::dumpHistoryItem):
1740         We have to explicitly access the underlying String of the URL rather than
1741         relying on the implicit conversion since it is now ambiguous which append(...)
1742         overload should be used.
1743
1744 2019-08-17  Devin Rousso  <drousso@apple.com>
1745
1746         Web Inspector: make the initial height bigger when attached
1747         https://bugs.webkit.org/show_bug.cgi?id=200855
1748
1749         Reviewed by Joseph Pecoraro.
1750
1751         * Shared/WebPreferences.yaml:
1752         Increase the default attached height from `300px` to `500px`, which is close to the same
1753         amount of area given a 15" MacBook Pro's aspect ratio (default attached width is `750px`).
1754
1755 2019-08-17  Simon Fraser  <simon.fraser@apple.com>
1756
1757         [iOS WK2] Scroll indicators disappear sometimes
1758         https://bugs.webkit.org/show_bug.cgi?id=200791
1759
1760         Reviewed by Tim Horton.
1761         
1762         _web_setSubviews: replaces all of the views subviews with the supplied array, but this blows
1763         away views not managed by WebKit, including UIScrollViews scroll indicators. Fix by having
1764         WebKit-managed views implement the WKWebKitControlled protocol, and only removing views
1765         implementing that protocol.
1766
1767         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
1768         (-[UIView _web_setSubviews:]):
1769         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
1770
1771 2019-08-17  Antti Koivisto  <antti@apple.com>
1772
1773         Content in <iframe> should override "touch-action" set in embedding document
1774         https://bugs.webkit.org/show_bug.cgi?id=200204
1775         <rdar://problem/54355249>
1776
1777         Reviewed by Antoine Quint.
1778
1779         Subframes where content doesn't use any touch-action properties won't generate event region for their main layer.
1780         As a result the touch-action property gets computed in UI process to the parent frames touch-action (instead of 'auto').
1781
1782         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
1783         (WebKit::touchActionsForPoint):
1784
1785         If the topmost layer hit is a WKChildScrollView we know its content layer didn't have an event region.
1786         This means we should return the default value 'auto'.
1787
1788 2019-08-16  Chris Dumez  <cdumez@apple.com>
1789
1790         Use strongly typed identifiers for StorageArea / StorageAreaImpl
1791         https://bugs.webkit.org/show_bug.cgi?id=200835
1792
1793         Reviewed by Alex Christensen.
1794
1795         Use strongly typed identifiers for StorageArea / StorageAreaImpl. They currently both use uint64_t
1796         and are used in the same code, it is therefore very easy to confused the 2 types of identifiers.
1797
1798         * NetworkProcess/WebStorage/StorageArea.cpp:
1799         (WebKit::StorageArea::StorageArea):
1800         (WebKit::StorageArea::setItem):
1801         (WebKit::StorageArea::removeItem):
1802         (WebKit::StorageArea::clear):
1803         (WebKit::StorageArea::dispatchEvents const):
1804         * NetworkProcess/WebStorage/StorageArea.h:
1805         (WebKit::StorageArea::identifier):
1806         * NetworkProcess/WebStorage/StorageAreaIdentifier.h: Copied from Source/WebKit/WebProcess/WebStorage/StorageAreaImpl.h.
1807         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
1808         (WebKit::StorageManagerSet::connectToLocalStorageArea):
1809         (WebKit::StorageManagerSet::connectToTransientLocalStorageArea):
1810         (WebKit::StorageManagerSet::connectToSessionStorageArea):
1811         (WebKit::StorageManagerSet::disconnectFromStorageArea):
1812         (WebKit::StorageManagerSet::getValues):
1813         (WebKit::StorageManagerSet::setItem):
1814         (WebKit::StorageManagerSet::removeItem):
1815         (WebKit::StorageManagerSet::clear):
1816         * NetworkProcess/WebStorage/StorageManagerSet.h:
1817         * NetworkProcess/WebStorage/StorageManagerSet.messages.in:
1818         * Scripts/webkit/messages.py:
1819         * WebKit.xcodeproj/project.pbxproj:
1820         * WebProcess/Network/NetworkProcessConnection.cpp:
1821         (WebKit::NetworkProcessConnection::didReceiveMessage):
1822         * WebProcess/WebProcess.cpp:
1823         (WebKit::WebProcess::registerStorageAreaMap):
1824         (WebKit::WebProcess::unregisterStorageAreaMap):
1825         (WebKit::WebProcess::storageAreaMap const):
1826         * WebProcess/WebProcess.h:
1827         * WebProcess/WebStorage/StorageAreaImpl.cpp:
1828         (WebKit::StorageAreaImpl::StorageAreaImpl):
1829         * WebProcess/WebStorage/StorageAreaImpl.h:
1830         * WebProcess/WebStorage/StorageAreaImplIdentifier.h: Copied from Source/WebKit/WebProcess/WebStorage/StorageAreaImpl.h.
1831         * WebProcess/WebStorage/StorageAreaMap.cpp:
1832         (WebKit::StorageAreaMap::StorageAreaMap):
1833         (WebKit::StorageAreaMap::setItem):
1834         (WebKit::StorageAreaMap::removeItem):
1835         (WebKit::StorageAreaMap::clear):
1836         (WebKit::StorageAreaMap::loadValuesIfNeeded):
1837         (WebKit::StorageAreaMap::dispatchStorageEvent):
1838         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
1839         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
1840         (WebKit::StorageAreaMap::disconnect):
1841         * WebProcess/WebStorage/StorageAreaMap.h:
1842         (WebKit::StorageAreaMap::identifier const):
1843         * WebProcess/WebStorage/StorageAreaMap.messages.in:
1844
1845 2019-08-16  Chris Dumez  <cdumez@apple.com>
1846
1847         Drop StorageArea::setWorkQueue() member function
1848         https://bugs.webkit.org/show_bug.cgi?id=200832
1849
1850         Reviewed by Alex Christensen.
1851
1852         Drop StorageArea::setWorkQueue() member function and pass the WorkQueue to the StorageArea constructor instead.
1853         The WorkQueue can never get updated so an explicit setter is not necessary. It also makes it clearer that the
1854         m_queue data member can never be null.
1855
1856         * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
1857         (WebKit::LocalStorageNamespace::getOrCreateStorageArea):
1858         * NetworkProcess/WebStorage/LocalStorageNamespace.h:
1859         * NetworkProcess/WebStorage/SessionStorageNamespace.cpp:
1860         (WebKit::SessionStorageNamespace::getOrCreateStorageArea):
1861         * NetworkProcess/WebStorage/SessionStorageNamespace.h:
1862         * NetworkProcess/WebStorage/StorageArea.cpp:
1863         (WebKit::StorageArea::StorageArea):
1864         (WebKit::StorageArea::clone const):
1865         (WebKit::StorageArea::openDatabaseAndImportItemsIfNeeded const):
1866         * NetworkProcess/WebStorage/StorageArea.h:
1867         (WebKit::StorageArea::setWorkQueue): Deleted.
1868         * NetworkProcess/WebStorage/StorageManager.cpp:
1869         (WebKit::StorageManager::createLocalStorageArea):
1870         (WebKit::StorageManager::createTransientLocalStorageArea):
1871         (WebKit::StorageManager::createSessionStorageArea):
1872         * NetworkProcess/WebStorage/StorageManager.h:
1873         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
1874         (WebKit::StorageManagerSet::connectToLocalStorageArea):
1875         (WebKit::StorageManagerSet::connectToTransientLocalStorageArea):
1876         (WebKit::StorageManagerSet::connectToSessionStorageArea):
1877         * NetworkProcess/WebStorage/TransientLocalStorageNamespace.cpp:
1878         (WebKit::TransientLocalStorageNamespace::getOrCreateStorageArea):
1879         * NetworkProcess/WebStorage/TransientLocalStorageNamespace.h:
1880
1881 2019-08-16  Chris Dumez  <cdumez@apple.com>
1882
1883         LocalStorageDatabaseTracker does not need to subclass ThreadSafeRefCounted
1884         https://bugs.webkit.org/show_bug.cgi?id=200825
1885
1886         Reviewed by Alex Christensen.
1887
1888         LocalStorageDatabaseTracker does not need to subclass ThreadSafeRefCounted. It is currently always
1889         ref'd / deref'd from the com.apple.WebKit.WebStorage serial WorkQueue, save from inside
1890         LocalStorageDatabaseTracker::platformMaybeExcludeFromBackup() on iOS. However, it is probably
1891         not a good idea to set FileSystem metadata from the main thread in platformMaybeExcludeFromBackup()
1892         anyway.
1893
1894         Note that I had to get rid of an old linked-on-after check since those are currently only safe
1895         to do on the main thread. I cleared this with Brady. It has been a while since we've shipped this
1896         behavior now and apps have had a chance to update.
1897
1898         * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
1899         (WebKit::LocalStorageDatabaseTracker::databasePath const):
1900         * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.h:
1901         * NetworkProcess/WebStorage/ios/LocalStorageDatabaseTrackerIOS.mm:
1902         (WebKit::LocalStorageDatabaseTracker::platformMaybeExcludeFromBackup const):
1903         * UIProcess/Cocoa/VersionChecks.h:
1904
1905 2019-08-16  Chris Dumez  <cdumez@apple.com>
1906
1907         LocalStorageDatabase should use inline initialization for its data members
1908         https://bugs.webkit.org/show_bug.cgi?id=200828
1909
1910         Reviewed by John Wilander.
1911
1912         * NetworkProcess/WebStorage/LocalStorageDatabase.cpp:
1913         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
1914         * NetworkProcess/WebStorage/LocalStorageDatabase.h:
1915
1916 2019-08-16  Kate Cheney  <katherine_cheney@apple.com>
1917
1918         Functions with no parameters in WebKit/Shared/API/c and WebKit/UIProcess/API/C are
1919         missing a "void" specifier in their argument list
1920         https://bugs.webkit.org/show_bug.cgi?id=200826
1921
1922         Reviewed by Chris Dumez.
1923
1924         Added void to indicate functions with no arguments to satisfy compiler errors.
1925         This error came to light when fixing another patch.
1926
1927         * Shared/API/c/WKArray.h:
1928         * Shared/API/c/WKConnectionRef.h:
1929         * Shared/API/c/WKContextMenuItem.h:
1930         * Shared/API/c/WKData.h:
1931         * Shared/API/c/WKDictionary.h:
1932         * Shared/API/c/WKErrorRef.h:
1933         * Shared/API/c/WKMutableArray.h:
1934         * Shared/API/c/WKMutableDictionary.h:
1935         * Shared/API/c/WKNumber.h:
1936         * Shared/API/c/WKPluginInformation.h:
1937         * Shared/API/c/WKRenderLayer.h:
1938         * Shared/API/c/WKRenderObject.h:
1939         * Shared/API/c/WKSecurityOriginRef.h:
1940         * Shared/API/c/WKSerializedScriptValue.h:
1941         * Shared/API/c/WKString.h:
1942         * Shared/API/c/WKURL.h:
1943         * Shared/API/c/WKURLRequest.h:
1944         * Shared/API/c/WKURLResponse.h:
1945         * Shared/API/c/WKUserContentURLPattern.h:
1946         * UIProcess/API/C/WKBackForwardListItemRef.h:
1947         * UIProcess/API/C/WKBackForwardListRef.h:
1948         * UIProcess/API/C/WKContext.h:
1949         * UIProcess/API/C/WKFormSubmissionListener.h:
1950         * UIProcess/API/C/WKFrame.h:
1951         * UIProcess/API/C/WKFramePolicyListener.h:
1952         * UIProcess/API/C/WKGeolocationManager.h:
1953         * UIProcess/API/C/WKGeolocationPermissionRequest.h:
1954         * UIProcess/API/C/WKGeolocationPosition.h:
1955         * UIProcess/API/C/WKHitTestResult.h:
1956         * UIProcess/API/C/WKNavigationDataRef.h:
1957         * UIProcess/API/C/WKOpenPanelParametersRef.h:
1958         * UIProcess/API/C/WKOpenPanelResultListener.h:
1959         * UIProcess/API/C/WKPage.h:
1960         * UIProcess/API/C/WKPageConfigurationRef.h:
1961         * UIProcess/API/C/WKPageGroup.h:
1962         * UIProcess/API/C/WKPageUIClient.h:
1963         * UIProcess/API/C/WKPreferencesRef.h:
1964         * UIProcess/API/C/WKUserContentControllerRef.h:
1965         * UIProcess/API/C/WKUserMediaPermissionRequest.h:
1966         * UIProcess/API/C/WKUserScriptRef.h:
1967
1968 2019-08-16  Chris Dumez  <cdumez@apple.com>
1969
1970         LocalStorageDatabase does not need to subclass ThreadSafeRefCounted
1971         https://bugs.webkit.org/show_bug.cgi?id=200822
1972
1973         Reviewed by Geoff Garen.
1974
1975         LocalStorageDatabase does not need to subclass ThreadSafeRefCounted, it is only ref'd / deref'd by the StorageArea
1976         on the com.apple.WebKit.WebStorage serial WorkQueue, and in LocalStorageDatabase::scheduleDatabaseUpdate() on the
1977         same WorkQueue.
1978
1979         * NetworkProcess/WebStorage/LocalStorageDatabase.cpp:
1980         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
1981         (WebKit::LocalStorageDatabase::~LocalStorageDatabase):
1982         * NetworkProcess/WebStorage/LocalStorageDatabase.h:
1983
1984 2019-08-16  Chris Dumez  <cdumez@apple.com>
1985
1986         Many WebStorage classes do not need to subclass ThreadSafeRefCounted
1987         https://bugs.webkit.org/show_bug.cgi?id=200821
1988
1989         Reviewed by Geoffrey Garen.
1990
1991         Many WebStorage classes do not need to subclass ThreadSafeRefCounted. They never get ref'd or deref'd.
1992
1993         * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
1994         (WebKit::LocalStorageNamespace::getOrCreateStorageArea):
1995         (WebKit::LocalStorageNamespace::clearAllStorageAreas):
1996         * NetworkProcess/WebStorage/LocalStorageNamespace.h:
1997         * NetworkProcess/WebStorage/SessionStorageNamespace.cpp:
1998         (WebKit::SessionStorageNamespace::getOrCreateStorageArea):
1999         * NetworkProcess/WebStorage/SessionStorageNamespace.h:
2000         * NetworkProcess/WebStorage/StorageArea.cpp:
2001         (WebKit::StorageArea::clone const):
2002         * NetworkProcess/WebStorage/StorageArea.h:
2003         * NetworkProcess/WebStorage/StorageManager.cpp:
2004         (WebKit::StorageManager::createSessionStorageNamespace):
2005         (WebKit::StorageManager::createLocalStorageArea):
2006         (WebKit::StorageManager::createTransientLocalStorageArea):
2007         (WebKit::StorageManager::createSessionStorageArea):
2008         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
2009         (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
2010         (WebKit::StorageManager::getOrCreateSessionStorageNamespace):
2011         * NetworkProcess/WebStorage/StorageManager.h:
2012         * NetworkProcess/WebStorage/TransientLocalStorageNamespace.cpp:
2013         (WebKit::TransientLocalStorageNamespace::getOrCreateStorageArea):
2014         * NetworkProcess/WebStorage/TransientLocalStorageNamespace.h:
2015
2016 2019-08-16  Dean Jackson  <dino@apple.com>
2017
2018         Long pressing images with transparent backgrounds in dark mode causes a black background to appear around the image content
2019         https://bugs.webkit.org/show_bug.cgi?id=200827
2020         <rdar://53933379>
2021
2022         Reviewed by Tim Horton.
2023
2024         Set a clear color when there is no provided background.
2025
2026         * UIProcess/ios/WKContentViewInteraction.mm:
2027         (createTargetedPreview):
2028
2029 2019-08-16  Ryosuke Niwa  <rniwa@webkit.org>
2030
2031         Split tabIndex computation for DOM and the rest of WebCore
2032         https://bugs.webkit.org/show_bug.cgi?id=200806
2033
2034         Reviewed by Chris Dumez.
2035
2036         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
2037         (webkit_dom_html_element_get_tab_index):
2038         (webkit_dom_html_element_set_tab_index):
2039
2040 2019-08-16  Ross Kirsling  <ross.kirsling@sony.com>
2041
2042         Unreviewed restabilization of non-unified build.
2043
2044         * NetworkProcess/NetworkCORSPreflightChecker.h:
2045         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
2046         (WebKit::StorageManagerSet::StorageManagerSet):
2047         * Shared/FrameInfoData.cpp:
2048         (WebKit::FrameInfoData::decode):
2049         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
2050         * WebProcess/WebStorage/StorageNamespaceImpl.h:
2051
2052 2019-08-16  Chris Dumez  <cdumez@apple.com>
2053
2054         StorageManager does not need to subclass RefCounted
2055         https://bugs.webkit.org/show_bug.cgi?id=200818
2056
2057         Reviewed by Geoffrey Garen.
2058
2059         StorageManager does not need to subclass RefCounted. It is owned by the StorageManagerSet
2060         and is never ref'd / deref'd.
2061
2062         * NetworkProcess/WebStorage/StorageManager.h:
2063         (WebKit::StorageManager::create): Deleted.
2064         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
2065         (WebKit::StorageManagerSet::add):
2066         * NetworkProcess/WebStorage/StorageManagerSet.h:
2067
2068 2019-08-16  Chris Dumez  <cdumez@apple.com>
2069
2070         Clarify StorageManagerSet / StorageManager threading model after r248734
2071         https://bugs.webkit.org/show_bug.cgi?id=200817
2072
2073         Reviewed by Geoffrey Garen.
2074
2075         Clarify StorageManagerSet / StorageManager threading model after r248734. StorageManager is now
2076         a background thread object but it still calls its completion handlers on the main thread, which
2077         is very error prone. The pattern in WebKit for thread safety is that methods should always call
2078         their completion handler of the thread / queue they were called on themselves. Doing differently
2079         has caused so many thread-safety bugs in the past.
2080
2081         * NetworkProcess/WebStorage/StorageManager.cpp:
2082         (WebKit::StorageManager::getSessionStorageOrigins const):
2083         (WebKit::StorageManager::deleteSessionStorageOrigins):
2084         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
2085         (WebKit::StorageManager::getLocalStorageOrigins const):
2086         (WebKit::StorageManager::getLocalStorageOriginDetails const):
2087         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
2088         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
2089         (WebKit::StorageManager::getSessionStorageOrigins): Deleted.
2090         (WebKit::StorageManager::getLocalStorageOrigins): Deleted.
2091         (WebKit::StorageManager::getLocalStorageOriginDetails): Deleted.
2092         * NetworkProcess/WebStorage/StorageManager.h:
2093         * NetworkProcess/WebStorage/StorageManagerSet.cpp:
2094         (WebKit::StorageManagerSet::getSessionStorageOrigins):
2095         (WebKit::StorageManagerSet::deleteSessionStorage):
2096         (WebKit::StorageManagerSet::deleteSessionStorageForOrigins):
2097         (WebKit::StorageManagerSet::getLocalStorageOrigins):
2098         (WebKit::StorageManagerSet::deleteLocalStorageModifiedSince):
2099         (WebKit::StorageManagerSet::deleteLocalStorageForOrigins):
2100         (WebKit::StorageManagerSet::getLocalStorageOriginDetails):
2101
2102 2019-08-16  Chris Dumez  <cdumez@apple.com>
2103
2104         StorageManagerSet constructor should not be public
2105         https://bugs.webkit.org/show_bug.cgi?id=200816
2106
2107         Reviewed by Geoffrey Garen.
2108
2109         StorageManagerSet constructor should not be public since it subclasses ThreadSafeRefCounted and
2110         has a factory method.
2111
2112         * NetworkProcess/WebStorage/StorageManagerSet.h:
2113
2114 2019-08-16  Timothy Hatcher  <timothy@apple.com>
2115
2116         REGRESSION (r248436): WKWebView doesn’t respect isOpaque setting in NIB.
2117         https://bugs.webkit.org/show_bug.cgi?id=200802
2118         rdar://problem/54357818
2119
2120         Reviewed by Tim Horton.
2121
2122         Tests: WKWebView.IsOpaqueDefault, WKWebView.SetOpaqueYes, WKWebView.SetOpaqueNo, WKWebView.IsOpaqueYesSubclassOverridden,
2123         WKWebView.IsOpaqueNoSubclassOverridden, WKWebView.IsOpaqueYesDecodedFromArchive, WKWebView.IsOpaqueNoDecodedFromArchive,
2124         WKWebView.IsOpaqueDrawsBackgroundYesConfiguration, WKWebView.IsOpaqueDrawsBackgroundNoConfiguration.
2125
2126         * UIProcess/API/Cocoa/WKWebView.mm:
2127         (-[WKWebView _initializeWithConfiguration:]): Call _setOpaqueInternal:NO instead of self.opaque = NO.
2128         (-[WKWebView _setOpaqueInternal:]): Added. Moved code from setOpaque:.
2129         (-[WKWebView setOpaque:]): Call _setOpaqueInternal:.
2130
2131 2019-08-15  Yusuke Suzuki  <ysuzuki@apple.com>
2132
2133         [WTF] Add makeUnique<T>, which ensures T is fast-allocated, WTF_MAKE_FAST_ALLOCATED annotation part
2134         https://bugs.webkit.org/show_bug.cgi?id=200620
2135
2136         Reviewed by Geoffrey Garen.
2137
2138         * NetworkProcess/AdClickAttributionManager.h:
2139         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.h:
2140         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
2141         * NetworkProcess/Cookies/WebCookieManager.h:
2142         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h:
2143         * NetworkProcess/NetworkHTTPSUpgradeChecker.h:
2144         * NetworkProcess/NetworkProcess.cpp:
2145         * NetworkProcess/NetworkSession.h:
2146         * NetworkProcess/NetworkSocketChannel.h:
2147         * NetworkProcess/WebSocketTask.h:
2148         * NetworkProcess/cache/PrefetchCache.h:
2149         * NetworkProcess/cocoa/WebSocketTaskCocoa.h:
2150         * NetworkProcess/soup/WebKitSoupRequestInputStream.cpp:
2151         * NetworkProcess/soup/WebSocketTaskSoup.h:
2152         * NetworkProcess/webrtc/LibWebRTCSocketClient.h:
2153         * NetworkProcess/webrtc/NetworkMDNSRegister.cpp:
2154         * Platform/Module.h:
2155         * PluginProcess/PluginControllerProxy.h:
2156         * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
2157         * Shared/Authentication/AuthenticationManager.h:
2158         * Shared/Cocoa/SandboxExtensionCocoa.mm:
2159         * Shared/Plugins/NPObjectMessageReceiver.h:
2160         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
2161         * UIProcess/API/APIAutomationClient.h:
2162         * UIProcess/API/APIAutomationSessionClient.h:
2163         * UIProcess/API/APIContextMenuClient.h:
2164         * UIProcess/API/APICustomProtocolManagerClient.h:
2165         * UIProcess/API/APIDiagnosticLoggingClient.h:
2166         * UIProcess/API/APIDownloadClient.h:
2167         * UIProcess/API/APIFindClient.h:
2168         * UIProcess/API/APIFindMatchesClient.h:
2169         * UIProcess/API/APIFormClient.h:
2170         * UIProcess/API/APIFullscreenClient.h:
2171         * UIProcess/API/APIGeolocationProvider.h:
2172         * UIProcess/API/APIHistoryClient.h:
2173         * UIProcess/API/APIIconDatabaseClient.h:
2174         * UIProcess/API/APIIconLoadingClient.h:
2175         * UIProcess/API/APIInjectedBundleClient.h:
2176         * UIProcess/API/APILegacyContextHistoryClient.h:
2177         * UIProcess/API/APILoaderClient.h:
2178         * UIProcess/API/APINavigationClient.h:
2179         * UIProcess/API/APIPolicyClient.h:
2180         * UIProcess/API/APIUIClient.h:
2181         * UIProcess/API/C/WKPage.cpp:
2182         (WKPageSetPageStateClient):
2183         * UIProcess/API/Cocoa/WKUserContentController.mm:
2184         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
2185         * UIProcess/API/glib/IconDatabase.h:
2186         * UIProcess/API/glib/WebKitAutomationSession.cpp:
2187         * UIProcess/API/glib/WebKitIconLoadingClient.cpp:
2188         * UIProcess/API/glib/WebKitNotificationProvider.h:
2189         * UIProcess/API/glib/WebKitUserContentManager.cpp:
2190         * UIProcess/API/glib/WebKitWebContext.cpp:
2191         * UIProcess/API/glib/WebKitWebView.cpp:
2192         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
2193         * UIProcess/API/gtk/WebKitWebInspector.cpp:
2194         * UIProcess/API/mac/WKView.mm:
2195         (-[WKView maybeInstallIconLoadingClient]):
2196         * UIProcess/API/wpe/APIViewClient.h:
2197         * UIProcess/API/wpe/ScrollGestureController.h:
2198         * UIProcess/ApplicationStateTracker.h:
2199         * UIProcess/Cocoa/AutomationSessionClient.h:
2200         * UIProcess/Cocoa/IconLoadingDelegate.h:
2201         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2202         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.h:
2203         * UIProcess/DrawingAreaProxy.h:
2204         * UIProcess/HighPerformanceGraphicsUsageSampler.h:
2205         * UIProcess/Network/NetworkProcessProxy.h:
2206         * UIProcess/PageClient.h:
2207         * UIProcess/PerActivityStateCPUUsageSampler.h:
2208         * UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.h:
2209         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
2210         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
2211         * UIProcess/SystemPreviewController.h:
2212         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2213         * UIProcess/WebAuthentication/WebAuthenticatorCoordinatorProxy.h:
2214         * UIProcess/WebNavigationState.h:
2215         * UIProcess/WebPageInjectedBundleClient.h:
2216         * UIProcess/WebPageProxy.h:
2217         * UIProcess/WebsiteData/WebsiteDataStoreClient.h:
2218         * UIProcess/gtk/DragAndDropHandler.h:
2219         * UIProcess/ios/EditableImageController.h:
2220         * UIProcess/ios/InputViewUpdateDeferrer.h:
2221         * UIProcess/ios/SmartMagnificationController.h:
2222         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
2223         * UIProcess/mac/WKFullScreenWindowController.mm:
2224         * UIProcess/mac/WKTextFinderClient.mm:
2225         * WebProcess/ApplePay/WebPaymentCoordinator.h:
2226         * WebProcess/Geolocation/GeolocationPermissionRequestManager.h:
2227         * WebProcess/Geolocation/WebGeolocationManager.h:
2228         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
2229         * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm:
2230         * WebProcess/InjectedBundle/API/glib/DOM/DOMObjectCache.cpp:
2231         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
2232         * WebProcess/MediaCache/WebMediaKeyStorageManager.h:
2233         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
2234         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
2235         * WebProcess/Network/webrtc/LibWebRTCResolver.h:
2236         * WebProcess/Notifications/WebNotificationManager.h:
2237         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
2238         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.h:
2239         * WebProcess/Plugins/PluginController.h:
2240         * WebProcess/Storage/WebSWOriginTable.h:
2241         * WebProcess/WebCoreSupport/WebAlternativeTextClient.h:
2242         * WebProcess/WebCoreSupport/WebChromeClient.h:
2243         * WebProcess/WebCoreSupport/WebContextMenuClient.h:
2244         * WebProcess/WebCoreSupport/WebDragClient.h:
2245         * WebProcess/WebCoreSupport/WebEditorClient.h:
2246         * WebProcess/WebCoreSupport/WebGeolocationClient.h:
2247         * WebProcess/WebCoreSupport/WebInspectorClient.h:
2248         * WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h:
2249         * WebProcess/WebCoreSupport/WebNotificationClient.h:
2250         * WebProcess/WebCoreSupport/WebPlugInClient.h:
2251         * WebProcess/WebCoreSupport/WebProgressTrackerClient.h:
2252         * WebProcess/WebCoreSupport/WebSpeechSynthesisClient.h:
2253         * WebProcess/WebCoreSupport/WebUserMediaClient.h:
2254         * WebProcess/WebPage/Cocoa/TextCheckingControllerProxy.h:
2255         * WebProcess/WebPage/FindController.h:
2256         * WebProcess/WebPage/ViewGestureGeometryCollector.h:
2257         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
2258         * WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
2259         * WebProcess/WebProcess.h:
2260         * WebProcess/cocoa/UserMediaCaptureManager.h:
2261
2262 2019-08-15  Brent Fulgham  <bfulgham@apple.com>
2263
2264         [FTW] Enable CoreFoundation use if building for Apple target
2265         https://bugs.webkit.org/show_bug.cgi?id=200799
2266
2267         Reviewed by Alex Christensen.
2268
2269         Fix the build and remove an unused method.
2270
2271         * PlatformFTW.cmake:
2272         * Shared/ShareableBitmap.h:
2273         * Shared/win/ShareableBitmapDirect2D.cpp:
2274         (WebKit::ShareableBitmap::createDirect2DSurface):
2275         (WebKit::ShareableBitmap::releaseSurfaceData): Deleted.
2276
2277 2019-08-15  Sihui Liu  <sihui_liu@apple.com>
2278
2279         Some improvements on web storage
2280         https://bugs.webkit.org/show_bug.cgi?id=200373
2281
2282         Reviewed by Geoffrey Garen.
2283
2284         Fix some issues in web storage architecture. For example, sessionStorageNameSpace for web page is prepared and 
2285         destroyed in the network process when the page comes and goes, even though the page may not use sessionStorage 
2286         at all. The messages about page state sent from web process to network process can be waste.
2287
2288         Here are some general ideas of this patch:
2289         1. Network process owns the web storage, and web process keeps a small local copy (based on session and 
2290         origins that are visited). There is a virtual connection from the local copy in the web process to the original
2291         copy in the network process. The connection is created by web process when some page asks for web storage.
2292         2. If connection is lost because network process is gone, storage in memory will be lost. The local copy in web
2293         processs will be discarded.
2294         3. (SessionID, StorageNamespaceID, SecurityOrigin) is used to identify a storage area. If session is changed in
2295         web process (like enabling private browsing in layout test now), a re-connection with different sessionID would 
2296         suffice to load another copy of storage.
2297         4. localStorage in ephemeral session has the same behavior as localStorage instead of sessionStorage, which
2298         means different pages in the same ephemeral session share the same localStorage.
2299
2300         Also, this patch introduces StorageManagerSet to network process. It handles web storage stuff, including
2301         receiving storage messages from web process, on one background thread. Previously each session has its own
2302         StorageManager and each StorageManager has its own WorkQueue.
2303
2304         * CMakeLists.txt:
2305         * DerivedSources-input.xcfilelist:
2306         * DerivedSources-output.xcfilelist:
2307         * DerivedSources.make:
2308
2309         * NetworkProcess/NetworkConnectionToWebProcess.cpp: remove message handlers that are no longer needed. Network
2310         process no longer needs to know page states from web process.
2311         (WebKit::NetworkConnectionToWebProcess::didClose):
2312         (WebKit::NetworkConnectionToWebProcess::webPageWasAdded): Deleted.
2313         (WebKit::NetworkConnectionToWebProcess::webPageWasRemoved): Deleted.
2314         (WebKit::NetworkConnectionToWebProcess::webProcessSessionChanged): Deleted.
2315         * NetworkProcess/NetworkConnectionToWebProcess.h:
2316         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2317
2318         * NetworkProcess/NetworkProcess.cpp: NetworkProcess uses StorageManagerSet instead of StorageManager from 
2319         different sessions to deal with web storage.
2320         (WebKit::NetworkProcess::NetworkProcess):
2321         (WebKit::NetworkProcess::initializeNetworkProcess):
2322         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess): StorageManagerSet starts handling 
2323         StorageManagerSet messages from the new connection.
2324         (WebKit::NetworkProcess::addWebsiteDataStore):
2325         (WebKit::NetworkProcess::destroySession):
2326         (WebKit::NetworkProcess::hasLocalStorage):
2327         (WebKit::NetworkProcess::fetchWebsiteData):
2328         (WebKit::NetworkProcess::deleteWebsiteData):
2329         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
2330         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomains):
2331         (WebKit::NetworkProcess::actualPrepareToSuspend):
2332         (WebKit::NetworkProcess::resume):
2333         (WebKit::NetworkProcess::syncLocalStorage):
2334         (WebKit::NetworkProcess::clearLegacyPrivateBrowsingLocalStorage): added for clearing in-memory ephemeral
2335         localStorage.
2336         (WebKit::NetworkProcess::getLocalStorageOriginDetails):
2337         (WebKit::NetworkProcess::connectionToWebProcessClosed):
2338         (WebKit::NetworkProcess::webPageWasAdded): Deleted.
2339         (WebKit::NetworkProcess::webPageWasRemoved): Deleted.
2340         (WebKit::NetworkProcess::webProcessWasDisconnected): Deleted.
2341         (WebKit::NetworkProcess::webProcessSessionChanged): Deleted.
2342         * NetworkProcess/NetworkProcess.h:
2343         * NetworkProcess/NetworkProcess.messages.in:
2344
2345         * NetworkProcess/NetworkSession.cpp: StorageManager is moved out of NetworkSession. It is now managed by 
2346         StorageManagerSet.
2347         (WebKit::NetworkSession::NetworkSession):
2348         (WebKit::NetworkSession::~NetworkSession):
2349         * NetworkProcess/NetworkSession.h:
2350         (WebKit::NetworkSession::storageManager): Deleted.
2351
2352         * NetworkProcess/NetworkSessionCreationParameters.cpp: creation parameters of StorageManager is moved out of
2353         NetworkSessionCreationParameters.
2354         (WebKit::NetworkSessionCreationParameters::privateSessionParameters):
2355         (WebKit::NetworkSessionCreationParameters::encode const):
2356         (WebKit::NetworkSessionCreationParameters::decode):
2357         * NetworkProcess/NetworkSessionCreationParameters.h:
2358
2359         * NetworkProcess/WebStorage/LocalStorageDatabase.cpp:
2360         (WebKit::LocalStorageDatabase::updateDatabase): remove an assertion that is no longer true as we can force an
2361         update with syncLocalStorage now.
2362         * NetworkProcess/WebStorage/LocalStorageDatabase.h: make updateDatabase public for syncLocalStorage.
2363
2364         * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.cpp: LocalStorageDatabaseTracker is created on the
2365         background thread now, so it does not hold WorkQueue to do the file operation.
2366         (WebKit::LocalStorageDatabaseTracker::create):
2367         (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
2368         (WebKit::LocalStorageDatabaseTracker::~LocalStorageDatabaseTracker):
2369         * NetworkProcess/WebStorage/LocalStorageDatabaseTracker.h:
2370         * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
2371         (WebKit::LocalStorageNamespace::getOrCreateStorageArea):
2372         (WebKit::LocalStorageNamespace::cloneTo): Deleted.
2373         * NetworkProcess/WebStorage/LocalStorageNamespace.h:
2374         * NetworkProcess/WebStorage/SessionStorageNamespace.cpp:
2375         (WebKit::SessionStorageNamespace::getOrCreateStorageArea):
2376         (WebKit::SessionStorageNamespace::addAllowedConnection): Deleted.
2377         (WebKit::SessionStorageNamespace::removeAllowedConnection): Deleted.
2378         * NetworkProcess/WebStorage/SessionStorageNamespace.h:
2379         (WebKit::SessionStorageNamespace::allowedConnections const): Deleted.
2380
2381         * NetworkProcess/WebStorage/StorageArea.cpp:
2382         (WebKit::generateStorageAreaIdentifier): each StorageArea has an identifier. StorageAreaMap in web process uses
2383         this identifier to indicate which StorageArea it is connecting to.
2384         (WebKit::StorageArea::StorageArea):
2385         (WebKit::StorageArea::~StorageArea): StorageArea may still have listeners because StorageArea should be 
2386         destroyed by requests from UI process, and listeners are connections to web processses.
2387         (WebKit::StorageArea::addListener): load localStorageDatabase in advance if there is some connection to this 
2388         LocalStorage area.
2389         (WebKit::StorageArea::removeListener):
2390         (WebKit::StorageArea::hasListener const):
2391         (WebKit::StorageArea::clear):
2392         (WebKit::StorageArea::openDatabaseAndImportItemsIfNeeded const):
2393         (WebKit::StorageArea::dispatchEvents const):
2394         (WebKit::StorageArea::syncToDatabase):
2395         (WebKit::StorageArea::setItems): Deleted. Stop syncing from web process to network process after network process
2396         is relaunched.
2397         * NetworkProcess/WebStorage/StorageArea.h:
2398         (WebKit::StorageArea::identifier):
2399         (WebKit::StorageArea::setWorkQueue):
2400
2401         * NetworkProcess/WebStorage/StorageManager.cpp: StorageManager should be accessed by only background thread now.
2402         (WebKit::StorageManager::StorageManager):
2403         (WebKit::StorageManager::~StorageManager):
2404         (WebKit::StorageManager::createSessionStorageNamespace):
2405         (WebKit::StorageManager::destroySessionStorageNamespace): this is not used now but keep it for future 
2406         improvement to remove in-memory sessionStorage in network process if we know some web page is gone forever.
2407         (WebKit::StorageManager::cloneSessionStorageNamespace): previously each page had its own ephemeral 
2408         localStorageNamespace and now all pages in the same session share one localStorage, so we don't need to clone
2409         localStorageNamespace.
2410         (WebKit::StorageManager::getSessionStorageOrigins):
2411         (WebKit::StorageManager::deleteSessionStorageOrigins):
2412         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
2413         (WebKit::StorageManager::getLocalStorageOrigins):
2414         (WebKit::StorageManager::getLocalStorageOriginDetails):
2415         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
2416         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
2417         (WebKit::StorageManager::createLocalStorageArea):
2418         (WebKit::StorageManager::createTransientLocalStorageArea):
2419         (WebKit::StorageManager::createSessionStorageArea):
2420         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
2421         (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
2422         (WebKit::StorageManager::getOrCreateSessionStorageNamespace):
2423         (WebKit::StorageManager::clearStorageNamespaces):
2424         (WebKit::StorageManager::addAllowedSessionStorageNamespaceConnection): Deleted.
2425         (WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection): Deleted.
2426         (WebKit::StorageManager::processDidCloseConnection): Deleted.
2427         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin): Deleted.
2428         (WebKit::StorageManager::createLocalStorageMap): Deleted.
2429         (WebKit::StorageManager::createTransientLocalStorageMap): Deleted.
2430         (WebKit::StorageManager::createSessionStorageMap): Deleted.
2431         (WebKit::StorageManager::destroyStorageMap): Deleted.
2432         (WebKit::StorageManager::prewarm): Deleted.
2433         (WebKit::StorageManager::getValues): Deleted.
2434         (WebKit::StorageManager::setItem): Deleted.
2435         (WebKit::StorageManager::setItems): Deleted.
2436         (WebKit::StorageManager::removeItem): Deleted.
2437         (WebKit::StorageManager::clear): Deleted.
2438         (WebKit::StorageManager::waitUntilTasksFinished): Deleted.
2439         (WebKit::StorageManager::suspend): Deleted.
2440         (WebKit::StorageManager::resume): Deleted.
2441         (WebKit::StorageManager::findStorageArea const): Deleted.
2442         * NetworkProcess/WebStorage/StorageManager.h:
2443         (WebKit::StorageManager::workQueue const): Deleted.
2444         (): Deleted.
2445
2446         * NetworkProcess/WebStorage/StorageManager.messages.in: Removed. Moved to StorageManagerSet.messages.in.
2447
2448         * NetworkProcess/WebStorage/StorageManagerSet.cpp: Added.
2449         (WebKit::StorageManagerSet::create):
2450         (WebKit::StorageManagerSet::StorageManagerSet):
2451         (WebKit::StorageManagerSet::~StorageManagerSet):
2452         (WebKit::StorageManagerSet::add):
2453         (WebKit::StorageManagerSet::remove):
2454         (WebKit::StorageManagerSet::contains):
2455         (WebKit::StorageManagerSet::addConnection):
2456         (WebKit::StorageManagerSet::removeConnection):
2457         (WebKit::StorageManagerSet::waitUntilTasksFinished):
2458         (WebKit::StorageManagerSet::waitUntilSyncingLocalStorageFinished):
2459         (WebKit::StorageManagerSet::suspend):
2460         (WebKit::StorageManagerSet::resume):
2461         (WebKit::StorageManagerSet::getSessionStorageOrigins):
2462         (WebKit::StorageManagerSet::deleteSessionStorage):
2463         (WebKit::StorageManagerSet::deleteSessionStorageForOrigins):
2464         (WebKit::StorageManagerSet::getLocalStorageOrigins):
2465         (WebKit::StorageManagerSet::deleteLocalStorageModifiedSince):
2466         (WebKit::StorageManagerSet::deleteLocalStorageForOrigins):
2467         (WebKit::StorageManagerSet::getLocalStorageOriginDetails):
2468         (WebKit::StorageManagerSet::connectToLocalStorageArea):
2469         (WebKit::StorageManagerSet::connectToTransientLocalStorageArea):
2470         (WebKit::StorageManagerSet::connectToSessionStorageArea):
2471         (WebKit::StorageManagerSet::disconnectFromStorageArea):
2472         (WebKit::StorageManagerSet::getValues):
2473         (WebKit::StorageManagerSet::setItem):
2474         (WebKit::StorageManagerSet::removeItem):
2475         (WebKit::StorageManagerSet::clear):
2476         (WebKit::StorageManagerSet::cloneSessionStorageNamespace):
2477         * NetworkProcess/WebStorage/StorageManagerSet.h: Added.
2478         * NetworkProcess/WebStorage/StorageManagerSet.messages.in: Added.
2479
2480         * Shared/WebsiteDataStoreParameters.cpp: creation parameters of StorageManager are moved to 
2481         WebsiteDataStoreParameters.
2482         (WebKit::WebsiteDataStoreParameters::encode const):
2483         (WebKit::WebsiteDataStoreParameters::decode):
2484         (WebKit::WebsiteDataStoreParameters::privateSessionParameters):
2485         * Shared/WebsiteDataStoreParameters.h:
2486         * Sources.txt:
2487
2488         * UIProcess/API/C/WKContext.cpp: add SPI for tests.
2489         (WKContextSyncLocalStorage):
2490         (WKContextClearLegacyPrivateBrowsingLocalStorage):
2491         * UIProcess/API/C/WKContextPrivate.h:
2492         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
2493         (WKWebsiteDataStoreRemoveLocalStorage):
2494         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
2495         * UIProcess/WebProcessPool.cpp:
2496         (WebKit::WebProcessPool::ensureNetworkProcess):
2497         (WebKit::WebProcessPool::syncLocalStorage):
2498         (WebKit::WebProcessPool::clearLegacyPrivateBrowsingLocalStorage):
2499         * UIProcess/WebProcessPool.h:
2500         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2501         (WebKit::WebsiteDataStore::parameters):
2502         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2503         (WebKit::WebsiteDataStore::parameters):
2504         * WebKit.xcodeproj/project.pbxproj:
2505
2506         * WebProcess/InjectedBundle/InjectedBundle.cpp: session change of web storage is done via 
2507         WebStorageNamespaceProvider instead of WebProcess now.
2508         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
2509         * WebProcess/WebProcess.cpp: web process no longer sends messsages about page state to network process.
2510         (WebKit::WebProcess::createWebPage):
2511         (WebKit::WebProcess::removeWebPage):
2512         (WebKit::WebProcess::ensureNetworkProcessConnection):
2513         (WebKit::WebProcess::networkProcessConnectionClosed):
2514         (WebKit::WebProcess::storageAreaMap const):
2515         (WebKit::WebProcess::enablePrivateBrowsingForTesting): Deleted. This was used for changing session via 
2516         WebProcess.
2517         * WebProcess/WebProcess.h:
2518         * WebProcess/WebStorage/StorageAreaImpl.cpp:
2519         (WebKit::StorageAreaImpl::StorageAreaImpl):
2520         (WebKit::StorageAreaImpl::length):
2521         (WebKit::StorageAreaImpl::key):
2522         (WebKit::StorageAreaImpl::item):
2523         (WebKit::StorageAreaImpl::setItem):
2524         (WebKit::StorageAreaImpl::removeItem):
2525         (WebKit::StorageAreaImpl::clear):
2526         (WebKit::StorageAreaImpl::contains):
2527         (WebKit::StorageAreaImpl::storageType const):
2528         (WebKit::StorageAreaImpl::incrementAccessCount):
2529         (WebKit::StorageAreaImpl::decrementAccessCount):
2530         (WebKit::StorageAreaImpl::prewarm): Deleted.
2531         (WebKit::StorageAreaImpl::securityOrigin const): Deleted.
2532
2533         * WebProcess/WebStorage/StorageAreaImpl.h: make StorageAreaImpl hold a weak reference to StorageAreaMap and 
2534         StorageNamespaceImpl hold a strong reference. In this way lifeime of localStorage StorageAreraMap stays align 
2535         with StorageNameSpaceProvider and Page.
2536
2537         * WebProcess/WebStorage/StorageAreaMap.cpp: identifier of StorageAreaMap is the same as identifier of 
2538         StorageArea it connects to. If the identifier is 0, it means the StorageAreaMap is disconnected.
2539         (WebKit::StorageAreaMap::StorageAreaMap):
2540         (WebKit::StorageAreaMap::~StorageAreaMap):
2541         (WebKit::StorageAreaMap::setItem):
2542         (WebKit::StorageAreaMap::removeItem):
2543         (WebKit::StorageAreaMap::clear):
2544         (WebKit::StorageAreaMap::resetValues):
2545         (WebKit::StorageAreaMap::loadValuesIfNeeded):
2546         (WebKit::StorageAreaMap::applyChange):
2547         (WebKit::StorageAreaMap::dispatchStorageEvent):
2548         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
2549         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
2550         (WebKit::StorageAreaMap::connect):
2551         (WebKit::StorageAreaMap::disconnect):
2552         (WebKit::generateStorageMapID): Deleted.
2553         (WebKit::StorageAreaMap::prewarm): Deleted.
2554         (WebKit::StorageAreaMap::didGetValues): Deleted. This is useless as GetValues is a synchronous operation.
2555         * WebProcess/WebStorage/StorageAreaMap.h:
2556         (): Deleted.
2557
2558         * WebProcess/WebStorage/StorageAreaMap.messages.in: there are two synchronous messages, one for connection and 
2559         one for getting values. We may merge them into one in future improvement.
2560         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
2561         (WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
2562         (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
2563         (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):
2564         (WebKit::StorageNamespaceImpl::StorageNamespaceImpl):
2565         (WebKit::StorageNamespaceImpl::storageArea):
2566         (WebKit::StorageNamespaceImpl::copy):
2567         (WebKit::StorageNamespaceImpl::setSessionIDForTesting):
2568         (WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace): Deleted.
2569         * WebProcess/WebStorage/StorageNamespaceImpl.h:
2570         * WebProcess/WebStorage/WebStorageNamespaceProvider.cpp:
2571         (WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):
2572         (WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace):
2573         (WebKit::WebStorageNamespaceProvider::createTransientLocalStorageNamespace):
2574         (WebKit::WebStorageNamespaceProvider::createEphemeralLocalStorageNamespace): Deleted.
2575         * WebProcess/WebStorage/WebStorageNamespaceProvider.h:
2576
2577 2019-08-15  Wenson Hsieh  <wenson_hsieh@apple.com>
2578
2579         Occasional hang under -[UIKeyboardTaskQueue lockWhenReadyForMainThread] when long-pressing non-editable text
2580         https://bugs.webkit.org/show_bug.cgi?id=200731
2581         <rdar://problem/54315371>
2582
2583         Reviewed by Tim Horton.
2584
2585         When handling a single tap in non-editable content, keyboards logic in UIKit may attempt to wait for all
2586         pending tasks in UIKeyboardTaskQueue to finish executing (e.g. by calling -waitUntilAllTasksAreFinished]). If
2587         the task queue has a pending task at this moment - for example, a text selection update that is waiting for a
2588         response from the web process - this will result in a permanent deadlock, since the main thread will be blocked,
2589         and therefore cannot receive any IPC communication from the web process.
2590
2591         One way to trigger this is to activate both the loupe gesture and non-editable text tap gesture simultaneously,
2592         by tapping in a non-editable part of the web page, while an ongoing loupe gesture is driving selection updates
2593         (see the layout test for more details).
2594
2595         To avoid getting into this scenario, prevent the text tap gesture recognizer from firing in a few edge cases
2596         that could lead to hangs under keyboard code in UIKit. See comments below.
2597
2598         Test: editing/selection/ios/tap-during-loupe-gesture.html
2599
2600         * UIProcess/ios/WKContentViewInteraction.h:
2601         * UIProcess/ios/WKContentViewInteraction.mm:
2602         (-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
2603
2604         Don't allow the text tap gesture recognizer to fire if the user is actively modifying the text selection using
2605         the loupe gesture, or if there's other pending selection change updates that are pending responses from the web
2606         content process.
2607
2608         (-[WKContentView selectTextWithGranularity:atPoint:completionHandler:]):
2609         (-[WKContentView updateSelectionWithExtentPoint:withBoundary:completionHandler:]):
2610
2611         Increment and decrement _suppressNonEditableSingleTapTextInteractionCount while handling these selection
2612         updates.
2613
2614 2019-08-15  Commit Queue  <commit-queue@webkit.org>
2615
2616         Unreviewed, rolling out r248440.
2617         https://bugs.webkit.org/show_bug.cgi?id=200772
2618
2619         Introduced regressions related to loading of local files.
2620         (Requested by perarne on #webkit).
2621
2622         Reverted changeset:
2623
2624         "[Mac] Use the PID of the WebContent process when issuing
2625         local file read sandbox extensions"
2626         https://bugs.webkit.org/show_bug.cgi?id=200543
2627         https://trac.webkit.org/changeset/248440
2628
2629 2019-08-15  Alex Christensen  <achristensen@webkit.org>
2630
2631         WKUIDelegate's webView:contextMenuDidEndForElement: should be called when context menus end
2632         https://bugs.webkit.org/show_bug.cgi?id=200750
2633         <rdar://problem/54232261> and <rdar://problem/52355829>
2634
2635         Reviewed by Tim Horton.
2636
2637         * UIProcess/ios/WKContentViewInteraction.mm:
2638         (-[WKContentView contextMenuInteraction:willEndForConfiguration:animator:]):
2639
2640 2019-08-14  Brian Burg  <bburg@apple.com>
2641
2642         Web Automation: mouse buttons are not correctly printed in SimulatedInputDispatcher log spew
2643         https://bugs.webkit.org/show_bug.cgi?id=200729
2644
2645         Reviewed by Devin Rousso.
2646
2647         This was printing out gibberish because it was trying to decode a WebMouseEvent button
2648         as an Automation protocol button. The logging was less useful because of it.
2649
2650         To fix this, push usage of Automation protocol-based MouseButton type alias all the way
2651         to the platform-specific methods. The mouse buttons are the same for WebMouseEvent::Button
2652         and the Automation protocol type, except the automation type has an auto-generated toString.
2653
2654         * UIProcess/Automation/SimulatedInputDispatcher.h:
2655         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
2656         (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
2657         (WebKit::SimulatedInputDispatcher::run):
2658         Fix types.
2659
2660         * UIProcess/Automation/WebAutomationSession.h:
2661         * UIProcess/Automation/WebAutomationSession.cpp:
2662         (WebKit::WebAutomationSession::simulateMouseInteraction):
2663         (WebKit::WebAutomationSession::performMouseInteraction):
2664         (WebKit::WebAutomationSession::performInteractionSequence):
2665         (WebKit::protocolMouseButtonToWebMouseEventButton): Deleted.
2666         Fix types.
2667
2668         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
2669         (WebKit::automationMouseButtonToPlatformMouseButton):
2670         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
2671         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
2672         (WebKit::mouseButtonToGdkButton):
2673         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
2674         * UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp:
2675         (WebKit::mouseButtonToWPEButton):
2676         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
2677         Move translation between MouseButton and native button values to platform methods.
2678
2679 2019-08-15  Simon Fraser  <simon.fraser@apple.com>
2680
2681         Use ObjectIdentifier<FrameIdentifierType> for frameIDs
2682         https://bugs.webkit.org/show_bug.cgi?id=199986
2683
2684         Reviewed by Ryosuke Niwa.
2685
2686         Use the strongly-typed FrameIdentifier instead of uint64_t as frame identifiers everywhere.
2687
2688         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
2689         (WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess):
2690         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
2691         (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccess):
2692         (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccessInternal):
2693         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
2694         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2695         (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
2696         (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
2697         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
2698         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
2699         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
2700         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
2701         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2702         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
2703         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccessForFrame):
2704         (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
2705         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
2706         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
2707         (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
2708         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2709         * NetworkProcess/NetworkCORSPreflightChecker.h:
2710         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2711         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
2712         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
2713         (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
2714         (WebKit::NetworkConnectionToWebProcess::getRawCookies):
2715         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
2716         (WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
2717         (WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
2718         * NetworkProcess/NetworkConnectionToWebProcess.h:
2719         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2720         * NetworkProcess/NetworkLoadChecker.cpp:
2721         (WebKit::NetworkLoadChecker::NetworkLoadChecker):
2722         * NetworkProcess/NetworkLoadChecker.h:
2723         * NetworkProcess/NetworkLoadParameters.h:
2724         * NetworkProcess/NetworkProcess.h:
2725         * NetworkProcess/NetworkResourceLoader.cpp:
2726         (WebKit::NetworkResourceLoader::start):
2727         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
2728         (WebKit::NetworkResourceLoader::startNetworkLoad):
2729         (WebKit::NetworkResourceLoader::convertToDownload):
2730         (WebKit::NetworkResourceLoader::abort):
2731         (WebKit::NetworkResourceLoader::didReceiveResponse):
2732         (WebKit::NetworkResourceLoader::didReceiveBuffer):
2733         (WebKit::NetworkResourceLoader::didFinishLoading):
2734         (WebKit::NetworkResourceLoader::didFailLoading):
2735         (WebKit::NetworkResourceLoader::continueWillSendRequest):
2736         (WebKit::escapeIDForJSON):
2737         (WebKit::logBlockedCookieInformation):
2738         (WebKit::logCookieInformationInternal):
2739         (WebKit::NetworkResourceLoader::logCookieInformation):
2740         * NetworkProcess/NetworkResourceLoader.h:
2741         * NetworkProcess/cache/NetworkCache.h:
2742         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2743         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2744         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
2745         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
2746         * Scripts/webkit/messages.py:
2747         * Shared/API/APIFrameHandle.cpp:
2748         (API::FrameHandle::create):
2749         (API::FrameHandle::createAutoconverting):
2750         (API::FrameHandle::FrameHandle):
2751         (API::FrameHandle::decode):
2752         * Shared/API/APIFrameHandle.h:
2753         (API::FrameHandle::frameID const):
2754         * Shared/API/Cocoa/_WKFrameHandle.mm:
2755         (-[_WKFrameHandle hash]):
2756         (-[_WKFrameHandle _frameID]):
2757         (-[_WKFrameHandle initWithCoder:]):
2758         (-[_WKFrameHandle encodeWithCoder:]):
2759         * Shared/Authentication/AuthenticationManager.cpp:
2760         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
2761         * Shared/Authentication/AuthenticationManager.h:
2762         * Shared/FrameInfoData.h:
2763         * UIProcess/API/C/WKFrameHandleRef.cpp:
2764         (WKFrameHandleGetFrameID):
2765         * UIProcess/API/Cocoa/WKWebView.mm:
2766         (-[WKWebView _printOperationWithPrintInfo:forFrame:]):
2767         (-[WKWebView _canChangeFrameLayout:]):
2768         * UIProcess/API/Cocoa/_WKInspector.mm:
2769         (-[_WKInspector showMainResourceForFrame:]):
2770         * UIProcess/Automation/SimulatedInputDispatcher.cpp:
2771         (WebKit::SimulatedInputDispatcher::run):
2772         * UIProcess/Automation/SimulatedInputDispatcher.h:
2773         * UIProcess/Automation/WebAutomationSession.cpp:
2774         (WebKit::WebAutomationSession::webFrameIDForHandle):
2775         (WebKit::WebAutomationSession::handleForWebFrameID):
2776         (WebKit::WebAutomationSession::switchToBrowsingContext):
2777         (WebKit::WebAutomationSession::waitForNavigationToComplete):
2778         (WebKit::findPageForFrameID):
2779         (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout):
2780         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
2781         (WebKit::WebAutomationSession::resolveChildFrameHandle):
2782         (WebKit::WebAutomationSession::resolveParentFrameHandle):
2783         (WebKit::WebAutomationSession::computeElementLayout):
2784         (WebKit::WebAutomationSession::selectOptionElement):
2785         (WebKit::WebAutomationSession::getAllCookies):
2786         (WebKit::WebAutomationSession::deleteSingleCookie):
2787         (WebKit::WebAutomationSession::viewportInViewCenterPointOfElement):
2788         (WebKit::WebAutomationSession::takeScreenshot):
2789         * UIProcess/Automation/WebAutomationSession.h:
2790         * UIProcess/Cocoa/UIDelegate.mm:
2791         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
2792         * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm:
2793         (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]):
2794         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2795         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame):
2796         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrameShared):
2797         * UIProcess/Network/NetworkProcessProxy.cpp:
2798         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
2799         (WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
2800         * UIProcess/Network/NetworkProcessProxy.h:
2801         * UIProcess/Network/NetworkProcessProxy.messages.in:
2802         * UIProcess/ProvisionalPageProxy.cpp:
2803         (WebKit::ProvisionalPageProxy::validateInput):
2804         (WebKit::ProvisionalPageProxy::didCreateMainFrame):
2805         (WebKit::ProvisionalPageProxy::didPerformClientRedirect):
2806         (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame):
2807         (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
2808         (WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
2809         (WebKit::ProvisionalPageProxy::didNavigateWithNavigationData):
2810         (WebKit::ProvisionalPageProxy::didChangeProvisionalURLForFrame):
2811         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync):
2812         (WebKit::ProvisionalPageProxy::decidePolicyForResponse):
2813         (WebKit::ProvisionalPageProxy::didPerformServerRedirect):
2814         (WebKit::ProvisionalPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
2815         (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionSync):
2816         (WebKit::ProvisionalPageProxy::contentFilterDidBlockLoadForFrame):
2817         * UIProcess/ProvisionalPageProxy.h:
2818         * UIProcess/ServiceWorkerProcessProxy.cpp:
2819         (WebKit::ServiceWorkerProcessProxy::didReceiveAuthenticationChallenge):
2820         * UIProcess/ServiceWorkerProcessProxy.h:
2821         * UIProcess/SuspendedPageProxy.cpp:
2822         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
2823         * UIProcess/SuspendedPageProxy.h:
2824         * UIProcess/UserMediaPermissionCheckProxy.cpp:
2825         (WebKit::UserMediaPermissionCheckProxy::UserMediaPermissionCheckProxy):
2826         * UIProcess/UserMediaPermissionCheckProxy.h:
2827         (WebKit::UserMediaPermissionCheckProxy::create):
2828         (WebKit::UserMediaPermissionCheckProxy::frameID const):
2829         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2830         (WebKit::UserMediaPermissionRequestManagerProxy::resetAccess):
2831         (WebKit::UserMediaPermissionRequestManagerProxy::searchForGrantedRequest const):
2832         (WebKit::UserMediaPermissionRequestManagerProxy::wasRequestDenied):
2833         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2834         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo):
2835         (WebKit::UserMediaPermissionRequestManagerProxy::wasGrantedVideoOrAudioAccess):
2836         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
2837         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2838         * UIProcess/UserMediaPermissionRequestProxy.cpp:
2839         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
2840         * UIProcess/UserMediaPermissionRequestProxy.h:
2841         (WebKit::UserMediaPermissionRequestProxy::create):
2842         (WebKit::UserMediaPermissionRequestProxy::mainFrameID const):
2843         (WebKit::UserMediaPermissionRequestProxy::frameID const):
2844         * UIProcess/WebFrameProxy.cpp:
2845         (WebKit::WebFrameProxy::WebFrameProxy):
2846         * UIProcess/WebFrameProxy.h:
2847         (WebKit::WebFrameProxy::create):
2848         (WebKit::WebFrameProxy::frameID const):
2849         * UIProcess/WebPageProxy.cpp:
2850         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
2851         (WebKit::WebPageProxy::commitProvisionalPage):
2852         (WebKit::WebPageProxy::runJavaScriptInFrame):
2853         (WebKit::WebPageProxy::didCreateMainFrame):
2854         (WebKit::WebPageProxy::didCreateSubframe):
2855         (WebKit::WebPageProxy::didCreateWindow):
2856         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
2857         (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
2858         (WebKit::WebPageProxy::didExplicitOpenForFrame):
2859         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
2860         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
2861         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
2862         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
2863         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
2864         (WebKit::WebPageProxy::didChangeProvisionalURLForFrameShared):
2865         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
2866         (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
2867         (WebKit::WebPageProxy::didCommitLoadForFrame):
2868         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
2869         (WebKit::WebPageProxy::didFinishLoadForFrame):
2870         (WebKit::WebPageProxy::didFailLoadForFrame):
2871         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
2872         (WebKit::WebPageProxy::didChangeMainDocument):
2873         (WebKit::WebPageProxy::didReceiveTitleForFrame):
2874         (WebKit::WebPageProxy::didFirstLayoutForFrame):
2875         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
2876         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
2877         (WebKit::WebPageProxy::didRunInsecureContentForFrame):
2878         (WebKit::WebPageProxy::didDetectXSSForFrame):
2879         (WebKit::WebPageProxy::frameDidBecomeFrameSet):
2880         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync):
2881         (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
2882         (WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
2883         (WebKit::WebPageProxy::decidePolicyForNavigationActionSyncShared):
2884         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
2885         (WebKit::WebPageProxy::decidePolicyForResponse):
2886         (WebKit::WebPageProxy::decidePolicyForResponseShared):
2887         (WebKit::WebPageProxy::unableToImplementPolicy):
2888         (WebKit::WebPageProxy::willSubmitForm):
2889         (WebKit::WebPageProxy::didNavigateWithNavigationData):
2890         (WebKit::WebPageProxy::didNavigateWithNavigationDataShared):
2891         (WebKit::WebPageProxy::didPerformClientRedirect):
2892         (WebKit::WebPageProxy::didPerformClientRedirectShared):
2893         (WebKit::WebPageProxy::didPerformServerRedirect):
2894         (WebKit::WebPageProxy::didPerformServerRedirectShared):
2895         (WebKit::WebPageProxy::didUpdateHistoryTitle):
2896         (WebKit::WebPageProxy::runJavaScriptAlert):
2897         (WebKit::WebPageProxy::runJavaScriptConfirm):
2898         (WebKit::WebPageProxy::runJavaScriptPrompt):
2899         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
2900         (WebKit::WebPageProxy::runOpenPanel):
2901         (WebKit::WebPageProxy::printFrame):
2902         (WebKit::WebPageProxy::focusedFrameChanged):
2903         (WebKit::WebPageProxy::frameSetLargestFrameChanged):
2904         (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
2905         (WebKit::WebPageProxy::exceededDatabaseQuota):
2906         (WebKit::WebPageProxy::requestStorageSpace):
2907         (WebKit::WebPageProxy::makeStorageSpaceRequest):
2908         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
2909         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
2910         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
2911         (WebKit::WebPageProxy::shouldAllowDeviceOrientationAndMotionAccess):
2912         (WebKit::WebPageProxy::requestStorageAccessConfirm):
2913         * UIProcess/WebPageProxy.h:
2914         * UIProcess/WebPageProxy.messages.in:
2915         * UIProcess/WebProcessProxy.cpp:
2916         (WebKit::WebProcessProxy::webFrame const):
2917         (WebKit::WebProcessProxy::canCreateFrame const):
2918         (WebKit::WebProcessProxy::frameCreated):
2919         (WebKit::WebProcessProxy::didDestroyFrame):
2920         * UIProcess/WebProcessProxy.h:
2921         * UIProcess/WebProcessProxy.messages.in:
2922         * UIProcess/ios/WKContentView.mm:
2923         (-[WKContentView _wk_pageCountForPrintFormatter:]):
2924         * UIProcess/ios/WebPageProxyIOS.mm:
2925         (WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF):
2926         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2927         (WebKit::evaluateJavaScriptCallback):
2928         (WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame):
2929         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
2930         (WebKit::WebAutomationSessionProxy::didEvaluateJavaScriptFunction):
2931         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithOrdinal):
2932         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle):
2933         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithName):
2934         (WebKit::WebAutomationSessionProxy::resolveParentFrame):
2935         (WebKit::WebAutomationSessionProxy::focusFrame):
2936         (WebKit::WebAutomationSessionProxy::computeElementLayout):
2937         (WebKit::WebAutomationSessionProxy::selectOptionElement):
2938         (WebKit::WebAutomationSessionProxy::takeScreenshot):
2939         (WebKit::WebAutomationSessionProxy::getCookiesForFrame):
2940         (WebKit::WebAutomationSessionProxy::deleteCookie):
2941         * WebProcess/Automation/WebAutomationSessionProxy.h:
2942         * WebProcess/Automation/WebAutomationSessionProxy.messages.in:
2943         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
2944         (+[WKWebProcessPlugInFrame lookUpFrameFromHandle:]):
2945         * WebProcess/Network/WebLoaderStrategy.cpp:
2946         (WebKit::WebLoaderStrategy::scheduleLoad):
2947         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
2948         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
2949         * WebProcess/Network/WebResourceLoader.cpp:
2950         (WebKit::WebResourceLoader::willSendRequest):
2951         (WebKit::WebResourceLoader::didReceiveResponse):
2952         (WebKit::WebResourceLoader::didReceiveData):
2953         (WebKit::WebResourceLoader::didFinishResourceLoad):
2954         (WebKit::WebResourceLoader::didFailResourceLoad):
2955         (WebKit::WebResourceLoader::didBlockAuthenticationChallenge):
2956         (WebKit::WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied):
2957         (WebKit::WebResourceLoader::didReceiveResource):
2958         * WebProcess/Network/WebResourceLoader.h:
2959         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2960         (WebKit::WebSWContextManagerConnection::installServiceWorker):
2961         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2962         (WebKit::WebChromeClient::focusedFrameChanged):
2963         (WebKit::WebChromeClient::contentsSizeChanged const):
2964         (WebKit::WebChromeClient::hasStorageAccess):
2965         (WebKit::WebChromeClient::requestStorageAccess):
2966         * WebProcess/WebCoreSupport/WebChromeClient.h:
2967         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2968         (WebKit::WebFrameLoaderClient::frameID const):
2969         (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
2970         (WebKit::WebFrameLoaderClient::dispatchDidFailLoad):
2971         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2972         * WebProcess/WebPage/WebCookieJar.cpp:
2973         (WebKit::WebCookieJar::cookies const):
2974         (WebKit::WebCookieJar::setCookies):
2975         (WebKit::WebCookieJar::cookieRequestHeaderFieldValue const):
2976         (WebKit::WebCookieJar::getRawCookies const):
2977         * WebProcess/WebPage/WebCookieJar.h:
2978         * WebProcess/WebPage/WebFrame.cpp:
2979         (WebKit::WebFrame::WebFrame):
2980         (WebKit::generateFrameID): Deleted.
2981         * WebProcess/WebPage/WebFrame.h:
2982         (WebKit::WebFrame::frameID const):
2983         * WebProcess/WebPage/WebInspector.cpp:
2984         (WebKit::WebInspector::showMainResourceForFrame):
2985         * WebProcess/WebPage/WebInspector.h:
2986         * WebProcess/WebPage/WebInspector.messages.in:
2987         * WebProcess/WebPage/WebPage.cpp:
2988         (WebKit::WebPage::loadURLInFrame):
2989         (WebKit::WebPage::loadDataInFrame):
2990         (WebKit::WebPage::stopLoadingFrame):
2991         (WebKit::WebPage::didReceivePolicyDecision):
2992         (WebKit::WebPage::continueWillSubmitForm):
2993         (WebKit::WebPage::runJavaScriptInFrame):
2994         (WebKit::WebPage::getSourceForFrame):
2995         (WebKit::WebPage::getMainResourceDataOfFrame):
2996         (WebKit::WebPage::getResourceDataFromFrame):
2997         (WebKit::WebPage::getWebArchiveOfFrame):
2998         (WebKit::WebPage::addConsoleMessage):
2999         (WebKit::WebPage::sendCSPViolationReport):
3000         (WebKit::WebPage::enqueueSecurityPolicyViolationEvent):
3001         (WebKit::WebPage::beginPrinting):
3002         (WebKit::WebPage::computePagesForPrinting):
3003         (WebKit::WebPage::computePagesForPrintingImpl):
3004         (WebKit::WebPage::drawRectToImage):
3005         (WebKit::WebPage::drawPagesToPDF):
3006         (WebKit::WebPage::drawPagesToPDFImpl):
3007         (WebKit::WebPage::drawPagesForPrinting):
3008         (WebKit::WebPage::frameBecameRemote):
3009         (WebKit::WebPage::hasStorageAccess):
3010         (WebKit::WebPage::requestStorageAccess):
3011         (WebKit::WebPage::shouldAllowDeviceOrientationAndMotionAccess):
3012         * WebProcess/WebPage/WebPage.h:
3013         * WebProcess/WebPage/WebPage.messages.in:
3014         * WebProcess/WebPage/ios/WebPageIOS.mm:
3015         (WebKit::WebPage::computePagesForPrintingPDFDocument):
3016         (WebKit::WebPage::computePagesForPrintingAndDrawToPDF):
3017         * WebProcess/WebPage/mac/WebPageMac.mm:
3018         (WebKit::WebPage::computePagesForPrintingPDFDocument):
3019         * WebProcess/WebProcess.cpp:
3020         (WebKit::WebProcess::webFrame const):
3021         (WebKit::WebProcess::addWebFrame):
3022         (WebKit::WebProcess::removeWebFrame):
3023         * WebProcess/WebProcess.h:
3024
3025 2019-08-14  Wenson Hsieh  <wenson_hsieh@apple.com>
3026
3027         Remove m_blockRectForTextSelection (along with related code)
3028         https://bugs.webkit.org/show_bug.cgi?id=200695
3029
3030         Reviewed by Megan Gardner.
3031
3032         This member variable was consulted by block selection codepaths which no longer exist.
3033         No change in behavior.
3034
3035         * WebProcess/WebPage/WebPage.h:
3036         * WebProcess/WebPage/ios/WebPageIOS.mm:
3037         (WebKit::WebPage::selectTextWithGranularityAtPoint):
3038         (WebKit::selectionBoxForRange): Deleted.
3039
3040 2019-08-14  Ryan Haddad  <ryanhaddad@apple.com>
3041
3042         Unreviewed, rolling out r248526.
3043
3044         Caused two IndexedDB perf tests to fail
3045
3046         Reverted changeset:
3047
3048         "Remove IDB-specific quota"
3049         https://bugs.webkit.org/show_bug.cgi?id=196545
3050         https://trac.webkit.org/changeset/248526
3051
3052 2019-08-14  Andy Estes  <aestes@apple.com>
3053
3054         Fix the build when ENABLE(APPLE_PAY) is false.
3055
3056         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
3057
3058 2019-08-14  Keith Rollin  <krollin@apple.com>
3059
3060         Remove support for macOS < 10.13
3061         https://bugs.webkit.org/show_bug.cgi?id=200694
3062         <rdar://problem/54278851>
3063
3064         Reviewed by Youenn Fablet.
3065
3066         Update conditionals that reference __MAC_OS_X_VERSION_MIN_REQUIRED and
3067         __MAC_OS_X_VERSION_MAX_ALLOWED, assuming that they both have values >=
3068         101300. This means that expressions like
3069         "__MAC_OS_X_VERSION_MIN_REQUIRED < 101300" are always False and
3070         "__MAC_OS_X_VERSION_MIN_REQUIRED >= 101300" are always True.
3071
3072         * NetworkProcess/Downloads/cocoa/WKDownloadProgress.mm:
3073         (-[WKDownloadProgress initWithDownloadTask:download:URL:sandboxExtension:]):
3074         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3075         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
3076         * Shared/WebPreferencesDefaultValues.cpp:
3077         (WebKit::defaultCustomPasteboardDataEnabled):
3078         * Shared/WebPreferencesDefaultValues.h:
3079         * Shared/mac/AuxiliaryProcessMac.mm:
3080         * UIProcess/Cocoa/WebViewImpl.h:
3081         * UIProcess/Cocoa/WebViewImpl.mm:
3082         (-[WKTextTouchBarItemController itemForIdentifier:]):
3083         (WebKit::WebViewImpl::mediaPlaybackControlsView const):
3084         (WebKit::WebViewImpl::updateMediaTouchBar):
3085         * UIProcess/mac/WebColorPickerMac.mm:
3086         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
3087         * WebProcess/Plugins/PDF/PDFPlugin.h:
3088         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3089         (-[WKPDFPluginAccessibilityObject setPdfLayerController:]):
3090         (-[WKPDFPluginAccessibilityObject accessibilityAttributeValue:]):
3091         (-[WKPDFPluginAccessibilityObject ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
3092         (-[WKPDFPluginAccessibilityObject accessibilityFocusedUIElement]):
3093         (-[WKPDFPluginAccessibilityObject accessibilityAssociatedControlForAnnotation:]):
3094         (-[WKPDFPluginAccessibilityObject accessibilityHitTest:]):
3095         (WebKit::PDFPlugin::pdfDocumentDidLoad):
3096         (WebKit::PDFPlugin::handleMouseEvent):
3097         (WebKit::PDFPlugin::handleMouseEnterEvent):
3098         (WebKit::PDFPlugin::handleContextMenuEvent):
3099         (WebKit::PDFPlugin::pluginHandlesContentOffsetForAccessibilityHitTest const):
3100         (WebKit::PDFPlugin::accessibilityAssociatedPluginParentForElement const):
3101         (WebKit::PDFPlugin::updateCursor): Deleted.
3102         * WebProcess/WebProcess.cpp:
3103         (WebKit::WebProcess::initializeWebProcess):
3104
3105 2019-08-14  Brian Burg  <bburg@apple.com>
3106
3107         REGRESSION(r245320): Web Automation: Perform Actions hangs when pointerdown happens near top of page
3108         https://bugs.webkit.org/show_bug.cgi?id=200728
3109         <rdar://problem/54260518>
3110
3111         Reviewed by Devin Rousso.
3112
3113         In the last major refactoring for this code, it seems that the argument to
3114         platformSimulateMouseInteraction was not unified to use viewport coordinates
3115         in all code paths. This patch fixes both callers to *not* add in topContentInset,
3116         and instead this is added back in when doing platform-specific event simulation.
3117
3118         This has no effect on iOS since it's guarded by ENABLE(WEBDRIVER_MOUSE_INTERACTIONS),
3119         which is only built on macOS.
3120
3121         * UIProcess/Automation/WebAutomationSession.h:
3122         * UIProcess/Automation/WebAutomationSession.cpp:
3123         (WebKit::WebAutomationSession::performMouseInteraction):
3124         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
3125         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
3126
3127 2019-08-14  Andy Estes  <aestes@apple.com>
3128
3129         [Cocoa] Add some WKA extension points
3130         https://bugs.webkit.org/show_bug.cgi?id=200506
3131         <rdar://problem/51682474>
3132
3133         Reviewed by Tim Horton.
3134
3135         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3136         (WebKit::finishCreating):
3137         (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest):
3138         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
3139         (IPC::finishDecoding):
3140         (IPC::finishEncoding):
3141         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::encode):
3142         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode):
3143         * Shared/WebCoreArgumentCoders.h:
3144
3145 2019-08-14  Luming Yin  <luming_yin@apple.com>
3146
3147         v3: CrashTracer: Regression : MobileSafari at UIKitCore: -[UITargetedPreview initWithView:parameters:]
3148         https://bugs.webkit.org/show_bug.cgi?id=200634
3149
3150         Reviewed by Simon Fraser.
3151
3152         Under rare race conditions, the WKContentView may no longer have an associated window. However, 
3153         UIContextMenuInteraction may still attempt initialize a UITargetedPreview with the orphaned 
3154         WKContentView. Speculative fix for crashes under such scenarios, so that we can continue without 
3155         a context menu configuration to prevent the UIKit exception.
3156
3157         * UIProcess/ios/WKContentViewInteraction.mm:
3158         (-[WKContentView continueContextMenuInteraction:]):
3159
3160 2019-08-14  Zalan Bujtas  <zalan@apple.com>
3161
3162         [ContentChangeObserver] Stop content change observation explicitly.
3163         https://bugs.webkit.org/show_bug.cgi?id=200689
3164         <rdar://problem/54274887>
3165
3166         Reviewed by Simon Fraser.
3167
3168         * WebProcess/WebPage/ios/WebPageIOS.mm:
3169         (WebKit::WebPage::handleSyntheticClick):
3170
3171 2019-08-14  Youenn Fablet  <youenn@apple.com>
3172
3173         Remove use of emptySessionID from NetworkLoadParameters
3174         https://bugs.webkit.org/show_bug.cgi?id=200712
3175
3176         Reviewed by Alex Christensen.
3177
3178         Make NetworkLoadParameters constructor take a session ID.
3179         Update call sites accordingly.
3180
3181         * NetworkProcess/AdClickAttributionManager.cpp:
3182         (WebKit::AdClickAttributionManager::fireConversionRequest):
3183         * NetworkProcess/Downloads/DownloadManager.cpp:
3184         (WebKit::DownloadManager::startDownload):
3185         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
3186         (WebKit::NetworkCORSPreflightChecker::startPreflight):
3187         * NetworkProcess/NetworkLoadParameters.h:
3188         (WebKit::NetworkLoadParameters::NetworkLoadParameters):
3189         * NetworkProcess/NetworkProcess.cpp:
3190         (WebKit::NetworkProcess::preconnectTo):
3191         * NetworkProcess/NetworkResourceLoadParameters.cpp:
3192         (WebKit::NetworkResourceLoadParameters::encode const):
3193         (WebKit::NetworkResourceLoadParameters::decode):
3194         * NetworkProcess/NetworkResourceLoadParameters.h:
3195         (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
3196         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
3197         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
3198         * WebProcess/Network/WebLoaderStrategy.cpp:
3199         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
3200         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
3201         (WebKit::WebLoaderStrategy::startPingLoad):
3202         (WebKit::WebLoaderStrategy::preconnectTo):
3203
3204 2019-08-14  Youenn Fablet  <youenn@apple.com>
3205
3206         Remove use of emptySessionID from WebPageCreationParameters
3207         https://bugs.webkit.org/show_bug.cgi?id=200708
3208
3209         Reviewed by Alex Christensen.
3210
3211         Make WebPageCreationParameters constructor take a SessionID.
3212         Update constructor call sites.
3213
3214         * Shared/WebPageCreationParameters.cpp:
3215         (WebKit::WebPageCreationParameters::decode):
3216         * Shared/WebPageCreationParameters.h:
3217         (WebKit::WebPageCreationParameters::WebPageCreationParameters):
3218         * UIProcess/WebPageProxy.cpp:
3219         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
3220
3221 2019-08-14  Youenn Fablet  <youenn@apple.com>
3222
3223         Remove API::PageConfiguration::m_sessionID
3224         https://bugs.webkit.org/show_bug.cgi?id=200670
3225
3226         Reviewed by Alex Christensen.
3227
3228         We can remove this member since it is only accessed for a debug assertion that can be removed without any harm.
3229
3230         * UIProcess/API/APIPageConfiguration.cpp:
3231         (API::PageConfiguration::PageConfiguration):
3232         (API::PageConfiguration::copy const):
3233         (API::PageConfiguration::setWebsiteDataStore):
3234         * UIProcess/API/APIPageConfiguration.h:
3235         * UIProcess/API/glib/WebKitWebContext.cpp:
3236         (webkitWebContextCreatePageForWebView):
3237         * UIProcess/WebProcessPool.cpp:
3238         (WebKit::WebProcessPool::createWebPage):
3239
3240 2019-08-14  Youenn Fablet  <youenn@apple.com>
3241
3242         ThreadableBlobRegistry::blobSize should take a SessionID as parameter
3243         https://bugs.webkit.org/show_bug.cgi?id=200671
3244
3245         Reviewed by Alex Christensen.
3246
3247         Update WebCacheStorageConnection to implement sessionID getter.
3248         Update NetworkConnectionToWebProcess to get a sessionID as parameter to blobSize computation.
3249
3250         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
3251         (WebKit::NetworkDataTaskCurl::createCurlRequest):
3252         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3253         (WebKit::NetworkConnectionToWebProcess::blobSize):
3254         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
3255         * NetworkProcess/NetworkConnectionToWebProcess.h:
3256         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3257         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
3258         (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
3259         * WebProcess/Cache/WebCacheStorageConnection.h:
3260         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
3261         (WebKit::BlobRegistryProxy::blobSize):
3262         * WebProcess/FileAPI/BlobRegistryProxy.h:
3263
3264 2019-08-14  Youenn Fablet  <youenn@apple.com>
3265
3266         Remove SessionID default constructor
3267         https://bugs.webkit.org/show_bug.cgi?id=200669
3268
3269         Reviewed by Alex Christensen.
3270
3271         Update IPC decoder to use an Optional<SessionID>.
3272         Update PageConfiguration to use emptySessionID instead of default constructor.
3273
3274         * NetworkProcess/NetworkSessionCreationParameters.cpp:
3275         (WebKit::NetworkSessionCreationParameters::decode):
3276         * Shared/WebPageCreationParameters.h:
3277         * UIProcess/API/APIPageConfiguration.cpp:
3278         (API::PageConfiguration::PageConfiguration):
3279         (API::PageConfiguration::sessionID): Deleted.
3280         (API::PageConfiguration::setSessionID): Deleted.
3281
3282 2019-08-14  Youenn Fablet  <youenn@apple.com>
3283
3284         Make WebSWOriginStore::m_webSWServerConnections a WeakHashSet
3285         https://bugs.webkit.org/show_bug.cgi?id=200661
3286
3287         Reviewed by Alex Christensen.
3288
3289         * NetworkProcess/ServiceWorker/WebSWOriginStore.cpp:
3290         (WebKit::WebSWOriginStore::importComplete):
3291         (WebKit::WebSWOriginStore::registerSWServerConnection):
3292         (WebKit::WebSWOriginStore::unregisterSWServerConnection):
3293         (WebKit::WebSWOriginStore::didInvalidateSharedMemory):
3294         * NetworkProcess/ServiceWorker/WebSWOriginStore.h:
3295
3296 2019-08-14  Youenn Fablet  <youenn@apple.com>
3297
3298         NetworkProcess::m_swServerConnections should use WeakPtr
3299         https://bugs.webkit.org/show_bug.cgi?id=200660
3300
3301         Reviewed by Geoffrey Garen.
3302
3303         Use WeakPtr for SWServer connections as an extra safety measure.
3304
3305         * NetworkProcess/NetworkProcess.cpp:
3306         (WebKit::NetworkProcess::postMessageToServiceWorkerClient):
3307         (WebKit::NetworkProcess::postMessageToServiceWorker):
3308         (WebKit::NetworkProcess::registerSWServerConnection):
3309         (WebKit::NetworkProcess::unregisterSWServerConnection):
3310         * NetworkProcess/NetworkProcess.h:
3311
3312 2019-08-14  Youenn Fablet  <youenn@apple.com>
3313
3314         Move some WebRTC runtime flags from experimental to internal
3315         https://bugs.webkit.org/show_bug.cgi?id=200672
3316
3317         Reviewed by Eric Carlson.
3318
3319         * Shared/WebPreferences.yaml:
3320
3321 2019-08-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
3322
3323         shouldRespectImageOrientation should be a value in ImageOrientation
3324         https://bugs.webkit.org/show_bug.cgi?id=200553
3325
3326         Reviewed by Simon Fraser.
3327
3328         * WebProcess/WebPage/ios/WebPageIOS.mm:
3329         (WebKit::imagePositionInformation):
3330
3331 2019-08-13  John Wilander  <wilander@apple.com>
3332
3333         Resource Load Statistics: Switch NSURLSession on top navigation to prevalent resource with user interaction
3334         https://bugs.webkit.org/show_bug.cgi?id=200642
3335         <rdar://problem/53962073>
3336
3337         Reviewed by Alex Christensen.
3338
3339         Since prevalent resources with user interaction get to keep their cookies and website
3340         data, we should use a different NSURLSessions for when they are first-party websites
3341         and have access to that data. This patch achieves that.
3342
3343         The WebKit::NetworkDataTaskCocoa constructor now checks with the network storage session
3344         if the first party for this load should be isolated. The category for which this is true
3345         is checked in the new function
3346         WebCore:NetworkStorageSession::shouldBlockThirdPartyCookiesButKeepFirstPartyCookiesFor()
3347         which in turn is backed by a new split of m_registrableDomainsToBlockCookieFor into:
3348         - m_registrableDomainsToBlockAndDeleteCookiesFor
3349         - m_registrableDomainsToBlockButKeepCookiesFor
3350         ... in WebCore:NetworkStorageSession.
3351
3352         Non-isolated sessions are now picked up through the convenience function
3353         WebKit::NetworkSessionCocoa::session() whereas isolated sessions are created lazily and
3354         picked up through WebKit::NetworkSessionCocoa::isolatedSession().
3355
3356         The number of isolated NSURLSessions in memory is capped to 10. When the cap is hit,
3357         the session that's been unused the longest is aged out.
3358
3359         The C API changes are test infrastructure.
3360
3361         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
3362         (WebKit::ResourceLoadStatisticsDatabaseStore::clear):
3363         (WebKit::ResourceLoadStatisticsDatabaseStore::domainsToBlockAndDeleteCookiesFor const):
3364         (WebKit::ResourceLoadStatisticsDatabaseStore::domainsToBlockButKeepCookiesFor const):
3365         (WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlocking):
3366         (WebKit::ResourceLoadStatisticsDatabaseStore::domainsToBlock const): Deleted.
3367         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
3368         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
3369         (WebKit::ResourceLoadStatisticsMemoryStore::clear):
3370         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
3371         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
3372         (WebKit::ResourceLoadStatisticsStore::updateCookieBlockingForDomains):
3373         (WebKit::ResourceLoadStatisticsStore::debugLogDomainsInBatches):
3374         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
3375         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
3376         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
3377         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdateForDomains): Deleted.
3378         (WebKit::WebResourceLoadStatisticsStore::scheduleClearBlockingStateForDomains): Deleted.
3379             Dead code.
3380         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
3381         (WebKit::RegistrableDomainsToBlockCookiesFor::isolatedCopy const):
3382         * NetworkProcess/NetworkProcess.cpp:
3383         (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
3384         (WebKit::NetworkProcess::scheduleClearInMemoryAndPersistent):
3385         (WebKit::NetworkProcess::hasIsolatedSession const):
3386         * NetworkProcess/NetworkProcess.h:
3387         * NetworkProcess/NetworkProcess.messages.in:
3388         * NetworkProcess/NetworkSession.h:
3389         (WebKit::NetworkSession::shouldIsolateSessionsForPrevalentTopFrames const):
3390         (WebKit::NetworkSession::hasIsolatedSession const):
3391         (WebKit::NetworkSession::clearIsolatedSessions):
3392         * NetworkProcess/NetworkSessionCreationParameters.cpp:
3393         (WebKit::NetworkSessionCreationParameters::encode const):
3394         (WebKit::NetworkSessionCreationParameters::decode):
3395         * NetworkProcess/NetworkSessionCreationParameters.h:
3396         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3397         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
3398         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
3399         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3400         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3401         (WebKit::NetworkSessionCocoa::session):
3402         (WebKit::NetworkSessionCocoa::isolatedSession):
3403         (WebKit::NetworkSessionCocoa::hasIsolatedSession const):
3404         (WebKit::NetworkSessionCocoa::clearIsolatedSessions):
3405         (WebKit::NetworkSessionCocoa::invalidateAndCancel):
3406         (WebKit::NetworkSessionCocoa::clearCredentials):
3407         * Shared/WebPreferences.yaml:
3408         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3409         (WKWebsiteDataStoreStatisticsHasIsolatedSession):
3410         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
3411         * UIProcess/Network/NetworkProcessProxy.cpp:
3412         (WebKit::NetworkProcessProxy::hasIsolatedSession):
3413         * UIProcess/Network/NetworkProcessProxy.h:
3414         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3415         (WebKit::WebsiteDataStore::parameters):
3416         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3417         (WebKit::WebsiteDataStore::hasLocalStorageForTesting const):
3418         (WebKit::WebsiteDataStore::hasIsolatedSessionForTesting const):
3419         * UIProcess/WebsiteData/WebsiteDataStore.h:
3420
3421 2019-08-13  Chris Dumez  <cdumez@apple.com>
3422
3423         Fix potential thread safety issue under WebResourceLoadStatisticsStore::hasHadUserInteraction()
3424         https://bugs.webkit.org/show_bug.cgi?id=200688
3425
3426         Reviewed by Alex Christensen.
3427
3428         Fix potential thread safety issue under WebResourceLoadStatisticsStore::hasHadUserInteraction().
3429         It passes a RegistrableDomain to another thread without isolated copying it.
3430
3431         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
3432         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
3433
3434 2019-08-13  Chris Dumez  <cdumez@apple.com>
3435
3436         Fix potential thread safety issue under StorageManager::getSessionStorageOrigins()
3437         https://bugs.webkit.org/show_bug.cgi?id=200684
3438
3439         Reviewed by Geoffrey Garen.
3440
3441         Fix potential thread safety issue under StorageManager::getSessionStorageOrigins(). The origins are being
3442         passed from the background queue to the main thread without isolated copy.
3443
3444         * NetworkProcess/WebStorage/StorageManager.cpp:
3445         (WebKit::StorageManager::getSessionStorageOrigins):
3446
3447 2019-08-12  Jiewen Tan  <jiewen_tan@apple.com>
3448
3449         [WebAuthn] Make CtapHidAuthenticator/U2fHidAuthenticator to CtapAuthenticator/U2fAuthenticator
3450         https://bugs.webkit.org/show_bug.cgi?id=191527
3451         <rdar://problem/54237146>
3452
3453         Reviewed by Chris Dumez.
3454
3455         This patch makes an ABC CtapDriver, which services as an abstract interface for CtapAuthenticator/U2fAuthenticator to talk to
3456         the actual object that implement the specific CTAP protocol that mananges communications over different transports, for example,
3457         CtapHidDriver, such that CtapAuthenticator/U2fAuthenticator can be shared across different transports.
3458
3459         This patch also renames CtapHidAuthenticator/U2fHidAuthenticator to CtapAuthenticator/U2fAuthenticator correspondingly.
3460
3461         * Sources.txt:
3462         * UIProcess/WebAuthentication/Cocoa/HidService.mm:
3463         (WebKit::HidService::continueAddDeviceAfterGetInfo):
3464         * UIProcess/WebAuthentication/fido/CtapAuthenticator.cpp: Renamed from Source/WebKit/UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp.
3465         (WebKit::CtapAuthenticator::CtapAuthenticator):
3466         (WebKit::CtapAuthenticator::makeCredential):
3467         (WebKit::CtapAuthenticator::continueMakeCredentialAfterResponseReceived const):
3468         (WebKit::CtapAuthenticator::getAssertion):
3469         (WebKit::CtapAuthenticator::continueGetAssertionAfterResponseReceived):
3470         (WebKit::CtapAuthenticator::tryDowngrade):
3471         * UIProcess/WebAuthentication/fido/CtapAuthenticator.h: Copied from Source/WebKit/UIProcess/WebAuthentication/fido/CtapHidAuthenticator.h.
3472         * UIProcess/WebAuthentication/fido/CtapDriver.h: Renamed from Source/WebKit/UIProcess/WebAuthentication/fido/CtapHidAuthenticator.h.
3473         * UIProcess/WebAuthentication/fido/CtapHidDriver.h:
3474         (WebKit::CtapHidDriver::setProtocol):
3475         * UIProcess/WebAuthentication/fido/U2fAuthenticator.cpp: Renamed from Source/WebKit/UIProcess/WebAuthentication/fido/U2fHidAuthenticator.cpp.
3476         (WebKit::U2fAuthenticator::U2fAuthenticator):
3477         (WebKit::U2fAuthenticator::makeCredential):
3478         (WebKit::U2fAuthenticator::checkExcludeList):
3479         (WebKit::U2fAuthenticator::issueRegisterCommand):
3480         (WebKit::U2fAuthenticator::getAssertion):
3481         (WebKit::U2fAuthenticator::issueSignCommand):
3482         (WebKit::U2fAuthenticator::issueNewCommand):
3483         (WebKit::U2fAuthenticator::issueCommand):
3484         (WebKit::U2fAuthenticator::responseReceived):
3485         (WebKit::U2fAuthenticator::continueRegisterCommandAfterResponseReceived):
3486         (WebKit::U2fAuthenticator::continueCheckOnlyCommandAfterResponseReceived):
3487         (WebKit::U2fAuthenticator::continueBogusCommandAfterResponseReceived):
3488         (WebKit::U2fAuthenticator::continueSignCommandAfterResponseReceived):
3489         * UIProcess/WebAuthentication/fido/U2fAuthenticator.h: Renamed from Source/WebKit/UIProcess/WebAuthentication/fido/U2fHidAuthenticator.h.
3490         * WebKit.xcodeproj/project.pbxproj:
3491
3492 2019-08-13  Chris Dumez  <cdumez@apple.com>
3493
3494         Crash under IPC::Connection::markCurrentlyDispatchedMessageAsInvalid()
3495         https://bugs.webkit.org/show_bug.cgi?id=200674
3496         <rdar://problem/50692748>
3497
3498         Reviewed by Geoff Garen.
3499
3500         When the client terminates a provisional process (e.g. via the [WKWebView _killWebContentProcessAndResetState]
3501         SPI), the WebProcessProxy would notify its associated WebPageProxy objects that it had terminated but would fail
3502         to notify its associated ProvisionalPageProxy objects. As a result, those objects would not get destroyed and
3503         would still think that they were in the middle of a provisional load the next time a load started. This inconsistent
3504         state would lead to crashes such as the one in the radar.
3505
3506         * UIProcess/ProvisionalPageProxy.cpp:
3507         (WebKit::ProvisionalPageProxy::cancel):
3508         * UIProcess/WebProcessProxy.cpp:
3509         (WebKit::WebProcessProxy::requestTermination):
3510
3511 2019-08-13  Youenn Fablet  <youenn@apple.com>
3512
3513         Blob registries should be keyed by session IDs
3514         https://bugs.webkit.org/show_bug.cgi?id=200567
3515         <rdar://problem/54120212>
3516
3517         Reviewed by Alex Christensen.
3518
3519         Move blob registry to NetworkSession so that it is partitioned by session ID.
3520         In case session ID is not given through IPC, use the connection as key to get the network session.
3521         This is used for blobSize.
3522
3523         * NetworkProcess/Downloads/DownloadManager.cpp:
3524         (WebKit::DownloadManager::startDownload):
3525         * NetworkProcess/Downloads/DownloadManager.h:
3526         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
3527         * NetworkProcess/FileAPI/NetworkBlobRegistry.h: Removed.
3528         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3529         (WebKit::NetworkConnectionToWebProcess::didClose):
3530         (WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
3531         (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
3532         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
3533         (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
3534         (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
3535         (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
3536         (WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
3537         (WebKit::NetworkConnectionToWebProcess::blobSize):
3538         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
3539         (WebKit::NetworkConnectionToWebProcess::filesInBlob):
3540         * NetworkProcess/NetworkConnectionToWebProcess.h:
3541         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3542         * NetworkProcess/NetworkProcess.cpp:
3543         (WebKit::NetworkProcess::blobRegistry):
3544         * NetworkProcess/NetworkProcess.h:
3545         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
3546         (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
3547         * NetworkProcess/NetworkResourceLoader.cpp:
3548         (WebKit::NetworkResourceLoader::startNetworkLoad):
3549         * NetworkProcess/NetworkSession.h:
3550         (WebKit::NetworkSession::blobRegistry):
3551         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3552         (WebKit::NetworkDataTaskSoup::createRequest):
3553         * NetworkProcess/soup/NetworkSessionSoup.cpp:
3554         (WebKit::NetworkSessionSoup::createWebSocketTask):
3555         * Sources.txt:
3556         * WebKit.xcodeproj/project.pbxproj:
3557         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
3558         (WebKit::BlobRegistryProxy::registerFileBlobURL):
3559         (WebKit::BlobRegistryProxy::registerBlobURL):
3560         (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
3561         (WebKit::BlobRegistryProxy::unregisterBlobURL):
3562         (WebKit::BlobRegistryProxy::registerBlobURLForSlice):
3563         (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
3564         * WebProcess/FileAPI/BlobRegistryProxy.h:
3565         * WebProcess/Network/NetworkProcessConnection.cpp:
3566         (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
3567         * WebProcess/Network/NetworkProcessConnection.h:
3568
3569 2019-08-13  Youenn Fablet  <youenn@apple.com>
3570
3571         User Agent and SessionID should be given to NetworkRTCProvider to set up the correct proxy information
3572         https://bugs.webkit.org/show_bug.cgi?id=200583
3573
3574         Reviewed by Eric Carlson.
3575
3576         Pass session id and user agent whenever creating a TCP client socket.
3577         Use this information to get the proxy information from NetworkSession and pass it to libwebrtc socket creation.
3578
3579         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
3580         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
3581         (WebKit::NetworkRTCProvider::proxyInfoFromSession):
3582         (WebKit::NetworkRTCProvider::createClientTCPSocket):
3583         * NetworkProcess/webrtc/NetworkRTCProvider.h:
3584         * NetworkProcess/webrtc/NetworkRTCProvider.messages.in:
3585         * WebKit.xcodeproj/project.pbxproj:
3586         * NetworkProcess/webrtc/NetworkRTCProvider.mm: Added.
3587         (WebKit::NetworkRTCProvider::proxyInfoFromSession):
3588         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
3589         (WebKit::LibWebRTCProvider::createPeerConnection):
3590         (WebKit::LibWebRTCProvider::createSocketFactory):
3591         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
3592         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
3593         (WebKit::LibWebRTCSocketFactory::createServerTcpSocket):
3594         (WebKit::LibWebRTCSocketFactory::createUdpSocket):
3595         (WebKit::LibWebRTCSocketFactory::createClientTcpSocket):
3596         (WebKit::LibWebRTCSocketFactory::createAsyncResolver):
3597         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
3598
3599 2019-08-12  Chris Dumez  <cdumez@apple.com>
3600
3601         Fix bad RELEASE_LOG_ERROR under ProvisionalPageProxy::ProvisionalPageProxy()
3602         https://bugs.webkit.org/show_bug.cgi?id=200646
3603
3604         Reviewed by Alex Christensen.
3605
3606         Fix bad RELEASE_LOG_ERROR under ProvisionalPageProxy::ProvisionalPageProxy(). Should be a
3607         simple RELEASE_LOG() as this is not an error.
3608
3609         * UIProcess/ProvisionalPageProxy.cpp:
3610         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
3611
3612 2019-08-12  Sam Weinig  <weinig@apple.com>
3613
3614         Replace multiparameter overloads of append() in StringBuilder as a first step toward standardizinging on the flexibleAppend() implementation
3615         https://bugs.webkit.org/show_bug.cgi?id=200614
3616
3617         Reviewed by Darin Adler.
3618
3619         Renames StringBuilder::append(const LChar*, unsigned), StringBuilder::append(const UChar*, unsigned) and 
3620         StringBuilder::append(const char*, unsigned) to StringBuilder::appendCharacters(...).
3621         
3622         Renames StringBuilder::append(const String& string, unsigned offset, unsigned length) to 
3623         StringBuilder::appendSubstring(...).
3624
3625         * Shared/mac/AuxiliaryProcessMac.mm:
3626         (WebKit::setAndSerializeSandboxParameters):
3627         * UIProcess/WebProcessPool.cpp:
3628         (WebKit::WebProcessPool::didReceiveInvalidMessage):
3629         Update for renames.
3630
3631 2019-08-12  Dean Jackson  <dino@apple.com>
3632
3633         Contextual menu Hide and Show Link Previews should not have a symbol
3634         https://bugs.webkit.org/show_bug.cgi?id=200645
3635         <rdar://problem/54129647>
3636
3637         Reviewed by Wenson Hsieh.
3638
3639         Don't use an image on the UIMenuItem.
3640
3641         * UIProcess/API/Cocoa/_WKElementAction.mm:
3642         (+[_WKElementAction imageForElementActionType:]): Return nil for Show/Hide Link Previews.
3643
3644 2019-08-12  Chris Dumez  <cdumez@apple.com>
3645
3646         Unreviewed, add missing WTF::initializeMainThread() call to fix some crashes on the bots after r248533.
3647
3648         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
3649         (WebKit::XPCServiceMain):
3650
3651 2019-08-12  Megan Gardner  <megan_gardner@apple.com>
3652
3653         Fix Crash in Mail Search
3654         https://bugs.webkit.org/show_bug.cgi?id=200589
3655         <rdar://problem/53666720>
3656
3657         Reviewed by Tim Horton.
3658
3659         If we search in Mail backwards first, for AppKit reasons 
3660         we get a -1 for the index of the found item.
3661         Do not try and insert data in this case.
3662
3663         * UIProcess/mac/WKTextFinderClient.mm:
3664
3665 2019-08-12  Adrian Perez de Castro  <aperez@igalia.com>
3666
3667         [WPE][GTK] Fix building without unified sources
3668         https://bugs.webkit.org/show_bug.cgi?id=200641
3669
3670         Reviewed by Žan Doberšek.
3671
3672         * UIProcess/gtk/WebDataListSuggestionsDropdownGtk.cpp: Add missing inclusions for headers
3673         WebCore/GtkUtilities.h (for convertWidgetPointToScreenPoint), WebCore/IntPoint.h, and
3674         WebPageProxy.h (the two latter to avoid usage of undefined types).
3675         (WebKit::WebDataListSuggestionsDropdownGtk::show): Add namespace prefix to use
3676         WebCore::IntPoint.
3677
3678 2019-08-12  Sihui Liu  <sihui_liu@apple.com>
3679
3680         Clear m_sessionStorageNamespaces on the background thread
3681         https://bugs.webkit.org/show_bug.cgi?id=200631
3682         <rdar://problem/54149638>
3683
3684         Reviewed by Chris Dumez.
3685
3686         Network process receives messages about web page state from web process and destroys sessionStorageNamespace if 
3687         needed. It also receives messages about session state from UI process and destroys StorageManager, which owns 
3688         SessionStorageNamespaces, if needed. Because of the race in receiving the messages from different processes, 
3689         network process may decide to destroy StorageManager before destroying all SessionStorageNamespaces, and 
3690         SessionStorageNamespaces are destroyed with StorageManager on the main thread.
3691
3692         * NetworkProcess/WebStorage/StorageManager.cpp:
3693         (WebKit::StorageManager::waitUntilTasksFinished):
3694
3695 2019-08-12  Sihui Liu  <sihui_liu@apple.com>
3696
3697         Remove an assertion in ~StorageArea()
3698         https://bugs.webkit.org/show_bug.cgi?id=200630
3699         <rdar://problem/54097722>
3700
3701         Reviewed by Chris Dumez.
3702
3703         In r247370, we clear the LocalStorageNamespace before the destructor of LocalStorageNamespace is invoked, to 
3704         make sure StorageArea gets destroyed on the background thread. 
3705         StorageArea can get destroyed before LocalStorageNamespace, so the assertion in ~StorageArea() is not true any 
3706         more.
3707
3708         * NetworkProcess/WebStorage/StorageArea.cpp:
3709         (WebKit::StorageArea::~StorageArea):
3710
3711 2019-08-12  Wenson Hsieh  <wenson_hsieh@apple.com>
3712
3713         [iPadOS] Web pages sometimes load at half width in Safari
3714         https://bugs.webkit.org/show_bug.cgi?id=200624
3715         <rdar://problem/52694257>
3716
3717         Reviewed by Simon Fraser.
3718
3719         Whenever WKWebView's size changes, it normally notifies the web content process by calling into WebPageProxy::
3720         setViewportConfigurationViewLayoutSize, which remembers this view layout size using a member variable,
3721         m_viewportConfigurationViewLayoutSize. Later, m_viewportConfigurationViewLayoutSize is consulted as a part of
3722         constructing the creation parameters used to set up a new page.
3723
3724         However, during animated resize, WKWebView avoids these calls to setViewportConfigurationViewLayoutSize via the
3725         dynamic viewport update mode check in -[WKWebView _frameOrBoundsChanged]. Instead, the new view layout size is
3726         pushed to the web process by calling WebPageProxy::dynamicViewportSizeUpdate.
3727
3728         Since dynamicViewportSizeUpdate doesn't update m_viewportConfigurationViewLayoutSize, the next
3729         WebPageCreationParameters that are created with this WebPageProxy (e.g. after a process swap, or after
3730         reloading, if the process was terminated) will use the size of the WKWebView prior to the most recent animated
3731         resize.
3732
3733         To fix the bug, we simply make sure that m_viewportConfigurationViewLayoutSize is updated in the dynamic
3734         viewport size update (i.e. animated resize) case as well.
3735
3736         Test: WebKit.CreateWebPageAfterAnimatedResize
3737
3738         * UIProcess/ios/WebPageProxyIOS.mm:
3739         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
3740
3741 2019-08-12  Chris Dumez  <cdumez@apple.com>
3742
3743         Crash under NetworkResourceLoader::start()
3744         https://bugs.webkit.org/show_bug.cgi?id=200628
3745
3746         Reviewed by Youenn Fablet.
3747
3748         Make sure the NetworkResourceLoader is still alive when the lambda passed to NetworkLoadChecker::check()
3749         gets executed.
3750
3751         * NetworkProcess/NetworkResourceLoader.cpp:
3752         (WebKit::NetworkResourceLoader::start):
3753         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
3754         * NetworkProcess/NetworkResourceLoader.h:
3755
3756 2019-08-12  Jonathan Bedard  <jbedard@apple.com>
3757
3758         Tapping buttons in Data Detectors lookup previews doesn't work (Follow-up fix)
3759         https://bugs.webkit.org/show_bug.cgi?id=200579
3760         <rdar://problem/54056519>
3761
3762         Reviewed by Megan Gardner.
3763
3764         * Platform/spi/ios/UIKitSPI.h: Add _UIContextMenuStyle SPI.
3765
3766 2019-08-12  Chris Dumez  <cdumez@apple.com>
3767
3768         Add threading assertions to RefCounted
3769         https://bugs.webkit.org/show_bug.cgi?id=200507
3770
3771         Reviewed by Ryosuke Niwa.
3772
3773         Enable new RefCounted threading assertions for WebKit2
3774         (UIProcess + auxiliary processes).
3775
3776         * Shared/AuxiliaryProcess.cpp:
3777         (WebKit::AuxiliaryProcess::initialize):
3778         * Shared/Cocoa/WebKit2InitializeCocoa.mm:
3779         (WebKit::runInitializationCode):
3780         * Shared/WebKit2Initialize.cpp:
3781         (WebKit::InitializeWebKit2):
3782
3783 2019-08-12  Chris Dumez  <cdumez@apple.com>
3784
3785         Unreviewed, rolling out r248525.
3786
3787         Revert new threading assertions while I work on fixing the
3788         issues they exposed
3789
3790         Reverted changeset:
3791
3792         "Add threading assertions to RefCounted"
3793         https://bugs.webkit.org/show_bug.cgi?id=200507
3794         https://trac.webkit.org/changeset/248525
3795
3796 2019-08-12  Youenn Fablet  <youenn@apple.com>
3797
3798         Remove IDB-specific quota
3799         https://bugs.webkit.org/show_bug.cgi?id=196545
3800
3801         Reviewed by Alex Christensen.
3802
3803         * NetworkProcess/NetworkProcess.cpp:
3804         (WebKit::NetworkProcess::createIDBServer):
3805         (WebKit::NetworkProcess::addIndexedDatabaseSession):
3806         (WebKit::NetworkProcess::setIDBPerOriginQuota): Deleted.
3807         * NetworkProcess/NetworkProcess.h:
3808         * NetworkProcess/NetworkProcess.messages.in:
3809         * UIProcess/API/C/WKContext.cpp:
3810         (WKContextSetIDBPerOriginQuota): Deleted.
3811         * UIProcess/API/C/WKContextPrivate.h:
3812         * UIProcess/WebProcessPool.cpp:
3813         (WebKit::WebProcessPool::setIDBPerOriginQuota): Deleted.
3814         * UIProcess/WebProcessPool.h:
3815
3816 2019-08-11  Chris Dumez  <cdumez@apple.com>
3817
3818         Add threading assertions to RefCounted
3819         https://bugs.webkit.org/show_bug.cgi?id=200507
3820
3821         Reviewed by Ryosuke Niwa.
3822
3823         Enable new RefCounted threading assertions for WebKit2
3824         (UIProcess + auxiliary processes).
3825
3826         * Shared/AuxiliaryProcess.cpp:
3827         (WebKit::AuxiliaryProcess::initialize):
3828         * Shared/Cocoa/WebKit2InitializeCocoa.mm:
3829         (WebKit::runInitializationCode):
3830         * Shared/WebKit2Initialize.cpp:
3831         (WebKit::InitializeWebKit2):
3832
3833 2019-08-11  Wenson Hsieh  <wenson_hsieh@apple.com>
3834
3835         WebPage and ViewportConfiguration have differing notions of viewLayoutSize
3836         https://bugs.webkit.org/show_bug.cgi?id=200619
3837
3838         Reviewed by Tim Horton.
3839
3840         The notion of a "view layout size" exists on WebPage and WebPageProxy for the purpose of specifying an intrinsic
3841         content size for the entire web view on macOS. However, it also exists in ViewportConfiguration (as
3842         viewLayoutSize) and WebPageProxy (under the name m_viewportConfigurationViewLayoutSize) for the purposes of
3843         specifying the minimum layout size of the page's viewport.
3844
3845         This is especially confusing in WebPageProxy, which has both m_viewportConfigurationViewLayoutSize and
3846         m_viewLayoutSize. To remedy this, rename "*viewLayoutSize" for the purposes of specifying an intrinsic web view
3847         size to "*minimumSizeForAutoLayout" instead, which is consistent with the corresponding SPI property name on
3848         WKView.
3849
3850         No change in behavior.
3851
3852         * Shared/WebPageCreationParameters.cpp:
3853         (WebKit::WebPageCreationParameters::encode const):
3854         (WebKit::WebPageCreationParameters::decode):
3855         * Shared/WebPageCreationParameters.h:
3856         * UIProcess/API/Cocoa/WKWebView.mm:
3857         (-[WKWebView _minimumLayoutWidth]):
3858         (-[WKWebView _setMinimumLayoutWidth:]):
3859         * UIProcess/Cocoa/WebViewImpl.mm:
3860         (WebKit::WebViewImpl::setMinimumSizeForAutoLayout):
3861         (WebKit::WebViewImpl::minimumSizeForAutoLayout const):
3862         (WebKit::WebViewImpl::setIntrinsicContentSize):
3863         * UIProcess/DrawingAreaProxy.h:
3864         (WebKit::DrawingAreaProxy::minimumSizeForAutoLayoutDidChange):
3865         (WebKit::DrawingAreaProxy::viewLayoutSizeDidChange): Deleted.
3866         * UIProcess/WebPageProxy.cpp:
3867         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
3868         * UIProcess/WebPageProxy.h:
3869         (WebKit::WebPageProxy::minimumSizeForAutoLayout const):
3870         (WebKit::WebPageProxy::viewLayoutSize const): Deleted.
3871         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
3872         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
3873         (WebKit::TiledCoreAnimationDrawingAreaProxy::minimumSizeForAutoLayoutDidChange):
3874         (WebKit::TiledCoreAnimationDrawingAreaProxy::didUpdateGeometry):
3875         (WebKit::TiledCoreAnimationDrawingAreaProxy::willSendUpdateGeometry):
3876         (WebKit::TiledCoreAnimationDrawingAreaProxy::viewLayoutSizeDidChange): Deleted.
3877         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3878         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
3879         * WebProcess/WebPage/WebPage.cpp:
3880         (WebKit::m_textAutoSizingAdjustmentTimer):
3881         (WebKit::WebPage::reinitializeWebPage):
3882         (WebKit::WebPage::setMinimumSizeForAutoLayout):
3883         (WebKit::WebPage::updateIntrinsicContentSizeIfNeeded):
3884         (WebKit::WebPage::setViewLayoutSize): Deleted.
3885         * WebProcess/WebPage/WebPage.h:
3886         (WebKit::WebPage::minimumSizeForAutoLayout const):
3887         (WebKit::WebPage::viewLayoutSize const): Deleted.
3888         * WebProcess/WebPage/WebPage.messages.in:
3889         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3890         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
3891
3892 2019-08-10  Alex Christensen  <achristensen@webkit.org>
3893
3894         Disable ContentChangeObserver TouchEvent adjustment on youtube.com on iOS in mobile browsing mode
3895         https://bugs.webkit.org/show_bug.cgi?id=200609
3896         <rdar://problem/54015403>
3897
3898         Reviewed by Maciej Stachowiak.
3899
3900         * Shared/WebsitePoliciesData.cpp:
3901         (WebKit::WebsitePoliciesData::encode const):
3902         (WebKit::WebsitePoliciesData::decode):
3903         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
3904         * Shared/WebsitePoliciesData.h:
3905         * UIProcess/API/APIWebsitePolicies.cpp:
3906         (API::WebsitePolicies::copy const):
3907         (API::WebsitePolicies::data):
3908         * UIProcess/API/APIWebsitePolicies.h:
3909         * UIProcess/ios/WebPageProxyIOS.mm:
3910         (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
3911
3912 2019-08-10  Said Abou-Hallawa  <sabouhallawa@apple.com>
3913
3914         [iOS] Add a quirk for gmail.com messages on iPhone iOS13
3915         https://bugs.webkit.org/show_bug.cgi?id=200605
3916
3917         Reviewed by Maciej Stachowiak.
3918
3919         Use WebPage::platformUserAgent() to add the gmail.com quirk.
3920
3921         * UIProcess/ios/WebPageProxyIOS.mm:
3922         (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
3923         * WebProcess/WebPage/ios/WebPageIOS.mm:
3924         (WebKit::WebPage::platformUserAgent const):
3925
3926 2019-08-10  Tim Horton  <timothy_horton@apple.com>
3927
3928         Remove some more unused 32-bit code
3929         https://bugs.webkit.org/show_bug.cgi?id=200607
3930
3931         Reviewed by Alexey Proskuryakov.
3932
3933         * Modules/OSX.modulemap:
3934
3935 2019-08-09  Wenson Hsieh  <wenson_hsieh@apple.com>
3936
3937         [iOS 13] Google Docs/Slides/Sheets: paste often doesn't work and sometimes produces an error
3938         https://bugs.webkit.org/show_bug.cgi?id=200591
3939         <rdar://problem/54102238>
3940
3941         Reviewed by Ryosuke Niwa and Tim Horton.
3942
3943         Adopts UIKit SPI to avoid incrementing the general pasteboard's change count whenever an editable element is
3944         focused. This is due to how, in iOS 13, UIKit temporarily writes an image to the pasteboard when showing the
3945         keyboard, to determine whether or not to show the Memojis in the input view.
3946
3947         This causes UIPasteboard's changeCount to increment twice due to adding and then removing the image, which means
3948         that the changeCount sanity checks in the web process will race against the pasteboard gaining and then losing
3949         this temporary image.
3950
3951         Instead, the new -supportsImagePaste SPI may be used to short-circuit this step, and avoid updating the
3952         changeCount when UIKeyboardImpl's delegate changes.
3953
3954         * UIProcess/ios/WKContentViewInteraction.mm:
3955         (-[WKContentView supportsImagePaste]):
3956
3957 2019-08-09  Alex Christensen  <achristensen@webkit.org>
3958
3959         Remove unused Connection::sendWithReply
3960         https://bugs.webkit.org/show_bug.cgi?id=200590
3961
3962         Reviewed by Chris Dumez.
3963
3964         This was attempted in r245151, but rolled out in r245164 because my SecItemShim code didn't work well on non-main threads.
3965         Chris found a better solution for SecItemShim in r248014, making this unused code.  Let's remove it.
3966
3967         * Platform/IPC/Connection.cpp:
3968         (IPC::Connection::invalidate):
3969         (IPC::Connection::processIncomingSyncReply):
3970         (IPC::Connection::connectionDidClose):
3971         (IPC::Connection::sendMessageWithReply): Deleted.
3972         * Platform/IPC/Connection.h:
3973         (IPC::Connection::send):
3974         (IPC::Connection::sendWithReply): Deleted.
3975
3976 2019-08-09  Simon Fraser  <simon.fraser@apple.com>
3977
3978         [iOS WK2] Remove context menu hints on navigation
3979         https://bugs.webkit.org/show_bug.cgi?id=200588
3980         rdar://problem/54061796
3981
3982         Reviewed by Tim Horton.
3983
3984         Make sure the context menu hint doesn't linger across navigations by hosting it in its
3985         own container view (shared with drag previews), and hiding that view on navigation (unparenting
3986         may have bad consequences). We remove the view when the animation ends.
3987
3988         * UIProcess/ios/WKContentViewInteraction.h:
3989         * UIProcess/ios/WKContentViewInteraction.mm:
3990         (-[WKContentView _didCommitLoadForMainFrame]):
3991         (-[WKContentView containerViewForTargetedPreviews]):
3992         (-[WKContentView _hideContextMenu]):
3993         (-[WKContentView contextMenuInteraction:willEndForConfiguration:animator:]):
3994
3995 2019-08-09  Alex Christensen  <achristensen@webkit.org>
3996
3997         Disable CSSOM View Scrolling API for IMDb iOS app
3998         https://bugs.webkit.org/show_bug.cgi?id=200586
3999         <rdar://problem/53645833>
4000
4001         Reviewed by Simon Fraser.
4002
4003         Change the CSSOMViewScrollingAPIEnabled default value to be off for the IMDb app's WKWebViews.
4004         I manually verified this is effective in those WKWebViews but no other WKWebViews and that it fixes the radar.
4005
4006         * Shared/WebPreferences.yaml:
4007         * Shared/WebPreferencesDefaultValues.cpp:
4008         (WebKit::defaultCSSOMViewScrollingAPIEnabled):
4009         * Shared/WebPreferencesDefaultValues.h:
4010
4011 2019-08-09  Tim Horton  <timothy_horton@apple.com>
4012
4013         Tapping buttons in Data Detectors lookup previews doesn't work
4014         https://bugs.webkit.org/show_bug.cgi?id=200579
4015         <rdar://problem/54056519>
4016
4017         Reviewed by Megan Gardner.
4018
4019         * Platform/spi/ios/UIKitSPI.h:
4020         * UIProcess/ios/WKContentViewInteraction.mm:
4021         (-[WKContentView _contextMenuInteraction:styleForMenuWithConfiguration:]):
4022         If a Data Detectors context menu wants the action menu style, provide it.
4023
4024         (-[WKContentView contextMenuInteraction:willPerformPreviewActionForMenuWithConfiguration:animator:]):
4025         If a Data Detectors context menu provides a view controller to present
4026         on context menu commit, present it. We present on top of the same view
4027         controller that is currently presenting the context menu, but modally
4028         instead of inside the context menu.
4029
4030         If a Data Detectors context menu instead provides a URL to launch on
4031         context menu commit, call openURL.
4032
4033         In both cases, change the commit style to pop, since we're committing
4034         instead of dismissing.
4035
4036 2019-08-08  Dean Jackson  <dino@apple.com>
4037
4038         REGRESSION (52279987): Most of the WKUIDelegate contextMenu delegate methods are not being called
4039         https://bugs.webkit.org/show_bug.cgi?id=200557
4040         <rdar://problem/53717962>
4041
4042         Reviewed by Wenson Hsieh.
4043
4044         UIKit changed the name of delegates recently. We ignored the warning because
4045         it was still calling the old methods. However, it will only do so for applications
4046         authored by Apple, breaking 3rd parties.
4047
4048         The change here is just adopting the new methods in place of the old ones.
4049         It does not change the API that WebKit vends (they still use the older names).
4050
4051         * UIProcess/ios/WKContentViewInteraction.mm:
4052         (-[WKContentView contextMenuInteraction:willDisplayMenuForConfiguration:animator:]):
4053         (-[WKContentView contextMenuInteraction:willPerformPreviewActionForMenuWithConfiguration:animator:]):
4054         (-[WKContentView contextMenuInteraction:willEndForConfiguration:animator:]):
4055         (-[WKContentView contextMenuInteractionWillPresent:]): Deleted.
4056         (-[WKContentView contextMenuInteraction:willCommitWithAnimator:]): Deleted.
4057         (-[WKContentView contextMenuInteractionDidEnd:]): Deleted.
4058
4059 2019-08-08  Simon Fraser  <simon.fraser@apple.com>
4060
4061         [iOS WK2] Hide previews when an inner overflow or frame scrollview scrolls
4062         https://bugs.webkit.org/show_bug.cgi?id=200552
4063         rdar://problem/54086338
4064
4065         Reviewed by Wenson Hsieh.
4066
4067         Give UITargetedPreview the UIScrollView that the target element is inside of,
4068         so it can clean up if the user starts to scroll that view.
4069
4070         * Platform/spi/ios/UIKitSPI.h:
4071         * UIProcess/ios/WKContentViewInteraction.mm:
4072         (-[WKContentView _createTargetedPreviewIfPossible]):
4073
4074 2019-08-08  Chris Dumez  <cdumez@apple.com>
4075
4076         Add threading assertions to WebStorage code
4077         https://bugs.webkit.org/show_bug.cgi?id=200550
4078
4079         Reviewed by Geoffrey Garen.
4080
4081         Add threading assertions to WebStorage code for extra safety.
4082
4083         * NetworkProcess/WebStorage/LocalStorageNamespace.cpp:
4084         (WebKit::LocalStorageNamespace::LocalStorageNamespace):
4085         (WebKit::LocalStorageNamespace::~LocalStorageNamespace):
4086         (WebKit::LocalStorageNamespace::getOrCreateStorageArea):
4087         (WebKit::LocalStorageNamespace::clearStorageAreasMatchingOrigin):
4088         (WebKit::LocalStorageNamespace::clearAllStorageAreas):
4089         (WebKit::LocalStorageNamespace::ephemeralOrigins const):
4090         (WebKit::LocalStorageNamespace::cloneTo):
4091         * NetworkProcess/WebStorage/SessionStorageNamespace.cpp:
4092         (WebKit::SessionStorageNamespace::SessionStorageNamespace):
4093         (WebKit::SessionStorageNamespace::~SessionStorageNamespace):
4094         (WebKit::SessionStorageNamespace::addAllowedConnection):
4095         (WebKit::SessionStorageNamespace::removeAllowedConnection):
4096         (WebKit::SessionStorageNamespace::getOrCreateStorageArea):
4097         (WebKit::SessionStorageNamespace::cloneTo):
4098         (WebKit::SessionStorageNamespace::origins const):
4099         (WebKit::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
4100         (WebKit::SessionStorageNamespace::clearAllStorageAreas):
4101         * NetworkProcess/WebStorage/StorageArea.cpp:
4102         (WebKit::StorageArea::StorageArea):
4103         (WebKit::StorageArea::~StorageArea):
4104         (WebKit::StorageArea::addListener):
4105         (WebKit::StorageArea::removeListener):
4106         (WebKit::StorageArea::hasListener const):
4107         (WebKit::StorageArea::clone const):
4108         (WebKit::StorageArea::setItem):
4109         (WebKit::StorageArea::setItems):
4110         (WebKit::StorageArea::removeItem):
4111         (WebKit::StorageArea::clear):
4112         (WebKit::StorageArea::items const):
4113         (WebKit::StorageArea::openDatabaseAndImportItemsIfNeeded const):
4114         (WebKit::StorageArea::dispatchEvents const):
4115         * NetworkProcess/WebStorage/StorageManager.cpp:
4116         (WebKit::StorageManager::createSessionStorageNamespace):
4117         (WebKit::StorageManager::destroySessionStorageNamespace):
4118         (WebKit::StorageManager::addAllowedSessionStorageNamespaceConnection):
4119         (WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection):
4120         (WebKit::StorageManager::cloneSessionStorageNamespace):
4121         (WebKit::StorageManager::processDidCloseConnection):
4122         (WebKit::StorageManager::getSessionStorageOrigins):
4123         (WebKit::StorageManager::deleteSessionStorageOrigins):
4124         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
4125         (WebKit::StorageManager::getLocalStorageOrigins):
4126         (WebKit::StorageManager::getLocalStorageOriginDetails):
4127         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
4128         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
4129         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
4130         (WebKit::StorageManager::waitUntilTasksFinished):
4131         (WebKit::StorageManager::suspend):
4132         (WebKit::StorageManager::resume):
4133         (WebKit::StorageManager::findStorageArea const):
4134         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
4135         (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
4136         * NetworkProcess/WebStorage/TransientLocalStorageNamespace.cpp:
4137         (WebKit::TransientLocalStorageNamespace::TransientLocalStorageNamespace):
4138         (WebKit::TransientLocalStorageNamespace::~TransientLocalStorageNamespace):
4139         (WebKit::TransientLocalStorageNamespace::getOrCreateStorageArea):
4140         (WebKit::TransientLocalStorageNamespace::origins const):
4141         (WebKit::TransientLocalStorageNamespace::clearStorageAreasMatchingOrigin):
4142         (WebKit::TransientLocalStorageNamespace::clearAllStorageAreas):
4143
4144 2019-08-08  Brent Fulgham  <bfulgham@apple.com>
4145
4146         [FTW] Get WebKit, WebKit2, and MiniBrowser building and executing
4147         https://bugs.webkit.org/show_bug.cgi?id=200539
4148         <rdar://problem/54082550>
4149
4150         Reviewed by Dean Jackson.
4151
4152         * PlatformFTW.cmake: Added.
4153         * Shared/ShareableBitmap.h:
4154         * Shared/win/ShareableBitmapDirect2D.cpp: Added.
4155         * UIProcess/BackingStore.cpp:
4156         * UIProcess/BackingStore.h:
4157         (WebKit::BackingStore::renderTarget):
4158         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp:
4159         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h:
4160         * UIProcess/win/BackingStoreDirect2D.cpp: Added.
4161         * UIProcess/win/WebInspectorProxyWin.cpp:
4162         (WebKit::WebInspectorProxy::inspectorPageURL):
4163         (WebKit::WebInspectorProxy::inspectorTestPageURL):
4164         (WebKit::WebInspectorProxy::inspectorBaseURL):
4165         * UIProcess/win/WebView.cpp:
4166         (WebKit::WebView::paint):
4167         * UIProcess/win/WebView.h:
4168         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
4169         (WebKit::DrawingAreaCoordinatedGraphics::display):
4170         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h:
4171         * WebProcess/WebPage/win/WebInspectorUIWin.cpp:
4172         (WebKit::WebInspectorUI::localizedStringsURL):
4173         (WebKit::RemoteWebInspectorUI::localizedStringsURL):
4174         * WebProcess/win/WebProcessMainWin.cpp:
4175         (WebKit::WebProcessMainWin):
4176
4177 2019-08-08  Per Arne Vollan  <pvollan@apple.com>
4178
4179         [Mac] Use the PID of the WebContent process when issuing local file read sandbox extensions
4180         https://bugs.webkit.org/show_bug.cgi?id=200543
4181
4182         Reviewed by Brent Fulgham.
4183
4184         Adopt SPI to issue a process-specific sandbox extension for local file read, passing it the process
4185         identifier of the WebContent process.
4186
4187         * Shared/Cocoa/SandboxExtensionCocoa.mm:
4188         (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
4189         (WebKit::SandboxExtension::createHandleForReadByPid):
4190         * Shared/SandboxExtension.h:
4191         * UIProcess/WebPageProxy.cpp:
4192         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
4193
4194 2019-08-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
4195
4196         [iOS] Position image information should respect the image orientation
4197         https://bugs.webkit.org/show_bug.cgi?id=200487
4198
4199         Reviewed by Simon Fraser.
4200
4201         imagePositionInformation() should respect the image orientation when
4202         drawing an Image to a ShareableBitmap context.
4203
4204         boundsPositionInformation() already takes care of the image orientation
4205         because it gets RenderImage::enclosingBoundingBox().
4206
4207         * WebProcess/WebPage/ios/WebPageIOS.mm:
4208         (WebKit::imagePositionInformation):
4209
4210 2019-08-08  Timothy Hatcher  <timothy@apple.com>
4211
4212         Set WKWebView opaque based on drawsBackground in PageConfiguration.
4213         https://bugs.webkit.org/show_bug.cgi?id=200528
4214
4215         Reviewed by Tim Horton.
4216
4217         * UIProcess/API/Cocoa/WKWebView.mm:
4218         (-[WKWebView _initializeWithConfiguration:]): Set self.opaque = NO when !self.opaque || !pageConfiguration->drawsBackground().
4219         It is almost impossible to have !self.opaque be NO at this point, since we are still inside initWithFrame:. A subclass could
4220         override opaque and return NO, but checking pageConfiguration's drawsBackground is a good alternative.
4221         * WebProcess/WebPage/WebPage.h: Remove unused m_drawsBackground member.
4222
4223 2019-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>
4224
4225         [iOS 13] Taps that interrupt momentum scrolling are recognized as clicks
4226         https://bugs.webkit.org/show_bug.cgi?id=200516
4227         <rdar://problem/53889373>
4228
4229         Reviewed by Tim Horton.
4230
4231         After <https://trac.webkit.org/r247656>, the -tracksImmediatelyWhileDecelerating property of WKScrollView and
4232         WKChildScrollView is set to NO. This means that if a user interacts with the page while the scroll view is
4233         decelerating (e.g. after momentum scrolling), the pan gesture recognizer will not be immediately recognized.
4234         This gives other gesture recognizers, such as the synthetic click (single tap) gesture a chance to instead
4235         recognize first. In this particular bug, this causes taps on the web view that are intended to only stop
4236         momentum scrolling to instead activate clickable elements beneath the touch, such as links and buttons.
4237
4238         To mitigate this, we add some logic to prevent the click gesture recognizer from firing in the case where the
4239         tap also causes the scroll view to decelerate. This heuristic is similar to the one introduced in r219310, which
4240         has the same purpose of hiding gestures that stop momentum scrolling from the page, and also consults
4241         -[UIScrollView _isInterruptingDeceleration].
4242
4243         Tests:  fast/scrolling/ios/click-events-during-momentum-scroll-in-main-frame.html
4244                 fast/scrolling/ios/click-events-during-momentum-scroll-in-overflow-after-tap-on-body.html
4245                 fast/scrolling/ios/click-events-during-momentum-scroll-in-overflow.html
4246
4247         * UIProcess/ios/WKContentViewInteraction.mm:
4248         (-[WKContentView gestureRecognizerShouldBegin:]):
4249
4250         Return NO in the case of the single tap gesture if the UIScrollView most recently touched by the single tap
4251         gesture (or one of its enclosing scroll views, up to the main WKScrollView) is being interrupted while
4252         decelerating.
4253
4254         * UIProcess/ios/WKSyntheticTapGestureRecognizer.h:
4255         * UIProcess/ios/WKSyntheticTapGestureRecognizer.mm:
4256         (-[WKSyntheticTapGestureRecognizer reset]):
4257         (-[WKSyntheticTapGestureRecognizer touchesBegan:withEvent:]):
4258
4259         Teach WKSyntheticTapGestureRecognizer to keep track of the last WKScrollView that was touched, for later use in
4260         -gestureRecognizerShouldBegin:. To do this, we keep a weak reference to the first UIScrollView we find in the
4261         set of touches.
4262
4263         (-[WKSyntheticTapGestureRecognizer lastTouchedScrollView]):
4264
4265 2019-08-08  Dean Jackson  <dino@apple.com>
4266
4267         Use "safari" glyph for "Show Link Previews" contextual menu
4268         https://bugs.webkit.org/show_bug.cgi?id=200544
4269         <rdar://problem/54087842>
4270
4271         Reviewed by Tim Horton.
4272
4273         Use the system image for the compass.
4274
4275         * UIProcess/API/Cocoa/_WKElementAction.mm:
4276         (+[_WKElementAction imageForElementActionType:]):
4277
4278 2019-08-08  Chris Dumez  <cdumez@apple.com>
4279
4280         Move classes declared inside StorageManager.cpp into their own headers
4281         https://bugs.webkit.org/show_bug.cgi?id=200527
4282
4283         Reviewed by Alex Christensen.
4284
4285         Move classes declared inside StorageManager.cpp into their own headers
4286         for clarity. StorageManager.cpp was getting really big.
4287
4288         * NetworkProcess/WebStorage/LocalStorageNamespace.cpp: Added.
4289         (WebKit::LocalStorageNamespace::LocalStorageNamespace):
4290         (WebKit::LocalStorageNamespace::~LocalStorageNamespace):
4291         (WebKit::LocalStorageNamespace::getOrCreateStorageArea):
4292         (WebKit::LocalStorageNamespace::clearStorageAreasMatchingOrigin):
4293         (WebKit::LocalStorageNamespace::clearAllStorageAreas):
4294         (WebKit::LocalStorageNamespace::ephemeralOrigins const):
4295         (WebKit::LocalStorageNamespace::cloneTo):
4296         * NetworkProcess/WebStorage/LocalStorageNamespace.h: Added.
4297         (WebKit::LocalStorageNamespace::create):
4298         (WebKit::LocalStorageNamespace::storageManager const):
4299         * NetworkProcess/WebStorage/SessionStorageNamespace.cpp: Added.
4300         (WebKit::SessionStorageNamespace::SessionStorageNamespace):
4301         (WebKit::SessionStorageNamespace::~SessionStorageNamespace):
4302         (WebKit::SessionStorageNamespace::addAllowedConnection):
4303         (WebKit::SessionStorageNamespace::removeAllowedConnection):
4304         (WebKit::SessionStorageNamespace::getOrCreateStorageArea):
4305         (WebKit::SessionStorageNamespace::cloneTo):
4306         (WebKit::SessionStorageNamespace::origins const):
4307         (WebKit::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
4308         (WebKit::SessionStorageNamespace::clearAllStorageAreas):
4309         * NetworkProcess/WebStorage/SessionStorageNamespace.h: Added.
4310         (WebKit::SessionStorageNamespace::create):
4311         (WebKit::SessionStorageNamespace::isEmpty const):
4312         (WebKit::SessionStorageNamespace::allowedConnections const):
4313         * NetworkProcess/WebStorage/StorageArea.cpp: Added.
4314         (WebKit::StorageArea::StorageArea):
4315         (WebKit::StorageArea::~StorageArea):
4316         (WebKit::StorageArea::addListener):
4317         (WebKit::StorageArea::removeListener):
4318         (WebKit::StorageArea::hasListener const):
4319         (WebKit::StorageArea::clone const):
4320         (WebKit::StorageArea::setItem):
4321         (WebKit::StorageArea::setItems):
4322         (WebKit::StorageArea::removeItem):
4323         (WebKit::StorageArea::clear):
4324         (WebKit::StorageArea::items const):
4325         (WebKit::StorageArea::openDatabaseAndImportItemsIfNeeded const):
4326         (WebKit::StorageArea::dispatchEvents const):
4327         * NetworkProcess/WebStorage/StorageArea.h: Added.
4328         (WebKit::StorageArea::create):
4329         (WebKit::StorageArea::securityOrigin const):
4330         (WebKit::StorageArea::isEphemeral const):
4331         * NetworkProcess/WebStorage/StorageManager.cpp:
4332         (WebKit::StorageManager::createLocalStorageMap):
4333         (WebKit::StorageManager::findStorageArea const):
4334         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
4335         (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
4336         * NetworkProcess/WebStorage/StorageManager.h:
4337         (WebKit::StorageManager::create):
4338         (WebKit::StorageManager::localStorageDatabaseTracker const):
4339         (WebKit::StorageManager::workQueue const):
4340         * NetworkProcess/WebStorage/TransientLocalStorageNamespace.cpp: Added.
4341         (WebKit::TransientLocalStorageNamespace::TransientLocalStorageNamespace):
4342         (WebKit::TransientLocalStorageNamespace::~TransientLocalStorageNamespace):
4343         (WebKit::TransientLocalStorageNamespace::getOrCreateStorageArea):
4344         (WebKit::TransientLocalStorageNamespace::origins const):
4345         (WebKit::TransientLocalStorageNamespace::clearStorageAreasMatchingOrigin):
4346         (WebKit::TransientLocalStorageNamespace::clearAllStorageAreas):
4347         * NetworkProcess/WebStorage/TransientLocalStorageNamespace.h: Added.
4348         (WebKit::TransientLocalStorageNamespace::create):
4349         * NetworkProcess/cache/NetworkCache.cpp:
4350         (WebKit::NetworkCache::canRequestUseSpeculativeRevalidation):
4351         * Sources.txt:
4352         * WebKit.xcodeproj/project.pbxproj:
4353
4354 2019-08-08  Rob Buis  <rbuis@igalia.com>
4355
4356         Add runtime flag for lazy image loading
4357         https://bugs.webkit.org/show_bug.cgi?id=199794
4358
4359         Reviewed by Darin Adler.
4360
4361         Add LazyImageLoading preference.
4362
4363         * Shared/WebPreferences.yaml:
4364         * UIProcess/API/C/WKPreferences.cpp:
4365         (WKPreferencesSetLazyImageLoadingEnabled):
4366         (WKPreferencesGetLazyImageLoadingEnabled):
4367         * UIProcess/API/C/WKPreferencesRefPrivate.h:
4368
4369 2019-08-07  Chris Dumez  <cdumez@apple.com>
4370
4371         Turn some ITP threading ASSERTs into RELEASE_ASSERTs
4372         https://bugs.webkit.org/show_bug.cgi?id=200521
4373
4374         Reviewed by Ryosuke Niwa.
4375
4376         Turn some ITP threading ASSERTs into RELEASE_ASSERTs to help catch more bugs.
4377
4378         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
4379         (WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
4380         (WebKit::ResourceLoadStatisticsMemoryStore::isEmpty const):
4381         * NetworkProcess/Classifier/ResourceLoadStatisticsPersistentStorage.cpp:
4382         (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
4383         (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage):
4384         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
4385         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
4386         (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
4387         (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
4388
4389 2019-08-07  Kate Cheney  <katherine_cheney@apple.com>
4390
4391         Adopt non-deprecated CGColorSpace API
4392         https://bugs.webkit.org/show_bug.cgi?id=184358
4393
4394         Reviewed by Darin Adler.
4395
4396         * Shared/mac/ColorSpaceData.mm:
4397         (WebKit::ColorSpaceData::decode):
4398
4399         We changed the deprecated CGColorSpaceCreateWithICCProfile function to 
4400         CGColorSpaceCreateWithICCData. 
4401
4402 2019-08-07  Alex Christensen  <achristensen@webkit.org>
4403
4404         Remove speculative workaround for upload crash
4405         https://bugs.webkit.org/show_bug.cgi?id=200514
4406
4407         Reviewed by Geoffrey Garen.
4408
4409         This workaround didn't help anyways, and the crash has been resolved.  Let's clean up.
4410
4411         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
4412         (-[WKNetworkSessionDelegate URLSession:task:needNewBodyStream:]):
4413
4414 2019-08-07  Chris Dumez  <cdumez@apple.com>
4415
4416         Regression(r247784) ResourceLoadStatisticsMemoryStore / ResourceLoadStatisticsPersistentStorage may get destroyed on the wrong thread
4417         https://bugs.webkit.org/show_bug.cgi?id=200517
4418
4419         Reviewed by Geoffrey Garen.
4420
4421         The issue is that WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore() is null checking
4422         m_persistentStorage and m_statisticsStore on the main thread, even though those members are initialized
4423         and destroyed on the background thread. As a result, if flushAndDestroyPersistentStore() is called *before*
4424         the background task to initialize those members has had a chance to run, then we'd return early without
4425         destroying those members. Later on, the background task would then initialize those data members and we
4426         would then destroy them on the main thread when the WebResourceLoadStatisticsStore is destroyed on the
4427         main thread.
4428
4429         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
4430         (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
4431
4432 2019-08-06  Dean Jackson  <dino@apple.com>
4433
4434         Context menu on a universal link produces a blank preview
4435         https://bugs.webkit.org/show_bug.cgi?id=200485
4436         <rdar://problem/53699620>
4437
4438         Reviewed by Tim Horton.
4439
4440         If the context menu is activated on an iTunesStore URL, pass it
4441         on to DataDetectors, who should know how to handle it.
4442
4443         Two drive-by fixes:
4444         - make it clear that early returns do not produce a value. Instead call the
4445           completion handler first, then return.
4446         - The new API DataDetectors case doesn't need to worry about hiding link previews
4447           as DataDetectors itself will handle that.
4448
4449         * UIProcess/ios/WKContentViewInteraction.mm: If the URL is an iTunesStoreURL
4450         (as defined by CoreServices), let DataDetectors handle it.
4451         (-[WKContentView assignLegacyDataForContextMenuInteraction]):
4452         (-[WKContentView continueContextMenuInteraction:]):
4453         (-[WKContentView continueContextMenuInteractionWithDataDetectors:]): New method to
4454         use DataDetectors if possible.
4455
4456 2019-08-08  Simon Fraser  <simon.fraser@apple.com>
4457
4458         Add to InteractionInformationAtPosition information about whether the element is in a subscrollable region
4459         https://bugs.webkit.org/show_bug.cgi?id=200374
4460         rdar://problem/54095519
4461
4462         Reviewed by Tim Horton.
4463         
4464         Add InteractionInformationAtPosition.containerScrollingNodeID and initialize it in elementPositionInformation()
4465         by asking the scrolling coordinator.
4466         
4467         Also add a way to get from a ScrollingNodeID to a UIScrollView to RemoteScrollingCoordinatorProxy,
4468         which gets the scrolling node and asks the delegate for the UIView.
4469
4470         * Shared/ios/InteractionInformationAtPosition.h:
4471         * Shared/ios/InteractionInformationAtPosition.mm:
4472         (WebKit::InteractionInformationAtPosition::encode const):
4473         (WebKit::InteractionInformationAtPosition::decode):
4474         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
4475         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
4476         (WebKit::RemoteScrollingCoordinatorProxy::scrollViewForScrollingNodeID const):
4477         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
4478         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
4479         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollView const):
4480         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
4481         * WebProcess/WebPage/ios/WebPageIOS.mm:
4482         (WebKit::elementPositionInformation):
4483
4484 2019-08-07  Priyanka Agarwal  <pagarwal999@apple.com>
4485
4486         Allow clients to toggle a text input field between being viewable and having characters hidden while maintaining 
4487         a yellow auto-filled appearance
4488         https://bugs.webkit.org/show_bug.cgi?id=200037
4489         rdar://problem/51900961
4490
4491         Reviewed by Daniel Bates.
4492
4493         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
4494         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
4495         (-[WKWebProcessPlugInNodeHandle HTMLInputElementIsAutoFilledAndViewable]):
4496         Accessor function for boolean which represents if the input element is autofilled and viewable.
4497
4498         (-[WKWebProcessPlugInNodeHandle setHTMLInputElementIsAutoFilledAndViewable:]):
4499         Setter function for boolean which represents if the input element is autofilled and viewable.
4500
4501         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
4502         (WKBundleNodeHandleSetHTMLInputElementAutoFilledAndViewable):
4503         Accessor function for boolean which represents if the input element is autofilled and viewable.
4504
4505        * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
4506         Creating function declaration for boolean setter.
4507
4508         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
4509         Accessor function for boolean which represents if the input element is autofilled and viewable.
4510
4511         (WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutoFilledAndViewable const):
4512         Setter function for boolean which represents if the input element is autofilled and viewable.
4513
4514         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutoFilledAndViewable):
4515         Setter function for boolean which represents if the input element is autofilled and viewable.
4516
4517         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
4518         Adding setter and getter functions for the boolean which represents if the input element is autofilled
4519         and viewable.
4520
4521 2019-08-07  Chris Dumez  <cdumez@apple.com>
4522
4523         Add more threading assertions to ITP code
4524         https://bugs.webkit.org/show_bug.cgi?id=200505
4525
4526         Reviewed by Brent Fulgham.
4527
4528         Add more threading assertions to ITP code to help catch bugs and protect against future bad usage.
4529
4530         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
4531         (WebKit::ResourceLoadStatisticsMemoryStore::isEmpty const):
4532         (WebKit::ResourceLoadStatisticsMemoryStore::setPersistentStorage):
4533         (WebKit::ResourceLoadStatisticsMemoryStore::incrementRecordsDeletedCountForDomains):
4534         (WebKit::ResourceLoadStatisticsMemoryStore::classifyPrevalentResources):
4535         (WebKit::ResourceLoadStatisticsMemoryStore::syncStorageIfNeeded):
4536         (WebKit::ResourceLoadStatisticsMemoryStore::syncStorageImmediately):
4537         (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherDataForDomains):
4538         (WebKit::ResourceLoadStatisticsMemoryStore::ensurePrevalentResourcesForDebugMode):
4539         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
4540         (WebKit::ResourceLoadStatisticsStore::statisticsEpirationTime const):
4541         (WebKit::ResourceLoadStatisticsStore::mergeOperatingDates):
4542         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
4543         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccessForFrame):
4544         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
4545         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
4546         (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
4547         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
4548         (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading):
4549         (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading):
4550         (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect):
4551         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):