bdfc0c1d1cb1ef0262875c5aabe0a85bf020c760
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2017-09-20  Chris Dumez  <cdumez@apple.com>
2
3         [WK2] Add API to get the redirect chain of a WKDownload
4         https://bugs.webkit.org/show_bug.cgi?id=176628
5         <rdar://problem/34338279>
6
7         Reviewed by Alex Christensen.
8
9         Add API to get the redirect chain of a WKDwnload. The redirect chain includes redirects
10         that happened during initial load, before the load was converted into a download.
11
12         * UIProcess/API/C/WKDownload.cpp:
13         (WKDownloadCopyRedirectChain):
14         * UIProcess/API/C/WKDownload.h:
15         * UIProcess/API/Cocoa/_WKDownload.h:
16         * UIProcess/API/Cocoa/_WKDownload.mm:
17         (-[_WKDownload originatingWebView]):
18         (-[_WKDownload redirectChain]):
19         * UIProcess/Downloads/DownloadProxy.cpp:
20         (WebKit::DownloadProxy::willSendRequest):
21         * UIProcess/Downloads/DownloadProxy.h:
22         (WebKit::DownloadProxy::setRedirectChain):
23         (WebKit::DownloadProxy::redirectChain const):
24         * UIProcess/WebFrameProxy.cpp:
25         (WebKit::WebFrameProxy::didStartProvisionalLoad):
26         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad):
27         * UIProcess/WebFrameProxy.h:
28         (WebKit::WebFrameProxy::redirectChain const):
29         * UIProcess/WebPageProxy.cpp:
30         (WebKit::WebPageProxy::receivedPolicyDecision):
31
32 2017-09-20  Alex Christensen  <achristensen@webkit.org>
33
34         Add infrastructure for adding custom headers to requests per website
35         https://bugs.webkit.org/show_bug.cgi?id=177255
36
37         Reviewed by Geoffrey Garen.
38
39         * Shared/WebsitePolicies.cpp: Added.
40         * Shared/WebsitePolicies.h:
41         (WebKit::WebsitePolicies::encode const):
42         (WebKit::WebsitePolicies::decode):
43         * UIProcess/API/APIWebsitePolicies.h:
44         * UIProcess/API/C/WKWebsitePolicies.cpp:
45         (WKWebsitePoliciesCopyCustomHeaderFields):
46         (WKWebsitePoliciesSetCustomHeaderFields):
47         * UIProcess/API/C/WKWebsitePolicies.h:
48         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
49         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
50         (-[_WKWebsitePolicies customHeaderFields]):
51         (-[_WKWebsitePolicies setCustomHeaderFields:]):
52         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
53         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
54
55 2017-09-20  Michael Catanzaro  <mcatanzaro@igalia.com>
56
57         REGRESSION(r222194) [WPE] Library and executable output names broken
58         https://bugs.webkit.org/show_bug.cgi?id=177273
59
60         Reviewed by Carlos Alberto Lopez Perez.
61
62         Move the WebKit2 output name variables to here from Source/cmake, since this is a better
63         place and where they are set on all other ports. Update them for the changes in r222194.
64
65         * PlatformWPE.cmake:
66
67 2017-09-20  Jonathan Bedard  <jbedard@apple.com>
68
69         Removed nullable from UIDragItem property
70         https://bugs.webkit.org/show_bug.cgi?id=176264
71         <rdar://problem/31144674>
72
73         Unreviewed build fix
74
75         When a nullable annotation is used in a header file,
76         the Objective-C compiler forces annotations on the entire
77         file. Remove an unneeded annotation in UIKitSPI.h so that
78         we can build in iOS 11.
79
80         * Platform/spi/ios/UIKitSPI.h:
81
82 2017-09-20  Antti Koivisto  <antti@apple.com>
83
84         Remove DOM and styling support for CSS Regions
85         https://bugs.webkit.org/show_bug.cgi?id=177221
86
87         Reviewed by Andreas Kling.
88
89         * Configurations/FeatureDefines.xcconfig:
90
91 2017-09-19  Simon Fraser  <simon.fraser@apple.com>
92
93         Do more math in terms of FloatSizes and FloatPoints
94         https://bugs.webkit.org/show_bug.cgi?id=177217
95
96         Reviewed by Zalan Bujtas.
97
98         Add operator/(const FloatSize&, const FloatSize&), GraphicsContext::translate(const FloatPoint&),
99         FloatRect.scale(FloatSize) and AffineTransform::translate(const FloatSize&)
100         and use them in lots of places to do math in terms of points and sizes.
101
102         * UIProcess/API/Cocoa/WKWebView.mm:
103         (-[WKWebView _didCommitLayerTree:]):
104         * UIProcess/ios/DragDropInteractionState.mm:
105         (WebKit::createTargetedDragPreview):
106         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
107         (WebKit::imageForRect):
108         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
109         (WebKit::InjectedBundleRangeHandle::renderedImage):
110         * WebProcess/WebPage/WebPage.cpp:
111         (WebKit::paintSnapshotAtSize):
112         (WebKit::WebPage::snapshotNode):
113
114 2017-09-19  Simon Fraser  <simon.fraser@apple.com>
115
116         tiled-drawing/tiled-backing-in-window.html fails on Retina displays
117         https://bugs.webkit.org/show_bug.cgi?id=177113
118
119         Reviewed by Tim Horton.
120
121         Make m_customDeviceScaleFactor a std::optional<> instead of having the weird "0 is unset"
122         behavior.
123
124         * UIProcess/WebPageProxy.cpp:
125         (WebKit::WebPageProxy::deviceScaleFactor const):
126         (WebKit::WebPageProxy::setCustomDeviceScaleFactor):
127         * UIProcess/WebPageProxy.h:
128
129 2017-09-19  Alex Christensen  <achristensen@webkit.org>
130
131         Allow modern decoding of Vectors
132         https://bugs.webkit.org/show_bug.cgi?id=177102
133
134         Reviewed by Andy Estes.
135
136         Rather than allow modern decoding of Vectors of types that only allow legacy decoding,
137         I just made modern decoders for all types that we need to decode in Vectors.
138
139         * NetworkProcess/NetworkResourceLoadParameters.cpp:
140         (WebKit::NetworkResourceLoadParameters::decode):
141         * Platform/IPC/ArgumentCoders.cpp:
142         (IPC::ArgumentCoder<std::chrono::system_clock::time_point>::decode):
143         * Platform/IPC/ArgumentCoders.h:
144         * Shared/AssistedNodeInformation.cpp:
145         (WebKit::OptionItem::decode):
146         * Shared/AssistedNodeInformation.h:
147         * Shared/CallbackID.h:
148         (WebKit::CallbackID::decode):
149         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
150         (IPC::ArgumentCoder<WebCore::PaymentError>::decode):
151         (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):
152         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode):
153         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::decode):
154         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ShippingMethod>::decode):
155         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::TotalAndLineItems>::decode):
156         (IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::decode):
157         (IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::decode):
158         * Shared/Databases/IndexedDB/WebIDBResult.cpp:
159         (WebKit::WebIDBResult::decode):
160         * Shared/FrameInfoData.cpp:
161         (WebKit::FrameInfoData::decode):
162         * Shared/Gamepad/GamepadData.cpp:
163         (WebKit::GamepadData::decode):
164         * Shared/Gamepad/GamepadData.h:
165         * Shared/PlatformPopupMenuData.cpp:
166         (WebKit::PlatformPopupMenuData::decode):
167         * Shared/PlatformPopupMenuData.h:
168         * Shared/Plugins/NPIdentifierData.cpp:
169         (WebKit::NPIdentifierData::decode):
170         * Shared/Plugins/NPIdentifierData.h:
171         * Shared/Plugins/NPVariantData.cpp:
172         (WebKit::NPVariantData::decode):
173         * Shared/Plugins/NPVariantData.h:
174         * Shared/RTCNetwork.cpp:
175         (WebKit::RTCNetwork::IPAddress::decode):
176         (WebKit::RTCNetwork::SocketAddress::decode):
177         (WebKit::RTCNetwork::decode):
178         * Shared/RTCNetwork.h:
179         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
180         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
181         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
182         (WebKit::RemoteLayerTreeTransaction::decode):
183         * Shared/SessionState.cpp:
184         (WebKit::HTTPBody::Element::decode):
185         (WebKit::FrameState::decode):
186         (WebKit::PageState::decode):
187         (WebKit::BackForwardListItemState::decode):
188         (WebKit::BackForwardListState::decode):
189         * Shared/SessionState.h:
190         * Shared/WebCompiledContentRuleListData.cpp:
191         (WebKit::WebCompiledContentRuleListData::decode):
192         * Shared/WebCompiledContentRuleListData.h:
193         * Shared/WebContextMenuItemData.cpp:
194         (WebKit::WebContextMenuItemData::decode):
195         * Shared/WebContextMenuItemData.h:
196         * Shared/WebCoreArgumentCoders.cpp:
197         (IPC::ArgumentCoder<DOMCacheEngine::CacheInfo>::decode):
198         (IPC::ArgumentCoder<DOMCacheEngine::Record>::decode):
199         (IPC::ArgumentCoder<FloatRect>::decode):
200         (IPC::ArgumentCoder<FloatQuad>::decode):
201         (IPC::ArgumentCoder<IntRect>::decode):
202         (IPC::ArgumentCoder<RecentSearch>::decode):
203         (IPC::ArgumentCoder<Region::Span>::decode):
204         (IPC::ArgumentCoder<MimeClassInfo>::decode):
205         (IPC::ArgumentCoder<PluginInfo>::decode):
206         (IPC::ArgumentCoder<SelectionRect>::decode):
207         (IPC::ArgumentCoder<CompositionUnderline>::decode):
208         (IPC::ArgumentCoder<DictationAlternative>::decode):
209         (IPC::ArgumentCoder<GrammarDetail>::decode):
210         (IPC::ArgumentCoder<TextCheckingResult>::decode):
211         (IPC::ArgumentCoder<BlobPart>::decode):
212         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
213         (IPC::ArgumentCoder<MediaConstraints>::decode):
214         (IPC::ArgumentCoder<CaptureDevice>::decode):
215         (IPC::ArgumentCoder<ScrollOffsetRange<float>>::decode):
216         (IPC::ArgumentCoder<MediaSelectionOption>::decode):
217         * Shared/WebCoreArgumentCoders.h:
218         * Shared/WebEvent.h:
219         * Shared/WebPageCreationParameters.cpp:
220         (WebKit::WebPageCreationParameters::decode):
221         * Shared/WebPlatformTouchPoint.cpp:
222         (WebKit::WebPlatformTouchPoint::decode):
223         * Shared/WebPopupItem.cpp:
224         (WebKit::WebPopupItem::decode):
225         * Shared/WebPopupItem.h:
226         * Shared/WebUserContentControllerDataTypes.cpp:
227         (WebKit::WebUserScriptData::decode):
228         (WebKit::WebUserStyleSheetData::decode):
229         (WebKit::WebScriptMessageHandlerData::decode):
230         * Shared/WebUserContentControllerDataTypes.h:
231         * Shared/WebsiteData/WebsiteData.cpp:
232         (WebKit::WebsiteData::Entry::decode):
233         * Shared/WebsiteData/WebsiteData.h:
234         * Shared/WebsiteDataStoreParameters.cpp:
235         (WebKit::WebsiteDataStoreParameters::decode):
236         * Shared/ios/WebPlatformTouchPointIOS.cpp:
237         (WebKit::WebPlatformTouchPoint::decode):
238         * Shared/mac/WebCoreArgumentCodersMac.mm:
239         (IPC::ArgumentCoder<KeypressCommand>::decode):
240         * UIProcess/LegacySessionStateCodingNone.cpp:
241         (WebKit::decodeLegacySessionState):
242         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h:
243         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
244         (WebKit::PlatformCAAnimationRemote::KeyframeValue::decode):
245         (WebKit::PlatformCAAnimationRemote::Properties::decode):
246
247 2017-09-19  Ryosuke Niwa  <rniwa@webkit.org>
248
249         On iOS, getData can't get text set by setData during copy event
250         https://bugs.webkit.org/show_bug.cgi?id=176980
251         <rdar://problem/34453915>
252
253         Reviewed by Darin Adler.
254
255         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
256         (WebKit::WebPlatformStrategies::copy): Deleted.
257         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
258
259 2017-09-19  Alex Christensen  <achristensen@webkit.org>
260
261         Expose WKPageRef as a private property on WKWebView on Mac
262         https://bugs.webkit.org/show_bug.cgi?id=177022
263         <rdar://problem/34342762>
264
265         Reviewed by Andy Estes.
266
267         * UIProcess/API/Cocoa/WKWebView.mm:
268         (-[WKWebView _pageRefForTransitionToWKWebView]):
269         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
270
271 2017-09-19  Alex Christensen  <achristensen@webkit.org>
272
273         Make _WKProcessPoolConfiguration.allowsCellularAccess actually work on iOS
274         https://bugs.webkit.org/show_bug.cgi?id=177124
275
276         Reviewed by Andy Estes.
277
278         The boolean added in r213747 was getting lost in two places:
279         1. The API::ProcessPoolConfiguration gets copied before it's used, so we need to set the bool on the copy.
280         2. The bool was not getting copied from that ProcessPoolConfiguration to the NetworkProcessCreationParameters
281         to be sent to the NetworkProcess to be given to the NSURLSessionConfiguration in NetworkSessionCocoa.mm.
282
283         These two problems were fixed and verified manually with a customized iOS app on my phone.
284         Unfortunately, this cannot be tested well with our current test infrastructure.
285
286         * UIProcess/API/APIProcessPoolConfiguration.cpp:
287         (API::ProcessPoolConfiguration::copy):
288         * UIProcess/WebProcessPool.cpp:
289         (WebKit::WebProcessPool::ensureNetworkProcess):
290
291 2017-09-18  Michael Catanzaro  <mcatanzaro@igalia.com>
292
293         [CMake] Rename WebKit target to WebKitLegacy and rename WebKit2 target to WebKit
294         https://bugs.webkit.org/show_bug.cgi?id=174558
295
296         Reviewed by Alex Christensen.
297
298         * CMakeLists.txt:
299         * PlatformGTK.cmake:
300         * PlatformMac.cmake:
301         * PlatformWPE.cmake:
302         * PlatformWin.cmake:
303         * Shared/gtk/WebKitWaylandProtocol.xml: Renamed from Source/WebKit/Shared/gtk/WebKit2WaylandProtocol.xml.
304         * UIProcess/gtk/WaylandCompositor.cpp:
305         * WebProcess/gtk/WaylandCompositorDisplay.cpp:
306
307 2017-09-18  Andy Estes  <aestes@apple.com>
308
309         [Cocoa] Upstream sandbox-related WebKitSystemInterface functions
310         https://bugs.webkit.org/show_bug.cgi?id=177047
311
312         Reviewed by Daniel Bates.
313
314         * NetworkProcess/NetworkResourceLoadParameters.cpp:
315         (WebKit::NetworkResourceLoadParameters::encode const):
316         * Platform/spi/mac/QuarantineSPI.h: Added.
317         * Shared/SandboxExtension.h:
318         (): Deleted.
319         * Shared/mac/ChildProcessMac.mm:
320         (WebKit::enableSandboxStyleFileQuarantine):
321         (WebKit::ChildProcess::initializeSandbox):
322         * Shared/mac/SandboxExtensionMac.mm:
323         (WebKit::SandboxExtensionImpl::create):
324         (WebKit::SandboxExtensionImpl::SandboxExtensionImpl):
325         (WebKit::SandboxExtensionImpl::~SandboxExtensionImpl):
326         (WebKit::SandboxExtensionImpl::consume):
327         (WebKit::SandboxExtensionImpl::invalidate):
328         (WebKit::SandboxExtensionImpl::getSerializedFormat):
329         (WebKit::SandboxExtension::Handle::Handle):
330         (WebKit::SandboxExtension::Handle::~Handle):
331         (WebKit::SandboxExtension::Handle::encode const):
332         (WebKit::SandboxExtension::Handle::decode):
333         (WebKit::SandboxExtension::createHandleWithoutResolvingPath):
334         (WebKit::SandboxExtension::createHandleForReadWriteDirectory):
335         (WebKit::SandboxExtension::createHandleForTemporaryFile):
336         (WebKit::SandboxExtension::createHandleForGenericExtension):
337         (WebKit::SandboxExtension::SandboxExtension):
338         (WebKit::SandboxExtension::~SandboxExtension):
339         (WebKit::SandboxExtension::revoke):
340         (WebKit::SandboxExtension::consume):
341         (WebKit::SandboxExtension::consumePermanently):
342         (WebKit::wkSandboxExtensionType): Deleted.
343         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
344         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
345         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
346         (WebKit::WebProcessPool::platformInitializeWebProcess):
347         * UIProcess/Downloads/DownloadProxy.cpp:
348         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
349         * UIProcess/Network/NetworkProcessProxy.cpp:
350         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs):
351         * UIProcess/Storage/StorageProcessProxy.cpp:
352         (WebKit::StorageProcessProxy::getSandboxExtensionsForBlobFiles):
353         * UIProcess/WebPageProxy.cpp:
354         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
355         (WebKit::WebPageProxy::loadFile):
356         (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
357         * UIProcess/WebProcessPool.cpp:
358         (WebKit::WebProcessPool::createNewWebProcess):
359         (WebKit::WebProcessPool::processDidFinishLaunching):
360         (WebKit::WebProcessPool::resumeDownload):
361         (WebKit::WebProcessPool::startMemorySampler):
362         * WebKit.xcodeproj/project.pbxproj:
363         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
364         (WebKit::BlobRegistryProxy::registerFileBlobURL):
365
366 2017-09-18  Andy Estes  <aestes@apple.com>
367
368         [Cocoa] Upstream WKSetCrashReportApplicationSpecificInformation() from WebKitSystemInterface
369         https://bugs.webkit.org/show_bug.cgi?id=177048
370
371         Reviewed by Alex Christensen.
372
373         * Platform/IPC/mac/ConnectionMac.mm:
374         (IPC::Connection::sendMessage):
375         (IPC::readFromMachPort):
376         * Platform/cocoa/CrashReporter.h: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
377         * Platform/cocoa/CrashReporter.mm: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
378         (WebKit::setCrashReportApplicationSpecificInformation):
379         * Platform/spi/Cocoa/CrashReporterClientSPI.h: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
380         * Shared/Cocoa/ChildProcessCocoa.mm:
381         (WebKit::ChildProcess::didReceiveInvalidMessage):
382         * WebKit.xcodeproj/project.pbxproj:
383         * WebProcess/cocoa/WebProcessCocoa.mm:
384         (WebKit::_WKSetCrashReportApplicationSpecificInformation):
385
386 2017-09-18  Andy Estes  <aestes@apple.com>
387
388         [Mac] Upstream miscellaneous WebKitSystemInterface functions
389         https://bugs.webkit.org/show_bug.cgi?id=177029
390
391         Reviewed by Alex Christensen.
392
393         * NetworkProcess/mac/NetworkProcessMac.mm:
394         (WebKit::NetworkProcess::initializeProcessName):
395         * PluginProcess/mac/PluginProcessMac.mm:
396         (WebKit::PluginProcess::initializeProcessName):
397         * StorageProcess/mac/StorageProcessMac.mm:
398         (WebKit::StorageProcess::initializeProcessName):
399         * UIProcess/Cocoa/WebViewImpl.mm:
400         (WebKit::trackingAreaOptions):
401         (WebKit::WebViewImpl::mightBeginScrollWhileInactive):
402         * UIProcess/mac/WebPopupMenuProxyMac.mm:
403         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
404         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
405         (WebKit::NetscapePlugin::popUpContextMenu):
406         * WebProcess/Plugins/PDF/PDFPlugin.mm:
407         (WebKit::PDFPlugin::handleContextMenuEvent):
408         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
409         (InitWebCoreSystemInterface):
410         * WebProcess/cocoa/WebProcessCocoa.mm:
411         (WebKit::WebProcess::initializeProcessName):
412         (WebKit::WebProcess::updateActivePages):
413
414 2017-09-17  Michael Catanzaro  <mcatanzaro@igalia.com>
415
416         [WPE][GTK] Merge ProcessLauncher[WPE,GTK]
417         https://bugs.webkit.org/show_bug.cgi?id=177041
418
419         Unreviewed fixup, I broke the size of the argv buffer when experimenting with how to respond
420         to review comments. Not sure why this didn't blow up everything during testing.
421
422         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
423         (WebKit::ProcessLauncher::launchProcess):
424
425 2017-09-17  Michael Catanzaro  <mcatanzaro@igalia.com>
426
427         [WPE][GTK] Merge ProcessLauncher[WPE,GTK]
428         https://bugs.webkit.org/show_bug.cgi?id=177041
429
430         Reviewed by Carlos Garcia Campos.
431
432         * PlatformGTK.cmake:
433         * PlatformWPE.cmake:
434         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: Renamed from Source/WebKit/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp.
435         (WebKit::childSetupFunction):
436         (WebKit::ProcessLauncher::launchProcess):
437         (WebKit::ProcessLauncher::terminateProcess):
438         (WebKit::ProcessLauncher::platformInvalidate):
439         * UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp: Removed.
440
441 2017-09-16  Tim Horton  <timothy_horton@apple.com>
442
443         Fix the Tools build with CMake on macOS
444         https://bugs.webkit.org/show_bug.cgi?id=177030
445
446         Reviewed by Geoffrey Garen.
447
448         * PlatformMac.cmake:
449         Add some WebKitLegacy headers to forward (for use by the tools).
450
451 2017-09-15  JF Bastien  <jfbastien@apple.com>
452
453         WTF: use Forward.h when appropriate instead of Vector.h
454         https://bugs.webkit.org/show_bug.cgi?id=176984
455
456         Reviewed by Saam Barati.
457
458         There's no need to include Vector.h when Forward.h will suffice. All we need is to move the template default parameters from Vector, and then the forward declaration can be used in so many new places: if a header only takes Vector by reference, rvalue reference, pointer, returns any of these, or has them as members then the header doesn't need to see the definition because the declaration will suffice.
459
460         * Scripts/webkit/LegacyMessages-expected.h:
461         * Scripts/webkit/Messages-expected.h:
462         * Shared/API/APIData.h:
463         * UIProcess/API/APIContextMenuClient.h:
464         * UIProcess/API/APIFormClient.h:
465         * UIProcess/API/APIHTTPCookieStore.h:
466         * UIProcess/API/APINotificationProvider.h:
467         * UIProcess/API/glib/WebKitNotificationProvider.h:
468         * UIProcess/Notifications/WebNotificationProvider.h:
469         * UIProcess/TextCheckerCompletion.h:
470         * UIProcess/WebCookieManagerProxy.h:
471         * UIProcess/WebOpenPanelResultListenerProxy.h:
472         * UIProcess/WebPasteboardProxy.h:
473         * UIProcess/WebPopupMenuProxy.h:
474         * UIProcess/WebTextCheckerClient.h:
475         * WebProcess/Cookies/WebCookieManager.h:
476         * WebProcess/Gamepad/WebGamepadProvider.h:
477         * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
478         * WebProcess/InjectedBundle/API/APIInjectedBundlePageContextMenuClient.h:
479         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
480         * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
481         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
482         * WebProcess/Network/webrtc/WebRTCMonitor.h:
483         * WebProcess/Network/webrtc/WebRTCResolver.h:
484         * WebProcess/WebPage/DrawingArea.h:
485         * WebProcess/WebPage/WebOpenPanelResultListener.h:
486
487 2017-09-15  Tim Horton  <timothy_horton@apple.com>
488
489         Fix the macOS CMake build
490         https://bugs.webkit.org/show_bug.cgi?id=177015
491
492         Reviewed by Andy Estes.
493
494         * CMakeLists.txt:
495         Add the new RemoteLayerTree directories to the header search path.
496         Add CookieStorageUtilsCF.mm to Sources.
497
498         * PlatformMac.cmake:
499         Add a few more files, and fix the generated forwarding headers include
500         path to name "WebKit" instead of "WebKit2".
501
502 2017-09-15  Youenn Fablet  <youenn@apple.com>
503
504         Add an URL method to remove both query string and fragment identifier
505         https://bugs.webkit.org/show_bug.cgi?id=176911
506
507         Reviewed by Alex Christensen.
508
509         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
510         (WebKit::CacheStorage::computeKeyURL):
511
512 2017-09-15  Andy Estes  <aestes@apple.com>
513
514         [Cocoa] Upstream MediaRemote and VideoToolbox WebKitSystemInterface functions
515         https://bugs.webkit.org/show_bug.cgi?id=176953
516
517         Reviewed by Eric Carlson.
518
519         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
520         (InitWebCoreSystemInterface):
521
522 2017-09-15  Ryosuke Niwa  <rniwa@webkit.org>
523
524         iOS: WebKitTestRunner hits an assertion in editing/pasteboard/datatransfer-items-copy-plaintext.html
525         https://bugs.webkit.org/show_bug.cgi?id=176968
526
527         Reviewed by Wenson Hsieh.
528
529         Don't allocate a SharedMemory of size zero (content was empty) as this would result in a crash inside
530         a WebContent process in release builds and an assertion failure in debug builds.
531
532         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
533         (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
534
535 2017-09-14  Youenn Fablet  <youenn@apple.com>
536
537         Add Cache API support of records persistency
538         https://bugs.webkit.org/show_bug.cgi?id=176845
539
540         Reviewed by Alex Christensen.
541
542         Introducing asynchronous opening of Cache objects.
543         When opening, Cache objects will read the list of records from the disk.
544         They keep in memory the necessary information to make any match or remove request without reading further information from the disk.
545         Cache objects thus keep during the opening time a list of callbacks to call when being opened.
546         Persistent storage is implemented through NetworkCache::Storage.
547
548         A Cache object is added a unique name so that records from a Cache cannot be mixed with records from another Cache.
549         This unique name is stored persistenly in addition to the Cache name.
550         This unique name is used as the key type given to the storage.
551
552         Request, response and responsebody data are no longer kept by the Cache object.
553         For regular sessions, this information is kept on the disk through NetworkCache::Storage.
554         Insertion time is also stored persistently so as to keep the ordering of the records consistent.
555         For private browsing sessions, this information is kept in a map owned by the Caches object.
556         RecordData is renamed to RecordInformation as it now only contains the information used to handle the different Cache actions.
557
558         For every record retrieval action, a ReadRecordTaskCounter is used.
559         Its purpose is to allow retrieving the record data on the disk in parallel,
560         and then send back the information when everything is read.
561         In case some records cannot be correctly read, they are removed automatically at that point.
562         The current implementation loads all information in memory including response bodies.
563         Further improvements might consider streaming the response bodies progressively.
564
565         For every stored record, an AsynchronousPutTaskCounter is used.
566         Its purpose is also to wait for all put actions to be completed before executing the completion callback.
567         In some cases, a record needs to be overriden.
568         In that case, as per the specification, only the data related to the response is to be modified.
569         This requires reading the record request data on disk before actually writing the whole record again.
570         This is implemented in updateRecordToDisk.
571
572         The Cache object is delegating all record writing/reading tasks to its Caches object.
573         The Caches object is responsible to handle persistent/private sessions.
574
575         * NetworkProcess/cache/CacheStorageEngine.cpp:
576         (WebKit::CacheStorage::Engine::retrieveRecords): Making sure Cache object is opened.
577         (WebKit::CacheStorage::Engine::readCache): Ditto.
578         (WebKit::CacheStorage::Engine::unlock): Disposing the cache without going through initializing it.
579         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
580         (WebKit::CacheStorage::computeKeyURL):
581         (WebKit::CacheStorage::queryCache):
582         (WebKit::CacheStorage::updateVaryInformation):
583         (WebKit::CacheStorage::Cache::toRecordInformation):
584         (WebKit::CacheStorage::Cache::Cache):
585         (WebKit::CacheStorage::Cache::open):
586         (WebKit::CacheStorage::Cache::finishOpening):
587         (WebKit::CacheStorage::ReadRecordTaskCounter::create):
588         (WebKit::CacheStorage::ReadRecordTaskCounter::~ReadRecordTaskCounter):
589         (WebKit::CacheStorage::ReadRecordTaskCounter::appendRecord):
590         (WebKit::CacheStorage::ReadRecordTaskCounter::ReadRecordTaskCounter):
591         (WebKit::CacheStorage::Cache::retrieveRecord):
592         (WebKit::CacheStorage::Cache::retrieveRecords):
593         (WebKit::CacheStorage::Cache::addRecord):
594         (WebKit::CacheStorage::Cache::recordsFromURL):
595         (WebKit::CacheStorage::Cache::recordsFromURL const):
596         (WebKit::CacheStorage::AsynchronousPutTaskCounter::create):
597         (WebKit::CacheStorage::AsynchronousPutTaskCounter::~AsynchronousPutTaskCounter):
598         (WebKit::CacheStorage::AsynchronousPutTaskCounter::onCompletion):
599         (WebKit::CacheStorage::AsynchronousPutTaskCounter::setError):
600         (WebKit::CacheStorage::Cache::put):
601         (WebKit::CacheStorage::Cache::remove):
602         (WebKit::CacheStorage::Cache::removeFromRecordList):
603         (WebKit::CacheStorage::Cache::writeRecordToDisk):
604         (WebKit::CacheStorage::Cache::updateRecordToDisk):
605         (WebKit::CacheStorage::Cache::readRecordFromDisk):
606         (WebKit::CacheStorage::Cache::removeRecordFromDisk):
607         (WebKit::CacheStorage::Cache::encode):
608         (WebKit::CacheStorage::decodeRecordHeader):
609         (WebKit::CacheStorage::Cache::decode):
610         (WebKit::CacheStorage::Cache::keys const):
611         * NetworkProcess/cache/CacheStorageEngineCache.h:
612         (WebKit::CacheStorage::Cache::isOpened const):
613         (WebKit::CacheStorage::Cache::uniqueName const):
614         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
615         (WebKit::CacheStorage::Caches::initialize):
616         (WebKit::CacheStorage::Caches::open):
617         (WebKit::CacheStorage::Caches::remove):
618         (WebKit::CacheStorage::Caches::dispose):
619         (WebKit::CacheStorage::encodeCacheNames):
620         (WebKit::CacheStorage::decodeCachesNames):
621         (WebKit::CacheStorage::Caches::readCachesFromDisk):
622         (WebKit::CacheStorage::Caches::readRecordsList):
623         (WebKit::CacheStorage::Caches::writeRecord):
624         (WebKit::CacheStorage::Caches::readRecord):
625         (WebKit::CacheStorage::Caches::removeRecord):
626         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
627         (WebKit::CacheStorage::Caches::salt const):
628         * NetworkProcess/cache/CacheStorageEngineCaches.h:
629         (WebKit::CacheStorage::Caches::shouldPersist const):
630         * NetworkProcess/cache/NetworkCacheStorage.cpp:
631         (WebKit::NetworkCache::Storage::store):
632         * NetworkProcess/cache/NetworkCacheStorage.h:
633         (WebKit::NetworkCache::Storage::writeWithoutWaiting):
634
635 2017-09-14  Alex Christensen  <achristensen@webkit.org>
636
637         Add WKUIDelegatePrivate equivalent of WKPageUIClient's drawHeader, drawFooter, headerHeight, and footerHeight
638         https://bugs.webkit.org/show_bug.cgi?id=176889
639         <rdar://problem/29270035>
640
641         Reviewed by Andy Estes.
642
643         * UIProcess/API/C/WKPage.cpp:
644         (WKPageLoadAlternateHTMLString):
645         (WKPageLoadAlternateHTMLStringWithUserData):
646         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
647         (-[WKBrowsingContextController loadAlternateHTMLString:baseURL:forUnreachableURL:]):
648         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
649         * UIProcess/API/Cocoa/WKWebView.mm:
650         (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]):
651         * UIProcess/Cocoa/UIDelegate.h:
652         * UIProcess/Cocoa/UIDelegate.mm:
653         (WebKit::UIDelegate::setDelegate):
654         (WebKit::UIDelegate::UIClient::headerHeight):
655         (WebKit::UIDelegate::UIClient::footerHeight):
656         (WebKit::UIDelegate::UIClient::drawHeader):
657         (WebKit::UIDelegate::UIClient::drawFooter):
658         * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm:
659         (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]):
660         * UIProcess/Cocoa/WebViewImpl.mm:
661         (WebKit::WebViewImpl::printOperationWithPrintInfo):
662         * UIProcess/FrameLoadState.cpp:
663         (WebKit::FrameLoadState::didStartProvisionalLoad):
664         (WebKit::FrameLoadState::didReceiveServerRedirectForProvisionalLoad):
665         (WebKit::FrameLoadState::didFailProvisionalLoad):
666         (WebKit::FrameLoadState::didCommitLoad):
667         (WebKit::FrameLoadState::didSameDocumentNotification):
668         (WebKit::FrameLoadState::setUnreachableURL):
669         (WebKit::FrameLoadState::FrameLoadState): Deleted.
670         * UIProcess/FrameLoadState.h:
671         (WebKit::FrameLoadState::url const):
672         (WebKit::FrameLoadState::provisionalURL const):
673         (WebKit::FrameLoadState::unreachableURL const):
674         * UIProcess/WebFrameProxy.cpp:
675         (WebKit::WebFrameProxy::loadURL):
676         (WebKit::WebFrameProxy::didStartProvisionalLoad):
677         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad):
678         (WebKit::WebFrameProxy::didSameDocumentNavigation):
679         (WebKit::WebFrameProxy::setUnreachableURL):
680         * UIProcess/WebFrameProxy.h:
681         (WebKit::WebFrameProxy::url const):
682         (WebKit::WebFrameProxy::provisionalURL const):
683         (WebKit::WebFrameProxy::unreachableURL const):
684         * UIProcess/WebPageProxy.cpp:
685         (WebKit::WebPageProxy::loadAlternateHTMLString):
686         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
687         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
688         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
689         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
690         * UIProcess/WebPageProxy.h:
691         * UIProcess/WebPageProxy.messages.in:
692         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
693         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
694         (WebKit::WebFrameLoaderClient::dispatchDidChangeProvisionalURL):
695         (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
696         (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage):
697         (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage):
698         (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage):
699         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
700         * WebProcess/WebPage/WebPage.cpp:
701         (WebKit::WebPage::loadURLInFrame):
702         * WebProcess/WebPage/WebPage.h:
703         * WebProcess/WebPage/WebPage.messages.in:
704
705 2017-09-14  Andy Estes  <aestes@apple.com>
706
707         [Mac] Upstream SpeechSynthesis-related WebKitSystemInterface functions
708         https://bugs.webkit.org/show_bug.cgi?id=176931
709
710         Reviewed by Joseph Pecoraro.
711
712         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
713         (InitWebCoreSystemInterface):
714
715 2017-09-14  Ryan Haddad  <ryanhaddad@apple.com>
716
717         Unreviewed, rolling out r222033.
718
719         This change caused API test WebKit.PrintFrame to time out.
720
721         Reverted changeset:
722
723         "Add WKUIDelegatePrivate equivalent of WKPageUIClient's
724         drawHeader, drawFooter, headerHeight, and footerHeight"
725         https://bugs.webkit.org/show_bug.cgi?id=176889
726         http://trac.webkit.org/changeset/222033
727
728 2017-09-14  Alex Christensen  <achristensen@webkit.org>
729
730         Add WKUIDelegatePrivate equivalent of WKPageUIClient's drawHeader, drawFooter, headerHeight, and footerHeight
731         https://bugs.webkit.org/show_bug.cgi?id=176889
732         <rdar://problem/29270035>
733
734         Reviewed by Andy Estes.
735
736         * UIProcess/API/C/WKPage.cpp:
737         (WKPageLoadAlternateHTMLString):
738         (WKPageLoadAlternateHTMLStringWithUserData):
739         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
740         (-[WKBrowsingContextController loadAlternateHTMLString:baseURL:forUnreachableURL:]):
741         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
742         * UIProcess/API/Cocoa/WKWebView.mm:
743         (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]):
744         * UIProcess/Cocoa/UIDelegate.h:
745         * UIProcess/Cocoa/UIDelegate.mm:
746         (WebKit::UIDelegate::setDelegate):
747         (WebKit::UIDelegate::UIClient::headerHeight):
748         (WebKit::UIDelegate::UIClient::footerHeight):
749         (WebKit::UIDelegate::UIClient::drawHeader):
750         (WebKit::UIDelegate::UIClient::drawFooter):
751         * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm:
752         (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]):
753         * UIProcess/Cocoa/WebViewImpl.mm:
754         (WebKit::WebViewImpl::printOperationWithPrintInfo):
755         * UIProcess/FrameLoadState.cpp:
756         (WebKit::FrameLoadState::didStartProvisionalLoad):
757         (WebKit::FrameLoadState::didReceiveServerRedirectForProvisionalLoad):
758         (WebKit::FrameLoadState::didFailProvisionalLoad):
759         (WebKit::FrameLoadState::didCommitLoad):
760         (WebKit::FrameLoadState::didSameDocumentNotification):
761         (WebKit::FrameLoadState::setUnreachableURL):
762         (WebKit::FrameLoadState::FrameLoadState): Deleted.
763         * UIProcess/FrameLoadState.h:
764         (WebKit::FrameLoadState::url const):
765         (WebKit::FrameLoadState::provisionalURL const):
766         (WebKit::FrameLoadState::unreachableURL const):
767         * UIProcess/WebFrameProxy.cpp:
768         (WebKit::WebFrameProxy::loadURL):
769         (WebKit::WebFrameProxy::didStartProvisionalLoad):
770         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad):
771         (WebKit::WebFrameProxy::didSameDocumentNavigation):
772         (WebKit::WebFrameProxy::setUnreachableURL):
773         * UIProcess/WebFrameProxy.h:
774         (WebKit::WebFrameProxy::url const):
775         (WebKit::WebFrameProxy::provisionalURL const):
776         (WebKit::WebFrameProxy::unreachableURL const):
777         * UIProcess/WebPageProxy.cpp:
778         (WebKit::WebPageProxy::loadAlternateHTMLString):
779         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
780         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
781         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
782         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
783         * UIProcess/WebPageProxy.h:
784         * UIProcess/WebPageProxy.messages.in:
785         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
786         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
787         (WebKit::WebFrameLoaderClient::dispatchDidChangeProvisionalURL):
788         (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
789         (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage):
790         (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage):
791         (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage):
792         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
793         * WebProcess/WebPage/WebPage.cpp:
794         (WebKit::WebPage::loadURLInFrame):
795         * WebProcess/WebPage/WebPage.h:
796         * WebProcess/WebPage/WebPage.messages.in:
797
798 2017-09-14  Carlos Garcia Campos  <cgarcia@igalia.com>
799
800         [GTK][Wayland] Flickering when resizing the window
801         https://bugs.webkit.org/show_bug.cgi?id=176774
802
803         Reviewed by Michael Catanzaro.
804
805         This regressed when we switched to always start the wayland compositor. In
806         AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState() we check if the nested compositor is
807         running, which is always true now (if EGL and the required extensions are available). We should check if we are
808         in AC mode instead.
809
810         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
811         (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState):
812
813 2017-09-14  Yusuke Suzuki  <utatane.tea@gmail.com>
814
815         [JSC] Add PrivateSymbolMode::{Include,Exclude} for PropertyNameArray
816         https://bugs.webkit.org/show_bug.cgi?id=176867
817
818         Reviewed by Sam Weinig.
819
820         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
821         (WebKit::NPJSObject::enumerate):
822
823 2017-09-14  Maureen Daum  <mdaum@apple.com>
824
825         Introduce the option to mark an HTML element as having AutoFill available.
826         https://bugs.webkit.org/show_bug.cgi?id=176710
827
828         Reviewed by Alex Christensen.
829
830         Introduce the option to mark an HTML element as having AutoFill available. Accessibility
831         can use this property when deciding whether to announce that the focused field offers
832         AutoFill.
833
834         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
835         (WKBundleNodeHandleGetHTMLInputElementAutoFillAvailable):
836         (WKBundleNodeHandleSetHTMLInputElementAutoFillAvailable):
837         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
838         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
839         (WebKit::InjectedBundleNodeHandle::isAutoFillAvailable const):
840         (WebKit::InjectedBundleNodeHandle::setAutoFillAvailable):
841         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
842
843 2017-09-13  John Wilander  <wilander@apple.com>
844
845         Introduce Storage Access API (document parts) as an experimental feature
846         https://bugs.webkit.org/show_bug.cgi?id=175759
847         <rdar://problem/34414107>
848
849         Reviewed by Alex Christensen.
850
851         Storage Access API is an experimental feature which allows cross-origin,
852         sandboxed iframes to request access to their first-party storage (as
853         opposed to partitioned storage). This might be restricted to cookies or
854         might cover all stateful mechanisms.
855
856         It introduces the following three developer-facing things:
857         - A new readonly attribute, document.hasStorageAccess.
858         - A new function, document.requestStorageAccess().
859         - A new iframe sandbox token, allow-storage-access-by-user-activation.
860
861         * Shared/WebCoreArgumentCoders.cpp:
862         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
863         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
864             Storage handling of the new type of data.
865         * Shared/WebPreferencesDefinitions.h:
866         * UIProcess/API/C/WKPreferences.cpp:
867         (WKPreferencesSetStorageAccessAPIEnabled):
868         (WKPreferencesGetStorageAccessAPIEnabled):
869         * UIProcess/API/C/WKPreferencesRefPrivate.h:
870         * UIProcess/WebResourceLoadStatisticsStore.cpp:
871             Bumped the model version from 9 to 10.
872         * WebProcess/WebPage/WebPage.cpp:
873         (WebKit::WebPage::updatePreferences):
874
875 2017-09-13  Andy Estes  <aestes@apple.com>
876
877         [Apple Pay] Consider phoneticName when encoding ContactFields
878         https://bugs.webkit.org/show_bug.cgi?id=176885
879         <rdar://problem/34176419>
880
881         Reviewed by Tim Horton.
882
883         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
884         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ContactFields>::encode):
885         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ContactFields>::decode):
886
887 2017-09-13  Matt Lewis  <jlewis3@apple.com>
888
889         Unreviewed, rolling out r221976.
890
891         The test introduced was flaky from point of addition.
892
893         Reverted changeset:
894
895         "Introduce Storage Access API (document parts) as an
896         experimental feature"
897         https://bugs.webkit.org/show_bug.cgi?id=175759
898         http://trac.webkit.org/changeset/221976
899
900 2017-09-13  Youenn Fablet  <youenn@apple.com>
901
902         Internals clearCacheStorageMemoryRepresentation should return a Promise
903         https://bugs.webkit.org/show_bug.cgi?id=176818
904
905         Reviewed by Alex Christensen.
906
907         Adding a completion handler to clearMemoryRepresentation.
908
909         * NetworkProcess/cache/CacheStorageEngine.cpp:
910         (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
911         * NetworkProcess/cache/CacheStorageEngine.h:
912         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
913         (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
914         * NetworkProcess/cache/CacheStorageEngineConnection.h:
915         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
916         * WebProcess/Cache/WebCacheStorageConnection.cpp:
917         (WebKit::WebCacheStorageConnection::clearMemoryRepresentation):
918         (WebKit::WebCacheStorageConnection::clearMemoryRepresentationCompleted):
919         * WebProcess/Cache/WebCacheStorageConnection.h:
920         * WebProcess/Cache/WebCacheStorageConnection.messages.in:
921
922 2017-09-13  Andy Estes  <aestes@apple.com>
923
924         [CF] Upstream CFNetwork-related WebKitSystemInterface functions
925         https://bugs.webkit.org/show_bug.cgi?id=176729
926
927         Reviewed by Alex Christensen.
928
929         * Shared/mac/WebCoreArgumentCodersMac.mm:
930         (IPC::createSerializableRepresentation):
931         (IPC::dictionaryValueOfType):
932         (IPC::createArchiveList):
933         (IPC::createCFURLRequestFromSerializableRepresentation):
934         (IPC::createNSURLRequestFromSerializableRepresentation):
935         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
936         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
937         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
938         (WebKit::WebProcessPool::legacyPlatformDefaultCacheStorageDirectory):
939         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
940         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
941         (InitWebCoreSystemInterface):
942
943 2017-09-13  Alex Christensen  <achristensen@webkit.org>
944
945         Add WKUIDelegatePrivate equivalent of WKPageUIClient's setIsResizable, getWindowFrame, and setWindowFrame
946         https://bugs.webkit.org/show_bug.cgi?id=176857
947         <rdar://problem/29270035>
948
949         Reviewed by Tim Horton.
950
951         isResizable is unreachable code because nothing sends Messages::WebPageProxy::GetIsResizable, so I removed it.
952
953         * UIProcess/API/APIUIClient.h:
954         (API::UIClient::setStatusBarIsVisible):
955         (API::UIClient::isResizable): Deleted.
956         * UIProcess/API/C/WKPage.cpp:
957         (WKPageSetPageUIClient):
958         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
959         * UIProcess/API/glib/WebKitUIClient.cpp:
960         * UIProcess/Cocoa/UIDelegate.h:
961         * UIProcess/Cocoa/UIDelegate.mm:
962         (WebKit::UIDelegate::setDelegate):
963         (WebKit::UIDelegate::UIClient::setIsResizable):
964         (WebKit::UIDelegate::UIClient::setWindowFrame):
965         (WebKit::UIDelegate::UIClient::windowFrame):
966         * UIProcess/WebPageProxy.cpp:
967         (WebKit::WebPageProxy::getIsResizable): Deleted.
968         * UIProcess/WebPageProxy.h:
969         * UIProcess/WebPageProxy.messages.in:
970
971 2017-09-13  Youenn Fablet  <youenn@apple.com>
972
973         Add a lambda-based map for Vectors
974         https://bugs.webkit.org/show_bug.cgi?id=176487
975
976         Reviewed by Darin Adler.
977
978         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
979         (WebKit::CacheStorage::Caches::readCachesFromDisk):
980
981 2017-09-13  John Wilander  <wilander@apple.com>
982
983         Introduce Storage Access API (document parts) as an experimental feature
984         https://bugs.webkit.org/show_bug.cgi?id=175759
985         <rdar://problem/33666847>
986
987         Reviewed by Alex Christensen.
988
989         Storage Access API is an experimental feature which allows cross-origin,
990         sandboxed iframes to request access to their first-party storage (as
991         opposed to partitioned storage). This might be restricted to cookies or
992         might cover all stateful mechanisms.
993
994         It introduces the following three developer-facing things:
995         - A new readonly attribute, document.hasStorageAccess.
996         - A new function, document.requestStorageAccess().
997         - A new iframe sandbox token, allow-storage-access-by-user-activation.
998
999         * Shared/WebCoreArgumentCoders.cpp:
1000         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
1001         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
1002             Storage handling of the new type of data.
1003         * Shared/WebPreferencesDefinitions.h:
1004         * UIProcess/API/C/WKPreferences.cpp:
1005         (WKPreferencesSetStorageAccessAPIEnabled):
1006         (WKPreferencesGetStorageAccessAPIEnabled):
1007         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1008         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1009             Bumped the model version from 9 to 10.
1010         * WebProcess/WebPage/WebPage.cpp:
1011         (WebKit::WebPage::updatePreferences):
1012
1013 2017-09-13  Sergio Villar Senin  <svillar@igalia.com>
1014
1015         [WebVR] Add IDLs and stubs
1016         https://bugs.webkit.org/show_bug.cgi?id=174202
1017
1018         Reviewed by Dean Jackson.
1019
1020         * Shared/WebPreferencesDefinitions.h:
1021         * WebProcess/WebPage/WebPage.cpp:
1022         (WebKit::WebPage::updatePreferences):
1023
1024 2017-09-12  Ryosuke Niwa  <rniwa@webkit.org>
1025
1026         Dragging & dropping a file creates an attachment element even when it's disabled
1027         https://bugs.webkit.org/show_bug.cgi?id=176769
1028
1029         Reviewed by Tim Horton.
1030
1031         * UIProcess/API/C/WKPreferences.cpp:
1032         (WKPreferencesSetAttachmentElementEnabled):
1033         (WKPreferencesGetAttachmentElementEnabled):
1034         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1035         * WebProcess/WebPage/WebPage.cpp:
1036         (WebKit::WebPage::updatePreferences):
1037
1038 2017-09-12  Youenn Fablet  <youenn@apple.com>
1039
1040         Introduce a RecordData for Cache to efficiently check whether it matches a corresponding request or not
1041         https://bugs.webkit.org/show_bug.cgi?id=176579
1042
1043         Reviewed by Alex Christensen.
1044
1045         Introducing RecordData that splits its stored data in mandatory data,
1046         used to check a record with a request and optional data that is
1047         necessary to build a CacheStorageEngine::Record used by WebProcess.
1048
1049         The mandatory data contains the URL, Vary header information and identifiers.
1050         Adding routines to go from a Record to RecordData and vice versa.
1051         Storing in CacheStorage::Cache RecordData instead of Record.
1052
1053         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
1054         (WebKit::CacheStorage::queryCache):
1055         (WebKit::CacheStorage::updateVaryInformation):
1056         (WebKit::CacheStorage::toRecord):
1057         (WebKit::CacheStorage::toRecordData):
1058         (WebKit::CacheStorage::Cache::retrieveRecords const):
1059         (WebKit::CacheStorage::Cache::addRecord):
1060         (WebKit::CacheStorage::Cache::recordsFromURL):
1061         (WebKit::CacheStorage::Cache::recordsFromURL const):
1062         (WebKit::CacheStorage::Cache::put):
1063         (WebKit::CacheStorage::Cache::writeRecordToDisk):
1064         (WebKit::CacheStorage::Cache::removeRecordFromDisk):
1065         * NetworkProcess/cache/CacheStorageEngineCache.h:
1066
1067 2017-09-12  Dan Bernstein  <mitz@apple.com>
1068
1069         Tried to fix the iOS 10 build after r221930.
1070
1071         * UIProcess/API/Cocoa/WKWebView.mm:
1072         (-[WKWebView _initializeWithConfiguration:]):
1073         (-[WKWebView _setDragInteractionPolicy:]):
1074
1075 2017-09-12  Dan Bernstein  <mitz@apple.com>
1076
1077         Update availability annotations to match the macOS 10.13 and iOS 11.0 GM seed SDKs
1078         https://bugs.webkit.org/show_bug.cgi?id=176793
1079
1080         Reviewed by Tim Horton.
1081
1082         Changed WK_MAC_TBA and WK_IOS_TBA to 10.13 and 11.0, respectively, in all declarations that
1083         appear in the GM seed SDKs. Additional changes and exceptions are noted below.
1084
1085         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Added missing availability annotation to
1086           -_webView:dataOwnerForDropSession: and -_webView:dataOwnerForDragSession:.
1087
1088         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Removed rednundant
1089           __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 guards.
1090
1091         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: Added missing availability annotation to
1092           -_setResourceLoadStatisticsTestingCallback:.
1093
1094         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h: Added missing availability annotation.
1095
1096         * UIProcess/API/Cocoa/_WKLinkIconParameters.h: Added availability annotation that had been
1097           missing since macOS 10.12.3 and iOS 10.3. Corrected annotation for _WKLinkIconParameters.
1098
1099         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: Added missing TBA annotation to
1100           _resourceLoadStatisticsDirectory.
1101
1102         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h: Removed iOS
1103           availability from macOS-only declaration and vice versa.
1104
1105         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm:
1106         (-[WKWebProcessPlugInRangeHandle detectDataWithTypes:context:]): Removed an availability
1107           annotation from this method implementation.
1108
1109         * Shared/API/Cocoa/WKDragDestinationAction.h:
1110         * UIProcess/API/Cocoa/WKContentRuleList.h:
1111         * UIProcess/API/Cocoa/WKContentRuleListStore.h:
1112         * UIProcess/API/Cocoa/WKError.h:
1113         * UIProcess/API/Cocoa/WKFrameInfo.h:
1114         * UIProcess/API/Cocoa/WKHTTPCookieStore.h:
1115         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
1116         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1117         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1118         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1119         * UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
1120         * UIProcess/API/Cocoa/WKURLSchemeHandler.h:
1121         * UIProcess/API/Cocoa/WKURLSchemeTask.h:
1122         * UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h:
1123         * UIProcess/API/Cocoa/WKUserContentController.h:
1124         * UIProcess/API/Cocoa/WKWebView.h:
1125         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1126         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1127         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
1128         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
1129         * UIProcess/API/Cocoa/WKWindowFeaturesPrivate.h:
1130         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
1131         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
1132         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
1133         * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h:
1134         * UIProcess/API/Cocoa/_WKGeolocationPosition.h:
1135         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1136         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
1137         * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
1138         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1139         * UIProcess/_WKWebViewPrintFormatter.h:
1140         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
1141         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h:
1142         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
1143
1144 2017-09-12  Alex Christensen  <achristensen@webkit.org>
1145
1146         Add WKUIDelegatePrivate equivalent of WKPageUIClient's runModal
1147         https://bugs.webkit.org/show_bug.cgi?id=176728
1148         <rdar://problem/29270035>
1149         
1150         Covered by a new API test.
1151
1152         Reviewed by Tim Horton.
1153
1154         * UIProcess/API/APIUIClient.h:
1155         (API::UIClient::runModal):
1156         * UIProcess/API/C/WKPage.cpp:
1157         (WKPageSetPageUIClient):
1158         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1159         * UIProcess/Cocoa/UIDelegate.h:
1160         * UIProcess/Cocoa/UIDelegate.mm:
1161         (WebKit::UIDelegate::setDelegate):
1162         (WebKit::UIDelegate::UIClient::canRunModal const):
1163         (WebKit::UIDelegate::UIClient::runModal):
1164         * UIProcess/WebPageProxy.cpp:
1165         (WebKit::WebPageProxy::runModal):
1166
1167 2017-09-12  Alex Christensen  <achristensen@webkit.org>
1168
1169         Add WKUIDelegatePrivate equivalent of WKPageUIClient's decidePolicyForNotificationPermissionRequest
1170         https://bugs.webkit.org/show_bug.cgi?id=176768
1171         <rdar://problem/29270035>
1172
1173         Reviewed by Tim Horton.
1174
1175         Covered by a new API test.
1176
1177         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1178         * UIProcess/Cocoa/UIDelegate.h:
1179         * UIProcess/Cocoa/UIDelegate.mm:
1180         (WebKit::UIDelegate::setDelegate):
1181         (WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel):
1182         (WebKit::UIDelegate::UIClient::exceededDatabaseQuota):
1183         (WebKit::UIDelegate::UIClient::decidePolicyForNotificationPermissionRequest):
1184         (WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota):
1185
1186 2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1187
1188         [iOS DnD] Support DataTransfer.setDragImage when starting a drag on iOS
1189         https://bugs.webkit.org/show_bug.cgi?id=176721
1190         <rdar://problem/34373660>
1191
1192         Reviewed by Tim Horton.
1193
1194         Rename elementBounds => dragPreviewFrameInRootViewCoordinates.
1195
1196         * UIProcess/ios/DragDropInteractionState.h:
1197         * UIProcess/ios/DragDropInteractionState.mm:
1198         (WebKit::DragDropInteractionState::previewForDragItem const):
1199         (WebKit::DragDropInteractionState::stageDragItem):
1200
1201 2017-09-11  Tim Horton  <timothy_horton@apple.com>
1202
1203         REGRESSION (r221272): WKWebView gets stuck zoomed in if the web process crashes
1204         https://bugs.webkit.org/show_bug.cgi?id=176767
1205         <rdar://problem/34196874>
1206
1207         Reviewed by Dan Bernstein.
1208
1209         * UIProcess/API/Cocoa/WKWebView.mm:
1210         (-[WKWebView _processDidExit]):
1211         Reset the "last sent" layout parameters when the Web Content process exits.
1212         They're no longer "last sent", and if we short-circuit from sending them
1213         again (from under _didRelaunchProcess), we will never send the correct
1214         layout width (until it changes).
1215
1216 2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1217
1218         [iOS WK2] Support tapping to add items to the current drag session in web content
1219         https://bugs.webkit.org/show_bug.cgi?id=176421
1220         <rdar://problem/31144674>
1221
1222         Reviewed by Tim Horton.
1223
1224         To request additional drag items, end the current drag in the web page and try to begin a drag at the new
1225         location. This process is transparent to the UI process, which still maintains the same UIDragSession with the
1226         old drag source.
1227
1228         As opposed to firing a new event (for instance: `adddragitem`), this approach is taken to ensure that if the
1229         page wants to preventDefault() on `dragstart`, it would also prevent the user from adding it as an additional
1230         drag item. Using the new event approach, dealing with this case would either require the page to listen for a
1231         new event and call preventDefault(), which would break compatibility with pages that only preventDefault() on
1232         `dragstart`, or it would require the default behavior of this new event to be _not_ adding a drag item, in which
1233         case this approach would require pages to adopt the new event in some form.
1234
1235         * WebProcess/WebPage/ios/WebPageIOS.mm:
1236         (WebKit::WebPage::requestAdditionalItemsForDragSession):
1237
1238 2017-09-11  Alex Christensen  <achristensen@webkit.org>
1239
1240         Clean up API::UIClient
1241         https://bugs.webkit.org/show_bug.cgi?id=176568
1242
1243         Reviewed by Brady Eidson.
1244
1245         We don't need createNewPage and createNewPageAsync.
1246         An async version can support synchronous delegate calls by just calling the completion handler synchronously.
1247
1248         * UIProcess/API/APIUIClient.h:
1249         (API::UIClient::createNewPage):
1250         (API::UIClient::createNewPageAsync): Deleted.
1251         (API::UIClient::canCreateNewPageAsync): Deleted.
1252         * UIProcess/API/C/WKPage.cpp:
1253         (WKPageSetPageUIClient):
1254         * UIProcess/API/glib/WebKitUIClient.cpp:
1255         * UIProcess/API/glib/WebKitUIClient.h:
1256         * UIProcess/Cocoa/UIDelegate.h:
1257         * UIProcess/Cocoa/UIDelegate.mm:
1258         (WebKit::UIDelegate::UIClient::createNewPage):
1259         (WebKit::UIDelegate::UIClient::createNewPageCommon): Deleted.
1260         (WebKit::UIDelegate::UIClient::canCreateNewPageAsync): Deleted.
1261         (WebKit::UIDelegate::UIClient::createNewPageAsync): Deleted.
1262         * UIProcess/WebPageProxy.cpp:
1263         (WebKit::WebPageProxy::createNewPage):
1264         * UIProcess/WebPageProxy.h:
1265
1266 2017-09-11  Alex Christensen  <achristensen@webkit.org>
1267
1268         Fix memory leak introduced in r221894.
1269         https://bugs.webkit.org/show_bug.cgi?id=176753
1270
1271         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
1272         (WebKit::NotificationPermissionRequestManagerProxy::createRequest):
1273         The NotificationPermissionRequestManagerProxy keeps track of pending requests
1274         so they can be denied when invalidating the page.  We add them to a HashMap and in
1275         r221894 I removed the code that removes them from that map once the request is complete.
1276         This code adds the completed task removal back.
1277         The NotificationPermissionRequestManagerProxy and WebPageProxy have the same lifetime,
1278         so protecting the WebPageProxy (m_page) makes sure there is no use-after-free when the
1279         completion handler is called.
1280
1281 2017-09-11  Alex Christensen  <achristensen@webkit.org>
1282
1283         Make NotificationPermissionRequest work with completion handlers
1284         https://bugs.webkit.org/show_bug.cgi?id=176753
1285
1286         Reviewed by Andy Estes.
1287
1288         API::UIClient::decidePolicyForNotificationPermissionRequest should take a completion handler
1289         which it will eventually call with a bool representing whether notifications are allowed.
1290         To do this, I make NotificationPermissionRequest just a wrapper for a lambda.
1291         One subtle change in behavior is when invalidating all outstanding requests, we deny them instead
1292         of just dropping them.  This results in a deny message sent where there wasn't one before,
1293         resulting in better cleanup in NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision.
1294
1295         * UIProcess/API/APIUIClient.h:
1296         (API::UIClient::decidePolicyForNotificationPermissionRequest):
1297         * UIProcess/API/C/WKPage.cpp:
1298         (WKPageSetPageUIClient):
1299         * UIProcess/Notifications/NotificationPermissionRequest.cpp: Removed.
1300         * UIProcess/Notifications/NotificationPermissionRequest.h:
1301         (WebKit::NotificationPermissionRequest::create):
1302         (WebKit::NotificationPermissionRequest::allow):
1303         (WebKit::NotificationPermissionRequest::deny):
1304         (WebKit::NotificationPermissionRequest::NotificationPermissionRequest):
1305         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
1306         (WebKit::NotificationPermissionRequestManagerProxy::invalidateRequests):
1307         (WebKit::NotificationPermissionRequestManagerProxy::createRequest):
1308         (WebKit::NotificationPermissionRequestManagerProxy::didReceiveNotificationPermissionDecision): Deleted.
1309         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h:
1310         * UIProcess/WebPageProxy.cpp:
1311         (WebKit::WebPageProxy::requestNotificationPermission):
1312         * WebKit.xcodeproj/project.pbxproj:
1313
1314 2017-09-11  Alex Christensen  <achristensen@webkit.org>
1315
1316         Modernize and make API::UIClient more asynchronous
1317         https://bugs.webkit.org/show_bug.cgi?id=176583
1318
1319         Reviewed by Brian Burg.
1320
1321         API::UIClient calls that return values synchronously require synchronous APIs unnecessarily.
1322         Having them call completion handlers with the results instead allows us to make asynchronous
1323         APIs, and existing synchronous APIs can just call the completion handlers immediately.
1324         
1325         Unfortunately an assumption that API::UIClient::windowFrame returns synchronously had worked
1326         its way into the WebAutomationSession, which calls WebPageProxy::getWindowFrame.  Making it
1327         asynchronous required making some automation protocols asynchronous so they can send their
1328         result once they have the resulting frames from the UIClient.
1329         
1330         No change in behaviour.
1331
1332         * UIProcess/API/APIUIClient.h:
1333         (API::UIClient::setToolbarsAreVisible):
1334         (API::UIClient::menuBarIsVisible):
1335         (API::UIClient::setMenuBarIsVisible):
1336         (API::UIClient::statusBarIsVisible):
1337         (API::UIClient::setStatusBarIsVisible):
1338         (API::UIClient::isResizable):
1339         (API::UIClient::setIsResizable):
1340         (API::UIClient::setWindowFrame):
1341         (API::UIClient::windowFrame):
1342         (API::UIClient::headerHeight):
1343         (API::UIClient::footerHeight):
1344         (API::UIClient::drawHeader):
1345         (API::UIClient::drawFooter):
1346         (API::UIClient::printFrame):
1347         * UIProcess/API/C/WKPage.cpp:
1348         (WKPageSetPageUIClient):
1349         * UIProcess/Automation/Automation.json:
1350         * UIProcess/Automation/WebAutomationSession.cpp:
1351         (WebKit::WebAutomationSession::buildBrowsingContextForPage):
1352         (WebKit::WebAutomationSession::getNextContext):
1353         (WebKit::WebAutomationSession::getBrowsingContexts):
1354         (WebKit::WebAutomationSession::getBrowsingContext):
1355         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
1356         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
1357         (WebKit::WebAutomationSession::performMouseInteraction):
1358         * UIProcess/Automation/WebAutomationSession.h:
1359         * UIProcess/Cocoa/UIDelegate.h:
1360         * UIProcess/Cocoa/UIDelegate.mm:
1361         (WebKit::UIDelegate::UIClient::printFrame):
1362         * UIProcess/Cocoa/WebViewImpl.mm:
1363         (WebKit::WebViewImpl::printOperationWithPrintInfo):
1364         * UIProcess/WebPageProxy.cpp:
1365         (WebKit::WebPageProxy::runJavaScriptPrompt):
1366         (WebKit::WebPageProxy::setToolbarsAreVisible):
1367         (WebKit::WebPageProxy::setMenuBarIsVisible):
1368         (WebKit::WebPageProxy::getMenuBarIsVisible):
1369         (WebKit::WebPageProxy::setStatusBarIsVisible):
1370         (WebKit::WebPageProxy::getStatusBarIsVisible):
1371         (WebKit::WebPageProxy::setIsResizable):
1372         (WebKit::WebPageProxy::getIsResizable):
1373         (WebKit::WebPageProxy::setWindowFrame):
1374         (WebKit::WebPageProxy::getWindowFrame):
1375         (WebKit::WebPageProxy::getWindowFrameWithCompletionHandler):
1376         (WebKit::WebPageProxy::screenToRootView):
1377         (WebKit::WebPageProxy::rootViewToScreen):
1378         (WebKit::WebPageProxy::printFrame):
1379         (WebKit::WebPageProxy::headerHeight):
1380         (WebKit::WebPageProxy::footerHeight):
1381         (WebKit::WebPageProxy::drawHeader):
1382         (WebKit::WebPageProxy::drawFooter):
1383         * UIProcess/WebPageProxy.h:
1384         * UIProcess/WebPageProxy.messages.in:
1385         * UIProcess/mac/WKPrintingView.h:
1386         * UIProcess/mac/WKPrintingView.mm:
1387         (-[WKPrintingView initWithFrameProxy:view:]):
1388         (-[WKPrintingView _adjustPrintingMarginsForHeaderAndFooter]):
1389         (-[WKPrintingView drawPageBorderWithSize:]):
1390         * UIProcess/mac/WebPageProxyMac.mm:
1391         (WebKit::WebPageProxy::windowAndViewFramesChanged):
1392
1393 2017-09-11  Stephan Szabo  <stephan.szabo@sony.com>
1394
1395         [WinCairo] Add entry Web Process files for wincairo webkit
1396         https://bugs.webkit.org/show_bug.cgi?id=176570
1397
1398         Reviewed by Alex Christensen.
1399
1400         * PlatformWin.cmake:
1401         * WebProcess/EntryPoint/win/WebProcessMain.cpp: Added.
1402         * WebProcess/win/WebProcessMainWin.cpp: Added.
1403         * WebProcess/win/WebProcessMainWin.h: Added.
1404
1405 2017-09-11  Alex Christensen  <achristensen@webkit.org>
1406
1407         Add WKUIDelegatePrivate equivalent of WKPageUIClient's decidePolicyForGeolocationPermissionRequest
1408         https://bugs.webkit.org/show_bug.cgi?id=176642
1409         <rdar://problem/29270035>
1410
1411         Reviewed by Darin Adler.
1412
1413         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1414         * UIProcess/Cocoa/UIDelegate.h:
1415         * UIProcess/Cocoa/UIDelegate.mm:
1416         (WebKit::UIDelegate::setDelegate):
1417         (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
1418         (WebKit::Function<void):
1419
1420 2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1421
1422         [iOS DnD] Elements in the DOM with the `draggable` attribute should be draggable
1423         https://bugs.webkit.org/show_bug.cgi?id=176664
1424         <rdar://problem/32596156>
1425
1426         Reviewed by Tim Horton.
1427
1428         Makes a simple adjustment in DragDropInteractionState::previewForDragItem to respect the drag image supplied to
1429         the UI process during a "DHTML"-defined drag (i.e. DragSourceActionDHTML).
1430
1431         Test: DataInteractionTests.CanStartDragOnDivWithDraggableAttribute
1432
1433         * UIProcess/API/Cocoa/WKWebView.mm:
1434         (-[WKWebView _simulateDataInteractionEntered:]): Deleted.
1435         (-[WKWebView _simulateDataInteractionUpdated:]): Deleted.
1436         (-[WKWebView _simulateDataInteractionPerformOperation:]): Deleted.
1437         (-[WKWebView _simulateDataInteractionEnded:]): Deleted.
1438         (-[WKWebView _simulateDataInteractionSessionDidEnd:]): Deleted.
1439         (-[WKWebView _simulateWillBeginDataInteractionWithSession:]): Deleted.
1440         (-[WKWebView _simulatedItemsForSession:]): Deleted.
1441         (-[WKWebView _simulateItemsForAddingToSession:atLocation:completion:]): Deleted.
1442         (-[WKWebView _simulatePrepareForDataInteractionSession:completion:]): Deleted.
1443
1444         Remove all -_simulate*: testing helpers on WKWebView.
1445
1446         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1447         * UIProcess/ios/DragDropInteractionState.mm:
1448         (WebKit::shouldUseDragImageToCreatePreviewForDragSource):
1449         (WebKit::shouldUseTextIndicatorToCreatePreviewForDragSource):
1450
1451         Add shouldUseDragImageToCreatePreviewForDragSource, which returns YES when dragging an image or DHTML-defined
1452         draggable element and the drag image exists. This is called from previewForDragItem when constructing the drag
1453         preview for a given UIDragItem.
1454
1455         (WebKit::DragDropInteractionState::previewForDragItem const):
1456         (WebKit::shouldUseTextIndicatorToCreatePreviewForDragAction): Deleted.
1457         * UIProcess/ios/WKContentViewInteraction.h:
1458         * UIProcess/ios/WKContentViewInteraction.mm:
1459         (-[WKContentView _simulateDataInteractionEntered:]): Deleted.
1460         (-[WKContentView _simulateDataInteractionUpdated:]): Deleted.
1461         (-[WKContentView _simulateDataInteractionEnded:]): Deleted.
1462         (-[WKContentView _simulateDataInteractionPerformOperation:]): Deleted.
1463         (-[WKContentView _simulateDataInteractionSessionDidEnd:]): Deleted.
1464         (-[WKContentView _simulateWillBeginDataInteractionWithSession:]): Deleted.
1465         (-[WKContentView _simulatedItemsForSession:]): Deleted.
1466         (-[WKContentView _simulatePrepareForDataInteractionSession:completion:]): Deleted.
1467         (-[WKContentView _simulateItemsForAddingToSession:atLocation:completion:]): Deleted.
1468
1469         Remove all -_simulate*: testing helpers on WKContentView.
1470
1471 2017-09-11  Alex Christensen  <achristensen@webkit.org>
1472
1473         Modernize BoxExtent into RectEdges
1474         https://bugs.webkit.org/show_bug.cgi?id=176437
1475
1476         Reviewed by Simon Fraser.
1477
1478         * Scripts/webkit/messages.py:
1479         (class_template_headers):
1480         * Shared/WebCoreArgumentCoders.h:
1481         * UIProcess/WebPageProxy.h:
1482         * UIProcess/WebPageProxy.messages.in:
1483         * WebProcess/WebPage/WebPage.messages.in:
1484
1485 2017-09-11  Andy Estes  <aestes@apple.com>
1486
1487         [Mac] Upstream QTKit-related WebKitSystemInterface functions
1488         https://bugs.webkit.org/show_bug.cgi?id=176472
1489
1490         Reviewed by Eric Carlson.
1491
1492         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1493         (InitWebCoreSystemInterface):
1494
1495 2017-09-11  JF Bastien  <jfbastien@apple.com>
1496
1497         cmake build fix
1498
1499         Unreviewed
1500
1501         * PlatformMac.cmake: one file was deleted, another renamed.
1502
1503 2017-09-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1504
1505         REGRESSION: [GTK] Generated HTML API documentation is missing descriptions
1506         https://bugs.webkit.org/show_bug.cgi?id=176667
1507
1508         Reviewed by Michael Catanzaro.
1509
1510         Fix several typos in API documentation.
1511
1512         * UIProcess/API/glib/WebKitSettings.cpp:
1513         (webkit_settings_class_init):
1514         * UIProcess/API/glib/WebKitWebView.cpp:
1515         (webkit_web_view_class_init):
1516         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
1517         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
1518
1519 2017-09-10  Brady Eidson  <beidson@apple.com>
1520
1521         Try to avoid creating the default WKWebsiteDataStore until its actually needed.
1522         <rdar://problem/33164453> and https://bugs.webkit.org/show_bug.cgi?id=176551
1523
1524         Reviewed by Tim Horton.
1525
1526         * UIProcess/API/APIHTTPCookieStore.cpp:
1527         (API::HTTPCookieStore::cookies):
1528         (API::HTTPCookieStore::setCookie):
1529         (API::HTTPCookieStore::deleteCookie):
1530
1531         * UIProcess/API/APIWebsiteDataStore.cpp:
1532         (API::WebsiteDataStore::defaultDataStore):
1533         (API::WebsiteDataStore::defaultDataStoreExists):
1534         * UIProcess/API/APIWebsiteDataStore.h:
1535
1536         * UIProcess/API/C/WKContext.cpp:
1537         (WKContextGetWebsiteDataStore):
1538
1539         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1540         (+[WKWebsiteDataStore _defaultDataStoreExists]):
1541         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1542
1543         * UIProcess/WebProcessPool.cpp:
1544         (WebKit::WebProcessPool::WebProcessPool):
1545         (WebKit::m_hiddenPageThrottlingTimer):
1546         (WebKit::WebProcessPool::ensureNetworkProcess):
1547         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
1548         (WebKit::WebProcessPool::warmInitialProcess):
1549         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
1550         (WebKit::WebProcessPool::createWebPage):
1551         (WebKit::WebProcessPool::pageAddedToProcess):
1552         * UIProcess/WebProcessPool.h:
1553
1554         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1555         (WebKit::WebsiteDataStore::isAssociatedProcessPool const):
1556
1557 2017-09-09  Mark Lam  <mark.lam@apple.com>
1558
1559         Avoid duplicate computations of ExecState::vm().
1560         https://bugs.webkit.org/show_bug.cgi?id=176647
1561
1562         Reviewed by Saam Barati.
1563
1564         * WebProcess/Plugins/Netscape/JSNPMethod.h:
1565         (WebKit::JSNPMethod::create):
1566         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
1567         (WebKit::NPJSObject::setProperty):
1568         (WebKit::NPJSObject::removeProperty):
1569         (WebKit::NPJSObject::enumerate):
1570
1571 2017-09-08  Joseph Pecoraro  <pecoraro@apple.com>
1572
1573         Fetch's Response.statusText is unexpectedly the full http status line for HTTP/2 responses
1574         https://bugs.webkit.org/show_bug.cgi?id=176479
1575
1576         Reviewed by Alex Christensen.
1577
1578         * NetworkProcess/NetworkProcess.cpp:
1579         (WebKit::NetworkProcess::initializeNetworkProcess):
1580         Initialize AtomicString statics like emptyAtom().
1581
1582 2017-09-08  Commit Queue  <commit-queue@webkit.org>
1583
1584         Unreviewed, rolling out r221773.
1585         https://bugs.webkit.org/show_bug.cgi?id=176614
1586
1587         This caused build failures. (Requested by mlewis13 on
1588         #webkit).
1589
1590         Reverted changeset:
1591
1592         "[Mac] Upstream QTKit-related WebKitSystemInterface functions"
1593         https://bugs.webkit.org/show_bug.cgi?id=176472
1594         http://trac.webkit.org/changeset/221773
1595
1596 2017-09-08  Stephan Szabo  <stephan.szabo@am.sony.com>
1597
1598         [WinCairo] Add Storage Process files for wincairo webkit
1599         https://bugs.webkit.org/show_bug.cgi?id=176567
1600
1601         Reviewed by Alex Christensen.
1602
1603         * PlatformWin.cmake:
1604         * StorageProcess/EntryPoint/win/StorageProcessMain.cpp: Added.
1605         (main):
1606         * StorageProcess/win/StorageProcessMainWin.cpp: Added.
1607         (WebKit::StorageProcessMainWin):
1608         * StorageProcess/win/StorageProcessMainWin.h: Added.
1609
1610 2017-09-08  Ryan Haddad  <ryanhaddad@apple.com>
1611
1612         Unreviewed, rolling out r221771.
1613
1614         This change caused two API tests to crash.
1615
1616         Reverted changeset:
1617
1618         "Clean up API::UIClient"
1619         https://bugs.webkit.org/show_bug.cgi?id=176568
1620         http://trac.webkit.org/changeset/221771
1621
1622 2017-09-07  Carlos Garcia Campos  <cgarcia@igalia.com>
1623
1624         [GTK][WPE] UI process crash in WebBackForwardList::restoreFromState
1625         https://bugs.webkit.org/show_bug.cgi?id=176303
1626
1627         Reviewed by Michael Catanzaro.
1628
1629         Ensure the current index provided by the session state is not out of actual item list bounds. This is a bug in
1630         the session state decoder, but WebBackForwardList::backForwardListState() is already doing the check and using
1631         the last item index instead, so it's not easy to know where the actual problem is. In any case we should
1632         still protect the decoder.
1633
1634         * UIProcess/API/glib/WebKitWebViewSessionState.cpp:
1635         (decodeSessionState):
1636
1637 2017-09-07  Andy Estes  <aestes@apple.com>
1638
1639         [Mac] Upstream QTKit-related WebKitSystemInterface functions
1640         https://bugs.webkit.org/show_bug.cgi?id=176472
1641
1642         Reviewed by Eric Carlson.
1643
1644         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1645         (InitWebCoreSystemInterface):
1646
1647 2017-09-07  Alex Christensen  <achristensen@webkit.org>
1648
1649         Clean up API::UIClient
1650         https://bugs.webkit.org/show_bug.cgi?id=176568
1651
1652         Reviewed by Brady Eidson.
1653
1654         We don't need createNewPage and createNewPageAsync.
1655         An async version can support synchronous delegate calls by just calling the completion handler synchronously.
1656
1657         * UIProcess/API/APIUIClient.h:
1658         (API::UIClient::createNewPage):
1659         (API::UIClient::createNewPageAsync): Deleted.
1660         (API::UIClient::canCreateNewPageAsync): Deleted.
1661         * UIProcess/API/C/WKPage.cpp:
1662         (WKPageSetPageUIClient):
1663         * UIProcess/API/glib/WebKitUIClient.cpp:
1664         * UIProcess/API/glib/WebKitUIClient.h:
1665         * UIProcess/Cocoa/UIDelegate.h:
1666         * UIProcess/Cocoa/UIDelegate.mm:
1667         (WebKit::UIDelegate::UIClient::createNewPage):
1668         (WebKit::UIDelegate::UIClient::createNewPageCommon): Deleted.
1669         (WebKit::UIDelegate::UIClient::canCreateNewPageAsync): Deleted.
1670         (WebKit::UIDelegate::UIClient::createNewPageAsync): Deleted.
1671         * UIProcess/WebPageProxy.cpp:
1672         (WebKit::WebPageProxy::createNewPage):
1673         * UIProcess/WebPageProxy.h:
1674
1675 2017-09-07  Alex Christensen  <achristensen@webkit.org>
1676
1677         Make DragControllerAction an enum class
1678         https://bugs.webkit.org/show_bug.cgi?id=176565
1679
1680         Reviewed by Andy Estes.
1681
1682         * Shared/DragControllerAction.h:
1683         (): Deleted.
1684         * UIProcess/WebPageProxy.cpp:
1685         (WebKit::WebPageProxy::dragEntered):
1686         (WebKit::WebPageProxy::dragUpdated):
1687         (WebKit::WebPageProxy::dragExited):
1688         (WebKit::WebPageProxy::performDragOperation):
1689         * WebProcess/WebPage/WebPage.cpp:
1690         (WebKit::WebPage::performDragControllerAction):
1691         * WebProcess/WebPage/WebPage.h:
1692         * WebProcess/WebPage/WebPage.messages.in:
1693
1694 2017-09-07  Myles C. Maxfield  <mmaxfield@apple.com>
1695
1696         [PAL] Unify PlatformUserPreferredLanguages.h with Language.h
1697         https://bugs.webkit.org/show_bug.cgi?id=176561
1698
1699         Reviewed by Brent Fulgham.
1700
1701         * UIProcess/WebProcessPool.cpp:
1702         * WebProcess/WebProcess.cpp:
1703         (WebKit::WebProcess::userPreferredLanguagesChanged const):
1704
1705 2017-09-07  Youenn Fablet  <youenn@apple.com>
1706
1707         Remove entry from CacheStorageEngineConnection lock map when unlocking a Cache
1708         https://bugs.webkit.org/show_bug.cgi?id=176548
1709
1710         Reviewed by Alex Christensen.
1711
1712         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
1713         (WebKit::CacheStorageEngineConnection::dereference):
1714
1715 2017-09-07  Chris Dumez  <cdumez@apple.com>
1716
1717         [WK2] Add C API to retrieve the originating page of a WKDownload
1718         https://bugs.webkit.org/show_bug.cgi?id=176557
1719         <rdar://problem/34314776>
1720
1721         Reviewed by Alex Christensen.
1722
1723         Add C API to retrieve the original page of a WKDownload. This is the C API equivalent to
1724         _WKDownload.originatingWebView which already exists in ObjC. The pointer is weak so as
1725         to not keep alive the page for the duration of the download.
1726
1727         * UIProcess/API/C/WKDownload.cpp:
1728         (WKDownloadGetOriginatingPage):
1729         * UIProcess/API/C/WKDownload.h:
1730         * UIProcess/API/Cocoa/_WKDownload.mm:
1731         (-[_WKDownload originatingWebView]):
1732         * UIProcess/API/Cocoa/_WKDownloadInternal.h:
1733         * UIProcess/Downloads/DownloadProxy.cpp:
1734         (WebKit::DownloadProxy::originatingPage const):
1735         (WebKit::DownloadProxy::setOriginatingPage):
1736         * UIProcess/Downloads/DownloadProxy.h:
1737         * UIProcess/WebPageProxy.cpp:
1738         (WebKit::WebPageProxy::receivedPolicyDecision):
1739         * UIProcess/WebProcessPool.cpp:
1740         (WebKit::WebProcessPool::download):
1741         (WebKit::WebProcessPool::resumeDownload):
1742         (WebKit::WebProcessPool::createDownloadProxy):
1743         * UIProcess/WebProcessPool.h:
1744         * UIProcess/ios/PageClientImplIOS.mm:
1745         (WebKit::PageClientImpl::handleDownloadRequest):
1746         * UIProcess/mac/PageClientImplMac.mm:
1747         (WebKit::PageClientImpl::handleDownloadRequest):
1748
1749 2017-09-07  Alex Christensen  <achristensen@webkit.org>
1750
1751         Clean up Geolocation request handling
1752         https://bugs.webkit.org/show_bug.cgi?id=176562
1753
1754         Reviewed by Tim Horton.
1755
1756         Instead of passing a GeolocationPermissionRequestProxy& to each client and returning a bool if the request will be handled,
1757         pass a Function<void(bool)>&& completionHandler and return the function if it won't be handled.
1758         This allows to temporarily support our UIClient/PageClient hybrid design while moving towards a sane design.
1759
1760         * UIProcess/API/APIUIClient.h:
1761         (API::UIClient::Function<void):
1762         (API::UIClient::decidePolicyForGeolocationPermissionRequest): Deleted.
1763         * UIProcess/API/C/WKAPICast.h:
1764         * UIProcess/API/C/WKGeolocationPermissionRequest.cpp:
1765         (WKGeolocationPermissionRequestGetTypeID):
1766         * UIProcess/API/C/WKPage.cpp:
1767         (WKPageSetPageUIClient):
1768         * UIProcess/GeolocationPermissionRequestProxy.cpp:
1769         (WebKit::GeolocationPermissionRequestProxy::allow):
1770         (WebKit::GeolocationPermissionRequestProxy::deny):
1771         (WebKit::GeolocationPermissionRequestProxy::invalidate):
1772         * UIProcess/GeolocationPermissionRequestProxy.h:
1773         (WebKit::GeolocationPermissionRequest::create):
1774         (WebKit::GeolocationPermissionRequest::allow):
1775         (WebKit::GeolocationPermissionRequest::deny):
1776         (WebKit::GeolocationPermissionRequest::GeolocationPermissionRequest):
1777         * UIProcess/PageClient.h:
1778         (WebKit::PageClient::decidePolicyForGeolocationPermissionRequest): Deleted.
1779         * UIProcess/WebPageProxy.cpp:
1780         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
1781         * UIProcess/ios/PageClientImplIOS.h:
1782         * UIProcess/ios/PageClientImplIOS.mm:
1783         (WebKit::Function<void):
1784         (WebKit::PageClientImpl::decidePolicyForGeolocationPermissionRequest): Deleted.
1785         * UIProcess/ios/WKContentView.h:
1786         * UIProcess/ios/WKGeolocationProviderIOS.h:
1787         * UIProcess/ios/WKGeolocationProviderIOS.mm:
1788         (-[WKGeolocationProviderIOS decidePolicyForGeolocationRequestFromOrigin:frame:completionHandler:view:]):
1789         (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
1790         (-[WKGeolocationProviderIOS geolocationAuthorizationDenied]):
1791         (-[WKWebAllowDenyPolicyListener initWithCompletionHandler:]):
1792         (-[WKWebAllowDenyPolicyListener allow]):
1793         (-[WKWebAllowDenyPolicyListener deny]):
1794         (-[WKGeolocationProviderIOS decidePolicyForGeolocationRequestFromOrigin:frame:request:view:]): Deleted.
1795         (-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]): Deleted.
1796
1797 2017-09-07  Alex Christensen  <achristensen@webkit.org>
1798
1799         Allow modern decoding of enums and OptionSets
1800         https://bugs.webkit.org/show_bug.cgi?id=176480
1801
1802         Reviewed by Andy Estes.
1803
1804         * Platform/IPC/ArgumentCoders.h:
1805         (IPC::ArgumentCoder<OptionSet<T>>::decode):
1806         * Platform/IPC/Decoder.h:
1807         (IPC::Decoder::operator>>):
1808         * Platform/IPC/Encoder.h:
1809         * Shared/WebsitePolicies.h:
1810         (WebKit::WebsitePolicies::encode const):
1811         (WebKit::WebsitePolicies::decode):
1812
1813 2017-09-07  Frederic Wang  <fwang@igalia.com>
1814
1815          Move more code from ScrollingTreeScrollingNodeDelegateIOS to ScrollingTreeScrollingNodeDelegate
1816          https://bugs.webkit.org/show_bug.cgi?id=174130
1817
1818          Reviewed by Simon Fraser.
1819
1820          * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h: Remove some members,
1821          headers and pre-declaration that are moved into the delegate.
1822          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollLayer): Deleted.
1823          * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: Remove some headers and
1824          WKOverflowScrollViewDelegate since they are moved into the delegate file. Also fix the
1825          comment to closing the WebKit namespace.
1826          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::~ScrollingTreeOverflowScrollingNodeIOS):
1827          Remove some code moved into the delegate and call the corresponding helper function to
1828          preserve the current behavior.
1829          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren): Ditto.
1830          Note that it is only necessary to cast the parameter to a ScrollingStateTreeNode.
1831          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren): Ditto.
1832          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange): Ditto.
1833          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollPosition): Ditto.
1834          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): Ditto.
1835          (-[WKOverflowScrollViewDelegate initWithScrollingTreeNodeDelegate:]): Deleted.
1836          (-[WKOverflowScrollViewDelegate scrollViewDidScroll:]): Deleted.
1837          (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]): Deleted.
1838          (-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Deleted.
1839          (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): Deleted.
1840          (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]): Deleted.
1841          * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h: Import headers and members
1842          from ScrollingTreeOverflowScrollingNodeIOS. Define new helper functions for the code imported
1843          from ScrollingTreeOverflowScrollingNodeIOS. Remove the friendship with
1844          ScrollingTreeOverflowScrollingNodeIOS and only makes public the function used by that class.
1845          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollLayer): This function is moved from
1846          ScrollingTreeOverflowScrollingNodeIOS.
1847          * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: Add headers,
1848          WKOverflowScrollViewDelegate (renamed WKScrollingNodeScrollViewDelegate) and some helper code
1849          imported from ScrollingTreeOverflowScrollingNodeIOS.
1850          (-[WKScrollingNodeScrollViewDelegate scrollViewDidScroll:]): Moved from
1851          ScrollingTreeOverflowScrollingNodeIOS.
1852          (-[WKScrollingNodeScrollViewDelegate scrollViewWillBeginDragging:]): Ditto.
1853          (-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Ditto.
1854          (-[WKScrollingNodeScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): Ditto.
1855          (-[WKScrollingNodeScrollViewDelegate scrollViewDidEndDecelerating:]): Ditto.
1856          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::~ScrollingTreeScrollingNodeDelegateIOS):
1857          Import code from ScrollingTreeOverflowScrollingNodeIOS.
1858          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::resetScrollViewDelegate): New helper function
1859          importing code from ScrollingTreeOverflowScrollingNodeIOS.
1860          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren): Ditto.
1861          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren): Ditto.
1862          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange): Ditto.
1863          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollPosition): Ditto.
1864          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::setScrollLayerPosition): Ditto.
1865
1866 2017-09-07  Chris Dumez  <cdumez@apple.com>
1867
1868         [WK2] Notify client when downloads are redirected
1869         https://bugs.webkit.org/show_bug.cgi?id=176481
1870         <rdar://problem/34309065>
1871
1872         Reviewed by Geoffrey Garen.
1873
1874         Notify client when downloads are redirected via both ObjC and C
1875         API.
1876
1877         * NetworkProcess/Downloads/Download.cpp:
1878         (WebKit::Download::willSendRedirectedRequest):
1879         * NetworkProcess/Downloads/Download.h:
1880         * NetworkProcess/Downloads/mac/DownloadMac.mm:
1881         (-[WKDownloadAsDelegate download:willSendRequest:redirectResponse:]):
1882         * UIProcess/API/APIDownloadClient.h:
1883         (API::DownloadClient::willSendRequest):
1884         * UIProcess/API/C/WKContext.cpp:
1885         (WKContextSetDownloadClient):
1886         * UIProcess/API/C/WKContextDownloadClient.h:
1887         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
1888         * UIProcess/Cocoa/DownloadClient.h:
1889         * UIProcess/Cocoa/DownloadClient.mm:
1890         (WebKit::DownloadClient::DownloadClient):
1891         (WebKit::DownloadClient::willSendRequest):
1892         * UIProcess/Downloads/DownloadProxy.cpp:
1893         (WebKit::DownloadProxy::willSendRequest):
1894         * UIProcess/Downloads/DownloadProxy.h:
1895         * UIProcess/Downloads/DownloadProxy.messages.in:
1896
1897         * UIProcess/mac/WebContextMenuProxyMac.mm:
1898         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
1899         Set menu proxy before calling menuFromProposedMenu() client delegate.
1900         This allows me to perform one of the menu item's action from the
1901         menuFromProposedMenu() client delegate in my API test.
1902
1903 2017-09-07  Alex Christensen  <achristensen@webkit.org>
1904
1905         Modernize Geolocation code
1906         https://bugs.webkit.org/show_bug.cgi?id=176496
1907
1908         Reviewed by Andy Estes.
1909
1910         Making the GeolocationPermissionRequestManager take a reference instead of a pointer
1911         spilled into making the other supplement constructors do the same.
1912
1913         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.cpp:
1914         (WebKit::LegacyCustomProtocolManager::LegacyCustomProtocolManager):
1915         (WebKit::LegacyCustomProtocolManager::startLoading):
1916         (WebKit::LegacyCustomProtocolManager::stopLoading):
1917         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h:
1918         * NetworkProcess/NetworkProcess.h:
1919         (WebKit::NetworkProcess::addSupplement):
1920         * Shared/Authentication/AuthenticationManager.cpp:
1921         (WebKit::AuthenticationManager::AuthenticationManager):
1922         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
1923         * Shared/Authentication/AuthenticationManager.h:
1924         * UIProcess/API/APIUIClient.h:
1925         (API::UIClient::decidePolicyForGeolocationPermissionRequest):
1926         * UIProcess/API/C/WKPage.cpp:
1927         (WKPageSetPageUIClient):
1928         * UIProcess/WebPageProxy.cpp:
1929         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
1930         * WebProcess/Cookies/WebCookieManager.cpp:
1931         (WebKit::WebCookieManager::WebCookieManager):
1932         (WebKit::WebCookieManager::getHostnamesWithCookies):
1933         (WebKit::WebCookieManager::deleteCookie):
1934         (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
1935         (WebKit::WebCookieManager::getAllCookies):
1936         (WebKit::WebCookieManager::getCookies):
1937         (WebKit::WebCookieManager::setCookie):
1938         (WebKit::WebCookieManager::setCookies):
1939         (WebKit::WebCookieManager::notifyCookiesDidChange):
1940         (WebKit::WebCookieManager::setHTTPCookieAcceptPolicy):
1941         (WebKit::WebCookieManager::getHTTPCookieAcceptPolicy):
1942         * WebProcess/Cookies/WebCookieManager.h:
1943         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
1944         (WebKit::GeolocationPermissionRequestManager::GeolocationPermissionRequestManager):
1945         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
1946         (WebKit::GeolocationPermissionRequestManager::cancelRequestForGeolocation):
1947         * WebProcess/Geolocation/GeolocationPermissionRequestManager.h:
1948         * WebProcess/Geolocation/WebGeolocationManager.cpp:
1949         (WebKit::WebGeolocationManager::WebGeolocationManager):
1950         (WebKit::WebGeolocationManager::registerWebPage):
1951         (WebKit::WebGeolocationManager::unregisterWebPage):
1952         (WebKit::WebGeolocationManager::setEnableHighAccuracyForPage):
1953         (WebKit::WebGeolocationManager::didChangePosition):
1954         (WebKit::WebGeolocationManager::didFailToDeterminePosition):
1955         (WebKit::WebGeolocationManager::resetPermissions):
1956         * WebProcess/Geolocation/WebGeolocationManager.h:
1957         * WebProcess/MediaCache/WebMediaKeyStorageManager.h:
1958         (WebKit::WebMediaKeyStorageManager::WebMediaKeyStorageManager):
1959         * WebProcess/Notifications/WebNotificationManager.cpp:
1960         (WebKit::WebNotificationManager::WebNotificationManager):
1961         (WebKit::WebNotificationManager::show):
1962         (WebKit::WebNotificationManager::cancel):
1963         (WebKit::WebNotificationManager::clearNotifications):
1964         (WebKit::WebNotificationManager::didDestroyNotification):
1965         * WebProcess/Notifications/WebNotificationManager.h:
1966         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
1967         (WebKit::WebGeolocationClient::requestPermission):
1968         (WebKit::WebGeolocationClient::cancelPermissionRequest):
1969         * WebProcess/WebCoreSupport/WebGeolocationClient.h:
1970         (WebKit::WebGeolocationClient::WebGeolocationClient):
1971         * WebProcess/WebPage/WebPage.cpp:
1972         (WebKit::m_cpuLimit):
1973         * WebProcess/WebProcess.h:
1974         (WebKit::WebProcess::addSupplement):
1975         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1976         (WebKit::UserMediaCaptureManager::UserMediaCaptureManager):
1977         * WebProcess/cocoa/UserMediaCaptureManager.h:
1978
1979 2017-09-06  Alex Christensen  <achristensen@webkit.org>
1980
1981         Add WKUIDelegatePrivate equivalent of WKPageUIClient's pageDidScroll
1982         https://bugs.webkit.org/show_bug.cgi?id=176482
1983         <rdar://problem/29270035>
1984
1985         Reviewed by Tim Horton.
1986         
1987         Covered by a new API test!
1988
1989         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1990         * UIProcess/Cocoa/UIDelegate.h:
1991         * UIProcess/Cocoa/UIDelegate.mm:
1992         (WebKit::UIDelegate::setDelegate):
1993         (WebKit::UIDelegate::UIClient::pageDidScroll):
1994
1995 2017-09-06  Youenn Fablet  <youenn@apple.com>
1996
1997         NetworkProcess Cache and Caches should be cleared when the last related WebProcess Cache or CacheStorage is destroyed
1998         https://bugs.webkit.org/show_bug.cgi?id=176249
1999
2000         Reviewed by Alex Christensen.
2001
2002         CacheStorageEngineConnection will store the number of Caches references for its related WebProcess.
2003         For a new reference, CacheStorageEngineConnection will notify its engine to lock the related Cache.
2004         When the last reference is gone, CacheStorageEngineConnection will ask the engine to release the lock.
2005
2006         CacheStorageEngine will keep locks as a counter for each Cache object.
2007         When the counter goes to zero, the engine asks the Cache to dispose itself.
2008         Disposal is done by its parent Caches as only Caches knows whether the Cache is persistent or has been removed.
2009
2010         The Caches will remove the Cache from memory.
2011         For removed caches, all information will be lost.
2012         For caches that are not removed, they will keep their identifiers but all in-memory record information will be discarded.
2013         If there is a need to reopen the Cache, it will need to read its information from the filesystem.
2014         If the Caches has no longer any active Cache object, it will ask the engine to release itself.
2015
2016         WebProcess crashing is handled correctly as the CacheStorageEngineConnection will release its locks at destruction
2017         time of the connection to the web process.
2018
2019         Adding the possiblity to grab an engine representation for test purposes.
2020
2021         * NetworkProcess/cache/CacheStorageEngine.cpp:
2022         (WebKit::CacheStorage::Engine::readCachesFromDisk):
2023         (WebKit::CacheStorage::Engine::removeCaches):
2024         (WebKit::CacheStorage::Engine::lock):
2025         (WebKit::CacheStorage::Engine::unlock):
2026         * NetworkProcess/cache/CacheStorageEngine.h:
2027         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
2028         (WebKit::CacheStorage::Cache::Cache):
2029         (WebKit::CacheStorage::Cache::dispose):
2030         (WebKit::CacheStorage::Cache::clearMemoryRepresentation):
2031         * NetworkProcess/cache/CacheStorageEngineCache.h:
2032         (WebKit::CacheStorage::Cache::isActive const):
2033         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2034         (WebKit::CacheStorage::Caches::Caches):
2035         (WebKit::CacheStorage::Caches::open):
2036         (WebKit::CacheStorage::Caches::dispose):
2037         (WebKit::CacheStorage::Caches::readCachesFromDisk):
2038         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
2039         * NetworkProcess/cache/CacheStorageEngineCaches.h:
2040         (WebKit::CacheStorage::Caches::create):
2041         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
2042         (WebKit::CacheStorageEngineConnection::~CacheStorageEngineConnection):
2043         (WebKit::CacheStorageEngineConnection::reference):
2044         (WebKit::CacheStorageEngineConnection::dereference):
2045         * NetworkProcess/cache/CacheStorageEngineConnection.h:
2046         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
2047         * WebProcess/Cache/WebCacheStorageConnection.cpp:
2048         (WebKit::WebCacheStorageConnection::reference):
2049         (WebKit::WebCacheStorageConnection::dereference):
2050         * WebProcess/Cache/WebCacheStorageConnection.h:
2051
2052 2017-09-06  Alex Christensen  <achristensen@webkit.org>
2053
2054         Add WKUIDelegatePrivate equivalent of WKPageUIClient's pinnedStateDidChange
2055         https://bugs.webkit.org/show_bug.cgi?id=176474
2056         <rdar://problem/29270035>
2057
2058         Reviewed by Tim Horton.
2059
2060         Rather than telling the UIClient that the pinned state changed and having the application check 4 bools
2061         like we do with WKPage, I made a KVO property on the WKWebView.  I introduce _WKRectEdge for this purpose,
2062         which is like UIRectEdge but unfortunately NSRectEdge and CGRectEdge cannot be used as NS_OPTIONS/flags.
2063         This same structure is used for rubber band state.
2064         
2065         Covered by a new API test.
2066
2067         * UIProcess/API/Cocoa/WKWebView.mm:
2068         (-[WKWebView _pinnedState]):
2069         (-[WKWebView _rubberBandState]):
2070         (-[WKWebView _setRubberBandState:]):
2071         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2072         * UIProcess/Cocoa/WebViewImpl.h:
2073         * UIProcess/Cocoa/WebViewImpl.mm:
2074         (WebKit::WebViewImpl::pinnedState):
2075         (WebKit::WebViewImpl::rubberBandState):
2076         (WebKit::WebViewImpl::setRubberBandState):
2077         * UIProcess/PageClient.h:
2078         (WebKit::PageClient::pinnedStateWillChange):
2079         (WebKit::PageClient::pinnedStateDidChange):
2080         * UIProcess/WebPageProxy.cpp:
2081         (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
2082         * UIProcess/mac/PageClientImplMac.h:
2083         * UIProcess/mac/PageClientImplMac.mm:
2084         (WebKit::PageClientImpl::pinnedStateWillChange):
2085         (WebKit::PageClientImpl::pinnedStateDidChange):
2086
2087 2017-09-06  Youenn Fablet  <youenn@apple.com>
2088
2089         Introduce asynchronous opening of CacheStorageEngine cache
2090         https://bugs.webkit.org/show_bug.cgi?id=176425
2091
2092         Reviewed by Alex Christensen.
2093
2094         Introducing Cache::open to allow reading from the filesystem to fill the Cache.
2095         This is called by Caches when engine requests to open an existing Cache.
2096
2097         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
2098         (WebKit::CacheStorage::Cache::Cache):
2099         (WebKit::CacheStorage::Cache::open):
2100         (WebKit::CacheStorage::Cache::finishOpening):
2101         (WebKit::CacheStorage::Cache::readRecordsList):
2102         * NetworkProcess/cache/CacheStorageEngineCache.h:
2103         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2104         (WebKit::CacheStorage::Caches::find):
2105         (WebKit::CacheStorage::Caches::open):
2106         (WebKit::CacheStorage::Caches::remove):
2107         (WebKit::CacheStorage::Caches::readCachesFromDisk):
2108         (WebKit::CacheStorage::Caches::find const): Deleted.
2109         * NetworkProcess/cache/CacheStorageEngineCaches.h:
2110
2111 2017-09-06  Alex Christensen  <achristensen@webkit.org>
2112
2113         Unreviewed, rolling out r221694.
2114
2115         broke build
2116
2117         Reverted changeset:
2118
2119         "Add WKUIDelegatePrivate equivalent of WKPageUIClient's
2120         pinnedStateDidChange"
2121         https://bugs.webkit.org/show_bug.cgi?id=176474
2122         http://trac.webkit.org/changeset/221694
2123
2124 2017-09-06  Ryan Haddad  <ryanhaddad@apple.com>
2125
2126         Unreviewed, rolling out r221461.
2127
2128         The LayoutTest added with this change crashes under
2129         GuardMalloc.
2130
2131         Reverted changeset:
2132
2133         "Add (entirely incorrect) fetching of ServiceWorker scripts."
2134         https://bugs.webkit.org/show_bug.cgi?id=176179
2135         http://trac.webkit.org/changeset/221461
2136
2137 2017-09-06  Alex Christensen  <achristensen@webkit.org>
2138
2139         Add modern decoders for POD types
2140         https://bugs.webkit.org/show_bug.cgi?id=176456
2141
2142         Reviewed by Geoffrey Garen.
2143
2144         * Platform/IPC/Decoder.cpp:
2145         (IPC::Decoder::getOptional):
2146         (IPC::Decoder::operator>>):
2147         * Platform/IPC/Decoder.h:
2148         * Shared/NavigationActionData.cpp:
2149         (WebKit::NavigationActionData::decode):
2150         * Shared/NavigationActionData.h:
2151
2152 2017-09-06  Alex Christensen  <achristensen@webkit.org>
2153
2154         Add WKUIDelegatePrivate equivalent of WKPageUIClient's pinnedStateDidChange
2155         https://bugs.webkit.org/show_bug.cgi?id=176474
2156         <rdar://problem/29270035>
2157
2158         Reviewed by Tim Horton.
2159
2160         Rather than telling the UIClient that the pinned state changed and having the application check 4 bools
2161         like we do with WKPage, I made a KVO property on the WKWebView.  I introduce _WKRectEdge for this purpose,
2162         which is like UIRectEdge but unfortunately NSRectEdge and CGRectEdge cannot be used as NS_OPTIONS/flags.
2163         This same structure is used for rubber band state.
2164         
2165         Covered by a new API test.
2166
2167         * UIProcess/API/Cocoa/WKWebView.mm:
2168         (-[WKWebView _pinnedState]):
2169         (-[WKWebView _rubberBandState]):
2170         (-[WKWebView _setRubberBandState:]):
2171         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2172         * UIProcess/Cocoa/WebViewImpl.h:
2173         * UIProcess/Cocoa/WebViewImpl.mm:
2174         (WebKit::WebViewImpl::pinnedState):
2175         (WebKit::WebViewImpl::rubberBandState):
2176         (WebKit::WebViewImpl::setRubberBandState):
2177         * UIProcess/PageClient.h:
2178         (WebKit::PageClient::pinnedStateWillChange):
2179         (WebKit::PageClient::pinnedStateDidChange):
2180         * UIProcess/WebPageProxy.cpp:
2181         (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
2182         * UIProcess/mac/PageClientImplMac.h:
2183         * UIProcess/mac/PageClientImplMac.mm:
2184         (WebKit::PageClientImpl::pinnedStateWillChange):
2185         (WebKit::PageClientImpl::pinnedStateDidChange):
2186
2187 2017-09-06  Brent Fulgham  <bfulgham@apple.com>
2188
2189         Deny third-party cookie creation for prevalent resources without interaction
2190         https://bugs.webkit.org/show_bug.cgi?id=175232
2191         <rdar://problem/33709386>
2192
2193         Reviewed by Alex Christensen.
2194
2195         Prior to Intelligent Tracking Prevention, WebKit would deny the ability to create a third party cookie if the user's
2196         settings prohibited it. Due to the internal mechanics of cookie partitioning, we now accept the third party cookie,
2197         but destroy it at some arbitrary moment which is difficult for websites to work with.
2198         
2199         This patch revises WebKit so that attempts to set third party cookies without user interaction fails immediately,
2200         which is what sites are expecting from Safari.
2201
2202         * NetworkProcess/NetworkProcess.cpp:
2203         (WebKit::NetworkProcess::updatePrevalentDomainsWithAndWithoutInteraction):
2204         (WebKit::NetworkProcess::updateCookiePartitioningForTopPrivatelyOwnedDomains): Renamed to updatePrevalentDomainsWithAndWithoutInteraction.
2205         * NetworkProcess/NetworkProcess.h:
2206         * NetworkProcess/NetworkProcess.messages.in: Renamed the UpdateCookiePartitioningForTopPrivatelyOwnedDomains message
2207         to UpdatePrevalentDomainsWithAndWithoutInteraction.
2208         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2209         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Recognize cases where a network session should block cookies, and
2210         use the stateless session so we fail immediately when attempting an invalid cookie set operation.
2211         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2212         (WebKit::WKWebsiteDataStore::_resourceLoadStatisticsSetShouldPartitionCookies): Use new helper function to clear partitioning state.
2213         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2214         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore): Update for revised naming.
2215         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning): Track domains with and without interaction so that we can recognize
2216         domains that should be immediately blocked from setting cookies.
2217         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains): Update for revised naming.
2218         (WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains): Added helper function for testing.
2219         * UIProcess/WebResourceLoadStatisticsStore.h:
2220         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2221         (WebKit::WebsiteDataStore::updatePrevalentDomainsWithAndWithoutInteraction): Update for revised naming.
2222         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback): Ditto.
2223         (WebKit::WebsiteDataStore::updateCookiePartitioningForTopPrivatelyOwnedDomains): Renamed to updatePrevalentDomainsWithAndWithoutInteraction.
2224         * UIProcess/WebsiteData/WebsiteDataStore.h:
2225
2226 2017-09-06  Adrian Perez de Castro  <aperez@igalia.com>
2227
2228         [WPE][CMake] Fix path to the WebKitApplicationInfo.h header.
2229
2230         Unreviewed build fix.
2231
2232         This doesn't really make a difference for the build bots, but it makes
2233         it possible to craft working release tarballs of WPE.
2234
2235         * PlatformWPE.cmake: Use the WPE version of WebKitApplicationInfo.h
2236
2237 2017-09-06  Frédéric Wang  <fwang@igalia.com>
2238
2239         Introduce ScrollingTreeScrollingNodeDelegateIOS to share code between overflow and frame scrolling
2240         https://bugs.webkit.org/show_bug.cgi?id=174097
2241
2242         Reviewed by Darin Adler.
2243
2244         This patch introduces a new ScrollingTreeScrollingNodeDelegateIOS that can be used by
2245         WKOverflowScrollViewDelegate to communicate to the scrolling tree and nodes. It can also be
2246         used as a helper class by ScrollingTreeOverflowScrollingNodeIOS. For now, only the non-
2247         overriden member functions of ScrollingTreeOverflowScrollingNodeIOS are moved to that new
2248         class. In follow-up commits, WKOverflowScrollViewDelegate can become a generic
2249         ScrollViewDelegate and more code can be moved into the ScrollingTreeScrollingNodeDelegateIOS
2250         file. Frame scrolling nodes will then be able to share the same UI code as overflow:auto when
2251         iOS frame scrolling is implemented (bug 149264).
2252
2253         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h: Move non-overriden member
2254         functions and m_updatingFromStateNode into the delegate class. Also define a member to store
2255         that delegate.
2256         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: Use the node delegate to
2257         communicate to the scrolling tree and node.
2258         (-[WKOverflowScrollViewDelegate initWithScrollingTreeNodeDelegate:]): Init with a delegate.
2259         (-[WKOverflowScrollViewDelegate scrollViewDidScroll:]): Call the delegate function.
2260         (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]): Ditto.
2261         (-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
2262         Use the delegate functions or pass by ScrollingTreeScrollingNodeDelegateIOS::scrollingNode().
2263         (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): Use the delegate
2264         functions.
2265         (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]): Ditto.
2266         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::ScrollingTreeOverflowScrollingNodeIOS):
2267         Init the delegate for this class.
2268         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren): Use the delegate.
2269         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): Use the delegate
2270         function.
2271         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterDelegatedScroll): Ditto.
2272         (-[WKOverflowScrollViewDelegate initWithScrollingTreeNode:]): Deleted. This is renamed
2273         initWithScrollingTreeNodeDelegate and accepts a delegate.
2274         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll): Deleted. Moved
2275         to ScrollingTreeScrollingNodeDelegateIOS.
2276         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollWillStart): Ditto.
2277         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollDidEnd): Ditto.
2278         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewWillStartPanGesture): Ditto.
2279         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll): Ditto.
2280         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::currentSnapPointIndicesDidChange): Ditto.
2281         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h: Added. New delegate class
2282         for ScrollingTreeOverflowScrollingNodeIOS. The members used by WKOverflowScrollViewDelegate
2283         are public and the others are private. ScrollingTreeOverflowScrollingNodeIOS is a friend of
2284         ScrollingTreeScrollingNodeDelegateIOS so that it can access private members e.g.
2285         updateChildNodesAfterScroll() or  m_updatingFromStateNode.
2286         * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: Added.
2287         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::ScrollingTreeScrollingNodeDelegateIOS):
2288         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::~ScrollingTreeScrollingNodeDelegateIOS):
2289         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateChildNodesAfterScroll): Code extracted
2290         from ScrollingTreeOverflowScrollingNodeIOS.
2291         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollWillStart): Ditto.
2292         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollDidEnd): Ditto.
2293         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewWillStartPanGesture): Ditto.
2294         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollViewDidScroll): Ditto.
2295         (WebKit::ScrollingTreeScrollingNodeDelegateIOS::currentSnapPointIndicesDidChange): Ditto.
2296         * WebKit.xcodeproj/project.pbxproj: Add ScrollingTreeScrollingNodeDelegateIOS files to the
2297         build system.
2298
2299 2017-09-05  Wenson Hsieh  <wenson_hsieh@apple.com>
2300
2301         [iOS WK2] Add plumbing for WKContentView to ask the web process for additional drag items
2302         https://bugs.webkit.org/show_bug.cgi?id=176348
2303         Work towards <rdar://problem/31144674>
2304
2305         Reviewed by Tim Horton.
2306
2307         Adds boilerplate plumbing to request additional items to an existing session. This implements some UI-side logic
2308         in WKContentView to send an additional drag items request and handle a response from the web process. 
2309         To start, WebPageProxy::requestAdditionalItemsForDragSession is invoked by -_dragInteraction:
2310         itemsForAddingToSession:withTouchAtPoint:completion: in WKContentView, and the response from the web process is
2311         handled in -[WKContentView _didHandleAdditionalDragItemsRequest:].
2312
2313         * UIProcess/API/Cocoa/WKWebView.mm:
2314         (-[WKWebView _simulateItemsForAddingToSession:atLocation:completion:]):
2315         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2316
2317         Add SPI to simulate a request for additional drag items. See Tools/ChangeLog for more detail.
2318
2319         * UIProcess/PageClient.h:
2320         * UIProcess/WebPageProxy.h:
2321         * UIProcess/WebPageProxy.messages.in:
2322
2323         Add an IPC message handler for the additional drag items response from the web process.
2324
2325         * UIProcess/ios/DragDropInteractionState.h:
2326         (WebKit::DragDropInteractionState::BlockPtr<void):
2327         * UIProcess/ios/DragDropInteractionState.mm:
2328         (WebKit::DragDropInteractionState::shouldRequestAdditionalItemForDragSession const):
2329         (WebKit::DragDropInteractionState::dragSessionWillRequestAdditionalItem):
2330
2331         Invoke the new additional items completion handler when tearing down to avoid getting UIKit into a bad state.
2332
2333         (WebKit::DragDropInteractionState::dragAndDropSessionsDidEnd):
2334         * UIProcess/ios/PageClientImplIOS.h:
2335         * UIProcess/ios/PageClientImplIOS.mm:
2336         (WebKit::PageClientImpl::didHandleAdditionalDragItemsRequest):
2337         * UIProcess/ios/WKContentViewInteraction.h:
2338         * UIProcess/ios/WKContentViewInteraction.mm:
2339         (-[WKContentView _didHandleAdditionalDragItemsRequest:]):
2340         (-[WKContentView _itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:]):
2341
2342         Factors common logic to convert a staged WebItemProviderRegistrationInfoList and DragSourceState into a list of
2343         drag items, invoking the private UI delegate in the process. This is called both when starting a drag session,
2344         and adding items to an existing drag session.
2345
2346         (-[WKContentView _dragInteraction:itemsForAddingToSession:withTouchAtPoint:completion:]):
2347
2348         Implements a (proposed) additional drag item delegate that serves as an asynchronous alternative to the API
2349         variant, -_dragInteraction:itemsForAddingToSession:withTouchAtPoint:. See <rdar://problem/33146803> for more
2350         information.
2351
2352         (-[WKContentView dragInteraction:itemsForBeginningSession:]):
2353
2354         Refactored to use -_itemsForBeginningOrAddingToSessionWithRegistrationList:stagedDragSource:.
2355
2356         (-[WKContentView _simulateItemsForAddingToSession:atLocation:completion:]):
2357         * UIProcess/ios/WebPageProxyIOS.mm:
2358         (WebKit::WebPageProxy::didHandleAdditionalDragItemsRequest):
2359         (WebKit::WebPageProxy::requestAdditionalItemsForDragSession):
2360         * WebProcess/WebPage/WebPage.h:
2361         * WebProcess/WebPage/WebPage.messages.in:
2362
2363         Add an IPC message handler for the additional drag items request from the UI process.
2364
2365         * WebProcess/WebPage/ios/WebPageIOS.mm:
2366         (WebKit::WebPage::requestAdditionalItemsForDragSession):
2367
2368 2017-09-05  Alex Christensen  <achristensen@webkit.org>
2369
2370         Add WKUIDelegatePrivate equivalent of WKPageUIClient's mouseDidMoveOverElement
2371         https://bugs.webkit.org/show_bug.cgi?id=176428
2372         <rdar://problem/29270035>
2373
2374         Reviewed by Tim Horton.
2375
2376         Covered by a new API test.
2377
2378         * UIProcess/API/APIUIClient.h:
2379         (API::UIClient::mouseDidMoveOverElement):
2380         * UIProcess/API/C/WKPage.cpp:
2381         (WKPageSetPageUIClient):
2382         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2383         * UIProcess/Cocoa/UIDelegate.h:
2384         * UIProcess/Cocoa/UIDelegate.mm:
2385         (WebKit::UIDelegate::setDelegate):
2386         (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
2387         (WebKit::UIDelegate::UIClient::createNewPageCommon):
2388         (WebKit::UIDelegate::UIClient::runJavaScriptAlert):
2389         (WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
2390         (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
2391         (WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel):
2392         (WebKit::UIDelegate::UIClient::takeFocus):
2393         (WebKit::UIDelegate::UIClient::focus):
2394         (WebKit::UIDelegate::UIClient::unfocus):
2395         (WebKit::UIDelegate::UIClient::didExceedBackgroundResourceLimitWhileInForeground):
2396         (WebKit::UIDelegate::UIClient::didNotHandleWheelEvent):
2397         (WebKit::toNSEventModifierFlags):
2398         (WebKit::UIDelegate::UIClient::mouseDidMoveOverElement):
2399         (WebKit::UIDelegate::UIClient::toolbarsAreVisible):
2400         (WebKit::UIDelegate::UIClient::didClickAutoFillButton):
2401         (WebKit::UIDelegate::UIClient::handleAutoplayEvent):
2402         (WebKit::requestUserMediaAuthorizationForDevices):
2403         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
2404         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin):
2405         (WebKit::UIDelegate::UIClient::printFrame):
2406         (WebKit::UIDelegate::UIClient::close):
2407         (WebKit::UIDelegate::UIClient::fullscreenMayReturnToInline):
2408         (WebKit::UIDelegate::UIClient::didEnterFullscreen):
2409         (WebKit::UIDelegate::UIClient::didExitFullscreen):
2410         (WebKit::UIDelegate::UIClient::requestPointerLock):
2411         (WebKit::UIDelegate::UIClient::didLosePointerLock):
2412         (WebKit::UIDelegate::UIClient::hasVideoInPictureInPictureDidChange):
2413         * UIProcess/WebPageProxy.cpp:
2414         (WebKit::WebPageProxy::mouseDidMoveOverElement):
2415         * UIProcess/WebPageProxy.h:
2416
2417 2017-09-05  Brent Fulgham  <bfulgham@apple.com>
2418
2419         Relax keychain access to permit users to permanently allow client certificates
2420         https://bugs.webkit.org/show_bug.cgi?id=175857
2421         <rdar://problem/32293867>
2422
2423         Reviewed by Alex Christensen.
2424
2425         Further relax the write permissions on the user's Keychain directory to support local certificates.
2426
2427         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2428         * WebProcess/com.apple.WebProcess.sb.in:
2429
2430 2017-09-05  Youenn Fablet  <youenn@apple.com>
2431
2432         Cache Storage Engine should not mix different origin caches
2433         https://bugs.webkit.org/show_bug.cgi?id=176394
2434
2435         Reviewed by Alex Christensen.
2436
2437         * NetworkProcess/cache/CacheStorageEngine.cpp:
2438         (WebKit::CacheStorage::Engine::readCachesFromDisk): Initializing the salt before creating the Caches object
2439         so that its persistency path is correctly computed.
2440         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2441         (WebKit::CacheStorage::cachesRootPath): Setting origin as partition string.
2442
2443 2017-09-05  Brent Fulgham  <bfulgham@apple.com>
2444
2445         Use a single network storage session for stateless connections
2446         https://bugs.webkit.org/show_bug.cgi?id=176386
2447         <rdar://problem/34262148>
2448
2449         Reviewed by Alex Christensen.
2450
2451         Change the name of 'm_dataTaskMapWithoutCredentials' to 'm_dataTaskMapWithoutState'
2452         to reflect that the data tasks do not involve credential or cookie storage. Ditto for
2453         the change from 'm_sessionWIthoutCredentialStorage' to 'm_statelessSession'.
2454
2455         This update should not change behavior, unless some stateless sessions were depending
2456         on cookies to be persistent (which would be a bug!)
2457
2458         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2459         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Update for new variable names.
2460         (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa): Ditto.
2461         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
2462         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2463         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Update the configuration to block
2464         cookies as well.
2465         (WebKit::NetworkSessionCocoa::invalidateAndCancel): Update for new names.
2466         (WebKit::NetworkSessionCocoa::clearCredentials): Ditto.
2467         (WebKit::NetworkSessionCocoa::dataTaskForIdentifier): Ditto.
2468
2469 2017-09-05  Yousuke Kimoto  <yousuke.kimoto@sony.com>
2470
2471         [WinCairo] Add Network Process files for wincairo webkit
2472         https://bugs.webkit.org/show_bug.cgi?id=176069
2473
2474         Reviewed by Alex Christensen.
2475
2476         * NetworkProcess/Downloads/curl/DownloadCurl.cpp: Added.
2477         (WebKit::Download::resume):
2478         (WebKit::Download::platformDidFinish):
2479         (WebKit::Download::startNetworkLoadWithHandle):
2480         (WebKit::Download::startNetworkLoad):
2481         (WebKit::Download::platformInvalidate):
2482         * NetworkProcess/EntryPoint/win/NetworkProcessMain.cpp: Added.
2483         (main):
2484         * NetworkProcess/curl/NetworkProcessCurl.cpp: Added.
2485         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
2486         (WebKit::NetworkProcess::platformSetURLCacheSize):
2487         (WebKit::NetworkProcess::allowSpecificHTTPSCertificateForHost):
2488         (WebKit::NetworkProcess::clearCacheForAllOrigins):
2489         (WebKit::NetworkProcess::clearDiskCache):
2490         (WebKit::NetworkProcess::platformTerminate):
2491         * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp: Added.
2492         (WebKit::RemoteNetworkingContext::~RemoteNetworkingContext):
2493         (WebKit::RemoteNetworkingContext::isValid const):
2494         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
2495         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
2496         (WebKit::RemoteNetworkingContext::storageSession const):
2497         (WebKit::RemoteNetworkingContext::blockedError const):
2498         * NetworkProcess/win/NetworkProcessMainWin.cpp: Added.
2499         (WebKit::NetworkProcessMainWin):
2500         * NetworkProcess/win/NetworkProcessMainWin.h: Added.
2501         * NetworkProcess/win/SystemProxyWin.cpp: Added.
2502         (WindowsSystemProxy::getSystemHttpProxy):
2503         (WindowsSystemProxy::setCurlHttpProxy):
2504         (WindowsSystemProxy::parseProxyString):
2505         * NetworkProcess/win/SystemProxyWin.h: Added.
2506         * PlatformWin.cmake:
2507
2508 2017-09-05  Youenn Fablet  <youenn@apple.com>
2509
2510         Allow retrieving Cache Storage records for a given URL only
2511         https://bugs.webkit.org/show_bug.cgi?id=176202
2512
2513         Reviewed by Alex Christensen.
2514
2515         Update CacheStorageEngineCache to store records as a map URL -> Vector of Records.
2516         This allows regular record retrieval to be faster.
2517         Retrieval of all records is less efficient but this should happen less often.
2518
2519         * NetworkProcess/cache/CacheStorageEngine.cpp:
2520         (WebKit::CacheStorage::Engine::retrieveRecords):
2521         * NetworkProcess/cache/CacheStorageEngine.h:
2522         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
2523         (WebKit::CacheStorage::queryCache):
2524         (WebKit::CacheStorage::Cache::retrieveRecords const):
2525         (WebKit::CacheStorage::computeKeyURL):
2526         (WebKit::CacheStorage::Cache::addNewURLRecord):
2527         (WebKit::CacheStorage::Cache::recordsFromURL):
2528         (WebKit::CacheStorage::Cache::recordsFromURL const):
2529         (WebKit::CacheStorage::Cache::put):
2530         (WebKit::CacheStorage::Cache::remove):
2531         * NetworkProcess/cache/CacheStorageEngineCache.h:
2532         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
2533         (WebKit::CacheStorageEngineConnection::retrieveRecords):
2534         * NetworkProcess/cache/CacheStorageEngineConnection.h:
2535         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
2536         * WebProcess/Cache/WebCacheStorageConnection.cpp:
2537         (WebKit::WebCacheStorageConnection::doRetrieveRecords):
2538         * WebProcess/Cache/WebCacheStorageConnection.h:
2539
2540 2017-09-05  Youenn Fablet  <youenn@apple.com>
2541
2542         WebKitTestRunner should set the cache storage directory path
2543         https://bugs.webkit.org/show_bug.cgi?id=176373
2544
2545         Reviewed by Chris Dumez.
2546
2547         * UIProcess/API/C/WKContextConfigurationRef.cpp:
2548         (WKContextConfigurationCopyCacheStorageDirectory):
2549         (WKContextConfigurationSetCacheStorageDirectory):
2550         * UIProcess/API/C/WKContextConfigurationRef.h:
2551
2552 2017-09-05  Alex Christensen  <achristensen@webkit.org>
2553
2554         Add WKUIDelegatePrivate equivalent of WKPageUIClient's unavailablePluginButtonClicked
2555         https://bugs.webkit.org/show_bug.cgi?id=176274
2556         <rdar://problem/29270035>
2557
2558         Reviewed by Darin Adler.
2559
2560         * UIProcess/API/APIUIClient.h:
2561         (API::UIClient::unavailablePluginButtonClicked):
2562         * UIProcess/API/C/WKPage.cpp:
2563         (WKPageSetPageUIClient):
2564         * UIProcess/API/Cocoa/WKPreferences.mm:
2565         (-[WKPreferences _setPluginsEnabled:]):
2566         (-[WKPreferences _pluginsEnabled]):
2567         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2568         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2569         * UIProcess/Cocoa/UIDelegate.h:
2570         * UIProcess/Cocoa/UIDelegate.mm:
2571         (WebKit::UIDelegate::setDelegate):
2572         (WebKit::toWKPluginUnavailabilityReason):
2573         (WebKit::UIDelegate::UIClient::unavailablePluginButtonClicked):
2574         * UIProcess/WebPageProxy.cpp:
2575         (WebKit::WebPageProxy::unavailablePluginButtonClicked):
2576
2577 2017-09-04  Alex Christensen  <achristensen@webkit.org>
2578
2579         Allow classes to have modern and legacy decoders to aid transition
2580         https://bugs.webkit.org/show_bug.cgi?id=176186
2581
2582         Reviewed by Zan Dobersek.
2583
2584         To illustrate this, I made legacy and modern decoders to WTF::String and transitioned one String decoder.
2585
2586         * Platform/IPC/ArgumentCoder.h:
2587         * Platform/IPC/ArgumentCoders.cpp:
2588         (IPC::ArgumentCoder<String>::decode):
2589         * Platform/IPC/ArgumentCoders.h:
2590         * Platform/IPC/Decoder.h:
2591         * Shared/WebPageCreationParameters.cpp:
2592         (WebKit::WebPageCreationParameters::decode):
2593
2594 2017-09-05  Frederic Wang  <fwang@igalia.com>
2595
2596         Use TilesBacking for iframes when async frame scrolling is enabled
2597         https://bugs.webkit.org/show_bug.cgi?id=173644
2598
2599         Reviewed by Simon Fraser.
2600
2601         This patch adds creation of TilesBacking for non-main frames when async frame scrolling is
2602         enabled. RenderLayerBacking::m_isMainFrameLayerWithTiledBacking is also renamed to reflect
2603         that tiled backing is not exclusive to the main frame. More adjustments might be needed for
2604         non-main frames and will be handled in follow-up commits.
2605
2606         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
2607         (WebKit::RemoteLayerTreeDrawingArea::shouldUseTiledBackingForFrameView): Also use tiled
2608         backing when asyncFrameScrollingEnabled is true.
2609         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2610         (WebKit::TiledCoreAnimationDrawingArea::shouldUseTiledBackingForFrameView): Ditto.
2611
2612 2017-09-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2613
2614         [GTK] Rename PLUGIN_ARCHITECTURE(X11) as PLUGIN_ARCHITECTURE(UNIX)
2615         https://bugs.webkit.org/show_bug.cgi?id=176330
2616
2617         Reviewed by Michael Catanzaro.
2618
2619         It's no longer X11 specific since it's also used in Wayland when the X11 target is enabled. It should be renamed
2620         as UNIX and make it available when building the wayland target even if the X11 on is disabled.
2621
2622         * PlatformGTK.cmake:
2623         * PlatformWPE.cmake:
2624         * PluginProcess/unix/PluginProcessMainUnix.cpp:
2625         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
2626         (WebKit::NetscapePluginModule::tryLoad):
2627         * Shared/Plugins/Netscape/NetscapePluginModule.h:
2628         * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp: Renamed from Source/WebKit/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp.
2629         * UIProcess/Plugins/PluginProcessProxy.h:
2630         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
2631         (WebKit::PluginInfoCache::getPluginInfo):
2632         (WebKit::PluginInfoCache::updatePluginInfo):
2633         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
2634         (WebKit::PluginProcessProxy::scanPlugin):
2635         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2636         (WebKit::NPN_InvalidateRect):
2637         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2638         (WebKit::NetscapePlugin::initialize):
2639         (WebKit::NetscapePlugin::destroy):
2640         (WebKit::NetscapePlugin::geometryDidChange):
2641         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
2642         * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp:
2643         * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.h:
2644         * config.h:
2645
2646 2017-09-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2647
2648         [GTK] Wrong use of PLUGIN_ARCHITECTURE(X11) in several places
2649         https://bugs.webkit.org/show_bug.cgi?id=176329
2650
2651         Reviewed by Michael Catanzaro.
2652
2653         We are using PLUGIN_ARCHITECTURE(X11) in several places where we should actually be using PLATFORM(X11). This is
2654         confusing because PLUGIN_ARCHITECTURE(X11) is no longer specific to X11, it will be renamed as UNIX in a follow
2655         up patch. Because of this we only support plugins in Wayland when building with both X11 and Wayland targets
2656         enabled.
2657
2658         * PluginProcess/PluginControllerProxy.cpp:
2659         * PluginProcess/PluginControllerProxy.h:
2660         * PluginProcess/unix/PluginProcessMainUnix.cpp:
2661         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
2662         (WebKit::NetscapePluginModule::determineQuirks):
2663         * Shared/Plugins/PluginQuirks.h:
2664         * UIProcess/WebPageProxy.h:
2665         * UIProcess/WebPageProxy.messages.in:
2666         * UIProcess/gtk/WebPageProxyGtk.cpp:
2667         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2668         (WebKit::NPN_GetValue):
2669         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2670         (WebKit::NetscapePlugin::shouldLoadSrcURL):
2671         (WebKit::NetscapePlugin::initialize):
2672         * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp:
2673         (WebKit::NetscapePlugin::platformHandleMouseEvent):
2674         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
2675         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.h:
2676         * WebProcess/Plugins/PluginController.h:
2677         * WebProcess/Plugins/PluginProxy.cpp:
2678         * WebProcess/Plugins/PluginProxy.h:
2679         * WebProcess/Plugins/PluginProxy.messages.in:
2680         * WebProcess/Plugins/PluginView.cpp:
2681         * WebProcess/Plugins/PluginView.h:
2682
2683 2017-09-04  Wenson Hsieh  <wenson_hsieh@apple.com>
2684
2685         [iOS DnD] Refactor drag and drop logic in WKContentView in preparation for supporting multiple drag items in a drag session
2686         https://bugs.webkit.org/show_bug.cgi?id=176264
2687         <rdar://problem/31144674>
2688
2689         Reviewed by Darin Adler.
2690
2691         Move DataInteractionState from WKContentViewInteraction.h to DragDropInteractionState.h, and also rename it to
2692         DragDropInteractionState. Additionally, refactor drag and drop state in the UI process to capture metadata about
2693         the dragged element in a separate DragSourceState struct. This patch also moves drag and drop state transition
2694         logic that doesn't involve WKContentView internals out of WKContentView, and into the implementation of
2695         DragDropInteractionState.
2696
2697         To support multiple drag items per session, we also introduce a simple mechanism to trace a UIDragItem back to
2698         the DragSourceState used to generate it. When generating a DragSourceState, we assign it a unique identifier,
2699         which we also set as the privateLocalContext of all UIDragItems generated when beginning the drag (this
2700         includes drag items returned by an internal client that uses one of the SPI hooks to augment drag items when
2701         starting a drag). This is subsequently used in the implementation of lift and cancellation preview delegate
2702         methods to supply the appropriate drag preview for each UIDragItem.
2703
2704         Lastly, fix a bug wherein the pageX and pageY of mouse drag events are inconsistent with other synthetic mouse
2705         events, such as synthetic clicks. For synthetic clicks, the PlatformMouseEvent is initialized with the same
2706         position and globalPosition. Whether this is really intended is unclear (see http://webkit.org/b/173855), but
2707         it's a trivial change for now to keep mouse events on iOS consistent by tweaking the behavior during drag and
2708         drop. See Tools/ChangeLog for some more information.
2709
2710         * Platform/spi/ios/UIKitSPI.h:
2711
2712         Add -[UIDragItem privateLocalContext].
2713
2714         * UIProcess/ios/DragDropInteractionState.h: Added.
2715         (WebKit::DragDropInteractionState::stagedDragSource const):
2716         (WebKit::DragDropInteractionState::dropSessionDidExit):
2717         (WebKit::DragDropInteractionState::dropSessionWillPerformDrop):
2718         (WebKit::DragDropInteractionState::adjustedPositionForDragEnd const):
2719         (WebKit::DragDropInteractionState::didBeginDragging const):
2720         (WebKit::DragDropInteractionState::isPerformingDrop const):
2721         (WebKit::DragDropInteractionState::dragSession const):
2722         (WebKit::DragDropInteractionState::dropSession const):
2723
2724         Wrap private drag/drop state member variables behind const getters, and move drag and drop logic that involves
2725         only the DragDropInteractionState into helper methods on DragDropInteractionState.
2726
2727         (WebKit::DragDropInteractionState::BlockPtr<void):
2728         * UIProcess/ios/DragDropInteractionState.mm: Added.
2729         (WebKit::dragItemMatchingIdentifier):
2730         (WebKit::createTargetedDragPreview):
2731         (WebKit::uiImageForImage):
2732
2733         Move drag preview creation logic here, from WKContentViewInteraction.mm.
2734
2735         (WebKit::shouldUseTextIndicatorToCreatePreviewForDragAction):
2736         (WebKit::DragDropInteractionState::activeDragSourceForItem const):
2737         (WebKit::DragDropInteractionState::anyActiveDragSourceIs const):
2738         (WebKit::DragDropInteractionState::prepareForDragSession):
2739         (WebKit::DragDropInteractionState::dragSessionWillBegin):
2740         (WebKit::DragDropInteractionState::previewForDragItem const):
2741         (WebKit::DragDropInteractionState::dragSessionWillDelaySetDownAnimation):
2742         (WebKit::DragDropInteractionState::dropSessionDidEnterOrUpdate):
2743         (WebKit::DragDropInteractionState::stageDragItem):
2744         (WebKit::DragDropInteractionState::hasStagedDragSource const):
2745         (WebKit::DragDropInteractionState::clearStagedDragSource):
2746         (WebKit::DragDropInteractionState::dragAndDropSessionsDidEnd):
2747         (WebKit::DragDropInteractionState::updatePreviewsForActiveDragSources):
2748         * UIProcess/ios/WKContentViewInteraction.h:
2749
2750         Move drag-and-drop-related state tied to the WKContentView here, from DataInteractionState (for instance, the
2751         UIView for the drop caret, the WKContentView snapshot when dropping, and a flag use to keep track of hiding the
2752         callout bar when dragging a text selection).
2753
2754         (): Deleted.
2755         * UIProcess/ios/WKContentViewInteraction.mm:
2756         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
2757         (-[WKContentView actionSheetAssistant:showCustomSheetForElement:]):
2758         (-[WKContentView _didChangeDragInteractionPolicy]):
2759         (-[WKContentView setupDataInteractionDelegates]):
2760         (-[WKContentView teardownDataInteractionDelegates]):
2761         (-[WKContentView _startDrag:item:]):
2762         (-[WKContentView _didHandleStartDataInteractionRequest:]):
2763         (-[WKContentView computeClientAndGlobalPointsForDropSession:outClientPoint:outGlobalPoint:]):
2764         (-[WKContentView cleanUpDragSourceSessionState]):
2765         (-[WKContentView _didConcludeEditDataInteraction:]):
2766         (-[WKContentView _didPerformDataInteractionControllerOperation:]):
2767         (-[WKContentView _didChangeDataInteractionCaretRect:currentRect:]):
2768         (-[WKContentView currentDragOrDropSession]):
2769         (-[WKContentView _restoreCalloutBarIfNeeded]):
2770         (-[WKContentView _dragInteraction:prepareForSession:completion:]):
2771         (-[WKContentView dragInteraction:itemsForBeginningSession:]):
2772         (-[WKContentView dragInteraction:previewForLiftingItem:session:]):
2773         (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]):
2774         (-[WKContentView dragInteraction:sessionWillBegin:]):
2775         (-[WKContentView dragInteraction:session:didEndWithOperation:]):
2776         (-[WKContentView dragInteraction:previewForCancellingItem:withDefault:]):
2777         (-[WKContentView _dragInteraction:item:shouldDelaySetDownAnimationWithCompletion:]):
2778         (-[WKContentView dragInteraction:item:willAnimateCancelWithAnimator:]):
2779         (-[WKContentView dropInteraction:sessionDidEnter:]):
2780         (-[WKContentView dropInteraction:sessionDidUpdate:]):
2781         (-[WKContentView dropInteraction:sessionDidExit:]):
2782         (-[WKContentView dropInteraction:performDrop:]):
2783         (-[WKContentView dropInteraction:sessionDidEnd:]):
2784
2785         Pull out logic that mutates drag and drop state into DragDropInteractionState. Adjust places that previously
2786         accessed DataInteractionState's members directly with corresponding getters in DragDropInteractionState.
2787
2788         (-[WKContentView _simulateDataInteractionEntered:]):
2789         (-[WKContentView _simulateDataInteractionUpdated:]):
2790         (-[WKContentView _simulateDataInteractionEnded:]):
2791         (-[WKContentView _simulateDataInteractionPerformOperation:]):
2792         (-[WKContentView _simulateDataInteractionSessionDidEnd:]):
2793         (-[WKContentView _simulateWillBeginDataInteractionWithSession:]):
2794         (-[WKContentView _simulatedItemsForSession:]):
2795         (-[WKContentView _simulatePrepareForDataInteractionSession:completion:]):
2796
2797         Rename _dataInteraction => _dragInteraction and _dataOperation => _dropInteraction.
2798
2799         (uiImageForImage): Deleted.
2800         (shouldUseTextIndicatorToCreatePreviewForDragAction): Deleted.
2801         (-[WKContentView dragPreviewForImage:frameInRootViewCoordinates:clippingRectsInFrameCoordinates:backgroundColor:]): Deleted.
2802         (-[WKContentView dragPreviewForCurrentDataInteractionState]): Deleted.
2803         (-[WKContentView _transitionDragPreviewToImageIfNecessary:]): Deleted.
2804         * WebKit.xcodeproj/project.pbxproj:
2805
2806 2017-09-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2807
2808         [Threaded Compositor] Deadlock in ThreadedDisplayRefreshMonitor
2809         https://bugs.webkit.org/show_bug.cgi?id=176296
2810
2811         Reviewed by Žan Doberšek.
2812
2813         The main thread tries to schedule a display refresh monitor from RAF, requestDisplayRefreshMonitorUpdate() tries
2814         to take the attributes lock to update coordinateUpdateCompletionWithClient. The compositing thread has finished
2815         a frame and sceneUpdateFinished() takes the attributes lock to update clientRendersNextFrame and then asks the
2816         display refresh monitor if it requires a new callback. ThreadedDisplayRefreshMonitor::requiresDisplayRefreshCallback()
2817         takes its lock to check the state, and requestDisplayRefreshMonitorUpdate() was called by
2818         ThreadedDisplayRefreshMonitor::requestRefreshCallback() with the display refresh monitor lock taken. So,
2819         the compositing thread has the attributes lock and wants the display refresh monitor one, and main thread has the
2820         display refresh monitor lock and wants the attributes one.
2821
2822         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
2823         (WebKit::ThreadedDisplayRefreshMonitor::requestRefreshCallback): Release the mutex before calling
2824         ThreadedCompositor::requestDisplayRefreshMonitorUpdate().
2825
2826 2017-09-03  Zan Dobersek  <zdobersek@igalia.com>
2827
2828         [GTK] Libgcrypt warning: missing initialization - please fix the application
2829         https://bugs.webkit.org/show_bug.cgi?id=171230
2830
2831         Reviewed by Michael Catanzaro.
2832
2833         Replicate the libgcrypt initialization in the NetworkProcess entrypoint.
2834         This is required due to libgcrypt being used through digest operations
2835         originating from the certificate hash computation in SoupNetworkSession.
2836
2837         The initialization is moved to the PAL library, and the initialize()
2838         function is now leveraged in both NetworkProcess and WebProcess entrypoints.
2839
2840         * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
2841         (main):
2842         * WebProcess/EntryPoint/unix/WebProcessMain.cpp:
2843         (main):
2844
2845 2017-09-03  Zan Dobersek  <zdobersek@igalia.com>
2846
2847         [WPE] Use the device scale factor value in WebPageCreationParameters
2848         https://bugs.webkit.org/show_bug.cgi?id=175377
2849
2850         Reviewed by Michael Catanzaro.
2851
2852         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2853         (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea):
2854         WebPageCreationParameters::deviceScaleFactor value should be used
2855         to set the device scale factor on the given WebPage object. This
2856         enables correctly leveraging the scale factor for the WPE port
2857         which enters accelerated mode unconditionally and as such doesn't
2858         wait for the backing store update that would provide that value
2859         otherwise.
2860
2861 2017-09-03  Brent Fulgham  <bfulgham@apple.com>
2862
2863         [WK2][iOS] Remove unnecessary IOHIDEventServiceFastPathUserClient access
2864         https://bugs.webkit.org/show_bug.cgi?id=175947
2865         <rdar://problem/33353627>
2866
2867         Reviewed by Darin Adler.
2868
2869         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2870
2871 2017-09-03  Dan Bernstein  <mitz@apple.com>
2872
2873         WKContentViewInteraction.mm includes redundant declaration of UIPreviewItemController's presentationSecondaryGestureRecognizer
2874         https://bugs.webkit.org/show_bug.cgi?id=176322
2875
2876         Reviewed by Darin Adler.
2877
2878         * UIProcess/ios/WKContentViewInteraction.mm: Removed the declaration, which is already made in the
2879           SDK or in UIKitSPI.h.
2880
2881 2017-09-03  Timothy Horton  <timothy_horton@apple.com>
2882
2883         Try to fix the iOS build
2884
2885         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
2886         (-[WKRemoteView initWithFrame:contextID:]):
2887
2888 2017-09-03  Tim Horton  <timothy_horton@apple.com>
2889
2890         Fix some style issues in the Remote Layer Tree code
2891         https://bugs.webkit.org/show_bug.cgi?id=176298
2892
2893         Reviewed by Dan Bernstein.
2894
2895         In bugs 176273 and 176297, the style bot noticed some existing style
2896         issues in the UI-side compositing code. Fix them, because there aren't
2897         many and they're straightforward.
2898
2899         * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
2900         * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.h:
2901         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
2902         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.h:
2903         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
2904         * UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.h:
2905         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
2906         * UIProcess/RemoteLayerTree/RemoteScrollingTree.h:
2907         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
2908         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2909
2910 2017-09-03  Yusuke Suzuki  <utatane.tea@gmail.com>
2911
2912         String#utf8() allocates new CString
2913         https://bugs.webkit.org/show_bug.cgi?id=176302
2914
2915         Reviewed by Sam Weinig.
2916
2917         * NetworkProcess/webrtc/NetworkRTCSocket.cpp:
2918         (WebKit::NetworkRTCSocket::sendTo):
2919
2920 2017-09-03  Tim Horton  <timothy_horton@apple.com>
2921
2922         Move shared part of the Remote Layer Tree code out of a Mac-specific directory
2923         https://bugs.webkit.org/show_bug.cgi?id=176297
2924
2925         Reviewed by Dan Bernstein.
2926
2927         UI-side compositing works on all Cocoa platforms, so the code should
2928         not live inside Mac/. Also merge the Scrolling directory in here,
2929         since those files are very related.
2930
2931         * PlatformMac.cmake:
2932         * Shared/RemoteLayerTree/RemoteLayerBackingStore.h: Renamed from Shared/mac/RemoteLayerBackingStore.h.
2933         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm: Renamed from Shared/mac/RemoteLayerBackingStore.mm.
2934         * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.h: Renamed from Shared/mac/RemoteLayerBackingStoreCollection.h.
2935         * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.mm: Renamed from Shared/mac/RemoteLayerBackingStoreCollection.mm.
2936         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h: Renamed from Shared/mac/RemoteLayerTreePropertyApplier.h.
2937         * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm: Renamed from Shared/mac/RemoteLayerTreePropertyApplier.mm.
2938         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: Renamed from Shared/mac/RemoteLayerTreeTransaction.h.
2939         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm: Renamed from Shared/mac/RemoteLayerTreeTransaction.mm.
2940         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp: Renamed from Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp.
2941         * Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.h: Renamed from Shared/Scrolling/RemoteScrollingCoordinatorTransaction.h.
2942         * WebKit.xcodeproj/project.pbxproj:
2943
2944 2017-09-03  Sam Weinig  <sam@webkit.org>
2945
2946         Remove CanvasProxy
2947         https://bugs.webkit.org/show_bug.cgi?id=176288
2948
2949         Reviewed by Yusuke Suzuki.
2950
2951         CanvasProxy does not appear to be in any current HTML spec
2952         and was disabled and unimplemented in our tree. Time to 
2953         get rid of it.
2954
2955         * Configurations/FeatureDefines.xcconfig:
2956
2957 2017-09-02  Andy Estes  <aestes@apple.com>
2958
2959         [CA] Upstream QuartzCore-related WebKitSystemInterface functions
2960         https://bugs.webkit.org/show_bug.cgi?id=176270
2961
2962         Reviewed by Tim Horton.
2963
2964         * Platform/mac/LayerHostingContext.mm:
2965         (WebKit::LayerHostingContext::createForPort):
2966         (WebKit::LayerHostingContext::createForExternalHostingProcess):
2967         * UIProcess/mac/PageClientImpl.mm:
2968         (WebKit::PageClientImpl::enterAcceleratedCompositingMode):
2969         (WebKit::PageClientImpl::updateAcceleratedCompositingMode):
2970         * UIProcess/mac/RemoteLayerTreeHost.mm:
2971         (WebKit::RemoteLayerTreeHost::createLayer):
2972         * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:
2973         (WebKit::makeRenderLayer):
2974         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2975         (InitWebCoreSystemInterface):
2976
2977 2017-09-02  Tim Horton  <timothy_horton@apple.com>
2978
2979         Move UI Process part of the Remote Layer Tree code out of a Mac-specific directory
2980         https://bugs.webkit.org/show_bug.cgi?id=176273
2981
2982         Reviewed by Dan Bernstein.
2983
2984         UI-side compositing works on all Cocoa platforms, so the code should
2985         not live inside Mac/. Also merge the Scrolling directory in here,
2986         since those files are very related.
2987
2988         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h: Renamed from SourceebKit/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h.
2989         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in: Renamed from UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.messages.in.
2990         * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: Renamed from UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm.
2991         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h: Renamed from UIProcess/mac/RemoteLayerTreeHost.h.
2992         * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm: Renamed from UIProcess/mac/RemoteLayerTreeHost.mm.
2993         * UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.h: Renamed from UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.h.
2994         * UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.mm: Renamed from UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.mm.
2995         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: Renamed from UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp.
2996         * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: Renamed from UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h.
2997         * UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp: Renamed from UIProcess/Scrolling/RemoteScrollingTree.cpp.
2998         * UIProcess/RemoteLayerTree/RemoteScrollingTree.h: Renamed from UIProcess/Scrolling/RemoteScrollingTree.h.
2999         * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm: Renamed from UIProcess/ios/RemoteLayerTreeHostIOS.mm.
3000         * UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm: Renamed from UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm.
3001         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h: Renamed from UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h.
3002         * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: Renamed from UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm.
3003         * WebKit.xcodeproj/project.pbxproj:
3004
3005 2017-09-02  Joseph Pecoraro  <pecoraro@apple.com>
3006
3007         Web Automation: -[_WKAutomationSession init] leaks
3008         https://bugs.webkit.org/show_bug.cgi?id=176268
3009
3010         Reviewed by Darin Adler.
3011
3012         * UIProcess/API/Cocoa/_WKAutomationSession.mm:
3013         (-[_WKAutomationSession init]):
3014
3015 2017-09-02  Tim Horton  <timothy_horton@apple.com>
3016
3017         Fix some style issues in the Web Process part of the Remote Layer Tree code
3018         https://bugs.webkit.org/show_bug.cgi?id=176272
3019
3020         Reviewed by Dan Bernstein.
3021
3022         In bug 176271, the style bot noticed some existing style issues in the UI-side
3023         compositing code. Fix them, because there aren't many and they're straightforward.
3024
3025         * WebProcess/WebPage/Cocoa/RemoteLayerTree/GraphicsLayerCARemote.cpp:
3026         * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCAAnimationRemote.h:
3027         * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCAAnimationRemote.mm:
3028         (WebKit::PlatformCAAnimationRemote::setValues):
3029         * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCALayerRemote.cpp:
3030         (WebKit::PlatformCALayerRemote::appendSublayer):
3031         (WebKit::PlatformCALayerRemote::insertSublayer):
3032         (WebKit::PlatformCALayerRemote::replaceSublayer):
3033         * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCALayerRemote.h:
3034         * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCALayerRemoteCustom.mm:
3035         (WebKit::PlatformCALayerRemoteCustom::clone const):
3036         * WebProcess/WebPage/Cocoa/RemoteLayerTree/PlatformCALayerRemoteTiledBacking.h:
3037         * WebProcess/WebPage/Cocoa/RemoteLayerTree/RemoteLayerTreeContext.h:
3038         * WebProcess/WebPage/Cocoa/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
3039         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3040         * WebProcess/WebPage/Cocoa/RemoteLayerTree/RemoteScrollingCoordinator.h:
3041         * WebProcess/WebPage/Cocoa/RemoteLayerTree/RemoteScrollingCoordinator.mm:
3042
3043 2017-09-02  Tim Horton  <timothy_horton@apple.com>
3044
3045         Move Web Process part of the Remote Layer Tree code out of a Mac-specific directory
3046         https://bugs.webkit.org/show_bug.cgi?id=176271
3047
3048         Rubber-stamped by Dan Bernstein.
3049
3050         UI-side compositing works on all Cocoa platforms, so the code should
3051         not live inside Mac/. Also merge the Scrolling directory in here,
3052         since those files are very related.
3053
3054         * WebKit.xcodeproj/project.pbxproj:
3055         * DerivedSources.make:
3056         * PlatformMac.cmake:
3057         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.cpp: Renamed from WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp.
3058         * WebProcess/WebPage/RemoteLayerTree/GraphicsLayerCARemote.h: Renamed from WebProcess/WebPage/mac/GraphicsLayerCARemote.h.
3059         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h: Renamed from WebProcess/WebPage/mac/PlatformCAAnimationRemote.h.
3060         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm: Renamed from WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm.
3061         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemote.cpp.
3062         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemote.h.
3063         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.h: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h.
3064         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteCustom.mm: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm.
3065         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteTiledBacking.cpp: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp.
3066         * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemoteTiledBacking.h: Renamed from WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h.
3067         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h: Renamed from WebProcess/WebPage/mac/RemoteLayerTreeContext.h.
3068         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm: Renamed from WebProcess/WebPage/mac/RemoteLayerTreeContext.mm.
3069         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h: Renamed from WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.h.
3070         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm: Renamed from WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.mm.
3071         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: Renamed from WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h.
3072         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: Renamed from WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm.
3073         * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.h: Renamed from WebProcess/Scrolling/RemoteScrollingCoordinator.h.
3074         * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.messages.in: Renamed from WebProcess/Scrolling/RemoteScrollingCoordinator.messages.in.
3075         * WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm: Renamed from WebProcess/Scrolling/RemoteScrollingCoordinator.mm.
3076
3077 2017-09-02  Carlos Garcia Campos  <cgarcia@igalia.com>
3078
3079         [GTK][Wayland] Use fast malloc to allocate backing store cairo surfaces data
3080         https://bugs.webkit.org/show_bug.cgi?id=176226
3081
3082         Reviewed by Michael Catanzaro.
3083
3084         Do not create the cairo surface for BackingStoreBackendCairoImpl. When not using X11 we are going to use an
3085         image surface anyway, so we don't really need to use the create similar. This way we only need to pass the size
3086         and device scale factor to BackingStoreBackendCairoImpl that will create the image surface using fast malloc to
3087         allocate the data.
3088
3089         * UIProcess/cairo/BackingStoreCairo.cpp:
3090         (WebKit::BackingStore::createBackend):
3091
3092 2017-09-02  Carlos Garcia Campos  <cgarcia@igalia.com>
3093
3094         [GTK][Wayland] Opening FedoraProject's pastebin chews CPU
3095         https://bugs.webkit.org/show_bug.cgi?id=175942
3096
3097         Reviewed by Žan Doberšek.
3098
3099         This regressed when we introduced the display refresh monitor. The monitor schedules updates immediately,
3100         because we removed the option to not do frame sync in X11 to let swapBuffers do the throttling, but that's
3101         not happening in Wayland because the nested compositor is dispatching frame callbacks on surface commit.
3102         We need to ensure that frame callbacks are dispatched on every monitor refresh, because swapBuffers waits for
3103         frame callbacks to be queued on display.
3104
3105         * UIProcess/gtk/WaylandCompositor.cpp:
3106         (WebKit::WaylandCompositor::Surface::~Surface): Destroy pending frame callbacks too.
3107         (WebKit::WaylandCompositor::Surface::setWebPage): Add a tick callback to the web view widget to flush all
3108         committed frame callbacks on every frame update.
3109         (WebKit::WaylandCompositor::Surface::requestFrame): Add the callbacks to m_pendingFrameCallbackList.
3110         (WebKit::WaylandCompositor::Surface::flushFrameCallbacks): Dispatch all committed frame callabcks.
3111         (WebKit::WaylandCompositor::Surface::flushPendingFrameCallbacks): Dispatch all pending frame callbacks.
3112         (WebKit::WaylandCompositor::Surface::commit): Do not dispatch frame callbacks here, move them to the list of
3113         committed frame callbacks that will be dispatched on the next frame clock update.
3114         * UIProcess/gtk/WaylandCompositor.h:
3115         (WebKit::WaylandCompositor::Surface::setWebPage): Moved to the cpp.
3116         * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.cpp:
3117         (WebKit::AcceleratedSurfaceWayland::AcceleratedSurfaceWayland): Move surface initialization and destruction to
3118         the compositing thread.
3119         (WebKit::AcceleratedSurfaceWayland::initialize):
3120         (WebKit::AcceleratedSurfaceWayland::finalize):
3121         (WebKit::AcceleratedSurfaceWayland::~AcceleratedSurfaceWayland): Deleted.
3122         * WebProcess/WebPage/gtk/AcceleratedSurfaceWayland.h:
3123
3124 2017-09-01  Youenn Fablet  <youenn@apple.com>
3125
3126         Do not Reject CacheStorage promises when updating the persistent filesystem data fails
3127         https://bugs.webkit.org/show_bug.cgi?id=176241
3128
3129         Reviewed by Alex Christensen.
3130
3131         Open/Remove caches may succeed in the memory representation but the write-to-disk operation may fail.
3132         In that case, the callback does not return an error but a value containing the cache identifier.
3133         The value will also contain a boolean flag set to true to notify the client that persistent storage failed this time.
3134
3135         * NetworkProcess/cache/CacheStorageEngine.cpp:
3136         (WebKit::CacheStorage::Engine::open):
3137         (WebKit::CacheStorage::Engine::remove):
3138         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3139         (WebKit::CacheStorage::Caches::open):
3140         (WebKit::CacheStorage::Caches::remove):
3141         * NetworkProcess/cache/CacheStorageEngineCaches.h:
3142
3143 2017-09-01  Alex Christensen  <achristensen@webkit.org>
3144
3145         Add WKUIDelegatePrivate equivalent of WKPageUIClient's toolbarsAreVisible
3146         https://bugs.webkit.org/show_bug.cgi?id=176246
3147         <rdar://problem/29270035>
3148
3149         Reviewed by Tim Horton.
3150
3151         * UIProcess/API/APIUIClient.h:
3152         (API::UIClient::toolbarsAreVisible):
3153         * UIProcess/API/C/WKPage.cpp:
3154         (WKPageSetPageUIClient):
3155         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3156         * UIProcess/Cocoa/UIDelegate.h:
3157         * UIProcess/Cocoa/UIDelegate.mm:
3158         (WebKit::UIDelegate::setDelegate):
3159         (WebKit::UIDelegate::UIClient::toolbarsAreVisible):
3160         * UIProcess/WebPageProxy.cpp:
3161         (WebKit::WebPageProxy::getToolbarsAreVisible):
3162         * UIProcess/WebPageProxy.h:
3163         * UIProcess/WebPageProxy.messages.in:
3164
3165 2017-09-01  Alex Christensen  <achristensen@webkit.org>
3166
3167         Make PageClientImplCocoa a proper superclass of PageClientImpls for Mac and iOS
3168         https://bugs.webkit.org/show_bug.cgi?id=176239
3169
3170         Reviewed by Tim Horton.
3171
3172         * UIProcess/Cocoa/PageClientImplCocoa.h: Added.
3173         (WebKit::PageClientImplCocoa::PageClientImplCocoa):
3174         * UIProcess/Cocoa/PageClientImplCocoa.mm:
3175         (WebKit::PageClientImplCocoa::isPlayingAudioWillChange):
3176         (WebKit::PageClientImplCocoa::isPlayingAudioDidChange):
3177         (WebKit::PageClientImpl::isPlayingAudioWillChange): Deleted.
3178         (WebKit::PageClientImpl::isPlayingAudioDidChange): Deleted.
3179         * UIProcess/Cocoa/WebViewImpl.mm:
3180         * UIProcess/ios/PageClientImplIOS.h:
3181         * UIProcess/ios/PageClientImplIOS.mm:
3182         (WebKit::PageClientImpl::PageClientImpl):
3183         * UIProcess/mac/PageClientImpl.h: Removed.
3184         * UIProcess/mac/PageClientImpl.mm: Removed.
3185         * UIProcess/mac/PageClientImplMac.h: Copied from Source/WebKit/UIProcess/mac/PageClientImpl.h.
3186         * UIProcess/mac/PageClientImplMac.mm: Copied from Source/WebKit/UIProcess/mac/PageClientImpl.mm.
3187         (WebKit::PageClientImpl::PageClientImpl):
3188         * UIProcess/mac/WebContextMenuProxyMac.mm:
3189         * UIProcess/mac/WebPageProxyMac.mm:
3190         * UIProcess/mac/WebPopupMenuProxyMac.mm:
3191         * WebKit.xcodeproj/project.pbxproj:
3192
3193 2017-09-01  Alex Christensen  <achristensen@webkit.org>
3194
3195         Replace WKUIDelegatePrivate's isPlayingMediaDidChange with KVO _isPlayingAudio on WKWebView
3196         https://bugs.webkit.org/show_bug.cgi?id=176212
3197
3198         Reviewed by Tim Horton.
3199
3200         Dan suggested this in bug 176203, I think it's a good idea,
3201         and I'll need to add more KVO properties soon anyways so I'd better learn how.
3202         Determining if audio playing changed is important for Safari, so WKPageUIClient's
3203         isPlayingAudioDidChange was correctly named but incorrectly fired if either audio
3204         or video playing changed and had you check if audio was playing, possibly too often.
3205
3206         * UIProcess/API/APIUIClient.h:
3207         (API::UIClient::isPlayingMediaDidChange):
3208         * UIProcess/API/C/WKPage.cpp:
3209         (WKPageSetPageUIClient):
3210         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3211         * UIProcess/API/Cocoa/WKWebView.mm:
3212         (-[WKWebView _isPlayingAudio]):
3213         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3214         * UIProcess/API/glib/WebKitUIClient.cpp:
3215         * UIProcess/Cocoa/UIDelegate.h:
3216         * UIProcess/Cocoa/UIDelegate.mm:
3217         (WebKit::UIDelegate::setDelegate):
3218         (WebKit::UIDelegate::UIClient::isPlayingMediaDidChange): Deleted.
3219         * UIProcess/Cocoa/WebViewImpl.h:
3220         * UIProcess/Cocoa/WebViewImpl.mm:
3221         (WebKit::WebViewImpl::isPlayingAudioWillChange):
3222         (WebKit::WebViewImpl::isPlayingAudioDidChange):
3223         * UIProcess/PageClient.h:
3224         * UIProcess/WebPageProxy.cpp:
3225         (WebKit::WebPageProxy::isPlayingMediaDidChange):
3226         * UIProcess/mac/PageClientImpl.h:
3227         * UIProcess/mac/PageClientImpl.mm:
3228         (WebKit::PageClientImpl::isPlayingAudioDidChange):
3229         (WebKit::PageClientImpl::isPlayingAudioWillChange):
3230
3231 2017-09-01  Alex Christensen  <achristensen@webkit.org>
3232
3233         Disable ObjC WebGL policy SPI on iOS
3234         https://bugs.webkit.org/show_bug.cgi?id=176233
3235
3236         Reviewed by Tim Horton.
3237         
3238         In r221465 I uploaded new SPI that is only needed on Mac with a beautiful test that only works on Mac.
3239         Since it fails on iOS and is not needed on iOS, let's just disable it on iOS.
3240
3241         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3242         * UIProcess/Cocoa/NavigationState.h:
3243         * UIProcess/Cocoa/NavigationState.mm:
3244         (WebKit::NavigationState::setNavigationDelegate):
3245
3246 2017-09-01  Andy Estes  <aestes@apple.com>
3247
3248         [CG] Upstream CoreGraphics-related WebKitSystemInterface functions
3249         https://bugs.webkit.org/show_bug.cgi?id=176200
3250
3251         Reviewed by Tim Horton.
3252
3253         * PluginProcess/mac/PluginProcessMac.mm:
3254         (WebKit::PluginProcess::platformInitializeProcess):
3255         * UIProcess/mac/WindowServerConnection.h:
3256         * UIProcess/mac/WindowServerConnection.mm:
3257         (WebKit::registerOcclusionNotificationHandler):
3258         (WebKit::WindowServerConnection::WindowServerConnection):
3259         (WebKit::WindowServerConnection::applicationWindowModificationsStarted): Deleted.
3260         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3261         (InitWebCoreSystemInterface):
3262
3263 2017-09-01  Per Arne Vollan  <pvollan@apple.com>
3264
3265         [Win] Compile error, 'Cache' is not declared.
3266         https://bugs.webkit.org/show_bug.cgi?id=176062
3267
3268         Reviewed by Youenn Fablet.
3269
3270         Rename DOMCache to DOMCacheEngine.
3271
3272         * NetworkProcess/cache/CacheStorageEngine.cpp:
3273         (WebKit::CacheStorage::Engine::queryCache):
3274         (WebKit::CacheStorage::Engine::writeFile):
3275         * NetworkProcess/cache/CacheStorageEngine.h:
3276         * NetworkProcess/cache/CacheStorageEngineCache.h:
3277         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3278         (WebKit::CacheStorage::Caches::initialize):
3279         * NetworkProcess/cache/CacheStorageEngineCaches.h:
3280         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
3281         * NetworkProcess/cache/CacheStorageEngineConnection.h:
3282         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
3283         * Shared/WebCoreArgumentCoders.cpp:
3284         (IPC::ArgumentCoder<DOMCacheEngine::CacheInfo>::encode):
3285         (IPC::ArgumentCoder<DOMCacheEngine::CacheInfo>::decode):
3286         (IPC::ArgumentCoder<DOMCacheEngine::Record>::encode):
3287         (IPC::ArgumentCoder<DOMCacheEngine::Record>::decode):
3288         (IPC::ArgumentCoder<DOMCache::CacheInfo>::encode): Deleted.
3289         (IPC::ArgumentCoder<DOMCache::CacheInfo>::decode): Deleted.
3290         (IPC::ArgumentCoder<DOMCache::Record>::encode): Deleted.
3291         (IPC::ArgumentCoder<DOMCache::Record>::decode): Deleted.
3292         * Shared/WebCoreArgumentCoders.h:
3293         * WebProcess/Cache/WebCacheStorageConnection.cpp:
3294         * WebProcess/Cache/WebCacheStorageConnection.h:
3295         * WebProcess/Cache/WebCacheStorageConnection.messages.in:
3296
3297 2017-08-31  Andy Estes  <aestes@apple.com>
3298
3299         [Mac] Upstream AppKit-related WebKitSystemInterface functions
3300         https://bugs.webkit.org/show_bug.cgi?id=176175
3301
3302         Reviewed by Brady Eidson.
3303
3304         * PluginProcess/mac/PluginProcessMac.mm:
3305         (WebKit::initializeCocoaOverrides):
3306         * Shared/mac/WebEventFactory.mm:
3307         (WebKit::WebEventFactory::createWebWheelEvent):
3308         (WebKit::WebEventFactory::createWebKeyboardEvent):
3309         * UIProcess/mac/WKTextInputWindowController.mm:
3310         (-[WKTextInputPanel init]):
3311         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3312         (InitWebCoreSystemInterface):
3313
3314 2017-08-31  Alex Christensen  <achristensen@webkit.org>
3315
3316         Add WKUIDelegatePrivate equivalent of WKPageUIClient's isPlayingAudioDidChange
3317         https://bugs.webkit.org/show_bug.cgi?id=176203
3318         <rdar://problem/29270035>
3319
3320         Reviewed by Tim Horton.
3321
3322         * UIProcess/API/APIUIClient.h:
3323         (API::UIClient::isPlayingMediaDidChange):
3324         (API::UIClient::isPlayingAudioDidChange): Deleted.
3325         * UIProcess/API/C/WKPage.cpp:
3326         (WKPageSetPageUIClient):
3327         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3328         * UIProcess/Cocoa/UIDelegate.h:
3329         * UIProcess/Cocoa/UIDelegate.mm:
3330         (WebKit::UIDelegate::setDelegate):
3331         (WebKit::UIDelegate::UIClient::isPlayingMediaDidChange):
3332         * UIProcess/WebPageProxy.cpp:
3333         (WebKit::WebPageProxy::isPlayingMediaDidChange):
3334
3335 2017-08-31  Alex Christensen  <achristensen@webkit.org>
3336
3337         Add ObjC SPI corresponding to WKPageLoaderClient's webGLLoadPolicy and resolveWebGLLoadPolicy
3338         https://bugs.webkit.org/show_bug.cgi?id=175779
3339         <rdar://problem/22367975>
3340
3341         Reviewed by Tim Horton.
3342
3343         * UIProcess/API/APINavigationClient.h:
3344         (API::NavigationClient::webGLLoadPolicy const):
3345         (API::NavigationClient::resolveWebGLLoadPolicy const):
3346         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3347         * UIProcess/Cocoa/NavigationState.h:
3348         * UIProcess/Cocoa/NavigationState.mm:
3349         (WebKit::NavigationState::setNavigationDelegate):
3350         (WebKit::toWebCoreWebGLLoadPolicy):
3351         (WebKit::NavigationState::NavigationClient::webGLLoadPolicy const):
3352         (WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const):
3353         * UIProcess/WebPageProxy.cpp:
3354         (WebKit::WebPageProxy::webGLPolicyForURL):
3355         (WebKit::WebPageProxy::resolveWebGLPolicyForURL):
3356         * UIProcess/WebPageProxy.h:
3357         * UIProcess/WebPageProxy.messages.in:
3358         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3359         (WebKit::WebFrameLoaderClient::webGLPolicyForURL const):
3360         (WebKit::WebFrameLoaderClient::resolveWebGLPolicyForURL const):
3361         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3362         * WebProcess/WebPage/WebPage.cpp:
3363         (WebKit::WebPage::webGLPolicyForURL):
3364         (WebKit::WebPage::resolveWebGLPolicyForURL):
3365         * WebProcess/WebPage/WebPage.h:
3366         * WebProcess/WebPage/ios/WebPageIOS.mm:
3367         (WebKit::WebPage::webGLPolicyForURL):
3368         (WebKit::WebPage::resolveWebGLPolicyForURL):
3369         * WebProcess/WebPage/mac/WebPageMac.mm:
3370         (WebKit::WebPage::webGLPolicyForURL):
3371         (WebKit::WebPage::resolveWebGLPolicyForURL):
3372
3373 2017-08-31  Brady Eidson  <beidson@apple.com>
3374
3375         Add (entirely incorrect) fetching of ServiceWorker scripts.
3376         https://bugs.webkit.org/show_bug.cgi?id=176179
3377
3378         Reviewed by Andy Estes.
3379
3380         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3381         (WebKit::WebSWServerConnection::startScriptFetchInClient):
3382         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3383         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
3384
3385         * WebProcess/Storage/WebSWClientConnection.cpp:
3386         (WebKit::WebSWClientConnection::finishFetchingScriptInServer):
3387         * WebProcess/Storage/WebSWClientConnection.h:
3388         * WebProcess/Storage/WebSWClientConnection.messages.in:
3389
3390 2017-08-31  Megan Gardner  <megan_gardner@apple.com>
3391
3392         Fix error in protocol revving
3393         https://bugs.webkit.org/show_bug.cgi?id=176191
3394
3395         Protocol definition was mastered out of later iOS submissions, causing them to not build.
3396
3397         Reviewed by Tim Horton.
3398
3399         * UIProcess/ios/WKContentViewInteraction.mm:
3400         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:]):
3401
3402 2017-08-31  Youenn Fablet  <youenn@apple.com>
3403
3404         Update CacheStorage caches only if it is updated
3405         https://bugs.webkit.org/show_bug.cgi?id=176135
3406
3407         Reviewed by Alex Christensen.
3408
3409         For each change to CacheStorageEngineCaches list of cache, CacheStorageEngineCaches increments a counter.
3410         When sending the list of caches, CacheStorageEngineCaches will compare its counter with the one provided.
3411         If they sare the same, CacheStorageEngineCaches will return nothing.
3412         Otherwise it returns the whole list of caches.
3413
3414         * NetworkProcess/cache/CacheStorageEngine.cpp:
3415         (WebKit::CacheStorage::Engine::retrieveCaches):
3416         * NetworkProcess/cache/CacheStorageEngine.h:
3417         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3418         (WebKit::CacheStorage::Caches::initialize):
3419         (WebKit::CacheStorage::Caches::open):
3420         (WebKit::CacheStorage::Caches::remove):
3421         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
3422         (WebKit::CacheStorage::Caches::cacheInfos const):
3423         * NetworkProcess/cache/CacheStorageEngineCaches.h:
3424         (WebKit::CacheStorage::Caches::updateCounter const):
3425         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
3426         (WebKit::CacheStorageEngineConnection::caches):
3427         * NetworkProcess/cache/CacheStorageEngineConnection.h:
3428         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
3429         * WebProcess/Cache/WebCacheStorageConnection.cpp:
3430         (WebKit::WebCacheStorageConnection::doRetrieveCaches):
3431         * WebProcess/Cache/WebCacheStorageConnection.h:
3432
3433 2017-08-31  Youenn Fablet  <youenn@apple.com>
3434
3435         Introduce CacheStorageEngineCache to handle cache records
3436         https://bugs.webkit.org/show_bug.cgi?id=176137
3437
3438         Reviewed by Alex Christensen.
3439
3440         CacheStorageEngineCache is the equivalent of WebCore Cache.
3441         It contains a list of records that it needs to manage (add, update, remove).
3442         Moving the logic of this management from CacheStorageEngine to this new class so as to ease future development.
3443
3444         * CMakeLists.txt:
3445         * NetworkProcess/cache/CacheStorageEngine.cpp:
3446         (WebKit::CacheStorage::Engine::open):
3447         (WebKit::CacheStorage::Engine::remove):
3448         (WebKit::CacheStorage::Engine::retrieveRecords):
3449         (WebKit::CacheStorage::Engine::putRecords):
3450         (WebKit::CacheStorage::Engine::deleteMatchingRecords):
3451         (WebKit::CacheStorage::Engine::cache):
3452         (WebKit::CacheStorage::Engine::writeCacheRecords): Deleted.
3453         (WebKit::CacheStorage::Engine::removeCacheRecords): Deleted.
3454         (WebKit::CacheStorage::Engine::queryCache): Deleted.
3455         * NetworkProcess/cache/CacheStorageEngine.h:
3456         * NetworkProcess/cache/CacheStorageEngineCache.cpp: Added.
3457         * NetworkProcess/cache/CacheStorageEngineCache.h:
3458         (WebKit::CacheStorage::Cache::identifier const):
3459         (WebKit::CacheStorage::Cache::name const):
3460         (WebKit::CacheStorage::Cache::info const):
3461         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3462         (WebKit::CacheStorage::Caches::find):
3463         (WebKit::CacheStorage::Caches::open):
3464         (WebKit::CacheStorage::Caches::remove):
3465         (WebKit::CacheStorage::encodeCacheNames):
3466         (WebKit::CacheStorage::Caches::readCachesFromDisk):
3467         (WebKit::CacheStorage::Caches::cacheInfos const):
3468         * WebKit.xcodeproj/project.pbxproj:
3469
3470 2017-08-31  David Quesada  <david_quesada@apple.com>
3471
3472         WKNavigationDelegatePrivate client redirect SPI needs to be able to detect redirects scheduled before the document finishes loading
3473         https://bugs.webkit.org/show_bug.cgi?id=176128
3474         rdar://problem/34068476
3475
3476         Reviewed by Brady Eidson.
3477
3478         _webView:didPerformClientRedirect: isn't useful for delegates that want to know about client redirects
3479         started before the document is finished loading. This is because the method would be called after the
3480         navigation scheduler's timer fires and the navigation for the redirect has begun. Since this happens in
3481         a later iteration of the run loop, the document has already finished loading. Address this by replacing
3482         the method with two that give the navigation delegate more information about when client redirects are
3483         scheduled and canceled.
3484
3485         * UIProcess/API/APINavigationClient.h:
3486         (API::NavigationClient::willPerformClientRedirect):
3487         (API::NavigationClient::didCancelClientRedirect):
3488         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3489         * UIProcess/Cocoa/NavigationState.h:
3490         * UIProcess/Cocoa/NavigationState.mm:
3491         (WebKit::NavigationState::setNavigationDelegate):
3492         (WebKit::NavigationState::NavigationClient::willPerformClientRedirect):
3493         (WebKit::NavigationState::NavigationClient::didCancelClientRedirect):
3494         * UIProcess/WebPageProxy.cpp:
3495         (WebKit::WebPageProxy::willPerformClientRedirectForFrame):
3496         (WebKit::WebPageProxy::didCancelClientRedirectForFrame):
3497         * UIProcess/WebPageProxy.h:
3498         * UIProcess/WebPageProxy.messages.in:
3499         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3500         (WebKit::WebFrameLoaderClient::dispatchDidCancelClientRedirect):
3501         (WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect):
3502         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3503
3504 2017-08-30  Megan Gardner  <megan_gardner@apple.com>
3505
3506         Remove IsBlockSelection flag
3507         https://bugs.webkit.org/show_bug.cgi?id=176141
3508
3509         Reviewed by Dean Jackson.
3510
3511         Block selection is disabled. Removed code associated with this flag to allow removal of the
3512         flag in UIKit.
3513         
3514         No tests for a removed feature.
3515
3516         * Platform/spi/ios/UIKitSPI.h:
3517         * Shared/ios/GestureTypes.h:
3518         * UIProcess/ios/WKContentViewInteraction.mm:
3519         (toUIWKSelectionFlags):
3520         * WebProcess/WebPage/ios/WebPageIOS.mm:
3521         (WebKit::WebPage::rangeForWebSelectionAtPosition):
3522         (WebKit::WebPage::selectWithGesture):
3523         (WebKit::WebPage::contractedRangeFromHandle):
3524         (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle):
3525         (WebKit::WebPage::updateBlockSelectionWithTouch):
3526         (WebKit::WebPage::updateSelectionWithTouches):
3527
3528 2017-08-30  Alex Christensen  <achristensen@webkit.org>
3529
3530         Add WKUIDelegatePrivate equivalent of WKPageUIClient's didClickAutoFillButton
3531         https://bugs.webkit.org/show_bug.cgi?id=176139
3532         <rdar://problem/29270035>
3533
3534         Reviewed by Tim Horton.
3535
3536         Covered by a cool new API test!
3537
3538         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3539         * UIProcess/Cocoa/UIDelegate.h:
3540         * UIProcess/Cocoa/UIDelegate.mm:
3541         (WebKit::UIDelegate::setDelegate):
3542         (WebKit::UIDelegate::UIClient::didClickAutoFillButton):
3543
3544 2017-08-31  Chris Dumez  <cdumez@apple.com>
3545
3546         Use WTF::crossThreadCopy() in more places
3547         https://bugs.webkit.org/show_bug.cgi?id=176169
3548
3549         Reviewed by Andreas Kling.
3550
3551         Use WTF::crossThreadCopy() in more places to make code more concise.
3552
3553         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3554         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
3555         (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
3556         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
3557         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
3558         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
3559         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3560         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains):
3561
3562 2017-08-31  Youenn Fablet  <youenn@apple.com>
3563
3564         Take into account removed caches in Caches::remove assertion
3565         https://bugs.webkit.org/show_bug.cgi?id=176164
3566
3567         Reviewed by Alex Christensen.
3568
3569         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3570         (WebKit::CacheStorage::Caches::remove):
3571
3572 2017-08-31  Youenn Fablet  <youenn@apple.com>
3573
3574         Do not create a salt if the CacheStorage engine should not persist
3575         https://bugs.webkit.org/show_bug.cgi?id=176138
3576
3577         Reviewed by Alex Christensen.
3578
3579         * NetworkProcess/cache/CacheStorageEngine.cpp:
3580         (WebKit::CacheStorage::Engine::~Engine): Ensuring that Caches will not try using the engine if it goes away.
3581         (WebKit::CacheStorage::Engine::initialize): Removing making a salt if engine data is not persistent.
3582         * NetworkProcess/cache/CacheStorageEngine.h: Check persistency according the root path. If it is null, caches should not try to do persistency.
3583         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3584         (WebKit::CacheStorage::cachesRootPath):
3585         (WebKit::CacheStorage::Caches::initialize):
3586         (WebKit::CacheStorage::Caches::detach):
3587         (WebKit::CacheStorage::Caches::readCachesFromDisk):
3588         (WebKit::CacheStorage::Caches::writeCachesToDisk):
3589         * NetworkProcess/cache/CacheStorageEngineCaches.h:
3590         (WebKit::CacheStorage::Caches::shouldPersist const):
3591         * NetworkProcess/cache/NetworkCacheData.cpp: Making makeSalt private again.
3592         (WebKit::NetworkCache::makeSalt):
3593         * NetworkProcess/cache/NetworkCacheData.h:
3594
3595
3596 2017-08-31  Carlos Garcia Campos  <cgarcia@igalia.com>
3597
3598         [GTK] Several InputMethodFilter tests are failing and crashing
3599         https://bugs.webkit.org/show_bug.cgi?id=176158
3600
3601         Reviewed by Carlos Alberto Lopez Perez.
3602
3603         * UIProcess/gtk/InputMethodFilter.cpp:
3604         (WebKit::InputMethodFilter::confirmCurrentComposition): Return early in testing mode because the page is not available.
3605         (WebKit::InputMethodFilter::logHandleKeyboardEventWithCompositionResultsForTesting): Use hexadecimal numbers for
3606         logging key codes.
3607
3608 2017-08-31  Carlos Garcia Campos  <cgarcia@igalia.com>
3609
3610         [GTK][Wayland] Crash when gdk_keymap_get_entries_for_keyval returns TRUE but n_keys=0
3611         https://bugs.webkit.org/show_bug.cgi?id=176154
3612
3613         Reviewed by Carlos Alberto Lopez Perez.
3614
3615         In Wayland gdk_keymap_get_entries_for_keyval() can return TRUE with n_keys=0. We have several places in WebKit
3616         where we just check the return value of gdk_keymap_get_entries_for_keyval() and then use the returned array to
3617         get the first position assuming it has at least one item. This has always worked in X11 because the GDK X11
3618         backend does the right thing, but it's crashing in Wayland now. It should be fixed in GTK+ but in the meantime
3619         it's easy to workaround by also checking n_keys > 0.
3620
3621         * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
3622         (WebKit::doKeyStrokeEvent):
3623
3624 2017-08-30  Dan Bernstein  <mitz@apple.com>
3625
3626         [iOS] REGRESSION (r218144) -[WKContentView targetForAction:withSender:] returns the content view for actions implemented only by the WKWebView, causing a crash
3627         https://bugs.webkit.org/show_bug.cgi?id=176077
3628         <rdar://problem/34145200>
3629
3630         Reviewed by Sam Weinig.
3631
3632         Test: TestWebKitAPI/Tests/WebKitCocoa/WKContentViewTargetForAction.mm
3633
3634         * UIProcess/API/Cocoa/WKWebView.mm:
3635         (-[WKWebView targetForAction:withSender:]): Override and forward WKContentView actions to
3636           -[WKContentView targetForActionForWebView:withSender:].
3637         * UIProcess/ios/WKContentViewInteraction.h: Declare -targetForActionForWebView:withSender:.
3638         * UIProcess/ios/WKContentViewInteraction.mm:
3639         (-[WKContentView targetForAction:withSender:]): Forward to the WKWebView.
3640         (-[WKContentView targetForActionForWebView:withSender:]): Call super’s
3641           -targetForAction:withSender:.
3642
3643 2017-08-30  Brent Fulgham  <bfulgham@apple.com>
3644
3645         Fix whitespace and formatting
3646         https://bugs.webkit.org/show_bug.cgi?id=176134
3647
3648         Reviewed by Sam Weinig.
3649
3650         Bring the file formatting into compliance with WebKit Coding Style.
3651
3652         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.mm:
3653         (-[_WKWebsiteDataStoreConfiguration _webStorageDirectory]):
3654         (-[_WKWebsiteDataStoreConfiguration _setWebStorageDirectory:]):
3655         (-[_WKWebsiteDataStoreConfiguration _indexedDBDatabaseDirectory]):
3656         (-[_WKWebsiteDataStoreConfiguration _setIndexedDBDatabaseDirectory:]):
3657         (-[_WKWebsiteDataStoreConfiguration _webSQLDatabaseDirectory]):
3658         (-[_WKWebsiteDataStoreConfiguration _setWebSQLDatabaseDirectory:]):
3659         (-[_WKWebsiteDataStoreConfiguration _cookieStorageFile]):
3660         (-[_WKWebsiteDataStoreConfiguration _setCookieStorageFile:]):
3661         (-[_WKWebsiteDataStoreConfiguration _resourceLoadStatisticsDirectory]):
3662         (-[_WKWebsiteDataStoreConfiguration _setResourceLoadStatisticsDirectory:]):
3663
3664 2017-08-30  Youenn Fablet  <youenn@apple.com>
3665
3666         Remove the list of removed caches from CacheStorageEngine
3667         https://bugs.webkit.org/show_bug.cgi?id=176136
3668
3669         Reviewed by Alex Christensen.
3670
3671
3672         This list is no longer useful as CacheStorageEngineCaches handles its own removed caches.
3673
3674         * NetworkProcess/cache/CacheStorageEngine.cpp:
3675         (WebKit::CacheStorage::Engine::remove):
3676         (WebKit::CacheStorage::Engine::cache):
3677         * NetworkProcess/cache/CacheStorageEngine.h:
3678
3679 2017-08-30  Tim Horton  <timothy_horton@apple.com>
3680
3681         REGRESSION (r221068): Graphics corruption when dragging images on iOS
3682         https://bugs.webkit.org/show_bug.cgi?id=176132
3683         <rdar://problem/34142983>
3684
3685         Reviewed by Dean Jackson.
3686
3687         * Shared/mac/ColorSpaceData.mm:
3688         (WebKit::ColorSpaceData::encode):
3689         Color space encoding was entirely disabled on iOS, so after r221068,
3690         ShareableBitmap would make different decisions about image format
3691         on both sides of the wire.
3692
3693         Enable color space encoding on iOS (decoding is already implemented)
3694         by moving some ifdefs around.
3695
3696 2017-08-30  Youenn Fablet  <youenn@apple.com>
3697
3698         [Cache API] Support cache names persistency
3699         https://bugs.webkit.org/show_bug.cgi?id=175995
3700
3701         Reviewed by Alex Christensen.
3702
3703         Adding disk read/write capacities to CacheStorage engine.
3704         This is used to store per-origin cache names in a file.
3705         Making Engine a thread safe refcounted object so that it does read/write in a background thread.
3706
3707         Introducing CacheStorage::Caches as the object managing the list of Cache objects for a given origin.
3708         Caches will be responsible to do all the read/write operations for all of its caches.
3709         It will be responsible for quota limitation as well.
3710
3711         Moving part of the logic from CacheStorage::Engine into CacheStorage::Caches.
3712
3713         CacheStorage::Engine is initialized asynchronously as it first creates a salt which is used
3714         to obfuscate the names of the various files stored on disk.
3715
3716         In the same spirit, CacheStorage::Caches is initialized asynchronously as it needs to read from the disk the list of cache names.
3717         Once read, the names will be stored in memory.
3718         Added the possibility to clear this in-memory representation. This will be useful for testing.
3719         This might also be useful to save memory when there is no more use of CacheStorage by web pages.
3720
3721         Introducing a new cacheStorageSubdirectoryName parameter for WebsiteDataStore so as to segment the different per session CacheStorageEngine
3722         in direct sub folders of the main cacheStorageDirectory folder.
3723
3724         * CMakeLists.txt:
3725         * NetworkProcess/cache/CacheStorageEngine.cpp:
3726         (WebKit::CacheStorage::Engine::open):
3727         (WebKit::CacheStorage::Engine::remove):
3728         (WebKit::CacheStorage::Engine::retrieveCaches):
3729         (WebKit::CacheStorage::Engine::retrieveRecords):
3730         (WebKit::CacheStorage::Engine::initialize):
3731         (WebKit::CacheStorage::Engine::readCachesFromDisk):
3732         (WebKit::CacheStorage::Engine::cache):
3733         (WebKit::CacheStorage::Engine::writeFile): Making use of default parameter to directly return to the main loop.
3734         (WebKit::CacheStorage::Engine::readFile): Ditto.
3735         (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
3736         * NetworkProcess/cache/CacheStorageEngine.h:
3737         (WebKit::CacheStorage::Engine::rootPath const):
3738         (WebKit::CacheStorage::Engine::salt const):
3739         (WebKit::CacheStorage::Engine::nextCacheIdentifier):
3740         * NetworkProcess/cache/CacheStorageEngineCaches.cpp: Added.
3741         (WebKit::CacheStorage::cachesRootPath):
3742         (WebKit::CacheStorage::cachesListFilename):
3743         (WebKit::CacheStorage::Caches::Caches):
3744         (WebKit::CacheStorage::Caches::initialize):
3745         (WebKit::CacheStorage::Caches::find):
3746         (WebKit::CacheStorage::Caches::open):
3747         (WebKit::CacheStorage::Caches::remove):
3748         (WebKit::CacheStorage::encodeCacheNames):
3749         (WebKit::CacheStorage::decodeCachesNames):
3750         (WebKit::CacheStorage::Caches::readCachesFromDisk):
3751         (WebKit::CacheStorage::Caches::writeCachesToDisk):
3752         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
3753         (WebKit::CacheStorage::Caches::cacheInfos const):
3754         * NetworkProcess/cache/CacheStorageEngineCaches.h: Added.
3755         (WebKit::CacheStorage::Caches::create):
3756         (WebKit::CacheStorage::Caches::isInitialized const):
3757         (WebKit::CacheStorage::Caches::detach):
3758         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
3759         (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
3760         * NetworkProcess/cache/CacheStorageEngineConnection.h:
3761         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
3762         * NetworkProcess/cache/NetworkCacheData.cpp:
3763         (WebKit::NetworkCache::makeSalt):
3764         * NetworkProcess/cache/NetworkCacheData.h:
3765         * UIProcess/WebsiteData/WebsiteDataStore.h:
3766         * WebKit.xcodeproj/project.pbxproj:
3767         * WebProcess/Cache/WebCacheStorageConnection.cpp:
3768         (WebKit::WebCacheStorageConnection::clearMemoryRepresentation):
3769         * WebProcess/Cache/WebCacheStorageConnection.h:
3770
3771 2017-08-30  Brady Eidson  <beidson@apple.com>
3772
3773         Add "Identified" base class to replace a whole bunch of custom identifier generators.
3774         https://bugs.webkit.org/show_bug.cgi?id=176120
3775
3776         Reviewed by Alex Christensen.
3777
3778         * UIProcess/API/APIUserScript.cpp:
3779         (API::UserScript::UserScript):
3780         (API::generateIdentifier): Deleted.
3781         * UIProcess/API/APIUserScript.h:
3782
3783         * UIProcess/API/APIUserStyleSheet.cpp:
3784         (API::UserStyleSheet::UserStyleSheet):
3785         (API::generateIdentifier): Deleted.
3786         * UIProcess/API/APIUserStyleSheet.h:
3787
3788         * UIProcess/UserContent/WebScriptMessageHandler.cpp:
3789         (WebKit::WebScriptMessageHandler::WebScriptMessageHandler):
3790         (WebKit::generateIdentifier): Deleted.
3791         * UIProcess/UserContent/WebScriptMessageHandler.h:
3792         (WebKit::WebScriptMessageHandler::identifier const): Deleted.
3793
3794         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
3795         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
3796         (WebKit::WebUserContentControllerProxy::~WebUserContentControllerProxy):
3797         (WebKit::WebUserContentControllerProxy::addProcess):
3798         (WebKit::WebUserContentControllerProxy::removeProcess):
3799         (WebKit::WebUserContentControllerProxy::addUserContentWorldUse):
3800         (WebKit::WebUserContentControllerProxy::removeUserContentWorldUses):
3801         (WebKit::WebUserContentControllerProxy::addUserScript):
3802         (WebKit::WebUserContentControllerProxy::removeUserScript):
3803         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
3804         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
3805         (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
3806         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
3807         (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
3808         (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
3809         (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
3810         (WebKit::WebUserContentControllerProxy::addContentRuleList):
3811         (WebKit::WebUserContentControllerProxy::removeContentRuleList):
3812         (WebKit::WebUserContentControllerProxy::removeAllContentRuleLists):
3813         (WebKit::generateIdentifier): Deleted.
3814         * UIProcess/UserContent/WebUserContentControllerProxy.h:
3815         (WebKit::WebUserContentControllerProxy::identifier const): Deleted.
3816
3817         * UIProcess/VisitedLinkStore.cpp:
3818         (WebKit::VisitedLinkStore::~VisitedLinkStore):
3819         (WebKit::VisitedLinkStore::VisitedLinkStore):
3820         (WebKit::VisitedLinkStore::addProcess):
3821         (WebKit::VisitedLinkStore::removeProcess):
3822         (WebKit::VisitedLinkStore::removeAll):
3823         (WebKit::VisitedLinkStore::pendingVisitedLinksTimerFired):
3824         (WebKit::VisitedLinkStore::sendTable):
3825         (WebKit::generateIdentifier): Deleted.
3826         * UIProcess/VisitedLinkStore.h:
3827
3828         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3829         (WebKit::WebsiteDataStore::WebsiteDataStore):
3830         (WebKit::generateIdentifier): Deleted.
3831         * UIProcess/WebsiteData/WebsiteDataStore.h:
3832         (WebKit::WebsiteDataStore::identifier const): Deleted.
3833
3834         * WebProcess/Network/WebSocketStream.cpp:
3835         (WebKit::WebSocketStream::WebSocketStream):
3836         (WebKit::WebSocketStream::~WebSocketStream):
3837         (WebKit::WebSocketStream::messageSenderDestinationID):
3838         * WebProcess/Network/WebSocketStream.h:
3839
3840 2017-08-30  Brady Eidson  <beidson@apple.com>
3841
3842         Implement all of "Register" right up until where the script is fetched.
3843         https://bugs.webkit.org/show_bug.cgi?id=176082
3844
3845         Reviewed by Andy Estes.
3846
3847         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3848         (WebKit::WebSWServerConnection::resolveJobInClient):
3849         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3850         * WebProcess/Storage/WebSWClientConnection.messages.in:
3851
3852 2017-08-30  Andy Estes  <aestes@apple.com>
3853
3854         [Mac] Upstream Accessibility-related WebKitSystemInterface functions
3855         https://bugs.webkit.org/show_bug.cgi?id=176093
3856
3857         Reviewed by Eric Carlson.
3858
3859         * UIProcess/Cocoa/WebViewImpl.h:
3860         * UIProcess/Cocoa/WebViewImpl.mm:
3861         (WebKit::WebViewImpl::setAccessibilityWebProcessToken):
3862         (WebKit::WebViewImpl::updateRemoteAccessibilityRegistration):
3863         (WebKit::WebViewImpl::accessibilityRegisterUIProcessTokens):
3864         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3865         (InitWebCoreSystemInterface):
3866         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
3867         * WebProcess/WebPage/mac/WebPageMac.mm:
3868         (WebKit::WebPage::platformInitialize):
3869         (WebKit::WebPage::registerUIProcessAccessibilityTokens):
3870
3871 2017-08-30  Carlos Alberto Lopez Perez  <clopez@igalia.com>
3872
3873         [WPE] Enable MEMORY_SAMPLER
3874         https://bugs.webkit.org/show_bug.cgi?id=176099
3875
3876         Reviewed by Michael Catanzaro.
3877
3878         Enable it at runtime if the environment variable WEBKIT_SAMPLE_MEMORY is set.
3879
3880         * UIProcess/API/wpe/WPEView.cpp:
3881         (WKWPE::m_compositingManagerProxy):
3882
3883 2017-08-30  Andy Estes  <aestes@apple.com>
3884
3885         [Mac] Upstream Carbon-related WebKitSystemInterface functions
3886         https://bugs.webkit.org/show_bug.cgi?id=176087
3887
3888         Reviewed by Alex Christensen.
3889
3890         * PluginProcess/mac/PluginProcessMac.mm:
3891         (WebKit::cgWindowID):
3892         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
3893         (WebKit::scriptCodeFromCurrentKeyboardInputSource):
3894         (WebKit::NetscapePlugin::sendComplexTextInput):
3895
3896 2017-08-30  Carlos Garcia Campos  <cgarcia@igalia.com>
3897
3898         Unreviewed. Try to fix layout test timing out after r221344.
3899
3900         There seems to be an infinite loop in the web process when WebPage::platformEditorState is called with non
3901         content editable result.
3902
3903         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
3904         (WebKit::WebPage::platformEditorState const):
3905
3906 2017-08-29  Carlos Garcia Campos  <cgarcia@igalia.com>
3907
3908         REGRESSION(r221064): [GTK] Editor not correctly working after r221064
3909         https://bugs.webkit.org/show_bug.cgi?id=176052
3910
3911         Reviewed by Michael Catanzaro.
3912
3913         Since r221064 we are not always notified about typing attributes when editor state changes. didChangeSelection
3914         no longer includes the typing attributes in EditorStateChange message, it's scheduled to be sent after the
3915         compositing layer have been flushed, but that part is not implemented for GTK+ port.
3916
3917         Fixes test /webkit2/WebKitWebView/editor-state/typing-attributes.
3918
3919         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
3920         (WebKit::AcceleratedDrawingArea::updateBackingStoreState): Call WebPage::flushPendingEditorStateUpdate() after
3921         the layout.
3922         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
3923         (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired): Call WebPage::flushPendingEditorStateUpdate() after
3924         the display sync.
3925         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3926         (WebKit::DrawingAreaImpl::display): Call WebPage::flushPendingEditorStateUpdate() after the layout.
3927         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
3928         (WebKit::WebPage::platformEditorState const): Also return early, setting isMissingPostLayoutData to true, when
3929         there's no frame view, the view needs a layout or the result is not for editable content.
3930
3931 2017-08-29  Brent Fulgham  <bfulgham@apple.com>
3932
3933         ResourceLoadStatistics logic does not understand custom WebsiteData stores
3934         https://bugs.webkit.org/show_bug.cgi?id=176037
3935         <rdar://problem/33338238>
3936
3937         Reviewed by Alex Christensen.
3938
3939         The NetworkProcess::updateCookiePartitioningForTopPrivatelyOwnedDomains always notifies the default website
3940         data store about observations it has made. This should be revised so that WebKit clients that register
3941         custom data stores through the WKWebsiteDataStores API can be assured that observations made in one session
3942         do not manipulate data from another session.
3943
3944         * NetworkProcess/NetworkProcess.cpp:
3945         (WebKit::NetworkProcess::updateCookiePartitioningForTopPrivatelyOwnedDomains): Use the passed sessionID to locate
3946         the correct NetworkStorageSession to notify about the new partitioning data.
3947         * NetworkProcess/NetworkProcess.h:
3948         * NetworkProcess/NetworkProcess.messages.in: Accept new argument.
3949         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3950         (WebKit::WebsiteDataStore::updateCookiePartitioningForTopPrivatelyOwnedDomains): Include the WebsiteDataStore's
3951         session ID in the message to update cookie partition data.
3952
3953 2017-08-29  Alex Christensen  <achristensen@webkit.org>
3954
3955         Automatically determine if a class has a modern decoder
3956         https://bugs.webkit.org/show_bug.cgi?id=176084
3957
3958         Reviewed by Sam Weinig.
3959
3960         Instead of determining if ModernDecoder is defined in the class,
3961         just check the signature of the decode member function.
3962
3963         * Platform/IPC/ArgumentCoder.h:
3964         (): Deleted.
3965         * Shared/WebPageCreationParameters.h:
3966         * Shared/WebPageGroupData.h:
3967         * Shared/WebsitePolicies.h:
3968
3969 2017-08-29  Alex Christensen  <achristensen@webkit.org>
3970
3971         Begin transition to modern IPC decoding
3972         https://bugs.webkit.org/show_bug.cgi?id=176043
3973
3974         Reviewed by JF Bastien.
3975
3976         Right now, if a class is decoded from IPC we must have a default constructor.
3977         This prevents us from having Ref or C++ references in such types, which is cluttering up our code.
3978         This is because IPC::decode makes a default-constructed object, fills it, and returns a bool indicating success.
3979         Making IPC::decode instead return a std::optional makes it so we do not need to call an empty constructor.
3980         This could also enable us to add IPC::Decoder::operator>> and other fun things!
3981         I also modernized two arbitrary classes, WebsitePolicies and WebPageGroupData with more to come.
3982         There's no good way to update the actual generated IPC code until each class has been transitioned.
3983
3984         * Platform/IPC/ArgumentCoder.h:
3985         (IPC::ArgumentCoder::decode):
3986         * Platform/IPC/Decoder.h:
3987         (IPC::Decoder::decode):
3988         * Shared/WebPageCreationParameters.cpp:
3989         (WebKit::WebPageCreationParameters::decode):
3990         * Shared/WebPageCreationParameters.h:
3991         * Shared/WebPageGroupData.cpp:
3992         (WebKit::WebPageGroupData::decode):
3993         * Shared/WebPageGroupData.h:
3994         * Shared/WebsitePolicies.h:
3995         (WebKit::WebsitePolicies::decode):