8331f4cc0b19eef7c72a35f6dc752435a6d86139
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2019-03-11  Chris Dumez  <cdumez@apple.com>
2
3         WebProcessCache should keep track of processes being added
4         https://bugs.webkit.org/show_bug.cgi?id=195538
5
6         Reviewed by Geoffrey Garen.
7
8         WebProcessCache should keep track of processes being added, while they are being
9         checked for responsiveness. This is useful so that:
10         - Requests to clear the cache also clear processes being added
11         - Requests to remove a given process from the cache (either because it crashed
12           or because it is being used for a history navigation) actually remove the
13           process if it is still being checked for responsiveness.
14         - The cached process eviction timer applies to such processes in case something
15           goes wrong with the code and the pending request does not get processed.
16
17         * UIProcess/WebProcessCache.cpp:
18         (WebKit::generateAddRequestIdentifier):
19         (WebKit::WebProcessCache::addProcessIfPossible):
20         (WebKit::WebProcessCache::addProcess):
21         (WebKit::WebProcessCache::clear):
22         (WebKit::WebProcessCache::clearAllProcessesForSession):
23         (WebKit::WebProcessCache::removeProcess):
24         (WebKit::WebProcessCache::CachedProcess::evictionTimerFired):
25         (WebKit::WebProcessCache::evictProcess): Deleted.
26         * UIProcess/WebProcessCache.h:
27         (WebKit::WebProcessCache::size const):
28         * UIProcess/WebProcessPool.cpp:
29         (WebKit::WebProcessPool::processForNavigationInternal):
30         * UIProcess/WebProcessProxy.cpp:
31         (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
32
33 2019-03-11  Alex Christensen  <achristensen@webkit.org>
34
35         REGRESSION: ( r240978-r240985 ) [ iOS Release ] Layout Test imported/w3c/web-platform-tests/xhr/send-redirect-post-upload.htm is crashing
36         https://bugs.webkit.org/show_bug.cgi?id=194523
37
38         Reviewed by Alexey Proskuryakov.
39
40         Attempt another workaround to prevent crashes.
41
42         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
43         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
44         (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
45         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
46         (-[WKNetworkSessionDelegate URLSession:task:needNewBodyStream:]):
47
48 2019-03-11  Ryan Haddad  <ryanhaddad@apple.com>
49
50         Unreviewed, rolling out r242688, r242643, r242624.
51
52         Caused multiple layout test failures and crashes on iOS and macOS.
53
54         Reverted changeset:
55
56         "requestAnimationFrame should execute before the next frame"
57         https://bugs.webkit.org/show_bug.cgi?id=177484
58         https://trac.webkit.org/changeset/242624/webkit
59
60         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
61         (WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush):
62         (WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState):
63         (WebKit::DrawingAreaCoordinatedGraphics::display):
64         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
65         (WebKit::LayerTreeHost::layerFlushTimerFired):
66         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
67         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
68         * WebProcess/WebPage/WebPage.cpp:
69         (WebKit::WebPage::layoutIfNeeded):
70         (WebKit::WebPage::willDisplayPage):
71         (WebKit::WebPage::renderingUpdate): Deleted.
72         * WebProcess/WebPage/WebPage.h:
73         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
74         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
75
76 2019-03-11  Darin Adler  <darin@apple.com>
77
78         Specify fixed precision explicitly to prepare to change String::number and StringBuilder::appendNumber floating point behavior
79         https://bugs.webkit.org/show_bug.cgi?id=195533
80
81         Reviewed by Brent Fulgham.
82
83         * NetworkProcess/cache/NetworkCache.cpp:
84         (WebKit::NetworkCache::Cache::dumpContentsToFile): Use appendFixedPrecisionNumber.
85         * NetworkProcess/cache/NetworkCacheEntry.cpp:
86         (WebKit::NetworkCache::Entry::asJSON const): Ditto.
87         * Shared/Gamepad/GamepadData.cpp:
88         (WebKit::GamepadData::loggingString const): Ditto.
89         * UIProcess/WebPageProxy.cpp:
90         (WebKit::WebPageProxy::logDiagnosticMessageWithValue): Use numberToStringFixedPrecision.
91
92 2019-03-11  John Wilander  <wilander@apple.com>
93
94         Resource Load Statistics: Make it possible exclude localhost from classification
95         https://bugs.webkit.org/show_bug.cgi?id=195474
96         <rdar://problem/47520577>
97
98         Reviewed by Brent Fulgham.
99
100         This patch allows for localhost to be excluded from classification and
101         treatment as a prevalent resource.
102
103         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
104         (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
105         (WebKit::ResourceLoadStatisticsDatabaseStore::reclassifyResources):
106             Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
107         (WebKit::ResourceLoadStatisticsDatabaseStore::setPrevalentResource):
108             Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
109         (WebKit::ResourceLoadStatisticsDatabaseStore::isPrevalentResource const):
110             Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
111         (WebKit::ResourceLoadStatisticsDatabaseStore::isVeryPrevalentResource const):
112             Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
113         (WebKit::ResourceLoadStatisticsDatabaseStore::setVeryPrevalentResource):
114             Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
115         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
116         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
117         (WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
118         (WebKit::ResourceLoadStatisticsMemoryStore::classifyPrevalentResources):
119             Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
120         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResource):
121             Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
122         (WebKit::ResourceLoadStatisticsMemoryStore::isPrevalentResource const):
123             Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
124         (WebKit::ResourceLoadStatisticsMemoryStore::isVeryPrevalentResource const):
125             Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
126         (WebKit::ResourceLoadStatisticsMemoryStore::setVeryPrevalentResource):
127             Makes use of the new ResourceLoadStatisticsMemoryStore::shouldSkip().
128         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
129         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
130         (WebKit::ResourceLoadStatisticsStore::ResourceLoadStatisticsStore):
131             Now takes a ShouldIncludeLocalhost parameter.
132         (WebKit::ResourceLoadStatisticsStore::shouldSkip const):
133             Convenience function, currently supporting the localhost exclusion.
134         (WebKit::ResourceLoadStatisticsStore::setIsRunningTest):
135             Test infrastructure.
136         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
137         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
138         (WebKit::WebResourceLoadStatisticsStore::setIsRunningTest):
139             Test infrastructure.
140         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
141             Now takes a ShouldIncludeLocalhost parameter.
142         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
143             Defines the new ShouldIncludeLocalhost boolean enum.
144         * NetworkProcess/NetworkProcess.cpp:
145         (WebKit::NetworkProcess::setIsRunningResourceLoadStatisticsTest):
146             Test infrastructure.
147         * NetworkProcess/NetworkProcess.h:
148         * NetworkProcess/NetworkProcess.messages.in:
149         * NetworkProcess/NetworkSession.cpp:
150         (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
151             Forwards the localhost setting to the create function.
152         * NetworkProcess/NetworkSession.h:
153         * NetworkProcess/NetworkSessionCreationParameters.cpp:
154         (WebKit::NetworkSessionCreationParameters::encode const):
155         (WebKit::NetworkSessionCreationParameters::decode):
156         * NetworkProcess/NetworkSessionCreationParameters.h:
157             New parameter called shouldIncludeLocalhostInResourceLoadStatistics.
158         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
159         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
160             Picks up the localhost setting from the parameters.
161         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
162         (WKWebsiteDataStoreSetStatisticsIsRunningTest):
163             Test infrastructure.
164         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
165         * UIProcess/Network/NetworkProcessProxy.cpp:
166         (WebKit::NetworkProcessProxy::setIsRunningResourceLoadStatisticsTest):
167             Test infrastructure.
168         * UIProcess/Network/NetworkProcessProxy.h:
169         * UIProcess/WebProcessPool.cpp:
170         (WebKit::WebProcessPool::ensureNetworkProcess):
171             Picks up the localhost setting from the WebsiteDataStore parameters.
172         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
173         (WebKit::WebsiteDataStore::parameters):
174             Makes sure Safari does not exclude localhost.
175         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
176         (WebKit::WebsiteDataStore::setIsRunningResourceLoadStatisticsTest):
177             Test infrastructure.
178         * UIProcess/WebsiteData/WebsiteDataStore.h:
179
180 2019-03-11  Alex Christensen  <achristensen@webkit.org>
181
182         Unreviewed, rolling out r242698.
183
184         API test crashes on bots.
185
186         Reverted changeset:
187
188         "Add a WKContentRuleList variant that uses copied memory
189         instead of mmap'd shared memory for class A containerized
190         apps"
191         https://bugs.webkit.org/show_bug.cgi?id=195511
192         https://trac.webkit.org/changeset/242698
193
194 2019-03-11  Michael Catanzaro  <mcatanzaro@igalia.com>
195
196         [WPE] Enable web process sandbox
197         https://bugs.webkit.org/show_bug.cgi?id=195169
198
199         Reviewed by Daniel Bates.
200
201         * PlatformWPE.cmake:
202         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
203         (WebKit::bubblewrapSpawn):
204
205 2019-03-11  Truitt Savell  <tsavell@apple.com>
206
207         Unreviewed, rolling out r242697.
208
209         Broke internal builders.
210
211         Reverted changeset:
212
213         "Optimizing loads when creating new pages"
214         https://bugs.webkit.org/show_bug.cgi?id=195516
215         https://trac.webkit.org/changeset/242697
216
217 2019-03-10  Alex Christensen  <achristensen@webkit.org>
218
219         Add a WKContentRuleList variant that uses copied memory instead of mmap'd shared memory for class A containerized apps
220         https://bugs.webkit.org/show_bug.cgi?id=195511
221         <rdar://problem/44873269>
222
223         Reviewed by Darin Adler.
224
225         * NetworkProcess/NetworkContentRuleListManager.cpp:
226         (WebKit::NetworkContentRuleListManager::addContentRuleLists):
227         * NetworkProcess/NetworkContentRuleListManager.h:
228         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
229         (WebKit::NetworkCache::pathRegisteredAsUnsafeToMemoryMapForTesting):
230         (WebKit::NetworkCache::registerPathAsUnsafeToMemoryMapForTesting):
231         (WebKit::NetworkCache::isSafeToUseMemoryMapForPath):
232         * NetworkProcess/cache/NetworkCacheFileSystem.h:
233         * Shared/WebCompiledContentRuleList.cpp:
234         (WebKit::WebCompiledContentRuleList::usesCopiedMemory const):
235         (WebKit::WebCompiledContentRuleList::conditionsApplyOnlyToDomain const):
236         (WebKit::WebCompiledContentRuleList::filtersWithoutConditionsBytecode const):
237         (WebKit::WebCompiledContentRuleList::filtersWithConditionsBytecode const):
238         (WebKit::WebCompiledContentRuleList::topURLFiltersBytecode const):
239         (WebKit::WebCompiledContentRuleList::actions const):
240         * Shared/WebCompiledContentRuleList.h:
241         * Shared/WebCompiledContentRuleListData.cpp:
242         (WebKit::WebCompiledContentRuleListData::size const):
243         (WebKit::WebCompiledContentRuleListData::dataPointer const):
244         (WebKit::WebCompiledContentRuleListData::encode const):
245         (WebKit::WebCompiledContentRuleListData::decode):
246         * Shared/WebCompiledContentRuleListData.h:
247         (WebKit::WebCompiledContentRuleListData::WebCompiledContentRuleListData):
248         * UIProcess/API/APIContentRuleList.cpp:
249         (API::ContentRuleList::usesCopiedMemory const):
250         * UIProcess/API/APIContentRuleList.h:
251         * UIProcess/API/APIContentRuleListStore.cpp:
252         (API::getData):
253         (API::decodeContentRuleListMetaData):
254         (API::ContentRuleListStore::readContentsOfFile):
255         (API::MappedOrCopiedData::dataPointer const):
256         (API::openAndMapOrCopyContentRuleList):
257         (API::compiledToFile):
258         (API::createExtension):
259         (API::ContentRuleListStore::lookupContentRuleList):
260         (API::ContentRuleListStore::compileContentRuleList):
261         (API::ContentRuleListStore::getContentRuleListSource):
262         (API::openAndMapContentRuleList): Deleted.
263         * UIProcess/API/APIContentRuleListStore.h:
264         * UIProcess/API/Cocoa/APIContentRuleListStoreCocoa.mm:
265         (API::ContentRuleListStore::readContentsOfFile):
266         * UIProcess/API/Cocoa/WKContentRuleListStore.mm:
267         (+[WKContentRuleListStore _registerPathAsUnsafeToMemoryMapForTesting:]):
268         * UIProcess/API/Cocoa/WKContentRuleListStorePrivate.h:
269         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
270         (-[_WKUserContentFilter usesCopiedMemory]):
271         * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
272         * WebProcess/UserContent/WebUserContentController.cpp:
273         (WebKit::WebUserContentController::addContentRuleLists):
274         * WebProcess/UserContent/WebUserContentController.h:
275         * WebProcess/WebPage/WebPage.cpp:
276         (WebKit::m_hostFileDescriptor):
277
278 2019-03-10  Jiewen Tan  <jiewen_tan@apple.com>
279
280         Optimizing loads when creating new pages
281         https://bugs.webkit.org/show_bug.cgi?id=195516
282         <rdar://problem/48738086>
283
284         Reviewed by Darin Adler.
285
286         This patch adds hooks in WebPageProxy::createNewPage to optimize loads, and moves the creationParameters
287         of API::NavigationAction from UI clients to WebPageProxy::createNewPage. Also, we now pass the whole
288         API::NavigationAction to the load optimizer instead of the request within.
289
290         * UIProcess/API/APINavigationAction.h:
291         * UIProcess/API/APIUIClient.h:
292         (API::UIClient::createNewPage):
293         * UIProcess/API/C/WKPage.cpp:
294         (WKPageSetPageUIClient):
295         * UIProcess/API/glib/WebKitUIClient.cpp:
296         * UIProcess/Cocoa/NavigationState.mm:
297         (WebKit::tryOptimizingLoad):
298         (WebKit::tryInterceptNavigation):
299         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
300         * UIProcess/Cocoa/UIDelegate.h:
301         * UIProcess/Cocoa/UIDelegate.mm:
302         (WebKit::UIDelegate::UIClient::createNewPage):
303         * UIProcess/WebPageProxy.cpp:
304         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
305         (WebKit::tryOptimizingLoad):
306         (WebKit::WebPageProxy::createNewPage):
307         * UIProcess/WebPageProxy.h:
308
309 2019-03-10  Tim Horton  <timothy_horton@apple.com>
310
311         Add SPI to retrieve the set of text inputs in a given rect, and later focus one
312         https://bugs.webkit.org/show_bug.cgi?id=195499
313
314         Reviewed by Darin Adler.
315
316         * Scripts/webkit/messages.py:
317         * Shared/TextInputContext.cpp: Added.
318         (IPC::ArgumentCoder<WebKit::TextInputContext>::encode):
319         (IPC::ArgumentCoder<WebKit::TextInputContext>::decode):
320         * Shared/TextInputContext.h: Added.
321         (WebKit::TextInputContext::operator== const):
322         Add TextInputContext, which represents a minimal set of information
323         about a text field.
324
325         * Sources.txt:
326         * SourcesCocoa.txt:
327         * UIProcess/API/Cocoa/WKWebView.mm:
328         (-[WKWebView _requestTextInputContextsInRect:completionHandler:]):
329         (-[WKWebView _focusTextInputContext:completionHandler:]):
330         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
331         Add SPI that allows clients to asynchronously request text input
332         contexts for a given rect, and later focus a given context.
333
334         * UIProcess/API/Cocoa/_WKTextInputContext.h: Added.
335         * UIProcess/API/Cocoa/_WKTextInputContext.mm: Added.
336         (-[_WKTextInputContext _initWithTextInputContext:]):
337         (-[_WKTextInputContext boundingRect]):
338         (-[_WKTextInputContext _textInputContext]):
339         (-[_WKTextInputContext isEqual:]):
340         (-[_WKTextInputContext hash]):
341         (-[_WKTextInputContext copyWithZone:]):
342         * UIProcess/API/Cocoa/_WKTextInputContextInternal.h: Added.
343         Add an SPI object that exposes a read-only window on a TextInputContext to clients.
344
345         * UIProcess/WebPageProxy.cpp:
346         (WebKit::WebPageProxy::textInputContextsInRect):
347         (WebKit::WebPageProxy::focusTextInputContext):
348         * UIProcess/WebPageProxy.h:
349         Plumbing from WKWebView<->WebPage.
350
351         * WebKit.xcodeproj/project.pbxproj:
352         * WebProcess/WebPage/WebPage.cpp:
353         (WebKit::elementRectInWindowCoordinates):
354         (WebKit::isEditableTextInputElement):
355         (WebKit::WebPage::textInputContextsInRect):
356         Search the DOM for text input contexts: <input type='text'> (or other
357         form fields that fall back on text field behavior), <textarea>, and
358         contenteditable roots. Store the WebPage, Document, and Element identifiers
359         so that we can find the element again later.
360
361         (WebKit::WebPage::focusTextInputContext):
362         Find the element for a given (web page, document, element) triple and focus it,
363         if it's still available.
364
365         * WebProcess/WebPage/WebPage.h:
366         * WebProcess/WebPage/WebPage.messages.in:
367
368 2019-03-10  Tim Horton  <timothy_horton@apple.com>
369
370         iOS: Using ⌥ to scroll horizontally is no different than arrow key
371         https://bugs.webkit.org/show_bug.cgi?id=195268
372         <rdar://problem/48326682>
373
374         Reviewed by Brent Fulgham.
375
376         * UIProcess/ios/WKContentViewInteraction.mm:
377         (-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:inDirection:]):
378         (-[WKContentView keyboardScrollViewAnimator:distanceForIncrement:]): Deleted.
379         * UIProcess/ios/WKKeyboardScrollingAnimator.h:
380         * UIProcess/ios/WKKeyboardScrollingAnimator.mm:
381         (-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]):
382         (-[WKKeyboardScrollViewAnimator setDelegate:]):
383         (-[WKKeyboardScrollViewAnimator distanceForIncrement:inDirection:]):
384         (-[WKKeyboardScrollViewAnimator distanceForIncrement:]): Deleted.
385         Add a direction parameter to -distanceForIncrement:, so the client
386         can return a different page/document size based on the scrolling axis.
387         Adopt it both in the default implementation and in WKContentViewInteraction.
388         Make the option key scroll by page when scrolling horizontally, like it
389         does when scrolling vertically.
390
391 2019-03-10  David Quesada  <david_quesada@apple.com>
392
393         ASSERT(m_downloads.isEmpty()) fails in DownloadProxyMap::~DownloadProxyMap()
394         https://bugs.webkit.org/show_bug.cgi?id=152480
395
396         Reviewed by Chris Dumez.
397
398         * UIProcess/Downloads/DownloadProxyMap.cpp:
399         (WebKit::DownloadProxyMap::downloadFinished):
400             If the DownloadProxy is holding the last reference to the process pool, then
401             invalidating the proxy will cause the process pool, the network process proxy,
402             and this DownloadProxyMap to deallocate. Ensure that doesn't happen until this
403             method has done everything it wants to do to clean up.
404
405 2019-03-10  Wenson Hsieh  <wenson_hsieh@apple.com>
406
407         Fix some misleading function and variable names in WKContentViewInteraction.mm
408         https://bugs.webkit.org/show_bug.cgi?id=195536
409
410         Reviewed by Tim Horton.
411
412         * UIProcess/ios/WKContentViewInteraction.mm:
413         (shouldDeferZoomingToSelectionWhenRevealingFocusedElement):
414
415         Rename shouldZoomToRevealSelectionRect to shouldDeferZoomingToSelectionWhenRevealingFocusedElement; this
416         function is used to determine whether we should zoom to the selection rect when revealing the focused element,
417         and therefore affects whether we need to defer zooming until we get selection information.
418
419         (rectToRevealWhenZoomingToFocusedElement):
420         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
421
422         Rename shouldShowKeyboard to shouldShowInputView; this boolean indicates whether we should show not only the
423         keyboard, but other UI for user input such as date and select pickers.
424
425         (-[WKContentView _didReceiveEditorStateUpdateAfterFocus]):
426         (shouldZoomToRevealSelectionRect): Deleted.
427
428 2019-03-10  Simon Fraser  <simon.fraser@apple.com>
429
430         ScrollingTree should have the final say on where layers go
431         https://bugs.webkit.org/show_bug.cgi?id=195507
432
433         Reviewed by Antti Koivisto.
434
435         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
436         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
437         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
438         (WebKit::RemoteScrollingCoordinatorProxy::applyScrollingTreeLayerPositions):
439         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
440         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
441         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
442
443 2019-03-09  Darin Adler  <darin@apple.com>
444
445         [Cocoa] Code signing fails because services are copied into XPCServices after the framework is signed
446         https://bugs.webkit.org/show_bug.cgi?id=195523
447
448         Reviewed by Dan Bernstein.
449
450         * WebKit.xcodeproj/project.pbxproj: Make symbolic links while building the WebKit
451         framework instead of copying in the services after the framework is built.
452
453 2019-03-09  Wenson Hsieh  <wenson_hsieh@apple.com>
454
455         REGRESSION (r242551): Sporadic hangs when tapping to change selection on iOS
456         https://bugs.webkit.org/show_bug.cgi?id=195475
457         <rdar://problem/48721153>
458
459         Reviewed by Chris Dumez.
460
461         r242551 refactored synchronous autocorrection context requests to send an async IPC message and then use
462         waitForAndDispatchImmediately, instead of calling sendSync. However, this exposes a couple of existing issues in
463         the implementation of waitForAndDispatchImmediately that causes sporadic IPC deadlocks when changing selection.
464
465         First, passing in InterruptWaitingIfSyncMessageArrives when synchronously waiting for an IPC message currently
466         does not fulfill its intended behavior of interrupting waiting when a sync message arrives. This is because sync
467         IPC messages, by default, may be dispatched while the receiver is waiting for a sync reply. This means that the
468         logic in Connection::SyncMessageState::processIncomingMessage to dispatch an incoming sync message on the main
469         thread will attempt to handle the incoming message by enqueueing it on the main thread, and then waking up the
470         client runloop (i.e. signaling m_waitForSyncReplySemaphore). This works in the case of sendSync since the sync
471         reply semaphore is used to block the main thread, but in the case of waitForAndDispatchImmediately, a different
472         m_waitForMessageCondition is used instead, so SyncMessageState::processIncomingMessage will only enqueue the
473         incoming sync message on the main thread, and not actually invoke it.
474
475         To fix this first issue, observe that there is pre-existing logic to enqueue the incoming message and signal
476         m_waitForMessageCondition in Connection::processIncomingMessage. This codepath is currently not taken because we
477         end up bailing early in the call to SyncMessageState::processIncomingMessage. Instead, we can move this early
478         return further down in the function, such that if there is an incoming sync message and we're waiting with the
479         InterruptWaitingIfSyncMessageArrives option, we will correctly enqueue the incoming message, wake the runloop,
480         and proceed to handle the incoming message.
481
482         The second issue is more subtle; consider the scenario in which we send a sync message A from the web process to
483         the UI process, and simultaneously, in the UI process, we schedule some work to be done on the main thread.
484         Let's additionally suppose that this scheduled work will send an IPC message B to the web process and
485         synchronously wait for a reply (in the case of this particular bug, this is the sync autocorrection context
486         request). What happens upon receiving sync message A is that the IPC thread in the UI process will schedule A on
487         the main thread; however, before the scheduled response to A is invoked, we will first invoke previously
488         scheduled work that attempts to block synchronously until a message B is received. In summary:
489
490         1. (Web process)    sends sync IPC message A to UI process.
491         2. (UI process)     schedules some main runloop task that will block synchronously on IPC message B.
492         3. (UI process)     receives sync IPC message A and schedules A on the main runloop.
493         4. (UI process)     carry out the task scheduled in (2) and block on B.
494
495         ...and then, the UI process and web process are now deadlocked because the UI process is waiting for B to
496         arrive, but the web process can't send B because it's waiting for a reply for IPC message A! To fix this second
497         deadlock, we first make an important observation: when using sendSync, we don't run into this problem because
498         immediately before sending sync IPC, we will attempt to handle any incoming sync IPC messages that have been
499         queued up. However, when calling waitForAndDispatchImmediately, we don't have this extra step, so a deadlock may
500         occur in the manner described above. To fix this, we make waitForAndDispatchImmediately behave more like
501         sendSync, by handling all incoming sync messages prior to blocking on an IPC response.
502
503         Test: editing/selection/ios/change-selection-by-tapping.html
504
505         * Platform/IPC/Connection.cpp:
506         (IPC::Connection::waitForMessage):
507         (IPC::Connection::processIncomingMessage):
508
509 2019-03-09  Andy Estes  <aestes@apple.com>
510
511         [Apple Pay] CanMakePaymentsWithActiveCard and OpenPaymentSetup should be async messages
512         https://bugs.webkit.org/show_bug.cgi?id=195526
513         <rdar://problem/48745636>
514
515         Reviewed by Chris Dumez.
516
517         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
518         (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard):
519         (WebKit::WebPaymentCoordinatorProxy::openPaymentSetup):
520         * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
521         * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
522         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
523         (WebKit::WebPaymentCoordinator::canMakePaymentsWithActiveCard):
524         (WebKit::WebPaymentCoordinator::openPaymentSetup):
525         (WebKit::generateCanMakePaymentsWithActiveCardReplyID): Deleted.
526         (WebKit::generateOpenPaymentSetupReplyID): Deleted.
527         (WebKit::WebPaymentCoordinator::canMakePaymentsWithActiveCardReply): Deleted.
528         (WebKit::WebPaymentCoordinator::openPaymentSetupReply): Deleted.
529         * WebProcess/ApplePay/WebPaymentCoordinator.h:
530         * WebProcess/ApplePay/WebPaymentCoordinator.messages.in:
531
532 2019-03-09  Andy Estes  <aestes@apple.com>
533
534         [iOS] Remove unneeded entitlements and sandbox allowances from the Networking service
535         https://bugs.webkit.org/show_bug.cgi?id=195527
536
537         Reviewed by Eric Carlson.
538
539         * Configurations/Network-iOS.entitlements:
540         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
541
542 2019-03-09  Chris Dumez  <cdumez@apple.com>
543
544         Use modern async IPC with reply for device orientation permission
545         https://bugs.webkit.org/show_bug.cgi?id=195529
546
547         Reviewed by Ryosuke Niwa.
548
549         * UIProcess/WebPageProxy.cpp:
550         (WebKit::WebPageProxy::requestDeviceOrientationAndMotionAccess):
551         * UIProcess/WebPageProxy.h:
552         * UIProcess/WebPageProxy.messages.in:
553         * WebProcess/WebPage/WebPage.cpp:
554         (WebKit::WebPage::shouldAllowDeviceOrientationAndMotionAccess):
555         (WebKit::nextDeviceOrientationAndMotionPermissionCallbackID): Deleted.
556         (WebKit::WebPage::didReceiveDeviceOrientationAndMotionAccessDecision): Deleted.
557         * WebProcess/WebPage/WebPage.h:
558         * WebProcess/WebPage/WebPage.messages.in:
559
560 2019-03-09  Zalan Bujtas  <zalan@apple.com>
561
562         [ContentChangeObserver] Start observing for content change between touchEnd and mouseMoved start
563         https://bugs.webkit.org/show_bug.cgi?id=195510
564         <rdar://problem/48735695>
565
566         Reviewed by Simon Fraser.
567
568         * WebProcess/WebPage/ios/WebPageIOS.mm:
569         (WebKit::WebPage::cancelPotentialTapInFrame):
570
571 2019-03-08  Chris Dumez  <cdumez@apple.com>
572
573         Enable ProcessAssertions on iOS Simulator
574         https://bugs.webkit.org/show_bug.cgi?id=195479
575
576         Reviewed by Alexey Proskuryakov.
577
578         Enable ProcessAssertions on iOS Simulator. We have some layout tests timing out in the
579         iOS Simulator due to the WebContent process suspending. Turning on ProcessAssertions in
580         the iOS Simulator seems to make those tests pass.
581
582         * UIProcess/ProcessAssertion.cpp:
583         * UIProcess/ProcessAssertion.h:
584         * UIProcess/ios/ProcessAssertionIOS.mm:
585
586 2019-03-08  Chris Dumez  <cdumez@apple.com>
587
588         Add support for Device Orientation / Motion permission API
589         https://bugs.webkit.org/show_bug.cgi?id=195329
590         <rdar://problem/47645367>
591
592         Reviewed by Geoffrey Garen.
593
594         Add support for Device Orientation / Motion permission API:
595         - https://github.com/w3c/deviceorientation/issues/57
596
597         This adds new SPI to WKUIDelegatePrivate, until we can make this API.
598
599         * Shared/WebPreferences.yaml:
600         * UIProcess/API/APIUIClient.h:
601         (API::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
602         * UIProcess/API/C/WKPage.cpp:
603         (WKPageSetPageUIClient):
604         * UIProcess/API/C/WKPageUIClient.h:
605         * UIProcess/API/Cocoa/WKUIDelegate.h:
606         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
607         * UIProcess/Cocoa/UIDelegate.h:
608         * UIProcess/Cocoa/UIDelegate.mm:
609         (WebKit::UIDelegate::setDelegate):
610         (WebKit::UIDelegate::UIClient::shouldAllowDeviceOrientationAndMotionAccess):
611         * UIProcess/WebPageProxy.cpp:
612         (WebKit::WebPageProxy::requestDeviceOrientationAndMotionAccess):
613         * UIProcess/WebPageProxy.h:
614         * UIProcess/WebPageProxy.messages.in:
615         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
616         (WebKit::WebChromeClient::shouldAllowDeviceOrientationAndMotionAccess):
617         * WebProcess/WebCoreSupport/WebChromeClient.h:
618         * WebProcess/WebPage/WebPage.cpp:
619         (WebKit::nextDeviceOrientationAndMotionPermissionCallbackID):
620         (WebKit::WebPage::shouldAllowDeviceOrientationAndMotionAccess):
621         (WebKit::WebPage::didReceiveDeviceOrientationAndMotionAccessDecision):
622         * WebProcess/WebPage/WebPage.h:
623         * WebProcess/WebPage/WebPage.messages.in:
624
625 2019-03-08  Brady Eidson  <beidson@apple.com>
626
627         Have the UIProcess take the UnboundedNetworking assertion when downloads are in progress.
628         https://bugs.webkit.org/show_bug.cgi?id=195468
629
630         Reviewed by Andy Estes.
631
632         * UIProcess/Downloads/DownloadProxyMap.cpp:
633         (WebKit::DownloadProxyMap::DownloadProxyMap):
634         (WebKit::DownloadProxyMap::createDownloadProxy): If this is the first download, and the process has the entitlement,
635           take the assertion.
636         (WebKit::DownloadProxyMap::downloadFinished):
637         (WebKit::DownloadProxyMap::processDidClose):
638         * UIProcess/Downloads/DownloadProxyMap.h:
639
640 2019-03-08  Chris Dumez  <cdumez@apple.com>
641
642         Add assertions to help debug a WebProcessCache crash
643         https://bugs.webkit.org/show_bug.cgi?id=195469
644
645         Reviewed by Brady Eidson.
646
647         I suspect the process's registrableDomain in null when evictProcess() gets
648         called, thus crashing when lookup it up in the HashMap. Confirm this and
649         how this could happen via assertions.
650
651         * UIProcess/WebProcessCache.cpp:
652         (WebKit::WebProcessCache::evictProcess):
653         * UIProcess/WebProcessProxy.cpp:
654         (WebKit::WebProcessProxy::didStartProvisionalLoadForMainFrame):
655
656 2019-03-08  Brady Eidson  <beidson@apple.com>
657
658         Rename AssertionState::Download.
659         https://bugs.webkit.org/show_bug.cgi?id=195465
660
661         Reviewed by Andy Estes.
662
663         It's (currently) about uploads and downloads.
664         Let's call it "UnboundedNetworking"
665
666         * NetworkProcess/Downloads/DownloadMap.cpp:
667         (WebKit::DownloadMap::add):
668
669         * UIProcess/ProcessAssertion.h:
670
671         * UIProcess/WebProcessProxy.cpp:
672         (WebKit::WebProcessProxy::didSetAssertionState):
673
674         * UIProcess/ios/ProcessAssertionIOS.mm:
675         (WebKit::flagsForState):
676         (WebKit::reasonForState):
677
678 2019-03-08  Simon Fraser  <simon.fraser@apple.com>
679
680         [macOS UI-side compositing] Mouse handling can trigger a crash before we have a scrolling tree root
681         https://bugs.webkit.org/show_bug.cgi?id=195467
682
683         Reviewed by Antti Koivisto.
684         
685         When launching MiniBrowser with UI-side compositing enabled in a state where the window
686         appears under the mouse, we can hit RemoteScrollingTree::handleMouseEvent() for a mouseEnter
687         event before we have a scrolling tree root node, so add a null check.
688
689         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
690         (WebKit::RemoteScrollingTree::handleMouseEvent):
691
692 2019-03-08  Carlos Garcia Campos  <cgarcia@igalia.com>
693
694         REGRESSION(r242624): [GTK] New rAF code path assumes AC mode
695         https://bugs.webkit.org/show_bug.cgi?id=195459
696
697         Reviewed by Žan Doberšek.
698
699         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
700         (WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush):
701         The refresh monitor now calls scheduleLayerFlush() but when AC
702         mode is disabled this method does nothing, so setNeedsDisplay()
703         needs to be called instead.
704
705 2019-03-07  Tim Horton  <timothy_horton@apple.com>
706
707         Crash under RemoteLayerTreePropertyApplier::applyProperties
708         https://bugs.webkit.org/show_bug.cgi?id=195448
709         <rdar://problem/48588226>
710
711         Reviewed by Simon Fraser.
712
713         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
714         (WebKit::RemoteLayerTreeHost::updateLayerTree):
715         Under some currently-unknown circumstances, the UI process is receiving
716         commits referring to layers that it does not know about.
717         One understood case of this was fixed in r241899, but there seem to be
718         cases remaining that are not understood.
719         Also, add a release log so that we can identify any downstream effects.
720
721 2019-03-07  Zalan Bujtas  <zalan@apple.com>
722
723         [ContentChangeObserver] Introduce fixed duration content observation
724         https://bugs.webkit.org/show_bug.cgi?id=195295
725         <rdar://problem/48579913>
726
727         Reviewed by Simon Fraser.
728
729         * WebProcess/WebPage/ios/WebPageIOS.mm:
730         (WebKit::WebPage::handleSyntheticClick):
731         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
732
733 2019-03-07  Fujii Hironori  <Hironori.Fujii@sony.com>
734
735         [WinCairo][WebKit] Nothing is drawn after Web process crashed
736         https://bugs.webkit.org/show_bug.cgi?id=195399
737
738         Reviewed by Alex Christensen.
739
740         PageClientImpl::viewSize returned 0x0 size after Web process
741         crashed. Restored the original implementation using GetClientRect
742         (Bug 52175).
743
744         * UIProcess/win/PageClientImpl.cpp:
745         (WebKit::PageClientImpl::viewSize):
746
747 2019-03-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
748
749         requestAnimationFrame should execute before the next frame
750         https://bugs.webkit.org/show_bug.cgi?id=177484
751
752         Reviewed by Simon Fraser.
753
754         Replace the calls to Page::layoutIfNeeded() and willDisplayPage() by
755         a single call to Page::renderingUpdate(). This new function implements 
756         "Update the rendering" step of the HTML Event Loop specification
757         <https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering>.
758
759         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
760         (WebKit::AcceleratedDrawingArea::updateBackingStoreState):
761         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
762         (WebKit::LayerTreeHost::layerFlushTimerFired):
763         * WebProcess/WebPage/DrawingAreaImpl.cpp:
764         (WebKit::DrawingAreaImpl::display):
765         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
766         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
767         * WebProcess/WebPage/WebPage.cpp:
768         (WebKit::WebPage::layoutIfNeeded):
769         (WebKit::WebPage::renderingUpdate):
770         (WebKit::WebPage::willDisplayPage): Deleted.
771         * WebProcess/WebPage/WebPage.h:
772         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
773         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
774
775 2019-03-07  Zalan Bujtas  <zalan@apple.com>
776
777         [ContentChangeObserver] Add a setting to be able to turn content change observation on/off
778         https://bugs.webkit.org/show_bug.cgi?id=195353
779         <rdar://problem/48626394>
780
781         Reviewed by Simon Fraser.
782
783         * Shared/WebPreferences.yaml:
784         * UIProcess/API/C/WKPreferences.cpp:
785         (WKPreferencesSetContentChangeObserverEnabled):
786         (WKPreferencesGetContentChangeObserverEnabled):
787         * UIProcess/API/C/WKPreferencesRefPrivate.h:
788         * UIProcess/API/Cocoa/WKPreferences.mm:
789         (-[WKPreferences _contentChangeObserverEnabled]):
790         (-[WKPreferences _setContentChangeObserverEnabled:]):
791         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
792         * WebProcess/WebPage/ios/WebPageIOS.mm:
793         (WebKit::WebPage::handleSyntheticClick):
794
795 2019-03-07  Andy Estes  <aestes@apple.com>
796
797         [Apple Pay] Untangle PKPaymentAuthorizationViewController from WebPaymentCoordinatorProxy
798         https://bugs.webkit.org/show_bug.cgi?id=195349
799         <rdar://problem/48625510>
800
801         Reviewed by Alex Christensen.
802
803         Introduced PaymentAuthorizationPresenter and WKPaymentAuthorizationDelegate to encapsulate
804         PKPaymentAuthorizationViewController and its delegate. Taught WebPaymentCoordinatorProxy to
805         interact with PaymentAuthorizationPresenter rather than PKPAVC directly.
806
807         These changes will allow us to swap out PKPaymentAuthorizationViewController with PKPaymentAuthorizationController in a follow-on patch.
808
809         * Platform/cocoa/PaymentAuthorizationPresenter.h: Added. Defined the abstract interface for
810         payment authorization presenters that use PKPA(V)C.
811         * Platform/cocoa/PaymentAuthorizationPresenter.mm: Added.
812         (WebKit::toPKPaymentAuthorizationStatus): Moved from WebPaymentCoordinatorProxyCocoa.mm.
813         (WebKit::toPKPaymentErrorCode): Ditto.
814         (WebKit::toNSError): Ditto.
815         (WebKit::toNSErrors): Ditto.
816         (WebKit::toPKShippingMethods): Ditto.
817         (WebKit::PaymentAuthorizationPresenter::completeMerchantValidation): Added. Implements the
818         logic previously in WebPaymentCoordinatorProxy::platformCompleteMerchantValidation.
819         (WebKit::PaymentAuthorizationPresenter::completePaymentMethodSelection): Ditto for
820         WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection.
821         (WebKit::PaymentAuthorizationPresenter::completePaymentSession): Ditto for 
822         (WebKit::PaymentAuthorizationPresenter::completeShippingContactSelection): Ditto for
823         WebPaymentCoordinatorProxy::platformCompletePaymentSession.
824         (WebKit::PaymentAuthorizationPresenter::completeShippingMethodSelection): Ditto for
825         WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection.
826         * Platform/cocoa/PaymentAuthorizationViewController.h: Added. Defined a subclass of PaymentAuthorizationPresenter for PKPaymentAuthorizationViewController.
827         * Platform/cocoa/PaymentAuthorizationViewController.mm: Added.
828         (-[WKPaymentAuthorizationViewControllerDelegate initWithPresenter:]): Added a PKPAVC
829         delegate that's a subclass of WKPaymentAuthorizationDelegate.
830         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]):
831         Called -[WKPaymentAuthorizationDelegate _didFinish].
832         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:handler:]): Called
833         -[WKPaymentAuthorizationDelegate _didAuthorizePayment:completion:].
834         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]): Called
835         -[WKPaymentAuthorizationDelegate _didSelectShippingMethod:completion:].
836         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]): Called
837         -[WKPaymentAuthorizationDelegate _didSelectShippingContact:completion:].
838         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]): Called
839         -[WKPaymentAuthorizationDelegate _didSelectPaymentMethod:completion:].
840         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:willFinishWithError:]):
841         Called -[WKPaymentAuthorizationDelegate _willFinishWithError:].
842         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didRequestMerchantSession:]): Called
843         -[WKPaymentAuthorizationDelegate _didRequestMerchantSession:].
844         * Platform/cocoa/WKPaymentAuthorizationDelegate.h: Added.
845         * Platform/cocoa/WKPaymentAuthorizationDelegate.mm: Added.
846         (-[WKPaymentAuthorizationDelegate summaryItems]): Added a summaryItems getter.
847         (-[WKPaymentAuthorizationDelegate shippingMethods]): Ditto for shippingMethods.
848         (-[WKPaymentAuthorizationDelegate completeMerchantValidation:error:]): Called
849         _didRequestMerchantSessionCompletion then set it to nil.
850         (-[WKPaymentAuthorizationDelegate completePaymentMethodSelection:]): Ditto for
851         _didSelectPaymentMethodCompletion.
852         (-[WKPaymentAuthorizationDelegate completePaymentSession:errors:didReachFinalState:]): Ditto
853         for _didAuthorizePaymentCompletion.
854         (-[WKPaymentAuthorizationDelegate completeShippingContactSelection:summaryItems:shippingMethods:errors:]):
855         Ditto for _didSelectShippingContactCompletion.
856         (-[WKPaymentAuthorizationDelegate completeShippingMethodSelection:]): Ditto for
857         _didSelectShippingMethodCompletion.
858         (-[WKPaymentAuthorizationDelegate invalidate]): If there's an outstanding authorization
859         callback, called -completePaymentSession:errors:didReachFinalState: with a state of
860         PKPaymentAuthorizationStatusFailure.
861         (-[WKPaymentAuthorizationDelegate _initWithPresenter:]):
862         (-[WKPaymentAuthorizationDelegate _didAuthorizePayment:completion:]): Added. Implements the
863         logic previously in WKPaymentAuthorizationViewControllerDelegate.
864         (-[WKPaymentAuthorizationDelegate _didFinish]): Ditto.
865         (-[WKPaymentAuthorizationDelegate _didRequestMerchantSession:]): Ditto.
866         (-[WKPaymentAuthorizationDelegate _didSelectPaymentMethod:completion:]): Ditto.
867         (-[WKPaymentAuthorizationDelegate _didSelectShippingContact:completion:]): Ditto.
868         (toShippingMethod): Moved from WebPaymentCoordinatorProxyCocoa.mm.
869         (-[WKPaymentAuthorizationDelegate _didSelectShippingMethod:completion:]): Added. Implements
870         the logic previously in WKPaymentAuthorizationViewControllerDelegate.
871         (-[WKPaymentAuthorizationDelegate _willFinishWithError:]): Ditto.
872         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
873         (WebKit::WebPaymentCoordinatorProxy::presenterWillValidateMerchant): To conform to
874         PaymentAuthorizationPresenter::Client, renamed from validateMerchant.
875         (WebKit::WebPaymentCoordinatorProxy::presenterDidAuthorizePayment): Renamed from
876         didAuthorizePayment.
877         (WebKit::WebPaymentCoordinatorProxy::presenterDidFinish): Moved logic here that previously
878         existed in WKPaymentAuthorizationViewControllerDelegate.
879         (WebKit::WebPaymentCoordinatorProxy::presenterDidSelectShippingMethod): Renamed from
880         didSelectShippingMethod.
881         (WebKit::WebPaymentCoordinatorProxy::presenterDidSelectShippingContact): Renamed from
882         didSelectShippingContact.
883         (WebKit::WebPaymentCoordinatorProxy::presenterDidSelectPaymentMethod): Renamed from
884         didSelectPaymentMethod.
885         (WebKit::WebPaymentCoordinatorProxy::validateMerchant): Renamed to
886         presenterWillValidateMerchant.
887         (WebKit::WebPaymentCoordinatorProxy::didAuthorizePayment): Renamed to
888         presenterDidAuthorizePayment.
889         (WebKit::WebPaymentCoordinatorProxy::didSelectShippingMethod): Renamed to
890         presenterDidSelectShippingMethod.
891         (WebKit::WebPaymentCoordinatorProxy::didSelectShippingContact): Renamed to
892         presenterDidSelectShippingContact.
893         (WebKit::WebPaymentCoordinatorProxy::didSelectPaymentMethod): Renamed to
894         didSelectPaymentMethod.
895         * Shared/ApplePay/WebPaymentCoordinatorProxy.h: Changed WebPaymentCoordinatorProxy to
896         subclass PaymentAuthorizationPresenter::Client.
897         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: Removed WKPaymentAuthorizationViewControllerDelegate interface and declared some helper functions
898         needed by PaymentAuthorizationPresenter.
899         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
900         (WebKit::toPKPaymentSummaryItemType): Removed static keyword.
901         (WebKit::toDecimalNumber): Ditto.
902         (WebKit::toPKPaymentSummaryItem): Ditto.
903         (WebKit::toPKPaymentSummaryItems): Ditto.
904         (WebKit::toPKShippingMethod): Ditto.
905         (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Changed to call
906         m_authorizationPresenter.
907         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession): Ditto.
908         (WebKit::WebPaymentCoordinatorProxy::platformCompleteMerchantValidation): Ditto.
909         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection): Ditto.
910         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection): Ditto.
911         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection): Ditto.
912         (-[WKPaymentAuthorizationViewControllerDelegate initWithPaymentCoordinatorProxy:]): Deleted.
913         (-[WKPaymentAuthorizationViewControllerDelegate invalidate]): Deleted.
914         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:willFinishWithError:]): Deleted.
915         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didRequestMerchantSession:]): Deleted.
916         (toShippingMethod): Deleted.
917         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:handler:]): Deleted.
918         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:handler:]): Deleted.
919         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:handler:]): Deleted.
920         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:handler:]): Deleted.
921         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didAuthorizePayment:completion:]): Deleted.
922         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingMethod:completion:]): Deleted.
923         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectPaymentMethod:completion:]): Deleted.
924         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewController:didSelectShippingContact:completion:]): Deleted.
925         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]): Deleted.
926         (WebKit::toPKPaymentAuthorizationStatus): Moved to PaymentAuthorizationPresenter.mm.
927         (WebKit::toPKPaymentErrorCode): Ditto.
928         (WebKit::toNSError): Ditto.
929         (WebKit::toNSErrors): Ditto.
930         * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
931         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Changed to present a
932         PaymentAuthorizationPresenter rather than a PKPAVC.
933         (WebKit::WebPaymentCoordinatorProxy::hidePaymentUI): Changed to dismiss a
934         PaymentAuthorizationPresenter rather than a PKPAVC.
935         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
936         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Ditto.
937         (WebKit::WebPaymentCoordinatorProxy::hidePaymentUI): Ditto.
938         * SourcesCocoa.txt:
939         * UIProcess/WebPageProxy.h:
940         * UIProcess/ios/WebPageProxyIOS.mm:
941         (WebKit::WebPageProxy::paymentCoordinatorAuthorizationPresenter): Added. Returns a new
942         PaymentAuthorizationViewController.
943         * WebKit.xcodeproj/project.pbxproj:
944
945 2019-03-07  Chris Dumez  <cdumez@apple.com>
946
947         Regression(r242580) WebKit.NetworkProcessCrashWithPendingConnection API is crashing on iOS debug
948         https://bugs.webkit.org/show_bug.cgi?id=195416
949
950         Reviewed by Antti Koivisto.
951
952         Drop ASSERT_NOT_REACHED() in WebPage::didCompletePageTransition() when the tree is still frozen due to
953         LayerTreeFreezeReason::ProcessSuspended. As demonstrated by this API test, nothing prevents a load from
954         completing and WebPage::didCompletePageTransition() to get called *after* WebProcess::prepareToSuspend()
955         has been called. From the logging during the test, I can tell that WebProcess::processDidResume() gets
956         called later on and the LayerTreeFreezeReason::ProcessSuspended freezing reason gets dropped, as expected.
957
958         * WebProcess/WebPage/WebPage.cpp:
959         (WebKit::WebPage::didCompletePageTransition):
960
961 2019-03-07  Chris Dumez  <cdumez@apple.com>
962
963         Clean up / simplify ProcessAssertion code
964         https://bugs.webkit.org/show_bug.cgi?id=195394
965
966         Reviewed by Geoffrey Garen.
967
968         Clean up / simplify ProcessAssertion code to facilitate its maintenance and make it
969         less error-prone.
970
971         * Platform/IPC/mac/ConnectionMac.mm:
972         (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
973         * UIProcess/ProcessAssertion.cpp:
974         (WebKit::ProcessAssertion::ProcessAssertion):
975         (WebKit::ProcessAssertion::setState):
976         * UIProcess/ProcessAssertion.h:
977         (WebKit::ProcessAssertion::Client::~Client):
978         (WebKit::ProcessAssertion::setClient):
979         (WebKit::ProcessAssertion::client):
980         * UIProcess/ProcessThrottler.cpp:
981         (WebKit::ProcessThrottler::didConnectToProcess):
982         * UIProcess/ProcessThrottler.h:
983         * UIProcess/ios/ProcessAssertionIOS.mm:
984         (-[WKProcessAssertionBackgroundTaskManager dealloc]):
985         (-[WKProcessAssertionBackgroundTaskManager addAssertionNeedingBackgroundTask:]):
986         (-[WKProcessAssertionBackgroundTaskManager removeAssertionNeedingBackgroundTask:]):
987         (-[WKProcessAssertionBackgroundTaskManager _notifyAssertionsOfImminentSuspension]):
988         (-[WKProcessAssertionBackgroundTaskManager _releaseBackgroundTask]):
989         (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
990         (WebKit::ProcessAssertion::ProcessAssertion):
991         (WebKit::ProcessAssertion::processAssertionWasInvalidated):
992         (WebKit::ProcessAssertion::setState):
993         (WebKit::ProcessAndUIAssertion::updateRunInBackgroundCount):
994         (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
995         (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
996         (WebKit::ProcessAndUIAssertion::processAssertionWasInvalidated):
997         (WebKit::ProcessAndUIAssertion::setState):
998         (WebKit::ProcessAndUIAssertion::uiAssertionWillExpireImminently):
999
1000 2019-03-07  Commit Queue  <commit-queue@webkit.org>
1001
1002         Unreviewed, rolling out r242297.
1003         https://bugs.webkit.org/show_bug.cgi?id=195430
1004
1005         Broke Microsoft Visio. (Requested by dydz on #webkit).
1006
1007         Reverted changeset:
1008
1009         "[iOS] Turn mouse event simulation on by default"
1010         https://bugs.webkit.org/show_bug.cgi?id=195218
1011         https://trac.webkit.org/changeset/242297
1012
1013 2019-03-07  John Wilander  <wilander@apple.com>
1014
1015         Resource Load Statistics: Log first-party navigations with link decoration
1016         https://bugs.webkit.org/show_bug.cgi?id=195301
1017         <rdar://problem/48569971>
1018
1019         Reviewed by Brent Fulgham.
1020
1021         This patch adds a call to the network process' resource load statistics to
1022         log cross-site navigations with link decoration. The logging checks if the
1023         source of the navigation is a prevalent resource and if so, sets the
1024         appropriate flag for the destination.
1025
1026         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
1027         (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
1028         (WebKit::ResourceLoadStatisticsDatabaseStore::createSchema):
1029         (WebKit::ResourceLoadStatisticsDatabaseStore::logSubresourceRedirect):
1030         (WebKit::ResourceLoadStatisticsDatabaseStore::logCrossSiteLoadWithLinkDecoration):
1031         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
1032         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
1033         (WebKit::ResourceLoadStatisticsMemoryStore::logCrossSiteLoadWithLinkDecoration):
1034         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
1035         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
1036         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1037         (WebKit::WebResourceLoadStatisticsStore::logCrossSiteLoadWithLinkDecoration):
1038         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1039         * NetworkProcess/NetworkProcess.cpp:
1040         (WebKit::NetworkProcess::committedCrossSiteLoadWithLinkDecoration):
1041             This now receives a completion handler. This is in preparation for
1042             test cases where we need to log such an event and wait for it to
1043             finish before continuing.
1044         * NetworkProcess/NetworkProcess.h:
1045         * NetworkProcess/NetworkProcess.messages.in:
1046         * UIProcess/Network/NetworkProcessProxy.cpp:
1047         (WebKit::NetworkProcessProxy::committedCrossSiteLoadWithLinkDecoration):
1048         * UIProcess/Network/NetworkProcessProxy.h:
1049         * UIProcess/WebPageProxy.cpp:
1050         (WebKit::WebPageProxy::didCommitLoadForFrame):
1051         * UIProcess/WebProcessPool.cpp:
1052         (WebKit::WebProcessPool::committedCrossSiteLoadWithLinkDecoration):
1053         * UIProcess/WebProcessPool.h:
1054
1055 2019-03-07  Per Arne Vollan  <pvollan@apple.com>
1056
1057         [iOS] Disable permissive call logging in sandbox
1058         https://bugs.webkit.org/show_bug.cgi?id=195288
1059         <rdar://problem/47683804>
1060
1061         Reviewed by Brent Fulgham.
1062
1063         As on macOS, we should enable strict call filtering in sandbox on iOS.
1064
1065         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1066
1067 2019-03-07  Youenn Fablet  <youenn@apple.com>
1068
1069         Introduce a quota manager for Cache API/Service Worker/IDB storage
1070         https://bugs.webkit.org/show_bug.cgi?id=195283
1071
1072         Reviewed by Chris Dumez.
1073
1074         Remove quota handling from Cache API storage and use StorageQuotaManager/StorageQuotaUser.
1075         CacheStorage::Caches becomes a quota user and has a StorageQuotaManager to check for space for any cache API write task.
1076         NetworkProcess is responsible to manage the quota managers.
1077         Quota managers will go through network process to ask UIProcess for quota extension.
1078
1079         Remove pending callback handling from CacheStorage since they are queued in QuotaManager now.
1080
1081         * NetworkProcess/NetworkProcess.cpp:
1082         (WebKit::NetworkProcess::~NetworkProcess):
1083         (WebKit::NetworkProcess::destroySession):
1084         (WebKit::NetworkProcess::cacheStorageRootPath):
1085         (WebKit::NetworkProcess::setCacheStorageParameters):
1086         (WebKit::NetworkProcess::storageQuotaManager):
1087         * NetworkProcess/NetworkProcess.h:
1088         * NetworkProcess/cache/CacheStorageEngine.cpp:
1089         (WebKit::CacheStorage::Engine::from):
1090         (WebKit::CacheStorage::Engine::Engine):
1091         (WebKit::CacheStorage::Engine::readCachesFromDisk):
1092         * NetworkProcess/cache/CacheStorageEngine.h:
1093         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
1094         (WebKit::CacheStorage::Cache::put):
1095         * NetworkProcess/cache/CacheStorageEngineCache.h:
1096         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1097         (WebKit::CacheStorage::Caches::Caches):
1098         (WebKit::CacheStorage::Caches::~Caches):
1099         (WebKit::CacheStorage::Caches::requestSpace):
1100         (WebKit::CacheStorage::Caches::writeRecord):
1101         * NetworkProcess/cache/CacheStorageEngineCaches.h:
1102
1103 2019-03-07  John Wilander  <wilander@apple.com>
1104
1105         Resource Load Statistics: Make it possible to purge only script-accessible cookies
1106         https://bugs.webkit.org/show_bug.cgi?id=195383
1107         <rdar://problem/48570136>
1108
1109         Reviewed by Brent Fulgham.
1110
1111         This patch provides the ability to purge all script-accessible cookies while leaving
1112         HttpOnly cookies in place.
1113
1114         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
1115         (WebKit::ResourceLoadStatisticsStore::removeDataRecords):
1116         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1117         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
1118             Support for a new boolean flag on whether or not to include HttpOnly Cookies.
1119         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1120         * NetworkProcess/NetworkProcess.cpp:
1121         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
1122             Support for a new boolean flag on whether or not to include HttpOnly Cookies.
1123         (WebKit::NetworkProcess::deleteCookiesForTesting):
1124             Test infrastructure.
1125         * NetworkProcess/NetworkProcess.h:
1126         * NetworkProcess/NetworkProcess.messages.in:
1127         * NetworkProcess/NetworkSession.cpp:
1128         (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
1129             Support for a new boolean flag on whether or not to include HttpOnly Cookies.
1130         * NetworkProcess/NetworkSession.h:
1131         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1132         (WKWebsiteDataStoreStatisticsDeleteCookiesForTesting):
1133             Test infrastructure.
1134         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1135         * UIProcess/Network/NetworkProcessProxy.cpp:
1136         (WebKit::NetworkProcessProxy::deleteCookiesForTesting):
1137             Test infrastructure.
1138         * UIProcess/Network/NetworkProcessProxy.h:
1139         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1140         (WebKit::WebsiteDataStore::deleteCookiesForTesting):
1141             Test infrastructure.
1142         * UIProcess/WebsiteData/WebsiteDataStore.h:
1143
1144 2019-03-07  Carlos Garcia Campos  <cgarcia@igalia.com>
1145
1146         REGRESSION(r242364): [WPE] Do not stop the compositing run loop update timer on suspend
1147         https://bugs.webkit.org/show_bug.cgi?id=195410
1148
1149         Reviewed by Žan Doberšek.
1150
1151         Calling CompositingRunLoop::stopUpdates() on suspend is leaving the threaded compositor in an inconsistent
1152         state, failing to resume and stopping the updates forever. This is causing timeouts in WPE layout tests. Instead
1153         of calling stopUpdates(), a new suspend() is called, that stops the update timer, without changing the current
1154         updae tha compositing state. A new method resume() is also added to schedule an update if needed.
1155
1156         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
1157         (WebKit::CompositingRunLoop::suspend): Set state as suspended and stop the update timer.
1158         (WebKit::CompositingRunLoop::resume): Set state as not suspended and start the update timer if it was scheduled
1159         while suspended.
1160         (WebKit::CompositingRunLoop::scheduleUpdate): Do not start the update timer when suspended.
1161         (WebKit::CompositingRunLoop::compositionCompleted): Ditto.
1162         (WebKit::CompositingRunLoop::updateCompleted): Ditto.
1163         (WebKit::CompositingRunLoop::updateTimerFired): Add an assert to ensure the update timer is not fired while suspended.
1164         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
1165         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1166         (WebKit::ThreadedCompositor::suspend): Call CompositingRunLoop::suspend() instead of stopUpdates().
1167         (WebKit::ThreadedCompositor::resume): Call CompositingRunLoop::resume().
1168
1169 2019-03-06  Mark Lam  <mark.lam@apple.com>
1170
1171         Exception is a JSCell, not a JSObject.
1172         https://bugs.webkit.org/show_bug.cgi?id=195392
1173
1174         Reviewed by Saam Barati.
1175
1176         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
1177         (WebKit::JSNPObject::throwInvalidAccessError):
1178         * WebProcess/Plugins/Netscape/JSNPObject.h:
1179
1180 2019-03-07  Commit Queue  <commit-queue@webkit.org>
1181
1182         Unreviewed, rolling out r242354.
1183         https://bugs.webkit.org/show_bug.cgi?id=195402
1184
1185         breaks layout tests in all configurations (Requested by
1186         zdobersek on #webkit).
1187
1188         Reverted changeset:
1189
1190         "[WPE] Enable web process sandbox"
1191         https://bugs.webkit.org/show_bug.cgi?id=195169
1192         https://trac.webkit.org/changeset/242354
1193
1194 2019-03-06  Ross Kirsling  <ross.kirsling@sony.com>
1195
1196         [Win] Remove -DUCHAR_TYPE=wchar_t stopgap and learn to live with char16_t.
1197         https://bugs.webkit.org/show_bug.cgi?id=195346
1198
1199         Reviewed by Fujii Hironori.
1200
1201         * Platform/IPC/win/ConnectionWin.cpp:
1202         (IPC::Connection::createServerAndClientIdentifiers):
1203         * Platform/win/ModuleWin.cpp:
1204         (WebKit::Module::load):
1205         * UIProcess/Launcher/win/ProcessLauncherWin.cpp:
1206         (WebKit::ProcessLauncher::launchProcess):
1207         * UIProcess/win/WebContextMenuProxyWin.cpp:
1208         (WebKit::createMenuItem):
1209         * UIProcess/win/WebView.cpp:
1210         (WebKit::WebView::setToolTip):
1211         * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp:
1212         (WebKit::InjectedBundle::initialize):
1213         Use wchar helpers as needed.
1214
1215 2019-03-06  Wenson Hsieh  <wenson_hsieh@apple.com>
1216
1217         Crash when attempting to change input type while dismissing datalist suggestions
1218         https://bugs.webkit.org/show_bug.cgi?id=195384
1219         <rdar://problem/48563718>
1220
1221         Reviewed by Brent Fulgham.
1222
1223         See WebCore ChangeLog for more details.
1224
1225         * WebProcess/WebPage/WebPage.cpp:
1226         (WebKit::WebPage::setActiveDataListSuggestionPicker):
1227         (WebKit::WebPage::didSelectDataListOption):
1228         (WebKit::WebPage::didCloseSuggestions):
1229         * WebProcess/WebPage/WebPage.h:
1230
1231         Turn m_activeDataListSuggestionPicker from a raw pointer into a WeakPtr.
1232
1233 2019-03-06  Chris Dumez  <cdumez@apple.com>
1234
1235         [iOS] ProcessDidResume() IPC should be sent upon resuming when ProcessWillSuspendImminently() IPC was sent
1236         https://bugs.webkit.org/show_bug.cgi?id=195382
1237         <rdar://problem/48642739>
1238
1239         Reviewed by Geoffrey Garen.
1240
1241         ProcessDidResume() IPC should be sent upon resuming when ProcessWillSuspendImminently() IPC was sent. Previously,
1242         we only send ProcessDidResume() to the WebProcess if PrepareToSuspend() was sent, not when the more urgent
1243         ProcessWillSuspendImminently() IPC was sent.
1244
1245         This mismatch has lead to bugs because the WebProcess does not know it got resumed and failed to unfreeze the
1246         layers it froze upon suspension.
1247
1248         * UIProcess/ProcessAssertion.h:
1249         (WebKit::ProcessAssertionClient::~ProcessAssertionClient):
1250
1251         * UIProcess/ProcessThrottler.cpp:
1252         (WebKit::ProcessThrottler::updateAssertion):
1253         (WebKit::ProcessThrottler::uiAssertionWillExpireImminently):
1254         (WebKit::ProcessThrottler::assertionWillExpireImminently): Deleted.
1255
1256         * UIProcess/ProcessThrottler.h:
1257         * UIProcess/ios/ProcessAssertionIOS.mm:
1258         (-[WKProcessAssertionBackgroundTaskManager _notifyClientsOfImminentSuspension]):
1259         (WebKit::ProcessAssertion::~ProcessAssertion):
1260         (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
1261         (WebKit::ProcessAndUIAssertion::setClient):
1262
1263         * WebProcess/WebPage/WebPage.cpp:
1264         (WebKit::WebPage::didCompletePageTransition):
1265         Revert change that was landed in r242098 to work around this ProcessThrottler bug.
1266
1267         * WebProcess/WebPage/ios/WebPageIOS.mm:
1268         (WebKit::WebPage::applicationWillEnterForeground):
1269         Revert change that was landed in r242554 to work around this ProcessThrottler bug.
1270
1271 2019-03-06  Alex Christensen  <achristensen@webkit.org>
1272
1273         Add gettid to allowed syscalls on Mac
1274         https://bugs.webkit.org/show_bug.cgi?id=195386
1275         <rdar://problem/48651255>
1276
1277         Reviewed by Brent Fulgham.
1278
1279         * WebProcess/com.apple.WebProcess.sb.in:
1280
1281 2019-03-06  Per Arne Vollan  <pvollan@apple.com>
1282
1283         [macOS] Sandbox call violation causes WebContent process to crash
1284         https://bugs.webkit.org/show_bug.cgi?id=195379
1285         <rdar://problem/48647263>
1286
1287         Reviewed by Brent Fulgham.
1288
1289         A new call needs to be added to the allow list in the WebContent process' sandbox.
1290
1291         * WebProcess/com.apple.WebProcess.sb.in:
1292
1293 2019-03-06  Antti Koivisto  <antti@apple.com>
1294
1295         [iOS] Basic hit testing for content overlapping fast-scrollable overflow
1296         https://bugs.webkit.org/show_bug.cgi?id=195360
1297
1298         Reviewed by Simon Fraser.
1299
1300         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
1301         (WebKit::RemoteLayerTreeHost::makeNode):
1302
1303         Use new UIView subclass for tiled layer hosting (so we know they have content even when contents property is nil).
1304
1305         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
1306         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
1307         (collectDescendantViewsAtPoint):
1308
1309         Factor collection step into a function.
1310         Do basic skipping of event-transparent layers.
1311
1312         (-[UIView _web_findDescendantViewAtPoint:withEvent:]):
1313
1314         To handle overlap cases, find the scroll view that has the deepest non-transparent view hit as its descendant.
1315
1316         (-[UIView _web_recursiveFindDescendantInteractibleViewAtPoint:withEvent:]): Deleted.
1317
1318 2019-03-06  Wenson Hsieh  <wenson_hsieh@apple.com>
1319
1320         Move RenderObject::isTransparentOrFullyClippedRespectingParentFrames() to RenderLayer
1321         https://bugs.webkit.org/show_bug.cgi?id=195300
1322
1323         Reviewed by Simon Fraser.
1324
1325         Refactor some logic to use isTransparentOrFullyClippedRespectingParentFrames on RenderLayer rather than
1326         RenderObject; introduce a helper method to ask whether the enclosing layer of a renderer is transparent or
1327         clipped.
1328
1329         * WebProcess/WebPage/ios/WebPageIOS.mm:
1330         (WebKit::enclosingLayerIsTransparentOrFullyClipped):
1331         (WebKit::WebPage::platformEditorState const):
1332         (WebKit::WebPage::requestEvasionRectsAboveSelection):
1333         (WebKit::WebPage::getFocusedElementInformation):
1334
1335 2019-03-06  Chris Dumez  <cdumez@apple.com>
1336
1337         REGRESSION (r238490): YouTube.com: Returning PiP to Safari after sleeping device loses page
1338         https://bugs.webkit.org/show_bug.cgi?id=195364
1339         <rdar://problem/48538837>
1340
1341         Reviewed by Geoffrey Garen.
1342
1343         Make sure we unset the LayerTreeFreezeReason::ProcessSuspended layer tree freeze reason
1344         when WebPage::applicationWillEnterForeground() is called. This restores pre-r238490
1345         behavior and addresses the issue with PiP on youtube.com.
1346
1347         * WebProcess/WebPage/ios/WebPageIOS.mm:
1348         (WebKit::WebPage::applicationWillEnterForeground):
1349
1350 2019-03-05  Dean Jackson  <dino@apple.com>
1351
1352         Fix WKPasswordView compilation on iOS
1353         https://bugs.webkit.org/show_bug.cgi?id=195344
1354         <rdar://problem/48620066>
1355
1356         Reviewed by Dan Bates.
1357
1358         Use WebKitAdditions.
1359
1360         * UIProcess/ios/WKPasswordView.mm:
1361         (-[WKPasswordView showInScrollView:]):
1362
1363 2019-03-06  Wenson Hsieh  <wenson_hsieh@apple.com>
1364
1365         [iOS] Frequent 1 second IPC deadlocks when showing a paste callout
1366         https://bugs.webkit.org/show_bug.cgi?id=195354
1367         <rdar://problem/48624675>
1368
1369         Reviewed by Tim Horton.
1370
1371         When triggering programmatic paste, we frequently hit deadlocks due to sync IPC going from the UI process to the
1372         web process and vice versa. What happens in this scenario is that prior to triggering programmatic paste, the
1373         page may try to move focus to a different element (e.g. a hidden editable area) before calling `execCommand`.
1374         This causes us to send an ElementDidFocus message to the UI process, followed by RequestDOMPasteAccess.
1375
1376         However, upon receiving ElementDidFocus, we reload input views and (in the process) UIKit requests the
1377         autocorrection context, which we implement in WebKit using a sync message to the web process due to
1378         <rdar://problem/16207002> and its blocking bug <rdar://problem/48383001>. This means we'll end up in a state
1379         where both the UI process and web process are blocked on each other waiting for a sync IPC response, and the UI
1380         process is hung for a second until the IPC message times out.
1381
1382         Ideally, we should fix this by addressing <rdar://problem/16207002>. However, this requires potentially large
1383         changes in UIKit (<rdar://problem/48383001>); for the time being, work around this deadlock by refactoring
1384         synchronous autocorrection context requests such that they can be resolved by an out-of-band IPC response
1385         (HandleAutocorrectionContext). Then prior to requesting DOM paste access, preemptively send a
1386         HandleAutocorrectionContext message to the UI process to unblock any pending synchronous autocorrection context
1387         requests.
1388
1389         * UIProcess/PageClient.h:
1390         * UIProcess/WebPageProxy.h:
1391         * UIProcess/WebPageProxy.messages.in:
1392         * UIProcess/ios/PageClientImplIOS.h:
1393         * UIProcess/ios/PageClientImplIOS.mm:
1394         (WebKit::PageClientImpl::handleAutocorrectionContext):
1395         * UIProcess/ios/WKContentViewInteraction.h:
1396
1397         Make it possible for WKContentView to remember its current pending autocorrection context completion handler.
1398         This is invoked and cleared out in `-_invokePendingAutocorrectionContextHandler:`.
1399
1400         * UIProcess/ios/WKContentViewInteraction.mm:
1401         (-[WKContentView _invokePendingAutocorrectionContextHandler:]):
1402         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
1403         (-[WKContentView _handleAutocorrectionContext:]):
1404
1405         Handle an autocorrection context response. This is invoked when the web process either handles an autocorrection
1406         context message, or when it preemptively sends an autocorrection context before requesting DOM paste access.
1407
1408         (+[WKAutocorrectionContext emptyAutocorrectionContext]):
1409
1410         Add a helper to create an empty autocorrection context.
1411
1412         * UIProcess/ios/WebPageProxyIOS.mm:
1413         (WebKit::WebPageProxy::requestAutocorrectionContext):
1414         (WebKit::WebPageProxy::handleAutocorrectionContext):
1415         (WebKit::WebPageProxy::autocorrectionContextSync): Deleted.
1416
1417         Removed this sync version, since we now only have requestAutocorrectionContext.
1418
1419         * WebProcess/WebPage/WebPage.cpp:
1420         (WebKit::WebPage::requestDOMPasteAccess):
1421
1422         Send WebPageProxy::HandleAutocorrectionContext, and add a FIXME referencing <rdar://problem/16207002>.
1423
1424         * WebProcess/WebPage/WebPage.h:
1425         * WebProcess/WebPage/WebPage.messages.in:
1426
1427         Split AutocorrectionContextSync into RequestAutocorrectionContext and HandleAutocorrectionContext; additionally,
1428         remove the existing RequestAutocorrectionContext message.
1429
1430         * WebProcess/WebPage/ios/WebPageIOS.mm:
1431         (WebKit::WebPage::requestAutocorrectionContext):
1432         (WebKit::WebPage::autocorrectionContextSync): Deleted.
1433
1434 2019-03-06  Rob Buis  <rbuis@igalia.com>
1435
1436         Consider supporting the `referrerpolicy` attribute.
1437         https://bugs.webkit.org/show_bug.cgi?id=179053
1438
1439         Reviewed by Darin Adler.
1440
1441         Add a runtime flag for referrerpolicy attribute.
1442
1443         * Shared/WebPreferences.yaml:
1444         * UIProcess/API/C/WKPreferences.cpp:
1445         (WKPreferencesSetReferrerPolicyAttributeEnabled):
1446         (WKPreferencesGetReferrerPolicyAttributeEnabled):
1447         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1448         * WebProcess/Network/WebLoaderStrategy.cpp:
1449         (WebKit::WebLoaderStrategy::loadResource): do not hardcode choosing
1450         the document referrer policy.
1451
1452 2019-03-06  Philippe Normand  <pnormand@igalia.com>
1453
1454         Unreviewed, WPE build fix after r242503
1455
1456         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
1457         ServiceWorker messages moved from network process to another
1458         header, so it needs to be included.
1459
1460 2019-03-05  David Quesada  <david_quesada@apple.com>
1461
1462         [WK2] It should be possible to follow links with 'download' attributes
1463         https://bugs.webkit.org/show_bug.cgi?id=195145
1464         rdar://problem/48462642
1465
1466         Reviewed by Alex Christensen.
1467
1468         When a link with a 'download' attribute is clicked and the navigation client
1469         says to allow the navigation (i.e. provides PolicyAction::Use),
1470         WebPageProxy::receivedNavigationPolicyDecision() should stop overriding this
1471         decision and downloading the link instead. Instead, web view should honor the
1472         policy chosen by the navigation delegate. This supports clients that want to
1473         offer the user the ability to view, rather than download, the contents of
1474         such links, which is permitted per the HTML spec.
1475
1476         This change is only made on Cocoa platforms for now since no other ports
1477         expose an API on their navigation action to express whether the page intends
1478         to download the linked resource.
1479
1480         * UIProcess/API/APINavigation.h:
1481         (API::Navigation::shouldPerformDownload const):
1482             Rename this to be in line with APINavigationAction's shouldPerformDownload()
1483             for consistency. 'Force' seems like too strong of a word for this property
1484             considering that 'forcing' the download isn't really an attribute inherent
1485             to the navigation, but a behavior implemented by the web page proxy.
1486         (API::Navigation::shouldForceDownload const): Deleted.
1487         * UIProcess/Cocoa/VersionChecks.h:
1488         * UIProcess/WebPageProxy.cpp:
1489         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
1490
1491 2019-03-05  Takashi Komori  <Takashi.Komori@sony.com>
1492
1493         [Curl] Implement Cookie Accept Policy.
1494         https://bugs.webkit.org/show_bug.cgi?id=191645
1495
1496         Reviewed by Fujii Hironori.
1497
1498         * NetworkProcess/Cookies/curl/WebCookieManagerCurl.cpp:
1499         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
1500         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
1501         * NetworkProcess/curl/NetworkDataTaskCurl.cpp:
1502         (WebKit::NetworkDataTaskCurl::curlDidReceiveResponse):
1503         (WebKit::NetworkDataTaskCurl::handleCookieHeaders):
1504         * NetworkProcess/curl/NetworkDataTaskCurl.h:
1505
1506 2019-03-05  Youenn Fablet  <youenn@apple.com>
1507
1508         Introduce ServiceWorkerFetchTask
1509         https://bugs.webkit.org/show_bug.cgi?id=195130
1510
1511         Reviewed by Chris Dumez.
1512
1513         ServiceWorkerFetchTask is added to represent NetworkProcess side of an ongoing fetch intercepted by service worker.
1514         This patch should not change existing behavior.
1515
1516         * CMakeLists.txt:
1517         * DerivedSources-input.xcfilelist:
1518         * DerivedSources-output.xcfilelist:
1519         * DerivedSources.make:
1520         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1521         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
1522         * NetworkProcess/NetworkProcess.cpp:
1523         (WebKit::NetworkProcess::didFailFetch): Deleted.
1524         (WebKit::NetworkProcess::didNotHandleFetch): Deleted.
1525         (WebKit::NetworkProcess::didReceiveFetchRedirectResponse): Deleted.
1526         (WebKit::NetworkProcess::didReceiveFetchResponse): Deleted.
1527         (WebKit::NetworkProcess::didReceiveFetchData): Deleted.
1528         (WebKit::NetworkProcess::didReceiveFetchFormData): Deleted.
1529         (WebKit::NetworkProcess::didFinishFetch): Deleted.
1530         * NetworkProcess/NetworkProcess.h:
1531         * NetworkProcess/NetworkProcess.messages.in:
1532         * NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
1533         (WebKit::WebSWServerConnection::cancelFetch):
1534         (WebKit::WebSWServerConnection::continueDidReceiveFetchResponse):
1535         (WebKit::WebSWServerConnection::startFetch):
1536         (WebKit::WebSWServerConnection::didReceiveFetchRedirectResponse): Deleted.
1537         (WebKit::WebSWServerConnection::didReceiveFetchResponse): Deleted.
1538         (WebKit::WebSWServerConnection::didReceiveFetchData): Deleted.
1539         (WebKit::WebSWServerConnection::didReceiveFetchFormData): Deleted.
1540         (WebKit::WebSWServerConnection::didFinishFetch): Deleted.
1541         (WebKit::WebSWServerConnection::didFailFetch): Deleted.
1542         (WebKit::WebSWServerConnection::didNotHandleFetch): Deleted.
1543         * NetworkProcess/ServiceWorker/WebSWServerConnection.h:
1544         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
1545         (WebKit::WebSWServerToContextConnection::connectionClosed):
1546         (WebKit::WebSWServerToContextConnection::startFetch):
1547         (WebKit::WebSWServerToContextConnection::cancelFetch):
1548         (WebKit::WebSWServerToContextConnection::continueDidReceiveFetchResponse):
1549         (WebKit::WebSWServerToContextConnection::didReceiveFetchTaskMessage):
1550         * NetworkProcess/ServiceWorker/WebSWServerToContextConnection.h:
1551         * SourcesCocoa.txt:
1552         * WebKit.xcodeproj/project.pbxproj:
1553         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1554         (WebKit::WebSWContextManagerConnection::startFetch):
1555         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
1556         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveRedirection):
1557         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveResponse):
1558         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
1559         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormDataAndFinish):
1560         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveBlobChunk):
1561         (WebKit::WebServiceWorkerFetchTaskClient::didFail):
1562         (WebKit::WebServiceWorkerFetchTaskClient::didFinish):
1563         (WebKit::WebServiceWorkerFetchTaskClient::didNotHandle):
1564         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp: Added.
1565         (WebKit::ServiceWorkerFetchTask::didReceiveRedirectResponse):
1566         (WebKit::ServiceWorkerFetchTask::didReceiveResponse):
1567         (WebKit::ServiceWorkerFetchTask::didReceiveData):
1568         (WebKit::ServiceWorkerFetchTask::didReceiveFormData):
1569         (WebKit::ServiceWorkerFetchTask::didFinish):
1570         (WebKit::ServiceWorkerFetchTask::didFail):
1571         (WebKit::ServiceWorkerFetchTask::didNotHandle):
1572         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h: Added.
1573         (WebKit::ServiceWorkerFetchTask::create):
1574         (WebKit::ServiceWorkerFetchTask::Identifier::hash const):
1575         (WebKit::ServiceWorkerFetchTask::identifier const):
1576         (WebKit::ServiceWorkerFetchTask::ServiceWorkerFetchTask):
1577         (WebKit::operator==):
1578         (WTF::ServiceWorkerFetchTaskIdentifierHash::hash):
1579         (WTF::ServiceWorkerFetchTaskIdentifierHash::equal):
1580         (WTF::HashTraits<WebKit::ServiceWorkerFetchTask::Identifier>::emptyValue):
1581         (WTF::HashTraits<WebKit::ServiceWorkerFetchTask::Identifier>::constructDeletedValue):
1582         (WTF::HashTraits<WebKit::ServiceWorkerFetchTask::Identifier>::isDeletedValue):
1583         * NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.messages.in: Added.
1584
1585 2019-03-05  Youenn Fablet  <youenn@apple.com>
1586
1587         Rename requestCacheStorageSpace to requestStorageSpace
1588         https://bugs.webkit.org/show_bug.cgi?id=195282
1589
1590         Reviewed by Chris Dumez.
1591
1592         Make the name more abstract as it might be used in the future for other storage
1593         like IDB or service worker registrations.
1594
1595         * NetworkProcess/NetworkProcess.cpp:
1596         (WebKit::NetworkProcess::requestStorageSpace):
1597         (WebKit::NetworkProcess::requestCacheStorageSpace): Deleted.
1598         * NetworkProcess/NetworkProcess.h:
1599         * NetworkProcess/cache/CacheStorageEngine.cpp:
1600         (WebKit::CacheStorage::Engine::requestSpace):
1601         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1602         (WebsiteDataStoreClient::WebsiteDataStoreClient):
1603         * UIProcess/API/Cocoa/_WKWebsiteDataStoreDelegate.h:
1604         * UIProcess/Network/NetworkProcessProxy.cpp:
1605         (WebKit::NetworkProcessProxy::requestStorageSpace):
1606         (WebKit::NetworkProcessProxy::requestCacheStorageSpace): Deleted.
1607         * UIProcess/Network/NetworkProcessProxy.h:
1608         * UIProcess/Network/NetworkProcessProxy.messages.in:
1609         * UIProcess/WebsiteData/WebsiteDataStoreClient.h:
1610         (WebKit::WebsiteDataStoreClient::requestStorageSpace):
1611         (WebKit::WebsiteDataStoreClient::requestCacheStorageSpace): Deleted.
1612
1613 2019-03-05  Chris Dumez  <cdumez@apple.com>
1614
1615         Drop cached WebProcesses for a given session when this session is destroyed
1616         https://bugs.webkit.org/show_bug.cgi?id=195212
1617         <rdar://problem/48301483>
1618
1619         Reviewed by Geoffrey Garen.
1620
1621         Drop cached WebProcesses for a give session when this session is destroyed. This way, when you close
1622         your private browsing window, all the processes it used get cleared and it cannot leave any state
1623         behind.
1624
1625         * UIProcess/WebProcessCache.cpp:
1626         (WebKit::WebProcessCache::canCacheProcess const):
1627         (WebKit::WebProcessCache::addProcessIfPossible):
1628         (WebKit::WebProcessCache::addProcess):
1629         (WebKit::WebProcessCache::clearAllProcessesForSession):
1630         * UIProcess/WebProcessCache.h:
1631         (WebKit::WebProcessCache::capacity const):
1632         * UIProcess/WebProcessPool.cpp:
1633         (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
1634         (WebKit::WebProcessPool::hasPagesUsingWebsiteDataStore const):
1635         * UIProcess/WebProcessPool.h:
1636
1637 2019-03-05  Brady Eidson  <beidson@apple.com>
1638
1639         Correctly handle sandbox extensions when the same WKWebView loads multiple file:// URLs.
1640         <rdar://problem/47820581> and https://bugs.webkit.org/show_bug.cgi?id=195291
1641
1642         Reviewed by Tim Horton.
1643
1644         * WebProcess/WebPage/WebPage.cpp:
1645         (WebKit::WebPage::SandboxExtensionTracker::shouldReuseCommittedSandboxExtension): If there is a pendingProvisionalSandboxExtension
1646           then its existence should override our willingness to reuse the existing committed extension.
1647         (WebKit::shouldReuseCommittedSandboxExtension): Deleted.
1648         * WebProcess/WebPage/WebPage.h:
1649
1650 2019-03-05  Ryan Haddad  <ryanhaddad@apple.com>
1651
1652         Unreviewed, rolling out r242403.
1653
1654         Caused layout test crashes on iOS simulator.
1655
1656         Reverted changeset:
1657
1658         "[ContentChangeObserver] Introduce fixed duration content
1659         observation"
1660         https://bugs.webkit.org/show_bug.cgi?id=195295
1661         https://trac.webkit.org/changeset/242403
1662
1663 2019-03-05  Loïc Yhuel  <loic.yhuel@softathome.com>
1664
1665         [WPE] Do not create a PlatformDisplay in the Service Worker process
1666         https://bugs.webkit.org/show_bug.cgi?id=194830
1667
1668         Reviewed by Žan Doberšek.
1669
1670         It avoids opening the Wayland socket in this WPEWebProcess, which might cause issues
1671         depending on the platform, and allocates unneeded resources.
1672
1673         * Shared/WebProcessCreationParameters.cpp:
1674         (WebKit::WebProcessCreationParameters::encode const):
1675         (WebKit::WebProcessCreationParameters::decode):
1676         * Shared/WebProcessCreationParameters.h: Add new isServiceWorkerProcess parameter.
1677         * UIProcess/WebProcessPool.cpp:
1678         (WebKit::WebProcessPool::initializeNewWebProcess): Set isServiceWorkerProcess parameter.
1679         * UIProcess/glib/WebProcessPoolGLib.cpp:
1680         (WebKit::WebProcessPool::platformInitializeWebProcess): No implementationLibraryName and hostClientFileDescriptor for Service Worker.
1681         * WebProcess/glib/WebProcessGLib.cpp:
1682         (WebKit::WebProcess::platformInitializeWebProcess): No wpe_loader_init nor PlatformDisplayLibWPE for Service Worker.
1683
1684 2019-03-04  Brady Eidson  <beidson@apple.com>
1685
1686         Unreviewed, rolling out r242376.
1687
1688         Broke some tests
1689
1690         Reverted changeset:
1691
1692         "Correctly handle sandbox extensions when the same WKWebView
1693         loads multiple file:// URLs."
1694         https://bugs.webkit.org/show_bug.cgi?id=195291
1695         https://trac.webkit.org/changeset/242376
1696
1697 2019-03-04  Fujii Hironori  <Hironori.Fujii@sony.com>
1698
1699         Use a SQLite database to hold the ResourceLoadStatistics data
1700         https://bugs.webkit.org/show_bug.cgi?id=194867
1701         <rdar://problem/24240854>
1702
1703         Unreviewed build fix for WinCairo.
1704
1705         ResourceLoadStatisticsDebug and RELEASE_LOG_INFO_IF are not
1706         defined because WinCairo port defines RELEASE_LOG_DISABLED.
1707
1708         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
1709         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess): Enclosed RELEASE_LOG_INFO_IF with #if !RELEASE_LOG_DISABLED.
1710         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener): Ditto.
1711         (WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlocking): Ditto.
1712
1713 2019-03-04  Brent Fulgham  <bfulgham@apple.com>
1714
1715         Use a SQLite database to hold the ResourceLoadStatistics data
1716         https://bugs.webkit.org/show_bug.cgi?id=194867
1717         <rdar://problem/24240854>
1718
1719         Reviewed by Chris Dumez.
1720
1721         The ResourceLoadStatistics database plist is inefficient. It requires more memory use
1722         than it needs, and forces lots of looping and string comparisons to find information.
1723
1724         This problem has already been solved in the form of relational databases. We use them
1725         elsewhere in WebKit, and should do so for this storage as well.
1726
1727         This patch creates an optional SQLite database to handle ITP operations.
1728
1729         1. It adds a new internal experimental feature flag to activate it. It requires the user
1730            exit and restart the process to take effect.
1731         2. It populates itself from the existing plist file (if it exists).
1732         3. It stops using the plist in favor of the database.
1733         4. It does queries and other operations using the database instead of the old hash table
1734            implementation.
1735
1736         This patch refactors the exisiting ResourceLoadStatisticsMemoryStore class into a base
1737         ResourceLoadStatisticsStore class, which ResourceLoadStatisticsMemoryStore is based on.
1738         It adds a new ResourceLoadStatisticsDatabaseStore that is implemented in terms of SQL
1739         operations.
1740
1741         These code changes should not have any impact on existing operations, and when enabled
1742         should produce the same test results.
1743
1744         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: Added.
1745         (WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
1746         (WebKit::ResourceLoadStatisticsDatabaseStore::createSchema):
1747         (WebKit::ResourceLoadStatisticsDatabaseStore::prepareStatements):
1748         (WebKit::ResourceLoadStatisticsDatabaseStore::insertObservedDomain):
1749         (WebKit::ResourceLoadStatisticsDatabaseStore::relationshipExists const):
1750         (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationship):
1751         (WebKit::ResourceLoadStatisticsDatabaseStore::confirmDomainDoesNotExist const):
1752         (WebKit::ResourceLoadStatisticsDatabaseStore::domainIDFromString const):
1753         (WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationships):
1754         (WebKit::ResourceLoadStatisticsDatabaseStore::databaseIsEmpty const):
1755         (WebKit::ResourceLoadStatisticsDatabaseStore::populateFromMemoryStore):
1756         (WebKit::ResourceLoadStatisticsDatabaseStore::calculateAndSubmitTelemetry const):
1757         (WebKit::ResourceLoadStatisticsDatabaseStore::incrementRecordsDeletedCountForDomains):
1758         (WebKit::ResourceLoadStatisticsDatabaseStore::recursivelyFindNonPrevalentDomainsThatRedirectedToThisDomain):
1759         (WebKit::buildList):
1760         (WebKit::ResourceLoadStatisticsDatabaseStore::markAsPrevalentIfHasRedirectedToPrevalent):
1761         (WebKit::listToString):
1762         (WebKit::ResourceLoadStatisticsDatabaseStore::findNotVeryPrevalentResources):
1763         (WebKit::ResourceLoadStatisticsDatabaseStore::reclassifyResources):
1764         (WebKit::ResourceLoadStatisticsDatabaseStore::classifyPrevalentResources):
1765         (WebKit::ResourceLoadStatisticsDatabaseStore::syncStorageIfNeeded):
1766         (WebKit::ResourceLoadStatisticsDatabaseStore::syncStorageImmediately):
1767         (WebKit::ResourceLoadStatisticsDatabaseStore::hasStorageAccess):
1768         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess):
1769         (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener):
1770         (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccess):
1771         (WebKit::ResourceLoadStatisticsDatabaseStore::grantStorageAccessInternal):
1772         (WebKit::ResourceLoadStatisticsDatabaseStore::grandfatherDataForDomains):
1773         (WebKit::ResourceLoadStatisticsDatabaseStore::ensurePrevalentResourcesForDebugMode):
1774         (WebKit::ResourceLoadStatisticsDatabaseStore::logFrameNavigation):
1775         (WebKit::ResourceLoadStatisticsDatabaseStore::logSubresourceLoading):
1776         (WebKit::ResourceLoadStatisticsDatabaseStore::logSubresourceRedirect):
1777         (WebKit::ResourceLoadStatisticsDatabaseStore::setUserInteraction):
1778         (WebKit::ResourceLoadStatisticsDatabaseStore::logUserInteraction):
1779         (WebKit::ResourceLoadStatisticsDatabaseStore::clearUserInteraction):
1780         (WebKit::ResourceLoadStatisticsDatabaseStore::hasHadUserInteraction):
1781         (WebKit::ResourceLoadStatisticsDatabaseStore::setPrevalentResource):
1782         (WebKit::ResourceLoadStatisticsDatabaseStore::setDomainsAsPrevalent):
1783         (WebKit::ResourceLoadStatisticsDatabaseStore::dumpResourceLoadStatistics const):
1784         (WebKit::ResourceLoadStatisticsDatabaseStore::predicateValueForDomain const):
1785         (WebKit::ResourceLoadStatisticsDatabaseStore::isPrevalentResource const):
1786         (WebKit::ResourceLoadStatisticsDatabaseStore::isVeryPrevalentResource const):
1787         (WebKit::ResourceLoadStatisticsDatabaseStore::isRegisteredAsSubresourceUnder const):
1788         (WebKit::ResourceLoadStatisticsDatabaseStore::isRegisteredAsSubFrameUnder const):
1789         (WebKit::ResourceLoadStatisticsDatabaseStore::isRegisteredAsRedirectingTo const):
1790         (WebKit::ResourceLoadStatisticsDatabaseStore::clearPrevalentResource):
1791         (WebKit::ResourceLoadStatisticsDatabaseStore::setGrandfathered):
1792         (WebKit::ResourceLoadStatisticsDatabaseStore::isGrandfathered const):
1793         (WebKit::ResourceLoadStatisticsDatabaseStore::setSubframeUnderTopFrameOrigin):
1794         (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUnderTopFrameOrigin):
1795         (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUniqueRedirectTo):
1796         (WebKit::ResourceLoadStatisticsDatabaseStore::setSubresourceUniqueRedirectFrom):
1797         (WebKit::ResourceLoadStatisticsDatabaseStore::setTopFrameUniqueRedirectTo):
1798         (WebKit::ResourceLoadStatisticsDatabaseStore::setTopFrameUniqueRedirectFrom):
1799         (WebKit::ResourceLoadStatisticsDatabaseStore::ensureResourceStatisticsForPrimaryDomain):
1800         (WebKit::ResourceLoadStatisticsDatabaseStore::clear):
1801         (WebKit::ResourceLoadStatisticsDatabaseStore::cookieTreatmentForOrigin const):
1802         (WebKit::ResourceLoadStatisticsDatabaseStore::hasUserGrantedStorageAccessThroughPrompt):
1803         (WebKit::ResourceLoadStatisticsDatabaseStore::domainsToBlock const):
1804         (WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlocking):
1805         (WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlockingForDomains):
1806         (WebKit::ResourceLoadStatisticsDatabaseStore::clearBlockingStateForDomains):
1807         (WebKit::ResourceLoadStatisticsDatabaseStore::processStatistics const):
1808         (WebKit::ResourceLoadStatisticsDatabaseStore::prevalentDomains const):
1809         (WebKit::ResourceLoadStatisticsDatabaseStore::findExpiredUserInteractions const):
1810         (WebKit::ResourceLoadStatisticsDatabaseStore::clearExpiredUserInteractions):
1811         (WebKit::ResourceLoadStatisticsDatabaseStore::clearGrandfathering):
1812         (WebKit::ResourceLoadStatisticsDatabaseStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
1813         (WebKit::ResourceLoadStatisticsDatabaseStore::pruneStatisticsIfNeeded):
1814         (WebKit::ResourceLoadStatisticsDatabaseStore::updateLastSeen):
1815         (WebKit::ResourceLoadStatisticsDatabaseStore::setLastSeen):
1816         (WebKit::ResourceLoadStatisticsDatabaseStore::setVeryPrevalentResource):
1817         (WebKit::ResourceLoadStatisticsDatabaseStore::removeAllStorageAccess):
1818         * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h: Added.
1819         (WebKit::ResourceLoadStatisticsDatabaseStore::isEmpty const):
1820         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
1821         (WebKit::ResourceLoadStatisticsMemoryStore::ResourceLoadStatisticsMemoryStore):
1822         (WebKit::ResourceLoadStatisticsMemoryStore::incrementRecordsDeletedCountForDomains):
1823         (WebKit::ResourceLoadStatisticsMemoryStore::classifyPrevalentResources):
1824         (WebKit::ResourceLoadStatisticsMemoryStore::syncStorageIfNeeded):
1825         (WebKit::ResourceLoadStatisticsMemoryStore::syncStorageImmediately):
1826         (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherDataForDomains):
1827         (WebKit::domainsToString): Deleted.
1828         (WebKit::OperatingDate::fromWallTime): Deleted.
1829         (WebKit::OperatingDate::today): Deleted.
1830         (WebKit::OperatingDate::secondsSinceEpoch const): Deleted.
1831         (WebKit::OperatingDate::operator== const): Deleted.
1832         (WebKit::OperatingDate::operator< const): Deleted.
1833         (WebKit::OperatingDate::operator<= const): Deleted.
1834         (WebKit::OperatingDate::OperatingDate): Deleted.
1835         (WebKit::mergeOperatingDates): Deleted.
1836         (WebKit::computeImportance): Deleted.
1837         (WebKit::ResourceLoadStatisticsMemoryStore::~ResourceLoadStatisticsMemoryStore): Deleted.
1838         (WebKit::ResourceLoadStatisticsMemoryStore::setNotifyPagesWhenDataRecordsWereScanned): Deleted.
1839         (WebKit::ResourceLoadStatisticsMemoryStore::setShouldClassifyResourcesBeforeDataRecordsRemoval): Deleted.
1840         (WebKit::ResourceLoadStatisticsMemoryStore::setShouldSubmitTelemetry): Deleted.
1841         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords): Deleted.
1842         (WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords): Deleted.
1843         (WebKit::ResourceLoadStatisticsMemoryStore::grandfatherExistingWebsiteData): Deleted.
1844         (WebKit::ResourceLoadStatisticsMemoryStore::setResourceLoadStatisticsDebugMode): Deleted.
1845         (WebKit::ResourceLoadStatisticsMemoryStore::setPrevalentResourceForDebugMode): Deleted.
1846         (WebKit::ResourceLoadStatisticsMemoryStore::scheduleStatisticsProcessingRequestIfNecessary): Deleted.
1847         (WebKit::ResourceLoadStatisticsMemoryStore::cancelPendingStatisticsProcessingRequest): Deleted.
1848         (WebKit::ResourceLoadStatisticsMemoryStore::setTimeToLiveUserInteraction): Deleted.
1849         (WebKit::ResourceLoadStatisticsMemoryStore::setMinimumTimeBetweenDataRecordsRemoval): Deleted.
1850         (WebKit::ResourceLoadStatisticsMemoryStore::setGrandfatheringTime): Deleted.
1851         (WebKit::ResourceLoadStatisticsMemoryStore::setCacheMaxAgeCap): Deleted.
1852         (WebKit::ResourceLoadStatisticsMemoryStore::updateCacheMaxAgeCap): Deleted.
1853         (WebKit::ResourceLoadStatisticsMemoryStore::setAgeCapForClientSideCookies): Deleted.
1854         (WebKit::ResourceLoadStatisticsMemoryStore::updateClientSideCookiesAgeCap): Deleted.
1855         (WebKit::ResourceLoadStatisticsMemoryStore::shouldRemoveDataRecords const): Deleted.
1856         (WebKit::ResourceLoadStatisticsMemoryStore::setDataRecordsBeingRemoved): Deleted.
1857         (WebKit::debugLogDomainsInBatches): Deleted.
1858         (WebKit::ResourceLoadStatisticsMemoryStore::includeTodayAsOperatingDateIfNecessary): Deleted.
1859         (WebKit::ResourceLoadStatisticsMemoryStore::hasStatisticsExpired const): Deleted.
1860         (WebKit::ResourceLoadStatisticsMemoryStore::setMaxStatisticsEntries): Deleted.
1861         (WebKit::ResourceLoadStatisticsMemoryStore::setPruneEntriesDownTo): Deleted.
1862         (WebKit::ResourceLoadStatisticsMemoryStore::resetParametersToDefaultValues): Deleted.
1863         (WebKit::ResourceLoadStatisticsMemoryStore::logTestingEvent): Deleted.
1864         (WebKit::ResourceLoadStatisticsMemoryStore::didCreateNetworkProcess): Deleted.
1865         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
1866         (WebKit::ResourceLoadStatisticsMemoryStore::data const):
1867         (WebKit::ResourceLoadStatisticsMemoryStore::isDebugModeEnabled const): Deleted.
1868         (WebKit::ResourceLoadStatisticsMemoryStore::store const): Deleted.
1869         (WebKit::ResourceLoadStatisticsMemoryStore::setStorageAccessPromptsEnabled): Deleted.
1870         (WebKit::ResourceLoadStatisticsMemoryStore::setDebugLogggingEnabled): Deleted.
1871         (): Deleted.
1872         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp: Added.
1873         (WebKit::domainsToString):
1874         (WebKit::OperatingDate::fromWallTime):
1875         (WebKit::OperatingDate::today):
1876         (WebKit::OperatingDate::secondsSinceEpoch const):
1877         (WebKit::OperatingDate::operator== const):
1878         (WebKit::OperatingDate::operator< const):
1879         (WebKit::OperatingDate::operator<= const):
1880         (WebKit::ResourceLoadStatisticsStore::ResourceLoadStatisticsStore):
1881         (WebKit::ResourceLoadStatisticsStore::~ResourceLoadStatisticsStore):
1882         (WebKit::ResourceLoadStatisticsStore::calculateAndSubmitTelemetry const):
1883         (WebKit::ResourceLoadStatisticsStore::computeImportance):
1884         (WebKit::ResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
1885         (WebKit::ResourceLoadStatisticsStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
1886         (WebKit::ResourceLoadStatisticsStore::setShouldSubmitTelemetry):
1887         (WebKit::ResourceLoadStatisticsStore::removeDataRecords):
1888         (WebKit::ResourceLoadStatisticsStore::processStatisticsAndDataRecords):
1889         (WebKit::ResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
1890         (WebKit::ResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
1891         (WebKit::ResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
1892         (WebKit::ResourceLoadStatisticsStore::scheduleStatisticsProcessingRequestIfNecessary):
1893         (WebKit::ResourceLoadStatisticsStore::cancelPendingStatisticsProcessingRequest):
1894         (WebKit::ResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
1895         (WebKit::ResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
1896         (WebKit::ResourceLoadStatisticsStore::setGrandfatheringTime):
1897         (WebKit::ResourceLoadStatisticsStore::setCacheMaxAgeCap):
1898         (WebKit::ResourceLoadStatisticsStore::updateCacheMaxAgeCap):
1899         (WebKit::ResourceLoadStatisticsStore::setAgeCapForClientSideCookies):
1900         (WebKit::ResourceLoadStatisticsStore::updateClientSideCookiesAgeCap):
1901         (WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords const):
1902         (WebKit::ResourceLoadStatisticsStore::setDataRecordsBeingRemoved):
1903         (WebKit::ResourceLoadStatisticsStore::updateCookieBlockingForDomains):
1904         (WebKit::ResourceLoadStatisticsStore::clearBlockingStateForDomains):
1905         (WebKit::ResourceLoadStatisticsStore::processStatistics const):
1906         (WebKit::ResourceLoadStatisticsStore::statisticsEpirationTime const):
1907         (WebKit::ResourceLoadStatisticsStore::mergeOperatingDates):
1908         (WebKit::ResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary):
1909         (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired const):
1910         (WebKit::ResourceLoadStatisticsStore::setMaxStatisticsEntries):
1911         (WebKit::ResourceLoadStatisticsStore::setPruneEntriesDownTo):
1912         (WebKit::ResourceLoadStatisticsStore::resetParametersToDefaultValues):
1913         (WebKit::ResourceLoadStatisticsStore::logTestingEvent):
1914         (WebKit::ResourceLoadStatisticsStore::removeAllStorageAccess):
1915         (WebKit::ResourceLoadStatisticsStore::didCreateNetworkProcess):
1916         (WebKit::ResourceLoadStatisticsStore::debugLogDomainsInBatches):
1917         * NetworkProcess/Classifier/ResourceLoadStatisticsStore.h: Copied from Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h.
1918         (WebKit::OperatingDate::OperatingDate):
1919         (WebKit::ResourceLoadStatisticsStore::isEmpty const):
1920         (WebKit::ResourceLoadStatisticsStore::data const):
1921         (WebKit::ResourceLoadStatisticsStore::isDebugModeEnabled const):
1922         (WebKit::ResourceLoadStatisticsStore::store const):
1923         (WebKit::ResourceLoadStatisticsStore::setStorageAccessPromptsEnabled):
1924         (WebKit::ResourceLoadStatisticsStore::setDebugLogggingEnabled):
1925         * NetworkProcess/Classifier/ResourceLoadStatisticsStoreCocoa.mm: Renamed from Source/WebKit/UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm.
1926         (WebKit::ResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
1927         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
1928         (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
1929         (WebKit::WebResourceLoadStatisticsStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
1930         (WebKit::WebResourceLoadStatisticsStore::setShouldSubmitTelemetry):
1931         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1932         (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
1933         (WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
1934         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResourceForDebugMode):
1935         (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
1936         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
1937         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
1938         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
1939         (WebKit::WebResourceLoadStatisticsStore::grantStorageAccess):
1940         (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
1941         (WebKit::WebResourceLoadStatisticsStore::logFrameNavigation):
1942         (WebKit::WebResourceLoadStatisticsStore::logWebSocketLoading):
1943         (WebKit::WebResourceLoadStatisticsStore::logSubresourceLoading):
1944         (WebKit::WebResourceLoadStatisticsStore::logSubresourceRedirect):
1945         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
1946         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
1947         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
1948         (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
1949         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
1950         (WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
1951         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
1952         (WebKit::WebResourceLoadStatisticsStore::isVeryPrevalentResource):
1953         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubresourceUnder):
1954         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
1955         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
1956         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
1957         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
1958         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
1959         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
1960         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
1961         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
1962         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
1963         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
1964         (WebKit::WebResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
1965         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdate):
1966         (WebKit::WebResourceLoadStatisticsStore::scheduleCookieBlockingUpdateForDomains):
1967         (WebKit::WebResourceLoadStatisticsStore::scheduleClearBlockingStateForDomains):
1968         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
1969         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
1970         (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
1971         (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime):
1972         (WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries):
1973         (WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo):
1974         (WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
1975         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
1976         * NetworkProcess/NetworkProcess.cpp:
1977         (WebKit::NetworkProcess::initializeNetworkProcess):
1978         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1979         (WebKit::NetworkProcessCreationParameters::encode const):
1980         (WebKit::NetworkProcessCreationParameters::decode):
1981         * NetworkProcess/NetworkProcessCreationParameters.h:
1982         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
1983         (WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
1984         * Platform/classifier/ResourceLoadStatisticsClassifier.h:
1985         * Shared/WebPreferences.yaml:
1986         * Sources.txt:
1987         * SourcesCocoa.txt:
1988         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1989         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1990         * UIProcess/WebProcessPool.cpp:
1991         * WebKit.xcodeproj/project.pbxproj:
1992
1993 2019-03-04  Zalan Bujtas  <zalan@apple.com>
1994
1995         [ContentChangeObserver] Introduce fixed duration content observation
1996         https://bugs.webkit.org/show_bug.cgi?id=195295
1997         <rdar://problem/48579913>
1998
1999         Reviewed by Simon Fraser.
2000
2001         * WebProcess/WebPage/ios/WebPageIOS.mm:
2002         (WebKit::WebPage::handleSyntheticClick):
2003
2004 2019-03-04  Truitt Savell  <tsavell@apple.com>
2005
2006         Unreviewed, rolling out r242396.
2007
2008         Found issue to be unrelated. reverting my rollout.
2009
2010         Reverted changeset:
2011
2012         "Unreviewed, rolling out r242222."
2013         https://bugs.webkit.org/show_bug.cgi?id=193683
2014         https://trac.webkit.org/changeset/242396
2015
2016 2019-03-04  Jiewen Tan  <jiewen_tan@apple.com>
2017
2018         Unreviewed, a followup after r242336
2019
2020         * UIProcess/WebPageProxy.cpp:
2021         (WebKit::WebPageProxy::webViewDidMoveToWindow):
2022         Copy the list of observers before iterating it to avoid observers modifying the list.
2023
2024 2019-03-04  Truitt Savell  <tsavell@apple.com>
2025
2026         Unreviewed, rolling out r242222.
2027
2028         Broke internal debug testing
2029
2030         Reverted changeset:
2031
2032         "[iOS] Move calls to [UIKeyboard isInHardwareKeyboardMode] to
2033         the UI process."
2034         https://bugs.webkit.org/show_bug.cgi?id=193683
2035         https://trac.webkit.org/changeset/242222
2036
2037 2019-03-04  Brent Fulgham  <bfulgham@apple.com>
2038
2039         Unreviewed build fix after r242378
2040
2041         * UIProcess/ios/EditableImageController.mm:
2042         (WebKit::EditableImageController::associateWithAttachment):
2043
2044 2019-03-04  Brent Fulgham  <bfulgham@apple.com>
2045
2046         Check contextIDs when handling WebContent messages
2047         https://bugs.webkit.org/show_bug.cgi?id=195289
2048         <rdar://problem/48475870>
2049
2050         Reviewed by Alex Christensen.
2051
2052         The WebContent process is untrusted because it handles arbitrary markup and javascript from untrusted sources.
2053         We should handle its messages with suspicion, and make sure the arguments are valid and usable before honoring them.
2054
2055         This patch hardens the message passing layer by performing MESSAGE_CHECK in places that had been overlooked.
2056
2057         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
2058         (WebKit::PlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID):
2059         (WebKit::PlaybackSessionManagerProxy::currentTimeChanged):
2060         (WebKit::PlaybackSessionManagerProxy::bufferedTimeChanged):
2061         (WebKit::PlaybackSessionManagerProxy::seekableRangesVectorChanged):
2062         (WebKit::PlaybackSessionManagerProxy::canPlayFastReverseChanged):
2063         (WebKit::PlaybackSessionManagerProxy::audioMediaSelectionOptionsChanged):
2064         (WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionOptionsChanged):
2065         (WebKit::PlaybackSessionManagerProxy::audioMediaSelectionIndexChanged):
2066         (WebKit::PlaybackSessionManagerProxy::legibleMediaSelectionIndexChanged):
2067         (WebKit::PlaybackSessionManagerProxy::externalPlaybackPropertiesChanged):
2068         (WebKit::PlaybackSessionManagerProxy::wirelessVideoPlaybackDisabledChanged):
2069         (WebKit::PlaybackSessionManagerProxy::mutedChanged):
2070         (WebKit::PlaybackSessionManagerProxy::volumeChanged):
2071         (WebKit::PlaybackSessionManagerProxy::durationChanged):
2072         (WebKit::PlaybackSessionManagerProxy::playbackStartedTimeChanged):
2073         (WebKit::PlaybackSessionManagerProxy::rateChanged):
2074         (WebKit::PlaybackSessionManagerProxy::pictureInPictureSupportedChanged):
2075         (WebKit::PlaybackSessionManagerProxy::pictureInPictureActiveChanged):
2076         (WebKit::PlaybackSessionManagerProxy::handleControlledElementIDResponse const):
2077         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
2078         (WebKit::UserMediaCaptureManagerProxy::createMediaSourceForCaptureDeviceWithConstraints):
2079         (WebKit::UserMediaCaptureManagerProxy::startProducingData):
2080         (WebKit::UserMediaCaptureManagerProxy::stopProducingData):
2081         (WebKit::UserMediaCaptureManagerProxy::end):
2082         (WebKit::UserMediaCaptureManagerProxy::capabilities):
2083         (WebKit::UserMediaCaptureManagerProxy::setMuted):
2084         (WebKit::UserMediaCaptureManagerProxy::applyConstraints):
2085         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
2086         (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
2087         (WebKit::VideoFullscreenManagerProxy::setHasVideo):
2088         (WebKit::VideoFullscreenManagerProxy::setVideoDimensions):
2089         (WebKit::VideoFullscreenManagerProxy::enterFullscreen):
2090         (WebKit::VideoFullscreenManagerProxy::exitFullscreen):
2091         (WebKit::VideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode):
2092         (WebKit::VideoFullscreenManagerProxy::setInlineRect):
2093         (WebKit::VideoFullscreenManagerProxy::setHasVideoContentLayer):
2094         (WebKit::VideoFullscreenManagerProxy::cleanupFullscreen):
2095         (WebKit::VideoFullscreenManagerProxy::preparedToReturnToInline):
2096         (WebKit::VideoFullscreenManagerProxy::preparedToExitFullscreen):
2097         * UIProcess/ios/EditableImageController.mm:
2098         (WebKit::EditableImageController::didCreateEditableImage):
2099         (WebKit::EditableImageController::didDestroyEditableImage):
2100         (WebKit::EditableImageController::associateWithAttachment):
2101
2102 2019-03-04  Alex Christensen  <achristensen@webkit.org>
2103
2104         Fix crashes when NetworkResourceLoader/NetworkLoadChecker are destroyed during HTTPS upgrade check
2105         https://bugs.webkit.org/show_bug.cgi?id=195238
2106         <rdar://problem/47598656>
2107
2108         Reviewed by Chris Dumez.
2109
2110         * NetworkProcess/NetworkLoadChecker.cpp:
2111         (WebKit::NetworkLoadChecker::checkRequest):
2112
2113 2019-03-04  Brady Eidson  <beidson@apple.com>
2114
2115         Correctly handle sandbox extensions when the same WKWebView loads multiple file:// URLs.
2116         <rdar://problem/47820581> and https://bugs.webkit.org/show_bug.cgi?id=195291
2117
2118         Reviewed by Andy Estes.
2119
2120         * WebProcess/WebPage/WebPage.cpp:
2121         (WebKit::shouldReuseCommittedSandboxExtension): Only retain the previous sandbox extension if the file URL
2122           we're currently loading is functionally equivalent to the previous one.
2123
2124 2019-03-04  Chris Dumez  <cdumez@apple.com>
2125
2126         Drop legacy userAgentForURL injected bundle SPI
2127         https://bugs.webkit.org/show_bug.cgi?id=195222
2128         <rdar://problem/46734147>
2129
2130         Reviewed by Darin Adler.
2131
2132         Drop legacy userAgentForURL injected bundle SPI. There are no longer any clients, and using
2133         WebsitePolicies.customUserAgent is the way to go nowadays.
2134
2135         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
2136         (API::InjectedBundle::PageLoaderClient::willDestroyFrame):
2137         (API::InjectedBundle::PageLoaderClient::userAgentForURL const): Deleted.
2138         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
2139         * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
2140         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2141         (setUpPageLoaderClient):
2142         (userAgentForURL): Deleted.
2143         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
2144         (WebKit::InjectedBundlePageLoaderClient::userAgentForURL const): Deleted.
2145         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
2146         * WebProcess/WebPage/WebPage.cpp:
2147         (WebKit::WebPage::userAgent const):
2148
2149 2019-03-04  Chris Dumez  <cdumez@apple.com>
2150
2151         Do not share WebProcesses between private and regular sessions
2152         https://bugs.webkit.org/show_bug.cgi?id=195189
2153         <rdar://problem/48421064>
2154
2155         Reviewed by Alex Christensen.
2156
2157         Do not share WebProcesses between private and regular sessions. There are some privacy concerns.
2158         Also, some of the WebsiteDataStore informations are passed via WebProcessCreationParameters (e.g.
2159         ApplicationCache path) and cannot be updated later.
2160
2161         There were 2 cases where this could happen and that are fixed in the patch:
2162         - A process may be prewarmed with a given website data store and then later on used for a page
2163           associated with a different data store. We now prevent this. While this is not necessary for
2164           privacy reasons, it is still useful because our code currently does not support well uses
2165           different sessions inside a single WebProcess, as mentioned above.
2166         - The client can force a WebsiteDataStore swap when responding to the decidePolicyForNavigationAction,
2167           via the WebsitePolicies. To address the issue, we now force a process swap whenever the client
2168           makes such a change.
2169
2170         As a result, WebProcessProxy::websiteDataStore() now makes sense and is always correct. It can
2171         also only contains pages whose WebPageProxy::websiteDataStore() returns the same store.
2172
2173         * UIProcess/API/C/WKContext.cpp:
2174         (WKContextWarmInitialProcess):
2175         * UIProcess/API/Cocoa/WKProcessPool.mm:
2176         (-[WKProcessPool _warmInitialProcess]):
2177         * UIProcess/ProvisionalPageProxy.cpp:
2178         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
2179         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
2180         * UIProcess/WebPageProxy.cpp:
2181         (WebKit::WebPageProxy::notifyProcessPoolToPrewarm):
2182         (WebKit::WebPageProxy::reattachToWebProcess):
2183         (WebKit::WebPageProxy::swapToWebProcess):
2184         (WebKit::WebPageProxy::close):
2185         (WebKit::WebPageProxy::receivedNavigationPolicyDecision):
2186         (WebKit::WebPageProxy::commitProvisionalPage):
2187         (WebKit::WebPageProxy::creationParameters):
2188         * UIProcess/WebPageProxy.h:
2189         (WebKit::WebPageProxy::websiteDataStore):
2190         * UIProcess/WebProcessPool.cpp:
2191         (WebKit::WebProcessPool::ensureNetworkProcess):
2192         (WebKit::WebProcessPool::tryTakePrewarmedProcess):
2193         (WebKit::WebProcessPool::prewarmProcess):
2194         (WebKit::WebProcessPool::createWebPage):
2195         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
2196         (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
2197         (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):
2198         (WebKit::WebProcessPool::processForNavigation):
2199         (WebKit::WebProcessPool::processForNavigationInternal):
2200         (WebKit::WebProcessPool::findReusableSuspendedPageProcess):
2201         * UIProcess/WebProcessPool.h:
2202         (WebKit::WebProcessPool::sendToOneProcess):
2203         * UIProcess/WebProcessProxy.cpp:
2204         (WebKit::WebProcessProxy::createWebPage):
2205         (WebKit::WebProcessProxy::addExistingWebPage):
2206         (WebKit::WebProcessProxy::removeWebPage):
2207         * UIProcess/WebProcessProxy.h:
2208
2209 2019-03-04  Chris Dumez  <cdumez@apple.com>
2210
2211         [iOS] Improve our file picker
2212         https://bugs.webkit.org/show_bug.cgi?id=195284
2213         <rdar://problem/45655856>
2214
2215         Reviewed by Tim Horton and Wenson Hsieh.
2216
2217         Improve our file picker on iOS so that:
2218         - Accepted file extensions specified in the HTML (e.g. <input type="file"> accept=".pdf">) are now
2219           properly reflected in the file picker. Previously, we only we only supported MIME types in the
2220           accept attribute that only Image / Video ones.
2221         - If accepted types are specified in the HTML and not of them are Video or Image types, then bypass
2222           the UIDocumentMenuViewController and show the file picker directly (as if the user had tapped on
2223           "Browse..." on that menu). Other menu items such as "Take Photo or Video" and "Photo Library" do
2224           not make sense if the page only accepts PDF files for example.
2225
2226         Things that we should do but are not fixed in this patch:
2227         - Stop using UIDocumentMenuViewController entirely since it was deprecated in favor of using
2228           UIDocumentPickerViewController directly.
2229         - Add multiple selection support, which is supported both on the HTML side and in the
2230           UIDocumentPickerViewController API.
2231
2232         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2233         (arrayContainsUTIThatConformsTo):
2234         (-[WKFileUploadPanel dealloc]):
2235         (-[WKFileUploadPanel presentWithParameters:resultListener:]):
2236         (UTIsForMIMETypes):
2237         (-[WKFileUploadPanel _mediaTypesForPickerSourceType:]):
2238         (-[WKFileUploadPanel _cameraButtonLabelAllowingPhoto:allowingVideo:]):
2239         (-[WKFileUploadPanel _showDocumentPickerMenu]):
2240
2241 2019-03-04  Alex Christensen  <achristensen@webkit.org>
2242
2243         REGRESSION: ( r240978-r240985 ) [ iOS Release ] Layout Test imported/w3c/web-platform-tests/xhr/send-redirect-post-upload.htm is crashing
2244         https://bugs.webkit.org/show_bug.cgi?id=194523
2245
2246         Reviewed by Ryosuke Niwa.
2247
2248         Attempt to work around a CFNetwork bug in the timing of tearing down tasks with upload streams.
2249         See rdar://problem/28233746.
2250
2251         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2252         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2253         (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
2254         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2255         (-[WKNetworkSessionDelegate URLSession:task:needNewBodyStream:]):
2256
2257 2019-03-04  Carlos Garcia Campos  <cgarcia@igalia.com>
2258
2259         [CoordinatedGraphics] The compositing loop is still running even after exiting AC mode
2260         https://bugs.webkit.org/show_bug.cgi?id=195270
2261
2262         Reviewed by Don Olmstead.
2263
2264         Suspend the threaded compositor when the painting is paused or layer flush disabled, and resume it again when
2265         painting is resumed and layer flush enabled.
2266
2267         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2268         (WebKit::ThreadedCompositor::suspend): Increment the suspend counter and mark the scene as inactive if it was suspended.
2269         (WebKit::ThreadedCompositor::resume): Decrement the suspend counter and mark the scene as active if it's now resumed.
2270         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
2271         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
2272         (WebKit::DrawingAreaCoordinatedGraphics::forceRepaint): Return early if layer tree state is frozen.
2273         (WebKit::DrawingAreaCoordinatedGraphics::forceRepaintAsync): Ditto.
2274         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
2275         (WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled): Call ThreadedCompositor::suspend()/resume().
2276         (WebKit::LayerTreeHost::pauseRendering): Call ThreadedCompositor::suspend.
2277         (WebKit::LayerTreeHost::resumeRendering): Call ThreadedCompositor::resume().
2278
2279 2019-03-04  Simon Fraser  <simon.fraser@apple.com>
2280
2281         Share more code between overflow and frame scrolling nodes, fixing overflow scrollbar display
2282         https://bugs.webkit.org/show_bug.cgi?id=195258
2283
2284         Reviewed by Antti Koivisto.
2285
2286         This patch moves management of scrollbar layers and scrollbar painters ("NSScrollerImp") down to
2287         ScrollingStateScrollingNode to be shared between frame and overflow nodes, allowing for
2288         scrolling thread updates of overflow scrollbars. It also moves some scrolling tree-side code
2289         to ScrollingTreeScrollingNodeDelegateMac to be shared between the "tree" nodes for overflow and frames.
2290
2291         Layers for scrollbars are given to scrolling state nodes via setNodeLayers() now, and
2292         RenderLayerCompositor::updateScrollingNodeLayers() is added to provide a bottleneck to call that.
2293         At some point AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() should be relieved
2294         of the responsibility of pushing scrollbar layers (but the scrolling state tree needs to hold
2295         references to GraphicsLayers before that becomes safe).
2296         
2297         The actual fix that allows overflow scrollbars to show is the change in
2298         AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() that calls scrollableArea.*ScrollbarLayerDidChange()
2299         for all ScrollableAreas. This ensures that the CALayer is pushed onto the NSScrollerImp.
2300
2301         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
2302         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
2303         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
2304         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
2305         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
2306         * SourcesCocoa.txt:
2307         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
2308         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
2309         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
2310         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
2311         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
2312         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::commitStateBeforeChildren):
2313         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::repositionRelatedLayers):
2314         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::handleMouseEvent):
2315         * UIProcess/RemoteLayerTree/mac/ScrollingTreeOverflowScrollingNodeRemoteMac.cpp: Copied from Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp.
2316         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::create):
2317         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::ScrollingTreeOverflowScrollingNodeRemoteMac):
2318         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::~ScrollingTreeOverflowScrollingNodeRemoteMac):
2319         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::commitStateBeforeChildren):
2320         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::repositionRelatedLayers):
2321         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::handleWheelEvent):
2322         (WebKit::ScrollingTreeOverflowScrollingNodeRemoteMac::handleMouseEvent):
2323         * WebKit.xcodeproj/project.pbxproj:
2324
2325 2019-03-04  Andy Estes  <aestes@apple.com>
2326
2327         [Apple Pay] Move WebPaymentCoordinatorProxy from Source/WebKit/UIProcess to Source/WebKit/Shared
2328         https://bugs.webkit.org/show_bug.cgi?id=195080
2329         <rdar://problem/48421558>
2330
2331         Reviewed by Antti Koivisto.
2332
2333         * CMakeLists.txt:
2334         * DerivedSources-input.xcfilelist:
2335         * DerivedSources.make:
2336         * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp.
2337         * Shared/ApplePay/WebPaymentCoordinatorProxy.h: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h.
2338         * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in.
2339         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: Renamed from Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h.
2340         * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: Renamed from Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm.
2341         * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: Renamed from Source/WebKit/UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm.
2342         * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: Renamed from Source/WebKit/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm.
2343         * Shared/mac/WebHitTestResultData.mm:
2344         * SourcesCocoa.txt:
2345         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
2346         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
2347         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
2348         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
2349         * WebKit.xcodeproj/project.pbxproj:
2350
2351 2019-03-04  Jer Noble  <jer.noble@apple.com>
2352
2353         [iOS] Fullscreen "stay in page" option breaks video playback
2354         https://bugs.webkit.org/show_bug.cgi?id=195277
2355         <rdar://problem/48537317>
2356
2357         Reviewed by Eric Carlson.
2358
2359         Make sure we resume media playback when the user chooses "stay in page" from the deceptive
2360         website warning dialog.
2361
2362         * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
2363         (-[WKFullScreenViewController _showPhishingAlert]):
2364
2365 2019-03-04  Michael Catanzaro  <mcatanzaro@igalia.com>
2366
2367         [WPE] Enable web process sandbox
2368         https://bugs.webkit.org/show_bug.cgi?id=195169
2369
2370         Reviewed by Daniel Bates.
2371
2372         * PlatformWPE.cmake:
2373         * UIProcess/Launcher/glib/BubblewrapLauncher.cpp:
2374         (WebKit::bubblewrapSpawn):
2375         * UIProcess/glib/WebProcessPoolGLib.cpp:
2376         (WebKit::WebProcessPool::platformInitialize):
2377
2378 2019-03-04  Adrian Perez de Castro  <aperez@igalia.com>
2379
2380         [GTK][WPE] Wrong license header in WebKit{,WebExtension}Autocleanups.h
2381         https://bugs.webkit.org/show_bug.cgi?id=195245
2382
2383         Reviewed by Carlos Garcia Campos.
2384
2385         Changed license headers to contain the LGPL, which is the correct one for the GTK
2386         and WPE ports. The change was agreed by the contributors to the files involved.
2387
2388         * UIProcess/API/gtk/WebKitAutocleanups.h:
2389         * UIProcess/API/wpe/WebKitAutocleanups.h:
2390         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionAutocleanups.h:
2391         * WebProcess/InjectedBundle/API/wpe/WebKitWebExtensionAutocleanups.h:
2392
2393 2019-03-04  Commit Queue  <commit-queue@webkit.org>
2394
2395         Unreviewed, rolling out r242045.
2396         https://bugs.webkit.org/show_bug.cgi?id=195273
2397
2398         WE not ready to enable PSON yet (Requested by KaL on #webkit).
2399
2400         Reverted changeset:
2401
2402         "[GTK] Enable PSON"
2403         https://bugs.webkit.org/show_bug.cgi?id=194979
2404         https://trac.webkit.org/changeset/242045
2405
2406 2019-03-04  Carlos Garcia Campos  <cgarcia@igalia.com>
2407
2408         [CoordinatedGraphics] Unify DrawingArea classes
2409         https://bugs.webkit.org/show_bug.cgi?id=195167
2410
2411         Reviewed by Žan Doberšek.
2412
2413         Add DrawingAreaProxyCoordinatedGraphics and DrawingAreaCoordinatedGraphics.
2414
2415         * PlatformGTK.cmake:
2416         * PlatformWPE.cmake:
2417         * PlatformWin.cmake:
2418         * Shared/DrawingAreaInfo.h:
2419         * SourcesGTK.txt:
2420         * SourcesWPE.txt:
2421         * UIProcess/API/gtk/PageClientImpl.cpp:
2422         (WebKit::PageClientImpl::createDrawingAreaProxy):
2423         (WebKit::PageClientImpl::viewSize):
2424         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2425         (webkitWebViewBaseRealize):
2426         (webkitWebViewBaseUnrealize):
2427         (webkitWebViewBaseDraw):
2428         (webkitWebViewBaseSizeAllocate):
2429         (webkitWebViewBaseDidRelaunchWebProcess):
2430         (webkitWebViewBasePageClosed):
2431         * UIProcess/API/wpe/PageClientImpl.cpp:
2432         (WebKit::PageClientImpl::createDrawingAreaProxy):
2433         * UIProcess/AcceleratedDrawingAreaProxy.cpp: Removed.
2434         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp: Added.
2435         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingAreaProxyCoordinatedGraphics):
2436         (WebKit::DrawingAreaProxyCoordinatedGraphics::~DrawingAreaProxyCoordinatedGraphics):
2437         (WebKit::DrawingAreaProxyCoordinatedGraphics::paint):
2438         (WebKit::DrawingAreaProxyCoordinatedGraphics::sizeDidChange):
2439         (WebKit::DrawingAreaProxyCoordinatedGraphics::deviceScaleFactorDidChange):
2440         (WebKit::DrawingAreaProxyCoordinatedGraphics::waitForBackingStoreUpdateOnNextPaint):
2441         (WebKit::DrawingAreaProxyCoordinatedGraphics::setBackingStoreIsDiscardable):
2442         (WebKit::DrawingAreaProxyCoordinatedGraphics::update):
2443         (WebKit::DrawingAreaProxyCoordinatedGraphics::didUpdateBackingStoreState):
2444         (WebKit::DrawingAreaProxyCoordinatedGraphics::enterAcceleratedCompositingMode):
2445         (WebKit::DrawingAreaProxyCoordinatedGraphics::exitAcceleratedCompositingMode):
2446         (WebKit::DrawingAreaProxyCoordinatedGraphics::updateAcceleratedCompositingMode):
2447         (WebKit::DrawingAreaProxyCoordinatedGraphics::incorporateUpdate):
2448         (WebKit::DrawingAreaProxyCoordinatedGraphics::alwaysUseCompositing const):
2449         (WebKit::DrawingAreaProxyCoordinatedGraphics::backingStoreStateDidChange):
2450         (WebKit::DrawingAreaProxyCoordinatedGraphics::sendUpdateBackingStoreState):
2451         (WebKit::DrawingAreaProxyCoordinatedGraphics::waitForAndDispatchDidUpdateBackingStoreState):
2452         (WebKit::DrawingAreaProxyCoordinatedGraphics::discardBackingStoreSoon):
2453         (WebKit::DrawingAreaProxyCoordinatedGraphics::discardBackingStore):
2454         (WebKit::DrawingAreaProxyCoordinatedGraphics::setNativeSurfaceHandleForCompositing):
2455         (WebKit::DrawingAreaProxyCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing):
2456         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::DrawingMonitor):
2457         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::~DrawingMonitor):
2458         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::webViewDrawCallback):
2459         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::start):
2460         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::stop):
2461         (WebKit::DrawingAreaProxyCoordinatedGraphics::DrawingMonitor::didDraw):
2462         (WebKit::DrawingAreaProxyCoordinatedGraphics::dispatchAfterEnsuringDrawing):
2463         * UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.h: Renamed from Source/WebKit/UIProcess/AcceleratedDrawingAreaProxy.h.
2464         * UIProcess/DrawingAreaProxyImpl.cpp: Removed.
2465         * UIProcess/DrawingAreaProxyImpl.h: Removed.
2466         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
2467         (WebKit::AcceleratedBackingStoreX11::update):
2468         * UIProcess/win/PageClientImpl.cpp:
2469         (WebKit::PageClientImpl::createDrawingAreaProxy):
2470         * UIProcess/win/WebView.cpp:
2471         (WebKit::WebView::paint):
2472         * WebProcess/WebPage/AcceleratedDrawingArea.cpp: Removed.
2473         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp: Added.
2474         (WebKit::DrawingAreaCoordinatedGraphics::DrawingAreaCoordinatedGraphics):
2475         (WebKit::DrawingAreaCoordinatedGraphics::~DrawingAreaCoordinatedGraphics):
2476         (WebKit::DrawingAreaCoordinatedGraphics::setNeedsDisplay):
2477         (WebKit::DrawingAreaCoordinatedGraphics::setNeedsDisplayInRect):
2478         (WebKit::DrawingAreaCoordinatedGraphics::scroll):
2479         (WebKit::DrawingAreaCoordinatedGraphics::forceRepaint):
2480         (WebKit::DrawingAreaCoordinatedGraphics::forceRepaintAsync):
2481         (WebKit::DrawingAreaCoordinatedGraphics::setLayerTreeStateIsFrozen):
2482         (WebKit::DrawingAreaCoordinatedGraphics::updatePreferences):
2483         (WebKit::DrawingAreaCoordinatedGraphics::mainFrameContentSizeChanged):
2484         (WebKit::DrawingAreaCoordinatedGraphics::deviceOrPageScaleFactorChanged):
2485         (WebKit::DrawingAreaCoordinatedGraphics::didChangeViewportAttributes):
2486         (WebKit::DrawingAreaCoordinatedGraphics::graphicsLayerFactory):
2487         (WebKit::DrawingAreaCoordinatedGraphics::setRootCompositingLayer):
2488         (WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush):
2489         (WebKit::DrawingAreaCoordinatedGraphics::layerHostDidFlushLayers):
2490         (WebKit::DrawingAreaCoordinatedGraphics::createDisplayRefreshMonitor):
2491         (WebKit::DrawingAreaCoordinatedGraphics::setNativeSurfaceHandleForCompositing):
2492         (WebKit::DrawingAreaCoordinatedGraphics::destroyNativeSurfaceHandleForCompositing):
2493         (WebKit::DrawingAreaCoordinatedGraphics::activityStateDidChange):
2494         (WebKit::DrawingAreaCoordinatedGraphics::attachViewOverlayGraphicsLayer):
2495         (WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState):
2496         (WebKit::DrawingAreaCoordinatedGraphics::didUpdate):
2497         (WebKit::DrawingAreaCoordinatedGraphics::sendDidUpdateBackingStoreState):
2498         (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingModeSoon):
2499         (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingModeNow):
2500         (WebKit::DrawingAreaCoordinatedGraphics::discardPreviousLayerTreeHost):
2501         (WebKit::DrawingAreaCoordinatedGraphics::suspendPainting):
2502         (WebKit::DrawingAreaCoordinatedGraphics::resumePainting):
2503         (WebKit::DrawingAreaCoordinatedGraphics::enterAcceleratedCompositingMode):
2504         (WebKit::DrawingAreaCoordinatedGraphics::exitAcceleratedCompositingMode):
2505         (WebKit::DrawingAreaCoordinatedGraphics::scheduleDisplay):
2506         (WebKit::DrawingAreaCoordinatedGraphics::displayTimerFired):
2507         (WebKit::DrawingAreaCoordinatedGraphics::display):
2508         (WebKit::shouldPaintBoundsRect):
2509         * WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.h: Renamed from Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.h.
2510         * WebProcess/WebPage/DrawingArea.cpp:
2511         (WebKit::DrawingArea::create):
2512         * WebProcess/WebPage/DrawingArea.h:
2513         (WebKit::DrawingArea::layerFlushThrottlingIsActive const):
2514         * WebProcess/WebPage/DrawingAreaImpl.cpp: Removed.
2515         * WebProcess/WebPage/DrawingAreaImpl.h: Removed.
2516
2517 2019-03-03  Zalan Bujtas  <zalan@apple.com>
2518
2519         [ContentChangeObserver] Content observation should be limited to the current document.
2520         https://bugs.webkit.org/show_bug.cgi?id=195256
2521         <rdar://problem/48544402>
2522
2523         Reviewed by Simon Fraser.
2524
2525         * WebProcess/WebPage/WebPage.h:
2526         * WebProcess/WebPage/ios/WebPageIOS.mm:
2527         (WebKit::WebPage::handleSyntheticClick):
2528         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
2529         (WebKit::WebPage::completeSyntheticClick):
2530         (WebKit::WebPage::handleTap):
2531         (WebKit::WebPage::handleTwoFingerTapAtPoint):
2532         (WebKit::WebPage::commitPotentialTap):
2533
2534 2019-03-03  Tim Horton  <timothy_horton@apple.com>
2535
2536         Rid the world of WK_API_ENABLED
2537         https://bugs.webkit.org/show_bug.cgi?id=195263
2538
2539         Reviewed by Dan Bernstein.
2540
2541         List of changed files elided because it's useless.
2542
2543 2019-03-03  Jiewen Tan  <jiewen_tan@apple.com>
2544
2545         Add a WebViewDidMoveToWindowObserver for WKWebView
2546         https://bugs.webkit.org/show_bug.cgi?id=195223
2547         <rdar://problem/48520161>
2548
2549         Reviewed by Darin Adler.
2550
2551         The load optimizer would only allow itself to optimize loads whenever the web view
2552         who owns the page is (visible && focused), otherwises it will wait until the web view
2553         becomes (visible && focused). Therefore, we need a way to notify the load optimizer
2554         changes of statuses.
2555
2556         * UIProcess/API/Cocoa/WKWebView.mm:
2557         (-[WKWebView didMoveToWindow]):
2558         * UIProcess/Cocoa/WebViewImpl.mm:
2559         (WebKit::WebViewImpl::viewDidMoveToWindow):
2560         * UIProcess/WebPageProxy.cpp:
2561         (WebKit::WebPageProxy::addWebViewDidMoveToWindowObserver):
2562         (WebKit::WebPageProxy::removeWebViewDidMoveToWindowObserver):
2563         (WebKit::WebPageProxy::webViewDidMoveToWindow):
2564         * UIProcess/WebPageProxy.h:
2565         * UIProcess/WebViewDidMoveToWindowObserver.h: Added.
2566         * WebKit.xcodeproj/project.pbxproj:
2567
2568 2019-03-03  Andy Estes  <aestes@apple.com>
2569
2570         [Apple Pay] Untangle WebPageProxy and WebPaymentCoordinatorProxy
2571         https://bugs.webkit.org/show_bug.cgi?id=195219
2572         <rdar://problem/48518082>
2573
2574         Reviewed by Darin Adler.
2575
2576         Rather than having WebPaymentCoordinatorProxy know about WebPageProxy, give
2577         WebPaymentCoordinatorProxy a client interface that WebPageProxy conforms to.
2578
2579         In a follow-on patch, WebPaymentCoordinatorProxy will have a non-WebPageProxy client.
2580
2581         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
2582         (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Replaced use of
2583         m_webPageProxy with m_client.
2584         (WebKit::WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy): Ditto.
2585         (WebKit::WebPaymentCoordinatorProxy::messageSenderConnection const): Implemented
2586         IPC::MessageSender via m_client.
2587         (WebKit::WebPaymentCoordinatorProxy::messageSenderDestinationID const): Ditto.
2588         (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard): Replaced use of
2589         m_webPageProxy with m_client.
2590         (WebKit::WebPaymentCoordinatorProxy::openPaymentSetup): Ditto.
2591         (WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession): Called our own
2592         MessageSender::send rather than going through m_webPageProxy.
2593         (WebKit::WebPaymentCoordinatorProxy::validateMerchant): Ditto.
2594         (WebKit::WebPaymentCoordinatorProxy::didAuthorizePayment): Ditto.
2595         (WebKit::WebPaymentCoordinatorProxy::didSelectShippingMethod): Ditto.
2596         (WebKit::WebPaymentCoordinatorProxy::didSelectShippingContact): Ditto.
2597         (WebKit::WebPaymentCoordinatorProxy::didSelectPaymentMethod): Ditto.
2598         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h: Defined the Client abstract class and
2599         changed m_webPageProxy to m_client.
2600         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
2601         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2602         (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): Replaced use of
2603         m_webPageProxy with m_client.
2604         (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Renamed from toPKPaymentRequest.
2605         (WebKit::toPKPaymentRequest): Renamed to WebPaymentCoordinatorProxy::platformPaymentRequest.
2606         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
2607         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Replaced use of m_webPageProxy
2608         with m_client.
2609         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
2610         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Ditto.
2611         * UIProcess/AuxiliaryProcessProxy.h:
2612         (WebKit::AuxiliaryProcessProxy::messageReceiverMap): Added.
2613         * UIProcess/WebPageProxy.cpp:
2614         (WebKit::WebPageProxy::paymentCoordinatorConnection): Implemented WebPaymentCoordinatorProxy::Client.
2615         (WebKit::WebPageProxy::paymentCoordinatorMessageReceiver): Ditto.
2616         (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationBundleIdentifier): Ditto.
2617         (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationSecondaryIdentifier): Ditto.
2618         (WebKit::WebPageProxy::paymentCoordinatorDestinationID): Ditto.
2619         * UIProcess/WebPageProxy.h: Made WebPageProxy derive from WebPaymentCoordinatorProxy::Client.
2620         * UIProcess/ios/WebPageProxyIOS.mm:
2621         (WebKit::WebPageProxy::paymentCoordinatorPresentingViewController): Implemented WebPaymentCoordinatorProxy::Client.
2622         (WebKit::WebPageProxy::paymentCoordinatorCTDataConnectionServiceType): Ditto.
2623         * UIProcess/mac/WebPageProxyMac.mm:
2624         (WebKit::WebPageProxy::paymentCoordinatorPresentingWindow): Ditto.
2625         * WebKit.xcodeproj/project.pbxproj:
2626
2627 2019-03-03  Tim Horton  <timothy_horton@apple.com>
2628
2629         Remove some more unused 32-bit code
2630         https://bugs.webkit.org/show_bug.cgi?id=195255
2631
2632         Reviewed by Darin Adler.
2633
2634         * Platform/Module.cpp:
2635         (WebKit::Module::Module):
2636         * Platform/Module.h:
2637         * Platform/cf/ModuleCF.cpp:
2638         (WebKit::Module::unload):
2639         (WebKit::Module::bundleResourceMap): Deleted.
2640         * PluginProcess/mac/PluginProcessMac.mm:
2641         (WebKit::initializeShim):
2642         (WebKit::PluginProcess::platformInitializeProcess):
2643         (WebKit::shouldCallRealDebugger): Deleted.
2644         (WebKit::isWindowActive): Deleted.
2645         (WebKit::getCurrentEventButtonState): Deleted.
2646         (WebKit::carbonWindowShown): Deleted.
2647         (WebKit::carbonWindowHidden): Deleted.
2648         (WebKit::openCFURLRef): Deleted.
2649         (WebKit::isMallocTinyMemoryTag): Deleted.
2650         (WebKit::shouldMapMemoryExecutable): Deleted.
2651         * PluginProcess/mac/PluginProcessShim.h:
2652         * PluginProcess/mac/PluginProcessShim.mm:
2653         (WebKit::shimDebugger): Deleted.
2654         (WebKit::shimGetCurrentEventButtonState): Deleted.
2655         (WebKit::shimIsWindowActive): Deleted.
2656         (WebKit::shimModalDialog): Deleted.
2657         (WebKit::shimAlert): Deleted.
2658         (WebKit::shimShowWindow): Deleted.
2659         (WebKit::shimHideWindow): Deleted.
2660         (WebKit::shimLSOpenCFURLRef): Deleted.
2661         (WebKit::shimMachVMMap): Deleted.
2662         * Shared/API/Cocoa/WKFoundation.h:
2663         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
2664         (WebKit::XPCServiceMain):
2665         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
2666         (WebKit::NetscapePluginModule::tryLoad):
2667         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
2668         (WebKit::getPluginArchitecture):
2669         (WebKit::NetscapePluginModule::determineQuirks):
2670         * Shared/Plugins/PluginQuirks.h:
2671         * Shared/cf/ArgumentCodersCF.cpp:
2672         (IPC::sizeForNumberType):
2673         * Shared/mac/WebEventFactory.mm:
2674         (WebKit::mouseButtonForEvent):
2675         (WebKit::globalPointForEvent):
2676         (WebKit::pointForEvent):
2677         (WebKit::WebEventFactory::createWebMouseEvent):
2678         * UIProcess/API/C/mac/WKPagePrivateMac.h:
2679         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
2680         (WKPageLoadFileReturningNavigation):
2681         * UIProcess/Cocoa/WebViewImpl.mm:
2682         (WebKit::WebViewImpl::pressureChangeWithEvent):
2683         * UIProcess/Gamepad/cocoa/UIGamepadProviderCocoa.mm:
2684         (WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider):
2685         * UIProcess/mac/ServicesController.mm:
2686         (WebKit::ServicesController::ServicesController):
2687         * UIProcess/mac/WebContextMenuProxyMac.mm:
2688         (WebKit::WebContextMenuProxyMac::setupServicesMenu):
2689         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2690         (WebKit::NPN_GetValue):
2691         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2692         (WebKit::NetscapePlugin::NetscapePlugin):
2693         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
2694         (WebKit::NetscapePlugin::isWindowActive const): Deleted.
2695         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2696         (WebKit::NetscapePlugin::setDrawingModel):
2697         (WebKit::NetscapePlugin::setEventModel):
2698         (WebKit::NetscapePlugin::platformPostInitialize):
2699         (WebKit::NetscapePlugin::platformDestroy):
2700         (WebKit::NetscapePlugin::platformGeometryDidChange):
2701         (WebKit::NetscapePlugin::platformPaint):
2702         (WebKit::NetscapePlugin::platformHandleMouseEvent):
2703         (WebKit::NetscapePlugin::platformHandleWheelEvent):
2704         (WebKit::NetscapePlugin::platformHandleMouseEnterEvent):
2705         (WebKit::NetscapePlugin::platformHandleMouseLeaveEvent):
2706         (WebKit::NetscapePlugin::platformHandleKeyboardEvent):
2707         (WebKit::NetscapePlugin::platformSetFocus):
2708         (WebKit::NetscapePlugin::windowFocusChanged):
2709         (WebKit::NetscapePlugin::windowAndViewFramesChanged):
2710         (WebKit::NetscapePlugin::sendComplexTextInput):
2711         (): Deleted.
2712         (WebKit::windowMap): Deleted.
2713         (WebKit::NetscapePlugin::netscapePluginFromWindow): Deleted.
2714         (WebKit::NetscapePlugin::windowRef const): Deleted.
2715         (WebKit::NetscapePlugin::updateFakeWindowBounds): Deleted.
2716         (WebKit::NetscapePlugin::buttonState): Deleted.
2717         (WebKit::initializeEventRecord): Deleted.
2718         (WebKit::anyMouseButtonIsDown): Deleted.
2719         (WebKit::rightMouseButtonIsDown): Deleted.
2720         (WebKit::modifiersForEvent): Deleted.
2721         (WebKit::convertStringToKeyCodes): Deleted.
2722         (WebKit::scriptCodeFromCurrentKeyboardInputSource): Deleted.
2723         (WebKit::NetscapePlugin::nullEventTimerFired): Deleted.
2724
2725 2019-03-02  Zalan Bujtas  <zalan@apple.com>
2726
2727         [ContentChangeObserver] Introduce ContentChangeObserver::MouseMovedScope
2728         https://bugs.webkit.org/show_bug.cgi?id=195252
2729         <rdar://problem/48539446>
2730
2731         Reviewed by Simon Fraser.
2732
2733         * WebProcess/WebPage/ios/WebPageIOS.mm:
2734         (WebKit::WebPage::handleSyntheticClick):
2735
2736 2019-03-02  Tim Horton  <timothy_horton@apple.com>
2737
2738         Move EditingRange <-> Range methods to EditingRange instead of WebPage
2739         https://bugs.webkit.org/show_bug.cgi?id=195201
2740
2741         Reviewed by Sam Weinig.
2742
2743         * Shared/EditingRange.h:
2744         * Shared/EditingRange.cpp:
2745         Also, modernize the coders.
2746
2747         * Sources.txt:
2748         * WebKit.xcodeproj/project.pbxproj:
2749         * WebProcess/WebPage/WebPage.cpp:
2750         (WebKit::WebPage::insertTextAsync):
2751         (WebKit::WebPage::getMarkedRangeAsync):
2752         (WebKit::WebPage::getSelectedRangeAsync):
2753         (WebKit::WebPage::characterIndexForPointAsync):
2754         (WebKit::WebPage::firstRectForCharacterRangeAsync):
2755         (WebKit::WebPage::setCompositionAsync):
2756         (WebKit::WebPage::rangeFromEditingRange): Deleted.
2757         * WebProcess/WebPage/mac/WebPageMac.mm:
2758         (WebKit::WebPage::insertDictatedTextAsync):
2759         (WebKit::WebPage::attributedSubstringForCharacterRangeAsync):
2760
2761 2019-03-02  Wenson Hsieh  <wenson_hsieh@apple.com>
2762
2763         [iOS] Programmatic paste access should be granted when copying and pasting within the same origin
2764         https://bugs.webkit.org/show_bug.cgi?id=195053
2765         <rdar://problem/48134710>
2766
2767         Reviewed by Ryosuke Niwa.
2768
2769         Add support for automatically granting programmatic pasteboard access when the pasteboard identifier of the
2770         document requesting programmatic paste matches the identifier in the custom pasteboard data blob in the
2771         UIPasteboard. To do this, we send the pasteboard identifier of the document requesting the DOM paste to the UI
2772         process, and check this against the pasteboard identifiers for each item on the platform pasteboard. If all
2773         items in the platform pasteboard match the given pasteboard identifier (since we don't support writing multiple
2774         pasteboard items via bindings, this should only be a single item), we skip showing the paste callout and
2775         immediately invoke the programmatic paste handler.
2776
2777         * Scripts/webkit/messages.py:
2778         * UIProcess/API/gtk/PageClientImpl.cpp:
2779         (WebKit::PageClientImpl::requestDOMPasteAccess):
2780         * UIProcess/API/gtk/PageClientImpl.h:
2781         * UIProcess/API/wpe/PageClientImpl.cpp:
2782         (WebKit::PageClientImpl::requestDOMPasteAccess):
2783         * UIProcess/API/wpe/PageClientImpl.h:
2784         * UIProcess/PageClient.h:
2785         * UIProcess/WebPageProxy.cpp:
2786         (WebKit::WebPageProxy::requestDOMPasteAccess):
2787         * UIProcess/WebPageProxy.h:
2788         * UIProcess/WebPageProxy.messages.in:
2789
2790         Add plumbing to deliver the pasteboard identifier to the client when requesting DOM paste.
2791
2792         * UIProcess/ios/PageClientImplIOS.h:
2793         * UIProcess/ios/PageClientImplIOS.mm:
2794         (WebKit::PageClientImpl::requestDOMPasteAccess):
2795         * UIProcess/ios/WKContentViewInteraction.h:
2796         * UIProcess/ios/WKContentViewInteraction.mm:
2797         (-[WKContentView cleanupInteraction]):
2798         (-[WKContentView resignFirstResponderForWebView]):
2799         (-[WKContentView _webTouchEventsRecognized:]):
2800         (-[WKContentView _willHideMenu:]):
2801         (-[WKContentView pasteForWebView:]):
2802         (-[WKContentView _handleDOMPasteRequestWithResult:]):
2803         (-[WKContentView _willPerformAction:sender:]):
2804         (-[WKContentView _didPerformAction:sender:]):
2805         (-[WKContentView handleKeyWebEvent:withCompletionHandler:]):
2806         (allPasteboardItemOriginsMatchOrigin):
2807         (-[WKContentView _requestDOMPasteAccessWithElementRect:originIdentifier:completionHandler:]):
2808         (-[WKContentView _requestDOMPasteAccessWithElementRect:completionHandler:]): Deleted.
2809
2810         Bail early in the case where all items' pasteboard identifiers (read via custom pasteboard data) match. When
2811         this happens, we only grant access for the current paste command, rather than granting access for the user
2812         gesture token.
2813
2814         * UIProcess/mac/PageClientImplMac.h:
2815         * UIProcess/win/PageClientImpl.cpp:
2816         (WebKit::PageClientImpl::requestDOMPasteAccess):
2817         * UIProcess/win/PageClientImpl.h:
2818         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2819         (WebKit::WebEditorClient::requestDOMPasteAccess):
2820         * WebProcess/WebCoreSupport/WebEditorClient.h:
2821         * WebProcess/WebPage/WebPage.cpp:
2822         (WebKit::WebPage::requestDOMPasteAccess):
2823         * WebProcess/WebPage/WebPage.h:
2824
2825 2019-02-27  Darin Adler  <darin@apple.com>
2826
2827         Fixed makeString(float) to do shortest-form serialization without first converting to double
2828         https://bugs.webkit.org/show_bug.cgi?id=195142
2829
2830         Reviewed by Daniel Bates.
2831
2832         * UIProcess/PerActivityStateCPUUsageSampler.cpp: Removed unneeded include of DecimalNumber.h.
2833
2834 2019-03-02  Adrian Perez de Castro  <aperez@igalia.com>
2835
2836         [WPE] Public API headers are missing autocleanup definitions
2837         https://bugs.webkit.org/show_bug.cgi?id=195211
2838
2839         Reviewed by Philippe Normand.
2840
2841         * PlatformWPE.cmake: List new API headers as installable.
2842         * UIProcess/API/wpe/WebKitAutocleanups.h: Added. This is a copy of the header from the GTK
2843         port, adapted to fit the WPE port.
2844         * UIProcess/API/wpe/webkit.h: Add inclusion of WebKitAutocleanups.h
2845         * WebProcess/InjectedBundle/API/wpe/WebKitWebExtensionAutocleanups.h: Added. Also adapted
2846         from the equivalent header of the GTK port.
2847         * WebProcess/InjectedBundle/API/wpe/webkit-web-extension.h: Add inclusion of
2848         WebKitWebExtensionAutocleanups.h
2849
2850 2019-03-02  Michael Catanzaro  <mcatanzaro@igalia.com>
2851
2852         Remove unused WebPageProxy::m_navigationID
2853         https://bugs.webkit.org/show_bug.cgi?id=195209
2854
2855         Reviewed by Darin Adler.
2856
2857         WebPageProxy::m_navigationID is never assigned to and is only used once by mistake in a
2858         debug LOG(). It must be a refactoring mistake.
2859
2860         * UIProcess/WebPageProxy.cpp:
2861         (WebKit::WebPageProxy::didCommitLoadForFrame):
2862         * UIProcess/WebPageProxy.h:
2863
2864 2019-03-01  Darin Adler  <darin@apple.com>
2865
2866         Finish removing String::format
2867         https://bugs.webkit.org/show_bug.cgi?id=194893
2868
2869         Reviewed by Daniel Bates.
2870
2871         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
2872         (WebKit::LocalAuthenticator::getAssertion): Use makeString, attempting to fix
2873         a problem where we passed an NSData * to format with a "%s"."
2874
2875 2019-03-01  Chris Dumez  <cdumez@apple.com>
2876
2877         Unreviewed Windows build fix after r242302.
2878
2879         * UIProcess/WebProcessPool.cpp:
2880         (WebKit::WebProcessPool::ensureNetworkProcess):
2881
2882 2019-03-01  Alex Christensen  <achristensen@webkit.org>
2883
2884         NetworkDataTask redirection should not keep alive its NetworkSession
2885         https://bugs.webkit.org/show_bug.cgi?id=194927
2886
2887         Reviewed by Darin Adler.
2888
2889         This should fix rdar://problem/47580502
2890
2891         * NetworkProcess/NetworkDataTask.h:
2892         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2893         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
2894
2895 2019-03-01  Alex Christensen  <achristensen@webkit.org>
2896
2897         Revert r241223, r241235, and r241287
2898         https://bugs.webkit.org/show_bug.cgi?id=194427
2899         <rdar://48045861>
2900
2901         This caused crashes, and feature design has evolved away from needing the daemon in this form.
2902
2903         * NetworkProcess/EntryPoint/Cocoa/Daemon/DaemonEntryPoint.mm:
2904         (WebKit::DaemonMain):
2905         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
2906         * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
2907         (WebKit::XPCServiceEventHandler):
2908         (WebKit::XPCServiceMain):
2909         (WebKit::XPCEventHandler): Deleted.
2910         (WebKit::XPCInitializationHandler): Deleted.
2911         * UIProcess/API/APIProcessPoolConfiguration.h:
2912         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2913         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2914         (-[_WKProcessPoolConfiguration usesNetworkingDaemon]): Deleted.
2915         (-[_WKProcessPoolConfiguration setUsesNetworkingDaemon:]): Deleted.
2916         * UIProcess/AuxiliaryProcessProxy.cpp:
2917         (WebKit::AuxiliaryProcessProxy::getLaunchOptions):
2918         * UIProcess/Launcher/ProcessLauncher.h:
2919         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2920         (WebKit::serviceName):
2921         (WebKit::ProcessLauncher::launchProcess):
2922         * UIProcess/Network/NetworkProcessProxy.cpp:
2923         (WebKit::NetworkProcessProxy::getLaunchOptions):
2924         * UIProcess/WebProcessPool.cpp:
2925         (WebKit::WebProcessPool::usesNetworkingDaemon const): Deleted.
2926         * UIProcess/WebProcessPool.h:
2927
2928 2019-03-01  Alex Christensen  <achristensen@webkit.org>
2929
2930         Add setters on WKWebsiteDataStore for sourceApplicationBundleIdentifier and sourceApplicationSecondaryIdentifier
2931         https://bugs.webkit.org/show_bug.cgi?id=195229
2932         <rdar://problem/48520362>
2933
2934         Reviewed by Chris Dumez.
2935
2936         Just like _setBoundInterfaceIdentifier, we need a way to set these properties after instantiation of a WKWebsiteDataStore,
2937         but we need to make sure we don't set it after the parameters have been copied to the NetworkProcess.
2938
2939         Functionality verified by manual testing.  See radar.
2940         Added an API test that verifies the setter restrictions work as expected.
2941
2942         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2943         (-[WKWebsiteDataStore _sourceApplicationBundleIdentifier]):
2944         (-[WKWebsiteDataStore _setSourceApplicationBundleIdentifier:]):
2945         (-[WKWebsiteDataStore _sourceApplicationSecondaryIdentifier]):
2946         (-[WKWebsiteDataStore _setSourceApplicationSecondaryIdentifier:]):
2947         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2948         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2949         (WebKit::toPKPaymentRequest):
2950         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2951         (WebKit::WebsiteDataStore::parameters):
2952         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2953         (WebKit::WebsiteDataStore::WebsiteDataStore):
2954         (WebKit::WebsiteDataStore::setSourceApplicationSecondaryIdentifier):
2955         (WebKit::WebsiteDataStore::setSourceApplicationBundleIdentifier):
2956         * UIProcess/WebsiteData/WebsiteDataStore.h:
2957         (WebKit::WebsiteDataStore::sourceApplicationBundleIdentifier):
2958         (WebKit::WebsiteDataStore::sourceApplicationSecondaryIdentifier):
2959
2960 2019-03-01  Antoine Quint  <graouts@apple.com>
2961
2962         [iOS] Turn mouse event simulation on by default
2963         https://bugs.webkit.org/show_bug.cgi?id=195218
2964         <rdar://problem/48516794>
2965
2966         Reviewed by Dean Jackson.
2967
2968         * Shared/WebPreferences.yaml:
2969
2970 2019-03-01  Ross Kirsling  <ross.kirsling@sony.com>
2971
2972         EnvironmentUtilities::stripValuesEndingWithString isn't thread-safe
2973         https://bugs.webkit.org/show_bug.cgi?id=194612
2974
2975         Reviewed by Alex Christensen.
2976
2977         This API test really shouldn't be verifying that the actual environment was successfully modified.
2978
2979         At its core, stripValuesEndingWithString is really just split-filter-join. By replacing it with a pair of
2980         simple functions -- one for string processing, one for environment processing -- the API test only needs to
2981         worry about the former.
2982
2983         * Platform/unix/EnvironmentUtilities.cpp:
2984         (WebKit::EnvironmentUtilities::stripEntriesEndingWith):
2985         (WebKit::EnvironmentUtilities::removeValuesEndingWith):
2986         (WebKit::EnvironmentUtilities::stripValuesEndingWithString): Deleted.
2987         * Platform/unix/EnvironmentUtilities.h:
2988         Replace old function with a pair of simpler ones.
2989
2990         * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkServiceEntryPoint.mm:
2991         (NetworkServiceInitializer):
2992         * PluginProcess/EntryPoint/Cocoa/XPCService/PluginServiceEntryPoint.mm:
2993         (PluginServiceInitializer):
2994         * WebProcess/EntryPoint/Cocoa/XPCService/WebContentServiceEntryPoint.mm:
2995         (WebContentServiceInitializer):
2996         Update function name.
2997
2998 2019-03-01  Don Olmstead  <don.olmstead@sony.com>
2999
3000         Unify WebsiteDataStore::defaultDataStoreConfiguration across ports
3001         https://bugs.webkit.org/show_bug.cgi?id=194844
3002
3003         Reviewed by Youenn Fablet.
3004
3005         Move the Cocoa implementation into APIWebsiteDataStore.cpp as the source of truth and
3006         append configuration for Glib's DeviceIdHashSalts storage directory. This also fixes
3007         a crash in Windows when running a Service Worker.
3008
3009         * UIProcess/API/APIWebsiteDataStore.cpp:
3010         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory):
3011         (API::WebsiteDataStore::defaultDataStoreConfiguration):
3012         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
3013         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
3014         (API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
3015         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
3016         (API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
3017         * UIProcess/API/win/APIWebsiteDataStoreWin.cpp:
3018         (API::WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory): Deleted.
3019         (API::WebsiteDataStore::defaultDataStoreConfiguration): Deleted.
3020
3021 2019-03-01  John Wilander  <wilander@apple.com>
3022
3023         Resource Load Statistics: Further restrict client-side cookie persistence after cross-site navigations with link decoration
3024         https://bugs.webkit.org/show_bug.cgi?id=195196
3025         <rdar://problem/48006419>
3026
3027         Reviewed by Brent Fulgham.
3028
3029         Trackers abuse link query parameters to transport user identifiers cross-site.
3030         This patch detects such navigations and applies further restrictions to
3031         client-site cookies on the destination page.
3032
3033         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3034         (WebKit::NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics):
3035         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage): Deleted.
3036             Renamed NetworkConnectionToWebProcess::clearPageSpecificDataForResourceLoadStatistics().
3037         * NetworkProcess/NetworkConnectionToWebProcess.h:
3038         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3039         * NetworkProcess/NetworkProcess.cpp:
3040         (WebKit::NetworkProcess::committedCrossSiteLoadWithLinkDecoration):
3041             Reporting IPC message when a link decorated cross-site navigation happens.
3042         (WebKit::NetworkProcess::resetCrossSiteLoadsWithLinkDecorationForTesting):
3043         * NetworkProcess/NetworkProcess.h:
3044         * NetworkProcess/NetworkProcess.messages.in:
3045         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3046         (WKWebsiteDataStoreStatisticsResetToConsistentState):
3047             Added clearing of the new state between test runs.
3048         * UIProcess/Network/NetworkProcessProxy.cpp:
3049         (WebKit::NetworkProcessProxy::resetCrossSiteLoadsWithLinkDecorationForTesting):
3050             Test infrastructure.
3051         * UIProcess/Network/NetworkProcessProxy.h:
3052         * UIProcess/WebPageProxy.cpp:
3053         (WebKit::isNonUniqueNavigationWithLinkDecoration):
3054             Convenience function.
3055         (WebKit::WebPageProxy::didCommitLoadForFrame):
3056             This function now reports to the network process when a link decorated
3057             cross-site navigation happens.
3058         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3059         (WebKit::WebsiteDataStore::resetCrossSiteLoadsWithLinkDecorationForTesting):
3060             Test infrastructure.
3061         * UIProcess/WebsiteData/WebsiteDataStore.h:
3062         * WebProcess/WebPage/WebPage.cpp:
3063         (WebKit::WebPage::close):
3064             Name change of function called.
3065
3066 2019-03-01  Tim Horton  <timothy_horton@apple.com>
3067
3068         Remove unused code in WebKitLegacy
3069         https://bugs.webkit.org/show_bug.cgi?id=189614
3070
3071         Reviewed by Simon Fraser.
3072
3073         * mac/MigrateHeadersFromWebKitLegacy.make:
3074
3075 2019-03-01  Tim Horton  <timothy_horton@apple.com>
3076
3077         Modernize WebKit::AttributedString a little bit
3078         https://bugs.webkit.org/show_bug.cgi?id=195200
3079
3080         Reviewed by Wenson Hsieh.
3081
3082         * Shared/mac/AttributedString.h:
3083         (WebKit::AttributedString::AttributedString):
3084         (WebKit::AttributedString::operator NSAttributedString * const):
3085         * Shared/mac/AttributedString.mm:
3086         (IPC::ArgumentCoder<WebKit::AttributedString>::encode):
3087         (IPC::ArgumentCoder<WebKit::AttributedString>::decode):
3088         (WebKit::AttributedString::encode const): Deleted.
3089         (WebKit::AttributedString::decode): Deleted.
3090         * UIProcess/Cocoa/WebViewImpl.mm:
3091         (WebKit::WebViewImpl::attributedSubstringForProposedRange):
3092         * WebProcess/WebPage/mac/WebPageMac.mm:
3093         (WebKit::WebPage::attributedSubstringForCharacterRangeAsync):
3094         Modern coders, and a constructor and cast operator to/from NSAttributedString.
3095         Also adopt those in a few places just for fun.
3096
3097 2019-03-01  Youenn Fablet  <youenn@apple.com>
3098
3099         Serialize IndexedDB::ObjectStoreOverwriteMode as an enum
3100         https://bugs.webkit.org/show_bug.cgi?id=195213
3101
3102         Reviewed by Alex Christensen.
3103
3104         Make use of enum trait to automatically check for correct enum value when receiving a putOrAdd message.
3105
3106         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
3107         (WebKit::WebIDBConnectionToClient::putOrAdd):
3108         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
3109         * NetworkProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
3110         * Scripts/webkit/messages.py:
3111         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
3112         (WebKit::WebIDBConnectionToServer::putOrAdd):
3113
3114 2019-03-01  Don Olmstead  <don.olmstead@sony.com>
3115
3116         [WinCairo] Enable service worker
3117         https://bugs.webkit.org/show_bug.cgi?id=188318
3118
3119         Reviewed by Youenn Fablet.
3120
3121         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3122         (WebKit::WebSWContextManagerConnection::terminateProcess):
3123         * WebProcess/Storage/WebSWContextManagerConnection.h:
3124         * config.h:
3125
3126 2019-03-01  Chris Dumez  <cdumez@apple.com>
3127
3128         Flaky API Test TestWebKitAPI.ProcessSwap.LoadUnload
3129         https://bugs.webkit.org/show_bug.cgi?id=195110
3130
3131         Reviewed by Ryosuke Niwa.
3132
3133         The test was attempting to disable PageCache via view preferences instead of using the
3134         process pool configuration flag. This would fail to disable PageCache because the
3135         usesPageCache preference would not prevent the creation of SuspendedPageProxy objects.
3136         As a result, the firing on the unload event would get delayed until the SuspendedPageProxy
3137         objects would get destroyed, which would lead to flakiness.
3138
3139         This patch updates WebPageProxy::suspendCurrentPageIfPossible() to not create suspended
3140         pages proxies when the usesPageCache preference is set to false.
3141
3142         * UIProcess/WebPageProxy.cpp:
3143         (WebKit::WebPageProxy::suspendCurrentPageIfPossible):
3144
3145 2019-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
3146
3147         [ThreadedCompositor] Simply the compositing run loop worker thread
3148         https://bugs.webkit.org/show_bug.cgi?id=195208
3149
3150         Reviewed by Don Olmstead.
3151
3152         We can remove the WorkQueuePool, since we never really supported more than one thread, and now that single
3153         process model non longer exists it doesn't even make sense. We can simply use a RunLoop instead of a WorkQueue
3154         so that the implementation is not specific to the generic WorkQueue implementation.
3155
3156         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
3157         (WebKit::createRunLoop): Helper function to create the RunLoop in a worker thread before m_updateTimer is initialized.
3158         (WebKit::CompositingRunLoop::CompositingRunLoop): Use createRunLoop().
3159         (WebKit::CompositingRunLoop::~CompositingRunLoop): Stop the worker thread run loop in the next main run loop iteration.
3160         (WebKit::CompositingRunLoop::performTask): Use m_runLoop.
3161         (WebKit::CompositingRunLoop::performTaskSync): Ditto.
3162         (WebKit::WorkQueuePool::singleton): Deleted.
3163         (WebKit::WorkQueuePool::dispatch): Deleted.
3164         (WebKit::WorkQueuePool::runLoop): Deleted.
3165         (WebKit::WorkQueuePool::invalidate): Deleted.
3166         (WebKit::WorkQueuePool::WorkQueuePool): Deleted.
3167         (WebKit::WorkQueuePool::getOrCreateWorkQueueForContext): Deleted.
3168         (): Deleted.
3169         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
3170
3171 2019-03-01  Justin Fan  <justin_fan@apple.com>
3172
3173         [Web GPU] 32-bit builds broken by attempt to disable WebGPU on 32-bit
3174         https://bugs.webkit.org/show_bug.cgi?id=195191
3175
3176         Rubber-stamped by Dean Jackson.
3177
3178         Dropping support for 32-bit entirely, so I'm intentionally leaving 32-bit broken.
3179
3180         * Configurations/FeatureDefines.xcconfig:
3181
3182 2019-02-28  Chris Dumez  <cdumez@apple.com>
3183
3184         HTTPSUpgradeList.db database should be opened in readonly mode
3185         https://bugs.webkit.org/show_bug.cgi?id=195194
3186         <rdar://problem/47103889>
3187
3188         Reviewed by Youenn Fablet.
3189
3190         HTTPSUpgradeList.db database should be opened in readonly mode since it is not meant to be
3191         modified by WebKit. Opening it in ReadWrite mode causes sandbox violations.
3192
3193         * NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
3194         (WebKit::NetworkHTTPSUpgradeChecker::NetworkHTTPSUpgradeChecker):
3195
3196 2019-02-28  David Quesada  <david_quesada@apple.com>
3197
3198         Expose APINavigationAction.shouldPerformDownload() on WKNavigationAction
3199         https://bugs.webkit.org/show_bug.cgi?id=195121
3200         rdar://problem/48450302
3201
3202         Reviewed by Alex Christensen.
3203
3204         * UIProcess/API/Cocoa/WKNavigationAction.mm:
3205         (-[WKNavigationAction _shouldPerformDownload]):
3206         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
3207
3208 2019-02-28  Antoine Quint  <graouts@apple.com>
3209
3210         Disable Web Animations in Safari Technology Preview
3211         https://bugs.webkit.org/show_bug.cgi?id=194748
3212         <rdar://problem/48139481>
3213
3214         Reviewed by Dean Jackson.
3215
3216         The test runners already opt into that feature explicitly, so all that is needed is to turn
3217         the default setting value to false.
3218
3219         * Shared/WebPreferences.yaml:
3220
3221 2019-02-28  Antoine Quint  <graouts@apple.com>
3222
3223         Enable the Pointer Events runtime flag by default
3224         https://bugs.webkit.org/show_bug.cgi?id=195156
3225
3226         Reviewed by Dean Jackson.
3227
3228         * Shared/WebPreferences.yaml:
3229
3230 2019-02-28  Sihui Liu  <sihui_liu@apple.com>
3231
3232         Revert r232263: it caused processes to crash because process was suspended with locked file
3233         https://bugs.webkit.org/show_bug.cgi?id=195122
3234         <rdar://problem/48444599>
3235
3236         Reviewed by Geoffrey Garen.
3237
3238         * NetworkProcess/NetworkProcess.cpp:
3239         (WebKit::NetworkProcess::NetworkProcess):
3240         * NetworkProcess/NetworkProcess.h:
3241         * Shared/WebSQLiteDatabaseTracker.cpp:
3242         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
3243         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
3244         * Shared/WebSQLiteDatabaseTracker.h:
3245         * WebProcess/WebProcess.cpp:
3246         (WebKit::m_webSQLiteDatabaseTracker):
3247         (WebKit::m_nonVisibleProcessCleanupTimer): Deleted.
3248         * WebProcess/WebProcess.h:
3249
3250 2019-02-28  Per Arne Vollan  <pvollan@apple.com>
3251
3252         [iOS] Move calls to [UIKeyboard isInHardwareKeyboardMode] to the UI process.
3253         https://bugs.webkit.org/show_bug.cgi?id=193683
3254         <rdar://problem/47634345>
3255
3256         Reviewed by Brent Fulgham.
3257
3258         When a keyboard is attached/deattached or the application becomes foreground, send a message from
3259         the UI process to the WebContent process, notifying whether a keyboard is attached or not. Also,
3260         cache the value of [UIKeyboard isInHardwareKeyboardMode] in the UI process, since this call seems
3261         to be expensive.
3262
3263         * UIProcess/API/Cocoa/WKWebView.mm:
3264         (hardwareKeyboardAvailabilityChangedCallback):
3265         * UIProcess/WebPageProxy.h:
3266         * UIProcess/WebProcessProxy.h:
3267         (WebKit::WebProcessProxy::setKeyboardIsAttached):
3268         (WebKit::WebProcessProxy::keyboardIsAttached const):
3269         * UIProcess/ios/WKContentViewInteraction.mm:
3270         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
3271         * UIProcess/ios/WebPageProxyIOS.mm:
3272         (WebKit::WebPageProxy::applicationWillEnterForeground):
3273         (WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged):
3274         * WebProcess/WebPage/WebPage.h:
3275         * WebProcess/WebPage/WebPage.messages.in:
3276         * WebProcess/WebPage/ios/WebPageIOS.mm:
3277         (WebKit::WebPage::platformEditorState const):
3278         (WebKit::WebPage::hardwareKeyboardAvailabilityChanged):
3279
3280 2019-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
3281
3282         [CoordinatedGraphics] Remove COORDINATED_GRAPHICS_THREADED option
3283         https://bugs.webkit.org/show_bug.cgi?id=195159
3284
3285         Reviewed by Don Olmstead.
3286
3287         Use COORDINATED_GRAPHICS instead.
3288
3289         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
3290         (WebKit::CoordinatedGraphicsScene::onNewBufferAvailable):
3291         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
3292         * Shared/CoordinatedGraphics/SimpleViewportController.cpp:
3293         * Shared/CoordinatedGraphics/SimpleViewportController.h:
3294         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
3295         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
3296         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3297         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
3298         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
3299         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.h:
3300         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
3301         (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged):
3302         (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
3303         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
3304         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h:
3305         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3306         (WebKit::DrawingAreaImpl::updatePreferences):
3307         * WebProcess/WebPage/WebPage.cpp:
3308         (WebKit::WebPage::sendViewportAttributesChanged):
3309         (WebKit::WebPage::viewportPropertiesDidChange):
3310         * WebProcess/gtk/WebProcessMainGtk.cpp:
3311
3312 2019-02-28  Sihui Liu  <sihui_liu@apple.com>
3313
3314         Stop using legacy IDB path by default when creating WebProcessPool from websiteDataStore
3315         https://bugs.webkit.org/show_bug.cgi?id=194958
3316
3317         Reviewed by Geoffrey Garen.
3318
3319         ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration should not use fixed IDB path.
3320
3321         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3322         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
3323         * UIProcess/API/APIWebsiteDataStore.cpp:
3324         (API::WebsiteDataStore::createLegacy):
3325         (API::indexedDBDatabaseDirectory):
3326         * UIProcess/API/APIWebsiteDataStore.h:
3327         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3328         (-[WKWebsiteDataStore _indexedDBDatabaseDirectory]):
3329         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
3330         * UIProcess/WebProcessPool.cpp:
3331         (WebKit::legacyWebsiteDataStoreConfiguration):
3332
3333 2019-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
3334
3335         [CoordinatedGraphics] Unify all LayerTreeHost classes
3336         https://bugs.webkit.org/show_bug.cgi?id=195094
3337
3338         Reviewed by Žan Doberšek.
3339
3340         There's no reason to have 3 classes, since currently LayerTreeHost is only used by coordinated graphics based
3341         ports.
3342
3343         * PlatformWin.cmake:
3344         * SourcesGTK.txt:
3345         * SourcesWPE.txt:
3346         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
3347         (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
3348         (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow):
3349         * WebProcess/WebPage/AcceleratedDrawingArea.h:
3350         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: Removed.
3351         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: Removed.
3352         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp.
3353         (WebKit::LayerTreeHost::LayerTreeHost):
3354         (WebKit::LayerTreeHost::~LayerTreeHost):
3355         (WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled):
3356         (WebKit::LayerTreeHost::scheduleLayerFlush):
3357         (WebKit::LayerTreeHost::cancelPendingLayerFlush):
3358         (WebKit::LayerTreeHost::layerFlushTimerFired):
3359         (WebKit::LayerTreeHost::setRootCompositingLayer):
3360         (WebKit::LayerTreeHost::setViewOverlayRootLayer):
3361         (WebKit::LayerTreeHost::invalidate):
3362         (WebKit::LayerTreeHost::scrollNonCompositedContents):
3363         (WebKit::LayerTreeHost::forceRepaint):
3364         (WebKit::LayerTreeHost::forceRepaintAsync):
3365         (WebKit::LayerTreeHost::sizeDidChange):
3366         (WebKit::LayerTreeHost::pauseRendering):
3367         (WebKit::LayerTreeHost::resumeRendering):
3368         (WebKit::LayerTreeHost::graphicsLayerFactory):
3369         (WebKit::LayerTreeHost::contentsSizeChanged):
3370         (WebKit::LayerTreeHost::didChangeViewportAttributes):
3371         (WebKit::LayerTreeHost::didChangeViewport):
3372         (WebKit::LayerTreeHost::setIsDiscardable):
3373         (WebKit::LayerTreeHost::setNativeSurfaceHandleForCompositing):
3374         (WebKit::LayerTreeHost::deviceOrPageScaleFactorChanged):
3375         (WebKit::LayerTreeHost::createDisplayRefreshMonitor):
3376         (WebKit::LayerTreeHost::didFlushRootLayer):
3377         (WebKit::LayerTreeHost::commitSceneState):
3378         (WebKit::LayerTreeHost::frameComplete):
3379         (WebKit::LayerTreeHost::nativeSurfaceHandleForCompositing):
3380         (WebKit::LayerTreeHost::didDestroyGLContext):
3381         (WebKit::LayerTreeHost::willRenderFrame):
3382         (WebKit::LayerTreeHost::didRenderFrame):
3383         (WebKit::LayerTreeHost::requestDisplayRefreshMonitorUpdate):
3384         (WebKit::LayerTreeHost::handleDisplayRefreshMonitorUpdate):
3385         (WebKit::LayerTreeHost::renderNextFrame):
3386         * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h.
3387         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3388         (WebKit::DrawingAreaImpl::setNeedsDisplay):
3389         (WebKit::DrawingAreaImpl::setNeedsDisplayInRect):
3390         * WebProcess/WebPage/LayerTreeHost.cpp: Removed.
3391         * WebProcess/WebPage/LayerTreeHost.h: Removed.
3392         * WebPage/win/LayerTreeHost.h: Added.
3393
3394 2019-02-28  Justin Fan  <justin_fan@apple.com>
3395
3396         [Web GPU] Enable Web GPU only on 64-bit
3397         https://bugs.webkit.org/show_bug.cgi?id=195139
3398
3399         Because Metal is only supported on 64 bit apps.
3400
3401         Unreviewed build fix.
3402
3403         * Configurations/FeatureDefines.xcconfig:
3404
3405 2019-02-27  Simon Fraser  <simon.fraser@apple.com>
3406
3407         Roll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)
3408
3409         * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
3410         (WebKit::LocalAuthenticator::getAssertion):
3411
3412 2019-02-27  Michael Catanzaro  <mcatanzaro@igalia.com>
3413
3414         Unreviewed, fix -Wformat warning
3415
3416         * WebProcess/WebPage/WebPage.cpp:
3417         (WebKit::WebPage::didCompletePageTransition):
3418
3419 2019-02-27  Brent Fulgham  <bfulgham@apple.com>
3420
3421         REGRESSION: Crash beneath ResourceLoadObserver::logSubresourceLoading
3422         https://bugs.webkit.org/show_bug.cgi?id=195072
3423
3424         Reviewed by Ryosuke Niwa.
3425
3426         ResourceLoadObserver and WebProcess should exist as long as the web page (process) is running. However,
3427         the NetworkProcess connection can close for a variety of reasons. If the ResourceLoadObserver observes
3428         a load or user gesture in the WebProcess, we should attempt to reconnect to the NetworkProcess (if it
3429         was disconnected), just like we do for other message send cases.
3430
3431         This patch switches from using the m_networkProcessConnection member (which might be null) to use the
3432         'ensureNetworkProcessConnection' accessor which ensures we have a valid connection for message sends.
3433
3434         * WebProcess/WebProcess.cpp:
3435         (WebKit::WebProcess::initializeWebProcess):
3436
3437 2019-02-27  Chris Dumez  <cdumez@apple.com>
3438
3439         Flaky API Test: TestWebKitAPI.ProcessSwap.SessionStorage
3440         https://bugs.webkit.org/show_bug.cgi?id=194480
3441
3442         Reviewed by Brady Eidson.
3443
3444         The StorageManager would only start listening for IPC on a given connection when
3445         StorageManager::processWillOpenConnection() is called. This gets called from
3446         WebsiteDataStore::webProcessWillOpenConnection() which gets called from
3447         WebProcessLifetimeTracker::webPageEnteringWebProcess().
3448
3449         webPageEnteringWebProcess() was called in WebPageProxy::finishAttachingToWebProcess()
3450         after process-swapping. This means that IPC comming from the *provisional* process
3451         would not get processed and we would only start processing IPC on the provisional
3452         process's connection when it would get committed.
3453
3454         To address the issue, this patch teaches WebProcessLifetimeTracker that a page can
3455         now have several processes. We also make sure that webPageEnteringWebProcess() gets
3456         called for the provisional process as soon as we create the provisional page, instead
3457         of waiting for it to get committed.
3458
3459         * UIProcess/ProvisionalPageProxy.cpp:
3460         (WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
3461         (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
3462         (WebKit::ProvisionalPageProxy::connectionWillOpen):
3463         * UIProcess/ProvisionalPageProxy.h:
3464         * UIProcess/WebPageProxy.cpp:
3465         (WebKit::WebPageProxy::finishAttachingToWebProcess):
3466         (WebKit::WebPageProxy::connectionWillOpen):
3467         (WebKit::WebPageProxy::webProcessWillShutDown):
3468         (WebKit::WebPageProxy::processDidTerminate):
3469         * UIProcess/WebPageProxy.h:
3470         (WebKit::WebPageProxy::webProcessLifetimeTracker):
3471         * UIProcess/WebProcessLifetimeObserver.cpp:
3472         (WebKit::WebProcessLifetimeObserver::addWebPage):
3473         (WebKit::WebProcessLifetimeObserver::removeWebPage):
3474         * UIProcess/WebProcessLifetimeObserver.h:
3475         * UIProcess/WebProcessLifetimeTracker.cpp:
3476         (WebKit::WebProcessLifetimeTracker::addObserver):
3477         (WebKit::WebProcessLifetimeTracker::webPageEnteringWebProcess):
3478         (WebKit::WebProcessLifetimeTracker::webPageLeavingWebProcess):
3479         (WebKit::WebProcessLifetimeTracker::pageWasInvalidated):
3480         (WebKit::WebProcessLifetimeTracker::processIsRunning):
3481         * UIProcess/WebProcessLifetimeTracker.h:
3482         * UIProcess/WebProcessProxy.cpp:
3483         (WebKit::WebProcessProxy::connectionWillOpen):
3484         * UIProcess/WebStorage/StorageManager.cpp:
3485         (WebKit::StorageManager::SessionStorageNamespace::allowedConnections const):
3486         (WebKit::StorageManager::SessionStorageNamespace::addAllowedConnection):
3487         (WebKit::StorageManager::SessionStorageNamespace::removeAllowedConnection):
3488         (WebKit::StorageManager::addAllowedSessionStorageNamespaceConnection):
3489         (WebKit::StorageManager::removeAllowedSessionStorageNamespaceConnection):
3490         (WebKit::StorageManager::processWillOpenConnection):
3491         (WebKit::StorageManager::processDidCloseConnection):
3492         (WebKit::StorageManager::createSessionStorageMap):
3493         (WebKit::StorageManager::SessionStorageNamespace::allowedConnection const): Deleted.
3494         (WebKit::StorageManager::SessionStorageNamespace::setAllowedConnection): Deleted.
3495         (WebKit::StorageManager::setAllowedSessionStorageNamespaceConnection): Deleted.
3496         * UIProcess/WebStorage/StorageManager.h:
3497         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3498         (WebKit::WebsiteDataStore::webPageWillOpenConnection):
3499         (WebKit::WebsiteDataStore::webPageDidCloseConnection):
3500
3501 2019-02-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3502
3503         [iOS] Web pages shouldn't be able to present a keyboard after the web view resigns first responder
3504         https://bugs.webkit.org/show_bug.cgi?id=195118
3505         <rdar://problem/43411940>
3506
3507         Reviewed by Tim Horton.
3508
3509         It's currently possible for websites to redirect focus into an editable element on the page by programmatically
3510         requesting focus within the "blur" event handler. This is because our current heuristics:
3511
3512         (1) Allow programmatic focus to show the keyboard when an element is already focused; this is meant to handle
3513             the case where the page moves focus between different elements on the page.
3514         (2) And also allow programmatic focus to show the keyboard when changing activity state; this is meant to handle
3515             the case where a focused element should show the keyboard when first responder is restored on a web view
3516             (e.g. in the case where a modal view controller is dismissed, and the web view regains first responder once
3517             again).
3518
3519         In both of these scenarios, we actually only want the keyboard to appear if the web view itself is either
3520         becoming the first responder, or is already the first responder. Importantly, when blurring the focused element
3521         by calling -[WKWebViewe resignFirstResponder] (as is the case when dismissing the keyboard by tapping 'Done' or
3522         focusing other platform UI), we don't want to allow the page to show the keyboard due to element focus.
3523
3524         To fix this issue, we enforce that we're either becoming the first responder or already are the first responder
3525         before showing the keyboard due to activity state change or focused element change.
3526
3527         Test: fast/events/ios/do-not-show-keyboard-when-focusing-after-blur.html
3528
3529         * UIProcess/ios/WKContentViewInteraction.h:
3530         * UIProcess/ios/WKContentViewInteraction.mm:
3531         (-[WKContentView setupInteraction]):
3532         (-[WKContentView textInputTraits]):
3533
3534         Quick drive-by tweak: rename _isBlurringFocusedNode to _isBlurringFocusedElement, to match the rest of the
3535         terminology used in WebKit.
3536
3537         (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
3538
3539         Make our heuristics for determining whether to show the keyboard a tiny bit easier to follow, by moving the
3540         logic into a lambda function and using early returns. See above for more details.
3541
3542         (-[WKContentView _elementDidBlur]):
3543         (-[WKContentView focusedFormControllerDidUpdateSuggestions:]):
3544
3545 2019-02-27  John Wilander  <wilander@apple.com>
3546
3547         Adopt WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics and WebKit::NetworkProcessProxy
3548         https://bugs.webkit.org/show_bug.cgi?id=195071
3549         <rdar://problem/48417690>
3550
3551         Reviewed by Alex Christensen and Brent Fulgham.
3552
3553         This patch adopts WebCore::RegistrableDomain in WebKit::NetworkProcessProxy
3554         and makes the necessary infrastructure changes to support that.
3555
3556         The previous HashCountedSets in WebCore::ResourceLoadStatistics are now just
3557         HashSets since we never used the counts for anything. This change simplified
3558         the IPC::ArgumentCoder<ResourceLoadStatistics> encode and decode functions.
3559
3560         The patch also makes WebCore::RegistrableDomain's String constructor private.
3561         A new create function WebCore::RegistrableDomain::uncheckedCreateFromString()
3562         is introduced to better signal to users that creating a registrable domain
3563         object with a string may create an object that doesn't match a registrable
3564         domain in a valid HTTP-family URL.
3565
3566         Finally, this patch harmonizes parameter and variable naming, going from
3567         "origin" to "domain" and "mainFrame" to "topFrame."
3568
3569         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
3570         (WebKit::ResourceLoadStatisticsMemoryStore::removeDataRecords):
3571         (WebKit::ResourceLoadStatisticsMemoryStore::recursivelyGetAllDomainsThatHaveRedirectedToThisDomain const):
3572         (WebKit::ResourceLoadStatisticsMemoryStore::markAsPrevalentIfHasRedirectedToPrevalent):
3573         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccess):
3574         (WebKit::ResourceLoadStatisticsMemoryStore::grantStorageAccessInternal):
3575         (WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
3576         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceLoading):
3577         (WebKit::ResourceLoadStatisticsMemoryStore::logSubresourceRedirect):
3578         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubresourceUnder const):
3579         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsSubFrameUnder const):
3580         (WebKit::ResourceLoadStatisticsMemoryStore::isRegisteredAsRedirectingTo const):
3581         (WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameDomain):
3582         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameDomain):
3583         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectTo):
3584         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUniqueRedirectFrom):
3585         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectTo):
3586         (WebKit::ResourceLoadStatisticsMemoryStore::setTopFrameUniqueRedirectFrom):
3587         (WebKit::ResourceLoadStatisticsMemoryStore::createEncoderFromData const):
3588         (WebKit::ResourceLoadStatisticsMemoryStore::hasUserGrantedStorageAccessThroughPrompt):
3589         (WebKit::ResourceLoadStatisticsMemoryStore::hasHadUnexpiredRecentUserInteraction const):
3590         (WebKit::ResourceLoadStatisticsMemoryStore::setSubframeUnderTopFrameOrigin): Deleted.
3591         (WebKit::ResourceLoadStatisticsMemoryStore::setSubresourceUnderTopFrameOrigin): Deleted.
3592         * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.h:
3593         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
3594         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
3595         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameDomain):
3596         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameDomain):
3597         (WebKit::WebResourceLoadStatisticsStore::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
3598         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin): Deleted.
3599         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin): Deleted.
3600         * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
3601         * NetworkProcess/Classifier/WebResourceLoadStatisticsTelemetry.cpp:
3602         (WebKit::sortedPrevalentResourceTelemetry):
3603         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3604         * NetworkProcess/NetworkProcess.cpp:
3605         (WebKit::NetworkProcess::setSubframeUnderTopFrameDomain):
3606         (WebKit::NetworkProcess::setSubresourceUnderTopFrameDomain):
3607         (WebKit::filterForRegistrableDomains):
3608         (WebKit::NetworkProcess::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
3609         (WebKit::NetworkProcess::registrableDomainsWithWebsiteData):
3610         (WebKit::NetworkProcess::setSubframeUnderTopFrameOrigin): Deleted.
3611         (WebKit::NetworkProcess::setSubresourceUnderTopFrameOrigin): Deleted.
3612         * NetworkProcess/NetworkProcess.h:
3613         * NetworkProcess/NetworkProcess.messages.in:
3614         * NetworkProcess/NetworkSession.cpp:
3615         (WebKit::NetworkSession::deleteWebsiteDataForRegistrableDomainsInAllPersistentDataStores):
3616         * NetworkProcess/NetworkSession.h:
3617         * Platform/classifier/ResourceLoadStatisticsClassifier.cpp:
3618         (WebKit::ResourceLoadStatisticsClassifier::calculateResourcePrevalence):
3619         * Shared/WebCoreArgumentCoders.cpp:
3620         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
3621         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
3622         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3623         (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
3624         (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
3625         * UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
3626         (WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
3627         * UIProcess/Network/NetworkProcessProxy.cpp:
3628         (WebKit::NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor):
3629         (WebKit::NetworkProcessProxy::isPrevalentResource):
3630         (WebKit::NetworkProcessProxy::isVeryPrevalentResource):
3631         (WebKit::NetworkProcessProxy::setPrevalentResource):
3632         (WebKit::NetworkProcessProxy::setPrevalentResourceForDebugMode):
3633         (WebKit::NetworkProcessProxy::setVeryPrevalentResource):
3634         (WebKit::NetworkProcessProxy::setLastSeen):
3635         (WebKit::NetworkProcessProxy::clearPrevalentResource):
3636         (WebKit::NetworkProcessProxy::logUserInteraction):
3637         (WebKit::NetworkProcessProxy::hasHadUserInteraction):
3638         (WebKit::NetworkProcessProxy::clearUserInteraction):
3639         (WebKit::NetworkProcessProxy::setSubframeUnderTopFrameDomain):
3640         (WebKit::NetworkProcessProxy::isRegisteredAsRedirectingTo):
3641         (WebKit::NetworkProcessProxy::isRegisteredAsSubFrameUnder):
3642         (WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameDomain):
3643         (WebKit::NetworkProcessProxy::isRegisteredAsSubresourceUnder):
3644         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectTo):
3645         (WebKit::NetworkProcessProxy::setSubresourceUniqueRedirectFrom):
3646         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectTo):
3647         (WebKit::NetworkProcessProxy::setTopFrameUniqueRedirectFrom):
3648         (WebKit::NetworkProcessProxy::isGrandfathered):
3649         (WebKit::NetworkProcessProxy::setGrandfathered):
3650         (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
3651         (WebKit::NetworkProcessProxy::hasStorageAccess):
3652         (WebKit::NetworkProcessProxy::requestStorageAccess):
3653         (WebKit::NetworkProcessProxy::requestStorageAccessConfirm):
3654         (WebKit::NetworkProcessProxy::grantStorageAccess):
3655         (WebKit::NetworkProcessProxy::setSubframeUnderTopFrameOrigin): Deleted.
3656         (WebKit::NetworkProcessProxy::setSubresourceUnderTopFrameOrigin): Deleted.
3657         * UIProcess/Network/NetworkProcessProxy.h:
3658         * UIProcess/Network/NetworkProcessProxy.messages.in:
3659         * UIProcess/WebPageProxy.cpp:
3660         (WebKit::WebPageProxy::requestStorageAccessConfirm):
3661         * UIProcess/WebPageProxy.h:
3662         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3663         (WebKit::WebsiteDataStore::isPrevalentResource):
3664         (WebKit::WebsiteDataStore::setPrevalentResource):
3665         (WebKit::WebsiteDataStore::setPrevalentResourceForDebugMode):
3666         (WebKit::WebsiteDataStore::isVeryPrevalentResource):
3667         (WebKit::WebsiteDataStore::setVeryPrevalentResource):
3668         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameDomain):
3669         (WebKit::WebsiteDataStore::isRegisteredAsSubFrameUnder):
3670         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameDomain):
3671         (WebKit::WebsiteDataStore::isRegisteredAsSubresourceUnder):
3672         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectTo):
3673         (WebKit::WebsiteDataStore::setSubresourceUniqueRedirectFrom):
3674         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectTo):
3675         (WebKit::WebsiteDataStore::setTopFrameUniqueRedirectFrom):
3676         (WebKit::WebsiteDataStore::isRegisteredAsRedirectingTo):
3677         (WebKit::WebsiteDataStore::clearPrevalentResource):
3678         (WebKit::WebsiteDataStore::setLastSeen):
3679         (WebKit::WebsiteDataStore::hasStorageAccess):
3680         (WebKit::WebsiteDataStore::requestStorageAccess):
3681         (WebKit::WebsiteDataStore::grantStorageAccess):
3682         (WebKit::WebsiteDataStore::logUserInteraction):
3683         (WebKit::WebsiteDataStore::hasHadUserInteraction):
3684         (WebKit::WebsiteDataStore::clearUserInteraction):
3685         (WebKit::WebsiteDataStore::setGrandfathered):
3686         (WebKit::WebsiteDataStore::setSubframeUnderTopFrameOrigin): Deleted.
3687         (WebKit::WebsiteDataStore::setSubresourceUnderTopFrameOrigin): Deleted.
3688         * UIProcess/WebsiteData/WebsiteDataStore.h:
3689         * WebProcess/WebPage/WebPage.cpp:
3690         (WebKit::WebPage::hasStorageAccess):
3691         (WebKit::WebPage::requestStorageAccess):
3692
3693 2019-02-27  Keith Rollin  <krollin@apple.com>
3694
3695         Fix Xcode project UUIDs for TextCheckerCompletion.cpp and TextCheckerCompletion.h
3696         https://bugs.webkit.org/show_bug.cgi?id=195109
3697         <rdar://problem/48442272>
3698
3699         Reviewed by Alexey Proskuryakov.
3700
3701         In r144436, TextCheckerCompletion.cpp and TextCheckerCompletion.h were
3702         added to WebKit2.xcodeproj with invalid UUIDs (they included Q's and
3703         Z's in hexadecimal strings). While these UUIDs haven't caused any
3704         problems in practice over the last six years, they are indeed invalid,
3705         and were discovered via an Xcode-project processing tool that did not
3706         anticipate their format. Fix this by removing the files from the
3707         project and re-adding them.
3708
3709         * WebKit.xcodeproj/project.pbxproj:
3710
3711 2019-02-27  Youenn Fablet  <youenn@apple.com>
3712
3713         Remove UserMediaProcessManager processState map
3714         https://bugs.webkit.org/show_bug.cgi?id=195056
3715
3716         Reviewed by Eric Carlson.
3717
3718         Before the patch, the WebProcessProxy->ProcessState map was storing the list of manager proxies and process state.
3719         To improve on this model, this patch does the following:
3720         - Move the process state to WebProcessProxy.
3721         - Remove the map and replace it by a set of all manager proxies.
3722
3723         This simplifies the handling.
3724         On WebProcess side, instead of storing the sandbox extensions in each WebPage, we handle them in WebProcess directly.
3725         This mirrors what is being done in UIProcess and reduces the risk of inconsistencies between the two, the risk being that capture would fail.
3726
3727         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3728         (WebKit::UserMediaPermissionRequestManagerProxy::forEach):
3729         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
3730         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
3731         (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged):
3732         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
3733         * UIProcess/UserMediaProcessManager.cpp:
3734         (WebKit::UserMediaProcessManager::muteCaptureMediaStreamsExceptIn):
3735         (WebKit::UserMediaProcessManager::willCreateMediaStream):
3736         (WebKit::UserMediaProcessManager::endedCaptureSession):
3737         (WebKit::UserMediaProcessManager::setCaptureEnabled):
3738         (WebKit::UserMediaProcessManager::captureDevicesChanged):
3739         (WebKit::ProcessState::ProcessState): Deleted.
3740         (WebKit::ProcessState::hasVideoExtension const): Deleted.
3741         (WebKit::ProcessState::grantVideoExtension): Deleted.
3742         (WebKit::ProcessState::revokeVideoExtension): Deleted.
3743         (WebKit::ProcessState::hasAudioExtension const): Deleted.
3744         (WebKit::ProcessState::grantAudioExtension): Deleted.
3745         (WebKit::ProcessState::revokeAudioExtension): Deleted.
3746         (WebKit::stateMap): Deleted.
3747         (WebKit::processState): Deleted.
3748         (WebKit::ProcessState::addRequestManager): Deleted.
3749         (WebKit::ProcessState::removeRequestManager): Deleted.
3750         (WebKit::UserMediaProcessManager::addUserMediaPermissionRequestManagerProxy): Deleted.
3751         (WebKit::UserMediaProcessManager::removeUserMediaPermissionRequestManagerProxy): Deleted.
3752         (WebKit::UserMediaProcessManager::startedCaptureSession): Deleted.
3753         * UIProcess/UserMediaProcessManager.h:
3754         * UIProcess/WebProcessProxy.h:
3755         (WebKit::WebProcessProxy::mediaCaptureSandboxExtensions const):
3756         (WebKit::WebProcessProxy::hasVideoCaptureExtension const):
3757         (WebKit::WebProcessProxy::grantVideoCaptureExtension):
3758         (WebKit::WebProcessProxy::revokeVideoCaptureExtension):
3759         (WebKit::WebProcessProxy::hasAudioCaptureExtension const):
3760         (WebKit::WebProcessProxy::grantAudioCaptureExtension):
3761         (WebKit::WebProcessProxy::revokeAudioCaptureExtension):
3762         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
3763         (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Deleted.
3764         (WebKit::UserMediaPermissionRequestManager::clear): Deleted.
3765         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Deleted.
3766         (WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): Deleted.
3767         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
3768         * WebProcess/WebPage/WebPage.cpp:
3769         (WebKit::WebPage::close):
3770         (WebKit::WebPage::grantUserMediaDeviceSandboxExtensions): Deleted.
3771         (WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions): Deleted.
3772         * WebProcess/WebPage/WebPage.h:
3773         * WebProcess/WebPage/WebPage.messages.in:
3774         * WebProcess/WebProcess.cpp:
3775         (WebKit::WebProcess::grantUserMediaDeviceSandboxExtensions):
3776         (WebKit::WebProcess::revokeUserMediaDeviceSandboxExtensions):
3777         * WebProcess/WebProcess.h:
3778         * WebProcess/WebProcess.messages.in:
3779
3780 2019-02-27  Per Arne Vollan  <pvollan@apple.com>
3781
3782         [macOS] Disable permissive call logging in sandbox
3783         https://bugs.webkit.org/show_bug.cgi?id=194061
3784         <rdar://problem/47686253>
3785
3786         Reviewed by Brent Fulgham.
3787
3788         Strict call filtering should be reenabled.
3789
3790         * WebProcess/com.apple.WebProcess.sb.in:
3791
3792 2019-02-27  Chris Dumez  <cdumez@apple.com>
3793
3794         [HTTPSUpgrade] Use open source database until the feature is ready
3795         https://bugs.webkit.org/show_bug.cgi?id=195069
3796         <rdar://problem/47838224>
3797
3798         Reviewed by Geoffrey Garen.
3799
3800         * DerivedSources-input.xcfilelist:
3801         * DerivedSources.make:
3802
3803 2019-02-27  Antoine Quint  <graouts@apple.com>
3804
3805         Support Pointer Events on macOS
3806         https://bugs.webkit.org/show_bug.cgi?id=195008
3807         <rdar://problem/47454419>
3808
3809         Reviewed by Dean Jackson.
3810
3811         * Configurations/FeatureDefines.xcconfig:
3812
3813 2019-02-27  Sihui Liu  <sihui_liu@apple.com>
3814
3815         Network Process is put to suspended when holding locked IndexedDB files
3816         https://bugs.webkit.org/show_bug.cgi?id=195024
3817         <rdar://problem/45194169>
3818
3819         Reviewed by Geoffrey Garen.
3820
3821         * NetworkProcess/NetworkProcess.cpp:
3822         (WebKit::NetworkProcess::idbServer):
3823         (WebKit::NetworkProcess::notifyHoldingLockedFiles):
3824         * NetworkProcess/NetworkProcess.h:
3825         * UIProcess/Network/NetworkProcessProxy.cpp:
3826         (WebKit::NetworkProcessProxy::didClose):
3827         (WebKit::NetworkProcessProxy::setIsIDBDatabaseHoldingLockedFiles):
3828         * UIProcess/Network/NetworkProcessProxy.h:
3829         * UIProcess/Network/NetworkProcessProxy.messages.in:
3830
3831 2019-02-26  Simon Fraser  <simon.fraser@apple.com>
3832
3833         Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
3834         https://bugs.webkit.org/show_bug.cgi?id=194973
3835
3836         Reviewed by Antti Koivisto.
3837
3838         This patch cleans up how the scrolling tree responds to scrolls.
3839
3840         First, ScrollingTreeScrollingNode::m_currentScrollPosition is "truth" for scrolling thread/
3841         UI process scroll position.
3842
3843         On macOS where handleWheelEvent on the scrolling thread changes scroll position, the
3844         bottleneck is ScrollingTreeScrollingNode::scrollTo() which sets the new scroll position,
3845         update the visual viewport (for frame scrolls) updates the scrolledContentsLayer position,
3846         updates related layers on this node (counter-scrolling layers etc), and then tells the
3847         scrolling tree, which recurses through descendant nodes so they can adjust their layer
3848         positions.
3849
3850         On iOS, the bottleneck is ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling(),
3851         which does the above other than setting scrolledContentsLayer (since we're reacting to
3852         layer state changes, not producing them).
3853
3854         updateLayersAfterAncestorChange() is renamed to relatedNodeScrollPositionDidChange(), and
3855         ScrollingTree does the tree walk so classes don't have to implement
3856         updateLayersAfterAncestorChange() just to talk children. The ScrollingTree tree walk knows
3857         how to get the correct layoutViewport and to stop at frame boundaries (layer updates never
3858         need to cross frame boundaries).
3859
3860         We preserve 'cumulativeDelta'; it's necessary for things like fixed inside overflow:scroll,
3861         since the fixed state was computed with the "layout" scroll position, so we have to account
3862         for the scroll delta since the last committed position. It's possible we could improve this
3863         in future.
3864
3865         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
3866         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
3867         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
3868         (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
3869         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
3870         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
3871         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
3872         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
3873         * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
3874         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3875         (WebKit::RemoteScrollingCoordinatorProxy::currentLayoutViewport const):
3876         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
3877         * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
3878         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
3879         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::repositionScrollingLayers):
3880         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::repositionRelatedLayers):
3881         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const): Deleted.
3882         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollPosition): Deleted.
3883         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition): Deleted.
3884         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateChildNodesAfterScroll): Deleted.
3885         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll): Deleted.
3886         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterViewportChange): Deleted.
3887         (WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange): Deleted.
3888         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
3889         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
3890         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::repositionScrollingLayers):
3891         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange): Deleted.
3892         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollPosition const): Deleted.
3893         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): Deleted.
3894         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterDelegatedScroll): Deleted.
3895         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
3896         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
3897         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::ScrollingTreeScrollingNodeDelegateIOS):
3898         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::repositionScrollingLayers):
3899         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll):
3900         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange): Deleted.
3901         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollPosition const): Deleted.
3902         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::setScrollLayerPosition): Deleted.
3903         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll): Deleted.
3904         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll const): Deleted.
3905         * UIProcess/RemoteLayerTree/mac/ScrollerPairMac.mm:
3906         (WebKit::ScrollerPairMac::updateValues):
3907         (WebKit::ScrollerPairMac::valuesForOrientation):
3908         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.cpp:
3909         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::repositionRelatedLayers):
3910         (WebKit::ScrollingTreeFrameScrollingNodeRemoteMac::setScrollLayerPosition): Deleted.
3911         * UIProcess/RemoteLayerTree/mac/ScrollingTreeFrameScrollingNodeRemoteMac.h:
3912         * UIProcess/ios/WKContentView.mm:
3913         (-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
3914
3915 2019-02-27  Alex Christensen  <achristensen@webkit.org>
3916
3917         Silence log after r242122
3918         https://bugs.webkit.org/show_bug.cgi?id=195074