[WinCairo] Fix build after rev 222610
[WebKit.git] / Source / WebKit / ChangeLog
1 2017-09-28  Ryosuke Niwa  <rniwa@webkit.org>
2
3         Image pasting is not working on tineye.com / gmail.com / GitHub.com due to lack of support for DataTransfer.items
4         https://bugs.webkit.org/show_bug.cgi?id=170449
5         <rdar://problem/31432525>
6
7         Reviewed by Wenson Hsieh.
8
9         Add sandbox extensions for files in the pasteboard to make copying & pasting image files work.
10         This is what we do for drag & drop but we should consider adding a mechanism to rekoke the extension in the future.
11
12         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
13         (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType): Add sandbox extensions to the pasted files.
14         * UIProcess/WebPasteboardProxy.h:
15         * UIProcess/WebPasteboardProxy.messages.in:
16         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
17         (WebKit::WebPlatformStrategies::getPathnamesForType): Consume the sandbox tokens sent by the UI process permanently
18         since WebCore will now create File objects for these pasted files.
19
20 2017-09-29  Wenson Hsieh  <wenson_hsieh@apple.com>
21
22         [iOS WK2] Implement -[WKContentView hasText] for compatibility with the UITextInput protocol
23         https://bugs.webkit.org/show_bug.cgi?id=177662
24         <rdar://problem/33410373>
25
26         Reviewed by Tim Horton.
27
28         Implements -[WKContentView hasText] by propagating a flag through post-layout editor state.
29
30         * Shared/EditorState.cpp:
31         (WebKit::EditorState::PostLayoutData::encode const):
32         (WebKit::EditorState::PostLayoutData::decode):
33         * Shared/EditorState.h:
34
35         Add a new flag to EditorState indicating whether or not the current editable root containing the selection has
36         any plain text. Add IPC support for this new flag.
37
38         * UIProcess/ios/WKContentViewInteraction.mm:
39         (-[WKContentView hasText]):
40         * WebProcess/WebPage/ios/WebPageIOS.mm:
41         (WebKit::computeEditableRootHasContentAndPlainText):
42
43         Add a new helper to compute whether or not the editable root has any content, and any plain text. This
44         is used as the last cached value for -hasText on WKContentView that we will deliver to UIKit. Some important
45         things to note here:
46         - If post layout data already indicates that we have selected some plain text, or that there is a plain text
47           character near the selection, just set the flags to true and bail, since the editable root necessarily has
48           content that is plain text.
49         - If hasContent is false, don't even bother computing hasPlainText, because it must also be false.
50         - Otherwise, use hasAnyPlainText to compute the value of hasPlainText, which is a faster variant of plainText.
51         These optimizations help us avoid doing extra work at all when running Speedometer, apart from checking the
52         values of a few PostLayoutData flags. This also fixes the value of hasContent, which was previously always false
53         if we had a range selection rather than a caret selection even when the editable root has content, because the
54         logic to compute the value of hasContent only existed in the branch where we have a caret selection.
55
56         (WebKit::WebPage::platformEditorState const):
57
58 2017-09-28  Timothy Horton  <timothy_horton@apple.com>
59
60         Fix the macOS CMake build
61
62         * CMakeLists.txt:
63
64 2017-09-28  Timothy Horton  <timothy_horton@apple.com>
65
66         Revise deployment target macros from r222620
67
68         Rubber-stamped by Wenson Hsieh.
69
70         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
71         * WebProcess/Plugins/PDF/PDFPlugin.mm:
72         (WebKit::PDFPlugin::pdfDocumentDidLoad):
73
74 2017-09-28  Aishwarya Nirmal  <anirmal@apple.com>
75
76         Request for PDF URL targets for specific pages, sections, etc.
77         https://bugs.webkit.org/show_bug.cgi?id=177582
78         <rdar://problem/5692679>
79
80         Reviewed by Tim Horton.
81         
82         This change sets the URL fragment for scroll anchoring in PDFs.
83
84         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
85         * WebProcess/Plugins/PDF/PDFPlugin.mm:
86         (WebKit::PDFPlugin::pdfDocumentDidLoad):
87
88 2017-09-28  Ross Kirsling  <ross.kirsling@sony.com>
89
90         [PAL] Move HysteresisActivity into PAL
91         https://bugs.webkit.org/show_bug.cgi?id=177516
92
93         Reviewed by Alex Christensen.
94
95         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
96         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::PendingFrameLoad):
97         * Shared/WebSQLiteDatabaseTracker.cpp:
98         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
99         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
100         * Shared/WebSQLiteDatabaseTracker.h:
101         * WebProcess/WebPage/WebPage.cpp:
102         (WebKit::m_pageScrolledHysteresis):
103         (WebKit::m_userActivityHysteresis):
104         (WebKit::WebPage::updateUserActivity):
105         * WebProcess/WebPage/WebPage.h:
106         * WebProcess/WebProcess.cpp:
107         (WebKit::WebProcess::WebProcess):
108         * WebProcess/WebProcess.h:
109
110 2017-09-28  Chris Dumez  <cdumez@apple.com>
111
112         Add support for <link rel=preconnect>
113         https://bugs.webkit.org/show_bug.cgi?id=177474
114         <rdar://problem/33141380>
115
116         Reviewed by Alex Christensen.
117
118         Add support for <link rel=preconnect>:
119         - https://w3c.github.io/resource-hints/#preconnect
120
121         Also add corresponding native private API.
122
123         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
124         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
125         (WebKit::NetworkConnectionToWebProcess::didFinishPreconnection):
126         * NetworkProcess/NetworkConnectionToWebProcess.h:
127         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
128         * NetworkProcess/NetworkDataTask.cpp:
129         (WebKit::NetworkDataTask::create):
130         * NetworkProcess/NetworkLoadParameters.h:
131         * NetworkProcess/NetworkProcess.cpp:
132         (WebKit::NetworkProcess::preconnectTo):
133         * NetworkProcess/NetworkProcess.h:
134         * NetworkProcess/NetworkProcess.messages.in:
135         * NetworkProcess/PreconnectTask.cpp: Added.
136         (WebKit::PreconnectTask::PreconnectTask):
137         (WebKit::PreconnectTask::~PreconnectTask):
138         (WebKit::PreconnectTask::willPerformHTTPRedirection):
139         (WebKit::PreconnectTask::didReceiveChallenge):
140         (WebKit::PreconnectTask::didReceiveResponseNetworkSession):
141         (WebKit::PreconnectTask::didReceiveData):
142         (WebKit::PreconnectTask::didCompleteWithError):
143         (WebKit::PreconnectTask::didSendData):
144         (WebKit::PreconnectTask::wasBlocked):
145         (WebKit::PreconnectTask::cannotShowURL):
146         (WebKit::PreconnectTask::didFinish):
147         * NetworkProcess/PreconnectTask.h: Copied from Source/WebKit/NetworkProcess/NetworkLoadParameters.h.
148         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
149         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
150         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
151         * Shared/WebCoreArgumentCoders.h:
152         * Shared/WebPreferencesDefinitions.h:
153         * UIProcess/API/C/WKContext.cpp:
154         (WKContextPreconnectToServer):
155         * UIProcess/API/C/WKContextPrivate.h:
156         * UIProcess/API/Cocoa/WKProcessPool.mm:
157         (-[WKProcessPool _preconnectToServer:]):
158         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
159         * UIProcess/WebProcessPool.cpp:
160         (WebKit::WebProcessPool::preconnectToServer):
161         * UIProcess/WebProcessPool.h:
162         * WebKit.xcodeproj/project.pbxproj:
163         * WebProcess/Network/NetworkProcessConnection.cpp:
164         (WebKit::NetworkProcessConnection::didFinishPreconnection):
165         * WebProcess/Network/NetworkProcessConnection.h:
166         * WebProcess/Network/NetworkProcessConnection.messages.in:
167         * WebProcess/Network/WebLoaderStrategy.cpp:
168         (WebKit::WebLoaderStrategy::networkProcessCrashed):
169         (WebKit::generateLoadIdentifier):
170         (WebKit::WebLoaderStrategy::startPingLoad):
171         (WebKit::WebLoaderStrategy::preconnectTo):
172         (WebKit::WebLoaderStrategy::didFinishPreconnection):
173         * WebProcess/Network/WebLoaderStrategy.h:
174         * WebProcess/WebPage/WebPage.cpp:
175         (WebKit::WebPage::updatePreferences):
176         * config.h:
177
178 2017-09-28  Zan Dobersek  <zdobersek@igalia.com>
179
180         [Cairo] Remove the cairo_glyph_t complexity from GlyphBuffer
181         https://bugs.webkit.org/show_bug.cgi?id=177598
182
183         Reviewed by Carlos Garcia Campos.
184
185         * Shared/API/c/cairo/WKImageCairo.cpp: Explicitly include the <cairo.h>
186         header here now that it's not included in GlyphBuffer.h.
187         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp: Ditto.
188
189 2017-09-27  Alex Christensen  <achristensen@webkit.org>
190
191         Add WKContentRuleList notify action type
192         https://bugs.webkit.org/show_bug.cgi?id=177013
193         <rdar://problem/31073936>
194
195         Reviewed by Darin Adler.
196
197         * NetworkProcess/PingLoad.cpp:
198         (WebKit::PingLoad::processContentExtensionRulesForLoad):
199         * UIProcess/API/APINavigationClient.h:
200         (API::NavigationClient::contentRuleListNotification):
201         * UIProcess/API/C/WKPage.cpp:
202         (WKPageSetPageNavigationClient):
203         * UIProcess/API/C/WKPageNavigationClient.h:
204         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
205         * UIProcess/Cocoa/NavigationState.h:
206         * UIProcess/Cocoa/NavigationState.mm:
207         (WebKit::NavigationState::setNavigationDelegate):
208         (WebKit::NavigationState::NavigationClient::contentRuleListNotification):
209         * UIProcess/WebPageProxy.cpp:
210         (WebKit::WebPageProxy::contentRuleListNotification):
211         * UIProcess/WebPageProxy.h:
212         * UIProcess/WebPageProxy.messages.in:
213         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
214         (WebKit::WebChromeClient::contentRuleListNotification):
215         * WebProcess/WebCoreSupport/WebChromeClient.h:
216
217 2017-09-27  Wenson Hsieh  <wenson_hsieh@apple.com>
218
219         Drag event DataTransfer has unexpected types "dyn.ah62d4..."
220         https://bugs.webkit.org/show_bug.cgi?id=172526
221         <rdar://problem/32396081>
222
223         Reviewed by Ryosuke Niwa.
224
225         Add boilerplate plumbing and encoder/decoder support for new pasteboard codepaths. See WebCore ChangeLog for
226         more details.
227
228         * Scripts/webkit/messages.py:
229         (headers_for_type):
230         * Shared/WebCoreArgumentCoders.cpp:
231         (IPC::ArgumentCoder<PasteboardCustomData>::encode):
232         (IPC::ArgumentCoder<PasteboardCustomData>::decode):
233
234         Add encoder/decoder support for PasteboardCustomData.
235
236         (IPC::ArgumentCoder<PasteboardWebContent>::encode):
237         (IPC::ArgumentCoder<PasteboardWebContent>::decode):
238
239         Encode and decode dataInHTMLFormat.
240
241         * Shared/WebCoreArgumentCoders.h:
242         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
243         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
244         (WebKit::WebPasteboardProxy::writeCustomData):
245         * UIProcess/WebPasteboardProxy.cpp:
246         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
247         (WebKit::WebPasteboardProxy::writeCustomData):
248         * UIProcess/WebPasteboardProxy.h:
249         * UIProcess/WebPasteboardProxy.messages.in:
250         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
251         (WebKit::WebPlatformStrategies::typesSafeForDOMToReadAndWrite):
252         (WebKit::WebPlatformStrategies::writeCustomData):
253         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
254
255 2017-09-27  Alex Christensen  <achristensen@webkit.org>
256
257         Allow modern decoding of std::optional<T>
258         https://bugs.webkit.org/show_bug.cgi?id=177519
259
260         Reviewed by Tim Horton.
261
262         * Platform/IPC/ArgumentCoders.h:
263         (IPC::ArgumentCoder<std::optional<T>>::decode):
264         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
265         (IPC::ArgumentCoder<WebCore::PaymentAuthorizationResult>::decode):
266         (IPC::ArgumentCoder<WebCore::PaymentError>::decode):
267         (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):
268         (IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::decode):
269         (IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::decode):
270         * Shared/WebCoreArgumentCoders.cpp:
271         (IPC::ArgumentCoder<IntPoint>::decode):
272         (IPC::ArgumentCoder<IntSize>::decode):
273         * Shared/WebCoreArgumentCoders.h:
274         * Shared/WebPageCreationParameters.cpp:
275         (WebKit::WebPageCreationParameters::decode):
276
277 2017-09-27  Commit Queue  <commit-queue@webkit.org>
278
279         Unreviewed, rolling out r222541.
280         https://bugs.webkit.org/show_bug.cgi?id=177580
281
282         WebCore isn't ready for the asynchronousness this was going to
283         enable (Requested by alexchristensen on #webkit).
284
285         Reverted changeset:
286
287         "Pass a completion handler instead of a
288         WebFramePolicyListenerProxy during policy decisions"
289         https://bugs.webkit.org/show_bug.cgi?id=177509
290         http://trac.webkit.org/changeset/222541
291
292 2017-09-27  Tina Liu  <iting_liu@apple.com>
293
294         Expose setShouldSuppressFirstResponderChanges() as WKView SPI
295         https://bugs.webkit.org/show_bug.cgi?id=177513
296         <rdar://problem/34669220>
297
298         Reviewed by Wenson Hsieh.
299
300         We already have setShouldSuppressFirstResponderChanges() SPI on WKWebView; Expose it on
301         WKView as well for clients using legacy WebKit.
302
303         * UIProcess/API/Cocoa/WKViewPrivate.h:
304         * UIProcess/API/mac/WKView.mm:
305         (-[WKView _setShouldSuppressFirstResponderChanges:]):
306
307 2017-09-27  Chris Dumez  <cdumez@apple.com>
308
309         Have PingLoad take a CompletionHandler
310         https://bugs.webkit.org/show_bug.cgi?id=177549
311
312         Reviewed by Youenn Fablet.
313
314         Have PingLoad take a CompletionHandler instead of relying on it calling on method on the
315         NetworkConnectionToWebProcess when it is done.
316
317         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
318         (WebKit::NetworkConnectionToWebProcess::loadPing):
319         * NetworkProcess/PingLoad.cpp:
320         (WebKit::PingLoad::PingLoad):
321         (WebKit::PingLoad::didFinish):
322         * NetworkProcess/PingLoad.h:
323
324 2017-09-26  Alex Christensen  <achristensen@webkit.org>
325
326         Pass a completion handler instead of a WebFramePolicyListenerProxy during policy decisions
327         https://bugs.webkit.org/show_bug.cgi?id=177509
328
329         Reviewed by Tim Horton.
330
331         This makes WebFramePolicyListenerProxy just a wrapper around a WTF::Function which is only needed for the C and glib APIs.
332         This is a step towards making WebPageProxy::DecidePolicyForResponseSync and WebPageProxy::DecidePolicyForNavigationAction asynchronous.
333
334         This patch has no change in behavior.
335
336         * CMakeLists.txt:
337         * UIProcess/API/APINavigationClient.h:
338         (API::NavigationClient::decidePolicyForNavigationAction):
339         (API::NavigationClient::decidePolicyForNavigationResponse):
340         * UIProcess/API/APIPolicyClient.h:
341         (API::PolicyClient::decidePolicyForNavigationAction):
342         (API::PolicyClient::decidePolicyForNewWindowAction):
343         (API::PolicyClient::decidePolicyForResponse):
344         * UIProcess/API/C/WKFramePolicyListener.cpp:
345         (WKFramePolicyListenerUseWithPolicies):
346         * UIProcess/API/C/WKPage.cpp:
347         (WKPageSetPagePolicyClient):
348         (WKPageSetPageNavigationClient):
349         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
350         * UIProcess/API/glib/WebKitPolicyClient.cpp:
351         * UIProcess/Automation/WebAutomationSession.cpp:
352         * UIProcess/Cocoa/NavigationState.h:
353         * UIProcess/Cocoa/NavigationState.mm:
354         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
355         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
356         * UIProcess/Cocoa/WebViewImpl.mm:
357         * UIProcess/RemoteWebInspectorProxy.cpp:
358         * UIProcess/WebFormSubmissionListenerProxy.h:
359         * UIProcess/WebFrameListenerProxy.cpp: Removed.
360         * UIProcess/WebFrameListenerProxy.h: Removed.
361         * UIProcess/WebFramePolicyListenerProxy.cpp:
362         (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
363         (WebKit::WebFramePolicyListenerProxy::~WebFramePolicyListenerProxy):
364         (WebKit::WebFramePolicyListenerProxy::create):
365         (WebKit::WebFramePolicyListenerProxy::use):
366         (WebKit::WebFramePolicyListenerProxy::download):
367         (WebKit::WebFramePolicyListenerProxy::ignore):
368         * UIProcess/WebFramePolicyListenerProxy.h:
369         (WebKit::WebFramePolicyListenerProxy::create): Deleted.
370         (): Deleted.
371         (WebKit::WebFramePolicyListenerProxy::operator new): Deleted.
372         * UIProcess/WebFrameProxy.cpp:
373         (WebKit::WebFrameProxy::webProcessWillShutDown):
374         (WebKit::WebFrameProxy::receivedPolicyDecision): Deleted.
375         (WebKit::WebFrameProxy::setUpPolicyListenerProxy): Deleted.
376         * UIProcess/WebFrameProxy.h:
377         * UIProcess/WebInspectorProxy.cpp:
378         * UIProcess/WebPageProxy.cpp:
379         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
380         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
381         (WebKit::WebPageProxy::decidePolicyForResponseSync):
382         (WebKit::WebPageProxy::receivedPolicyDecision): Deleted.
383         (WebKit::WebPageProxy::decidePolicyForResponse): Deleted.
384         * UIProcess/WebPageProxy.h:
385         * UIProcess/mac/ViewGestureControllerMac.mm:
386         * WebKit.xcodeproj/project.pbxproj:
387
388 2017-09-26  Brian Burg  <bburg@apple.com>
389
390         Web Automation: overflow:hidden elements with no children are mistakenly reported as not visible
391         https://bugs.webkit.org/show_bug.cgi?id=177514
392         <rdar://problem/31936291>
393
394         Reviewed by Joseph Pecoraro.
395
396         * UIProcess/Automation/atoms/ElementDisplayed.js:
397         (isShown.isElementSubtreeHiddenByOverflow):
398         Array.prototype.every returns true when passed an empty list, so we need
399         to check for the case where the element has no children and return 'false'.
400
401 2017-09-26  Youenn Fablet  <youenn@apple.com>
402
403         [Cocoa] Add a modern WKPreferences switch to disable WebRTC
404         https://bugs.webkit.org/show_bug.cgi?id=176638
405         <rdar://problem/34335158>
406
407         Reviewed by Alex Christensen.
408
409         * UIProcess/API/Cocoa/WKPreferences.mm:
410         (-[WKPreferences _peerConnectionEnabled]):
411         (-[WKPreferences _setPeerConnectionEnabled:]):
412         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
413
414 2017-09-26  Brent Fulgham  <bfulgham@apple.com>
415
416         Harden our access to the vector of URL schemes.
417         https://bugs.webkit.org/show_bug.cgi?id=177470
418         <rdar://problem/33881522>
419
420         Reviewed by Chris Dumez.
421
422         Instead of asserting, use MESSAGE_CHECK so that we actually refuse to access an invalid iterator.
423
424         * UIProcess/WebPageProxy.cpp:
425         (WebKit::WebPageProxy::startURLSchemeTask):
426         (WebKit::WebPageProxy::stopURLSchemeTask):
427
428 2017-09-26  Jer Noble  <jer.noble@apple.com>
429
430         Thrown ObjC exception when right clicking on <img> containing mp4 link
431         https://bugs.webkit.org/show_bug.cgi?id=177370
432
433         Reviewed by Darin Adler.
434
435         Creating a NSImage from mp4 data will fail and return nil; do a nil-check before attempting
436         to put the results into a NSMutableArray.
437
438         * UIProcess/mac/WebContextMenuProxyMac.mm:
439         (WebKit::WebContextMenuProxyMac::createShareMenuItem):
440
441 2017-09-26  Brian Burg  <bburg@apple.com>
442
443         Web Automation: add commands to get and set user permissions for pages in an automation session
444         https://bugs.webkit.org/show_bug.cgi?id=177405
445         <rdar://problem/34493846>
446
447         Reviewed by Joseph Pecoraro.
448
449         To test some Web APIs via WebDriver, it needs to be possible to simulate a user accepting or
450         denying requests for elevated permissions, such as getUserMedia() or geolocation.
451
452         This patch adds a generic way for a test to configure the automation session's
453         simulated user action that will happen every time a specific permission is requested.
454         A test can set a "session permission", trigger the permission request via Web API,
455         and then verify that the page behaves correctly when the user accepted or denied the request.
456
457         A proposal will follow shortly to expose this functionality via a new REST API endpoint.
458
459         * UIProcess/Automation/Automation.json: Add get/set commands.
460
461         * UIProcess/Automation/WebAutomationSession.cpp:
462         (WebKit::WebAutomationSession::getSessionPermissions):
463         (WebKit::WebAutomationSession::setSessionPermissions):
464         For now, store the permission value in a member of the session. The getUserMedia
465         permission only needs a bool, but there is no reason we couldn't use more complicated
466         values for permissions (i.e., strings, numbers, arrays, objects) someday.
467
468         (WebKit::WebAutomationSession::shouldAllowGetUserMediaForPage const):
469         Expose the specific decision to be taken based on whether the request is allowed or denied.
470
471         * UIProcess/Automation/WebAutomationSession.h:
472         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
473         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
474         If the page is under automation, then simulate the user action according to the
475         current values of permissions set for the session.
476
477 2017-09-25  Alex Christensen  <achristensen@webkit.org>
478
479         Make PolicyAction an encodable enum class
480         https://bugs.webkit.org/show_bug.cgi?id=177480
481
482         Reviewed by Antti Koivisto.
483
484         * NetworkProcess/Downloads/DownloadManager.cpp:
485         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
486         (WebKit::DownloadManager::cancelDownload):
487         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
488         (WebKit::NetworkCORSPreflightChecker::didReceiveResponseNetworkSession):
489         * NetworkProcess/NetworkDataTask.cpp:
490         (WebKit::NetworkDataTask::didReceiveResponse):
491         * NetworkProcess/NetworkDataTaskBlob.cpp:
492         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
493         * NetworkProcess/NetworkLoad.cpp:
494         (WebKit::NetworkLoad::~NetworkLoad):
495         (WebKit::NetworkLoad::continueDidReceiveResponse):
496         (WebKit::NetworkLoad::notifyDidReceiveResponse):
497         * NetworkProcess/PingLoad.cpp:
498         (WebKit::PingLoad::didReceiveResponseNetworkSession):
499         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
500         (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):
501         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
502         (toNSURLSessionResponseDisposition):
503         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
504         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
505         * Scripts/webkit/messages.py:
506         (headers_for_type):
507         * UIProcess/WebFormSubmissionListenerProxy.h:
508         * UIProcess/WebFrameListenerProxy.h:
509         (WebKit::WebFrameListenerProxy::navigation): Deleted.
510         * UIProcess/WebFramePolicyListenerProxy.cpp:
511         (WebKit::WebFramePolicyListenerProxy::use):
512         (WebKit::WebFramePolicyListenerProxy::download):
513         (WebKit::WebFramePolicyListenerProxy::ignore):
514         * UIProcess/WebPageProxy.cpp:
515         (WebKit::WebPageProxy::receivedPolicyDecision):
516         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
517         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
518         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
519         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
520         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
521         * WebProcess/WebPage/WebFrame.cpp:
522         (WebKit::WebFrame::invalidatePolicyListener):
523         * WebProcess/WebPage/WebPage.cpp:
524         (WebKit::WebPage::didReceivePolicyDecision):
525         * WebProcess/WebPage/WebPage.h:
526         * WebProcess/WebPage/WebPage.messages.in:
527
528 2017-09-25  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
529
530         [WinCairo] Share default value of font family preferences among non-cocoa builds
531         https://bugs.webkit.org/show_bug.cgi?id=177479
532
533         Reviewed by Yusuke Suzuki.
534
535         * Shared/WebPreferencesDefinitions.h:
536
537 2017-09-25  Frederik Riedel  <riedel@apple.com>
538
539         Expose way to set values of classified form controls as {Legacy WebKit, WebKit} SPI
540         https://bugs.webkit.org/show_bug.cgi?id=174394
541         <rdar://problem/33183504>
542
543         Reviewed by Ryosuke Niwa.
544
545         * Platform/spi/ios/UIKitSPI.h:
546         * Shared/AssistedNodeInformation.cpp:
547         (WebKit::AssistedNodeInformation::encode const):
548         Encodes additional node information, including if the node is part of a login screen.
549         (WebKit::AssistedNodeInformation::decode):
550         Decodes the additional assisted node information.
551         * Shared/AssistedNodeInformation.h:
552         * UIProcess/WebPageProxy.h:
553         * UIProcess/ios/WKContentView.mm:
554         (-[WKContentView acceptsAutofilledLoginCredentials]):
555         Determines if the WKContentView shows a login screen.
556         (-[WKContentView representingPageUrl]):
557         Returns the URL of the currently displayed web page.
558         * UIProcess/ios/WKContentViewInteraction.mm:
559         (-[WKContentView insertTextSuggestion:]):
560         Inserts the login credentials into the Web View.
561         * UIProcess/ios/WebPageProxyIOS.mm:
562         (WebKit::WebPageProxy::startAssistingNode):
563         Transfer the additional assistednode information (acceptsAutofilledLoginCredentials and representingPageUrl).
564         (WebKit::WebPageProxy::acceptsAutofilledLoginCredentials):
565         Returns if the Web View shows a login screen.
566         (WebKit::WebPageProxy::representingPageUrl):
567         Returns the Web View's URL.
568         (WebKit::WebPageProxy::autofillLoginCredentials):
569         Insert the credentials into the Web View.
570         * WebProcess/WebPage/WebPage.h:
571         * WebProcess/WebPage/WebPage.messages.in:
572         * WebProcess/WebPage/ios/WebPageIOS.mm:
573         (WebKit::WebPage::getAssistedNodeInformation): Transports the information if the currently
574         highlighted node accepts autofilled login credentials.
575         (WebKit::WebPage::autofillLoginCredentials): Fills the login credentials into the
576         WebPage.
577
578 2017-09-25  Youenn Fablet  <youenn@apple.com>
579
580         WebRTC video does not resume receiving when switching back to Safari 11 on iOS
581         https://bugs.webkit.org/show_bug.cgi?id=175472
582         <rdar://problem/33860863>
583
584         Reviewed by Darin Adler.
585
586         Notifying LibWebRTC of backgrounding/foregrouding.
587
588         * WebProcess/WebPage/ios/WebPageIOS.mm:
589         (WebKit::WebPage::applicationDidEnterBackground):
590         (WebKit::WebPage::applicationWillEnterForeground):
591
592 2017-09-25  Sam Weinig  <sam@webkit.org>
593
594         Remove unused EditorClient functions
595         https://bugs.webkit.org/show_bug.cgi?id=177463
596
597         Reviewed by Alex Christensen.
598
599         Remove unused EditorClient functions.
600
601         * WebProcess/WebCoreSupport/WebEditorClient.h:
602         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
603         (WebKit::WebEditorClient::canonicalizeURL): Deleted.
604         (WebKit::WebEditorClient::canonicalizeURLString): Deleted.
605         (WebKit::WebEditorClient::writeDataToPasteboard): Deleted.
606         (WebKit::WebEditorClient::supportedPasteboardTypesForCurrentSelection): Deleted.
607         (WebKit::WebEditorClient::readDataFromPasteboard): Deleted.
608         (WebKit::WebEditorClient::pasteboardChangeCount): Deleted.
609         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
610         (WebKit::WebEditorClient::canonicalizeURL): Deleted.
611         (WebKit::WebEditorClient::canonicalizeURLString): Deleted.
612
613 2017-09-25  Alex Christensen  <achristensen@webkit.org>
614
615         Make Attribute an enum class
616         https://bugs.webkit.org/show_bug.cgi?id=177414
617
618         Reviewed by Yusuke Suzuki.
619
620         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
621         (WebKit::JSNPObject::getOwnPropertySlot):
622
623 2017-09-25  Alex Christensen  <achristensen@webkit.org>
624
625         Stop using PolicyCallback
626         https://bugs.webkit.org/show_bug.cgi?id=176088
627
628         Reviewed by Andy Estes.
629
630         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
631         * WebProcess/WebPage/WebFrame.cpp:
632         (WebKit::WebFrame::invalidatePolicyListener):
633         * WebProcess/WebPage/WebFrame.h:
634         * WebProcess/WebPage/WebInspector.cpp:
635
636 2017-09-25  Chris Dumez  <cdumez@apple.com>
637
638         [WK2] Add API to query if a download was user-initiated
639         https://bugs.webkit.org/show_bug.cgi?id=177435
640         <rdar://problem/34498422>
641
642         Reviewed by Alex Christensen.
643
644         Add C and Cocoa private API to query if a download was user-initiated.
645
646         For clarity, we now construct navigation object for subframe loads
647         as well (we used to do so only for main frame loads). This allows us
648         to store the user-intiated flag and the redirect chain on the navigation
649         object instead of the WebFrameProxy.
650
651         * UIProcess/API/APINavigation.cpp:
652         (API::Navigation::Navigation):
653         (API::Navigation::appendRedirectionURL):
654         * UIProcess/API/APINavigation.h:
655         (API::Navigation::takeRedirectChain):
656         (API::Navigation::setWasUserInitiated):
657         (API::Navigation::wasUserInitiated const):
658         * UIProcess/API/C/WKDownload.cpp:
659         (WKDownloadGetWasUserInitiated):
660         * UIProcess/API/C/WKDownload.h:
661         * UIProcess/API/Cocoa/_WKDownload.h:
662         * UIProcess/API/Cocoa/_WKDownload.mm:
663         (-[_WKDownload wasUserInitiated]):
664         * UIProcess/Downloads/DownloadProxy.h:
665         (WebKit::DownloadProxy::setWasUserInitiated):
666         (WebKit::DownloadProxy::wasUserInitiated const):
667         * UIProcess/WebFrameProxy.cpp:
668         (WebKit::WebFrameProxy::didStartProvisionalLoad):
669         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad):
670         (WebKit::WebFrameProxy::didFailProvisionalLoad):
671         (WebKit::WebFrameProxy::didFinishLoad):
672         (WebKit::WebFrameProxy::didFailLoad):
673         * UIProcess/WebFrameProxy.h:
674         (WebKit::WebFrameProxy::title const):
675         * UIProcess/WebPageProxy.cpp:
676         (WebKit::WebPageProxy::receivedPolicyDecision):
677         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
678         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
679         (WebKit::WebPageProxy::decidePolicyForResponse):
680         (WebKit::WebPageProxy::decidePolicyForResponseSync):
681         * UIProcess/WebPageProxy.h:
682         * UIProcess/WebPageProxy.messages.in:
683         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
684         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
685
686 2017-09-25  Chris Dumez  <cdumez@apple.com>
687
688         Make StoredCredentials an enum class and rename its header
689         https://bugs.webkit.org/show_bug.cgi?id=177455
690
691         Reviewed by Youenn Fablet.
692
693         Make StoredCredentials an enum class and rename its header for clarity. This was error-prone because 0 meant
694         "allow" and and 1 meant "do not allow". It was trivial to convert it to a boolean by mistake and get the
695         opposite behavior.
696
697         * NetworkProcess/Downloads/DownloadManager.cpp:
698         (WebKit::DownloadManager::startDownload):
699         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
700         (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
701         * NetworkProcess/NetworkCORSPreflightChecker.h:
702         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
703         (WebKit::NetworkConnectionToWebProcess::loadPing):
704         * NetworkProcess/NetworkDataTask.cpp:
705         (WebKit::NetworkDataTask::create):
706         (WebKit::NetworkDataTask::NetworkDataTask):
707         * NetworkProcess/NetworkDataTask.h:
708         * NetworkProcess/NetworkDataTaskBlob.cpp:
709         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
710         * NetworkProcess/NetworkLoad.cpp:
711         (WebKit::NetworkLoad::shouldUseCredentialStorage):
712         * NetworkProcess/NetworkLoadParameters.h:
713         * NetworkProcess/NetworkResourceLoadParameters.cpp:
714         (WebKit::NetworkResourceLoadParameters::encode const):
715         (WebKit::NetworkResourceLoadParameters::decode):
716         * NetworkProcess/PingLoad.cpp:
717         (WebKit::PingLoad::willPerformHTTPRedirection):
718         (WebKit::PingLoad::makeCrossOriginAccessRequest):
719         (WebKit::PingLoad::makeSimpleCrossOriginAccessRequest):
720         (WebKit::PingLoad::makeCrossOriginAccessRequestWithPreflight):
721         (WebKit::PingLoad::preflightSuccess):
722         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
723         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
724         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
725         (WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay):
726         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
727         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
728         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
729         (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
730         (WebKit::NetworkDataTaskCocoa::tryPasswordBasedAuthentication):
731         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
732         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
733         (-[WKNetworkSessionDelegate existingTask:]):
734         (WebKit::NetworkSessionCocoa::dataTaskForIdentifier):
735         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
736         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
737         (WebKit::NetworkDataTaskSoup::createRequest):
738         (WebKit::NetworkDataTaskSoup::authenticate):
739         (WebKit::NetworkDataTaskSoup::continueAuthenticate):
740         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
741         * NetworkProcess/soup/NetworkDataTaskSoup.h:
742         * WebProcess/Network/WebLoaderStrategy.cpp:
743         (WebKit::WebLoaderStrategy::scheduleLoad):
744         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
745         (WebKit::WebLoaderStrategy::startPingLoad):
746         * WebProcess/Network/WebLoaderStrategy.h:
747
748 2017-09-25  Sam Weinig  <sam@webkit.org>
749
750         Remove unnecessary userVisibleString EditorClient function
751         https://bugs.webkit.org/show_bug.cgi?id=177456
752
753         Reviewed by Dan Bernstein.
754
755         * WebProcess/WebCoreSupport/WebEditorClient.h:
756         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
757         (WebKit::WebEditorClient::userVisibleString): Deleted.
758         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
759         (WebKit::WebEditorClient::userVisibleString): Deleted.
760
761             Remove userVisibleString client function.
762
763 2017-09-25  Commit Queue  <commit-queue@webkit.org>
764
765         Unreviewed, rolling out r222455.
766         https://bugs.webkit.org/show_bug.cgi?id=177460
767
768         broke iOS build (Requested by alexchristensen on #webkit).
769
770         Reverted changeset:
771
772         "Add WKContentRuleList notify action type"
773         https://bugs.webkit.org/show_bug.cgi?id=177013
774         http://trac.webkit.org/changeset/222455
775
776 2017-09-25  Alex Christensen  <achristensen@webkit.org>
777
778         Separate form submission from PolicyChecker infrastructure
779         https://bugs.webkit.org/show_bug.cgi?id=177396
780
781         Reviewed by Geoffrey Garen.
782
783         * UIProcess/API/APIFormClient.h:
784         (API::FormClient::willSubmitForm):
785         * UIProcess/API/Cocoa/WKWebView.mm:
786         (-[WKWebView _setInputDelegate:]):
787         * UIProcess/WebFormClient.cpp:
788         (WebKit::WebFormClient::willSubmitForm):
789         * UIProcess/WebFormClient.h:
790         * UIProcess/WebFormSubmissionListenerProxy.cpp:
791         (WebKit::WebFormSubmissionListenerProxy::continueSubmission):
792         (WebKit::WebFormSubmissionListenerProxy::WebFormSubmissionListenerProxy): Deleted.
793         * UIProcess/WebFormSubmissionListenerProxy.h:
794         (WebKit::WebFormSubmissionListenerProxy::create):
795         (WebKit::WebFormSubmissionListenerProxy::WebFormSubmissionListenerProxy):
796         (): Deleted.
797         (WebKit::WebFormSubmissionListenerProxy::operator new): Deleted.
798         * UIProcess/WebFrameProxy.cpp:
799         (WebKit::WebFrameProxy::setUpFormSubmissionListenerProxy): Deleted.
800         * UIProcess/WebFrameProxy.h:
801         * UIProcess/WebPageProxy.cpp:
802         (WebKit::WebPageProxy::willSubmitForm):
803         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
804         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
805         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
806         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
807         * WebProcess/WebPage/WebFrame.cpp:
808         (WebKit::WebFrame::setUpWillSubmitFormListener):
809         (WebKit::WebFrame::continueWillSubmitForm):
810         * WebProcess/WebPage/WebFrame.h:
811         * WebProcess/WebPage/WebPage.cpp:
812         (WebKit::WebPage::continueWillSubmitForm):
813         * WebProcess/WebPage/WebPage.h:
814         * WebProcess/WebPage/WebPage.messages.in:
815
816 2017-09-25  Alex Christensen  <achristensen@webkit.org>
817
818         Add WKContentRuleList notify action type
819         https://bugs.webkit.org/show_bug.cgi?id=177013
820         <rdar://problem/31073936>
821
822         Reviewed by Darin Adler.
823
824         * NetworkProcess/PingLoad.cpp:
825         (WebKit::PingLoad::processContentExtensionRulesForLoad):
826         * UIProcess/API/APINavigationClient.h:
827         (API::NavigationClient::contentRuleListNotification):
828         * UIProcess/API/C/WKPage.cpp:
829         (WKPageSetPageNavigationClient):
830         * UIProcess/API/C/WKPageNavigationClient.h:
831         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
832         * UIProcess/Cocoa/NavigationState.h:
833         * UIProcess/Cocoa/NavigationState.mm:
834         (WebKit::NavigationState::setNavigationDelegate):
835         (WebKit::NavigationState::NavigationClient::contentRuleListNotification):
836         * UIProcess/WebPageProxy.cpp:
837         (WebKit::WebPageProxy::contentRuleListNotification):
838         * UIProcess/WebPageProxy.h:
839         * UIProcess/WebPageProxy.messages.in:
840         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
841         (WebKit::WebChromeClient::contentRuleListNotification):
842         * WebProcess/WebCoreSupport/WebChromeClient.h:
843
844 2017-09-25  Timothy Horton  <timothy_horton@apple.com>
845
846         Make progress on getting Mac CMake building again
847         https://bugs.webkit.org/show_bug.cgi?id=177443
848
849         Unreviewed, just "fixing" the build.
850
851         * PlatformMac.cmake:
852         Add some missing files and include paths.
853
854 2017-09-24  Michael Catanzaro  <mcatanzaro@igalia.com>
855
856         Viewport fit is no longer experimental
857         https://bugs.webkit.org/show_bug.cgi?id=177417
858
859         Reviewed by Darin Adler.
860
861         * Shared/WebPreferencesDefinitions.h:
862
863 2017-09-24  Michael Catanzaro  <mcatanzaro@igalia.com>
864
865         [GTK] Unreviewed, move webkit_hit_test_result_context_is_scrollbar in documentation
866
867         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
868
869 2017-09-24  Michael Catanzaro  <mcatanzaro@igalia.com>
870
871         Alphabetize experimental features list
872         https://bugs.webkit.org/show_bug.cgi?id=177374
873
874         Reviewed by Darin Adler.
875
876         * Shared/WebPreferencesDefinitions.h:
877
878 2017-09-24  Zan Dobersek  <zdobersek@igalia.com>
879
880         [WebKit] Changing EME setting through InjectedBundle should update WebPreferencesStore
881         https://bugs.webkit.org/show_bug.cgi?id=177312
882
883         Reviewed by Carlos Garcia Campos.
884
885         When enabling EME through the InjectedBundle for testing purposes, it's
886         only enabled in RuntimeEnabledFeatures, but not in WebPreferencesStore.
887         This causes failures on imported W3C tests that cover EME persistent
888         state licenses and perform parts of that test in a new window, where
889         the original RuntimeEnabledFeatures state doesn't have any effect.
890
891         To avoid those failures, when enabling EME feature for testing purposes
892         through InjectedBundle, the feature should also be enabled in the
893         WebPreferencesStore.
894
895         * WebProcess/InjectedBundle/InjectedBundle.cpp:
896         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
897
898 2017-09-22  Zalan Bujtas  <zalan@apple.com>
899
900         WeakPtrFactory should populate m_ref lazily.
901         https://bugs.webkit.org/show_bug.cgi?id=177375
902
903         Reviewed by Geoffrey Garen.
904
905         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
906         (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy):
907         (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard):
908         (WebKit::WebPaymentCoordinatorProxy::openPaymentSetup):
909         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
910         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
911         * UIProcess/ApplicationStateTracker.mm:
912         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
913         * UIProcess/Cocoa/WebViewImpl.h:
914         (WebKit::WebViewImpl::createWeakPtr):
915         * UIProcess/Cocoa/WebViewImpl.mm:
916         (WebKit::WebViewImpl::WebViewImpl):
917         * UIProcess/Launcher/ProcessLauncher.cpp:
918         (WebKit::ProcessLauncher::ProcessLauncher):
919         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
920         (WebKit::ProcessLauncher::launchProcess):
921         * UIProcess/ProcessAssertion.h:
922         (WebKit::ProcessAssertion::createWeakPtr):
923         * UIProcess/WebPageProxy.cpp:
924         (WebKit::m_configurationPreferenceValues):
925         (WebKit::m_weakPtrFactory): Deleted.
926         * UIProcess/WebPageProxy.h:
927         (WebKit::WebPageProxy::createWeakPtr const):
928         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
929         (WebKit::RemoteLayerTreeDrawingArea::createWeakPtr):
930         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
931         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
932
933 2017-09-22  John Wilander  <wilander@apple.com>
934
935         Re-enable configuration.HTTPCookieStorage on session without credentials
936         https://bugs.webkit.org/show_bug.cgi?id=177393
937
938         This patch rolls back the crucial change to the network session
939         without credentials that landed in r221632:
940         <http://trac.webkit.org/changeset/221632>
941
942         Reviewed by Brent Fulgham.
943
944         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
945         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
946             Commented out the disabled cookie jar and added a FIXME
947             referring to https://bugs.webkit.org/show_bug.cgi?id=177394.
948
949 2017-09-22  Chris Dumez  <cdumez@apple.com>
950
951         Enable File and Directory Entries API at runtime
952         https://bugs.webkit.org/show_bug.cgi?id=176616
953         <rdar://problem/34330942>
954
955         Reviewed by Geoffrey Garen.
956
957         Enable File and Directory Entries API at runtime on Mac/WebKit2,
958         now that DataTransfer.items is enabled there.
959
960         * Shared/WebPreferencesDefinitions.h:
961
962 2017-09-22  Matt Lewis  <jlewis3@apple.com>
963
964         Unreviewed, rolling out r222394.
965
966         This broke the Windows Debug Build.
967
968         Reverted changeset:
969
970         "Remove build-webkit's notion of feature flags having a
971         default value"
972         https://bugs.webkit.org/show_bug.cgi?id=177338
973         http://trac.webkit.org/changeset/222394
974
975 2017-09-22  John Wilander  <wilander@apple.com>
976
977         Non-prevalent resources should be allowed access to existing cookies in a third-party context
978         https://bugs.webkit.org/show_bug.cgi?id=177336
979         <rdar://problem/34578257>
980
981         Reviewed by Brent Fulgham.
982
983         This patch restructures what is communicated to the network process,
984         from two vectors - with user interaction and without user interaction -
985         to three vectors - to partition, to block, to neither partition nor block.
986         The previous two vectors did not allow proper categorization into which
987         domains should be partitioned, blocked, or left alone. That was the cause
988         of the regression where non-prevalent third-party domains erroneously had
989         their cookies blocked when they should fall back to the old behavior of
990         access but no new cookies allowed to be set.
991
992         * NetworkProcess/NetworkProcess.cpp:
993         (WebKit::NetworkProcess::updatePrevalentDomainsToPartitionOrBlockCookies):
994         (WebKit::NetworkProcess::updatePrevalentDomainsWithAndWithoutInteraction): Deleted.
995         * NetworkProcess/NetworkProcess.h:
996         * NetworkProcess/NetworkProcess.messages.in:
997         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
998         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
999         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1000         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1001         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
1002         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
1003         (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
1004         (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies const):
1005         (WebKit::WebResourceLoadStatisticsStore::shouldBlockCookies const):
1006         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
1007         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
1008         (WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains):
1009         (WebKit::WebResourceLoadStatisticsStore::resetCookiePartitioningState):
1010         * UIProcess/WebResourceLoadStatisticsStore.h:
1011         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1012         (WebKit::WebsiteDataStore::updatePrevalentDomainsToPartitionOrBlockCookies):
1013         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
1014         (WebKit::WebsiteDataStore::updatePrevalentDomainsWithAndWithoutInteraction): Deleted.
1015         * UIProcess/WebsiteData/WebsiteDataStore.h:
1016
1017 2017-09-22  Tim Horton <timothy_horton@apple.com> and Michael Catanzaro <mcatanzaro@igalia.com>
1018
1019         Remove build-webkit's notion of feature flags having a default value
1020         https://bugs.webkit.org/show_bug.cgi?id=177338
1021
1022         Reviewed by Alex Christensen.
1023
1024         Use ENABLE_EXPERIMENTAL_FEATURES instead of ENABLE_DEVELOPER_MODE to enable runtime
1025         experimental features.
1026
1027         * Shared/WebPreferencesDefinitions.h:
1028
1029 2017-09-22  Chris Dumez  <cdumez@apple.com>
1030
1031         Use high resolution timestamp for event time
1032         https://bugs.webkit.org/show_bug.cgi?id=154246
1033         <rdar://problem/34333304>
1034
1035         Reviewed by Ryosuke Niwa.
1036
1037         Use WallTime / MonotonicTime instead of double type for clarity.
1038
1039         * Shared/WebCoreArgumentCoders.cpp:
1040         (IPC::ArgumentCoder<WallTime>::encode):
1041         (IPC::ArgumentCoder<WallTime>::decode):
1042         * Shared/WebCoreArgumentCoders.h:
1043         * Shared/WebEvent.cpp:
1044         (WebKit::WebEvent::WebEvent):
1045         * Shared/WebEvent.h:
1046         (WebKit::WebEvent::timestamp const):
1047         (WebKit::WebTouchEvent::WebTouchEvent):
1048         * Shared/WebKeyboardEvent.cpp:
1049         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
1050         * Shared/WebMouseEvent.cpp:
1051         (WebKit::WebMouseEvent::WebMouseEvent):
1052         * Shared/WebTouchEvent.cpp:
1053         (WebKit::WebTouchEvent::WebTouchEvent):
1054         * Shared/WebWheelEvent.cpp:
1055         (WebKit::WebWheelEvent::WebWheelEvent):
1056         * Shared/gtk/WebEventFactory.cpp:
1057         (WebKit::WebEventFactory::createWebMouseEvent):
1058         (WebKit::WebEventFactory::createWebWheelEvent):
1059         (WebKit::WebEventFactory::createWebKeyboardEvent):
1060         (WebKit::WebEventFactory::createWebTouchEvent):
1061         * Shared/ios/NativeWebTouchEventIOS.mm:
1062         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
1063         * Shared/ios/WebIOSEventFactory.mm:
1064         (WebIOSEventFactory::createWebKeyboardEvent):
1065         * Shared/mac/NativeWebGestureEventMac.mm:
1066         (WebKit::NativeWebGestureEvent::NativeWebGestureEvent):
1067         * Shared/mac/WebEventFactory.mm:
1068         (WebKit::WebEventFactory::createWebMouseEvent):
1069         (WebKit::WebEventFactory::createWebWheelEvent):
1070         (WebKit::WebEventFactory::createWebKeyboardEvent):
1071         * Shared/mac/WebGestureEvent.h:
1072         (WebKit::WebGestureEvent::WebGestureEvent):
1073         * Shared/wpe/WebEventFactory.cpp:
1074         (WebKit::WebEventFactory::createWebKeyboardEvent):
1075         (WebKit::WebEventFactory::createWebMouseEvent):
1076         (WebKit::WebEventFactory::createWebWheelEvent):
1077         (WebKit::WebEventFactory::createWebTouchEvent):
1078         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1079         (WKBundlePageSimulateMouseDown):
1080         (WKBundlePageSimulateMouseUp):
1081         (WKBundlePageSimulateMouseMotion):
1082         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1083         (WebKit::PDFPlugin::showContextMenuAtPoint):
1084         * WebProcess/Plugins/PluginView.cpp:
1085         (WebKit::PluginView::createWebEvent const):
1086         * WebProcess/WebPage/WebPage.cpp:
1087         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
1088         (WebKit::WebPage::contextMenuAtPointInWindow):
1089         (WebKit::WebPage::dragEnded):
1090         (WebKit::WebPage::simulateMouseDown):
1091         (WebKit::WebPage::simulateMouseUp):
1092         (WebKit::WebPage::simulateMouseMotion):
1093         * WebProcess/WebPage/WebPage.h:
1094         * WebProcess/WebPage/ios/WebPageIOS.mm:
1095         (WebKit::WebPage::handleSyntheticClick):
1096         (WebKit::WebPage::completeSyntheticClick):
1097         (WebKit::WebPage::requestAdditionalItemsForDragSession):
1098         (WebKit::WebPage::inspectorNodeSearchMovedToPosition):
1099
1100 2017-09-22  Fujii Hironori  <Hironori.Fujii@sony.com>
1101
1102         [GTK] Web Inspector: Can't load three.js
1103         https://bugs.webkit.org/show_bug.cgi?id=177340
1104
1105         Reviewed by Carlos Garcia Campos.
1106
1107         * PlatformGTK.cmake: Add JS files of three.js to InspectorFiles variable.
1108         * PlatformWPE.cmake: Ditto.
1109
1110 2017-09-21  Ryosuke Niwa  <rniwa@webkit.org>
1111
1112         Enable dataTransfer.items on macOS and iOS
1113         https://bugs.webkit.org/show_bug.cgi?id=177335
1114
1115         Reviewed by Sam Weinig.
1116
1117         * Shared/WebPreferencesDefinitions.h:
1118
1119 2017-09-21  Dan Bernstein  <mitz@apple.com>
1120
1121         Try to fix Apple internal builds with the iOS 11.0 SDK.
1122
1123         * Configurations/WebKit.xcconfig: Disable framework header postprocessing for iOS 11.0.
1124
1125 2017-09-21  Chris Dumez  <cdumez@apple.com>
1126
1127         Regression(r222308): new API tests are failing for !NETWORK_SESSION
1128         https://bugs.webkit.org/show_bug.cgi?id=177321
1129
1130         Reviewed by Alex Christensen.
1131
1132         When a load is redirected and then converted into a download, CFNetwork
1133         seems to call [NSURLDownloadDelegate willSendRequest:] on the download
1134         with a non-nil redirectResponse, which was unexpected.
1135
1136         To address the issue, we now ignore the willSendRequest call if the
1137         new request's URL is the same as the redirectResponse one.
1138
1139         * NetworkProcess/Downloads/mac/DownloadMac.mm:
1140         (-[WKDownloadAsDelegate download:willSendRequest:redirectResponse:]):
1141
1142 2017-09-21  Chris Dumez  <cdumez@apple.com>
1143
1144         Unreviewed, drop assertion added in r222308.
1145
1146         The assertion is hit by a couple of tests still but there is no bad effect
1147         to the vector not being empty at this point since we clear it right after.
1148
1149         * UIProcess/WebFrameProxy.cpp:
1150         (WebKit::WebFrameProxy::didStartProvisionalLoad):
1151
1152 2017-09-21  Chris Dumez  <cdumez@apple.com>
1153
1154         [WK2] Add API to get the redirect chain of a WKDownload
1155         https://bugs.webkit.org/show_bug.cgi?id=176628
1156         <rdar://problem/34338279>
1157
1158         Reviewed by Alex Christensen.
1159
1160         Re-enable assertion initially added in r222308 and later disabled in
1161         r222320. The assertion was hit because we failed to clear the redirect
1162         chain in WebFrameProxy::didFailProvisionalLoad().
1163
1164         * UIProcess/WebFrameProxy.cpp:
1165         (WebKit::WebFrameProxy::didStartProvisionalLoad):
1166         (WebKit::WebFrameProxy::didFailProvisionalLoad):
1167
1168 2017-09-21  Alex Christensen  <achristensen@webkit.org>
1169
1170         REGRESSION(r221465) WKWebViews without WebGL delegate callbacks crash when WebGL contexts are created
1171         https://bugs.webkit.org/show_bug.cgi?id=177306
1172         <rdar://problem/34351988>
1173
1174         Reviewed by Chris Dumez.
1175
1176         * UIProcess/Cocoa/NavigationState.mm:
1177         (WebKit::NavigationState::NavigationClient::webGLLoadPolicy const):
1178         (WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const):
1179         I forgot to early return after calling the default completion handler if there's no delegate selector.
1180
1181 2017-09-21  Chris Dumez  <cdumez@apple.com>
1182
1183         Unreviewed, temporarily disable assertion added in r222308 while I investigate.
1184
1185         * UIProcess/WebFrameProxy.cpp:
1186         (WebKit::WebFrameProxy::didStartProvisionalLoad):
1187
1188 2017-09-20  Stephan Szabo  <stephan.szabo@sony.com>
1189
1190         [Win] WTF: Add alias for process id to use in place of direct uses of pid_t
1191         https://bugs.webkit.org/show_bug.cgi?id=177017
1192
1193         Reviewed by Alex Christensen.
1194
1195         * NetworkProcess/NetworkProcessCreationParameters.h:
1196         * Shared/WebProcessCreationParameters.h:
1197         * UIProcess/API/APIProcessPoolConfiguration.h:
1198         * UIProcess/API/C/WKContext.cpp:
1199         (WKContextGetNetworkProcessIdentifier):
1200         (WKContextGetDatabaseProcessIdentifier):
1201         * UIProcess/API/C/WKContextPrivate.h:
1202         * UIProcess/API/C/WKPage.cpp:
1203         (WKPageGetProcessIdentifier):
1204         * UIProcess/API/C/WKPagePrivate.h:
1205         * UIProcess/ChildProcessProxy.h:
1206         (WebKit::ChildProcessProxy::processIdentifier const):
1207         * UIProcess/Launcher/ProcessLauncher.cpp:
1208         (WebKit::ProcessLauncher::didFinishLaunchingProcess):
1209         * UIProcess/Launcher/ProcessLauncher.h:
1210         (WebKit::ProcessLauncher::processIdentifier const):
1211         * UIProcess/ProcessAssertion.cpp:
1212         (WebKit::ProcessAssertion::ProcessAssertion):
1213         (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
1214         * UIProcess/ProcessAssertion.h:
1215         (WebKit::ProcessAssertion::ProcessAssertion):
1216         * UIProcess/ProcessThrottler.cpp:
1217         (WebKit::ProcessThrottler::didConnectToProcess):
1218         * UIProcess/ProcessThrottler.h:
1219         * UIProcess/WebPageProxy.cpp:
1220         (WebKit::WebPageProxy::processIdentifier const):
1221         * UIProcess/WebPageProxy.h:
1222         * UIProcess/WebProcessPool.cpp:
1223         (WebKit::WebProcessPool::networkProcessIdentifier):
1224         (WebKit::WebProcessPool::storageProcessIdentifier):
1225         * UIProcess/WebProcessPool.h:
1226
1227 2017-09-20  Chris Dumez  <cdumez@apple.com>
1228
1229         [WK2] Add API to get the redirect chain of a WKDownload
1230         https://bugs.webkit.org/show_bug.cgi?id=176628
1231         <rdar://problem/34338279>
1232
1233         Reviewed by Alex Christensen.
1234
1235         Add API to get the redirect chain of a WKDwnload. The redirect chain includes redirects
1236         that happened during initial load, before the load was converted into a download.
1237
1238         * UIProcess/API/C/WKDownload.cpp:
1239         (WKDownloadCopyRedirectChain):
1240         * UIProcess/API/C/WKDownload.h:
1241         * UIProcess/API/Cocoa/_WKDownload.h:
1242         * UIProcess/API/Cocoa/_WKDownload.mm:
1243         (-[_WKDownload originatingWebView]):
1244         (-[_WKDownload redirectChain]):
1245         * UIProcess/Downloads/DownloadProxy.cpp:
1246         (WebKit::DownloadProxy::willSendRequest):
1247         * UIProcess/Downloads/DownloadProxy.h:
1248         (WebKit::DownloadProxy::setRedirectChain):
1249         (WebKit::DownloadProxy::redirectChain const):
1250         * UIProcess/WebFrameProxy.cpp:
1251         (WebKit::WebFrameProxy::didStartProvisionalLoad):
1252         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad):
1253         * UIProcess/WebFrameProxy.h:
1254         (WebKit::WebFrameProxy::redirectChain const):
1255         * UIProcess/WebPageProxy.cpp:
1256         (WebKit::WebPageProxy::receivedPolicyDecision):
1257
1258 2017-09-20  Alex Christensen  <achristensen@webkit.org>
1259
1260         Add infrastructure for adding custom headers to requests per website
1261         https://bugs.webkit.org/show_bug.cgi?id=177255
1262
1263         Reviewed by Geoffrey Garen.
1264
1265         * Shared/WebsitePolicies.cpp: Added.
1266         * Shared/WebsitePolicies.h:
1267         (WebKit::WebsitePolicies::encode const):
1268         (WebKit::WebsitePolicies::decode):
1269         * UIProcess/API/APIWebsitePolicies.h:
1270         * UIProcess/API/C/WKWebsitePolicies.cpp:
1271         (WKWebsitePoliciesCopyCustomHeaderFields):
1272         (WKWebsitePoliciesSetCustomHeaderFields):
1273         * UIProcess/API/C/WKWebsitePolicies.h:
1274         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1275         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
1276         (-[_WKWebsitePolicies customHeaderFields]):
1277         (-[_WKWebsitePolicies setCustomHeaderFields:]):
1278         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1279         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1280
1281 2017-09-20  Michael Catanzaro  <mcatanzaro@igalia.com>
1282
1283         REGRESSION(r222194) [WPE] Library and executable output names broken
1284         https://bugs.webkit.org/show_bug.cgi?id=177273
1285
1286         Reviewed by Carlos Alberto Lopez Perez.
1287
1288         Move the WebKit2 output name variables to here from Source/cmake, since this is a better
1289         place and where they are set on all other ports. Update them for the changes in r222194.
1290
1291         * PlatformWPE.cmake:
1292
1293 2017-09-20  Jonathan Bedard  <jbedard@apple.com>
1294
1295         Removed nullable from UIDragItem property
1296         https://bugs.webkit.org/show_bug.cgi?id=176264
1297         <rdar://problem/31144674>
1298
1299         Unreviewed build fix
1300
1301         When a nullable annotation is used in a header file,
1302         the Objective-C compiler forces annotations on the entire
1303         file. Remove an unneeded annotation in UIKitSPI.h so that
1304         we can build in iOS 11.
1305
1306         * Platform/spi/ios/UIKitSPI.h:
1307
1308 2017-09-20  Antti Koivisto  <antti@apple.com>
1309
1310         Remove DOM and styling support for CSS Regions
1311         https://bugs.webkit.org/show_bug.cgi?id=177221
1312
1313         Reviewed by Andreas Kling.
1314
1315         * Configurations/FeatureDefines.xcconfig:
1316
1317 2017-09-19  Simon Fraser  <simon.fraser@apple.com>
1318
1319         Do more math in terms of FloatSizes and FloatPoints
1320         https://bugs.webkit.org/show_bug.cgi?id=177217
1321
1322         Reviewed by Zalan Bujtas.
1323
1324         Add operator/(const FloatSize&, const FloatSize&), GraphicsContext::translate(const FloatPoint&),
1325         FloatRect.scale(FloatSize) and AffineTransform::translate(const FloatSize&)
1326         and use them in lots of places to do math in terms of points and sizes.
1327
1328         * UIProcess/API/Cocoa/WKWebView.mm:
1329         (-[WKWebView _didCommitLayerTree:]):
1330         * UIProcess/ios/DragDropInteractionState.mm:
1331         (WebKit::createTargetedDragPreview):
1332         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
1333         (WebKit::imageForRect):
1334         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
1335         (WebKit::InjectedBundleRangeHandle::renderedImage):
1336         * WebProcess/WebPage/WebPage.cpp:
1337         (WebKit::paintSnapshotAtSize):
1338         (WebKit::WebPage::snapshotNode):
1339
1340 2017-09-19  Simon Fraser  <simon.fraser@apple.com>
1341
1342         tiled-drawing/tiled-backing-in-window.html fails on Retina displays
1343         https://bugs.webkit.org/show_bug.cgi?id=177113
1344
1345         Reviewed by Tim Horton.
1346
1347         Make m_customDeviceScaleFactor a std::optional<> instead of having the weird "0 is unset"
1348         behavior.
1349
1350         * UIProcess/WebPageProxy.cpp:
1351         (WebKit::WebPageProxy::deviceScaleFactor const):
1352         (WebKit::WebPageProxy::setCustomDeviceScaleFactor):
1353         * UIProcess/WebPageProxy.h:
1354
1355 2017-09-19  Alex Christensen  <achristensen@webkit.org>
1356
1357         Allow modern decoding of Vectors
1358         https://bugs.webkit.org/show_bug.cgi?id=177102
1359
1360         Reviewed by Andy Estes.
1361
1362         Rather than allow modern decoding of Vectors of types that only allow legacy decoding,
1363         I just made modern decoders for all types that we need to decode in Vectors.
1364
1365         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1366         (WebKit::NetworkResourceLoadParameters::decode):
1367         * Platform/IPC/ArgumentCoders.cpp:
1368         (IPC::ArgumentCoder<std::chrono::system_clock::time_point>::decode):
1369         * Platform/IPC/ArgumentCoders.h:
1370         * Shared/AssistedNodeInformation.cpp:
1371         (WebKit::OptionItem::decode):
1372         * Shared/AssistedNodeInformation.h:
1373         * Shared/CallbackID.h:
1374         (WebKit::CallbackID::decode):
1375         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
1376         (IPC::ArgumentCoder<WebCore::PaymentError>::decode):
1377         (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):
1378         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode):
1379         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::decode):
1380         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ShippingMethod>::decode):
1381         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::TotalAndLineItems>::decode):
1382         (IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::decode):
1383         (IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::decode):
1384         * Shared/Databases/IndexedDB/WebIDBResult.cpp:
1385         (WebKit::WebIDBResult::decode):
1386         * Shared/FrameInfoData.cpp:
1387         (WebKit::FrameInfoData::decode):
1388         * Shared/Gamepad/GamepadData.cpp:
1389         (WebKit::GamepadData::decode):
1390         * Shared/Gamepad/GamepadData.h:
1391         * Shared/PlatformPopupMenuData.cpp:
1392         (WebKit::PlatformPopupMenuData::decode):
1393         * Shared/PlatformPopupMenuData.h:
1394         * Shared/Plugins/NPIdentifierData.cpp:
1395         (WebKit::NPIdentifierData::decode):
1396         * Shared/Plugins/NPIdentifierData.h:
1397         * Shared/Plugins/NPVariantData.cpp:
1398         (WebKit::NPVariantData::decode):
1399         * Shared/Plugins/NPVariantData.h:
1400         * Shared/RTCNetwork.cpp:
1401         (WebKit::RTCNetwork::IPAddress::decode):
1402         (WebKit::RTCNetwork::SocketAddress::decode):
1403         (WebKit::RTCNetwork::decode):
1404         * Shared/RTCNetwork.h:
1405         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
1406         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
1407         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
1408         (WebKit::RemoteLayerTreeTransaction::decode):
1409         * Shared/SessionState.cpp:
1410         (WebKit::HTTPBody::Element::decode):
1411         (WebKit::FrameState::decode):
1412         (WebKit::PageState::decode):
1413         (WebKit::BackForwardListItemState::decode):
1414         (WebKit::BackForwardListState::decode):
1415         * Shared/SessionState.h:
1416         * Shared/WebCompiledContentRuleListData.cpp:
1417         (WebKit::WebCompiledContentRuleListData::decode):
1418         * Shared/WebCompiledContentRuleListData.h:
1419         * Shared/WebContextMenuItemData.cpp:
1420         (WebKit::WebContextMenuItemData::decode):
1421         * Shared/WebContextMenuItemData.h:
1422         * Shared/WebCoreArgumentCoders.cpp:
1423         (IPC::ArgumentCoder<DOMCacheEngine::CacheInfo>::decode):
1424         (IPC::ArgumentCoder<DOMCacheEngine::Record>::decode):
1425         (IPC::ArgumentCoder<FloatRect>::decode):
1426         (IPC::ArgumentCoder<FloatQuad>::decode):
1427         (IPC::ArgumentCoder<IntRect>::decode):
1428         (IPC::ArgumentCoder<RecentSearch>::decode):
1429         (IPC::ArgumentCoder<Region::Span>::decode):
1430         (IPC::ArgumentCoder<MimeClassInfo>::decode):
1431         (IPC::ArgumentCoder<PluginInfo>::decode):
1432         (IPC::ArgumentCoder<SelectionRect>::decode):
1433         (IPC::ArgumentCoder<CompositionUnderline>::decode):
1434         (IPC::ArgumentCoder<DictationAlternative>::decode):
1435         (IPC::ArgumentCoder<GrammarDetail>::decode):
1436         (IPC::ArgumentCoder<TextCheckingResult>::decode):
1437         (IPC::ArgumentCoder<BlobPart>::decode):
1438         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
1439         (IPC::ArgumentCoder<MediaConstraints>::decode):
1440         (IPC::ArgumentCoder<CaptureDevice>::decode):
1441         (IPC::ArgumentCoder<ScrollOffsetRange<float>>::decode):
1442         (IPC::ArgumentCoder<MediaSelectionOption>::decode):
1443         * Shared/WebCoreArgumentCoders.h:
1444         * Shared/WebEvent.h:
1445         * Shared/WebPageCreationParameters.cpp:
1446         (WebKit::WebPageCreationParameters::decode):
1447         * Shared/WebPlatformTouchPoint.cpp:
1448         (WebKit::WebPlatformTouchPoint::decode):
1449         * Shared/WebPopupItem.cpp:
1450         (WebKit::WebPopupItem::decode):
1451         * Shared/WebPopupItem.h:
1452         * Shared/WebUserContentControllerDataTypes.cpp:
1453         (WebKit::WebUserScriptData::decode):
1454         (WebKit::WebUserStyleSheetData::decode):
1455         (WebKit::WebScriptMessageHandlerData::decode):
1456         * Shared/WebUserContentControllerDataTypes.h:
1457         * Shared/WebsiteData/WebsiteData.cpp:
1458         (WebKit::WebsiteData::Entry::decode):
1459         * Shared/WebsiteData/WebsiteData.h:
1460         * Shared/WebsiteDataStoreParameters.cpp:
1461         (WebKit::WebsiteDataStoreParameters::decode):
1462         * Shared/ios/WebPlatformTouchPointIOS.cpp:
1463         (WebKit::WebPlatformTouchPoint::decode):
1464         * Shared/mac/WebCoreArgumentCodersMac.mm:
1465         (IPC::ArgumentCoder<KeypressCommand>::decode):
1466         * UIProcess/LegacySessionStateCodingNone.cpp:
1467         (WebKit::decodeLegacySessionState):
1468         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h:
1469         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
1470         (WebKit::PlatformCAAnimationRemote::KeyframeValue::decode):
1471         (WebKit::PlatformCAAnimationRemote::Properties::decode):
1472
1473 2017-09-19  Ryosuke Niwa  <rniwa@webkit.org>
1474
1475         On iOS, getData can't get text set by setData during copy event
1476         https://bugs.webkit.org/show_bug.cgi?id=176980
1477         <rdar://problem/34453915>
1478
1479         Reviewed by Darin Adler.
1480
1481         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1482         (WebKit::WebPlatformStrategies::copy): Deleted.
1483         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1484
1485 2017-09-19  Alex Christensen  <achristensen@webkit.org>
1486
1487         Expose WKPageRef as a private property on WKWebView on Mac
1488         https://bugs.webkit.org/show_bug.cgi?id=177022
1489         <rdar://problem/34342762>
1490
1491         Reviewed by Andy Estes.
1492
1493         * UIProcess/API/Cocoa/WKWebView.mm:
1494         (-[WKWebView _pageRefForTransitionToWKWebView]):
1495         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1496
1497 2017-09-19  Alex Christensen  <achristensen@webkit.org>
1498
1499         Make _WKProcessPoolConfiguration.allowsCellularAccess actually work on iOS
1500         https://bugs.webkit.org/show_bug.cgi?id=177124
1501
1502         Reviewed by Andy Estes.
1503
1504         The boolean added in r213747 was getting lost in two places:
1505         1. The API::ProcessPoolConfiguration gets copied before it's used, so we need to set the bool on the copy.
1506         2. The bool was not getting copied from that ProcessPoolConfiguration to the NetworkProcessCreationParameters
1507         to be sent to the NetworkProcess to be given to the NSURLSessionConfiguration in NetworkSessionCocoa.mm.
1508
1509         These two problems were fixed and verified manually with a customized iOS app on my phone.
1510         Unfortunately, this cannot be tested well with our current test infrastructure.
1511
1512         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1513         (API::ProcessPoolConfiguration::copy):
1514         * UIProcess/WebProcessPool.cpp:
1515         (WebKit::WebProcessPool::ensureNetworkProcess):
1516
1517 2017-09-18  Michael Catanzaro  <mcatanzaro@igalia.com>
1518
1519         [CMake] Rename WebKit target to WebKitLegacy and rename WebKit2 target to WebKit
1520         https://bugs.webkit.org/show_bug.cgi?id=174558
1521
1522         Reviewed by Alex Christensen.
1523
1524         * CMakeLists.txt:
1525         * PlatformGTK.cmake:
1526         * PlatformMac.cmake:
1527         * PlatformWPE.cmake:
1528         * PlatformWin.cmake:
1529         * Shared/gtk/WebKitWaylandProtocol.xml: Renamed from Source/WebKit/Shared/gtk/WebKit2WaylandProtocol.xml.
1530         * UIProcess/gtk/WaylandCompositor.cpp:
1531         * WebProcess/gtk/WaylandCompositorDisplay.cpp:
1532
1533 2017-09-18  Andy Estes  <aestes@apple.com>
1534
1535         [Cocoa] Upstream sandbox-related WebKitSystemInterface functions
1536         https://bugs.webkit.org/show_bug.cgi?id=177047
1537
1538         Reviewed by Daniel Bates.
1539
1540         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1541         (WebKit::NetworkResourceLoadParameters::encode const):
1542         * Platform/spi/mac/QuarantineSPI.h: Added.
1543         * Shared/SandboxExtension.h:
1544         (): Deleted.
1545         * Shared/mac/ChildProcessMac.mm:
1546         (WebKit::enableSandboxStyleFileQuarantine):
1547         (WebKit::ChildProcess::initializeSandbox):
1548         * Shared/mac/SandboxExtensionMac.mm:
1549         (WebKit::SandboxExtensionImpl::create):
1550         (WebKit::SandboxExtensionImpl::SandboxExtensionImpl):
1551         (WebKit::SandboxExtensionImpl::~SandboxExtensionImpl):
1552         (WebKit::SandboxExtensionImpl::consume):
1553         (WebKit::SandboxExtensionImpl::invalidate):
1554         (WebKit::SandboxExtensionImpl::getSerializedFormat):
1555         (WebKit::SandboxExtension::Handle::Handle):
1556         (WebKit::SandboxExtension::Handle::~Handle):
1557         (WebKit::SandboxExtension::Handle::encode const):
1558         (WebKit::SandboxExtension::Handle::decode):
1559         (WebKit::SandboxExtension::createHandleWithoutResolvingPath):
1560         (WebKit::SandboxExtension::createHandleForReadWriteDirectory):
1561         (WebKit::SandboxExtension::createHandleForTemporaryFile):
1562         (WebKit::SandboxExtension::createHandleForGenericExtension):
1563         (WebKit::SandboxExtension::SandboxExtension):
1564         (WebKit::SandboxExtension::~SandboxExtension):
1565         (WebKit::SandboxExtension::revoke):
1566         (WebKit::SandboxExtension::consume):
1567         (WebKit::SandboxExtension::consumePermanently):
1568         (WebKit::wkSandboxExtensionType): Deleted.
1569         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
1570         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
1571         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1572         (WebKit::WebProcessPool::platformInitializeWebProcess):
1573         * UIProcess/Downloads/DownloadProxy.cpp:
1574         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
1575         * UIProcess/Network/NetworkProcessProxy.cpp:
1576         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs):
1577         * UIProcess/Storage/StorageProcessProxy.cpp:
1578         (WebKit::StorageProcessProxy::getSandboxExtensionsForBlobFiles):
1579         * UIProcess/WebPageProxy.cpp:
1580         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
1581         (WebKit::WebPageProxy::loadFile):
1582         (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
1583         * UIProcess/WebProcessPool.cpp:
1584         (WebKit::WebProcessPool::createNewWebProcess):
1585         (WebKit::WebProcessPool::processDidFinishLaunching):
1586         (WebKit::WebProcessPool::resumeDownload):
1587         (WebKit::WebProcessPool::startMemorySampler):
1588         * WebKit.xcodeproj/project.pbxproj:
1589         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
1590         (WebKit::BlobRegistryProxy::registerFileBlobURL):
1591
1592 2017-09-18  Andy Estes  <aestes@apple.com>
1593
1594         [Cocoa] Upstream WKSetCrashReportApplicationSpecificInformation() from WebKitSystemInterface
1595         https://bugs.webkit.org/show_bug.cgi?id=177048
1596
1597         Reviewed by Alex Christensen.
1598
1599         * Platform/IPC/mac/ConnectionMac.mm:
1600         (IPC::Connection::sendMessage):
1601         (IPC::readFromMachPort):
1602         * Platform/cocoa/CrashReporter.h: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
1603         * Platform/cocoa/CrashReporter.mm: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
1604         (WebKit::setCrashReportApplicationSpecificInformation):
1605         * Platform/spi/Cocoa/CrashReporterClientSPI.h: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
1606         * Shared/Cocoa/ChildProcessCocoa.mm:
1607         (WebKit::ChildProcess::didReceiveInvalidMessage):
1608         * WebKit.xcodeproj/project.pbxproj:
1609         * WebProcess/cocoa/WebProcessCocoa.mm:
1610         (WebKit::_WKSetCrashReportApplicationSpecificInformation):
1611
1612 2017-09-18  Andy Estes  <aestes@apple.com>
1613
1614         [Mac] Upstream miscellaneous WebKitSystemInterface functions
1615         https://bugs.webkit.org/show_bug.cgi?id=177029
1616
1617         Reviewed by Alex Christensen.
1618
1619         * NetworkProcess/mac/NetworkProcessMac.mm:
1620         (WebKit::NetworkProcess::initializeProcessName):
1621         * PluginProcess/mac/PluginProcessMac.mm:
1622         (WebKit::PluginProcess::initializeProcessName):
1623         * StorageProcess/mac/StorageProcessMac.mm:
1624         (WebKit::StorageProcess::initializeProcessName):
1625         * UIProcess/Cocoa/WebViewImpl.mm:
1626         (WebKit::trackingAreaOptions):
1627         (WebKit::WebViewImpl::mightBeginScrollWhileInactive):
1628         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1629         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
1630         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
1631         (WebKit::NetscapePlugin::popUpContextMenu):
1632         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1633         (WebKit::PDFPlugin::handleContextMenuEvent):
1634         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1635         (InitWebCoreSystemInterface):
1636         * WebProcess/cocoa/WebProcessCocoa.mm:
1637         (WebKit::WebProcess::initializeProcessName):
1638         (WebKit::WebProcess::updateActivePages):
1639
1640 2017-09-17  Michael Catanzaro  <mcatanzaro@igalia.com>
1641
1642         [WPE][GTK] Merge ProcessLauncher[WPE,GTK]
1643         https://bugs.webkit.org/show_bug.cgi?id=177041
1644
1645         Unreviewed fixup, I broke the size of the argv buffer when experimenting with how to respond
1646         to review comments. Not sure why this didn't blow up everything during testing.
1647
1648         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
1649         (WebKit::ProcessLauncher::launchProcess):
1650
1651 2017-09-17  Michael Catanzaro  <mcatanzaro@igalia.com>
1652
1653         [WPE][GTK] Merge ProcessLauncher[WPE,GTK]
1654         https://bugs.webkit.org/show_bug.cgi?id=177041
1655
1656         Reviewed by Carlos Garcia Campos.
1657
1658         * PlatformGTK.cmake:
1659         * PlatformWPE.cmake:
1660         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: Renamed from Source/WebKit/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp.
1661         (WebKit::childSetupFunction):
1662         (WebKit::ProcessLauncher::launchProcess):
1663         (WebKit::ProcessLauncher::terminateProcess):
1664         (WebKit::ProcessLauncher::platformInvalidate):
1665         * UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp: Removed.
1666
1667 2017-09-16  Tim Horton  <timothy_horton@apple.com>
1668
1669         Fix the Tools build with CMake on macOS
1670         https://bugs.webkit.org/show_bug.cgi?id=177030
1671
1672         Reviewed by Geoffrey Garen.
1673
1674         * PlatformMac.cmake:
1675         Add some WebKitLegacy headers to forward (for use by the tools).
1676
1677 2017-09-15  JF Bastien  <jfbastien@apple.com>
1678
1679         WTF: use Forward.h when appropriate instead of Vector.h
1680         https://bugs.webkit.org/show_bug.cgi?id=176984
1681
1682         Reviewed by Saam Barati.
1683
1684         There's no need to include Vector.h when Forward.h will suffice. All we need is to move the template default parameters from Vector, and then the forward declaration can be used in so many new places: if a header only takes Vector by reference, rvalue reference, pointer, returns any of these, or has them as members then the header doesn't need to see the definition because the declaration will suffice.
1685
1686         * Scripts/webkit/LegacyMessages-expected.h:
1687         * Scripts/webkit/Messages-expected.h:
1688         * Shared/API/APIData.h:
1689         * UIProcess/API/APIContextMenuClient.h:
1690         * UIProcess/API/APIFormClient.h:
1691         * UIProcess/API/APIHTTPCookieStore.h:
1692         * UIProcess/API/APINotificationProvider.h:
1693         * UIProcess/API/glib/WebKitNotificationProvider.h:
1694         * UIProcess/Notifications/WebNotificationProvider.h:
1695         * UIProcess/TextCheckerCompletion.h:
1696         * UIProcess/WebCookieManagerProxy.h:
1697         * UIProcess/WebOpenPanelResultListenerProxy.h:
1698         * UIProcess/WebPasteboardProxy.h:
1699         * UIProcess/WebPopupMenuProxy.h:
1700         * UIProcess/WebTextCheckerClient.h:
1701         * WebProcess/Cookies/WebCookieManager.h:
1702         * WebProcess/Gamepad/WebGamepadProvider.h:
1703         * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
1704         * WebProcess/InjectedBundle/API/APIInjectedBundlePageContextMenuClient.h:
1705         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
1706         * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
1707         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
1708         * WebProcess/Network/webrtc/WebRTCMonitor.h:
1709         * WebProcess/Network/webrtc/WebRTCResolver.h:
1710         * WebProcess/WebPage/DrawingArea.h:
1711         * WebProcess/WebPage/WebOpenPanelResultListener.h:
1712
1713 2017-09-15  Tim Horton  <timothy_horton@apple.com>
1714
1715         Fix the macOS CMake build
1716         https://bugs.webkit.org/show_bug.cgi?id=177015
1717
1718         Reviewed by Andy Estes.
1719
1720         * CMakeLists.txt:
1721         Add the new RemoteLayerTree directories to the header search path.
1722         Add CookieStorageUtilsCF.mm to Sources.
1723
1724         * PlatformMac.cmake:
1725         Add a few more files, and fix the generated forwarding headers include
1726         path to name "WebKit" instead of "WebKit2".
1727
1728 2017-09-15  Youenn Fablet  <youenn@apple.com>
1729
1730         Add an URL method to remove both query string and fragment identifier
1731         https://bugs.webkit.org/show_bug.cgi?id=176911
1732
1733         Reviewed by Alex Christensen.
1734
1735         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
1736         (WebKit::CacheStorage::computeKeyURL):
1737
1738 2017-09-15  Andy Estes  <aestes@apple.com>
1739
1740         [Cocoa] Upstream MediaRemote and VideoToolbox WebKitSystemInterface functions
1741         https://bugs.webkit.org/show_bug.cgi?id=176953
1742
1743         Reviewed by Eric Carlson.
1744
1745         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1746         (InitWebCoreSystemInterface):
1747
1748 2017-09-15  Ryosuke Niwa  <rniwa@webkit.org>
1749
1750         iOS: WebKitTestRunner hits an assertion in editing/pasteboard/datatransfer-items-copy-plaintext.html
1751         https://bugs.webkit.org/show_bug.cgi?id=176968
1752
1753         Reviewed by Wenson Hsieh.
1754
1755         Don't allocate a SharedMemory of size zero (content was empty) as this would result in a crash inside
1756         a WebContent process in release builds and an assertion failure in debug builds.
1757
1758         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1759         (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
1760
1761 2017-09-14  Youenn Fablet  <youenn@apple.com>
1762
1763         Add Cache API support of records persistency
1764         https://bugs.webkit.org/show_bug.cgi?id=176845
1765
1766         Reviewed by Alex Christensen.
1767
1768         Introducing asynchronous opening of Cache objects.
1769         When opening, Cache objects will read the list of records from the disk.
1770         They keep in memory the necessary information to make any match or remove request without reading further information from the disk.
1771         Cache objects thus keep during the opening time a list of callbacks to call when being opened.
1772         Persistent storage is implemented through NetworkCache::Storage.
1773
1774         A Cache object is added a unique name so that records from a Cache cannot be mixed with records from another Cache.
1775         This unique name is stored persistenly in addition to the Cache name.
1776         This unique name is used as the key type given to the storage.
1777
1778         Request, response and responsebody data are no longer kept by the Cache object.
1779         For regular sessions, this information is kept on the disk through NetworkCache::Storage.
1780         Insertion time is also stored persistently so as to keep the ordering of the records consistent.
1781         For private browsing sessions, this information is kept in a map owned by the Caches object.
1782         RecordData is renamed to RecordInformation as it now only contains the information used to handle the different Cache actions.
1783
1784         For every record retrieval action, a ReadRecordTaskCounter is used.
1785         Its purpose is to allow retrieving the record data on the disk in parallel,
1786         and then send back the information when everything is read.
1787         In case some records cannot be correctly read, they are removed automatically at that point.
1788         The current implementation loads all information in memory including response bodies.
1789         Further improvements might consider streaming the response bodies progressively.
1790
1791         For every stored record, an AsynchronousPutTaskCounter is used.
1792         Its purpose is also to wait for all put actions to be completed before executing the completion callback.
1793         In some cases, a record needs to be overriden.
1794         In that case, as per the specification, only the data related to the response is to be modified.
1795         This requires reading the record request data on disk before actually writing the whole record again.
1796         This is implemented in updateRecordToDisk.
1797
1798         The Cache object is delegating all record writing/reading tasks to its Caches object.
1799         The Caches object is responsible to handle persistent/private sessions.
1800
1801         * NetworkProcess/cache/CacheStorageEngine.cpp:
1802         (WebKit::CacheStorage::Engine::retrieveRecords): Making sure Cache object is opened.
1803         (WebKit::CacheStorage::Engine::readCache): Ditto.
1804         (WebKit::CacheStorage::Engine::unlock): Disposing the cache without going through initializing it.
1805         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
1806         (WebKit::CacheStorage::computeKeyURL):
1807         (WebKit::CacheStorage::queryCache):
1808         (WebKit::CacheStorage::updateVaryInformation):
1809         (WebKit::CacheStorage::Cache::toRecordInformation):
1810         (WebKit::CacheStorage::Cache::Cache):
1811         (WebKit::CacheStorage::Cache::open):
1812         (WebKit::CacheStorage::Cache::finishOpening):
1813         (WebKit::CacheStorage::ReadRecordTaskCounter::create):
1814         (WebKit::CacheStorage::ReadRecordTaskCounter::~ReadRecordTaskCounter):
1815         (WebKit::CacheStorage::ReadRecordTaskCounter::appendRecord):
1816         (WebKit::CacheStorage::ReadRecordTaskCounter::ReadRecordTaskCounter):
1817         (WebKit::CacheStorage::Cache::retrieveRecord):
1818         (WebKit::CacheStorage::Cache::retrieveRecords):
1819         (WebKit::CacheStorage::Cache::addRecord):
1820         (WebKit::CacheStorage::Cache::recordsFromURL):
1821         (WebKit::CacheStorage::Cache::recordsFromURL const):
1822         (WebKit::CacheStorage::AsynchronousPutTaskCounter::create):
1823         (WebKit::CacheStorage::AsynchronousPutTaskCounter::~AsynchronousPutTaskCounter):
1824         (WebKit::CacheStorage::AsynchronousPutTaskCounter::onCompletion):
1825         (WebKit::CacheStorage::AsynchronousPutTaskCounter::setError):
1826         (WebKit::CacheStorage::Cache::put):
1827         (WebKit::CacheStorage::Cache::remove):
1828         (WebKit::CacheStorage::Cache::removeFromRecordList):
1829         (WebKit::CacheStorage::Cache::writeRecordToDisk):
1830         (WebKit::CacheStorage::Cache::updateRecordToDisk):
1831         (WebKit::CacheStorage::Cache::readRecordFromDisk):
1832         (WebKit::CacheStorage::Cache::removeRecordFromDisk):
1833         (WebKit::CacheStorage::Cache::encode):
1834         (WebKit::CacheStorage::decodeRecordHeader):
1835         (WebKit::CacheStorage::Cache::decode):
1836         (WebKit::CacheStorage::Cache::keys const):
1837         * NetworkProcess/cache/CacheStorageEngineCache.h:
1838         (WebKit::CacheStorage::Cache::isOpened const):
1839         (WebKit::CacheStorage::Cache::uniqueName const):
1840         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1841         (WebKit::CacheStorage::Caches::initialize):
1842         (WebKit::CacheStorage::Caches::open):
1843         (WebKit::CacheStorage::Caches::remove):
1844         (WebKit::CacheStorage::Caches::dispose):
1845         (WebKit::CacheStorage::encodeCacheNames):
1846         (WebKit::CacheStorage::decodeCachesNames):
1847         (WebKit::CacheStorage::Caches::readCachesFromDisk):
1848         (WebKit::CacheStorage::Caches::readRecordsList):
1849         (WebKit::CacheStorage::Caches::writeRecord):
1850         (WebKit::CacheStorage::Caches::readRecord):
1851         (WebKit::CacheStorage::Caches::removeRecord):
1852         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
1853         (WebKit::CacheStorage::Caches::salt const):
1854         * NetworkProcess/cache/CacheStorageEngineCaches.h:
1855         (WebKit::CacheStorage::Caches::shouldPersist const):
1856         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1857         (WebKit::NetworkCache::Storage::store):
1858         * NetworkProcess/cache/NetworkCacheStorage.h:
1859         (WebKit::NetworkCache::Storage::writeWithoutWaiting):
1860
1861 2017-09-14  Alex Christensen  <achristensen@webkit.org>
1862
1863         Add WKUIDelegatePrivate equivalent of WKPageUIClient's drawHeader, drawFooter, headerHeight, and footerHeight
1864         https://bugs.webkit.org/show_bug.cgi?id=176889
1865         <rdar://problem/29270035>
1866
1867         Reviewed by Andy Estes.
1868
1869         * UIProcess/API/C/WKPage.cpp:
1870         (WKPageLoadAlternateHTMLString):
1871         (WKPageLoadAlternateHTMLStringWithUserData):
1872         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
1873         (-[WKBrowsingContextController loadAlternateHTMLString:baseURL:forUnreachableURL:]):
1874         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1875         * UIProcess/API/Cocoa/WKWebView.mm:
1876         (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]):
1877         * UIProcess/Cocoa/UIDelegate.h:
1878         * UIProcess/Cocoa/UIDelegate.mm:
1879         (WebKit::UIDelegate::setDelegate):
1880         (WebKit::UIDelegate::UIClient::headerHeight):
1881         (WebKit::UIDelegate::UIClient::footerHeight):
1882         (WebKit::UIDelegate::UIClient::drawHeader):
1883         (WebKit::UIDelegate::UIClient::drawFooter):
1884         * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm:
1885         (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]):
1886         * UIProcess/Cocoa/WebViewImpl.mm:
1887         (WebKit::WebViewImpl::printOperationWithPrintInfo):
1888         * UIProcess/FrameLoadState.cpp:
1889         (WebKit::FrameLoadState::didStartProvisionalLoad):
1890         (WebKit::FrameLoadState::didReceiveServerRedirectForProvisionalLoad):
1891         (WebKit::FrameLoadState::didFailProvisionalLoad):
1892         (WebKit::FrameLoadState::didCommitLoad):
1893         (WebKit::FrameLoadState::didSameDocumentNotification):
1894         (WebKit::FrameLoadState::setUnreachableURL):
1895         (WebKit::FrameLoadState::FrameLoadState): Deleted.
1896         * UIProcess/FrameLoadState.h:
1897         (WebKit::FrameLoadState::url const):
1898         (WebKit::FrameLoadState::provisionalURL const):
1899         (WebKit::FrameLoadState::unreachableURL const):
1900         * UIProcess/WebFrameProxy.cpp:
1901         (WebKit::WebFrameProxy::loadURL):
1902         (WebKit::WebFrameProxy::didStartProvisionalLoad):
1903         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad):
1904         (WebKit::WebFrameProxy::didSameDocumentNavigation):
1905         (WebKit::WebFrameProxy::setUnreachableURL):
1906         * UIProcess/WebFrameProxy.h:
1907         (WebKit::WebFrameProxy::url const):
1908         (WebKit::WebFrameProxy::provisionalURL const):
1909         (WebKit::WebFrameProxy::unreachableURL const):
1910         * UIProcess/WebPageProxy.cpp:
1911         (WebKit::WebPageProxy::loadAlternateHTMLString):
1912         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
1913         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
1914         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
1915         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
1916         * UIProcess/WebPageProxy.h:
1917         * UIProcess/WebPageProxy.messages.in:
1918         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1919         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
1920         (WebKit::WebFrameLoaderClient::dispatchDidChangeProvisionalURL):
1921         (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
1922         (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage):
1923         (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage):
1924         (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage):
1925         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
1926         * WebProcess/WebPage/WebPage.cpp:
1927         (WebKit::WebPage::loadURLInFrame):
1928         * WebProcess/WebPage/WebPage.h:
1929         * WebProcess/WebPage/WebPage.messages.in:
1930
1931 2017-09-14  Andy Estes  <aestes@apple.com>
1932
1933         [Mac] Upstream SpeechSynthesis-related WebKitSystemInterface functions
1934         https://bugs.webkit.org/show_bug.cgi?id=176931
1935
1936         Reviewed by Joseph Pecoraro.
1937
1938         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1939         (InitWebCoreSystemInterface):
1940
1941 2017-09-14  Ryan Haddad  <ryanhaddad@apple.com>
1942
1943         Unreviewed, rolling out r222033.
1944
1945         This change caused API test WebKit.PrintFrame to time out.
1946
1947         Reverted changeset:
1948
1949         "Add WKUIDelegatePrivate equivalent of WKPageUIClient's
1950         drawHeader, drawFooter, headerHeight, and footerHeight"
1951         https://bugs.webkit.org/show_bug.cgi?id=176889
1952         http://trac.webkit.org/changeset/222033
1953
1954 2017-09-14  Alex Christensen  <achristensen@webkit.org>
1955
1956         Add WKUIDelegatePrivate equivalent of WKPageUIClient's drawHeader, drawFooter, headerHeight, and footerHeight
1957         https://bugs.webkit.org/show_bug.cgi?id=176889
1958         <rdar://problem/29270035>
1959
1960         Reviewed by Andy Estes.
1961
1962         * UIProcess/API/C/WKPage.cpp:
1963         (WKPageLoadAlternateHTMLString):
1964         (WKPageLoadAlternateHTMLStringWithUserData):
1965         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
1966         (-[WKBrowsingContextController loadAlternateHTMLString:baseURL:forUnreachableURL:]):
1967         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1968         * UIProcess/API/Cocoa/WKWebView.mm:
1969         (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]):
1970         * UIProcess/Cocoa/UIDelegate.h:
1971         * UIProcess/Cocoa/UIDelegate.mm:
1972         (WebKit::UIDelegate::setDelegate):
1973         (WebKit::UIDelegate::UIClient::headerHeight):
1974         (WebKit::UIDelegate::UIClient::footerHeight):
1975         (WebKit::UIDelegate::UIClient::drawHeader):
1976         (WebKit::UIDelegate::UIClient::drawFooter):
1977         * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm:
1978         (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]):
1979         * UIProcess/Cocoa/WebViewImpl.mm:
1980         (WebKit::WebViewImpl::printOperationWithPrintInfo):
1981         * UIProcess/FrameLoadState.cpp:
1982         (WebKit::FrameLoadState::didStartProvisionalLoad):
1983         (WebKit::FrameLoadState::didReceiveServerRedirectForProvisionalLoad):
1984         (WebKit::FrameLoadState::didFailProvisionalLoad):
1985         (WebKit::FrameLoadState::didCommitLoad):
1986         (WebKit::FrameLoadState::didSameDocumentNotification):
1987         (WebKit::FrameLoadState::setUnreachableURL):
1988         (WebKit::FrameLoadState::FrameLoadState): Deleted.
1989         * UIProcess/FrameLoadState.h:
1990         (WebKit::FrameLoadState::url const):
1991         (WebKit::FrameLoadState::provisionalURL const):
1992         (WebKit::FrameLoadState::unreachableURL const):
1993         * UIProcess/WebFrameProxy.cpp:
1994         (WebKit::WebFrameProxy::loadURL):
1995         (WebKit::WebFrameProxy::didStartProvisionalLoad):
1996         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad):
1997         (WebKit::WebFrameProxy::didSameDocumentNavigation):
1998         (WebKit::WebFrameProxy::setUnreachableURL):
1999         * UIProcess/WebFrameProxy.h:
2000         (WebKit::WebFrameProxy::url const):
2001         (WebKit::WebFrameProxy::provisionalURL const):
2002         (WebKit::WebFrameProxy::unreachableURL const):
2003         * UIProcess/WebPageProxy.cpp:
2004         (WebKit::WebPageProxy::loadAlternateHTMLString):
2005         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
2006         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
2007         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
2008         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
2009         * UIProcess/WebPageProxy.h:
2010         * UIProcess/WebPageProxy.messages.in:
2011         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2012         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
2013         (WebKit::WebFrameLoaderClient::dispatchDidChangeProvisionalURL):
2014         (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
2015         (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage):
2016         (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage):
2017         (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage):
2018         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
2019         * WebProcess/WebPage/WebPage.cpp:
2020         (WebKit::WebPage::loadURLInFrame):
2021         * WebProcess/WebPage/WebPage.h:
2022         * WebProcess/WebPage/WebPage.messages.in:
2023
2024 2017-09-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2025
2026         [GTK][Wayland] Flickering when resizing the window
2027         https://bugs.webkit.org/show_bug.cgi?id=176774
2028
2029         Reviewed by Michael Catanzaro.
2030
2031         This regressed when we switched to always start the wayland compositor. In
2032         AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState() we check if the nested compositor is
2033         running, which is always true now (if EGL and the required extensions are available). We should check if we are
2034         in AC mode instead.
2035
2036         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
2037         (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState):
2038
2039 2017-09-14  Yusuke Suzuki  <utatane.tea@gmail.com>
2040
2041         [JSC] Add PrivateSymbolMode::{Include,Exclude} for PropertyNameArray
2042         https://bugs.webkit.org/show_bug.cgi?id=176867
2043
2044         Reviewed by Sam Weinig.
2045
2046         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
2047         (WebKit::NPJSObject::enumerate):
2048
2049 2017-09-14  Maureen Daum  <mdaum@apple.com>
2050
2051         Introduce the option to mark an HTML element as having AutoFill available.
2052         https://bugs.webkit.org/show_bug.cgi?id=176710
2053
2054         Reviewed by Alex Christensen.
2055
2056         Introduce the option to mark an HTML element as having AutoFill available. Accessibility
2057         can use this property when deciding whether to announce that the focused field offers
2058         AutoFill.
2059
2060         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
2061         (WKBundleNodeHandleGetHTMLInputElementAutoFillAvailable):
2062         (WKBundleNodeHandleSetHTMLInputElementAutoFillAvailable):
2063         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
2064         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
2065         (WebKit::InjectedBundleNodeHandle::isAutoFillAvailable const):
2066         (WebKit::InjectedBundleNodeHandle::setAutoFillAvailable):
2067         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
2068
2069 2017-09-13  John Wilander  <wilander@apple.com>
2070
2071         Introduce Storage Access API (document parts) as an experimental feature
2072         https://bugs.webkit.org/show_bug.cgi?id=175759
2073         <rdar://problem/34414107>
2074
2075         Reviewed by Alex Christensen.
2076
2077         Storage Access API is an experimental feature which allows cross-origin,
2078         sandboxed iframes to request access to their first-party storage (as
2079         opposed to partitioned storage). This might be restricted to cookies or
2080         might cover all stateful mechanisms.
2081
2082         It introduces the following three developer-facing things:
2083         - A new readonly attribute, document.hasStorageAccess.
2084         - A new function, document.requestStorageAccess().
2085         - A new iframe sandbox token, allow-storage-access-by-user-activation.
2086
2087         * Shared/WebCoreArgumentCoders.cpp:
2088         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
2089         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
2090             Storage handling of the new type of data.
2091         * Shared/WebPreferencesDefinitions.h:
2092         * UIProcess/API/C/WKPreferences.cpp:
2093         (WKPreferencesSetStorageAccessAPIEnabled):
2094         (WKPreferencesGetStorageAccessAPIEnabled):
2095         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2096         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2097             Bumped the model version from 9 to 10.
2098         * WebProcess/WebPage/WebPage.cpp:
2099         (WebKit::WebPage::updatePreferences):
2100
2101 2017-09-13  Andy Estes  <aestes@apple.com>
2102
2103         [Apple Pay] Consider phoneticName when encoding ContactFields
2104         https://bugs.webkit.org/show_bug.cgi?id=176885
2105         <rdar://problem/34176419>
2106
2107         Reviewed by Tim Horton.
2108
2109         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2110         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ContactFields>::encode):
2111         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ContactFields>::decode):
2112
2113 2017-09-13  Matt Lewis  <jlewis3@apple.com>
2114
2115         Unreviewed, rolling out r221976.
2116
2117         The test introduced was flaky from point of addition.
2118
2119         Reverted changeset:
2120
2121         "Introduce Storage Access API (document parts) as an
2122         experimental feature"
2123         https://bugs.webkit.org/show_bug.cgi?id=175759
2124         http://trac.webkit.org/changeset/221976
2125
2126 2017-09-13  Youenn Fablet  <youenn@apple.com>
2127
2128         Internals clearCacheStorageMemoryRepresentation should return a Promise
2129         https://bugs.webkit.org/show_bug.cgi?id=176818
2130
2131         Reviewed by Alex Christensen.
2132
2133         Adding a completion handler to clearMemoryRepresentation.
2134
2135         * NetworkProcess/cache/CacheStorageEngine.cpp:
2136         (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
2137         * NetworkProcess/cache/CacheStorageEngine.h:
2138         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
2139         (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
2140         * NetworkProcess/cache/CacheStorageEngineConnection.h:
2141         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
2142         * WebProcess/Cache/WebCacheStorageConnection.cpp:
2143         (WebKit::WebCacheStorageConnection::clearMemoryRepresentation):
2144         (WebKit::WebCacheStorageConnection::clearMemoryRepresentationCompleted):
2145         * WebProcess/Cache/WebCacheStorageConnection.h:
2146         * WebProcess/Cache/WebCacheStorageConnection.messages.in:
2147
2148 2017-09-13  Andy Estes  <aestes@apple.com>
2149
2150         [CF] Upstream CFNetwork-related WebKitSystemInterface functions
2151         https://bugs.webkit.org/show_bug.cgi?id=176729
2152
2153         Reviewed by Alex Christensen.
2154
2155         * Shared/mac/WebCoreArgumentCodersMac.mm:
2156         (IPC::createSerializableRepresentation):
2157         (IPC::dictionaryValueOfType):
2158         (IPC::createArchiveList):
2159         (IPC::createCFURLRequestFromSerializableRepresentation):
2160         (IPC::createNSURLRequestFromSerializableRepresentation):
2161         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
2162         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
2163         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2164         (WebKit::WebProcessPool::legacyPlatformDefaultCacheStorageDirectory):
2165         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
2166         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2167         (InitWebCoreSystemInterface):
2168
2169 2017-09-13  Alex Christensen  <achristensen@webkit.org>
2170
2171         Add WKUIDelegatePrivate equivalent of WKPageUIClient's setIsResizable, getWindowFrame, and setWindowFrame
2172         https://bugs.webkit.org/show_bug.cgi?id=176857
2173         <rdar://problem/29270035>
2174
2175         Reviewed by Tim Horton.
2176
2177         isResizable is unreachable code because nothing sends Messages::WebPageProxy::GetIsResizable, so I removed it.
2178
2179         * UIProcess/API/APIUIClient.h:
2180         (API::UIClient::setStatusBarIsVisible):
2181         (API::UIClient::isResizable): Deleted.
2182         * UIProcess/API/C/WKPage.cpp:
2183         (WKPageSetPageUIClient):
2184         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2185         * UIProcess/API/glib/WebKitUIClient.cpp:
2186         * UIProcess/Cocoa/UIDelegate.h:
2187         * UIProcess/Cocoa/UIDelegate.mm:
2188         (WebKit::UIDelegate::setDelegate):
2189         (WebKit::UIDelegate::UIClient::setIsResizable):
2190         (WebKit::UIDelegate::UIClient::setWindowFrame):
2191         (WebKit::UIDelegate::UIClient::windowFrame):
2192         * UIProcess/WebPageProxy.cpp:
2193         (WebKit::WebPageProxy::getIsResizable): Deleted.
2194         * UIProcess/WebPageProxy.h:
2195         * UIProcess/WebPageProxy.messages.in:
2196
2197 2017-09-13  Youenn Fablet  <youenn@apple.com>
2198
2199         Add a lambda-based map for Vectors
2200         https://bugs.webkit.org/show_bug.cgi?id=176487
2201
2202         Reviewed by Darin Adler.
2203
2204         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2205         (WebKit::CacheStorage::Caches::readCachesFromDisk):
2206
2207 2017-09-13  John Wilander  <wilander@apple.com>
2208
2209         Introduce Storage Access API (document parts) as an experimental feature
2210         https://bugs.webkit.org/show_bug.cgi?id=175759
2211         <rdar://problem/33666847>
2212
2213         Reviewed by Alex Christensen.
2214
2215         Storage Access API is an experimental feature which allows cross-origin,
2216         sandboxed iframes to request access to their first-party storage (as
2217         opposed to partitioned storage). This might be restricted to cookies or
2218         might cover all stateful mechanisms.
2219
2220         It introduces the following three developer-facing things:
2221         - A new readonly attribute, document.hasStorageAccess.
2222         - A new function, document.requestStorageAccess().
2223         - A new iframe sandbox token, allow-storage-access-by-user-activation.
2224
2225         * Shared/WebCoreArgumentCoders.cpp:
2226         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
2227         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
2228             Storage handling of the new type of data.
2229         * Shared/WebPreferencesDefinitions.h:
2230         * UIProcess/API/C/WKPreferences.cpp:
2231         (WKPreferencesSetStorageAccessAPIEnabled):
2232         (WKPreferencesGetStorageAccessAPIEnabled):
2233         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2234         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2235             Bumped the model version from 9 to 10.
2236         * WebProcess/WebPage/WebPage.cpp:
2237         (WebKit::WebPage::updatePreferences):
2238
2239 2017-09-13  Sergio Villar Senin  <svillar@igalia.com>
2240
2241         [WebVR] Add IDLs and stubs
2242         https://bugs.webkit.org/show_bug.cgi?id=174202
2243
2244         Reviewed by Dean Jackson.
2245
2246         * Shared/WebPreferencesDefinitions.h:
2247         * WebProcess/WebPage/WebPage.cpp:
2248         (WebKit::WebPage::updatePreferences):
2249
2250 2017-09-12  Ryosuke Niwa  <rniwa@webkit.org>
2251
2252         Dragging & dropping a file creates an attachment element even when it's disabled
2253         https://bugs.webkit.org/show_bug.cgi?id=176769
2254
2255         Reviewed by Tim Horton.
2256
2257         * UIProcess/API/C/WKPreferences.cpp:
2258         (WKPreferencesSetAttachmentElementEnabled):
2259         (WKPreferencesGetAttachmentElementEnabled):
2260         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2261         * WebProcess/WebPage/WebPage.cpp:
2262         (WebKit::WebPage::updatePreferences):
2263
2264 2017-09-12  Youenn Fablet  <youenn@apple.com>
2265
2266         Introduce a RecordData for Cache to efficiently check whether it matches a corresponding request or not
2267         https://bugs.webkit.org/show_bug.cgi?id=176579
2268
2269         Reviewed by Alex Christensen.
2270
2271         Introducing RecordData that splits its stored data in mandatory data,
2272         used to check a record with a request and optional data that is
2273         necessary to build a CacheStorageEngine::Record used by WebProcess.
2274
2275         The mandatory data contains the URL, Vary header information and identifiers.
2276         Adding routines to go from a Record to RecordData and vice versa.
2277         Storing in CacheStorage::Cache RecordData instead of Record.
2278
2279         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
2280         (WebKit::CacheStorage::queryCache):
2281         (WebKit::CacheStorage::updateVaryInformation):
2282         (WebKit::CacheStorage::toRecord):
2283         (WebKit::CacheStorage::toRecordData):
2284         (WebKit::CacheStorage::Cache::retrieveRecords const):
2285         (WebKit::CacheStorage::Cache::addRecord):
2286         (WebKit::CacheStorage::Cache::recordsFromURL):
2287         (WebKit::CacheStorage::Cache::recordsFromURL const):
2288         (WebKit::CacheStorage::Cache::put):
2289         (WebKit::CacheStorage::Cache::writeRecordToDisk):
2290         (WebKit::CacheStorage::Cache::removeRecordFromDisk):
2291         * NetworkProcess/cache/CacheStorageEngineCache.h:
2292
2293 2017-09-12  Dan Bernstein  <mitz@apple.com>
2294
2295         Tried to fix the iOS 10 build after r221930.
2296
2297         * UIProcess/API/Cocoa/WKWebView.mm:
2298         (-[WKWebView _initializeWithConfiguration:]):
2299         (-[WKWebView _setDragInteractionPolicy:]):
2300
2301 2017-09-12  Dan Bernstein  <mitz@apple.com>
2302
2303         Update availability annotations to match the macOS 10.13 and iOS 11.0 GM seed SDKs
2304         https://bugs.webkit.org/show_bug.cgi?id=176793
2305
2306         Reviewed by Tim Horton.
2307
2308         Changed WK_MAC_TBA and WK_IOS_TBA to 10.13 and 11.0, respectively, in all declarations that
2309         appear in the GM seed SDKs. Additional changes and exceptions are noted below.
2310
2311         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Added missing availability annotation to
2312           -_webView:dataOwnerForDropSession: and -_webView:dataOwnerForDragSession:.
2313
2314         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Removed rednundant
2315           __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 guards.
2316
2317         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: Added missing availability annotation to
2318           -_setResourceLoadStatisticsTestingCallback:.
2319
2320         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h: Added missing availability annotation.
2321
2322         * UIProcess/API/Cocoa/_WKLinkIconParameters.h: Added availability annotation that had been
2323           missing since macOS 10.12.3 and iOS 10.3. Corrected annotation for _WKLinkIconParameters.
2324
2325         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: Added missing TBA annotation to
2326           _resourceLoadStatisticsDirectory.
2327
2328         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h: Removed iOS
2329           availability from macOS-only declaration and vice versa.
2330
2331         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm:
2332         (-[WKWebProcessPlugInRangeHandle detectDataWithTypes:context:]): Removed an availability
2333           annotation from this method implementation.
2334
2335         * Shared/API/Cocoa/WKDragDestinationAction.h:
2336         * UIProcess/API/Cocoa/WKContentRuleList.h:
2337         * UIProcess/API/Cocoa/WKContentRuleListStore.h:
2338         * UIProcess/API/Cocoa/WKError.h:
2339         * UIProcess/API/Cocoa/WKFrameInfo.h:
2340         * UIProcess/API/Cocoa/WKHTTPCookieStore.h:
2341         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
2342         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2343         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2344         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2345         * UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
2346         * UIProcess/API/Cocoa/WKURLSchemeHandler.h:
2347         * UIProcess/API/Cocoa/WKURLSchemeTask.h:
2348         * UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h:
2349         * UIProcess/API/Cocoa/WKUserContentController.h:
2350         * UIProcess/API/Cocoa/WKWebView.h:
2351         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
2352         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2353         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
2354         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
2355         * UIProcess/API/Cocoa/WKWindowFeaturesPrivate.h:
2356         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
2357         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
2358         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
2359         * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h:
2360         * UIProcess/API/Cocoa/_WKGeolocationPosition.h:
2361         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2362         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
2363         * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
2364         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
2365         * UIProcess/_WKWebViewPrintFormatter.h:
2366         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
2367         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h:
2368         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
2369
2370 2017-09-12  Alex Christensen  <achristensen@webkit.org>
2371
2372         Add WKUIDelegatePrivate equivalent of WKPageUIClient's runModal
2373         https://bugs.webkit.org/show_bug.cgi?id=176728
2374         <rdar://problem/29270035>
2375         
2376         Covered by a new API test.
2377
2378         Reviewed by Tim Horton.
2379
2380         * UIProcess/API/APIUIClient.h:
2381         (API::UIClient::runModal):
2382         * UIProcess/API/C/WKPage.cpp:
2383         (WKPageSetPageUIClient):
2384         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2385         * UIProcess/Cocoa/UIDelegate.h:
2386         * UIProcess/Cocoa/UIDelegate.mm:
2387         (WebKit::UIDelegate::setDelegate):
2388         (WebKit::UIDelegate::UIClient::canRunModal const):
2389         (WebKit::UIDelegate::UIClient::runModal):
2390         * UIProcess/WebPageProxy.cpp:
2391         (WebKit::WebPageProxy::runModal):
2392
2393 2017-09-12  Alex Christensen  <achristensen@webkit.org>
2394
2395         Add WKUIDelegatePrivate equivalent of WKPageUIClient's decidePolicyForNotificationPermissionRequest
2396         https://bugs.webkit.org/show_bug.cgi?id=176768
2397         <rdar://problem/29270035>
2398
2399         Reviewed by Tim Horton.
2400
2401         Covered by a new API test.
2402
2403         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2404         * UIProcess/Cocoa/UIDelegate.h:
2405         * UIProcess/Cocoa/UIDelegate.mm:
2406         (WebKit::UIDelegate::setDelegate):
2407         (WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel):
2408         (WebKit::UIDelegate::UIClient::exceededDatabaseQuota):
2409         (WebKit::UIDelegate::UIClient::decidePolicyForNotificationPermissionRequest):
2410         (WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota):
2411
2412 2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2413
2414         [iOS DnD] Support DataTransfer.setDragImage when starting a drag on iOS
2415         https://bugs.webkit.org/show_bug.cgi?id=176721
2416         <rdar://problem/34373660>
2417
2418         Reviewed by Tim Horton.
2419
2420         Rename elementBounds => dragPreviewFrameInRootViewCoordinates.
2421
2422         * UIProcess/ios/DragDropInteractionState.h:
2423         * UIProcess/ios/DragDropInteractionState.mm:
2424         (WebKit::DragDropInteractionState::previewForDragItem const):
2425         (WebKit::DragDropInteractionState::stageDragItem):
2426
2427 2017-09-11  Tim Horton  <timothy_horton@apple.com>
2428
2429         REGRESSION (r221272): WKWebView gets stuck zoomed in if the web process crashes
2430         https://bugs.webkit.org/show_bug.cgi?id=176767
2431         <rdar://problem/34196874>
2432
2433         Reviewed by Dan Bernstein.
2434
2435         * UIProcess/API/Cocoa/WKWebView.mm:
2436         (-[WKWebView _processDidExit]):
2437         Reset the "last sent" layout parameters when the Web Content process exits.
2438         They're no longer "last sent", and if we short-circuit from sending them
2439         again (from under _didRelaunchProcess), we will never send the correct
2440         layout width (until it changes).
2441
2442 2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2443
2444         [iOS WK2] Support tapping to add items to the current drag session in web content
2445         https://bugs.webkit.org/show_bug.cgi?id=176421
2446         <rdar://problem/31144674>
2447
2448         Reviewed by Tim Horton.
2449
2450         To request additional drag items, end the current drag in the web page and try to begin a drag at the new
2451         location. This process is transparent to the UI process, which still maintains the same UIDragSession with the
2452         old drag source.
2453
2454         As opposed to firing a new event (for instance: `adddragitem`), this approach is taken to ensure that if the
2455         page wants to preventDefault() on `dragstart`, it would also prevent the user from adding it as an additional
2456         drag item. Using the new event approach, dealing with this case would either require the page to listen for a
2457         new event and call preventDefault(), which would break compatibility with pages that only preventDefault() on
2458         `dragstart`, or it would require the default behavior of this new event to be _not_ adding a drag item, in which
2459         case this approach would require pages to adopt the new event in some form.
2460
2461         * WebProcess/WebPage/ios/WebPageIOS.mm:
2462         (WebKit::WebPage::requestAdditionalItemsForDragSession):
2463
2464 2017-09-11  Alex Christensen  <achristensen@webkit.org>
2465
2466         Clean up API::UIClient
2467         https://bugs.webkit.org/show_bug.cgi?id=176568
2468
2469         Reviewed by Brady Eidson.
2470
2471         We don't need createNewPage and createNewPageAsync.
2472         An async version can support synchronous delegate calls by just calling the completion handler synchronously.
2473
2474         * UIProcess/API/APIUIClient.h:
2475         (API::UIClient::createNewPage):
2476         (API::UIClient::createNewPageAsync): Deleted.
2477         (API::UIClient::canCreateNewPageAsync): Deleted.
2478         * UIProcess/API/C/WKPage.cpp:
2479         (WKPageSetPageUIClient):
2480         * UIProcess/API/glib/WebKitUIClient.cpp:
2481         * UIProcess/API/glib/WebKitUIClient.h:
2482         * UIProcess/Cocoa/UIDelegate.h:
2483         * UIProcess/Cocoa/UIDelegate.mm:
2484         (WebKit::UIDelegate::UIClient::createNewPage):
2485         (WebKit::UIDelegate::UIClient::createNewPageCommon): Deleted.
2486         (WebKit::UIDelegate::UIClient::canCreateNewPageAsync): Deleted.
2487         (WebKit::UIDelegate::UIClient::createNewPageAsync): Deleted.
2488         * UIProcess/WebPageProxy.cpp:
2489         (WebKit::WebPageProxy::createNewPage):
2490         * UIProcess/WebPageProxy.h:
2491
2492 2017-09-11  Alex Christensen  <achristensen@webkit.org>
2493
2494         Fix memory leak introduced in r221894.
2495         https://bugs.webkit.org/show_bug.cgi?id=176753
2496
2497         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
2498         (WebKit::NotificationPermissionRequestManagerProxy::createRequest):
2499         The NotificationPermissionRequestManagerProxy keeps track of pending requests
2500         so they can be denied when invalidating the page.  We add them to a HashMap and in
2501         r221894 I removed the code that removes them from that map once the request is complete.
2502         This code adds the completed task removal back.
2503         The NotificationPermissionRequestManagerProxy and WebPageProxy have the same lifetime,
2504         so protecting the WebPageProxy (m_page) makes sure there is no use-after-free when the
2505         completion handler is called.
2506
2507 2017-09-11  Alex Christensen  <achristensen@webkit.org>
2508
2509         Make NotificationPermissionRequest work with completion handlers
2510         https://bugs.webkit.org/show_bug.cgi?id=176753
2511
2512         Reviewed by Andy Estes.
2513
2514         API::UIClient::decidePolicyForNotificationPermissionRequest should take a completion handler
2515         which it will eventually call with a bool representing whether notifications are allowed.
2516         To do this, I make NotificationPermissionRequest just a wrapper for a lambda.
2517         One subtle change in behavior is when invalidating all outstanding requests, we deny them instead
2518         of just dropping them.  This results in a deny message sent where there wasn't one before,
2519         resulting in better cleanup in NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision.
2520
2521         * UIProcess/API/APIUIClient.h:
2522         (API::UIClient::decidePolicyForNotificationPermissionRequest):
2523         * UIProcess/API/C/WKPage.cpp:
2524         (WKPageSetPageUIClient):
2525         * UIProcess/Notifications/NotificationPermissionRequest.cpp: Removed.
2526         * UIProcess/Notifications/NotificationPermissionRequest.h:
2527         (WebKit::NotificationPermissionRequest::create):
2528         (WebKit::NotificationPermissionRequest::allow):
2529         (WebKit::NotificationPermissionRequest::deny):
2530         (WebKit::NotificationPermissionRequest::NotificationPermissionRequest):
2531         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
2532         (WebKit::NotificationPermissionRequestManagerProxy::invalidateRequests):
2533         (WebKit::NotificationPermissionRequestManagerProxy::createRequest):
2534         (WebKit::NotificationPermissionRequestManagerProxy::didReceiveNotificationPermissionDecision): Deleted.
2535         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h:
2536         * UIProcess/WebPageProxy.cpp:
2537         (WebKit::WebPageProxy::requestNotificationPermission):
2538         * WebKit.xcodeproj/project.pbxproj:
2539
2540 2017-09-11  Alex Christensen  <achristensen@webkit.org>
2541
2542         Modernize and make API::UIClient more asynchronous
2543         https://bugs.webkit.org/show_bug.cgi?id=176583
2544
2545         Reviewed by Brian Burg.
2546
2547         API::UIClient calls that return values synchronously require synchronous APIs unnecessarily.
2548         Having them call completion handlers with the results instead allows us to make asynchronous
2549         APIs, and existing synchronous APIs can just call the completion handlers immediately.
2550         
2551         Unfortunately an assumption that API::UIClient::windowFrame returns synchronously had worked
2552         its way into the WebAutomationSession, which calls WebPageProxy::getWindowFrame.  Making it
2553         asynchronous required making some automation protocols asynchronous so they can send their
2554         result once they have the resulting frames from the UIClient.
2555         
2556         No change in behaviour.
2557
2558         * UIProcess/API/APIUIClient.h:
2559         (API::UIClient::setToolbarsAreVisible):
2560         (API::UIClient::menuBarIsVisible):
2561         (API::UIClient::setMenuBarIsVisible):
2562         (API::UIClient::statusBarIsVisible):
2563         (API::UIClient::setStatusBarIsVisible):
2564         (API::UIClient::isResizable):
2565         (API::UIClient::setIsResizable):
2566         (API::UIClient::setWindowFrame):
2567         (API::UIClient::windowFrame):
2568         (API::UIClient::headerHeight):
2569         (API::UIClient::footerHeight):
2570         (API::UIClient::drawHeader):
2571         (API::UIClient::drawFooter):
2572         (API::UIClient::printFrame):
2573         * UIProcess/API/C/WKPage.cpp:
2574         (WKPageSetPageUIClient):
2575         * UIProcess/Automation/Automation.json:
2576         * UIProcess/Automation/WebAutomationSession.cpp:
2577         (WebKit::WebAutomationSession::buildBrowsingContextForPage):
2578         (WebKit::WebAutomationSession::getNextContext):
2579         (WebKit::WebAutomationSession::getBrowsingContexts):
2580         (WebKit::WebAutomationSession::getBrowsingContext):
2581         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
2582         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
2583         (WebKit::WebAutomationSession::performMouseInteraction):
2584         * UIProcess/Automation/WebAutomationSession.h:
2585         * UIProcess/Cocoa/UIDelegate.h:
2586         * UIProcess/Cocoa/UIDelegate.mm:
2587         (WebKit::UIDelegate::UIClient::printFrame):
2588         * UIProcess/Cocoa/WebViewImpl.mm:
2589         (WebKit::WebViewImpl::printOperationWithPrintInfo):
2590         * UIProcess/WebPageProxy.cpp:
2591         (WebKit::WebPageProxy::runJavaScriptPrompt):
2592         (WebKit::WebPageProxy::setToolbarsAreVisible):
2593         (WebKit::WebPageProxy::setMenuBarIsVisible):
2594         (WebKit::WebPageProxy::getMenuBarIsVisible):
2595         (WebKit::WebPageProxy::setStatusBarIsVisible):
2596         (WebKit::WebPageProxy::getStatusBarIsVisible):
2597         (WebKit::WebPageProxy::setIsResizable):
2598         (WebKit::WebPageProxy::getIsResizable):
2599         (WebKit::WebPageProxy::setWindowFrame):
2600         (WebKit::WebPageProxy::getWindowFrame):
2601         (WebKit::WebPageProxy::getWindowFrameWithCompletionHandler):
2602         (WebKit::WebPageProxy::screenToRootView):
2603         (WebKit::WebPageProxy::rootViewToScreen):
2604         (WebKit::WebPageProxy::printFrame):
2605         (WebKit::WebPageProxy::headerHeight):
2606         (WebKit::WebPageProxy::footerHeight):
2607         (WebKit::WebPageProxy::drawHeader):
2608         (WebKit::WebPageProxy::drawFooter):
2609         * UIProcess/WebPageProxy.h:
2610         * UIProcess/WebPageProxy.messages.in:
2611         * UIProcess/mac/WKPrintingView.h:
2612         * UIProcess/mac/WKPrintingView.mm:
2613         (-[WKPrintingView initWithFrameProxy:view:]):
2614         (-[WKPrintingView _adjustPrintingMarginsForHeaderAndFooter]):
2615         (-[WKPrintingView drawPageBorderWithSize:]):
2616         * UIProcess/mac/WebPageProxyMac.mm:
2617         (WebKit::WebPageProxy::windowAndViewFramesChanged):
2618
2619 2017-09-11  Stephan Szabo  <stephan.szabo@sony.com>
2620
2621         [WinCairo] Add entry Web Process files for wincairo webkit
2622         https://bugs.webkit.org/show_bug.cgi?id=176570
2623
2624         Reviewed by Alex Christensen.
2625
2626         * PlatformWin.cmake:
2627         * WebProcess/EntryPoint/win/WebProcessMain.cpp: Added.
2628         * WebProcess/win/WebProcessMainWin.cpp: Added.
2629         * WebProcess/win/WebProcessMainWin.h: Added.
2630
2631 2017-09-11  Alex Christensen  <achristensen@webkit.org>
2632
2633         Add WKUIDelegatePrivate equivalent of WKPageUIClient's decidePolicyForGeolocationPermissionRequest
2634         https://bugs.webkit.org/show_bug.cgi?id=176642
2635         <rdar://problem/29270035>
2636
2637         Reviewed by Darin Adler.
2638
2639         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2640         * UIProcess/Cocoa/UIDelegate.h:
2641         * UIProcess/Cocoa/UIDelegate.mm:
2642         (WebKit::UIDelegate::setDelegate):
2643         (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
2644         (WebKit::Function<void):
2645
2646 2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2647
2648         [iOS DnD] Elements in the DOM with the `draggable` attribute should be draggable
2649         https://bugs.webkit.org/show_bug.cgi?id=176664
2650         <rdar://problem/32596156>
2651
2652         Reviewed by Tim Horton.
2653
2654         Makes a simple adjustment in DragDropInteractionState::previewForDragItem to respect the drag image supplied to
2655         the UI process during a "DHTML"-defined drag (i.e. DragSourceActionDHTML).
2656
2657         Test: DataInteractionTests.CanStartDragOnDivWithDraggableAttribute
2658
2659         * UIProcess/API/Cocoa/WKWebView.mm:
2660         (-[WKWebView _simulateDataInteractionEntered:]): Deleted.
2661         (-[WKWebView _simulateDataInteractionUpdated:]): Deleted.
2662         (-[WKWebView _simulateDataInteractionPerformOperation:]): Deleted.
2663         (-[WKWebView _simulateDataInteractionEnded:]): Deleted.
2664         (-[WKWebView _simulateDataInteractionSessionDidEnd:]): Deleted.
2665         (-[WKWebView _simulateWillBeginDataInteractionWithSession:]): Deleted.
2666         (-[WKWebView _simulatedItemsForSession:]): Deleted.
2667         (-[WKWebView _simulateItemsForAddingToSession:atLocation:completion:]): Deleted.
2668         (-[WKWebView _simulatePrepareForDataInteractionSession:completion:]): Deleted.
2669
2670         Remove all -_simulate*: testing helpers on WKWebView.
2671
2672         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2673         * UIProcess/ios/DragDropInteractionState.mm:
2674         (WebKit::shouldUseDragImageToCreatePreviewForDragSource):
2675         (WebKit::shouldUseTextIndicatorToCreatePreviewForDragSource):
2676
2677         Add shouldUseDragImageToCreatePreviewForDragSource, which returns YES when dragging an image or DHTML-defined
2678         draggable element and the drag image exists. This is called from previewForDragItem when constructing the drag
2679         preview for a given UIDragItem.
2680
2681         (WebKit::DragDropInteractionState::previewForDragItem const):
2682         (WebKit::shouldUseTextIndicatorToCreatePreviewForDragAction): Deleted.
2683         * UIProcess/ios/WKContentViewInteraction.h:
2684         * UIProcess/ios/WKContentViewInteraction.mm:
2685         (-[WKContentView _simulateDataInteractionEntered:]): Deleted.
2686         (-[WKContentView _simulateDataInteractionUpdated:]): Deleted.
2687         (-[WKContentView _simulateDataInteractionEnded:]): Deleted.
2688         (-[WKContentView _simulateDataInteractionPerformOperation:]): Deleted.
2689         (-[WKContentView _simulateDataInteractionSessionDidEnd:]): Deleted.
2690         (-[WKContentView _simulateWillBeginDataInteractionWithSession:]): Deleted.
2691         (-[WKContentView _simulatedItemsForSession:]): Deleted.
2692         (-[WKContentView _simulatePrepareForDataInteractionSession:completion:]): Deleted.
2693         (-[WKContentView _simulateItemsForAddingToSession:atLocation:completion:]): Deleted.
2694
2695         Remove all -_simulate*: testing helpers on WKContentView.
2696
2697 2017-09-11  Alex Christensen  <achristensen@webkit.org>
2698
2699         Modernize BoxExtent into RectEdges
2700         https://bugs.webkit.org/show_bug.cgi?id=176437
2701
2702         Reviewed by Simon Fraser.
2703
2704         * Scripts/webkit/messages.py:
2705         (class_template_headers):
2706         * Shared/WebCoreArgumentCoders.h:
2707         * UIProcess/WebPageProxy.h:
2708         * UIProcess/WebPageProxy.messages.in:
2709         * WebProcess/WebPage/WebPage.messages.in:
2710
2711 2017-09-11  Andy Estes  <aestes@apple.com>
2712
2713         [Mac] Upstream QTKit-related WebKitSystemInterface functions
2714         https://bugs.webkit.org/show_bug.cgi?id=176472
2715
2716         Reviewed by Eric Carlson.
2717
2718         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2719         (InitWebCoreSystemInterface):
2720
2721 2017-09-11  JF Bastien  <jfbastien@apple.com>
2722
2723         cmake build fix
2724
2725         Unreviewed
2726
2727         * PlatformMac.cmake: one file was deleted, another renamed.
2728
2729 2017-09-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2730
2731         REGRESSION: [GTK] Generated HTML API documentation is missing descriptions
2732         https://bugs.webkit.org/show_bug.cgi?id=176667
2733
2734         Reviewed by Michael Catanzaro.
2735
2736         Fix several typos in API documentation.
2737
2738         * UIProcess/API/glib/WebKitSettings.cpp:
2739         (webkit_settings_class_init):
2740         * UIProcess/API/glib/WebKitWebView.cpp:
2741         (webkit_web_view_class_init):
2742         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
2743         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
2744
2745 2017-09-10  Brady Eidson  <beidson@apple.com>
2746
2747         Try to avoid creating the default WKWebsiteDataStore until its actually needed.
2748         <rdar://problem/33164453> and https://bugs.webkit.org/show_bug.cgi?id=176551
2749
2750         Reviewed by Tim Horton.
2751
2752         * UIProcess/API/APIHTTPCookieStore.cpp:
2753         (API::HTTPCookieStore::cookies):
2754         (API::HTTPCookieStore::setCookie):
2755         (API::HTTPCookieStore::deleteCookie):
2756
2757         * UIProcess/API/APIWebsiteDataStore.cpp:
2758         (API::WebsiteDataStore::defaultDataStore):
2759         (API::WebsiteDataStore::defaultDataStoreExists):
2760         * UIProcess/API/APIWebsiteDataStore.h:
2761
2762         * UIProcess/API/C/WKContext.cpp:
2763         (WKContextGetWebsiteDataStore):
2764
2765         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2766         (+[WKWebsiteDataStore _defaultDataStoreExists]):
2767         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2768
2769         * UIProcess/WebProcessPool.cpp:
2770         (WebKit::WebProcessPool::WebProcessPool):
2771         (WebKit::m_hiddenPageThrottlingTimer):
2772         (WebKit::WebProcessPool::ensureNetworkProcess):
2773         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
2774         (WebKit::WebProcessPool::warmInitialProcess):
2775         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
2776         (WebKit::WebProcessPool::createWebPage):
2777         (WebKit::WebProcessPool::pageAddedToProcess):
2778         * UIProcess/WebProcessPool.h:
2779
2780         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2781         (WebKit::WebsiteDataStore::isAssociatedProcessPool const):
2782
2783 2017-09-09  Mark Lam  <mark.lam@apple.com>
2784
2785         Avoid duplicate computations of ExecState::vm().
2786         https://bugs.webkit.org/show_bug.cgi?id=176647
2787
2788         Reviewed by Saam Barati.
2789
2790         * WebProcess/Plugins/Netscape/JSNPMethod.h:
2791         (WebKit::JSNPMethod::create):
2792         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
2793         (WebKit::NPJSObject::setProperty):
2794         (WebKit::NPJSObject::removeProperty):
2795         (WebKit::NPJSObject::enumerate):
2796
2797 2017-09-08  Joseph Pecoraro  <pecoraro@apple.com>
2798
2799         Fetch's Response.statusText is unexpectedly the full http status line for HTTP/2 responses
2800         https://bugs.webkit.org/show_bug.cgi?id=176479
2801
2802         Reviewed by Alex Christensen.
2803
2804         * NetworkProcess/NetworkProcess.cpp:
2805         (WebKit::NetworkProcess::initializeNetworkProcess):
2806         Initialize AtomicString statics like emptyAtom().
2807
2808 2017-09-08  Commit Queue  <commit-queue@webkit.org>
2809
2810         Unreviewed, rolling out r221773.
2811         https://bugs.webkit.org/show_bug.cgi?id=176614
2812
2813         This caused build failures. (Requested by mlewis13 on
2814         #webkit).
2815
2816         Reverted changeset:
2817
2818         "[Mac] Upstream QTKit-related WebKitSystemInterface functions"
2819         https://bugs.webkit.org/show_bug.cgi?id=176472
2820         http://trac.webkit.org/changeset/221773
2821
2822 2017-09-08  Stephan Szabo  <stephan.szabo@am.sony.com>
2823
2824         [WinCairo] Add Storage Process files for wincairo webkit
2825         https://bugs.webkit.org/show_bug.cgi?id=176567
2826
2827         Reviewed by Alex Christensen.
2828
2829         * PlatformWin.cmake:
2830         * StorageProcess/EntryPoint/win/StorageProcessMain.cpp: Added.
2831         (main):
2832         * StorageProcess/win/StorageProcessMainWin.cpp: Added.
2833         (WebKit::StorageProcessMainWin):
2834         * StorageProcess/win/StorageProcessMainWin.h: Added.
2835
2836 2017-09-08  Ryan Haddad  <ryanhaddad@apple.com>
2837
2838         Unreviewed, rolling out r221771.
2839
2840         This change caused two API tests to crash.
2841
2842         Reverted changeset:
2843
2844         "Clean up API::UIClient"
2845         https://bugs.webkit.org/show_bug.cgi?id=176568
2846         http://trac.webkit.org/changeset/221771
2847
2848 2017-09-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2849
2850         [GTK][WPE] UI process crash in WebBackForwardList::restoreFromState
2851         https://bugs.webkit.org/show_bug.cgi?id=176303
2852
2853         Reviewed by Michael Catanzaro.
2854
2855         Ensure the current index provided by the session state is not out of actual item list bounds. This is a bug in
2856         the session state decoder, but WebBackForwardList::backForwardListState() is already doing the check and using
2857         the last item index instead, so it's not easy to know where the actual problem is. In any case we should
2858         still protect the decoder.
2859
2860         * UIProcess/API/glib/WebKitWebViewSessionState.cpp:
2861         (decodeSessionState):
2862
2863 2017-09-07  Andy Estes  <aestes@apple.com>
2864
2865         [Mac] Upstream QTKit-related WebKitSystemInterface functions
2866         https://bugs.webkit.org/show_bug.cgi?id=176472
2867
2868         Reviewed by Eric Carlson.
2869
2870         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2871         (InitWebCoreSystemInterface):
2872
2873 2017-09-07  Alex Christensen  <achristensen@webkit.org>
2874
2875         Clean up API::UIClient
2876         https://bugs.webkit.org/show_bug.cgi?id=176568
2877
2878         Reviewed by Brady Eidson.
2879
2880         We don't need createNewPage and createNewPageAsync.
2881         An async version can support synchronous delegate calls by just calling the completion handler synchronously.
2882
2883         * UIProcess/API/APIUIClient.h:
2884         (API::UIClient::createNewPage):
2885         (API::UIClient::createNewPageAsync): Deleted.
2886         (API::UIClient::canCreateNewPageAsync): Deleted.
2887         * UIProcess/API/C/WKPage.cpp:
2888         (WKPageSetPageUIClient):
2889         * UIProcess/API/glib/WebKitUIClient.cpp:
2890         * UIProcess/API/glib/WebKitUIClient.h:
2891         * UIProcess/Cocoa/UIDelegate.h:
2892         * UIProcess/Cocoa/UIDelegate.mm:
2893         (WebKit::UIDelegate::UIClient::createNewPage):
2894         (WebKit::UIDelegate::UIClient::createNewPageCommon): Deleted.
2895         (WebKit::UIDelegate::UIClient::canCreateNewPageAsync): Deleted.
2896         (WebKit::UIDelegate::UIClient::createNewPageAsync): Deleted.
2897         * UIProcess/WebPageProxy.cpp:
2898         (WebKit::WebPageProxy::createNewPage):
2899         * UIProcess/WebPageProxy.h:
2900
2901 2017-09-07  Alex Christensen  <achristensen@webkit.org>
2902
2903         Make DragControllerAction an enum class
2904         https://bugs.webkit.org/show_bug.cgi?id=176565
2905
2906         Reviewed by Andy Estes.
2907
2908         * Shared/DragControllerAction.h:
2909         (): Deleted.
2910         * UIProcess/WebPageProxy.cpp:
2911         (WebKit::WebPageProxy::dragEntered):
2912         (WebKit::WebPageProxy::dragUpdated):
2913         (WebKit::WebPageProxy::dragExited):
2914         (WebKit::WebPageProxy::performDragOperation):
2915         * WebProcess/WebPage/WebPage.cpp:
2916         (WebKit::WebPage::performDragControllerAction):
2917         * WebProcess/WebPage/WebPage.h:
2918         * WebProcess/WebPage/WebPage.messages.in:
2919
2920 2017-09-07  Myles C. Maxfield  <mmaxfield@apple.com>
2921
2922         [PAL] Unify PlatformUserPreferredLanguages.h with Language.h
2923         https://bugs.webkit.org/show_bug.cgi?id=176561
2924
2925         Reviewed by Brent Fulgham.
2926
2927         * UIProcess/WebProcessPool.cpp:
2928         * WebProcess/WebProcess.cpp:
2929         (WebKit::WebProcess::userPreferredLanguagesChanged const):
2930
2931 2017-09-07  Youenn Fablet  <youenn@apple.com>
2932
2933         Remove entry from CacheStorageEngineConnection lock map when unlocking a Cache
2934         https://bugs.webkit.org/show_bug.cgi?id=176548
2935
2936         Reviewed by Alex Christensen.
2937
2938         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
2939         (WebKit::CacheStorageEngineConnection::dereference):
2940
2941 2017-09-07  Chris Dumez  <cdumez@apple.com>
2942
2943         [WK2] Add C API to retrieve the originating page of a WKDownload
2944         https://bugs.webkit.org/show_bug.cgi?id=176557
2945         <rdar://problem/34314776>
2946
2947         Reviewed by Alex Christensen.
2948
2949         Add C API to retrieve the original page of a WKDownload. This is the C API equivalent to
2950         _WKDownload.originatingWebView which already exists in ObjC. The pointer is weak so as
2951         to not keep alive the page for the duration of the download.
2952
2953         * UIProcess/API/C/WKDownload.cpp:
2954         (WKDownloadGetOriginatingPage):
2955         * UIProcess/API/C/WKDownload.h:
2956         * UIProcess/API/Cocoa/_WKDownload.mm:
2957         (-[_WKDownload originatingWebView]):
2958         * UIProcess/API/Cocoa/_WKDownloadInternal.h:
2959         * UIProcess/Downloads/DownloadProxy.cpp:
2960         (WebKit::DownloadProxy::originatingPage const):
2961         (WebKit::DownloadProxy::setOriginatingPage):
2962         * UIProcess/Downloads/DownloadProxy.h:
2963         * UIProcess/WebPageProxy.cpp:
2964         (WebKit::WebPageProxy::receivedPolicyDecision):
2965         * UIProcess/WebProcessPool.cpp:
2966         (WebKit::WebProcessPool::download):
2967         (WebKit::WebProcessPool::resumeDownload):
2968         (WebKit::WebProcessPool::createDownloadProxy):
2969         * UIProcess/WebProcessPool.h:
2970         * UIProcess/ios/PageClientImplIOS.mm:
2971         (WebKit::PageClientImpl::handleDownloadRequest):
2972         * UIProcess/mac/PageClientImplMac.mm:
2973         (WebKit::PageClientImpl::handleDownloadRequest):
2974
2975 2017-09-07  Alex Christensen  <achristensen@webkit.org>
2976
2977         Clean up Geolocation request handling
2978         https://bugs.webkit.org/show_bug.cgi?id=176562
2979
2980         Reviewed by Tim Horton.
2981
2982         Instead of passing a GeolocationPermissionRequestProxy& to each client and returning a bool if the request will be handled,
2983         pass a Function<void(bool)>&& completionHandler and return the function if it won't be handled.
2984         This allows to temporarily support our UIClient/PageClient hybrid design while moving towards a sane design.
2985
2986         * UIProcess/API/APIUIClient.h:
2987         (API::UIClient::Function<void):
2988         (API::UIClient::decidePolicyForGeolocationPermissionRequest): Deleted.
2989         * UIProcess/API/C/WKAPICast.h:
2990         * UIProcess/API/C/WKGeolocationPermissionRequest.cpp:
2991         (WKGeolocationPermissionRequestGetTypeID):
2992         * UIProcess/API/C/WKPage.cpp:
2993         (WKPageSetPageUIClient):
2994         * UIProcess/GeolocationPermissionRequestProxy.cpp:
2995         (WebKit::GeolocationPermissionRequestProxy::allow):
2996         (WebKit::GeolocationPermissionRequestProxy::deny):
2997         (WebKit::GeolocationPermissionRequestProxy::invalidate):
2998         * UIProcess/GeolocationPermissionRequestProxy.h:
2999         (WebKit::GeolocationPermissionRequest::create):
3000         (WebKit::GeolocationPermissionRequest::allow):
3001         (WebKit::GeolocationPermissionRequest::deny):
3002         (WebKit::GeolocationPermissionRequest::GeolocationPermissionRequest):
3003         * UIProcess/PageClient.h:
3004         (WebKit::PageClient::decidePolicyForGeolocationPermissionRequest): Deleted.
3005         * UIProcess/WebPageProxy.cpp:
3006         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
3007         * UIProcess/ios/PageClientImplIOS.h:
3008         * UIProcess/ios/PageClientImplIOS.mm:
3009         (WebKit::Function<void):
3010         (WebKit::PageClientImpl::decidePolicyForGeolocationPermissionRequest): Deleted.
3011         * UIProcess/ios/WKContentView.h:
3012         * UIProcess/ios/WKGeolocationProviderIOS.h:
3013         * UIProcess/ios/WKGeolocationProviderIOS.mm:
3014         (-[WKGeolocationProviderIOS decidePolicyForGeolocationRequestFromOrigin:frame:completionHandler:view:]):
3015         (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
3016         (-[WKGeolocationProviderIOS geolocationAuthorizationDenied]):
3017         (-[WKWebAllowDenyPolicyListener initWithCompletionHandler:]):
3018         (-[WKWebAllowDenyPolicyListener allow]):
3019         (-[WKWebAllowDenyPolicyListener deny]):
3020         (-[WKGeolocationProviderIOS decidePolicyForGeolocationRequestFromOrigin:frame:request:view:]): Deleted.
3021         (-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]): Deleted.
3022
3023 2017-09-07  Alex Christensen  <achristensen@webkit.org>
3024
3025         Allow modern decoding of enums and OptionSets
3026         https://bugs.webkit.org/show_bug.cgi?id=176480
3027
3028         Reviewed by Andy Estes.
3029
3030         * Platform/IPC/ArgumentCoders.h:
3031         (IPC::ArgumentCoder<OptionSet<T>>::decode):
3032         * Platform/IPC/Decoder.h:
3033         (IPC::Decoder::operator>>):
3034         * Platform/IPC/Encoder.h:
3035         * Shared/WebsitePolicies.h:
3036         (WebKit::WebsitePolicies::encode const):
3037         (WebKit::WebsitePolicies::decode):
3038
3039 2017-09-07  Frederic Wang  <fwang@igalia.com>
3040
3041          Move more code from ScrollingTreeScrollingNodeDelegateIOS to ScrollingTreeScrollingNodeDelegate
3042          https://bugs.webkit.org/show_bug.cgi?id=174130
3043
3044          Reviewed by Simon Fraser.
3045
3046          * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h: Remove some members,
3047          headers and pre-declaration that are moved into the delegate.
3048          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollLayer): Deleted.
3049          * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: Remove some headers and
3050          WKOverflowScrollViewDelegate since they are moved into the delegate file. Also fix the
3051          comment to closing the WebKit namespace.
3052          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::~ScrollingTreeOverflowScrollingNodeIOS):
3053          Remove some code moved into the delegate and call the corresponding helper function to
3054          preserve the current behavior.
3055          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren): Ditto.
3056          Note that it is only necessary to cast the parameter to a ScrollingStateTreeNode.
3057          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren): Ditto.
3058          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange): Ditto.
3059          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollPosition): Ditto.
3060          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): Ditto.
3061          (-[WKOverflowScrollViewDelegate initWithScrollingTreeNodeDelegate:]): Deleted.
3062          (-[WKOverflowScrollViewDelegate scrollViewDidScroll:]): Deleted.
3063          (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]): Deleted.
3064          (-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Deleted.
3065          (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): Deleted.
3066          (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]): Deleted.
3067          * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h: Import headers and members
3068          from ScrollingTreeOverflowScrollingNodeIOS. Define new helper functions for the code imported
3069          from ScrollingTreeOverflowScrollingNodeIOS. Remove the friendship with
3070          ScrollingTreeOverflowScrollingNodeIOS and only makes public the function used by that class.
3071          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollLayer): This function is moved from
3072          ScrollingTreeOverflowScrollingNodeIOS.
3073          * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: Add headers,
3074          WKOverflowScrollViewDelegate (renamed WKScrollingNodeScrollViewDelegate) and some helper code
3075          imported from ScrollingTreeOverflowScrollingNodeIOS.
3076          (-[WKScrollingNodeScrollViewDelegate scrollViewDidScroll:]): Moved from
3077          ScrollingTreeOverflowScrollingNodeIOS.
3078          (-[WKScrollingNodeScrollViewDelegate scrollViewWillBeginDragging:]): Ditto.
3079          (-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Ditto.
3080          (-[WKScrollingNodeScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): Ditto.
3081          (-[WKScrollingNodeScrollViewDelegate scrollViewDidEndDecelerating:]): Ditto.
3082          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::~ScrollingTreeScrollingNodeDelegateIOS):
3083          Import code from ScrollingTreeOverflowScrollingNodeIOS.
3084          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::resetScrollViewDelegate): New helper function
3085          importing code from ScrollingTreeOverflowScrollingNodeIOS.
3086          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren): Ditto.
3087          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren): Ditto.
3088          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange): Ditto.
3089          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollPosition): Ditto.
3090          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::setScrollLayerPosition): Ditto.
3091
3092 2017-09-07  Chris Dumez  <cdumez@apple.com>
3093
3094         [WK2] Notify client when downloads are redirected
3095         https://bugs.webkit.org/show_bug.cgi?id=176481
3096         <rdar://problem/34309065>
3097
3098         Reviewed by Geoffrey Garen.
3099
3100         Notify client when downloads are redirected via both ObjC and C
3101         API.
3102
3103         * NetworkProcess/Downloads/Download.cpp:
3104         (WebKit::Download::willSendRedirectedRequest):
3105         * NetworkProcess/Downloads/Download.h:
3106         * NetworkProcess/Downloads/mac/DownloadMac.mm:
3107         (-[WKDownloadAsDelegate download:willSendRequest:redirectResponse:]):
3108         * UIProcess/API/APIDownloadClient.h:
3109         (API::DownloadClient::willSendRequest):
3110         * UIProcess/API/C/WKContext.cpp:
3111         (WKContextSetDownloadClient):
3112         * UIProcess/API/C/WKContextDownloadClient.h:
3113         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
3114         * UIProcess/Cocoa/DownloadClient.h:
3115         * UIProcess/Cocoa/DownloadClient.mm:
3116         (WebKit::DownloadClient::DownloadClient):
3117         (WebKit::DownloadClient::willSendRequest):
3118         * UIProcess/Downloads/DownloadProxy.cpp:
3119         (WebKit::DownloadProxy::willSendRequest):
3120         * UIProcess/Downloads/DownloadProxy.h:
3121         * UIProcess/Downloads/DownloadProxy.messages.in:
3122
3123         * UIProcess/mac/WebContextMenuProxyMac.mm:
3124         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
3125         Set menu proxy before calling menuFromProposedMenu() client delegate.
3126         This allows me to perform one of the menu item's action from the
3127         menuFromProposedMenu() client delegate in my API test.
3128
3129 2017-09-07  Alex Christensen  <achristensen@webkit.org>
3130
3131         Modernize Geolocation code
3132         https://bugs.webkit.org/show_bug.cgi?id=176496
3133
3134         Reviewed by Andy Estes.
3135
3136         Making the GeolocationPermissionRequestManager take a reference instead of a pointer
3137         spilled into making the other supplement constructors do the same.
3138
3139         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.cpp:
3140         (WebKit::LegacyCustomProtocolManager::LegacyCustomProtocolManager):
3141         (WebKit::LegacyCustomProtocolManager::startLoading):
3142         (WebKit::LegacyCustomProtocolManager::stopLoading):
3143         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h:
3144         * NetworkProcess/NetworkProcess.h:
3145         (WebKit::NetworkProcess::addSupplement):
3146         * Shared/Authentication/AuthenticationManager.cpp:
3147         (WebKit::AuthenticationManager::AuthenticationManager):
3148         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
3149         * Shared/Authentication/AuthenticationManager.h:
3150         * UIProcess/API/APIUIClient.h:
3151         (API::UIClient::decidePolicyForGeolocationPermissionRequest):
3152         * UIProcess/API/C/WKPage.cpp:
3153         (WKPageSetPageUIClient):
3154         * UIProcess/WebPageProxy.cpp:
3155         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
3156         * WebProcess/Cookies/WebCookieManager.cpp:
3157         (WebKit::WebCookieManager::WebCookieManager):
3158         (WebKit::WebCookieManager::getHostnamesWithCookies):
3159         (WebKit::WebCookieManager::deleteCookie):
3160         (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
3161         (WebKit::WebCookieManager::getAllCookies):
3162         (WebKit::WebCookieManager::getCookies):
3163         (WebKit::WebCookieManager::setCookie):
3164         (WebKit::WebCookieManager::setCookies):
3165         (WebKit::WebCookieManager::notifyCookiesDidChange):
3166         (WebKit::WebCookieManager::setHTTPCookieAcceptPolicy):
3167         (WebKit::WebCookieManager::getHTTPCookieAcceptPolicy):
3168         * WebProcess/Cookies/WebCookieManager.h:
3169         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
3170         (WebKit::GeolocationPermissionRequestManager::GeolocationPermissionRequestManager):
3171         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
3172         (WebKit::GeolocationPermissionRequestManager::cancelRequestForGeolocation):
3173         * WebProcess/Geolocation/GeolocationPermissionRequestManager.h:
3174         * WebProcess/Geolocation/WebGeolocationManager.cpp:
3175         (WebKit::WebGeolocationManager::WebGeolocationManager):
3176         (WebKit::WebGeolocationManager::registerWebPage):
3177         (WebKit::WebGeolocationManager::unregisterWebPage):
3178         (WebKit::WebGeolocationManager::setEnableHighAccuracyForPage):
3179         (WebKit::WebGeolocationManager::didChangePosition):
3180         (WebKit::WebGeolocationManager::didFailToDeterminePosition):
3181         (WebKit::WebGeolocationManager::resetPermissions):
3182         * WebProcess/Geolocation/WebGeolocationManager.h:
3183         * WebProcess/MediaCache/WebMediaKeyStorageManager.h:
3184         (WebKit::WebMediaKeyStorageManager::WebMediaKeyStorageManager):
3185         * WebProcess/Notifications/WebNotificationManager.cpp:
3186         (WebKit::WebNotificationManager::WebNotificationManager):
3187         (WebKit::WebNotificationManager::show):
3188         (WebKit::WebNotificationManager::cancel):
3189         (WebKit::WebNotificationManager::clearNotifications):
3190         (WebKit::WebNotificationManager::didDestroyNotification):
3191         * WebProcess/Notifications/WebNotificationManager.h:
3192         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
3193         (WebKit::WebGeolocationClient::requestPermission):
3194         (WebKit::WebGeolocationClient::cancelPermissionRequest):
3195         * WebProcess/WebCoreSupport/WebGeolocationClient.h:
3196         (WebKit::WebGeolocationClient::WebGeolocationClient):
3197         * WebProcess/WebPage/WebPage.cpp:
3198         (WebKit::m_cpuLimit):
3199         * WebProcess/WebProcess.h:
3200         (WebKit::WebProcess::addSupplement):
3201         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
3202         (WebKit::UserMediaCaptureManager::UserMediaCaptureManager):
3203         * WebProcess/cocoa/UserMediaCaptureManager.h:
3204
3205 2017-09-06  Alex Christensen  <achristensen@webkit.org>
3206
3207         Add WKUIDelegatePrivate equivalent of WKPageUIClient's pageDidScroll
3208         https://bugs.webkit.org/show_bug.cgi?id=176482
3209         <rdar://problem/29270035>
3210
3211         Reviewed by Tim Horton.
3212         
3213         Covered by a new API test!
3214
3215         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3216         * UIProcess/Cocoa/UIDelegate.h:
3217         * UIProcess/Cocoa/UIDelegate.mm:
3218         (WebKit::UIDelegate::setDelegate):
3219         (WebKit::UIDelegate::UIClient::pageDidScroll):
3220
3221 2017-09-06  Youenn Fablet  <youenn@apple.com>
3222
3223         NetworkProcess Cache and Caches should be cleared when the last related WebProcess Cache or CacheStorage is destroyed
3224         https://bugs.webkit.org/show_bug.cgi?id=176249
3225
3226         Reviewed by Alex Christensen.
3227
3228         CacheStorageEngineConnection will store the number of Caches references for its related WebProcess.
3229         For a new reference, CacheStorageEngineConnection will notify its engine to lock the related Cache.
3230         When the last reference is gone, CacheStorageEngineConnection will ask the engine to release the lock.
3231
3232         CacheStorageEngine will keep locks as a counter for each Cache object.
3233         When the counter goes to zero, the engine asks the Cache to dispose itself.
3234         Disposal is done by its parent Caches as only Caches knows whether the Cache is persistent or has been removed.
3235
3236         The Caches will remove the Cache from memory.
3237         For removed caches, all information will be lost.
3238         For caches that are not removed, they will keep their identifiers but all in-memory record information will be discarded.
3239         If there is a need to reopen the Cache, it will need to read its information from the filesystem.
3240         If the Caches has no longer any active Cache object, it will ask the engine to release itself.
3241
3242         WebProcess crashing is handled correctly as the CacheStorageEngineConnection will release its locks at destruction
3243         time of the connection to the web process.
3244
3245         Adding the possiblity to grab an engine representation for test purposes.
3246
3247         * NetworkProcess/cache/CacheStorageEngine.cpp:
3248         (WebKit::CacheStorage::Engine::readCachesFromDisk):
3249         (WebKit::CacheStorage::Engine::removeCaches):
3250         (WebKit::CacheStorage::Engine::lock):
3251         (WebKit::CacheStorage::Engine::unlock):
3252         * NetworkProcess/cache/CacheStorageEngine.h:
3253         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
3254         (WebKit::CacheStorage::Cache::Cache):
3255         (WebKit::CacheStorage::Cache::dispose):
3256         (WebKit::CacheStorage::Cache::clearMemoryRepresentation):
3257         * NetworkProcess/cache/CacheStorageEngineCache.h:
3258         (WebKit::CacheStorage::Cache::isActive const):
3259         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3260         (WebKit::CacheStorage::Caches::Caches):
3261         (WebKit::CacheStorage::Caches::open):
3262         (WebKit::CacheStorage::Caches::dispose):
3263         (WebKit::CacheStorage::Caches::readCachesFromDisk):
3264         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
3265         * NetworkProcess/cache/CacheStorageEngineCaches.h:
3266         (WebKit::CacheStorage::Caches::create):
3267         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
3268         (WebKit::CacheStorageEngineConnection::~CacheStorageEngineConnection):
3269         (WebKit::CacheStorageEngineConnection::reference):
3270         (WebKit::CacheStorageEngineConnection::dereference):
3271         * NetworkProcess/cache/CacheStorageEngineConnection.h:
3272         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
3273         * WebProcess/Cache/WebCacheStorageConnection.cpp:
3274         (WebKit::WebCacheStorageConnection::reference):
3275         (WebKit::WebCacheStorageConnection::dereference):
3276         * WebProcess/Cache/WebCacheStorageConnection.h:
3277
3278 2017-09-06  Alex Christensen  <achristensen@webkit.org>
3279
3280         Add WKUIDelegatePrivate equivalent of WKPageUIClient's pinnedStateDidChange
3281         https://bugs.webkit.org/show_bug.cgi?id=176474
3282         <rdar://problem/29270035>
3283
3284         Reviewed by Tim Horton.
3285
3286         Rather than telling the UIClient that the pinned state changed and having the application check 4 bools
3287         like we do with WKPage, I made a KVO property on the WKWebView.  I introduce _WKRectEdge for this purpose,
3288         which is like UIRectEdge but unfortunately NSRectEdge and CGRectEdge cannot be used as NS_OPTIONS/flags.
3289         This same structure is used for rubber band state.
3290         
3291         Covered by a new API test.
3292
3293         * UIProcess/API/Cocoa/WKWebView.mm:
3294         (-[WKWebView _pinnedState]):
3295         (-[WKWebView _rubberBandState]):
3296         (-[WKWebView _setRubberBandState:]):
3297         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3298         * UIProcess/Cocoa/WebViewImpl.h:
3299         * UIProcess/Cocoa/WebViewImpl.mm:
3300         (WebKit::WebViewImpl::pinnedState):
3301         (WebKit::WebViewImpl::rubberBandState):
3302         (WebKit::WebViewImpl::setRubberBandState):
3303         * UIProcess/PageClient.h:
3304         (WebKit::PageClient::pinnedStateWillChange):
3305         (WebKit::PageClient::pinnedStateDidChange):
3306         * UIProcess/WebPageProxy.cpp:
3307         (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
3308         * UIProcess/mac/PageClientImplMac.h:
3309         * UIProcess/mac/PageClientImplMac.mm:
3310         (WebKit::PageClientImpl::pinnedStateWillChange):
3311         (WebKit::PageClientImpl::pinnedStateDidChange):
3312
3313 2017-09-06  Youenn Fablet  <youenn@apple.com>
3314
3315         Introduce asynchronous opening of CacheStorageEngine cache
3316         https://bugs.webkit.org/show_bug.cgi?id=176425
3317
3318         Reviewed by Alex Christensen.
3319
3320         Introducing Cache::open to allow reading from the filesystem to fill the Cache.
3321         This is called by Caches when engine requests to open an existing Cache.
3322
3323         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
3324         (WebKit::CacheStorage::Cache::Cache):
3325         (WebKit::CacheStorage::Cache::open):
3326         (WebKit::CacheStorage::Cache::finishOpening):
3327         (WebKit::CacheStorage::Cache::readRecordsList):
3328         * NetworkProcess/cache/CacheStorageEngineCache.h:
3329         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3330         (WebKit::CacheStorage::Caches::find):
3331         (WebKit::CacheStorage::Caches::open):
3332         (WebKit::CacheStorage::Caches::remove):
3333         (WebKit::CacheStorage::Caches::readCachesFromDisk):
3334         (WebKit::CacheStorage::Caches::find const): Deleted.
3335         * NetworkProcess/cache/CacheStorageEngineCaches.h:
3336
3337 2017-09-06  Alex Christensen  <achristensen@webkit.org>
3338
3339         Unreviewed, rolling out r221694.
3340
3341         broke build
3342
3343         Reverted changeset:
3344
3345         "Add WKUIDelegatePrivate equivalent of WKPageUIClient's
3346         pinnedStateDidChange"
3347         https://bugs.webkit.org/show_bug.cgi?id=176474
3348         http://trac.webkit.org/changeset/221694
3349
3350 2017-09-06  Ryan Haddad  <ryanhaddad@apple.com>
3351
3352         Unreviewed, rolling out r221461.
3353
3354         The LayoutTest added with this change crashes under
3355         GuardMalloc.
3356
3357         Reverted changeset:
3358
3359         "Add (entirely incorrect) fetching of ServiceWorker scripts."
3360         https://bugs.webkit.org/show_bug.cgi?id=176179
3361         http://trac.webkit.org/changeset/221461
3362
3363 2017-09-06  Alex Christensen  <achristensen@webkit.org>
3364
3365         Add modern decoders for POD types
3366         https://bugs.webkit.org/show_bug.cgi?id=176456
3367
3368         Reviewed by Geoffrey Garen.
3369
3370         * Platform/IPC/Decoder.cpp:
3371         (IPC::Decoder::getOptional):
3372         (IPC::Decoder::operator>>):
3373         * Platform/IPC/Decoder.h:
3374         * Shared/NavigationActionData.cpp:
3375         (WebKit::NavigationActionData::decode):
3376         * Shared/NavigationActionData.h:
3377
3378 2017-09-06  Alex Christensen  <achristensen@webkit.org>
3379
3380         Add WKUIDelegatePrivate equivalent of WKPageUIClient's pinnedStateDidChange
3381         https://bugs.webkit.org/show_bug.cgi?id=176474
3382         <rdar://problem/29270035>
3383
3384         Reviewed by Tim Horton.
3385
3386         Rather than telling the UIClient that the pinned state changed and having the application check 4 bools
3387         like we do with WKPage, I made a KVO property on the WKWebView.  I introduce _WKRectEdge for this purpose,
3388         which is like UIRectEdge but unfortunately NSRectEdge and CGRectEdge cannot be used as NS_OPTIONS/flags.
3389         This same structure is used for rubber band state.
3390         
3391         Covered by a new API test.
3392
3393         * UIProcess/API/Cocoa/WKWebView.mm:
3394         (-[WKWebView _pinnedState]):
3395         (-[WKWebView _rubberBandState]):
3396         (-[WKWebView _setRubberBandState:]):
3397         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3398         * UIProcess/Cocoa/WebViewImpl.h:
3399         * UIProcess/Cocoa/WebViewImpl.mm:
3400         (WebKit::WebViewImpl::pinnedState):
3401         (WebKit::WebViewImpl::rubberBandState):
3402         (WebKit::WebViewImpl::setRubberBandState):
3403         * UIProcess/PageClient.h:
3404         (WebKit::PageClient::pinnedStateWillChange):
3405         (WebKit::PageClient::pinnedStateDidChange):
3406         * UIProcess/WebPageProxy.cpp:
3407         (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
3408         * UIProcess/mac/PageClientImplMac.h:
3409         * UIProcess/mac/PageClientImplMac.mm:
3410         (WebKit::PageClientImpl::pinnedStateWillChange):
3411         (WebKit::PageClientImpl::pinnedStateDidChange):
3412
3413 2017-09-06  Brent Fulgham  <bfulgham@apple.com>
3414
3415         Deny third-party cookie creation for prevalent resources without interaction
3416         https://bugs.webkit.org/show_bug.cgi?id=175232
3417         <rdar://problem/33709386>
3418
3419         Reviewed by Alex Christensen.
3420
3421         Prior to Intelligent Tracking Prevention, WebKit would deny the ability to create a third party cookie if the user's
3422         settings prohibited it. Due to the internal mechanics of cookie partitioning, we now accept the third party cookie,
3423         but destroy it at some arbitrary moment which is difficult for websites to work with.
3424         
3425         This patch revises WebKit so that attempts to set third party cookies without user interaction fails immediately,
3426         which is what sites are expecting from Safari.
3427
3428         * NetworkProcess/NetworkProcess.cpp:
3429         (WebKit::NetworkProcess::updatePrevalentDomainsWithAndWithoutInteraction):
3430         (WebKit::NetworkProcess::updateCookiePartitioningForTopPrivatelyOwnedDomains): Renamed to updatePrevalentDomainsWithAndWithoutInteraction.
3431         * NetworkProcess/NetworkProcess.h:
3432         * NetworkProcess/NetworkProcess.messages.in: Renamed the UpdateCookiePartitioningForTopPrivatelyOwnedDomains message
3433         to UpdatePrevalentDomainsWithAndWithoutInteraction.
3434         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3435         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Recognize cases where a network session should block cookies, and
3436         use the stateless session so we fail immediately when attempting an invalid cookie set operation.
3437         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3438         (WebKit::WKWebsiteDataStore::_resourceLoadStatisticsSetShouldPartitionCookies): Use new helper function to clear partitioning state.
3439         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3440         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): Update for revised naming.
3441         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning): Track domains with and without interaction so that we can recognize
3442         domains that should be immediately blocked from setting cookies.
3443         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains): Update for revised naming.
3444         (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains): Added helper function for testing.
3445         * UIProcess/WebResourceLoadStatisticsStore.h:
3446         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3447         (WebKit::WebsiteDataStore::updatePrevalentDomainsWithAndWithoutInteraction): Update for revised naming.
3448         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback): Ditto.
3449         (WebKit::WebsiteDataStore::updateCookiePartitioningForTopPrivatelyOwnedDomains): Renamed to updatePrevalentDomainsWithAndWithoutInteraction.
3450         * UIProcess/WebsiteData/WebsiteDataStore.h:
3451
3452 2017-09-06  Adrian Perez de Castro  <aperez@igalia.com>
3453
3454         [WPE][CMake] Fix path to the WebKitApplicationInfo.h header.
3455
3456         Unreviewed build fix.
3457
3458         This doesn't really make a difference for the build bots, but it makes
3459         it possible to craft working release tarballs of WPE.
3460
3461         * PlatformWPE.cmake: Use the WPE version of WebKitApplicationInfo.h
3462
3463 2017-09-06  Frédéric Wang  <fwang@igalia.com>
3464
3465         Introduce ScrollingTreeScrollingNodeDelegateIOS to share code between overflow and frame scrolling
3466         https://bugs.webkit.org/show_bug.cgi?id=174097
3467
3468         Reviewed by Darin Adler.
3469
3470         This patch introduces a new ScrollingTreeScrollingNodeDelegateIOS that can be used by
3471         WKOverflowScrollViewDelegate to communicate to the scrolling tree and nodes. It can also be
3472         used as a helper class by ScrollingTreeOverflowScrollingNodeIOS. For now, only the non-
3473         overriden member functions of ScrollingTreeOverflowScrollingNodeIOS are moved to that new
3474         class. In follow-up commits, WKOverflowScrollViewDelegate can become a generic
3475         ScrollViewDelegate and more code can be moved into the ScrollingTreeScrollingNodeDelegateIOS
3476         file. Frame scrolling nodes will then be able to share the same UI code as overflow:auto when
3477         iOS frame scrolling is implemented (bug 149264).
3478
3479         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h: Move non-overriden member
3480         functions and m_updatingFromStateNode into the delegate class. Also define a member to store
3481         that delegate.
3482         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: Use the node delegate to
3483         communicate to the scrolling tree and node.
3484         (-[WKOverflowScrollViewDelegate initWithScrollingTreeNodeDelegate:]): Init with a delegate.
3485         (-[WKOverflowScrollViewDelegate scrollViewDidScroll:]): Call the delegate function.
3486         (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]): Ditto.
3487         (-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
3488         Use the delegate functions or pass by ScrollingTreeScrollingNodeDelegateIOS::scrollingNode().
3489         (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): Use the delegate
3490         functions.
3491         (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]): Ditto.
3492         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::ScrollingTreeOverflowScrollingNodeIOS):
3493         Init the delegate for this class.
3494         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren): Use the delegate.
3495         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): Use the delegate
3496         function.
3497         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterDelegatedScroll): Ditto.
3498         (-[WKOverflowScrollViewDelegate initWithScrollingTreeNode:]): Deleted. This is renamed
3499         initWithScrollingTreeNodeDelegate and accepts a delegate.
3500         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll): Deleted. Moved
3501         to ScrollingTreeScrollingNodeDelegateIOS.
3502         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollWillStart): Ditto.
3503         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollDidEnd): Ditto.
3504         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewWillStartPanGesture): Ditto.
3505         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll): Ditto.
3506         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::currentSnapPointIndicesDidChange): Ditto.
3507         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h: Added. New delegate class
3508         for ScrollingTreeOverflowScrollingNodeIOS. The members used by WKOverflowScrollViewDelegate
3509         are public and the others are private. ScrollingTreeOverflowScrollingNodeIOS is a friend of
3510         ScrollingTreeScrollingNodeDelegateIOS so that it can access private members e.g.
3511         updateChildNodesAfterScroll() or  m_updatingFromStateNode.
3512         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: Added.
3513         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::ScrollingTreeScrollingNodeDelegateIOS):
3514         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::~ScrollingTreeScrollingNodeDelegateIOS):
3515         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll): Code extracted
3516         from ScrollingTreeOverflowScrollingNodeIOS.
3517         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollWillStart): Ditto.
3518         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollDidEnd): Ditto.
3519         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewWillStartPanGesture): Ditto.
3520         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll): Ditto.
3521         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::currentSnapPointIndicesDidChange): Ditto.
3522         * WebKit.xcodeproj/project.pbxproj: Add ScrollingTreeScrollingNodeDelegateIOS files to the
3523         build system.
3524
3525 2017-09-05  Wenson Hsieh  <wenson_hsieh@apple.com>
3526