71edfa186dfc3f098867d159e0295081748b34b2
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2017-07-21  Brady Eidson  <beidson@apple.com>
2
3         Get rid of WebCore IconDatabase code.
4         https://bugs.webkit.org/show_bug.cgi?id=174700
5
6         Reviewed by Tim Horton.
7
8         * UIProcess/API/glib/WebKitWebContext.cpp:
9         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
10         (WebKit::WebFrameLoaderClient::useIconLoadingClient): Deleted.
11         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
12
13 2017-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
14
15         Web Automation: implicit navigations don't cause browsing context switch
16         https://bugs.webkit.org/show_bug.cgi?id=174633
17         <rdar://problem/33387797>
18
19         Reviewed by Brian Burg.
20
21         When a new page load replaces the current frameset, for example when a link in the current browser context has a
22         _top target, there's no explicit context switch, so the web driver doesn't know that the current browsing
23         context is no longer valid. Following commands will still be using the previous frame as the current browsing
24         context, but they don't fail with no such frame because the frame is still alive in the page cache and
25         referenced in the internal maps used in both UI and web processes. This causes test
26         testShouldFocusOnTheReplacementWhenAFrameFollowsALinkToA_TopTargetedPage to fail, since it expects a no such
27         frame exception. When a new page navigation happens we can simply remove references to frames from
28         m_handleWebFrameMap in WebAutomationSession, because any existing frame reference in the map should be for a
29         previous page. With this, before the next command is executed, waitForNavigationToComplete will be called and it
30         will fail with no such frame, condition that is handled to switch to the top level browser context. The test
31         still fails, because the find element command is called with the top level browsing context, returning no such
32         element, instead of no such frame. This is consistent with Chrome.
33
34         * UIProcess/Automation/WebAutomationSession.cpp:
35         (WebKit::WebAutomationSession::navigationOccurredForFrame): Clear the m_handleWebFrameMap when a new page load
36         finished.
37
38 2017-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
39
40         WebDriver: wait until navigation is complete before running new commands and after a click
41         https://bugs.webkit.org/show_bug.cgi?id=174670
42
43         Reviewed by Brian Burg.
44
45         Add waitForNavigationToComplete method to Automation to allow WebDriver to wait for pending navigations to
46         complete. The new method already receives page load strategy and timeout, but they are not implemented yet.
47
48         * UIProcess/Automation/Automation.json: Add waitForNavigationToComplete method and PageLoadStrategy new type.
49         * UIProcess/Automation/WebAutomationSession.cpp:
50         (WebKit::WebAutomationSession::waitForNavigationToComplete): Call waitForNavigationToCompleteOnPage or
51         waitForNavigationToCompleteOnFrame depending on whether the current borwsing context is the main frame or not.
52         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage): Check if there's an ongoing load for the page,
53         and wait for it to complete if needed.
54         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame): Check if there's an ongoing load for the frame,
55         and wait for it to complete if needed.
56         (WebKit::WebAutomationSession::navigateBrowsingContext): Use waitForNavigationToCompleteOnPage() now.
57         (WebKit::WebAutomationSession::goBackInBrowsingContext): Ditto.
58         (WebKit::WebAutomationSession::goForwardInBrowsingContext): Ditto.
59         (WebKit::WebAutomationSession::reloadBrowsingContext): Ditto.
60         (WebKit::WebAutomationSession::navigationOccurredForFrame): Renamed since it now receives the notification for
61         all the frames. Complete page operations if it's a main frame, or frame operations otherwise.
62         * UIProcess/Automation/WebAutomationSession.h:
63         * UIProcess/WebPageProxy.cpp:
64         (WebKit::WebPageProxy::didFinishLoadForFrame): Notify about all frames, not only the main one.
65         (WebKit::WebPageProxy::didFailLoadForFrame): Ditto.
66         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): Ditto.
67
68 2017-07-20  Carlos Garcia Campos  <cgarcia@igalia.com>
69
70         Unreviewed. Remove WKIconDatabaseCairo.
71
72         * PlatformGTK.cmake:
73         * PlatformWPE.cmake:
74         * UIProcess/API/C/cairo/WKIconDatabaseCairo.cpp: Removed.
75         * UIProcess/API/C/cairo/WKIconDatabaseCairo.h: Removed.
76
77 2017-07-20  Brady Eidson  <beidson@apple.com>
78
79         Get rid of IconDatabase related code in WebKit.
80         https://bugs.webkit.org/show_bug.cgi?id=174693
81
82         Reviewed by Tim Horton.
83
84         This leaves the C-API class but guts it.
85
86         No explanations of the other changes are needed.
87
88         * CMakeLists.txt:
89         * DerivedSources.make:
90         * Shared/WebProcessCreationParameters.cpp:
91         (WebKit::WebProcessCreationParameters::encode):
92         (WebKit::WebProcessCreationParameters::decode):
93         * Shared/WebProcessCreationParameters.h:
94         * UIProcess/API/C/WKContext.cpp:
95         (WKContextGetIconDatabase):
96         (WKContextSetIconDatabasePath):
97         * UIProcess/API/C/WKIconDatabase.cpp:
98         (WKIconDatabaseSetIconDatabaseClient):
99         (WKIconDatabaseRetainIconForURL):
100         (WKIconDatabaseReleaseIconForURL):
101         (WKIconDatabaseSetIconDataForIconURL):
102         (WKIconDatabaseSetIconURLForPageURL):
103         (WKIconDatabaseCopyIconURLForPageURL):
104         (WKIconDatabaseCopyIconDataForPageURL):
105         (WKIconDatabaseEnableDatabaseCleanup):
106         (WKIconDatabaseRemoveAllIcons):
107         (WKIconDatabaseCheckIntegrityBeforeOpening):
108         (WKIconDatabaseClose):
109         * UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
110         (WKIconDatabaseTryGetCGImageForURL):
111         (WKIconDatabaseTryCopyCGImageArrayForURL):
112         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
113         (WebKit::WebProcessPool::platformDefaultIconDatabasePath): Deleted.
114         * UIProcess/WebIconDatabase.cpp: Removed.
115         * UIProcess/WebIconDatabase.h:
116         (WebKit::WebIconDatabase::clearProcessPool): Deleted.
117         * UIProcess/WebIconDatabase.messages.in: Removed.
118         * UIProcess/WebIconDatabaseClient.cpp: Removed.
119         * UIProcess/WebIconDatabaseClient.h: Removed.
120         * UIProcess/WebProcessPool.cpp:
121         (WebKit::m_hiddenPageThrottlingTimer):
122         (WebKit::WebProcessPool::~WebProcessPool):
123         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
124         (WebKit::WebProcessPool::createNewWebProcess):
125         (WebKit::WebProcessPool::setIconDatabasePath): Deleted.
126         (WebKit::WebProcessPool::iconDatabasePath): Deleted.
127         * UIProcess/WebProcessPool.h:
128         * UIProcess/WebProcessProxy.cpp:
129         (WebKit::WebProcessProxy::processWillShutDown):
130         (WebKit::WebProcessProxy::retainIconForPageURL): Deleted.
131         (WebKit::WebProcessProxy::releaseIconForPageURL): Deleted.
132         (WebKit::WebProcessProxy::releaseRemainingIconsForPageURLs): Deleted.
133         * UIProcess/WebProcessProxy.h:
134         * UIProcess/WebProcessProxy.messages.in:
135         * UIProcess/gtk/WebProcessPoolGtk.cpp:
136         (WebKit::WebProcessPool::platformDefaultIconDatabasePath): Deleted.
137         * UIProcess/wpe/WebProcessPoolWPE.cpp:
138         (WebKit::WebProcessPool::platformDefaultIconDatabasePath): Deleted.
139         * WebKit.xcodeproj/project.pbxproj:
140         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp: Removed.
141         * WebProcess/IconDatabase/WebIconDatabaseProxy.h: Removed.
142         * WebProcess/IconDatabase/WebIconDatabaseProxy.messages.in: Removed.
143         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
144         * WebProcess/WebProcess.cpp:
145         (WebKit::WebProcess::WebProcess):
146         (WebKit::WebProcess::initializeWebProcess):
147         (WebKit::WebProcess::getWebCoreStatistics):
148         * WebProcess/WebProcess.h:
149
150 2017-07-20  David Quesada  <david_quesada@apple.com>
151
152         Add SPI to notify WKNavigationDelegate about client redirects
153         https://bugs.webkit.org/show_bug.cgi?id=174680
154         rdar://problem/33184886
155
156         Reviewed by Brady Eidson.
157
158         * UIProcess/API/APINavigationClient.h:
159         (API::NavigationClient::didPerformClientRedirectForNavigation):
160         Add a new virtual method for navigation clients to implement if they want to be informed
161         when the page is initiating a navigation that is a client redirect.
162
163         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
164         Declare the new WKNavigationDelegate method -_webView:didPerformClientRedirectForNavigation:
165
166         * UIProcess/Cocoa/NavigationState.h:
167         * UIProcess/Cocoa/NavigationState.mm:
168         (WebKit::NavigationState::setNavigationDelegate):
169         (WebKit::NavigationState::NavigationClient::didPerformClientRedirectForNavigation):
170         Add a new method to NavigationState method to tell the WKNavigationDelegate when a
171         client redirect happens.
172
173         * UIProcess/WebPageProxy.cpp:
174         (WebKit::WebPageProxy::didPerformClientRedirectForLoadForFrame):
175         * UIProcess/WebPageProxy.h:
176         * UIProcess/WebPageProxy.messages.in:
177         Allow the WebPageProxy to receive a message from the web process when a client redirect happens.
178
179         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
180         (WebKit::WebFrameLoaderClient::dispatchDidPerformClientRedirect):
181         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
182         Send this new message to the UI process on client redirects.
183
184 2017-07-20  Chris Dumez  <cdumez@apple.com>
185
186         Drop legacy XPathException type
187         https://bugs.webkit.org/show_bug.cgi?id=174679
188
189         Reviewed by Sam Weinig.
190
191         Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome
192         no longer expose XPathException.
193
194         * UIProcess/Automation/atoms/FindNodes.js:
195         (tryToFindNode):
196
197 2017-07-20  Chris Dumez  <cdumez@apple.com>
198
199         Unreviewed, rolling out r219706.
200
201         Broke iOS build
202
203         Reverted changeset:
204
205         "Drop legacy XPathException type"
206         https://bugs.webkit.org/show_bug.cgi?id=174679
207         http://trac.webkit.org/changeset/219706
208
209 2017-07-20  Chris Dumez  <cdumez@apple.com>
210
211         Drop legacy XPathException type
212         https://bugs.webkit.org/show_bug.cgi?id=174679
213
214         Reviewed by Sam Weinig.
215
216         Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome
217         no longer expose XPathException.
218
219         * UIProcess/Automation/atoms/FindNodes.js:
220         (tryToFindNode):
221
222 2017-07-20  Chris Dumez  <cdumez@apple.com>
223
224         Avoid unnecessary WorkQueue dispatch in WebResourceLoadStatisticsStore::processStatisticsAndDataRecords()
225         https://bugs.webkit.org/show_bug.cgi?id=174686
226
227         Reviewed by Geoffrey Garen.
228
229         Avoid unnecessary WorkQueue dispatch in WebResourceLoadStatisticsStore::processStatisticsAndDataRecords(). The most common
230         call site is already on the right thread.
231
232         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
233         (-[WKWebsiteDataStore _resourceLoadStatisticsProcessStatisticsAndDataRecords]):
234         * UIProcess/WebResourceLoadStatisticsStore.cpp:
235         (WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
236         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
237         * UIProcess/WebResourceLoadStatisticsStore.h:
238
239 2017-07-20  Chris Dumez  <cdumez@apple.com>
240
241         Regression(ITP): May get frequently logged out of wsj.com
242         https://bugs.webkit.org/show_bug.cgi?id=174661
243         <rdar://problem/32343256>
244
245         Reviewed by Geoffrey Garen.
246
247         Bump statistics file version to blow away old statistics on disk since those do not
248         take into account associated domains.
249
250         * UIProcess/WebResourceLoadStatisticsStore.cpp:
251
252 2017-07-20  Chris Dumez  <cdumez@apple.com>
253
254         Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable
255         https://bugs.webkit.org/show_bug.cgi?id=174660
256
257         Reviewed by Geoffrey Garen.
258
259         Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable.
260         This essentially replaces a branch to figure out if the new size is less or greater than the
261         current size by an assertion.
262
263         * Platform/IPC/ArgumentCoders.h:
264         * UIProcess/Gamepad/UIGamepadProvider.cpp:
265         (WebKit::UIGamepadProvider::platformGamepadConnected):
266         * UIProcess/WebProcessPool.cpp:
267         (WebKit::WebProcessPool::setInitialConnectedGamepads):
268         * WebProcess/Network/WebLoaderStrategy.cpp:
269         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
270         * WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp:
271         (WebKit::WebPasteboardOverrides::getDataForOverride):
272         * WebProcess/WebPage/ios/WebPageIOS.mm:
273         (WebKit::WebPage::requestAutocorrectionData):
274
275 2017-07-20  Chris Dumez  <cdumez@apple.com>
276
277         Regression(ITP): Can no longer log in on abc.go.com
278         https://bugs.webkit.org/show_bug.cgi?id=174533
279         <rdar://problem/33325881>
280
281         Reviewed by Geoffrey Garen.
282
283         Bump statistics database version to blow away any existing statistics. Without this, SSO providers
284         for which we added a quirk may already be in the database and identified as trackers. The quirk
285         merely prevents the specified SSO providers from being identified as trackers.
286
287         * UIProcess/WebResourceLoadStatisticsStore.cpp:
288
289 2017-07-19  Simon Fraser  <simon.fraser@apple.com>
290
291         getBoundingClientRects not updated for programmatic scrolls
292         https://bugs.webkit.org/show_bug.cgi?id=174538
293         rdar://problem/33049012
294
295         Reviewed by Tim Horton.
296         
297         Feed ViewportRectStability and ScrollingLayerPositionAction into reconcileScrollingState().
298
299         * WebProcess/WebPage/ios/WebPageIOS.mm:
300         (WebKit::WebPage::updateVisibleContentRects):
301
302 2017-07-19  Brady Eidson  <beidson@apple.com>
303
304         iBooks sometimes crashes when closing a book.
305         <rdar://problem/31180331> and https://bugs.webkit.org/show_bug.cgi?id=174658
306
307         Reviewed by Oliver Hunt.
308
309         - LegacyCustomProtocolManagerProxy should not reference a WebProcessPool directly.
310         - LegacyCustomProtocolManagerProxy should invalidate in its destructor.
311
312         * UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.cpp:
313         (WebKit::LegacyCustomProtocolManagerProxy::LegacyCustomProtocolManagerProxy):
314         (WebKit::LegacyCustomProtocolManagerProxy::~LegacyCustomProtocolManagerProxy):
315         (WebKit::LegacyCustomProtocolManagerProxy::startLoading):
316         (WebKit::LegacyCustomProtocolManagerProxy::stopLoading):
317         (WebKit::LegacyCustomProtocolManagerProxy::invalidate):
318         (WebKit::LegacyCustomProtocolManagerProxy::wasRedirectedToRequest):
319         (WebKit::LegacyCustomProtocolManagerProxy::didReceiveResponse):
320         (WebKit::LegacyCustomProtocolManagerProxy::didLoadData):
321         (WebKit::LegacyCustomProtocolManagerProxy::didFailWithError):
322         (WebKit::LegacyCustomProtocolManagerProxy::didFinishLoading):
323         (WebKit::LegacyCustomProtocolManagerProxy::processDidClose): Deleted.
324         * UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.h:
325
326         * UIProcess/Network/NetworkProcessProxy.cpp:
327         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
328         (WebKit::NetworkProcessProxy::didClose):
329         * UIProcess/Network/NetworkProcessProxy.h:
330         (WebKit::NetworkProcessProxy::processPool):
331
332 2017-07-19  Yusuke Suzuki  <utatane.tea@gmail.com>
333
334         [WTF] Implement WTF::ThreadGroup
335         https://bugs.webkit.org/show_bug.cgi?id=174081
336
337         Reviewed by Mark Lam.
338
339         * Shared/AsyncRequest.h:
340
341 2017-07-18  Carlos Garcia Campos  <cgarcia@igalia.com>
342
343         WebDriver: handle invalid selector errors
344         https://bugs.webkit.org/show_bug.cgi?id=174619
345
346         Reviewed by Brian Burg.
347
348         We are currently handling only XPathException and only when it's an invalid expression. In the xpath case, the
349         spec also says "If any item in result is not an element return an error with error code invalid selector.", so
350         we should also handle TYPE_ERR (The expression could not be converted to return the specified type.). However,
351         since the spec says "or other error", I think we can simplify this and simply throw InvalidSelector inside the
352         catch, without checking any specific error. This is causing 14 failures in selenium tests.
353
354         ยง12. Element Retrieval. Step 6: If a DOMException, SyntaxError, XPathException, or other error occurs during the
355         execution of the element location strategy, return error invalid selector.
356         https://www.w3.org/TR/webdriver/#dfn-find
357
358         * UIProcess/Automation/Automation.json: Add InvalidSelector error.
359         * UIProcess/Automation/atoms/FindNodes.js:
360         (tryToFindNode): Raise InvalidSelector in case of error.
361         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
362         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Handle InvalidSelector exceptions.
363
364 2017-07-18  Carlos Garcia Campos  <cgarcia@igalia.com>
365
366         Web Automation: error details not passed to DidEvaluateJavaScriptFunction message when callback was not called before page unload
367         https://bugs.webkit.org/show_bug.cgi?id=174624
368
369         Reviewed by Brian Burg.
370
371         There's a variable errorMessage, but it's unused.
372
373         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
374         (WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame): Pass errorMessage instead of String() to DidEvaluateJavaScriptFunction.
375
376 2017-07-18  Carlos Garcia Campos  <cgarcia@igalia.com>
377
378         Web Automation: evaluateJavaScriptFunction should always notify the web process before returning early
379         https://bugs.webkit.org/show_bug.cgi?id=174623
380
381         Reviewed by Brian Burg.
382
383         It currently returns early if page, frame or scriptObject are nullptr, in which cases the UI process is not
384         notified. This causes test testShouldNotBeAbleToDoAnythingTheFrameIsDeletedFromUnderUs to hang, because message
385         DidEvaluateJavaScriptFunction is never sent when the given frame no longer exists. We should send
386         DidEvaluateJavaScriptFunction with WindowNotFound in case of page is nullptr and FrameNotFound if the frame is
387         nullptr. The scriptObject early return is actually wrong, because scriptObjectForFrame creates a new script if
388         there's isn't one for the given frame.
389
390         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
391         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
392
393 2017-07-18  Carlos Garcia Campos  <cgarcia@igalia.com>
394
395         Web Automation: pending evaluate script callbacks are stored with the wrong frame ID when using the default main frame
396         https://bugs.webkit.org/show_bug.cgi?id=174622
397
398         Reviewed by Brian Burg.
399
400         The frameHandle argument is optional in evaluateJavaScriptFunction(), when not provided we pass 0 to the web
401         process. The proxy gets the web page main frame when received frame ID is 0, but the given frameID is
402         still used as key of m_webFramePendingEvaluateJavaScriptCallbacksMap and also passed to the javascript function
403         as argument. I think r203442 was actually a workaround to this bug, making it even more hidden. Both
404         m_webFrameScriptObjectMap and m_webFramePendingEvaluateJavaScriptCallbacksMap should never have 0 as a
405         key, since they always use a frame ID, and the frame identifier counter starts at 1. This is causing test
406         testShouldDetectPageLoadsWhileWaitingOnAnAsyncScriptAndReturnAnError to hang, because when the page is unloaded
407         and didClearWindowObjectForFrame is called, we try to get the pending callbacks of frame 1, but they were stored
408         as frame 0 so DidEvaluateJavaScriptFunction message is never sent to the UI process.
409
410         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
411         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Use always the actual frameID from the WebFrame
412         we are using.
413         * WebProcess/Automation/WebAutomationSessionProxy.h: Do not allow 0 as a key of
414         m_webFramePendingEvaluateJavaScriptCallbacksMap and m_webFrameScriptObjectMap.
415
416 2017-07-18  Andy Estes  <aestes@apple.com>
417
418         [Xcode] Enable CLANG_WARN_RANGE_LOOP_ANALYSIS
419         https://bugs.webkit.org/show_bug.cgi?id=174631
420
421         Reviewed by Tim Horton.
422
423         * Configurations/Base.xcconfig:
424         * Shared/API/APIArray.cpp:
425         (API::Array::toStringVector):
426         * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
427         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsArray):
428         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
429         (WebKit::WebUserContentControllerProxy::addProcess):
430         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
431         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
432         * UIProcess/ios/forms/WKFileUploadPanel.mm:
433         (-[WKFileUploadPanel presentWithParameters:resultListener:]):
434         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
435         (WebKit::InjectedBundlePageEditorClient::getPasteboardDataForRange):
436
437 2017-07-18  Andy Estes  <aestes@apple.com>
438
439         [Xcode] Enable CLANG_WARN_OBJC_LITERAL_CONVERSION
440         https://bugs.webkit.org/show_bug.cgi?id=174631
441
442         Reviewed by Sam Weinig.
443
444         * Configurations/Base.xcconfig:
445
446 2017-07-18  Andy Estes  <aestes@apple.com>
447
448         [Xcode] Enable CLANG_WARN_NON_LITERAL_NULL_CONVERSION
449         https://bugs.webkit.org/show_bug.cgi?id=174631
450
451         Reviewed by Dan Bernstein.
452
453         * Configurations/Base.xcconfig:
454
455 2017-07-18  Matt Lewis  <jlewis3@apple.com>
456
457         Unreviewed, rolling out r219610.
458
459         This caused an api failure on all platforms for the test
460         SnapshotImageLargeAsyncDecoding
461
462         Reverted changeset:
463
464         "Async image decoding for large images should be disabled
465         after the first time a tile is painted"
466         https://bugs.webkit.org/show_bug.cgi?id=174451
467         http://trac.webkit.org/changeset/219610
468
469 2017-07-18  Andy Estes  <aestes@apple.com>
470
471         [Xcode] Enable CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING
472         https://bugs.webkit.org/show_bug.cgi?id=174631
473
474         Reviewed by Darin Adler.
475
476         * Configurations/Base.xcconfig:
477
478 2017-07-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
479
480         Async image decoding for large images should be disabled after the first time a tile is painted
481         https://bugs.webkit.org/show_bug.cgi?id=174451
482
483         Reviewed by Simon Fraser.
484
485         * Shared/mac/RemoteLayerBackingStore.mm:
486         (WebKit::RemoteLayerBackingStore::drawInContext):
487         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
488         (WebKit::CompositingCoordinator::paintContents):
489         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
490
491 2017-07-17  Carlos Garcia Campos  <cgarcia@igalia.com>
492
493         Web Automation: link and partial link queries don't work if text link contains trailing or leading whitespaces
494         https://bugs.webkit.org/show_bug.cgi?id=174499
495
496         Reviewed by Brian Burg.
497
498         This is causing test test_Driver_Can_Get_Link_By_Link_Test_Ignoring_Trailing_Whitespace to fail.
499
500         * UIProcess/Automation/atoms/FindNodes.js:
501         (switch): Use normalize-space() in in the links xpath expressions.
502
503 2017-07-17  Darin Adler  <darin@apple.com>
504
505         Improve use of NeverDestroyed
506         https://bugs.webkit.org/show_bug.cgi?id=174348
507
508         Reviewed by Sam Weinig.
509
510         * DatabaseProcess/DatabaseProcess.h: Removed unneeded include of
511         NeverDestroyed.h.
512         * NetworkProcess/cache/NetworkCacheKey.cpp: Ditto.
513
514         * NetworkProcess/capture/NetworkCaptureManager.cpp: Moved include of
515         NeverDestroyed.h here ...
516         * NetworkProcess/capture/NetworkCaptureManager.h: ... from here.
517
518         * PluginProcess/PluginProcess.cpp: Moved include of NeverDestroyed.h
519         here ...
520         * PluginProcess/PluginProcess.h: ... from here.
521
522         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
523         (isContainerClass): Removed trivial inefficient use of
524         LazyNeverDestroyed<HashSet> to check against two classes.
525         Instead wrote out the boolean expression.
526
527         * Shared/mac/SecItemShim.cpp: Removed unneeded include of
528         NeverDestroyed.h.
529
530         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
531         (WebKit::WebProcessPool::platformInitialize): Call
532         installMemoryPressureHandler instead of WebMemoryPressureHandler::singleton.
533
534         * UIProcess/Gamepad/UIGamepadProvider.h: Removed unneeded include
535         of NeverDestroyed.h.
536
537         * UIProcess/Plugins/PluginProcessManager.cpp: Moved include of
538         NeverDestroyed.h here ...
539         * UIProcess/Plugins/PluginProcessManager.h: ... from here.
540
541         * UIProcess/WebInspectorProxy.cpp: Removed unneeded include
542         of NeverDestroyed.h.
543
544         * UIProcess/WebPageProxy.h: Added now-needed include of
545         MediaPlaybackTargetContext.h.
546
547         * UIProcess/WebPasteboardProxy.cpp: Moved include of
548         NeverDestroyed.h here ...
549         * UIProcess/WebPasteboardProxy.h: ... from here.
550
551         * UIProcess/ios/WebMemoryPressureHandlerIOS.h: Removed the
552         WebMemoryPressureHandler class from this header. Callers don't need to
553         know if there is a class. They simply indicate when it's time to install
554         the handler. Another way to put it is that this class had no functions
555         other than the singleton function.
556
557         * UIProcess/ios/WebMemoryPressureHandlerIOS.mm:
558         (WebKit::installMemoryPressureHandler): Replaced the class with this function.
559         It creates a dispatch source and then resumes it. To avoid having the source
560         look like a leak, we keep it in a global variable.
561
562         * WebProcess/Gamepad/WebGamepadProvider.h: Include Forward.h instead of
563         NeverDestroyed.h.
564
565         * WebProcess/WebCoreSupport/WebPasteboardOverrides.cpp: Moved include of
566         NeverDestroyed.h here ...
567         * WebProcess/WebCoreSupport/WebPasteboardOverrides.h: ... from here.
568
569         * WebProcess/WebCoreSupport/WebPlatformStrategies.h: Removed unneeded
570         include of NeverDestroyed.h.
571
572 2017-07-17  Timothy Horton  <timothy_horton@apple.com>
573
574         Page using safe area constant properties jumps to correct layout after resize
575         https://bugs.webkit.org/show_bug.cgi?id=174598
576         <rdar://problem/33364275>
577
578         Reviewed by Simon Fraser.
579
580         Test: fast/events/ios/rotation/safe-area-insets-during-safari-type-rotation.html
581
582         * UIProcess/API/Cocoa/WKWebView.mm:
583         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
584         * UIProcess/WebPageProxy.h:
585         * UIProcess/ios/WebPageProxyIOS.mm:
586         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
587         * WebProcess/WebPage/WebPage.h:
588         * WebProcess/WebPage/WebPage.messages.in:
589         * WebProcess/WebPage/ios/WebPageIOS.mm:
590         (WebKit::WebPage::dynamicViewportSizeUpdate):
591         Plumb unobscured safe area insets through in the dynamicViewportSizeUpdate,
592         like we do in VisibleContentRectUpdate (once again sad that these aren't
593         more similar), so that it will be correct in the during-rotation snapshot,
594         instead of only becoming correct in the first visible content rect update
595         post-rotation.
596
597 2017-07-17  Chris Dumez  <cdumez@apple.com>
598
599         UserMediaPermissionRequestManagerProxy should not use WebCore::Timer
600         https://bugs.webkit.org/show_bug.cgi?id=174599
601         <rdar://problem/33362600>
602
603         Reviewed by Tim Horton.
604
605         UserMediaPermissionRequestManagerProxy should not use WebCore::Timer since it runs in the
606         UIProcess. Switch to using RunLoop::Timer instead.
607
608         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
609         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy):
610         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
611
612 2017-07-17  Chris Dumez  <cdumez@apple.com>
613
614         NETWORK_SESSION does not need didReceiveAuthenticationChallenge(uint64_t, uint64_t, const AuthenticationChallenge&)
615         https://bugs.webkit.org/show_bug.cgi?id=174595
616
617         Reviewed by Alex Christensen.
618
619         * Shared/Authentication/AuthenticationManager.cpp:
620         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
621         * Shared/Authentication/AuthenticationManager.h:
622
623 2017-07-17  Wenson Hsieh  <wenson_hsieh@apple.com>
624
625         [iOS DnD] Web process uses too much memory when beginning a drag on a very large image
626         https://bugs.webkit.org/show_bug.cgi?id=174585
627         <rdar://problem/33302541>
628
629         Reviewed by Tim Horton.
630
631         Add IPC support for serializing/deserializing the size of an image written to the pasteboard. See WebCore
632         ChangeLogs for more details.
633
634         * Shared/WebCoreArgumentCoders.cpp:
635         (IPC::ArgumentCoder<PasteboardImage>::encode):
636         (IPC::ArgumentCoder<PasteboardImage>::decode):
637
638 2017-07-17  Konstantin Tokarev  <annulen@yandex.ru>
639
640         Unreviewed attempt to fix Mac cmake build
641
642         * PlatformMac.cmake: Remove reference to file which is gone since r219025
643
644 2017-07-17  Michael Catanzaro  <mcatanzaro@igalia.com>
645
646         [CMake] Include most CMake modules from WebKitCommon.cmake
647         https://bugs.webkit.org/show_bug.cgi?id=174546
648
649         Reviewed by Konstantin Tokarev.
650
651         * CMakeLists.txt:
652
653 2017-07-17  Michael Catanzaro  <mcatanzaro@igalia.com>
654
655         [CMake] Macros in WebKitMacros.cmake should be prefixed with WEBKIT_ namespace
656         https://bugs.webkit.org/show_bug.cgi?id=174547
657
658         Reviewed by Alex Christensen.
659
660         * CMakeLists.txt:
661
662 2017-07-17  Alex Christensen  <achristensen@webkit.org>
663
664         Modernize content extension code
665         https://bugs.webkit.org/show_bug.cgi?id=174588
666
667         Reviewed by Sam Weinig.
668
669         * WebProcess/UserContent/WebUserContentController.cpp:
670         (WebKit::WebUserContentController::addContentRuleLists):
671
672 2017-07-17  Jeremy Jones  <jeremyj@apple.com>
673
674         Add video fullscreen transition logging.
675         https://bugs.webkit.org/show_bug.cgi?id=174474
676
677         Reviewed by Jer Noble.
678
679         No functional change. Just adds logging.
680
681         * Platform/Logging.h:
682         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
683         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
684         (WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement):
685         (WebKit::WebVideoFullscreenManager::exitVideoFullscreenToModeWithoutAnimation):
686         (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
687         (WebKit::WebVideoFullscreenManager::didEnterFullscreen):
688         (WebKit::WebVideoFullscreenManager::didExitFullscreen):
689         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen):
690         (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced):
691
692 2017-07-17  Konstantin Tokarev  <annulen@yandex.ru>
693
694         [CMake] Create targets before WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS is called
695         https://bugs.webkit.org/show_bug.cgi?id=174557
696
697         Reviewed by Michael Catanzaro.
698
699         * CMakeLists.txt:
700
701 2017-07-17  Carlos Garcia Campos  <cgarcia@igalia.com>
702
703         Web Automation: link and partial link queries don't work if the link contains formatting tags
704         https://bugs.webkit.org/show_bug.cgi?id=174498
705
706         Reviewed by Brian Burg.
707
708         So, for example, if we find links with text "Foo" and there's a link like <a href=""><bA>Foo</b></a> we fail
709         with no such element error. This causes test test_Link_With_Formatting_Tags to fail.
710
711         * UIProcess/Automation/atoms/FindNodes.js:
712         (switch): Use descendant-or-self::text() instead of just text() in the links xpath expressions.
713
714 2017-07-16  Carlos Garcia Campos  <cgarcia@igalia.com>
715
716         Web Automation: FindNodes should throw an error in case of invalid strategy
717         https://bugs.webkit.org/show_bug.cgi?id=174497
718
719         Reviewed by Brian Burg.
720
721         We are currently returning null or empty list. According to the spec in 12.2 Find Element and 12.3 Find
722         Elements, step 4: "If location strategy is not present as a keyword in the table of location strategies, return
723         error with error code invalid argument.".
724         https://www.w3.org/TR/webdriver/#find-element.
725
726         This is causing test test_should_throw_an_error_if_user_passes_in_invalid_by_when_find_elements to fail.
727
728         * UIProcess/Automation/atoms/FindNodes.js:
729         (switch): Throw an error in case of unknown strategy.
730         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
731         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Handle InvalidParameter exceptions.
732
733 2017-07-16  Brady Eidson  <beidson@apple.com>
734
735         Crash when a WKHTTPCookieStore outlives its owning WKWebsiteDataStore.
736         <rdar://problem/33341730> and https://bugs.webkit.org/show_bug.cgi?id=174574
737
738         Reviewed by Tim Horton.
739
740         Instead of holding a weak reference to its owning API::WebsiteDataStore,
741         API::HTTPCookieStore can hold a strong reference to the owner's implementation
742         WebKit::WebsiteDataStore.
743         
744         * UIProcess/API/APIHTTPCookieStore.cpp:
745         (API::HTTPCookieStore::HTTPCookieStore):
746         (API::HTTPCookieStore::cookies):
747         (API::HTTPCookieStore::setCookie):
748         (API::HTTPCookieStore::deleteCookie):
749         (API::HTTPCookieStore::registerObserver):
750         (API::HTTPCookieStore::unregisterObserver):
751         (API::HTTPCookieStore::cookieManagerDestroyed):
752         (API::HTTPCookieStore::registerForNewProcessPoolNotifications):
753         * UIProcess/API/APIHTTPCookieStore.h:
754
755 2017-07-15  Brady Eidson  <beidson@apple.com>
756
757         Make sure all CFHTTPCookieStorageRefs we create are scheduled.
758         <rdar://problem/33221110> and https://bugs.webkit.org/show_bug.cgi?id=174513
759
760         Reviewed by Tim Horton.
761
762         Whenever we create a CFHTTPCookieStorage from identifying data it is unscheduled.
763         We need to schedule it on the appropriate RunLoop.
764         
765         This patch also cleans up the creation of the identifying data itself.
766         
767         * NetworkProcess/mac/RemoteNetworkingContext.mm:
768         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
769
770         * Shared/cf/CookieStorageUtilsCF.h: Added.
771         * Shared/cf/CookieStorageUtilsCF.mm: Added.
772         (WebKit::cookieStorageFromIdentifyingData):
773         (WebKit::identifyingDataFromCookieStorage):
774
775         * Shared/mac/ChildProcessMac.mm:
776         (WebKit::ChildProcess::setSharedHTTPCookieStorage):
777
778         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
779         (WebKit::WebProcessPool::platformInitializeWebProcess):
780         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
781
782         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
783         (WebKit::WebsiteDataStore::parameters):
784
785         * WebKit.xcodeproj/project.pbxproj:
786
787         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
788         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
789
790 2017-07-15  Wenson Hsieh  <wenson_hsieh@apple.com>
791
792         [iOS WK2] Presenting an action sheet on an image map prevents selection UI from updating
793         https://bugs.webkit.org/show_bug.cgi?id=174539
794         <rdar://problem/33307395>
795
796         Reviewed by Darin Adler.
797
798         Small tweak to avoid presenting at the element rect or text rect if the interaction information failed to
799         capture valid bounds for the element. We instead fall back to presenting at the touch location. This addresses
800         problems when presenting the action sheet popover on image maps on iPad, where GetPositionInformation fails to
801         capture correct data about for the <area>.
802
803         * UIProcess/ios/WKActionSheetAssistant.mm:
804         (presentationStyleForView):
805
806 2017-07-14  Jonathan Bedard  <jbedard@apple.com>
807
808         Add iOS 11 SPI
809         https://bugs.webkit.org/show_bug.cgi?id=174430
810         <rdar://problem/33269288>
811
812         Reviewed by Tim Horton.
813
814         * Platform/spi/ios/UIKitSPI.h: Add drag-and-drop SPI for iOS 11.
815         * UIProcess/ios/WKContentViewInteraction.mm: Move UIKit SPI to UIKitSPI.h.
816
817 2017-07-14  Jeff Miller  <jeffm@apple.com>
818
819         -[WKWebProcessBundleParameters setParametersForKeyWithDictionary:] passing wrong parameters to -setParameter:forKey
820         https://bugs.webkit.org/show_bug.cgi?id=174524
821
822         Reviewed by Sam Weinig.
823
824         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.mm:
825         (-[WKWebProcessBundleParameters setParametersForKeyWithDictionary:]):
826         Pass the dictionary key and value in the correct order.
827
828 2017-07-14  Brent Fulgham  <bfulgham@apple.com>
829
830         Monitor directory for new statistics files after a delete operation
831         https://bugs.webkit.org/show_bug.cgi?id=174521
832         <rdar://problem/33322189>
833
834         Reviewed by Chris Dumez.
835
836         Create a FileMonitor to watch the data directory when the statistics file is
837         deleted by an external process. If it sees the file get created externally, merge
838         those data into the in-memory store.
839
840         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp:
841         (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk): Added.
842         (WebKit::ResourceLoadStatisticsPersistentStorage::monitorDirectoryForNewStatistics):
843         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h:
844
845 2017-07-14  Matt Lewis  <jlewis3@apple.com>
846
847         Unreviewed, rolling out r219516.
848
849         This caused an API failure on macOS.
850
851         Reverted changeset:
852
853         "Make sure all CFHTTPCookieStorageRefs we create are
854         scheduled."
855         https://bugs.webkit.org/show_bug.cgi?id=174513
856         http://trac.webkit.org/changeset/219516
857
858 2017-07-14  Daniel Bates  <dabates@apple.com>
859
860         REGRESSION (r219013): Compute source frame info for frameless document
861         https://bugs.webkit.org/show_bug.cgi?id=174385
862         <rdar://problem/33217736>
863
864         Reviewed by Brady Eidson.
865
866         Fixes an issue where we would crash in WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction()
867         when computing the frame info for a now-frameless document. One way this can happen is when the frame
868         that contains the document that initiated the navigation is removed from the page.
869
870         * UIProcess/WebPageProxy.cpp:
871         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Check that we have a valid page ID before
872         looking up the WebPage object corresponding to it.
873         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
874         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Compute a FrameInfoData
875         object from the source document directly as opposed to using WebFrame::info() as the latter requires
876         that we have a valid WebCore frame and the source document may not have a frame.
877
878 2017-07-14  Jer Noble  <jer.noble@apple.com>
879
880         Allow clients to override their own hardware media requirements where no fallback media exists.
881         https://bugs.webkit.org/show_bug.cgi?id=174426
882         <rdar://problem/32537704>
883
884         Reviewed by Eric Carlson.
885
886         Add a new WKWebViewConfiguration property, as well as a new WKPreferences function, both to control
887         WebCore's new allowMediaContentTypesRequiringHardwareSupportAsFallback setting.
888
889         * Shared/WebPreferencesDefinitions.h:
890         * UIProcess/API/C/WKPreferences.cpp:
891         (WKPreferencesGetAllowMediaContentTypesRequiringHardwareSupportAsFallback):
892         (WKPreferencesSetAllowMediaContentTypesRequiringHardwareSupportAsFallback):
893         * UIProcess/API/C/WKPreferencesRef.h:
894         * UIProcess/API/Cocoa/WKWebView.mm:
895         (-[WKWebView _initializeWithConfiguration:]):
896         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
897         (-[WKWebViewConfiguration init]):
898         (-[WKWebViewConfiguration copyWithZone:]):
899         (-[WKWebViewConfiguration _setAllowMediaContentTypesRequiringHardwareSupportAsFallback:]):
900         (-[WKWebViewConfiguration _allowMediaContentTypesRequiringHardwareSupportAsFallback]):
901         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
902         * WebProcess/WebPage/WebPage.cpp:
903         (WebKit::WebPage::updatePreferences):
904
905 2017-07-14  Chris Dumez  <cdumez@apple.com>
906
907         Possible crash under NetworkSocketStream::didFailSocketStream()
908         https://bugs.webkit.org/show_bug.cgi?id=174526
909         <rdar://problem/32831441>
910
911         Reviewed by Brent Fulgham.
912
913         For robustness, initialize the SocketStreamHandleImpl after the other
914         data members. We are passing |this| to the SocketStreamHandleImpl when
915         constructing it so it is unsafe to have uninitialized data members
916         at this point.
917
918         * NetworkProcess/NetworkSocketStream.cpp:
919         (WebKit::NetworkSocketStream::NetworkSocketStream):
920         * NetworkProcess/NetworkSocketStream.h:
921
922 2017-07-14  Michael Catanzaro  <mcatanzaro@igalia.com>
923
924         [CMake] Unclear distinction between WebKitHelpers and WebKitMacros
925         https://bugs.webkit.org/show_bug.cgi?id=153189
926
927         Reviewed by Antonio Gomes.
928
929         New location for macros that are exclusively needed here.
930
931         * CMakeLists.txt:
932
933 2017-07-14  Brady Eidson  <beidson@apple.com>
934
935         Make sure all CFHTTPCookieStorageRefs we create are scheduled.
936         <rdar://problem/33221110> and https://bugs.webkit.org/show_bug.cgi?id=174513
937
938         Reviewed by Tim Horton.
939
940         Whenever we create a CFHTTPCookieStorage from identifying data it is unscheduled.
941         We need to schedule it on a RunLoop.
942         
943         This patch also cleans up the creation of the identifying data itself.
944         
945         * NetworkProcess/mac/RemoteNetworkingContext.mm:
946         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
947         
948         * Shared/cf/CookieStorageUtilsCF.cpp: Added.
949         (WebKit::cookieStorageFromIdentifyingData):
950         (WebKit::identifyingDataFromCookieStorage):
951         * Shared/cf/CookieStorageUtilsCF.h: Added.
952         
953         * Shared/mac/ChildProcessMac.mm:
954         (WebKit::ChildProcess::setSharedHTTPCookieStorage):
955         
956         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
957         (WebKit::WebProcessPool::platformInitializeWebProcess):
958         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
959         
960         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
961         (WebKit::WebsiteDataStore::parameters):
962         
963         * WebKit.xcodeproj/project.pbxproj:
964         
965         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
966         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
967
968 2017-07-14  Chris Dumez  <cdumez@apple.com>
969
970         Potential null-dereference under NetworkRTCProvider::resolvedName()
971         https://bugs.webkit.org/show_bug.cgi?id=174507
972         <rdar://problem/32597868>
973
974         Reviewed by Youenn Fablet.
975
976         NetworkRTCProvider::resolvedName() could do a null dereference of m_connection
977         because m_connection is nullified in NetworkRTCProvider::close() but resolvers
978         were only closed later on in the NetworkRTCProvider destructor.
979
980         To address the issue, we now stop DNS resolvers earlier, in NetworkRTCProvider::close().
981         Also fix unsafe modification of m_resolvers HashMap when iterating over it.
982
983         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
984         (WebKit::NetworkRTCProvider::~NetworkRTCProvider):
985         (WebKit::NetworkRTCProvider::close):
986         (WebKit::NetworkRTCProvider::Resolver::~Resolver):
987         (WebKit::NetworkRTCProvider::stopResolver):
988
989 2017-07-14  Youenn Fablet  <youenn@apple.com>
990
991         Report CoreAudioCaptureSource failure in case shared unit stops working properly
992         https://bugs.webkit.org/show_bug.cgi?id=174494
993
994         Reviewed by Eric Carlson.
995
996         In case of capture failure, send a CaptureFailure message so that the
997         correct behavior happens in the Web process.
998
999         * UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:
1000         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1001         (WebKit::UserMediaCaptureManager::captureFailed):
1002         * WebProcess/cocoa/UserMediaCaptureManager.h:
1003         * WebProcess/cocoa/UserMediaCaptureManager.messages.in:
1004
1005 2017-07-13  Chris Dumez  <cdumez@apple.com>
1006
1007         Better deal with changes to the ResourceLoadStatisticsStore file on disk
1008         https://bugs.webkit.org/show_bug.cgi?id=174487
1009
1010         Reviewed by Brent Fulgham.
1011
1012         Rename WebResourceLoadStatisticsStore's resetDataFromDecoder() to mergeWithDataFromDecoder()
1013         and update it so that it actual merges the data from the disk with the one we have in memory,
1014         instead of replacing it. This avoid data loss.
1015
1016         We leverage the existing WebResourceLoadStatisticsStore::mergeStatistics() to merge the
1017         statistics.
1018
1019         To faciliate merging the operating dates, they are now represented as OperatingDate objects
1020         instead of WallTime objects. OperatingDate only include date precision, no time information.
1021         As a result, the merge 2 vectors of OperatingDate objects, we can:
1022         1. Merge the 2 sorted vectors (using std::merge())
1023         2. Get rid of duplicates (easy because of date-level precision)
1024         3. Drop old dates until the vector has at most 30 items.
1025
1026         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp:
1027         (WebKit::ResourceLoadStatisticsPersistentStorage::refreshMemoryStoreFromDisk):
1028         (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
1029         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1030         (WebKit::OperatingDate::fromWallTime):
1031         (WebKit::OperatingDate::today):
1032         (WebKit::OperatingDate::secondsSinceEpoch):
1033         (WebKit::OperatingDate::operator==):
1034         (WebKit::OperatingDate::operator<):
1035         (WebKit::OperatingDate::operator<=):
1036         (WebKit::OperatingDate::OperatingDate):
1037         (WebKit::mergeOperatingDates):
1038         (WebKit::WebResourceLoadStatisticsStore::createEncoderFromData):
1039         (WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
1040         (WebKit::WebResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary):
1041         (WebKit::WebResourceLoadStatisticsStore::hasStatisticsExpired):
1042         * UIProcess/WebResourceLoadStatisticsStore.h:
1043
1044 2017-07-13  Dan Bernstein  <mitz@apple.com>
1045
1046         Removed empty project directories left behind after the rename
1047
1048         * WebKit2.xcodeproj: Removed.
1049
1050 2017-07-13  Matthew Hanson  <matthew_hanson@apple.com>
1051
1052         Fix the cMake builds (GTK and WPE.)
1053         https://bugs.webkit.org/show_bug.cgi?id=174164
1054         rdar://problem/33137595
1055
1056         Reviewed by Dan Bernstein.
1057
1058         * Scripts/generate-forwarding-headers.pl:
1059         (collectFrameworkHeaderPaths):
1060         (createForwardingHeadersForFramework):
1061
1062 2017-07-13  Matthew Hanson  <matthew_hanson@apple.com>
1063
1064         Rename WebKit2.xcodeproj to WebKit.xcodeproj.
1065         https://bugs.webkit.org/show_bug.cgi?id=174164
1066         rdar://problem/33137595
1067
1068         Reviewed by Dan Bernstein.
1069
1070         * WebKit.xcodeproj/project.pbxproj: Renamed from Source/WebKit/WebKit2.xcodeproj/project.pbxproj.
1071
1072 2017-07-13  Matthew Hanson  <matthew_hanson@apple.com>
1073
1074         Update tools and configurations after renaming Source/WebKit2 to Source/WebKit.
1075         https://bugs.webkit.org/show_bug.cgi?id=174164
1076         rdar://problem/33137595
1077
1078         Reviewed by Dan Bernstein.
1079
1080         * PlatformGTK.cmake:
1081         * Shared/API/c/wpe/WebKit.h:
1082
1083 2017-07-13  Michael Catanzaro  <mcatanzaro@igalia.com>
1084
1085         Fix compiler warnings when building with GCC 7
1086         https://bugs.webkit.org/show_bug.cgi?id=174463
1087
1088         Reviewed by Darin Adler.
1089
1090         * Platform/IPC/unix/ConnectionUnix.cpp:
1091         (IPC::Connection::sendOutputMessage):
1092
1093 2017-07-13  Chris Dumez  <cdumez@apple.com>
1094
1095         Moved filesystem code out of WebResourceLoadStatisticsStore class
1096         https://bugs.webkit.org/show_bug.cgi?id=174435
1097
1098         Reviewed by Brent Fulgham.
1099
1100         Moved filesystem code out of WebResourceLoadStatisticsStore class and into
1101         a new ResourceLoadStatisticsPersistentStorage class to decrease complexity.
1102
1103         * CMakeLists.txt:
1104         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
1105         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp: Added.
1106         (WebKit::hasFileChangedSince):
1107         (WebKit::createDecoderForFile):
1108         (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
1109         (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage):
1110         (WebKit::ResourceLoadStatisticsPersistentStorage::storageDirectoryPath):
1111         (WebKit::ResourceLoadStatisticsPersistentStorage::resourceLogFilePath):
1112         (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk):
1113         (WebKit::ResourceLoadStatisticsPersistentStorage::stopMonitoringDisk):
1114         (WebKit::ResourceLoadStatisticsPersistentStorage::refreshMemoryStoreFromDisk):
1115         (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
1116         (WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk):
1117         (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
1118         (WebKit::ResourceLoadStatisticsPersistentStorage::clear):
1119         (WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously):
1120         (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup):
1121         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h: Added.
1122         * UIProcess/Storage/ios/ResourceLoadStatisticsPersistentStorageIOS.mm: Added.
1123         (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup):
1124         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1125         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1126         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
1127         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
1128         (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
1129         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
1130         (WebKit::WebResourceLoadStatisticsStore::resetDataFromDecoder):
1131         * UIProcess/WebResourceLoadStatisticsStore.h:
1132         * WebKit2.xcodeproj/project.pbxproj:
1133
1134 2017-07-13  Chris Dumez  <cdumez@apple.com>
1135
1136         Unreviewed, rolling out r219453.
1137
1138         Seems to cause some crashes on the bots
1139
1140         Reverted changeset:
1141
1142         "Moved filesystem code out of WebResourceLoadStatisticsStore
1143         class"
1144         https://bugs.webkit.org/show_bug.cgi?id=174435
1145         http://trac.webkit.org/changeset/219453
1146
1147 2017-07-13  Jeremy Jones  <jeremyj@apple.com>
1148
1149         Fix style. Use #pragma once in VideoFullscreen and PlaybackSession headers.
1150         https://bugs.webkit.org/show_bug.cgi?id=174448
1151
1152         Reviewed by Eric Carlson.
1153
1154         No behavior change.
1155
1156         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
1157         * WebProcess/cocoa/WebVideoFullscreenManager.h:
1158
1159 2017-07-13  Jeremy Jones  <jeremyj@apple.com>
1160
1161         Style fix. Replace strongThis with protectedThis.
1162         https://bugs.webkit.org/show_bug.cgi?id=174444
1163
1164         Reviewed by Eric Carlson.
1165
1166         Rename, no behavior change.
1167
1168         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
1169         (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
1170         (WebKit::WebVideoFullscreenManager::didEnterFullscreen):
1171         (WebKit::WebVideoFullscreenManager::didExitFullscreen):
1172         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen):
1173
1174 2017-07-13  Chris Dumez  <cdumez@apple.com>
1175
1176         Moved filesystem code out of WebResourceLoadStatisticsStore class
1177         https://bugs.webkit.org/show_bug.cgi?id=174435
1178
1179         Reviewed by Brent Fulgham.
1180
1181         Moved filesystem code out of WebResourceLoadStatisticsStore class and into
1182         a new ResourceLoadStatisticsPersistentStorage class to decrease complexity.
1183
1184         * CMakeLists.txt:
1185         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
1186         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp: Added.
1187         (WebKit::hasFileChangedSince):
1188         (WebKit::createDecoderForFile):
1189         (WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
1190         (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage):
1191         (WebKit::ResourceLoadStatisticsPersistentStorage::storageDirectoryPath):
1192         (WebKit::ResourceLoadStatisticsPersistentStorage::resourceLogFilePath):
1193         (WebKit::ResourceLoadStatisticsPersistentStorage::startMonitoringDisk):
1194         (WebKit::ResourceLoadStatisticsPersistentStorage::stopMonitoringDisk):
1195         (WebKit::ResourceLoadStatisticsPersistentStorage::refreshMemoryStoreFromDisk):
1196         (WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
1197         (WebKit::ResourceLoadStatisticsPersistentStorage::writeMemoryStoreToDisk):
1198         (WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
1199         (WebKit::ResourceLoadStatisticsPersistentStorage::clear):
1200         (WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously):
1201         (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup):
1202         * UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h: Added.
1203         * UIProcess/Storage/ios/ResourceLoadStatisticsPersistentStorageIOS.mm: Added.
1204         (WebKit::ResourceLoadStatisticsPersistentStorage::excludeFromBackup):
1205         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1206         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1207         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
1208         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
1209         (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
1210         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
1211         (WebKit::WebResourceLoadStatisticsStore::resetDataFromDecoder):
1212         * UIProcess/WebResourceLoadStatisticsStore.h:
1213         * WebKit2.xcodeproj/project.pbxproj:
1214
1215 2017-07-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1216
1217         Web Automation: evaluateJavaScriptFunction should start the callback timeout after the function is applied
1218         https://bugs.webkit.org/show_bug.cgi?id=174421
1219
1220         Reviewed by Brian Burg.
1221
1222         This is causing selenium test testShouldNotTimeoutIfScriptCallsbackInsideAZeroTimeout to fail, because
1223         JavaScriptTimeout error is generated unexpectedly. When no script timeout is specified, 0 is used by default,
1224         which means we do a setTimeout with 0 and then the script does another setTimeout with 0, but ours is dispatched
1225         before and reportTimeoutError is called. We should start our timeout after applying the function, and only if
1226         the result hasn't been reported yet.
1227
1228         * WebProcess/Automation/WebAutomationSessionProxy.js:
1229         (let.AutomationSessionProxy.prototype.evaluateJavaScriptFunction):
1230
1231 2017-07-12  Wenson Hsieh  <wenson_hsieh@apple.com>
1232
1233         [iOS DnD] [WK2] Add SPI to enable, disable, or follow default behavior for DnD on a WKWebView
1234         https://bugs.webkit.org/show_bug.cgi?id=174440
1235         <rdar://problem/33272627>
1236
1237         Reviewed by Beth Dakin.
1238
1239         Adds a new _dragInteractionPolicy property to WKWebView, which an internal client may use to always allow
1240         dragging out of the web view (_WKDragInteractionPolicyAlwaysEnable), never allow
1241         (_WKDragInteractionPolicyAlwaysDisable) or just use the default device-dependent behavior
1242         (_WKDragInteractionPolicyDefault).
1243
1244         Also removes an extraneous class from WKContentViewInteraction.mm that is no longer used anywhere.
1245
1246         * UIProcess/API/Cocoa/WKWebView.mm:
1247         (-[WKWebView _initializeWithConfiguration:]):
1248
1249         Set _dragInteractionPolicy to _WKDragInteractionPolicyDefault upon initialization.
1250
1251         (-[WKWebView _dragInteractionPolicy]):
1252         (-[WKWebView _setDragInteractionPolicy:]):
1253         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1254         * UIProcess/ios/WKContentViewInteraction.h:
1255         * UIProcess/ios/WKContentViewInteraction.mm:
1256         (shouldEnableDragInteractionForPolicy):
1257         (-[WKContentView _didChangeDragInteractionPolicy]):
1258
1259         Called by the WKWebView when its _dragInteractionPolicy changes. The content view updates its
1260         UIDragInteraction's -enabled property here in response.
1261
1262         (-[WKContentView setupDataInteractionDelegates]):
1263
1264 2017-07-12  Said Abou-Hallawa  <sabouhallawa@apple.com>
1265
1266         Async image decoding for large images should be disabled by default
1267         https://bugs.webkit.org/show_bug.cgi?id=174432
1268
1269         Reviewed by Simon Fraser.
1270
1271         -- Replace every reference to GraphicsLayerPaintFlags::Snapshotting by
1272            GraphicsLayerPaintFlags::None and every GraphicsLayerPaintFlags::None
1273            by AllowAsyncImageDecoding.
1274         -- Replace setting the bit PaintBehaviorSnapshotting in an existing PaintBehavoir 
1275            by resetting the bit PaintBehaviorAllowAsyncImageDecoding.
1276
1277         * Shared/mac/RemoteLayerBackingStore.mm:
1278         (WebKit::RemoteLayerBackingStore::drawInContext):
1279         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
1280         (WebKit::imageForRect):
1281         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
1282         (WebKit::InjectedBundleRangeHandle::renderedImage):
1283
1284 2017-07-12  Eric Carlson  <eric.carlson@apple.com>
1285
1286         [MediaStream] a capture source failure should end the MediaStreamTrack
1287         https://bugs.webkit.org/show_bug.cgi?id=174375
1288
1289         Reviewed by Youenn Fablet.
1290
1291         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1292         (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged): Consolidate start/end.
1293         (WebKit::UserMediaPermissionRequestManagerProxy::startedCaptureSession): Deleted.
1294         (WebKit::UserMediaPermissionRequestManagerProxy::endedCaptureSession): Deleted.
1295         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1296
1297         * UIProcess/WebPageProxy.cpp:
1298         (WebKit::WebPageProxy::isPlayingMediaDidChange): Call captureStateChanged if the capture 
1299         state changes. Consider interrupted flags.
1300
1301 2017-07-12  Daniel Bates  <dabates@apple.com>
1302
1303         NavigationAction should track whether the navigation was initiated by the main frame
1304         https://bugs.webkit.org/show_bug.cgi?id=174386
1305         <rdar://problem/33245267>
1306
1307         Reviewed by Brady Eidson.
1308
1309         * WebProcess/WebPage/WebInspector.cpp:
1310         (WebKit::WebInspector::openInNewTab): Pass whether the load was initiated by the main frame
1311         when instantiating the NavigationAction.
1312
1313 2017-07-12  Daniel Bates  <dabates@apple.com>
1314
1315         Rename NavigationInitiatedByMainFrame to InitiatedByMainFrame
1316         https://bugs.webkit.org/show_bug.cgi?id=174427
1317
1318         Rubber-stamped by Brady Eidson.
1319
1320         * WebProcess/Plugins/PluginView.cpp:
1321         (WebKit::PluginView::loadURL):
1322         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1323         (WebKit::WebFrameLoaderClient::dispatchCreatePage):
1324         * WebProcess/WebPage/WebInspector.cpp:
1325         (WebKit::WebInspector::openInNewTab):
1326
1327 2017-07-12  Matt Lewis  <jlewis3@apple.com>
1328
1329         Unreviewed, rolling out r219401.
1330
1331         This revision rolled out the previous patch, but after talking
1332         with reviewer, a rebaseline is what was needed.Rolling back in
1333         before rebaseline.
1334
1335         Reverted changeset:
1336
1337         "Unreviewed, rolling out r219379."
1338         https://bugs.webkit.org/show_bug.cgi?id=174400
1339         http://trac.webkit.org/changeset/219401
1340
1341 2017-07-12  Daniel Bates  <dabates@apple.com>
1342
1343         Update description of Secure Contexts experimental flag
1344         https://bugs.webkit.org/show_bug.cgi?id=174401
1345
1346         Reviewed by Simon Fraser.
1347
1348         Change the description of the Secure Contexts experimental flag from "isSecureContext attribute"
1349         to "Secure Contexts API".
1350
1351         * Shared/WebPreferencesDefinitions.h:
1352
1353 2017-07-12  Matt Lewis  <jlewis3@apple.com>
1354
1355         Unreviewed, rolling out r219379.
1356
1357         This revision caused a consistent failure in the test
1358         fast/dom/Window/property-access-on-cached-window-after-frame-
1359         removed.html.
1360
1361         Reverted changeset:
1362
1363         "Remove NAVIGATOR_HWCONCURRENCY"
1364         https://bugs.webkit.org/show_bug.cgi?id=174400
1365         http://trac.webkit.org/changeset/219379
1366
1367 2017-07-12  Zan Dobersek  <zdobersek@igalia.com>
1368
1369         [WPE] Use libepoxy
1370         https://bugs.webkit.org/show_bug.cgi?id=172104
1371
1372         Reviewed by Michael Catanzaro.
1373
1374         * PlatformWPE.cmake: Drop the EGL_INCLUDE_DIRS compilation flags.
1375         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1376         Include <epoxy/gl.h> when compiling with libepoxy usage enabled.
1377
1378 2017-07-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1379
1380         Web Automation: upstream safaridriver's JavaScript atom implementations
1381         https://bugs.webkit.org/show_bug.cgi?id=172060
1382         <rdar://problem/32168187>
1383
1384         Reviewed by Brian Burg.
1385
1386         * UIProcess/Automation/atoms/ElementAttribute.js: Added.
1387         * UIProcess/Automation/atoms/ElementDisplayed.js: Added.
1388         * UIProcess/Automation/atoms/FindNodes.js: Added.
1389         * UIProcess/Automation/atoms/FormElementClear.js: Added.
1390         * UIProcess/Automation/atoms/FormSubmit.js: Added.
1391
1392 2017-07-11  Dean Jackson  <dino@apple.com>
1393
1394         Remove NAVIGATOR_HWCONCURRENCY
1395         https://bugs.webkit.org/show_bug.cgi?id=174400
1396
1397         Reviewed by Sam Weinig.
1398
1399         * Configurations/FeatureDefines.xcconfig:
1400
1401 2017-07-11  Ansh Shukla  <ansh_shukla@apple.com>
1402
1403         WKWindowFeatures needs to expose scrollbar, fullscreen, and dialog configuration properties
1404         https://bugs.webkit.org/show_bug.cgi?id=174239
1405
1406         Reviewed by Brady Eidson.
1407
1408         Add a new private header to expose getters for window feature properties already available
1409         in the TFB APIWindowFeatures class. These properties are necessary for Safari to adopt more
1410         modern API.
1411
1412         * UIProcess/API/Cocoa/WKWindowFeatures.mm:
1413         (-[WKWindowFeatures _locationBarVisibility]):
1414         (-[WKWindowFeatures _scrollbarsVisibility]):
1415         (-[WKWindowFeatures _fullscreenDisplay]):
1416         (-[WKWindowFeatures _dialogDisplay]):
1417         * UIProcess/API/Cocoa/WKWindowFeaturesInternal.h: Expose some window features as read-only
1418         properties.
1419         * UIProcess/API/Cocoa/WKWindowFeaturesPrivate.h:
1420         * WebKit2.xcodeproj/project.pbxproj:
1421
1422 2017-07-11  Chris Dumez  <cdumez@apple.com>
1423
1424         Avoid duplicating default parameter values in [WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]
1425         https://bugs.webkit.org/show_bug.cgi?id=174402
1426
1427         Reviewed by Brent Fulgham.
1428
1429         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1430         (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]):
1431         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1432         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1433         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
1434         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
1435         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
1436         (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
1437         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
1438         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
1439         (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
1440         (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime):
1441         (WebKit::WebResourceLoadStatisticsStore::shouldRemoveDataRecords):
1442         (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies):
1443         (WebKit::WebResourceLoadStatisticsStore::hasStatisticsExpired):
1444         (WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries):
1445         (WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo):
1446         (WebKit::WebResourceLoadStatisticsStore::pruneStatisticsIfNeeded):
1447         (WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
1448         * UIProcess/WebResourceLoadStatisticsStore.h:
1449
1450 2017-07-11  Dean Jackson  <dino@apple.com>
1451
1452         Rolling out r219372.
1453
1454         * Configurations/FeatureDefines.xcconfig:
1455
1456 2017-07-11  Dean Jackson  <dino@apple.com>
1457
1458         Remove NAVIGATOR_HWCONCURRENCY
1459         https://bugs.webkit.org/show_bug.cgi?id=174400
1460
1461         Reviewed by Sam Weinig.
1462
1463         * Configurations/FeatureDefines.xcconfig:
1464
1465 2017-07-11  Dean Jackson  <dino@apple.com>
1466
1467         Viewport fit experimental feature should be always on by default
1468         https://bugs.webkit.org/show_bug.cgi?id=174398
1469         <rdar://problem/33248920>
1470
1471         Reviewed by Simon Fraser.
1472
1473         Even though this is experimental, it should be enabled by default, and
1474         not follow the value of DEFAULT_EXPERIMENTAL_FEATURES_ENABLED.
1475
1476         * Shared/WebPreferencesDefinitions.h:
1477
1478 2017-07-11  Adrian Perez de Castro  <aperez@igalia.com>
1479
1480         Fix typo: ContentRuleListStore::nonLegacyDdefaultStore()
1481         https://bugs.webkit.org/show_bug.cgi?id=174387
1482
1483         Reviewed by Michael Catanzaro.
1484
1485         Rename nonLegacyDdefaultStore() to nonLegacyDefaultStore().
1486
1487         * UIProcess/API/APIContentRuleListStore.cpp:
1488         (API::ContentRuleListStore::nonLegacyDefaultStore):
1489         (API::ContentRuleListStore::defaultStore):
1490         * UIProcess/API/APIContentRuleListStore.h:
1491
1492 2017-07-11  Chris Dumez  <cdumez@apple.com>
1493
1494         Simplify primary domain lambda captures in WebResourceLoadStatisticsStore
1495         https://bugs.webkit.org/show_bug.cgi?id=174381
1496
1497         Reviewed by Brent Fulgham.
1498
1499         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1500         (WebKit::isolatedPrimaryDomain):
1501         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
1502         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
1503         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
1504         (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
1505         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
1506         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
1507         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
1508         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
1509         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
1510         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
1511         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
1512         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
1513         (WebKit::primaryDomain): Deleted.
1514
1515 2017-07-11  Timothy Hatcher  <timothy@hatcher.name>
1516
1517         Fix a build failure in WebDragClient when !PLATFORM(COCOA) && !PLATFORM(GTK).
1518         https://bugs.webkit.org/show_bug.cgi?id=174372
1519
1520         Reviewed by Beth Dakin.
1521
1522         * WebProcess/WebCoreSupport/WebDragClient.cpp:
1523         (WebKit::WebDragClient::didConcludeEditDrag): Added empty method.
1524
1525 2017-07-11  Brent Fulgham  <bfulgham@apple.com>
1526
1527         Reset cookie partitioning state after network process crashes
1528         https://bugs.webkit.org/show_bug.cgi?id=174306
1529         <rdar://problem/33171605>
1530
1531         Reviewed by Chris Dumez.
1532
1533         * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
1534         (WebKit::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler): Move cookie
1535         partioning state code to helper function.
1536         (WebKit::ResourceLoadStatisticsStore::resetPartitionCookiesState): Added.
1537         * UIProcess/Storage/ResourceLoadStatisticsStore.h:
1538         * UIProcess/WebProcessPool.cpp:
1539         (WebKit::WebProcessPool::ensureNetworkProcess): Inform the statistics store that
1540         the network process crashed.
1541         (WebKit::WebProcessPool::terminateNetworkProcess): Mark network process as crashed.
1542         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1543         (WebKit::WebResourceLoadStatisticsStore::networkProcessDidCrash): Reset the cookie
1544         partitioning state after a crash.
1545         * UIProcess/WebResourceLoadStatisticsStore.h:
1546         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1547         (WebKit::WebsiteDataStore::notifyResourceLoadStatisticsNetworkProcessDidCrash): Relay
1548         information to the statistics store.
1549         * UIProcess/WebsiteData/WebsiteDataStore.h:
1550
1551 2017-07-11  Timothy Hatcher  <timothy@hatcher.name>
1552
1553         Fix broken build when !ENABLE(INDEXED_DATABASE)
1554         https://bugs.webkit.org/show_bug.cgi?id=174370
1555
1556         Reviewed by Alex Christensen.
1557
1558         * UIProcess/WebProcessPool.cpp:
1559         (WebKit::WebProcessPool::pageAddedToProcess):
1560
1561 2017-07-11  Youenn Fablet  <youenn@apple.com>
1562
1563         Changing the web page muted state for playing audio should not disable other tabs capture
1564         https://bugs.webkit.org/show_bug.cgi?id=174349
1565
1566         Unreviewed.
1567
1568         * UIProcess/WebPageProxy.cpp:
1569         (WebKit::WebPageProxy::activateMediaStreamCaptureInPage): Fixes non MEDIA_STREAM builds.
1570
1571 2017-07-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1572
1573         Address post-review feedback after http://trac.webkit.org/r219310
1574         https://bugs.webkit.org/show_bug.cgi?id=174300
1575         <rdar://problem/33030639>
1576
1577         Reviewed by Simon Fraser.
1578
1579         Removes plumbing introduced in r219310 for telling WKContentView when the user has finished panning or zooming.
1580         This was previously used to reset allowing asynchronous touch event after preventing the web touch events
1581         gesture recognizer from firing.
1582
1583         However, a far simpler (and much less fragile) solution is to just set _canSendTouchEventsAsynchronously to NO
1584         at the beginning of the gesture, before the first `touchstart` event is dispatched. This way, we always ensure
1585         that _canSendTouchEventsAsynchronously is NO when beginning to process a touch event. This approach is correct
1586         because the only place where we query _canSendTouchEventsAsynchronously is in -_webTouchEventsRecognized:, where
1587         (when we are beginning a new gesture) we are guaranteed that -gestureRecognizer:shouldIgnoreWebTouchWithEvent:
1588         has already been called and _canSendTouchEventsAsynchronously is NO.
1589
1590         Confirmed that the LayoutTests added in r219310 still pass.
1591
1592         * UIProcess/API/Cocoa/WKWebView.mm:
1593         (-[WKWebView scrollViewDidEndDragging:willDecelerate:]):
1594         (-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
1595         * UIProcess/PageClient.h:
1596         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
1597         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
1598         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidEndPanGesture): Deleted.
1599         * UIProcess/Scrolling/RemoteScrollingTree.h:
1600         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
1601         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1602         (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]):
1603         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewDidEndPanGesture): Deleted.
1604         * UIProcess/WebPageProxy.h:
1605         * UIProcess/ios/PageClientImplIOS.h:
1606         * UIProcess/ios/PageClientImplIOS.mm:
1607         (WebKit::PageClientImpl::overflowScrollViewDidEndPanGesture): Deleted.
1608         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1609         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidEndPanGesture): Deleted.
1610         * UIProcess/ios/WKContentViewInteraction.h:
1611         * UIProcess/ios/WKContentViewInteraction.mm:
1612         (-[WKContentView gestureRecognizer:shouldIgnoreWebTouchWithEvent:]):
1613         (-[WKContentView scrollViewDidEndPanOrPinchGesture]): Deleted.
1614         * UIProcess/ios/WebPageProxyIOS.mm:
1615         (WebKit::WebPageProxy::overflowScrollViewDidEndPanGesture): Deleted.
1616
1617 2017-07-11  Brent Fulgham  <bfulgham@apple.com>
1618
1619         Unreviewed clean-up after r219323
1620
1621         Simplify algorithm slightly based on a suggestion Chris Dumez made in the review.
1622
1623         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1624         (WebKit::pruneResources): Don't create a second variable to track the pruning operation.
1625
1626 2017-07-11  Alex Christensen  <achristensen@webkit.org>
1627
1628         SharedBuffer::size should return a size_t
1629         https://bugs.webkit.org/show_bug.cgi?id=174328
1630
1631         Reviewed by Andreas Kling.
1632
1633         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1634         (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
1635
1636 2017-07-11  Youenn Fablet  <youenn@apple.com>
1637
1638         We should do ICE candidate filtering at the Document level
1639         https://bugs.webkit.org/show_bug.cgi?id=173861
1640         <rdar://problem/33122058>
1641
1642         Reviewed by Eric Carlson.
1643
1644         Removing ICE candidate filtering handling at UIProcess level.
1645         ICE candidate filtering is now disabled at UserMediaRequest level.
1646         WebPage forwards the ICE candidate filtering option to the page so as to set
1647         the default option correctly for every document of the page.
1648
1649         * UIProcess/UserMediaProcessManager.cpp:
1650         (WebKit::UserMediaProcessManager::willCreateMediaStream):
1651         (WebKit::UserMediaProcessManager::endedCaptureSession):
1652         * WebProcess/WebPage/WebPage.cpp:
1653         (WebKit::WebPage::disableICECandidateFiltering):
1654         (WebKit::WebPage::enableICECandidateFiltering):
1655
1656 2017-07-11  Youenn Fablet  <youenn@apple.com>
1657
1658         Changing the web page muted state for playing audio should not disable other tabs capture
1659         https://bugs.webkit.org/show_bug.cgi?id=174349
1660         rdar://problem/33223988
1661
1662         Reviewed by Eric Carlson.
1663
1664         Make sure to mute capturing streams of any other tab if the current tab will start capturing or will unmute existing capturing streams.
1665         Manually tested by having a tab doing capture and another tab playing a video.
1666         Muting or unmuting the tab playing video should not change the capture tab.
1667
1668         * UIProcess/WebPageProxy.cpp:
1669         (WebKit::WebPageProxy::activateMediaStreamCaptureInPage):
1670         (WebKit::WebPageProxy::setMuted):
1671         * UIProcess/WebPageProxy.h:
1672         (WebKit::WebPageProxy::activateMediaStreamCaptureInPage):
1673
1674 2017-07-11  Youenn Fablet  <youenn@apple.com>
1675
1676         NetworkProcess should close listening WebRTC sockets when being suspended
1677         https://bugs.webkit.org/show_bug.cgi?id=174270
1678         rdar://problem/33139844
1679
1680         Reviewed by Chris Dumez.
1681
1682         To prevent potential spinning of the NetworkProcess, NetworkProcess will now close listening sockets when being notified that it will be suspended.
1683         When the network process is being suspended, it will stop creating listening sockets, until it resumes.
1684         Future additional efforts might be to improve select/cancel so that we can stop listening sockets at resume time,
1685         or to reimplement part of the stack using CFStream.
1686
1687         Tested through manual testing by going to a website doing WebRTC, homing out so that the network process is suspended and reopening Safari.
1688
1689         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1690         (WebKit::NetworkConnectionToWebProcess::cleanupForSuspension):
1691         Proxying call to clean for suspension to rtc provider so that it will
1692         close listening sockets.
1693         (WebKit::NetworkConnectionToWebProcess::resumeFromSuspension): Authorizing back listening sockets.
1694         * NetworkProcess/NetworkConnectionToWebProcess.h:
1695         (WebKit::NetworkConnectionToWebProcess::cleanupForSuspension):
1696         Clean-up is done asynchronously as it can happen in background threads.
1697         Hence why passing a callback as parameter.
1698         * NetworkProcess/NetworkProcess.cpp:
1699         (WebKit::NetworkProcess::notifyProcessReadyToSuspend): Helper routine
1700         to notify UI process that network process clean up is done.
1701         (WebKit::TaskCounter::TaskCounter): Helper class to call notifyProcessReadyToSuspend when sded.
1702         (WebKit::TaskCounter::~TaskCounter):
1703         (WebKit::NetworkProcess::actualPrepareToSuspend): Doing the clean-up for each connection that needs it.
1704         Making sure to notify UI process of clean-up being completed once all connections are cleaned.
1705         (WebKit::NetworkProcess::processWillSuspendImminently):
1706         (WebKit::NetworkProcess::prepareToSuspend):
1707         (WebKit::NetworkProcess::processDidResume): Reenable listening sockets.
1708         * NetworkProcess/NetworkProcess.h:
1709         * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
1710         (WebKit::LibWebRTCSocketClient::LibWebRTCSocketClient):
1711         * NetworkProcess/webrtc/LibWebRTCSocketClient.h: Adding type getter and making close public.
1712         Used by NetworkRTCProvider to identifiy listening sockets and close them.
1713         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
1714         (WebKit::NetworkRTCProvider::closeListeningSockets): We close the webrtc socket
1715         and we also notify the Web Process that the socket is closed so that it can take actions to recreate some if needed.
1716         (WebKit::NetworkRTCProvider::finishClosingListeningSockets):
1717         * NetworkProcess/webrtc/NetworkRTCProvider.h:
1718         (WebKit::NetworkRTCProvider::authorizeListeningSockets): Authorize creation of listening sockets.
1719
1720 2017-07-10  Brent Fulgham  <bfulgham@apple.com>
1721
1722         Resource Load Statistics: Prune statistics in orders of importance
1723         https://bugs.webkit.org/show_bug.cgi?id=174215
1724         <rdar://problem/33164403>
1725
1726         Unreviewed test correction.
1727
1728         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1729         (WebKit::pruneResources): The revised algorithm did not update the remaining
1730         count to be pruned, causing a test failure.
1731
1732 2017-07-10  John Wilander  <wilander@apple.com>
1733
1734         Resource Load Statistics: Prune statistics in orders of importance
1735         https://bugs.webkit.org/show_bug.cgi?id=174215
1736         <rdar://problem/33164403>
1737
1738         Reviewed by Chris Dumez.
1739
1740         New functionality. Prunes statistics in this order:
1741         1. Non-prevalent resources without user interaction.
1742         2. Prevalent resources without user interaction.
1743         3. Non-prevalent resources with user interaction.
1744         4. Prevalent resources with user interaction.
1745
1746         * Shared/WebCoreArgumentCoders.cpp:
1747         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
1748         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
1749             Added timestamp field lastSeen.
1750         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1751         (-[WKWebsiteDataStore _resourceLoadStatisticsSetLastSeen:forHost:]):
1752         (-[WKWebsiteDataStore _resourceLoadStatisticsSetMaxStatisticsEntries:]):
1753         (-[WKWebsiteDataStore _resourceLoadStatisticsSetPruneEntriesDownTo:]):
1754         (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]):
1755             Test infrastructure.
1756         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1757         * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
1758         (WebKit::ResourceLoadStatisticsStore::setMaxStatisticsEntries):
1759             Test infrastructure.
1760         (WebKit::ResourceLoadStatisticsStore::setPruneEntriesDownTo):
1761             Test infrastructure.
1762         (WebKit::sortAndPrune):
1763             Convenience function.
1764         (WebKit::ResourceLoadStatisticsStore::pruneStatisticsIfNeeded):
1765             The new pruning function.
1766         * UIProcess/Storage/ResourceLoadStatisticsStore.h:
1767         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1768         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
1769             Now calls ResourceLoadStatisticsStore::pruneStatisticsIfNeeded().
1770         (WebKit::WebResourceLoadStatisticsStore::setLastSeen):
1771             Test infrastructure.
1772         (WebKit::WebResourceLoadStatisticsStore::setMaxStatisticsEntries):
1773             Test infrastructure.
1774         (WebKit::WebResourceLoadStatisticsStore::setPruneEntriesDownTo):
1775             Test infrastructure.
1776         * UIProcess/WebResourceLoadStatisticsStore.h:
1777
1778 2017-07-10  Dean Jackson  <dino@apple.com>
1779
1780         const() experimental feature should always be on by default
1781         https://bugs.webkit.org/show_bug.cgi?id=174341
1782         <rdar://problem/33228603>
1783
1784         Reviewed by Simon Fraser.
1785
1786         Even though this is experimental, it should be enabled by default, and
1787         not follow the value of DEFAULT_EXPERIMENTAL_FEATURES_ENABLED.
1788
1789         * Shared/WebPreferencesDefinitions.h:
1790
1791 2017-07-10  Chris Dumez  <cdumez@apple.com>
1792
1793         [iOS] _didCommitLayerTree should avoid calling [scrollView setZoomScale] unnecessarily
1794         https://bugs.webkit.org/show_bug.cgi?id=174326
1795         <rdar://problem/33150490>
1796
1797         Reviewed by Simon Fraser.
1798
1799         Only call [scrollView setZoomScale] if the new zoom scale is actually different to
1800         avoid doing unnecessary work in UIKit.
1801
1802         * UIProcess/API/Cocoa/WKWebView.mm:
1803         (-[WKWebView _didCommitLayerTree:]):
1804
1805 2017-07-10  Chris Dumez  <cdumez@apple.com>
1806
1807         Merge ResourceLoadStatisticsStore into WebResourceLoadStatisticsStore
1808         https://bugs.webkit.org/show_bug.cgi?id=174203
1809
1810         Reviewed by Brent Fulgham.
1811
1812         Merge ResourceLoadStatisticsStore into WebResourceLoadStatisticsStore. The 2 classes
1813         have a similar purpose and there is no clean separation between the 2. It makes more
1814         sense to have a single store class for resource load statistics.
1815
1816         If we want to simplify the WebResourceLoadStatisticsStore class, I think it'd make
1817         more sense to split the file system I/O code out. This code adds quite a bit of
1818         complexity.
1819
1820         * CMakeLists.txt:
1821         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1822         (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]):
1823         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
1824         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore]):
1825         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]):
1826         (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]):
1827         * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: Removed.
1828         * UIProcess/Storage/ResourceLoadStatisticsStore.h: Removed.
1829         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1830         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1831         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
1832         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
1833         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
1834         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
1835         (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
1836         (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk):
1837         (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk):
1838         (WebKit::WebResourceLoadStatisticsStore::startMonitoringStatisticsStorage):
1839         (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
1840         (WebKit::WebResourceLoadStatisticsStore::submitTelemetry):
1841         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
1842         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
1843         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
1844         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
1845         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
1846         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
1847         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
1848         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
1849         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
1850         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
1851         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
1852         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
1853         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
1854         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory):
1855         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
1856         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
1857         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
1858         (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime):
1859         (WebKit::WebResourceLoadStatisticsStore::ensureResourceStatisticsForPrimaryDomain):
1860         (WebKit::WebResourceLoadStatisticsStore::createEncoderFromData):
1861         (WebKit::WebResourceLoadStatisticsStore::populateFromDecoder):
1862         (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
1863         (WebKit::WebResourceLoadStatisticsStore::mergeStatistics):
1864         (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies):
1865         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
1866         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
1867         (WebKit::WebResourceLoadStatisticsStore::processStatistics):
1868         (WebKit::WebResourceLoadStatisticsStore::hasHadUnexpiredRecentUserInteraction):
1869         (WebKit::WebResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
1870         (WebKit::WebResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary):
1871         (WebKit::WebResourceLoadStatisticsStore::hasStatisticsExpired):
1872         * UIProcess/WebResourceLoadStatisticsStore.h:
1873         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
1874         (WebKit::sortedPrevalentResourceTelemetry):
1875         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
1876         * UIProcess/WebResourceLoadStatisticsTelemetry.h:
1877         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1878         (WebKit::WebsiteDataStore::removeData):
1879         * WebKit2.xcodeproj/project.pbxproj:
1880
1881 2017-07-10  Wenson Hsieh  <wenson_hsieh@apple.com>
1882
1883         [WK2] Ignore touch events that interrupt platform-driven momentum scrolling
1884         https://bugs.webkit.org/show_bug.cgi?id=174300
1885         <rdar://problem/33030639>
1886
1887         Reviewed by Simon Fraser.
1888
1889         Adds support for immediately failing WKContentView's UIWebTouchEventsGestureRecognizer if any touch interrupts
1890         scroll view deceleration. Covered by 3 new LayoutTests (see Source/WebCore/ChangeLog).
1891
1892         * Platform/spi/ios/UIKitSPI.h:
1893         * UIProcess/API/Cocoa/WKWebView.mm:
1894         (-[WKWebView scrollViewDidEndDragging:willDecelerate:]):
1895         (-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
1896         * UIProcess/PageClient.h:
1897         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
1898         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
1899         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidEndPanGesture):
1900         * UIProcess/Scrolling/RemoteScrollingTree.h:
1901         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
1902         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1903         (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]):
1904         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewDidEndPanGesture):
1905
1906         Adds plumbing in the UI process to alert the WKContentView when scroll view dragging has ended in an overflow
1907         momentum scrolling region (tracked by an overflow scrolling tree node). This parallels UI process plumbing for
1908         ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewWillStartPanGesture.
1909
1910         * UIProcess/WebPageProxy.h:
1911         * UIProcess/ios/PageClientImplIOS.h:
1912         * UIProcess/ios/PageClientImplIOS.mm:
1913         (WebKit::PageClientImpl::overflowScrollViewDidEndPanGesture):
1914         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1915         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidEndPanGesture):
1916         * UIProcess/ios/WKContentViewInteraction.h:
1917         * UIProcess/ios/WKContentViewInteraction.mm:
1918         (-[WKContentView scrollViewDidEndPanOrPinchGesture]):
1919
1920         When the dragging phase of a scroll gesture ends, ensure that _canSendTouchEventsAsynchronously is reset to NO.
1921         When touches are not being prevented, this flag is set to YES in -scrollViewWillStartPanOrPinchGesture: and
1922         normally reset to NO in -_webTouchEventsRecognized: after all touch points have been released. However, in the
1923         case where we've prematurely failed the web touch events gesture recognizer after -touchesBegan:,
1924         -_webTouchEventsRecognized: will not be called again in a state where all touches have been released. Thus, we
1925         also need to bookend the place where we begin allowing async touch event dispatch in
1926         -scrollViewWillStartPanOrPinchGesture by disallowing async touch event dispatch in
1927         -scrollViewDidEndPanOrPinchGesture.
1928
1929         This has no impact in the normal case where the user scrolls without momentum, since
1930         -scrollViewDidEndPanOrPinchGesture will fire after async touch events have already been disallowed in
1931         -_webTouchEventsRecognized:, and in the case where the page prevents default on touches, scrolling doesn't
1932         happen anyways, so neither scrollViewWillStartPanOrPinchGesture nor scrollViewDidEndPanOrPinchGesture will be
1933         invoked.
1934
1935         (-[WKContentView gestureRecognizer:shouldIgnoreWebTouchWithEvent:]):
1936
1937         Implements a new SPI hook in UIKit. This serves an identical purpose as -shouldIgnoreWebTouch, but additionally
1938         passes the triggering UIEvent, as well as the gesture recognizer itself (following standard convention for
1939         Objective C delegate methods). Here, we return YES in the case where one or more of the touches recognized by
1940         the gesture is currently interrupting scroll deceleration.
1941
1942         * UIProcess/ios/WebPageProxyIOS.mm:
1943         (WebKit::WebPageProxy::overflowScrollViewDidEndPanGesture):
1944
1945 2017-07-10  Brent Fulgham  <bfulgham@apple.com>
1946
1947         [WK2][macOS] Allow access to com.apple.cfnetwork.cfnetworkagent in the Network Process
1948         https://bugs.webkit.org/show_bug.cgi?id=174320
1949         <rdar://problem/33191856>
1950
1951         Reviewed by Geoffrey Garen.
1952
1953         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1954
1955 2017-07-10  Megan Gardner  <megan_gardner@apple.com>
1956
1957         Add location to NavigationActionData
1958         https://bugs.webkit.org/show_bug.cgi?id=174233
1959         <rdar://problem/29165518>
1960
1961         Reviewed by Simon Fraser.
1962         
1963         Add the root view location of a tap to a NavigationAction to vend to Safari.
1964
1965         * Shared/NavigationActionData.cpp:
1966         (WebKit::NavigationActionData::encode):
1967         (WebKit::NavigationActionData::decode):
1968         * Shared/NavigationActionData.h:
1969         * UIProcess/API/APINavigationAction.h:
1970         * UIProcess/API/Cocoa/WKNavigationAction.mm:
1971         (-[WKNavigationAction description]):
1972         (-[WKNavigationAction _clickLocationInRootViewCoordinates]):
1973         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
1974         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
1975         (WebKit::clickLocationInRootViewCoordinatesForMouseEvent):
1976         (WebKit::InjectedBundleNavigationAction::clickLocationInRootViewCoordinatesForNavigationAction):
1977         (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
1978         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
1979         (WebKit::InjectedBundleNavigationAction::clickLocationInRootViewCoordinates):
1980         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1981         (WebKit::WebChromeClient::createWindow):
1982         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1983         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
1984         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1985
1986 2017-07-03  Brian Burg  <bburg@apple.com>
1987
1988         Web Replay: remove some unused code
1989         https://bugs.webkit.org/show_bug.cgi?id=173903
1990
1991         Rubber-stamped by Joseph Pecoraro.
1992
1993         * Configurations/FeatureDefines.xcconfig:
1994         * WebProcess/WebPage/WebPage.cpp:
1995         (WebKit::WebPage::tryClose):
1996         (WebKit::WebPage::loadRequest):
1997         (WebKit::WebPage::stopLoadingFrame):
1998         (WebKit::WebPage::stopLoading):
1999         (WebKit::WebPage::reload):
2000         (WebKit::WebPage::contextMenuAtPointInWindow):
2001         (WebKit::handleContextMenuEvent):
2002         (WebKit::handleMouseEvent):
2003         (WebKit::handleWheelEvent):
2004         (WebKit::handleKeyEvent):
2005         (WebKit::WebPage::scroll):
2006         (WebKit::WebPage::logicalScroll):
2007
2008 2017-07-10  Chris Dumez  <cdumez@apple.com>
2009
2010         Further WebResourceLoadStatisticsStore / ResourceLoadStatisticsStore clean up
2011         https://bugs.webkit.org/show_bug.cgi?id=174301
2012
2013         Reviewed by Brent Fulgham.
2014
2015         General clean up and various simplifications / optimizations to WebResourceLoadStatisticsStore
2016         and ResourceLoadStatisticsStore classes.
2017
2018         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2019         (-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]):
2020         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
2021         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2022         * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
2023         (WebKit::ResourceLoadStatisticsStore::create):
2024         (WebKit::ResourceLoadStatisticsStore::ResourceLoadStatisticsStore):
2025         (WebKit::ResourceLoadStatisticsStore::hasHadRecentUserInteraction):
2026         (WebKit::ResourceLoadStatisticsStore::createEncoderFromData):
2027         (WebKit::ResourceLoadStatisticsStore::populateFromDecoder):
2028         (WebKit::ResourceLoadStatisticsStore::clearInMemory):
2029         (WebKit::ResourceLoadStatisticsStore::mergeStatistics):
2030         (WebKit::ResourceLoadStatisticsStore::updateCookiePartitioning):
2031         (WebKit::ResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
2032         (WebKit::ResourceLoadStatisticsStore::processStatistics):
2033         (WebKit::ResourceLoadStatisticsStore::hasHadUnexpiredRecentUserInteraction):
2034         (WebKit::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
2035         * UIProcess/Storage/ResourceLoadStatisticsStore.h:
2036         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2037         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2038         (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
2039         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
2040         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
2041         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
2042         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
2043         (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
2044         (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk):
2045         (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
2046         (WebKit::WebResourceLoadStatisticsStore::resourceLogFilePath):
2047         (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk):
2048         (WebKit::WebResourceLoadStatisticsStore::scheduleOrWriteStoreToDisk):
2049         (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
2050         (WebKit::WebResourceLoadStatisticsStore::startMonitoringStatisticsStorage):
2051         (WebKit::WebResourceLoadStatisticsStore::platformExcludeFromBackup):
2052         (WebKit::WebResourceLoadStatisticsStore::createDecoderFromDisk):
2053         (WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
2054         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
2055         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
2056         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
2057         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
2058         (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
2059         (WebKit::WebResourceLoadStatisticsStore::clearInMemoryAndPersistent):
2060         (WebKit::WebResourceLoadStatisticsStore::shouldRemoveDataRecords):
2061         (WebKit::WebResourceLoadStatisticsStore::setDataRecordsBeingRemoved):
2062         * UIProcess/WebResourceLoadStatisticsStore.h:
2063         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
2064         (WebKit::sortedPrevalentResourceTelemetry):
2065         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
2066         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2067         (WebKit::WebsiteDataStore::updateCookiePartitioningForTopPrivatelyOwnedDomains):
2068         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
2069         * UIProcess/WebsiteData/WebsiteDataStore.h:
2070
2071 2017-07-10  Michael Catanzaro  <mcatanzaro@igalia.com>
2072
2073         [SOUP] Remove WebKitSoupCookieJarSqlite
2074         https://bugs.webkit.org/show_bug.cgi?id=174310
2075
2076         Reviewed by Carlos Garcia Campos.
2077
2078         It seems WebKitSoupCookieJarSqlite uses exactly the same database format as the upstream
2079         SoupCookieJarDb class. WebKitSoupCookieJarSqlite is a copy of SoupCookieJarSqlite that uses
2080         WebCore's SQLite wrapper and WTF stuff. WebKitSoupCookieJarSqlite exists only because
2081         SoupCookieJarDb is relatively new, and the older SoupCookieJarSqlite class existed only in
2082         libsoup-gnome rather than libsoup proper. The advantage of continuing to use our
2083         WebKitSoupCookieJarSqlite class, besides that we already know it works, is that it utilizes
2084         the same SQLiteDatabase class that is used elsewhere in WebKit. But that's not really any
2085         reason to keep the class around, when SoupCookieJarDb does exactly the same thing. It was
2086         introduced in libsoup 2.42 and that is already our minimum required version, so we can
2087         switch now.
2088
2089         This passes a quick sanity-check of Epiphany's cookies dialog and also TestCookieManager.
2090
2091         * PlatformGTK.cmake:
2092         * PlatformWPE.cmake:
2093         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
2094         (WebKit::WebCookieManager::setCookiePersistentStorage):
2095         * WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.cpp: Removed.
2096         * WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.h: Removed.
2097
2098 2017-07-10  Myles C. Maxfield  <mmaxfield@apple.com>
2099
2100         REGRESSION(r213590): UI process updates the visible content rects more often than it did in iOS 10
2101         https://bugs.webkit.org/show_bug.cgi?id=174282
2102         <rdar://problem/33144344>
2103
2104         Reviewed by Simon Fraser.
2105
2106         In r213590, we accidentally refactored -[WKWebView _didCommitLayerTree:] to call _scheduleVisibleContentRectUpdate
2107         more often. Instead, this should be triggered from inside the "if" statements. 
2108
2109         No tests because there is no behavior change. Performance change is tested in MotionMark.
2110
2111         * UIProcess/API/Cocoa/WKWebView.mm:
2112         (-[WKWebView _isShowingVideoPictureInPicture]):
2113         (-[WKWebView _initializeWithConfiguration:]):
2114         (-[WKWebView goBack]):
2115         (-[WKWebView _didCommitLayerTree:]):
2116         (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
2117         (-[WKWebView _zoomToRect:withOrigin:fitEntireRect:minimumScale:maximumScale:minimumScrollDistance:]):
2118         (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
2119         (-[WKWebView scrollViewDidScroll:]):
2120         (-[WKWebView _visibleContentRect]):
2121         (-[WKWebView _frameOrBoundsChanged]):
2122         (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
2123         (-[WKWebView _updateVisibleContentRects]):
2124         (-[WKWebView _navigationGestureDidBegin]):
2125         (-[WKWebView _reloadWithoutContentBlockers]):
2126         (-[WKWebView _reloadExpiredOnly]):
2127         (-[WKWebView _setObscuredInsets:]):
2128         (-[WKWebView _setUnobscuredSafeAreaInsets:]):
2129         (-[WKWebView _endAnimatedResize]):
2130         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
2131         (-[WKWebView _clearOverrideLayoutParameters]):
2132         (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]):
2133         (-[WKWebView _propertiesOfLayerWithID:]):
2134
2135 2017-07-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2136
2137         [SOUP] SoupCookieJar is never released (resulting in sqlite temp files lying around)
2138         https://bugs.webkit.org/show_bug.cgi?id=166029
2139
2140         Reviewed by Michael Catanzaro.
2141
2142         Clear the SoupNetworkSession and cookie storage after the main loop quits.
2143
2144         * NetworkProcess/soup/NetworkProcessMainSoup.cpp:
2145         (WebKit::NetworkProcessMainUnix):
2146
2147 2017-07-10  Wenson Hsieh  <wenson_hsieh@apple.com>
2148
2149         [WK2] Action sheets for links fail to present in WebKit2 PDF view
2150         https://bugs.webkit.org/show_bug.cgi?id=174307
2151         <rdar://problem/31412128>
2152
2153         Reviewed by Tim Horton.
2154
2155         Currently, presenting an action sheet for a link always uses the WKActionSheetPresentAtClosestIndicatorRect
2156         codepath, which requires text indicator data for the link. However, when showing an action sheet for a link via
2157         WKPDFView, a text indicator for the link is not included, so the popover rect ends up being an empty rect at the
2158         origin, which causes us to bail from presenting the popover.
2159
2160         To address this, we tweak our heuristic for determining which action sheet presentation style to use, so that we
2161         only use the closest indicator rect for a link if the text indicator data is also present (otherwise, we fall
2162         back to using the element rect). All other behavior is the same.
2163
2164         * UIProcess/ios/WKActionSheetAssistant.mm:
2165         (-[WKActionSheetAssistant showImageSheet]):
2166         (presentationStyleForView):
2167
2168         Refactor _shouldPresentAtTouchLocationForElementRect into presentationStyleForView, a static function that
2169         returns a WKActionSheetPresentationStyle.
2170
2171         (-[WKActionSheetAssistant showLinkSheet]):
2172         (-[WKActionSheetAssistant _shouldPresentAtTouchLocationForElementRect:]): Deleted.
2173
2174 2017-07-09  Brady Eidson  <beidson@apple.com>
2175
2176         Remove some obsolete WebKitVersionChecks.
2177         https://bugs.webkit.org/show_bug.cgi?id=174294
2178
2179         Reviewed by Dan Bernstein.
2180
2181         * WebProcess/WebPage/WebPage.cpp:
2182         (WebKit::WebPage::updatePreferences):
2183
2184 2017-07-08  Chris Dumez  <cdumez@apple.com>
2185
2186         Simplify WebResourceLoadStatisticsStore / ResourceLoadStatisticsStore
2187         https://bugs.webkit.org/show_bug.cgi?id=174290
2188
2189         Reviewed by Brent Fulgham.
2190
2191         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2192         (-[WKWebsiteDataStore _resourceLoadStatisticsProcessStatisticsAndDataRecords]):
2193         (-[WKWebsiteDataStore _resourceLoadStatisticsSubmitTelemetry]):
2194         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2195         Rename a couple of functions in the Cocoa SPI for clarity and to match the name
2196         of their internal implementation.
2197
2198         * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
2199         (WebKit::ResourceLoadStatisticsStore::create):
2200         (WebKit::ResourceLoadStatisticsStore::ensureResourceStatisticsForPrimaryDomain):
2201         Stylistic changes.
2202
2203         (WebKit::ResourceLoadStatisticsStore::createEncoderFromData):
2204         Make const.
2205
2206         (WebKit::ResourceLoadStatisticsStore::readDataFromDecoder):
2207         Use HashMap::add() instead of HashMap::set(). There is not supposed to have any duplicate
2208         keys so add() is sufficient and more efficient.
2209
2210         (WebKit::ResourceLoadStatisticsStore::clearInMemoryAndPersistent): Removed.
2211         clearInMemoryAndPersistent() was only called from WebResourceLoadStatisticsStore and
2212         the m_deletePersistentStoreHandler / m_grandfatherExistingWebsiteDataHandler were both
2213         set by the WebResourceLoadStatisticsStore as well. Therefore, we don't really need this
2214         function, WebResourceLoadStatisticsStore now calls ResourceLoadStatisticsStore::clearInMemory()
2215         instead and takes care of doing what the m_deletePersistentStoreHandler /
2216         m_grandfatherExistingWebsiteDataHandler handlers were doing on its side.
2217
2218         (WebKit::ResourceLoadStatisticsStore::mergeStatistics):
2219         Pass Vector as rvalue reference, as a preparation for a future optimization. Added FIXME
2220         comment about the optimization.
2221
2222         (WebKit::ResourceLoadStatisticsStore::setNotificationCallback): Removed.
2223         (WebKit::ResourceLoadStatisticsStore::setGrandfatherExistingWebsiteDataCallback): Removed.
2224         (WebKit::ResourceLoadStatisticsStore::setDeletePersistentStoreCallback): Removed.
2225         (WebKit::ResourceLoadStatisticsStore::setFireTelemetryCallback): Removed.
2226         Drop those callback setters. WebResourceLoadStatisticsStore is the only client of
2227         ResourceLoadStatisticsStore and those callbacks were always called as a result of
2228         an operation requested by the WebResourceLoadStatisticsStore. Therefore, those are
2229         not needed. WebResourceLoadStatisticsStore can take care of doing what those
2230         callbacks were doing on its side.
2231
2232         (WebKit::ResourceLoadStatisticsStore::processStatistics):
2233         Pass parameter by const reference since we clearly do not intend to transfer ownership of it.
2234
2235         (WebKit::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
2236         (WebKit::ResourceLoadStatisticsStore::updateStatisticsForRemovedDataRecords):
2237         (WebKit::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore):
2238         Stylistic changes.
2239
2240         (WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords): Removed.
2241         (WebKit::ResourceLoadStatisticsStore::dataRecordsBeingRemoved): Removed.
2242         (WebKit::ResourceLoadStatisticsStore::dataRecordsWereRemoved): Removed.
2243         Those were moved to WebResourceLoadStatisticsStore since they do not require
2244         any access to the statistics, and are only used by WebResourceLoadStatisticsStore.
2245
2246         * UIProcess/Storage/ResourceLoadStatisticsStore.h:
2247
2248         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2249         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2250         Store registering most callbacks on the coreStore. Instead, the logic of those
2251         callbacks is now inlined in the few methods in WebResourceLoadStatisticsStore
2252         that were causing these callbacks to be called.
2253
2254         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
2255         Access some methods on WebResourceLoadStatisticsStore instead of the coreStore
2256         since those were moved.
2257
2258         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
2259         Drop unnecessary mutable for lambda.
2260
2261         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
2262         Pass parameter as rvalue reference as a preparation for a future optimization.
2263
2264         (WebKit::WebResourceLoadStatisticsStore::hasStatisticsFileChangedSinceLastSync):
2265         Make const.
2266
2267         (WebKit::WebResourceLoadStatisticsStore::submitTelemetry):
2268         Add assertion to make sure this is called on the main thread.
2269
2270         (WebKit::WebResourceLoadStatisticsStore::fireDataModificationHandler): Removed.
2271         This was dispatching to a background queue to call fireDataModificationHandler()
2272         on the ResourceLoadStatisticsStore. The coreStore would then dispatch back on the
2273         main thread to call the WebResourceLoadStatisticsStore's modification handler.
2274         This modification handler was merely calling processStatisticsAndDataRecords().
2275         Therefore, callers of WebResourceLoadStatisticsStore::fireDataModificationHandler()
2276         can call WebResourceLoadStatisticsStore::processStatisticsAndDataRecords() directly
2277         instead.
2278
2279         (WebKit::WebResourceLoadStatisticsStore::fireTelemetryHandler): Removed.
2280         This was calling ResourceLoadStatisticsStore::fireTelemetryHandler(), which was
2281         calling back WebResourceLoadStatisticsStore's fireTelemetryHandler. The handler
2282         in question was merely calling submitTelemetry(). Therefore, callers of
2283         WebResourceLoadStatisticsStore::fireTelemetryHandler() can call
2284         WebResourceLoadStatisticsStore::submitTelemetry() directly instead.
2285
2286         (WebKit::WebResourceLoadStatisticsStore::clearInMemoryAndPersistent):
2287         Call ResourceLoadStatisticsStore::clearInMemory() instead of clearInMemoryAndPersistent(),
2288         which was removed. ResourceLoadStatisticsStore::clearInMemoryAndPersistent() was calling
2289         clearInMemory() and then 2 of WebResourceLoadStatisticsStore's handlers. Instead, we now
2290         call the functions that those handlers were calling directly, thus eliminating the need
2291         for those handlers.
2292
2293         (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
2294         Set m_minimumTimeBetweenDataRecordsRemoval directly as it is now store on this class
2295         instead of the coreStore.
2296
2297         (WebKit::WebResourceLoadStatisticsStore::shouldRemoveDataRecords):
2298         (WebKit::WebResourceLoadStatisticsStore::dataRecordsBeingRemoved):
2299         (WebKit::WebResourceLoadStatisticsStore::dataRecordsWereRemoved):
2300         Those were merely moved from the ResourceLoadStatisticsStore.
2301
2302         * UIProcess/WebResourceLoadStatisticsStore.h:
2303
2304         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
2305         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
2306         Check for sortedPrevalentResources.isEmpty() instead of checking if the size
2307         if less than minimumPrevalentResourcesForTelemetry.
2308         ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry() either returns
2309         an empty vector or a vector with more than minimumPrevalentResourcesForTelemetry
2310         items. Therefore, there is no need to expose minimumPrevalentResourcesForTelemetry.
2311
2312 2017-07-08  Yusuke Suzuki  <utatane.tea@gmail.com>
2313
2314         Drop NOSNIFF compile flag
2315         https://bugs.webkit.org/show_bug.cgi?id=174289
2316
2317         Reviewed by Michael Catanzaro.
2318
2319         * Configurations/FeatureDefines.xcconfig:
2320
2321 2017-07-07  Chris Dumez  <cdumez@apple.com>
2322
2323         [WK2] Use a rolling 30-day uptime for processing statistics
2324         https://bugs.webkit.org/show_bug.cgi?id=174235
2325         <rdar://problem/33164381>
2326
2327         Reviewed by Brent Fulgham.
2328
2329         Follow-up fix for r219274 because it caused this test to time out:
2330         http/tests/loading/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout.html
2331
2332         The test sets TimeToLiveUserInteraction to 0 so our implementation cannot use
2333         0 as magic value to see if it was set. Instead, use std::optional.
2334
2335         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2336         (-[WKWebsiteDataStore _resourceLoadStatisticsResetToConsistentState]):
2337         * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
2338         (WebKit::ResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
2339         (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired):
2340         * UIProcess/Storage/ResourceLoadStatisticsStore.h:
2341         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2342         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
2343         * UIProcess/WebResourceLoadStatisticsStore.h:
2344
2345 2017-07-07  Brent Fulgham  <bfulgham@apple.com>
2346
2347         [WK2] Use a rolling 30-day uptime for processing statistics
2348         https://bugs.webkit.org/show_bug.cgi?id=174235
2349         <rdar://problem/33164381>
2350
2351         Reviewed by Chris Dumez.
2352
2353         * UIProcess/API/Cocoa/WKWebsiteDataStore.cpp:
2354         (WebKit::WKWebsiteDataStore::_resourceLoadStatisticsResetToConsistentState): Initialize time-to-live to zero by default.
2355         * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
2356         (WebKit::ResourceLoadStatisticsStore::createEncoderFromData): Write out vector
2357         of operating dates.
2358         (WebKit::ResourceLoadStatisticsStore::readDataFromDecoder): Read in vector of
2359         operating dates.
2360         (WebKit::ResourceLoadStatisticsStore::hasHadRecentUserInteraction): Check new
2361         convenience method.
2362         (WebKit::ResourceLoadStatisticsStore::markTodayAsOperatingDate): Added.
2363         (WebKit::ResourceLoadStatisticsStore::hasStatisticsExpired): Added.
2364         * UIProcess/Storage/ResourceLoadStatisticsStore.h:
2365         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2366         (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): When reading
2367         a new data file, update the current operating date (if needed).
2368         (WebKit::WebResourceLoadStatisticsStore::handleDailyTasks): Roll uptime dates as
2369         needed, then handle telemetry.
2370         * UIProcess/WebResourceLoadStatisticsStore.h:
2371
2372 2017-07-07  Wenson Hsieh  <wenson_hsieh@apple.com>
2373
2374         [iOS DnD] For cross-app drags, 'drop' event handlers are never invoked if dataTransfer.dropEffect is not set while dragging
2375         https://bugs.webkit.org/show_bug.cgi?id=174219
2376         <rdar://problem/32083177>
2377
2378         Reviewed by Ryosuke Niwa.
2379
2380         Tweak some testing SPI to return a drop operation flag instead of whether or not the drop operation was not
2381         UIDropOperationCancel.
2382
2383         * UIProcess/API/Cocoa/WKWebView.mm:
2384         (-[WKWebView _simulateDataInteractionUpdated:]):
2385         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2386         * UIProcess/ios/WKContentViewInteraction.h:
2387         * UIProcess/ios/WKContentViewInteraction.mm:
2388         (-[WKContentView _simulateDataInteractionUpdated:]):
2389
2390 2017-07-07  Commit Queue  <commit-queue@webkit.org>
2391
2392         Unreviewed, rolling out r219238, r219239, and r219241.
2393         https://bugs.webkit.org/show_bug.cgi?id=174265
2394
2395         "fast/workers/dedicated-worker-lifecycle.html is flaky"
2396         (Requested by yusukesuzuki on #webkit).
2397
2398         Reverted changesets:
2399
2400         "[WTF] Implement WTF::ThreadGroup"
2401         https://bugs.webkit.org/show_bug.cgi?id=174081
2402         http://trac.webkit.org/changeset/219238
2403
2404         "Unreviewed, build fix after r219238"
2405         https://bugs.webkit.org/show_bug.cgi?id=174081
2406         http://trac.webkit.org/changeset/219239
2407
2408         "Unreviewed, CLoop build fix after r219238"
2409         https://bugs.webkit.org/show_bug.cgi?id=174081
2410         http://trac.webkit.org/changeset/219241
2411
2412 2017-07-07  Antti Koivisto  <antti@apple.com>
2413
2414         WKWebSiteDataStore.removeDataOfTypes should wait until disk cache files are actually removed before invoking completion handler
2415         https://bugs.webkit.org/show_bug.cgi?id=174224
2416         <rdar://problem/33067545>
2417
2418         Reviewed by Sam Weinig.
2419
2420         Currently we dispatch file deletion operations to a background queue and call the completion
2421         handler without waiting for the I/O to complete.
2422
2423         * NetworkProcess/NetworkProcess.cpp:
2424         (WebKit::clearDiskCacheEntries):
2425
2426             Call a new version of NetworkCache::remove() for bulk deletion.
2427             Note that it is fine to call this with an empty vector.
2428
2429         * NetworkProcess/cache/NetworkCache.cpp:
2430         (WebKit::NetworkCache::Cache::remove):
2431
2432             Bulk deletion with a completion handler.
2433
2434         (WebKit::NetworkCache::Cache::deleteFiles): Added.
2435
2436             Factor to a helper function.
2437
2438         * NetworkProcess/cache/NetworkCache.h:
2439         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2440         (WebKit::NetworkCache::Storage::remove):
2441
2442             Remove files for all the provided keys in a queue and invoke the completion handler in the main thread when done.
2443
2444         * NetworkProcess/cache/NetworkCacheStorage.h:
2445
2446 2017-07-06  Chris Dumez  <cdumez@apple.com>
2447
2448         Fix bad usage of static variables in ResourceLoadStatisticsStore
2449         https://bugs.webkit.org/show_bug.cgi?id=174237
2450
2451         Reviewed by Brent Fulgham.
2452
2453         Fix bad usage of static variables in ResourceLoadStatisticsStore. Those can be set via
2454         member functions on ResourceLoadStatisticsStore so they should be data members. The
2455         API to set them is associated to a particular store and there can in theory be several
2456         stores.
2457
2458         * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
2459         (WebKit::ResourceLoadStatisticsStore::shouldPartitionCookies):
2460         (WebKit::ResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
2461         (WebKit::ResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
2462         (WebKit::ResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
2463         (WebKit::ResourceLoadStatisticsStore::setGrandfatheringTime):
2464         (WebKit::ResourceLoadStatisticsStore::hasHadRecentUserInteraction):
2465         (WebKit::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore):
2466         (WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords):
2467         (WebKit::shouldPartitionCookies): Deleted.
2468         * UIProcess/Storage/ResourceLoadStatisticsStore.h:
2469
2470 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
2471
2472         [WTF] Implement WTF::ThreadGroup
2473         https://bugs.webkit.org/show_bug.cgi?id=174081
2474
2475         Reviewed by Mark Lam.
2476
2477         * Shared/AsyncRequest.h:
2478         * UIProcess/Storage/ResourceLoadStatisticsStore.h:
2479
2480 2017-07-06  Chris Dumez  <cdumez@apple.com>
2481
2482         Drop unused ResourceLoadStatistics members
2483         https://bugs.webkit.org/show_bug.cgi?id=174226
2484
2485         Reviewed by Brent Fulgham.
2486
2487         * Shared/WebCoreArgumentCoders.cpp:
2488         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
2489         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
2490         * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
2491         (WebKit::ResourceLoadStatisticsStore::readDataFromDecoder):
2492
2493 2017-07-06  Wenson Hsieh  <wenson_hsieh@apple.com>
2494
2495         Unreviewed, fix the internal iOS 11 build
2496
2497         It turns out, our internal bots are still on an older version of the iOS 11 SDK that's missing _UIDataOwner in
2498         <UIKit/NSItemProvider+UIKitAdditions_Private.h>. To ensure that we can build on both current and slightly older
2499         versions of the iOS 11 SDK, fall back to using NSInteger instead of _UIDataOwner.
2500
2501         * Platform/spi/ios/UIKitSPI.h:
2502         * UIProcess/ios/WKContentViewInteraction.mm:
2503         (-[WKContentView _dragInteraction:dataOwnerForSession:]):
2504         (-[WKContentView _dropInteraction:dataOwnerForSession:]):
2505
2506 2017-07-06  Wenson Hsieh  <wenson_hsieh@apple.com>
2507
2508         [iOS DnD] [WK2] Add delegate hooks for specifying the data owner for a drag or drop session
2509         https://bugs.webkit.org/show_bug.cgi?id=174139
2510         <rdar://problem/33126212>
2511
2512         Reviewed by Beth Dakin.
2513
2514         Add hooks to query the UI delegate for a _UIDataOwner on both drag and drop sides.
2515
2516         * Platform/spi/ios/UIKitSPI.h:
2517         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2518         * UIProcess/ios/WKContentViewInteraction.mm:
2519         (-[WKContentView _dragInteraction:dataOwnerForSession:]):
2520         (-[WKContentView _dropInteraction:dataOwnerForSession:]):
2521
2522 2017-07-06  Brent Fulgham  <bfulgham@apple.com>
2523
2524         [WK2] ResourceLoadStatistics should batch its writes
2525         https://bugs.webkit.org/show_bug.cgi?id=174111
2526         <rdar://problem/33115894>
2527
2528         Reviewed by Chris Dumez.
2529
2530         Revise the data writing operation to only write on a specific interval (currently
2531         set to 5 minutes).
2532
2533         Also make 'writeStoreToDisk' simpler to use by moving the deleting (before write) and
2534         creating (after write) of the FileMonitor into the method, rather than requiring this
2535         knowledge in multiple places.
2536
2537         Make sure that we write our statistics file out before exiting so that we do not
2538         lose any data if we exit before the five-minute window has elapsed.
2539
2540         * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
2541         (WebKit::ResourceLoadStatisticsStore::setWritePersistentStoreCallback): Deleted.
2542         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2543         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords): Remove the stop
2544         and start monitoring into 'writeStoreToDisk'. Also check if enough time has elapsed since
2545         the last write to commit to disk.
2546         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Remove the
2547         stop and start monitoring into 'writeStoreToDisk'.
2548         (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk): Add the stop and start monitoring
2549         commands here, so callers don't have to know to do so.
2550
2551 2017-07-06  Chris Dumez  <cdumez@apple.com>
2552
2553         FileMonitor should not be ref counted
2554         https://bugs.webkit.org/show_bug.cgi?id=174166
2555
2556         Reviewed by Brent Fulgham.
2557
2558         Update code using FileMonitor to reflect API change.
2559
2560         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2561         (WebKit::WebResourceLoadStatisticsStore::startMonitoringStatisticsStorage):
2562         (WebKit::WebResourceLoadStatisticsStore::stopMonitoringStatisticsStorage):
2563         * UIProcess/WebResourceLoadStatisticsStore.h:
2564
2565 2017-07-06  Matt Rajca  <mrajca@apple.com>
2566
2567         Fix build with VIDEO support disabled.
2568         https://bugs.webkit.org/show_bug.cgi?id=174217
2569
2570         Unreviewed build fix.
2571
2572         * WebProcess/WebPage/WebPage.cpp:
2573         (WebKit::WebPage::updateWebsitePolicies):
2574
2575 2017-07-06  Chris Dumez  <cdumez@apple.com>
2576
2577         Crash under WebResourceLoadStatisticsStore::persistentStoragePath(WTF::String const&)
2578         https://bugs.webkit.org/show_bug.cgi?id=174205
2579         <rdar://problem/33093552>
2580
2581         Reviewed by Brent Fulgham.
2582
2583         Make sure we isolateCopy() m_statisticsStoragePath before using it from the background
2584         thread.
2585
2586         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2587         (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
2588         (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk):
2589         (WebKit::WebResourceLoadStatisticsStore::resourceLogFilePath):
2590         (WebKit::WebResourceLoadStatisticsStore::statisticsFilePath):
2591         (WebKit::WebResourceLoadStatisticsStore::writeStoreToDisk):
2592         (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
2593         (WebKit::WebResourceLoadStatisticsStore::deleteStoreFromDisk):
2594         (WebKit::WebResourceLoadStatisticsStore::startMonitoringStatisticsStorage):
2595         (WebKit::WebResourceLoadStatisticsStore::syncWithExistingStatisticsStorageIfNeeded):
2596         (WebKit::WebResourceLoadStatisticsStore::persistentStoragePath): Deleted.
2597         * UIProcess/WebResourceLoadStatisticsStore.h:
2598
2599 2017-07-06  Alex Christensen  <achristensen@webkit.org>
2600
2601         Fix CFURLRequestRef serialization after r207330
2602         https://bugs.webkit.org/show_bug.cgi?id=163332
2603
2604         * Shared/mac/WebCoreArgumentCodersMac.mm:
2605         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
2606         The CFURLConnection code was not updated.
2607         We did not catch this because nobody uses the WebKit2 CFURLConnection code, but I need to use it to debug something.
2608
2609 2017-07-06  Chris Dumez  <cdumez@apple.com>
2610
2611         Move ResourceLoadObserver notification throttling logic from WebProcess class to ResourceLoadObserver
2612         https://bugs.webkit.org/show_bug.cgi?id=174194
2613
2614         Reviewed by Brent Fulgham.
2615
2616         Move ResourceLoadObserver notification throttling logic from WebProcess class to
2617         ResourceLoadObserver. This makes more sense and decreases the complexity of the
2618         WebProcess class.
2619
2620         * WebProcess/WebProcess.cpp:
2621         (WebKit::m_webSQLiteDatabaseTracker):
2622         (WebKit::WebProcess::statisticsChangedTimerFired): Deleted.
2623         * WebProcess/WebProcess.h:
2624
2625 2017-07-06  Chris Dumez  <cdumez@apple.com>
2626
2627         WebResourceLoadStatisticsStore should only be constructed when the feature is enabled
2628         https://bugs.webkit.org/show_bug.cgi?id=174189
2629
2630         Reviewed by Brent Fulgham.
2631
2632         Delay the construction of the WebResourceLoadStatisticsStore until the feature gets
2633         enabled via WebsiteDataStore::setResourceLoadStatisticsEnabled(). Previously, we would
2634         always construct a store and then have a boolean on the store to indicate if it is
2635         enabled or not.
2636
2637         Also simplify the initialization process of the WebResourceLoadStatisticsStore, we
2638         used to have:
2639         1. WebResourceLoadStatisticsStore constructor
2640         2. WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver()
2641         3. WebResourceLoadStatisticsStore::setResourceLoadStatisticsEnabled(true)
2642
2643         All 3 steps are now taken care of by the WebResourceLoadStatisticsStore constructor.
2644
2645         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2646         (WebKit::WebProcessPool::platformInitialize):
2647         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2648         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
2649         (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
2650         * UIProcess/WebResourceLoadStatisticsStore.h:
2651         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
2652         (WebKit::WebsiteDataStore::platformInitialize):
2653         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2654         (WebKit::WebsiteDataStore::WebsiteDataStore):
2655         (WebKit::WebsiteDataStore::resourceLoadStatisticsEnabled):
2656         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
2657         * UIProcess/WebsiteData/WebsiteDataStore.h:
2658         (WebKit::WebsiteDataStore::resourceLoadStatistics):
2659         * UIProcess/wpe/WebProcessPoolWPE.cpp:
2660         (WebKit::WebProcessPool::platformInitialize):
2661
2662 2017-07-06  Claudio Saavedra  <csaavedra@igalia.com>
2663
2664         [GTK] It should process MouseMoved events when the parent window is not active
2665         https://bugs.webkit.org/show_bug.cgi?id=116691
2666
2667         Reviewed by Michael Catanzaro.
2668
2669         From reading the comments in the related code, only in Safari it
2670         is desired that MouseMoved events are not processed when the
2671         parent window is not active. In other ports, in particular those
2672         targeting Linux, these events should be processed for consistency
2673         with other browsers.
2674
2675         * UIProcess/WebPageProxy.cpp:
2676         (WebKit::WebPageProxy::setCursor):
2677         * UIProcess/mac/PageClientImpl.mm:
2678         (WebKit::PageClientImpl::setCursor):
2679         * WebProcess/WebPage/WebPage.cpp:
2680         (WebKit::handleMouseEvent):
2681         (WebKit::WebPage::mouseEvent):  No need to always pass a boolean
2682         parameter that is only checked for one type of event. Do the check
2683         internally in handleMouseEvent() only when needed and only in Cocoa.
2684
2685 2017-07-05  Don Olmstead  <don.olmstead@sony.com>
2686
2687         [WTF] Move SoftLinking.h into WTF
2688         https://bugs.webkit.org/show_bug.cgi?id=174000
2689
2690         Reviewed by Alex Christensen.
2691
2692         * Platform/mac/StringUtilities.mm:
2693         * Platform/spi/ios/ManagedConfigurationSPI.h:
2694         * Shared/Cocoa/DataDetectionResult.mm:
2695         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2696         * Shared/ios/InteractionInformationAtPosition.mm:
2697         * Shared/ios/WebIconUtilities.mm:
2698         * Shared/mac/CookieStorageShim.mm:
2699         * Shared/mac/WebCoreArgumentCodersMac.mm:
2700         * UIProcess/API/Cocoa/_WKElementAction.mm:
2701         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2702         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
2703         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
2704         * UIProcess/Cocoa/UIDelegate.mm:
2705         * UIProcess/Cocoa/WebViewImpl.mm:
2706         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2707         * UIProcess/ios/WKActionSheetAssistant.mm:
2708         * UIProcess/ios/WKContentViewInteraction.mm:
2709         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
2710         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2711         * UIProcess/mac/WKImmediateActionController.mm:
2712         * UIProcess/mac/WebInspectorProxyMac.mm:
2713         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
2714         * WebProcess/WebPage/mac/WebInspectorUIMac.mm:
2715         * WebProcess/cocoa/WebProcessCocoa.mm:
2716
2717 2017-07-05  Brady Eidson  <beidson@apple.com>
2718
2719         Allow navigations in subframes to get a ShouldOpenExternalURLsPolicy of "ShouldAllow".
2720         <rdar://problem/22485589> and https://bugs.webkit.org/show_bug.cgi?id=174178
2721
2722         Reviewed by Alex Christensen.
2723
2724         Adopt to the new constructor for FrameLoadRequest.
2725
2726         * WebProcess/Plugins/PluginView.cpp:
2727         (WebKit::PluginView::loadURL):
2728         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2729         (WebKit::WebFrameLoaderClient::dispatchCreatePage):
2730         * WebProcess/WebPage/WebInspector.cpp:
2731         (WebKit::WebInspector::openInNewTab):
2732
2733 2017-07-05  Ryosuke Niwa  <rniwa@webkit.org>
2734
2735         Remove unnecessary forward declartions now that we include Foundation.h
2736
2737         * UIProcess/API/Cocoa/WKContentRuleListStore.h:
2738
2739 2017-07-05  Ryosuke Niwa  <rniwa@webkit.org>
2740
2741         Make WebKit's public headers on Mac and iOS C++ module safe
2742         https://bugs.webkit.org/show_bug.cgi?id=174175
2743
2744         Reviewed by Alex Christensen.
2745
2746         Fixed the header files.
2747
2748         * UIProcess/API/Cocoa/WKContentRuleList.h:
2749         * UIProcess/API/Cocoa/WKContentRuleListStore.h:
2750         * UIProcess/API/Cocoa/WKUIDelegate.h:
2751
2752 2017-07-05  Chris Dumez  <cdumez@apple.com>
2753
2754         [WK2] WebsiteDataStore::setResourceLoadStatisticsEnabled() updates processPools the store is not associated with
2755         https://bugs.webkit.org/show_bug.cgi?id=174174
2756
2757         Reviewed by Brent Fulgham.
2758
2759         WebsiteDataStore::setResourceLoadStatisticsEnabled() updates processPools the store is not associated with.
2760         Fix this by iterating over WebsiteDataStore::processPools() instead of WebProcessPool::allProcessPools().
2761
2762         Also rename shouldPartitionCookiesForTopPrivatelyOwnedDomains methods / IPC messages to
2763         updateCookiePartitioningForTopPrivatelyOwnedDomains since this is a setter, not a getter.
2764
2765         Finally, drop ShouldPartitionCookiesForTopPrivatelyOwnedDomains IPC message to the NetworkProcessProxy
2766         as well as corresponding methods as those appear to be unused.
2767
2768         * NetworkProcess/NetworkProcess.cpp:
2769         (WebKit::NetworkProcess::updateCookiePartitioningForTopPrivatelyOwnedDomains):
2770         (WebKit::NetworkProcess::shouldPartitionCookiesForTopPrivatelyOwnedDomains): Deleted.
2771         * NetworkProcess/NetworkProcess.h:
2772         * NetworkProcess/NetworkProcess.messages.in:
2773         * UIProcess/Network/NetworkProcessProxy.cpp:
2774         (WebKit::NetworkProcessProxy::shouldPartitionCookiesForTopPrivatelyOwnedDomains): Deleted.
2775         * UIProcess/Network/NetworkProcessProxy.h:
2776         * UIProcess/Network/NetworkProcessProxy.messages.in:
2777         * UIProcess/WebProcessPool.cpp:
2778         (WebKit::WebProcessPool::setResourceLoadStatisticsEnabled):
2779         * UIProcess/WebProcessPool.h:
2780         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2781         (WebKit::WebsiteDataStore::updateCookiePartitioningForTopPrivatelyOwnedDomains):
2782         (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
2783         (WebKit::WebsiteDataStore::registerSharedResourceLoadObserver):
2784         (WebKit::WebsiteDataStore::shouldPartitionCookiesForTopPrivatelyOwnedDomains): Deleted.
2785         * UIProcess/WebsiteData/WebsiteDataStore.h:
2786
2787 2017-07-05  Tim Horton  <timothy_horton@apple.com>
2788
2789         Async Image Decoding: Image flashes away briefly when tapping on tab in iPad tab picker
2790         https://bugs.webkit.org/show_bug.cgi?id=174173
2791         <rdar://problem/32431952>
2792
2793         Reviewed by Geoffrey Garen.
2794
2795         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2796         (WebKit::RemoteLayerTreeDrawingArea::addTransactionCallbackID):
2797         When a client uses e.g. doAfterNextPresentationUpdate (or internally,
2798         dispatchAfterEnsuringDrawing), they're doing so in the hopes that the
2799         callback is called after the page is well-painted -- for example, to
2800         remove a snapshot (in the tab picker case, as well as for navigation
2801         gestures), or to *take* a snapshot. In all of these cases, it is
2802         preferable to do a synchronous decode, to ensure that the image does
2803         not flash away temporarily.
2804
2805         Use the existing mechanism that was implemented for the synchronous
2806         activity state change flush to also force synchronous image decoding
2807         any time there is a post-commit transaction callback.
2808
2809 2017-07-05  Wenson Hsieh  <wenson_hsieh@apple.com>
2810
2811         [iOS DnD] [WK2] 3D touch fails to recognize when UIDragInteraction is enabled on phone
2812         https://bugs.webkit.org/show_bug.cgi?id=174171
2813         <rdar://problem/32956929>
2814
2815         Reviewed by Tim Horton.
2816
2817         By default, UIKit defers all competing long press gesture recognizers if dragging is enabled. However, this
2818         would cause 3D touch to be prevented, due to UIKit asking us whether or not we can proceed with the 3D touch
2819         gesture in -_interactionShouldBeginFromPreviewItemController:forPosition:, while the highlight long press
2820         gesture recognizer is being deferred. To address this, we use SPI on UIDragInteraction to allow the highlight
2821         long press gesture recognizer to recognize alongside the drag lift gesture. We then (already) manually cancel
2822         the highlight long press gesture in _dragInteraction:prepareForSession:completion:.
2823
2824         * UIProcess/ios/WKContentViewInteraction.mm:
2825         (-[WKContentView _dragInteraction:shouldDelayCompetingGestureRecognizer:]):
2826
2827 2017-07-03  Myles C. Maxfield  <mmaxfield@apple.com>
2828
2829         Remove copy of ICU headers from WebKit
2830         https://bugs.webkit.org/show_bug.cgi?id=116407
2831
2832         Reviewed by Alex Christensen.
2833
2834         * Configurations/BaseTarget.xcconfig:
2835
2836 2017-07-05  Chris Dumez  <cdumez@apple.com>
2837
2838         Regression(r218821): Bad cast to WebKit::DiagnosticLoggingClient in WKWebView's _setDiagnosticLoggingDelegate
2839         https://bugs.webkit.org/show_bug.cgi?id=174163
2840         <rdar://problem/33067518>
2841
2842         Reviewed by Alex Christensen.
2843
2844         After r218821, WebPageProxy::setDiagnosticLoggingClient() would no longer set the client in
2845         private session. This is an issue because there is code in WKWebView which expects the
2846         DiagnosticLoggingClient to be set and of a specific type. This would lead to bad casts in
2847         WKWebView's _diagnosticLoggingDelegate / _setDiagnosticLoggingDelegate.
2848
2849         To avoid the issue, we now unconditionally update the client in
2850         WebPageProxy::setDiagnosticLoggingClient(). Instead, we implement the logic for disabling
2851         logging in private session in the logging methods themselves, via the
2852         WebPageProxy::effectiveDiagnosticLoggingClient() helper instead.
2853
2854         I also added null checks in WKWebView's _diagnosticLoggingDelegate /
2855         _setDiagnosticLoggingDelegate. Even though the WKWebView sets itself as the diagnostic
2856         logging client, WebPageProxy::diagnosticLoggingClient() can still return null after
2857         calling WebPageProxy::close(). Previously, we would have done a bad cast if the WKWebView's
2858         client would have used this API after calling 'close' as well.
2859
2860         * UIProcess/API/APIDiagnosticLoggingClient.h:
2861         * UIProcess/API/Cocoa/WKWebView.mm:
2862         (-[WKWebView _diagnosticLoggingDelegate]):
2863         (-[WKWebView _setDiagnosticLoggingDelegate:]):
2864         * UIProcess/WebPageProxy.cpp:
2865         (WebKit::WebPageProxy::WebPageProxy):
2866         (WebKit::WebPageProxy::setDiagnosticLoggingClient):
2867         (WebKit::WebPageProxy::close):
2868         (WebKit::WebPageProxy::effectiveDiagnosticLoggingClient):
2869         (WebKit::WebPageProxy::logDiagnosticMessage):
2870         (WebKit::WebPageProxy::logDiagnosticMessageWithResult):
2871         (WebKit::WebPageProxy::logDiagnosticMessageWithValue):
2872         (WebKit::WebPageProxy::logDiagnosticMessageWithEnhancedPrivacy):
2873         * UIProcess/WebPageProxy.h:
2874         (WebKit::WebPageProxy::diagnosticLoggingClient):
2875
2876 2017-07-05  Daniel Bates  <dabates@apple.com>
2877
2878         Do not pass API::FrameInfo for source frame or clear out page of target frame on
2879         API navigation
2880         https://bugs.webkit.org/show_bug.cgi?id=174170
2881         <rdar://problem/33140328>
2882
2883         Reviewed by Brady Eidson.
2884
2885         As a step towards making it straightforward for an embedding client to determine whether
2886         a WebPageProxy::decidePolicyForNavigationAction() callback was initiated from API we
2887         should not pass frame info for the source frame and should not nullify the page pointer
2888         in the target frame info.
2889
2890         Currently we always pass frame info for the source frame and nullify the page pointer
2891         in both the source frame info and target frame info if the navigation was initiated from
2892         API. This seems subtle and error prone. Instead we should not pass frame info for
2893         the source frame and not nullify the page pointer in the target frame info as a step
2894         towards making using this API less error-prone.
2895
2896         * UIProcess/WebPageProxy.cpp:
2897         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2898
2899 2017-07-05  Chris Dumez  <cdumez@apple.com>
2900
2901         Add a few more WebKit2 owners
2902         https://bugs.webkit.org/show_bug.cgi?id=174169
2903
2904         Reviewed by Brady Eidson.
2905
2906         * Owners:
2907
2908 2017-07-05  Brent Fulgham  <bfulgham@apple.com>
2909
2910         [WK2] Prevent ResourceLoadStatistics from triggering a cascade of read/write events
2911         https://bugs.webkit.org/show_bug.cgi?id=174062\
2912         <rdar://problem/33086744>
2913
2914         Reviewed by Chris Dumez.
2915
2916         ResourceLoadStatistics was triggering periods of high CPU use due to a cascade of read/write
2917         operations:
2918         (1) The 'makeRefPtr' call in FileMonitor::startMonitoring was capturing a reference to itself, preventing
2919             the FileMonitor from being destroyed. This caused the file modification handler to fire in response
2920             to our own write events, creating a ridiculous read/write cycle. This problem was addressed in
2921             the short term by stopping the file monitor in WebResourceLoadStatisticsStore::stopMonitoringStatisticsStorage,
2922             rather than relying on the destructor to shut things down. This will be improved in a
2923             subsequent patch.
2924         (2) 'syncWithExistingStatisticsStorageIfNeeded' was creating a FileMonitor during the write operation,
2925             which exacerbated the chain of read/writes already present due to the self-reference described above.
2926         (3) Because VNODE dispatch sources are low level, they do not offer a means of filtering out operations
2927             triggered by the current process. To avoid this, I added code to track the file modification time, so
2928             that we don't bother reading a file that holds data that is older than the in-memory data, even though
2929             we receive a file modification dispatch. Writes seem to trigger a chain of notification events in rapid
2930             succession. Once we've responded to the first of these events, we don't need to to further reads until
2931             the data on disk changes again.    
2932
2933         We also shouldn't allow the ResourceLoadStatistics worker thread to consume high CPU resources. Run it
2934         as utility QoS, avoiding using the CPU when other work is going on.
2935
2936         Drive-by fix: The closure in setWritePersistentStoreCallback() should stop monitoring before writing
2937         data, and should start monitoring after the write completes.
2938
2939         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2940         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): Run our worker queue
2941         as a utility-level process.
2942         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver): Stop checking for
2943         updates before writing, and begin checking again once the write is complete.
2944         (WebKit::WebResourceLoadStatisticsStore::statisticsFileModificationTime): Added.
2945         (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded): Avoid reading the file if it
2946         was last modified on (or before) the time we last read the file.
2947         (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk): Ditto.
2948         (WebKit::WebResourceLoadStatisticsStore::stopMonitoringStatisticsStorage): Explicitly stop file
2949         monitoring so that the active file modification handler will terminate.
2950         (WebKit::WebResourceLoadStatisticsStore::syncWithExistingStatisticsStorageIfNeeded): Do not begin
2951         monitoring the file after syncing, since this is only used as part of an ongoing write operation.
2952
2953 2017-07-05  Jonathan Bedard  <jbedard@apple.com>
2954
2955         Add WebKitPrivateFrameworkStubs for iOS 11
2956         https://bugs.webkit.org/show_bug.cgi?id=173988
2957
2958         Reviewed by David Kilzer.
2959
2960         * Configurations/BaseTarget.xcconfig: iphoneos and iphonesimulator should use the
2961         same directory for private framework stubs.
2962
2963 2017-07-05  Andy Estes  <aestes@apple.com>
2964
2965         [iOS] WKActionSheetAssistants can outlive their host views
2966         https://bugs.webkit.org/show_bug.cgi?id=174160
2967         <rdar://problem/20638607>
2968
2969         Reviewed by Tim Horton.
2970
2971         WKActionSheetAssistant keeps a raw pointer to its host UIView, and nothing clears it when
2972         the host view is deallocated. If the assistant outlives the view, we can end up accessing a
2973         pointer to a deallocated UIView and crashing.
2974
2975         I don't know how to reproduce such a crash, but this patch guards against it by doing the
2976         following:
2977
2978         1. Make _view a WeakObjCPtr in WKActionSheetAssistant to ensure it gets set to nil when the
2979            UIView is deallocated.
2980         2. Call -[WKActionSheetAssistant cleanupSheet] when a WKContentView or WKPDFView is
2981            deallocated, or when the Web process crashes. This will ensure the action sheet is
2982            dismissed and prevent the user from tapping on an action that's no longer valid.
2983
2984         * UIProcess/ios/WKActionSheetAssistant.mm:
2985         (-[WKActionSheetAssistant superviewForSheet]):
2986         (-[WKActionSheetAssistant _presentationRectForSheetGivenPoint:inHostView:]):
2987         (-[WKActionSheetAssistant presentationRectForElementUsingClosestIndicatedRect]):
2988         (-[WKActionSheetAssistant presentationRectForIndicatedElement]):
2989         (-[WKActionSheetAssistant _shouldPresentAtTouchLocationForElementRect:]):
2990         * UIProcess/ios/WKContentViewInteraction.mm:
2991         (-[WKContentView cleanupInteraction]):
2992         * UIProcess/ios/WKPDFView.mm:
2993         (-[WKPDFView dealloc]):
2994
2995 2017-07-05  Frederic Wang  <fwang@igalia.com>
2996
2997         Move ScrolledContentsLayer property to ScrollingStateScrollingNode
2998         https://bugs.webkit.org/show_bug.cgi?id=174134
2999
3000         Reviewed by Simon Fraser.
3001
3002         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
3003         (ArgumentCoder<ScrollingStateScrollingNode>::encode): Add encoding for scrolled contents
3004         layer.
3005         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode): Remove encoding for scrolled
3006         contents layer.
3007         (ArgumentCoder<ScrollingStateOverflowScrollingNode>::encode): Ditto.
3008         (ArgumentCoder<ScrollingStateScrollingNode>::decode): Add decoding for scrolled contents
3009         layer.
3010         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode): Remove decoding for scrolled
3011         contents layer.
3012         (ArgumentCoder<ScrollingStateOverflowScrollingNode>::decode): Ditto.
3013         (WebKit::dump): Move dumping of scrolled contents layer from overflow/frame nodes to
3014         scrolling node.
3015         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
3016         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): Adjust enum value to use
3017         ScrollingStateScrollingNode::ScrolledContentsLayer.
3018         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
3019         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren): Ditto.
3020         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3021         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): Ditto.
3022
3023 2017-07-05  Ada Chan  <adachan@apple.com>
3024
3025         Fix crash in UIKit: +[UIViewController _viewControllerForFullScreenPresentationFromView:]
3026         https://bugs.webkit.org/show_bug.cgi?id=174143
3027         <rdar://problem/28384582>
3028
3029         Reviewed by Wenson Hsieh.
3030
3031         In -[WKActionSheet willRotate], we can't guarantee that the action sheet belongs
3032         in a window, and passing nil to +[UIViewController _viewControllerForFullScreenPresentationFromView:]
3033         throws an exception. To fix this, bail early if the result from -hostViewForSheet is nil.
3034
3035         * UIProcess/ios/WKActionSheet.mm:
3036         (-[WKActionSheet willRotate]):
3037
3038 2017-07-05  Eric Carlson  <eric.carlson@apple.com>
3039
3040         [MediaStream] Protect request and web view during gUM client callback
3041         https://bugs.webkit.org/show_bug.cgi?id=174096
3042         <rdar://problem/32833102>
3043
3044         Reviewed by Youenn Fablet.
3045
3046         Retain the message and WebView during asynchronous calls so they won't be 
3047         released if a navigation happens during a call to the UA for getUserMedia 
3048         or enumerateMediaDevices.
3049
3050         * UIProcess/Cocoa/UIDelegate.mm:
3051         (WebKit::requestUserMediaAuthorizationForDevices):
3052         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
3053         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
3054
3055 2017-07-05  Matt Lewis  <jlewis3@apple.com>
3056
3057         Unreviewed, rolling out r219128.
3058
3059         Spoke with engineer who originally submitted, Patch for APi
3060         test to follow.
3061
3062         Reverted changeset:
3063
3064         "Unreviewed, rolling out r219070."
3065         https://bugs.webkit.org/show_bug.cgi?id=174082
3066         http://trac.webkit.org/changeset/219128
3067
3068 2017-07-05  Matt Lewis  <jlewis3@apple.com>
3069
3070         Unreviewed, rolling out r219070.
3071
3072         This revision caused consistent failures of the API test
3073         UIPasteboardTests.DoNotPastePlainTextAsURL on iOS.
3074
3075         Reverted changeset:
3076
3077         "Pasting single words copied to UIPasteboard inserts URLs in
3078         editable areas"
3079         https://bugs.webkit.org/show_bug.cgi?id=174082
3080         http://trac.webkit.org/changeset/219070
3081
3082 2017-07-05  Zan Dobersek  <zdobersek@igalia.com>
3083
3084         [GLib] Incorrect <glib/gi18n.h> include in WebKitWebsiteData
3085         https://bugs.webkit.org/show_bug.cgi?id=174093
3086
3087         Reviewed by Michael Catanzaro.
3088
3089         * UIProcess/API/glib/WebKitWebsiteData.cpp: Include <glib/gi18n-lib.h>
3090         rather than <glib/gi18n.h>, since the former has to be included in a
3091         library while the latter should only be included in a standalone application.
3092
3093 2017-07-04  Joseph Pecoraro  <pecoraro@apple.com>
3094
3095         Cleanup some StringBuilder use
3096         https://bugs.webkit.org/show_bug.cgi?id=174118
3097
3098         Reviewed by Andreas Kling.
3099
3100         * NetworkProcess/capture/NetworkCaptureManager.cpp:
3101         (WebKit::NetworkCapture::Manager::hashToPath):
3102         * UIProcess/WebPageProxy.cpp:
3103
3104 2017-07-03  Wenson Hsieh  <wenson_hsieh@apple.com>
3105
3106         [iOS DnD] [WK2] Callout bar should reappear after dragging ends for a text selection
3107         https://bugs.webkit.org/show_bug.cgi?id=174116
3108         <rdar://problem/33017845>
3109
3110         Reviewed by Ryosuke Niwa.
3111
3112         -willStartScrollingOverflow -didEndScrollingOverflow are helper methods on both the UIWKTextInteractionAssistant
3113         and UIWebSelectionAssistant that handle hiding selection and callout bar UI during overflow scrolling and making
3114         it reappear after scrolling ends. However, these hooks do not contain logic specific to scrolling, and simply
3115         tell the inner UIWebSelectionView to either show or hide and are safe to invoke outside of the context of
3116         scrolling.
3117
3118         This patch invokes these hooks when beginning a drag on a selection, and when a dragging ends, if it called
3119         -willStartScrollingOverflow to begin with. We should rename these in the future to be something along the lines
3120         of -hideSelectionViewAndControls and -showSelectionViewAndControls, respectively, and adopt these new names in
3121         WebKit. We also move logic to hide the callout out of -itemsForBeginningSession: and into
3122         -willAnimateLiftWithAnimator:, when the lift actually begins.
3123
3124         * UIProcess/ios/WKContentViewInteraction.h:
3125         * UIProcess/ios/WKContentViewInteraction.mm:
3126         (-[WKContentView cleanUpDragSourceSessionState]):
3127         (-[WKContentView _restoreCalloutBarIfNeeded]):
3128         (-[WKContentView dragInteraction:itemsForBeginningSession:]):
3129         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
3130         (-[WKContentView dragInteraction:session:didEndWithOperation:]):
3131
3132 2017-07-03  Matt Rajca  <mrajca@apple.com>
3133
3134         Add/remove appropriate media element behavior restrictions when updateWebsitePolicies is called
3135         https://bugs.webkit.org/show_bug.cgi?id=174103
3136
3137         Reviewed by Alex Christensen.
3138
3139         Currently, when -[WKWebView evaluateJavaScript:completionHandler:] is invoked, we end up simulating
3140         a user gesture unconditionally. This is not desireable for some tests, so I added a private variant
3141         of this method that takes a boolean that is ultimately passed to `executeScript` for the
3142         `forceUserGesture` parameter (instead of unconditionally passing `true`).
3143
3144         * UIProcess/API/C/WKPage.cpp:
3145         (WKPageRunJavaScriptInMainFrame):
3146         * UIProcess/API/Cocoa/WKWebView.mm:
3147         (-[WKWebView evaluateJavaScript:completionHandler:]):
3148         (-[WKWebView _evaluateJavaScript:forceUserGesture:completionHandler:]):
3149         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3150         * UIProcess/WebPageProxy.cpp:
3151         (WebKit::WebPageProxy::runJavaScriptInMainFrame):
3152         * UIProcess/WebPageProxy.h:
3153         * WebProcess/WebPage/WebPage.cpp:
3154         (WebKit::WebPage::runJavaScriptInMainFrame):
3155         (WebKit::WebPage::updateWebsitePolicies): Update behavior restrictions on any existing media elements.
3156         * WebProcess/WebPage/WebPage.h:
3157         * WebProcess/WebPage/WebPage.messages.in:
3158
3159 2017-07-03  Matt Lewis  <jlewis3@apple.com>
3160
3161         Unreviewed, rolling out r219103.
3162
3163         Caused multiple build failures.
3164
3165         Reverted changeset:
3166
3167         "Remove copy of ICU headers from WebKit"
3168         https://bugs.webkit.org/show_bug.cgi?id=116407
3169         http://trac.webkit.org/changeset/219103
3170
3171 2017-07-03  Myles C. Maxfield  <mmaxfield@apple.com>
3172
3173         Remove copy of ICU headers from WebKit
3174         https://bugs.webkit.org/show_bug.cgi?id=116407
3175
3176         Reviewed by Alex Christensen.
3177
3178         Use WTF's copy of ICU headers.
3179
3180         * Configurations/BaseTarget.xcconfig:
3181
3182 2017-07-03  Brady Eidson  <beidson@apple.com>
3183
3184         Switch all WebKit API related to favicons from WebIconDatabase over to new WebCore::IconLoader mechanism.
3185         https://bugs.webkit.org/show_bug.cgi?id=174073
3186
3187         Reviewed by Andy Estes.
3188
3189         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3190         (WebKit::WebFrameLoaderClient::getLoadDecisionForIcons):
3191         (WebKit::WebFrameLoaderClient::dispatchDidReceiveIcon): Deleted.
3192         (WebKit::WebFrameLoaderClient::registerForIconNotification): Deleted.
3193         (WebKit::WebFrameLoaderClient::getLoadDecisionForIcon): Deleted.
3194         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3195
3196 2017-07-03  Sam Weinig  <sam@webkit.org>
3197
3198         [WebIDL] Remove more unnecessary uses of the preprocessor in idl files
3199         https://bugs.webkit.org/show_bug.cgi?id=174083
3200
3201         Reviewed by Alex Christensen.
3202
3203         * Configurations/FeatureDefines.xcconfig:
3204         Add ENABLE_NAVIGATOR_STANDALONE.
3205
3206 2017-07-03  Matt Lewis  <jlewis3@apple.com>
3207
3208         Unreviewed, rolling out r219083.
3209
3210         The revision caused an API failure on all testing platforms.
3211
3212         Reverted changeset:
3213
3214         "[MediaStream] Protect request and web view during gUM client
3215         callback"
3216         https://bugs.webkit.org/show_bug.cgi?id=174096
3217         http://trac.webkit.org/changeset/219083
3218
3219 2017-07-03  Ryosuke Niwa  <rniwa@webkit.org>
3220
3221         WebContent processes crash when the network process crashes with pending connection requests
3222         https://bugs.webkit.org/show_bug.cgi?id=174065
3223         <rdar://problem/30359835>
3224
3225         Reviewed by Tim Horton.
3226
3227         The bug was caused by the UI process clearing away pending network connection requests whenever the existing
3228         network process crashed. This resulted in WebContent process killing itself inside ensureNetworkProcessConnection.
3229
3230         Fixed the bug by re-launching a new network process when this happens. We don't try to re-launch a new process
3231         if the previous attempt to launch a network process had failed.
3232
3233         This patch splits NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch into networkProcessFailedToLaunch
3234         and networkProcessCrashed to differentiate those two cases, and invoke the respective callbacks in WebProcessPool.
3235
3236         * UIProcess/API/Cocoa/WKProcessPool.mm:
3237         (-[WKProcessPool _networkProcessIdentifier]): Added.
3238         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3239         * UIProcess/Network/NetworkProcessProxy.cpp:
3240         (WebKit::NetworkProcessProxy::networkProcessCrashed): Added.
3241         (WebKit::NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch): Split into the two following functions.
3242         (WebKit::NetworkProcessProxy::networkProcessFailedToLaunch): Extracted from networkProcessCrashedOrFailedToLaunch.
3243         (WebKit::NetworkProcessProxy::clearCallbackStates): Extracted from networkProcessCrashedOrFailedToLaunch
3244         (WebKit::NetworkProcessProxy::didClose): Call networkProcessCrashed.
3245         (WebKit::NetworkProcessProxy::didFinishLaunching): Call networkProcessFailedToLaunch.
3246         * UIProcess/Network/NetworkProcessProxy.h:
3247         * UIProcess/WebProcessPool.cpp:
3248         (WebKit::WebProcessPool::networkProcessCrashed): Start a new network process when there are pending connection
3249         requests the crached network failed to fullfil.
3250         (WebKit::WebProcessPool::networkProcessFailedToLaunch):
3251         * UIProcess/WebProcessPool.h:
3252
3253 2017-07-03  Eric Carlson  <eric.carlson@apple.com>
3254
3255         [MediaStream] Protect request and web view during gUM client callback
3256         https://bugs.webkit.org/show_bug.cgi?id=174096
3257         <rdar://problem/32833102>
3258
3259         Reviewed by Youenn Fablet.
3260
3261         Retain the message and WebView during asynchronous calls so they won't be 
3262         released if a navigation happens during a call to the UA for getUserMedia 
3263         or enumerateMediaDevices.
3264
3265         * UIProcess/Cocoa/UIDelegate.mm:
3266         (WebKit::requestUserMediaAuthorizationForDevices):
3267         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
3268         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
3269
3270 2017-07-03  Andy Estes  <aestes@apple.com>
3271
3272         [Xcode] Add an experimental setting to build with ccache
3273         https://bugs.webkit.org/show_bug.cgi?id=173875
3274
3275         Reviewed by Tim Horton.
3276
3277         * Configurations/DebugRelease.xcconfig: Included ccache.xcconfig.
3278
3279 2017-07-03  Chris Dumez  <cdumez@apple.com>
3280
3281         Drop ResourceLoadStatisticsStore's statisticsLock
3282         https://bugs.webkit.org/show_bug.cgi?id=174080
3283
3284         Reviewed by Brent Fulgham.
3285
3286         Drop ResourceLoadStatisticsStore's statisticsLock. It added complexity and was only needed
3287         do that the SPI exposed to WebKitTestRunner would query the store synchronously from the
3288         main thread. Instead, I made the SPI asynchronous and make sure we always access the store
3289         from the same background thread. As a result, there is no longer any need for locking.
3290
3291         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3292         (-[WKWebsiteDataStore _resourceLoadStatisticsIsPrevalentResource:completionHandler:]):
3293         (-[WKWebsiteDataStore _resourceLoadStatisticsHadUserInteraction:completionHandler:]):
3294         (-[WKWebsiteDataStore _resourceLoadStatisticsIsGrandfathered:completionHandler:]):
3295         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
3296         * UIProcess/Storage/ResourceLoadStatisticsStore.cpp:
3297         (WebKit::ResourceLoadStatisticsStore::isPrevalentResource):
3298         (WebKit::ResourceLoadStatisticsStore::isGrandFathered):
3299         (WebKit::ResourceLoadStatisticsStore::ensureResourceStatisticsForPrimaryDomain):
3300         (WebKit::ResourceLoadStatisticsStore::createEncoderFromData):
3301         (WebKit::ResourceLoadStatisticsStore::readDataFromDecoder):
3302         (WebKit::ResourceLoadStatisticsStore::clearInMemory):
3303         (WebKit::ResourceLoadStatisticsStore::mergeStatistics):
3304         (WebKit::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler):
3305         (WebKit::ResourceLoadStatisticsStore::processStatistics):
3306         (WebKit::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
3307         (WebKit::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry):
3308         (WebKit::ResourceLoadStatisticsStore::updateStatisticsForRemovedDataRecords):
3309         (WebKit::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore):
3310         * UIProcess/Storage/ResourceLoadStatisticsStore.h:
3311         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3312         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
3313         (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
3314         (WebKit::WebResourceLoadStatisticsStore::refreshFromDisk):
3315         (WebKit::WebResourceLoadStatisticsStore::clearInMemoryData):
3316         (WebKit::WebResourceLoadStatisticsStore::submitTelemetry):
3317         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
3318         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
3319         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
3320         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
3321         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
3322         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
3323         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
3324         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
3325         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
3326         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
3327         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
3328         * UIProcess/WebResourceLoadStatisticsStore.h:
3329
3330 2017-07-03  Wenson Hsieh  <wenson_hsieh@apple.com>
3331
3332         Pasting single words copied to UIPasteboard inserts URLs in editable areas
3333         https://bugs.webkit.org/show_bug.cgi?id=174082
3334         <rdar://problem/33046992>
3335
3336         Reviewed by Tim Horton.
3337
3338         Add a hook to WKPreferences to allow programatic pasting.
3339
3340         * UIProcess/API/Cocoa/WKPreferences.mm:
3341         (-[WKPreferences _setDOMPasteAllowed:]):
3342         (-[WKPreferences _domPasteAllowed]):
3343         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3344
3345 2017-07-03  Zan Dobersek  <zdobersek@igalia.com>
3346
3347         Unreviewed GTK+ and WPE build fix when building with GCC 4.9.
3348
3349         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
3350         (WebKit::CoordinatedLayerTreeHost::renderNextFrame): Don't use brace-list
3351         initialization to override the m_forceRepaintAsync struct. Instead, manually
3352         assign the OptionalCallbackID() value to the m_forceRepaintAsync.callbackID
3353         member variable, and override the m_forceRepaintAsync.needsFreshFlush member
3354         variable with `false`.
3355
3356 2017-07-03  Zan Dobersek  <zdobersek@igalia.com>
3357
3358         [ThreadedCompositor] Update and retrieve scene attributes under a Lock
3359         https://bugs.webkit.org/show_bug.cgi?id=173762
3360
3361         Reviewed by Carlos Garcia Campos.
3362
3363         Instead of dispatching separate tasks on the composition run loop, update
3364         various scene attributes by locking a common lock object and updating the
3365         appropriate attribute.
3366
3367         In ThreadedCompositor::renderLayerTree(), where these attributes are used
3368         in scene composition, the lock is again obtained and the attributes copied
3369         into local variables, releasing the lock afterwards. The attribute values
3370         in local copies are then used for that renderLayerTree() invocation.
3371
3372         This approach is more efficient than dispatching separate tasks that can
3373         race against renderLayerTree() dispatches.
3374
3375         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
3376         (WebKit::ThreadedCompositor::ThreadedCompositor):
3377         (WebKit::m_displayRefreshMonitor):
3378         (WebKit::ThreadedCompositor::setScaleFactor):
3379         (WebKit::ThreadedCompositor::setScrollPosition):
3380         (WebKit::ThreadedCompositor::setViewportSize):
3381         (WebKit::ThreadedCompositor::setDrawsBackground):
3382         (WebKit::ThreadedCompositor::renderLayerTree):
3383         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
3384
3385 2017-07-01  Dan Bernstein  <mitz@apple.com>
3386
3387         [iOS] Remove code only needed when building for iOS 9.x
3388         https://bugs.webkit.org/show_bug.cgi?id=174068
3389
3390         Reviewed by Tim Horton.
3391
3392         * Configurations/FeatureDefines.xcconfig:
3393         * Configurations/WebKit.xcconfig:
3394         * Platform/spi/ios/UIKitSPI.h:
3395         * UIProcess/API/Cocoa/WKWebView.mm:
3396         (-[WKWebView dealloc]):
3397         * UIProcess/ios/WKContentViewInteraction.mm:
3398         (-[WKFormInputSession setSuggestions:]):
3399         (-[WKFormInputSession invalidate]):
3400         (-[WKContentView insertTextSuggestion:]):
3401         (contentTypeFromFieldName):
3402         (-[WKContentView textInputTraits]):
3403         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
3404         * WebProcess/WebPage/ios/WebPageIOS.mm:
3405         (WebKit::WebPage::getPositionInformation):
3406         * config.h:
3407
3408 2017-07-01  Brady Eidson  <beidson@apple.com>
3409
3410         When setting a custom cookie storage location on a WKWebsiteDataStore, cookies aren't actually removed.
3411         <rdar://problem/32410662> and https://bugs.webkit.org/show_bug.cgi?id=174035
3412
3413         Reviewed by Alex Christensen.
3414
3415         * UIProcess/API/Cocoa/WKProcessPool.mm:
3416         (-[WKProcessPool _terminateNetworkProcess]):
3417         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3418         
3419         * UIProcess/WebProcessPool.cpp:
3420         (WebKit::WebProcessPool::ensureNetworkProcess): Take an optional WebsiteDataStore. If one is passed in,
3421           send it to either the existing or new network process.
3422         * UIProcess/WebProcessPool.h:
3423         
3424         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
3425         (WebKit::WebsiteDataStore::parameters): Resolve paths first.
3426
3427         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3428         (WebKit::WebsiteDataStore::fetchDataAndApply):
3429         (WebKit::WebsiteDataStore::removeData):
3430
3431 2017-07-01  Ryosuke Niwa  <rniwa@webkit.org>
3432
3433         Frame.h doesn't need to include FrameLoader.h, IntRect.h, and NavigationScheduler.h
3434         https://bugs.webkit.org/show_bug.cgi?id=174004
3435
3436         Reviewed by Simon Fraser.
3437
3438         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
3439         * WebProcess/WebPage/WebInspector.cpp:
3440
3441 2017-07-01  Dan Bernstein  <mitz@apple.com>
3442
3443         [macOS] Remove code only needed when building for OS X Yosemite
3444         https://bugs.webkit.org/show_bug.cgi?id=174067
3445
3446         Reviewed by Tim Horton.
3447
3448         * Configurations/Base.xcconfig:
3449         * Configurations/BaseTarget.xcconfig:
3450         * Configurations/BaseXPCService.xcconfig:
3451         * Configurations/DebugRelease.xcconfig:
3452         * Configurations/FeatureDefines.xcconfig:
3453         * Configurations/NetworkService.xcconfig:
3454         * Configurations/PluginService.32.xcconfig:
3455         * Configurations/PluginService.64.xcconfig:
3456         * Configurations/Version.xcconfig:
3457         * Configurations/WebContentService.xcconfig:
3458         * Configurations/WebKit.xcconfig:
3459         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
3460         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist: Removed.
3461         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3462         (WebKit::NetworkProcessCreationParameters::encode):
3463         (WebKit::NetworkProcessCreationParameters::decode):
3464         * NetworkProcess/NetworkProcessCreationParameters.h:
3465         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3466         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3467         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
3468         * Platform/IPC/Connection.h:
3469         * Platform/IPC/mac/ConnectionMac.mm:
3470         (IPC::Connection::platformInvalidate):
3471         (IPC::Connection::platformInitialize):
3472         (IPC::Connection::open):
3473         (IPC::Connection::exceptionSourceEventHandler): Deleted.
3474         (IPC::Connection::setShouldCloseConnectionOnMachExceptions): Deleted.
3475         * Platform/mac/LayerHostingContext.h:
3476         * Platform/mac/LayerHostingContext.mm:
3477         (WebKit::LayerHostingContext::createFencePort):
3478         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist: Removed.
3479         * PluginProcess/mac/PluginControllerProxyMac.mm:
3480         (WebKit::PluginControllerProxy::updateLayerHostingContext):
3481         * PluginProcess/mac/PluginProcessShim.mm:
3482         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
3483         * Shared/ChildProcess.h:
3484         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
3485         (WebKit::getPluginInfoFromPropertyLists):
3486         (WebKit::NetscapePluginModule::getPluginInfo):
3487         (WebKit::contentsOfPropertyListAtURL): Deleted.
3488         (WebKit::getMIMETypesFromPluginBundle): Deleted.
3489         * Shared/Plugins/PluginProcessCreationParameters.cpp:
3490         (WebKit::PluginProcessCreationParameters::encode):
3491         (WebKit::PluginProcessCreationParameters::decode):
3492         * Shared/Plugins/PluginProcessCreationParameters.h:
3493         * Shared/WebProcessCreationParameters.cpp:
3494         (WebKit::WebProcessCreationParameters::encode):
3495         (WebKit::WebProcessCreationParameters::decode):
3496         * Shared/WebProcessCreationParameters.h:
3497         * Shared/mac/ChildProcessMac.mm:
3498         (WebKit::ChildProcess::setSharedHTTPCookieStorage):
3499         * UIProcess/API/C/WKPage.cpp:
3500         (WKPageSetPageUIClient):
3501         (fixUpBotchedPageUIClient): Deleted.
3502         * UIProcess/ChildProcessProxy.cpp:
3503         (WebKit::ChildProcessProxy::didFinishLaunching):
3504         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3505         (WebKit::WebProcessPool::platformInitializeWebProcess):
3506         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3507         (WebKit::WebProcessPool::resetHSTSHostsAddedAfterDate):
3508         * UIProcess/Cocoa/WebViewImpl.h:
3509         * UIProcess/Cocoa/WebViewImpl.mm:
3510         (WebKit::WebViewImpl::updateLayer):
3511         (WebKit::WebViewImpl::startWindowDrag):
3512         * UIProcess/DrawingAreaProxy.h:
3513         (WebKit::DrawingAreaProxy::waitForPossibleGeometryUpdate): Deleted.
3514         * UIProcess/Plugins/PluginProcessProxy.cpp:
3515         (WebKit::PluginProcessProxy::didFinishLaunching):
3516         * UIProcess/Plugins/PluginProcessProxy.h:
3517         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
3518         (WebKit::PluginProcessProxy::platformInitializePluginProcess):
3519         (WebKit::PluginProcessProxy::createPropertyListFile): Deleted.
3520         * UIProcess/WebPageProxy.cpp:
3521         (WebKit::WebPageProxy::setTopContentInset):
3522         * UIProcess/mac/PageClientImpl.mm:
3523         (WebKit::PageClientImpl::rootViewToWindow):
3524         (WebKit::PageClientImpl::startWindowDrag):
3525         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
3526         (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag):
3527         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
3528         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
3529         (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
3530         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForPossibleGeometryUpdate): Deleted.
3531         * UIProcess/mac/WebInspectorProxyMac.mm:
3532         (WebKit::WebInspectorProxy::createFrontendWindow):
3533         (WebKit::WebInspectorProxy::platformStartWindowDrag):
3534         * UIProcess/mac/WebPopupMenuProxyMac.mm:
3535         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
3536         * WebKit2.xcodeproj/project.pbxproj:
3537         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist: Removed.
3538         * WebProcess/WebPage/WebPage.cpp:
3539         * WebProcess/WebPage/WebPage.h:
3540         * WebProcess/WebPage/WebPage.messages.in:
3541         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
3542         (WebKit::addAnimationToLayer):
3543         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3544         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3545         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3546         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
3547         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
3548         * WebProcess/cocoa/WebProcessCocoa.mm:
3549         (WebKit::WebProcess::platformInitializeWebProcess):
3550         * WebProcess/com.apple.WebProcess.sb.in:
3551
3552 2017-07-01  Chris Dumez  <cdumez@apple.com>
3553
3554         Replace ResourceLoadStatisticsStore C API with Cocoa SPI
3555         https://bugs.webkit.org/show_bug.cgi?id=174060
3556
3557         Reviewed by Brent Fulgham.
3558
3559         Replace ResourceLoadStatisticsStore C API by Cocoa SPI. The new Cocoa SPI is on
3560         WKWebsiteDataStore, which allows us to get rid of the WebResourceLoadStatisticsManager
3561         singleton as the SPI can now interact directly with the WebResourceLoadStatisticsStore.
3562
3563         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: Removed.
3564         * UIProcess/API/C/WKResourceLoadStatisticsManager.h: Removed.
3565         Drop old C API.
3566
3567         * UIProcess/WebResourceLoadStatisticsManager.cpp: Removed.
3568         * UIProcess/WebResourceLoadStatisticsManager.h: Removed.
3569         Drop WebResourceLoadStatisticsManager singleton which was only required by the
3570         C API. This is because the C API was global, rather than working on a specific
3571         store.
3572
3573         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3574         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
3575         Add new Cocoa SPI on WKWebsiteDataStore. This is only used for testing.
3576
3577         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3578         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
3579         Stop registering the store with the WebResourceLoadStatisticsManager singleton,
3580         as this singleton is gone.
3581
3582         * UIProcess/WebsiteData/WebsiteDataStore.h:
3583         (WebKit::WebsiteDataStore::resourceLoadStatistics):
3584         Add new getter to retrieve the WebResourceLoadStatisticsStore from the
3585         WebsiteDataStore. This is needed by the new Cocoa SPI.
3586
3587         * WebKit2.xcodeproj/project.pbxproj:
3588         Drop some files.
3589
3590 2017-06-30  Megan Gardner  <megan_gardner@apple.com>
3591
3592         Unreviewed mac build fix.
3593
3594         * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
3595         * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h:
3596
3597 2017-06-30  Megan Gardner  <megan_gardner@apple.com>
3598
3599         Add API to get WKActivatedElementInfo
3600         https://bugs.webkit.org/show_bug.cgi?id=174001
3601         <rdar://problem/29165518>
3602         
3603         Adding a way to get a WKActivatedElementInfo for a point on a WKWebView.
3604
3605         Reviewed by Tim Horton.
3606
3607         * UIProcess/API/Cocoa/WKWebView.mm:
3608         (-[WKWebView requestActivatedElementAtPosition:completionBlock:]):
3609         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3610         * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
3611         (+[_WKActivatedElementInfo infoWithType:withInteractionInformationAtPosition:]):
3612         (-[_WKActivatedElementInfo infoWithType:withInteractionInformationAtPosition:]):
3613         * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h:
3614
3615 2017-06-30  Tim Horton  <timothy_horton@apple.com>
3616
3617         Use API instead of SPI for content inset adjustment behavior
3618         https://bugs.webkit.org/show_bug.cgi?id=174050
3619
3620         Reviewed by Sam Weinig.
3621
3622         * Platform/spi/ios/UIKitSPI.h:
3623         * UIProcess/ios/WKScrollView.mm:
3624         (-[WKScrollView initWithFrame:]):
3625         (-[WKScrollView setContentInsetAdjustmentBehavior:]):
3626         (-[WKScrollView _setContentInsetAdjustmentBehaviorInternal:]):
3627         (-[WKScrollView _setContentInsetAdjustmentBehavior:]): Deleted.
3628         Switch over to the API. The old SPI calls the API internally, so our
3629         override will now cover all callers.
3630
3631 2017-06-30  Chris Dumez  <cdumez@apple.com>
3632
3633         Move store logic from WebResourceLoadStatisticsManager to WebResourceLoadStatisticsStore
3634         https://bugs.webkit.org/show_bug.cgi?id=174038
3635
3636         Reviewed by Brent Fulgham.
3637
3638         Move store logic from WebResourceLoadStatisticsManager to WebResourceLoadStatisticsStore.
3639         WebResourceLoadStatisticsManager is now essentially a proxy to the
3640         WebResourceLoadStatisticsStore to support the current C API.
3641
3642         In a follow-up, I plan to to replace the C API with a Cocoa SPI which works on a
3643         WebResourceLoadStatisticsStore directly instead of requiring a
3644         WebResourceLoadStatisticsManager singleton.
3645
3646         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
3647         (WKResourceLoadStatisticsManagerSetMinimumTimeBetweenDataRecordsRemoval):
3648         (WKResourceLoadStatisticsManagerResetToConsistentState):
3649         * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
3650         * UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm: Removed.
3651         * UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
3652         (WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):
3653         * UIProcess/WebResourceLoadStatisticsManager.cpp:
3654         (WebKit::WebResourceLoadStatisticsManager::WebResourceLoadStatisticsManager):
3655         (WebKit::WebResourceLoadStatisticsManager::~WebResourceLoadStatisticsManager):
3656         (WebKit::WebResourceLoadStatisticsManager::setStatisticsStore):
3657         (WebKit::WebResourceLoadStatisticsManager::clearInMemoryStore):
3658         (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore):
3659         (WebKit::WebResourceLoadStatisticsManager::logUserInteraction):
3660         (WebKit::WebResourceLoadStatisticsManager::clearUserInteraction):
3661         (WebKit::WebResourceLoadStatisticsManager::hasHadUserInteraction):
3662         (WebKit::WebResourceLoadStatisticsManager::setPrevalentResource):
3663         (WebKit::WebResourceLoadStatisticsManager::isPrevalentResource):
3664         (WebKit::WebResourceLoadStatisticsManager::clearPrevalentResource):
3665         (WebKit::WebResourceLoadStatisticsManager::setGrandfathered):
3666         (WebKit::WebResourceLoadStatisticsManager::isGrandfathered):
3667         (WebKit::WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin):
3668         (WebKit::WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin):
3669         (WebKit::WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo):
3670         (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveUserInteraction):
3671         (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveCookiePartitionFree):
3672         (WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweenDataRecordsRemoval):
3673         (WebKit::WebResourceLoadStatisticsManager::setGrandfatheringTime):
3674         (WebKit::WebResourceLoadStatisticsManager::fireDataModificationHandler):
3675         (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler):
3676         (WebKit::WebResourceLoadStatisticsManager::fireTelemetryHandler):
3677         * UIProcess/WebResourceLoadStatisticsManager.h:
3678         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3679         (WebKit::primaryDomain):
3680         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
3681         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
3682         (WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
3683         (WebKit::WebResourceLoadStatisticsStore::hasHadUserInteraction):
3684         (WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
3685         (WebKit::WebResourceLoadStatisticsStore::isPrevalentResource):
3686         (WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
3687         (WebKit::WebResourceLoadStatisticsStore::setGrandfathered):
3688         (WebKit::WebResourceLoadStatisticsStore::isGrandfathered):
3689         (WebKit::WebResourceLoadStatisticsStore::setSubframeUnderTopFrameOrigin):
3690         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUnderTopFrameOrigin):
3691         (WebKit::WebResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
3692         (WebKit::WebResourceLoadStatisticsStore::fireDataModificationHandler):
3693         (WebKit::WebResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler):
3694         (WebKit::WebResourceLoadStatisticsStore::fireTelemetryHandler):
3695         (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
3696         (WebKit::WebResourceLoadStatisticsStore::clearInMemoryAndPersistent):
3697         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
3698         (WebKit::WebResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
3699         (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweenDataRecordsRemoval):
3700         (WebKit::WebResourceLoadStatisticsStore::setGrandfatheringTime):
3701         * UIProcess/WebResourceLoadStatisticsStore.h:
3702         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3703         (WebKit::WebsiteDataStore::removeData):
3704         * WebKit2.xcodeproj/project.pbxproj:
3705
3706 2017-06-30  John Wilander  <wilander@apple.com>
3707
3708         [WK2] Resource load statistics code is spamming the WebProcess with a test-only message 
3709         https://bugs.webkit.org/show_bug.cgi?id=174048
3710         <rdar://problem/33062376>
3711
3712         Reviewed by Brent Fulgham.
3713
3714         Fix the telemetry data message send so that it is not generated during normal operations.
3715         This is only meant to be used by WebKitTestRunner.
3716
3717         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
3718         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit): 
3719
3720 2017-06-30  Daniel Bates  <dabates@apple.com>
3721
3722         Attempt to fix the WPE build following <https://trac.webkit.org/changeset/219013>
3723         (https://bugs.webkit.org/show_bug.cgi?id=165160)
3724
3725         Update the prototype of UIClient::createNewPage() to take a API::FrameInfo& instead of
3726         a WebFrameProxy* and a const WebCore::SecurityOriginData&.
3727
3728         * UIProcess/API/glib/WebKitUIClient.cpp:
3729
3730 2017-06-30  Alex Christensen  <achristensen@webkit.org>
3731
3732         Stop soft linking with CFNetwork
3733         https://bugs.webkit.org/show_bug.cgi?id=174029
3734
3735         Reviewed by Jer Noble.
3736
3737         * Shared/mac/CookieStorageShim.mm:
3738
3739 2017-06-30  Daniel Bates  <dabates@apple.com>
3740
3741         API::FrameInfo should know the web page that contains the frame; add API property webView to WKFrameInfo
3742         https://bugs.webkit.org/show_bug.cgi?id=165160
3743         <rdar://problem/29451999>
3744
3745         Reviewed by Brady Eidson.
3746
3747         Expose a property on WKFrameInfo to retrieve the WKWebView of the web page that contains the
3748         frame. This will allow an embedding client to know the web view that initiated the navigation
3749         request as well as differentiate between a navigation initiated by web content from one
3750         initiated via API.
3751
3752         The majority of this change is passing the document D that initiated the targeted navigation
3753         or called window.open() through the loading machinery to the FrameLoaderClient. The changes
3754         to pass this information to the FrameLoaderClient when creating a new window are straightforward.
3755         For targeted navigation, the WebKit2 FrameLoaderClient implementation now computes the info
3756         for the originating frame regardless of the navigation type (NavigationAction::type()).
3757         (Currently we only compute the originating frame for hyperlink activated navigations,
3758         form submissions, and form resubmissions). The WebProcess computes the page ID of the page
3759         that contains the originating frame and sends that to the UIProcess so that it can create
3760         an API::FrameInfo for the originating frame and associate the page that contains the frame,
3761         if the navigation was triggered by web content. If the navigation was triggered by API
3762         (e.g. -[WKWebView goBack]) then the created API::FrameInfo does not have an associated page
3763         so that an embedding client can distinguish between a navigation initiated by web content
3764         from a navigation that it initiated via API depending on whether API::FrameInfo::page() is
3765         nullptr. We expose property webView on the Mac and iOS API class WKFrameInfo to return the
3766         WKWebView corresponding to API::FrameInfo::page().
3767
3768         A small change that this patch makes is to have the WebProcess compute the originating frame
3769         info (call WebFrame::info()) and send it over to the UIProcess as opposed to sending the frame
3770         ID of the originating frame and having the UIProcess compute the frame info from it. We do this
3771         because the UIProcess may not be able to compute the frame info for the originating frame if
3772         the window that it was contained in was closed between the time the WebProcess sent the frame
3773         ID to the UIProcess and the UIProcess received it.
3774
3775         * UIProcess/API/APIFrameInfo.cpp:
3776         (API::FrameInfo::create):
3777         (API::FrameInfo::FrameInfo):
3778         (API::FrameInfo::clearPage):
3779         * UIProcess/API/APIFrameInfo.h:
3780         * UIProcess/API/APIUIClient.h:
3781         (API::UIClient::createNewPage):
3782         (API::UIClient::createNewPageAsync):
3783         * UIProcess/API/C/WKPage.cpp:
3784         (WKPageSetPageUIClient):
3785         * UIProcess/API/Cocoa/WKFrameInfo.h:
3786         * UIProcess/API/Cocoa/WKFrameInfo.mm:
3787         (-[WKFrameInfo description]):
3788         (-[WKFrameInfo webView]):
3789         * UIProcess/API/Cocoa/WKUserContentController.mm:
3790         * UIProcess/Cocoa/UIDelegate.h:
3791         * UIProcess/Cocoa/UIDelegate.mm:
3792         (WebKit::UIDelegate::UIClient::createNewPageCommon):
3793         (WebKit::UIDelegate::UIClient::createNewPage):
3794         (WebKit::UIDelegate::UIClient::createNewPageAsync):
3795         * UIProcess/WebPageProxy.cpp:
3796         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3797         (WebKit::WebPageProxy::createNewPage):
3798         * UIProcess/WebPageProxy.h:
3799         * UIProcess/WebPageProxy.messages.in:
3800         * WebProcess/Plugins/PluginView.cpp:
3801         (WebKit::PluginView::loadURL):
3802         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3803         (WebKit::WebChromeClient::createWindow):
3804         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3805         (WebKit::WebFrameLoaderClient::dispatchCreatePage):
3806         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3807         * WebProcess/WebPage/WebInspector.cpp:
3808         (WebKit::WebInspector::openInNewTab):
3809
3810 2017-06-29  Jer Noble  <jer.noble@apple.com>
3811
3812         Make Legacy EME API controlled by RuntimeEnabled setting.
3813         https://bugs.webkit.org/show_bug.cgi?id=173994
3814
3815         Reviewed by Sam Weinig.
3816
3817         Add a new WKWebViewConfiguration property, as well as a new WKPreferences function, both able to control
3818         WebCore's new RuntimeEnabledFeature setting for the Legacy EME API.
3819
3820         * Configurations/FeatureDefines.xcconfig:
3821         * Shared/WebPreferencesDefinitions.h:
3822         * UIProcess/API/C/WKPreferences.cpp:
3823         (WKPreferencesGetLegacyEncryptedMediaAPIEnabled):
3824         (WKPreferencesSetLegacyEncryptedMediaAPIEnabled):
3825         * UIProcess/API/C/WKPreferencesRef.h:
3826         * UIProcess/API/Cocoa/WKWebView.mm:
3827         (-[WKWebView _initializeWithConfiguration:]):
3828         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3829         (-[WKWebViewConfiguration init]):
3830         (-[WKWebViewConfiguration copyWithZone:]):
3831         (-[WKWebViewConfiguration _setLegacyEncryptedMediaAPIEnabled:]):
3832         (-[WKWebViewConfiguration _legacyEncryptedMediaAPIEnabled]):
3833         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3834         * WebProcess/WebPage/WebPage.cpp:
3835         (WebKit::WebPage::updatePreferences):
3836
3837 2017-06-30  Jer Noble  <jer.noble@apple.com>
3838
3839         REGRESSION (r218757): Touch Bar's media scrubber timeline runs from 00:00 to 00:00 and has no playhead
3840         https://bugs.webkit.org/show_bug.cgi?id=174032
3841
3842         Reviewed by Eric Carlson.
3843
3844         Fix a copypasta error where durationChange notifications were changing the value of muted.
3845
3846         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
3847         (WebKit::WebPlaybackSessionManagerProxy::durationChanged):
3848
3849 2017-06-30  Chris Dumez  <cdumez@apple.com>
3850
3851         Move ResourceLoadStatisticsStore to WebKit2/UIProcess
3852         https://bugs.webkit.org/show_bug.cgi?id=174033
3853
3854         Reviewed by Brent Fulgham.
3855
3856         Move ResourceLoadStatisticsStore to WebKit2/UIProcess since it is only
3857         used in the WebKit2 UIProcess.
3858
3859         * CMakeLists.txt:
3860         * UIProcess/Storage/ResourceLoadStatisticsStore.cpp: Renamed from Source/WebCore/loader/ResourceLoadStatisticsStore.cpp.
3861         (WebKit::ResourceLoadStatisticsStore::createEncoderFromData):
3862         (WebKit::ResourceLoadStatisticsStore::readDataFromDecoder):
3863         (WebKit::ResourceLoadStatisticsStore::clearInMemory):
3864         (WebKit::ResourceLoadStatisticsStore::clearInMemoryAndPersistent):
3865         (WebKit::ResourceLoadStatisticsStore::mergeStatistics):
3866         (WebKit::ResourceLoadStatisticsStore::fireDataModificationHandler):
3867         (WebKit::ResourceLoadStatisticsStore::fireTelemetryHandler):
3868         (WebKit::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler):
3869         (WebKit::ResourceLoadStatisticsStore::processStatistics):
3870         (WebKit::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry):
3871         (WebKit::ResourceLoadStatisticsStore::shouldRemoveDataRecords):
3872         (WebKit::ResourceLoadStatisticsStore::dataRecordsBeingRemoved):
3873         (WebKit::ResourceLoadStatisticsStore::dataRecordsWereRemoved):
3874         (WebKit::ResourceLoadStatisticsStore::statisticsLock):
3875         * UIProcess/Storage/ResourceLoadStatisticsStore.h: Renamed from Source/WebCore/loader/ResourceLoadStatisticsStore.h.
3876         * UIProcess/WebResourceLoadStatisticsManager.cpp:
3877         (WebKit::primaryDomain):
3878         * UIProcess/WebResourceLoadStatisticsManager.h:
3879         * UIProcess/WebResourceLoadStatisticsStore.h:
3880         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
3881         * UIProcess/WebResourceLoadStatisticsTelemetry.h:
3882         * WebKit2.xcodeproj/project.pbxproj:
3883
3884 2017-06-30  Ryosuke Niwa  <rniwa@webkit.org>
3885
3886         Ran sort-Xcode-project-file.
3887
3888         * WebKit2.xcodeproj/project.pbxproj:
3889
3890 2017-06-30  Chris Dumez  <cdumez@apple.com>
3891
3892         ResourceLoadObserver does not need a ResourceLoadStatisticsStore
3893         https://bugs.webkit.org/show_bug.cgi?id=174013
3894
3895         Reviewed by Brent Fulgham.
3896
3897         ResourceLoadObserver does not need a ResourceLoadStatisticsStore. ResourceLoadStatisticsStore is too complicated for its needs.
3898         ResourceLoadStatisticsStore can then be moved to WebKit2/UIProcess in a follow-up.
3899
3900         * WebProcess/WebProcess.cpp:
3901         (WebKit::m_webSQLiteDatabaseTracker):
3902         (WebKit::WebProcess::statisticsChangedTimerFired):
3903         * WebProcess/WebProcess.h:
3904
3905 2017-06-30  Brent Fulgham  <bfulgham@apple.com>
3906
3907         [WK2][iOS][macOS] Update XPC services process launch dictionary
3908         https://bugs.webkit.org/show_bug.cgi?id=173995
3909         <rdar://problem/32797264>
3910
3911         Reviewed by Alex Christensen.
3912
3913         Update the WebProcess and Plugin Process XPC launch dictionaries to activate
3914         improved ALSR features when launching.
3915
3916         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
3917         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
3918         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist:
3919
3920 2017-06-30  Chris Dumez  <cdumez@apple.com>
3921
3922         Merge WebResourceLoadStatisticsManager and WebResourceLoadObserver
3923         https://bugs.webkit.org/show_bug.cgi?id=174008
3924
3925         Reviewed by Brent Fulgham.
3926
3927         Merge WebResourceLoadStatisticsManager and WebResourceLoadObserver. One was basically
3928         a proxy to the other.
3929
3930         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
3931         (WKResourceLoadStatisticsManagerSetPrevalentResource):
3932         (WKResourceLoadStatisticsManagerIsPrevalentResource):
3933         (WKResourceLoadStatisticsManagerSetHasHadUserInteraction):
3934         (WKResourceLoadStatisticsManagerIsHasHadUserInteraction):
3935         (WKResourceLoadStatisticsManagerSetGrandfathered):
3936         (WKResourceLoadStatisticsManagerIsGrandfathered):
3937         (WKResourceLoadStatisticsManagerSetSubframeUnderTopFrameOrigin):
3938         (WKResourceLoadStatisticsManagerSetSubresourceUnderTopFrameOrigin):
3939         (WKResourceLoadStatisticsManagerSetSubresourceUniqueRedirectTo):
3940         (WKResourceLoadStatisticsManagerSetTimeToLiveUserInteraction):
3941         (WKResourceLoadStatisticsManagerSetTimeToLiveCookiePartitionFree):
3942         (WKResourceLoadStatisticsManagerSetMinimumTimeBetweeenDataRecordsRemoval):
3943         (WKResourceLoadStatisticsManagerSetGrandfatheringTime):
3944         (WKResourceLoadStatisticsManagerFireDataModificationHandler):
3945         (WKResourceLoadStatisticsManagerFireShouldPartitionCookiesHandler):
3946         (WKResourceLoadStatisticsManagerFireShouldPartitionCookiesHandlerForOneDomain):
3947         (WKResourceLoadStatisticsManagerFireTelemetryHandler):
3948         (WKResourceLoadStatisticsManagerSetNotifyPagesWhenDataRecordsWereScanned):
3949         (WKResourceLoadStatisticsManagerSetShouldClassifyResourcesBeforeDataRecordsRemoval):
3950         (WKResourceLoadStatisticsManagerSetNotifyPagesWhenTelemetryWasCaptured):
3951         (WKResourceLoadStatisticsManagerSetShouldSubmitTelemetry):
3952         (WKResourceLoadStatisticsManagerClearInMemoryAndPersistentStore):
3953         (WKResourceLoadStatisticsManagerClearInMemoryAndPersistentStoreModifiedSinceHours):
3954         (WKResourceLoadStatisticsManagerResetToConsistentState):
3955         * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
3956         * UIProcess/Cocoa/WebResourceLoadStatisticsManagerCocoa.mm:
3957         (WebKit::WebResourceLoadStatisticsManager::registerUserDefaultsIfNeeded):
3958         * UIProcess/WebResourceLoadObserver.cpp: Removed.
3959         * UIProcess/WebResourceLoadObserver.h: Removed.
3960         * UIProcess/WebResourceLoadStatisticsManager.cpp:
3961         (WebKit::primaryDomain):
3962         (WebKit::WebResourceLoadStatisticsManager::shared):
3963         (WebKit::WebResourceLoadStatisticsManager::setStatisticsStore):
3964         (WebKit::WebResourceLoadStatisticsManager::setStatisticsQueue):
3965         (WebKit::WebResourceLoadStatisticsManager::clearInMemoryStore):
3966         (WebKit::WebResourceLoadStatisticsManager::clearInMemoryAndPersistentStore):
3967         (WebKit::WebResourceLoadStatisticsManager::logUserInteraction):
3968         (WebKit::WebResourceLoadStatisticsManager::clearUserInteraction):
3969         (WebKit::WebResourceLoadStatisticsManager::hasHadUserInteraction):
3970         (WebKit::WebResourceLoadStatisticsManager::setPrevalentResource):
3971         (WebKit::WebResourceLoadStatisticsManager::isPrevalentResource):
3972         (WebKit::WebResourceLoadStatisticsManager::clearPrevalentResource):
3973         (WebKit::WebResourceLoadStatisticsManager::setGrandfathered):
3974         (WebKit::WebResourceLoadStatisticsManager::isGrandfathered):
3975         (WebKit::WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin):
3976         (WebKit::WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin):
3977         (WebKit::WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo):
3978         (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveUserInteraction):
3979         (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveCookiePartitionFree):
3980         (WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval):
3981         (WebKit::WebResourceLoadStatisticsManager::setGrandfatheringTime):
3982         (WebKit::WebResourceLoadStatisticsManager::fireDataModificationHandler):
3983         (WebKit::WebResourceLoadStatisticsManager::fireShouldPartitionCookiesHandler):
3984         (WebKit::WebResourceLoadStatisticsManager::fireTelemetryHandler):
3985         * UIProcess/WebResourceLoadStatisticsManager.h:
3986         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3987         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
3988         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3989         (WebKit::WebsiteDataStore::removeData):
3990         * WebKit2.xcodeproj/project.pbxproj:
3991
3992 2017-06-30  Wenson Hsieh  <wenson_hsieh@apple.com>
3993
3994         [iOS DnD] Drag caret rect is incorrectly computed when dropping in editable content in iframes
3995         https://bugs.webkit.org/show_bug.cgi?id=174017
3996         <rdar://problem/32959782>
3997
3998         Reviewed by Simon Fraser.
3999
4000         Send the drag caret rect in root view coordinates over to the UI process.
4001
4002         * UIProcess/API/Cocoa/WKWebView.mm:
4003         (-[WKWebView _dragCaretRect]):
4004         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
4005
4006         Add basic test plumbing to fetch the current drag caret rect.
4007
4008         * WebProcess/WebPage/WebPage.cpp:
4009         (WebKit::WebPage::performDragControllerAction):
<