[WPE] Do not create a PlatformDisplay in the Service Worker process
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-03-05  Loïc Yhuel  <loic.yhuel@softathome.com>
2
3         [WPE] Do not create a PlatformDisplay in the Service Worker process
4         https://bugs.webkit.org/show_bug.cgi?id=194830
5
6         Reviewed by Žan Doberšek.
7
8         It avoids opening the Wayland socket in this WPEWebProcess, which might cause issues
9         depending on the platform, and allocates unneeded resources.
10
11         * Shared/WebProcessCreationParameters.cpp:
12         (WebKit::WebProcessCreationParameters::encode const):
13         (WebKit::WebProcessCreationParameters::decode):
14         * Shared/WebProcessCreationParameters.h: Add new isServiceWorkerProcess parameter.
15         * UIProcess/WebProcessPool.cpp:
16         (WebKit::WebProcessPool::initializeNewWebProcess): Set isServiceWorkerProcess parameter.
17         * UIProcess/glib/WebProcessPoolGLib.cpp:
18         (WebKit::WebProcessPool::platformInitializeWebProcess): No implementationLibraryName and hostClientFileDescriptor for Service Worker.
19         * WebProcess/glib/WebProcessGLib.cpp:
20         (WebKit::WebProcess::platformInitializeWebProcess): No wpe_loader_init nor PlatformDisplayLibWPE for Service Worker.
21
22 2019-03-04  Brady Eidson  <beidson@apple.com>
23
24         Unreviewed, rolling out r242376.
25
26         Broke some tests
27
28         Reverted changeset:
29
30         "Correctly handle sandbox extensions when the same WKWebView
31         loads multiple file:// URLs."
32         https://bugs.webkit.org/show_bug.cgi?id=195291
33         https://trac.webkit.org/changeset/242376
34
35 2019-03-04  Fujii Hironori  <Hironori.Fujii@sony.com>
36
37         Use a SQLite database to hold the ResourceLoadStatistics data
38         https://bugs.webkit.org/show_bug.cgi?id=194867
39         <rdar://problem/24240854>
40
41         Unreviewed build fix for WinCairo.
42
43         ResourceLoadStatisticsDebug and RELEASE_LOG_INFO_IF are not
44         defined because WinCairo port defines RELEASE_LOG_DISABLED.
45
46         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
47         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess): Enclosed RELEASE_LOG_INFO_IF with #if !RELEASE_LOG_DISABLED.
48         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener): Ditto.
49         (WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlocking): Ditto.
50
51 2019-03-04  Brent Fulgham  <bfulgham@apple.com>
52
53         Use a SQLite database to hold the ResourceLoadStatistics data
54         https://bugs.webkit.org/show_bug.cgi?id=194867
55         <rdar://problem/24240854>
56
57         Reviewed by Chris Dumez.
58
59         The ResourceLoadStatistics database plist is inefficient. It requires more memory use
60         than it needs, and forces lots of looping and string comparisons to find information.
61
62         This problem has already been solved in the form of relational databases. We use them
63         elsewhere in WebKit, and should do so for this storage as well.
64
65         This patch creates an optional SQLite database to handle ITP operations.
66
67         1. It adds a new internal experimental feature flag to activate it. It requires the user
68            exit and restart the process to take effect.
69         2. It populates itself from the existing plist file (if it exists).
70         3. It stops using the plist in favor of the database.
71         4. It does queries and other operations using the database instead of the old hash table
72            implementation.
73
74         This patch refactors the exisiting ResourceLoadStatisticsMemoryStore class into a base
75         ResourceLoadStatisticsStore class, which ResourceLoadStatisticsMemoryStore is based on.
76         It adds a new ResourceLoadStatisticsDatabaseStore that is implemented in terms of SQL
77         operations.
78
79         These code changes should not have any impact on existing operations, and when enabled
80         should produce the same test results.
81
82         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: Added.
83         (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
84         (WebKit::ResourceLoadStatisticsDatabaseStore::createSchema):
85         (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
86         (WebKit::ResourceLoadStatisticsDatabaseStore::insertObservedDomain):
87         (WebKit::ResourceLoadStatisticsDatabaseStore::relationshipExists const):
88         (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationship):
89         (WebKit::ResourceLoadStatisticsDatabaseStore::confirmDomainDoesNotExist const):
90         (WebKit::ResourceLoadStatisticsDatabaseStore::domainIDFromString const):
91         (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships):
92         (WebKit::ResourceLoadStatisticsDatabaseStore::databaseIsEmpty const):
93         (WebKit::ResourceLoadStatisticsDatabaseStore::populateFromMemoryStore):
94         (WebKit::ResourceLoadStatisticsDatabaseStore::calculateAndSubmitTelemetry const):
95         (WebKit::ResourceLoadStatisticsDatabaseStore::incrementRecordsDeletedCountForDomains):
96         (WebKit::ResourceLoadStatisticsDatabaseStore::recursivelyFindNonPrevalentDomainsThatRedirectedToThisDomain):
97         (WebKit::buildList):
98         (WebKit::ResourceLoadStatisticsDatabaseStore::markAsPrevalentIfHasRedirectedToPrevalent):
99         (WebKit::listToString):
100         (WebKit::ResourceLoadStatisticsDatabaseStore::findNotVeryPrevalentResources):
101         (WebKit::ResourceLoadStatisticsDatabaseStore::reclassifyResources):
102         (WebKit::ResourceLoadStatisticsDatabaseStore::classifyPrevalentResources):
103         (WebKit::ResourceLoadStatisticsDatabaseStore::syncStorageIfNeeded):
104         (WebKit::ResourceLoadStatisticsDatabaseStore::syncStorageImmediately):
105         (WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess):
106         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
107         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener):
108         (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccess):
109         (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccessInternal):
110         (WebKit::ResourceLoadStatisticsDatabaseStore::grandfatherDataForDomains):
111         (WebKit::ResourceLoadStatisticsDatabaseStore::ensurePrevalentResourcesForDebugMode):
112         (WebKit::ResourceLoadStatisticsDatabaseStore::logFrameNavigation):
113         (WebKit::ResourceLoadStatisticsDatabaseStore::logSubresourceLoading):
114         (WebKit::ResourceLoadStatisticsDatabaseStore::logSubresourceRedirect):
115         (WebKit::ResourceLoadStatisticsDatabaseStore::setUserInteraction):
116         (WebKit::ResourceLoadStatisticsDatabaseStore::logUserInteraction):
117         (WebKit::ResourceLoadStatisticsDatabaseStore::clearUserInteraction):
118         (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction):
119         (WebKit::ResourceLoadStatisticsDatabaseStore::setPrevalentResource):
120         (WebKit::ResourceLoadStatisticsDatabaseStore::setDomainsAsPrevalent):
121         (WebKit::ResourceLoadStatisticsDatabaseStore::dumpResourceLoadStatistics const):
122         (WebKit::ResourceLoadStatisticsDatabaseStore::predicateValueForDomain const):
123         (WebKit::ResourceLoadStatisticsDatabaseStore::isPrevalentResource const):
124         (WebKit::ResourceLoadStatisticsDatabaseStore::isVeryPrevalentResource const):
125         (WebKit::ResourceLoadStatisticsDatabaseStore::isRegisteredAsSubresourceUnder const):
126         (WebKit::ResourceLoadStatisticsDatabaseStore::isRegisteredAsSubFrameUnder const):
127         (WebKit::ResourceLoadStatisticsDatabaseStore::isRegisteredAsRedirectingTo const):
128         (WebKit::ResourceLoadStatisticsDatabaseStore::clearPrevalentResource):
129         (WebKit::ResourceLoadStatisticsDatabaseStore::setGrandfathered):
130         (WebKit::ResourceLoadStatisticsDatabaseStore::isGrandfathered const):
131         (WebKit::ResourceLoadStatisticsDatabaseStore::setSubframeUnderTopFrameOrigin):
132         (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUnderTopFrameOrigin):
133         (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUniqueRedirectTo):
134         (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUniqueRedirectFrom):
135         (WebKit::ResourceLoadStatisticsDatabaseStore::setTopFrameUniqueRedirectTo):
136         (WebKit::ResourceLoadStatisticsDatabaseStore::setTopFrameUniqueRedirectFrom):
137         (WebKit::ResourceLoadStatisticsDatabaseStore::ensureResourceStatisticsForPrimaryDomain):
138         (WebKit::ResourceLoadStatisticsDatabaseStore::clear):
139         (WebKit::ResourceLoadStatisticsDatabaseStore::cookieTreatmentForOrigin const):
140         (WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt):
141         (WebKit::ResourceLoadStatisticsDatabaseStore::domainsToBlock const):
142         (WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlocking):
143         (WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlockingForDomains):
144         (WebKit::ResourceLoadStatisticsDatabaseStore::clearBlockingStateForDomains):
145         (WebKit::ResourceLoadStatisticsDatabaseStore::processStatistics const):
146         (WebKit::ResourceLoadStatisticsDatabaseStore::prevalentDomains const):
147         (WebKit::ResourceLoadStatisticsDatabaseStore::findExpiredUserInteractions const):
148         (WebKit::ResourceLoadStatisticsDatabaseStore::clearExpiredUserInteractions):
149         (WebKit::ResourceLoadStatisticsDatabaseStore::clearGrandfathering):
150         (WebKit::ResourceLoadStatisticsDatabaseStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
151         (WebKit::ResourceLoadStatisticsDatabaseStore::pruneStatisticsIfNeeded):
152         (WebKit::ResourceLoadStatisticsDatabaseStore::updateLastSeen):
153         (WebKit::ResourceLoadStatisticsDatabaseStore::setLastSeen):
154         (WebKit::ResourceLoadStatisticsDatabaseStore::setVeryPrevalentResource):
155         (WebKit::ResourceLoadStatisticsDatabaseStore::removeAllStorageAccess):
156         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: Added.
157         (WebKit::ResourceLoadStatisticsDatabaseStore::isEmpty const):
158         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
159         (WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
160         (WebKit::ResourceLoadStatisticsMemoryStore::incrementRecordsDeletedCountForDomains):
161         (WebKit::ResourceLoadStatisticsMemoryStore::classifyPrevalentResources):
162         (WebKit::ResourceLoadStatisticsMemoryStore::syncStorageIfNeeded):
163         (WebKit::ResourceLoadStatisticsMemoryStore::syncStorageImmediately):
164         (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherDataForDomains):
165         (WebKit::domainsToString): Deleted.
166         (WebKit::OperatingDate::fromWallTime): Deleted.
167         (WebKit::OperatingDate::today): Deleted.
168         (WebKit::OperatingDate::secondsSinceEpoch const): Deleted.
169         (WebKit::OperatingDate::operator== const): Deleted.
170         (WebKit::OperatingDate::operator< const): Deleted.
171         (WebKit::OperatingDate::operator<= const): Deleted.
172         (WebKit::OperatingDate::OperatingDate): Deleted.
173         (WebKit::mergeOperatingDates): Deleted.
174         (WebKit::computeImportance): Deleted.
175         (WebKit::ResourceLoadStatisticsMemoryStore::~ResourceLoadStatisticsMemoryStore): Deleted.
176         (WebKit::ResourceLoadStatisticsMemoryStore::setNotifyPagesWhenDataRecordsWereScanned): Deleted.
177         (WebKit::ResourceLoadStatisticsMemoryStore::setShouldClassifyResourcesBeforeDataRecordsRemoval): Deleted.
178         (WebKit::ResourceLoadStatisticsMemoryStore::setShouldSubmitTelemetry): Deleted.
179         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords): Deleted.
180         (WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords): Deleted.
181         (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData): Deleted.
182         (WebKit::ResourceLoadStatisticsMemoryStore::setResourceLoadStatisticsDebugMode): Deleted.
183         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResourceForDebugMode): Deleted.
184         (WebKit::ResourceLoadStatisticsMemoryStore::scheduleStatisticsProcessingRequestIfNecessary): Deleted.
185         (WebKit::ResourceLoadStatisticsMemoryStore::cancelPendingStatisticsProcessingRequest): Deleted.
186         (WebKit::ResourceLoadStatisticsMemoryStore::setTimeToLiveUserInteraction): Deleted.
187         (WebKit::ResourceLoadStatisticsMemoryStore::setMinimumTimeBetweenDataRecordsRemoval): Deleted.
188         (WebKit::ResourceLoadStatisticsMemoryStore::setGrandfatheringTime): Deleted.
189         (WebKit::ResourceLoadStatisticsMemoryStore::setCacheMaxAgeCap): Deleted.
190         (WebKit::ResourceLoadStatisticsMemoryStore::updateCacheMaxAgeCap): Deleted.
191         (WebKit::ResourceLoadStatisticsMemoryStore::setAgeCapForClientSideCookies): Deleted.
192         (WebKit::ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap): Deleted.
193         (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveDataRecords const): Deleted.
194         (WebKit::ResourceLoadStatisticsMemoryStore::setDataRecordsBeingRemoved): Deleted.
195         (WebKit::debugLogDomainsInBatches): Deleted.
196         (WebKit::ResourceLoadStatisticsMemoryStore::includeTodayAsOperatingDateIfNecessary): Deleted.
197         (WebKit::ResourceLoadStatisticsMemoryStore::hasStatisticsExpired const): Deleted.
198         (WebKit::ResourceLoadStatisticsMemoryStore::setMaxStatisticsEntries): Deleted.
199         (WebKit::ResourceLoadStatisticsMemoryStore::setPruneEntriesDownTo): Deleted.
200         (WebKit::ResourceLoadStatisticsMemoryStore::resetParametersToDefaultValues): Deleted.
201         (WebKit::ResourceLoadStatisticsMemoryStore::logTestingEvent): Deleted.
202         (WebKit::ResourceLoadStatisticsMemoryStore::didCreateNetworkProcess): Deleted.
203         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
204         (WebKit::ResourceLoadStatisticsMemoryStore::data const):
205         (WebKit::ResourceLoadStatisticsMemoryStore::isDebugModeEnabled const): Deleted.
206         (WebKit::ResourceLoadStatisticsMemoryStore::store const): Deleted.
207         (WebKit::ResourceLoadStatisticsMemoryStore::setStorageAccessPromptsEnabled): Deleted.
208         (WebKit::ResourceLoadStatisticsMemoryStore::setDebugLogggingEnabled): Deleted.
209         (): Deleted.
210         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp: Added.
211         (WebKit::domainsToString):
212         (WebKit::OperatingDate::fromWallTime):
213         (WebKit::OperatingDate::today):
214         (WebKit::OperatingDate::secondsSinceEpoch const):
215         (WebKit::OperatingDate::operator== const):
216         (WebKit::OperatingDate::operator< const):
217         (WebKit::OperatingDate::operator<= const):
218         (WebKit::ResourceLoadStatisticsStore::ResourceLoadStatisticsStore):
219         (WebKit::ResourceLoadStatisticsStore::~ResourceLoadStatisticsStore):
220         (WebKit::ResourceLoadStatisticsStore::calculateAndSubmitTelemetry const):
221         (WebKit::ResourceLoadStatisticsStore::computeImportance):
222         (WebKit::ResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
223         (WebKit::ResourceLoadStatisticsStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
224         (WebKit::ResourceLoadStatisticsStore::setShouldSubmitTelemetry):
225         (WebKit::ResourceLoadStatisticsStore::removeDataRecords):
226         (WebKit::ResourceLoadStatisticsStore::processStatisticsAndDataRecords):
227         (WebKit::ResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
228         (WebKit::ResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
229         (WebKit::ResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
230         (WebKit::ResourceLoadStatisticsStore::scheduleStatisticsProcessingRequestIfNecessary):
231         (WebKit::ResourceLoadStatisticsStore::cancelPendingStatisticsProcessingRequest):
232         (WebKit::ResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
233         (WebKit::ResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
234         (WebKit::ResourceLoadStatisticsStore::setGrandfatheringTime):
235         (WebKit::ResourceLoadStatisticsStore::setCacheMaxAgeCap):
236         (WebKit::ResourceLoadStatisticsStore::updateCacheMaxAgeCap):
237         (WebKit::ResourceLoadStatisticsStore::setAgeCapForClientSideCookies):
238         (WebKit::ResourceLoadStatisticsStore::updateClientSideCookiesAgeCap):
239         (WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords const):
240         (WebKit::ResourceLoadStatisticsStore::setDataRecordsBeingRemoved):
241         (WebKit::ResourceLoadStatisticsStore::updateCookieBlockingForDomains):
242         (WebKit::ResourceLoadStatisticsStore::clearBlockingStateForDomains):
243         (WebKit::ResourceLoadStatisticsStore::processStatistics const):
244         (WebKit::ResourceLoadStatisticsStore::statisticsEpirationTime const):
245         (WebKit::ResourceLoadStatisticsStore::mergeOperatingDates):
246         (WebKit::ResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary):
247         (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired const):
248         (WebKit::ResourceLoadStatisticsStore::setMaxStatisticsEntries):
249         (WebKit::ResourceLoadStatisticsStore::setPruneEntriesDownTo):
250         (WebKit::ResourceLoadStatisticsStore::resetParametersToDefaultValues):
251         (WebKit::ResourceLoadStatisticsStore::logTestingEvent):
252         (WebKit::ResourceLoadStatisticsStore::removeAllStorageAccess):
253         (WebKit::ResourceLoadStatisticsStore::didCreateNetworkProcess):
254         (WebKit::ResourceLoadStatisticsStore::debugLogDomainsInBatches):
255         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: Copied from Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h.
256         (WebKit::OperatingDate::OperatingDate):
257         (WebKit::ResourceLoadStatisticsStore::isEmpty const):
258         (WebKit::ResourceLoadStatisticsStore::data const):
259         (WebKit::ResourceLoadStatisticsStore::isDebugModeEnabled const):
260         (WebKit::ResourceLoadStatisticsStore::store const):
261         (WebKit::ResourceLoadStatisticsStore::setStorageAccessPromptsEnabled):
262         (WebKit::ResourceLoadStatisticsStore::setDebugLogggingEnabled):
263         * NetworkProcess/Classifier/ResourceLoadStatisticsStoreCocoa.mm: Renamed from Source/WebKit/UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm.
264         (WebKit::ResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
265         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
266         (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
267         (WebKit::WebResourceLoadStatisticsStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
268         (WebKit::WebResourceLoadStatisticsStore::setShouldSubmitTelemetry):
269         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
270         (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
271         (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
272         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
273         (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
274         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
275         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
276         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
277         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
278         (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
279         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
280         (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading):
281         (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading):
282         (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect):
283         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
284         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
285         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
286         (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
287         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
288         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
289         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
290         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
291         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder):
292         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
293         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
294         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
295         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
296         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
297         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
298         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
299         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
300         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
301         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
302         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
303         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdate):
304         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdateForDomains):
305         (WebKit::WebResourceLoadStatisticsStore::scheduleClearBlockingStateForDomains):
306         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
307         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
308         (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
309         (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime):
310         (WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries):
311         (WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo):
312         (WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
313         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
314         * NetworkProcess/NetworkProcess.cpp:
315         (WebKit::NetworkProcess::initializeNetworkProcess):
316         * NetworkProcess/NetworkProcessCreationParameters.cpp:
317         (WebKit::NetworkProcessCreationParameters::encode const):
318         (WebKit::NetworkProcessCreationParameters::decode):
319         * NetworkProcess/NetworkProcessCreationParameters.h:
320         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
321         (WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
322         * Platform/classifier/ResourceLoadStatisticsClassifier.h:
323         * Shared/WebPreferences.yaml:
324         * Sources.txt:
325         * SourcesCocoa.txt:
326         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
327         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
328         * UIProcess/WebProcessPool.cpp:
329         * WebKit.xcodeproj/project.pbxproj:
330
331 2019-03-04  Zalan Bujtas  <zalan@apple.com>
332
333         [ContentChangeObserver] Introduce fixed duration content observation
334         https://bugs.webkit.org/show_bug.cgi?id=195295
335         <rdar://problem/48579913>
336
337         Reviewed by Simon Fraser.
338
339         * WebProcess/WebPage/ios/WebPageIOS.mm:
340         (WebKit::WebPage::handleSyntheticClick):
341
342 2019-03-04  Truitt Savell  <tsavell@apple.com>
343
344         Unreviewed, rolling out r242396.
345
346         Found issue to be unrelated. reverting my rollout.
347
348         Reverted changeset:
349
350         "Unreviewed, rolling out r242222."
351         https://bugs.webkit.org/show_bug.cgi?id=193683
352         https://trac.webkit.org/changeset/242396
353
354 2019-03-04  Jiewen Tan  <jiewen_tan@apple.com>
355
356         Unreviewed, a followup after r242336
357
358         * UIProcess/WebPageProxy.cpp:
359         (WebKit::WebPageProxy::webViewDidMoveToWindow):
360         Copy the list of observers before iterating it to avoid observers modifying the list.
361
362 2019-03-04  Truitt Savell  <tsavell@apple.com>
363
364         Unreviewed, rolling out r242222.
365
366         Broke internal debug testing
367
368         Reverted changeset:
369
370         "[iOS] Move calls to [UIKeyboard isInHardwareKeyboardMode] to
371         the UI process."
372         https://bugs.webkit.org/show_bug.cgi?id=193683
373         https://trac.webkit.org/changeset/242222
374
375 2019-03-04  Brent Fulgham  <bfulgham@apple.com>
376
377         Unreviewed build fix after r242378
378
379         * UIProcess/ios/EditableImageController.mm:
380         (WebKit::EditableImageController::associateWithAttachment):
381
382 2019-03-04  Brent Fulgham  <bfulgham@apple.com>
383
384         Check contextIDs when handling WebContent messages
385         https://bugs.webkit.org/show_bug.cgi?id=195289
386         <rdar://problem/48475870>
387
388         Reviewed by Alex Christensen.
389
390         The WebContent process is untrusted because it handles arbitrary markup and javascript from untrusted sources.
391         We should handle its messages with suspicion, and make sure the arguments are valid and usable before honoring them.
392
393         This patch hardens the message passing layer by performing MESSAGE_CHECK in places that had been overlooked.
394
395         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
396         (WebKit::PlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID):
397         (WebKit::PlaybackSessionManagerProxy::currentTimeChanged):
398         (WebKit::PlaybackSessionManagerProxy::bufferedTimeChanged):
399         (WebKit::PlaybackSessionManagerProxy::seekableRangesVectorChanged):
400         (WebKit::PlaybackSessionManagerProxy::canPlayFastReverseChanged):
401         (WebKit::PlaybackSessionManagerProxy::audioMediaSelectionOptionsChanged):
402         (WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionOptionsChanged):
403         (WebKit::PlaybackSessionManagerProxy::audioMediaSelectionIndexChanged):
404         (WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionIndexChanged):
405         (WebKit::PlaybackSessionManagerProxy::externalPlaybackPropertiesChanged):
406         (WebKit::PlaybackSessionManagerProxy::wirelessVideoPlaybackDisabledChanged):
407         (WebKit::PlaybackSessionManagerProxy::mutedChanged):
408         (WebKit::PlaybackSessionManagerProxy::volumeChanged):
409         (WebKit::PlaybackSessionManagerProxy::durationChanged):
410         (WebKit::PlaybackSessionManagerProxy::playbackStartedTimeChanged):
411         (WebKit::PlaybackSessionManagerProxy::rateChanged):
412         (WebKit::PlaybackSessionManagerProxy::pictureInPictureSupportedChanged):
413         (WebKit::PlaybackSessionManagerProxy::pictureInPictureActiveChanged):
414         (WebKit::PlaybackSessionManagerProxy::handleControlledElementIDResponse const):
415         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
416         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
417         (WebKit::UserMediaCaptureManagerProxy::startProducingData):
418         (WebKit::UserMediaCaptureManagerProxy::stopProducingData):
419         (WebKit::UserMediaCaptureManagerProxy::end):
420         (WebKit::UserMediaCaptureManagerProxy::capabilities):
421         (WebKit::UserMediaCaptureManagerProxy::setMuted):
422         (WebKit::UserMediaCaptureManagerProxy::applyConstraints):
423         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
424         (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
425         (WebKit::VideoFullscreenManagerProxy::setHasVideo):
426         (WebKit::VideoFullscreenManagerProxy::setVideoDimensions):
427         (WebKit::VideoFullscreenManagerProxy::enterFullscreen):
428         (WebKit::VideoFullscreenManagerProxy::exitFullscreen):
429         (WebKit::VideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode):
430         (WebKit::VideoFullscreenManagerProxy::setInlineRect):
431         (WebKit::VideoFullscreenManagerProxy::setHasVideoContentLayer):
432         (WebKit::VideoFullscreenManagerProxy::cleanupFullscreen):
433         (WebKit::VideoFullscreenManagerProxy::preparedToReturnToInline):
434         (WebKit::VideoFullscreenManagerProxy::preparedToExitFullscreen):
435         * UIProcess/ios/EditableImageController.mm:
436         (WebKit::EditableImageController::didCreateEditableImage):
437         (WebKit::EditableImageController::didDestroyEditableImage):
438         (WebKit::EditableImageController::associateWithAttachment):
439
440 2019-03-04  Alex Christensen  <achristensen@webkit.org>
441
442         Fix crashes when NetworkResourceLoader/NetworkLoadChecker are destroyed during HTTPS upgrade check
443         https://bugs.webkit.org/show_bug.cgi?id=195238
444         <rdar://problem/47598656>
445
446         Reviewed by Chris Dumez.
447
448         * NetworkProcess/NetworkLoadChecker.cpp:
449         (WebKit::NetworkLoadChecker::checkRequest):
450
451 2019-03-04  Brady Eidson  <beidson@apple.com>
452
453         Correctly handle sandbox extensions when the same WKWebView loads multiple file:// URLs.
454         <rdar://problem/47820581> and https://bugs.webkit.org/show_bug.cgi?id=195291
455
456         Reviewed by Andy Estes.
457
458         * WebProcess/WebPage/WebPage.cpp:
459         (WebKit::shouldReuseCommittedSandboxExtension): Only retain the previous sandbox extension if the file URL
460           we're currently loading is functionally equivalent to the previous one.
461
462 2019-03-04  Chris Dumez  <cdumez@apple.com>
463
464         Drop legacy userAgentForURL injected bundle SPI
465         https://bugs.webkit.org/show_bug.cgi?id=195222
466         <rdar://problem/46734147>
467
468         Reviewed by Darin Adler.
469
470         Drop legacy userAgentForURL injected bundle SPI. There are no longer any clients, and using
471         WebsitePolicies.customUserAgent is the way to go nowadays.
472
473         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
474         (API::InjectedBundle::PageLoaderClient::willDestroyFrame):
475         (API::InjectedBundle::PageLoaderClient::userAgentForURL const): Deleted.
476         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
477         * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
478         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
479         (setUpPageLoaderClient):
480         (userAgentForURL): Deleted.
481         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
482         (WebKit::InjectedBundlePageLoaderClient::userAgentForURL const): Deleted.
483         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
484         * WebProcess/WebPage/WebPage.cpp:
485         (WebKit::WebPage::userAgent const):
486
487 2019-03-04  Chris Dumez  <cdumez@apple.com>
488
489         Do not share WebProcesses between private and regular sessions
490         https://bugs.webkit.org/show_bug.cgi?id=195189
491         <rdar://problem/48421064>
492
493         Reviewed by Alex Christensen.
494
495         Do not share WebProcesses between private and regular sessions. There are some privacy concerns.
496         Also, some of the WebsiteDataStore informations are passed via WebProcessCreationParameters (e.g.
497         ApplicationCache path) and cannot be updated later.
498
499         There were 2 cases where this could happen and that are fixed in the patch:
500         - A process may be prewarmed with a given website data store and then later on used for a page
501           associated with a different data store. We now prevent this. While this is not necessary for
502           privacy reasons, it is still useful because our code currently does not support well uses
503           different sessions inside a single WebProcess, as mentioned above.
504         - The client can force a WebsiteDataStore swap when responding to the decidePolicyForNavigationAction,
505           via the WebsitePolicies. To address the issue, we now force a process swap whenever the client
506           makes such a change.
507
508         As a result, WebProcessProxy::websiteDataStore() now makes sense and is always correct. It can
509         also only contains pages whose WebPageProxy::websiteDataStore() returns the same store.
510
511         * UIProcess/API/C/WKContext.cpp:
512         (WKContextWarmInitialProcess):
513         * UIProcess/API/Cocoa/WKProcessPool.mm:
514         (-[WKProcessPool _warmInitialProcess]):
515         * UIProcess/ProvisionalPageProxy.cpp:
516         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
517         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
518         * UIProcess/WebPageProxy.cpp:
519         (WebKit::WebPageProxy::notifyProcessPoolToPrewarm):
520         (WebKit::WebPageProxy::reattachToWebProcess):
521         (WebKit::WebPageProxy::swapToWebProcess):
522         (WebKit::WebPageProxy::close):
523         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
524         (WebKit::WebPageProxy::commitProvisionalPage):
525         (WebKit::WebPageProxy::creationParameters):
526         * UIProcess/WebPageProxy.h:
527         (WebKit::WebPageProxy::websiteDataStore):
528         * UIProcess/WebProcessPool.cpp:
529         (WebKit::WebProcessPool::ensureNetworkProcess):
530         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
531         (WebKit::WebProcessPool::prewarmProcess):
532         (WebKit::WebProcessPool::createWebPage):
533         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
534         (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
535         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
536         (WebKit::WebProcessPool::processForNavigation):
537         (WebKit::WebProcessPool::processForNavigationInternal):
538         (WebKit::WebProcessPool::findReusableSuspendedPageProcess):
539         * UIProcess/WebProcessPool.h:
540         (WebKit::WebProcessPool::sendToOneProcess):
541         * UIProcess/WebProcessProxy.cpp:
542         (WebKit::WebProcessProxy::createWebPage):
543         (WebKit::WebProcessProxy::addExistingWebPage):
544         (WebKit::WebProcessProxy::removeWebPage):
545         * UIProcess/WebProcessProxy.h:
546
547 2019-03-04  Chris Dumez  <cdumez@apple.com>
548
549         [iOS] Improve our file picker
550         https://bugs.webkit.org/show_bug.cgi?id=195284
551         <rdar://problem/45655856>
552
553         Reviewed by Tim Horton and Wenson Hsieh.
554
555         Improve our file picker on iOS so that:
556         - Accepted file extensions specified in the HTML (e.g. <input type="file"> accept=".pdf">) are now
557           properly reflected in the file picker. Previously, we only we only supported MIME types in the
558           accept attribute that only Image / Video ones.
559         - If accepted types are specified in the HTML and not of them are Video or Image types, then bypass
560           the UIDocumentMenuViewController and show the file picker directly (as if the user had tapped on
561           "Browse..." on that menu). Other menu items such as "Take Photo or Video" and "Photo Library" do
562           not make sense if the page only accepts PDF files for example.
563
564         Things that we should do but are not fixed in this patch:
565         - Stop using UIDocumentMenuViewController entirely since it was deprecated in favor of using
566           UIDocumentPickerViewController directly.
567         - Add multiple selection support, which is supported both on the HTML side and in the
568           UIDocumentPickerViewController API.
569
570         * UIProcess/ios/forms/WKFileUploadPanel.mm:
571         (arrayContainsUTIThatConformsTo):
572         (-[WKFileUploadPanel dealloc]):
573         (-[WKFileUploadPanel presentWithParameters:resultListener:]):
574         (UTIsForMIMETypes):
575         (-[WKFileUploadPanel _mediaTypesForPickerSourceType:]):
576         (-[WKFileUploadPanel _cameraButtonLabelAllowingPhoto:allowingVideo:]):
577         (-[WKFileUploadPanel _showDocumentPickerMenu]):
578
579 2019-03-04  Alex Christensen  <achristensen@webkit.org>
580
581         REGRESSION: ( r240978-r240985 ) [ iOS Release ] Layout Test imported/w3c/web-platform-tests/xhr/send-redirect-post-upload.htm is crashing
582         https://bugs.webkit.org/show_bug.cgi?id=194523
583
584         Reviewed by Ryosuke Niwa.
585
586         Attempt to work around a CFNetwork bug in the timing of tearing down tasks with upload streams.
587         See rdar://problem/28233746.
588
589         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
590         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
591         (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
592         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
593         (-[WKNetworkSessionDelegate URLSession:task:needNewBodyStream:]):
594
595 2019-03-04  Carlos Garcia Campos  <cgarcia@igalia.com>
596
597         [CoordinatedGraphics] The compositing loop is still running even after exiting AC mode
598         https://bugs.webkit.org/show_bug.cgi?id=195270
599
600         Reviewed by Don Olmstead.
601
602         Suspend the threaded compositor when the painting is paused or layer flush disabled, and resume it again when
603         painting is resumed and layer flush enabled.
604
605         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
606         (WebKit::ThreadedCompositor::suspend): Increment the suspend counter and mark the scene as inactive if it was suspended.
607         (WebKit::ThreadedCompositor::resume): Decrement the suspend counter and mark the scene as active if it's now resumed.
608         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
609         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
610         (WebKit::DrawingAreaCoordinatedGraphics::forceRepaint): Return early if layer tree state is frozen.
611         (WebKit::DrawingAreaCoordinatedGraphics::forceRepaintAsync): Ditto.
612         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
613         (WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled): Call ThreadedCompositor::suspend()/resume().
614         (WebKit::LayerTreeHost::pauseRendering): Call ThreadedCompositor::suspend.
615         (WebKit::LayerTreeHost::resumeRendering): Call ThreadedCompositor::resume().
616
617 2019-03-04  Simon Fraser  <simon.fraser@apple.com>
618
619         Share more code between overflow and frame scrolling nodes, fixing overflow scrollbar display
620         https://bugs.webkit.org/show_bug.cgi?id=195258
621
622         Reviewed by Antti Koivisto.
623
624         This patch moves management of scrollbar layers and scrollbar painters ("NSScrollerImp") down to
625         ScrollingStateScrollingNode to be shared between frame and overflow nodes, allowing for
626         scrolling thread updates of overflow scrollbars. It also moves some scrolling tree-side code
627         to ScrollingTreeScrollingNodeDelegateMac to be shared between the "tree" nodes for overflow and frames.
628
629         Layers for scrollbars are given to scrolling state nodes via setNodeLayers() now, and
630         RenderLayerCompositor::updateScrollingNodeLayers() is added to provide a bottleneck to call that.
631         At some point AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() should be relieved
632         of the responsibility of pushing scrollbar layers (but the scrolling state tree needs to hold
633         references to GraphicsLayers before that becomes safe).
634         
635         The actual fix that allows overflow scrollbars to show is the change in
636         AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() that calls scrollableArea.*ScrollbarLayerDidChange()
637         for all ScrollableAreas. This ensures that the CALayer is pushed onto the NSScrollerImp.
638
639         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
640         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
641         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
642         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
643         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
644         * SourcesCocoa.txt:
645         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
646         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
647         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
648         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
649         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
650         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::commitStateBeforeChildren):
651         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::repositionRelatedLayers):
652         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleMouseEvent):
653         * UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.cpp: Copied from Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp.
654         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::create):
655         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::ScrollingTreeOverflowScrollingNodeRemoteMac):
656         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::~ScrollingTreeOverflowScrollingNodeRemoteMac):
657         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::commitStateBeforeChildren):
658         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::repositionRelatedLayers):
659         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::handleWheelEvent):
660         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::handleMouseEvent):
661         * WebKit.xcodeproj/project.pbxproj:
662
663 2019-03-04  Andy Estes  <aestes@apple.com>
664
665         [Apple Pay] Move WebPaymentCoordinatorProxy from Source/WebKit/UIProcess to Source/WebKit/Shared
666         https://bugs.webkit.org/show_bug.cgi?id=195080
667         <rdar://problem/48421558>
668
669         Reviewed by Antti Koivisto.
670
671         * CMakeLists.txt:
672         * DerivedSources-input.xcfilelist:
673         * DerivedSources.make:
674         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp.
675         * Shared/ApplePay/WebPaymentCoordinatorProxy.h: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h.
676         * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in.
677         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: Renamed from Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h.
678         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: Renamed from Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm.
679         * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: Renamed from Source/WebKit/UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm.
680         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: Renamed from Source/WebKit/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm.
681         * Shared/mac/WebHitTestResultData.mm:
682         * SourcesCocoa.txt:
683         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
684         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
685         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
686         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
687         * WebKit.xcodeproj/project.pbxproj:
688
689 2019-03-04  Jer Noble  <jer.noble@apple.com>
690
691         [iOS] Fullscreen "stay in page" option breaks video playback
692         https://bugs.webkit.org/show_bug.cgi?id=195277
693         <rdar://problem/48537317>
694
695         Reviewed by Eric Carlson.
696
697         Make sure we resume media playback when the user chooses "stay in page" from the deceptive
698         website warning dialog.
699
700         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
701         (-[WKFullScreenViewController _showPhishingAlert]):
702
703 2019-03-04  Michael Catanzaro  <mcatanzaro@igalia.com>
704
705         [WPE] Enable web process sandbox
706         https://bugs.webkit.org/show_bug.cgi?id=195169
707
708         Reviewed by Daniel Bates.
709
710         * PlatformWPE.cmake:
711         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
712         (WebKit::bubblewrapSpawn):
713         * UIProcess/glib/WebProcessPoolGLib.cpp:
714         (WebKit::WebProcessPool::platformInitialize):
715
716 2019-03-04  Adrian Perez de Castro  <aperez@igalia.com>
717
718         [GTK][WPE] Wrong license header in WebKit{,WebExtension}Autocleanups.h
719         https://bugs.webkit.org/show_bug.cgi?id=195245
720
721         Reviewed by Carlos Garcia Campos.
722
723         Changed license headers to contain the LGPL, which is the correct one for the GTK
724         and WPE ports. The change was agreed by the contributors to the files involved.
725
726         * UIProcess/API/gtk/WebKitAutocleanups.h:
727         * UIProcess/API/wpe/WebKitAutocleanups.h:
728         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionAutocleanups.h:
729         * WebProcess/InjectedBundle/API/wpe/WebKitWebExtensionAutocleanups.h:
730
731 2019-03-04  Commit Queue  <commit-queue@webkit.org>
732
733         Unreviewed, rolling out r242045.
734         https://bugs.webkit.org/show_bug.cgi?id=195273
735
736         WE not ready to enable PSON yet (Requested by KaL on #webkit).
737
738         Reverted changeset:
739
740         "[GTK] Enable PSON"
741         https://bugs.webkit.org/show_bug.cgi?id=194979
742         https://trac.webkit.org/changeset/242045
743
744 2019-03-04  Carlos Garcia Campos  <cgarcia@igalia.com>
745
746         [CoordinatedGraphics] Unify DrawingArea classes
747         https://bugs.webkit.org/show_bug.cgi?id=195167
748
749         Reviewed by Žan Doberšek.
750
751         Add DrawingAreaProxyCoordinatedGraphics and DrawingAreaCoordinatedGraphics.
752
753         * PlatformGTK.cmake:
754         * PlatformWPE.cmake:
755         * PlatformWin.cmake:
756         * Shared/DrawingAreaInfo.h:
757         * SourcesGTK.txt:
758         * SourcesWPE.txt:
759         * UIProcess/API/gtk/PageClientImpl.cpp:
760         (WebKit::PageClientImpl::createDrawingAreaProxy):
761         (WebKit::PageClientImpl::viewSize):
762         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
763         (webkitWebViewBaseRealize):
764         (webkitWebViewBaseUnrealize):
765         (webkitWebViewBaseDraw):
766         (webkitWebViewBaseSizeAllocate):
767         (webkitWebViewBaseDidRelaunchWebProcess):
768         (webkitWebViewBasePageClosed):
769         * UIProcess/API/wpe/PageClientImpl.cpp:
770         (WebKit::PageClientImpl::createDrawingAreaProxy):
771         * UIProcess/AcceleratedDrawingAreaProxy.cpp: Removed.
772         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp: Added.
773         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingAreaProxyCoordinatedGraphics):
774         (WebKit::DrawingAreaProxyCoordinatedGraphics::~DrawingAreaProxyCoordinatedGraphics):
775         (WebKit::DrawingAreaProxyCoordinatedGraphics::paint):
776         (WebKit::DrawingAreaProxyCoordinatedGraphics::sizeDidChange):
777         (WebKit::DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange):
778         (WebKit::DrawingAreaProxyCoordinatedGraphics::waitForBackingStoreUpdateOnNextPaint):
779         (WebKit::DrawingAreaProxyCoordinatedGraphics::setBackingStoreIsDiscardable):
780         (WebKit::DrawingAreaProxyCoordinatedGraphics::update):
781         (WebKit::DrawingAreaProxyCoordinatedGraphics::didUpdateBackingStoreState):
782         (WebKit::DrawingAreaProxyCoordinatedGraphics::enterAcceleratedCompositingMode):
783         (WebKit::DrawingAreaProxyCoordinatedGraphics::exitAcceleratedCompositingMode):
784         (WebKit::DrawingAreaProxyCoordinatedGraphics::updateAcceleratedCompositingMode):
785         (WebKit::DrawingAreaProxyCoordinatedGraphics::incorporateUpdate):
786         (WebKit::DrawingAreaProxyCoordinatedGraphics::alwaysUseCompositing const):
787         (WebKit::DrawingAreaProxyCoordinatedGraphics::backingStoreStateDidChange):
788         (WebKit::DrawingAreaProxyCoordinatedGraphics::sendUpdateBackingStoreState):
789         (WebKit::DrawingAreaProxyCoordinatedGraphics::waitForAndDispatchDidUpdateBackingStoreState):
790         (WebKit::DrawingAreaProxyCoordinatedGraphics::discardBackingStoreSoon):
791         (WebKit::DrawingAreaProxyCoordinatedGraphics::discardBackingStore):
792         (WebKit::DrawingAreaProxyCoordinatedGraphics::setNativeSurfaceHandleForCompositing):
793         (WebKit::DrawingAreaProxyCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing):
794         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::DrawingMonitor):
795         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::~DrawingMonitor):
796         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::webViewDrawCallback):
797         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::start):
798         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::stop):
799         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::didDraw):
800         (WebKit::DrawingAreaProxyCoordinatedGraphics::dispatchAfterEnsuringDrawing):
801         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h: Renamed from Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.h.
802         * UIProcess/DrawingAreaProxyImpl.cpp: Removed.
803         * UIProcess/DrawingAreaProxyImpl.h: Removed.
804         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
805         (WebKit::AcceleratedBackingStoreX11::update):
806         * UIProcess/win/PageClientImpl.cpp:
807         (WebKit::PageClientImpl::createDrawingAreaProxy):
808         * UIProcess/win/WebView.cpp:
809         (WebKit::WebView::paint):
810         * WebProcess/WebPage/AcceleratedDrawingArea.cpp: Removed.
811         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: Added.
812         (WebKit::DrawingAreaCoordinatedGraphics::DrawingAreaCoordinatedGraphics):
813         (WebKit::DrawingAreaCoordinatedGraphics::~DrawingAreaCoordinatedGraphics):
814         (WebKit::DrawingAreaCoordinatedGraphics::setNeedsDisplay):
815         (WebKit::DrawingAreaCoordinatedGraphics::setNeedsDisplayInRect):
816         (WebKit::DrawingAreaCoordinatedGraphics::scroll):
817         (WebKit::DrawingAreaCoordinatedGraphics::forceRepaint):
818         (WebKit::DrawingAreaCoordinatedGraphics::forceRepaintAsync):
819         (WebKit::DrawingAreaCoordinatedGraphics::setLayerTreeStateIsFrozen):
820         (WebKit::DrawingAreaCoordinatedGraphics::updatePreferences):
821         (WebKit::DrawingAreaCoordinatedGraphics::mainFrameContentSizeChanged):
822         (WebKit::DrawingAreaCoordinatedGraphics::deviceOrPageScaleFactorChanged):
823         (WebKit::DrawingAreaCoordinatedGraphics::didChangeViewportAttributes):
824         (WebKit::DrawingAreaCoordinatedGraphics::graphicsLayerFactory):
825         (WebKit::DrawingAreaCoordinatedGraphics::setRootCompositingLayer):
826         (WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush):
827         (WebKit::DrawingAreaCoordinatedGraphics::layerHostDidFlushLayers):
828         (WebKit::DrawingAreaCoordinatedGraphics::createDisplayRefreshMonitor):
829         (WebKit::DrawingAreaCoordinatedGraphics::setNativeSurfaceHandleForCompositing):
830         (WebKit::DrawingAreaCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing):
831         (WebKit::DrawingAreaCoordinatedGraphics::activityStateDidChange):
832         (WebKit::DrawingAreaCoordinatedGraphics::attachViewOverlayGraphicsLayer):
833         (WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState):
834         (WebKit::DrawingAreaCoordinatedGraphics::didUpdate):
835         (WebKit::DrawingAreaCoordinatedGraphics::sendDidUpdateBackingStoreState):
836         (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingModeSoon):
837         (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingModeNow):
838         (WebKit::DrawingAreaCoordinatedGraphics::discardPreviousLayerTreeHost):
839         (WebKit::DrawingAreaCoordinatedGraphics::suspendPainting):
840         (WebKit::DrawingAreaCoordinatedGraphics::resumePainting):
841         (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode):
842         (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingMode):
843         (WebKit::DrawingAreaCoordinatedGraphics::scheduleDisplay):
844         (WebKit::DrawingAreaCoordinatedGraphics::displayTimerFired):
845         (WebKit::DrawingAreaCoordinatedGraphics::display):
846         (WebKit::shouldPaintBoundsRect):
847         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h: Renamed from Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.h.
848         * WebProcess/WebPage/DrawingArea.cpp:
849         (WebKit::DrawingArea::create):
850         * WebProcess/WebPage/DrawingArea.h:
851         (WebKit::DrawingArea::layerFlushThrottlingIsActive const):
852         * WebProcess/WebPage/DrawingAreaImpl.cpp: Removed.
853         * WebProcess/WebPage/DrawingAreaImpl.h: Removed.
854
855 2019-03-03  Zalan Bujtas  <zalan@apple.com>
856
857         [ContentChangeObserver] Content observation should be limited to the current document.
858         https://bugs.webkit.org/show_bug.cgi?id=195256
859         <rdar://problem/48544402>
860
861         Reviewed by Simon Fraser.
862
863         * WebProcess/WebPage/WebPage.h:
864         * WebProcess/WebPage/ios/WebPageIOS.mm:
865         (WebKit::WebPage::handleSyntheticClick):
866         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
867         (WebKit::WebPage::completeSyntheticClick):
868         (WebKit::WebPage::handleTap):
869         (WebKit::WebPage::handleTwoFingerTapAtPoint):
870         (WebKit::WebPage::commitPotentialTap):
871
872 2019-03-03  Tim Horton  <timothy_horton@apple.com>
873
874         Rid the world of WK_API_ENABLED
875         https://bugs.webkit.org/show_bug.cgi?id=195263
876
877         Reviewed by Dan Bernstein.
878
879         List of changed files elided because it's useless.
880
881 2019-03-03  Jiewen Tan  <jiewen_tan@apple.com>
882
883         Add a WebViewDidMoveToWindowObserver for WKWebView
884         https://bugs.webkit.org/show_bug.cgi?id=195223
885         <rdar://problem/48520161>
886
887         Reviewed by Darin Adler.
888
889         The load optimizer would only allow itself to optimize loads whenever the web view
890         who owns the page is (visible && focused), otherwises it will wait until the web view
891         becomes (visible && focused). Therefore, we need a way to notify the load optimizer
892         changes of statuses.
893
894         * UIProcess/API/Cocoa/WKWebView.mm:
895         (-[WKWebView didMoveToWindow]):
896         * UIProcess/Cocoa/WebViewImpl.mm:
897         (WebKit::WebViewImpl::viewDidMoveToWindow):
898         * UIProcess/WebPageProxy.cpp:
899         (WebKit::WebPageProxy::addWebViewDidMoveToWindowObserver):
900         (WebKit::WebPageProxy::removeWebViewDidMoveToWindowObserver):
901         (WebKit::WebPageProxy::webViewDidMoveToWindow):
902         * UIProcess/WebPageProxy.h:
903         * UIProcess/WebViewDidMoveToWindowObserver.h: Added.
904         * WebKit.xcodeproj/project.pbxproj:
905
906 2019-03-03  Andy Estes  <aestes@apple.com>
907
908         [Apple Pay] Untangle WebPageProxy and WebPaymentCoordinatorProxy
909         https://bugs.webkit.org/show_bug.cgi?id=195219
910         <rdar://problem/48518082>
911
912         Reviewed by Darin Adler.
913
914         Rather than having WebPaymentCoordinatorProxy know about WebPageProxy, give
915         WebPaymentCoordinatorProxy a client interface that WebPageProxy conforms to.
916
917         In a follow-on patch, WebPaymentCoordinatorProxy will have a non-WebPageProxy client.
918
919         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
920         (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Replaced use of
921         m_webPageProxy with m_client.
922         (WebKit::WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy): Ditto.
923         (WebKit::WebPaymentCoordinatorProxy::messageSenderConnection const): Implemented
924         IPC::MessageSender via m_client.
925         (WebKit::WebPaymentCoordinatorProxy::messageSenderDestinationID const): Ditto.
926         (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard): Replaced use of
927         m_webPageProxy with m_client.
928         (WebKit::WebPaymentCoordinatorProxy::openPaymentSetup): Ditto.
929         (WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession): Called our own
930         MessageSender::send rather than going through m_webPageProxy.
931         (WebKit::WebPaymentCoordinatorProxy::validateMerchant): Ditto.
932         (WebKit::WebPaymentCoordinatorProxy::didAuthorizePayment): Ditto.
933         (WebKit::WebPaymentCoordinatorProxy::didSelectShippingMethod): Ditto.
934         (WebKit::WebPaymentCoordinatorProxy::didSelectShippingContact): Ditto.
935         (WebKit::WebPaymentCoordinatorProxy::didSelectPaymentMethod): Ditto.
936         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Defined the Client abstract class and
937         changed m_webPageProxy to m_client.
938         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
939         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
940         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): Replaced use of
941         m_webPageProxy with m_client.
942         (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Renamed from toPKPaymentRequest.
943         (WebKit::toPKPaymentRequest): Renamed to WebPaymentCoordinatorProxy::platformPaymentRequest.
944         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
945         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Replaced use of m_webPageProxy
946         with m_client.
947         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
948         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Ditto.
949         * UIProcess/AuxiliaryProcessProxy.h:
950         (WebKit::AuxiliaryProcessProxy::messageReceiverMap): Added.
951         * UIProcess/WebPageProxy.cpp:
952         (WebKit::WebPageProxy::paymentCoordinatorConnection): Implemented WebPaymentCoordinatorProxy::Client.
953         (WebKit::WebPageProxy::paymentCoordinatorMessageReceiver): Ditto.
954         (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationBundleIdentifier): Ditto.
955         (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationSecondaryIdentifier): Ditto.
956         (WebKit::WebPageProxy::paymentCoordinatorDestinationID): Ditto.
957         * UIProcess/WebPageProxy.h: Made WebPageProxy derive from WebPaymentCoordinatorProxy::Client.
958         * UIProcess/ios/WebPageProxyIOS.mm:
959         (WebKit::WebPageProxy::paymentCoordinatorPresentingViewController): Implemented WebPaymentCoordinatorProxy::Client.
960         (WebKit::WebPageProxy::paymentCoordinatorCTDataConnectionServiceType): Ditto.
961         * UIProcess/mac/WebPageProxyMac.mm:
962         (WebKit::WebPageProxy::paymentCoordinatorPresentingWindow): Ditto.
963         * WebKit.xcodeproj/project.pbxproj:
964
965 2019-03-03  Tim Horton  <timothy_horton@apple.com>
966
967         Remove some more unused 32-bit code
968         https://bugs.webkit.org/show_bug.cgi?id=195255
969
970         Reviewed by Darin Adler.
971
972         * Platform/Module.cpp:
973         (WebKit::Module::Module):
974         * Platform/Module.h:
975         * Platform/cf/ModuleCF.cpp:
976         (WebKit::Module::unload):
977         (WebKit::Module::bundleResourceMap): Deleted.
978         * PluginProcess/mac/PluginProcessMac.mm:
979         (WebKit::initializeShim):
980         (WebKit::PluginProcess::platformInitializeProcess):
981         (WebKit::shouldCallRealDebugger): Deleted.
982         (WebKit::isWindowActive): Deleted.
983         (WebKit::getCurrentEventButtonState): Deleted.
984         (WebKit::carbonWindowShown): Deleted.
985         (WebKit::carbonWindowHidden): Deleted.
986         (WebKit::openCFURLRef): Deleted.
987         (WebKit::isMallocTinyMemoryTag): Deleted.
988         (WebKit::shouldMapMemoryExecutable): Deleted.
989         * PluginProcess/mac/PluginProcessShim.h:
990         * PluginProcess/mac/PluginProcessShim.mm:
991         (WebKit::shimDebugger): Deleted.
992         (WebKit::shimGetCurrentEventButtonState): Deleted.
993         (WebKit::shimIsWindowActive): Deleted.
994         (WebKit::shimModalDialog): Deleted.
995         (WebKit::shimAlert): Deleted.
996         (WebKit::shimShowWindow): Deleted.
997         (WebKit::shimHideWindow): Deleted.
998         (WebKit::shimLSOpenCFURLRef): Deleted.
999         (WebKit::shimMachVMMap): Deleted.
1000         * Shared/API/Cocoa/WKFoundation.h:
1001         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
1002         (WebKit::XPCServiceMain):
1003         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
1004         (WebKit::NetscapePluginModule::tryLoad):
1005         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
1006         (WebKit::getPluginArchitecture):
1007         (WebKit::NetscapePluginModule::determineQuirks):
1008         * Shared/Plugins/PluginQuirks.h:
1009         * Shared/cf/ArgumentCodersCF.cpp:
1010         (IPC::sizeForNumberType):
1011         * Shared/mac/WebEventFactory.mm:
1012         (WebKit::mouseButtonForEvent):
1013         (WebKit::globalPointForEvent):
1014         (WebKit::pointForEvent):
1015         (WebKit::WebEventFactory::createWebMouseEvent):
1016         * UIProcess/API/C/mac/WKPagePrivateMac.h:
1017         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
1018         (WKPageLoadFileReturningNavigation):
1019         * UIProcess/Cocoa/WebViewImpl.mm:
1020         (WebKit::WebViewImpl::pressureChangeWithEvent):
1021         * UIProcess/Gamepad/cocoa/UIGamepadProviderCocoa.mm:
1022         (WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider):
1023         * UIProcess/mac/ServicesController.mm:
1024         (WebKit::ServicesController::ServicesController):
1025         * UIProcess/mac/WebContextMenuProxyMac.mm:
1026         (WebKit::WebContextMenuProxyMac::setupServicesMenu):
1027         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1028         (WebKit::NPN_GetValue):
1029         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1030         (WebKit::NetscapePlugin::NetscapePlugin):
1031         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
1032         (WebKit::NetscapePlugin::isWindowActive const): Deleted.
1033         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
1034         (WebKit::NetscapePlugin::setDrawingModel):
1035         (WebKit::NetscapePlugin::setEventModel):
1036         (WebKit::NetscapePlugin::platformPostInitialize):
1037         (WebKit::NetscapePlugin::platformDestroy):
1038         (WebKit::NetscapePlugin::platformGeometryDidChange):
1039         (WebKit::NetscapePlugin::platformPaint):
1040         (WebKit::NetscapePlugin::platformHandleMouseEvent):
1041         (WebKit::NetscapePlugin::platformHandleWheelEvent):
1042         (WebKit::NetscapePlugin::platformHandleMouseEnterEvent):
1043         (WebKit::NetscapePlugin::platformHandleMouseLeaveEvent):
1044         (WebKit::NetscapePlugin::platformHandleKeyboardEvent):
1045         (WebKit::NetscapePlugin::platformSetFocus):
1046         (WebKit::NetscapePlugin::windowFocusChanged):
1047         (WebKit::NetscapePlugin::windowAndViewFramesChanged):
1048         (WebKit::NetscapePlugin::sendComplexTextInput):
1049         (): Deleted.
1050         (WebKit::windowMap): Deleted.
1051         (WebKit::NetscapePlugin::netscapePluginFromWindow): Deleted.
1052         (WebKit::NetscapePlugin::windowRef const): Deleted.
1053         (WebKit::NetscapePlugin::updateFakeWindowBounds): Deleted.
1054         (WebKit::NetscapePlugin::buttonState): Deleted.
1055         (WebKit::initializeEventRecord): Deleted.
1056         (WebKit::anyMouseButtonIsDown): Deleted.
1057         (WebKit::rightMouseButtonIsDown): Deleted.
1058         (WebKit::modifiersForEvent): Deleted.
1059         (WebKit::convertStringToKeyCodes): Deleted.
1060         (WebKit::scriptCodeFromCurrentKeyboardInputSource): Deleted.
1061         (WebKit::NetscapePlugin::nullEventTimerFired): Deleted.
1062
1063 2019-03-02  Zalan Bujtas  <zalan@apple.com>
1064
1065         [ContentChangeObserver] Introduce ContentChangeObserver::MouseMovedScope
1066         https://bugs.webkit.org/show_bug.cgi?id=195252
1067         <rdar://problem/48539446>
1068
1069         Reviewed by Simon Fraser.
1070
1071         * WebProcess/WebPage/ios/WebPageIOS.mm:
1072         (WebKit::WebPage::handleSyntheticClick):
1073
1074 2019-03-02  Tim Horton  <timothy_horton@apple.com>
1075
1076         Move EditingRange <-> Range methods to EditingRange instead of WebPage
1077         https://bugs.webkit.org/show_bug.cgi?id=195201
1078
1079         Reviewed by Sam Weinig.
1080
1081         * Shared/EditingRange.h:
1082         * Shared/EditingRange.cpp:
1083         Also, modernize the coders.
1084
1085         * Sources.txt:
1086         * WebKit.xcodeproj/project.pbxproj:
1087         * WebProcess/WebPage/WebPage.cpp:
1088         (WebKit::WebPage::insertTextAsync):
1089         (WebKit::WebPage::getMarkedRangeAsync):
1090         (WebKit::WebPage::getSelectedRangeAsync):
1091         (WebKit::WebPage::characterIndexForPointAsync):
1092         (WebKit::WebPage::firstRectForCharacterRangeAsync):
1093         (WebKit::WebPage::setCompositionAsync):
1094         (WebKit::WebPage::rangeFromEditingRange): Deleted.
1095         * WebProcess/WebPage/mac/WebPageMac.mm:
1096         (WebKit::WebPage::insertDictatedTextAsync):
1097         (WebKit::WebPage::attributedSubstringForCharacterRangeAsync):
1098
1099 2019-03-02  Wenson Hsieh  <wenson_hsieh@apple.com>
1100
1101         [iOS] Programmatic paste access should be granted when copying and pasting within the same origin
1102         https://bugs.webkit.org/show_bug.cgi?id=195053
1103         <rdar://problem/48134710>
1104
1105         Reviewed by Ryosuke Niwa.
1106
1107         Add support for automatically granting programmatic pasteboard access when the pasteboard identifier of the
1108         document requesting programmatic paste matches the identifier in the custom pasteboard data blob in the
1109         UIPasteboard. To do this, we send the pasteboard identifier of the document requesting the DOM paste to the UI
1110         process, and check this against the pasteboard identifiers for each item on the platform pasteboard. If all
1111         items in the platform pasteboard match the given pasteboard identifier (since we don't support writing multiple
1112         pasteboard items via bindings, this should only be a single item), we skip showing the paste callout and
1113         immediately invoke the programmatic paste handler.
1114
1115         * Scripts/webkit/messages.py:
1116         * UIProcess/API/gtk/PageClientImpl.cpp:
1117         (WebKit::PageClientImpl::requestDOMPasteAccess):
1118         * UIProcess/API/gtk/PageClientImpl.h:
1119         * UIProcess/API/wpe/PageClientImpl.cpp:
1120         (WebKit::PageClientImpl::requestDOMPasteAccess):
1121         * UIProcess/API/wpe/PageClientImpl.h:
1122         * UIProcess/PageClient.h:
1123         * UIProcess/WebPageProxy.cpp:
1124         (WebKit::WebPageProxy::requestDOMPasteAccess):
1125         * UIProcess/WebPageProxy.h:
1126         * UIProcess/WebPageProxy.messages.in:
1127
1128         Add plumbing to deliver the pasteboard identifier to the client when requesting DOM paste.
1129
1130         * UIProcess/ios/PageClientImplIOS.h:
1131         * UIProcess/ios/PageClientImplIOS.mm:
1132         (WebKit::PageClientImpl::requestDOMPasteAccess):
1133         * UIProcess/ios/WKContentViewInteraction.h:
1134         * UIProcess/ios/WKContentViewInteraction.mm:
1135         (-[WKContentView cleanupInteraction]):
1136         (-[WKContentView resignFirstResponderForWebView]):
1137         (-[WKContentView _webTouchEventsRecognized:]):
1138         (-[WKContentView _willHideMenu:]):
1139         (-[WKContentView pasteForWebView:]):
1140         (-[WKContentView _handleDOMPasteRequestWithResult:]):
1141         (-[WKContentView _willPerformAction:sender:]):
1142         (-[WKContentView _didPerformAction:sender:]):
1143         (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
1144         (allPasteboardItemOriginsMatchOrigin):
1145         (-[WKContentView _requestDOMPasteAccessWithElementRect:originIdentifier:completionHandler:]):
1146         (-[WKContentView _requestDOMPasteAccessWithElementRect:completionHandler:]): Deleted.
1147
1148         Bail early in the case where all items' pasteboard identifiers (read via custom pasteboard data) match. When
1149         this happens, we only grant access for the current paste command, rather than granting access for the user
1150         gesture token.
1151
1152         * UIProcess/mac/PageClientImplMac.h:
1153         * UIProcess/win/PageClientImpl.cpp:
1154         (WebKit::PageClientImpl::requestDOMPasteAccess):
1155         * UIProcess/win/PageClientImpl.h:
1156         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1157         (WebKit::WebEditorClient::requestDOMPasteAccess):
1158         * WebProcess/WebCoreSupport/WebEditorClient.h:
1159         * WebProcess/WebPage/WebPage.cpp:
1160         (WebKit::WebPage::requestDOMPasteAccess):
1161         * WebProcess/WebPage/WebPage.h:
1162
1163 2019-02-27  Darin Adler  <darin@apple.com>
1164
1165         Fixed makeString(float) to do shortest-form serialization without first converting to double
1166         https://bugs.webkit.org/show_bug.cgi?id=195142
1167
1168         Reviewed by Daniel Bates.
1169
1170         * UIProcess/PerActivityStateCPUUsageSampler.cpp: Removed unneeded include of DecimalNumber.h.
1171
1172 2019-03-02  Adrian Perez de Castro  <aperez@igalia.com>
1173
1174         [WPE] Public API headers are missing autocleanup definitions
1175         https://bugs.webkit.org/show_bug.cgi?id=195211
1176
1177         Reviewed by Philippe Normand.
1178
1179         * PlatformWPE.cmake: List new API headers as installable.
1180         * UIProcess/API/wpe/WebKitAutocleanups.h: Added. This is a copy of the header from the GTK
1181         port, adapted to fit the WPE port.
1182         * UIProcess/API/wpe/webkit.h: Add inclusion of WebKitAutocleanups.h
1183         * WebProcess/InjectedBundle/API/wpe/WebKitWebExtensionAutocleanups.h: Added. Also adapted
1184         from the equivalent header of the GTK port.
1185         * WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h: Add inclusion of
1186         WebKitWebExtensionAutocleanups.h
1187
1188 2019-03-02  Michael Catanzaro  <mcatanzaro@igalia.com>
1189
1190         Remove unused WebPageProxy::m_navigationID
1191         https://bugs.webkit.org/show_bug.cgi?id=195209
1192
1193         Reviewed by Darin Adler.
1194
1195         WebPageProxy::m_navigationID is never assigned to and is only used once by mistake in a
1196         debug LOG(). It must be a refactoring mistake.
1197
1198         * UIProcess/WebPageProxy.cpp:
1199         (WebKit::WebPageProxy::didCommitLoadForFrame):
1200         * UIProcess/WebPageProxy.h:
1201
1202 2019-03-01  Darin Adler  <darin@apple.com>
1203
1204         Finish removing String::format
1205         https://bugs.webkit.org/show_bug.cgi?id=194893
1206
1207         Reviewed by Daniel Bates.
1208
1209         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
1210         (WebKit::LocalAuthenticator::getAssertion): Use makeString, attempting to fix
1211         a problem where we passed an NSData * to format with a "%s"."
1212
1213 2019-03-01  Chris Dumez  <cdumez@apple.com>
1214
1215         Unreviewed Windows build fix after r242302.
1216
1217         * UIProcess/WebProcessPool.cpp:
1218         (WebKit::WebProcessPool::ensureNetworkProcess):
1219
1220 2019-03-01  Alex Christensen  <achristensen@webkit.org>
1221
1222         NetworkDataTask redirection should not keep alive its NetworkSession
1223         https://bugs.webkit.org/show_bug.cgi?id=194927
1224
1225         Reviewed by Darin Adler.
1226
1227         This should fix rdar://problem/47580502
1228
1229         * NetworkProcess/NetworkDataTask.h:
1230         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1231         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
1232
1233 2019-03-01  Alex Christensen  <achristensen@webkit.org>
1234
1235         Revert r241223, r241235, and r241287
1236         https://bugs.webkit.org/show_bug.cgi?id=194427
1237         <rdar://48045861>
1238
1239         This caused crashes, and feature design has evolved away from needing the daemon in this form.
1240
1241         * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm:
1242         (WebKit::DaemonMain):
1243         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
1244         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
1245         (WebKit::XPCServiceEventHandler):
1246         (WebKit::XPCServiceMain):
1247         (WebKit::XPCEventHandler): Deleted.
1248         (WebKit::XPCInitializationHandler): Deleted.
1249         * UIProcess/API/APIProcessPoolConfiguration.h:
1250         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1251         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1252         (-[_WKProcessPoolConfiguration usesNetworkingDaemon]): Deleted.
1253         (-[_WKProcessPoolConfiguration setUsesNetworkingDaemon:]): Deleted.
1254         * UIProcess/AuxiliaryProcessProxy.cpp:
1255         (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
1256         * UIProcess/Launcher/ProcessLauncher.h:
1257         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1258         (WebKit::serviceName):
1259         (WebKit::ProcessLauncher::launchProcess):
1260         * UIProcess/Network/NetworkProcessProxy.cpp:
1261         (WebKit::NetworkProcessProxy::getLaunchOptions):
1262         * UIProcess/WebProcessPool.cpp:
1263         (WebKit::WebProcessPool::usesNetworkingDaemon const): Deleted.
1264         * UIProcess/WebProcessPool.h:
1265
1266 2019-03-01  Alex Christensen  <achristensen@webkit.org>
1267
1268         Add setters on WKWebsiteDataStore for sourceApplicationBundleIdentifier and sourceApplicationSecondaryIdentifier
1269         https://bugs.webkit.org/show_bug.cgi?id=195229
1270         <rdar://problem/48520362>
1271
1272         Reviewed by Chris Dumez.
1273
1274         Just like _setBoundInterfaceIdentifier, we need a way to set these properties after instantiation of a WKWebsiteDataStore,
1275         but we need to make sure we don't set it after the parameters have been copied to the NetworkProcess.
1276
1277         Functionality verified by manual testing.  See radar.
1278         Added an API test that verifies the setter restrictions work as expected.
1279
1280         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1281         (-[WKWebsiteDataStore _sourceApplicationBundleIdentifier]):
1282         (-[WKWebsiteDataStore _setSourceApplicationBundleIdentifier:]):
1283         (-[WKWebsiteDataStore _sourceApplicationSecondaryIdentifier]):
1284         (-[WKWebsiteDataStore _setSourceApplicationSecondaryIdentifier:]):
1285         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1286         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1287         (WebKit::toPKPaymentRequest):
1288         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1289         (WebKit::WebsiteDataStore::parameters):
1290         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1291         (WebKit::WebsiteDataStore::WebsiteDataStore):
1292         (WebKit::WebsiteDataStore::setSourceApplicationSecondaryIdentifier):
1293         (WebKit::WebsiteDataStore::setSourceApplicationBundleIdentifier):
1294         * UIProcess/WebsiteData/WebsiteDataStore.h:
1295         (WebKit::WebsiteDataStore::sourceApplicationBundleIdentifier):
1296         (WebKit::WebsiteDataStore::sourceApplicationSecondaryIdentifier):
1297
1298 2019-03-01  Antoine Quint  <graouts@apple.com>
1299
1300         [iOS] Turn mouse event simulation on by default
1301         https://bugs.webkit.org/show_bug.cgi?id=195218
1302         <rdar://problem/48516794>
1303
1304         Reviewed by Dean Jackson.
1305
1306         * Shared/WebPreferences.yaml:
1307
1308 2019-03-01  Ross Kirsling  <ross.kirsling@sony.com>
1309
1310         EnvironmentUtilities::stripValuesEndingWithString isn't thread-safe
1311         https://bugs.webkit.org/show_bug.cgi?id=194612
1312
1313         Reviewed by Alex Christensen.
1314
1315         This API test really shouldn't be verifying that the actual environment was successfully modified.
1316
1317         At its core, stripValuesEndingWithString is really just split-filter-join. By replacing it with a pair of
1318         simple functions -- one for string processing, one for environment processing -- the API test only needs to
1319         worry about the former.
1320
1321         * Platform/unix/EnvironmentUtilities.cpp:
1322         (WebKit::EnvironmentUtilities::stripEntriesEndingWith):
1323         (WebKit::EnvironmentUtilities::removeValuesEndingWith):
1324         (WebKit::EnvironmentUtilities::stripValuesEndingWithString): Deleted.
1325         * Platform/unix/EnvironmentUtilities.h:
1326         Replace old function with a pair of simpler ones.
1327
1328         * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkServiceEntryPoint.mm:
1329         (NetworkServiceInitializer):
1330         * PluginProcess/EntryPoint/Cocoa/XPCService/PluginServiceEntryPoint.mm:
1331         (PluginServiceInitializer):
1332         * WebProcess/EntryPoint/Cocoa/XPCService/WebContentServiceEntryPoint.mm:
1333         (WebContentServiceInitializer):
1334         Update function name.
1335
1336 2019-03-01  Don Olmstead  <don.olmstead@sony.com>
1337
1338         Unify WebsiteDataStore::defaultDataStoreConfiguration across ports
1339         https://bugs.webkit.org/show_bug.cgi?id=194844
1340
1341         Reviewed by Youenn Fablet.
1342
1343         Move the Cocoa implementation into APIWebsiteDataStore.cpp as the source of truth and
1344         append configuration for Glib's DeviceIdHashSalts storage directory. This also fixes
1345         a crash in Windows when running a Service Worker.
1346
1347         * UIProcess/API/APIWebsiteDataStore.cpp:
1348         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
1349         (API::WebsiteDataStore::defaultDataStoreConfiguration):
1350         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
1351         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
1352         (API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
1353         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
1354         (API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
1355         * UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
1356         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
1357         (API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
1358
1359 2019-03-01  John Wilander  <wilander@apple.com>
1360
1361         Resource Load Statistics: Further restrict client-side cookie persistence after cross-site navigations with link decoration
1362         https://bugs.webkit.org/show_bug.cgi?id=195196
1363         <rdar://problem/48006419>
1364
1365         Reviewed by Brent Fulgham.
1366
1367         Trackers abuse link query parameters to transport user identifiers cross-site.
1368         This patch detects such navigations and applies further restrictions to
1369         client-site cookies on the destination page.
1370
1371         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1372         (WebKit::NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics):
1373         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage): Deleted.
1374             Renamed NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics().
1375         * NetworkProcess/NetworkConnectionToWebProcess.h:
1376         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1377         * NetworkProcess/NetworkProcess.cpp:
1378         (WebKit::NetworkProcess::committedCrossSiteLoadWithLinkDecoration):
1379             Reporting IPC message when a link decorated cross-site navigation happens.
1380         (WebKit::NetworkProcess::resetCrossSiteLoadsWithLinkDecorationForTesting):
1381         * NetworkProcess/NetworkProcess.h:
1382         * NetworkProcess/NetworkProcess.messages.in:
1383         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1384         (WKWebsiteDataStoreStatisticsResetToConsistentState):
1385             Added clearing of the new state between test runs.
1386         * UIProcess/Network/NetworkProcessProxy.cpp:
1387         (WebKit::NetworkProcessProxy::resetCrossSiteLoadsWithLinkDecorationForTesting):
1388             Test infrastructure.
1389         * UIProcess/Network/NetworkProcessProxy.h:
1390         * UIProcess/WebPageProxy.cpp:
1391         (WebKit::isNonUniqueNavigationWithLinkDecoration):
1392             Convenience function.
1393         (WebKit::WebPageProxy::didCommitLoadForFrame):
1394             This function now reports to the network process when a link decorated
1395             cross-site navigation happens.
1396         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1397         (WebKit::WebsiteDataStore::resetCrossSiteLoadsWithLinkDecorationForTesting):
1398             Test infrastructure.
1399         * UIProcess/WebsiteData/WebsiteDataStore.h:
1400         * WebProcess/WebPage/WebPage.cpp:
1401         (WebKit::WebPage::close):
1402             Name change of function called.
1403
1404 2019-03-01  Tim Horton  <timothy_horton@apple.com>
1405
1406         Remove unused code in WebKitLegacy
1407         https://bugs.webkit.org/show_bug.cgi?id=189614
1408
1409         Reviewed by Simon Fraser.
1410
1411         * mac/MigrateHeadersFromWebKitLegacy.make:
1412
1413 2019-03-01  Tim Horton  <timothy_horton@apple.com>
1414
1415         Modernize WebKit::AttributedString a little bit
1416         https://bugs.webkit.org/show_bug.cgi?id=195200
1417
1418         Reviewed by Wenson Hsieh.
1419
1420         * Shared/mac/AttributedString.h:
1421         (WebKit::AttributedString::AttributedString):
1422         (WebKit::AttributedString::operator NSAttributedString * const):
1423         * Shared/mac/AttributedString.mm:
1424         (IPC::ArgumentCoder<WebKit::AttributedString>::encode):
1425         (IPC::ArgumentCoder<WebKit::AttributedString>::decode):
1426         (WebKit::AttributedString::encode const): Deleted.
1427         (WebKit::AttributedString::decode): Deleted.
1428         * UIProcess/Cocoa/WebViewImpl.mm:
1429         (WebKit::WebViewImpl::attributedSubstringForProposedRange):
1430         * WebProcess/WebPage/mac/WebPageMac.mm:
1431         (WebKit::WebPage::attributedSubstringForCharacterRangeAsync):
1432         Modern coders, and a constructor and cast operator to/from NSAttributedString.
1433         Also adopt those in a few places just for fun.
1434
1435 2019-03-01  Youenn Fablet  <youenn@apple.com>
1436
1437         Serialize IndexedDB::ObjectStoreOverwriteMode as an enum
1438         https://bugs.webkit.org/show_bug.cgi?id=195213
1439
1440         Reviewed by Alex Christensen.
1441
1442         Make use of enum trait to automatically check for correct enum value when receiving a putOrAdd message.
1443
1444         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1445         (WebKit::WebIDBConnectionToClient::putOrAdd):
1446         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
1447         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
1448         * Scripts/webkit/messages.py:
1449         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1450         (WebKit::WebIDBConnectionToServer::putOrAdd):
1451
1452 2019-03-01  Don Olmstead  <don.olmstead@sony.com>
1453
1454         [WinCairo] Enable service worker
1455         https://bugs.webkit.org/show_bug.cgi?id=188318
1456
1457         Reviewed by Youenn Fablet.
1458
1459         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1460         (WebKit::WebSWContextManagerConnection::terminateProcess):
1461         * WebProcess/Storage/WebSWContextManagerConnection.h:
1462         * config.h:
1463
1464 2019-03-01  Chris Dumez  <cdumez@apple.com>
1465
1466         Flaky API Test TestWebKitAPI.ProcessSwap.LoadUnload
1467         https://bugs.webkit.org/show_bug.cgi?id=195110
1468
1469         Reviewed by Ryosuke Niwa.
1470
1471         The test was attempting to disable PageCache via view preferences instead of using the
1472         process pool configuration flag. This would fail to disable PageCache because the
1473         usesPageCache preference would not prevent the creation of SuspendedPageProxy objects.
1474         As a result, the firing on the unload event would get delayed until the SuspendedPageProxy
1475         objects would get destroyed, which would lead to flakiness.
1476
1477         This patch updates WebPageProxy::suspendCurrentPageIfPossible() to not create suspended
1478         pages proxies when the usesPageCache preference is set to false.
1479
1480         * UIProcess/WebPageProxy.cpp:
1481         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
1482
1483 2019-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1484
1485         [ThreadedCompositor] Simply the compositing run loop worker thread
1486         https://bugs.webkit.org/show_bug.cgi?id=195208
1487
1488         Reviewed by Don Olmstead.
1489
1490         We can remove the WorkQueuePool, since we never really supported more than one thread, and now that single
1491         process model non longer exists it doesn't even make sense. We can simply use a RunLoop instead of a WorkQueue
1492         so that the implementation is not specific to the generic WorkQueue implementation.
1493
1494         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
1495         (WebKit::createRunLoop): Helper function to create the RunLoop in a worker thread before m_updateTimer is initialized.
1496         (WebKit::CompositingRunLoop::CompositingRunLoop): Use createRunLoop().
1497         (WebKit::CompositingRunLoop::~CompositingRunLoop): Stop the worker thread run loop in the next main run loop iteration.
1498         (WebKit::CompositingRunLoop::performTask): Use m_runLoop.
1499         (WebKit::CompositingRunLoop::performTaskSync): Ditto.
1500         (WebKit::WorkQueuePool::singleton): Deleted.
1501         (WebKit::WorkQueuePool::dispatch): Deleted.
1502         (WebKit::WorkQueuePool::runLoop): Deleted.
1503         (WebKit::WorkQueuePool::invalidate): Deleted.
1504         (WebKit::WorkQueuePool::WorkQueuePool): Deleted.
1505         (WebKit::WorkQueuePool::getOrCreateWorkQueueForContext): Deleted.
1506         (): Deleted.
1507         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
1508
1509 2019-03-01  Justin Fan  <justin_fan@apple.com>
1510
1511         [Web GPU] 32-bit builds broken by attempt to disable WebGPU on 32-bit
1512         https://bugs.webkit.org/show_bug.cgi?id=195191
1513
1514         Rubber-stamped by Dean Jackson.
1515
1516         Dropping support for 32-bit entirely, so I'm intentionally leaving 32-bit broken.
1517
1518         * Configurations/FeatureDefines.xcconfig:
1519
1520 2019-02-28  Chris Dumez  <cdumez@apple.com>
1521
1522         HTTPSUpgradeList.db database should be opened in readonly mode
1523         https://bugs.webkit.org/show_bug.cgi?id=195194
1524         <rdar://problem/47103889>
1525
1526         Reviewed by Youenn Fablet.
1527
1528         HTTPSUpgradeList.db database should be opened in readonly mode since it is not meant to be
1529         modified by WebKit. Opening it in ReadWrite mode causes sandbox violations.
1530
1531         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
1532         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
1533
1534 2019-02-28  David Quesada  <david_quesada@apple.com>
1535
1536         Expose APINavigationAction.shouldPerformDownload() on WKNavigationAction
1537         https://bugs.webkit.org/show_bug.cgi?id=195121
1538         rdar://problem/48450302
1539
1540         Reviewed by Alex Christensen.
1541
1542         * UIProcess/API/Cocoa/WKNavigationAction.mm:
1543         (-[WKNavigationAction _shouldPerformDownload]):
1544         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
1545
1546 2019-02-28  Antoine Quint  <graouts@apple.com>
1547
1548         Disable Web Animations in Safari Technology Preview
1549         https://bugs.webkit.org/show_bug.cgi?id=194748
1550         <rdar://problem/48139481>
1551
1552         Reviewed by Dean Jackson.
1553
1554         The test runners already opt into that feature explicitly, so all that is needed is to turn
1555         the default setting value to false.
1556
1557         * Shared/WebPreferences.yaml:
1558
1559 2019-02-28  Antoine Quint  <graouts@apple.com>
1560
1561         Enable the Pointer Events runtime flag by default
1562         https://bugs.webkit.org/show_bug.cgi?id=195156
1563
1564         Reviewed by Dean Jackson.
1565
1566         * Shared/WebPreferences.yaml:
1567
1568 2019-02-28  Sihui Liu  <sihui_liu@apple.com>
1569
1570         Revert r232263: it caused processes to crash because process was suspended with locked file
1571         https://bugs.webkit.org/show_bug.cgi?id=195122
1572         <rdar://problem/48444599>
1573
1574         Reviewed by Geoffrey Garen.
1575
1576         * NetworkProcess/NetworkProcess.cpp:
1577         (WebKit::NetworkProcess::NetworkProcess):
1578         * NetworkProcess/NetworkProcess.h:
1579         * Shared/WebSQLiteDatabaseTracker.cpp:
1580         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
1581         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
1582         * Shared/WebSQLiteDatabaseTracker.h:
1583         * WebProcess/WebProcess.cpp:
1584         (WebKit::m_webSQLiteDatabaseTracker):
1585         (WebKit::m_nonVisibleProcessCleanupTimer): Deleted.
1586         * WebProcess/WebProcess.h:
1587
1588 2019-02-28  Per Arne Vollan  <pvollan@apple.com>
1589
1590         [iOS] Move calls to [UIKeyboard isInHardwareKeyboardMode] to the UI process.
1591         https://bugs.webkit.org/show_bug.cgi?id=193683
1592         <rdar://problem/47634345>
1593
1594         Reviewed by Brent Fulgham.
1595
1596         When a keyboard is attached/deattached or the application becomes foreground, send a message from
1597         the UI process to the WebContent process, notifying whether a keyboard is attached or not. Also,
1598         cache the value of [UIKeyboard isInHardwareKeyboardMode] in the UI process, since this call seems
1599         to be expensive.
1600
1601         * UIProcess/API/Cocoa/WKWebView.mm:
1602         (hardwareKeyboardAvailabilityChangedCallback):
1603         * UIProcess/WebPageProxy.h:
1604         * UIProcess/WebProcessProxy.h:
1605         (WebKit::WebProcessProxy::setKeyboardIsAttached):
1606         (WebKit::WebProcessProxy::keyboardIsAttached const):
1607         * UIProcess/ios/WKContentViewInteraction.mm:
1608         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1609         * UIProcess/ios/WebPageProxyIOS.mm:
1610         (WebKit::WebPageProxy::applicationWillEnterForeground):
1611         (WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged):
1612         * WebProcess/WebPage/WebPage.h:
1613         * WebProcess/WebPage/WebPage.messages.in:
1614         * WebProcess/WebPage/ios/WebPageIOS.mm:
1615         (WebKit::WebPage::platformEditorState const):
1616         (WebKit::WebPage::hardwareKeyboardAvailabilityChanged):
1617
1618 2019-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1619
1620         [CoordinatedGraphics] Remove COORDINATED_GRAPHICS_THREADED option
1621         https://bugs.webkit.org/show_bug.cgi?id=195159
1622
1623         Reviewed by Don Olmstead.
1624
1625         Use COORDINATED_GRAPHICS instead.
1626
1627         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1628         (WebKit::CoordinatedGraphicsScene::onNewBufferAvailable):
1629         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1630         * Shared/CoordinatedGraphics/SimpleViewportController.cpp:
1631         * Shared/CoordinatedGraphics/SimpleViewportController.h:
1632         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
1633         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
1634         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1635         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1636         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
1637         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h:
1638         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1639         (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged):
1640         (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
1641         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
1642         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:
1643         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1644         (WebKit::DrawingAreaImpl::updatePreferences):
1645         * WebProcess/WebPage/WebPage.cpp:
1646         (WebKit::WebPage::sendViewportAttributesChanged):
1647         (WebKit::WebPage::viewportPropertiesDidChange):
1648         * WebProcess/gtk/WebProcessMainGtk.cpp:
1649
1650 2019-02-28  Sihui Liu  <sihui_liu@apple.com>
1651
1652         Stop using legacy IDB path by default when creating WebProcessPool from websiteDataStore
1653         https://bugs.webkit.org/show_bug.cgi?id=194958
1654
1655         Reviewed by Geoffrey Garen.
1656
1657         ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration should not use fixed IDB path.
1658
1659         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1660         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
1661         * UIProcess/API/APIWebsiteDataStore.cpp:
1662         (API::WebsiteDataStore::createLegacy):
1663         (API::indexedDBDatabaseDirectory):
1664         * UIProcess/API/APIWebsiteDataStore.h:
1665         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1666         (-[WKWebsiteDataStore _indexedDBDatabaseDirectory]):
1667         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1668         * UIProcess/WebProcessPool.cpp:
1669         (WebKit::legacyWebsiteDataStoreConfiguration):
1670
1671 2019-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1672
1673         [CoordinatedGraphics] Unify all LayerTreeHost classes
1674         https://bugs.webkit.org/show_bug.cgi?id=195094
1675
1676         Reviewed by Žan Doberšek.
1677
1678         There's no reason to have 3 classes, since currently LayerTreeHost is only used by coordinated graphics based
1679         ports.
1680
1681         * PlatformWin.cmake:
1682         * SourcesGTK.txt:
1683         * SourcesWPE.txt:
1684         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1685         (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
1686         (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow):
1687         * WebProcess/WebPage/AcceleratedDrawingArea.h:
1688         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: Removed.
1689         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: Removed.
1690         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp.
1691         (WebKit::LayerTreeHost::LayerTreeHost):
1692         (WebKit::LayerTreeHost::~LayerTreeHost):
1693         (WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled):
1694         (WebKit::LayerTreeHost::scheduleLayerFlush):
1695         (WebKit::LayerTreeHost::cancelPendingLayerFlush):
1696         (WebKit::LayerTreeHost::layerFlushTimerFired):
1697         (WebKit::LayerTreeHost::setRootCompositingLayer):
1698         (WebKit::LayerTreeHost::setViewOverlayRootLayer):
1699         (WebKit::LayerTreeHost::invalidate):
1700         (WebKit::LayerTreeHost::scrollNonCompositedContents):
1701         (WebKit::LayerTreeHost::forceRepaint):
1702         (WebKit::LayerTreeHost::forceRepaintAsync):
1703         (WebKit::LayerTreeHost::sizeDidChange):
1704         (WebKit::LayerTreeHost::pauseRendering):
1705         (WebKit::LayerTreeHost::resumeRendering):
1706         (WebKit::LayerTreeHost::graphicsLayerFactory):
1707         (WebKit::LayerTreeHost::contentsSizeChanged):
1708         (WebKit::LayerTreeHost::didChangeViewportAttributes):
1709         (WebKit::LayerTreeHost::didChangeViewport):
1710         (WebKit::LayerTreeHost::setIsDiscardable):
1711         (WebKit::LayerTreeHost::setNativeSurfaceHandleForCompositing):
1712         (WebKit::LayerTreeHost::deviceOrPageScaleFactorChanged):
1713         (WebKit::LayerTreeHost::createDisplayRefreshMonitor):
1714         (WebKit::LayerTreeHost::didFlushRootLayer):
1715         (WebKit::LayerTreeHost::commitSceneState):
1716         (WebKit::LayerTreeHost::frameComplete):
1717         (WebKit::LayerTreeHost::nativeSurfaceHandleForCompositing):
1718         (WebKit::LayerTreeHost::didDestroyGLContext):
1719         (WebKit::LayerTreeHost::willRenderFrame):
1720         (WebKit::LayerTreeHost::didRenderFrame):
1721         (WebKit::LayerTreeHost::requestDisplayRefreshMonitorUpdate):
1722         (WebKit::LayerTreeHost::handleDisplayRefreshMonitorUpdate):
1723         (WebKit::LayerTreeHost::renderNextFrame):
1724         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h.
1725         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1726         (WebKit::DrawingAreaImpl::setNeedsDisplay):
1727         (WebKit::DrawingAreaImpl::setNeedsDisplayInRect):
1728         * WebProcess/WebPage/LayerTreeHost.cpp: Removed.
1729         * WebProcess/WebPage/LayerTreeHost.h: Removed.
1730         * WebPage/win/LayerTreeHost.h: Added.
1731
1732 2019-02-28  Justin Fan  <justin_fan@apple.com>
1733
1734         [Web GPU] Enable Web GPU only on 64-bit
1735         https://bugs.webkit.org/show_bug.cgi?id=195139
1736
1737         Because Metal is only supported on 64 bit apps.
1738
1739         Unreviewed build fix.
1740
1741         * Configurations/FeatureDefines.xcconfig:
1742
1743 2019-02-27  Simon Fraser  <simon.fraser@apple.com>
1744
1745         Roll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)
1746
1747         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
1748         (WebKit::LocalAuthenticator::getAssertion):
1749
1750 2019-02-27  Michael Catanzaro  <mcatanzaro@igalia.com>
1751
1752         Unreviewed, fix -Wformat warning
1753
1754         * WebProcess/WebPage/WebPage.cpp:
1755         (WebKit::WebPage::didCompletePageTransition):
1756
1757 2019-02-27  Brent Fulgham  <bfulgham@apple.com>
1758
1759         REGRESSION: Crash beneath ResourceLoadObserver::logSubresourceLoading
1760         https://bugs.webkit.org/show_bug.cgi?id=195072
1761
1762         Reviewed by Ryosuke Niwa.
1763
1764         ResourceLoadObserver and WebProcess should exist as long as the web page (process) is running. However,
1765         the NetworkProcess connection can close for a variety of reasons. If the ResourceLoadObserver observes
1766         a load or user gesture in the WebProcess, we should attempt to reconnect to the NetworkProcess (if it
1767         was disconnected), just like we do for other message send cases.
1768
1769         This patch switches from using the m_networkProcessConnection member (which might be null) to use the
1770         'ensureNetworkProcessConnection' accessor which ensures we have a valid connection for message sends.
1771
1772         * WebProcess/WebProcess.cpp:
1773         (WebKit::WebProcess::initializeWebProcess):
1774
1775 2019-02-27  Chris Dumez  <cdumez@apple.com>
1776
1777         Flaky API Test: TestWebKitAPI.ProcessSwap.SessionStorage
1778         https://bugs.webkit.org/show_bug.cgi?id=194480
1779
1780         Reviewed by Brady Eidson.
1781
1782         The StorageManager would only start listening for IPC on a given connection when
1783         StorageManager::processWillOpenConnection() is called. This gets called from
1784         WebsiteDataStore::webProcessWillOpenConnection() which gets called from
1785         WebProcessLifetimeTracker::webPageEnteringWebProcess().
1786
1787         webPageEnteringWebProcess() was called in WebPageProxy::finishAttachingToWebProcess()
1788         after process-swapping. This means that IPC comming from the *provisional* process
1789         would not get processed and we would only start processing IPC on the provisional
1790         process's connection when it would get committed.
1791
1792         To address the issue, this patch teaches WebProcessLifetimeTracker that a page can
1793         now have several processes. We also make sure that webPageEnteringWebProcess() gets
1794         called for the provisional process as soon as we create the provisional page, instead
1795         of waiting for it to get committed.
1796
1797         * UIProcess/ProvisionalPageProxy.cpp:
1798         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
1799         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
1800         (WebKit::ProvisionalPageProxy::connectionWillOpen):
1801         * UIProcess/ProvisionalPageProxy.h:
1802         * UIProcess/WebPageProxy.cpp:
1803         (WebKit::WebPageProxy::finishAttachingToWebProcess):
1804         (WebKit::WebPageProxy::connectionWillOpen):
1805         (WebKit::WebPageProxy::webProcessWillShutDown):
1806         (WebKit::WebPageProxy::processDidTerminate):
1807         * UIProcess/WebPageProxy.h:
1808         (WebKit::WebPageProxy::webProcessLifetimeTracker):
1809         * UIProcess/WebProcessLifetimeObserver.cpp:
1810         (WebKit::WebProcessLifetimeObserver::addWebPage):
1811         (WebKit::WebProcessLifetimeObserver::removeWebPage):
1812         * UIProcess/WebProcessLifetimeObserver.h:
1813         * UIProcess/WebProcessLifetimeTracker.cpp:
1814         (WebKit::WebProcessLifetimeTracker::addObserver):
1815         (WebKit::WebProcessLifetimeTracker::webPageEnteringWebProcess):
1816         (WebKit::WebProcessLifetimeTracker::webPageLeavingWebProcess):
1817         (WebKit::WebProcessLifetimeTracker::pageWasInvalidated):
1818         (WebKit::WebProcessLifetimeTracker::processIsRunning):
1819         * UIProcess/WebProcessLifetimeTracker.h:
1820         * UIProcess/WebProcessProxy.cpp:
1821         (WebKit::WebProcessProxy::connectionWillOpen):
1822         * UIProcess/WebStorage/StorageManager.cpp:
1823         (WebKit::StorageManager::SessionStorageNamespace::allowedConnections const):
1824         (WebKit::StorageManager::SessionStorageNamespace::addAllowedConnection):
1825         (WebKit::StorageManager::SessionStorageNamespace::removeAllowedConnection):
1826         (WebKit::StorageManager::addAllowedSessionStorageNamespaceConnection):
1827         (WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection):
1828         (WebKit::StorageManager::processWillOpenConnection):
1829         (WebKit::StorageManager::processDidCloseConnection):
1830         (WebKit::StorageManager::createSessionStorageMap):
1831         (WebKit::StorageManager::SessionStorageNamespace::allowedConnection const): Deleted.
1832         (WebKit::StorageManager::SessionStorageNamespace::setAllowedConnection): Deleted.
1833         (WebKit::StorageManager::setAllowedSessionStorageNamespaceConnection): Deleted.
1834         * UIProcess/WebStorage/StorageManager.h:
1835         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1836         (WebKit::WebsiteDataStore::webPageWillOpenConnection):
1837         (WebKit::WebsiteDataStore::webPageDidCloseConnection):
1838
1839 2019-02-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1840
1841         [iOS] Web pages shouldn't be able to present a keyboard after the web view resigns first responder
1842         https://bugs.webkit.org/show_bug.cgi?id=195118
1843         <rdar://problem/43411940>
1844
1845         Reviewed by Tim Horton.
1846
1847         It's currently possible for websites to redirect focus into an editable element on the page by programmatically
1848         requesting focus within the "blur" event handler. This is because our current heuristics:
1849
1850         (1) Allow programmatic focus to show the keyboard when an element is already focused; this is meant to handle
1851             the case where the page moves focus between different elements on the page.
1852         (2) And also allow programmatic focus to show the keyboard when changing activity state; this is meant to handle
1853             the case where a focused element should show the keyboard when first responder is restored on a web view
1854             (e.g. in the case where a modal view controller is dismissed, and the web view regains first responder once
1855             again).
1856
1857         In both of these scenarios, we actually only want the keyboard to appear if the web view itself is either
1858         becoming the first responder, or is already the first responder. Importantly, when blurring the focused element
1859         by calling -[WKWebViewe resignFirstResponder] (as is the case when dismissing the keyboard by tapping 'Done' or
1860         focusing other platform UI), we don't want to allow the page to show the keyboard due to element focus.
1861
1862         To fix this issue, we enforce that we're either becoming the first responder or already are the first responder
1863         before showing the keyboard due to activity state change or focused element change.
1864
1865         Test: fast/events/ios/do-not-show-keyboard-when-focusing-after-blur.html
1866
1867         * UIProcess/ios/WKContentViewInteraction.h:
1868         * UIProcess/ios/WKContentViewInteraction.mm:
1869         (-[WKContentView setupInteraction]):
1870         (-[WKContentView textInputTraits]):
1871
1872         Quick drive-by tweak: rename _isBlurringFocusedNode to _isBlurringFocusedElement, to match the rest of the
1873         terminology used in WebKit.
1874
1875         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
1876
1877         Make our heuristics for determining whether to show the keyboard a tiny bit easier to follow, by moving the
1878         logic into a lambda function and using early returns. See above for more details.
1879
1880         (-[WKContentView _elementDidBlur]):
1881         (-[WKContentView focusedFormControllerDidUpdateSuggestions:]):
1882
1883 2019-02-27  John Wilander  <wilander@apple.com>
1884
1885         Adopt WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics and WebKit::NetworkProcessProxy
1886         https://bugs.webkit.org/show_bug.cgi?id=195071
1887         <rdar://problem/48417690>
1888
1889         Reviewed by Alex Christensen and Brent Fulgham.
1890
1891         This patch adopts WebCore::RegistrableDomain in WebKit::NetworkProcessProxy
1892         and makes the necessary infrastructure changes to support that.
1893
1894         The previous HashCountedSets in WebCore::ResourceLoadStatistics are now just
1895         HashSets since we never used the counts for anything. This change simplified
1896         the IPC::ArgumentCoder<ResourceLoadStatistics> encode and decode functions.
1897
1898         The patch also makes WebCore::RegistrableDomain's String constructor private.
1899         A new create function WebCore::RegistrableDomain::uncheckedCreateFromString()
1900         is introduced to better signal to users that creating a registrable domain
1901         object with a string may create an object that doesn't match a registrable
1902         domain in a valid HTTP-family URL.
1903
1904         Finally, this patch harmonizes parameter and variable naming, going from
1905         "origin" to "domain" and "mainFrame" to "topFrame."
1906
1907         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
1908         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
1909         (WebKit::ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain const):
1910         (WebKit::ResourceLoadStatisticsMemoryStore::markAsPrevalentIfHasRedirectedToPrevalent):
1911         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
1912         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
1913         (WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
1914         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading):
1915         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect):
1916         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubresourceUnder const):
1917         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubFrameUnder const):
1918         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsRedirectingTo const):
1919         (WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameDomain):
1920         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameDomain):
1921         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectTo):
1922         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectFrom):
1923         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectTo):
1924         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectFrom):
1925         (WebKit::ResourceLoadStatisticsMemoryStore::createEncoderFromData const):
1926         (WebKit::ResourceLoadStatisticsMemoryStore::hasUserGrantedStorageAccessThroughPrompt):
1927         (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUnexpiredRecentUserInteraction const):
1928         (WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameOrigin): Deleted.
1929         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameOrigin): Deleted.
1930         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
1931         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1932         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
1933         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameDomain):
1934         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameDomain):
1935         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
1936         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): Deleted.
1937         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): Deleted.
1938         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1939         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
1940         (WebKit::sortedPrevalentResourceTelemetry):
1941         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1942         * NetworkProcess/NetworkProcess.cpp:
1943         (WebKit::NetworkProcess::setSubframeUnderTopFrameDomain):
1944         (WebKit::NetworkProcess::setSubresourceUnderTopFrameDomain):
1945         (WebKit::filterForRegistrableDomains):
1946         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
1947         (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
1948         (WebKit::NetworkProcess::setSubframeUnderTopFrameOrigin): Deleted.
1949         (WebKit::NetworkProcess::setSubresourceUnderTopFrameOrigin): Deleted.
1950         * NetworkProcess/NetworkProcess.h:
1951         * NetworkProcess/NetworkProcess.messages.in:
1952         * NetworkProcess/NetworkSession.cpp:
1953         (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
1954         * NetworkProcess/NetworkSession.h:
1955         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
1956         (WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
1957         * Shared/WebCoreArgumentCoders.cpp:
1958         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
1959         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
1960         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1961         (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
1962         (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
1963         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
1964         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
1965         * UIProcess/Network/NetworkProcessProxy.cpp:
1966         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
1967         (WebKit::NetworkProcessProxy::isPrevalentResource):
1968         (WebKit::NetworkProcessProxy::isVeryPrevalentResource):
1969         (WebKit::NetworkProcessProxy::setPrevalentResource):
1970         (WebKit::NetworkProcessProxy::setPrevalentResourceForDebugMode):
1971         (WebKit::NetworkProcessProxy::setVeryPrevalentResource):
1972         (WebKit::NetworkProcessProxy::setLastSeen):
1973         (WebKit::NetworkProcessProxy::clearPrevalentResource):
1974         (WebKit::NetworkProcessProxy::logUserInteraction):
1975         (WebKit::NetworkProcessProxy::hasHadUserInteraction):
1976         (WebKit::NetworkProcessProxy::clearUserInteraction):
1977         (WebKit::NetworkProcessProxy::setSubframeUnderTopFrameDomain):
1978         (WebKit::NetworkProcessProxy::isRegisteredAsRedirectingTo):
1979         (WebKit::NetworkProcessProxy::isRegisteredAsSubFrameUnder):
1980         (WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameDomain):
1981         (WebKit::NetworkProcessProxy::isRegisteredAsSubresourceUnder):
1982         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectTo):
1983         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectFrom):
1984         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectTo):
1985         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectFrom):
1986         (WebKit::NetworkProcessProxy::isGrandfathered):
1987         (WebKit::NetworkProcessProxy::setGrandfathered):
1988         (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
1989         (WebKit::NetworkProcessProxy::hasStorageAccess):
1990         (WebKit::NetworkProcessProxy::requestStorageAccess):
1991         (WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
1992         (WebKit::NetworkProcessProxy::grantStorageAccess):
1993         (WebKit::NetworkProcessProxy::setSubframeUnderTopFrameOrigin): Deleted.
1994         (WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameOrigin): Deleted.
1995         * UIProcess/Network/NetworkProcessProxy.h:
1996         * UIProcess/Network/NetworkProcessProxy.messages.in:
1997         * UIProcess/WebPageProxy.cpp:
1998         (WebKit::WebPageProxy::requestStorageAccessConfirm):
1999         * UIProcess/WebPageProxy.h:
2000         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2001         (WebKit::WebsiteDataStore::isPrevalentResource):
2002         (WebKit::WebsiteDataStore::setPrevalentResource):
2003         (WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
2004         (WebKit::WebsiteDataStore::isVeryPrevalentResource):
2005         (WebKit::WebsiteDataStore::setVeryPrevalentResource):
2006         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameDomain):
2007         (WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
2008         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameDomain):
2009         (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
2010         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
2011         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
2012         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
2013         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
2014         (WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
2015         (WebKit::WebsiteDataStore::clearPrevalentResource):
2016         (WebKit::WebsiteDataStore::setLastSeen):
2017         (WebKit::WebsiteDataStore::hasStorageAccess):
2018         (WebKit::WebsiteDataStore::requestStorageAccess):
2019         (WebKit::WebsiteDataStore::grantStorageAccess):
2020         (WebKit::WebsiteDataStore::logUserInteraction):
2021         (WebKit::WebsiteDataStore::hasHadUserInteraction):
2022         (WebKit::WebsiteDataStore::clearUserInteraction):
2023         (WebKit::WebsiteDataStore::setGrandfathered):
2024         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin): Deleted.
2025         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin): Deleted.
2026         * UIProcess/WebsiteData/WebsiteDataStore.h:
2027         * WebProcess/WebPage/WebPage.cpp:
2028         (WebKit::WebPage::hasStorageAccess):
2029         (WebKit::WebPage::requestStorageAccess):
2030
2031 2019-02-27  Keith Rollin  <krollin@apple.com>
2032
2033         Fix Xcode project UUIDs for TextCheckerCompletion.cpp and TextCheckerCompletion.h
2034         https://bugs.webkit.org/show_bug.cgi?id=195109
2035         <rdar://problem/48442272>
2036
2037         Reviewed by Alexey Proskuryakov.
2038
2039         In r144436, TextCheckerCompletion.cpp and TextCheckerCompletion.h were
2040         added to WebKit2.xcodeproj with invalid UUIDs (they included Q's and
2041         Z's in hexadecimal strings). While these UUIDs haven't caused any
2042         problems in practice over the last six years, they are indeed invalid,
2043         and were discovered via an Xcode-project processing tool that did not
2044         anticipate their format. Fix this by removing the files from the
2045         project and re-adding them.
2046
2047         * WebKit.xcodeproj/project.pbxproj:
2048
2049 2019-02-27  Youenn Fablet  <youenn@apple.com>
2050
2051         Remove UserMediaProcessManager processState map
2052         https://bugs.webkit.org/show_bug.cgi?id=195056
2053
2054         Reviewed by Eric Carlson.
2055
2056         Before the patch, the WebProcessProxy->ProcessState map was storing the list of manager proxies and process state.
2057         To improve on this model, this patch does the following:
2058         - Move the process state to WebProcessProxy.
2059         - Remove the map and replace it by a set of all manager proxies.
2060
2061         This simplifies the handling.
2062         On WebProcess side, instead of storing the sandbox extensions in each WebPage, we handle them in WebProcess directly.
2063         This mirrors what is being done in UIProcess and reduces the risk of inconsistencies between the two, the risk being that capture would fail.
2064
2065         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2066         (WebKit::UserMediaPermissionRequestManagerProxy::forEach):
2067         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
2068         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
2069         (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged):
2070         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2071         * UIProcess/UserMediaProcessManager.cpp:
2072         (WebKit::UserMediaProcessManager::muteCaptureMediaStreamsExceptIn):
2073         (WebKit::UserMediaProcessManager::willCreateMediaStream):
2074         (WebKit::UserMediaProcessManager::endedCaptureSession):
2075         (WebKit::UserMediaProcessManager::setCaptureEnabled):
2076         (WebKit::UserMediaProcessManager::captureDevicesChanged):
2077         (WebKit::ProcessState::ProcessState): Deleted.
2078         (WebKit::ProcessState::hasVideoExtension const): Deleted.
2079         (WebKit::ProcessState::grantVideoExtension): Deleted.
2080         (WebKit::ProcessState::revokeVideoExtension): Deleted.
2081         (WebKit::ProcessState::hasAudioExtension const): Deleted.
2082         (WebKit::ProcessState::grantAudioExtension): Deleted.
2083         (WebKit::ProcessState::revokeAudioExtension): Deleted.
2084         (WebKit::stateMap): Deleted.
2085         (WebKit::processState): Deleted.
2086         (WebKit::ProcessState::addRequestManager): Deleted.
2087         (WebKit::ProcessState::removeRequestManager): Deleted.
2088         (WebKit::UserMediaProcessManager::addUserMediaPermissionRequestManagerProxy): Deleted.
2089         (WebKit::UserMediaProcessManager::removeUserMediaPermissionRequestManagerProxy): Deleted.
2090         (WebKit::UserMediaProcessManager::startedCaptureSession): Deleted.
2091         * UIProcess/UserMediaProcessManager.h:
2092         * UIProcess/WebProcessProxy.h:
2093         (WebKit::WebProcessProxy::mediaCaptureSandboxExtensions const):
2094         (WebKit::WebProcessProxy::hasVideoCaptureExtension const):
2095         (WebKit::WebProcessProxy::grantVideoCaptureExtension):
2096         (WebKit::WebProcessProxy::revokeVideoCaptureExtension):
2097         (WebKit::WebProcessProxy::hasAudioCaptureExtension const):
2098         (WebKit::WebProcessProxy::grantAudioCaptureExtension):
2099         (WebKit::WebProcessProxy::revokeAudioCaptureExtension):
2100         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2101         (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Deleted.
2102         (WebKit::UserMediaPermissionRequestManager::clear): Deleted.
2103         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Deleted.
2104         (WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): Deleted.
2105         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
2106         * WebProcess/WebPage/WebPage.cpp:
2107         (WebKit::WebPage::close):
2108         (WebKit::WebPage::grantUserMediaDeviceSandboxExtensions): Deleted.
2109         (WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions): Deleted.
2110         * WebProcess/WebPage/WebPage.h:
2111         * WebProcess/WebPage/WebPage.messages.in:
2112         * WebProcess/WebProcess.cpp:
2113         (WebKit::WebProcess::grantUserMediaDeviceSandboxExtensions):
2114         (WebKit::WebProcess::revokeUserMediaDeviceSandboxExtensions):
2115         * WebProcess/WebProcess.h:
2116         * WebProcess/WebProcess.messages.in:
2117
2118 2019-02-27  Per Arne Vollan  <pvollan@apple.com>
2119
2120         [macOS] Disable permissive call logging in sandbox
2121         https://bugs.webkit.org/show_bug.cgi?id=194061
2122         <rdar://problem/47686253>
2123
2124         Reviewed by Brent Fulgham.
2125
2126         Strict call filtering should be reenabled.
2127
2128         * WebProcess/com.apple.WebProcess.sb.in:
2129
2130 2019-02-27  Chris Dumez  <cdumez@apple.com>
2131
2132         [HTTPSUpgrade] Use open source database until the feature is ready
2133         https://bugs.webkit.org/show_bug.cgi?id=195069
2134         <rdar://problem/47838224>
2135
2136         Reviewed by Geoffrey Garen.
2137
2138         * DerivedSources-input.xcfilelist:
2139         * DerivedSources.make:
2140
2141 2019-02-27  Antoine Quint  <graouts@apple.com>
2142
2143         Support Pointer Events on macOS
2144         https://bugs.webkit.org/show_bug.cgi?id=195008
2145         <rdar://problem/47454419>
2146
2147         Reviewed by Dean Jackson.
2148
2149         * Configurations/FeatureDefines.xcconfig:
2150
2151 2019-02-27  Sihui Liu  <sihui_liu@apple.com>
2152
2153         Network Process is put to suspended when holding locked IndexedDB files
2154         https://bugs.webkit.org/show_bug.cgi?id=195024
2155         <rdar://problem/45194169>
2156
2157         Reviewed by Geoffrey Garen.
2158
2159         * NetworkProcess/NetworkProcess.cpp:
2160         (WebKit::NetworkProcess::idbServer):
2161         (WebKit::NetworkProcess::notifyHoldingLockedFiles):
2162         * NetworkProcess/NetworkProcess.h:
2163         * UIProcess/Network/NetworkProcessProxy.cpp:
2164         (WebKit::NetworkProcessProxy::didClose):
2165         (WebKit::NetworkProcessProxy::setIsIDBDatabaseHoldingLockedFiles):
2166         * UIProcess/Network/NetworkProcessProxy.h:
2167         * UIProcess/Network/NetworkProcessProxy.messages.in:
2168
2169 2019-02-26  Simon Fraser  <simon.fraser@apple.com>
2170
2171         Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
2172         https://bugs.webkit.org/show_bug.cgi?id=194973
2173
2174         Reviewed by Antti Koivisto.
2175
2176         This patch cleans up how the scrolling tree responds to scrolls.
2177
2178         First, ScrollingTreeScrollingNode::m_currentScrollPosition is "truth" for scrolling thread/
2179         UI process scroll position.
2180
2181         On macOS where handleWheelEvent on the scrolling thread changes scroll position, the
2182         bottleneck is ScrollingTreeScrollingNode::scrollTo() which sets the new scroll position,
2183         update the visual viewport (for frame scrolls) updates the scrolledContentsLayer position,
2184         updates related layers on this node (counter-scrolling layers etc), and then tells the
2185         scrolling tree, which recurses through descendant nodes so they can adjust their layer
2186         positions.
2187
2188         On iOS, the bottleneck is ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling(),
2189         which does the above other than setting scrolledContentsLayer (since we're reacting to
2190         layer state changes, not producing them).
2191
2192         updateLayersAfterAncestorChange() is renamed to relatedNodeScrollPositionDidChange(), and
2193         ScrollingTree does the tree walk so classes don't have to implement
2194         updateLayersAfterAncestorChange() just to talk children. The ScrollingTree tree walk knows
2195         how to get the correct layoutViewport and to stop at frame boundaries (layer updates never
2196         need to cross frame boundaries).
2197
2198         We preserve 'cumulativeDelta'; it's necessary for things like fixed inside overflow:scroll,
2199         since the fixed state was computed with the "layout" scroll position, so we have to account
2200         for the scroll delta since the last committed position. It's possible we could improve this
2201         in future.
2202
2203         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2204         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2205         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
2206         (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
2207         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
2208         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
2209         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
2210         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
2211         * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
2212         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2213         (WebKit::RemoteScrollingCoordinatorProxy::currentLayoutViewport const):
2214         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
2215         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
2216         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
2217         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::repositionScrollingLayers):
2218         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::repositionRelatedLayers):
2219         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const): Deleted.
2220         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollPosition): Deleted.
2221         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition): Deleted.
2222         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll): Deleted.
2223         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll): Deleted.
2224         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange): Deleted.
2225         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange): Deleted.
2226         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2227         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2228         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::repositionScrollingLayers):
2229         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange): Deleted.
2230         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollPosition const): Deleted.
2231         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): Deleted.
2232         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterDelegatedScroll): Deleted.
2233         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
2234         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
2235         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::ScrollingTreeScrollingNodeDelegateIOS):
2236         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers):
2237         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll):
2238         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange): Deleted.
2239         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollPosition const): Deleted.
2240         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::setScrollLayerPosition): Deleted.
2241         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll): Deleted.
2242         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll const): Deleted.
2243         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm:
2244         (WebKit::ScrollerPairMac::updateValues):
2245         (WebKit::ScrollerPairMac::valuesForOrientation):
2246         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
2247         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::repositionRelatedLayers):
2248         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::setScrollLayerPosition): Deleted.
2249         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h:
2250         * UIProcess/ios/WKContentView.mm:
2251         (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2252
2253 2019-02-27  Alex Christensen  <achristensen@webkit.org>
2254
2255         Silence log after r242122
2256         https://bugs.webkit.org/show_bug.cgi?id=195074
2257
2258         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
2259         (WebKit::LocalStorageDatabaseTracker::databasePath const):
2260         m_localStorageDirectory can now be null for ephemeral sessions.
2261         This is not a failure to create a directory and needs no log.
2262         This fixes the WKWebView.InitializingWebViewWithEphemeralStorageDoesNotLog API test.
2263
2264 2019-02-27  Timothy Hatcher  <timothy@apple.com>
2265
2266         REGRESSION: WebKit content crash in Base System (because NSAppearance is NULL).
2267         https://bugs.webkit.org/show_bug.cgi?id=195086
2268         rdar://problem/48419124
2269
2270         Reviewed by Tim Horton.
2271
2272         * UIProcess/RemoteLayerTree/mac/ScrollerMac.mm:
2273         (-[WKScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Always return a valid NSAppearance.
2274
2275 2019-02-26  Chris Dumez  <cdumez@apple.com>
2276
2277         [PSON] Add mechanism to clear suspended pages while bypassing the WebProcess cache
2278         https://bugs.webkit.org/show_bug.cgi?id=195089
2279
2280         Reviewed by Geoffrey Garen.
2281
2282         Add a convenient mechanism to clear suspended pages while bypassing the WebProcess
2283         cache since we need to do this on memory pressure and when clearing website data.
2284
2285         * UIProcess/WebPageProxy.cpp:
2286         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2287         * UIProcess/WebProcessCache.cpp:
2288         (WebKit::WebProcessCache::addProcessIfPossible):
2289         (WebKit::WebProcessCache::addProcess):
2290         (WebKit::WebProcessCache::takeProcess):
2291         (WebKit::WebProcessCache::CachedProcess::~CachedProcess):
2292         * UIProcess/WebProcessCache.h:
2293         (WebKit::WebProcessCache::setIsDisabled): Deleted.
2294         * UIProcess/WebProcessPool.cpp:
2295         (WebKit::WebProcessPool::handleMemoryPressureWarning):
2296         (WebKit::WebProcessPool::hasSuspendedPageFor const):
2297         (WebKit::WebProcessPool::clearSuspendedPages):
2298         * UIProcess/WebProcessPool.h:
2299         * UIProcess/WebProcessProxy.cpp:
2300         (WebKit::WebProcessProxy::maybeShutDown):
2301         (WebKit::WebProcessProxy::canTerminateAuxiliaryProcess):
2302         * UIProcess/WebProcessProxy.h:
2303         (WebKit::WebProcessProxy::suspendedPageCount const):
2304         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2305         (WebKit::WebsiteDataStore::removeData):
2306
2307 2019-02-26  Alex Christensen  <achristensen@webkit.org>
2308
2309         Move ephemeral local storage from WebProcess to UIProcess
2310         https://bugs.webkit.org/show_bug.cgi?id=195074
2311         <rdar://problem/47937975>
2312
2313         Reviewed by Geoff Garen.
2314
2315         Before PSON, a page could navigate to another domain that navigates back and still have its local storage.
2316         Since PSON makes it unreliable to retain the state in the WebProcess, move it to the process with the rest of the local storage.
2317         If it's ephemeral, we obviously can't use the SQLite on-disk storage implementation, so use the same WebCore::StorageMap we used to in the WebProcess.
2318
2319         * UIProcess/WebStorage/StorageManager.cpp:
2320         (WebKit::StorageManager::LocalStorageNamespace::LocalStorageNamespace):
2321         (WebKit::StorageManager::StorageManager):
2322         (WebKit::StorageManager::createLocalStorageMap):
2323         (WebKit::StorageManager::createTransientLocalStorageMap):
2324         (WebKit::StorageManager::createSessionStorageMap):
2325         (WebKit::StorageManager::destroyStorageMap):
2326         (WebKit::StorageManager::getValues):
2327         (WebKit::StorageManager::setItem):
2328         (WebKit::StorageManager::removeItem):
2329         (WebKit::StorageManager::clear):
2330         * UIProcess/WebStorage/StorageManager.h:
2331         * UIProcess/WebStorage/StorageManager.messages.in:
2332         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2333         (WebKit::WebsiteDataStore::WebsiteDataStore):
2334         * WebProcess/WebStorage/StorageAreaMap.cpp:
2335         (WebKit::StorageAreaMap::StorageAreaMap):
2336         (WebKit::StorageAreaMap::setItem):
2337         (WebKit::StorageAreaMap::removeItem):
2338         (WebKit::StorageAreaMap::clear):
2339         (WebKit::StorageAreaMap::loadValuesIfNeeded):
2340         * WebProcess/WebStorage/StorageNamespaceImpl.cpp:
2341         (WebKit::StorageNamespaceImpl::createEphemeralLocalStorageNamespace):
2342         (WebKit::StorageNamespaceImpl::storageArea):
2343         (WebKit::StorageNamespaceImpl::copy):
2344         (): Deleted.
2345         (WebKit::StorageNamespaceImpl::ephemeralLocalStorageArea): Deleted.
2346         * WebProcess/WebStorage/StorageNamespaceImpl.h:
2347
2348 2019-02-20  Jer Noble  <jer.noble@apple.com>
2349
2350         [Cocoa] Media elements will restart network buffering just before suspending
2351         https://bugs.webkit.org/show_bug.cgi?id=193691
2352
2353         Reviewed by Eric Carlson.
2354
2355         When the WebProcess receives a notification that the process is about to become
2356         suspended, it tells the MemoryPressureHandler to release all critical memory. This
2357         has the side effect of causing AVFoundation-backed media elements to dump their
2358         in-memory caches and start downloading media data again. Instead, media elements
2359         should all stop buffering media data during suspension. Add new testing SPI to
2360         simulate suspension and resume messages.
2361
2362         * UIProcess/API/Cocoa/WKWebView.mm:
2363         (-[WKWebView _processWillSuspendImminentlyForTesting]):
2364         (-[WKWebView _processDidResumeForTesting]):
2365         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2366         * UIProcess/WebProcessProxy.h:
2367         * UIProcess/ios/WKInkPickerView.mm:
2368         * WebProcess/WebPage/WebPage.cpp:
2369         (WebKit::WebPage::suspendAllMediaBuffering):
2370         (WebKit::WebPage::resumeAllMediaBuffering):
2371         * WebProcess/WebPage/WebPage.h:
2372         * WebProcess/WebProcess.cpp:
2373         (WebKit::WebProcess::actualPrepareToSuspend):
2374         (WebKit::WebProcess::cancelPrepareToSuspend):
2375         (WebKit::WebProcess::processDidResume):
2376         (WebKit::WebProcess::suspendAllMediaBuffering):
2377         (WebKit::WebProcess::resumeAllMediaBuffering):
2378         * WebProcess/WebProcess.h:
2379
2380 2019-02-26  Youenn Fablet  <youenn@apple.com>
2381
2382         Move service worker response validation from the service worker client to the service worker itself
2383         https://bugs.webkit.org/show_bug.cgi?id=194716
2384
2385         Reviewed by Geoffrey Garen.
2386
2387         Removed response validation as it is now done in service worker side.
2388
2389         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2390         (WebKit::ServiceWorkerClientFetch::didReceiveRedirectResponse):
2391         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
2392
2393 2019-02-26  Zalan Bujtas  <zalan@apple.com>
2394
2395         [ContentChangeObserver] clearContentChangeObservers should be internal to ContentChangeObserver class
2396         https://bugs.webkit.org/show_bug.cgi?id=195066
2397         <rdar://problem/48411682>
2398
2399         Reviewed by Tim Horton.
2400
2401         * WebProcess/WebCoreSupport/WebChromeClient.h:
2402         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
2403         (WebKit::WebChromeClient::clearContentChangeObservers): Deleted.
2404
2405 2019-02-26  Per Arne Vollan  <pvollan@apple.com>
2406
2407         [iOS] Sandbox should allow mach lookups related to media capturing
2408         https://bugs.webkit.org/show_bug.cgi?id=194951
2409
2410         Reviewed by Eric Carlson.
2411
2412         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2413
2414 2019-02-26  Brent Fulgham  <bfulgham@apple.com>
2415
2416         Update NetworkSession to use Session Cleanup when available
2417         https://bugs.webkit.org/show_bug.cgi?id=195019
2418         <rdar://problem/45149868>
2419
2420         Reviewed by Alex Christensen.
2421
2422         If the build environment supports Session Cleanup, initialize it.
2423
2424         No test changes since this doesn't do anything on the test systems at present.
2425
2426         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2427         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
2428
2429 2019-02-26  Chris Dumez  <cdumez@apple.com>
2430
2431         [iOS] Regression(PSON) Scroll position is no longer restored when navigating back to reddit.com
2432         https://bugs.webkit.org/show_bug.cgi?id=195054
2433         <rdar://problem/48330549>
2434
2435         Reviewed by Geoff Garen.
2436
2437         We attempt to restore the scroll position twice, on first layout and then on load completion.
2438         Before PSON, the scroll position would fail to get restored on first layout but would succeed
2439         on load completion because the view is tall enough by then. With PSON however, we would
2440         fail to restore the scroll position on load completion because the view would not be tall
2441         enough yet by this point. The reason is that the dynamic resources would not be in the memory cache
2442         and would then get reloaded abd finish loading *after* the load event.
2443
2444         To address the issue, we now make sure to not purge the memory cache on process suspension on
2445         iOS if there is currently a SuspendedPageProxy in the UIProcess for this process.
2446
2447         * UIProcess/SuspendedPageProxy.cpp:
2448         (WebKit::SuspendedPageProxy::SuspendedPageProxy):
2449         (WebKit::SuspendedPageProxy::~SuspendedPageProxy):
2450         * UIProcess/WebProcessProxy.cpp:
2451         (WebKit::WebProcessProxy::incrementSuspendedPageCount):
2452         (WebKit::WebProcessProxy::decrementSuspendedPageCount):
2453         * UIProcess/WebProcessProxy.h:
2454         * WebProcess/WebProcess.cpp:
2455         (WebKit::WebProcess::initializeWebProcess):
2456         (WebKit::WebProcess::setHasSuspendedPageProxy):
2457         * WebProcess/WebProcess.h:
2458         * WebProcess/WebProcess.messages.in:
2459
2460 2019-02-26  Ryosuke Niwa  <rniwa@webkit.org>
2461
2462         [iOS] REGRESSION(r238490?): Safari sometimes shows blank page until a cross site navigation or re-opening the tab
2463         https://bugs.webkit.org/show_bug.cgi?id=195037
2464         <rdar://problem/48154508>
2465
2466         Reviewed by Antti Koivisto.
2467
2468         Restore the pre-r238490 behavior of WebPage::didCompletePageTransition clearing LayerTreeFreezeReason::ProcessSuspended
2469         as this has been an issue when I was able to reproduce the issue locally.
2470
2471         Also added release logging to help diagnose the issue in the future.
2472
2473         * WebProcess/WebPage/WebPage.cpp:
2474         (WebKit::WebPage::freezeLayerTree):
2475         (WebKit::WebPage::unfreezeLayerTree):
2476         (WebKit::WebPage::didCompletePageTransition):
2477         * WebProcess/WebProcess.cpp:
2478         (WebKit::WebProcess::freezeAllLayerTrees):
2479         (WebKit::WebProcess::unfreezeAllLayerTrees):
2480
2481 2019-02-26  Youenn Fablet  <youenn@apple.com>
2482
2483         Create WebPageProxy::m_userMediaPermissionRequestManager only when needed
2484         https://bugs.webkit.org/show_bug.cgi?id=195051
2485
2486         Reviewed by Eric Carlson.
2487
2488         Before the patch, WebPageProxy::m_userMediaPermissionRequestManager was created
2489         in some methods to reset its state when main document is changing, view is becoming visible...
2490         This code is unnecessary if the page did not create it already using JS APIs such as getUserMedia/enumerateDevices/ondevicechange.
2491         This patch skips processing in the other cases if WebPageProxy::m_userMediaPermissionRequestManager is null.
2492
2493         * UIProcess/WebPageProxy.cpp:
2494         (WebKit::WebPageProxy::close): No need to nullify it since it will be done in resetState shortly after.
2495         (WebKit::WebPageProxy::didChangeMainDocument):
2496         (WebKit::WebPageProxy::viewIsBecomingVisible):
2497         (WebKit::WebPageProxy::clearUserMediaState):
2498         (WebKit::WebPageProxy::updatePlayingMediaDidChange): m_userMediaPermissionRequestManager should not be null here
2499         since there is or was some capturing done for the page.
2500
2501 2019-02-26  Zalan Bujtas  <zalan@apple.com>
2502
2503         [ContentChangeObserver] Simplify content observation API by removing explicit DOMTimer observation.
2504         https://bugs.webkit.org/show_bug.cgi?id=195023
2505         <rdar://problem/48381885>
2506
2507         Reviewed by Tim Horton.
2508
2509         * WebProcess/WebPage/ios/WebPageIOS.mm:
2510         (WebKit::WebPage::handleSyntheticClick):
2511
2512 2019-02-26  Takashi Komori  <Takashi.Komori@sony.com>
2513
2514         [Curl] Load HTTP body of 401 response when AuthenticationChange is cancelled.
2515         https://bugs.webkit.org/show_bug.cgi?id=191652
2516
2517         Reviewed by Alex Christensen.
2518
2519         Test: http/tests/security/401-logout/401-logout.php
2520
2521         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
2522         (WebKit::NetworkDataTaskCurl::tryHttpAuthentication):
2523         (WebKit::NetworkDataTaskCurl::tryProxyAuthentication):
2524         * NetworkProcess/curl/NetworkDataTaskCurl.h:
2525
2526 2019-02-26  Youenn Fablet  <youenn@apple.com>
2527
2528         WebPageProxy should nullify m_userMediaPermissionRequestManager after resetting the media state
2529         https://bugs.webkit.org/show_bug.cgi?id=195028
2530         <rdar://problem/48243733>
2531
2532         Reviewed by Eric Carlson.
2533
2534         Covered by API test.
2535
2536         * UIProcess/WebPageProxy.cpp:
2537         (WebKit::WebPageProxy::resetState):
2538
2539 2019-02-26  Philippe Normand <pnormand@igalia.com> and Carlos Garcia Campos  <cgarcia@igalia.com>
2540
2541         [WPE] Add API for webview background color configuration
2542         https://bugs.webkit.org/show_bug.cgi?id=192305
2543
2544         Reviewed by Michael Catanzaro.
2545
2546         In the case of WPE we need to send the background color to the web process to be used as the background color of
2547         the page. This patch adapts the GTK+ implementation to do the same, since it's a lot simpler. The patch also
2548         removes the SetDrawsBackground message in favor of the new SetBackgroundColor message that receives an optional
2549         color.
2550
2551         * PlatformWPE.cmake: Add new WPE API for WebKitColor boxed type.
2552         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2553         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext): Remove background rendering and opacity handling.
2554         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
2555         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2556         (WebKit::ThreadedCompositor::renderLayerTree): Remove drawsBakground and always clear the context with
2557         transparent color.
2558         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
2559         * Shared/WebPageCreationParameters.cpp:
2560         (WebKit::WebPageCreationParameters::encode const): Replace drawsBackground with backgroundColor.
2561         (WebKit::WebPageCreationParameters::decode): Ditto.
2562         * Shared/WebPageCreationParameters.h:
2563         * SourcesWPE.txt:
2564         * UIProcess/API/glib/WebKitWebView.cpp:
2565         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
2566         (webkit_web_view_set_background_color):
2567         (webkit_web_view_get_background_color):
2568         * UIProcess/API/wpe/WebKitColor.cpp: Added.
2569         (webkit_color_copy):
2570         (webkit_color_free):
2571         (webkitColorToWebCoreColor):
2572         (webkitColorFillFromWebCoreColor):
2573         (webkit_color_parse):
2574         * UIProcess/API/wpe/WebKitColor.h: Added.
2575         * UIProcess/API/wpe/WebKitColorPrivate.h: Added.
2576         * UIProcess/API/wpe/WebKitWebView.h: Implement webkit_web_view_set_background_color API.
2577         * UIProcess/API/wpe/WebKitWebViewWPE.cpp: Ditto.
2578         (webkit_web_view_set_background_color):
2579         (webkit_web_view_get_background_color):
2580         * UIProcess/API/wpe/docs/wpe-0.1-sections.txt: Add new symbols.
2581         * UIProcess/WebPageProxy.cpp:
2582         (WebKit::WebPageProxy::setDrawsBackground): Set a transparent background color when false is passed.
2583         (WebKit::WebPageProxy::setBackgroundColor): Send background color to the WebProcess.
2584         (WebKit::WebPageProxy::creationParameters): Replace drawsBackground with backgroundColor.
2585         * UIProcess/WebPageProxy.h:
2586         (WebKit::WebPageProxy::drawsBackground const):
2587         (WebKit::WebPageProxy::backgroundColor const):
2588         * UIProcess/cairo/BackingStoreCairo.cpp:
2589         (WebKit::BackingStore::incorporateUpdate): Remove GTK+ code to handle background color.
2590         * UIProcess/gtk/AcceleratedBackingStore.cpp:
2591         * UIProcess/gtk/AcceleratedBackingStore.h: Make paint() pure virtual and remove the implementation.
2592         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
2593         (WebKit::AcceleratedBackingStoreWayland::paint): Dot not call AcceleratedBackingStore::paint() now that is pure virtual.
2594         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
2595         (WebKit::AcceleratedBackingStoreX11::paint): Ditto.
2596         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2597         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Use background color as provided by the
2598         UIProcess when creating the FrameView.
2599         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2600         * WebProcess/WebPage/AcceleratedDrawingArea.h:
2601         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2602         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
2603         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
2604         (WebKit::ThreadedCoordinatedLayerTreeHost::setIsDiscardable):
2605         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
2606         * WebProcess/WebPage/DrawingArea.h:
2607         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2608         (WebKit::DrawingAreaImpl::display): Remove special case for transparent background.
2609         * WebProcess/WebPage/LayerTreeHost.h:
2610         * WebProcess/WebPage/WebPage.cpp:
2611         (WebKit::WebPage::setBackgroundColor): New API for background color configuration. Proxies to FrameView and DrawingArea.
2612         * WebProcess/WebPage/WebPage.h:
2613         (WebKit::WebPage::backgroundColor const): Read-only access to the current background color.
2614         * WebProcess/WebPage/WebPage.messages.in: Replace SetDrawsBackground message with SetBackgroundColor.
2615
2616 2019-02-25  Yongjun Zhang  <yongjun_zhang@apple.com>
2617
2618         scalableNativeWebpageParameters() is not preserved on new page navigation.
2619         https://bugs.webkit.org/show_bug.cgi?id=194892
2620         <rdar://problem/47538280>
2621
2622         If a page's current default viewport configuration is scalableNativeWebpageParameters due to
2623         the fact that m_canIgnoreScalingConstraints is true, loading a new page should preserve this
2624         configuration until we derive the right values from viewport meta-tag.
2625
2626         Reviewed by Wenson Hsieh.
2627
2628         * WebProcess/WebPage/ios/WebPageIOS.mm:
2629         (WebKit::WebPage::resetViewportDefaultConfiguration): Use nativeWebpageParameters() instance method to
2630             get the appropriate default configuration.
2631
2632 2019-02-25  Wenson Hsieh  <wenson_hsieh@apple.com>
2633
2634         [iOS] Adjust initial scale zooming heuristics when changing view scale
2635         https://bugs.webkit.org/show_bug.cgi?id=194995
2636
2637         Reviewed by Tim Horton.
2638
2639         Currently, we only zoom to the new initial scale iff we're exactly at initial scale before changing the view
2640         scale. This was done so that if a user zoomed in really far and then increased the view scale, we wouldn't end
2641         up zooming out as a result. However, this leads to confusing behavior in the case where the user has manually
2642         changed the zoom scale to something close to (but not exactly) initial scale, and then attempts to zoom in
2643         further using view scale. In this case, we'll end up keeping page scale the same, so it looks like nothing is
2644         happening.
2645
2646         To fix this, we tweak our heuristics for determining whether to jump to initial scale; if the view scale is
2647         increasing and the new initial scale is greater than the current scale, zoom to initial scale. Likewise, if the
2648         view scale is decreasing and the new initial scale is less than the current scale, zoom to initial scale.
2649
2650         Test: fast/viewport/ios/initial-scale-after-changing-view-scale.html
2651
2652         * WebProcess/WebPage/ios/WebPageIOS.mm:
2653         (WebKit::WebPage::setViewportConfigurationViewLayoutSize):
2654
2655 2019-02-25  John Wilander  <wilander@apple.com>
2656
2657         Introduce and adopt new class RegistrableDomain for eTLD+1
2658         https://bugs.webkit.org/show_bug.cgi?id=194791
2659         <rdar://problem/48179240>
2660
2661         Reviewed by Alex Christensen, Fujii Hironori, and Brent Fulgham.
2662
2663         A new API test was added. Plenty of existing layout tests under
2664         http/tests/resourceLoadStatistics/ and http/tests/storageAccess/ test the code.
2665
2666         This patch introduces and adopts a new class called WebCore::RegistrableDomain
2667         which represents a domain's eTLD+1 (effective top level domain plus one) and is
2668         the basis for the term "site," as in same-site. Other popular names include
2669         high-level domain, primary domain, and top privately controlled/owned domain.
2670         Effective top level domains are enumerated on the Public Suffix List
2671         (https://publicsuffix.org).
2672
2673         This class just uses the full domain for when the Public Suffix List cannot help
2674         finding the registrable domain and for WebKit ports that haven't enabled
2675         PUBLIC_SUFFIX_LIST. It also uses the string "nullOrigin" as a representation
2676         for the null or unique origin (this matches how these origins were handled
2677         before).
2678
2679         The implementation is a wrapper around a String and the functions and class
2680         members that now make use of this new class used to handle regular String
2681         objects which didn't help much in terms of type safety or guarantees that the
2682         string had already been converted to an eTLD+1.
2683
2684         We've at least two bad bugs in the Storage Access API because of confusion
2685         between a URL's eTLD+1 and its host. The usage of WebCore::RegistrableDomain
2686         will prohibit such bugs in the future.
2687
2688         Partitioning in WebKit also uses eTLD+1 to a large extent. I plan to adopt
2689         WebCore::RegistrableDomain for partitioning in a later patch.
2690
2691         This patch also enhances parameter naming by:
2692         - Removing parts that refer to "primary" as in primaryDomain.
2693         - Replacing references to "TopPrivatelyControlledDomain" with "RegistrableDomain."
2694         - Replacing references to "TopPrivatelyOwnedDomain" with "RegistrableDomain."
2695         - Using the term "domain" consistently instead of e.g. "host."
2696
2697         A follow-up patch will continue backwards in call chains to create
2698         WebCore::RegistrableDomain objects as early as possible instead of using strings.
2699         I did not do that work here in the interest of patch size.
2700
2701         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
2702         (WebKit::domainsToString):
2703         (WebKit::pruneResources):
2704         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
2705         (WebKit::ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain const):
2706         (WebKit::ResourceLoadStatisticsMemoryStore::markAsPrevalentIfHasRedirectedToPrevalent):
2707         (WebKit::ResourceLoadStatisticsMemoryStore::isPrevalentDueToDebugMode):
2708         (WebKit::ResourceLoadStatisticsMemoryStore::hasStorageAccess):
2709         (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess):
2710         (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener):
2711         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
2712         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
2713         (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData):
2714         (WebKit::ResourceLoadStatisticsMemoryStore::ensurePrevalentResourcesForDebugMode):
2715         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResourceForDebugMode):
2716         (WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
2717         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading):
2718         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect):
2719         (WebKit::ResourceLoadStatisticsMemoryStore::logUserInteraction):
2720         (WebKit::ResourceLoadStatisticsMemoryStore::clearUserInteraction):
2721         (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUserInteraction):
2722         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResource):
2723         (WebKit::ResourceLoadStatisticsMemoryStore::isPrevalentResource const):
2724         (WebKit::ResourceLoadStatisticsMemoryStore::isVeryPrevalentResource const):
2725         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubresourceUnder const):
2726         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubFrameUnder const):
2727         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsRedirectingTo const):
2728         (WebKit::ResourceLoadStatisticsMemoryStore::clearPrevalentResource):
2729         (WebKit::ResourceLoadStatisticsMemoryStore::setGrandfathered):
2730         (WebKit::ResourceLoadStatisticsMemoryStore::isGrandfathered const):
2731         (WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameOrigin):
2732         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameOrigin):
2733         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectTo):
2734         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectFrom):
2735         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectTo):
2736         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectFrom):
2737         (WebKit::ResourceLoadStatisticsMemoryStore::ensureResourceStatisticsForRegistrableDomain):
2738         (WebKit::ResourceLoadStatisticsMemoryStore::mergeStatistics):
2739         (WebKit::ResourceLoadStatisticsMemoryStore::hasUserGrantedStorageAccessThroughPrompt):
2740         (WebKit::debugLogDomainsInBatches):
2741         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
2742         (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlockingForDomains):
2743         (WebKit::ResourceLoadStatisticsMemoryStore::clearBlockingStateForDomains):
2744         (WebKit::ResourceLoadStatisticsMemoryStore::registrableDomainsToRemoveWebsiteDataFor):
2745         (WebKit::ResourceLoadStatisticsMemoryStore::pruneStatisticsIfNeeded):
2746         (WebKit::ResourceLoadStatisticsMemoryStore::setLastSeen):
2747         (WebKit::ResourceLoadStatisticsMemoryStore::setVeryPrevalentResource):
2748         (WebKit::ResourceLoadStatisticsMemoryStore::ensureResourceStatisticsForPrimaryDomain): Deleted.
2749         (WebKit::ResourceLoadStatisticsMemoryStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor): Deleted.
2750         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
2751         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
2752         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
2753         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
2754         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccessForFrame):
2755         (WebKit::WebResourceLoadStatisticsStore::callHasStorageAccessForFrameHandler):
2756         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
2757         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
2758         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
2759         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
2760         (WebKit::WebResourceLoadStatisticsStore::callGrantStorageAccessHandler):
2761         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
2762         (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading):
2763         (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading):
2764         (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect):
2765         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
2766         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
2767         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
2768         (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
2769         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
2770         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
2771         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
2772         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
2773         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder):
2774         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
2775         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
2776         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
2777         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
2778         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
2779         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
2780         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
2781         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
2782         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
2783         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
2784         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
2785         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdateForDomains):
2786         (WebKit::WebResourceLoadStatisticsStore::scheduleClearBlockingStateForDomains):
2787         (WebKit::WebResourceLoadStatisticsStore::callUpdatePrevalentDomainsToBlockCookiesForHandler):
2788         (WebKit::WebResourceLoadStatisticsStore::removePrevalentDomains):
2789         (WebKit::WebResourceLoadStatisticsStore::callRemoveDomainsHandler):
2790         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
2791         (WebKit::WebResourceLoadStatisticsStore::registrableDomainsWithWebsiteData):
2792         (WebKit::isolatedPrimaryDomain): Deleted.
2793         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
2794         (WebKit::WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
2795         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
2796         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2797         (WebKit::NetworkConnectionToWebProcess::logUserInteraction):
2798         (WebKit::NetworkConnectionToWebProcess::logWebSocketLoading):
2799         (WebKit::NetworkConnectionToWebProcess::logSubresourceLoading):
2800         (WebKit::NetworkConnectionToWebProcess::logSubresourceRedirect):
2801         (WebKit::NetworkConnectionToWebProcess::hasStorageAccess):
2802         (WebKit::NetworkConnectionToWebProcess::requestStorageAccess):
2803         * NetworkProcess/NetworkConnectionToWebProcess.h:
2804         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2805         * NetworkProcess/NetworkProcess.cpp:
2806         (WebKit::NetworkProcess::updatePrevalentDomainsToBlockCookiesFor):
2807         (WebKit::NetworkProcess::isGrandfathered):
2808         (WebKit::NetworkProcess::isPrevalentResource):
2809         (WebKit::NetworkProcess::isVeryPrevalentResource):
2810         (WebKit::NetworkProcess::setGrandfathered):
2811         (WebKit::NetworkProcess::setPrevalentResource):
2812         (WebKit::NetworkProcess::setPrevalentResourceForDebugMode):
2813         (WebKit::NetworkProcess::setVeryPrevalentResource):
2814         (WebKit::NetworkProcess::clearPrevalentResource):
2815         (WebKit::NetworkProcess::setSubframeUnderTopFrameOrigin):
2816         (WebKit::NetworkProcess::isRegisteredAsRedirectingTo):
2817         (WebKit::NetworkProcess::isRegisteredAsSubFrameUnder):
2818         (WebKit::NetworkProcess::setSubresourceUnderTopFrameOrigin):
2819         (WebKit::NetworkProcess::setSubresourceUniqueRedirectTo):
2820         (WebKit::NetworkProcess::setSubresourceUniqueRedirectFrom):
2821         (WebKit::NetworkProcess::isRegisteredAsSubresourceUnder):
2822         (WebKit::NetworkProcess::setTopFrameUniqueRedirectTo):
2823         (WebKit::NetworkProcess::setTopFrameUniqueRedirectFrom):
2824         (WebKit::NetworkProcess::setLastSeen):
2825         (WebKit::NetworkProcess::hasStorageAccessForFrame):
2826         (WebKit::NetworkProcess::hasStorageAccess):
2827         (WebKit::NetworkProcess::requestStorageAccess):
2828         (WebKit::NetworkProcess::requestStorageAccessGranted):
2829         (WebKit::NetworkProcess::grantStorageAccess):
2830         (WebKit::NetworkProcess::logFrameNavigation):
2831         (WebKit::NetworkProcess::logUserInteraction):
2832         (WebKit::NetworkProcess::hadUserInteraction):
2833         (WebKit::NetworkProcess::clearUserInteraction):
2834         (WebKit::NetworkProcess::removePrevalentDomains):
2835         (WebKit::filterForRegistrableDomains):
2836         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
2837         (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
2838         (WebKit::filterForTopLevelDomains): Deleted.
2839         (WebKit::NetworkProcess::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
2840         (WebKit::NetworkProcess::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
2841         * NetworkProcess/NetworkProcess.h:
2842         * NetworkProcess/NetworkProcess.messages.in:
2843         * NetworkProcess/NetworkResourceLoader.cpp:
2844         (WebKit::logCookieInformationInternal):
2845         * NetworkProcess/NetworkSession.cpp:
2846         (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
2847         (WebKit::NetworkSession::registrableDomainsWithWebsiteData):
2848         (WebKit::NetworkSession::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores): Deleted.
2849         (WebKit::NetworkSession::topPrivatelyControlledDomainsWithWebsiteData): Deleted.
2850         * NetworkProcess/NetworkSession.h:
2851         * Shared/WebCoreArgumentCoders.cpp:
2852         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
2853         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
2854         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
2855         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
2856         * UIProcess/Network/NetworkProcessProxy.cpp:
2857         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
2858         (WebKit::NetworkProcessProxy::isPrevalentResource):
2859         (WebKit::NetworkProcessProxy::isVeryPrevalentResource):
2860         (WebKit::NetworkProcessProxy::setPrevalentResource):
2861         (WebKit::NetworkProcessProxy::setPrevalentResourceForDebugMode):
2862         (WebKit::NetworkProcessProxy::setVeryPrevalentResource):
2863         (WebKit::NetworkProcessProxy::setLastSeen):
2864         (WebKit::NetworkProcessProxy::clearPrevalentResource):
2865         (WebKit::NetworkProcessProxy::logUserInteraction):
2866         (WebKit::NetworkProcessProxy::hasHadUserInteraction):
2867         (WebKit::NetworkProcessProxy::clearUserInteraction):
2868         (WebKit::NetworkProcessProxy::setSubframeUnderTopFrameOrigin):
2869         (WebKit::NetworkProcessProxy::isRegisteredAsRedirectingTo):
2870         (WebKit::NetworkProcessProxy::isRegisteredAsSubFrameUnder):
2871         (WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameOrigin):
2872         (WebKit::NetworkProcessProxy::isRegisteredAsSubresourceUnder):
2873         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectTo):
2874         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectFrom):
2875         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectTo):
2876         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectFrom):
2877         (WebKit::NetworkProcessProxy::isGrandfathered):
2878         (WebKit::NetworkProcessProxy::setGrandfathered):
2879         (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
2880         (WebKit::NetworkProcessProxy::hasStorageAccess):
2881         (WebKit::NetworkProcessProxy::requestStorageAccess):
2882         (WebKit::NetworkProcessProxy::grantStorageAccess):
2883         (WebKit::NetworkProcessProxy::notifyWebsiteDataDeletionForRegistrableDomainsFinished):
2884         (WebKit::NetworkProcessProxy::notifyWebsiteDataScanForRegistrableDomainsFinished):
2885         (WebKit::NetworkProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished): Deleted.
2886         (WebKit::NetworkProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished): Deleted.
2887         * UIProcess/Network/NetworkProcessProxy.h:
2888         * UIProcess/Network/NetworkProcessProxy.messages.in:
2889         * UIProcess/WebPageProxy.cpp:
2890         (WebKit::WebPageProxy::logFrameNavigation):
2891         (WebKit::WebPageProxy::requestStorageAccessConfirm):
2892         * UIProcess/WebProcessProxy.cpp:
2893         (WebKit::WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed):
2894         (WebKit::WebProcessProxy::notifyWebsiteDataScanForRegistrableDomainsFinished):
2895         (WebKit::WebProcessProxy::notifyWebsiteDataDeletionForRegistrableDomainsFinished):
2896         (WebKit::WebProcessProxy::notifyWebsiteDataScanForTopPrivatelyControlledDomainsFinished): Deleted.
2897         (WebKit::WebProcessProxy::notifyWebsiteDataDeletionForTopPrivatelyOwnedDomainsFinished): Deleted.
2898         * UIProcess/WebProcessProxy.h:
2899         * UIProcess/WebResourceLoadStatisticsStore.messages.in:
2900         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2901         (WebKit::WebsiteDataStore::isPrevalentResource):
2902         (WebKit::WebsiteDataStore::setPrevalentResource):
2903         (WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
2904         (WebKit::WebsiteDataStore::isVeryPrevalentResource):
2905         (WebKit::WebsiteDataStore::setVeryPrevalentResource):
2906         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin):
2907         (WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
2908         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin):
2909         (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
2910         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
2911         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
2912         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
2913         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
2914         (WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
2915         (WebKit::WebsiteDataStore::clearPrevalentResource):
2916         (WebKit::WebsiteDataStore::setLastSeen):
2917         (WebKit::WebsiteDataStore::hasStorageAccess):
2918         (WebKit::WebsiteDataStore::requestStorageAccess):
2919         (WebKit::WebsiteDataStore::grantStorageAccess):
2920         (WebKit::WebsiteDataStore::logUserInteraction):
2921         (WebKit::WebsiteDataStore::hasHadUserInteraction):
2922         (WebKit::WebsiteDataStore::clearUserInteraction):
2923         (WebKit::WebsiteDataStore::setGrandfathered):
2924         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains): Deleted.
2925         * UIProcess/WebsiteData/WebsiteDataStore.h:
2926         * WebProcess/WebPage/WebPage.cpp:
2927         (WebKit::WebPage::hasStorageAccess):
2928         (WebKit::WebPage::requestStorageAccess):
2929         * WebProcess/WebProcess.cpp:
2930         (WebKit::m_nonVisibleProcessCleanupTimer):
2931         (WebKit::WebProcess::initializeWebProcess):
2932
2933 2019-02-25  Adrian Perez de Castro  <aperez@igalia.com>
2934
2935         [WPE] Bump WPEBackend-fdo requirement to API version 1.0
2936         https://bugs.webkit.org/show_bug.cgi?id=195001
2937
2938         Reviewed by Carlos Garcia Campos.
2939
2940         API version 1.0 always includes the functionality previously guarded with
2941         WPE_BACKEND_CHECK_VERSION(): remove the guards and always use the new functions
2942         unconditionally.
2943
2944         * UIProcess/API/wpe/WPEView.cpp:
2945         (WKWPE::View::View): Remove usage of WPE_BACKEND_CHECK_VERSION().
2946         (WKWPE::m_backend): Ditto.
2947         * UIProcess/API/wpe/qt/WPEQtViewBackend.cpp:
2948         (WPEQtViewBackend::WPEQtViewBackend): Use libWPEBackend-fdo-1.0 as
2949         library name, remove call to wpe_fdo_initialize_for_egl_display().
2950         (WPEQtViewBackend::create): Call wpe_fdo_initialize_for_egl_display()
2951         here, to bail out early in case initialization fails.
2952         * UIProcess/glib/WebProcessPoolGLib.cpp:
2953         (WebKit::WebProcessPool::platformInitializeWebProcess): Remove usage of
2954         WPE_BACKEND_CHECK_VERSION().
2955
2956 2019-02-25  Per Arne Vollan  <pvollan@apple.com>
2957
2958         A prewarmed Web process should have a process assertion.
2959         https://bugs.webkit.org/show_bug.cgi?id=195006
2960
2961         Reviewed by Geoffrey Garen.
2962
2963         To make sure the prewarm message is handled in the Web process before the process is suspended,
2964         the process should have a process assertion. This can be fixed by sending the prewarm message
2965         inside WebProcessPool::initializeNewWebProcess, since all message sent inside this method are
2966         guaranteed to be handled before the WebContent process is suspended.
2967
2968         This patch is based on Chris Dumez' idea and obervation of the issue.
2969
2970         * UIProcess/WebProcessPool.cpp:
2971         (WebKit::WebProcessPool::createNewWebProcess):
2972         (WebKit::WebProcessPool::initializeNewWebProcess):
2973         * UIProcess/WebProcessPool.h:
2974
2975 2019-02-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2976
2977         [GTK] Enable PSON
2978         https://bugs.webkit.org/show_bug.cgi?id=194979
2979
2980         Reviewed by Žan Doberšek.
2981
2982         It is expected that this may introduce unexpected regressions, so it's appropriate to do
2983         this at the start of a new release cycle.
2984
2985         * Shared/WebPreferencesDefaultValues.h:
2986
2987 2019-02-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2988
2989         [WPE][GTK] Clean up handling of WEBKIT_FORCE_COMPLEX_TEXT
2990         https://bugs.webkit.org/show_bug.cgi?id=194614
2991
2992         Reviewed by Carlos Garcia Campos.
2993
2994         This environment variable is now enabled for WPE, not just for GTK.
2995
2996         It is now possible to use this environment variable to enable complex text, not just to
2997         disable it.
2998
2999         WebProcessPool::setAlwaysUsesComplexTextCodePath is fixed to be respected even when this
3000         environment variable is set, although WPE and GTK will never do so.
3001
3002         * UIProcess/glib/WebProcessPoolGLib.cpp:
3003         (WebKit::WebProcessPool::platformInitialize):
3004         (WebKit::WebProcessPool::platformInitializeWebProcess):
3005
3006 2019-02-24  Zalan Bujtas  <zalan@apple.com>
3007
3008         Introduce ContentChangeObserver class
3009         https://bugs.webkit.org/show_bug.cgi?id=194977
3010         <rdar://problem/48338115>
3011
3012         Reviewed by Simon Fraser.
3013
3014         * WebProcess/WebPage/ios/WebPageIOS.mm:
3015         (WebKit::WebPage::handleSyntheticClick):
3016         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
3017
3018 2019-02-24  Simon Fraser  <simon.fraser@apple.com>
3019
3020         Migrate from "fixedPositionRect" to "layoutViewport" in the scrolling tree
3021         https://bugs.webkit.org/show_bug.cgi?id=194984
3022
3023         Reviewed by Sam Weinig.
3024
3025         Rename "fixedPositionRect" to "layoutViewport" in scrolling tree code.
3026
3027         Remove ScrollingTree::fixedPositionRect() which was only used on iOS, to fetch the
3028         current layout viewport rect. Instead, set the layout viewport on the root
3029         node in ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling().
3030         
3031         Add a WK2 Scrolling log channel.
3032
3033         * Platform/Logging.h:
3034         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
3035         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
3036         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
3037         (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
3038         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
3039         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
3040         (WebKit::RemoteScrollingTree::fixedPositionRect): Deleted.
3041         * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
3042         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3043         (WebKit::RemoteScrollingCoordinatorProxy::currentLayoutViewport const):
3044         (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect const): Deleted.
3045         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
3046         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
3047         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll):
3048         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange):
3049         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
3050         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
3051         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
3052         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange):
3053         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
3054         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
3055         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange):
3056         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll):
3057         * UIProcess/ios/WKContentView.mm:
3058         (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
3059
3060 2019-02-20  Darin Adler  <darin@apple.com>
3061
3062         Finish removing String::format
3063         https://bugs.webkit.org/show_bug.cgi?id=194893
3064
3065         Reviewed by Daniel Bates.
3066
3067         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
3068         (WebKit::LocalAuthenticator::getAssertion): Use makeString, attempting to fix
3069         a problem where we passed an NSData * to format with a "%s"."
3070
3071 2019-02-24  Michael Catanzaro  <mcatanzaro@igalia.com>
3072
3073         [WPE] Install MemoryPressureHandler in UIProcess
3074         https://bugs.webkit.org/show_bug.cgi?id=194617
3075
3076         Reviewed by Žan Doberšek.
3077
3078         Currently only GTK and Cocoa ports run MemoryPressureHandler in the UI process. WPE should
3079         too.
3080
3081         We need @no-unify to avoid changing the unified source bundles under API/, which are
3082         notoriously fragile. (WebMemoryPressureHandler.cpp sorts just above API/.)
3083
3084         * SourcesWPE.txt:
3085         * UIProcess/WebMemoryPressureHandler.cpp:
3086         (WebKit::installMemoryPressureHandler):
3087         * UIProcess/glib/WebProcessPoolGLib.cpp:
3088         (WebKit::WebProcessPool::platformInitialize):
3089
3090 2019-02-23  Chris Dumez  <cdumez@apple.com>
3091
3092         Give DrawingAreas their own identifiers
3093         https://bugs.webkit.org/show_bug.cgi?id=194969
3094         <rdar://problem/48154508>
3095
3096         Unreviewed, fix API test debug assertion failures after r241988.
3097         We do not support sending an ObjectIdentifier that is 0 via IPC so update WebPageProxy::CreateNewPage
3098         IPC to return an Optional<WebPageCreationParameters> instead of a WebPageCreationParameters. It returns
3099         nullopt when there this no UIClient or the client did not create the page, instead of returning a
3100         default-initialized WebPageCreationParameters.
3101
3102         * UIProcess/WebPageProxy.cpp:
3103         (WebKit::WebPageProxy::createNewPage):
3104         * UIProcess/WebPageProxy.messages.in:
3105         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3106         (WebKit::WebChromeClient::createWindow):
3107
3108 2019-02-23  Simon Fraser  <simon.fraser@apple.com>
3109
3110         Remove remnants of iOS WK1 scrolling tree code
3111         https://bugs.webkit.org/show_bug.cgi?id=194980
3112
3113         Reviewed by Sam Weinig.
3114
3115         Remove ScrollingTreeIOS and ScrollingCoordinatorIOS which were never instantiated.
3116
3117         Merge ScrollingTreeFrameScrollingNodeIOS into ScrollingTreeFrameScrollingNodeRemoteIOS,
3118         removing code which never applies to iOS WK2 (e.g. the synchronous scrolling code path).
3119
3120         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
3121         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
3122         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
3123         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::ScrollingTreeFrameScrollingNodeRemoteIOS):
3124         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
3125         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
3126         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::minimumScrollPosition const):
3127         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::maximumScrollPosition const):
3128         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const):
3129         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollPosition):
3130         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition):
3131         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll):
3132         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll):
3133         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange):
3134         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
3135         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
3136
3137 2019-02-23  Keith Miller  <keith_miller@apple.com>
3138
3139         Add new mac target numbers
3140         https://bugs.webkit.org/show_bug.cgi?id=194955
3141
3142         Reviewed by Tim Horton.
3143
3144         * Configurations/Base.xcconfig:
3145         * Configurations/DebugRelease.xcconfig:
3146
3147 2019-02-22  Chris Dumez  <cdumez@apple.com>
3148
3149         Give DrawingAreas their own identifiers
3150         https://bugs.webkit.org/show_bug.cgi?id=194969
3151         <rdar://problem/48154508>
3152
3153         Reviewed by Geoffrey Garen.
3154
3155         Give DrawingAreas their own identifiers instead of using the pageID. It will make the IPC more robust now that a
3156         WebPageProxy can have several drawing areas with PSON.
3157
3158         * Shared/DrawingAreaInfo.h:
3159         * Shared/WebPageCreationParameters.cpp:
3160         (WebKit::WebPageCreationParameters::encode const):
3161         (WebKit::WebPageCreationParameters::decode):
3162         * Shared/WebPageCreationParameters.h:
3163         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
3164         (WebKit::AcceleratedDrawingAreaProxy::sendUpdateBackingStoreState):
3165         (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState):
3166         (WebKit::AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing):
3167         (WebKit::AcceleratedDrawingAreaProxy::destroyNativeSurfaceHandleForCompositing):
3168         * UIProcess/DrawingAreaProxy.cpp:
3169         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
3170         (WebKit::DrawingAreaProxy::~DrawingAreaProxy):
3171         (WebKit::DrawingAreaProxy::messageSenderConnection const):
3172         (WebKit::DrawingAreaProxy::sendMessage):
3173         (WebKit::DrawingAreaProxy::viewExposedRectChangedTimerFired):
3174         * UIProcess/DrawingAreaProxy.h:
3175         (WebKit::DrawingAreaProxy::identifier const):
3176         (WebKit::DrawingAreaProxy::process const):
3177         * UIProcess/DrawingAreaProxyImpl.cpp:
3178         (WebKit::DrawingAreaProxyImpl::update):
3179         * UIProcess/ProvisionalPageProxy.cpp:
3180         (WebKit::ProvisionalPageProxy::initializeWebPage):
3181         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
3182         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
3183         (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
3184         (WebKit::RemoteLayerTreeDrawingAreaProxy::deviceScaleFactorDidChange):
3185         (WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
3186         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
3187         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidEnd):
3188         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
3189         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
3190         (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
3191         * UIProcess/WebPageProxy.cpp:
3192         (WebKit::WebPageProxy::initializeWebPage):
3193         (WebKit::WebPageProxy::createNewPage):
3194         (WebKit::WebPageProxy::creationParameters):
3195         * UIProcess/WebPageProxy.h:
3196         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
3197         (WebKit::TiledCoreAnimationDrawingAreaProxy::deviceScaleFactorDidChange):
3198         (WebKit::TiledCoreAnimationDrawingAreaProxy::colorSpaceDidChange):
3199         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
3200         (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
3201         (WebKit::TiledCoreAnimationDrawingAreaProxy::adjustTransientZoom):
3202         (WebKit::TiledCoreAnimationDrawingAreaProxy::commitTransientZoom):
3203         (WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing):
3204         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
3205         (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea):
3206         (WebKit::AcceleratedDrawingArea::layerHostDidFlushLayers):
3207         (WebKit::AcceleratedDrawingArea::sendDidUpdateBackingStoreState):
3208         * WebProcess/WebPage/DrawingArea.cpp:
3209         (WebKit::DrawingArea::DrawingArea):
3210         (WebKit::DrawingArea::removeMessageReceiverIfNeeded):
3211         * WebProcess/WebPage/DrawingArea.h:
3212         (WebKit::DrawingArea::identifier const):
3213         (WebKit::DrawingArea::send):
3214         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3215         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
3216         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
3217         (WebKit::DrawingAreaImpl::display):
3218         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
3219         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
3220         (WebKit::RemoteLayerTreeDrawingArea::updateGeometry):
3221         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3222         * WebProcess/WebPage/WebPage.cpp:
3223         (WebKit::WebPage::reinitializeWebPage):
3224         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3225         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
3226         (WebKit::TiledCoreAnimationDrawingArea::sendEnterAcceleratedCompositingModeIfNeeded):
3227         (WebKit::TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded):
3228         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
3229         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
3230         (WebKit::TiledCoreAnimationDrawingArea::setLayerHostingMode):
3231
3232 2019-02-22  Andy Estes  <aestes@apple.com>
3233
3234         [Cocoa] Do not suppress deprecation warnings when calling sandbox_extension_issue_file
3235         https://bugs.webkit.org/show_bug.cgi?id=194971
3236         <rdar://problem/35786264>
3237
3238         Reviewed by Tim Horton.
3239
3240         sandbox_extension_issue_file is not actually deprecated.
3241
3242         * Shared/mac/SandboxExtensionMac.mm:
3243         (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
3244
3245 2019-02-22  Wenson Hsieh  <wenson_hsieh@apple.com>
3246
3247         [iOS] Callout menu overlaps in-page controls when editing a comment in github.com's issue tracker
3248         https://bugs.webkit.org/show_bug.cgi?id=194873
3249         <rdar://problem/46701974>
3250
3251         Reviewed by Tim Horton.
3252
3253         On the topic of supporting web-based rich text editors on iOS, one problematic area has always been handling
3254         conflicts between platform UI (i.e., the system callout menu) and in-page text editing controls. This issue
3255         comes up in websites that don't use the "hidden contenteditable" approach to rich text editing, but also show
3256         additional controls in a toolbar or contextual menu above the selection. In these cases, what often happens is
3257         that system controls overlap controls in the page.
3258
3259         Luckily, the iOS callout menu (i.e. the private UICalloutBar) is capable of presenting with a list of "evasion
3260         rects" to avoid; if the callout bar would normally intersect with one of these rects, then a different
3261         orientation that does not intersect with one of these rects is chosen instead. Currently, the only rect added
3262         here by UIKit when presenting the callout menu is the bounding rect of the on-screen keyboard, but after
3263         <rdar://problem/48128337>, we now have a generalized mechanism for offering additional evasion rects before
3264         UIKit presents the callout menu.
3265
3266         This patch adopts the mechanism introduced in <rdar://problem/48128337>, and introduces a heuristic for
3267         determining the approximate location of controls in the page which might overlap the callout menu. This
3268         heuristic works by hit-testing for clickable (but non-editable) nodes above the bounds of the selection, which
3269         are additionally not hit-tested by advancing outwards from any of the other edges of the selection bounds.
3270         Additionally, any hit-tested nodes whose bounding rects are very large (relative to the content view size) are
3271         ignored (this deals with scenarios where the body or a large container element has a click handler). We then add
3272         the bounding rects of each of the nodes that fit this criteria to the list of rects for UIKit to avoid when
3273         presenting the system callout menu.
3274
3275         The result is that WebKit will, by default, avoid overlapping anything that looks like controls in the page when
3276         showing a callout menu in editable content. In practice, this fixes overlapping controls on most websites that
3277         roll their own context menu or toolbar in their rich text editor.
3278
3279         Test: editing/selection/ios/avoid-showing-callout-menu-over-controls.html
3280
3281         * Platform/spi/ios/UIKitSPI.h:
3282         * UIProcess/WebPageProxy.h:
3283         * UIProcess/ios/WKContentViewInteraction.mm:
3284         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
3285         (-[WKContentView requestRectsToEvadeForSelectionCommandsWithCompletionHandler:]):
3286         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
3287
3288         Drive-by: handle null completion handler arguments more gracefully, by raising an NSException and bailing before
3289         attempting to invoke a nil block.
3290
3291         * UIProcess/ios/WebPageProxyIOS.mm:
3292         (WebKit::WebPageProxy::requestEvasionRectsAboveSelection):
3293
3294         See above for more detail.
3295
3296         * WebProcess/WebPage/WebPage.h:
3297         * WebProcess/WebPage/WebPage.messages.in:
3298         * WebProcess/WebPage/ios/WebPageIOS.mm:
3299         (WebKit::WebPage::requestEvasionRectsAboveSelection):
3300
3301 2019-02-22  Simon Fraser  <simon.fraser@apple.com>
3302
3303         Unreviewed build fix: need a WebCore:: namespace on ScrollingEventResult.
3304
3305         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
3306
3307 2019-02-22  Chris Dumez  <cdumez@apple.com>
3308
3309         Regression(PSON) Unable to preview password-protected documents on iCloud.com
3310         https://bugs.webkit.org/show_bug.cgi?id=194954
3311         <rdar://problem/48127957>
3312
3313         Reviewed by Alex Christensen.
3314
3315         Make sure the ProvisionalPageProxy forwards to the WebPageProxy the QuickLook-related
3316         IPC on iOS.
3317
3318         * UIProcess/ProvisionalPageProxy.cpp:
3319         (WebKit::ProvisionalPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame):
3320         (WebKit::ProvisionalPageProxy::didReceiveMessage):
3321         * UIProcess/ProvisionalPageProxy.h:
3322         * UIProcess/WebPageProxy.h:
3323         * UIProcess/ios/WebPageProxyIOS.mm:
3324         (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame):
3325         (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrameShared):
3326
3327 2019-02-22  Per Arne Vollan  <pvollan@apple.com>
3328
3329         [iOS] Sandbox should allow mach lookups related to media capturing
3330         https://bugs.webkit.org/show_bug.cgi?id=194951
3331         <rdar://problem/48013875>
3332
3333         Reviewed by Brent Fulgham.
3334
3335         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3336
3337 2019-02-22  Alexander Mikhaylenko  <exalm7659@gmail.com>
3338
3339         [GTK] Navigation gesture improvements
3340         https://bugs.webkit.org/show_bug.cgi?id=194943
3341
3342         Reviewed by Michael Catanzaro.
3343
3344       &nbs