Make LegacyCustomProtocolManager optional for network process
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2017-11-30  Stephan Szabo  <stephan.szabo@sony.com>
2
3         Make LegacyCustomProtocolManager optional for network process
4         https://bugs.webkit.org/show_bug.cgi?id=176230
5
6         Reviewed by Alex Christensen.
7
8         * CMakeLists.txt:
9         * Configurations/FeatureDefines.xcconfig:
10         * NetworkProcess/NetworkProcess.cpp:
11         (WebKit::NetworkProcess::NetworkProcess):
12         (WebKit::NetworkProcess::initializeNetworkProcess):
13         * PlatformGTK.cmake:
14         * PlatformMac.cmake:
15         * PlatformWPE.cmake:
16         * UIProcess/Network/NetworkProcessProxy.cpp:
17         (WebKit::NetworkProcessProxy::NetworkProcessProxy):
18         (WebKit::NetworkProcessProxy::didClose):
19         * UIProcess/Network/NetworkProcessProxy.h:
20         * UIProcess/WebProcessPool.cpp:
21         (WebKit::WebProcessPool::setLegacyCustomProtocolManagerClient):
22         (WebKit::WebProcessPool::registerSchemeForCustomProtocol):
23         (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol):
24
25 2017-11-30  Ryan Haddad  <ryanhaddad@apple.com>
26
27         Unreviewed build fix, suppress deprecation warnings.
28
29         * Shared/mac/SandboxExtensionMac.mm:
30         (WebKit::SandboxExtensionImpl::sandboxExtensionForType):
31
32 2017-11-30  Daniel Bates  <dabates@apple.com>
33
34         Expose SPI didClickAlternativePresentationButtonWithUserInfo on iOS
35         https://bugs.webkit.org/show_bug.cgi?id=180218
36         <rdar://problem/35782555>
37
38         Reviewed by Alex Christensen.
39
40         We want to support the SPI didClickAlternativePresentationButtonWithUserInfo on Cocoa platforms.
41
42         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
43         * UIProcess/Cocoa/UIDelegate.h:
44         * UIProcess/Cocoa/UIDelegate.mm:
45         (WebKit::UIDelegate::setDelegate):
46         (WebKit::UIDelegate::UIClient::didClickAlternativePresentationButton):
47
48 2017-11-30  Joseph Pecoraro  <pecoraro@apple.com>
49
50         [Cocoa] Web Automation: _WKAutomationSessionConfiguration leak
51         https://bugs.webkit.org/show_bug.cgi?id=180222
52
53         Reviewed by Brian Burg.
54
55         * UIProcess/Cocoa/AutomationClient.mm:
56         (WebKit::AutomationClient::requestAutomationSessionWithCapabilities):
57
58 2017-11-30  Joseph Pecoraro  <pecoraro@apple.com>
59
60         Fix some NSOperationQueue leaks
61         https://bugs.webkit.org/show_bug.cgi?id=180221
62
63         Reviewed by Wenson Hsieh.
64
65         * UIProcess/Cocoa/WebViewImpl.mm:
66         (WebKit::WebViewImpl::performDragOperation):
67
68 2017-11-30  Brian Burg  <bburg@apple.com>
69
70         Web Automation: computeElementLayout does not correctly translate iframe client coordinates to main frame coordinates
71         https://bugs.webkit.org/show_bug.cgi?id=180213
72         <rdar://problem/30260141>
73
74         Reviewed by Simon Fraser.
75
76         The current implementation computes points in terms of the frame in which the element is located.
77         However, WebDriver expects coordinates to be relative to the top-level document since
78         these coordinates are used for generating click events, among other things.
79
80         To convert from frame client coordinates to main frame client coordinates, round-trip
81         both inViewCenterPoint and elementBounds to root view coordinates and back
82         to the main frame's contents/client coordinates. Then convert this to page coordinates if needed.
83
84         This progresses several tests in the Selenium Python test suite:
85
86          - event_firing_webdriver_tests.py::test_should_fire_navigation_events
87          - frame_switching_tests.py::testShouldBeAbleToClickInAFrameThatRewritesTopWindowLocation
88          - frame_switching_tests.py::testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUs
89          - frame_switching_tests.py::testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUsWithFrameIndex
90          - frame_switching_tests.py::testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUsWithWebelement
91          - frame_switching_tests.py::testShouldNotBeAbleToDoAnythingTheFrameIsDeletedFromUnderUs
92          - position_and_size_tests.py::testShouldGetCoordinatesOfAnInvisibleElement
93
94         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
95         (WebKit::WebAutomationSessionProxy::computeElementLayout):
96         Get both the frame and main frame FrameViews and convert coordinates to the root view.
97         This is somewhat lossy as clientToDocument* deals with FloatPoints but contentsToRootView
98         deals with IntPoints. For the purposes of WebDriver, lossiness is not a problem since
99         integer values are expected anyway.
100
101         The imperative nature of the coordinate calculations is difficult to debug, so I converted
102         this function to only assign to each variable once.
103
104 2017-11-30  Alex Christensen  <achristensen@webkit.org>
105
106         WKURLSchemeHandler.request should include HTTPBody
107         https://bugs.webkit.org/show_bug.cgi?id=180220
108
109         Reviewed by Brady Eidson.
110
111         * Shared/URLSchemeTaskParameters.cpp: Added.
112         (WebKit::URLSchemeTaskParameters::encode const):
113         (WebKit::URLSchemeTaskParameters::decode):
114         * Shared/URLSchemeTaskParameters.h: Added.
115         * UIProcess/API/Cocoa/WKURLSchemeTask.mm:
116         (-[WKURLSchemeTaskImpl request]):
117         * UIProcess/WebPageProxy.cpp:
118         (WebKit::WebPageProxy::startURLSchemeTask):
119         * UIProcess/WebPageProxy.h:
120         * UIProcess/WebPageProxy.messages.in:
121         * UIProcess/WebURLSchemeHandler.cpp:
122         (WebKit::WebURLSchemeHandler::startTask):
123         * UIProcess/WebURLSchemeHandler.h:
124         * UIProcess/WebURLSchemeTask.cpp:
125         (WebKit::WebURLSchemeTask::create):
126         (WebKit::WebURLSchemeTask::WebURLSchemeTask):
127         * UIProcess/WebURLSchemeTask.h:
128         * WebKit.xcodeproj/project.pbxproj:
129         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
130         (WebKit::WebURLSchemeTaskProxy::startLoading):
131
132 2017-11-30  Darin Adler  <darin@apple.com>
133
134         [Mac] remove unneeded RetainPtr use introduced in r225142
135         https://bugs.webkit.org/show_bug.cgi?id=180202
136
137         Reviewed by Tim Horton.
138
139         * WebProcess/Plugins/PDF/PDFPlugin.h: Got rid of unnecessary RetainPtr.
140         * WebProcess/Plugins/PDF/PDFPlugin.mm:
141         (WebKit::PDFPlugin::lookupTextAtLocation const): Ditto.
142         * WebProcess/WebPage/WebPage.h: Ditto.
143         * WebProcess/WebPage/mac/WebPageMac.mm:
144         (WebKit::WebPage::performDictionaryLookupAtLocation): Ditto.
145         (WebKit::WebPage::performDictionaryLookupForSelection): Ditto.
146         (WebKit::WebPage::performImmediateActionHitTestAtLocation): Ditto.
147         (WebKit::WebPage::lookupTextAtLocation): Ditto.
148
149 2017-11-30  Zan Dobersek  <zdobersek@igalia.com>
150
151         [CoordGraphics] Move CoordinatedGraphicsLayer painting behind Nicosia::PaintingEngine
152         https://bugs.webkit.org/show_bug.cgi?id=180141
153
154         Reviewed by Carlos Garcia Campos.
155
156         CompositingCoordinator must implement the paintingEngine() method now
157         that the method's been added to the CoordinatedGraphicsLayerClient
158         interface. The CompositingCoordinator manages the Nicosia::PaintingEngine
159         object through the new m_paintingEngine member variable, and returns the
160         reference to this object in the paintingEngine() method.
161
162         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
163         (WebKit::CompositingCoordinator::CompositingCoordinator):
164         (WebKit::CompositingCoordinator::paintingEngine):
165         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
166         Drop unnecessary typedefs.
167
168 2017-11-29  Wenson Hsieh  <wenson_hsieh@apple.com>
169
170         [Attachment Support] Implement SPI for clients to make an attachment element display in-place
171         https://bugs.webkit.org/show_bug.cgi?id=180153
172         <rdar://problem/35735252>
173
174         Reviewed by Tim Horton.
175
176         Add new WebKit SPI, -[_WKAttachment setDisplayOptions:completion:], and add plumbing for attachment display
177         options to the web content process. Changes covered by 4 new API tests.
178
179         * Scripts/webkit/messages.py:
180         (headers_for_type):
181         * UIProcess/API/APIAttachment.cpp:
182         (API::Attachment::setDisplayOptions):
183         * UIProcess/API/APIAttachment.h:
184         * UIProcess/API/Cocoa/WKWebView.mm:
185         (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]):
186
187         Respect given display options when inserting a new attachment.
188
189         * UIProcess/API/Cocoa/_WKAttachment.h:
190         * UIProcess/API/Cocoa/_WKAttachment.mm:
191         (-[_WKAttachmentDisplayOptions coreDisplayOptions]):
192
193         Introduce a helper to convert from the Cocoa _WKAttachmentDisplayOptions object to platform-agnostic
194         AttachmentDisplayOptions.
195
196         (-[_WKAttachment setDisplayOptions:completion:]):
197         (WebKit::if): Deleted.
198         * UIProcess/API/Cocoa/_WKAttachmentInternal.h:
199         * UIProcess/WebPageProxy.cpp:
200         (WebKit::WebPageProxy::insertAttachment):
201         (WebKit::WebPageProxy::setAttachmentDisplayOptions):
202         * UIProcess/WebPageProxy.h:
203         * WebProcess/WebPage/WebPage.cpp:
204         (WebKit::WebPage::insertAttachment):
205         (WebKit::WebPage::requestAttachmentData):
206         (WebKit::WebPage::setAttachmentDisplayOptions):
207         (WebKit::WebPage::attachmentElementWithIdentifier const):
208
209         Pull common logic to retrieve an attachment element matching a given identifier out into a helper.
210
211         * WebProcess/WebPage/WebPage.h:
212         * WebProcess/WebPage/WebPage.messages.in:
213
214 2017-11-29  Brent Fulgham  <bfulgham@apple.com>
215
216         Part 2: Adopt updated NSKeyed[Un]Archiver API when available
217         https://bugs.webkit.org/show_bug.cgi?id=180127
218         <rdar://problem/35710738>
219
220         Reviewed by Simon Fraser.
221
222         The API that accepts a user-allocated NSMutableData is deprecated. Switch (for macOS 10.12 and newer)
223         to the modern API. Use the original API for macOS builds prior to 10.12.
224
225         * Shared/Cocoa/DataDetectionResult.mm:
226         (WebKit::DataDetectionResult::encode const):
227         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
228         (IPC::ArgumentCoder<WebCore::Payment>::encode):
229         (IPC::ArgumentCoder<WebCore::PaymentContact>::encode):
230         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode):
231         (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode):
232         * Shared/ios/InteractionInformationAtPosition.mm:
233         (WebKit::InteractionInformationAtPosition::encode const):
234         * Shared/mac/WebCoreArgumentCodersMac.mm:
235         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData):
236         (IPC::ArgumentCoder<Credential>::encodePlatformData):
237         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode):
238         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData):
239         * Shared/mac/WebHitTestResultData.mm:
240         (WebKit::WebHitTestResultData::platformEncode const):
241         * UIProcess/API/Cocoa/WKProcessPool.mm:
242         (-[WKProcessPool _setObject:forBundleParameter:]):
243         (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]):
244         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
245         (WebKit::WebProcessPool::platformInitializeWebProcess):
246         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
247         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]):
248
249 2017-11-29  Brady Eidson  <beidson@apple.com>
250
251         When managing context startups, make ServiceWorkerJobDataIdentifier's optional.
252         https://bugs.webkit.org/show_bug.cgi?id=180166
253
254         Reviewed by Chris Dumez.
255
256         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
257
258         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
259         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
260         (WebKit::WebSWContextManagerConnection::didFinishInstall):
261         * WebProcess/Storage/WebSWContextManagerConnection.h:
262
263 2017-11-29  Youenn Fablet  <youenn@apple.com>
264
265         Add support for service worker generated redirections
266         https://bugs.webkit.org/show_bug.cgi?id=179498
267
268         Reviewed by Darin Adler.
269
270         Small refactoring to allow a service worker redirected fetch to follow the redirection through the service worker.
271
272         * WebProcess/Network/WebLoaderStrategy.cpp:
273         (WebKit::WebLoaderStrategy::scheduleLoad): Make use of the loader request in case a network load is needed after a service worker redirection.
274         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
275         (WebKit::ServiceWorkerClientFetch::create):
276         (WebKit::ServiceWorkerClientFetch::~ServiceWorkerClientFetch):
277         (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch):
278         (WebKit::ServiceWorkerClientFetch::start):
279         (WebKit::ServiceWorkerClientFetch::didReceiveResponse): Check for response.
280         Generate redirected request if needed and call loader callback to process the redirection.
281         Adding some states so that if didFinish is called before the willSendRequest callback, redirection is followed.
282         (WebKit::ServiceWorkerClientFetch::didFinish):
283         In case redirection should be followed, wait for didFinish to follow it.
284         This simplifies the model although introducing some limited latency.
285         * WebProcess/Storage/ServiceWorkerClientFetch.h:
286         * WebProcess/Storage/WebSWClientConnection.cpp:
287         (WebKit::WebSWClientConnection::startFetch):
288         * WebProcess/Storage/WebSWClientConnection.h:
289         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
290         (WebKit::WebServiceWorkerProvider::handleFetch):
291
292 2017-11-29  Youenn Fablet  <youenn@apple.com>
293
294         Add support for FetchEvent.clientId
295         https://bugs.webkit.org/show_bug.cgi?id=180052
296
297         Reviewed by Chris Dumez.
298
299         Using FetchOption persistency coders for cache API and modernizing IPC FetchOptions decoding.
300
301         * WebKit/Shared/WebCoreArgumentCoders.cpp:
302         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
303         (WebKit::CacheStorage::Cache::encode):
304         (WebKit::CacheStorage::Cache::decodeRecordHeader):
305         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
306         (WebKit::WebSWContextManagerConnection::startFetch):
307         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
308         (WebKit::WebSWContextManagerConnection::startFetch):
309
310 2017-11-29  Alex Christensen  <achristensen@webkit.org>
311
312         Make WebFrameLoaderClient more robust against null pointer dereferencing
313         https://bugs.webkit.org/show_bug.cgi?id=180157
314         <rdar://problem/34895616>
315
316         Reviewed by Tim Horton.
317
318         There has always been rare null pointer crashes in this code, but they have become more common
319         now that we are waiting for completion handlers for redirects, which makes it more likely that
320         we are hitting this code after we have detached from the core frame.
321
322         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
323         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
324         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
325         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
326         * WebProcess/WebPage/WebFrame.cpp:
327         (WebKit::WebFrame::page const):
328
329 2017-11-29  Alex Christensen  <achristensen@webkit.org>
330
331         Fix Mac CMake build.
332
333         * PlatformMac.cmake:
334
335 2017-11-29  Chris Dumez  <cdumez@apple.com>
336
337         StorageToWebProcessConnection & WebSWServerToContextConnection should use the same underlying IPC::Connection
338         https://bugs.webkit.org/show_bug.cgi?id=180147
339
340         Reviewed by Brady Eidson.
341
342         StorageToWebProcessConnection & WebSWServerToContextConnection should use the same underlying IPC::Connection.
343         Otherwise, we have with 2 IPC::Connections between the StorageProcess and the ServiceWorker (aka Context) process,
344         which makes synchronization of IPC messages difficult.
345
346         * StorageProcess/StorageProcess.cpp:
347         (WebKit::StorageProcess::createStorageToWebProcessConnection):
348         (WebKit::StorageProcess::createServerToContextConnection):
349         * StorageProcess/StorageProcess.h:
350         * StorageProcess/StorageProcess.messages.in:
351         * StorageProcess/StorageToWebProcessConnection.cpp:
352         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
353         * UIProcess/ServiceWorkerProcessProxy.cpp:
354         (WebKit::ServiceWorkerProcessProxy::start):
355         * UIProcess/ServiceWorkerProcessProxy.h:
356         * UIProcess/Storage/StorageProcessProxy.cpp:
357         (WebKit::StorageProcessProxy::getStorageProcessConnection):
358         (WebKit::StorageProcessProxy::didFinishLaunching):
359         (WebKit::StorageProcessProxy::establishWorkerContextConnectionToStorageProcess):
360         * UIProcess/Storage/StorageProcessProxy.h:
361         * UIProcess/Storage/StorageProcessProxy.messages.in:
362         * UIProcess/WebProcessPool.cpp:
363         (WebKit::WebProcessPool::getStorageProcessConnection):
364         (WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
365         * UIProcess/WebProcessPool.h:
366         * UIProcess/WebProcessProxy.cpp:
367         (WebKit::WebProcessProxy::getStorageProcessConnection):
368         * UIProcess/WebProcessProxy.h:
369         (WebKit::WebProcessProxy::isServiceWorkerProcess const):
370         * UIProcess/WebProcessProxy.messages.in:
371         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
372         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
373         * WebProcess/WebProcess.cpp:
374         (WebKit::WebProcess::didReceiveMessage):
375         (WebKit::WebProcess::establishWorkerContextConnectionToStorageProcess):
376         * WebProcess/WebProcess.h:
377         * WebProcess/WebProcess.messages.in:
378
379 2017-11-29  Chris Dumez  <cdumez@apple.com>
380
381         ensure*Connection() methods on WebProcess should return a reference
382         https://bugs.webkit.org/show_bug.cgi?id=180149
383
384         Reviewed by Alex Christensen.
385
386         ensure*Connection() methods on WebProcess should return a reference instead of not returning
387         anything. Also get rid of the non-ensure variants which called "ensure" internally and are
388         no longer needed.
389
390         * Shared/mac/CookieStorageShim.mm:
391         (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL):
392         * WebProcess/Cache/WebCacheStorageConnection.cpp:
393         (WebKit::WebCacheStorageConnection::connection):
394         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
395         (WebKit::WebIDBConnectionToServer::messageSenderConnection):
396         (WebKit::preregisterSandboxExtensionsIfNecessary):
397         * WebProcess/Databases/WebDatabaseProvider.cpp:
398         (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
399         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
400         (WebKit::BlobRegistryProxy::registerFileBlobURL):
401         (WebKit::BlobRegistryProxy::registerBlobURL):
402         (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
403         (WebKit::BlobRegistryProxy::unregisterBlobURL):
404         (WebKit::BlobRegistryProxy::registerBlobURLForSlice):
405         (WebKit::BlobRegistryProxy::blobSize):
406         (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
407         * WebProcess/Network/NetworkProcessConnection.cpp:
408         (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
409         * WebProcess/Network/WebLoaderStrategy.cpp:
410         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
411         (WebKit::WebLoaderStrategy::remove):
412         (WebKit::WebLoaderStrategy::setDefersLoading):
413         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
414         (WebKit::WebLoaderStrategy::startPingLoad):
415         (WebKit::WebLoaderStrategy::preconnectTo):
416         (WebKit::WebLoaderStrategy::storeDerivedDataToCache):
417         (WebKit::WebLoaderStrategy::setCaptureExtraNetworkLoadMetricsEnabled):
418         * WebProcess/Network/WebResourceLoader.cpp:
419         (WebKit::WebResourceLoader::messageSenderConnection):
420         * WebProcess/Network/WebSocketStream.cpp:
421         (WebKit::WebSocketStream::WebSocketStream):
422         (WebKit::WebSocketStream::messageSenderConnection):
423         * WebProcess/Network/webrtc/LibWebRTCResolver.cpp:
424         (WebKit::sendOnMainThread):
425         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
426         (WebKit::sendOnMainThread):
427         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
428         (WebKit::LibWebRTCSocketFactory::CreateServerTcpSocket):
429         (WebKit::LibWebRTCSocketFactory::CreateUdpSocket):
430         (WebKit::LibWebRTCSocketFactory::CreateClientTcpSocket):
431         (WebKit::LibWebRTCSocketFactory::createNewConnectionSocket):
432         * WebProcess/Network/webrtc/WebRTCMonitor.cpp:
433         (WebKit::sendOnMainThread):
434         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
435         (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
436         (WebKit::WebServiceWorkerProvider::handleFetch):
437         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
438         (WebKit::WebPlatformStrategies::cookiesForDOM):
439         (WebKit::WebPlatformStrategies::setCookiesFromDOM):
440         (WebKit::WebPlatformStrategies::cookiesEnabled):
441         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
442         (WebKit::WebPlatformStrategies::getRawCookies):
443         (WebKit::WebPlatformStrategies::deleteCookie):
444         * WebProcess/WebPage/WebFrame.cpp:
445         (WebKit::WebFrame::startDownload):
446         (WebKit::WebFrame::convertMainResourceLoadToDownload):
447         * WebProcess/WebProcess.cpp:
448         (WebKit::WebProcess::ensureLegacyPrivateBrowsingSessionInNetworkProcess):
449         (WebKit::WebProcess::ensureNetworkProcessConnection):
450         (WebKit::WebProcess::ensureWebToStorageProcessConnection):
451         (WebKit::WebProcess::prefetchDNS):
452         * WebProcess/WebProcess.h:
453
454 2017-11-29  Alex Christensen  <achristensen@webkit.org>
455
456         Modernize API::SerializedScriptValue
457         https://bugs.webkit.org/show_bug.cgi?id=180115
458
459         Reviewed by Brady Eidson.
460
461         Also remove some SPI that hasn't been used anywhere since Mountain Lion.
462
463         * Shared/API/APISerializedScriptValue.h:
464         (API::SerializedScriptValue::create):
465         (API::SerializedScriptValue::internalRepresentation):
466         (API::SerializedScriptValue::SerializedScriptValue):
467         * Shared/API/c/WKSerializedScriptValue.cpp:
468         (WKSerializedScriptValueDeserialize):
469         (WKSerializedScriptValueCreateWithInternalRepresentation): Deleted.
470         (WKSerializedScriptValueGetInternalRepresentation): Deleted.
471         * Shared/API/c/WKSerializedScriptValuePrivate.h: Removed.
472         * UIProcess/API/Cocoa/WKWebView.mm:
473         (-[WKWebView _evaluateJavaScript:forceUserGesture:completionHandler:]):
474         * WebKit.xcodeproj/project.pbxproj:
475
476 2017-11-29  Michael Catanzaro  <mcatanzaro@igalia.com>
477
478         REGRESSION(r218064): [GTK] Broke entering fullscreen mode in debug builds
479         https://bugs.webkit.org/show_bug.cgi?id=180120
480
481         Reviewed by Carlos Garcia Campos.
482
483         These assertions need to be swapped. Fixes /webkit2/WebKitWebView/fullscreen in debug mode.
484
485         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
486         (webkitWebViewBaseEnterFullScreen):
487         (webkitWebViewBaseExitFullScreen):
488
489 2017-11-29  Zan Dobersek  <zdobersek@igalia.com>
490
491         [CoordGraphics] Rename CoordinatedBuffer to Nicosia::Buffer
492         https://bugs.webkit.org/show_bug.cgi?id=180135
493
494         Reviewed by Carlos Garcia Campos.
495
496         Adjust code to the CoordinatedBuffer -> Nicosia::Buffer transition.
497
498         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
499         (WebKit::CoordinatedBackingStoreTile::setBackBuffer):
500         (WebKit::CoordinatedBackingStore::updateTile):
501         * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
502         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
503         (WebKit::CoordinatedGraphicsScene::createUpdateAtlas):
504         (WebKit::CoordinatedGraphicsScene::updateImageBacking):
505         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
506         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
507         (WebKit::CompositingCoordinator::updateImageBacking):
508         (WebKit::CompositingCoordinator::createUpdateAtlas):
509         (WebKit::CompositingCoordinator::getCoordinatedBuffer):
510         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
511         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
512         (WebKit::UpdateAtlas::UpdateAtlas):
513         (WebKit::UpdateAtlas::getCoordinatedBuffer):
514         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
515
516 2017-11-28  Brent Fulgham  <bfulgham@apple.com>
517
518         Adopt updated NSKeyed[Un]Archiver API when available
519         https://bugs.webkit.org/show_bug.cgi?id=180127
520         <rdar://problem/35710738>
521
522         Reviewed by Alex Christensen.
523
524         Switch to new NSKeyed[Un]Archiver methods when available. We do not attempt
525         to adopt secure coding in places we were not under the original API.
526
527         * Platform/ios/AccessibilityIOS.mm:
528         (WebKit::newAccessibilityRemoteToken): Use secure-by-default API.
529         * Shared/Cocoa/DataDetectionResult.mm:
530         (WebKit::DataDetectionResult::encode const): Ditto.
531         (WebKit::DataDetectionResult::decode): Ditto.
532         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
533         (IPC::ArgumentCoder<WebCore::Payment>::encode): Ditto.
534         (IPC::ArgumentCoder<WebCore::Payment>::decode): Ditto.
535         (IPC::ArgumentCoder<WebCore::PaymentContact>::encode): Ditto.
536         (IPC::ArgumentCoder<WebCore::PaymentContact>::decode): Ditto.
537         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode): Ditto.
538         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::decode): Ditto.
539         (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode): Ditto.
540         (IPC::ArgumentCoder<WebCore::PaymentMethod>::decode): Ditto.
541         * Shared/ios/InteractionInformationAtPosition.mm:
542         (WebKit::InteractionInformationAtPosition::encode const): Ditto.
543         (WebKit::InteractionInformationAtPosition::decode): Ditto.
544         * Shared/mac/WebCoreArgumentCodersMac.mm:
545         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Ditto.
546         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Ditto.
547         (IPC::ArgumentCoder<Credential>::encodePlatformData): Ditto.
548         (IPC::ArgumentCoder<Credential>::decodePlatformData): Ditto.
549         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode): Ditto.
550         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode): Ditto.
551         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): Ditto.
552         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): Ditto.
553         * Shared/mac/WebHitTestResultData.mm:
554         (WebKit::WebHitTestResultData::platformEncode const): Ditto.
555         (WebKit::WebHitTestResultData::platformDecode): Ditto.
556         * UIProcess/API/Cocoa/WKProcessPool.mm:
557         (-[WKProcessPool _setObject:forBundleParameter:]): Ditto.
558         (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]): Ditto.
559         * UIProcess/API/Cocoa/WKWebView.mm:
560         (-[WKWebView _setInputDelegate:]): Ditto.
561         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
562         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
563         * UIProcess/ios/PageClientImplIOS.mm:
564         (WebKit::PageClientImpl::startAssistingNode): Ditto.
565         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
566         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Ditto.
567         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
568         (WebKit::InjectedBundle::initialize): Ditto.
569         (WebKit::InjectedBundle::setBundleParameter): Ditto.
570         (WebKit::InjectedBundle::setBundleParameters): Ditto.
571
572 2017-11-28  Youenn Fablet  <youenn@apple.com>
573
574         NetworkCache::Storage should protect itself when removing operations from its maps
575         https://bugs.webkit.org/show_bug.cgi?id=180118
576
577         Reviewed by Antti Koivisto.
578
579         The operations can contain ref to the Storage object and removing them from the map may destroy the Storage object
580
581         * NetworkProcess/cache/NetworkCacheStorage.cpp:
582         (WebKit::NetworkCache::Storage::remove):
583         (WebKit::NetworkCache::Storage::finishReadOperation):
584         (WebKit::NetworkCache::Storage::finishWriteOperation):
585         (WebKit::NetworkCache::Storage::traverse):
586
587 2017-11-28  Youenn Fablet  <youenn@apple.com>
588
589         Register Documents as ServiceWorker clients to the StorageProcess
590         https://bugs.webkit.org/show_bug.cgi?id=180047
591
592         Reviewed by Brady Eidson.
593
594         Adding IPC to register/unregister clients to the storage process.
595         This will be used to enable service worker termination, and implementation of Clients API.
596
597         WebSWServerConnection keeps a hash map of all its related clients.
598         This allows unregistering these clients if the corresponding web process crashes.
599
600         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
601         (WebKit::WebSWServerConnection::~WebSWServerConnection):
602         (WebKit::WebSWServerConnection::registerServiceWorkerClient):
603         (WebKit::WebSWServerConnection::unregisterServiceWorkerClient):
604         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
605         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
606         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
607         * WebProcess/Storage/WebSWClientConnection.cpp:
608         (WebKit::WebSWClientConnection::registerServiceWorkerClient):
609         (WebKit::WebSWClientConnection::unregisterServiceWorkerClient):
610         * WebProcess/Storage/WebSWClientConnection.h:
611
612 2017-11-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
613
614         [CG] PostScript images should be supported if they are sub-resource images
615         https://bugs.webkit.org/show_bug.cgi?id=178502
616         <rdar://problem/35102988>
617
618         Reviewed by Simon Fraser.
619
620         Make convertPostScriptDataToPDF() be as static function of PDFDocumentImage
621         in WebCore.
622
623         * WebProcess/Plugins/PDF/PDFPlugin.mm:
624         (WebKit::PDFPlugin::convertPostScriptDataIfNeeded):
625         (WebKit::convertPostScriptDataToPDF): Deleted.
626
627 2017-11-28  Alex Christensen  <achristensen@webkit.org>
628
629         Add SPI for adding strings directly to a _WKVisitedLinkStore
630         https://bugs.webkit.org/show_bug.cgi?id=180100
631
632         Reviewed by Geoffrey Garen.
633
634         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
635         * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm:
636         (-[_WKVisitedLinkStore addVisitedLinkWithString:]):
637         This is a performance optimization for rdar://problem/16321391
638
639 2017-11-28  Joseph Pecoraro  <pecoraro@apple.com>
640
641         REGRESSION: Web Inspector: context menu actions "Download Image" and "Open Image in New Window" don't work
642         https://bugs.webkit.org/show_bug.cgi?id=178808
643         <rdar://problem/35176608>
644
645         Reviewed by Brian Burg.
646
647         * UIProcess/mac/WKInspectorViewController.mm:
648         (-[WKInspectorViewController _webView:contextMenu:forElement:]):
649         Continue to hide the image context menu actions like we used to.
650         Investigating making these context menus work can be done as a
651         follow-up task.
652
653         * UIProcess/mac/WKWebInspectorWKWebView.mm:
654         (-[WKWebInspectorWKWebView initWithFrame:configuration:]):
655         Use nullptr instead of 0.
656
657 2017-11-14  Carlos Garcia Campos  <cgarcia@igalia.com>
658
659         Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h
660         https://bugs.webkit.org/show_bug.cgi?id=173793
661
662         Reviewed by Joseph Pecocaro.
663
664         Based on patch by Brian Burg.
665
666         * UIProcess/Automation/WebAutomationSession.cpp:
667         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
668         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
669         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage):
670         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame):
671         (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout):
672         (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout):
673         (WebKit::WebAutomationSession::navigationOccurredForFrame):
674         (WebKit::WebAutomationSession::documentLoadedForFrame):
675         (WebKit::WebAutomationSession::inspectorFrontendLoaded):
676         (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
677         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
678         (WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
679         (WebKit::WebAutomationSession::addSingleCookie):
680         (WebKit::WebAutomationSession::setSessionPermissions):
681         (WebKit::WebAutomationSession::performMouseInteraction):
682         (WebKit::WebAutomationSession::performKeyboardInteractions):
683         * UIProcess/Automation/WebAutomationSession.h:
684
685 2017-11-28  Daniel Bates  <dabates@apple.com>
686
687         [Cocoa] First pass at implementing alternative presentation button element
688         https://bugs.webkit.org/show_bug.cgi?id=179785
689         Part of <rdar://problem/34917108>
690
691         Reviewed by Brent Fulgham.
692
693         Expose SPI to substitute the alternative presentation button for one or more elements
694         and remove the alternative presentation button. Add a private delegate callback when
695         the alternative presentation button is clicked.
696
697         * UIProcess/API/APIUIClient.h:
698         (API::UIClient::didClickAlternativePresentationButton): Added.
699         * UIProcess/API/C/WKPageUIClient.h:
700         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
701         * UIProcess/Cocoa/UIDelegate.h:
702         * UIProcess/Cocoa/UIDelegate.mm:
703         (WebKit::UIDelegate::setDelegate): Wired up delegate callback.
704         (WebKit::UIDelegate::UIClient::didClickAlternativePresentationButton): Added.
705         * UIProcess/WebPageProxy.cpp:
706         (WebKit::WebPageProxy::handleAlternativePresentationButtonClick): Added.
707         * UIProcess/WebPageProxy.h:
708         * UIProcess/WebPageProxy.messages.in:
709         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
710         (API::InjectedBundle::PageUIClient::didClickAlternativePresentationButton): Added.
711         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
712         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
713         (-[WKWebProcessPlugInFrame substituteElements:withAlternativePresentationButtonWithIdentifier:]): Added.
714         (-[WKWebProcessPlugInFrame removeAlternativePresentationButton:]): Added.
715         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h:
716         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
717         (WKBundleSubstituteWithAlternativePresentationButton): Added.
718         (WKBundleRemoveAlternativePresentationButton): Added.
719         * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
720         * WebProcess/InjectedBundle/API/c/WKBundlePageUIClient.h:
721         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
722         (WebKit::InjectedBundlePageUIClient::didClickAlternativePresentationButton): Added.
723         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
724         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
725         (WebKit::WebChromeClient::handleAlternativePresentationButtonClick): Added.
726         * WebProcess/WebCoreSupport/WebChromeClient.h:
727
728 2017-11-27  Chris Dumez  <cdumez@apple.com>
729
730         ASSERTION FAILED: addResult.isNewEntry WebCore::SWServerRegistration::addClientUsingRegistration(WebCore::ServiceWorkerClientIdentifier const&) + 141
731         https://bugs.webkit.org/show_bug.cgi?id=180049
732
733         Reviewed by Brady Eidson.
734
735         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
736         * WebProcess/Storage/WebSWClientConnection.cpp:
737         (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer):
738         (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):
739         (WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient):
740         (WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient):
741         * WebProcess/Storage/WebSWClientConnection.h:
742
743 2017-11-27  Jeremy Jones  <jeremyj@apple.com>
744
745         downcast to WebKit::FullscreenClient can sometimes fail.
746         https://bugs.webkit.org/show_bug.cgi?id=179849
747
748         Reviewed by Darin Adler.
749
750         There are cases during teardown where fullscreenClient() has been cleared back to an API::FullscreenClient.
751         Because those cases, WKWebView should test before downcasting to WebKit::FullscreenClient.
752
753         This is causing a crash when fullscreen delegate is cleared after a page is closed.
754
755         * UIProcess/API/Cocoa/WKWebView.mm:
756         (-[WKWebView _setFullscreenDelegate:]):
757         (-[WKWebView _fullscreenDelegate]):
758
759 2017-11-27  Chris Dumez  <cdumez@apple.com>
760
761         Give Document a strongly typed identifier instead of a uint64_t
762         https://bugs.webkit.org/show_bug.cgi?id=180041
763
764         Reviewed by Youenn Fablet.
765
766         Give Document a strongly typed identifier instead of a uint64_t, for clarity.
767
768         * Platform/IPC/ArgumentCoders.h:
769         * Scripts/webkit/messages.py:
770         (forward_declarations_and_headers):
771         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
772         (WebKit::WebSWServerConnection::notifyClientsOfControllerChange):
773         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
774         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
775         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
776         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
777         * StorageProcess/StorageProcess.cpp:
778         (WebKit::StorageProcess::postMessageToServiceWorkerClient):
779         * WebProcess/Storage/WebSWClientConnection.cpp:
780         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
781         (WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient):
782         (WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient):
783         (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
784         * WebProcess/Storage/WebSWClientConnection.h:
785         * WebProcess/Storage/WebSWClientConnection.messages.in:
786
787 2017-11-27  Yacine Bandou  <yacine.bandou_ext@softathome.com>
788
789         [GTK][WPE] Add "enable-encrypted-media" property to WebKitWebSettings
790         https://bugs.webkit.org/show_bug.cgi?id=18005
791
792         Reviewed by Michael Catanzaro.
793
794         EncryptedMedia is an experimental JavaScript API for playing encrypted media in HTML.
795         This property will only work as intended if the EncryptedMedia feature is enabled at build time
796         with the ENABLE_ENCRYPTED_MEDIA flag.
797
798         * UIProcess/API/glib/WebKitSettings.cpp:
799         (webKitSettingsSetProperty):
800         (webKitSettingsGetProperty):
801         (webkit_settings_class_init):
802         (webkit_settings_get_enable_encrypted_media):
803         (webkit_settings_set_enable_encrypted_media):
804         * UIProcess/API/gtk/WebKitSettings.h:
805         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
806         * UIProcess/API/wpe/WebKitSettings.h:
807
808 2017-11-27  Tim Horton  <timothy_horton@apple.com>
809
810         One too many zeroes in macOS version number in FeatureDefines
811         https://bugs.webkit.org/show_bug.cgi?id=180011
812
813         Reviewed by Dan Bernstein.
814
815         * Configurations/FeatureDefines.xcconfig:
816
817 2017-11-27  Zan Dobersek  <zdobersek@igalia.com>
818
819         [CoordGraphics] Prettify ID value handling in UpdateAtlas and UpdateAtlas::Client
820         https://bugs.webkit.org/show_bug.cgi?id=180038
821
822         Reviewed by Carlos Garcia Campos.
823
824         In the UpdateAtlas class, provide an ID type that aliases to uint32_t.
825         The m_id member variable (ex-m_ID) uses this type, and it's also now
826         used in the Client interface.
827
828         While poking around, the header is modified to use '#pragma once',
829         and m_id is moved to the more logical first position among member
830         variables.
831
832         The static ID variable is modified to use the new type, and renamed
833         to s_nextID. Comment alongside the namespace scope closure is fixed
834         to use the appropriate name.
835
836         createUpdateAtlas() and removeUpdateAtlas() methods in the
837         CompositingCoordinator class are modified to use the UpdateAtlas::ID
838         type, and the former has the second parameter changed from RefPtr<>
839         to Ref<>.
840
841         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
842         (WebKit::CompositingCoordinator::createUpdateAtlas):
843         (WebKit::CompositingCoordinator::removeUpdateAtlas):
844         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
845         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
846         (WebKit::UpdateAtlas::UpdateAtlas):
847         (WebKit::UpdateAtlas::~UpdateAtlas):
848         (WebKit::UpdateAtlas::getCoordinatedBuffer):
849         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
850
851 2017-11-27  Zan Dobersek  <zdobersek@igalia.com>
852
853         [CoordGraphics] CompositingCoordinator: clean up Client vtable, GraphicsLayerClient overrides
854         https://bugs.webkit.org/show_bug.cgi?id=180037
855
856         Reviewed by Carlos Garcia Campos.
857
858         Remove the CompositingCoordinator::Client::paintLayerContents() method since
859         the only implementation in CoordinatedLayerTreeHost was empty.
860
861         Subsequently, the CompositingCoordinator::paintContents() override of the
862         GraphicsLayerClient method can also be removed. The notifyAnimationStarted()
863         override is empty, just like the base method, so it's removed as well.
864
865         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
866         (WebKit::CompositingCoordinator::deviceScaleFactor const): Bring method up
867         to the notifyFlushRequired() code, since both are overrides of the
868         GraphicsLayerClient-inherited methods.
869         (WebKit::CompositingCoordinator::pageScaleFactor const): Ditto.
870         (WebKit::CompositingCoordinator::notifyAnimationStarted): Deleted.
871         (WebKit::CompositingCoordinator::paintContents): Deleted.
872         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
873         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
874         (WebKit::CoordinatedLayerTreeHost::paintLayerContents): Deleted.
875         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
876
877 2017-11-27  Carlos Garcia Campos  <cgarcia@igalia.com>
878
879         REGRESSION(r223073): disk cache directory is no longer copied in ProcessPoolConfiguration::copy()
880         https://bugs.webkit.org/show_bug.cgi?id=180031
881
882         Reviewed by Youenn Fablet.
883
884         This has caused GTK/WPE test /webkit2/WebKitWebsiteData/configuration to fail, and the wrong directory is used
885         by the network process. I think it was removed by mistake in r223073.
886
887         * UIProcess/API/APIProcessPoolConfiguration.cpp:
888         (API::ProcessPoolConfiguration::copy): Copy m_diskCacheDirectory too.
889
890 2017-11-27  Adrian Perez de Castro  <aperez@igalia.com>
891
892         [WPE][GTK] Improve contents of pkg-config .pc files
893         https://bugs.webkit.org/show_bug.cgi?id=180032
894
895         Reviewed by Carlos Garcia Campos.
896
897         * gtk/webkit2gtk-web-extension.pc.in: Add URL, edit Name and Description.
898         * gtk/webkit2gtk.pc.in: Add URL, edit Name.
899         * wpe/wpe-webkit.pc.in: Add URL, edit Name and Description.
900
901 2017-11-23  Darin Adler  <darin@apple.com>
902
903         Fix dictionary leak in lookup, convert FindOptions to OptionSet, tweak code style nearby
904         https://bugs.webkit.org/show_bug.cgi?id=179981
905
906         Reviewed by Sam Weinig.
907
908         * WebProcess/Plugins/PDF/PDFPlugin.h: Use some references instead of pointers. Made more
909         things final and private. Changed functions with multiple return values to use tuples
910         instead of out arguments for clarity, especially because some were using pointers and it
911         was ambiguous whether the pointers could be nullptr. Tweaked formatting. Moved initialization
912         of data members into the class definition.
913
914         * WebProcess/Plugins/PDF/PDFPlugin.mm:
915         (WebKit::PDFPlugin::create): Take a reference.
916         (WebKit::PDFPlugin::PDFPlugin): Ditto. Also moved some initialization to the class definition.
917         (WebKit::PDFPlugin::countFindMatches): Added comment about ignored maxMatchCount argument.
918         (WebKit::PDFPlugin::findString): Use contains instead of & to check bits in options.
919         Simplified slightly confusing match count code that was doing some unnecessary comparisons
920         with the maximum match count. Use auto a bit.
921         (WebKit::coreCursor): Renamed from pdfLayerControllerCursorTypeToCursor since this is C++
922         and overloading works based on the argument type.
923         (WebKit::PDFPlugin::notifyCursorChanged): Updated for name change.
924         (WebKit::PDFPlugin::lookupTextAtLocation const): Return a tuple instead of using two out
925         arguments and use a RetainPtr so we don't leak the options dictionary.
926
927         * WebProcess/Plugins/PluginProxy.h: Removed unneeded include of FindOptions.h.
928
929         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
930         (WebKit::WebContextMenuClient::lookUpInDictionary): Pass a reference.
931
932         * WebProcess/WebPage/FindController.cpp:
933         (WebKit::core): Use |= instead of | to build up a FindOptions.
934         (WebKit::FindController::FindController): Initialize data members in the class definition.
935         (WebKit::pluginViewForFrame): Deleted. Callers now use WebPage::pluginViewForFrame.
936         (WebKit::FindController::updateFindUIAfterPageScroll): Added a FIXME about some peculiar code.
937         (WebKit::FindController::findString): Use |= rather than | to add in an option.
938         (WebKit::FindController::hideFindUI): Use { } rather than 0 for no options.
939         * WebProcess/WebPage/FindController.h: Moved initialization to the header. Exported the core
940         function that converts WebKit::FindOptions to WebCore::FindOptions.
941
942         * WebProcess/WebPage/WebFrame.cpp:
943         (WebKit::WebFrame::handlesPageScaleGesture const): Use WebPage::pluginViewForFrame.
944         (WebKit::WebFrame::requiresUnifiedScaleFactor const): Use WebPage::pluginViewForFrame.
945
946         * WebProcess/WebPage/WebPage.cpp:
947         (WebKit::WebPage::createPlugin): Removed unneeded local variable and UNUSED_PARAM.
948         (WebKit::WebPage::focusedPluginViewForFrame): Use pluginViewForFrame.
949         (WebKit::WebPage::pluginViewForFrame): Added a null check since this takes a pointer.
950         Use is/downcast insteadof more ad hoc coding style.
951         (WebKit::WebPage::findStringFromInjectedBundle): Call core to convert WebKit::FindOptions
952         to WebCore::FindOptions. Before, this was accidentally relying on the bits from the two
953         enumrations matching! The stricter type checking of OptionSet helps us catch mistakes
954         like this.
955
956         * WebProcess/WebPage/WebPage.h: Updated for the above. Also flattened out nested #if
957         statements, made forward declarations unconditional, and re-sorted them. Changed the
958         Mac-specific lookupTextAtLocation to return a tuple (see below).
959
960         * WebProcess/WebPage/ios/WebPageIOS.mm:
961         (WebKit::WebPage::performDictionaryLookupForSelection): Take a reference instead of a pointer.
962         (WebKit::WebPage::performDictionaryLookupForRange): Ditto.
963         (WebKit::rangeNearPositionMatchesText): Use { } rather than 0 for no options.
964
965         * WebProcess/WebPage/mac/WebPageMac.mm:
966         (WebKit::WebPage::performDictionaryLookupAtLocation): Use RetainPtr<NSDictionary> to fix
967         code that used to leak.
968         (WebKit::WebPage::performDictionaryLookupForSelection): Ditto.
969         (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Use a reference.
970         (WebKit::WebPage::dictionaryPopupInfoForRange): Updated for changed argument types.
971         (WebKit::WebPage::dictionaryPopupInfoForSelectionInPDFPlugin): Ditto.
972         (WebKit::WebPage::performDictionaryLookupForRange): Ditto.
973         (WebKit::WebPage::performImmediateActionHitTestAtLocation): Updated to handle the
974         tuple result from the lookupTextAtLocation functions.
975         (WebKit::WebPage::lookupTextAtLocation): Changed to return a tuple and use RetainPtr
976         for the NSDictionary to help fix the leak.
977
978 2017-11-24  Zan Dobersek  <zdobersek@igalia.com>
979
980         [CoordGraphics] CoordinatedGraphicsLayer::updateContentBuffers() should always assume a non-null CoordinatedBuffer
981         https://bugs.webkit.org/show_bug.cgi?id=179977
982
983         Reviewed by Carlos Garcia Campos.
984
985         Make CompositingCoordinator::getCoordinatedBuffer() return a Ref<CoordinatedBuffer>
986         value. In case an UpdateAtlas with enough free area is found, its CoordinatedBuffer
987         is dereferenced into the return value. In case a new UpdateAtlas is created, the
988         returned CoordinatedBuffer pointer is asserted to be non-null and dereferenced.
989
990         The retrieved CoordinatedBuffer pointer on a newly-created UpdateAtlas should never
991         be null since the tiles are smaller in size than the UpdateAtlas area. The assert
992         is done in release configurations as well since the code in CoordinatedGraphicsLayer
993         assumes the returned pointer will be non-null, so it's just a matter of where to
994         crash first in case somehow a null value is returned.
995
996         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
997         (WebKit::CompositingCoordinator::getCoordinatedBuffer):
998         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
999
1000 2017-11-24  Zan Dobersek  <zdobersek@igalia.com>
1001
1002         [CoordGraphics] UpdateAtlas constructor should receive an IntSize, not a dimension value
1003         https://bugs.webkit.org/show_bug.cgi?id=179976
1004
1005         Reviewed by Carlos Garcia Campos.
1006
1007         Have the UpdateAtlas constructor receive an IntSize object that specifies
1008         the desired size for the CoordinatedBuffer. Passing in a dimension doesn't
1009         really make sense since this value isn't dynamically configurable, and
1010         the only value that is passed in is already a power-of-two.
1011
1012         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1013         (WebKit::CompositingCoordinator::getCoordinatedBuffer):
1014         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
1015         (WebKit::UpdateAtlas::UpdateAtlas):
1016         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
1017
1018 2017-11-23  Sam Weinig  <sam@webkit.org>
1019
1020         Remove unneeded ScriptController::processingUserGesture() forwarding functions
1021         https://bugs.webkit.org/show_bug.cgi?id=179954
1022
1023         Reviewed by Darin Adler.
1024
1025         Replace ScriptController::processingUserGesture() and ScriptController::processingUserGestureForMedia()
1026         with direct calls to the corresponding UserGestureIndicator functions.
1027
1028         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1029         (WebKit::InjectedBundle::isProcessingUserGesture):
1030         * WebProcess/WebPage/WebPage.cpp:
1031         (WebKit::WebPage::addResourceRequest):
1032
1033 2017-11-23  Chris Dumez  <cdumez@apple.com>
1034
1035         WebSWServerConnection should register/unregister itself with the StorageProcess
1036         https://bugs.webkit.org/show_bug.cgi?id=179965
1037
1038         Reviewed by Darin Adler.
1039
1040         WebSWServerConnection should register/unregister itself with the StorageProcess instead of relying
1041         on StorageToWebProcessConnection to do so on its behalf. This is less error-prone.
1042
1043         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1044         (WebKit::WebSWServerConnection::WebSWServerConnection):
1045         (WebKit::WebSWServerConnection::~WebSWServerConnection):
1046         * StorageProcess/StorageToWebProcessConnection.cpp:
1047         (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection):
1048         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
1049         (WebKit::StorageToWebProcessConnection::removeSWServerConnection):
1050
1051 2017-11-23  Darin Adler  <darin@apple.com>
1052
1053         Reduce WTF::String operations that do unnecessary Unicode operations instead of ASCII
1054         https://bugs.webkit.org/show_bug.cgi?id=179907
1055
1056         Reviewed by Sam Weinig.
1057
1058         * NetworkProcess/cache/NetworkCache.cpp:
1059         (WebKit::NetworkCache::isMediaMIMEType): Use startsWithLettersIgnoringASCIICase.
1060         * NetworkProcess/cache/NetworkCacheKey.cpp:
1061         (WebKit::NetworkCache::hashString): Use isAllASCII..
1062         * UIProcess/API/C/WKWebsitePolicies.cpp:
1063         (WKWebsitePoliciesSetCustomHeaderFields): Use startsWithLettersIgnoringASCIICase..
1064         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
1065         (-[_WKWebsitePolicies setCustomHeaderFields:]): Ditto.
1066         * UIProcess/WebPageProxy.cpp:
1067         (WebKit::WebPageProxy::savePDFToFileInDownloadsFolder): Use endsWithIgnoringASCIICase.
1068         * UIProcess/WebPreferences.cpp:
1069         (WebKit::WebPreferences::WebPreferences): Initialize m_identifier explicitly. Somehow
1070         changing the String default constructor to be "= default" led to a warning that we
1071         otherwise did not get about not initializing m_identifier. Arguably a compiler bug,
1072         but legitimately strange that the copy constructor does not copy m_identifier and so
1073         nice to be explicit about it, I guess.
1074         * UIProcess/mac/WebPageProxyMac.mm:
1075         (WebKit::WebPageProxy::savePDFToTemporaryFolderAndOpenWithNativeApplicationRaw): Use
1076         endsWithIgnoringASCIICase.
1077         (WebKit::WebPageProxy::openPDFFromTemporaryFolderWithNativeApplication): Ditto.
1078         * WebProcess/WebPage/WebPage.cpp:
1079         (WebKit::WebPage::createPlugin): Ditto.
1080         * WebProcess/WebPage/ios/WebPageIOS.mm:
1081         (WebKit::WebPage::platformEditorState const): Use isAllSpecialCharacters<isHTMLSpace>.
1082
1083 2017-11-23  Zan Dobersek  <zdobersek@igalia.com>
1084
1085         [CoordGraphics] Simplify CoordinatedGraphicsLayer's content buffer updates
1086         https://bugs.webkit.org/show_bug.cgi?id=179972
1087
1088         Reviewed by Carlos Garcia Campos.
1089
1090         In CompositingCoordinator, add the getCoordinatedBuffer() method, replacing
1091         paintToSurface(). The new method traverses the list of UpdateAtlases and
1092         returns any CoordinatedBuffer object that was free to use. If none exist,
1093         a new UpdateAtlas object is created, and its CoordinatedBuffer is returned.
1094
1095         In  UpdateAtlas, the paintOnAvailableBuffer() method is replaced with
1096         getCoordinatedBuffer(). The latter allocates the necessary area but then
1097         returns a reference to the CoordinatedBuffer buffer, along with the atlas ID
1098         and the allocated rectangle information, and does not invoke any painting
1099         operation like paintOnAvailableBuffer() did.
1100
1101         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1102         (WebKit::CompositingCoordinator::getCoordinatedBuffer):
1103         (WebKit::CompositingCoordinator::paintToSurface): Deleted.
1104         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1105         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
1106         (WebKit::UpdateAtlas::getCoordinatedBuffer):
1107         (WebKit::UpdateAtlas::paintOnAvailableBuffer): Deleted.
1108         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
1109
1110 2017-11-23  Zan Dobersek  <zdobersek@igalia.com>
1111
1112         [CoordGraphics] Remove relay CoordinatedBuffer::Client implementations
1113         https://bugs.webkit.org/show_bug.cgi?id=179970
1114
1115         Reviewed by Carlos Garcia Campos.
1116
1117         Drop the helper UpdateAtlasSurfaceClient class and instead directly use
1118         the CoordinatedBuffer's GraphicsContext to perform clip and translation
1119         operations based on the allocated rectangle, to pre-fill the target rect
1120         with transparent color in case the alpha channel is supported, and to
1121         then invoke CoordinatedBuffer::Client::paintToSurfaceContext() method,
1122         passing the GraphicsContext as the argument.
1123
1124         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
1125         (WebKit::UpdateAtlas::paintOnAvailableBuffer):
1126         (): Deleted.
1127
1128 2017-11-23  Zan Dobersek  <zdobersek@igalia.com>
1129
1130         [CoordGraphics] Replace CoordinatedSurface, ThreadSafeCoordinatedSurface with CoordinatedBuffer
1131         https://bugs.webkit.org/show_bug.cgi?id=179967
1132
1133         Reviewed by Carlos Garcia Campos.
1134
1135         Replace uses of CoordinatedSurface class with CoordinatedBuffer. The
1136         ThreadSafeCoordinatedSurface class is removed, along with the code in
1137         CoordinatedLayerTreeHost that established a CoordinatedSurface factory.
1138
1139         * PlatformGTK.cmake:
1140         * PlatformWPE.cmake:
1141         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
1142         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
1143         (WebKit::CoordinatedBackingStoreTile::setBackBuffer):
1144         (WebKit::CoordinatedBackingStore::updateTile):
1145         * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
1146         Rename m_surface to m_buffer, m_surfaceOffset to m_bufferOffset.
1147         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1148         (WebKit::CoordinatedGraphicsScene::createUpdateAtlas):
1149         (WebKit::CoordinatedGraphicsScene::updateImageBacking):
1150         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1151         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp: Removed.
1152         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.h: Removed.
1153         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1154         (WebKit::CompositingCoordinator::updateImageBacking):
1155         (WebKit::CompositingCoordinator::createUpdateAtlas):
1156         (WebKit::CompositingCoordinator::paintToSurface):
1157         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1158         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1159         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
1160         (WebKit::CoordinatedLayerTreeHost::createCoordinatedSurface): Deleted.
1161         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1162         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
1163         (WebKit::UpdateAtlas::UpdateAtlas):
1164         (WebKit::UpdateAtlas::~UpdateAtlas):
1165         (WebKit::UpdateAtlas::paintOnAvailableBuffer):
1166         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
1167         Rename m_surface to m_buffer.
1168         (WebKit::UpdateAtlas::size const):
1169         (WebKit::UpdateAtlas::supportsAlpha const):
1170
1171 2017-11-22  Ali Juma  <ajuma@chromium.org>
1172
1173         Implement VisualViewport API attributes
1174         https://bugs.webkit.org/show_bug.cgi?id=179385
1175
1176         Reviewed by Frédéric Wang.
1177
1178         Add a VisualViewportAPI experimental feature.
1179
1180         * Shared/WebPreferences.yaml:
1181
1182 2017-11-22  Tim Horton <timothy_horton@apple.com> and Michael Catanzaro <mcatanzaro@igalia.com>
1183
1184         Remove build-webkit's notion of feature flags having a default value
1185         https://bugs.webkit.org/show_bug.cgi?id=177338
1186
1187         Reviewed by Carlos Alberto Lopez Perez.
1188
1189         Use ENABLE_EXPERIMENTAL_FEATURES instead of ENABLE_DEVELOPER_MODE to enable runtime
1190         experimental features.
1191
1192         * Shared/WebPreferencesDefaultValues.h:
1193
1194 2017-11-22  Commit Queue  <commit-queue@webkit.org>
1195
1196         Unreviewed, rolling out r225093.
1197         https://bugs.webkit.org/show_bug.cgi?id=179938
1198
1199         Compilation failed on WinCairo 64-bit Release (Requested by
1200         fredw on #webkit).
1201
1202         Reverted changeset:
1203
1204         "Implement VisualViewport API attributes"
1205         https://bugs.webkit.org/show_bug.cgi?id=179385
1206         https://trac.webkit.org/changeset/225093
1207
1208 2017-11-21  Ali Juma  <ajuma@chromium.org>
1209
1210         Implement VisualViewport API attributes
1211         https://bugs.webkit.org/show_bug.cgi?id=179385
1212
1213         Reviewed by Frédéric Wang.
1214
1215         Add a VisualViewportAPI experimental feature.
1216
1217         * Shared/WebPreferences.yaml:
1218
1219 2017-11-21  Christopher Reid  <chris.reid@sony.com>
1220
1221         [PAL] Remove FileSystem's dependency on WebCoreNSStringExtras
1222         https://bugs.webkit.org/show_bug.cgi?id=179504
1223
1224         Reviewed by Darin Adler.
1225
1226         * UIProcess/Cocoa/WebViewImpl.mm:
1227         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1228         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
1229
1230 2017-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1231
1232         [WPE] WPEWebProcess: Couldn't find current GLX or EGL context
1233         https://bugs.webkit.org/show_bug.cgi?id=179883
1234
1235         Reviewed by Žan Doberšek.
1236
1237         I'm seeing that message quite often when running the unit tests. The problem seems to be that some tests run so
1238         fast that the web process never renders the first frame, so the context is created but never made current. I've
1239         checked with apitrace that there are calls to eglQueryContext with null display, causing a EGL_BAD_DISPLAY, but
1240         I don't know where those calls are originated. Making the context current right after it's created fixes the
1241         problem.
1242
1243         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1244         (WebKit::ThreadedCompositor::createGLContext): Always call makeContextCurrent() right after the context is created.
1245
1246 2017-11-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1247
1248         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.2 release.
1249
1250         * gtk/NEWS: Add release notes for 2.19.2.
1251
1252 2017-11-20  Don Olmstead  <don.olmstead@sony.com>
1253
1254         Add declspec within WebKit API
1255         https://bugs.webkit.org/show_bug.cgi?id=179893
1256
1257         Reviewed by Darin Adler.
1258
1259         * Shared/API/c/WKDeclarationSpecifiers.h:
1260
1261 2017-11-20  Mario Sanchez Prada  <mario@endlessm.com>
1262
1263         [GTK] New API to add, retrieve and delete cookies via WebKitCookieManager
1264         https://bugs.webkit.org/show_bug.cgi?id=177932
1265
1266         Reviewed by Carlos Garcia Campos.
1267
1268         Added new API to WebKitCookieManager to add, retrieve and delete complete
1269         cookies into/out-of a running session, and updated documentation sections.
1270
1271         * UIProcess/API/glib/WebKitCookieManager.cpp:
1272         (webkit_cookie_manager_add_cookie): New function.
1273         (webkit_cookie_manager_add_cookie_finish): Ditto.
1274         (webkit_cookie_manager_get_cookies): Ditto.
1275         (webkit_cookie_manager_get_cookies_finish): Ditto.
1276         (webkit_cookie_manager_delete_cookie): Ditto.
1277         (webkit_cookie_manager_delete_cookie_finish): Ditto.
1278         * UIProcess/API/gtk/WebKitCookieManager.h: Added new functions.
1279         * UIProcess/API/wpe/WebKitCookieManager.h: Ditto.
1280         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Ditto.
1281
1282 2017-11-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1283
1284         [WPE] webkit_web_view_new() should enable specifying wpe_view_backend object
1285         https://bugs.webkit.org/show_bug.cgi?id=178655
1286
1287         Reviewed by Michael Catanzaro.
1288
1289         Update all WebKitWebView constructors to receive a WebKitWebViewBackend as argument. It's now required to
1290         provide a backend to create a web view, but it can be NULL to use the default one. WebKitWebViewBackend is a
1291         boxed type wrapping a struct wpe_view_backend* used as construct only property of WebKitWebView. The view always
1292         takes the ownership of the WebKitWebViewBackend which owns the struct wpe_view_backend*. An optional
1293         GDestroyNotify and user data pointer can be passed to the WebKitWebViewBackend constructor to provide a custom
1294         deleter for the backend. In the C API the struct wpe_view_backend* is also mandatory now, but it can't be NULL
1295         and it's owned by the caller, not the view.
1296
1297         * PlatformWPE.cmake:
1298         * UIProcess/API/C/wpe/WKView.cpp:
1299         (WKViewCreate):
1300         * UIProcess/API/C/wpe/WKView.h:
1301         * UIProcess/API/glib/WebKitWebView.cpp:
1302         (_WebKitWebViewPrivate::~_WebKitWebViewPrivate):
1303         (webkitWebViewConstructed):
1304         (webkitWebViewSetProperty):
1305         (webkitWebViewGetProperty):
1306         (webkit_web_view_class_init):
1307         (webkitWebViewCreatePage):
1308         (webkit_web_view_get_backend):
1309         * UIProcess/API/wpe/WPEView.cpp:
1310         (WKWPE::m_backend):
1311         (WKWPE::View::~View):
1312         * UIProcess/API/wpe/WebKitWebView.h:
1313         * UIProcess/API/wpe/WebKitWebViewBackend.cpp: Added.
1314         (_WebKitWebViewBackend::_WebKitWebViewBackend):
1315         (_WebKitWebViewBackend::~_WebKitWebViewBackend):
1316         (webkitWebViewBackendRef):
1317         (webkitWebViewBackendUnref):
1318         (webkitWebViewBackendCreateDefault):
1319         (webkit_web_view_backend_new):
1320         (webkit_web_view_backend_get_wpe_backend):
1321         * UIProcess/API/wpe/WebKitWebViewBackend.h: Added.
1322         * UIProcess/API/wpe/WebKitWebViewBackendPrivate.h: Added.
1323         * UIProcess/API/wpe/WebKitWebViewWPE.cpp:
1324         (webkit_web_view_new):
1325         (webkit_web_view_new_with_context):
1326         (webkit_web_view_new_with_related_view):
1327         (webkit_web_view_new_with_settings):
1328         (webkit_web_view_new_with_user_content_manager):
1329         * UIProcess/API/wpe/webkit.h:
1330
1331 2017-11-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1332
1333         [GTK][WPE] webkit_cookie_manager_delete_all_cookies doesn't delete the cookies if called before a web process is running
1334         https://bugs.webkit.org/show_bug.cgi?id=175265
1335
1336         Reviewed by Michael Catanzaro.
1337
1338         This is what happens:
1339
1340         1- We create our WebKitWebContext that creates its WebProcessPool.
1341         2- We set a persistent cookies storage.
1342         3- We ask the website data store to delete all cookies, but since website data store is a web process observer
1343            and we haven't spawned any web process yet, it creates a new WebProcessPool with the default configuration
1344            (no persistent cookies) and sends the message to delete the cookies there.
1345         4- The network process of the second process pool does nothing because it doesn't have cookies at all.
1346
1347         We need to set the primary data store of the WebProcessPool when WebKitWebContext is constructed to ensure that
1348         one is used before the web process is launched.
1349
1350         * UIProcess/API/glib/WebKitWebContext.cpp:
1351         (webkitWebContextConstructed):
1352
1353 2017-11-19  Tim Horton  <timothy_horton@apple.com>
1354
1355         Remove unused TOUCH_ICON_LOADING feature flag
1356         https://bugs.webkit.org/show_bug.cgi?id=179873
1357
1358         Reviewed by Simon Fraser.
1359
1360         * Configurations/FeatureDefines.xcconfig:
1361
1362 2017-11-19  Tim Horton  <timothy_horton@apple.com>
1363
1364         Remove unused LEGACY_VENDOR_PREFIXES feature flag
1365         https://bugs.webkit.org/show_bug.cgi?id=179872
1366
1367         Reviewed by Darin Adler.
1368
1369         * Configurations/FeatureDefines.xcconfig:
1370
1371 2017-11-18  Chris Dumez  <cdumez@apple.com>
1372
1373         ASSERTION FAILED: registration in WebCore::SWServerJobQueue::scriptContextStarted(ServiceWorkerIdentifier)
1374         https://bugs.webkit.org/show_bug.cgi?id=179846
1375
1376         Reviewed by Darin Adler.
1377
1378         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1379         (WebKit::WebSWServerConnection::rejectJobInClient):
1380         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
1381         (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
1382         (WebKit::WebSWServerConnection::startScriptFetchInClient):
1383         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1384         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
1385         * WebProcess/Storage/WebSWClientConnection.messages.in:
1386         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1387         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
1388         (WebKit::WebSWContextManagerConnection::didFinishInstall):
1389         * WebProcess/Storage/WebSWContextManagerConnection.h:
1390
1391 2017-11-18  Tim Horton  <timothy_horton@apple.com>
1392
1393         Rename some Network Capture debugging defines
1394         https://bugs.webkit.org/show_bug.cgi?id=179870
1395
1396         Reviewed by Darin Adler.
1397
1398         * NetworkProcess/capture/NetworkCaptureLogging.h:
1399         * NetworkProcess/capture/NetworkCaptureManager.cpp:
1400         (WebKit::NetworkCapture::Manager::findMatch):
1401         (WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
1402         These shouldn't have WTF in their name - they have nothing to do with WTF.
1403         These shouldn't use ENABLE(), since they're not features, just debugging macros.
1404
1405 2017-11-17  Chris Dumez  <cdumez@apple.com>
1406
1407         [Service Workers] Implement "Notify Controller Change" algorithm
1408         https://bugs.webkit.org/show_bug.cgi?id=179822
1409
1410         Reviewed by Youenn Fablet.
1411
1412         * Scripts/webkit/messages.py:
1413         (class_template_headers):
1414         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1415         (WebKit::WebSWServerConnection::notifyClientsOfControllerChange):
1416         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1417         * WebProcess/Storage/WebSWClientConnection.messages.in:
1418
1419 2017-11-17  Chris Dumez  <cdumez@apple.com>
1420
1421         Use a strongly typed identifier for SWServer::Connection
1422         https://bugs.webkit.org/show_bug.cgi?id=179848
1423
1424         Reviewed by Brady Eidson.
1425
1426         Use a strongly typed identifier for SWServer::Connection, for clarity.
1427
1428         * Scripts/webkit/messages.py:
1429         (forward_declarations_and_headers):
1430         (forward_declarations_and_headers.templates):
1431         (headers_for_type):
1432         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1433         (WebKit::WebSWServerConnection::WebSWServerConnection):
1434         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
1435         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1436         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1437         * StorageProcess/StorageProcess.cpp:
1438         (WebKit::StorageProcess::didFailFetch):
1439         (WebKit::StorageProcess::didNotHandleFetch):
1440         (WebKit::StorageProcess::didReceiveFetchResponse):
1441         (WebKit::StorageProcess::didReceiveFetchData):
1442         (WebKit::StorageProcess::didReceiveFetchFormData):
1443         (WebKit::StorageProcess::didFinishFetch):
1444         * StorageProcess/StorageProcess.h:
1445         * StorageProcess/StorageProcess.messages.in:
1446         * StorageProcess/StorageToWebProcessConnection.cpp:
1447         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
1448         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
1449         (WebKit::StorageToWebProcessConnection::removeSWServerConnection):
1450         (WebKit::generateIDBConnectionToServerIdentifier):
1451         (WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer):
1452         * StorageProcess/StorageToWebProcessConnection.h:
1453         * StorageProcess/StorageToWebProcessConnection.messages.in:
1454         * WebProcess/Storage/WebSWClientConnection.cpp:
1455         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
1456         * WebProcess/Storage/WebSWClientConnection.h:
1457         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1458         (WebKit::WebSWContextManagerConnection::startFetch):
1459         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
1460         * WebProcess/Storage/WebSWContextManagerConnection.h:
1461         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1462         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
1463         (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
1464         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
1465         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
1466         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
1467         (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):
1468         * WebProcess/Storage/WebToStorageProcessConnection.h:
1469
1470 2017-11-17  John Wilander  <wilander@apple.com>
1471
1472         Storage Access API: UI process should update network process about granted access
1473         https://bugs.webkit.org/show_bug.cgi?id=176943
1474         <rdar://problem/34440612>
1475
1476         Reviewed by Alex Christensen.
1477
1478         * NetworkProcess/NetworkProcess.cpp:
1479         (WebKit::NetworkProcess::updateStorageAccessForPrevalentDomains):
1480             Updates storage access on the session.
1481         * NetworkProcess/NetworkProcess.h:
1482         * NetworkProcess/NetworkProcess.messages.in:
1483         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1484         (WebKit::NetworkProcessCreationParameters::encode const):
1485         (WebKit::NetworkProcessCreationParameters::decode):
1486         * NetworkProcess/NetworkProcessCreationParameters.h:
1487         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1488         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1489         (WebKit::NetworkProcess::setStorageAccessAPIEnabled):
1490         * UIProcess/API/C/WKCookieManager.cpp:
1491         (WKCookieManagerSetStorageAccessAPIEnabled):
1492         * UIProcess/API/C/WKCookieManager.h:
1493         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1494         (WKWebsiteDataStoreSetStatisticsHasHadNonRecentUserInteraction):
1495         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1496         * UIProcess/API/Cocoa/WKProcessPool.mm:
1497         (-[WKProcessPool _isStorageAccessAPIEnabled]):
1498         (-[WKProcessPool _setStorageAccessAPIEnabled:]):
1499         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1500         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1501         (-[WKWebsiteDataStore _resourceLoadStatisticsSetHasHadNonRecentUserInteractionForHost:]):
1502             Test infrastructure.
1503         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1504         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1505         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1506         (WebKit::WebProcessPool::setStorageAccessAPIEnabled):
1507         * UIProcess/Network/NetworkProcessProxy.cpp:
1508         (WebKit::nextRequestStorageAccessContextId):
1509         (WebKit::NetworkProcessProxy::updateStorageAccessForPrevalentDomains):
1510             Sends a message to the network process to update storage access.
1511         (WebKit::NetworkProcessProxy::storageAccessRequestResult):
1512             Receives a message from the network process that storage access
1513             was updated.
1514         * UIProcess/Network/NetworkProcessProxy.h:
1515         * UIProcess/Network/NetworkProcessProxy.messages.in:
1516         * UIProcess/WebCookieManagerProxy.cpp:
1517         (WebKit::WebCookieManagerProxy::setStorageAccessAPIEnabled):
1518         * UIProcess/WebCookieManagerProxy.h:
1519         * UIProcess/WebProcessPool.h:
1520         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1521         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1522         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
1523         (WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
1524             Test infrastructure.
1525         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
1526             Now makes the API call even if the only operation is to clear first.
1527         * UIProcess/WebResourceLoadStatisticsStore.h:
1528         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1529         (WebKit::WebsiteDataStore::updateStorageAccessForPrevalentDomainsHandler):
1530             Propagates the storage access directive to the network process proxy.
1531         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
1532         * UIProcess/WebsiteData/WebsiteDataStore.h:
1533
1534 2017-11-16  Yousuke Kimoto  <yousuke.kimoto@sony.com>
1535
1536         [WinCairo] Add network (curl) files for wincairo webkit
1537         https://bugs.webkit.org/show_bug.cgi?id=179474
1538
1539         Reviewed by Alex Christensen.
1540
1541         * Shared/curl/WebCoreArgumentCodersCurl.cpp:
1542         (IPC::ArgumentCoder<CertificateInfo>::decode): Fidex return value since currently no operation is needed for wincairo webkit.
1543         (IPC::ArgumentCoder<ResourceError>::decodePlatformData): Fidex return value since currently no operation is needed for wincairo webkit.
1544         * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.cpp: Renamed from Source/WebKit/WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.cpp.
1545         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
1546         * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.h: Renamed from Source/WebKit/WebProcess/WebCoreSupport/win/WebFrameNetworkingContext.h.
1547
1548 2017-11-16  Don Olmstead  <don.olmstead@sony.com>
1549
1550         [WinCairo] Update WinCairoRequirements
1551         https://bugs.webkit.org/show_bug.cgi?id=179790
1552
1553         Reviewed by Alex Christensen.
1554
1555         * PlatformWin.cmake:
1556
1557 2017-11-16  Youenn Fablet  <youenn@apple.com>
1558
1559         Service Worker should get the body of intercepted requests
1560         https://bugs.webkit.org/show_bug.cgi?id=179776
1561
1562         Reviewed by Alex Christensen.
1563
1564         Pass a FormDataReference when starting fetch IPC.
1565         Convert this FormDataReference in a FormData and using it to set the FetchRequest body properly in Service Worker process.
1566         Forbid fetch interception when URL is not HTTP/HTTPS.
1567
1568         * Platform/IPC/FormDataReference.h:
1569         (IPC::FormDataReference::FormDataReference):
1570         (IPC::FormDataReference::takeData):
1571         (IPC::FormDataReference::encode const):
1572         (IPC::FormDataReference::decode):
1573         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1574         (WebKit::WebSWServerConnection::startFetch):
1575         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1576         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1577         * WebProcess/Storage/WebSWClientConnection.cpp:
1578         (WebKit::WebSWClientConnection::startFetch):
1579         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1580         (WebKit::WebSWContextManagerConnection::startFetch):
1581         * WebProcess/Storage/WebSWContextManagerConnection.h:
1582         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1583         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
1584         (WebKit::WebServiceWorkerProvider::handleFetch):
1585
1586 2017-11-16  Daniel Bates  <dabates@apple.com>
1587
1588         Add feature define for alternative presentation button element
1589         https://bugs.webkit.org/show_bug.cgi?id=179692
1590         Part of <rdar://problem/34917108>
1591
1592         Reviewed by Andy Estes.
1593
1594         Only enabled on Cocoa platforms by default.
1595
1596         * Configurations/FeatureDefines.xcconfig:
1597
1598 2017-11-16  Chris Dumez  <cdumez@apple.com>
1599
1600         [Service Worker] Implement "Try Clear Registration" algorithm
1601         https://bugs.webkit.org/show_bug.cgi?id=179791
1602
1603         Reviewed by Youenn Fablet.
1604
1605         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1606         * WebProcess/Storage/WebSWClientConnection.cpp:
1607         (WebKit::WebSWClientConnection::serviceWorkerStartedControllingClient):
1608         (WebKit::WebSWClientConnection::serviceWorkerStoppedControllingClient):
1609         * WebProcess/Storage/WebSWClientConnection.h:
1610
1611 2017-11-16  Michael Catanzaro  <mcatanzaro@igalia.com>
1612
1613         REGRESSION(r224179): layer flush now requires sync IPC to compute undo/redo availability in EditorState
1614         https://bugs.webkit.org/show_bug.cgi?id=179797
1615
1616         Reviewed by Simon Fraser.
1617
1618         r224179 introduced a performance regression. The newly-added code in WebPage::editorState is
1619         part of a performance-critical path. (The editor state is computed and sent to the UI
1620         process during the layer flush.) Calls to Editor::canUndo and Editor::canRedo were added,
1621         but these calls are both implemented with sync IPC calls to WebPageProxy in the UI process.
1622         WebPageProxy passes them along to PageClientImpl to compute the availability of the
1623         commands.
1624
1625         That's all pointless because this code only exists for the purpose of getting editing
1626         command availability to the UI process. In the case of undo and redo, it's not needed at
1627         all. I did not realize that when writing the code. So canUndo and canRedo should be removed
1628         from EditorState. This ought to be sufficient to avoid the perf regression.
1629
1630         No changes are needed to the GTK/WPE WebKitEditorState API. The API is reimplemented using
1631         WebPageProxy::canUndoRedo instead of EditorState. There should be no changes in behavior,
1632         only performance.
1633
1634         * Shared/EditorState.cpp:
1635         (WebKit::EditorState::PostLayoutData::encode const):
1636         (WebKit::EditorState::PostLayoutData::decode):
1637         * Shared/EditorState.h:
1638         * UIProcess/API/glib/WebKitEditorState.cpp:
1639         (webkitEditorStateCreate):
1640         (webkitEditorStateChanged):
1641         * UIProcess/API/glib/WebKitEditorStatePrivate.h:
1642         * UIProcess/API/glib/WebKitWebView.cpp:
1643         (webkit_web_view_get_editor_state):
1644         * UIProcess/WebPageProxy.cpp:
1645         (WebKit::WebPageProxy::canUndo):
1646         (WebKit::WebPageProxy::canRedo):
1647         * UIProcess/WebPageProxy.h:
1648         * WebProcess/WebPage/WebPage.cpp:
1649         (WebKit::WebPage::editorState const):
1650
1651 2017-11-16  Megan Gardner  <megan_gardner@apple.com>
1652
1653         Remove allowBlockSelection as block selection is not supported anymore
1654         https://bugs.webkit.org/show_bug.cgi?id=179738
1655
1656         Reviewed by Tim Horton.
1657
1658         Remove all instances of the alloweBlockSelection flag. Blocks selection is fully disabled
1659         and thus this flag will do nothing. This was only added as a debug measure last year, and nothing
1660         ever actually used it.
1661
1662         * Shared/WebPageCreationParameters.cpp:
1663         (WebKit::WebPageCreationParameters::encode const):
1664         (WebKit::WebPageCreationParameters::decode):
1665         * Shared/WebPageCreationParameters.h:
1666         * UIProcess/API/Cocoa/WKWebView.mm:
1667         (-[WKWebView _allowsBlockSelection]): Deleted.
1668         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1669         (-[WKWebViewConfiguration init]):
1670         (-[WKWebViewConfiguration copyWithZone:]):
1671         (-[WKWebViewConfiguration _allowsBlockSelection]): Deleted.
1672         (-[WKWebViewConfiguration _setAllowsBlockSelection:]): Deleted.
1673         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1674         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1675         * UIProcess/PageClient.h:
1676         * UIProcess/WebPageProxy.cpp:
1677         (WebKit::WebPageProxy::creationParameters):
1678         * UIProcess/ios/PageClientImplIOS.h:
1679         * UIProcess/ios/PageClientImplIOS.mm:
1680         (WebKit::PageClientImpl::allowsBlockSelection): Deleted.
1681         * WebProcess/WebPage/WebPage.cpp:
1682         * WebProcess/WebPage/WebPage.h:
1683
1684 2017-11-16  Brent Fulgham  <bfulgham@apple.com>
1685
1686         Whitelist additional IOKit properties based on customer feedback
1687         https://bugs.webkit.org/show_bug.cgi?id=179782
1688         <rdar://problem/35508246>
1689
1690         Reviewed by Dean Jackson.
1691
1692         Expand the IOKit property whitelist to recognize a few more properties as valid based on review of logs
1693         from customer systems and our test infrastructure.
1694
1695         * WebProcess/com.apple.WebProcess.sb.in:
1696
1697 2017-11-15  Brady Eidson  <beidson@apple.com>
1698
1699         Implement basics of "Terminate Service Worker" algorithm.
1700         https://bugs.webkit.org/show_bug.cgi?id=179551
1701
1702         Reviewed by Chris Dumez.
1703
1704         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
1705         (WebKit::WebSWServerToContextConnection::terminateWorker):
1706         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
1707         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in:
1708
1709         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1710         (WebKit::WebSWContextManagerConnection::terminateWorker):
1711         (WebKit::WebSWContextManagerConnection::workerTerminated):
1712         * WebProcess/Storage/WebSWContextManagerConnection.h:
1713         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1714
1715 2017-11-15  Brent Fulgham  <bfulgham@apple.com>
1716
1717         Remove access to 'com.apple.mediaaccessibility.public' preferences in WebContent sandbox
1718         https://bugs.webkit.org/show_bug.cgi?id=179747
1719         <rdar://problem/35367346>
1720
1721         Reviewed by Dean Jackson.
1722
1723         The 'mediaaccessibilityd' process handles access to MediaAccessibility preferences. We don't need
1724         to grant the WebContent Process sandbox access to them.
1725
1726         * WebProcess/com.apple.WebProcess.sb.in: 
1727
1728 2017-11-15  Alex Christensen  <achristensen@webkit.org>
1729
1730         Revert r224885
1731         https://bugs.webkit.org/show_bug.cgi?id=179719
1732
1733         * UIProcess/API/APIContentRuleListStore.cpp:
1734         (API::compiledToFile):
1735         r224885 was a speculative fix that did not fix anything on the bots.
1736
1737 2017-11-15  Brent Fulgham  <bfulgham@apple.com>
1738
1739         Unreviewed build fix after r224830.
1740
1741         * WebProcess/com.apple.WebProcess.sb.in: Add missing sysctl-read permissions needed
1742         to support testing on Mac Mini hardware.
1743
1744 2017-11-15  Youenn Fablet  <youenn@apple.com>
1745
1746         Add ServiceWorker to WebProcess plumbery for FormData fetch responses
1747         https://bugs.webkit.org/show_bug.cgi?id=179694
1748
1749         Reviewed by Alex Christensen.
1750
1751         Added plumbery from Service Worker up to Web Process to pass form data response bodies.
1752         A follow-up patch should read the data from Network Process and send it to the ResourceLoader.
1753
1754         * Platform/IPC/FormDataReference.h: Added.
1755         (IPC::FormDataReference::FormDataReference):
1756         (IPC::FormDataReference::takeData):
1757         (IPC::FormDataReference::encode const):
1758         (IPC::FormDataReference::decode):
1759         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1760         (WebKit::WebSWServerConnection::didReceiveFetchFormData):
1761         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1762         * StorageProcess/StorageProcess.cpp:
1763         (WebKit::StorageProcess::didReceiveFetchFormData):
1764         * StorageProcess/StorageProcess.h:
1765         * StorageProcess/StorageProcess.messages.in:
1766         * WebKit.xcodeproj/project.pbxproj:
1767         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1768         (WebKit::ServiceWorkerClientFetch::didReceiveFormData):
1769         * WebProcess/Storage/ServiceWorkerClientFetch.h:
1770         * WebProcess/Storage/ServiceWorkerClientFetch.messages.in:
1771         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
1772         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveFormData):
1773         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
1774
1775 2017-11-15  Alex Christensen  <achristensen@webkit.org>
1776
1777         Move a compiled WKContentRuleList to its destination before calling mmap
1778         https://bugs.webkit.org/show_bug.cgi?id=179719
1779
1780         Reviewed by Brady Eidson.
1781
1782         Right now we compile a WKContentRuleList to a temporary file, call mmap, close the file, then move it.
1783         Sometimes, especially on bots running tests, the move fails because the temporary file doesn't exist
1784         any more.  Moving the file before mmaping and closing the file might prevent this failure.
1785
1786         * UIProcess/API/APIContentRuleListStore.cpp:
1787         (API::compiledToFile):
1788
1789 2017-11-15  Chris Dumez  <cdumez@apple.com>
1790
1791         [Service Workers] Implement Client API
1792         https://bugs.webkit.org/show_bug.cgi?id=179709
1793
1794         Reviewed by Alex Christensen.
1795
1796         * Shared/WebCoreArgumentCoders.cpp:
1797         * Shared/WebCoreArgumentCoders.h:
1798         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1799         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
1800         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1801         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1802         * WebProcess/Storage/WebSWClientConnection.cpp:
1803         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
1804         * WebProcess/Storage/WebSWClientConnection.h:
1805         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1806         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
1807         * WebProcess/Storage/WebSWContextManagerConnection.h:
1808         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1809
1810 2017-11-15  Ryan Haddad  <ryanhaddad@apple.com>
1811
1812         Unreviewed, rolling out r224863.
1813
1814         Introduced LayoutTest crashes on iOS Simulator.
1815
1816         Reverted changeset:
1817
1818         "Move JSONValues to WTF and convert uses of InspectorValues.h
1819         to JSONValues.h"
1820         https://bugs.webkit.org/show_bug.cgi?id=173793
1821         https://trac.webkit.org/changeset/224863
1822
1823 2017-11-14  Brent Fulgham  <bfulgham@apple.com>
1824
1825         Remove access to "com.apple.pbs.fetch_services" from WebContent sandbox
1826         https://bugs.webkit.org/show_bug.cgi?id=179689
1827         <rdar://problem/35369172>
1828
1829         Reviewed by Per Arne Vollan.
1830
1831         WebKit's WebContent process should not have any need to interact with the fetch_services
1832         API exposed to the system. These interactions (if needed) should be happening in the UIProcess,
1833         so we should prevent the untrusted Web Content Process from being able to connect.
1834
1835         * WebProcess/com.apple.WebProcess.sb.in:
1836
1837 2017-11-15  Michael Catanzaro  <mcatanzaro@igalia.com>
1838
1839         Remove GTK web inspector images
1840         https://bugs.webkit.org/show_bug.cgi?id=179716
1841
1842         Reviewed by Carlos Garcia Campos.
1843
1844         * InspectorGResources.cmake:
1845
1846 2017-11-15  Gabriel Ivascu  <givascu@igalia.com>
1847
1848         [GTK] Automatically adjust font size when gtk-xft-dpi changes
1849         https://bugs.webkit.org/show_bug.cgi?id=142673
1850
1851         Some follow-up fixes for the previous patch.
1852
1853         Reviewed by Carlos Garcia Campos.
1854
1855         * UIProcess/API/glib/WebKitSettings.cpp:
1856         (webKitSettingsDispose):
1857         (webKitSettingsConstructed):
1858
1859 2017-11-14  Nan Wang  <n_wang@apple.com>
1860
1861         AX: AOM: Implement AccessibleNode class and support label and role attributes
1862         https://bugs.webkit.org/show_bug.cgi?id=179494
1863
1864         Reviewed by Ryosuke Niwa.
1865
1866         * Shared/WebPreferences.yaml:
1867         * UIProcess/API/C/WKPreferences.cpp:
1868         (WKPreferencesSetAccessibilityObjectModelEnabled):
1869         (WKPreferencesGetAccessibilityObjectModelEnabled):
1870         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1871
1872 2017-11-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1873
1874         Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h
1875         https://bugs.webkit.org/show_bug.cgi?id=173793
1876
1877         Reviewed by Brian Burg.
1878
1879         Based on patch by Brian Burg.
1880
1881         * UIProcess/Automation/WebAutomationSession.cpp:
1882         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
1883         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
1884         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage):
1885         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame):
1886         (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout):
1887         (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout):
1888         (WebKit::WebAutomationSession::navigationOccurredForFrame):
1889         (WebKit::WebAutomationSession::documentLoadedForFrame):
1890         (WebKit::WebAutomationSession::inspectorFrontendLoaded):
1891         (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
1892         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
1893         (WebKit::WebAutomationSession::setFilesToSelectForFileUpload):
1894         (WebKit::WebAutomationSession::addSingleCookie):
1895         (WebKit::WebAutomationSession::setSessionPermissions):
1896         (WebKit::WebAutomationSession::performMouseInteraction):
1897         (WebKit::WebAutomationSession::performKeyboardInteractions):
1898         * UIProcess/Automation/WebAutomationSession.h:
1899
1900 2017-11-14  Chris Dumez  <cdumez@apple.com>
1901
1902         [Service Workers] Implement container.getRegistrations()
1903         https://bugs.webkit.org/show_bug.cgi?id=179672
1904
1905         Reviewed by Brady Eidson.
1906
1907         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1908         (WebKit::WebSWServerConnection::getRegistrations):
1909         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1910         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1911         * WebProcess/Storage/WebSWClientConnection.cpp:
1912         (WebKit::WebSWClientConnection::didGetRegistrations):
1913         (WebKit::WebSWClientConnection::getRegistrations):
1914         * WebProcess/Storage/WebSWClientConnection.h:
1915         * WebProcess/Storage/WebSWClientConnection.messages.in:
1916
1917 2017-11-14  Youenn Fablet  <youenn@apple.com>
1918
1919         Implement ServiceWorker handle fetch for navigation loads
1920         https://bugs.webkit.org/show_bug.cgi?id=179404
1921
1922         Reviewed by Alex Christensen and Chris Dumez.
1923
1924         Update handle fetch algorithm to support navigation requests.
1925         In case of navigation requests, set service worker response mime type to text/html if none is provided.
1926
1927         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
1928         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
1929         * WebProcess/Storage/WebSWClientConnection.cpp:
1930         (WebKit::WebSWClientConnection::startFetch):
1931         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
1932         (WebKit::shouldHandleFetch):
1933         (WebKit::WebServiceWorkerProvider::handleFetch):
1934
1935 2017-11-14  Alex Christensen  <achristensen@webkit.org>
1936
1937         Remove Cocoa CFURLConnection loading code
1938         https://bugs.webkit.org/show_bug.cgi?id=179688
1939
1940         Reviewed by Antti Koivisto.
1941
1942         * NetworkProcess/Downloads/Download.h:
1943
1944 2017-11-14  Daniel Bates  <dabates@apple.com>
1945
1946         Update comment in FeatureDefines.xcconfig to reflect location of Visual Studio property files
1947         for feature defines
1948
1949         Following r195498 and r201917 the Visual Studio property files for feature defines have
1950         moved from directory WebKitLibraries/win/tools/vsprops to directory Source/cmake/tools/vsprops.
1951         Update the comment in FeatureDefines.xcconfig to reflect the new location and names of these
1952         files.
1953
1954         * Configurations/FeatureDefines.xcconfig:
1955
1956 2017-11-14  Brent Fulgham  <bfulgham@apple.com>
1957
1958         Whitelist some IOKIt properties to avoid sandbox violations on YouTube
1959         https://bugs.webkit.org/show_bug.cgi?id=179683
1960         <rdar://problem/35415368>
1961
1962         Reviewed by Dean Jackson.
1963
1964         YouTube video playback on some hardware (and some video encodings) generates sandbox violations. Add
1965         whitelist entries for the relevant IOKit properties needed to support these activities.
1966
1967         * WebProcess/com.apple.WebProcess.sb.in:
1968
1969 2017-11-14  Daniel Bates  <dabates@apple.com>
1970
1971         Mark WebChromeClient::requestStorageAccess() as final
1972         https://bugs.webkit.org/show_bug.cgi?id=179673
1973
1974         Reviewed by Sam Weinig.
1975
1976         Mark WebChromeClient::requestStorageAccess() as final so that it overrides the virtual function
1977         in ChromeClient with the same name and hence we actually call it through a ChromeClient pointer.
1978
1979         * WebProcess/WebCoreSupport/WebChromeClient.h:
1980
1981 2017-11-14  Youenn Fablet  <youenn@apple.com>
1982
1983         WebSWClientConnection should do IPC to StorageProcess if its WebSWOriginTable is not yet initialized
1984         https://bugs.webkit.org/show_bug.cgi?id=179668
1985
1986         Reviewed by Chris Dumez.
1987
1988         There may be cases where the origin table is not initialized and we would think there is no service worker registration.
1989         In such a case, we should go to the StorageProcess.
1990         StorageProcess is now sending an IPC message back to each registered SW connection so that WebProcess will know whether its map
1991         is correctly initialized or not.
1992
1993         Renaming hasServiceWorkerRegisteredForOrigin in mayHaveServiceWorkerRegisteredForOrigin.
1994
1995         * WebProcess/Storage/WebSWClientConnection.cpp:
1996         (WebKit::WebSWClientConnection::mayHaveServiceWorkerRegisteredForOrigin const):
1997         (WebKit::WebSWClientConnection::matchRegistration):
1998         (WebKit::WebSWClientConnection::hasServiceWorkerRegisteredForOrigin const): Deleted.
1999         * WebProcess/Storage/WebSWClientConnection.h:
2000         * WebProcess/Storage/WebSWOriginTable.h:
2001         (WebKit::WebSWOriginTable::isInitialized const):
2002         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
2003         (WebKit::shouldHandleFetch):
2004
2005 2017-11-14  Brent Fulgham  <bfulgham@apple.com>
2006
2007         Consolidate sysctl-read rules in WebProcess sandbox
2008         https://bugs.webkit.org/show_bug.cgi?id=179674
2009         <rdar://problem/35367154>
2010
2011         Reviewed by Dean Jackson.
2012
2013         Consolidate the various calls to 'allow sysctl-read' imported during Bug 179548 into
2014         the main function in the sandbox profile.
2015
2016         Remove the statement to grant global sysctl-read permissions that was copied into this
2017         sandbox profile in an earlier checkin. We started blocking the blanket read permissions in
2018         macOS 10.13, and want to continue to do so.
2019         
2020         The earlier "grant global read access" in 'system.sb' apparently allowed some sysctl reads
2021         to occur before we hit the block declaration in the WebContent sandbox. Now that we are
2022         consistently blocking systcl reads from the start, we need to add whitelist entries for a
2023         few more entries to avoid creating new sandbox violations.
2024
2025         * WebProcess/com.apple.WebProcess.sb.in:
2026
2027 2017-11-14  Alex Christensen  <achristensen@webkit.org>
2028
2029         Remove WebKit CFURLConnection code
2030         https://bugs.webkit.org/show_bug.cgi?id=179645
2031
2032         Reviewed by Alexey Proskuryakov.
2033
2034         The CFURLConnection code is Windows-specific now. Nobody can use it in modern WebKit.
2035
2036         * NetworkProcess/Downloads/Download.h:
2037         * NetworkProcess/Downloads/mac/DownloadMac.mm:
2038         * NetworkProcess/NetworkLoad.h:
2039         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2040         (WebKit::serverTrustCredential):
2041         * NetworkProcess/mac/NetworkLoadMac.mm:
2042         * Shared/Authentication/AuthenticationManager.cpp:
2043         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
2044         (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
2045         (WebKit::AuthenticationManager::cancelSingleChallenge):
2046         (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
2047         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
2048         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
2049         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
2050         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
2051         * Shared/WebProcessCreationParameters.cpp:
2052         (WebKit::WebProcessCreationParameters::encode const):
2053         (WebKit::WebProcessCreationParameters::decode):
2054         * Shared/WebProcessCreationParameters.h:
2055         * Shared/mac/WebCoreArgumentCodersMac.mm:
2056         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
2057         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
2058         * config.h:
2059
2060 2017-11-14  Alex Christensen  <achristensen@webkit.org>
2061
2062         Remove assertions added in r224791
2063         https://bugs.webkit.org/show_bug.cgi?id=178751#c10
2064
2065         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2066         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
2067         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
2068         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
2069         I had added assertions that sandbox extension handle consumption succeeds.
2070         In the API test IndexedDB.StructuredCloneBackwardCompatibility we get a sandbox extension handle
2071         to give access to a directory that does not exist and consumption fails.  We want it to fail,
2072         so my optimistic addition of a success assertion was incorrect.  The test passes without it
2073         and behaves like it used to.
2074
2075 2017-11-14  Tim Horton  <timothy_horton@apple.com>
2076
2077         Don't use -[NSString stringWithFormat:] to build defaults keys
2078         https://bugs.webkit.org/show_bug.cgi?id=179680
2079
2080         Reviewed by Simon Fraser.
2081
2082         * UIProcess/mac/WebPreferencesMac.mm:
2083         (WebKit::makeKey):
2084         (WebKit::debugUserDefaultsValue):
2085         Use string concatenation instead of stringWithFormat to build
2086         preference keys. This wasn't a huge cost, but it shaves a few milliseconds
2087         off process launch.
2088
2089 2017-11-14  Alex Christensen  <achristensen@webkit.org>
2090
2091         Clean up old URL parser remnants
2092         https://bugs.webkit.org/show_bug.cgi?id=179573
2093
2094         Reviewed by Darin Adler.
2095
2096         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
2097         (WebKit::WebContextMenuClient::searchWithGoogle):
2098         Use https if we do end up searching with google.
2099
2100 2017-11-14  Antti Koivisto  <antti@apple.com>
2101
2102         Enable display:contents by default
2103         https://bugs.webkit.org/show_bug.cgi?id=179655
2104
2105         Reviewed by Sam Weinig.
2106
2107         * Shared/WebPreferences.yaml:
2108
2109         Make non-experimental and enabled.
2110
2111 2017-11-10  Brent Fulgham  <bfulgham@apple.com>
2112
2113         Consolidate mach-lookup calls in WebProcess sandbox
2114         https://bugs.webkit.org/show_bug.cgi?id=179650
2115         <rdar://problem/35367154>
2116
2117         Reviewed by Dean Jackson.
2118
2119         Consolidate the various calls to 'allow mach-lookup' imported during Bug 179548 into the main
2120         function in the sandbox profile. Remove some entries that are not needed by WebKit.
2121
2122         Remove the statement to grant global permission to perform mach-lookup for any xpc
2123         service name that was copied into this sandbox profile in Bug 179548. We started blocking
2124         this in macOS 10.13 and want to continue to do so.
2125         
2126         The earlier "grant global permission" in 'system.sb' apparently allowed some xpc lookups to occur
2127         before we hit the block declaration in the WebContent sandbox. Now that we are consistently blocking
2128         mach lookups we need to add whitelist entries for a few more services to avoid creating new
2129         sandbox violations.
2130
2131         * WebProcess/com.apple.WebProcess.sb.in:
2132
2133 2017-11-14  Tim Horton  <timothy_horton@apple.com>
2134
2135         Long pressing a phone number with spaces in it results in a link sheet instead of a data detectors sheet
2136         https://bugs.webkit.org/show_bug.cgi?id=179646
2137         <rdar://problem/35337288>
2138
2139         Reviewed by Simon Fraser.
2140
2141         * UIProcess/ios/WKActionSheetAssistant.mm:
2142         (-[WKActionSheetAssistant showImageSheet]):
2143         (-[WKActionSheetAssistant showLinkSheet]):
2144         (-[WKActionSheetAssistant showDataDetectorsSheet]):
2145         * UIProcess/ios/WKContentViewInteraction.mm:
2146         (-[WKContentView _actionForLongPressFromPositionInformation:]):
2147         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
2148         Make use of canBePresentedByDataDetectors with our WebCore URL instead
2149         of (sometimes unsucessfully) reparsing the URL with NSURL's parser.
2150         Also, avoid a few unnecessary round-trips through String when converting
2151         from URL to NSURL.
2152
2153 2017-11-14  Brent Fulgham  <bfulgham@apple.com>
2154
2155         REGRESSION(r224799): WebKit crashes on Sierra due to sandbox violation
2156         https://bugs.webkit.org/show_bug.cgi?id=179656
2157         
2158         Unreviewed build fix.
2159
2160         * WebProcess/com.apple.WebProcess.sb.in: Switch to Dan's recommended version check.
2161
2162 2017-11-13  Joseph Pecoraro  <pecoraro@apple.com>
2163
2164         Give a ServiceWorker WebContentProcess a different display name
2165         https://bugs.webkit.org/show_bug.cgi?id=179653
2166
2167         Reviewed by Brady Eidson.
2168
2169         * UIProcess/WebProcessProxy.h:
2170         * UIProcess/WebProcessProxy.cpp:
2171         (WebKit::WebProcessProxy::create):
2172         Call connect after construction so virtual methods will use subclass implementations.
2173
2174         * UIProcess/ServiceWorkerProcessProxy.h:
2175         * UIProcess/ServiceWorkerProcessProxy.cpp:
2176         (WebKit::ServiceWorkerProcessProxy::create):
2177         Copy the pattern from WebProcessProxy to ensure connect() gets called after construction.
2178
2179         (WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
2180         Set a launch option to signal this is a Service Worker process.
2181
2182         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
2183         (WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
2184         * WebProcess/cocoa/WebProcessCocoa.mm:
2185         (WebKit::WebProcess::initializeProcessName):
2186         Consume the launch option to configuration the process name.
2187
2188 2017-11-13  Ryosuke Niwa  <rniwa@webkit.org>
2189
2190         REGRESSION(r224799): WebKit crashes at launch on macOS Sierra due to a sandbox violation
2191         https://bugs.webkit.org/show_bug.cgi?id=179656
2192
2193         Unreviewed. Revert r224799 on macOS Sierra.
2194
2195         * WebProcess/com.apple.WebProcess.sb.in:
2196
2197 2017-11-13  Chris Dumez  <cdumez@apple.com>
2198
2199         Send ServiceWorkerData structs to the WebProcesses instead of ServiceWorkerIdentifiers
2200         https://bugs.webkit.org/show_bug.cgi?id=179649
2201
2202         Reviewed by Brady Eidson.
2203
2204         * Shared/WebCoreArgumentCoders.h:
2205         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2206         (WebKit::WebSWServerConnection::updateRegistrationStateInClient):
2207         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
2208         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2209         * WebProcess/Storage/WebSWClientConnection.cpp:
2210         (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
2211         * WebProcess/Storage/WebSWClientConnection.h:
2212         * WebProcess/Storage/WebSWClientConnection.messages.in:
2213
2214 2017-11-13  Brady Eidson  <beidson@apple.com>
2215
2216         Massive "Server-process-to-context-process" connection overhaul.
2217         https://bugs.webkit.org/show_bug.cgi?id=179554
2218
2219         Reviewed by Chris Dumez.
2220
2221         * DerivedSources.make:
2222         * WebKit.xcodeproj/project.pbxproj:
2223
2224         * Shared/WebCoreArgumentCoders.h:
2225
2226         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2227         (WebKit::WebSWServerConnection::sendToContextProcess):
2228         (WebKit::WebSWServerConnection::installServiceWorkerContext): Deleted.
2229         (WebKit::WebSWServerConnection::fireInstallEvent): Deleted.
2230         (WebKit::WebSWServerConnection::fireActivateEvent): Deleted.
2231         (WebKit::WebSWServerConnection::setContextConnection): Deleted.
2232         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2233
2234         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp: Copied from Source/WebCore/workers/service/server/SWServerWorker.cpp.
2235         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
2236         (WebKit::WebSWServerToContextConnection::messageSenderConnection):
2237         (WebKit::WebSWServerToContextConnection::messageSenderDestinationID):
2238         (WebKit::WebSWServerToContextConnection::connectionClosed):
2239         (WebKit::WebSWServerToContextConnection::installServiceWorkerContext):
2240         (WebKit::WebSWServerToContextConnection::fireInstallEvent):
2241         (WebKit::WebSWServerToContextConnection::fireActivateEvent):
2242         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: Copied from Source/WebCore/workers/service/ServiceWorkerTypes.h.
2243         (WebKit::WebSWServerToContextConnection::create):
2244         (WebKit::WebSWServerToContextConnection::ipcConnection const):
2245         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: Copied from Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.messages.in.
2246
2247         * StorageProcess/StorageProcess.cpp:
2248         (WebKit::StorageProcess::didClose):
2249         (WebKit::StorageProcess::didReceiveMessage):
2250         (WebKit::StorageProcess::globalServerToContextConnection):
2251         (WebKit::StorageProcess::createServerToContextConnection):
2252         (WebKit::StorageProcess::didGetWorkerContextProcessConnection):
2253         (WebKit::StorageProcess::workerContextProcessConnection): Deleted.
2254         (WebKit::StorageProcess::createWorkerContextProcessConnection): Deleted.
2255         (WebKit::StorageProcess::serviceWorkerContextFailedToStart): Deleted.
2256         (WebKit::StorageProcess::serviceWorkerContextStarted): Deleted.
2257         (WebKit::StorageProcess::didFinishServiceWorkerInstall): Deleted.
2258         (WebKit::StorageProcess::didFinishServiceWorkerActivation): Deleted.
2259         (WebKit::StorageProcess::setServiceWorkerHasPendingEvents): Deleted.
2260         * StorageProcess/StorageProcess.h:
2261         * StorageProcess/StorageProcess.messages.in:
2262
2263         * StorageProcess/StorageToWebProcessConnection.cpp:
2264         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
2265         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
2266         (WebKit::StorageToWebProcessConnection::workerContextProcessConnectionCreated):
2267
2268         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2269         (WebKit::WebSWContextManagerConnection::installServiceWorker):
2270         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
2271         (WebKit::WebSWContextManagerConnection::fireInstallEvent):
2272         (WebKit::WebSWContextManagerConnection::fireActivateEvent):
2273         (WebKit::WebSWContextManagerConnection::didFinishInstall):
2274         (WebKit::WebSWContextManagerConnection::didFinishActivation):
2275         (WebKit::WebSWContextManagerConnection::setServiceWorkerHasPendingEvents):
2276         * WebProcess/Storage/WebSWContextManagerConnection.h:
2277         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2278
2279 2017-11-13  Brent Fulgham  <bfulgham@apple.com>
2280
2281         WebContent sandbox should not include 'system.sb'
2282         https://bugs.webkit.org/show_bug.cgi?id=179548
2283         <rdar://problem/35367154>
2284
2285         Reviewed by Darin Adler.
2286
2287         Stop including 'system.sb', and just include the portions of that sandbox that we
2288         actually use in WebContent Process. This is the first step in some further sandbox
2289         tightening.
2290
2291         * WebProcess/com.apple.WebProcess.sb.in:
2292
2293 2017-11-13  Simon Fraser  <simon.fraser@apple.com>
2294
2295         When navigating back to a page, compositing layers may not use accelerated drawing
2296         https://bugs.webkit.org/show_bug.cgi?id=178749
2297         rdar://problem/35158946
2298
2299         Reviewed by Dean Jackson.
2300
2301         Avoid assertions when a test enables accelerated drawing (which we can't support
2302         in the iOS simulator).
2303
2304         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
2305         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
2306
2307 2017-11-13  Youenn Fablet  <youenn@apple.com>
2308
2309         matchRegistration does not need to go to StorageProcess if no service worker is registered
2310         https://bugs.webkit.org/show_bug.cgi?id=179480
2311
2312         Reviewed by Chris Dumez.
2313
2314         Removed origin store handling from StorageProcess since it is now handled within SWServer.
2315         Updated clearing of web site data accordingly.
2316         Optimized matchRegistration by looking at the origin store before doing any IPC.
2317         Do IPC to the StorageProcess if the origin store is not yet initialized on the WebProcess.
2318
2319         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
2320         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2321         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
2322         (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
2323         * StorageProcess/StorageProcess.cpp:
2324         (WebKit::StorageProcess::deleteWebsiteData):
2325         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
2326         (WebKit::StorageProcess::swServerForSession):
2327         (WebKit::StorageProcess::swOriginStoreForSession):
2328         (WebKit::StorageProcess::registerSWServerConnection):
2329         (WebKit::StorageProcess::unregisterSWServerConnection):
2330         (WebKit::StorageProcess::ensureSWOriginStoreForSession): Deleted.
2331         (WebKit::StorageProcess::swOriginStoreForSession const): Deleted.
2332         * StorageProcess/StorageProcess.h:
2333         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
2334         (WebKit::WebSWOriginStore::addToStore):
2335         (WebKit::WebSWOriginStore::removeFromStore):
2336         (WebKit::WebSWOriginStore::clearStore):
2337         (WebKit::WebSWOriginStore::add): Deleted.
2338         (WebKit::WebSWOriginStore::remove): Deleted.
2339         (WebKit::WebSWOriginStore::clear): Deleted.
2340         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
2341         * WebProcess/Storage/WebSWClientConnection.cpp:
2342         (WebKit::WebSWClientConnection::matchRegistration):
2343
2344 2017-11-13  Alex Christensen  <achristensen@webkit.org>
2345
2346         Merge NetworkProcess::EnsurePrivateBrowsingSession and NetworkProcess::AddWebsiteDataStore into one message type
2347         https://bugs.webkit.org/show_bug.cgi?id=178751
2348
2349         Reviewed by Brady Eidson.
2350
2351         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2352         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
2353         * NetworkProcess/NetworkProcess.cpp:
2354         (WebKit::NetworkProcess::initializeNetworkProcess):
2355         (WebKit::NetworkProcess::ensurePrivateBrowsingSession): Deleted.
2356         * NetworkProcess/NetworkProcess.h:
2357         * NetworkProcess/NetworkProcess.messages.in:
2358         * NetworkProcess/RemoteNetworkingContext.h:
2359         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2360         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
2361         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Deleted.
2362         * Shared/WebsiteDataStoreParameters.cpp:
2363         (WebKit::WebsiteDataStoreParameters::legacyPrivateSessionParameters):
2364         * Shared/WebsiteDataStoreParameters.h:
2365         * UIProcess/WebProcessPool.cpp:
2366         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
2367         (WebKit::WebProcessPool::createNewWebProcess):
2368         (WebKit::WebProcessPool::pageAddedToProcess):
2369         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2370         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
2371         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
2372         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
2373         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
2374         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Deleted.
2375         * WebProcess/WebPage/WebPage.cpp:
2376         (WebKit::WebPage::setSessionID):
2377         * WebProcess/WebProcess.cpp:
2378         (WebKit::WebProcess::ensurePrivateBrowsingSession): Deleted.
2379         * WebProcess/WebProcess.h:
2380         * WebProcess/WebProcess.messages.in:
2381
2382 2017-11-13  Alex Christensen  <achristensen@webkit.org>
2383
2384         Add logs to debug content extension test failures
2385         https://bugs.webkit.org/show_bug.cgi?id=179624
2386
2387         Reviewed by Chris Dumez.
2388
2389         * UIProcess/API/APIContentRuleListStore.cpp:
2390         (API::compiledToFile):
2391         Right now I'm seeing this log:
2392         "Rule list compilation failed: Unspecified error during compile."
2393         I need more information to debug what is failing on the bots.
2394
2395 2017-11-07  Brian Burg  <bburg@apple.com>
2396
2397         Web Automation: inViewCenterPoint should not include topContentInset when computed in viewport coordinates
2398         https://bugs.webkit.org/show_bug.cgi?id=179129
2399         <rdar://problem/35297038>
2400
2401         Reviewed by Simon Fraser.
2402
2403         When computing the in view center point per W3C specification, the top content inset
2404         is inadvertently added back in when converting to the root view coordinate system.
2405
2406         This patch reworks the protocol command so that it explicitly requests a coordinate
2407         system, with options for "Page" (root / contents), "LayoutViewport", and "VisualViewport".
2408         The latter is not implemented in this patch, since it is intended for use on iOS someday.
2409
2410         * UIProcess/Automation/Automation.json:
2411         Change usesViewport to CoordinateSystem.
2412         Add a new coordinate system enum type and use it.
2413         Fix relevant comments for Automation.computElementLayout.
2414
2415         * UIProcess/Automation/WebAutomationSession.h:
2416         * UIProcess/Automation/WebAutomationSession.cpp:
2417         (WebKit::protocolStringToCoordinateSystem):
2418         (WebKit::WebAutomationSession::computeElementLayout):
2419         Parse the requested coordinate system and send it in the message to the web process.
2420
2421         * WebKit.xcodeproj/project.pbxproj:
2422         * WebProcess/Automation/WebAutomationSessionProxy.messages.in:
2423         * WebProcess/Automation/WebAutomationSessionProxy.h:
2424         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2425         (WebKit::WebAutomationSessionProxy::computeElementLayout):
2426         Rework the implementation. Get the element bounds and in-view center point in
2427         client coordinates and convert back to root view coordinates for CoordinateSystem::Page.
2428
2429 2017-11-08  Keith Miller  <keith_miller@apple.com>
2430
2431         Async iteration should only fetch the next method once and add feature flag
2432         https://bugs.webkit.org/show_bug.cgi?id=179451
2433
2434         Reviewed by Geoffrey Garen.
2435
2436         Add feature flag for Async iteration.
2437
2438         * Configurations/FeatureDefines.xcconfig:
2439
2440 2017-11-13  Mark Lam  <mark.lam@apple.com>
2441
2442         Add more overflow check book-keeping for MarkedArgumentBuffer.
2443         https://bugs.webkit.org/show_bug.cgi?id=179634
2444         <rdar://problem/35492517>
2445
2446         Reviewed by Saam Barati.
2447
2448         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
2449         (WebKit::NPJSObject::construct):
2450         (WebKit::NPJSObject::invoke):
2451
2452 2017-11-13  Timothy Horton  <timothy_horton@apple.com>
2453
2454         Address some post-landing review comments from r224728
2455         https://bugs.webkit.org/show_bug.cgi?id=179576
2456
2457         * Platform/IPC/mac/MachMessage.h:
2458         (IPC::MachMessage::setMessageReceiverName):
2459         (IPC::MachMessage::setMessageName):
2460         More moving!
2461
2462 2017-11-13  Tim Horton  <timothy_horton@apple.com>
2463
2464         Occasional MobileSafari crash under -[WKPDFView web_setMinimumSize:]
2465         https://bugs.webkit.org/show_bug.cgi?id=179628
2466         <rdar://problem/34773037>
2467
2468         Reviewed by Simon Fraser.
2469
2470         * UIProcess/ios/WKPDFView.mm:
2471         (-[WKPDFView _computePageAndDocumentFrames]):
2472         Similar to r223444, avoid propagating null CGRects into the view hierarchy.
2473         In this case, the null rect comes from applying margins to a rect that is 
2474         smaller than the margins. We could check for that specifically, but a
2475         more-general check for a null rect seems reasonable.
2476
2477 2017-11-13  Tim Horton  <timothy_horton@apple.com>
2478
2479         Use the real mach type instead of reinterpret_casting in MachMessage
2480         https://bugs.webkit.org/show_bug.cgi?id=179629
2481
2482         Reviewed by Dan Bernstein.
2483
2484         * Platform/IPC/mac/MachMessage.cpp:
2485         (IPC::MachMessage::header):
2486         * Platform/IPC/mac/MachMessage.h:
2487         Just use mach_msg_header_t proper, and avoid the reinterpret_cast.
2488         This also corrects the alignment of the struct on platforms where
2489         alignof(mach_msg_header_t) != alignof(uint8_t).
2490
2491 2017-11-13  Gabriel Ivascu  <givascu@igalia.com>
2492
2493         [GTK] Automatically adjust font size when gtk-xft-dpi changes
2494         https://bugs.webkit.org/show_bug.cgi?id=142673
2495
2496         Reviewed by Michael Catanzaro.
2497
2498         * UIProcess/API/glib/WebKitSettings.cpp:
2499         (webKitSettingsDispose):
2500         (webKitSettingsConstructed):
2501         (webkit_settings_class_init):
2502
2503 2017-11-13  Chris Dumez  <cdumez@apple.com>
2504
2505         Implement "Service Worker Has No Pending Events" / "Update Service Worker Extended Events Set" algorithms
2506         https://bugs.webkit.org/show_bug.cgi?id=179618
2507
2508         Reviewed by Brady Eidson.
2509
2510         * StorageProcess/StorageProcess.cpp:
2511         (WebKit::StorageProcess::setServiceWorkerHasPendingEvents):
2512         * StorageProcess/StorageProcess.h:
2513         * StorageProcess/StorageProcess.messages.in:
2514         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2515         (WebKit::WebSWContextManagerConnection::setServiceWorkerHasPendingEvents):
2516         * WebProcess/Storage/WebSWContextManagerConnection.h:
2517
2518 2017-11-13  Wenson Hsieh  <wenson_hsieh@apple.com>
2519
2520         [Attachment Support] Implement SPI for clients to request data for a given attachment
2521         https://bugs.webkit.org/show_bug.cgi?id=179586
2522         <rdar://problem/35355720>
2523
2524         Reviewed by Darin Adler.
2525
2526         Adds support in WebKit for fetching data for a given attachment element. See WebCore/ChangeLog for more details.
2527         Most of the changes here are boilerplate plumbing of -requestAttachmentData through the client layers.
2528
2529         Test coverage by augmenting existing API tests in WKAttachmentTests, and adding 3 new tests.
2530
2531         * UIProcess/API/APIAttachment.cpp:
2532         (API::Attachment::requestData):
2533         * UIProcess/API/APIAttachment.h:
2534         * UIProcess/API/Cocoa/_WKAttachment.h:
2535         * UIProcess/API/Cocoa/_WKAttachment.mm:
2536         (-[_WKAttachment requestData:]):
2537         * UIProcess/WebPageProxy.cpp:
2538         (WebKit::WebPageProxy::sharedBufferCallback):
2539
2540         Add a new IPC callback helper type, SharedBufferCallback. This is similar to the existing DataCallback, but
2541         instead of deserializing to an API::Data, we convert to a SharedBuffer instead. Additionally,
2542         SharedBufferCallback is able to draw a distinction between null data and empty data. This allows -requestData:
2543         to distinguish between cases where (for instance) the data for a given attachment is an empty blob, and when
2544         the attachment doesn't exist at all.
2545
2546         (WebKit::WebPageProxy::dataCallback):
2547         (WebKit::WebPageProxy::insertAttachment):
2548         (WebKit::WebPage::invokeSharedBufferCallback):
2549         (WebKit::WebPageProxy::requestAttachmentData):
2550         * UIProcess/WebPageProxy.h:
2551         * UIProcess/WebPageProxy.messages.in:
2552         * WebProcess/WebPage/WebPage.cpp:
2553         (WebKit::WebPage::requestAttachmentData):
2554         * WebProcess/WebPage/WebPage.h:
2555         * WebProcess/WebPage/WebPage.messages.in:
2556
2557 2017-11-12  Darin Adler  <darin@apple.com>
2558
2559         More is<> and downcast<>, less static_cast<>
2560         https://bugs.webkit.org/show_bug.cgi?id=179600
2561
2562         Reviewed by Chris Dumez.
2563
2564         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp:
2565         (WebKit::wrap): Use is/downcast.
2566         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
2567         (WebKit::WebEditorClient::handleKeyboardEvent): Ditto.
2568         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
2569         (WebKit::WebEditorClient::handleKeyboardEvent): Ditto.
2570         * WebProcess/WebPage/WebPage.cpp:
2571         (WebKit::WebPage::handleEditingKeyboardEvent): Ditto.
2572         * WebProcess/WebPage/mac/WebPageMac.mm:
2573         (WebKit::frameForEvent): Ditto.
2574
2575 2017-11-12  Gabriel Ivascu  <givascu@igalia.com>
2576
2577         [GTK] Add functionality to handle font sizes in points
2578         https://bugs.webkit.org/show_bug.cgi?id=179285
2579
2580         Reviewed by Carlos Garcia Campos and Michael Catanzaro.
2581
2582         * UIProcess/API/glib/WebKitSettings.cpp:
2583         (webkit_settings_class_init):
2584         (webkit_settings_font_size_to_points):
2585         (webkit_settings_font_size_to_pixels):
2586         * UIProcess/API/gtk/WebKitSettings.h:
2587         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2588
2589 2017-11-11  Tim Horton  <timothy_horton@apple.com>
2590
2591         Increase the alignment requirement of WKObject's wrapped C++ object
2592         https://bugs.webkit.org/show_bug.cgi?id=179518
2593
2594         Reviewed by Dan Bernstein.
2595
2596         * Shared/API/APIObject.h:
2597         * Shared/Cocoa/APIObject.mm:
2598         (API::allocateWKObject):
2599         (API::Object::fromWKObjectExtraSpace):
2600         (API::Object::newObject):
2601         * Shared/Cocoa/WKObject.mm:
2602         (-[WKObject dealloc]):
2603         (-[WKObject _apiObject]):
2604         * UIProcess/API/Cocoa/WKConnection.mm:
2605         (-[WKConnection dealloc]):
2606         (-[WKConnection _apiObject]):
2607         (-[WKConnection _connection]):
2608         Increase the alignment of the C++ object stored inside WKObject's extra space
2609         to 8-bytes, for platforms where some types require greater-than-pointer alignment.
2610         To achieve this, increase the size of the extra-space allocation by the difference
2611         between 8 bytes and pointer-alignment, and then align within that.
2612
2613 2017-11-11  Tim Horton  <timothy_horton@apple.com>
2614
2615         Avoid composing the message + recipient name for crash logs until a failure actually occurs
2616         https://bugs.webkit.org/show_bug.cgi?id=179576
2617
2618         Reviewed by Dan Bernstein.
2619
2620         * Platform/IPC/mac/ConnectionMac.mm:
2621         (IPC::Connection::sendMessage):
2622         (IPC::Connection::sendOutgoingMessage):
2623         * Platform/IPC/mac/MachMessage.h:
2624         (IPC::MachMessage::messageReceiverName const):
2625         (IPC::MachMessage::setMessageReceiverName):
2626         (IPC::MachMessage::messageName const):
2627         (IPC::MachMessage::setMessageName):
2628         Store the message name and receiver name separately on MachMessage,
2629         only composing them into a string if the message is unhandled. This
2630         makes the time spent composing the string in sendOutgoingMessage
2631         completely disappear. In absolute terms, it wasn't huge, but if you
2632         do enough IPC it starts to add up.
2633
2634 2017-11-10  Chris Dumez  <cdumez@apple.com>
2635
2636         [Service Workers] Implement "Try Activate" / "Activate" algorithms
2637         https://bugs.webkit.org/show_bug.cgi?id=179436
2638
2639         Reviewed by Brady Eidson.
2640
2641         Implement proper "Try Activate" / "Activate" algorithms as per:
2642         - https://w3c.github.io/ServiceWorker/#try-activate-algorithm
2643         - https://w3c.github.io/ServiceWorker/#activation-algorithm
2644
2645         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2646         (WebKit::WebSWServerConnection::fireActivateEvent):
2647         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2648         * StorageProcess/StorageProcess.cpp:
2649         (WebKit::StorageProcess::didFinishServiceWorkerActivation):
2650         * StorageProcess/StorageProcess.h:
2651         * StorageProcess/StorageProcess.messages.in:
2652         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2653         (WebKit::WebSWContextManagerConnection::fireActivateEvent):
2654         (WebKit::WebSWContextManagerConnection::didFinishActivation):
2655         * WebProcess/Storage/WebSWContextManagerConnection.h:
2656         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2657
2658 2017-11-10  John Wilander  <wilander@apple.com>
2659
2660         Ignore HSTS for partitioned, cross-origin subresource requests
2661         https://bugs.webkit.org/show_bug.cgi?id=178993
2662         <rdar://problem/34962462>
2663
2664         Reviewed by Brent Fulgham.
2665
2666         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2667         (downgradeRequest):
2668             Convenience function to downgrade a request if
2669             CFNetwork as already upgraded it during
2670             canonicalization. This allows the rest of 
2671             WebKit's processing to function, such as UIR
2672             and mixed content blocking.
2673         (updateIgnoreStrictTransportSecuritySettingIfNecessary):
2674             Adds and removed the ignore request accordingly.
2675         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
2676             Now asks CFNetwork to ignore HSTS on resource loads we
2677             partition cookies for.
2678         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
2679             Now asks CFNetwork to ignore HSTS on resource loads we
2680             partition cookies for.
2681
2682 2017-11-10  Alex Christensen  <achristensen@webkit.org>
2683
2684         _WKThumbnailView initialization with WKWebView needs to call correct initWithFrame
2685         https://bugs.webkit.org/show_bug.cgi?id=179537
2686         <rdar://problem/35275219>
2687
2688         Reviewed by Darin Adler.
2689
2690         I introduced this in r223439 and made an ObjC mistake.  This is what I get for adding SPI with no tests.
2691         I fixed this by making the existing WKView/_WKThumbnailView API tests work with WKWebView.
2692
2693         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
2694         (-[_WKThumbnailView initWithFrame:fromWKWebView:]):
2695
2696 2017-11-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2697
2698         [GTK][WPE] Switch to use API::NavigationClient
2699         https://bugs.webkit.org/show_bug.cgi?id=178720
2700
2701         Reviewed by Alex Christensen.
2702
2703         Replace WebKitLoaderClient and WebKitPolicyClient with WebKitNavigationClient that implements
2704         API::NavigationClient.
2705
2706         * PlatformGTK.cmake:
2707         * PlatformWPE.cmake:
2708         * UIProcess/API/APINavigationAction.h: Add new constructor that receives a target frame name instead of a target
2709         frame info.
2710         * UIProcess/API/APINavigationClient.h:
2711         (API::NavigationClient::didDisplayInsecureContent): Added.
2712         (API::NavigationClient::didRunInsecureContent): Added.
2713         (API::NavigationClient::decidePolicyForNavigationResponse): Change NavigationResponse parameter to be a
2714         Ref<NavigationResponse>&& instead of a NavigationResponse&.
2715         * UIProcess/API/C/WKPage.cpp:
2716         (WKPageSetPageNavigationClient): Update NavigationResponse parameter.
2717         * UIProcess/API/glib/WebKitBackForwardList.cpp:
2718         (webkitBackForwardListChanged):
2719         * UIProcess/API/glib/WebKitBackForwardListPrivate.h:
2720         * UIProcess/API/glib/WebKitNavigationAction.cpp:
2721         (webkitNavigationActionCreate): Wrap the given API::NavigationAction.
2722         (webkit_navigation_action_get_navigation_type): Use the wrapped API::NavigationAction.
2723         (webkit_navigation_action_get_mouse_button): Ditto.
2724         (webkit_navigation_action_get_modifiers): Ditto.
2725         (webkit_navigation_action_get_request): Ditto.
2726         (webkit_navigation_action_is_user_gesture): Ditto.
2727         (webkit_navigation_action_is_redirect): Ditto.
2728         * UIProcess/API/glib/WebKitNavigationActionPrivate.h:
2729         (_WebKitNavigationAction::_WebKitNavigationAction):
2730         * UIProcess/API/glib/WebKitNavigationClient.cpp: Renamed from Source/WebKit/UIProcess/API/glib/WebKitLoaderClient.cpp.
2731         (NavigationClient::NavigationClient):
2732         (attachNavigationClientToView):
2733         * UIProcess/API/glib/WebKitNavigationClient.h: Renamed from Source/WebKit/UIProcess/API/glib/WebKitLoaderClient.h.
2734         * UIProcess/API/glib/WebKitNavigationPolicyDecision.cpp:
2735         (webkit_navigation_policy_decision_get_frame_name): Add FIXME.
2736         (webkitNavigationPolicyDecisionCreate): Get the target frame name from the API::NavigationAction.
2737         * UIProcess/API/glib/WebKitNavigationPolicyDecisionPrivate.h:
2738         * UIProcess/API/glib/WebKitPolicyClient.cpp: Removed.
2739         * UIProcess/API/glib/WebKitPolicyClient.h: Removed.
2740         * UIProcess/API/glib/WebKitPolicyDecision.cpp:
2741         (webkitPolicyDecisionSetListener): Remove the madePolicyDecision boolean member, we can null-check the listener instead.
2742         (webkit_policy_decision_use): Ensure listener is nullptr after being invoked to prevent the decision from being made
2743         more than once.
2744         (webkit_policy_decision_ignore): Ditto.
2745         (webkit_policy_decision_download): Ditto.
2746         * UIProcess/API/glib/WebKitPolicyDecisionPrivate.h:
2747         * UIProcess/API/glib/WebKitResponsePolicyDecision.cpp:
2748         (webkit_response_policy_decision_get_request): Use the wrapped API::NavigationResponse.
2749         (webkit_response_policy_decision_get_response): Ditto.
2750         (webkit_response_policy_decision_is_mime_type_supported): Ditto.
2751         (webkitResponsePolicyDecisionCreate): Wrap the given API::NavigationResponse.
2752         * UIProcess/API/glib/WebKitResponsePolicyDecisionPrivate.h:
2753         * UIProcess/API/glib/WebKitUIClient.cpp:
2754         (UIClient::createNewPage): Create the WebKitNavigationAction from a new API::NavigationAction.
2755         * UIProcess/API/glib/WebKitWebView.cpp:
2756         (webkitWebViewConstructed): Attach navigation client.
2757         * UIProcess/Cocoa/NavigationState.h: Update API::NavigationResponse parameter of decidePolicyForNavigationResponse.
2758         * UIProcess/Cocoa/NavigationState.mm:
2759         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
2760         * UIProcess/WebPageProxy.cpp:
2761         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame): Notify the navigation client if it's used.
2762         (WebKit::WebPageProxy::didRunInsecureContentForFrame): Ditto.
2763         (WebKit::WebPageProxy::decidePolicyForNewWindowAction): Use the new API::NavigationAction constructor to pass
2764         the target frame name, instead of a null target frame info.
2765         (WebKit::WebPageProxy::decidePolicyForResponse): Move the API::NavigationResponse.
2766
2767 2017-11-09  Chris Dumez  <cdumez@apple.com>
2768
2769         Unreviewed, rolling out r224661.
2770
2771         Broke build on several internal Mac/iOS bots
2772
2773         Reverted changeset:
2774
2775         "Ignore HSTS for partitioned, cross-origin subresource
2776         requests"
2777         https://bugs.webkit.org/show_bug.cgi?id=178993
2778         https://trac.webkit.org/changeset/224661
2779
2780 2017-11-09  Chris Dumez  <cdumez@apple.com>
2781
2782         ServiceWorkerRegistration objects may get recycled for different SWServerRegistration objects
2783         https://bugs.webkit.org/show_bug.cgi?id=179517
2784
2785         Reviewed by Brady Eidson.
2786
2787         * Scripts/webkit/messages.py:
2788         (forward_declarations_and_headers):
2789         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2790         (WebKit::WebSWServerConnection::updateRegistrationStateInClient):
2791         (WebKit::WebSWServerConnection::fireUpdateFoundEvent):
2792         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2793         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2794         * WebProcess/Storage/WebSWClientConnection.cpp:
2795         (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer):
2796         (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):
2797         * WebProcess/Storage/WebSWClientConnection.h:
2798         * WebProcess/Storage/WebSWClientConnection.messages.in:
2799
2800 2017-11-09  John Wilander  <wilander@apple.com>
2801
2802         Ignore HSTS for partitioned, cross-origin subresource requests
2803         https://bugs.webkit.org/show_bug.cgi?id=178993
2804         <rdar://problem/34962462>
2805
2806         Reviewed by Brent Fulgham.
2807
2808         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2809         (downgradeRequest):
2810             Convenience function to downgrade a request if
2811             CFNetwork as already upgraded it during
2812             canonicalization. This allows the rest of 
2813             WebKit's processing to function, such as UIR
2814             and mixed content blocking.
2815         (updateIgnoreStrictTransportSecuritySettingIfNecessary):
2816             Adds and removed the ignore request accordingly.
2817         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
2818             Now asks CFNetwork to ignore HSTS on resource loads we
2819             partition cookies for.
2820         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
2821             Now asks CFNetwork to ignore HSTS on resource loads we
2822             partition cookies for.
2823
2824 2017-11-09  Chris Dumez  <cdumez@apple.com>
2825
2826         Implement real post 'install' event steps of the Install algorithm (steps 14+)
2827         https://bugs.webkit.org/show_bug.cgi?id=179401
2828
2829         Reviewed by Brady Eidson.
2830
2831         Implement step 14+ of Install algorithm, as per:
2832         - https://w3c.github.io/ServiceWorker/#installation-algorithm
2833
2834         * Scripts/webkit/messages.py:
2835         (headers_for_type):
2836         * Shared/WebCoreArgumentCoders.h:
2837         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2838         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
2839         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2840         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2841         * WebProcess/Storage/WebSWClientConnection.cpp:
2842         (WebKit::WebSWClientConnection::didResolveRegistrationPromise):
2843         * WebProcess/Storage/WebSWClientConnection.h:
2844         * WebProcess/Storage/WebSWClientConnection.messages.in:
2845
2846 2017-11-09  Megan Gardner  <megan_gardner@apple.com>
2847
2848         Clean out unused selection items from UIKitSPI
2849         https://bugs.webkit.org/show_bug.cgi?id=179459
2850
2851         Reviewed by Tim Horton.
2852
2853         Many of these should have been removed from previous commits, but they were missed.
2854         None of these enums or methods are being used by WebKit anymore, and removing them will keep things
2855         clean and allow UIKit to remove things that are not used at all by anyone anymore.
2856
2857         * Platform/spi/ios/UIKitSPI.h:
2858
2859 2017-11-09  Christopher Reid  <chris.reid@sony.com>
2860
2861         Use enum classes within FileSystem
2862         https://bugs.webkit.org/show_bug.cgi?id=175172
2863
2864         Reviewed by Darin Adler.
2865
2866         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
2867         * NetworkProcess/NetworkDataTaskBlob.cpp:
2868         * NetworkProcess/cache/NetworkCache.cpp:
2869         * NetworkProcess/capture/NetworkCaptureManager.cpp:
2870         * NetworkProcess/capture/NetworkCaptureRecorder.cpp:
2871         * Shared/WebMemorySampler.cpp:
2872         * UIProcess/API/APIContentRuleListStore.cpp:
2873         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
2874
2875 2017-11-09  Youenn Fablet  <youenn@apple.com>
2876
2877         ServiceWorkerClientFetch should create not null ResourceError
2878         https://bugs.webkit.org/show_bug.cgi?id=179485
2879
2880         Reviewed by Darin Adler.
2881
2882         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2883         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
2884
2885 2017-11-09  Andy Estes  <aestes@apple.com>
2886
2887         [iOS] Adopt UIPreviewDataAttachmentListIsContentManaged
2888         https://bugs.webkit.org/show_bug.cgi?id=179458
2889         <rdar://problem/35034691>
2890
2891         Reviewed by Dan Bernstein.
2892
2893         * Platform/spi/ios/UIKitSPI.h:
2894         * UIProcess/ios/WKContentViewInteraction.mm:
2895         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
2896
2897 2017-11-08  Joseph Pecoraro  <pecoraro@apple.com>
2898
2899         Include a more complete block signature in public headers to avoid potential -Wstrict-prototypes warnings
2900         https://bugs.webkit.org/show_bug.cgi?id=179466
2901
2902         Reviewed by Dan Bernstein.
2903
2904         * UIProcess/API/Cocoa/WKHTTPCookieStore.h:
2905         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
2906         (-[WKHTTPCookieStore setCookie:completionHandler:]):
2907         (-[WKHTTPCookieStore deleteCookie:completionHandler:]):
2908
2909 2017-11-08  Jeremy Jones  <jeremyj@apple.com>
2910
2911         Make WKFullScreenWidnowController more robust against modification by the embedding app.
2912         https://bugs.webkit.org/show_bug.cgi?id=179413
2913         rdar://problem/35408061
2914
2915         Reviewed by Darin Adler.
2916
2917         Present fullscreen UViewController in a separate UIWindow to prevent interaction with the embedding app's
2918         UIViewController hierarchy.
2919
2920         Immediately tear down the fullscreen interface if the embedding app removes the WKWebView from the fullscreen window.
2921         This prevents the fullscreen interface from getting into an invalid state.
2922
2923         Preserve scrollView.zoomScale because it is not effectively preserved by the more indirect _viewScale.
2924
2925         Use a custom root view controller to allow hiding of the status bar.
2926
2927         Remove the no-longer-necessary dispatch_after calls during enter and exit fullscreen.
2928
2929         * UIProcess/API/Cocoa/WKWebView.mm:
2930         (-[WKWebView removeFromSuperview]):
2931         * UIProcess/ios/WKFullScreenWindowControllerIOS.h:
2932         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
2933         (WebKit::WKWebViewState::applyTo):
2934         (WebKit::WKWebViewState::store):
2935         (-[_WKFullScreenViewController loadView]):
2936         (-[_WKFullscreenRootViewController prefersStatusBarHidden]):
2937         (-[WKFullScreenWindowController enterFullScreen]):
2938         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
2939         (-[WKFullScreenWindowController completedExitFullScreen]):
2940         (-[WKFullScreenWindowController exitFullscreenImmediately]):
2941         (-[WKFullScreenWindowController close]):
2942         (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
2943         (-[_WKFullScreenViewController viewDidDisappear:]): Deleted.
2944
2945 2017-11-08  Jeremy Jones  <jeremyj@apple.com>
2946
2947         HTMLMediaElement should not use element fullscreen on iOS
2948         https://bugs.webkit.org/show_bug.cgi?id=179418
2949         rdar://problem/35409277
2950
2951         Reviewed by Eric Carlson.
2952
2953         Add ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN to determine if HTMLMediaElement should use element full screen or not.
2954
2955         * Configurations/FeatureDefines.xcconfig:
2956
2957 2017-11-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2958
2959         [Attachment Support] Implement delegate hooks for attachment element insertion and removal
2960         https://bugs.webkit.org/show_bug.cgi?id=179016
2961         <rdar://problem/35250890>
2962
2963         Reviewed by Tim Horton.
2964
2965         See WebCore/ChangeLog for more details.
2966
2967         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2968         * UIProcess/API/Cocoa/WKWebView.mm:
2969         (-[WKWebView _didInsertAttachment:]):
2970         (-[WKWebView _didRemoveAttachment:]):
2971         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2972         * UIProcess/Cocoa/PageClientImplCocoa.h:
2973         * UIProcess/Cocoa/PageClientImplCocoa.mm:
2974         (WebKit::PageClientImplCocoa::didInsertAttachment):
2975         (WebKit::PageClientImplCocoa::didRemoveAttachment):
2976         * UIProcess/PageClient.h:
2977         (WebKit::PageClient::didInsertAttachment):
2978         (WebKit::PageClient::didRemoveAttachment):
2979         * UIProcess/WebPageProxy.cpp:
2980         (WebKit::WebPageProxy::didInsertAttachment):
2981         (WebKit::WebPageProxy::didRemoveAttachment):
2982         * UIProcess/WebPageProxy.h:
2983         * UIProcess/WebPageProxy.messages.in:
2984         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2985         (WebKit::WebEditorClient::didInsertAttachment):
2986         (WebKit::WebEditorClient::didRemoveAttachment):
2987         * WebProcess/WebCoreSupport/WebEditorClient.h:
2988
2989 2017-11-08  Carlos Garcia Campos  <cgarcia@igalia.com>
2990
2991         REGRESSION(r223773): [GTK] WebKitWebInspector bring-to-front signal is emitted right after open-window
2992         https://bugs.webkit.org/show_bug.cgi?id=179365
2993
2994         Reviewed by Michael Catanzaro.
2995
2996         In the GTK+ API, open-window already implies presenting the window to bring it to the front, so it's not
2997         expected that bring-to-front is emitted on open. This is happening since r223773 that moved common code from
2998         platform specific inspector files to the main file, but in the case of open the mac implementation was not
2999         exactly the same as the GTK+ one. This broke /webkit2/WebKitWebInspector/default and
3000         /webkit2/WebKitWebInspector/manual-attach-detach.
3001
3002         * UIProcess/WebInspectorProxy.cpp:
3003         (WebKit::WebInspectorProxy::open): Set m_isOpening for the scope of the function.
3004         * UIProcess/WebInspectorProxy.h: Add m_isOpening.
3005         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3006         (WebKit::WebInspectorProxy::platformBringToFront): Return early if m_isOpening is true.
3007
3008 2017-11-07  Carlos Garcia Campos  <cgarcia@igalia.com>
3009
3010         REGRESSION(r224179): [GTK] Several WebViewEditor tests are failing since r224179
3011         https://bugs.webkit.org/show_bug.cgi?id=179366
3012
3013         Reviewed by Michael Catanzaro.
3014
3015         In r224179, webkit_web_view_can_execute_editing_command() was optimized to use the sync path for commands
3016         supported by the WebViewEditorState, but the state requires a redraw to be up to date. We can't know if
3017         WebViewEditorState is in sync, when webkit_web_view_can_execute_editing_command() is called, so we always need
3018         to ask the web process.
3019
3020         * UIProcess/API/glib/WebKitWebView.cpp:
3021         (webkit_web_view_can_execute_editing_command):
3022
3023 2017-11-07  Carlos Garcia Campos  <cgarcia@igalia.com>
3024
3025         [GTK][WPE] Build inspector resources using copy-user-interface-resources.pl script
3026         https://bugs.webkit.org/show_bug.cgi?id=179317
3027
3028         Reviewed by Michael Catanzaro.
3029
3030         This is the script used by Apple and it has several advantages:
3031
3032           - It allows to combine and minify most of the js and css files, which improves performance and binary size.
3033           - It removes the debug resources and assertions in production builds.
3034           - It allows to remove the test resources in production builds.
3035
3036         The patch also moves the common cmake code to generate the resources to a new file InspectorGResources.cmake included
3037         by GTK+ and WPE platform cmake files.
3038
3039         * InspectorGResources.cmake: Added.
3040         * PlatformGTK.cmake:
3041         * PlatformWPE.cmake:
3042
3043 2017-11-07  Jeremy Jones  <jeremyj@apple.com>
3044
3045         Add downcast support for FullscreenClient.
3046         https://bugs.webkit.org/show_bug.cgi?id=178824
3047
3048         Reviewed by Simon Fraser.
3049
3050         Add SPECIALIZE_TYPE_TRAITS macros for API::FullscreenClient and WebKit::Fullscreen client so 
3051         downcasts can be done safely.
3052
3053         * UIProcess/API/APIFullscreenClient.h:
3054         (API::FullscreenClient::isType const):
3055         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
3056         (WKPageSetFullscreenDelegate):
3057         (WKPageGetFullscreenDelegate):
3058         * UIProcess/API/Cocoa/WKWebView.mm:
3059         (-[WKWebView _setFullscreenDelegate:]):
3060         (-[WKWebView _fullscreenDelegate]):
3061         * UIProcess/Cocoa/FullscreenClient.h:
3062         (isType):
3063         * UIProcess/Cocoa/FullscreenClient.mm:
3064
3065 2017-11-07  Brady Eidson  <beidson@apple.com>
3066
3067         Implement "UpdateWorkerState" and use it
3068         https://bugs.webkit.org/show_bug.cgi?id=179318
3069
3070         Reviewed by Chris Dumez.
3071
3072         * Scripts/webkit/messages.py:
3073         (headers_for_type):
3074         * Shared/WebCoreArgumentCoders.h:
3075  
3076        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3077         (WebKit::WebSWServerConnection::updateWorkerStateInClient):
3078         (WebKit::WebSWServerConnection::installServiceWorkerContext):
3079         (WebKit::WebSWServerConnection::setContextConnection):
3080         (WebKit::WebSWServerConnection::updateServiceWorkerContext): Deleted.
3081         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3082
3083         * WebProcess/Storage/WebSWClientConnection.messages.in:
3084
3085         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3086         (WebKit::WebSWContextManagerConnection::installServiceWorker):
3087         (WebKit::WebSWContextManagerConnection::updateServiceWorker): Deleted.
3088         * WebProcess/Storage/WebSWContextManagerConnection.h:
3089         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
3090
3091 2017-11-07  Commit Queue  <commit-queue@webkit.org>
3092
3093         Unreviewed, rolling out r224512 and r224521.
3094         https://bugs.webkit.org/show_bug.cgi?id=179388
3095
3096         An API test added with this change is failing an assertion on
3097         the bots. (Requested by ryanhaddad on #webkit).
3098
3099         Reverted changesets:
3100
3101         "[Attachment Support] Implement delegate hooks for attachment
3102         element insertion and removal"
3103         https://bugs.webkit.org/show_bug.cgi?id=179016
3104         https://trac.webkit.org/changeset/224512
3105
3106         "Remove stray logging from a newly added API test"
3107         https://trac.webkit.org/changeset/224521
3108
3109 2017-11-07  Chris Dumez  <cdumez@apple.com>
3110
3111         [Service Workers] Add support for "install" event
3112         https://bugs.webkit.org/show_bug.cgi?id=179338
3113
3114         Reviewed by Youenn Fablet.
3115
3116         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3117         (WebKit::WebSWServerConnection::firePostInstallEvents):
3118         (WebKit::WebSWServerConnection::fireInstallEvent):
3119         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3120         * StorageProcess/StorageProcess.cpp:
3121         (WebKit::StorageProcess::didFinishServiceWorkerInstall):
3122         * StorageProcess/StorageProcess.h:
3123         * StorageProcess/StorageProcess.messages.in:
3124         * WebProcess/Storage/WebSWClientConnection.messages.in:
3125         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3126         (WebKit::WebSWContextManagerConnection::fireInstallEvent):
3127         (WebKit::WebSWContextManagerConnection::didFinishInstall):
3128         * WebProcess/Storage/WebSWContextManagerConnection.h:
3129         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
3130
3131 2017-11-07  Youenn Fablet  <youenn@apple.com>
3132
3133         Support the case of fetch events that are not responded
3134         https://bugs.webkit.org/show_bug.cgi?id=179336
3135
3136         Reviewed by Chris Dumez.
3137
3138         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
3139         (WebKit::WebServiceWorkerFetchTaskClient::didNotHandle):
3140         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
3141
3142 2017-11-06  Alex Christensen  <achristensen@webkit.org>
3143
3144         Make ResourceLoader::willSendRequestInternal asynchronous
3145         https://bugs.webkit.org/show_bug.cgi?id=179251
3146
3147         Reviewed by Andy Estes.
3148
3149         * WebProcess/Network/WebLoaderStrategy.cpp:
3150         (WebKit::WebLoaderStrategy::loadResource):
3151         (WebKit::WebLoaderStrategy::schedulePluginStreamLoad):
3152         * WebProcess/Network/WebLoaderStrategy.h:
3153         * WebProcess/Plugins/PluginView.cpp:
3154         (WebKit::PluginView::Stream::start):
3155
3156 2017-11-06  Wenson Hsieh  <wenson_hsieh@apple.com>
3157
3158         [Attachment Support] Implement delegate hooks for attachment element insertion and removal
3159         https://bugs.webkit.org/show_bug.cgi?id=179016
3160         <rdar://problem/35250890>
3161
3162         Reviewed by Tim Horton.
3163
3164         Adds boilerplate plumbing to WebEditorClient, WebPage, and the usual machinery in the UI process to notify
3165         WebKit2 clients when attachment elements have been inserted or removed from the document. See the WebCore
3166         ChangeLog for more details about the implementation, or the Tools ChangeLog for more information about new API
3167         tests.
3168
3169         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3170         * UIProcess/API/Cocoa/WKWebView.mm:
3171         (-[WKWebView _didInsertAttachment:]):
3172         (-[WKWebView _didRemoveAttachment:]):
3173         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3174         * UIProcess/Cocoa/PageClientImplCocoa.h:
3175         * UIProcess/Cocoa/PageClientImplCocoa.mm:
3176         (WebKit::PageClientImplCocoa::didInsertAttachment):
3177         (WebKit::PageClientImplCocoa::didRemoveAttachment):
3178         * UIProcess/PageClient.h:
3179         (WebKit::PageClient::didInsertAttachment):
3180         (WebKit::PageClient::didRemoveAttachment):
3181         * UIProcess/WebPageProxy.cpp:
3182         (WebKit::WebPageProxy::didInsertAttachment):
3183         (WebKit::WebPageProxy::didRemoveAttachment):
3184         * UIProcess/WebPageProxy.h:
3185         * UIProcess/WebPageProxy.messages.in:
3186         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3187         (WebKit::WebEditorClient::didInsertAttachment):
3188         (WebKit::WebEditorClient::didRemoveAttachment):
3189         * WebProcess/WebCoreSupport/WebEditorClient.h:
3190
3191 2017-11-06  Jeremy Jones  <jeremyj@apple.com>
3192
3193         iOS element fullscreen should use a UIGestureRecognizer to detect user interaction.
3194         https://bugs.webkit.org/show_bug.cgi?id=179029
3195         rdar://problem/35307882
3196
3197         Reviewed by Simon Fraser.
3198
3199         Replace _WKTapDelegatingView with a UILongPressGestureRecognizer. When set with a duration of 0, it effectively
3200         recognizes UITouchBegin events.
3201
3202         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
3203         (-[_WKFullScreenViewController loadView]):
3204         (-[_WKFullScreenViewController gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
3205         (-[_WKTapDelegatingView setTarget:action:]): Deleted.
3206         (-[_WKTapDelegatingView hitTest:withEvent:]): Deleted.
3207
3208 2017-11-06  Chris Dumez  <cdumez@apple.com>
3209
3210         [Service Workers] Add proper implementation for 'updatefound' event
3211         https://bugs.webkit.org/show_bug.cgi?id=179302
3212
3213         Reviewed by Brady Eidson.
3214
3215         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3216         (WebKit::WebSWServerConnection::fireUpdateFoundEvent):
3217         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3218         * WebProcess/Storage/WebSWClientConnection.messages.in:
3219
3220 2017-11-06  Christopher Reid  <chris.reid@sony.com>
3221
3222         Use enum classes within FileSystem
3223         https://bugs.webkit.org/show_bug.cgi?id=175172
3224
3225         Reviewed by Myles C. Maxfield.
3226
3227         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
3228         * NetworkProcess/NetworkDataTaskBlob.cpp:
3229         * NetworkProcess/cache/NetworkCache.cpp:
3230         * NetworkProcess/capture/NetworkCaptureManager.cpp:
3231         * NetworkProcess/capture/NetworkCaptureRecorder.cpp:
3232         * Shared/WebMemorySampler.cpp:
3233         * UIProcess/API/APIContentRuleListStore.cpp:
3234         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
3235
3236 2017-11-06  Michael Catanzaro  <mcatanzaro@igalia.com>
3237
3238         [WPE] Properly use SYSTEM_INCLUDE_DIRECTORIES for WebKit build target
3239         https://bugs.webkit.org/show_bug.cgi?id=179097
3240
3241         Reviewed by Žan Doberšek.
3242
3243         * PlatformWPE.cmake:
3244
3245 2017-11-05  Yusuke Suzuki  <utatane.tea@gmail.com>
3246
3247         JIT call inline caches should cache calls to objects with getCallData/getConstructData traps
3248         https://bugs.webkit.org/show_bug.cgi?id=144458
3249
3250         Reviewed by Saam Barati.
3251
3252         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
3253         (WebKit::JSNPMethod::JSNPMethod):
3254         (WebKit::JSNPMethod::getCallData): Deleted.
3255         * WebProcess/Plugins/Netscape/JSNPMethod.h:
3256         (WebKit::JSNPMethod::createStructure):
3257
3258 2017-11-04  Chris Dumez  <cdumez@apple.com>
3259
3260         REGRESSION(r223718): Leaking WebProcessPool after reconfiguration
3261         https://bugs.webkit.org/show_bug.cgi?id=179123
3262         <rdar://problem/35294685>
3263
3264         Reviewed by Geoff Garen.
3265
3266         Make sure we destroy the ServiceWorker WebProcess once all other WebProcesses
3267         go away at there is no use keeping it running at this point. Also, this prevents
3268         leaking the WebProcessPool since the WebProcessProxy holds a strong reference
3269         to the WebProcessPool.
3270
3271         * UIProcess/WebProcessPool.cpp:
3272         (WebKit::WebProcessPool::disconnectProcess):
3273
3274 2017-11-01  Darin Adler  <darin@apple.com>
3275
3276         Simplify event dispatch code and make it a bit more consistent
3277         https://bugs.webkit.org/show_bug.cgi?id=178991
3278
3279         Reviewed by Chris Dumez.
3280
3281         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
3282         (webkit_dom_event_get_src_element): Call target instead of srcElement.
3283
3284 2017-11-04  Aishwarya Nirmal  <anirmal@apple.com>
3285
3286         [Touch Bar Web API] Add support for menuitem tag
3287         https://bugs.webkit.org/show_bug.cgi?id=179020
3288
3289         Reviewed by Ryosuke Niwa.
3290
3291         Adds in the MenuItemElementEnabled flag so that the menu item element is a runtime-
3292         enabled feature. It has a default value of false.
3293
3294         * Shared/WebPreferences.yaml:
3295         * UIProcess/API/C/WKPreferences.cpp:
3296         (WKPreferencesSetMenuItemElementEnabled):
3297         (WKPreferencesGetMenuItemElementEnabled):
3298         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3299
3300 2017-11-03  Chris Dumez  <cdumez@apple.com>
3301
3302         Unreviewed, rolling out r224438.
3303
3304         Has caused assertions on the bots
3305
3306         Reverted changeset:
3307
3308         "REGRESSION(r223718): Leaking WebProcessPool after
3309         reconfiguration"
3310         https://bugs.webkit.org/show_bug.cgi?id=179123
3311         https://trac.webkit.org/changeset/224438
3312
3313 2017-11-03  Youenn Fablet  <youenn@apple.com>
3314
3315         Requests handled by Service Worker should not go through preflighting
3316         https://bugs.webkit.org/show_bug.cgi?id=179250
3317
3318         Reviewed by Alex Christensen.
3319
3320         * WebProcess/Network/WebLoaderStrategy.cpp:
3321         (WebKit::WebLoaderStrategy::scheduleLoad):
3322         * WebProcess/Storage/WebSWClientConnection.cpp:
3323         (WebKit::WebSWClientConnection::startFetch):
3324         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
3325         (WebKit::shouldHandleFetch):
3326
3327 2017-11-03  Chris Dumez  <cdumez@apple.com>
3328
3329         REGRESSION(r223718): Leaking WebProcessPool after reconfiguration
3330         https://bugs.webkit.org/show_bug.cgi?id=179123
3331         <rdar://problem/35294685>
3332
3333         Reviewed by Geoffrey Garen.
3334
3335         Make sure we destroy the ServiceWorker WebProcess once all other WebProcesses
3336         go away at there is no use keeping it running at this point. Also, this prevents
3337         leaking the WebProcessPool since the WebProcessProxy holds a strong reference
3338         to the WebProcessPool.
3339
3340         * UIProcess/WebProcessPool.cpp:
3341         (WebKit::WebProcessPool::disconnectProcess):
3342
3343 2017-11-03  Youenn Fablet  <youenn@apple.com>
3344
3345         Implement Service Worker Matching Registration algorithm
3346         https://bugs.webkit.org/show_bug.cgi?id=178882
3347
3348         Reviewed by Chris Dumez.
3349
3350         Added IPC plumbery for matchRegistration request and response.
3351         Added some limited clearing of workers and registrations.
3352
3353         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3354         (WebKit::WebSWServerConnection::matchRegistration):
3355         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3356         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
3357         * StorageProcess/StorageProcess.cpp:
3358         (WebKit::StorageProcess::deleteWebsiteData):
3359         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
3360         * WebProcess/Storage/WebSWClientConnection.cpp:
3361         (WebKit::WebSWClientConnection::didMatchRegistration):
3362         (WebKit::WebSWClientConnection::matchRegistration):
3363         * WebProcess/Storage/WebSWClientConnection.h:
3364         * WebProcess/Storage/WebSWClientConnection.messages.in:
3365         * WebProcess/Storage/WebServiceWorkerProvider.h:
3366
3367 2017-11-03  Jeremy Jones  <jeremyj@apple.com>
3368
3369         Element fullscreen should use FloatRects instead of IntRects in beganEnterFullScreenWithInitialFrame
3370         https://bugs.webkit.org/show_bug.cgi?id=179033
3371         rdar://problem/35309279
3372         
3373         Reviewed by Darin Adler.
3374
3375         Screen coordinates are floats, so use NSRect instead of IntRect on Mac.
3376
3377         * UIProcess/mac/WKFullScreenWindowController.h:
3378         * UIProcess/mac/WKFullScreenWindowController.mm:
3379         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
3380         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
3381
3382 2017-11-03  Chris Dumez  <cdumez@apple.com>
3383
3384         Use a single identifier type to identify Service Workers
3385         https://bugs.webkit.org/show_bug.cgi?id=179192
3386
3387         Reviewed by Brady Eidson.
3388
3389         Use a single identifier type to identify Service Workers. We had both a String
3390         identifier and a uint64_t identifier for each service worker. We now consistently
3391         use a ServiceWorkerIdentifier which is a strongly typed identifier backed by a
3392         uint64_t.
3393
3394         * Scripts/webkit/messages.py:
3395         (forward_declarations_and_headers):
3396         (forward_declarations_and_headers.templates):
3397         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3398         (WebKit::WebSWServerConnection::startFetch):
3399         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
3400         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
3401         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3402         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
3403         * StorageProcess/StorageProcess.cpp:
3404         (WebKit::StorageProcess::serviceWorkerContextFailedToStart):
3405         (WebKit::StorageProcess::serviceWorkerContextStarted):
3406         (WebKit::StorageProcess::postMessageToServiceWorkerClient):
3407         * StorageProcess/StorageProcess.h:
3408         * StorageProcess/StorageProcess.messages.in:
3409         * WebProcess/Storage/WebSWClientConnection.cpp:
3410         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
3411         (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
3412         * WebProcess/Storage/WebSWClientConnection.h:
3413         * WebProcess/Storage/WebSWClientConnection.messages.in:
3414         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
3415         (WebKit::WebSWContextManagerConnection::updateServiceWorker):
3416         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
3417         (WebKit::WebSWContextManagerConnection::startFetch):
3418         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
3419         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
3420         * WebProcess/Storage/WebSWContextManagerConnection.h:
3421         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
3422
3423 2017-11-03  Antti Koivisto  <antti@apple.com>
3424
3425         Enable display:contents by default as experimental feature
3426         https://bugs.webkit.org/show_bug.cgi?id=179239
3427         <rdar://problem/35334612>
3428
3429         Reviewed by Darin Adler.
3430
3431         We pass most of the WPT tests. What remains is mostly flexbox related edge cases.
3432
3433         * Shared/WebPreferences.yaml:
3434
3435 2017-11-03  Frederic Wang  <fwang@igalia.com>
3436
3437         Use WK_IOS_TBA instead of WK_MAC_TBA to indicate availability of private functions on iOS
3438         https://bugs.webkit.org/show_bug.cgi?id=179238
3439
3440         Reviewed by Darin Adler.
3441
3442         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3443         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
3444
3445 2017-11-02  Maciej Stachowiak  <mjs@apple.com>
3446
3447         Don't try to guess plugin MIME type from a file extension in a URL (no observable effect)
3448         https://bugs.webkit.org/show_bug.cgi?id=178333
3449
3450         Reviewed by Darin Adler.
3451
3452         * WebProcess/Plugins/PluginView.cpp:
3453         (WebKit::PluginView::pluginDidReceiveUserInteraction): loadedMIMEType --> serviceType
3454         * WebProcess/WebPage/WebPage.cpp:
3455         (WebKit::WebPage::determinePrimarySnapshottedPlugIn): ditto