Add and remove cookie partition accordingly in intermediary redirect requests
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2017-10-17  John Wilander  <wilander@apple.com>
2
3         Add and remove cookie partition accordingly in intermediary redirect requests
4         https://bugs.webkit.org/show_bug.cgi?id=178369
5         <rdar://problem/34467603>
6
7         Reviewed by Brent Fulgham.
8
9         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
10         (WebKit::shouldChangePartition):
11             Convenience function. Comment documents the logic.
12         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
13             Now adds and removes cookie partition based on the
14             redirect-to URL's domain.
15         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
16         (WKBundleResourceLoadStatisticsNotifyObserver):
17             Test infrastructure.
18         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
19
20 2017-10-17  Youenn Fablet  <youenn@apple.com>
21
22         Cache API implementation should be able to compute storage size for WebKit client applications.
23         https://bugs.webkit.org/show_bug.cgi?id=178350
24
25         Reviewed by Chris Dumez.
26
27         When gathering data from DOM Cache, we compute the size as follows:
28         - If Caches object is not persistent, size is zero
29         - If Caches object is persistent, we use the size computed by NetworkCache::Storage. 
30         Covered by updated tests.
31
32         * NetworkProcess/cache/CacheStorageEngine.cpp:
33         (WebKit::CacheStorage::ReadOriginsTaskCounter::create):
34         (WebKit::CacheStorage::ReadOriginsTaskCounter::addOrigin):
35         (WebKit::CacheStorage::Engine::fetchEntries):
36         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
37         (WebKit::CacheStorage::Caches::storageSize const):
38         * NetworkProcess/cache/CacheStorageEngineCaches.h:
39         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
40         (WKWebsiteDataStoreGetFetchCacheSizeForOrigin):
41         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
42
43 2017-10-17  Keith Miller  <keith_miller@apple.com>
44
45         Change WebCore sources to work with unified source builds
46         https://bugs.webkit.org/show_bug.cgi?id=178229
47
48         Rubber stamped by Tim Horton.
49
50         * Configurations/FeatureDefines.xcconfig:
51
52 2017-10-16  Wenson Hsieh  <wenson_hsieh@apple.com>
53
54         Unreviewed, fix the iOS build after r223431
55
56         Remove an unused variable captured in a lambda.
57
58         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
59         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
60
61 2017-10-12  Matt Rajca  <mrajca@apple.com>
62
63         Add API support for quirk that lets an arbitrary click allow auto-play.
64         https://bugs.webkit.org/show_bug.cgi?id=178227
65
66         Reviewed by Alex Christensen.
67
68         Instead of hardcoding sites in WebCore, let API clients control which websites opt into the quirk that lets
69         an arbitrary click allow auto-play via website policies.
70
71         * Shared/WebsitePolicies.h:
72         * UIProcess/API/C/WKWebsitePolicies.cpp:
73         (WKWebsitePoliciesSetAllowedAutoplayQuirks):
74         (WKWebsitePoliciesGetAllowedAutoplayQuirks):
75         * UIProcess/API/C/WKWebsitePolicies.h:
76         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
77         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
78         (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]):
79         (-[_WKWebsitePolicies allowedAutoplayQuirks]):
80         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
81         (WebKit::WebFrameLoaderClient::applyToDocumentLoader):
82         * WebProcess/WebPage/WebPage.cpp:
83         (WebKit::WebPage::updateWebsitePolicies):
84
85 2017-10-16  Andy Estes  <aestes@apple.com>
86
87         [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError
88         https://bugs.webkit.org/show_bug.cgi?id=178191
89         <rdar://problem/34906367>
90
91         Reviewed by Tim Horton.
92
93         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
94         (WebKit::toNSError):
95
96 2017-10-16  Tim Horton  <timothy_horton@apple.com>
97
98         Safari crashes after searching PDF (under [WKPDFView zoom:to:atPoint:kind:])
99         https://bugs.webkit.org/show_bug.cgi?id=178358
100         <rdar://problem/34676899>
101
102         Reviewed by Wenson Hsieh.
103
104         * UIProcess/ios/WKPDFView.mm:
105         (-[WKPDFView _didFindMatch:]):
106         UIPDFSelection can return a null rect as the selection's bounds.
107         We can't zoom to a null rect (and doing so results in CA throwing an
108         exception later).
109
110 2017-10-16  Alex Christensen  <achristensen@webkit.org>
111
112         Add a _WKThumbnailView initializer with a WKWebView
113         https://bugs.webkit.org/show_bug.cgi?id=178351
114         <rdar://problem/34979453>
115
116         Reviewed by Tim Horton.
117
118         * UIProcess/API/Cocoa/WKWebView.mm:
119         (-[WKWebView _page]):
120         (-[WKWebView _setThumbnailView:]):
121         (-[WKWebView _thumbnailView]):
122         (-[WKWebView _setIgnoresAllEvents:]):
123         (-[WKWebView _ignoresAllEvents]):
124         * UIProcess/API/Cocoa/WKWebViewInternal.h:
125         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
126         * UIProcess/API/Cocoa/_WKThumbnailView.h:
127         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
128         (-[_WKThumbnailView initWithFrame:fromWKWebView:]):
129         (-[_WKThumbnailView _viewWasUnparented]):
130         (-[_WKThumbnailView _viewWasParented]):
131
132 2017-10-16  Alex Christensen  <achristensen@webkit.org>
133
134         Expose more WKView properties as WKWebViewPrivate SPI
135         https://bugs.webkit.org/show_bug.cgi?id=178349
136         <rdar://problem/34980919>
137
138         Reviewed by Tim Horton.
139
140         _backgroundExtendsBeyondPage was already exposed on iOS, but we need it on Mac, too.
141         A few other properties also need exposing.
142
143         * UIProcess/API/Cocoa/WKWebView.mm:
144         (toAPIScrollbarStyle):
145         (toCoreScrollbarStyle):
146         (-[WKWebView _setBackgroundExtendsBeyondPage:]):
147         (-[WKWebView _backgroundExtendsBeyondPage]):
148         (-[WKWebView _setOverlayScrollbarStyle:]):
149         (-[WKWebView _overlayScrollbarStyle]):
150         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
151
152 2017-10-16  Chris Dumez  <cdumez@apple.com>
153
154         Log using differential privacy domains where the WebContent process crashes
155         https://bugs.webkit.org/show_bug.cgi?id=178346
156         <rdar://problem/33293830>
157
158         Reviewed by Alex Christensen.
159
160         * UIProcess/WebPageProxy.cpp:
161         (WebKit::WebPageProxy::reload):
162         (WebKit::WebPageProxy::currentURL const):
163         (WebKit::WebPageProxy::processDidTerminate):
164         * UIProcess/WebPageProxy.h:
165         * UIProcess/WebProcessProxy.cpp:
166         (WebKit::WebProcessProxy::didClose):
167
168 2017-10-16  Youenn Fablet  <youenn@apple.com>
169
170         Activate Cache API by default
171         https://bugs.webkit.org/show_bug.cgi?id=178186
172
173         Reviewed by Chris Dumez.
174
175         * Shared/WebPreferencesDefinitions.h:
176
177 2017-10-16  Sam Weinig  <sam@webkit.org>
178
179         [Settings] Remove all custom code from Settings.h/cpp
180         https://bugs.webkit.org/show_bug.cgi?id=178330
181
182         Reviewed by Simon Fraser.
183
184         * Shared/WebPreferencesDefinitions.h:
185         * UIProcess/API/C/WKPreferences.cpp:
186         (WKPreferencesSetFrameFlatteningEnabled):
187         (WKPreferencesGetFrameFlatteningEnabled):
188         * UIProcess/API/glib/WebKitSettings.cpp:
189         (webkit_settings_get_enable_frame_flattening):
190         (webkit_settings_set_enable_frame_flattening):
191         * WebProcess/InjectedBundle/InjectedBundle.cpp:
192         (WebKit::InjectedBundle::setFrameFlatteningEnabled):
193         
194             Update for naming changes of FrameFlattening now that it is an enum class.
195
196         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
197         (WebKit::WebChromeClient::contentsSizeChanged const):
198
199             Ge the effectiveFrameFlattening from the FrameView, rather than the Settings.
200
201 2017-10-16  Chris Dumez  <cdumez@apple.com>
202
203         [WK2][NetworkSession] Add support for resuming downloads
204         https://bugs.webkit.org/show_bug.cgi?id=177625
205         <rdar://problem/34345975>
206
207         Reviewed by Alex Christensen.
208
209         Add support for resuming downloads for the WK2 NETWORK_SESSION code path.
210
211         This was tested manually. I was unable to write an API test because our tests
212         do not run an HTTP server and CFNetwork does not seem to generate resume data
213         when cancelling a download over non-HTTP.
214
215         * NetworkProcess/Downloads/Download.cpp:
216         (WebKit::Download::didReceiveChallenge):
217         (WebKit::Download::continueCanAuthenticateAgainstProtectionSpace):
218         * NetworkProcess/Downloads/Download.h:
219         * NetworkProcess/Downloads/DownloadManager.cpp:
220         (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace):
221         (WebKit::DownloadManager::resumeDownload):
222         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
223         (WebKit::Download::resume):
224         This currently includes a workaround for <rdar://problem/34745171>. We update the
225         resume data to include the NSURLSessionResumeInfoLocalPath key with the final
226         destination path so that CFNetwork looks for the temporary data at the right
227         location.
228
229         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
230         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
231         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
232         (WebKit::NetworkSessionCocoa::downloadTaskWithResumeData):
233         * Shared/Authentication/AuthenticationManager.cpp:
234         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
235         * Shared/Authentication/AuthenticationManager.h:
236
237 2017-10-16  Adrian Perez de Castro  <aperez@igalia.com>
238
239         [WPE] Build failure due to invalid cast of EGLNativeWindowType when targetting 64-bit ARM
240         https://bugs.webkit.org/show_bug.cgi?id=178090
241
242         Reviewed by Michael Catanzaro.
243
244         EGLNativeWindowType can be aliased to a different type depending (at least) on the EGL
245         implementation, its build options, and the libepoxy build options.  Using "static_cast"
246         works when it is a numeric value and the width of the value needs to be optionally
247         extended to 64 bits (e.g. the EGL type is "int" in a 32-bit CPU) but not for pointers,
248         and using "reinterpret_cast" works when the size of a pointer is 64 bits but not in other
249         cases. Therefore it seems reasonable to use a plain C cast expression to solve this
250         particular situation.
251
252         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
253         (WebKit::AcceleratedSurfaceWPE::window const): Use a good old plain C cast expression.
254
255 2017-10-16  Chris Dumez  <cdumez@apple.com>
256
257         Clicks on Link with download attribute causes all (other) links to trigger download when clicked
258         https://bugs.webkit.org/show_bug.cgi?id=178267
259         <rdar://problem/34985016>
260
261         Reviewed by Darin Adler.
262
263         When clicking on an anchor with the download attribute, the m_syncNavigationActionHasDownloadAttribute
264         flag on WebPageProxy would get set. This flag would not get reset right away and instead, it would get
265         updated during the next call to WebPageProxy::decidePolicyForNavigationAction(). The issue is that if
266         you later click on a link with target="_blank", WebPageProxy::decidePolicyForNewWindowAction() gets
267         called instead of WebPageProxy::decidePolicyForNavigationAction() and we do not reset the
268         m_syncNavigationActionHasDownloadAttribute flag and we force a download.
269
270         To address the problem, I got rid of this flag on WebPageProxy and it is error-prone and should really
271         not be at page-level. Instead, I added a shouldForceDownload flag on the navigation object. It makes
272         more sense to associate the flag with the navigation and makes it less error-prone.
273
274         * UIProcess/API/APINavigation.h:
275         (API::Navigation::setShouldForceDownload):
276         (API::Navigation::shouldForceDownload const):
277         * UIProcess/WebPageProxy.cpp:
278         (WebKit::WebPageProxy::receivedPolicyDecision):
279         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
280         * UIProcess/WebPageProxy.h:
281
282 2017-10-16  Ryan Haddad  <ryanhaddad@apple.com>
283
284         Unreviewed, rolling out r223271.
285
286         This change introduced LayoutTest failures on WK1.
287
288         Reverted changeset:
289
290         "Use asynchronous ResourceHandleClient calls for WebKit1"
291         https://bugs.webkit.org/show_bug.cgi?id=160677
292         https://trac.webkit.org/changeset/223271
293
294 2017-10-13  Youenn Fablet  <youenn@apple.com>
295
296         Implement listing origins for which CacheStorage is storing data
297         https://bugs.webkit.org/show_bug.cgi?id=178236
298
299         Reviewed by Chris Dumez.
300
301         Cache storage is split on per-origin folders which name is obfuscated through salting.
302         To retrieve the origin for each folder, an origin file is now stored within each folder.
303         This file contains the actual origin.
304
305         Adding support to get the list of origin by iterating through each folder and
306         getting the actual origin by reading the content of the 'origin' file.
307
308         Adding C API for WebKitTestRunner.
309
310         * NetworkProcess/cache/CacheStorageEngine.cpp:
311         (WebKit::CacheStorage::Engine::fetchEntries):
312         (WebKit::CacheStorage::ReadOriginsTaskCounter::create):
313         (WebKit::CacheStorage::ReadOriginsTaskCounter::~ReadOriginsTaskCounter):
314         (WebKit::CacheStorage::ReadOriginsTaskCounter::addOrigin):
315         (WebKit::CacheStorage::ReadOriginsTaskCounter::ReadOriginsTaskCounter):
316         * NetworkProcess/cache/CacheStorageEngine.h:
317         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
318         (WebKit::CacheStorage::cachesOriginFilename):
319         (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory):
320         (WebKit::CacheStorage::Caches::Caches):
321         (WebKit::CacheStorage::Caches::storeOrigin):
322         (WebKit::CacheStorage::Caches::readOrigin):
323         (WebKit::CacheStorage::Caches::initialize):
324         * NetworkProcess/cache/CacheStorageEngineCaches.h:
325         (WebKit::CacheStorage::Caches::origin const):
326         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
327         (WKWebsiteDataStoreGetFetchCacheOrigins):
328         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
329
330 2017-10-13  Alex Christensen  <achristensen@webkit.org>
331
332         Fix API tests after r223269.
333         https://bugs.webkit.org/show_bug.cgi?id=178246
334
335         * UIProcess/API/APIContentRuleListStore.cpp:
336         (API::ContentRuleListStore::getContentRuleListSource):
337         Version 10 also has the ability to recover content rule list source.
338
339 2017-10-11  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
340
341         [GLib] WebKitNavigationAction should tell whether it is a redirect
342         https://bugs.webkit.org/show_bug.cgi?id=178178
343
344         There is no good way to know whether a given navigation action has been caused
345         by a redirect through the glib API. This is necessary to implement some app mode
346         heuristics for Epiphany.
347
348         Reviewed by Carlos Garcia Campos.
349
350         * UIProcess/API/glib/WebKitNavigationAction.cpp:
351         (webkit_navigation_action_is_redirect): returns whether the navigation action is a redirect.
352         * UIProcess/API/glib/WebKitNavigationActionPrivate.h: add isRedirect to the wrapper object.
353         (_WebKitNavigationAction::_WebKitNavigationAction):
354         * UIProcess/API/gtk/WebKitNavigationAction.h: add the new API.
355         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: ditto.
356         * UIProcess/API/wpe/WebKitNavigationAction.h: ditto.
357
358 2017-10-12  Brady Eidson  <beidson@apple.com>
359
360         SW "Hello world".
361         https://bugs.webkit.org/show_bug.cgi?id=178187
362
363         Reviewed by Andy Estes.
364
365         * WebProcess/WebProcess.cpp:
366         (WebKit::WebProcess::startServiceWorkerContext):
367
368 2017-10-12  Alex Christensen  <achristensen@webkit.org>
369
370         Remove unnecessary includes in WebKit
371         https://bugs.webkit.org/show_bug.cgi?id=178235
372
373         Reviewed by Tim Horton.
374
375         * Platform/IPC/ArgumentCoders.h:
376         * WebProcess/WebProcess.cpp:
377         * WebProcess/WebStorage/StorageAreaImpl.h:
378
379 2017-10-12  Alex Christensen  <achristensen@webkit.org>
380
381         Increment ContentRuleListStore::CurrentContentRuleListFileVersion
382         https://bugs.webkit.org/show_bug.cgi?id=178246
383         <rdar://problem/34890057>
384
385         Reviewed by Tim Horton.
386
387         * UIProcess/API/APIContentRuleListStore.h:
388         Things are crashing.  Something isn't binary reverse compatible.
389         Probably something related to r222602.
390         This is why we have a version number to update.
391
392 2017-10-12  Alex Christensen  <achristensen@webkit.org>
393
394         Expose some of WKView's WebViewImpl accessors through WKWebViewPrivate
395         https://bugs.webkit.org/show_bug.cgi?id=178240
396         <rdar://problem/34962720>
397
398         Reviewed by Tim Horton.
399         
400         Also renamed createFullScreenWindow to fullScreenWindow to reflect the fact that it returns
401         an autoreleased NSWindow so we don't make the same naming mistake in the WKWebView SPI.
402
403         * UIProcess/API/Cocoa/WKWebView.mm:
404         (-[WKWebView _dismissContentRelativeChildWindows]):
405         (-[WKWebView _setFrame:andScrollBy:]):
406         (-[WKWebView _setTotalHeightOfBanners:]):
407         (-[WKWebView _totalHeightOfBanners]):
408         (-[WKWebView _beginDeferringViewInWindowChanges]):
409         (-[WKWebView _endDeferringViewInWindowChanges]):
410         (-[WKWebView _endDeferringViewInWindowChangesSync]):
411         (-[WKWebView _gestureEventWasNotHandledByWebCore:]):
412         (-[WKWebView _setIgnoresNonWheelEvents:]):
413         (-[WKWebView _ignoresNonWheelEvents]):
414         (-[WKWebView _setCustomSwipeViews:]):
415         (-[WKWebView _setCustomSwipeViewsTopContentInset:]):
416         (-[WKWebView _tryToSwipeWithEvent:ignoringPinnedState:]):
417         (-[WKWebView _setDidMoveSwipeSnapshotCallback:]):
418         (-[WKWebView _fullScreenPlaceholderView]):
419         (-[WKWebView _fullScreenWindow]):
420         (-[WKWebView _disableFrameSizeUpdates]):
421         (-[WKWebView _enableFrameSizeUpdates]):
422         (-[WKWebView _canChangeFrameLayout:]):
423         (-[WKWebView _underlayColor]):
424         (-[WKWebView _setUnderlayColor:]):
425         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
426         * UIProcess/API/mac/WKView.mm:
427         (-[WKView createFullScreenWindow]):
428         * UIProcess/Cocoa/WebViewImpl.h:
429         * UIProcess/Cocoa/WebViewImpl.mm:
430         (WebKit::WebViewImpl::fullScreenWindowController):
431         (WebKit::WebViewImpl::fullScreenWindow):
432         (WebKit::WebViewImpl::createFullScreenWindow): Deleted.
433
434 2017-10-12  Youenn Fablet  <youenn@apple.com>
435
436         Layout Test http/tests/cache-storage/cache-clearing.https.html is failing
437         https://bugs.webkit.org/show_bug.cgi?id=178200
438
439         Reviewed by Chris Dumez.
440
441         Deleting only the per-origin folders inside the CacheStorage engine root folder.
442
443         * NetworkProcess/cache/CacheStorageEngine.cpp:
444         (WebKit::CacheStorage::Engine::clearAllCaches):
445         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
446         (WKWebsiteDataStoreRemoveAllFetchCaches):
447         (WKWebsiteDataStoreRemoveFetchCacheForOrigin):
448         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
449
450 2017-10-12  Chris Dumez  <cdumez@apple.com>
451
452         [Mac] Add support for MouseEvent.buttons
453         https://bugs.webkit.org/show_bug.cgi?id=178214
454
455         Reviewed by Ryosuke Niwa.
456
457         * Shared/WebEvent.h:
458         (WebKit::WebMouseEvent::buttons const):
459         * Shared/WebEventConversion.cpp:
460         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
461         * Shared/WebMouseEvent.cpp:
462         (WebKit::WebMouseEvent::WebMouseEvent):
463         (WebKit::WebMouseEvent::encode const):
464         (WebKit::WebMouseEvent::decode):
465         * Shared/mac/WebEventFactory.mm:
466         (WebKit::currentlyPressedMouseButtons):
467         (WebKit::WebEventFactory::createWebMouseEvent):
468         * WebProcess/Plugins/PDF/PDFPlugin.mm:
469         (WebKit::PDFPlugin::showContextMenuAtPoint):
470         * WebProcess/Plugins/PluginView.cpp:
471         (WebKit::PluginView::createWebEvent const):
472         * WebProcess/WebPage/WebPage.cpp:
473         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
474         (WebKit::WebPage::simulateMouseDown):
475         (WebKit::WebPage::simulateMouseUp):
476         (WebKit::WebPage::simulateMouseMotion):
477
478 2017-10-12  Youenn Fablet  <youenn@apple.com>
479
480         Add API to clean CacheStorage data
481         https://bugs.webkit.org/show_bug.cgi?id=178034
482
483         Unreviewed.
484
485         * Shared/WebsiteData/WebsiteDataType.h: fixing the DOMCache value. 
486
487 2017-10-12  Stephan Szabo  <stephan.szabo@sony.com>
488
489         [WinCairo] add WebProcess files for wincairo webkit
490         https://bugs.webkit.org/show_bug.cgi?id=178024
491
492         Reviewed by Alex Christensen.
493
494         * PlatformWin.cmake:
495         * WebProcess/Cookies/curl/WebCookieManagerCurl.cpp: Added.
496         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
497         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy):
498         * WebProcess/InjectedBundle/win/InjectedBundleWin.cpp: Added.
499         (WebKit::InjectedBundle::initialize):
500         (WebKit::InjectedBundle::setBundleParameter):
501         (WebKit::InjectedBundle::setBundleParameters):
502         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
503         * WebProcess/Plugins/Netscape/win/PluginProxyWin.cpp: Added.
504         (WebKit::PluginProxy::needsBackingStore const):
505         * WebProcess/WebCoreSupport/win/WebContextMenuClientWin.cpp: Added.
506         (WebKit::WebContextMenuClient::lookUpInDictionary):
507         (WebKit::WebContextMenuClient::isSpeaking):
508         (WebKit::WebContextMenuClient::speak):
509         (WebKit::WebContextMenuClient::stopSpeaking):
510         * WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.cpp: Added.
511         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
512         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
513         (WebKit::WebFrameNetworkingContext::WebFrameNetworkingContext):
514         (WebKit::WebFrameNetworkingContext::storageSession const):
515         (WebKit::WebFrameNetworkingContext::webFrameLoaderClient const):
516         (WebKit::WebFrameNetworkingContext::blockedError const):
517         * WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h: Added.
518         (WebKit::WebFrameNetworkingContext::create):
519         * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp: Added.
520         (WebKit::WebPopupMenu::setUpPlatformData):
521         * WebProcess/WebPage/win/WebInspectorUIWin.cpp: Added.
522         (WebKit::WebInspectorUI::canSave):
523         (WebKit::WebInspectorUI::localizedStringsURL):
524         (WebKit::RemoteWebInspectorUI::localizedStringsURL):
525         * WebProcess/WebPage/win/WebPageWin.cpp: Added.
526         (WebKit::WebPage::platformInitialize):
527         (WebKit::WebPage::platformDetach):
528         (WebKit::WebPage::platformEditorState const):
529         (WebKit::WebPage::platformPreferencesDidChange):
530         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
531         (WebKit::WebPage::platformHasLocalDataForURL):
532         (WebKit::WebPage::cachedResponseMIMETypeForURL):
533         (WebKit::WebPage::platformCanHandleRequest):
534         (WebKit::WebPage::cachedSuggestedFilenameForURL):
535         (WebKit::WebPage::cachedResponseDataForURL):
536         (WebKit::WebPage::platformUserAgent const):
537         (WebKit::WebPage::interpretKeyEvent):
538         * WebProcess/WebProcess.cpp:
539         (WebKit::WebProcess::ensureWebToStorageProcessConnection):
540         * WebProcess/win/WebProcessWin.cpp: Added.
541         (loadResourceIntoBuffer):
542         (WebKit::WebProcess::platformInitializeWebProcess):
543         (WebKit::WebProcess::platformTerminate):
544         (WebKit::WebProcess::platformSetCacheModel):
545
546 2017-10-12  David Kilzer  <ddkilzer@apple.com>
547
548         [iOS] Fix -Wunused-lambda-capture warnings in WebCore/WebKit with new clang compiler
549         <https://webkit.org/b/178226>
550
551         Reviewed by Chris Fleizach.
552
553         * UIProcess/ios/WKContentViewInteraction.mm:
554         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:withFlags:]):
555         - Remove unused lambda variable 'touch' which was also passed as
556           an argument.
557         (-[WKContentView changeSelectionWithTouchesFrom:to:withGesture:withState:]):
558         - Remove unused lambda variable 'gestureState' which was also
559           passed as an argument.
560         (-[WKContentView _simulateLongPressActionAtLocation:]):
561         - Remove unused lambda variable 'location'.
562
563 2017-10-12  John Wilander  <wilander@apple.com>
564
565         ResourceLoadObserver::logFrameNavigation() should use redirectResponse.url()
566         https://bugs.webkit.org/show_bug.cgi?id=175257
567         <rdar://problem/33359866>
568
569         Reviewed by Brent Fulgham.
570
571         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
572         (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsSubFrameUnder:topFrameHost:completionHandler:]):
573         (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsRedirectingTo:hostRedirectedTo:completionHandler:]):
574             Test infrastructure.
575         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
576         * UIProcess/WebResourceLoadStatisticsStore.cpp:
577         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
578         (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
579             Test infrastructure.
580         * UIProcess/WebResourceLoadStatisticsStore.h:
581
582 2017-10-12  Andy Estes  <aestes@apple.com>
583
584         [iOS] Conditionally rename DatabaseProcess to StorageProcess when building for iOS devices
585         https://bugs.webkit.org/show_bug.cgi?id=178181
586         <rdar://problem/33660282>
587
588         Reviewed by Dan Bernstein.
589
590         * Configurations/BaseTarget.xcconfig:
591         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
592         (WebKit::serviceName):
593         * WebKit.xcodeproj/project.pbxproj:
594
595 2017-10-12  Youenn Fablet  <youenn@apple.com>
596
597         CacheStorage persistent folder should be in /Library/Cache
598         https://bugs.webkit.org/show_bug.cgi?id=178193
599
600         Reviewed by Brady Eidson.
601
602         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
603         (API::WebsiteDataStore::defaultCacheStorageDirectory): Making CacheStorage
604         directory a subfolder of Caches folder.
605         (API::WebsiteDataStore::defaultDataStoreConfiguration):
606         * UIProcess/WebProcessPool.cpp:
607         (WebKit::legacyWebsiteDataStoreConfiguration):
608         (WebKit::WebProcessPool::ensureNetworkProcess): Make sure the web site data store
609         has the right cache directory path. Also make sure that the quota is set even if there is no folder specified.
610         Quota may still be useful in case of non persistent sessions.
611         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
612         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
613         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
614         (API::WebsiteDataStore::defaultCacheStorageDirectory):
615
616 2017-10-11  Sam Weinig  <sam@webkit.org>
617
618         Remove out-parameter variants of copyToVector
619         https://bugs.webkit.org/show_bug.cgi?id=178155
620
621         Reviewed by Tim Horton.
622
623         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
624         (-[_WKRemoteObjectInterface debugDescription]):
625         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
626         (WebKit::dump):
627         * UIProcess/WebPageProxy.cpp:
628         (WebKit::WebPageProxy::resetState):
629         * UIProcess/WebProcessPool.cpp:
630         (WebKit::WebProcessPool::createNewWebProcess):
631         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
632         (WebKit::WebsiteDataStore::parameters):
633         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
634         (WebKit::WebsiteDataStore::pendingCookies const):
635         * UIProcess/ios/ProcessAssertionIOS.mm:
636         (-[WKProcessAssertionBackgroundTaskManager _notifyClientsOfImminentSuspension]):
637         * WebProcess/Cookies/WebCookieManager.cpp:
638         (WebKit::WebCookieManager::getHostnamesWithCookies):
639         * WebProcess/Geolocation/WebGeolocationManager.cpp:
640         (WebKit::WebGeolocationManager::didChangePosition):
641         (WebKit::WebGeolocationManager::didFailToDeterminePosition):
642         * WebProcess/Network/WebLoaderStrategy.cpp:
643         (WebKit::WebLoaderStrategy::internallyFailedLoadTimerFired):
644
645             Replace out-parameter based copyToVector, with one that returns a Vector.
646
647 2017-10-11  Jaehun Lim  <ljaehun.lim@samsung.com>
648
649         Fix debug build
650
651         Unreviewed.
652
653         Add ENABLE(SERVICE_WORKER) guard.
654
655         * UIProcess/WebProcessPool.cpp:
656         (WebKit::WebProcessPool::createWebPage):
657
658 2017-10-11  Youenn Fablet  <youenn@apple.com>
659
660         Add API to clean CacheStorage data
661         https://bugs.webkit.org/show_bug.cgi?id=178034
662
663         Unreviewed.
664
665         * NetworkProcess/NetworkProcess.cpp:
666         (WebKit::NetworkProcess::fetchWebsiteData): Fixing lifetime of aggregator.
667
668 2017-10-11  Youenn Fablet  <youenn@apple.com>
669
670         Add API to clean CacheStorage data
671         https://bugs.webkit.org/show_bug.cgi?id=178034
672
673         Reviewed by Chris Dumez.
674
675         Introducing a new website data type for DOMCache.
676         Adding API to delete DOMCache for a given origin or for all origins.
677         This is added to WKWebsiteDataStore.
678
679         Cleaning a CacheStorage will remove all data in the Cache object but the object will stay live
680         for the duration of the NetworkProcess.
681         This allows ensuring that once a cache is cleaned, WebProcess will update to this new state.
682
683         Fetching of WebsiteData for DOMCache is not implemented yet since we do not keep a list of all origins for which we have data.
684
685         * NetworkProcess/NetworkProcess.cpp:
686         (WebKit::fetchDOMCacheEntries):
687         (WebKit::NetworkProcess::fetchWebsiteData):
688         (WebKit::NetworkProcess::deleteWebsiteData):
689         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
690         * NetworkProcess/cache/CacheStorageEngine.cpp:
691         (WebKit::CacheStorage::Engine::cachesRootPath):
692         (WebKit::CacheStorage::Engine::fetchEntries):
693         (WebKit::CacheStorage::ClearTasksHandler::ClearTasksHandler):
694         (WebKit::CacheStorage::ClearTasksHandler::~ClearTasksHandler):
695         (WebKit::CacheStorage::Engine::clearEngines):
696         (WebKit::CacheStorage::Engine::clearCachesForOrigins):
697         (WebKit::CacheStorage::Engine::readCachesFromDisk):
698         (WebKit::CacheStorage::deleteFolder):
699         (WebKit::CacheStorage::Engine::clearCaches):
700         (WebKit::CacheStorage::Engine::unlock): Removing the assertion as Cache objects are removed when clearing data.
701         * NetworkProcess/cache/CacheStorageEngine.h:
702         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
703         (WebKit::CacheStorage::Caches::Caches):
704         (WebKit::CacheStorage::Caches::clear):
705         * NetworkProcess/cache/CacheStorageEngineCaches.h:
706         (WebKit::CacheStorage::Caches::create):
707         * Shared/WebsiteData/WebsiteDataType.h:
708         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
709         (WKWebsiteDataStoreRemoveAllDOMCaches):
710         (WKWebsiteDataStoreRemoveDOMCacheForOrigin):
711         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
712         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
713         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
714         (dataTypesToString):
715         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
716         (WebKit::toWebsiteDataType):
717         (WebKit::toWKWebsiteDataTypes):
718         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
719         (+[WKWebsiteDataStore allWebsiteDataTypes]):
720         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
721         (WebKit::computeNetworkProcessAccessTypeForDataFetch):
722         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
723
724 2017-10-11  Chris Dumez  <cdumez@apple.com>
725
726         [Geolocation] Expose Coordinates.floorLevel
727         https://bugs.webkit.org/show_bug.cgi?id=178173
728         <rdar://problem/34918936>
729
730         Reviewed by Ryosuke Niwa.
731
732         * UIProcess/API/C/WKGeolocationPosition.cpp:
733         (WKGeolocationPositionCreate):
734         (WKGeolocationPositionCreate_b):
735         (WKGeolocationPositionCreate_c):
736         * UIProcess/API/C/WKGeolocationPosition.h:
737
738 2017-10-11  Youenn Fablet  <youenn@apple.com>
739
740         Bump default cache storage quota to 20MB
741         https://bugs.webkit.org/show_bug.cgi?id=178132
742
743         Reviewed by Alex Christensen.
744
745         Adding the ability to set the quota per origin through WebsiteDataStore.
746         Moving cache storage directory setting also in WebsiteDataStore.
747
748         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
749         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
750         * NetworkProcess/NetworkProcess.cpp:
751         (WebKit::NetworkProcess::initializeNetworkProcess):
752         * NetworkProcess/mac/RemoteNetworkingContext.mm:
753         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
754         * Shared/WebsiteDataStoreParameters.cpp:
755         (WebKit::WebsiteDataStoreParameters::encode const):
756         (WebKit::WebsiteDataStoreParameters::decode):
757         * Shared/WebsiteDataStoreParameters.h:
758         * UIProcess/API/APIProcessPoolConfiguration.cpp:
759         (API::ProcessPoolConfiguration::createWithLegacyOptions):
760         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
761         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
762         (API::ProcessPoolConfiguration::copy):
763         * UIProcess/API/APIProcessPoolConfiguration.h:
764         * UIProcess/API/C/WKContextConfigurationRef.cpp:
765         * UIProcess/API/C/WKContextConfigurationRef.h:
766         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
767         (-[WKWebsiteDataStore _cacheStoragePerOriginQuota]):
768         (-[WKWebsiteDataStore _setCacheStoragePerOriginQuota:]):
769         (-[WKWebsiteDataStore _cacheStorageDirectory]):
770         (-[WKWebsiteDataStore _setCacheStorageDirectory:]):
771         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
772         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
773         * UIProcess/WebProcessPool.cpp:
774         (WebKit::legacyWebsiteDataStoreConfiguration):
775         (WebKit::WebProcessPool::ensureNetworkProcess):
776         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
777         * UIProcess/WebProcessPool.h:
778         * UIProcess/WebsiteData/WebsiteDataStore.h:
779         (WebKit::WebsiteDataStore::cacheStoragePerOriginQuota const):
780         (WebKit::WebsiteDataStore::setCacheStoragePerOriginQuota):
781         (WebKit::WebsiteDataStore::cacheStorageDirectory const):
782         (WebKit::WebsiteDataStore::setCacheStorageDirectory):
783
784 2017-10-11  Myles C. Maxfield  <mmaxfield@apple.com>
785
786         Allow PAL to log messages
787         https://bugs.webkit.org/show_bug.cgi?id=171523
788
789         Reviewed by Alex Christensen.
790
791         * Platform/Logging.h:
792         * Scripts/generate-forwarding-headers.pl:
793
794 2017-10-11  Ryosuke Niwa  <rniwa@webkit.org>
795
796         Sanitize URL in pasteboard for other applications and cross origin content
797         https://bugs.webkit.org/show_bug.cgi?id=178060
798         <rdar://problem/34874518>
799
800         Reviewed by Wenson Hsieh.
801
802         Plubmed the origin identifier through IPC from Pasteboard in WebContent process to PlatformPasteboard in UIProcess.
803
804         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
805         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
806         * UIProcess/WebPasteboardProxy.cpp:
807         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
808         * UIProcess/WebPasteboardProxy.h:
809         * UIProcess/WebPasteboardProxy.messages.in:
810         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
811         (WebKit::WebPlatformStrategies::typesSafeForDOMToReadAndWrite):
812         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
813
814 2017-10-11  Chris Dumez  <cdumez@apple.com>
815
816         Modernize Geolocation code
817         https://bugs.webkit.org/show_bug.cgi?id=178148
818
819         Reviewed by Ryosuke Niwa.
820
821         * Shared/WebGeolocationPosition.cpp:
822         (WebKit::WebGeolocationPosition::create):
823         (WebKit::WebGeolocationPosition::~WebGeolocationPosition):
824         * Shared/WebGeolocationPosition.h:
825         (WebKit::WebGeolocationPosition::timestamp const):
826         (WebKit::WebGeolocationPosition::latitude const):
827         (WebKit::WebGeolocationPosition::longitude const):
828         (WebKit::WebGeolocationPosition::accuracy const):
829         (WebKit::WebGeolocationPosition::altitude const):
830         (WebKit::WebGeolocationPosition::altitudeAccuracy const):
831         (WebKit::WebGeolocationPosition::heading const):
832         (WebKit::WebGeolocationPosition::speed const):
833         (WebKit::WebGeolocationPosition::corePosition const):
834         (WebKit::WebGeolocationPosition::WebGeolocationPosition):
835         * UIProcess/API/C/WKGeolocationPosition.cpp:
836         (WKGeolocationPositionCreate_b):
837         * UIProcess/API/Cocoa/_WKGeolocationPosition.mm:
838         (WebKit::wrapper):
839         * UIProcess/API/glib/WebKitGeolocationProvider.cpp:
840         (WebKit::WebKitGeolocationProvider::notifyPositionChanged):
841         * UIProcess/WebGeolocationManagerProxy.cpp:
842         (WebKit::WebGeolocationManagerProxy::providerDidChangePosition):
843         * UIProcess/ios/WKGeolocationProviderIOS.mm:
844         (-[WKLegacyCoreLocationProvider positionChanged:]):
845         * WebProcess/Geolocation/WebGeolocationManager.cpp:
846         (WebKit::WebGeolocationManager::didChangePosition):
847         * WebProcess/Geolocation/WebGeolocationManager.h:
848         * WebProcess/Geolocation/WebGeolocationManager.messages.in:
849         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
850         (WebKit::WebGeolocationClient::lastPosition):
851         * WebProcess/WebCoreSupport/WebGeolocationClient.h:
852
853 2017-10-11  Brady Eidson  <beidson@apple.com>
854
855         Add a SW context process (where SW scripts will actually execute).
856         https://bugs.webkit.org/show_bug.cgi?id=178156
857
858         Reviewed by Andy Estes.
859
860         This patch adds an auxiliary "ServiceWorker context" WebProcess to a WebProcessPool.
861
862         This process is where ServiceWorker scripts will execute, separate from the client WebProcess
863         hosting the page(s) they are serving.
864
865         This patch also adds all of the plumbing to pass along a fetched service worker script to this
866         context WebProcess, as well as message back failure to actually start the script so we can test.
867
868         Touches lots of code sites but is basically just a lot of plumbing.
869
870         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
871         (WebKit::WebSWServerConnection::WebSWServerConnection):
872         (WebKit::WebSWServerConnection::startServiceWorkerContext):
873         (WebKit::WebSWServerConnection::sendToContextProcess):
874         (WebKit::WebSWServerConnection::setContextConnection):
875         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
876
877         * StorageProcess/StorageProcess.cpp:
878         (WebKit::StorageProcess::workerContextProcessConnection):
879         (WebKit::StorageProcess::createWorkerContextProcessConnection):
880         (WebKit::StorageProcess::didGetWorkerContextProcessConnection):
881         (WebKit::StorageProcess::serviceWorkerContextFailedToStart):
882         (WebKit::StorageProcess::registerSWServerConnection):
883         (WebKit::StorageProcess::unregisterSWServerConnection):
884         * StorageProcess/StorageProcess.h:
885         * StorageProcess/StorageProcess.messages.in:
886
887         * StorageProcess/StorageToWebProcessConnection.cpp:
888         (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection):
889         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
890         (WebKit::StorageToWebProcessConnection::removeSWServerConnection):
891         (WebKit::StorageToWebProcessConnection::workerContextProcessConnectionCreated):
892         * StorageProcess/StorageToWebProcessConnection.h:
893
894         * UIProcess/Storage/StorageProcessProxy.cpp:
895         (WebKit::StorageProcessProxy::create):
896         (WebKit::StorageProcessProxy::StorageProcessProxy):
897         (WebKit::StorageProcessProxy::didClose):
898         (WebKit::StorageProcessProxy::getWorkerContextProcessConnection):
899         (WebKit::StorageProcessProxy::didGetWorkerContextProcessConnection):
900         * UIProcess/Storage/StorageProcessProxy.h:
901         * UIProcess/Storage/StorageProcessProxy.messages.in:
902
903         * UIProcess/WebProcessPool.cpp:
904         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
905         (WebKit::WebProcessPool::getWorkerContextProcessConnection):
906         (WebKit::WebProcessPool::didGetWorkerContextProcessConnection):
907         (WebKit::WebProcessPool::disconnectProcess):
908         (WebKit::WebProcessPool::createWebPage):
909         * UIProcess/WebProcessPool.h:
910
911         * UIProcess/WebProcessProxy.cpp:
912         (WebKit::WebProcessProxy::didGetWorkerContextConnection):
913         * UIProcess/WebProcessProxy.h:
914         * UIProcess/WebProcessProxy.messages.in:
915
916         * WebProcess/WebProcess.cpp:
917         (WebKit::WebProcess::getWorkerContextConnection):
918         (WebKit::WebProcess::startServiceWorkerContext):
919         * WebProcess/WebProcess.h:
920         * WebProcess/WebProcess.messages.in:
921
922 2017-10-11  Don Olmstead  <don.olmstead@sony.com>
923
924         Remove ENABLE_NETWORK_CACHE
925         https://bugs.webkit.org/show_bug.cgi?id=177424
926
927         Reviewed by Antti Koivisto.
928
929         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
930         (WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache):
931         * NetworkProcess/NetworkConnectionToWebProcess.h:
932         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
933         * NetworkProcess/NetworkProcess.cpp:
934         (WebKit::fetchDiskCacheEntries):
935         (WebKit::clearDiskCacheEntries):
936         (WebKit::NetworkProcess::setCacheModel):
937         * NetworkProcess/NetworkProcess.h:
938         (WebKit::NetworkProcess::cache):
939         * NetworkProcess/NetworkProcessCreationParameters.cpp:
940         (WebKit::NetworkProcessCreationParameters::encode const):
941         (WebKit::NetworkProcessCreationParameters::decode):
942         * NetworkProcess/NetworkProcessCreationParameters.h:
943         * NetworkProcess/NetworkResourceLoader.cpp:
944         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
945         (WebKit::NetworkResourceLoader::canUseCachedRedirect const):
946         (WebKit::NetworkResourceLoader::start):
947         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
948         (WebKit::NetworkResourceLoader::startNetworkLoad):
949         (WebKit::NetworkResourceLoader::abort):
950         (WebKit::NetworkResourceLoader::didReceiveResponse):
951         (WebKit::NetworkResourceLoader::didReceiveBuffer):
952         (WebKit::NetworkResourceLoader::didFinishLoading):
953         (WebKit::NetworkResourceLoader::didFailLoading):
954         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
955         (WebKit::NetworkResourceLoader::continueWillSendRequest):
956         (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
957         * NetworkProcess/NetworkResourceLoader.h:
958         * NetworkProcess/cache/NetworkCache.cpp:
959         * NetworkProcess/cache/NetworkCache.h:
960         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
961         * NetworkProcess/cache/NetworkCacheBlobStorage.h:
962         * NetworkProcess/cache/NetworkCacheCoders.cpp:
963         * NetworkProcess/cache/NetworkCacheCoders.h:
964         * NetworkProcess/cache/NetworkCacheCodersCocoa.cpp:
965         * NetworkProcess/cache/NetworkCacheCodersSoup.cpp:
966         * NetworkProcess/cache/NetworkCacheData.cpp:
967         * NetworkProcess/cache/NetworkCacheData.h:
968         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
969         * NetworkProcess/cache/NetworkCacheDataSoup.cpp:
970         * NetworkProcess/cache/NetworkCacheEntry.cpp:
971         * NetworkProcess/cache/NetworkCacheEntry.h:
972         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
973         * NetworkProcess/cache/NetworkCacheFileSystem.h:
974         * NetworkProcess/cache/NetworkCacheIOChannel.h:
975         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
976         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
977         * NetworkProcess/cache/NetworkCacheKey.cpp:
978         * NetworkProcess/cache/NetworkCacheKey.h:
979         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
980         * NetworkProcess/cache/NetworkCacheStatistics.h:
981         * NetworkProcess/cache/NetworkCacheStorage.cpp:
982         * NetworkProcess/cache/NetworkCacheStorage.h:
983         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
984         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
985         (WebKit::NetworkProcess::clearDiskCache):
986         * NetworkProcess/ios/NetworkProcessIOS.mm:
987         (WebKit::NetworkProcess::clearCacheForAllOrigins):
988         * NetworkProcess/soup/NetworkProcessSoup.cpp:
989         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
990         (WebKit::NetworkProcess::clearDiskCache):
991         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
992         (WebKit::registerUserDefaultsIfNeeded):
993         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
994         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
995         (WebKit::WebProcessPool::isNetworkCacheEnabled):
996         * UIProcess/soup/WebProcessPoolSoup.cpp:
997         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
998         * WebProcess/Network/WebLoaderStrategy.cpp:
999         (WebKit::WebLoaderStrategy::storeDerivedDataToCache):
1000         * config.h:
1001
1002 2017-10-11  Michael Catanzaro  <mcatanzaro@igalia.com>
1003
1004         Unreviewed, rolling out r223146.
1005
1006         Better to not expose cairo in the WPE API
1007
1008         Reverted changeset:
1009
1010         "[WPE] Header cairo.h is used in GLib API headers but cannot
1011         be found"
1012         https://bugs.webkit.org/show_bug.cgi?id=178100
1013         http://trac.webkit.org/changeset/223146
1014
1015 2017-09-27  Frederic Wang  <fwang@igalia.com>
1016
1017         [iOS] Do not flatten frames when async frame scrolling is enabled
1018         https://bugs.webkit.org/show_bug.cgi?id=173704
1019
1020         Reviewed by Simon Fraser.
1021
1022         This patch disables frame flattening when async frame scrolling is enabled on iOS, as
1023         otherwise you can not scroll them. Once iframe scrolling is implemented in iOS (bug 149264),
1024         developers and beta testers will be able to check it by enabling "Async Frame Scrolling"
1025         in the "Experimental WebKit Features" menu of Safari iOS.
1026
1027         Test: platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling.html
1028
1029         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1030         (WebKit::WebChromeClient::contentsSizeChanged): Use effectiveFrameFlattening() introduced in
1031         Source/WebCore.
1032
1033 2017-10-10  Ryosuke Niwa  <rniwa@webkit.org>
1034
1035         Enable custom pasteboard data in DumpRenderTree and WebKitTestRunner
1036         https://bugs.webkit.org/show_bug.cgi?id=178154
1037
1038         Reviewed by Wenson Hsieh.
1039
1040         Plumbed customPasteboardDataEnabled flag to be used in WebKitTestRunner.
1041
1042         * Shared/WebPreferencesDefinitions.h:
1043         * UIProcess/API/C/WKPreferences.cpp:
1044         (WKPreferencesSetCustomPasteboardDataEnabled):
1045         (WKPreferencesGetCustomPasteboardDataEnabled):
1046         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1047         * WebProcess/WebPage/WebPage.cpp:
1048         (WebKit::WebPage::updatePreferences):
1049
1050 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1051
1052         [WPE] Remove the possibility of installing the old WebKit2 C API
1053         https://bugs.webkit.org/show_bug.cgi?id=178125
1054
1055         Reviewed by Michael Catanzaro.
1056
1057         * PlatformWPE.cmake: Remove support for installing the deprecated C API.
1058
1059 2017-10-10  Chris Dumez  <cdumez@apple.com>
1060
1061         [WK2] Add API to clear service worker registrations
1062         https://bugs.webkit.org/show_bug.cgi?id=178085
1063         <rdar://problem/34866025>
1064
1065         Reviewed by Ryosuke Niwa.
1066
1067         Add API to clear service worker registrations. Although the request to
1068         clear the registration is passed on to the StorageProcess, it is currently
1069         a no-op on StorageProcess side until we actually persist service worker
1070         registrations on disk.
1071
1072         * Shared/WebsiteData/WebsiteDataType.h:
1073         * StorageProcess/StorageProcess.cpp:
1074         (WebKit::StorageProcess::fetchWebsiteData):
1075         (WebKit::StorageProcess::deleteWebsiteData):
1076         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
1077         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1078         (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):
1079         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1080         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
1081         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
1082         (dataTypesToString):
1083         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
1084         (WebKit::toWebsiteDataType):
1085         (WebKit::toWKWebsiteDataTypes):
1086         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1087         (+[WKWebsiteDataStore allWebsiteDataTypes]):
1088         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1089         (WebKit::WebsiteDataStore::fetchDataAndApply):
1090         (WebKit::WebsiteDataStore::removeData):
1091
1092 2017-10-10  Commit Queue  <commit-queue@webkit.org>
1093
1094         Unreviewed, rolling out r223130.
1095         https://bugs.webkit.org/show_bug.cgi?id=178147
1096
1097         Breaks the build when EGLNativeWindowType is a pointer
1098         (Requested by aperezdc on #webkit).
1099
1100         Reverted changeset:
1101
1102         "[WPE] Build failure due to invalid cast of
1103         EGLNativeWindowType when targetting 64-bit ARM"
1104         https://bugs.webkit.org/show_bug.cgi?id=178090
1105         http://trac.webkit.org/changeset/223130
1106
1107 2017-10-10  Sam Weinig  <sam@webkit.org>
1108
1109         Replace copyKeysToVector/copyValuesToVector with copyToVector(map.keys())/copyToVector(map.values())
1110         https://bugs.webkit.org/show_bug.cgi?id=178102
1111
1112         Reviewed by Tim Horton.
1113
1114         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1115         (WebKit::NetworkConnectionToWebProcess::didClose):
1116         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
1117         (WebKit::dumpChangedLayers):
1118         * UIProcess/API/glib/WebKitWebContext.cpp:
1119         (webkitWebContextInvalidateCustomProtocolRequests):
1120         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1121         (webkitWebViewBaseContainerForall):
1122         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
1123         (-[WKWebViewContentProviderRegistry _mimeTypesWithCustomContentProviders]):
1124         * UIProcess/GenericCallback.h:
1125         (WebKit::invalidateCallbackMap):
1126         * UIProcess/WebProcessProxy.cpp:
1127         (WebKit::WebProcessProxy::shutDown):
1128         (WebKit::WebProcessProxy::didClose):
1129         (WebKit::WebProcessProxy::didBecomeUnresponsive):
1130         (WebKit::WebProcessProxy::didBecomeResponsive):
1131         (WebKit::WebProcessProxy::willChangeIsResponsive):
1132         (WebKit::WebProcessProxy::didChangeIsResponsive):
1133         (WebKit::WebProcessProxy::disconnectFramesFromPage):
1134         (WebKit::WebProcessProxy::frameCountInPage const):
1135         (WebKit::WebProcessProxy::requestTermination):
1136         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
1137         (WebKit::NPRuntimeObjectMap::invalidate):
1138         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1139         (WebKit::NetscapePlugin::stopAllStreams):
1140         * WebProcess/Plugins/PluginView.cpp:
1141         (WebKit::PluginView::cancelAllStreams):
1142         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
1143         (WebKit::RemoteLayerTreeContext::buildTransaction):
1144         * WebProcess/WebProcess.cpp:
1145         (WebKit::WebProcess::didClose):
1146
1147 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1148
1149         [WPE] Header cairo.h is used in GLib API headers but cannot be found
1150         https://bugs.webkit.org/show_bug.cgi?id=178100
1151
1152         Reviewed by Michael Catanzaro.
1153
1154         * wpe/wpe-webkit.pc.in: Add Cairo to the "Requires" field, so its flags get pulled
1155         in and the "cairo.h", used in the WPE WebKit GLib API headers, can be found.
1156
1157 2017-10-10  Michael Catanzaro  <mcatanzaro@igalia.com>
1158
1159         CSS constant properties should not be enabled by default
1160         https://bugs.webkit.org/show_bug.cgi?id=177416
1161
1162         Reviewed by Darin Adler.
1163
1164         * Shared/WebPreferencesDefinitions.h:
1165
1166 2017-10-10  Brady Eidson  <beidson@apple.com>
1167
1168         Random StorageProcess and SWServer cleanup.
1169         https://bugs.webkit.org/show_bug.cgi?id=178141
1170
1171         Reviewed by Andy Estes.
1172
1173         -StorageProcess should own the set of SWServers
1174         -Some renaming and cleanup
1175
1176         * StorageProcess/StorageProcess.cpp:
1177         (WebKit::StorageProcess::createStorageToWebProcessConnection):
1178         (WebKit::StorageProcess::swServerForSession):
1179         * StorageProcess/StorageProcess.h:
1180         (WebKit::StorageProcess::queue):
1181
1182         * StorageProcess/StorageToWebProcessConnection.cpp:
1183         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
1184         * StorageProcess/StorageToWebProcessConnection.h:
1185
1186 2017-10-10  Michael Catanzaro  <mcatanzaro@igalia.com>
1187
1188         Unreviewed, rolling out r223136.
1189
1190         Forgot to update GTK API header
1191
1192         Reverted changeset:
1193
1194         "[WPE] Header cairo.h is used in GLib API headers but cannot
1195         be found"
1196         https://bugs.webkit.org/show_bug.cgi?id=178100
1197         http://trac.webkit.org/changeset/223136
1198
1199 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1200
1201         [WPE] Header cairo.h is used in GLib API headers but cannot be found
1202         https://bugs.webkit.org/show_bug.cgi?id=178100
1203
1204         Reviewed by Žan Doberšek.
1205
1206         Instead of including <cairo.h>, it is better to forward-declare cairo_surface_t,
1207         which is the one and only Cairo declaration needed by the WPE API header.
1208
1209         * UIProcess/API/glib/WebKitFaviconDatabase.cpp: Add inclusion of <cairo.h>.
1210         * UIProcess/API/glib/WebKitWebView.cpp: Add inclusion of <cairo.h>.
1211         * UIProcess/API/wpe/WebKitFaviconDatabase.h: Add forward declaration of cairo_surface_t.
1212
1213 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1214
1215         [WPE] Cannot link against libWPEWebkit due to wrong contents of wpe-webkit.pc
1216         https://bugs.webkit.org/show_bug.cgi?id=178133
1217
1218         Reviewed by Žan Doberšek.
1219
1220         * wpe/wpe-webkit.pc.in: Remove "-lWPE" and replace "Requires.private" with a plain "Requires".
1221
1222 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1223
1224         [WPE] Build failure due to invalid cast of EGLNativeWindowType when targetting 64-bit ARM
1225         https://bugs.webkit.org/show_bug.cgi?id=178090
1226
1227         Reviewed by Žan Doberšek.
1228
1229         * WebProcess/WebPage/wpe/AcceleratedSurfaceWPE.cpp:
1230         (WebKit::AcceleratedSurfaceWPE::window const): Use static_cast instead of reinterpret_cast,
1231         this way extending values of EGLNativeWindowType to 64 bits is allowed.
1232
1233 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1234
1235         [WPE] GLib API headers WebKitScriptDialog.h and WebKitFileChooserRequest.h are not installed
1236         https://bugs.webkit.org/show_bug.cgi?id=178104
1237
1238         Reviewed by Žan Doberšek.
1239
1240         * PlatformWPE.cmake: Add missing header paths to the WPE_API_INSTALLED_HEADERS variable.
1241
1242 2017-10-10  Adrian Perez de Castro  <aperez@igalia.com>
1243
1244         [WPE][CMake] The “install” target should install all public API headers
1245         https://bugs.webkit.org/show_bug.cgi?id=176475
1246
1247         Reviewed by Žan Doberšek.
1248
1249         Install the WPE port GLib-based API headers. The deprecated C API is still available,
1250         but disabled by default behind the "EXPORT_DEPRECATED_WEBKIT2_C_API" CMake option.
1251
1252         * PlatformWPE.cmake: Always install "wpe-webkit.pc" and the GLib C API for WPE.
1253
1254 2017-10-09  Jeremy Jones  <jeremyj@apple.com>
1255
1256         Fix typo of virtual keyword in PageClientImplIOS.h
1257         https://bugs.webkit.org/show_bug.cgi?id=178088
1258
1259         Reviewed by Simon Fraser.
1260
1261         This compile error happens when FULLSCREEN_API is enabled for iOS.
1262         Remove the redundant virtual keyword since function is marked override.
1263
1264         * UIProcess/ios/PageClientImplIOS.h:
1265
1266 2017-10-09  Chris Dumez  <cdumez@apple.com>
1267
1268         [iOS][WK2] Tiles outsides the viewport are sometimes missing after relaunching a crashes WebProcess
1269         https://bugs.webkit.org/show_bug.cgi?id=178095
1270         <rdar://problem/34415016>
1271
1272         Reviewed by Simon Fraser.
1273
1274         Make sure we reset WKWebView._hasScheduledVisibleRectUpdate to NO in WKWebView._processDidExit.
1275         _scheduleVisibleContentRectUpdateAfterScrollInView would otherwise return early because
1276         WKWebView._hasScheduledVisibleRectUpdate is always YES. Normally,
1277         _addUpdateVisibleContentRectPreCommitHandler sets a CATransaction commit handler that
1278         resets _hasScheduledVisibleRectUpdate to NO, but it does not do so when ![webView _isValid]
1279         (which is true when the WebProcess has crashed.
1280
1281         Also reset WKWebView._commitDidRestoreScrollPosition to NO in WKWebView._processDidExit even
1282         though it does not seem to be the cause of this bug. It seems to make sense to reset this member
1283         when the process crashes.
1284
1285         * UIProcess/API/Cocoa/WKWebView.mm:
1286         (-[WKWebView _processDidExit]):
1287
1288 2017-10-09  Youenn Fablet  <youenn@apple.com>
1289
1290         Add quota to cache API
1291         https://bugs.webkit.org/show_bug.cgi?id=177552
1292
1293         Reviewed by Alex Christensen.
1294
1295         Adding support for quota checking in CacheStorage::Caches.
1296         It is passed to NetworkProcess at creation time.
1297         Default quota size is configured to 400Ko by origin per default.
1298         This value is suitable for testing.
1299         Future patch should raise this default value and allows configuring it.
1300
1301         Quota is computed based on the response body size.
1302         This size is padded at WebCore for opaque responses.
1303         Size is stored persistently as opaque response padded size should remain stable.
1304         See https://github.com/whatwg/storage/issues/31 for the rationale about this padding.
1305
1306         In case of putting several records at the same time, the size of all records
1307         is computed so that all records will be written or rejected together.
1308
1309         Sending QuotaExceeded error when quota is exceeded.
1310         Future effort should allow asking UIProcess for quota extension.
1311
1312         * NetworkProcess/NetworkProcess.cpp:
1313         (WebKit::NetworkProcess::cacheStoragePerOriginQuota const):
1314         * NetworkProcess/NetworkProcess.h:
1315         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1316         (WebKit::NetworkProcessCreationParameters::encode const):
1317         (WebKit::NetworkProcessCreationParameters::decode):
1318         * NetworkProcess/NetworkProcessCreationParameters.h:
1319         * NetworkProcess/cache/CacheStorageEngine.cpp:
1320         (WebKit::CacheStorage::Engine::readCachesFromDisk):
1321         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
1322         (WebKit::CacheStorage::Cache::toRecordInformation):
1323         (WebKit::CacheStorage::isolatedCopy):
1324         (WebKit::CacheStorage::Cache::open):
1325         (WebKit::CacheStorage::Cache::storeRecords):
1326         (WebKit::CacheStorage::Cache::put):
1327         (WebKit::CacheStorage::Cache::writeRecordToDisk):
1328         (WebKit::CacheStorage::Cache::updateRecordToDisk):
1329         (WebKit::CacheStorage::Cache::removeRecordFromDisk):
1330         (WebKit::CacheStorage::Cache::encode):
1331         (WebKit::CacheStorage::Cache::decodeRecordHeader):
1332         (WebKit::CacheStorage::Cache::decode):
1333         * NetworkProcess/cache/CacheStorageEngineCache.h:
1334         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1335         (WebKit::CacheStorage::Caches::Caches):
1336         (WebKit::CacheStorage::Caches::initialize):
1337         (WebKit::CacheStorage::Caches::initializeSize):
1338         (WebKit::CacheStorage::Caches::requestSpace):
1339         (WebKit::CacheStorage::Caches::writeRecord):
1340         (WebKit::CacheStorage::Caches::removeRecord):
1341         (WebKit::CacheStorage::Caches::removeCacheEntry):
1342         * NetworkProcess/cache/CacheStorageEngineCaches.h:
1343         (WebKit::CacheStorage::Caches::create):
1344         (WebKit::CacheStorage::Caches::hasEnoughSpace const):
1345         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1346         (WebKit::NetworkCache::Storage::traverse):
1347         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1348         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1349         * Shared/WebCoreArgumentCoders.cpp:
1350         (IPC::ArgumentCoder<DOMCacheEngine::Record>::encode):
1351         (IPC::ArgumentCoder<DOMCacheEngine::Record>::decode):
1352         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1353         (API::ProcessPoolConfiguration::copy):
1354         * UIProcess/API/APIProcessPoolConfiguration.h:
1355         * UIProcess/WebProcessPool.cpp:
1356         (WebKit::WebProcessPool::ensureNetworkProcess):
1357
1358 2017-10-09  Sam Weinig  <sam@webkit.org>
1359
1360         Make HashMap::keys() and HashMap::values() work with WTF::map/WTF::copyToVector
1361         https://bugs.webkit.org/show_bug.cgi?id=178072
1362
1363         Reviewed by Darin Adler.
1364
1365         * Shared/AsyncRequest.h:
1366         (WebKit::AsyncRequestMap::values):
1367         * UIProcess/WebProcessProxy.h:
1368         (WebKit::WebProcessProxy::pages const):
1369
1370             Update for type change for HashMap::values().
1371
1372 2017-10-09  Jeremy Jones  <jeremyj@apple.com>
1373
1374         Incorrect fullscreen animation when element has a transform.
1375         https://bugs.webkit.org/show_bug.cgi?id=177558
1376         rdar://problem/29603741
1377
1378         Reviewed by Jer Noble.
1379
1380         Use a bit of code from element fullscreen to do this correctly for video fullscreen.
1381         The key is to get the absolute quad from the renderer. This will work for scaling,
1382         But since we still take the bounding box, it won't work for rotations.
1383
1384         * WebProcess/cocoa/VideoFullscreenManager.mm:
1385         (WebKit::inlineVideoFrame):
1386
1387 2017-10-09  Robin Morisset  <rmorisset@apple.com>
1388
1389         Make the names of the options consistent
1390         https://bugs.webkit.org/show_bug.cgi?id=177933
1391
1392         Reviewed by Saam Barati.
1393
1394         * NetworkProcess/capture/json.hpp:
1395         * Platform/IPC/Connection.cpp:
1396         (IPC::Connection::connectionDidClose):
1397         * UIProcess/API/Cocoa/WKWebView.mm:
1398         (-[WKWebView _keyboardWillHide:]):
1399         * UIProcess/WebPageProxy.cpp:
1400         (WebKit::WebPageProxy::runModal):
1401         * UIProcess/mac/WebInspectorProxyMac.mm:
1402         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
1403         * WebProcess/WebPage/ios/WebPageIOS.mm:
1404         (WebKit::WebPage::selectWithGesture):
1405
1406 2017-10-09  Adrian Perez de Castro  <aperez@igalia.com>
1407
1408         [WPE][GTK] Propagate libepoxy compiler flags obtained from pkg-config
1409         https://bugs.webkit.org/show_bug.cgi?id=178081
1410
1411         Reviewed by Carlos Alberto Lopez Perez.
1412
1413         * CMakeLists.txt: Use ${LIBEPOXY_DEFINITIONS} for building WebKit.
1414
1415 2017-10-08  Tim Horton  <timothy_horton@apple.com>
1416
1417         mediaPlaybackRequiresUserAction API replacement annotation is wrong
1418         https://bugs.webkit.org/show_bug.cgi?id=178063
1419
1420         Reviewed by Dan Bernstein.
1421
1422         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1423         mediaPlaybackRequiresUserAction suggests that you should use 
1424         requiresUserActionForMediaPlayback instead, but that is also deprecated.
1425         Instead, follow the chain and suggest mediaTypesRequiringUserActionForPlayback.
1426
1427 2017-10-06  Wenson Hsieh  <wenson_hsieh@apple.com>
1428
1429         [iOS WK2] API tests added in r222991 are failing in iOS 11 test runners
1430         https://bugs.webkit.org/show_bug.cgi?id=178037
1431
1432         Reviewed by Tim Horton.
1433
1434         This patch carries out some minor cleanup around UIKitSPI.h in WebKit2, so that the internal SDK isn't required
1435         to implement -[WKContentView insertTextSuggestion:].
1436
1437         * Platform/spi/ios/UIKitSPI.h:
1438         * UIProcess/ios/WKContentViewInteraction.mm:
1439         (-[WKContentView insertTextSuggestion:]):
1440
1441 2017-10-06  Chris Dumez  <cdumez@apple.com>
1442
1443         [Beacon][Cocoa] Beacon requests with BufferSource payload should not have a Content-Type HTTP header
1444         https://bugs.webkit.org/show_bug.cgi?id=178027
1445         <rdar://problem/34748470>
1446
1447         Reviewed by Youenn Fablet.
1448
1449         Use new NSURLSessionConfiguration._suppressedAutoAddedHTTPHeaders CFNetwork SPI to
1450         make sure that CFNetwork never adds a Content-Type HTTP headers to our requests
1451         when we did not add one.
1452
1453         This is covered by the following tests on newer OSes:
1454         - imported/w3c/web-platform-tests/beacon/headers/header-content-type.html
1455         - http/tests/blink/sendbeacon/beacon-same-origin.html
1456
1457         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1458         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1459
1460 2017-10-06  Aishwarya Nirmal  <anirmal@apple.com>
1461
1462         [iOS] Respect the "caret-color" CSS property when editing 
1463         https://bugs.webkit.org/show_bug.cgi?id=177489
1464         <rdar://problem/34600419>
1465
1466         Reviewed by Tim Horton.
1467
1468         This change adds support for the caret-color property on iOS.
1469
1470         * Shared/EditorState.cpp:
1471         (WebKit::EditorState::PostLayoutData::encode const):
1472         (WebKit::EditorState::PostLayoutData::decode):
1473         * Shared/EditorState.h:
1474         * UIProcess/ios/WKContentViewInteraction.mm:
1475         (-[WKContentView insertionPointColor]):
1476         * WebProcess/WebPage/ios/WebPageIOS.mm:
1477         (WebKit::WebPage::platformEditorState const):
1478
1479 2017-10-06  Brian Burg  <bburg@apple.com>
1480
1481         Web Inspector: clicking in Inspector webview clears the selection in the inspected page
1482         https://bugs.webkit.org/show_bug.cgi?id=178014
1483         <rdar://problem/12706857>
1484
1485         Reviewed by Timothy Hatcher.
1486
1487         If the Inspector is docked to the inspected view, clicking on the Inspector
1488         webview will cause selection in the inspected view to be lost. This is because
1489         the selection is lost when the web view resigns first responder.
1490
1491         Add a check in maintainsInactiveSelection to always retain selection if
1492         Web Inspector is open. This approach seems simpler than trying to sync a client's
1493         usage of WKPageSetMaintainsInactiveSelection with overrides that need to be applied
1494         and unapplied when an inspector web view is shown or hidden.
1495
1496         * UIProcess/WebPageProxy.cpp:
1497         (WebKit::WebPageProxy::maintainsInactiveSelection const):
1498         (WebKit::WebPageProxy::inspector const): Drive by, use nullptr.
1499
1500         * UIProcess/WebPageProxy.h:
1501         (WebKit::WebPageProxy::maintainsInactiveSelection const): Deleted.
1502
1503 2017-10-06  Alex Christensen  <achristensen@webkit.org>
1504
1505         Add more infrastructure to apply custom headers to same-origin requests
1506         https://bugs.webkit.org/show_bug.cgi?id=177629
1507
1508         Reviewed by Ryosuke Niwa.
1509
1510         * UIProcess/API/C/WKWebsitePolicies.cpp:
1511         (WKWebsitePoliciesCopyCustomHeaderFields):
1512         (WKWebsitePoliciesSetCustomHeaderFields):
1513         * UIProcess/API/C/WKWebsitePolicies.h:
1514         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1515         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
1516         (-[_WKWebsitePolicies customHeaderFields]):
1517         (-[_WKWebsitePolicies setCustomHeaderFields:]):
1518
1519         Make the SPI for setting custom header fields take a dictionary<String, String>
1520         instead of an array of Strings with colons. This matches NSURLRequest and other
1521         APIs that deal with header fields.
1522
1523 2017-10-06  Wenson Hsieh  <wenson_hsieh@apple.com>
1524
1525         [iOS] Tweak support for classifying form controls (followup to r222487)
1526         https://bugs.webkit.org/show_bug.cgi?id=177917
1527         <rdar://problem/34820122>
1528
1529         Reviewed by Dean Jackson.
1530
1531         This patch follows up with <http://trac.webkit.org/r222487>. It combines the functionality of two SPI hooks
1532         implemented on WKContentView into a single method that vends a context dictionary, and additionally addresses an
1533         issue with the original implementation, wherein some cached state on WebPageProxy is set upon starting node
1534         assistance, but is never unset when stopping node assistance, nor set anywhere else. See per-method comments for
1535         more detail.
1536
1537         * UIProcess/WebPageProxy.h:
1538
1539         Remove members m_acceptsAutofilledLoginCredentials and m_representingPageURL from WebPageProxy. This state is
1540         retrieved from the AssistedNodeInformation struct when starting node assistance, but is never reset anywhere
1541         else. Instead of introducing new members to remember this state, we can just use the WKContentView's current
1542         assisted node information.
1543
1544         This also means that programmatically focusing forms (without user gesture) will no longer cause WKContentView
1545         to accept autofilled login credentials, since we bail out of node assistance and don't begin an input session.
1546
1547         * UIProcess/ios/WKContentView.mm:
1548         (-[WKContentView acceptsAutofilledLoginCredentials]): Deleted.
1549         (-[WKContentView representingPageURL]): Deleted.
1550         * UIProcess/ios/WKContentViewInteraction.mm:
1551         (-[WKContentView _autofillContext]):
1552
1553         Merge functionality of the previous two SPI hooks, such that -_autofillContext will return a non-null dictionary
1554         containing the URL of the focused element's document if and only if WKContentView accepts autofilled login
1555         credentials, and there exists a representing page URL.
1556
1557         When the page stops assisting the focused node, we set the AssistedNodeInformation's element type to None, so we
1558         additionally bail and return nil if the element type is None. As an aside, it seems a more reasonable approach to
1559         resetting state upon stopping node assistance is to just completely reset _assistedNodeInformation to its initial
1560         value, i.e. via _assistedNodeInformation = { }. It's not clear whether there are behaviors relying on the fact
1561         that all members but the element type in the content view's assisted node information could be stale, so this
1562         seems worthy of some investigation.
1563
1564         * UIProcess/ios/WebPageProxyIOS.mm:
1565         (WebKit::WebPageProxy::startAssistingNode):
1566         (WebKit::WebPageProxy::acceptsAutofilledLoginCredentials): Deleted.
1567         (WebKit::WebPageProxy::representingPageURL): Deleted.
1568
1569 2017-10-06  Yousuke Kimoto  <yousuke.kimoto@sony.com>
1570
1571         [WinCairo] Add shared curl files
1572         https://bugs.webkit.org/show_bug.cgi?id=177999
1573
1574         Reviewed by Alex Christensen.
1575
1576         * PlatformWin.cmake:
1577         * Shared/Authentication/curl/AuthenticationManagerCurl.cpp: Added.
1578         (WebKit::AuthenticationManager::receivedCredential):
1579         (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
1580         (WebKit::AuthenticationManager::receivedCancellation):
1581         (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
1582         (WebKit::AuthenticationManager::receivedChallengeRejection):
1583         * Shared/curl/WebCoreArgumentCodersCurl.cpp: Added.
1584         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
1585         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
1586         (IPC::ArgumentCoder<CertificateInfo>::encode):
1587         (IPC::ArgumentCoder<CertificateInfo>::decode):
1588         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
1589         (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
1590         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
1591         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData):
1592         (IPC::ArgumentCoder<Credential>::encodePlatformData):
1593         (IPC::ArgumentCoder<Credential>::decodePlatformData):
1594
1595 2017-10-06  Brent Fulgham  <bfulgham@apple.com>
1596
1597         Sandbox rules block PluginProcess using "File Open/Save" dialogs
1598         https://bugs.webkit.org/show_bug.cgi?id=177965
1599         <rdar://problem/33976846>
1600
1601         Reviewed by Alexey Proskuryakov.
1602
1603         Update the PluginProcess sandboxes to allow the same XPC services as
1604         the WebContent process. Also allow access to the openAndSavePanelServices.
1605
1606         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: 
1607
1608 2017-10-06  Brady Eidson  <beidson@apple.com>
1609
1610         Add (entirely incorrect) fetching of ServiceWorker scripts.
1611         https://bugs.webkit.org/show_bug.cgi?id=176179
1612
1613         Reviewed by Andy Estes.
1614
1615         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1616         (WebKit::WebSWServerConnection::startScriptFetchInClient):
1617         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1618         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1619
1620         * WebProcess/Storage/WebSWClientConnection.cpp:
1621         (WebKit::WebSWClientConnection::finishFetchingScriptInServer):
1622         * WebProcess/Storage/WebSWClientConnection.h:
1623         * WebProcess/Storage/WebSWClientConnection.messages.in:
1624
1625 2017-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1626
1627         [GTK][WPE] Add API to configure and enable resource load statistics
1628         https://bugs.webkit.org/show_bug.cgi?id=177943
1629
1630         Reviewed by Michael Catanzaro.
1631
1632         Add new WebKitWebsiteDataManager construct only property to set the directory where the persistent stats are
1633         stored, and methods to enable resource load statistics and query whether it's currently enabled. Also add a new
1634         Website data type to be able to remove the persistent stats using WebKitWebsiteDataManager existing API.
1635
1636         * UIProcess/API/glib/WebKitWebContext.cpp:
1637         (websiteDataStoreConfigurationForWebProcessPoolConfiguration):
1638         (webkitWebContextConstructed):
1639         * UIProcess/API/glib/WebKitWebsiteData.cpp:
1640         (recordContainsSupportedDataTypes):
1641         (toWebKitWebsiteDataTypes):
1642         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
1643         (webkitWebsiteDataManagerGetProperty):
1644         (webkitWebsiteDataManagerSetProperty):
1645         (webkitWebsiteDataManagerConstructed):
1646         (webkit_website_data_manager_class_init):
1647         (webkitWebsiteDataManagerGetDataStore):
1648         (webkit_website_data_manager_get_resource_load_stats_directory):
1649         (webkit_website_data_manager_set_resource_load_stats_enabled):
1650         (webkit_website_data_manager_get_resource_load_stats_enabled):
1651         (toWebsiteDataTypes):
1652         * UIProcess/API/gtk/WebKitWebsiteData.h:
1653         * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
1654         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1655         * UIProcess/API/wpe/WebKitWebsiteData.h:
1656         * UIProcess/API/wpe/WebKitWebsiteDataManager.h:
1657
1658 2017-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1659
1660         [GTK][WPE] All resource load statistics tests added in r212183 crash in GTK bots, timeout in GTK and WPE bots since r219049
1661         https://bugs.webkit.org/show_bug.cgi?id=168171
1662
1663         Reviewed by Chris Dumez.
1664
1665         Add C API to handle all resource load statistics requests made by the layout tests.
1666
1667         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1668         (WKWebsiteDataStoreSetStatisticsLastSeen):
1669         (WKWebsiteDataStoreSetStatisticsPrevalentResource):
1670         (WKWebsiteDataStoreIsStatisticsPrevalentResource):
1671         (WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
1672         (WKWebsiteDataStoreIsStatisticsHasHadUserInteraction):
1673         (WKWebsiteDataStoreSetStatisticsGrandfathered):
1674         (WKWebsiteDataStoreIsStatisticsGrandfathered):
1675         (WKWebsiteDataStoreSetStatisticsSubframeUnderTopFrameOrigin):
1676         (WKWebsiteDataStoreSetStatisticsSubresourceUnderTopFrameOrigin):
1677         (WKWebsiteDataStoreSetStatisticsSubresourceUniqueRedirectTo):
1678         (WKWebsiteDataStoreSetStatisticsTimeToLiveUserInteraction):
1679         (WKWebsiteDataStoreSetStatisticsTimeToLiveCookiePartitionFree):
1680         (WKWebsiteDataStoreStatisticsProcessStatisticsAndDataRecords):
1681         (WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
1682         (WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
1683         (WKWebsiteDataStoreStatisticsSubmitTelemetry):
1684         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenDataRecordsWereScanned):
1685         (WKWebsiteDataStoreSetStatisticsShouldClassifyResourcesBeforeDataRecordsRemoval):
1686         (WKWebsiteDataStoreSetStatisticsNotifyPagesWhenTelemetryWasCaptured):
1687         (WKWebsiteDataStoreSetStatisticsMinimumTimeBetweenDataRecordsRemoval):
1688         (WKWebsiteDataStoreSetStatisticsGrandfatheringTime):
1689         (WKWebsiteDataStoreSetStatisticsMaxStatisticsEntries):
1690         (WKWebsiteDataStoreSetStatisticsPruneEntriesDownTo):
1691         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
1692         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
1693         (WKWebsiteDataStoreStatisticsClearThroughWebsiteDataRemoval):
1694         (WKWebsiteDataStoreStatisticsResetToConsistentState):
1695         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1696
1697 2017-10-05  Tim Horton  <timothy_horton@apple.com>
1698
1699         Fix the Mac CMake build
1700         https://bugs.webkit.org/show_bug.cgi?id=177985
1701
1702         Unreviewed build fix.
1703
1704         * CMakeLists.txt:
1705         * PlatformMac.cmake:
1706         After r222917, there's one more piece of WebKitSystemInterface left.
1707         And some missing bits of PaymentRequest.
1708
1709 2017-10-05  Keith Miller  <keith_miller@apple.com>
1710
1711         Unreviewed, tapi builds without optimization so we should have TAPI passes -DRELEASE_WITHOUT_OPTIMIZATIONS.
1712
1713         * Configurations/Base.xcconfig:
1714
1715 2017-10-05  Jer Noble  <jer.noble@apple.com>
1716
1717         [Cocoa] Enable ENABLE_ENCRYPTED_MEDIA build-time setting
1718         https://bugs.webkit.org/show_bug.cgi?id=177261
1719
1720         Reviewed by Eric Carlson.
1721
1722         * Configurations/FeatureDefines.xcconfig:
1723
1724 2017-10-05  Alex Christensen  <achristensen@webkit.org>
1725
1726         Add ObjC equivalent of WKPageNavigationClient.didChangeBackForwardList
1727         https://bugs.webkit.org/show_bug.cgi?id=177966
1728         <rdar://problem/22387135>
1729
1730         Reviewed by Tim Horton.
1731
1732         * UIProcess/API/APINavigationClient.h:
1733         (API::NavigationClient::didChangeBackForwardList):
1734         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1735         * UIProcess/Cocoa/NavigationState.h:
1736         * UIProcess/Cocoa/NavigationState.mm:
1737         (WebKit::NavigationState::setNavigationDelegate):
1738         (WebKit::NavigationState::NavigationClient::didFailToInitializePlugIn):
1739         (WebKit::NavigationState::NavigationClient::didChangeBackForwardList):
1740         (WebKit::NavigationState::NavigationClient::willPerformClientRedirect):
1741         (WebKit::NavigationState::NavigationClient::didCancelClientRedirect):
1742         (WebKit::NavigationState::NavigationClient::renderingProgressDidChange):
1743         (WebKit::NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace):
1744         (WebKit::NavigationState::NavigationClient::processDidTerminate):
1745         (WebKit::NavigationState::NavigationClient::processDidBecomeResponsive):
1746         (WebKit::NavigationState::NavigationClient::processDidBecomeUnresponsive):
1747         (WebKit::NavigationState::NavigationClient::webCryptoMasterKey):
1748         (WebKit::NavigationState::NavigationClient::didFinishLoadForQuickLookDocumentInMainFrame):
1749         (WebKit::NavigationState::HistoryClient::didNavigateWithNavigationData):
1750         (WebKit::NavigationState::HistoryClient::didPerformClientRedirect):
1751         (WebKit::NavigationState::HistoryClient::didPerformServerRedirect):
1752         (WebKit::NavigationState::HistoryClient::didUpdateHistoryTitle):
1753         * UIProcess/WebPageProxy.cpp:
1754         (WebKit::WebPageProxy::didChangeBackForwardList):
1755
1756 2017-10-05  Alex Christensen  <achristensen@webkit.org>
1757
1758         Add ObjC SPI with userInfo corresponding to WKPageNavigationClient's decidePolicyForNavigationAction, didStartProvisionalNavigation, and didFailNavigation
1759         https://bugs.webkit.org/show_bug.cgi?id=177974
1760         <rdar://problem/22888802>
1761
1762         Reviewed by Tim Horton.
1763
1764         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1765         * UIProcess/Cocoa/NavigationState.h:
1766         * UIProcess/Cocoa/NavigationState.mm:
1767         (WebKit::NavigationState::setNavigationDelegate):
1768         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1769         (WebKit::NavigationState::NavigationClient::didStartProvisionalNavigation):
1770         (WebKit::NavigationState::NavigationClient::didFailNavigationWithError):
1771         * UIProcess/Cocoa/UIDelegate.mm:
1772         (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
1773
1774 2017-10-05  John Wilander  <wilander@apple.com>
1775
1776         Storage Access API: Web process should ask UI process for grant/deny
1777         https://bugs.webkit.org/show_bug.cgi?id=176941
1778         <rdar://problem/34440036>
1779
1780         Reviewed by Chris Dumez and Sam Weinig.
1781
1782         This patch adds infrastructure to let WebCore::Document call
1783         WebKit::WebResourceLoadStatisticsStore and ask for storage
1784         access on behalf of an iframe. The communication goes through
1785         the ChromeClient since we might want to add a native prompt.
1786         From the ChromeClient it continues to the WebPage which
1787         messages the WebPageProxy. The WebPageProxy calls the
1788         WebsiteDataStore which owns the WebResourceLoadStatisticsStore.
1789         A uint64_t is used to match the right callback with the boolean
1790         result.
1791
1792         * UIProcess/WebPageProxy.cpp:
1793         (WebKit::WebPageProxy::requestStorageAccess):
1794         * UIProcess/WebPageProxy.h:
1795         * UIProcess/WebPageProxy.messages.in:
1796         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1797         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
1798         * UIProcess/WebResourceLoadStatisticsStore.h:
1799         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1800         (WebKit::WebsiteDataStore::requestStorageAccess):
1801         * UIProcess/WebsiteData/WebsiteDataStore.h:
1802         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1803         (WebKit::WebChromeClient::requestStorageAccess):
1804         * WebProcess/WebCoreSupport/WebChromeClient.h:
1805         * WebProcess/WebPage/WebPage.cpp:
1806         (WebKit::nextRequestStorageAccessContextId):
1807         (WebKit::WebPage::requestStorageAccess):
1808         (WebKit::WebPage::storageAccessResponse):
1809         * WebProcess/WebPage/WebPage.h:
1810         * WebProcess/WebPage/WebPage.messages.in:
1811
1812 2017-10-05  Chris Dumez  <cdumez@apple.com>
1813
1814         Drop unused parameters for CookiesStrategy::cookiesEnabled()
1815         https://bugs.webkit.org/show_bug.cgi?id=177957
1816
1817         Reviewed by Alex Christensen.
1818
1819         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1820         (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
1821         * NetworkProcess/NetworkConnectionToWebProcess.h:
1822         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1823         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1824         (WebKit::WebPlatformStrategies::cookiesEnabled):
1825         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1826
1827 2017-10-05  Tim Horton  <timothy_horton@apple.com>
1828
1829         Make progress toward properly-formed XPC services in the Mac CMake build
1830         https://bugs.webkit.org/show_bug.cgi?id=177918
1831
1832         Reviewed by Alex Christensen.
1833
1834         * CMakeLists.txt:
1835         * PlatformMac.cmake:
1836         Turn on the storage process on Mac, and fix its build.
1837         Move XPC services to Versions/A/XPCServices and add the toplevel
1838         XPCServices as a symlink of that.
1839         Run the XPC services' Info.plists through configure_file, and substitute
1840         the important variables (most critically the bundle identifier).
1841         Factor out the service setup so we don't keep duplicating it as it
1842         gets more complicated.
1843
1844 2017-10-05  Andy Estes  <aestes@apple.com>
1845
1846         [Payment Request] Add a payment method that supports Apple Pay
1847         https://bugs.webkit.org/show_bug.cgi?id=177850
1848
1849         Reviewed by Youenn Fablet.
1850
1851         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1852         (toShippingMethod): Converted the NSDecimalNumber amount to a string rather than an integer.
1853         (WebKit::toDecimalNumber): used -decimalNumberWithString:locale: rather than
1854         -initWithMantissa:exponent:isNegative: to create an NSDecimalNumber.
1855         (WebKit::toPKPaymentSummaryItem):
1856         (WebKit::toPKShippingMethod):
1857
1858 2017-10-05  Youenn Fablet  <youenn@apple.com>
1859
1860         Make LibWebRTCProvider port agnostic
1861         https://bugs.webkit.org/show_bug.cgi?id=177747
1862
1863         Reviewed by Alex Christensen & Alex Garcia.
1864
1865         * WebProcess/Network/webrtc/LibWebRTCProvider.h: Making sure Mac/iOS provider creates the codec factories.
1866
1867 2017-10-04  Alex Christensen  <achristensen@webkit.org>
1868
1869         Stop linking with WebKitSystemInterface
1870         https://bugs.webkit.org/show_bug.cgi?id=177915
1871
1872         Reviewed by Antti Koivisto.
1873
1874         * Configurations/DebugRelease.xcconfig:
1875         * WebKit.xcodeproj/project.pbxproj:
1876
1877 2017-10-04  Alex Christensen  <achristensen@webkit.org>
1878
1879         Remove unnecessary includes of WebKitSystemInterface on Cocoa platforms
1880         https://bugs.webkit.org/show_bug.cgi?id=177912
1881
1882         Reviewed by Saam Barati.
1883
1884         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1885         * NetworkProcess/mac/NetworkProcessMac.mm:
1886         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1887         * Platform/IPC/mac/ConnectionMac.mm:
1888         * Platform/mac/LayerHostingContext.mm:
1889         * PluginProcess/mac/PluginProcessMac.mm:
1890         * PluginProcess/mac/PluginProcessShim.mm:
1891         * Shared/ios/ChildProcessIOS.mm:
1892         * Shared/mac/ChildProcessMac.mm:
1893         * Shared/mac/SandboxExtensionMac.mm:
1894         * Shared/mac/WebCoreArgumentCodersMac.mm:
1895         * Shared/mac/WebEventFactory.mm:
1896         * StorageProcess/ios/StorageProcessIOS.mm:
1897         * StorageProcess/mac/StorageProcessMac.mm:
1898         * UIProcess/API/Cocoa/WKWebView.mm:
1899         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
1900         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
1901         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1902         * UIProcess/Cocoa/WebViewImpl.mm:
1903         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1904         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
1905         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
1906         * UIProcess/mac/PageClientImplMac.mm:
1907         * UIProcess/mac/WKTextInputWindowController.mm:
1908         * UIProcess/mac/WebContextMenuProxyMac.mm:
1909         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1910         * UIProcess/mac/WindowServerConnection.mm:
1911         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
1912         * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:
1913         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1914         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1915         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
1916         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1917         * WebProcess/WebPage/ios/WebPageIOS.mm:
1918         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
1919         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
1920         * WebProcess/WebPage/mac/WebPageMac.mm:
1921         * WebProcess/cocoa/WebProcessCocoa.mm:
1922
1923 2017-10-04  Youenn Fablet  <youenn@apple.com>
1924
1925         rtc::PacketOptions should have its own IPC encoding/decoding routines
1926         https://bugs.webkit.org/show_bug.cgi?id=177812
1927
1928         Reviewed by Alex Christensen.
1929
1930         Replacing rtc::PacketOptions IPC encoding/decoding from passing the structure as individual parameters to the structure as a parameter.
1931         Introducing WebKit::RTCPacketOptions as a wrapper around it for which encode/decode routines are added.
1932         Updating code using rtc::PacketOptions accordingly.
1933
1934         * NetworkProcess/webrtc/NetworkRTCSocket.cpp:
1935         (WebKit::NetworkRTCSocket::sendTo):
1936         * NetworkProcess/webrtc/NetworkRTCSocket.h:
1937         * NetworkProcess/webrtc/NetworkRTCSocket.messages.in:
1938         * Platform/IPC/Decoder.cpp:
1939         (IPC::Decoder::operator>>):
1940         (IPC::Decoder::decode):
1941         * Platform/IPC/Decoder.h:
1942         * Platform/IPC/Encoder.cpp:
1943         (IPC::Encoder::encode):
1944         * Platform/IPC/Encoder.h:
1945         * Shared/RTCPacketOptions.cpp: Added.
1946         (WebKit::RTCPacketOptions::encode const):
1947         (WebKit::RTCPacketOptions::decode):
1948         * Shared/RTCPacketOptions.h: Added.
1949         * WebKit.xcodeproj/project.pbxproj:
1950         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
1951         (WebKit::LibWebRTCSocket::SendTo):
1952
1953 2017-10-04  Don Olmstead  <don.olmstead@sony.com>
1954
1955         Include Pasteboard.h for all in WebCoreArgumentCoders
1956         https://bugs.webkit.org/show_bug.cgi?id=177902
1957
1958         Reviewed by Alex Christensen.
1959
1960         * Shared/WebCoreArgumentCoders.cpp:
1961
1962 2017-10-04  David Kilzer  <ddkilzer@apple.com>
1963
1964         Remove unused variables in lambdas for network process cache
1965         <https://webkit.org/b/177878>
1966         <rdar://problem/34038482>
1967
1968         Reviewed by Tim Horton.
1969
1970         * NetworkProcess/cache/CacheStorageEngine.cpp:
1971         (WebKit::CacheStorage::Engine::open):
1972         (WebKit::CacheStorage::Engine::putRecords):
1973         (WebKit::CacheStorage::Engine::deleteMatchingRecords):
1974         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
1975         (WebKit::CacheStorageEngineConnection::reference):
1976         - Remove unused |this| from lambda captures.
1977
1978 2017-10-04  Stephan Szabo  <stephan.szabo@sony.com>
1979
1980         [WinCairo] add PLATFORM(WIN) configurations to config.h
1981         https://bugs.webkit.org/show_bug.cgi?id=177846
1982
1983         Reviewed by Alex Christensen.
1984
1985         * config.h:
1986
1987 2017-10-04  Adrian Perez de Castro  <aperez@igalia.com>
1988
1989         [GTK] WebKit2GTK+ does not handle touchmove and touchend events correctly
1990         https://bugs.webkit.org/show_bug.cgi?id=158531
1991
1992         Reviewed by Carlos Alberto Lopez Perez.
1993
1994         Do not bypass WebCore event handling when receiving touch events.
1995
1996         Based on a patch by Andre Moreira Magalhaes <andre.magalhaes@collabora.co.uk>.
1997         Thanks to Carlos Garnacho <carlosg@gnome.org> for helping out reviewing the code.
1998
1999         * UIProcess/API/gtk/PageClientImpl.cpp:
2000         (WebKit::PageClientImpl::doneWithTouchEvent): Make sure touchend reaches gesture controller if touchbegin evet got to it.
2001         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2002         (webkitWebViewBaseTouchEvent): Do not invoke gesture controller directly by bypassing WebCore event handling.
2003         * UIProcess/gtk/GestureController.cpp:
2004         (WebKit::GestureController::reset): Added.
2005         (WebKit::GestureController::handleEvent): Reset gesture controller when touchpadupdate/end is received without touchbegin.
2006         (WebKit::GestureController::Gesture::reset): Added.
2007         * UIProcess/gtk/GestureController.h:
2008
2009 2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
2010
2011         Unreviewed WPE build fix after r222837
2012         https://bugs.webkit.org/show_bug.cgi?id=177449
2013
2014         * Shared/wpe/WebEventFactory.cpp:
2015         (WebKit::wallTimeForEventTime):
2016
2017 2017-10-04  Ryosuke Niwa  <rniwa@webkit.org>
2018
2019         Use blob URL when pasting RTFD instead of overriding DocumentLoader
2020         https://bugs.webkit.org/show_bug.cgi?id=177801
2021         <rdar://problem/34542270>
2022
2023         Reviewed by Wenson Hsieh.
2024
2025         Fixed the assertion failure when RTFD content is empty.
2026
2027         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2028         (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
2029
2030 2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>
2031
2032         REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
2033         https://bugs.webkit.org/show_bug.cgi?id=177449
2034
2035         Reviewed by Chris Dumez.
2036
2037         * Shared/wpe/WebEventFactory.cpp:
2038         (WebKit::wallTimeForEventTime):
2039
2040 2017-10-03  Brent Fulgham  <bfulgham@apple.com>
2041
2042         Correct nullptr dereference during shutdown
2043         https://bugs.webkit.org/show_bug.cgi?id=177845
2044         <rdar://problem/33651405>
2045
2046         Reviewed by Chris Dumez.
2047
2048         It looks like the ResourceLoadStatisticsPersistentStorage destructor is calling code that attempts
2049         to use member variables in its owning class (WebResourceLoadStatisticsStore). Since these may have
2050         already been destroyed, they are in an invalid state when accessed.
2051
2052         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
2053         (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage): Do not call
2054         finishAllPendingWorkSynchronously() in the destructor, since it relies on the m_memoryStore to be
2055         a reference to completely valid object.
2056         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2057         (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore): Instead, call
2058         'finishAllPendingWorkSynchronously' here, when the object is still in a known valid state.
2059
2060 2017-10-03  Alex Christensen  <achristensen@webkit.org>
2061
2062         Moderize WebKit's back forward list code
2063         https://bugs.webkit.org/show_bug.cgi?id=177843
2064
2065         Reviewed by Tim Horton.
2066
2067         Use Ref instead of RefPtr when possible.
2068         Use references instead of pointers when possible.
2069         Remove unnecessary null checks.
2070         Reduce unnecessary Vector copying.
2071
2072         * Shared/SessionState.h:
2073         * Shared/WebBackForwardListItem.h:
2074         * UIProcess/API/APILoaderClient.h:
2075         (API::LoaderClient::didChangeBackForwardList):
2076         (API::LoaderClient::shouldKeepCurrentBackForwardListItemInList):
2077         * UIProcess/API/C/WKPage.cpp:
2078         (WKPageSetPageLoaderClient):
2079         * UIProcess/WebBackForwardList.cpp:
2080         (WebKit::WebBackForwardList::pageClosed):
2081         (WebKit::WebBackForwardList::addItem):
2082         (WebKit::WebBackForwardList::goToItem):
2083         (WebKit::WebBackForwardList::currentItem const):
2084         (WebKit::WebBackForwardList::backItem const):
2085         (WebKit::WebBackForwardList::forwardItem const):
2086         (WebKit::WebBackForwardList::itemAtIndex const):
2087         (WebKit::WebBackForwardList::backListAsAPIArrayWithLimit const):
2088         (WebKit::WebBackForwardList::forwardListAsAPIArrayWithLimit const):
2089         (WebKit::WebBackForwardList::removeAllItems):
2090         (WebKit::WebBackForwardList::clear):
2091         (WebKit::WebBackForwardList::backForwardListState const):
2092         (WebKit::WebBackForwardList::restoreFromState):
2093         * UIProcess/WebBackForwardList.h:
2094         * UIProcess/WebPageProxy.cpp:
2095         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
2096         (WebKit::WebPageProxy::initializeWebPage):
2097         (WebKit::WebPageProxy::didChangeBackForwardList):
2098         (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList):
2099         (WebKit::WebPageProxy::backForwardGoToItem):
2100         * UIProcess/WebPageProxy.h:
2101         * UIProcess/WebProcessProxy.cpp:
2102         (WebKit::WebProcessProxy::registerNewWebBackForwardListItem):
2103         * UIProcess/WebProcessProxy.h:
2104         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2105         (WebKit::WebBackForwardListProxy::itemAtIndex):
2106
2107 2017-10-03  Chris Dumez  <cdumez@apple.com>
2108
2109         SharedStringHashStore should support removing hashes
2110         https://bugs.webkit.org/show_bug.cgi?id=177770
2111
2112         Reviewed by Alex Christensen.
2113
2114         SharedStringHashStore should support removing hashes. It currently only supports adding hashes or
2115         clearing all of them, which is sufficient for the VisitedLinkStore but will not be for Service
2116         Worker purposes.
2117
2118         * Shared/SharedStringHashStore.cpp:
2119         (WebKit::SharedStringHashStore::SharedStringHashStore):
2120         (WebKit::SharedStringHashStore::add):
2121         (WebKit::SharedStringHashStore::remove):
2122         (WebKit::SharedStringHashStore::contains):
2123         (WebKit::SharedStringHashStore::clear):
2124         (WebKit::SharedStringHashStore::resizeTable):
2125         (WebKit::SharedStringHashStore::pendingOperationsTimerFired):
2126         * Shared/SharedStringHashStore.h:
2127         * Shared/SharedStringHashTable.cpp:
2128         (WebKit::SharedStringHashTable::remove):
2129         * Shared/SharedStringHashTable.h:
2130         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
2131         * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm:
2132         (-[_WKVisitedLinkStore containsVisitedLinkWithURL:]):
2133         (-[_WKVisitedLinkStore removeVisitedLinkWithURL:]):
2134         * UIProcess/VisitedLinkStore.cpp:
2135         (WebKit::VisitedLinkStore::containsVisitedLinkHash):
2136         (WebKit::VisitedLinkStore::removeVisitedLinkHash):
2137         (WebKit::VisitedLinkStore::didUpdateSharedStringHashes):
2138         * UIProcess/VisitedLinkStore.h:
2139
2140 2017-10-03  Alex Christensen  <achristensen@webkit.org>
2141
2142         Fix API tests after r222794.
2143         https://bugs.webkit.org/show_bug.cgi?id=177825
2144
2145         * UIProcess/WebPageProxy.cpp:
2146         (WebKit::WebPageProxy::willGoToBackForwardListItem):
2147         Sometimes there's no navigation client.
2148
2149 2017-10-03  Alex Christensen  <achristensen@webkit.org>
2150
2151         Add ObjC equivalent of WKPageLoaderClient.pluginDidFail
2152         https://bugs.webkit.org/show_bug.cgi?id=177787
2153         <rdar://problem/22387633>
2154
2155         Reviewed by Tim Horton.
2156
2157         * UIProcess/API/APILoaderClient.h:
2158         (API::LoaderClient::didFailToInitializePlugin):
2159         * UIProcess/API/APINavigationClient.h:
2160         (API::NavigationClient::canHandleDidFailToInitializePlugIn const):
2161         (API::NavigationClient::didFailToInitializePlugIn):
2162         * UIProcess/API/C/WKPage.cpp:
2163         (WKPageSetPageLoaderClient):
2164         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2165         * UIProcess/Cocoa/NavigationState.h:
2166         * UIProcess/Cocoa/NavigationState.mm:
2167         (WebKit::NavigationState::setNavigationDelegate):
2168         (WebKit::NavigationState::NavigationClient::canHandleDidFailToInitializePlugIn const):
2169         (WebKit::NavigationState::NavigationClient::didFailToInitializePlugIn):
2170         * UIProcess/WebPageProxy.cpp:
2171         (WebKit::WebPageProxy::didFailToInitializePlugin):
2172
2173 2017-10-03  Adrian Perez de Castro  <aperez@igalia.com>
2174
2175         [GTK] Prefer -webkit-system-font
2176         https://bugs.webkit.org/show_bug.cgi?id=177814
2177
2178         Reviewed by Carlos Garcia Campos.
2179
2180         Use "font-family: -webkit-system-font" instead of "font: menu".
2181
2182         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
2183         (WebKit::RemoteInspectorProtocolHandler::handleRequest): Edited HTML snippet.
2184
2185 2017-10-03  Alex Christensen  <achristensen@webkit.org>
2186
2187         Add ObjC SPI equivalent to WKPageLoaderClient.willGoToBackForwardListItem
2188         https://bugs.webkit.org/show_bug.cgi?id=177825
2189         <rdar://problem/22387505>
2190
2191         Reviewed by Tim Horton.
2192
2193         * UIProcess/API/APILoaderClient.h:
2194         (API::LoaderClient::willGoToBackForwardListItem):
2195         * UIProcess/API/APINavigationClient.h:
2196         (API::NavigationClient::canHandleWillGoToBackForwardListItem const):
2197         (API::NavigationClient::willGoToBackForwardListItem):
2198         * UIProcess/API/C/WKPage.cpp:
2199         (WKPageSetPageLoaderClient):
2200         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2201         * UIProcess/Cocoa/NavigationState.h:
2202         * UIProcess/Cocoa/NavigationState.mm:
2203         (WebKit::NavigationState::setNavigationDelegate):
2204         (WebKit::NavigationState::NavigationClient::canHandleWillGoToBackForwardListItem const):
2205         (WebKit::NavigationState::NavigationClient::willGoToBackForwardListItem):
2206         * UIProcess/WebPageProxy.cpp:
2207         (WebKit::WebPageProxy::willGoToBackForwardListItem):
2208         * UIProcess/WebPageProxy.h:
2209         * UIProcess/WebPageProxy.messages.in:
2210         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2211         (WebKit::WebFrameLoaderClient::shouldGoToHistoryItem const):
2212
2213 2017-10-03  Michael Catanzaro  <mcatanzaro@igalia.com>
2214
2215         REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
2216         https://bugs.webkit.org/show_bug.cgi?id=177449
2217
2218         Reviewed by Chris Dumez.
2219
2220         * Shared/gtk/WebEventFactory.cpp:
2221         (WebKit::WebEventFactory::createWebMouseEvent):
2222         (WebKit::WebEventFactory::createWebWheelEvent):
2223         (WebKit::WebEventFactory::createWebKeyboardEvent):
2224         (WebKit::WebEventFactory::createWebTouchEvent):
2225         * Shared/wpe/WebEventFactory.cpp:
2226         (WebKit::wallTimeForEventTime):
2227         (WebKit::WebEventFactory::createWebKeyboardEvent):
2228         (WebKit::WebEventFactory::createWebMouseEvent):
2229         (WebKit::WebEventFactory::createWebWheelEvent):
2230         (WebKit::WebEventFactory::createWebTouchEvent):
2231
2232 2017-10-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2233
2234         [GTK][WPE] WebProcess should run cleanup on quit to release resources
2235         https://bugs.webkit.org/show_bug.cgi?id=168126
2236
2237         Reviewed by Michael Catanzaro.
2238
2239         Do not call exit on sync message send failure for GTK and WPE ports.
2240
2241         * WebProcess/WebProcess.cpp:
2242         (WebKit::WebProcess::initializeConnection):
2243
2244 2017-10-02  Ryosuke Niwa  <rniwa@webkit.org>
2245
2246         Move more code into PasteboardCustomData
2247         https://bugs.webkit.org/show_bug.cgi?id=177795
2248
2249         Reviewed by Wenson Hsieh.
2250
2251         Added the support for encoding and decoding the origin string in PasteboardCustomData.
2252
2253         * Shared/WebCoreArgumentCoders.cpp:
2254         (IPC::ArgumentCoder<PasteboardCustomData>::encode):
2255         (IPC::ArgumentCoder<PasteboardCustomData>::decode):
2256
2257 2017-10-02  Adrian Perez de Castro  <aperez@igalia.com>
2258
2259         [GTK] Do not hardcode font family in served remote inspector HTML snippets
2260         https://bugs.webkit.org/show_bug.cgi?id=177742
2261
2262         Reviewed by Carlos Garcia Campos.
2263
2264         Instead of hardcoding Cantarell as the font used for the HTML snippets served
2265         by the remote inspector handler, use "font: menu" to obtain the system UI
2266         font, plus a "font-size" rule for adjusting the size.
2267
2268         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
2269         (WebKit::RemoteInspectorProtocolHandler::handleRequest): Change the
2270         CSS rules in the served snippet.
2271
2272 2017-10-02  Joseph Pecoraro  <pecoraro@apple.com>
2273
2274         Web Inspector: Include Beacon and Ping requests in Network tab
2275         https://bugs.webkit.org/show_bug.cgi?id=177641
2276         <rdar://problem/33086839>
2277
2278         Reviewed by Chris Dumez.
2279
2280         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2281         (WebKit::NetworkConnectionToWebProcess::loadPing):
2282         (WebKit::NetworkConnectionToWebProcess::didFinishPingLoad):
2283         * NetworkProcess/NetworkConnectionToWebProcess.h:
2284         * NetworkProcess/PingLoad.cpp:
2285         (WebKit::PingLoad::PingLoad):
2286         (WebKit::PingLoad::didFinish):
2287         (WebKit::PingLoad::didReceiveResponseNetworkSession):
2288         * NetworkProcess/PingLoad.h:
2289         * WebProcess/Network/NetworkProcessConnection.cpp:
2290         (WebKit::NetworkProcessConnection::didFinishPingLoad):
2291         * WebProcess/Network/NetworkProcessConnection.h:
2292         * WebProcess/Network/NetworkProcessConnection.messages.in:
2293         * WebProcess/Network/WebLoaderStrategy.cpp:
2294         (WebKit::WebLoaderStrategy::networkProcessCrashed):
2295         (WebKit::WebLoaderStrategy::startPingLoad):
2296         (WebKit::WebLoaderStrategy::didFinishPingLoad):
2297         * WebProcess/Network/WebLoaderStrategy.h:
2298         Pass an optional ResourceResponse back to the ping completion handler.
2299
2300 2017-10-02  Alex Christensen  <achristensen@webkit.org>
2301
2302         REGRESSION: API tests WebKit.ProcessDidTerminateRequestedByClient and WebKit.ProcessDidTerminateWithReasonCrash are timing out
2303         https://bugs.webkit.org/show_bug.cgi?id=177764
2304
2305         Reviewed by Chris Dumez.
2306
2307         * UIProcess/API/C/WKPage.cpp:
2308         (WKPageSetPageNavigationClient):
2309         I shouldn't have reverted the A API telling the listener to continue if there's no client function.
2310
2311 2017-10-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2312
2313         [WPE][GTK] Crash in webkit_web_resource_get_data_finish()
2314         https://bugs.webkit.org/show_bug.cgi?id=177107
2315
2316         Reviewed by Michael Catanzaro.
2317
2318         Handle errors in webkit_web_resource_get_data() callback.
2319
2320         * UIProcess/API/glib/WebKitWebResource.cpp:
2321         (resourceDataCallback):
2322         (webkit_web_resource_get_data):
2323
2324 2017-10-02  Olivier Blin  <olivier.blin@softathome.com>
2325
2326         [WPE] Fix UIProcess build with GStreamer and without VIDEO
2327         https://bugs.webkit.org/show_bug.cgi?id=177753
2328
2329         Reviewed by Michael Catanzaro.
2330
2331         GStreamer builds fail when WebAudio is enabled but VIDEO disabled.
2332         This is the WPE counterpart of bug 153135.
2333
2334         * UIProcess/API/wpe/PageClientImpl.h:
2335
2336 2017-10-02  Alex Christensen  <achristensen@webkit.org>
2337
2338         Expose more WKPreferences SPI to match C SPI
2339         https://bugs.webkit.org/show_bug.cgi?id=177697
2340
2341         * UIProcess/API/Cocoa/WKPreferences.mm:
2342         (-[WKPreferences _javaEnabledForLocalFiles]):
2343         (-[WKPreferences _setPlugInsEnabled:]): Deleted.
2344         (-[WKPreferences _plugInsEnabled]): Deleted.
2345         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2346         _javaEnabledForLocalFiles should return the correct value.
2347         _plugInsEnabled has public API.  This SPI is not needed.
2348
2349 2017-10-02  Alex Christensen  <achristensen@webkit.org>
2350
2351         REGRESSION(r214201): WebProcess hangs during policy decisions
2352         https://bugs.webkit.org/show_bug.cgi?id=177590
2353         <rdar://problem/33362929>
2354
2355         Reviewed by Andy Estes.
2356
2357         This is like r222431 but for trunk instead of a branch.
2358         It includes the same regression API test so I don't make the same mistake again.
2359
2360         * UIProcess/API/C/WKPage.cpp:
2361         (WKPageSetPageNavigationClient):
2362         * UIProcess/WebPageProxy.cpp:
2363         (WebKit::WebPageProxy::receivedPolicyDecision):
2364         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2365         (WebKit::WebPageProxy::decidePolicyForResponseSync):
2366         * UIProcess/WebPageProxy.h:
2367         * UIProcess/WebPageProxy.messages.in:
2368         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2369         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2370         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
2371         (WebKit::WebFrameLoaderClient::applyToDocumentLoader):
2372         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2373         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2374         * WebProcess/WebPage/WebDocumentLoader.cpp:
2375         (WebKit::WebDocumentLoader::setNavigationID):
2376         * WebProcess/WebPage/WebFrame.cpp:
2377         (WebKit::WebFrame::setUpPolicyListener):
2378         (WebKit::WebFrame::invalidatePolicyListener):
2379         (WebKit::WebFrame::didReceivePolicyDecision):
2380         * WebProcess/WebPage/WebFrame.h:
2381         * WebProcess/WebPage/WebPage.cpp:
2382         (WebKit::WebPage::didReceivePolicyDecision):
2383         * WebProcess/WebPage/WebPage.h:
2384         * WebProcess/WebPage/WebPage.messages.in:
2385
2386 2017-10-02  Alex Christensen  <achristensen@webkit.org>
2387
2388         Remove unnecessary copy of SessionID in WebPageProxy
2389         https://bugs.webkit.org/show_bug.cgi?id=177702
2390
2391         Reviewed by Darin Adler.
2392
2393         * UIProcess/WebPageProxy.cpp:
2394         (WebKit::WebPageProxy::sessionID const):
2395         (WebKit::WebPageProxy::creationParameters):
2396         * UIProcess/WebPageProxy.h:
2397         (WebKit::WebPageProxy::sessionID const): Deleted.
2398
2399 2017-10-02  Alex Christensen  <achristensen@webkit.org>
2400
2401         Expose more WKPreferences SPI to match C SPI
2402         https://bugs.webkit.org/show_bug.cgi?id=177697
2403         <rdar://problem/24110556>
2404
2405         Reviewed by Darin Adler.
2406
2407         * UIProcess/API/Cocoa/WKPreferences.mm:
2408         (-[WKPreferences _setJavaEnabledForLocalFiles:]):
2409         (-[WKPreferences _javaEnabledForLocalFiles]):
2410         (-[WKPreferences _setCanvasUsesAcceleratedDrawing:]):
2411         (-[WKPreferences _canvasUsesAcceleratedDrawing]):
2412         (-[WKPreferences _setAcceleratedCompositingEnabled:]):
2413         (-[WKPreferences _acceleratedCompositingEnabled]):
2414         (-[WKPreferences _setDefaultTextEncodingName:]):
2415         (-[WKPreferences _defaultTextEncodingName]):
2416         (-[WKPreferences _setNeedsSiteSpecificQuirks:]):
2417         (-[WKPreferences _needsSiteSpecificQuirks]):
2418         (-[WKPreferences _setAuthorAndUserStylesEnabled:]):
2419         (-[WKPreferences _authorAndUserStylesEnabled]):
2420         (-[WKPreferences _setDOMTimersThrottlingEnabled:]):
2421         (-[WKPreferences _domTimersThrottlingEnabled]):
2422         (-[WKPreferences _setWebArchiveDebugModeEnabled:]):
2423         (-[WKPreferences _webArchiveDebugModeEnabled]):
2424         (-[WKPreferences _setLocalFileContentSniffingEnabled:]):
2425         (-[WKPreferences _localFileContentSniffingEnabled]):
2426         (-[WKPreferences _setUsesPageCache:]):
2427         (-[WKPreferences _usesPageCache]):
2428         (-[WKPreferences _setPageCacheSupportsPlugins:]):
2429         (-[WKPreferences _pageCacheSupportsPlugins]):
2430         (-[WKPreferences _setShouldPrintBackgrounds:]):
2431         (-[WKPreferences _shouldPrintBackgrounds]):
2432         (-[WKPreferences _setWebSecurityEnabled:]):
2433         (-[WKPreferences _webSecurityEnabled]):
2434         (-[WKPreferences _setUniversalAccessFromFileURLsAllowed:]):
2435         (-[WKPreferences _universalAccessFromFileURLsAllowed]):
2436         (-[WKPreferences _setAVFoundationEnabled:]):
2437         (-[WKPreferences _avFoundationEnabled]):
2438         (-[WKPreferences _setSuppressesIncrementalRendering:]):
2439         (-[WKPreferences _suppressesIncrementalRendering]):
2440         (-[WKPreferences _setAsynchronousPluginInitializationEnabled:]):
2441         (-[WKPreferences _asynchronousPluginInitializationEnabled]):
2442         (-[WKPreferences _setArtificialPluginInitializationDelayEnabled:]):
2443         (-[WKPreferences _artificialPluginInitializationDelayEnabled]):
2444         (-[WKPreferences _setCookieEnabled:]):
2445         (-[WKPreferences _cookieEnabled]):
2446         (-[WKPreferences _setPlugInSnapshottingEnabled:]):
2447         (-[WKPreferences _plugInSnapshottingEnabled]):
2448         (-[WKPreferences _setQTKitEnabled:]):
2449         (-[WKPreferences _qtKitEnabled]):
2450         (-[WKPreferences _setSubpixelCSSOMElementMetricsEnabled:]):
2451         (-[WKPreferences _subpixelCSSOMElementMetricsEnabled]):
2452         (-[WKPreferences _setMediaSourceEnabled:]):
2453         (-[WKPreferences _mediaSourceEnabled]):
2454         (-[WKPreferences _setViewGestureDebuggingEnabled:]):
2455         (-[WKPreferences _viewGestureDebuggingEnabled]):
2456         (-[WKPreferences _setCSSAnimationTriggersEnabled:]):
2457         (-[WKPreferences _cssAnimationTriggersEnabled]):
2458         (-[WKPreferences _setStandardFontFamily:]):
2459         (-[WKPreferences _standardFontFamily]):
2460         (-[WKPreferences _setNotificationsEnabled:]):
2461         (-[WKPreferences _notificationsEnabled]):
2462         (-[WKPreferences _setBackspaceKeyNavigationEnabled:]):
2463         (-[WKPreferences _backspaceKeyNavigationEnabled]):
2464         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2465
2466 2017-10-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2467
2468         [GTK][WPE] Enable interactive forms validation by default
2469         https://bugs.webkit.org/show_bug.cgi?id=177737
2470
2471         Reviewed by Michael Catanzaro.
2472
2473         It's currently disabled for no reason.
2474
2475         * Shared/WebPreferencesDefinitions.h:
2476
2477 2017-10-02  Michael Catanzaro  <mcatanzaro@igalia.com>
2478
2479         Remove ENABLE_CSS_REGIONS
2480         https://bugs.webkit.org/show_bug.cgi?id=177689
2481
2482         Reviewed by Darin Adler.
2483
2484         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
2485         (webkit_dom_element_get_webkit_region_overset):
2486         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.h:
2487         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
2488         (webkit_dom_element_get_webkit_region_overset): Deleted.
2489         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
2490
2491 2017-09-30  Darin Adler  <darin@apple.com>
2492
2493         Have IPC::Connection::Client objects consistently invalidate the connection when destroyed
2494         https://bugs.webkit.org/show_bug.cgi?id=177708
2495
2496         Reviewed by Anders Carlsson.
2497
2498         I ran into an intermittent crash when running regression tests. It looked like a connection
2499         client was being called after it was destroyed. I did an audit of the all the connection
2500         clients to make sure they all invalidate their connection before they are destroyed.
2501
2502         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2503         (WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess): Invalidate the
2504         connection since this object opened the connection. There is no obvious
2505         guarantee that the connection will already be invalid when this is destroyed.
2506         * StorageProcess/StorageToWebProcessConnection.cpp:
2507         (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection): Ditto.
2508         * UIProcess/Plugins/PluginProcessProxy.cpp:
2509         (WebKit::PluginProcessProxy::~PluginProcessProxy): Ditto.
2510         * WebProcess/Network/NetworkProcessConnection.cpp:
2511         (WebKit::NetworkProcessConnection::~NetworkProcessConnection): Ditto.
2512         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
2513         (WebKit::WebToStorageProcessConnection::~WebToStorageProcessConnection): Ditto.
2514
2515         * StorageProcess/StorageToWebProcessConnection.h: Derive privately rather than publicly
2516         from IPC::Connection::Client because we can, and this means we don't have to study quite
2517         as much code to understand how this is used as a connection client.
2518         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: Ditto.
2519         * WebProcess/Storage/WebToStorageProcessConnection.h: Ditto.
2520         * WebProcess/WebPage/WebInspector.h: Ditto.
2521         * WebProcess/WebPage/WebInspectorUI.h: Ditto.
2522
2523         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2524         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer): Added a comment about a
2525         reference cycle cycle leading to a leak that I believe exists here.
2526
2527 2017-09-29  Alex Christensen  <achristensen@webkit.org>
2528
2529         REGRESSION: ASSERTION FAILED: m_provisionalURL.isEmpty() in WebKit::FrameLoadState::didStartProvisionalLoad
2530         https://bugs.webkit.org/show_bug.cgi?id=177491
2531
2532         Reviewed by Andy Estes.
2533
2534         * WebProcess/WebPage/WebFrame.cpp:
2535         (WebKit::WebFrame::setUpWillSubmitFormListener):
2536         (WebKit::WebFrame::continueWillSubmitForm):
2537         (WebKit::WebFrame::invalidatePolicyListener):
2538         Speculative fix for a flaky assertion.
2539         Restore the clearing of the policy listeners we used to have when form submission was treated as a policy.
2540
2541 2017-09-29  Chris Dumez  <cdumez@apple.com>
2542
2543         http/tests/preconnect/link-rel-preconnect-https.html is flaky
2544         https://bugs.webkit.org/show_bug.cgi?id=177673
2545
2546         Reviewed by Alex Christensen.
2547
2548         Update PreconnectTask to query the client when a certificate needs to be
2549         validated. This allows WebKitTestRunner to ignore invalid certificates
2550         and this causes http/tests/preconnect/link-rel-preconnect-https.html
2551         to pass consistently.
2552
2553         To avoid duplicating code, PreconnectTask now uses NetworkLoad internally
2554         instead of using a NetworkDataTask directly.
2555
2556         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2557         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
2558         * NetworkProcess/NetworkConnectionToWebProcess.h:
2559         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2560         * NetworkProcess/NetworkLoad.h:
2561         * NetworkProcess/NetworkProcess.cpp:
2562         (WebKit::generateCanAuthenticateIdentifier):
2563         (WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace):
2564         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace):
2565         (WebKit::NetworkProcess::preconnectTo):
2566         * NetworkProcess/NetworkProcess.h:
2567         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2568         (WebKit::NetworkResourceLoadParameters::encode const):
2569         (WebKit::NetworkResourceLoadParameters::decode):
2570         * NetworkProcess/PreconnectTask.cpp:
2571         (WebKit::PreconnectTask::PreconnectTask):
2572         (WebKit::PreconnectTask::~PreconnectTask):
2573         (WebKit::PreconnectTask::willSendRedirectedRequest):
2574         (WebKit::PreconnectTask::didReceiveResponse):
2575         (WebKit::PreconnectTask::didReceiveBuffer):
2576         (WebKit::PreconnectTask::didFinishLoading):
2577         (WebKit::PreconnectTask::didFailLoading):
2578         (WebKit::PreconnectTask::didSendData):
2579         (WebKit::PreconnectTask::canAuthenticateAgainstProtectionSpaceAsync):
2580         (WebKit::PreconnectTask::continueCanAuthenticateAgainstProtectionSpace):
2581         (WebKit::PreconnectTask::frameID const):
2582         (WebKit::PreconnectTask::pageID const):
2583         * NetworkProcess/PreconnectTask.h:
2584         * WebProcess/Network/WebLoaderStrategy.cpp:
2585         (WebKit::WebLoaderStrategy::preconnectTo):
2586         * WebProcess/Network/WebLoaderStrategy.h:
2587
2588 2017-09-29  Alex Christensen  <achristensen@webkit.org>
2589
2590         Expose WebPreferences::webGLEnabled through WKPreferences
2591         https://bugs.webkit.org/show_bug.cgi?id=177692
2592         <rdar://problem/24110556>
2593
2594         Reviewed by Andy Estes.
2595
2596         * UIProcess/API/Cocoa/WKPreferences.mm:
2597         (-[WKPreferences _setWebGLEnabled:]):
2598         (-[WKPreferences _webGLEnabled]):
2599         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2600
2601 2017-09-29  Chris Dumez  <cdumez@apple.com>
2602
2603         [WK2][NETWORK_SESSION] Move some authentication-related code to avoid duplication
2604         https://bugs.webkit.org/show_bug.cgi?id=177667
2605
2606         Reviewed by Alex Christensen.
2607
2608         Move some authentication-related code to avoid duplication.
2609         This is a preparation code supporting Download authentication
2610         as Download uses a NSURLSessionDownloadTask and not a
2611         NetworkDataTask.
2612
2613         * NetworkProcess/NetworkDataTask.h:
2614         (WebKit::NetworkDataTask::setSuggestedFilename):
2615         * NetworkProcess/NetworkLoad.cpp:
2616         (WebKit::NetworkLoad::didReceiveChallenge):
2617         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
2618         * NetworkProcess/NetworkSession.cpp:
2619         (WebKit::NetworkSession::allowsSpecificHTTPSCertificateForHost):
2620         * NetworkProcess/NetworkSession.h:
2621         * NetworkProcess/PreconnectTask.cpp:
2622         (WebKit::PreconnectTask::didReceiveChallenge):
2623         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2624         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2625         (WebKit::NetworkDataTaskCocoa::didReceiveChallenge):
2626         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
2627         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2628         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
2629         (WebKit::certificatesMatch):
2630         (WebKit::NetworkSessionCocoa::allowsSpecificHTTPSCertificateForHost):
2631
2632 2017-09-29  Alex Christensen  <achristensen@webkit.org>
2633
2634         Fix WKWebViewConfigurationPrivate after r222663
2635         https://bugs.webkit.org/show_bug.cgi?id=177644
2636
2637         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2638         (-[WKWebViewConfiguration init]):
2639         (-[WKWebViewConfiguration copyWithZone:]):
2640         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2641
2642 2017-09-29  Chris Dumez  <cdumez@apple.com>
2643
2644         Split some logic out of VisitedLinkStore and make it reusable
2645         https://bugs.webkit.org/show_bug.cgi?id=177575
2646
2647         Reviewed by Alex Christensen.
2648
2649         Split some logic out of VisitedLinkStore and make it reusable for other purposes than
2650         visited links and from other processes than the UIProcess.
2651
2652         The plan is to reuse the new SharedStringHashStore for Service Worker registration
2653         on StorageProcess side and querying on WebContent process side.
2654
2655         * CMakeLists.txt:
2656         * Shared/SharedStringHashStore.cpp: Added.
2657         (WebKit::nextPowerOf2):
2658         (WebKit::tableSizeForKeyCount):
2659         (WebKit::SharedStringHashStore::SharedStringHashStore):
2660         (WebKit::SharedStringHashStore::createSharedMemoryHandle):
2661         (WebKit::SharedStringHashStore::add):
2662         (WebKit::SharedStringHashStore::clear):
2663         (WebKit::SharedStringHashStore::resizeTable):
2664         (WebKit::SharedStringHashStore::pendingSharedStringHashesTimerFired):
2665         * Shared/SharedStringHashStore.h: Copied from Source/WebKit/WebProcess/WebPage/VisitedLinkTableController.h.
2666         (WebKit::SharedStringHashStore::Client::~Client):
2667         (WebKit::SharedStringHashStore::isEmpty const):
2668         * Shared/SharedStringHashTable.cpp: Renamed from Source/WebKit/Shared/VisitedLinkTable.cpp.
2669         (WebKit::SharedStringHashTable::SharedStringHashTable):
2670         (WebKit::SharedStringHashTable::~SharedStringHashTable):
2671         (WebKit::SharedStringHashTable::setSharedMemory):
2672         (WebKit::SharedStringHashTable::add):
2673         (WebKit::SharedStringHashTable::contains const):
2674         (WebKit::SharedStringHashTable::clear):
2675         * Shared/SharedStringHashTable.h: Renamed from Source/WebKit/Shared/VisitedLinkTable.h.
2676         * UIProcess/API/C/WKContext.cpp:
2677         (WKContextAddVisitedLink):
2678         * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm:
2679         (-[_WKVisitedLinkStore addVisitedLinkWithURL:]):
2680         * UIProcess/VisitedLinkStore.cpp:
2681         (WebKit::VisitedLinkStore::VisitedLinkStore):
2682         (WebKit::VisitedLinkStore::addProcess):
2683         (WebKit::VisitedLinkStore::addVisitedLinkHash):
2684         (WebKit::VisitedLinkStore::removeAll):
2685         (WebKit::VisitedLinkStore::addVisitedLinkHashFromPage):
2686         (WebKit::VisitedLinkStore::sendStoreHandleToProcess):
2687         (WebKit::VisitedLinkStore::didInvalidateSharedMemory):
2688         (WebKit::VisitedLinkStore::didAddSharedStringHashes):
2689         * UIProcess/VisitedLinkStore.h:
2690         * UIProcess/WebProcessPool.cpp:
2691         * UIProcess/WebProcessPool.h:
2692         * UIProcess/WebProcessProxy.h:
2693         * WebKit.xcodeproj/project.pbxproj:
2694         * WebProcess/WebPage/VisitedLinkTableController.cpp:
2695         (WebKit::VisitedLinkTableController::isLinkVisited):
2696         (WebKit::VisitedLinkTableController::addVisitedLink):
2697         (WebKit::VisitedLinkTableController::visitedLinkStateChanged):
2698         * WebProcess/WebPage/VisitedLinkTableController.h:
2699         * WebProcess/WebPage/VisitedLinkTableController.messages.in:
2700
2701 2017-09-28  Alex Christensen  <achristensen@webkit.org>
2702
2703         Add WKWebViewConfiguration SPI equivalent to WKPageConfigurationSetBackgroundCPULimit
2704         https://bugs.webkit.org/show_bug.cgi?id=177644
2705         <rdar://problem/34338698>
2706
2707         Reviewed by Geoffrey Garen.
2708
2709         WKPageConfigurationSetBackgroundCPULimit is a setter of a std::optional<double> with no accessor.
2710         It's never set to 0 in practice, so I guess the ObjC equivalent is a double that is zero or nonzero.
2711
2712         * UIProcess/API/Cocoa/WKWebView.mm:
2713         (-[WKWebView _initializeWithConfiguration:]):
2714         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2715         (-[WKWebViewConfiguration _setCPULimit:]):
2716         (-[WKWebViewConfiguration _cpuLimit]):
2717         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2718
2719 2017-09-28  Ryosuke Niwa  <rniwa@webkit.org>
2720
2721         Image pasting is not working on tineye.com / gmail.com / GitHub.com due to lack of support for DataTransfer.items
2722         https://bugs.webkit.org/show_bug.cgi?id=170449
2723         <rdar://problem/31432525>
2724
2725         Reviewed by Wenson Hsieh.
2726
2727         Add sandbox extensions for files in the pasteboard to make copying & pasting image files work.
2728         This is what we do for drag & drop but we should consider adding a mechanism to rekoke the extension in the future.
2729
2730         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2731         (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType): Add sandbox extensions to the pasted files.
2732         * UIProcess/WebPasteboardProxy.h:
2733         * UIProcess/WebPasteboardProxy.messages.in:
2734         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2735         (WebKit::WebPlatformStrategies::getPathnamesForType): Consume the sandbox tokens sent by the UI process permanently
2736         since WebCore will now create File objects for these pasted files.
2737
2738 2017-09-29  Wenson Hsieh  <wenson_hsieh@apple.com>
2739
2740         [iOS WK2] Implement -[WKContentView hasText] for compatibility with the UITextInput protocol
2741         https://bugs.webkit.org/show_bug.cgi?id=177662
2742         <rdar://problem/33410373>
2743
2744         Reviewed by Tim Horton.
2745
2746         Implements -[WKContentView hasText] by propagating a flag through post-layout editor state.
2747
2748         * Shared/EditorState.cpp:
2749         (WebKit::EditorState::PostLayoutData::encode const):
2750         (WebKit::EditorState::PostLayoutData::decode):
2751         * Shared/EditorState.h:
2752
2753         Add a new flag to EditorState indicating whether or not the current editable root containing the selection has
2754         any plain text. Add IPC support for this new flag.
2755
2756         * UIProcess/ios/WKContentViewInteraction.mm:
2757         (-[WKContentView hasText]):
2758         * WebProcess/WebPage/ios/WebPageIOS.mm:
2759         (WebKit::computeEditableRootHasContentAndPlainText):
2760
2761         Add a new helper to compute whether or not the editable root has any content, and any plain text. This
2762         is used as the last cached value for -hasText on WKContentView that we will deliver to UIKit. Some important
2763         things to note here:
2764         - If post layout data already indicates that we have selected some plain text, or that there is a plain text
2765           character near the selection, just set the flags to true and bail, since the editable root necessarily has
2766           content that is plain text.
2767         - If hasContent is false, don't even bother computing hasPlainText, because it must also be false.
2768         - Otherwise, use hasAnyPlainText to compute the value of hasPlainText, which is a faster variant of plainText.
2769         These optimizations help us avoid doing extra work at all when running Speedometer, apart from checking the
2770         values of a few PostLayoutData flags. This also fixes the value of hasContent, which was previously always false
2771         if we had a range selection rather than a caret selection even when the editable root has content, because the
2772         logic to compute the value of hasContent only existed in the branch where we have a caret selection.
2773
2774         (WebKit::WebPage::platformEditorState const):
2775
2776 2017-09-28  Timothy Horton  <timothy_horton@apple.com>
2777
2778         Fix the macOS CMake build
2779
2780         * CMakeLists.txt:
2781
2782 2017-09-28  Timothy Horton  <timothy_horton@apple.com>
2783
2784         Revise deployment target macros from r222620
2785
2786         Rubber-stamped by Wenson Hsieh.
2787
2788         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
2789         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2790         (WebKit::PDFPlugin::pdfDocumentDidLoad):
2791
2792 2017-09-28  Aishwarya Nirmal  <anirmal@apple.com>
2793
2794         Request for PDF URL targets for specific pages, sections, etc.
2795         https://bugs.webkit.org/show_bug.cgi?id=177582
2796         <rdar://problem/5692679>
2797
2798         Reviewed by Tim Horton.
2799         
2800         This change sets the URL fragment for scroll anchoring in PDFs.
2801
2802         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
2803         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2804         (WebKit::PDFPlugin::pdfDocumentDidLoad):
2805
2806 2017-09-28  Ross Kirsling  <ross.kirsling@sony.com>
2807
2808         [PAL] Move HysteresisActivity into PAL
2809         https://bugs.webkit.org/show_bug.cgi?id=177516
2810
2811         Reviewed by Alex Christensen.
2812
2813         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2814         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::PendingFrameLoad):
2815         * Shared/WebSQLiteDatabaseTracker.cpp:
2816         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
2817         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
2818         * Shared/WebSQLiteDatabaseTracker.h:
2819         * WebProcess/WebPage/WebPage.cpp:
2820         (WebKit::m_pageScrolledHysteresis):
2821         (WebKit::m_userActivityHysteresis):
2822         (WebKit::WebPage::updateUserActivity):
2823         * WebProcess/WebPage/WebPage.h:
2824         * WebProcess/WebProcess.cpp:
2825         (WebKit::WebProcess::WebProcess):
2826         * WebProcess/WebProcess.h:
2827
2828 2017-09-28  Chris Dumez  <cdumez@apple.com>
2829
2830         Add support for <link rel=preconnect>
2831         https://bugs.webkit.org/show_bug.cgi?id=177474
2832         <rdar://problem/33141380>
2833
2834         Reviewed by Alex Christensen.
2835
2836         Add support for <link rel=preconnect>:
2837         - https://w3c.github.io/resource-hints/#preconnect
2838
2839         Also add corresponding native private API.
2840
2841         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2842         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
2843         (WebKit::NetworkConnectionToWebProcess::didFinishPreconnection):
2844         * NetworkProcess/NetworkConnectionToWebProcess.h:
2845         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2846         * NetworkProcess/NetworkDataTask.cpp:
2847         (WebKit::NetworkDataTask::create):
2848         * NetworkProcess/NetworkLoadParameters.h:
2849         * NetworkProcess/NetworkProcess.cpp:
2850         (WebKit::NetworkProcess::preconnectTo):
2851         * NetworkProcess/NetworkProcess.h:
2852         * NetworkProcess/NetworkProcess.messages.in:
2853         * NetworkProcess/PreconnectTask.cpp: Added.
2854         (WebKit::PreconnectTask::PreconnectTask):
2855         (WebKit::PreconnectTask::~PreconnectTask):
2856         (WebKit::PreconnectTask::willPerformHTTPRedirection):
2857         (WebKit::PreconnectTask::didReceiveChallenge):
2858         (WebKit::PreconnectTask::didReceiveResponseNetworkSession):
2859         (WebKit::PreconnectTask::didReceiveData):
2860         (WebKit::PreconnectTask::didCompleteWithError):
2861         (WebKit::PreconnectTask::didSendData):
2862         (WebKit::PreconnectTask::wasBlocked):
2863         (WebKit::PreconnectTask::cannotShowURL):
2864         (WebKit::PreconnectTask::didFinish):
2865         * NetworkProcess/PreconnectTask.h: Copied from Source/WebKit/NetworkProcess/NetworkLoadParameters.h.
2866         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
2867         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2868         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
2869         * Shared/WebCoreArgumentCoders.h:
2870         * Shared/WebPreferencesDefinitions.h:
2871         * UIProcess/API/C/WKContext.cpp:
2872         (WKContextPreconnectToServer):
2873         * UIProcess/API/C/WKContextPrivate.h:
2874         * UIProcess/API/Cocoa/WKProcessPool.mm:
2875         (-[WKProcessPool _preconnectToServer:]):
2876         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2877         * UIProcess/WebProcessPool.cpp:
2878         (WebKit::WebProcessPool::preconnectToServer):
2879         * UIProcess/WebProcessPool.h:
2880         * WebKit.xcodeproj/project.pbxproj:
2881         * WebProcess/Network/NetworkProcessConnection.cpp:
2882         (WebKit::NetworkProcessConnection::didFinishPreconnection):
2883         * WebProcess/Network/NetworkProcessConnection.h:
2884         * WebProcess/Network/NetworkProcessConnection.messages.in:
2885         * WebProcess/Network/WebLoaderStrategy.cpp:
2886         (WebKit::WebLoaderStrategy::networkProcessCrashed):
2887         (WebKit::generateLoadIdentifier):
2888         (WebKit::WebLoaderStrategy::startPingLoad):
2889         (WebKit::WebLoaderStrategy::preconnectTo):
2890         (WebKit::WebLoaderStrategy::didFinishPreconnection):
2891         * WebProcess/Network/WebLoaderStrategy.h:
2892         * WebProcess/WebPage/WebPage.cpp:
2893         (WebKit::WebPage::updatePreferences):
2894         * config.h:
2895
2896 2017-09-28  Zan Dobersek  <zdobersek@igalia.com>
2897
2898         [Cairo] Remove the cairo_glyph_t complexity from GlyphBuffer
2899         https://bugs.webkit.org/show_bug.cgi?id=177598
2900
2901         Reviewed by Carlos Garcia Campos.
2902
2903         * Shared/API/c/cairo/WKImageCairo.cpp: Explicitly include the <cairo.h>
2904         header here now that it's not included in GlyphBuffer.h.
2905         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp: Ditto.
2906
2907 2017-09-27  Alex Christensen  <achristensen@webkit.org>
2908
2909         Add WKContentRuleList notify action type
2910         https://bugs.webkit.org/show_bug.cgi?id=177013
2911         <rdar://problem/31073936>
2912
2913         Reviewed by Darin Adler.
2914
2915         * NetworkProcess/PingLoad.cpp:
2916         (WebKit::PingLoad::processContentExtensionRulesForLoad):
2917         * UIProcess/API/APINavigationClient.h:
2918         (API::NavigationClient::contentRuleListNotification):
2919         * UIProcess/API/C/WKPage.cpp:
2920         (WKPageSetPageNavigationClient):
2921         * UIProcess/API/C/WKPageNavigationClient.h:
2922         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2923         * UIProcess/Cocoa/NavigationState.h:
2924         * UIProcess/Cocoa/NavigationState.mm:
2925         (WebKit::NavigationState::setNavigationDelegate):
2926         (WebKit::NavigationState::NavigationClient::contentRuleListNotification):
2927         * UIProcess/WebPageProxy.cpp:
2928         (WebKit::WebPageProxy::contentRuleListNotification):
2929         * UIProcess/WebPageProxy.h:
2930         * UIProcess/WebPageProxy.messages.in:
2931         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2932         (WebKit::WebChromeClient::contentRuleListNotification):
2933         * WebProcess/WebCoreSupport/WebChromeClient.h:
2934
2935 2017-09-27  Wenson Hsieh  <wenson_hsieh@apple.com>
2936
2937         Drag event DataTransfer has unexpected types "dyn.ah62d4..."
2938         https://bugs.webkit.org/show_bug.cgi?id=172526
2939         <rdar://problem/32396081>
2940
2941         Reviewed by Ryosuke Niwa.
2942
2943         Add boilerplate plumbing and encoder/decoder support for new pasteboard codepaths. See WebCore ChangeLog for
2944         more details.
2945
2946         * Scripts/webkit/messages.py:
2947         (headers_for_type):
2948         * Shared/WebCoreArgumentCoders.cpp:
2949         (IPC::ArgumentCoder<PasteboardCustomData>::encode):
2950         (IPC::ArgumentCoder<PasteboardCustomData>::decode):
2951
2952         Add encoder/decoder support for PasteboardCustomData.
2953
2954         (IPC::ArgumentCoder<PasteboardWebContent>::encode):
2955         (IPC::ArgumentCoder<PasteboardWebContent>::decode):
2956
2957         Encode and decode dataInHTMLFormat.
2958
2959         * Shared/WebCoreArgumentCoders.h:
2960         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2961         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
2962         (WebKit::WebPasteboardProxy::writeCustomData):
2963         * UIProcess/WebPasteboardProxy.cpp:
2964         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
2965         (WebKit::WebPasteboardProxy::writeCustomData):
2966         * UIProcess/WebPasteboardProxy.h:
2967         * UIProcess/WebPasteboardProxy.messages.in:
2968         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2969         (WebKit::WebPlatformStrategies::typesSafeForDOMToReadAndWrite):
2970         (WebKit::WebPlatformStrategies::writeCustomData):
2971         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2972
2973 2017-09-27  Alex Christensen  <achristensen@webkit.org>
2974
2975         Allow modern decoding of std::optional<T>
2976         https://bugs.webkit.org/show_bug.cgi?id=177519
2977
2978         Reviewed by Tim Horton.
2979
2980         * Platform/IPC/ArgumentCoders.h:
2981         (IPC::ArgumentCoder<std::optional<T>>::decode):
2982         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2983         (IPC::ArgumentCoder<WebCore::PaymentAuthorizationResult>::decode):
2984         (IPC::ArgumentCoder<WebCore::PaymentError>::decode):
2985         (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):
2986         (IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::decode):
2987         (IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::decode):
2988         * Shared/WebCoreArgumentCoders.cpp:
2989         (IPC::ArgumentCoder<IntPoint>::decode):
2990         (IPC::ArgumentCoder<IntSize>::decode):
2991         * Shared/WebCoreArgumentCoders.h:
2992         * Shared/WebPageCreationParameters.cpp:
2993         (WebKit::WebPageCreationParameters::decode):
2994
2995 2017-09-27  Commit Queue  <commit-queue@webkit.org>
2996
2997         Unreviewed, rolling out r222541.
2998         https://bugs.webkit.org/show_bug.cgi?id=177580
2999
3000         WebCore isn't ready for the asynchronousness this was going to
3001         enable (Requested by alexchristensen on #webkit).
3002
3003         Reverted changeset:
3004
3005         "Pass a completion handler instead of a
3006         WebFramePolicyListenerProxy during policy decisions"
3007         https://bugs.webkit.org/show_bug.cgi?id=177509
3008         http://trac.webkit.org/changeset/222541
3009
3010 2017-09-27  Tina Liu  <iting_liu@apple.com>
3011
3012         Expose setShouldSuppressFirstResponderChanges() as WKView SPI
3013         https://bugs.webkit.org/show_bug.cgi?id=177513
3014         <rdar://problem/34669220>
3015
3016         Reviewed by Wenson Hsieh.
3017
3018         We already have setShouldSuppressFirstResponderChanges() SPI on WKWebView; Expose it on
3019         WKView as well for clients using legacy WebKit.
3020
3021         * UIProcess/API/Cocoa/WKViewPrivate.h:
3022         * UIProcess/API/mac/WKView.mm:
3023         (-[WKView _setShouldSuppressFirstResponderChanges:]):
3024
3025 2017-09-27  Chris Dumez  <cdumez@apple.com>
3026
3027         Have PingLoad take a CompletionHandler
3028         https://bugs.webkit.org/show_bug.cgi?id=177549
3029
3030         Reviewed by Youenn Fablet.
3031
3032         Have PingLoad take a CompletionHandler instead of relying on it calling on method on the
3033         NetworkConnectionToWebProcess when it is done.
3034
3035         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3036         (WebKit::NetworkConnectionToWebProcess::loadPing):
3037         * NetworkProcess/PingLoad.cpp:
3038         (WebKit::PingLoad::PingLoad):
3039         (WebKit::PingLoad::didFinish):
3040         * NetworkProcess/PingLoad.h:
3041
3042 2017-09-26  Alex Christensen  <achristensen@webkit.org>
3043
3044         Pass a completion handler instead of a WebFramePolicyListenerProxy during policy decisions
3045         https://bugs.webkit.org/show_bug.cgi?id=177509
3046
3047         Reviewed by Tim Horton.
3048
3049         This makes WebFramePolicyListenerProxy just a wrapper around a WTF::Function which is only needed for the C and glib APIs.
3050         This is a step towards making WebPageProxy::DecidePolicyForResponseSync and WebPageProxy::DecidePolicyForNavigationAction asynchronous.
3051
3052         This patch has no change in behavior.
3053
3054         * CMakeLists.txt:
3055         * UIProcess/API/APINavigationClient.h:
3056         (API::NavigationClient::decidePolicyForNavigationAction):
3057         (API::NavigationClient::decidePolicyForNavigationResponse):
3058         * UIProcess/API/APIPolicyClient.h:
3059         (API::PolicyClient::decidePolicyForNavigationAction):
3060         (API::PolicyClient::decidePolicyForNewWindowAction):
3061         (API::PolicyClient::decidePolicyForResponse):
3062         * UIProcess/API/C/WKFramePolicyListener.cpp:
3063         (WKFramePolicyListenerUseWithPolicies):
3064         * UIProcess/API/C/WKPage.cpp:
3065         (WKPageSetPagePolicyClient):
3066         (WKPageSetPageNavigationClient):
3067         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
3068         * UIProcess/API/glib/WebKitPolicyClient.cpp:
3069         * UIProcess/Automation/WebAutomationSession.cpp:
3070         * UIProcess/Cocoa/NavigationState.h:
3071         * UIProcess/Cocoa/NavigationState.mm:
3072         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
3073         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
3074         * UIProcess/Cocoa/WebViewImpl.mm:
3075         * UIProcess/RemoteWebInspectorProxy.cpp:
3076         * UIProcess/WebFormSubmissionListenerProxy.h:
3077         * UIProcess/WebFrameListenerProxy.cpp: Removed.
3078         * UIProcess/WebFrameListenerProxy.h: Removed.
3079         * UIProcess/WebFramePolicyListenerProxy.cpp:
3080         (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
3081         (WebKit::WebFramePolicyListenerProxy::~WebFramePolicyListenerProxy):
3082         (WebKit::WebFramePolicyListenerProxy::create):
3083         (WebKit::WebFramePolicyListenerProxy::use):
3084         (WebKit::WebFramePolicyListenerProxy::download):
3085         (WebKit::WebFramePolicyListenerProxy::ignore):
3086         * UIProcess/WebFramePolicyListenerProxy.h:
3087         (WebKit::WebFramePolicyListenerProxy::create): Deleted.
3088         (): Deleted.
3089         (WebKit::WebFramePolicyListenerProxy::operator new): Deleted.
3090         * UIProcess/WebFrameProxy.cpp:
3091         (WebKit::WebFrameProxy::webProcessWillShutDown):
3092         (WebKit::WebFrameProxy::receivedPolicyDecision): Deleted.
3093         (WebKit::WebFrameProxy::setUpPolicyListenerProxy): Deleted.
3094         * UIProcess/WebFrameProxy.h:
3095         * UIProcess/WebInspectorProxy.cpp:
3096         * UIProcess/WebPageProxy.cpp:
3097         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3098         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
3099         (WebKit::WebPageProxy::decidePolicyForResponseSync):
3100         (WebKit::WebPageProxy::receivedPolicyDecision): Deleted.
3101         (WebKit::WebPageProxy::decidePolicyForResponse): Deleted.
3102         * UIProcess/WebPageProxy.h:
3103         * UIProcess/mac/ViewGestureControllerMac.mm:
3104         * WebKit.xcodeproj/project.pbxproj:
3105
3106 2017-09-26  Brian Burg  <bburg@apple.com>
3107
3108         Web Automation: overflow:hidden elements with no children are mistakenly reported as not visible
3109         https://bugs.webkit.org/show_bug.cgi?id=177514
3110         <rdar://problem/31936291>
3111
3112         Reviewed by Joseph Pecoraro.
3113
3114         * UIProcess/Automation/atoms/ElementDisplayed.js:
3115         (isShown.isElementSubtreeHiddenByOverflow):
3116         Array.prototype.every returns true when passed an empty list, so we need
3117         to check for the case where the element has no children and return 'false'.
3118
3119 2017-09-26  Youenn Fablet  <youenn@apple.com>
3120
3121         [Cocoa] Add a modern WKPreferences switch to disable WebRTC
3122         https://bugs.webkit.org/show_bug.cgi?id=176638
3123         <rdar://problem/34335158>
3124
3125         Reviewed by Alex Christensen.
3126
3127         * UIProcess/API/Cocoa/WKPreferences.mm:
3128         (-[WKPreferences _peerConnectionEnabled]):
3129         (-[WKPreferences _setPeerConnectionEnabled:]):
3130         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3131
3132 2017-09-26  Brent Fulgham  <bfulgham@apple.com>
3133
3134         Harden our access to the vector of URL schemes.
3135         https://bugs.webkit.org/show_bug.cgi?id=177470
3136         <rdar://problem/33881522>
3137
3138         Reviewed by Chris Dumez.
3139
3140         Instead of asserting, use MESSAGE_CHECK so that we actually refuse to access an invalid iterator.
3141
3142         * UIProcess/WebPageProxy.cpp:
3143         (WebKit::WebPageProxy::startURLSchemeTask):
3144         (WebKit::WebPageProxy::stopURLSchemeTask):
3145
3146 2017-09-26  Jer Noble  <jer.noble@apple.com>
3147
3148         Thrown ObjC exception when right clicking on <img> containing mp4 link
3149         https://bugs.webkit.org/show_bug.cgi?id=177370
3150
3151         Reviewed by Darin Adler.
3152
3153         Creating a NSImage from mp4 data will fail and return nil; do a nil-check before attempting
3154         to put the results into a NSMutableArray.
3155
3156         * UIProcess/mac/WebContextMenuProxyMac.mm:
3157         (WebKit::WebContextMenuProxyMac::createShareMenuItem):
3158
3159 2017-09-26  Brian Burg  <bburg@apple.com>
3160
3161         Web Automation: add commands to get and set user permissions for pages in an automation session
3162         https://bugs.webkit.org/show_bug.cgi?id=177405
3163         <rdar://problem/34493846>
3164
3165         Reviewed by Joseph Pecoraro.
3166
3167         To test some Web APIs via WebDriver, it needs to be possible to simulate a user accepting or
3168         denying requests for elevated permissions, such as getUserMedia() or geolocation.
3169
3170         This patch adds a generic way for a test to configure the automation session's
3171         simulated user action that will happen every time a specific permission is requested.
3172         A test can set a "session permission", trigger the permission request via Web API,
3173         and then verify that the page behaves correctly when the user accepted or denied the request.
3174
3175         A proposal will follow shortly to expose this functionality via a new REST API endpoint.
3176
3177         * UIProcess/Automation/Automation.json: Add get/set commands.
3178
3179         * UIProcess/Automation/WebAutomationSession.cpp:
3180         (WebKit::WebAutomationSession::getSessionPermissions):
3181         (WebKit::WebAutomationSession::setSessionPermissions):
3182         For now, store the permission value in a member of the session. The getUserMedia
3183         permission only needs a bool, but there is no reason we couldn't use more complicated
3184         values for permissions (i.e., strings, numbers, arrays, objects) someday.
3185
3186         (WebKit::WebAutomationSession::shouldAllowGetUserMediaForPage const):
3187         Expose the specific decision to be taken based on whether the request is allowed or denied.
3188
3189         * UIProcess/Automation/WebAutomationSession.h:
3190         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3191         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
3192         If the page is under automation, then simulate the user action according to the
3193         current values of permissions set for the session.
3194
3195 2017-09-25  Alex Christensen  <achristensen@webkit.org>
3196
3197         Make PolicyAction an encodable enum class
3198         https://bugs.webkit.org/show_bug.cgi?id=177480
3199
3200         Reviewed by Antti Koivisto.
3201
3202         * NetworkProcess/Downloads/DownloadManager.cpp:
3203         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
3204         (WebKit::DownloadManager::cancelDownload):
3205         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
3206         (WebKit::NetworkCORSPreflightChecker::didReceiveResponseNetworkSession):
3207         * NetworkProcess/NetworkDataTask.cpp:
3208         (WebKit::NetworkDataTask::didReceiveResponse):
3209         * NetworkProcess/NetworkDataTaskBlob.cpp:
3210         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
3211         * NetworkProcess/NetworkLoad.cpp:
3212         (WebKit::NetworkLoad::~NetworkLoad):
3213         (WebKit::NetworkLoad::continueDidReceiveResponse):
3214         (WebKit::NetworkLoad::notifyDidReceiveResponse):
3215         * NetworkProcess/PingLoad.cpp:
3216         (WebKit::PingLoad::didReceiveResponseNetworkSession):
3217         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
3218         (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):
3219         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3220         (toNSURLSessionResponseDisposition):
3221         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3222         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
3223         * Scripts/webkit/messages.py:
3224         (headers_for_type):
3225         * UIProcess/WebFormSubmissionListenerProxy.h:
3226         * UIProcess/WebFrameListenerProxy.h:
3227         (WebKit::WebFrameListenerProxy::navigation): Deleted.
3228         * UIProcess/WebFramePolicyListenerProxy.cpp:
3229         (WebKit::WebFramePolicyListenerProxy::use):
3230         (WebKit::WebFramePolicyListenerProxy::download):
3231         (WebKit::WebFramePolicyListenerProxy::ignore):
3232         * UIProcess/WebPageProxy.cpp:
3233         (WebKit::WebPageProxy::receivedPolicyDecision):
3234         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3235         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3236         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
3237         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
3238         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3239         * WebProcess/WebPage/WebFrame.cpp:
3240         (WebKit::WebFrame::invalidatePolicyListener):
3241         * WebProcess/WebPage/WebPage.cpp:
3242         (WebKit::WebPage::didReceivePolicyDecision):
3243         * WebProcess/WebPage/WebPage.h:
3244         * WebProcess/WebPage/WebPage.messages.in:
3245
3246 2017-09-25  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
3247
3248         [WinCairo] Share default value of font family preferences among non-cocoa builds
3249         https://bugs.webkit.org/show_bug.cgi?id=177479
3250
3251         Reviewed by Yusuke Suzuki.
3252
3253         * Shared/WebPreferencesDefinitions.h:
3254
3255 2017-09-25  Frederik Riedel  <riedel@apple.com>
3256
3257         Expose way to set values of classified form controls as {Legacy WebKit, WebKit} SPI
3258         https://bugs.webkit.org/show_bug.cgi?id=174394
3259         <rdar://problem/33183504>
3260
3261         Reviewed by Ryosuke Niwa.
3262
3263         * Platform/spi/ios/UIKitSPI.h:
3264         * Shared/AssistedNodeInformation.cpp:
3265         (WebKit::AssistedNodeInformation::encode const):
3266         Encodes additional node information, including if the node is part of a login screen.
3267         (WebKit::AssistedNodeInformation::decode):
3268         Decodes the additional assisted node information.
3269         * Shared/AssistedNodeInformation.h:
3270         * UIProcess/WebPageProxy.h:
3271         * UIProcess/ios/WKContentView.mm:
3272         (-[WKContentView acceptsAutofilledLoginCredentials]):
3273         Determines if the WKContentView shows a login screen.
3274         (-[WKContentView representingPageUrl]):
3275         Returns the URL of the currently displayed web page.
3276         * UIProcess/ios/WKContentViewInteraction.mm:
3277         (-[WKContentView insertTextSuggestion:]):
3278         Inserts the login credentials into the Web View.
3279         * UIProcess/ios/WebPageProxyIOS.mm:
3280         (WebKit::WebPageProxy::startAssistingNode):
3281         Transfer the additional assistednode information (acceptsAutofilledLoginCredentials and representingPageUrl).
3282         (WebKit::WebPageProxy::acceptsAutofilledLoginCredentials):
3283         Returns if the Web View shows a login screen.
3284         (WebKit::WebPageProxy::representingPageUrl):
3285         Returns the Web View's URL.
3286         (WebKit::WebPageProxy::autofillLoginCredentials):
3287         Insert the credentials into the Web View.
3288         * WebProcess/WebPage/WebPage.h:
3289         * WebProcess/WebPage/WebPage.messages.in:
3290         * WebProcess/WebPage/ios/WebPageIOS.mm:
3291         (WebKit::WebPage::getAssistedNodeInformation): Transports the information if the currently
3292         highlighted node accepts autofilled login credentials.
3293         (WebKit::WebPage::autofillLoginCredentials): Fills the login credentials into the
3294         WebPage.
3295
3296 2017-09-25  Youenn Fablet  <youenn@apple.com>
3297
3298         WebRTC video does not resume receiving when switching back to Safari 11 on iOS
3299         https://bugs.webkit.org/show_bug.cgi?id=175472
3300         <rdar://problem/33860863>
3301
3302         Reviewed by Darin Adler.
3303
3304         Notifying LibWebRTC of backgrounding/foregrouding.
3305
3306         * WebProcess/WebPage/ios/WebPageIOS.mm:
3307         (WebKit::WebPage::applicationDidEnterBackground):
3308         (WebKit::WebPage::applicationWillEnterForeground):
3309
3310 2017-09-25  Sam Weinig  <sam@webkit.org>
3311
3312         Remove unused EditorClient functions
3313         https://bugs.webkit.org/show_bug.cgi?id=177463
3314
3315         Reviewed by Alex Christensen.
3316
3317         Remove unused EditorClient functions.
3318
3319         * WebProcess/WebCoreSupport/WebEditorClient.h:
3320         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
3321         (WebKit::WebEditorClient::canonicalizeURL): Deleted.
3322         (WebKit::WebEditorClient::canonicalizeURLString): Deleted.
3323         (WebKit::WebEditorClient::writeDataToPasteboard): Deleted.
3324         (WebKit::WebEditorClient::supportedPasteboardTypesForCurrentSelection): Deleted.
3325         (WebKit::WebEditorClient::readDataFromPasteboard): Deleted.
3326         (WebKit::WebEditorClient::pasteboardChangeCount): Deleted.
3327         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
3328         (WebKit::WebEditorClient::canonicalizeURL): Deleted.
3329         (WebKit::WebEditorClient::canonicalizeURLString): Deleted.
3330
3331 2017-09-25  Alex Christensen  <achristensen@webkit.org>
3332
3333         Make Attribute an enum class
3334         https://bugs.webkit.org/show_bug.cgi?id=177414
3335
3336         Reviewed by Yusuke Suzuki.
3337
3338         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
3339         (WebKit::JSNPObject::getOwnPropertySlot):
3340
3341 2017-09-25  Alex Christensen  <achristensen@webkit.org>
3342
3343         Stop using PolicyCallback
3344         https://bugs.webkit.org/show_bug.cgi?id=176088
3345
3346         Reviewed by Andy Estes.
3347
3348         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3349         * WebProcess/WebPage/WebFrame.cpp:
3350         (WebKit::WebFrame::invalidatePolicyListener):
3351         * WebProcess/WebPage/WebFrame.h:
3352         * WebProcess/WebPage/WebInspector.cpp:
3353
3354 2017-09-25  Chris Dumez  <cdumez@apple.com>
3355
3356         [WK2] Add API to query if a download was user-initiated
3357         https://bugs.webkit.org/show_bug.cgi?id=177435
3358         <rdar://problem/34498422>
3359
3360         Reviewed by Alex Christensen.
3361
3362         Add C and Cocoa private API to query if a download was user-initiated.
3363
3364         For clarity, we now construct navigation object for subframe loads
3365         as well (we used to do so only for main frame loads). This allows us
3366         to store the user-intiated flag and the redirect chain on the navigation
3367         object instead of the WebFrameProxy.
3368
3369         * UIProcess/API/APINavigation.cpp:
3370         (API::Navigation::Navigation):
3371         (API::Navigation::appendRedirectionURL):
3372         * UIProcess/API/APINavigation.h:
3373         (API::Navigation::takeRedirectChain):
3374         (API::Navigation::setWasUserInitiated):
3375         (API::Navigation::wasUserInitiated const):
3376         * UIProcess/API/C/WKDownload.cpp:
3377         (WKDownloadGetWasUserInitiated):
3378         * UIProcess/API/C/WKDownload.h:
3379         * UIProcess/API/Cocoa/_WKDownload.h:
3380         * UIProcess/API/Cocoa/_WKDownload.mm:
3381         (-[_WKDownload wasUserInitiated]):
3382         * UIProcess/Downloads/DownloadProxy.h:
3383         (WebKit::DownloadProxy::setWasUserInitiated):
3384         (WebKit::DownloadProxy::wasUserInitiated const):
3385         * UIProcess/WebFrameProxy.cpp:
3386         (WebKit::WebFrameProxy::didStartProvisionalLoad):
3387         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad):
3388         (WebKit::WebFrameProxy::didFailProvisionalLoad):
3389         (WebKit::WebFrameProxy::didFinishLoad):
3390         (WebKit::WebFrameProxy::didFailLoad):
3391         * UIProcess/WebFrameProxy.h:
3392         (WebKit::WebFrameProxy::title const):
3393         * UIProcess/WebPageProxy.cpp:
3394         (WebKit::WebPageProxy::receivedPolicyDecision):
3395         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
3396         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
3397         (WebKit::WebPageProxy::decidePolicyForResponse):
3398         (WebKit::WebPageProxy::decidePolicyForResponseSync):
3399         * UIProcess/WebPageProxy.h:
3400         * UIProcess/WebPageProxy.messages.in:
3401         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3402         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
3403
3404 2017-09-25  Chris Dumez  <cdumez@apple.com>
3405
3406         Make StoredCredentials an enum class and rename its header
3407         https://bugs.webkit.org/show_bug.cgi?id=177455
3408
3409         Reviewed by Youenn Fablet.
3410
3411         Make StoredCredentials an enum class and rename its header for clarity. This was error-prone because 0 meant
3412         "allow" and and 1 meant "do not allow". It was trivial to convert it to a boolean by mistake and get the
3413         opposite behavior.
3414
3415         * NetworkProcess/Downloads/DownloadManager.cpp:
3416         (WebKit::DownloadManager::startDownload):
3417         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
3418         (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
3419         * NetworkProcess/NetworkCORSPreflightChecker.h:
3420         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3421         (WebKit::NetworkConnectionToWebProcess::loadPing):
3422         * NetworkProcess/NetworkDataTask.cpp:
3423         (WebKit::NetworkDataTask::create):
3424         (WebKit::NetworkDataTask::NetworkDataTask):
3425         * NetworkProcess/NetworkDataTask.h:
3426         * NetworkProcess/NetworkDataTaskBlob.cpp:
3427         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
3428         * NetworkProcess/NetworkLoad.cpp:
3429         (WebKit::NetworkLoad::shouldUseCredentialStorage):
3430         * NetworkProcess/NetworkLoadParameters.h:
3431         * NetworkProcess/NetworkResourceLoadParameters.cpp:
3432         (WebKit::NetworkResourceLoadParameters::encode const):
3433         (WebKit::NetworkResourceLoadParameters::decode):
3434         * NetworkProcess/PingLoad.cpp:
3435         (WebKit::PingLoad::willPerformHTTPRedirection):
3436         (WebKit::PingLoad::makeCrossOriginAccessRequest):
3437         (WebKit::PingLoad::makeSimpleCrossOriginAccessRequest):
3438         (WebKit::PingLoad::makeCrossOriginAccessRequestWithPreflight):
3439         (WebKit::PingLoad::preflightSuccess):
3440         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
3441         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
3442         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
3443         (WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay):
3444         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
3445         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3446         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
3447         (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
3448         (WebKit::NetworkDataTaskCocoa::tryPasswordBasedAuthentication):
3449         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
3450         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3451         (-[WKNetworkSessionDelegate existingTask:]):
3452         (WebKit::NetworkSessionCocoa::dataTaskForIdentifier):
3453         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3454         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
3455         (WebKit::NetworkDataTaskSoup::createRequest):
3456         (WebKit::NetworkDataTaskSoup::authenticate):
3457         (WebKit::NetworkDataTaskSoup::continueAuthenticate):
3458         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
3459         * NetworkProcess/soup/NetworkDataTaskSoup.h:
3460         * WebProcess/Network/WebLoaderStrategy.cpp:
3461         (WebKit::WebLoaderStrategy::scheduleLoad):
3462         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
3463         (WebKit::WebLoaderStrategy::startPingLoad):
3464         * WebProcess/Network/WebLoaderStrategy.h:
3465
3466 2017-09-25  Sam Weinig  <sam@webkit.org>
3467
3468         Remove unnecessary userVisibleString EditorClient function
3469         https://bugs.webkit.org/show_bug.cgi?id=177456
3470
3471         Reviewed by Dan Bernstein.
3472
3473         * WebProcess/WebCoreSupport/WebEditorClient.h:
3474         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
3475         (WebKit::WebEditorClient::userVisibleString): Deleted.
3476         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
3477         (WebKit::WebEditorClient::userVisibleString): Deleted.
3478
3479             Remove userVisibleString client function.
3480
3481 2017-09-25  Commit Queue  <commit-queue@webkit.org>
3482