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