Send ServiceWorkerData structs to the WebProcesses instead of ServiceWorkerIdentifiers
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2017-11-13  Chris Dumez  <cdumez@apple.com>
2
3         Send ServiceWorkerData structs to the WebProcesses instead of ServiceWorkerIdentifiers
4         https://bugs.webkit.org/show_bug.cgi?id=179649
5
6         Reviewed by Brady Eidson.
7
8         * Shared/WebCoreArgumentCoders.h:
9         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
10         (WebKit::WebSWServerConnection::updateRegistrationStateInClient):
11         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
12         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
13         * WebProcess/Storage/WebSWClientConnection.cpp:
14         (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
15         * WebProcess/Storage/WebSWClientConnection.h:
16         * WebProcess/Storage/WebSWClientConnection.messages.in:
17
18 2017-11-13  Brady Eidson  <beidson@apple.com>
19
20         Massive "Server-process-to-context-process" connection overhaul.
21         https://bugs.webkit.org/show_bug.cgi?id=179554
22
23         Reviewed by Chris Dumez.
24
25         * DerivedSources.make:
26         * WebKit.xcodeproj/project.pbxproj:
27
28         * Shared/WebCoreArgumentCoders.h:
29
30         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
31         (WebKit::WebSWServerConnection::sendToContextProcess):
32         (WebKit::WebSWServerConnection::installServiceWorkerContext): Deleted.
33         (WebKit::WebSWServerConnection::fireInstallEvent): Deleted.
34         (WebKit::WebSWServerConnection::fireActivateEvent): Deleted.
35         (WebKit::WebSWServerConnection::setContextConnection): Deleted.
36         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
37
38         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp: Copied from Source/WebCore/workers/service/server/SWServerWorker.cpp.
39         (WebKit::WebSWServerToContextConnection::WebSWServerToContextConnection):
40         (WebKit::WebSWServerToContextConnection::messageSenderConnection):
41         (WebKit::WebSWServerToContextConnection::messageSenderDestinationID):
42         (WebKit::WebSWServerToContextConnection::connectionClosed):
43         (WebKit::WebSWServerToContextConnection::installServiceWorkerContext):
44         (WebKit::WebSWServerToContextConnection::fireInstallEvent):
45         (WebKit::WebSWServerToContextConnection::fireActivateEvent):
46         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.h: Copied from Source/WebCore/workers/service/ServiceWorkerTypes.h.
47         (WebKit::WebSWServerToContextConnection::create):
48         (WebKit::WebSWServerToContextConnection::ipcConnection const):
49         * StorageProcess/ServiceWorker/WebSWServerToContextConnection.messages.in: Copied from Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.messages.in.
50
51         * StorageProcess/StorageProcess.cpp:
52         (WebKit::StorageProcess::didClose):
53         (WebKit::StorageProcess::didReceiveMessage):
54         (WebKit::StorageProcess::globalServerToContextConnection):
55         (WebKit::StorageProcess::createServerToContextConnection):
56         (WebKit::StorageProcess::didGetWorkerContextProcessConnection):
57         (WebKit::StorageProcess::workerContextProcessConnection): Deleted.
58         (WebKit::StorageProcess::createWorkerContextProcessConnection): Deleted.
59         (WebKit::StorageProcess::serviceWorkerContextFailedToStart): Deleted.
60         (WebKit::StorageProcess::serviceWorkerContextStarted): Deleted.
61         (WebKit::StorageProcess::didFinishServiceWorkerInstall): Deleted.
62         (WebKit::StorageProcess::didFinishServiceWorkerActivation): Deleted.
63         (WebKit::StorageProcess::setServiceWorkerHasPendingEvents): Deleted.
64         * StorageProcess/StorageProcess.h:
65         * StorageProcess/StorageProcess.messages.in:
66
67         * StorageProcess/StorageToWebProcessConnection.cpp:
68         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
69         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
70         (WebKit::StorageToWebProcessConnection::workerContextProcessConnectionCreated):
71
72         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
73         (WebKit::WebSWContextManagerConnection::installServiceWorker):
74         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
75         (WebKit::WebSWContextManagerConnection::fireInstallEvent):
76         (WebKit::WebSWContextManagerConnection::fireActivateEvent):
77         (WebKit::WebSWContextManagerConnection::didFinishInstall):
78         (WebKit::WebSWContextManagerConnection::didFinishActivation):
79         (WebKit::WebSWContextManagerConnection::setServiceWorkerHasPendingEvents):
80         * WebProcess/Storage/WebSWContextManagerConnection.h:
81         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
82
83 2017-11-13  Brent Fulgham  <bfulgham@apple.com>
84
85         WebContent sandbox should not include 'system.sb'
86         https://bugs.webkit.org/show_bug.cgi?id=179548
87         <rdar://problem/35367154>
88
89         Reviewed by Darin Adler.
90
91         Stop including 'system.sb', and just include the portions of that sandbox that we
92         actually use in WebContent Process. This is the first step in some further sandbox
93         tightening.
94
95         * WebProcess/com.apple.WebProcess.sb.in:
96
97 2017-11-13  Simon Fraser  <simon.fraser@apple.com>
98
99         When navigating back to a page, compositing layers may not use accelerated drawing
100         https://bugs.webkit.org/show_bug.cgi?id=178749
101         rdar://problem/35158946
102
103         Reviewed by Dean Jackson.
104
105         Avoid assertions when a test enables accelerated drawing (which we can't support
106         in the iOS simulator).
107
108         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
109         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
110
111 2017-11-13  Youenn Fablet  <youenn@apple.com>
112
113         matchRegistration does not need to go to StorageProcess if no service worker is registered
114         https://bugs.webkit.org/show_bug.cgi?id=179480
115
116         Reviewed by Chris Dumez.
117
118         Removed origin store handling from StorageProcess since it is now handled within SWServer.
119         Updated clearing of web site data accordingly.
120         Optimized matchRegistration by looking at the origin store before doing any IPC.
121         Do IPC to the StorageProcess if the origin store is not yet initialized on the WebProcess.
122
123         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
124         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
125         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
126         (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
127         * StorageProcess/StorageProcess.cpp:
128         (WebKit::StorageProcess::deleteWebsiteData):
129         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
130         (WebKit::StorageProcess::swServerForSession):
131         (WebKit::StorageProcess::swOriginStoreForSession):
132         (WebKit::StorageProcess::registerSWServerConnection):
133         (WebKit::StorageProcess::unregisterSWServerConnection):
134         (WebKit::StorageProcess::ensureSWOriginStoreForSession): Deleted.
135         (WebKit::StorageProcess::swOriginStoreForSession const): Deleted.
136         * StorageProcess/StorageProcess.h:
137         * StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
138         (WebKit::WebSWOriginStore::addToStore):
139         (WebKit::WebSWOriginStore::removeFromStore):
140         (WebKit::WebSWOriginStore::clearStore):
141         (WebKit::WebSWOriginStore::add): Deleted.
142         (WebKit::WebSWOriginStore::remove): Deleted.
143         (WebKit::WebSWOriginStore::clear): Deleted.
144         * StorageProcess/ServiceWorker/WebSWOriginStore.h:
145         * WebProcess/Storage/WebSWClientConnection.cpp:
146         (WebKit::WebSWClientConnection::matchRegistration):
147
148 2017-11-13  Alex Christensen  <achristensen@webkit.org>
149
150         Merge NetworkProcess::EnsurePrivateBrowsingSession and NetworkProcess::AddWebsiteDataStore into one message type
151         https://bugs.webkit.org/show_bug.cgi?id=178751
152
153         Reviewed by Brady Eidson.
154
155         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
156         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
157         * NetworkProcess/NetworkProcess.cpp:
158         (WebKit::NetworkProcess::initializeNetworkProcess):
159         (WebKit::NetworkProcess::ensurePrivateBrowsingSession): Deleted.
160         * NetworkProcess/NetworkProcess.h:
161         * NetworkProcess/NetworkProcess.messages.in:
162         * NetworkProcess/RemoteNetworkingContext.h:
163         * NetworkProcess/mac/RemoteNetworkingContext.mm:
164         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
165         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Deleted.
166         * Shared/WebsiteDataStoreParameters.cpp:
167         (WebKit::WebsiteDataStoreParameters::legacyPrivateSessionParameters):
168         * Shared/WebsiteDataStoreParameters.h:
169         * UIProcess/WebProcessPool.cpp:
170         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
171         (WebKit::WebProcessPool::createNewWebProcess):
172         (WebKit::WebProcessPool::pageAddedToProcess):
173         * WebProcess/InjectedBundle/InjectedBundle.cpp:
174         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
175         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
176         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
177         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
178         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Deleted.
179         * WebProcess/WebPage/WebPage.cpp:
180         (WebKit::WebPage::setSessionID):
181         * WebProcess/WebProcess.cpp:
182         (WebKit::WebProcess::ensurePrivateBrowsingSession): Deleted.
183         * WebProcess/WebProcess.h:
184         * WebProcess/WebProcess.messages.in:
185
186 2017-11-13  Alex Christensen  <achristensen@webkit.org>
187
188         Add logs to debug content extension test failures
189         https://bugs.webkit.org/show_bug.cgi?id=179624
190
191         Reviewed by Chris Dumez.
192
193         * UIProcess/API/APIContentRuleListStore.cpp:
194         (API::compiledToFile):
195         Right now I'm seeing this log:
196         "Rule list compilation failed: Unspecified error during compile."
197         I need more information to debug what is failing on the bots.
198
199 2017-11-07  Brian Burg  <bburg@apple.com>
200
201         Web Automation: inViewCenterPoint should not include topContentInset when computed in viewport coordinates
202         https://bugs.webkit.org/show_bug.cgi?id=179129
203         <rdar://problem/35297038>
204
205         Reviewed by Simon Fraser.
206
207         When computing the in view center point per W3C specification, the top content inset
208         is inadvertently added back in when converting to the root view coordinate system.
209
210         This patch reworks the protocol command so that it explicitly requests a coordinate
211         system, with options for "Page" (root / contents), "LayoutViewport", and "VisualViewport".
212         The latter is not implemented in this patch, since it is intended for use on iOS someday.
213
214         * UIProcess/Automation/Automation.json:
215         Change usesViewport to CoordinateSystem.
216         Add a new coordinate system enum type and use it.
217         Fix relevant comments for Automation.computElementLayout.
218
219         * UIProcess/Automation/WebAutomationSession.h:
220         * UIProcess/Automation/WebAutomationSession.cpp:
221         (WebKit::protocolStringToCoordinateSystem):
222         (WebKit::WebAutomationSession::computeElementLayout):
223         Parse the requested coordinate system and send it in the message to the web process.
224
225         * WebKit.xcodeproj/project.pbxproj:
226         * WebProcess/Automation/WebAutomationSessionProxy.messages.in:
227         * WebProcess/Automation/WebAutomationSessionProxy.h:
228         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
229         (WebKit::WebAutomationSessionProxy::computeElementLayout):
230         Rework the implementation. Get the element bounds and in-view center point in
231         client coordinates and convert back to root view coordinates for CoordinateSystem::Page.
232
233 2017-11-08  Keith Miller  <keith_miller@apple.com>
234
235         Async iteration should only fetch the next method once and add feature flag
236         https://bugs.webkit.org/show_bug.cgi?id=179451
237
238         Reviewed by Geoffrey Garen.
239
240         Add feature flag for Async iteration.
241
242         * Configurations/FeatureDefines.xcconfig:
243
244 2017-11-13  Mark Lam  <mark.lam@apple.com>
245
246         Add more overflow check book-keeping for MarkedArgumentBuffer.
247         https://bugs.webkit.org/show_bug.cgi?id=179634
248         <rdar://problem/35492517>
249
250         Reviewed by Saam Barati.
251
252         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
253         (WebKit::NPJSObject::construct):
254         (WebKit::NPJSObject::invoke):
255
256 2017-11-13  Timothy Horton  <timothy_horton@apple.com>
257
258         Address some post-landing review comments from r224728
259         https://bugs.webkit.org/show_bug.cgi?id=179576
260
261         * Platform/IPC/mac/MachMessage.h:
262         (IPC::MachMessage::setMessageReceiverName):
263         (IPC::MachMessage::setMessageName):
264         More moving!
265
266 2017-11-13  Tim Horton  <timothy_horton@apple.com>
267
268         Occasional MobileSafari crash under -[WKPDFView web_setMinimumSize:]
269         https://bugs.webkit.org/show_bug.cgi?id=179628
270         <rdar://problem/34773037>
271
272         Reviewed by Simon Fraser.
273
274         * UIProcess/ios/WKPDFView.mm:
275         (-[WKPDFView _computePageAndDocumentFrames]):
276         Similar to r223444, avoid propagating null CGRects into the view hierarchy.
277         In this case, the null rect comes from applying margins to a rect that is 
278         smaller than the margins. We could check for that specifically, but a
279         more-general check for a null rect seems reasonable.
280
281 2017-11-13  Tim Horton  <timothy_horton@apple.com>
282
283         Use the real mach type instead of reinterpret_casting in MachMessage
284         https://bugs.webkit.org/show_bug.cgi?id=179629
285
286         Reviewed by Dan Bernstein.
287
288         * Platform/IPC/mac/MachMessage.cpp:
289         (IPC::MachMessage::header):
290         * Platform/IPC/mac/MachMessage.h:
291         Just use mach_msg_header_t proper, and avoid the reinterpret_cast.
292         This also corrects the alignment of the struct on platforms where
293         alignof(mach_msg_header_t) != alignof(uint8_t).
294
295 2017-11-13  Gabriel Ivascu  <givascu@igalia.com>
296
297         [GTK] Automatically adjust font size when gtk-xft-dpi changes
298         https://bugs.webkit.org/show_bug.cgi?id=142673
299
300         Reviewed by Michael Catanzaro.
301
302         * UIProcess/API/glib/WebKitSettings.cpp:
303         (webKitSettingsDispose):
304         (webKitSettingsConstructed):
305         (webkit_settings_class_init):
306
307 2017-11-13  Chris Dumez  <cdumez@apple.com>
308
309         Implement "Service Worker Has No Pending Events" / "Update Service Worker Extended Events Set" algorithms
310         https://bugs.webkit.org/show_bug.cgi?id=179618
311
312         Reviewed by Brady Eidson.
313
314         * StorageProcess/StorageProcess.cpp:
315         (WebKit::StorageProcess::setServiceWorkerHasPendingEvents):
316         * StorageProcess/StorageProcess.h:
317         * StorageProcess/StorageProcess.messages.in:
318         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
319         (WebKit::WebSWContextManagerConnection::setServiceWorkerHasPendingEvents):
320         * WebProcess/Storage/WebSWContextManagerConnection.h:
321
322 2017-11-13  Wenson Hsieh  <wenson_hsieh@apple.com>
323
324         [Attachment Support] Implement SPI for clients to request data for a given attachment
325         https://bugs.webkit.org/show_bug.cgi?id=179586
326         <rdar://problem/35355720>
327
328         Reviewed by Darin Adler.
329
330         Adds support in WebKit for fetching data for a given attachment element. See WebCore/ChangeLog for more details.
331         Most of the changes here are boilerplate plumbing of -requestAttachmentData through the client layers.
332
333         Test coverage by augmenting existing API tests in WKAttachmentTests, and adding 3 new tests.
334
335         * UIProcess/API/APIAttachment.cpp:
336         (API::Attachment::requestData):
337         * UIProcess/API/APIAttachment.h:
338         * UIProcess/API/Cocoa/_WKAttachment.h:
339         * UIProcess/API/Cocoa/_WKAttachment.mm:
340         (-[_WKAttachment requestData:]):
341         * UIProcess/WebPageProxy.cpp:
342         (WebKit::WebPageProxy::sharedBufferCallback):
343
344         Add a new IPC callback helper type, SharedBufferCallback. This is similar to the existing DataCallback, but
345         instead of deserializing to an API::Data, we convert to a SharedBuffer instead. Additionally,
346         SharedBufferCallback is able to draw a distinction between null data and empty data. This allows -requestData:
347         to distinguish between cases where (for instance) the data for a given attachment is an empty blob, and when
348         the attachment doesn't exist at all.
349
350         (WebKit::WebPageProxy::dataCallback):
351         (WebKit::WebPageProxy::insertAttachment):
352         (WebKit::WebPage::invokeSharedBufferCallback):
353         (WebKit::WebPageProxy::requestAttachmentData):
354         * UIProcess/WebPageProxy.h:
355         * UIProcess/WebPageProxy.messages.in:
356         * WebProcess/WebPage/WebPage.cpp:
357         (WebKit::WebPage::requestAttachmentData):
358         * WebProcess/WebPage/WebPage.h:
359         * WebProcess/WebPage/WebPage.messages.in:
360
361 2017-11-12  Darin Adler  <darin@apple.com>
362
363         More is<> and downcast<>, less static_cast<>
364         https://bugs.webkit.org/show_bug.cgi?id=179600
365
366         Reviewed by Chris Dumez.
367
368         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp:
369         (WebKit::wrap): Use is/downcast.
370         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
371         (WebKit::WebEditorClient::handleKeyboardEvent): Ditto.
372         * WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
373         (WebKit::WebEditorClient::handleKeyboardEvent): Ditto.
374         * WebProcess/WebPage/WebPage.cpp:
375         (WebKit::WebPage::handleEditingKeyboardEvent): Ditto.
376         * WebProcess/WebPage/mac/WebPageMac.mm:
377         (WebKit::frameForEvent): Ditto.
378
379 2017-11-12  Gabriel Ivascu  <givascu@igalia.com>
380
381         [GTK] Add functionality to handle font sizes in points
382         https://bugs.webkit.org/show_bug.cgi?id=179285
383
384         Reviewed by Carlos Garcia Campos and Michael Catanzaro.
385
386         * UIProcess/API/glib/WebKitSettings.cpp:
387         (webkit_settings_class_init):
388         (webkit_settings_font_size_to_points):
389         (webkit_settings_font_size_to_pixels):
390         * UIProcess/API/gtk/WebKitSettings.h:
391         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
392
393 2017-11-11  Tim Horton  <timothy_horton@apple.com>
394
395         Increase the alignment requirement of WKObject's wrapped C++ object
396         https://bugs.webkit.org/show_bug.cgi?id=179518
397
398         Reviewed by Dan Bernstein.
399
400         * Shared/API/APIObject.h:
401         * Shared/Cocoa/APIObject.mm:
402         (API::allocateWKObject):
403         (API::Object::fromWKObjectExtraSpace):
404         (API::Object::newObject):
405         * Shared/Cocoa/WKObject.mm:
406         (-[WKObject dealloc]):
407         (-[WKObject _apiObject]):
408         * UIProcess/API/Cocoa/WKConnection.mm:
409         (-[WKConnection dealloc]):
410         (-[WKConnection _apiObject]):
411         (-[WKConnection _connection]):
412         Increase the alignment of the C++ object stored inside WKObject's extra space
413         to 8-bytes, for platforms where some types require greater-than-pointer alignment.
414         To achieve this, increase the size of the extra-space allocation by the difference
415         between 8 bytes and pointer-alignment, and then align within that.
416
417 2017-11-11  Tim Horton  <timothy_horton@apple.com>
418
419         Avoid composing the message + recipient name for crash logs until a failure actually occurs
420         https://bugs.webkit.org/show_bug.cgi?id=179576
421
422         Reviewed by Dan Bernstein.
423
424         * Platform/IPC/mac/ConnectionMac.mm:
425         (IPC::Connection::sendMessage):
426         (IPC::Connection::sendOutgoingMessage):
427         * Platform/IPC/mac/MachMessage.h:
428         (IPC::MachMessage::messageReceiverName const):
429         (IPC::MachMessage::setMessageReceiverName):
430         (IPC::MachMessage::messageName const):
431         (IPC::MachMessage::setMessageName):
432         Store the message name and receiver name separately on MachMessage,
433         only composing them into a string if the message is unhandled. This
434         makes the time spent composing the string in sendOutgoingMessage
435         completely disappear. In absolute terms, it wasn't huge, but if you
436         do enough IPC it starts to add up.
437
438 2017-11-10  Chris Dumez  <cdumez@apple.com>
439
440         [Service Workers] Implement "Try Activate" / "Activate" algorithms
441         https://bugs.webkit.org/show_bug.cgi?id=179436
442
443         Reviewed by Brady Eidson.
444
445         Implement proper "Try Activate" / "Activate" algorithms as per:
446         - https://w3c.github.io/ServiceWorker/#try-activate-algorithm
447         - https://w3c.github.io/ServiceWorker/#activation-algorithm
448
449         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
450         (WebKit::WebSWServerConnection::fireActivateEvent):
451         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
452         * StorageProcess/StorageProcess.cpp:
453         (WebKit::StorageProcess::didFinishServiceWorkerActivation):
454         * StorageProcess/StorageProcess.h:
455         * StorageProcess/StorageProcess.messages.in:
456         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
457         (WebKit::WebSWContextManagerConnection::fireActivateEvent):
458         (WebKit::WebSWContextManagerConnection::didFinishActivation):
459         * WebProcess/Storage/WebSWContextManagerConnection.h:
460         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
461
462 2017-11-10  John Wilander  <wilander@apple.com>
463
464         Ignore HSTS for partitioned, cross-origin subresource requests
465         https://bugs.webkit.org/show_bug.cgi?id=178993
466         <rdar://problem/34962462>
467
468         Reviewed by Brent Fulgham.
469
470         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
471         (downgradeRequest):
472             Convenience function to downgrade a request if
473             CFNetwork as already upgraded it during
474             canonicalization. This allows the rest of 
475             WebKit's processing to function, such as UIR
476             and mixed content blocking.
477         (updateIgnoreStrictTransportSecuritySettingIfNecessary):
478             Adds and removed the ignore request accordingly.
479         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
480             Now asks CFNetwork to ignore HSTS on resource loads we
481             partition cookies for.
482         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
483             Now asks CFNetwork to ignore HSTS on resource loads we
484             partition cookies for.
485
486 2017-11-10  Alex Christensen  <achristensen@webkit.org>
487
488         _WKThumbnailView initialization with WKWebView needs to call correct initWithFrame
489         https://bugs.webkit.org/show_bug.cgi?id=179537
490         <rdar://problem/35275219>
491
492         Reviewed by Darin Adler.
493
494         I introduced this in r223439 and made an ObjC mistake.  This is what I get for adding SPI with no tests.
495         I fixed this by making the existing WKView/_WKThumbnailView API tests work with WKWebView.
496
497         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
498         (-[_WKThumbnailView initWithFrame:fromWKWebView:]):
499
500 2017-11-10  Carlos Garcia Campos  <cgarcia@igalia.com>
501
502         [GTK][WPE] Switch to use API::NavigationClient
503         https://bugs.webkit.org/show_bug.cgi?id=178720
504
505         Reviewed by Alex Christensen.
506
507         Replace WebKitLoaderClient and WebKitPolicyClient with WebKitNavigationClient that implements
508         API::NavigationClient.
509
510         * PlatformGTK.cmake:
511         * PlatformWPE.cmake:
512         * UIProcess/API/APINavigationAction.h: Add new constructor that receives a target frame name instead of a target
513         frame info.
514         * UIProcess/API/APINavigationClient.h:
515         (API::NavigationClient::didDisplayInsecureContent): Added.
516         (API::NavigationClient::didRunInsecureContent): Added.
517         (API::NavigationClient::decidePolicyForNavigationResponse): Change NavigationResponse parameter to be a
518         Ref<NavigationResponse>&& instead of a NavigationResponse&.
519         * UIProcess/API/C/WKPage.cpp:
520         (WKPageSetPageNavigationClient): Update NavigationResponse parameter.
521         * UIProcess/API/glib/WebKitBackForwardList.cpp:
522         (webkitBackForwardListChanged):
523         * UIProcess/API/glib/WebKitBackForwardListPrivate.h:
524         * UIProcess/API/glib/WebKitNavigationAction.cpp:
525         (webkitNavigationActionCreate): Wrap the given API::NavigationAction.
526         (webkit_navigation_action_get_navigation_type): Use the wrapped API::NavigationAction.
527         (webkit_navigation_action_get_mouse_button): Ditto.
528         (webkit_navigation_action_get_modifiers): Ditto.
529         (webkit_navigation_action_get_request): Ditto.
530         (webkit_navigation_action_is_user_gesture): Ditto.
531         (webkit_navigation_action_is_redirect): Ditto.
532         * UIProcess/API/glib/WebKitNavigationActionPrivate.h:
533         (_WebKitNavigationAction::_WebKitNavigationAction):
534         * UIProcess/API/glib/WebKitNavigationClient.cpp: Renamed from Source/WebKit/UIProcess/API/glib/WebKitLoaderClient.cpp.
535         (NavigationClient::NavigationClient):
536         (attachNavigationClientToView):
537         * UIProcess/API/glib/WebKitNavigationClient.h: Renamed from Source/WebKit/UIProcess/API/glib/WebKitLoaderClient.h.
538         * UIProcess/API/glib/WebKitNavigationPolicyDecision.cpp:
539         (webkit_navigation_policy_decision_get_frame_name): Add FIXME.
540         (webkitNavigationPolicyDecisionCreate): Get the target frame name from the API::NavigationAction.
541         * UIProcess/API/glib/WebKitNavigationPolicyDecisionPrivate.h:
542         * UIProcess/API/glib/WebKitPolicyClient.cpp: Removed.
543         * UIProcess/API/glib/WebKitPolicyClient.h: Removed.
544         * UIProcess/API/glib/WebKitPolicyDecision.cpp:
545         (webkitPolicyDecisionSetListener): Remove the madePolicyDecision boolean member, we can null-check the listener instead.
546         (webkit_policy_decision_use): Ensure listener is nullptr after being invoked to prevent the decision from being made
547         more than once.
548         (webkit_policy_decision_ignore): Ditto.
549         (webkit_policy_decision_download): Ditto.
550         * UIProcess/API/glib/WebKitPolicyDecisionPrivate.h:
551         * UIProcess/API/glib/WebKitResponsePolicyDecision.cpp:
552         (webkit_response_policy_decision_get_request): Use the wrapped API::NavigationResponse.
553         (webkit_response_policy_decision_get_response): Ditto.
554         (webkit_response_policy_decision_is_mime_type_supported): Ditto.
555         (webkitResponsePolicyDecisionCreate): Wrap the given API::NavigationResponse.
556         * UIProcess/API/glib/WebKitResponsePolicyDecisionPrivate.h:
557         * UIProcess/API/glib/WebKitUIClient.cpp:
558         (UIClient::createNewPage): Create the WebKitNavigationAction from a new API::NavigationAction.
559         * UIProcess/API/glib/WebKitWebView.cpp:
560         (webkitWebViewConstructed): Attach navigation client.
561         * UIProcess/Cocoa/NavigationState.h: Update API::NavigationResponse parameter of decidePolicyForNavigationResponse.
562         * UIProcess/Cocoa/NavigationState.mm:
563         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
564         * UIProcess/WebPageProxy.cpp:
565         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame): Notify the navigation client if it's used.
566         (WebKit::WebPageProxy::didRunInsecureContentForFrame): Ditto.
567         (WebKit::WebPageProxy::decidePolicyForNewWindowAction): Use the new API::NavigationAction constructor to pass
568         the target frame name, instead of a null target frame info.
569         (WebKit::WebPageProxy::decidePolicyForResponse): Move the API::NavigationResponse.
570
571 2017-11-09  Chris Dumez  <cdumez@apple.com>
572
573         Unreviewed, rolling out r224661.
574
575         Broke build on several internal Mac/iOS bots
576
577         Reverted changeset:
578
579         "Ignore HSTS for partitioned, cross-origin subresource
580         requests"
581         https://bugs.webkit.org/show_bug.cgi?id=178993
582         https://trac.webkit.org/changeset/224661
583
584 2017-11-09  Chris Dumez  <cdumez@apple.com>
585
586         ServiceWorkerRegistration objects may get recycled for different SWServerRegistration objects
587         https://bugs.webkit.org/show_bug.cgi?id=179517
588
589         Reviewed by Brady Eidson.
590
591         * Scripts/webkit/messages.py:
592         (forward_declarations_and_headers):
593         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
594         (WebKit::WebSWServerConnection::updateRegistrationStateInClient):
595         (WebKit::WebSWServerConnection::fireUpdateFoundEvent):
596         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
597         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
598         * WebProcess/Storage/WebSWClientConnection.cpp:
599         (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer):
600         (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):
601         * WebProcess/Storage/WebSWClientConnection.h:
602         * WebProcess/Storage/WebSWClientConnection.messages.in:
603
604 2017-11-09  John Wilander  <wilander@apple.com>
605
606         Ignore HSTS for partitioned, cross-origin subresource requests
607         https://bugs.webkit.org/show_bug.cgi?id=178993
608         <rdar://problem/34962462>
609
610         Reviewed by Brent Fulgham.
611
612         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
613         (downgradeRequest):
614             Convenience function to downgrade a request if
615             CFNetwork as already upgraded it during
616             canonicalization. This allows the rest of 
617             WebKit's processing to function, such as UIR
618             and mixed content blocking.
619         (updateIgnoreStrictTransportSecuritySettingIfNecessary):
620             Adds and removed the ignore request accordingly.
621         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
622             Now asks CFNetwork to ignore HSTS on resource loads we
623             partition cookies for.
624         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
625             Now asks CFNetwork to ignore HSTS on resource loads we
626             partition cookies for.
627
628 2017-11-09  Chris Dumez  <cdumez@apple.com>
629
630         Implement real post 'install' event steps of the Install algorithm (steps 14+)
631         https://bugs.webkit.org/show_bug.cgi?id=179401
632
633         Reviewed by Brady Eidson.
634
635         Implement step 14+ of Install algorithm, as per:
636         - https://w3c.github.io/ServiceWorker/#installation-algorithm
637
638         * Scripts/webkit/messages.py:
639         (headers_for_type):
640         * Shared/WebCoreArgumentCoders.h:
641         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
642         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
643         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
644         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
645         * WebProcess/Storage/WebSWClientConnection.cpp:
646         (WebKit::WebSWClientConnection::didResolveRegistrationPromise):
647         * WebProcess/Storage/WebSWClientConnection.h:
648         * WebProcess/Storage/WebSWClientConnection.messages.in:
649
650 2017-11-09  Megan Gardner  <megan_gardner@apple.com>
651
652         Clean out unused selection items from UIKitSPI
653         https://bugs.webkit.org/show_bug.cgi?id=179459
654
655         Reviewed by Tim Horton.
656
657         Many of these should have been removed from previous commits, but they were missed.
658         None of these enums or methods are being used by WebKit anymore, and removing them will keep things
659         clean and allow UIKit to remove things that are not used at all by anyone anymore.
660
661         * Platform/spi/ios/UIKitSPI.h:
662
663 2017-11-09  Christopher Reid  <chris.reid@sony.com>
664
665         Use enum classes within FileSystem
666         https://bugs.webkit.org/show_bug.cgi?id=175172
667
668         Reviewed by Darin Adler.
669
670         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
671         * NetworkProcess/NetworkDataTaskBlob.cpp:
672         * NetworkProcess/cache/NetworkCache.cpp:
673         * NetworkProcess/capture/NetworkCaptureManager.cpp:
674         * NetworkProcess/capture/NetworkCaptureRecorder.cpp:
675         * Shared/WebMemorySampler.cpp:
676         * UIProcess/API/APIContentRuleListStore.cpp:
677         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
678
679 2017-11-09  Youenn Fablet  <youenn@apple.com>
680
681         ServiceWorkerClientFetch should create not null ResourceError
682         https://bugs.webkit.org/show_bug.cgi?id=179485
683
684         Reviewed by Darin Adler.
685
686         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
687         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
688
689 2017-11-09  Andy Estes  <aestes@apple.com>
690
691         [iOS] Adopt UIPreviewDataAttachmentListIsContentManaged
692         https://bugs.webkit.org/show_bug.cgi?id=179458
693         <rdar://problem/35034691>
694
695         Reviewed by Dan Bernstein.
696
697         * Platform/spi/ios/UIKitSPI.h:
698         * UIProcess/ios/WKContentViewInteraction.mm:
699         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
700
701 2017-11-08  Joseph Pecoraro  <pecoraro@apple.com>
702
703         Include a more complete block signature in public headers to avoid potential -Wstrict-prototypes warnings
704         https://bugs.webkit.org/show_bug.cgi?id=179466
705
706         Reviewed by Dan Bernstein.
707
708         * UIProcess/API/Cocoa/WKHTTPCookieStore.h:
709         * UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
710         (-[WKHTTPCookieStore setCookie:completionHandler:]):
711         (-[WKHTTPCookieStore deleteCookie:completionHandler:]):
712
713 2017-11-08  Jeremy Jones  <jeremyj@apple.com>
714
715         Make WKFullScreenWidnowController more robust against modification by the embedding app.
716         https://bugs.webkit.org/show_bug.cgi?id=179413
717         rdar://problem/35408061
718
719         Reviewed by Darin Adler.
720
721         Present fullscreen UViewController in a separate UIWindow to prevent interaction with the embedding app's
722         UIViewController hierarchy.
723
724         Immediately tear down the fullscreen interface if the embedding app removes the WKWebView from the fullscreen window.
725         This prevents the fullscreen interface from getting into an invalid state.
726
727         Preserve scrollView.zoomScale because it is not effectively preserved by the more indirect _viewScale.
728
729         Use a custom root view controller to allow hiding of the status bar.
730
731         Remove the no-longer-necessary dispatch_after calls during enter and exit fullscreen.
732
733         * UIProcess/API/Cocoa/WKWebView.mm:
734         (-[WKWebView removeFromSuperview]):
735         * UIProcess/ios/WKFullScreenWindowControllerIOS.h:
736         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
737         (WebKit::WKWebViewState::applyTo):
738         (WebKit::WKWebViewState::store):
739         (-[_WKFullScreenViewController loadView]):
740         (-[_WKFullscreenRootViewController prefersStatusBarHidden]):
741         (-[WKFullScreenWindowController enterFullScreen]):
742         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
743         (-[WKFullScreenWindowController completedExitFullScreen]):
744         (-[WKFullScreenWindowController exitFullscreenImmediately]):
745         (-[WKFullScreenWindowController close]):
746         (-[WKFullScreenWindowController webViewDidRemoveFromSuperviewWhileInFullscreen]):
747         (-[_WKFullScreenViewController viewDidDisappear:]): Deleted.
748
749 2017-11-08  Jeremy Jones  <jeremyj@apple.com>
750
751         HTMLMediaElement should not use element fullscreen on iOS
752         https://bugs.webkit.org/show_bug.cgi?id=179418
753         rdar://problem/35409277
754
755         Reviewed by Eric Carlson.
756
757         Add ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN to determine if HTMLMediaElement should use element full screen or not.
758
759         * Configurations/FeatureDefines.xcconfig:
760
761 2017-11-08  Wenson Hsieh  <wenson_hsieh@apple.com>
762
763         [Attachment Support] Implement delegate hooks for attachment element insertion and removal
764         https://bugs.webkit.org/show_bug.cgi?id=179016
765         <rdar://problem/35250890>
766
767         Reviewed by Tim Horton.
768
769         See WebCore/ChangeLog for more details.
770
771         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
772         * UIProcess/API/Cocoa/WKWebView.mm:
773         (-[WKWebView _didInsertAttachment:]):
774         (-[WKWebView _didRemoveAttachment:]):
775         * UIProcess/API/Cocoa/WKWebViewInternal.h:
776         * UIProcess/Cocoa/PageClientImplCocoa.h:
777         * UIProcess/Cocoa/PageClientImplCocoa.mm:
778         (WebKit::PageClientImplCocoa::didInsertAttachment):
779         (WebKit::PageClientImplCocoa::didRemoveAttachment):
780         * UIProcess/PageClient.h:
781         (WebKit::PageClient::didInsertAttachment):
782         (WebKit::PageClient::didRemoveAttachment):
783         * UIProcess/WebPageProxy.cpp:
784         (WebKit::WebPageProxy::didInsertAttachment):
785         (WebKit::WebPageProxy::didRemoveAttachment):
786         * UIProcess/WebPageProxy.h:
787         * UIProcess/WebPageProxy.messages.in:
788         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
789         (WebKit::WebEditorClient::didInsertAttachment):
790         (WebKit::WebEditorClient::didRemoveAttachment):
791         * WebProcess/WebCoreSupport/WebEditorClient.h:
792
793 2017-11-08  Carlos Garcia Campos  <cgarcia@igalia.com>
794
795         REGRESSION(r223773): [GTK] WebKitWebInspector bring-to-front signal is emitted right after open-window
796         https://bugs.webkit.org/show_bug.cgi?id=179365
797
798         Reviewed by Michael Catanzaro.
799
800         In the GTK+ API, open-window already implies presenting the window to bring it to the front, so it's not
801         expected that bring-to-front is emitted on open. This is happening since r223773 that moved common code from
802         platform specific inspector files to the main file, but in the case of open the mac implementation was not
803         exactly the same as the GTK+ one. This broke /webkit2/WebKitWebInspector/default and
804         /webkit2/WebKitWebInspector/manual-attach-detach.
805
806         * UIProcess/WebInspectorProxy.cpp:
807         (WebKit::WebInspectorProxy::open): Set m_isOpening for the scope of the function.
808         * UIProcess/WebInspectorProxy.h: Add m_isOpening.
809         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
810         (WebKit::WebInspectorProxy::platformBringToFront): Return early if m_isOpening is true.
811
812 2017-11-07  Carlos Garcia Campos  <cgarcia@igalia.com>
813
814         REGRESSION(r224179): [GTK] Several WebViewEditor tests are failing since r224179
815         https://bugs.webkit.org/show_bug.cgi?id=179366
816
817         Reviewed by Michael Catanzaro.
818
819         In r224179, webkit_web_view_can_execute_editing_command() was optimized to use the sync path for commands
820         supported by the WebViewEditorState, but the state requires a redraw to be up to date. We can't know if
821         WebViewEditorState is in sync, when webkit_web_view_can_execute_editing_command() is called, so we always need
822         to ask the web process.
823
824         * UIProcess/API/glib/WebKitWebView.cpp:
825         (webkit_web_view_can_execute_editing_command):
826
827 2017-11-07  Carlos Garcia Campos  <cgarcia@igalia.com>
828
829         [GTK][WPE] Build inspector resources using copy-user-interface-resources.pl script
830         https://bugs.webkit.org/show_bug.cgi?id=179317
831
832         Reviewed by Michael Catanzaro.
833
834         This is the script used by Apple and it has several advantages:
835
836           - It allows to combine and minify most of the js and css files, which improves performance and binary size.
837           - It removes the debug resources and assertions in production builds.
838           - It allows to remove the test resources in production builds.
839
840         The patch also moves the common cmake code to generate the resources to a new file InspectorGResources.cmake included
841         by GTK+ and WPE platform cmake files.
842
843         * InspectorGResources.cmake: Added.
844         * PlatformGTK.cmake:
845         * PlatformWPE.cmake:
846
847 2017-11-07  Jeremy Jones  <jeremyj@apple.com>
848
849         Add downcast support for FullscreenClient.
850         https://bugs.webkit.org/show_bug.cgi?id=178824
851
852         Reviewed by Simon Fraser.
853
854         Add SPECIALIZE_TYPE_TRAITS macros for API::FullscreenClient and WebKit::Fullscreen client so 
855         downcasts can be done safely.
856
857         * UIProcess/API/APIFullscreenClient.h:
858         (API::FullscreenClient::isType const):
859         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
860         (WKPageSetFullscreenDelegate):
861         (WKPageGetFullscreenDelegate):
862         * UIProcess/API/Cocoa/WKWebView.mm:
863         (-[WKWebView _setFullscreenDelegate:]):
864         (-[WKWebView _fullscreenDelegate]):
865         * UIProcess/Cocoa/FullscreenClient.h:
866         (isType):
867         * UIProcess/Cocoa/FullscreenClient.mm:
868
869 2017-11-07  Brady Eidson  <beidson@apple.com>
870
871         Implement "UpdateWorkerState" and use it
872         https://bugs.webkit.org/show_bug.cgi?id=179318
873
874         Reviewed by Chris Dumez.
875
876         * Scripts/webkit/messages.py:
877         (headers_for_type):
878         * Shared/WebCoreArgumentCoders.h:
879  
880        * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
881         (WebKit::WebSWServerConnection::updateWorkerStateInClient):
882         (WebKit::WebSWServerConnection::installServiceWorkerContext):
883         (WebKit::WebSWServerConnection::setContextConnection):
884         (WebKit::WebSWServerConnection::updateServiceWorkerContext): Deleted.
885         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
886
887         * WebProcess/Storage/WebSWClientConnection.messages.in:
888
889         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
890         (WebKit::WebSWContextManagerConnection::installServiceWorker):
891         (WebKit::WebSWContextManagerConnection::updateServiceWorker): Deleted.
892         * WebProcess/Storage/WebSWContextManagerConnection.h:
893         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
894
895 2017-11-07  Commit Queue  <commit-queue@webkit.org>
896
897         Unreviewed, rolling out r224512 and r224521.
898         https://bugs.webkit.org/show_bug.cgi?id=179388
899
900         An API test added with this change is failing an assertion on
901         the bots. (Requested by ryanhaddad on #webkit).
902
903         Reverted changesets:
904
905         "[Attachment Support] Implement delegate hooks for attachment
906         element insertion and removal"
907         https://bugs.webkit.org/show_bug.cgi?id=179016
908         https://trac.webkit.org/changeset/224512
909
910         "Remove stray logging from a newly added API test"
911         https://trac.webkit.org/changeset/224521
912
913 2017-11-07  Chris Dumez  <cdumez@apple.com>
914
915         [Service Workers] Add support for "install" event
916         https://bugs.webkit.org/show_bug.cgi?id=179338
917
918         Reviewed by Youenn Fablet.
919
920         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
921         (WebKit::WebSWServerConnection::firePostInstallEvents):
922         (WebKit::WebSWServerConnection::fireInstallEvent):
923         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
924         * StorageProcess/StorageProcess.cpp:
925         (WebKit::StorageProcess::didFinishServiceWorkerInstall):
926         * StorageProcess/StorageProcess.h:
927         * StorageProcess/StorageProcess.messages.in:
928         * WebProcess/Storage/WebSWClientConnection.messages.in:
929         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
930         (WebKit::WebSWContextManagerConnection::fireInstallEvent):
931         (WebKit::WebSWContextManagerConnection::didFinishInstall):
932         * WebProcess/Storage/WebSWContextManagerConnection.h:
933         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
934
935 2017-11-07  Youenn Fablet  <youenn@apple.com>
936
937         Support the case of fetch events that are not responded
938         https://bugs.webkit.org/show_bug.cgi?id=179336
939
940         Reviewed by Chris Dumez.
941
942         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
943         (WebKit::WebServiceWorkerFetchTaskClient::didNotHandle):
944         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
945
946 2017-11-06  Alex Christensen  <achristensen@webkit.org>
947
948         Make ResourceLoader::willSendRequestInternal asynchronous
949         https://bugs.webkit.org/show_bug.cgi?id=179251
950
951         Reviewed by Andy Estes.
952
953         * WebProcess/Network/WebLoaderStrategy.cpp:
954         (WebKit::WebLoaderStrategy::loadResource):
955         (WebKit::WebLoaderStrategy::schedulePluginStreamLoad):
956         * WebProcess/Network/WebLoaderStrategy.h:
957         * WebProcess/Plugins/PluginView.cpp:
958         (WebKit::PluginView::Stream::start):
959
960 2017-11-06  Wenson Hsieh  <wenson_hsieh@apple.com>
961
962         [Attachment Support] Implement delegate hooks for attachment element insertion and removal
963         https://bugs.webkit.org/show_bug.cgi?id=179016
964         <rdar://problem/35250890>
965
966         Reviewed by Tim Horton.
967
968         Adds boilerplate plumbing to WebEditorClient, WebPage, and the usual machinery in the UI process to notify
969         WebKit2 clients when attachment elements have been inserted or removed from the document. See the WebCore
970         ChangeLog for more details about the implementation, or the Tools ChangeLog for more information about new API
971         tests.
972
973         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
974         * UIProcess/API/Cocoa/WKWebView.mm:
975         (-[WKWebView _didInsertAttachment:]):
976         (-[WKWebView _didRemoveAttachment:]):
977         * UIProcess/API/Cocoa/WKWebViewInternal.h:
978         * UIProcess/Cocoa/PageClientImplCocoa.h:
979         * UIProcess/Cocoa/PageClientImplCocoa.mm:
980         (WebKit::PageClientImplCocoa::didInsertAttachment):
981         (WebKit::PageClientImplCocoa::didRemoveAttachment):
982         * UIProcess/PageClient.h:
983         (WebKit::PageClient::didInsertAttachment):
984         (WebKit::PageClient::didRemoveAttachment):
985         * UIProcess/WebPageProxy.cpp:
986         (WebKit::WebPageProxy::didInsertAttachment):
987         (WebKit::WebPageProxy::didRemoveAttachment):
988         * UIProcess/WebPageProxy.h:
989         * UIProcess/WebPageProxy.messages.in:
990         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
991         (WebKit::WebEditorClient::didInsertAttachment):
992         (WebKit::WebEditorClient::didRemoveAttachment):
993         * WebProcess/WebCoreSupport/WebEditorClient.h:
994
995 2017-11-06  Jeremy Jones  <jeremyj@apple.com>
996
997         iOS element fullscreen should use a UIGestureRecognizer to detect user interaction.
998         https://bugs.webkit.org/show_bug.cgi?id=179029
999         rdar://problem/35307882
1000
1001         Reviewed by Simon Fraser.
1002
1003         Replace _WKTapDelegatingView with a UILongPressGestureRecognizer. When set with a duration of 0, it effectively
1004         recognizes UITouchBegin events.
1005
1006         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
1007         (-[_WKFullScreenViewController loadView]):
1008         (-[_WKFullScreenViewController gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
1009         (-[_WKTapDelegatingView setTarget:action:]): Deleted.
1010         (-[_WKTapDelegatingView hitTest:withEvent:]): Deleted.
1011
1012 2017-11-06  Chris Dumez  <cdumez@apple.com>
1013
1014         [Service Workers] Add proper implementation for 'updatefound' event
1015         https://bugs.webkit.org/show_bug.cgi?id=179302
1016
1017         Reviewed by Brady Eidson.
1018
1019         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1020         (WebKit::WebSWServerConnection::fireUpdateFoundEvent):
1021         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1022         * WebProcess/Storage/WebSWClientConnection.messages.in:
1023
1024 2017-11-06  Christopher Reid  <chris.reid@sony.com>
1025
1026         Use enum classes within FileSystem
1027         https://bugs.webkit.org/show_bug.cgi?id=175172
1028
1029         Reviewed by Myles C. Maxfield.
1030
1031         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
1032         * NetworkProcess/NetworkDataTaskBlob.cpp:
1033         * NetworkProcess/cache/NetworkCache.cpp:
1034         * NetworkProcess/capture/NetworkCaptureManager.cpp:
1035         * NetworkProcess/capture/NetworkCaptureRecorder.cpp:
1036         * Shared/WebMemorySampler.cpp:
1037         * UIProcess/API/APIContentRuleListStore.cpp:
1038         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
1039
1040 2017-11-06  Michael Catanzaro  <mcatanzaro@igalia.com>
1041
1042         [WPE] Properly use SYSTEM_INCLUDE_DIRECTORIES for WebKit build target
1043         https://bugs.webkit.org/show_bug.cgi?id=179097
1044
1045         Reviewed by Žan Doberšek.
1046
1047         * PlatformWPE.cmake:
1048
1049 2017-11-05  Yusuke Suzuki  <utatane.tea@gmail.com>
1050
1051         JIT call inline caches should cache calls to objects with getCallData/getConstructData traps
1052         https://bugs.webkit.org/show_bug.cgi?id=144458
1053
1054         Reviewed by Saam Barati.
1055
1056         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
1057         (WebKit::JSNPMethod::JSNPMethod):
1058         (WebKit::JSNPMethod::getCallData): Deleted.
1059         * WebProcess/Plugins/Netscape/JSNPMethod.h:
1060         (WebKit::JSNPMethod::createStructure):
1061
1062 2017-11-04  Chris Dumez  <cdumez@apple.com>
1063
1064         REGRESSION(r223718): Leaking WebProcessPool after reconfiguration
1065         https://bugs.webkit.org/show_bug.cgi?id=179123
1066         <rdar://problem/35294685>
1067
1068         Reviewed by Geoff Garen.
1069
1070         Make sure we destroy the ServiceWorker WebProcess once all other WebProcesses
1071         go away at there is no use keeping it running at this point. Also, this prevents
1072         leaking the WebProcessPool since the WebProcessProxy holds a strong reference
1073         to the WebProcessPool.
1074
1075         * UIProcess/WebProcessPool.cpp:
1076         (WebKit::WebProcessPool::disconnectProcess):
1077
1078 2017-11-01  Darin Adler  <darin@apple.com>
1079
1080         Simplify event dispatch code and make it a bit more consistent
1081         https://bugs.webkit.org/show_bug.cgi?id=178991
1082
1083         Reviewed by Chris Dumez.
1084
1085         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
1086         (webkit_dom_event_get_src_element): Call target instead of srcElement.
1087
1088 2017-11-04  Aishwarya Nirmal  <anirmal@apple.com>
1089
1090         [Touch Bar Web API] Add support for menuitem tag
1091         https://bugs.webkit.org/show_bug.cgi?id=179020
1092
1093         Reviewed by Ryosuke Niwa.
1094
1095         Adds in the MenuItemElementEnabled flag so that the menu item element is a runtime-
1096         enabled feature. It has a default value of false.
1097
1098         * Shared/WebPreferences.yaml:
1099         * UIProcess/API/C/WKPreferences.cpp:
1100         (WKPreferencesSetMenuItemElementEnabled):
1101         (WKPreferencesGetMenuItemElementEnabled):
1102         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1103
1104 2017-11-03  Chris Dumez  <cdumez@apple.com>
1105
1106         Unreviewed, rolling out r224438.
1107
1108         Has caused assertions on the bots
1109
1110         Reverted changeset:
1111
1112         "REGRESSION(r223718): Leaking WebProcessPool after
1113         reconfiguration"
1114         https://bugs.webkit.org/show_bug.cgi?id=179123
1115         https://trac.webkit.org/changeset/224438
1116
1117 2017-11-03  Youenn Fablet  <youenn@apple.com>
1118
1119         Requests handled by Service Worker should not go through preflighting
1120         https://bugs.webkit.org/show_bug.cgi?id=179250
1121
1122         Reviewed by Alex Christensen.
1123
1124         * WebProcess/Network/WebLoaderStrategy.cpp:
1125         (WebKit::WebLoaderStrategy::scheduleLoad):
1126         * WebProcess/Storage/WebSWClientConnection.cpp:
1127         (WebKit::WebSWClientConnection::startFetch):
1128         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
1129         (WebKit::shouldHandleFetch):
1130
1131 2017-11-03  Chris Dumez  <cdumez@apple.com>
1132
1133         REGRESSION(r223718): Leaking WebProcessPool after reconfiguration
1134         https://bugs.webkit.org/show_bug.cgi?id=179123
1135         <rdar://problem/35294685>
1136
1137         Reviewed by Geoffrey Garen.
1138
1139         Make sure we destroy the ServiceWorker WebProcess once all other WebProcesses
1140         go away at there is no use keeping it running at this point. Also, this prevents
1141         leaking the WebProcessPool since the WebProcessProxy holds a strong reference
1142         to the WebProcessPool.
1143
1144         * UIProcess/WebProcessPool.cpp:
1145         (WebKit::WebProcessPool::disconnectProcess):
1146
1147 2017-11-03  Youenn Fablet  <youenn@apple.com>
1148
1149         Implement Service Worker Matching Registration algorithm
1150         https://bugs.webkit.org/show_bug.cgi?id=178882
1151
1152         Reviewed by Chris Dumez.
1153
1154         Added IPC plumbery for matchRegistration request and response.
1155         Added some limited clearing of workers and registrations.
1156
1157         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1158         (WebKit::WebSWServerConnection::matchRegistration):
1159         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1160         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1161         * StorageProcess/StorageProcess.cpp:
1162         (WebKit::StorageProcess::deleteWebsiteData):
1163         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
1164         * WebProcess/Storage/WebSWClientConnection.cpp:
1165         (WebKit::WebSWClientConnection::didMatchRegistration):
1166         (WebKit::WebSWClientConnection::matchRegistration):
1167         * WebProcess/Storage/WebSWClientConnection.h:
1168         * WebProcess/Storage/WebSWClientConnection.messages.in:
1169         * WebProcess/Storage/WebServiceWorkerProvider.h:
1170
1171 2017-11-03  Jeremy Jones  <jeremyj@apple.com>
1172
1173         Element fullscreen should use FloatRects instead of IntRects in beganEnterFullScreenWithInitialFrame
1174         https://bugs.webkit.org/show_bug.cgi?id=179033
1175         rdar://problem/35309279
1176         
1177         Reviewed by Darin Adler.
1178
1179         Screen coordinates are floats, so use NSRect instead of IntRect on Mac.
1180
1181         * UIProcess/mac/WKFullScreenWindowController.h:
1182         * UIProcess/mac/WKFullScreenWindowController.mm:
1183         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
1184         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
1185
1186 2017-11-03  Chris Dumez  <cdumez@apple.com>
1187
1188         Use a single identifier type to identify Service Workers
1189         https://bugs.webkit.org/show_bug.cgi?id=179192
1190
1191         Reviewed by Brady Eidson.
1192
1193         Use a single identifier type to identify Service Workers. We had both a String
1194         identifier and a uint64_t identifier for each service worker. We now consistently
1195         use a ServiceWorkerIdentifier which is a strongly typed identifier backed by a
1196         uint64_t.
1197
1198         * Scripts/webkit/messages.py:
1199         (forward_declarations_and_headers):
1200         (forward_declarations_and_headers.templates):
1201         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1202         (WebKit::WebSWServerConnection::startFetch):
1203         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
1204         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
1205         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1206         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1207         * StorageProcess/StorageProcess.cpp:
1208         (WebKit::StorageProcess::serviceWorkerContextFailedToStart):
1209         (WebKit::StorageProcess::serviceWorkerContextStarted):
1210         (WebKit::StorageProcess::postMessageToServiceWorkerClient):
1211         * StorageProcess/StorageProcess.h:
1212         * StorageProcess/StorageProcess.messages.in:
1213         * WebProcess/Storage/WebSWClientConnection.cpp:
1214         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
1215         (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
1216         * WebProcess/Storage/WebSWClientConnection.h:
1217         * WebProcess/Storage/WebSWClientConnection.messages.in:
1218         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1219         (WebKit::WebSWContextManagerConnection::updateServiceWorker):
1220         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
1221         (WebKit::WebSWContextManagerConnection::startFetch):
1222         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
1223         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
1224         * WebProcess/Storage/WebSWContextManagerConnection.h:
1225         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1226
1227 2017-11-03  Antti Koivisto  <antti@apple.com>
1228
1229         Enable display:contents by default as experimental feature
1230         https://bugs.webkit.org/show_bug.cgi?id=179239
1231         <rdar://problem/35334612>
1232
1233         Reviewed by Darin Adler.
1234
1235         We pass most of the WPT tests. What remains is mostly flexbox related edge cases.
1236
1237         * Shared/WebPreferences.yaml:
1238
1239 2017-11-03  Frederic Wang  <fwang@igalia.com>
1240
1241         Use WK_IOS_TBA instead of WK_MAC_TBA to indicate availability of private functions on iOS
1242         https://bugs.webkit.org/show_bug.cgi?id=179238
1243
1244         Reviewed by Darin Adler.
1245
1246         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1247         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
1248
1249 2017-11-02  Maciej Stachowiak  <mjs@apple.com>
1250
1251         Don't try to guess plugin MIME type from a file extension in a URL (no observable effect)
1252         https://bugs.webkit.org/show_bug.cgi?id=178333
1253
1254         Reviewed by Darin Adler.
1255
1256         * WebProcess/Plugins/PluginView.cpp:
1257         (WebKit::PluginView::pluginDidReceiveUserInteraction): loadedMIMEType --> serviceType
1258         * WebProcess/WebPage/WebPage.cpp:
1259         (WebKit::WebPage::determinePrimarySnapshottedPlugIn): ditto
1260
1261 2017-11-02  Brady Eidson  <beidson@apple.com>
1262
1263         SW: Implement "Update Registration State" algorithm (unused for now)
1264         https://bugs.webkit.org/show_bug.cgi?id=179186
1265
1266         Reviewed by Chris Dumez.
1267
1268         * Scripts/webkit/messages.py:
1269         (headers_for_type):
1270
1271         * Shared/WebCoreArgumentCoders.h:
1272
1273         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1274         (WebKit::WebSWServerConnection::updateRegistrationStateInClient):
1275         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1276         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
1277
1278         * WebProcess/Storage/WebSWClientConnection.cpp:
1279         (WebKit::WebSWClientConnection::addServiceWorkerRegistrationInServer):
1280         (WebKit::WebSWClientConnection::removeServiceWorkerRegistrationInServer):
1281         * WebProcess/Storage/WebSWClientConnection.h:
1282         * WebProcess/Storage/WebSWClientConnection.messages.in:
1283
1284 2017-11-02  Alex Christensen  <achristensen@webkit.org>
1285
1286         Use CompletionHandlers for redirects
1287         https://bugs.webkit.org/show_bug.cgi?id=179163
1288
1289         Reviewed by Tim Horton.
1290
1291         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
1292         (WebKit::BlobDownloadClient::willSendRequestAsync):
1293         * NetworkProcess/Downloads/BlobDownloadClient.h:
1294         * NetworkProcess/NetworkDataTask.h:
1295         * NetworkProcess/NetworkLoad.cpp:
1296         (WebKit::NetworkLoad::~NetworkLoad):
1297         (WebKit::NetworkLoad::continueWillSendRequest):
1298         (WebKit::NetworkLoad::willSendRequestAsync):
1299         * NetworkProcess/NetworkLoad.h:
1300         * NetworkProcess/NetworkLoadClient.h:
1301         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1302         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
1303         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
1304         * UIProcess/API/APIDownloadClient.h:
1305         (API::DownloadClient::willSendRequest):
1306         * UIProcess/API/C/WKContext.cpp:
1307         (WKContextSetDownloadClient):
1308         * UIProcess/Cocoa/DownloadClient.h:
1309         * UIProcess/Cocoa/DownloadClient.mm:
1310         (WebKit::DownloadClient::willSendRequest):
1311         * WebProcess/Network/WebResourceLoader.cpp:
1312         (WebKit::WebResourceLoader::willSendRequest):
1313         * WebProcess/Plugins/PluginView.cpp:
1314         (WebKit::PluginView::Stream::~Stream):
1315         (WebKit::PluginView::Stream::continueLoad):
1316         (WebKit::PluginView::Stream::willSendRequest):
1317         * WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
1318
1319 2017-11-02  Christopher Reid  <chris.reid@sony.com>
1320
1321         Add a FileSystem namespace to FileSystem.cpp
1322         https://bugs.webkit.org/show_bug.cgi?id=179063
1323
1324         Reviewed by Darin Adler.
1325
1326         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
1327         * NetworkProcess/Downloads/BlobDownloadClient.h:
1328         * NetworkProcess/NetworkDataTaskBlob.cpp:
1329         * NetworkProcess/NetworkDataTaskBlob.h:
1330         * NetworkProcess/NetworkProcess.cpp:
1331         * NetworkProcess/cache/CacheStorageEngine.cpp:
1332         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1333         * NetworkProcess/cache/NetworkCache.cpp:
1334         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
1335         * NetworkProcess/cache/NetworkCacheData.cpp:
1336         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
1337         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1338         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
1339         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
1340         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1341         * NetworkProcess/capture/NetworkCaptureManager.cpp:
1342         * NetworkProcess/capture/NetworkCaptureManager.h:
1343         * NetworkProcess/capture/NetworkCaptureRecorder.cpp:
1344         * NetworkProcess/capture/NetworkCaptureResource.h:
1345         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1346         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1347         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1348         * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp:
1349         * Shared/Plugins/unix/PluginSearchPath.cpp:
1350         * Shared/WebMemorySampler.cpp:
1351         * Shared/WebMemorySampler.h:
1352         * Shared/gtk/ProcessExecutablePathGtk.cpp:
1353         * Shared/ios/ChildProcessIOS.mm:
1354         * Shared/mac/ChildProcessMac.mm:
1355         * Shared/mac/SandboxExtensionMac.mm:
1356         * Shared/wpe/ProcessExecutablePathWPE.cpp:
1357         * StorageProcess/StorageProcess.cpp:
1358         * UIProcess/API/APIContentRuleListStore.cpp:
1359         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp:
1360         * UIProcess/API/glib/IconDatabase.cpp:
1361         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
1362         * UIProcess/API/glib/WebKitFileChooserRequest.cpp:
1363         * UIProcess/API/glib/WebKitWebContext.cpp:
1364         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
1365         * UIProcess/Automation/WebAutomationSession.cpp:
1366         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1367         * UIProcess/Cocoa/WebViewImpl.mm:
1368         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
1369         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
1370         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
1371         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
1372         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
1373         * UIProcess/WebStorage/LocalStorageDatabase.cpp:
1374         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
1375         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1376         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1377         * UIProcess/gtk/WebProcessPoolGtk.cpp:
1378         * UIProcess/mac/WebPageProxyMac.mm:
1379         * UIProcess/wpe/WebProcessPoolWPE.cpp:
1380         * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.cpp:
1381         * WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp:
1382         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
1383         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
1384         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
1385         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
1386
1387 2017-11-02  Joseph Pecoraro  <pecoraro@apple.com>
1388
1389         Make ServiceWorker a Remote Inspector debuggable target
1390         https://bugs.webkit.org/show_bug.cgi?id=179043
1391         <rdar://problem/34126008>
1392
1393         Reviewed by Brian Burg.
1394
1395         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.h:
1396         * UIProcess/API/Cocoa/_WKRemoteWebInspectorViewController.mm:
1397         (debuggableTypeString):
1398         Provide a way to start a Remote Web Inspector frontend for a ServiceWorker target type.
1399
1400 2017-11-02  Ryan Haddad  <ryanhaddad@apple.com>
1401
1402         Unreviewed, rolling out r224353.
1403
1404         Breaks internal builds.
1405
1406         Reverted changeset:
1407
1408         "Ignore HSTS for partitioned, cross-origin subresource
1409         requests"
1410         https://bugs.webkit.org/show_bug.cgi?id=178993
1411         https://trac.webkit.org/changeset/224353
1412
1413 2017-11-02  John Wilander  <wilander@apple.com>
1414
1415         Ignore HSTS for partitioned, cross-origin subresource requests
1416         https://bugs.webkit.org/show_bug.cgi?id=178993
1417         <rdar://problem/34962462>
1418
1419         Reviewed by Brent Fulgham and Alex Christensen.
1420
1421         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1422         (downgradeRequest):
1423             Convenience function to downgrade a request if
1424             CFNetwork as already upgraded it during
1425             canonicalization. This allows the rest of 
1426             WebKit's processing to function, such as UIR
1427             and mixed content blocking.
1428         (updateIgnoreStrictTransportSecuritySettingIfNecessary):
1429             Adds and removed the ignore request accordingly.
1430         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
1431             Now asks CFNetwork to ignore HSTS on resource loads we
1432             partition cookies for.
1433         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
1434             Now asks CFNetwork to ignore HSTS on resource loads we
1435             partition cookies for.
1436
1437 2017-11-02  Yousuke Kimoto  <yousuke.kimoto@sony.com>
1438
1439         [WinCairo] Add IPC files for wincairo webkit
1440         https://bugs.webkit.org/show_bug.cgi?id=177919
1441
1442         Reviewed by Alex Christensen.
1443
1444         * Platform/IPC/Attachment.cpp:
1445         * Platform/IPC/Attachment.h:
1446         (IPC::Attachment::Attachment):
1447         (IPC::Attachment::handle):
1448         * Platform/IPC/Connection.h:
1449         (IPC::Connection::identifierIsNull):
1450         (IPC::Connection::sendWithReply):
1451         * Platform/IPC/win/AttachmentWin.cpp: Added.
1452         (IPC::Attachment::encode const):
1453         (IPC::getDuplicatedHandle):
1454         (IPC::Attachment::decode):
1455         * Platform/IPC/win/ConnectionWin.cpp: Added.
1456         (IPC::Connection::createServerAndClientIdentifiers):
1457         (IPC::Connection::platformInitialize):
1458         (IPC::Connection::platformInvalidate):
1459         (IPC::Connection::readEventHandler):
1460         (IPC::Connection::writeEventHandler):
1461         (IPC::Connection::open):
1462         (IPC::Connection::platformCanSendOutgoingMessages const):
1463         (IPC::Connection::sendOutgoingMessage):
1464         (IPC::Connection::willSendSyncMessage):
1465         (IPC::Connection::didReceiveSyncReply):
1466         * PlatformWin.cmake:
1467
1468 2017-11-02  Megan Gardner  <megan_gardner@apple.com>
1469
1470         Early out selection update when data is not present
1471         https://bugs.webkit.org/show_bug.cgi?id=179084
1472
1473         Reviewed by Ryosuke Niwa.
1474
1475         We should early out of a selection update when we do not have the data that is necessary to make that
1476         update. This mostly helps avoid debug asserts, but will be helpful with the selection changes that are
1477         ongoing.
1478
1479         * UIProcess/ios/WKContentViewInteraction.mm:
1480         (-[WKContentView _updateChangedSelection:]):
1481
1482 2017-11-02  Eric Carlson  <eric.carlson@apple.com>
1483
1484         [MediaStream] audioTrack.label is always empty on macOS
1485         https://bugs.webkit.org/show_bug.cgi?id=179175
1486         <rdar://problem/35315438>
1487
1488         Reviewed by Youenn Fablet.
1489
1490         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
1491         (WebKit::UserMediaCaptureManager::createCaptureSource): Pass settings.label to Source constructor.
1492
1493 2017-11-02  Frederic Wang  <fwang@igalia.com>
1494
1495         Add references to bug 179167 in FIXME comments
1496         https://bugs.webkit.org/show_bug.cgi?id=179168
1497
1498         Reviewed by Daniel Bates.
1499
1500         * Configurations/FeatureDefines.xcconfig:
1501
1502 2017-11-01  Jeremy Jones  <jeremyj@apple.com>
1503
1504         Implement WKFullscreenWindowController for iOS.
1505         https://bugs.webkit.org/show_bug.cgi?id=178924
1506         rdar://problem/34697120
1507
1508         Reviewed by Simon Fraser.
1509
1510         Plumb relevant calls through WKWebView and PageClientImplIOS.
1511
1512         This forms the base implementation for element fullscreen. This will animate an element into fullscreen and back to inline.
1513         It does this by replacing the WKWebView with a placeholder image and presenting the WKWebView with a fullscreen view controller.
1514         This also attempts to preserve UI state of the WKWebView when it is placed back inline.
1515
1516         To enable _WKFullscreenDelegate for iOS, this adds an iOS version of the delegate methods that passes WKWebView instead of NSView.
1517         The iOS version of these functions are renamed to be more specific and disambiguate them from the video fullscreen delegate methods.
1518
1519         This also adds an image asset for the done button.
1520
1521         * Configurations/FeatureDefines.xcconfig:
1522         * UIProcess/API/Cocoa/WKWebView.mm:
1523         (-[WKWebView hasFullScreenWindowController]):
1524         (-[WKWebView fullScreenWindowController]):
1525         (-[WKWebView closeFullScreenWindowController]):
1526         (-[WKWebView fullScreenPlaceholderView]):
1527         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1528         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h:
1529         * UIProcess/Cocoa/FullscreenClient.h:
1530         * UIProcess/Cocoa/FullscreenClient.mm:
1531         (WebKit::FullscreenClient::FullscreenClient):
1532         (WebKit::FullscreenClient::setDelegate):
1533         (WebKit::FullscreenClient::willEnterFullscreen):
1534         (WebKit::FullscreenClient::didEnterFullscreen):
1535         (WebKit::FullscreenClient::willExitFullscreen):
1536         (WebKit::FullscreenClient::didExitFullscreen):
1537         * UIProcess/ios/PageClientImplIOS.mm:
1538         (WebKit::PageClientImpl::closeFullScreenManager):
1539         (WebKit::PageClientImpl::isFullScreen):
1540         (WebKit::PageClientImpl::enterFullScreen):
1541         (WebKit::PageClientImpl::exitFullScreen):
1542         (WebKit::PageClientImpl::beganEnterFullScreen):
1543         (WebKit::PageClientImpl::beganExitFullScreen):
1544         * UIProcess/ios/WKContentView.mm:
1545         * UIProcess/ios/WKFullScreenWindowControllerIOS.h: Copied from Source/WebKit/UIProcess/API/Cocoa/_WKFullscreenDelegate.h.
1546         * UIProcess/ios/WKFullScreenWindowControllerIOS.mm: Added.
1547         (WebKit::replaceViewWithView):
1548         (WebKit::WKWebViewState::applyTo):
1549         (WebKit::WKWebViewState::store):
1550         (-[_WKTapDelgatingView setTarget:action:]):
1551         (-[_WKTapDelgatingView hitTest:withEvent:]):
1552         (-[_WKFullScreenViewController dealloc]):
1553         (-[_WKFullScreenViewController viewWillTransitionToSize:withTransitionCoordinator:]):
1554         (+[_WKFullScreenViewController configureView:withBackgroundFillOfColor:opacity:filter:]):
1555         (-[_WKFullScreenViewController _updateTransparencyOfVisualEffectView:]):
1556         (-[_WKFullScreenViewController createVisualEffectViewWithFrame:]):
1557         (-[_WKFullScreenViewController loadView]):
1558         (-[_WKFullScreenViewController viewWillAppear:]):
1559         (-[_WKFullScreenViewController viewDidDisappear:]):
1560         (-[_WKFullScreenViewController cancelAction:]):
1561         (-[_WKFullScreenViewController hideCancelButton]):
1562         (-[_WKFullScreenViewController showCancelButton]):
1563         (-[_WKFullScreenViewController setTarget:action:]):
1564         (-[_WKFullScreenViewController prefersStatusBarHidden]):
1565         (-[WKFullscreenAnimationController transitionDuration:]):
1566         (-[WKFullscreenAnimationController animateTransition:]):
1567         (-[WKFullscreenAnimationController animationEnded:]):
1568         (-[WKFullScreenWindowController initWithWebView:page:]):
1569         (-[WKFullScreenWindowController dealloc]):
1570         (-[WKFullScreenWindowController isFullScreen]):
1571         (-[WKFullScreenWindowController webViewPlaceholder]):
1572         (-[WKFullScreenWindowController enterFullScreen]):
1573         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]):
1574         (-[WKFullScreenWindowController completedEnterFullScreen]):
1575         (-[WKFullScreenWindowController exitFullScreen]):
1576         (-[WKFullScreenWindowController requestExitFullScreen]):
1577         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
1578         (-[WKFullScreenWindowController completedExitFullScreen]):
1579         (-[WKFullScreenWindowController close]):
1580         (-[WKFullScreenWindowController _manager]):
1581         (-[WKFullScreenWindowController animationControllerForPresentedController:presentingController:sourceController:]):
1582         (-[WKFullScreenWindowController animationControllerForDismissedController:]):
1583         * WebKit.xcassets/Contents.json: Added.
1584         * WebKit.xcassets/Done.imageset/Contents.json: Added.
1585         * WebKit.xcassets/Done.imageset/Done.pdf: Added.
1586         * WebKit.xcodeproj/project.pbxproj:
1587         * WebProcess/FullScreen/WebFullScreenManager.cpp:
1588         (WebKit::WebFullScreenManager::willEnterFullScreen):
1589         (WebKit::WebFullScreenManager::willExitFullScreen):
1590
1591 2017-11-01  Daniel Bates  <dabates@apple.com>
1592
1593         XMLHttpRequest should not sniff content encoding
1594         https://bugs.webkit.org/show_bug.cgi?id=175597
1595         <rdar://problem/34912624>
1596
1597         Reviewed by Alex Christensen.
1598
1599         Fixes an issue where the body of an HTTP response with headers "Content-Type: application/octet-stream" and
1600         "Content-Encoding: gzip" associated with an XHR request to a .gz file would not be automatically gzipped
1601         decompressed. Specifically, such a response would be treated analogous to a response with headers
1602         "Content-Type: application/gzip" and "Content-Encoding: identity". This behavior does not conform to the
1603         behavior of the Content-Encoding header as defined in the HTTP 1.1 and later specs. Moreover this behavior
1604         breaks the Epic Zen Garden demo: <https://s3.amazonaws.com/mozilla-games/ZenGarden/EpicZenGarden.html>.
1605
1606         On macOS 10.13.2 opt out of content encoding sniffing when making an XHR request. We likely can
1607         selectively opt out of content encoding sniffing for other network requests. This will be done
1608         in subsequent commits to make it straightforward to identify site breakage (if any).
1609
1610         * NetworkProcess/Downloads/Download.cpp:
1611         (WebKit::Download::start): Enable content encoding sniff to match existing behavior.
1612         (WebKit::Download::startWithHandle): Ditto.
1613         * NetworkProcess/NetworkDataTask.cpp:
1614         (WebKit::NetworkDataTask::create): Pass through the content encoding sniffing policy.
1615         * NetworkProcess/NetworkLoad.cpp:
1616         (WebKit::NetworkLoad::NetworkLoad): Ditto.
1617         * NetworkProcess/NetworkLoadParameters.h:
1618         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1619         (WebKit::NetworkResourceLoadParameters::encode const): Encode content encoding sniffing policy.
1620         (WebKit::NetworkResourceLoadParameters::decode): Decode content encoding sniffing policy.
1621         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1622         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad): Enable content encoding sniff to match existing
1623         behavior. We should look to disable content encoding sniffing in a subsequent change.
1624         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1625         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1626         (WebKit::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded): Added helper function
1627         to apply sniffing policies and bind request to interface, if applicable.
1628         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa): Modified to take the content encoding sniffing
1629         policy. Calls applySniffingPoliciesAndBindRequestToInferfaceIfNeeded() to apply this policy. Also use
1630         convenience function URL::isLocalFile() to determine if the URL is a file URL.
1631         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1632         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup): Pass through the content encoding sniffing policy.
1633         * NetworkProcess/soup/NetworkDataTaskSoup.h:
1634         * WebProcess/Network/WebLoaderStrategy.cpp:
1635         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess): Pass through the content encoding sniffing policy.
1636         (WebKit::WebLoaderStrategy::loadResourceSynchronously): Enable content encoding sniff to match existing
1637         behavior.
1638
1639 2017-11-01  Brady Eidson  <beidson@apple.com>
1640
1641         Plumbing for handling SW scripts failing to evaluate
1642         https://bugs.webkit.org/show_bug.cgi?id=178926
1643
1644         Reviewed by Chris Dumez.
1645
1646         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
1647         (WebKit::WebSWServerConnection::updateServiceWorkerContext):
1648         (WebKit::WebSWServerConnection::setContextConnection):
1649         (WebKit::WebSWServerConnection::startServiceWorkerContext): Deleted.
1650         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
1651
1652         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
1653         (WebKit::WebSWContextManagerConnection::updateServiceWorker):
1654         (WebKit::WebSWContextManagerConnection::serviceWorkerStartedWithMessage):
1655         (WebKit::WebSWContextManagerConnection::startServiceWorker): Deleted.
1656         * WebProcess/Storage/WebSWContextManagerConnection.h:
1657         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
1658
1659 2017-11-01  Frederic Wang  <fwang@igalia.com>
1660
1661         Make iOS Find UI reveal matches in scrollable elements
1662         https://bugs.webkit.org/show_bug.cgi?id=178789
1663
1664         Reviewed by Tim Horton.
1665
1666         * WebProcess/WebPage/ios/FindControllerIOS.mm:
1667         (WebKit::FindController::didFindString): Reveal selection up to the main frame. The main frame
1668         is handled by the SmartMagnificationController.
1669
1670 2017-11-01  Michael Catanzaro  <mcatanzaro@igalia.com>
1671
1672         REGRESSION(r224192): [WPE] Fix WebEventFactory::createWebWheelEvent
1673         https://bugs.webkit.org/show_bug.cgi?id=179098
1674
1675         Reviewed by Sam Weinig.
1676
1677         * Shared/wpe/WebEventFactory.cpp:
1678         (WebKit::WebEventFactory::createWebWheelEvent):
1679
1680 2017-10-31  Tim Horton  <timothy_horton@apple.com>
1681
1682         Clean up some drag and drop feature flags
1683         https://bugs.webkit.org/show_bug.cgi?id=179082
1684
1685         Reviewed by Simon Fraser.
1686
1687         * Configurations/FeatureDefines.xcconfig:
1688
1689 2017-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
1690
1691         Followup to r224238: API::Attachment should generate a _WKAttachment ObjC wrapper
1692         https://bugs.webkit.org/show_bug.cgi?id=179080
1693
1694         Reviewed by Tim Horton.
1695
1696         Fixes a failing API test. The new Attachment object type added in r224238 was not actually being handled in
1697         Object::newObject, so a plain WKObject Objective C wrapper was being created; fix this by allocating a new
1698         _WKAttachment object for Type::Attachment.
1699
1700         * Shared/Cocoa/APIObject.mm:
1701         (API::Object::newObject):
1702
1703 2017-10-31  Tim Horton  <timothy_horton@apple.com>
1704
1705         Fix up some content filtering feature flags
1706         https://bugs.webkit.org/show_bug.cgi?id=179079
1707
1708         Reviewed by Simon Fraser.
1709
1710         * Configurations/FeatureDefines.xcconfig:
1711
1712 2017-10-31  Youenn Fablet  <youenn@apple.com>
1713
1714         rwt should allow service worker to load localhost HTTPS resources with any certificate
1715         https://bugs.webkit.org/show_bug.cgi?id=179018
1716
1717         Reviewed by Chris Dumez.
1718
1719         Allowing ServiceWorkerProcessProxy to handle authentication challenge.
1720         Temporarily adding a boolean flag through WebProcessPool to lower the SSL certificate verifications for service workers.
1721         This allows reducing flakiness in our layout tests for rwt.
1722         Future work should be done to expose a correct API for the application level to handle authentication challenges properly.
1723
1724         * UIProcess/API/C/WKContext.cpp:
1725         (WKContextSetAllowsAnySSLCertificateForServiceWorkerTesting):
1726         * UIProcess/API/C/WKContextPrivate.h:
1727         * UIProcess/API/Cocoa/WKProcessPool.mm:
1728         (-[WKProcessPool _setAllowsAnySSLCertificateForServiceWorker:]):
1729         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1730         * UIProcess/Network/NetworkProcessProxy.cpp:
1731         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
1732         (WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace):
1733         * UIProcess/ServiceWorkerProcessProxy.cpp:
1734         (WebKit::ServiceWorkerProcessProxy::didReceiveAuthenticationChallenge):
1735         * UIProcess/ServiceWorkerProcessProxy.h:
1736         * UIProcess/WebProcessPool.h:
1737
1738 2017-10-31  Joseph Pecoraro  <pecoraro@apple.com>
1739
1740         Web Inspector: UIProcess ASSERT in ~RemoteWebInspectorProxy when InspectorProcess crashes
1741         https://bugs.webkit.org/show_bug.cgi?id=179044
1742
1743         Reviewed by Alex Christensen.
1744
1745         * UIProcess/RemoteWebInspectorProxy.cpp:
1746         (WebKit::RemoteWebInspectorProxy::frontendDidClose):
1747         Add a protector to keep the proxy alive for the duration of this method.
1748
1749 2017-10-31  Youenn Fablet  <youenn@apple.com>
1750
1751         Crash in:  com.apple.WebKit: WebKit::CacheStorage::Caches::initializeSize(WTF::Function<void (std::optional<WebCore::DOMCacheEngine::Error>&&)>&&) + 30 (CacheStorageEngineCaches.cpp:163)
1752         https://bugs.webkit.org/show_bug.cgi?id=179037
1753
1754         Reviewed by Chris Dumez.
1755
1756         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
1757         (WebKit::CacheStorage::Caches::initializeSize): the storage backend may be cleared when clearing caches by the UI Process.
1758         Returning early in that case. A web application will typically fail to open a cache in this case.
1759         On retry, the cache should be opened.
1760
1761 2017-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
1762
1763         [Attachment Support] Implement WKWebView SPI for inserting attachment elements
1764         https://bugs.webkit.org/show_bug.cgi?id=179013
1765         <rdar://problem/35249668>
1766
1767         Reviewed by Tim Horton.
1768
1769         Adds native SPI to insert attachment elements given a filename, an optional MIME type, and a data blob. See
1770         change-by-change comments below for more detail. Covered by a new API test.
1771
1772         * PlatformMac.cmake:
1773         * Shared/API/APIObject.h:
1774         * Shared/API/Cocoa/WebKitPrivate.h:
1775         * UIProcess/API/APIAttachment.cpp: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h.
1776         (API::Attachment::create):
1777         (API::Attachment::Attachment):
1778         (API::Attachment::~Attachment):
1779
1780         Introduce API::Attachment, which represents a platform-agnostic Attachment.
1781
1782         * UIProcess/API/APIAttachment.h: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h.
1783         * UIProcess/API/Cocoa/WKWebView.mm:
1784         (-[WKWebView _insertAttachmentWithFilename:contentType:data:options:completion:]):
1785
1786         Adds support for inserting a new attachment element. Calls out to WebPageProxy to insert the attachment from the
1787         given data blob, and creates a new API-object-backed _WKAttachment.
1788
1789         (-[WKWebView _executeEditCommand:argument:completion:]):
1790
1791         Support passing in a nil completion block.
1792
1793         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1794         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1795         * UIProcess/API/Cocoa/_WKAttachment.h: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h.
1796         * UIProcess/API/Cocoa/_WKAttachment.mm: Copied from Source/WebCore/html/HTMLAttachmentElement.h.
1797
1798         Introduces _WKAttachment, an Objective C wrapper around the API::Attachment.
1799
1800         (-[_WKAttachment _apiObject]):
1801         (-[_WKAttachment isEqual:]):
1802         (-[_WKAttachment uniqueIdentifier]):
1803         (-[_WKAttachment hash]):
1804
1805         Add _WKAttachment, a WebKit SPI object that wraps an attachment element unique identifier. Also, allow
1806         _WKAttachment to be used as a hashable NSDictionary key.
1807
1808         (-[_WKAttachment description]):
1809         * UIProcess/API/Cocoa/_WKAttachmentInternal.h: Copied from Source/WebKit/Shared/API/Cocoa/WebKitPrivate.h.
1810         (API::wrapper):
1811         * UIProcess/WebPageProxy.cpp:
1812         (WebKit::WebPageProxy::insertAttachment):
1813
1814         Implement IPC support for inserting an attachment.
1815
1816         * UIProcess/WebPageProxy.h:
1817         * WebKit.xcodeproj/project.pbxproj:
1818         * WebProcess/WebPage/WebPage.cpp:
1819         (WebKit::WebPage::insertAttachment):
1820         * WebProcess/WebPage/WebPage.h:
1821         * WebProcess/WebPage/WebPage.messages.in:
1822
1823 2017-10-31  Alex Christensen  <achristensen@webkit.org>
1824
1825         Fix custom header field setting with reloads and asynchronous navigation action policy decisions
1826         https://bugs.webkit.org/show_bug.cgi?id=179064
1827
1828         Reviewed by Tim Horton.
1829
1830         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1831         (WebKit::WebFrameLoaderClient::applyToDocumentLoader):
1832         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1833         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1834         * WebProcess/WebPage/WebFrame.cpp:
1835         (WebKit::WebFrame::didReceivePolicyDecision):
1836         * WebProcess/WebPage/WebFrame.h:
1837         * WebProcess/WebPage/WebPage.cpp:
1838         (WebKit::WebPage::didReceivePolicyDecision):
1839
1840 2017-10-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1841
1842         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.1 release.
1843
1844         * gtk/NEWS: Add release notes for 2.19.1.
1845
1846 2017-10-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1847
1848         Unreviewed. Fix GTK+ make distcheck.
1849
1850         Include WebCore/TextEncodingRegistry.h to ensure the forwarding header is generated.
1851
1852         * UIProcess/API/glib/WebKitSettings.cpp:
1853
1854 2017-10-31  Commit Queue  <commit-queue@webkit.org>
1855
1856         Unreviewed, rolling out r223884.
1857         https://bugs.webkit.org/show_bug.cgi?id=179055
1858
1859         It broke GTK+ make distcheck (Requested by KaL on #webkit).
1860
1861         Reverted changeset:
1862
1863         "[GTK][WPE] generate-forwarding-headers.pl should also scan
1864         derived sources in WebKit framework"
1865         https://bugs.webkit.org/show_bug.cgi?id=178579
1866         https://trac.webkit.org/changeset/223884
1867
1868 2017-10-30  Fujii Hironori  <Hironori.Fujii@sony.com>
1869
1870         Use LazyNeverDestroyed instead of DEFINE_GLOBAL for XMLNames, HTMLNames, MathMLNames and SVGNames
1871         https://bugs.webkit.org/show_bug.cgi?id=175118
1872
1873         Reviewed by Alex Christensen.
1874
1875         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPrivate.cpp:
1876         (WebKit::wrap):
1877
1878 2017-10-27  Megan Gardner  <megan_gardner@apple.com>
1879
1880         Correctly determine affinity when inserting text via Keyboard Suggestions
1881         https://bugs.webkit.org/show_bug.cgi?id=178969
1882
1883         Reviewed by Ryosuke Niwa.
1884
1885         Use the logic of VisiblePosition to correctly determine cursor affinity. We were
1886         defaulting to upstream, but that in incorrect and resulted in hitting asserts that
1887         we should not. This should give us the correct affinity in all cases.
1888
1889         * WebProcess/WebPage/ios/WebPageIOS.mm:
1890         (WebKit::WebPage::syncApplyAutocorrection):
1891
1892 2017-10-30  Commit Queue  <commit-queue@webkit.org>
1893
1894         Unreviewed, rolling out r224078.
1895         https://bugs.webkit.org/show_bug.cgi?id=179026
1896
1897         MotionMark regression (Requested by shallawa on #webkit).
1898
1899         Reverted changeset:
1900
1901         "When navigating back to a page, compositing layers may not
1902         use accelerated drawing"
1903         https://bugs.webkit.org/show_bug.cgi?id=178749
1904         https://trac.webkit.org/changeset/224078
1905
1906 2017-10-30  Sam Weinig  <sam@webkit.org>
1907
1908         [Setting] Only expose experimental features that are compiled in
1909         https://bugs.webkit.org/show_bug.cgi?id=179023
1910
1911         Reviewed by Tim Horton.
1912
1913         * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
1914         
1915             Update template to conditionally expose experimental features based on their
1916             'condition' option in WebPreferences.yaml
1917
1918 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
1919
1920         [WPE] Fix build warnings
1921         https://bugs.webkit.org/show_bug.cgi?id=178899
1922
1923         Reviewed by Carlos Alberto Lopez Perez.
1924
1925         * PlatformWPE.cmake:
1926
1927 2017-10-30  Sam Weinig  <sam@webkit.org>
1928
1929         [Settings] Replace macro driven experimental features code with generated code
1930         https://bugs.webkit.org/show_bug.cgi?id=178994
1931
1932         Reviewed by Simon Fraser.
1933
1934         As a first step toward allowing experimental features to vary based on compile
1935         time flags, replace the macro driven implementation of the WebPreferences part
1936         of experimental features, with one generated from a template file.
1937
1938         * CMakeLists.txt:
1939         * DerivedSources.make:
1940         * Scripts/GeneratePreferences.rb:
1941         * WebKit.xcodeproj/project.pbxproj:
1942
1943             Generate the new template.
1944         
1945         * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb: Added.
1946         * UIProcess/WebPreferences.cpp:
1947         (WebKit::createExperimentalFeaturesVector): Deleted.
1948         (WebKit::WebPreferences::experimentalFeatures): Deleted.
1949         (WebKit::WebPreferences::isEnabledForFeature const): Deleted.
1950         (WebKit::WebPreferences::setEnabledForFeature): Deleted.
1951         (WebKit::WebPreferences::enableAllExperimentalFeatures): Deleted.
1952         
1953             Replace macro implementation with template generated one.
1954
1955 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
1956
1957         [WPE] Build more files under WebCore as unified sources and get rid of WebCorePlatformWPE build target
1958         https://bugs.webkit.org/show_bug.cgi?id=178964
1959
1960         Reviewed by Carlos Alberto Lopez Perez.
1961
1962         * PlatformWPE.cmake:
1963
1964 2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
1965
1966         [WPE][GTK] Expose availability of certain editing commands in WebKitEditorState
1967         https://bugs.webkit.org/show_bug.cgi?id=168219
1968
1969         Reviewed by Ryosuke Niwa.
1970
1971         Expose canCut, canCopy, canPaste, canUndo, and canRedo in EditorState::PostLayouData.
1972
1973         Add corresponding new WPE/GTK API.
1974
1975         Remove allowsCopy from WebKitTestResultData. It's unused, does not work correctly in all
1976         circumstances, and irritates Ryosuke.
1977
1978         Also, remove a bunch of #ifs guarding post layout data, since it's now used on all ports.
1979
1980         * Shared/EditorState.cpp:
1981         (WebKit::EditorState::encode const):
1982         (WebKit::EditorState::decode):
1983         (WebKit::EditorState::PostLayoutData::encode const):
1984         (WebKit::EditorState::PostLayoutData::decode):
1985         * Shared/EditorState.h:
1986         (WebKit::EditorState::postLayoutData const const):
1987         * Shared/WebHitTestResultData.cpp:
1988         (WebKit::WebHitTestResultData::WebHitTestResultData):
1989         (WebKit::WebHitTestResultData::encode const):
1990         (WebKit::WebHitTestResultData::decode):
1991         * Shared/WebHitTestResultData.h:
1992         * UIProcess/API/APIHitTestResult.h:
1993         (API::HitTestResult::allowsCopy const): Deleted.
1994         * UIProcess/API/glib/WebKitEditorState.cpp:
1995         (webkitEditorStateChanged):
1996         (webkit_editor_state_is_cut_available):
1997         (webkit_editor_state_is_copy_available):
1998         (webkit_editor_state_is_paste_available):
1999         (webkit_editor_state_is_undo_available):
2000         (webkit_editor_state_is_redo_available):
2001         * UIProcess/API/glib/WebKitWebView.cpp:
2002         (webkit_web_view_can_execute_editing_command):
2003         * UIProcess/API/gtk/WebKitEditorState.h:
2004         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2005         * UIProcess/API/wpe/WebKitEditorState.h:
2006         * WebProcess/WebPage/WebPage.cpp:
2007         (WebKit::WebPage::editorState const):
2008         * WebProcess/WebPage/mac/WebPageMac.mm:
2009         (WebKit::WebPage::performImmediateActionHitTestAtLocation):
2010
2011 2017-10-27  Sam Weinig  <sam@webkit.org>
2012
2013         [Settings] Generate more of the WebKit preferences code
2014         https://bugs.webkit.org/show_bug.cgi?id=178945
2015
2016         Reviewed by Chris Dumez.
2017
2018         Generate WebPreferencesKeys.{h,cpp} and WebPreferencesStoreDefaultsMap.cpp
2019
2020         * CMakeLists.txt:
2021         * DerivedSources.make:
2022         * WebKit.xcodeproj/project.pbxproj:
2023         * Scripts/GeneratePreferences.rb:
2024         
2025             Generate new files.
2026         
2027         * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb:
2028         
2029             Update include.
2030         
2031         * Scripts/PreferencesTemplates/WebPreferencesKeys.cpp.erb: Added.
2032         * Scripts/PreferencesTemplates/WebPreferencesKeys.h.erb: Added.
2033         * Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb: Added.
2034
2035             Add template files for new generated files.
2036
2037         * Shared/WebPreferencesDefaultValues.h: Copied from Source/WebKit/Shared/WebPreferencesDefinitionsBase.h.
2038         * Shared/WebPreferencesDefinitionsBase.h:
2039         
2040             Renamed WebPreferencesDefinitionsBase.h to WebPreferencesDefaultValues.h to better indicate what it is.
2041         
2042         * Shared/WebPreferencesKeys.cpp: Removed.
2043         * Shared/WebPreferencesKeys.h: Removed.
2044         
2045             Replaced with generated versions.
2046
2047         * Shared/WebPreferencesStore.cpp:
2048         (WebKit::defaults): Deleted.
2049         * Shared/WebPreferencesStore.h:
2050         
2051             Replace macro driven defaults map with generated WebPreferencesStoreDefaultsMap.cpp.
2052
2053 2017-10-28  Chris Dumez  <cdumez@apple.com>
2054
2055         self.ExtendableEvent / Client / Clients / WindowClient do not exist in a Service Worker
2056         https://bugs.webkit.org/show_bug.cgi?id=178976
2057
2058         Reviewed by Sam Weinig.
2059
2060         Actually enable the Service Worker RuntimeEnabledFeature in the Service Worker
2061         WebProcess.
2062
2063         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2064         (WebKit::WebSWContextManagerConnection::updatePreferences):
2065
2066 2017-10-28  Joseph Pecoraro  <pecoraro@apple.com>
2067
2068         Make postprocess-framework-headers.sh a little easier to read
2069         https://bugs.webkit.org/show_bug.cgi?id=178971
2070
2071         Reviewed by Sam Weinig.
2072
2073         * mac/postprocess-framework-headers.sh:
2074
2075 2017-10-27  Daniel Bates  <dabates@apple.com>
2076
2077         Attempt to fix the Apple El Capitan build following <https://trac.webkit.org/changeset/224134>
2078         (https://bugs.webkit.org/show_bug.cgi?id=178919)
2079
2080         Move definition of NetworkLoad::isAllowedToAskUserForCredentials() outside of USE(NETWORK_SESSION)-guarded section.
2081
2082         * NetworkProcess/NetworkLoad.cpp:
2083         (WebKit::NetworkLoad::isAllowedToAskUserForCredentials const):
2084
2085 2017-10-27  Daniel Bates  <dabates@apple.com>
2086
2087         Only allow non-mixed content protected subresources to ask for credentials
2088         https://bugs.webkit.org/show_bug.cgi?id=178919
2089         <rdar://problem/35015245>
2090
2091         Reviewed by Alex Christensen.
2092
2093         Only allow non-mixed content protected subresources to ask for credentials. It is not meaningful
2094         to allow protected mixed-content subresources to ask for credentials.
2095
2096         * NetworkProcess/Downloads/PendingDownload.cpp:
2097         (WebKit::PendingDownload::PendingDownload): Initialize m_isAllowedToAskUserForCredentials based on
2098         the specified resource load parameters or NetworkLoad object.
2099         * NetworkProcess/Downloads/PendingDownload.h: Add override for NetworkLoadClient::isAllowedToAskUserForCredentials().
2100         * NetworkProcess/NetworkLoad.cpp:
2101         (WebKit::NetworkLoad::isAllowedToAskUserForCredentials const): Added.
2102         (WebKit::NetworkLoad::completeAuthenticationChallenge): Ask NetworkLoadClient whether the load is
2103         allowed to prompt for credentials.
2104         (WebKit::NetworkLoad::didReceiveAuthenticationChallenge): Ditto.
2105         * NetworkProcess/NetworkLoad.h:
2106         * NetworkProcess/NetworkLoadClient.h:
2107         * NetworkProcess/NetworkResourceLoader.cpp:
2108         (WebKit::NetworkResourceLoader::NetworkResourceLoader): Initialize m_isAllowedToAskUserForCredentials
2109         based on the specified resource load parameters.
2110         (WebKit::NetworkResourceLoader::willSendRedirectedRequest): We do not support prompting for credentials
2111         for synchronous loads.
2112         (WebKit::NetworkResourceLoader::continueWillSendRequest): Modified to take an argument as to whether the
2113         load is allowed to ask the user for credentials and updates state.
2114         * NetworkProcess/NetworkResourceLoader.h:
2115         * NetworkProcess/NetworkResourceLoader.messages.in: Modified message ContinueWillSendRequest to take a
2116         boolean as to whether the load is allowed to ask the user for credentials.
2117         * NetworkProcess/PreconnectTask.h: Override NetworkLoadClient::isAllowedToAskUserForCredentials()
2118         such that we never ask for credentials. This matches our current behavior.
2119         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: Ditto.
2120         * WebProcess/Network/WebResourceLoader.cpp:
2121         (WebKit::WebResourceLoader::willSendRequest): Query ResourceLoader as to whether the load is allowed to
2122         ask the user for credentials and pass this state to NetworkResourceLoader.
2123
2124 2017-10-27  Adrian Perez de Castro  <aperez@igalia.com>
2125
2126         [GTK][CMake] Incorrect conditional check when adding build dir to GIR runtime library path
2127         https://bugs.webkit.org/show_bug.cgi?id=178936
2128
2129         Reviewed by Michael Catanzaro.
2130
2131         * PlatformGTK.cmake: Fix spelling of variable used in conditional.
2132
2133 2017-10-27  Chris Dumez  <cdumez@apple.com>
2134
2135         Add initial support for serviceWorkerClient.postMessage()
2136         https://bugs.webkit.org/show_bug.cgi?id=178794
2137
2138         Reviewed by Youenn Fablet.
2139
2140         Add initial support for serviceWorkerClient.postMessage():
2141         - https://w3c.github.io/ServiceWorker/#client-postmessage
2142
2143         It is now possible to do bi-directional communication with a service worker
2144         via postMessage().
2145
2146         * Shared/WebCoreArgumentCoders.cpp:
2147         (IPC::ArgumentCoder<ServiceWorkerClientIdentifier>::encode):
2148         (IPC::ArgumentCoder<ServiceWorkerClientIdentifier>::decode):
2149         * Shared/WebCoreArgumentCoders.h:
2150         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2151         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
2152         (WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
2153         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2154         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2155         * StorageProcess/StorageProcess.cpp:
2156         (WebKit::StorageProcess::postMessageToServiceWorkerClient):
2157         * StorageProcess/StorageProcess.h:
2158         * StorageProcess/StorageProcess.messages.in:
2159         * WebProcess/Storage/WebSWClientConnection.cpp:
2160         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
2161         (WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
2162         * WebProcess/Storage/WebSWClientConnection.h:
2163         * WebProcess/Storage/WebSWClientConnection.messages.in:
2164         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
2165         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
2166         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
2167         * WebProcess/Storage/WebSWContextManagerConnection.h:
2168         * WebProcess/Storage/WebSWContextManagerConnection.messages.in:
2169
2170 2017-10-27  David Kilzer  <ddkilzer@apple.com>
2171
2172         REGRESSION (r224077): DeprecatedGlobalSettings::setAVKitEnabled() not protected by HAVE(AVKIT)
2173
2174         Unreviewed build fix.
2175
2176         * WebProcess/WebPage/WebPage.cpp:
2177         (WebKit::WebPage::updatePreferences): Fix build.
2178
2179 2017-10-26  Jeremy Jones  <jeremyj@apple.com>
2180
2181         Implement seek tolerance methods in WebAVPlayerController.
2182         https://bugs.webkit.org/show_bug.cgi?id=178838
2183         rdar://problem/33781777
2184
2185         Reviewed by Eric Carlson.
2186
2187         This implementes additional methods on WebAVPlayerController that allows AVKit more control over seeking.
2188
2189         * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
2190         * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
2191         (WebKit::PlaybackSessionModelContext::seekToTime):
2192         (WebKit::PlaybackSessionManagerProxy::seekToTime):
2193         * WebProcess/cocoa/PlaybackSessionManager.h:
2194         * WebProcess/cocoa/PlaybackSessionManager.messages.in:
2195         * WebProcess/cocoa/PlaybackSessionManager.mm:
2196         (WebKit::PlaybackSessionManager::seekToTime):
2197
2198 2017-10-26  Brian Burg  <bburg@apple.com>
2199
2200         Web Automation: denying user permission for getUserMedia doesn't work
2201         https://bugs.webkit.org/show_bug.cgi?id=178895
2202
2203         Reviewed by Youenn Fablet.
2204
2205         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2206         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2207         The ordering of special cases is incorrect. Safari configures its automation views to
2208         allow mock devices and never prompt for them. These checks were before the check for
2209         the automation session's getUserMedia permission. Switch these checks.
2210
2211         Also change the deny reason so that subsequent requests are also denied. This matches
2212         behavior when a user denies a permission request on a real dialog. With this change,
2213         the DOM error changes from SecurityError to NotAllowedError, which makes more sense.
2214
2215 2017-10-26  Michael Catanzaro  <mcatanzaro@igalia.com>
2216
2217         Unreviewed, fix GCC warning spam after r224077
2218         https://bugs.webkit.org/show_bug.cgi?id=178823
2219
2220         Need to leave a blank line at the bottom of the file.
2221
2222         * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb:
2223
2224 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
2225
2226         When navigating back to a page, compositing layers may not use accelerated drawing
2227         https://bugs.webkit.org/show_bug.cgi?id=178749
2228         rdar://problem/35158946
2229
2230         Reviewed by Dean Jackson.
2231
2232         Avoid assertions when a test enables accelerated drawing (which we can't support
2233         in the iOS simulator).
2234
2235         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
2236         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
2237
2238 2017-10-26  Sam Weinig  <sam@webkit.org>
2239
2240         [Settings] Generate the bulk of WebPage::updatePreferences(...)
2241         https://bugs.webkit.org/show_bug.cgi?id=178823
2242
2243         Reviewed by Tim Horton.
2244
2245         * CMakeLists.txt:
2246         * DerivedSources.make:
2247         * WebKit.xcodeproj/project.pbxproj:
2248
2249             Add new file generation.
2250
2251         * Scripts/GeneratePreferences.rb:
2252         
2253             Replace 'webkitOnly' boolean option with a new 'webcoreBinding' option.
2254             'webcoreBinding' supports the following values:
2255                 - none (same as webkit only)
2256                 - custom (means that you do bind to a webcore concept, but currently it must
2257                   be done in a custom manner)
2258                 - DeprecatedGlobalSettings (binds to a DeprecatedGlobalSettings setting)
2259                 - RuntimeEnabledFeatures (binds to a RuntimeEnabledFeatures setting)
2260             If 'webcoreBinding' is not provided, the preference binds to WebCore Setting
2261             of either the same name or the override name provided by the new 'webcoreName'
2262             option (we should try to remove the need for 'webcoreName' by unifying with 
2263             WebCore on preference/setting naming).
2264             
2265             A 'condition' option was also added to indicate that the preference is only available
2266             when that macro condition is true.
2267             
2268             Since we are generating most of WebPage::updatePreferences, we can simplify the
2269             macros in WebPreferencesDefinitions.h to only have normal/debug/experimental variants
2270             and remove the need for per-type macros, which were only used in WebPage::updatePreferences.
2271         
2272         * Scripts/PreferencesTemplates/WebPageUpdatePreferences.cpp.erb: Added.
2273         
2274             Generates bindings from WebPreferences to WebCore::Settings/DeprecatedGlobalSettings/RuntimeEnabledFeatures.
2275             Does not generate a binding if the 'webcoreBinding' option is set to either 'none' or 'custom'.
2276         
2277         * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb:
2278     
2279             Simplify down to just normal/debug/experimental macros.
2280         
2281         * Shared/WebPreferences.yaml:
2282         
2283             Annotate perferences with new optional 'webcoreBinding', 'webcoreName', and 'condition'
2284             options.
2285         
2286         * WebProcess/WebPage/WebPage.cpp:
2287         (WebKit::WebPage::updatePreferences):
2288         
2289             Replace a ton of hand written preference to settings bindings with a call to updatePreferencesGenerated().
2290         
2291         * WebProcess/WebPage/WebPage.h:
2292         
2293             Add declaration of updatePreferencesGenerated, remove platformPreferencesDidChange.
2294
2295         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
2296         (WebKit::WebPage::platformPreferencesDidChange): Deleted.
2297         * WebProcess/WebPage/ios/WebPageIOS.mm:
2298         (WebKit::WebPage::platformPreferencesDidChange): Deleted.
2299         * WebProcess/WebPage/mac/WebPageMac.mm:
2300         (WebKit::WebPage::platformPreferencesDidChange): Deleted.
2301         * WebProcess/WebPage/win/WebPageWin.cpp:
2302         (WebKit::WebPage::platformPreferencesDidChange): Deleted.
2303         * WebProcess/WebPage/wpe/WebPageWPE.cpp:
2304         (WebKit::WebPage::platformPreferencesDidChange): Deleted.
2305         
2306             Remove all the empty platformPreferencesDidChange functions.
2307
2308 2017-10-26  Alex Christensen  <achristensen@webkit.org>
2309
2310         Move WKWebViewConfiguration validation to WKWebView construction
2311         https://bugs.webkit.org/show_bug.cgi?id=178840
2312
2313         Reviewed by Tim Horton.
2314         
2315         I'm trying to remove WKWebViewConfigurationInternal methods so I can make WKWebViewConfiguration
2316         a wrapper around an APIObject like all the other API objects.  A small step towards making this easier
2317         is to remove the unnecessary method _validate and move its logic to its one callsite.  I added an API test
2318         that ensures no change in behavior.
2319
2320         * UIProcess/API/Cocoa/WKWebView.mm:
2321         (-[WKWebView _initializeWithConfiguration:]):
2322         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2323         (-[WKWebViewConfiguration _validate]): Deleted.
2324         * UIProcess/API/Cocoa/WKWebViewConfigurationInternal.h:
2325
2326 2017-10-26  Megan Gardner  <megan_gardner@apple.com>
2327
2328         Remove unneeded block selection calculation code
2329         https://bugs.webkit.org/show_bug.cgi?id=178889
2330
2331         Reviewed by Tim Horton.
2332
2333         Removing more block selection code. Much of this should have been removed
2334         before, as the only things that were using these functions were removed in the
2335         last patch. Also remove the code decided if you should move to block mode or not,
2336         as the answer now is always NO.
2337
2338         * WebProcess/WebPage/WebPage.h:
2339         * WebProcess/WebPage/ios/WebPageIOS.mm:
2340         (WebKit::WebPage::updateSelectionWithTouches):
2341         (WebKit::WebPage::rangeForBlockAtPoint): Deleted.
2342         (WebKit::distanceBetweenRectsForPosition): Deleted.
2343         (WebKit::rectsEssentiallyTheSame): Deleted.
2344         (WebKit::unionDOMRanges): Deleted.
2345         (WebKit::computeEdgeCenter): Deleted.
2346         (WebKit::WebPage::expandedRangeFromHandle): Deleted.
2347         (WebKit::WebPage::contractedRangeFromHandle): Deleted.
2348         (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle): Deleted.
2349         (WebKit::WebPage::switchToBlockSelectionAtPoint): Deleted.
2350         (WebKit::WebPage::shouldSwitchToBlockModeForHandle): Deleted.
2351
2352 2017-10-26  Jeremy Jones  <jeremyj@apple.com>
2353
2354         Call setFullscreenClient on iOS.
2355         https://bugs.webkit.org/show_bug.cgi?id=178089
2356
2357         Reviewed by Simon Fraser.
2358
2359         This was only being set for MacOS.
2360
2361         * UIProcess/ios/WKContentView.mm:
2362         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
2363
2364 2017-10-26  Eric Carlson  <eric.carlson@apple.com>
2365
2366         NowPlayingInfo should contain a unique identifier
2367         https://bugs.webkit.org/show_bug.cgi?id=178872
2368
2369         Reviewed by Jer Noble.
2370
2371         * UIProcess/API/Cocoa/WKWebView.mm:
2372         (-[WKWebView _requestActiveNowPlayingSessionInfo:]): Take a completion handler.
2373         (-[WKWebView _requestActiveNowPlayingSessionInfo]): Deleted.
2374         (-[WKWebView _handleActiveNowPlayingSessionInfoResponse:title:duration:elapsedTime:]): Deleted.
2375         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2376         * UIProcess/PageClient.h:
2377
2378         * UIProcess/WebPageProxy.cpp:
2379         (WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo): Ditto.
2380         (WebKit::WebPageProxy::nowPlayingInfoCallback): Lookup and call completion handler.
2381         (WebKit::WebPageProxy::handleActiveNowPlayingSessionInfoResponse const): Deleted.
2382         * UIProcess/WebPageProxy.h:
2383         * UIProcess/WebPageProxy.messages.in:
2384
2385         * UIProcess/ios/PageClientImplIOS.h:
2386         * UIProcess/ios/PageClientImplIOS.mm:
2387         (WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse): Deleted.
2388
2389         * UIProcess/mac/PageClientImplMac.h:
2390         * UIProcess/mac/PageClientImplMac.mm:
2391         (WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse): Deleted.
2392
2393         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
2394         (WebKit::WebPage::requestActiveNowPlayingSessionInfo): Take callback ID. Pass unique ID.
2395         * WebProcess/WebPage/WebPage.h:
2396         * WebProcess/WebPage/WebPage.messages.in:
2397
2398 2017-10-26  Andy Estes  <aestes@apple.com>
2399
2400         [Payment Request] Enable Payment Request whenever Apple Pay is enabled
2401         https://bugs.webkit.org/show_bug.cgi?id=178880
2402
2403         Reviewed by Tim Horton.
2404
2405         * Shared/WebPreferences.yaml:
2406         * UIProcess/API/C/WKPreferences.cpp:
2407         (WKPreferencesSetPaymentRequestEnabled): Deleted.
2408         (WKPreferencesGetPaymentRequestEnabled): Deleted.
2409         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2410         * WebProcess/WebPage/WebPage.cpp:
2411         (WebKit::WebPage::updatePreferences):
2412
2413 2017-10-26  Chris Dumez  <cdumez@apple.com>
2414
2415         Bring back SWContextManager abstraction in WebCore
2416         https://bugs.webkit.org/show_bug.cgi?id=178876
2417
2418         Reviewed by Geoffrey Garen.
2419
2420         Bring back SWContextManager abstraction in WebCore. It was killed in <https://trac.webkit.org/changeset/223718> but
2421         is actually useful when the ServiceWorker wants to message the storage process.
2422
2423         * CMakeLists.txt:
2424         * DerivedSources.make:
2425         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2426         (WebKit::WebSWServerConnection::startServiceWorkerContext):
2427         (WebKit::WebSWServerConnection::startFetch):
2428         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
2429         * WebKit.xcodeproj/project.pbxproj:
2430         * WebProcess/Storage/WebSWContextManagerConnection.cpp: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.cpp.
2431         (WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
2432         (WebKit::WebSWContextManagerConnection::updatePreferences):
2433         (WebKit::WebSWContextManagerConnection::startServiceWorker):
2434         (WebKit::WebSWContextManagerConnection::startFetch):
2435         (WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
2436         * WebProcess/Storage/WebSWContextManagerConnection.h: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
2437         * WebProcess/Storage/WebSWContextManagerConnection.messages.in: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.messages.in.
2438         * WebProcess/WebProcess.cpp:
2439         (WebKit::WebProcess::didReceiveMessage):
2440         (WebKit::WebProcess::getWorkerContextConnection):
2441         * WebProcess/WebProcess.h:
2442
2443 2017-10-26  Alexey Proskuryakov  <ap@apple.com>
2444
2445         Remove deprecated WebKit symbols
2446         https://bugs.webkit.org/show_bug.cgi?id=178875
2447         rdar://problem/31139070
2448
2449         Reviewed by Dan Bernstein.
2450
2451         * PlatformMac.cmake:
2452         * Shared/API/c/WKDeprecatedFunctions.cpp:
2453         (WKContextSetProcessModel):
2454         (WKPageGroupCopyIdentifier): Deleted.
2455         (WKPageGroupAddUserContentFilter): Deleted.
2456         (WKPageGroupRemoveUserContentFilter): Deleted.
2457         * UIProcess/API/C/WKPageGroup.h:
2458         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm: Removed.
2459         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
2460         * WebKit.xcodeproj/project.pbxproj:
2461
2462 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
2463
2464         Unreviewed, rolling out r223984.
2465
2466         Caused LayoutTest assertion failures.
2467
2468         Reverted changeset:
2469
2470         "When navigating back to a page, compositing layers may not
2471         use accelerated drawing"
2472         https://bugs.webkit.org/show_bug.cgi?id=178749
2473         https://trac.webkit.org/changeset/223984
2474
2475 2017-10-26  Megan Gardner  <megan_gardner@apple.com>
2476
2477         Remove code to update block selection
2478         https://bugs.webkit.org/show_bug.cgi?id=178843
2479
2480         Reviewed by Tim Horton.
2481
2482         Removes code for updating block selection, which has been disabled.
2483         This code is being slowly pruned to avoid regressions and accidental removal of code that is being used.
2484
2485         * Platform/spi/ios/UIKitSPI.h:
2486         * UIProcess/PageClient.h:
2487         * UIProcess/WebPageProxy.h:
2488         * UIProcess/WebPageProxy.messages.in:
2489         * UIProcess/ios/PageClientImplIOS.h:
2490         * UIProcess/ios/PageClientImplIOS.mm:
2491         (WebKit::PageClientImpl::didUpdateBlockSelectionWithTouch): Deleted.
2492         * UIProcess/ios/WKContentViewInteraction.h:
2493         * UIProcess/ios/WKContentViewInteraction.mm:
2494         (toSelectionHandlePosition): Deleted.
2495         (-[WKContentView _didUpdateBlockSelectionWithTouch:withFlags:growThreshold:shrinkThreshold:]): Deleted.
2496         (-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]): Deleted.
2497         * UIProcess/ios/WebPageProxyIOS.mm:
2498         (WebKit::WebPageProxy::updateBlockSelectionWithTouch): Deleted.
2499         (WebKit::WebPageProxy::didUpdateBlockSelectionWithTouch): Deleted.
2500         * WebProcess/WebPage/WebPage.h:
2501         * WebProcess/WebPage/WebPage.messages.in:
2502         * WebProcess/WebPage/ios/WebPageIOS.mm:
2503         (WebKit::shouldExpand): Deleted.
2504         (WebKit::WebPage::changeBlockSelection): Deleted.
2505         (WebKit::WebPage::updateBlockSelectionWithTouch): Deleted.
2506
2507 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
2508
2509         Unreviewed, rolling out r223994.
2510
2511         The LayoutTest for this change is failing.
2512
2513         Reverted changeset:
2514
2515         "Add service worker handle fetch support for all subresource
2516         requests"
2517         https://bugs.webkit.org/show_bug.cgi?id=178769
2518         https://trac.webkit.org/changeset/223994
2519
2520 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
2521
2522         Unreviewed, rolling out r223908.
2523
2524         Causes LayoutTest crashes with newer SDKs.
2525
2526         Reverted changeset:
2527
2528         "Adopt new secure coding APIs"
2529         https://bugs.webkit.org/show_bug.cgi?id=178484
2530         https://trac.webkit.org/changeset/223908
2531
2532 2017-10-26  Christopher Reid  <chris.reid@sony.com>
2533
2534         Remove scopeguard from platform
2535         https://bugs.webkit.org/show_bug.cgi?id=178681
2536
2537         Reviewed by Brady Eidson.
2538
2539         * Shared/mac/ChildProcessMac.mm:
2540
2541 2017-10-25  Per Arne Vollan  <pvollan@apple.com>
2542
2543         Network process crash under WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge.
2544         https://bugs.webkit.org/show_bug.cgi?id=160234
2545         rdar://problem/30675510
2546
2547         Reviewed by Geoffrey Garen.
2548
2549         An exception is raised because we call the method rejectProtectionSpaceAndContinueWithChallenge on the CFNetwork
2550         challenge sender, which does not implement this optional method. The methods on the authentication challenge
2551         sender are deprecated when network session is used, so we should not call them in that case.
2552
2553         * Shared/Authentication/AuthenticationManager.cpp:
2554         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
2555         (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
2556         (WebKit::AuthenticationManager::cancelSingleChallenge):
2557         (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
2558         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
2559         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
2560         (WebKit::AuthenticationManager::receivedCredential):
2561         (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
2562         (WebKit::AuthenticationManager::receivedCancellation):
2563         (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
2564         (WebKit::AuthenticationManager::receivedChallengeRejection):
2565         * Shared/Authentication/soup/AuthenticationManagerSoup.cpp:
2566
2567 2017-10-25  Youenn Fablet  <youenn@apple.com>
2568
2569         Move DNS resolution outside of NetworkRTCProvider
2570         https://bugs.webkit.org/show_bug.cgi?id=178796
2571
2572         Reviewed by Geoffrey Garen.
2573
2574        Tested through manual testing on external STUN servers.
2575        Moving NetworkRTCProvider::Resolver into NetworkRTCResolver.
2576        Updating the implementation to use a completion handler.
2577
2578         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
2579         (WebKit::NetworkRTCProvider::createResolver):
2580         * NetworkProcess/webrtc/NetworkRTCProvider.h:
2581         * NetworkProcess/webrtc/NetworkRTCResolver.cpp:
2582         (WebKit::NetworkRTCResolver::NetworkRTCResolver):
2583         (WebKit::NetworkRTCResolver::~NetworkRTCResolver):
2584         (WebKit::NetworkRTCResolver::start):
2585         (WebKit::NetworkRTCResolver::stop):
2586         (WebKit::NetworkRTCResolver::completed):
2587         (WebKit::NetworkRTCProvider::Resolver::~Resolver): Deleted.
2588         (WebKit::NetworkRTCProvider::stop): Deleted.
2589         (WebKit::NetworkRTCProvider::resolutionCompleted): Deleted.
2590         * NetworkProcess/webrtc/NetworkRTCResolver.h:
2591         * WebKit.xcodeproj/project.pbxproj:
2592
2593 2017-10-25  Eric Carlson  <eric.carlson@apple.com>
2594
2595         [MediaStream] Clear cached gUM prompt state
2596         https://bugs.webkit.org/show_bug.cgi?id=178754
2597         <rdar://problem/32742356>
2598
2599         Reviewed by Youenn Fablet.
2600
2601         * Shared/WebPreferences.yaml: Define new settings.
2602
2603         * Shared/WebPreferencesDefinitionsBase.h: New default values.
2604
2605         * UIProcess/API/C/WKPreferences.cpp:
2606         (WKPreferencesSetInactiveMediaCaptureSteamRepromptIntervalInMinutes): New.
2607         (WKPreferencesGetInactiveMediaCaptureSteamRepromptIntervalInMinutes): Ditto.
2608         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2609
2610         * UIProcess/API/Cocoa/WKPreferences.mm:
2611         (-[WKPreferences _inactiveMediaCaptureSteamRepromptIntervalInMinutes]): Ditto.
2612         (-[WKPreferences _setInactiveMediaCaptureSteamRepromptIntervalInMinutes:]): Ditto.
2613         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2614
2615         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2616         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Initialize
2617         the timer.
2618         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): Remove unneeded namespace.
2619         (WebKit::toWebCore): Remove unneeded breaks.
2620         (WebKit::UserMediaPermissionRequestManagerProxy::searchForGrantedRequest const): Remove unneeded namespace.
2621         (WebKit::UserMediaPermissionRequestManagerProxy::wasRequestDenied): Ditto.
2622         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Ditto.
2623         (WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Ditto.
2624         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Ditto.
2625         (WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs const): Ditto.
2626         (WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged): Set the watchdog timer
2627         to the correct interval based on capture state.
2628         (WebKit::UserMediaPermissionRequestManagerProxy::watchdogTimerFired): Clear cached state.
2629         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2630
2631 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
2632
2633         When navigating back to a page, compositing layers may not use accelerated drawing
2634         https://bugs.webkit.org/show_bug.cgi?id=178749
2635         rdar://problem/35158946
2636
2637         Reviewed by Dean Jackson.
2638
2639         Avoid assertions when a test enables accelerated drawing (which we can't support
2640         in the iOS simulator).
2641
2642         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
2643         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
2644
2645 2017-10-25  Youenn Fablet  <youenn@apple.com>
2646
2647         Enable ServiceWorker to fetch resources
2648         https://bugs.webkit.org/show_bug.cgi?id=178673
2649
2650         Reviewed by Brady Eidson.
2651
2652         ServiceWorkerContextManager makes use of the new ServiceWorkerThreadProxy.
2653         It creates the necessary environment for the thread to make use of network loads, web sockets and cache storage.
2654         Fetch is functional with these changes.
2655
2656         ServiceWorkerProcessProxy is introduced as a UIProcess proxy to the service worker process.
2657         This process proxy is responsible to give the pageID used by all service worker thread instances for network loads.
2658         ServiceWorkerContextManager is responsible to give a unique frameID for all service worker threads.
2659         This is necessary as these two ids are currently needed for any network load.
2660
2661         ServiceWorkerThreadProxy creates its own FrameLoaderClient which is now used to get pageID, frameID and sessionID.
2662
2663         * UIProcess/ServiceWorkerProcessProxy.cpp: Added.
2664         (WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
2665         (WebKit::m_serviceWorkerPageID):
2666         (WebKit::ServiceWorkerProcessProxy::~ServiceWorkerProcessProxy):
2667         (WebKit::ServiceWorkerProcessProxy::start):
2668         * UIProcess/ServiceWorkerProcessProxy.h: Added.
2669         * UIProcess/WebProcessPool.cpp:
2670         (WebKit::WebProcessPool::getWorkerContextProcessConnection):
2671         (WebKit::WebProcessPool::createNewWebProcess):
2672         (WebKit::WebProcessPool::initializeNewWebProcess):
2673         (WebKit::WebProcessPool::disconnectProcess):
2674         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
2675         (WebKit::WebProcessPool::createWebPage):
2676         * UIProcess/WebProcessPool.h:
2677         * UIProcess/WebProcessProxy.cpp:
2678         (WebKit::WebProcessProxy::generatePageID):
2679         * UIProcess/WebProcessProxy.h:
2680         * WebKit.xcodeproj/project.pbxproj:
2681         * WebProcess/Network/WebLoaderStrategy.cpp:
2682         (WebKit::WebLoaderStrategy::scheduleLoad):
2683         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
2684         (WebKit::WebLoaderStrategy::startPingLoad):
2685         * WebProcess/Network/WebLoaderStrategy.h:
2686         * WebProcess/Storage/ServiceWorkerContextManager.cpp:
2687         (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager):
2688         (WebKit::ServiceWorkerContextManager::startServiceWorker):
2689         (WebKit::ServiceWorkerContextManager::startFetch):
2690         * WebProcess/Storage/ServiceWorkerContextManager.h:
2691         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2692         (WebKit::WebFrameLoaderClient::pageID const):
2693         (WebKit::WebFrameLoaderClient::frameID const):
2694         (WebKit::WebFrameLoaderClient::sessionID const):
2695         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2696         * WebProcess/WebProcess.cpp:
2697         (WebKit::WebProcess::getWorkerContextConnection):
2698         * WebProcess/WebProcess.h:
2699         * WebProcess/WebProcess.messages.in:
2700
2701 2017-10-25  Yousuke Kimoto  <yousuke.kimoto@sony.com>
2702
2703         [WinCairo] Add WebKit platform files for wincairo webkit
2704         https://bugs.webkit.org/show_bug.cgi?id=178000
2705
2706         Reviewed by Alex Christensen.
2707
2708         * Platform/Module.h:
2709         * Platform/SharedMemory.h:
2710         (WebKit::SharedMemory::handle const):
2711         * Platform/win/LoggingWin.cpp: Added. It is based on Source/WebCore/platform/win/LoggingWin.cpp
2712         (WebKit::logLevelString):
2713         * Platform/win/ModuleWin.cpp: Added.
2714         (WebKit::Module::load):
2715         (WebKit::Module::unload):
2716         (WebKit::Module::platformFunctionPointer const):
2717         * Platform/win/SharedMemoryWin.cpp: Added.
2718         (WebKit::SharedMemory::Handle::Handle):
2719         (WebKit::SharedMemory::Handle::~Handle):
2720         (WebKit::SharedMemory::Handle::isNull const):
2721         (WebKit::SharedMemory::Handle::encode const):
2722         (WebKit::SharedMemory::Handle::clear):
2723         (WebKit::getDuplicatedHandle):
2724         (WebKit::SharedMemory::Handle::decode):
2725         (WebKit::protectAttribute):
2726         (WebKit::SharedMemory::allocate):
2727         (WebKit::SharedMemory::create):
2728         (WebKit::accessRights):
2729         (WebKit::SharedMemory::map):
2730         (WebKit::SharedMemory::adopt):
2731         (WebKit::SharedMemory::~SharedMemory):
2732         (WebKit::SharedMemory::createHandle):
2733         (WebKit::SharedMemory::systemPageSize):
2734         * PlatformWin.cmake:
2735
2736 2017-10-25  Chris Dumez  <cdumez@apple.com>
2737
2738         Add support for unregistering a service worker
2739         https://bugs.webkit.org/show_bug.cgi?id=178735
2740
2741         Reviewed by Brady Eidson.
2742
2743         Add support for unregistering a service worker:
2744         - https://w3c.github.io/ServiceWorker/#navigator-service-worker-unregister
2745
2746         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2747         (WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
2748         (WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
2749         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2750         * WebProcess/Storage/WebSWClientConnection.messages.in:
2751
2752 2017-10-25  Chris Dumez  <cdumez@apple.com>
2753
2754         Make SharedStringHashTable less error prone
2755         https://bugs.webkit.org/show_bug.cgi?id=178764
2756
2757         Reviewed by Youenn Fablet.
2758
2759         SharedStringHashTable is backed by SharedMemory and this SharedMemory
2760         may be readonly (and is when used in the WebContent process). As a result,
2761         some of the operations on SharedStringHashTable that write to this shared
2762         memory will crash if called and the SharedMemory is readonly.
2763
2764         To make this less error prone, introduce a new SharedStringHashTableReadOnly
2765         base class for SharedStringHashTable and only keep the operations that
2766         write to the shared memory on SharedStringHashTableReadOnly (namely, add() /
2767         remove() / clear(). Update VisitedLinkTableController and WebSWOriginTable
2768         to use SharedStringHashTableReadOnly since they are instantiated in the
2769         WebContent process and use readonly shared memory.
2770
2771         * Shared/SharedStringHashTable.cpp:
2772         (WebKit::SharedStringHashTableReadOnly::SharedStringHashTableReadOnly):
2773         (WebKit::SharedStringHashTableReadOnly::~SharedStringHashTableReadOnly):
2774         (WebKit::SharedStringHashTableReadOnly::setSharedMemory):
2775         (WebKit::doubleHash):
2776         (WebKit::SharedStringHashTableReadOnly::contains const):
2777         (WebKit::SharedStringHashTableReadOnly::findSlot const):
2778         (WebKit::SharedStringHashTable::SharedStringHashTable):
2779         (WebKit::SharedStringHashTable::~SharedStringHashTable):
2780         (WebKit::SharedStringHashTable::add):
2781         (WebKit::SharedStringHashTable::remove):
2782         (WebKit::SharedStringHashTable::clear):
2783         * Shared/SharedStringHashTable.h:
2784         * WebProcess/Storage/WebSWOriginTable.h:
2785         * WebProcess/WebPage/VisitedLinkTableController.cpp:
2786         (WebKit::VisitedLinkTableController::removeAllVisitedLinks):
2787         * WebProcess/WebPage/VisitedLinkTableController.h:
2788
2789 2017-10-25  Adrian Perez de Castro  <aperez@igalia.com>
2790
2791         [WPE] Remove GLib API functions which use Cairo
2792         https://bugs.webkit.org/show_bug.cgi?id=178205
2793
2794         Reviewed by Michael Catanzaro.
2795
2796         Add PLATFORM(GTK) guards for the parts of of the GLib API which use cairo_surface_t (web
2797         page snapshots and favicons), and remove the affected function prototypes from public API
2798         headers. This way, the WPE version of the API is not tied to Cairo.
2799
2800         * PlatformWPE.cmake:
2801         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
2802         * UIProcess/API/glib/WebKitFaviconDatabasePrivate.h:
2803         * UIProcess/API/glib/WebKitInjectedBundleClient.cpp:
2804         * UIProcess/API/glib/WebKitWebView.cpp:
2805         (webkitWebViewConstructed):
2806         (webkitWebViewGetProperty):
2807         (webkitWebViewDispose):
2808         (webkit_web_view_class_init):
2809         (webkitWebViewLoadChanged):
2810         * UIProcess/API/glib/WebKitWebViewPrivate.h:
2811         * UIProcess/API/wpe/WebKitFaviconDatabase.h:
2812         * UIProcess/API/wpe/WebKitWebView.h:
2813         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
2814         (webkitWebPageDidReceiveMessage):
2815
2816 2017-10-25  Zan Dobersek  <zdobersek@igalia.com>
2817
2818         Make SERVICE_WORKER feature buildable on GTK, WPE
2819         https://bugs.webkit.org/show_bug.cgi?id=178574
2820
2821         Reviewed by Carlos Garcia Campos.
2822
2823         * CMakeLists.txt: Add missing files to the build.
2824         * StorageProcess/StorageProcess.cpp:
2825         (WebKit::StorageProcess::didGetWorkerContextProcessConnection):
2826         IPC::Attachment object should be accessed through an rvalue reference,
2827         making it mutable and enabling releasing the file descriptor.
2828         * StorageProcess/StorageProcess.h: Adjust the method signature.
2829         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2830         Explicitly include the ResourceError header from WebCore (using a forwarding header).
2831         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
2832         Include the CachedResource header from WebCore (again using a forwarding header).
2833         * WebProcess/Storage/WebServiceWorkerProvider.h: Forward-declare the WebCore::CachedResource type.
2834
2835 2017-10-24  Youenn Fablet  <youenn@apple.com>
2836
2837         ServiceWorkerClientFetch should return an error that is not null in case of failure
2838         https://bugs.webkit.org/show_bug.cgi?id=178761
2839
2840         Reviewed by Geoffrey Garen.
2841
2842         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
2843         (WebKit::ServiceWorkerClientFetch::didFail): Generating a General error.
2844
2845 2017-10-24  Youenn Fablet  <youenn@apple.com>
2846
2847         Enable service worker to use cache storage api
2848         https://bugs.webkit.org/show_bug.cgi?id=178684
2849
2850         Reviewed by Brady Eidson.
2851
2852         Passing the WebPreferences store of the default page group of the WebProcessPool to its ServiceWorker process.
2853         ServiceWorkerContextManager then uses it to initialize the preferences accordingly.
2854         Patch is covered by new test which is using cache api previously disabled and now enabled through the store.
2855
2856         Made use of the new ServiceWorkerThreadProxy in ServiceWorkerContextManager to enable a cache storage connection.
2857         Fixed the default size of quota in WebsiteDataStore.
2858
2859         * UIProcess/WebProcessPool.cpp:
2860         (WebKit::WebProcessPool::getWorkerContextProcessConnection):
2861         * UIProcess/WebsiteData/WebsiteDataStore.h:
2862         * WebProcess/Storage/ServiceWorkerContextManager.cpp:
2863         (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager):
2864         (WebKit::ServiceWorkerContextManager::updatePreferences):
2865         (WebKit::ServiceWorkerContextManager::startServiceWorker):
2866         (WebKit::ServiceWorkerContextManager::startFetch):
2867         * WebProcess/Storage/ServiceWorkerContextManager.h:
2868         (WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager): Deleted.
2869         * WebProcess/WebProcess.cpp:
2870         (WebKit::WebProcess::getWorkerContextConnection):
2871         * WebProcess/WebProcess.h:
2872         * WebProcess/WebProcess.messages.in:
2873
2874 2017-10-24  Alex Christensen  <achristensen@webkit.org>
2875
2876         Selecting and right-clicking URL-like strings with IDNA-disallowed characters in host or authority causes rendering engine crash
2877         https://bugs.webkit.org/show_bug.cgi?id=174267
2878
2879         Reviewed by Tim Horton.
2880
2881         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2882         (WKBundlePageCanHandleRequest):
2883
2884 2017-10-24  Chris Dumez  <cdumez@apple.com>
2885
2886         Add initial implementation for serviceWorker.postMessage()
2887         https://bugs.webkit.org/show_bug.cgi?id=178534
2888
2889         Reviewed by Youenn Fablet.
2890
2891         Add initial implementation for serviceWorker.postMessage():
2892         - https://w3c.github.io/ServiceWorker/#service-worker-postmessage
2893
2894         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
2895         (WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
2896         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
2897         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
2898         * WebProcess/Storage/ServiceWorkerContextManager.cpp:
2899         (WebKit::ServiceWorkerContextManager::postMessageToServiceWorkerGlobalScope):
2900         * WebProcess/Storage/ServiceWorkerContextManager.h:
2901         * WebProcess/Storage/ServiceWorkerContextManager.messages.in:
2902         * WebProcess/Storage/WebSWClientConnection.cpp:
2903         (WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
2904         * WebProcess/Storage/WebSWClientConnection.h:
2905
2906 2017-10-24  Brent Fulgham  <bfulgham@apple.com>
2907
2908         Adopt new secure coding APIs
2909         https://bugs.webkit.org/show_bug.cgi?id=178484
2910         <rdar://problem/34837193>
2911
2912         Reviewed by Tim Horton.
2913
2914         Switch to new NSKeyed[Un]Archiver methods that active and use
2915         NSSecureCoding by default.
2916
2917         * Platform/ios/AccessibilityIOS.mm:
2918         (WebKit::newAccessibilityRemoteToken): Use secure-by-default API.
2919         * Shared/Cocoa/DataDetectionResult.mm:
2920         (WebKit::DataDetectionResult::encode const): Ditto.
2921         (WebKit::DataDetectionResult::decode): Ditto.
2922         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2923         (IPC::ArgumentCoder<WebCore::Payment>::encode): Ditto.
2924         (IPC::ArgumentCoder<WebCore::Payment>::decode): Ditto.
2925         (IPC::ArgumentCoder<WebCore::PaymentContact>::encode): Ditto.
2926         (IPC::ArgumentCoder<WebCore::PaymentContact>::decode): Ditto.
2927         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode): Ditto.
2928         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::decode): Ditto.
2929         (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode): Ditto.
2930         (IPC::ArgumentCoder<WebCore::PaymentMethod>::decode): Ditto.
2931         * Shared/ios/InteractionInformationAtPosition.mm:
2932         (WebKit::InteractionInformationAtPosition::encode const): Ditto.
2933         (WebKit::InteractionInformationAtPosition::decode): Ditto.
2934         * Shared/mac/WebCoreArgumentCodersMac.mm:
2935         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Ditto.
2936         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Ditto.
2937         (IPC::ArgumentCoder<Credential>::encodePlatformData): Ditto.
2938         (IPC::ArgumentCoder<Credential>::decodePlatformData): Ditto.
2939         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode): Ditto.
2940         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode): Ditto.
2941         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): Ditto.
2942         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): Ditto.
2943         * Shared/mac/WebHitTestResultData.mm:
2944         (WebKit::WebHitTestResultData::platformEncode const): Ditto.
2945         (WebKit::WebHitTestResultData::platformDecode): Ditto.
2946         * UIProcess/API/Cocoa/WKProcessPool.mm:
2947         (-[WKProcessPool _setObject:forBundleParameter:]): Ditto.
2948         (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]): Ditto.
2949         * UIProcess/API/Cocoa/WKWebView.mm:
2950         (-[WKWebView _setInputDelegate:]): Ditto.
2951         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2952         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
2953         * UIProcess/ios/PageClientImplIOS.mm:
2954         (WebKit::PageClientImpl::startAssistingNode): Ditto.
2955         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2956         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Ditto.
2957         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
2958         (WebKit::InjectedBundle::initialize): Ditto.
2959         (WebKit::InjectedBundle::setBundleParameter): Ditto.
2960         (WebKit::InjectedBundle::setBundleParameters): Ditto.
2961
2962 2017-10-24  Sam Weinig  <sam@webkit.org>
2963
2964         [Settings] Add initial support for generating preferences related code
2965         https://bugs.webkit.org/show_bug.cgi?id=178656
2966
2967         Reviewed by Dean Jackson.
2968
2969         As a first step towards getting off the macros in WebPreferencesDefinitions.h
2970         and reducing the overhead of adding a preference, this change generates adds
2971         WebPreferences.yaml where preference changes will go, and generates much of
2972         WebPreferencesDefinitions.h from it (all the custom defaults moved to 
2973         WebPreferencesDefinitionsBase.h). Subsequent changes will remove the need for 
2974         the macros in WebPreferencesDefinitions.h entirely.
2975
2976         * CMakeLists.txt:
2977         * DerivedSources.make:
2978         * WebKit.xcodeproj/project.pbxproj:
2979         
2980             Add new files / rules to generate WebPreferencesDefinitions.h.
2981         
2982         * Scripts/GeneratePreferences.rb: Added.
2983         * Scripts/PreferencesTemplates: Added.
2984         * Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb: Added.
2985         
2986             Add scripts and template to generate WebPreferencesDefinitions.h from
2987             WebPreferences.yaml.
2988
2989         * Shared/WebPreferences.yaml: Added.
2990         
2991             Configuration file for preferences.
2992         
2993         * Shared/WebPreferencesDefinitions.h: Removed.
2994         * Shared/WebPreferencesDefinitionsBase.h: Copied from Source/WebKit/Shared/WebPreferencesDefinitions.h.
2995         
2996             Moved custom defaults to new WebPreferencesDefinitionsBase.h. Removed the need for 
2997             FOR_EACH_WEBKIT_STRING_PREFERENCE by using custom defaults for the font family values.
2998
2999 2017-10-24  Matt Lewis  <jlewis3@apple.com>
3000
3001         Unreviewed, rolling out r223889.
3002
3003         This caused multiple crashes on all platforms
3004
3005         Reverted changeset:
3006
3007         "Adopt new secure coding APIs"
3008         https://bugs.webkit.org/show_bug.cgi?id=178484
3009         https://trac.webkit.org/changeset/223889
3010
3011 2017-10-24  Youenn Fablet  <youenn@apple.com>
3012
3013         ASSERTION FAILED: !m_serviceWorkerManager in WebProcess::getWorkerContextConnection() on API tests
3014         https://bugs.webkit.org/show_bug.cgi?id=178586
3015         <rdar://problem/35115902>
3016
3017         Reviewed by Brady Eidson.
3018
3019        Covered by API tests no longer crashing.
3020
3021         * UIProcess/WebProcessPool.cpp:
3022         (WebKit::WebProcessPool::getWorkerContextProcessConnection): Sending a worker context process connection message only at creation of the service worker process.
3023
3024 2017-10-24  Brent Fulgham  <bfulgham@apple.com>
3025
3026         Adopt new secure coding APIs
3027         https://bugs.webkit.org/show_bug.cgi?id=178484
3028         <rdar://problem/34837193>
3029
3030         Reviewed by Tim Horton.
3031
3032         Switch to new NSKeyed[Un]Archiver methods that active and use
3033         NSSecureCoding by default.
3034
3035         * Platform/ios/AccessibilityIOS.mm:
3036         (WebKit::newAccessibilityRemoteToken): Use secure-by-default API.
3037         * Shared/Cocoa/DataDetectionResult.mm:
3038         (WebKit::DataDetectionResult::encode const): Ditto.
3039         (WebKit::DataDetectionResult::decode): Ditto.
3040         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
3041         (IPC::ArgumentCoder<WebCore::Payment>::encode): Ditto.
3042         (IPC::ArgumentCoder<WebCore::Payment>::decode): Ditto.
3043         (IPC::ArgumentCoder<WebCore::PaymentContact>::encode): Ditto.
3044         (IPC::ArgumentCoder<WebCore::PaymentContact>::decode): Ditto.
3045         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::encode): Ditto.
3046         (IPC::ArgumentCoder<WebCore::PaymentMerchantSession>::decode): Ditto.
3047         (IPC::ArgumentCoder<WebCore::PaymentMethod>::encode): Ditto.
3048         (IPC::ArgumentCoder<WebCore::PaymentMethod>::decode): Ditto.
3049         * Shared/ios/InteractionInformationAtPosition.mm:
3050         (WebKit::InteractionInformationAtPosition::encode const): Ditto.
3051         (WebKit::InteractionInformationAtPosition::decode): Ditto.
3052         * Shared/mac/WebCoreArgumentCodersMac.mm:
3053         (IPC::ArgumentCoder<ProtectionSpace>::encodePlatformData): Ditto.
3054         (IPC::ArgumentCoder<ProtectionSpace>::decodePlatformData): Ditto.
3055         (IPC::ArgumentCoder<Credential>::encodePlatformData): Ditto.
3056         (IPC::ArgumentCoder<Credential>::decodePlatformData): Ditto.
3057         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode): Ditto.
3058         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode): Ditto.
3059         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): Ditto.
3060         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): Ditto.
3061         * Shared/mac/WebHitTestResultData.mm:
3062         (WebKit::WebHitTestResultData::platformEncode const): Ditto.
3063         (WebKit::WebHitTestResultData::platformDecode): Ditto.
3064         * UIProcess/API/Cocoa/WKProcessPool.mm:
3065         (-[WKProcessPool _setObject:forBundleParameter:]): Ditto.
3066         (-[WKProcessPool _setObjectsForBundleParametersWithDictionary:]): Ditto.
3067         * UIProcess/API/Cocoa/WKWebView.mm:
3068         (-[WKWebView _setInputDelegate:]): Ditto.
3069         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3070         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
3071         * UIProcess/ios/PageClientImplIOS.mm:
3072         (WebKit::PageClientImpl::startAssistingNode): Ditto.
3073         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3074         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Ditto.
3075         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
3076         (WebKit::InjectedBundle::initialize): Ditto.
3077         (WebKit::InjectedBundle::setBundleParameter): Ditto.
3078         (WebKit::InjectedBundle::setBundleParameters): Ditto.
3079
3080 2017-10-24  Zan Dobersek  <zdobersek@igalia.com>
3081
3082         [GTK][WPE] generate-forwarding-headers.pl should also scan derived sources in WebKit framework
3083         https://bugs.webkit.org/show_bug.cgi?id=178579
3084
3085         Reviewed by Carlos Garcia Campos.
3086
3087         * PlatformGTK.cmake: When generating forwarding headers, derived sources
3088         should be scanned as well. The DERIVED_SOURCES_WEBKIT_DIR value has to
3089         be passed as an include path to the generate-forward-headers.pl script
3090         to achieve that. This target then also has to depend on all the derived
3091         source files to be generated before this can be performed.
3092         * PlatformWPE.cmake: Ditto.
3093
3094 2017-10-23  Brian Burg  <bburg@apple.com>
3095
3096         [Cocoa] Web Automation: add SPI to tell whether the automation session is currently simulating user interactions
3097         https://bugs.webkit.org/show_bug.cgi?id=178616
3098
3099         Reviewed by Joseph Pecoraro.
3100
3101         This is needed to disambiguate whether an action (such as selectAll:) came from
3102         a user clicking on "Edit > Select All" in a menu or whether it was produced by
3103         simulating the keystrokes to produce the chord for "Command + a". Some clients,
3104         such as Safari, would allow the latter but not the former during automation.
3105
3106         * UIProcess/API/Cocoa/_WKAutomationSession.h:
3107         * UIProcess/API/Cocoa/_WKAutomationSession.mm:
3108         (-[_WKAutomationSession isSimulatingUserInteraction]):
3109         Add new SPI property that's backed by the same WebAutomationSession method.
3110
3111         * UIProcess/Automation/WebAutomationSession.h:
3112         * UIProcess/Automation/WebAutomationSession.cpp:
3113         (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
3114         (WebKit::WebAutomationSession::performMouseInteraction):
3115         (WebKit::WebAutomationSession::performKeyboardInteractions):
3116         Set m_simulatingUserInteraction prior to sending the synthesized events. It will
3117         be cleared when keyboardEventsFlushedForPage() is called by WebPageProxy.
3118
3119         * UIProcess/WebPageProxy.cpp:
3120         (WebKit::WebPageProxy::didReceiveEvent):
3121         Notify the automation session that the key event queue was flushed *after* giving
3122         delegates a chance to do something with the key event. This is necessary so that
3123         any actions that are created from the NSEvent by the delegates are handled prior
3124         to the automation session finishing its keyboard interaction command.
3125
3126 2017-10-23  Brian Burg  <bburg@apple.com>
3127
3128         [Mac] Web Automation: key modifiers for synthesized NSEvents are incorrect
3129         https://bugs.webkit.org/show_bug.cgi?id=178615
3130
3131         Reviewed by Joseph Pecoraro.
3132
3133         In both PLATFORM(MAC) platform methods for simulating keyboard interactions,
3134         we errantly relied on +[NSEvent modifierFlags] to get the current state of
3135         sticky modifiers when creating synthesized events. This is incorrect for two reasons:
3136         modifierFlags is never updated when simulating a sequence of events (because
3137         all the events are synthesized before any are delivered); and the NSEvent class
3138         method only reflects the modifier state of the primary physical keyboard, which
3139         is not affected by synthesized NSEvents that happen to have modifier flags.
3140
3141         Instead, just keep our own m_currentModifiers state in the session and compute
3142         the necessary NSEventModifierFlags to put on each synthesized event. This aligns
3143         the implementation with the treatment of sticky keys in the iOS and GTK platform methods.
3144
3145         * UIProcess/Automation/WebAutomationSession.h: Every port gets this variable now.
3146         * UIProcess/Automation/mac/WebAutomationSessionMac.mm:
3147         (WebKit::WebAutomationSession::platformSimulateKeyStroke):
3148         (WebKit::WebAutomationSession::platformSimulateKeySequence):
3149         Use and update m_currentModifiers.
3150
3151 2017-10-23  Alex Christensen  <achristensen@webkit.org>
3152
3153         Fix ASAN test after r222824
3154         https://bugs.webkit.org/show_bug.cgi?id=178688
3155         <rdar://problem/35104706>
3156
3157         Reviewed by Tim Horton.
3158
3159         * UIProcess/WebBackForwardList.cpp:
3160         (WebKit::WebBackForwardList::clear):
3161         Resizing a list of Ref<T> after we've WTFMoved all the elements doesn't make ASAN happy.
3162
3163 2017-10-23  Tim Horton  <timothy_horton@apple.com>
3164
3165         Stop using _UIApplicationUsesLegacyUI()
3166         https://bugs.webkit.org/show_bug.cgi?id=178680
3167         <rdar://problem/35131949>
3168
3169         Reviewed by Dan Bernstein.
3170
3171         * Platform/spi/ios/UIKitSPI.h:
3172         * UIProcess/ios/forms/WKFormSelectPopover.mm:
3173         (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
3174         (-[WKSelectPopover initWithView:hasGroups:]):
3175         Resolve _UIApplicationUsesLegacyUI to false and simplify.
3176
3177 2017-10-23  Ryan Haddad  <ryanhaddad@apple.com>
3178
3179         Unreviewed, suppress deprecation warnings to fix the build.
3180         <rdar://problem/35131949>
3181
3182         * UIProcess/ios/forms/WKFormSelectPopover.mm:
3183         (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
3184         (-[WKSelectPopover initWithView:hasGroups:]):
3185
3186 2017-10-23  Youenn Fablet  <youenn@apple.com>
3187
3188         TestController should clear all fetch caches when resetting its state
3189         https://bugs.webkit.org/show_bug.cgi?id=178486
3190         <rdar://problem/35066305>
3191
3192         Reviewed by Chris Dumez.
3193
3194         Adding a new DidNotHandle message to disambiguate with the DidFail fetch case.
3195         With DidNotHandle, the loading should go the network process.
3196         With DidFail, the loading should return a network error.
3197
3198         On receiving an order to start a fetch, ServiceWorkerThread will dispatch a fetch event.
3199         The client of this event will retrieve the response and return it to the WebProcess through IPC.
3200
3201         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3202         (WebKit::WebSWServerConnection::didNotHandleFetch):
3203         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3204         * StorageProcess/StorageProcess.cpp:
3205         (WebKit::StorageProcess::didNotHandleFetch):
3206         * StorageProcess/StorageProcess.h:
3207         * StorageProcess/StorageProcess.messages.in:
3208         * WebKit.xcodeproj/project.pbxproj:
3209         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
3210         (WebKit::ServiceWorkerClientFetch::didFail):
3211         (WebKit::ServiceWorkerClientFetch::didNotHandle):
3212         * WebProcess/Storage/ServiceWorkerClientFetch.h:
3213         * WebProcess/Storage/ServiceWorkerClientFetch.messages.in:
3214         * WebProcess/Storage/ServiceWorkerContextManager.cpp:
3215         (WebKit::ServiceWorkerContextManager::startFetch):
3216         * WebProcess/Storage/ServiceWorkerContextManager.h:
3217         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: Added.
3218         (WebKit::WebServiceWorkerFetchTaskClient::~WebServiceWorkerFetchTaskClient):
3219         (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
3220         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveResponse):
3221         (WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
3222         (WebKit::WebServiceWorkerFetchTaskClient::didFail):
3223         (WebKit::WebServiceWorkerFetchTaskClient::didFinish):
3224         * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h: Added.
3225         * WebProcess/WebProcess.cpp:
3226         (WebKit::WebProcess::startFetchInServiceWorker):
3227         * WebProcess/WebProcess.h:
3228
3229 2017-10-22  Wenson Hsieh  <wenson_hsieh@apple.com>
3230
3231         [iOS] WebProcess::initializeWebProcess spends ~150ms spinning up AVSystemController on some devices
3232         https://bugs.webkit.org/show_bug.cgi?id=178640
3233         <rdar://problem/35113105>
3234
3235         Reviewed by Youenn Fablet.
3236
3237         In r213933, we added a mechanism to allow the web process to drive media capture, by setting an attribute on the
3238         shared AVSystemController. This requires us to fault in the Celestial framework, which is a slight performance
3239         hit on some hardware. Instead of doing this at the start of every web process launch, we can just do this work
3240         lazily, the first time the web process requests permissions for user media access.
3241
3242         * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
3243         (WebKit::WebUserMediaClient::requestUserMediaAccess):
3244         * WebProcess/WebPage/WebPage.cpp:
3245         (WebKit::WebPage::prepareToSendUserMediaPermissionRequest):
3246         * WebProcess/WebPage/WebPage.h:
3247         * WebProcess/WebPage/ios/WebPageIOS.mm:
3248         (WebKit::WebPage::prepareToSendUserMediaPermissionRequest):
3249         * WebProcess/cocoa/WebProcessCocoa.mm:
3250         (WebKit::WebProcess::platformInitializeWebProcess):
3251
3252 2017-10-21  Michael Catanzaro  <mcatanzaro@igalia.com>
3253
3254         Unreviewed, silence a -Wunused-but-set-variable warning
3255
3256         * WebProcess/WebPage/EventDispatcher.cpp:
3257         (WebKit::EventDispatcher::wheelEvent):
3258
3259 2017-10-20  Alex Christensen  <achristensen@webkit.org>
3260
3261         Add FIXME comment after r223803
3262         https://bugs.webkit.org/show_bug.cgi?id=178418
3263
3264         * UIProcess/WebProcessPool.cpp:
3265         (WebKit::WebProcessPool::ensureNetworkProcess):
3266         We need some work to better support customized persistent data stores.  Add a comment indicating such.
3267
3268 2017-10-20  Alex Christensen  <achristensen@webkit.org>
3269
3270         Fix API tests after r223791.
3271         https://bugs.webkit.org/show_bug.cgi?id=178418
3272
3273         * UIProcess/WebProcessPool.cpp:
3274         (WebKit::WebProcessPool::ensureNetworkProcess):
3275         Whatever NetworkSessionInitializationParameters we send with the NetworkProcess initialization message,
3276         that's the default session.  This is needed for WebKit.WebsiteDataStoreCustomPaths.
3277         (WebKit::WebProcessPool::createNewWebProcess):
3278         Don't change behavior or NetworkProcess initialization like I did in r223791.
3279
3280 2017-10-20  Alex Christensen  <achristensen@webkit.org>
3281
3282         Fix download tests on El Capitan after r223730
3283         https://bugs.webkit.org/show_bug.cgi?id=178547
3284
3285         * UIProcess/Downloads/DownloadProxy.cpp:
3286         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
3287         Revert to original behavior.  This uses suggestedFilename, which may have come from places like
3288         the download attribute, instead of always using the filename from CFNetwork.
3289
3290 2017-10-20  Alex Christensen  <achristensen@webkit.org>
3291
3292         Expose _boundInterfaceIdentifier and _allowsCellularAccess to WKWebsiteDataStorePrivate
3293         https://bugs.webkit.org/show_bug.cgi?id=178418
3294         <rdar://problem/29599569>
3295
3296         Reviewed by Tim Horton.
3297         
3298         In r213747 I introduced allowsCellularAccess to _WKProcessPoolConfiguration because there
3299         was no way to add parameters to the default (and other) NetworkSession constructors.  Since
3300         clients have not adopted this SPI, we can introduce such a way in NetworkSessionCreationParameters
3301         and move the SPI to WKWebsiteDataStore, which is where it and other NetworkSession properties
3302         ought to be instead of making them WKProcessPool global.
3303
3304         We also need to expose access to NSURLRequest.boundInterfaceIdentifier.  Instead of serializing and
3305         deserializing that property for each NSURLRequest and then having subresources mysteriously jump back
3306         to having no bound interface identifiers, I'm adding this to WKWebsiteDataStore, too, to make it a
3307         session networking property.
3308         
3309         I manually verified that these properties are being set properly with a custom test app and added logs.
3310         Unfortunately, these properties don't do anything under circumstances anywhere close to what we test.
3311         The architecture change of having NetworkSessionCreationParameters is verified to not have a change in
3312         behavior by existing tests, such as any test that uses TestProtocol (which we should eventually remove).
3313
3314         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3315         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
3316         * NetworkProcess/NetworkProcess.cpp:
3317         (WebKit::NetworkProcess::NetworkProcess):
3318         (WebKit::NetworkProcess::initializeNetworkProcess):
3319         (WebKit::NetworkProcess::clearCachedCredentials):
3320         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3321         (WebKit::NetworkProcessCreationParameters::encode const):
3322         (WebKit::NetworkProcessCreationParameters::decode):
3323         * NetworkProcess/NetworkProcessCreationParameters.h:
3324         * NetworkProcess/NetworkSession.cpp:
3325         (WebKit::NetworkSession::create):
3326         (WebKit::NetworkSession::defaultSession): Deleted.
3327         * NetworkProcess/NetworkSession.h:
3328         * NetworkProcess/NetworkSessionCreationParameters.h: Added.
3329         (WebKit::NetworkSessionCreationParameters::encode const):
3330         (WebKit::NetworkSessionCreationParameters::decode):
3331         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
3332         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
3333         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3334         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
3335         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3336         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3337         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
3338         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3339         (WebKit::NetworkSessionCocoa::setSourceApplicationSecondaryIdentifier):
3340         (WebKit::NetworkSessionCocoa::create):
3341         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3342         (WebKit::NetworkSessionCocoa::setLegacyCustomProtocolManager): Deleted.
3343         (WebKit::NetworkSessionCocoa::setAllowsCellularAccess): Deleted.
3344         (WebKit::NetworkSessionCocoa::defaultSession): Deleted.
3345         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3346         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
3347         (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession):
3348         * Shared/SessionTracker.cpp:
3349         (WebKit::SessionTracker::networkSession):
3350         (WebKit::SessionTracker::setSession):
3351         * Shared/WebsiteDataStoreParameters.cpp:
3352         (WebKit::WebsiteDataStoreParameters::encode const):
3353         (WebKit::WebsiteDataStoreParameters::decode):
3354         * Shared/WebsiteDataStoreParameters.h:
3355         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3356         (API::ProcessPoolConfiguration::copy):
3357         * UIProcess/API/APIProcessPoolConfiguration.h:
3358         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3359         (-[WKWebsiteDataStore _setBoundInterfaceIdentifier:]):
3360         (-[WKWebsiteDataStore _boundInterfaceIdentifier]):
3361         (-[WKWebsiteDataStore _setAllowsCellularAccess:]):
3362         (-[WKWebsiteDataStore _allowsCellularAccess]):
3363         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
3364         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3365         (-[_WKProcessPoolConfiguration allowsCellularAccess]):
3366         (-[_WKProcessPoolConfiguration setAllowsCellularAccess:]):
3367         * UIProcess/WebProcessPool.cpp:
3368         (WebKit::WebProcessPool::ensureNetworkProcess):
3369         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
3370         * UIProcess/WebsiteData/WebsiteDataStore.h:
3371         (WebKit::WebsiteDataStore::setBoundInterfaceIdentifier):
3372         (WebKit::WebsiteDataStore::boundInterfaceIdentifier):
3373         (WebKit::WebsiteDataStore::setAllowsCellularAccess):
3374         (WebKit::WebsiteDataStore::allowsCellularAccess):
3375         * WebKit.xcodeproj/project.pbxproj:
3376         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3377         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
3378         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
3379         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
3380         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
3381         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
3382         * WebProcess/WebProcess.cpp:
3383         (WebKit::WebProcess::ensurePrivateBrowsingSession):
3384         (WebKit::WebProcess::clearCachedCredentials):
3385
3386 2017-10-20  Alex Christensen  <achristensen@webkit.org>
3387
3388         Add ObjC SPI to _WKDownloadDelegate missing from WKContextDownloadClient
3389         https://bugs.webkit.org/show_bug.cgi?id=178566
3390         <rdar://problem/23041906>
3391
3392         Reviewed by Brady Eidson.
3393
3394         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
3395         * UIProcess/Cocoa/DownloadClient.h:
3396         * UIProcess/Cocoa/DownloadClient.mm:
3397         (WebKit::DownloadClient::DownloadClient):
3398         (WebKit::DownloadClient::didReceiveAuthenticationChallenge):
3399         (WebKit::DownloadClient::shouldDecodeSourceDataOfMIMEType):
3400         (WebKit::DownloadClient::didCreateDestination):
3401         (WebKit::DownloadClient::processDidCrash):
3402
3403 2017-10-20  Youenn Fablet  <youenn@apple.com>
3404
3405         ResourceResponse should have a ServiceWorker source
3406         https://bugs.webkit.org/show_bug.cgi?id=178593
3407
3408         Reviewed by Alex Christensen.
3409
3410         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
3411         (WebKit::ServiceWorkerClientFetch::didReceiveResponse): setting response source to ServiceWorker.
3412         * WebProcess/Storage/ServiceWorkerClientFetch.h:
3413
3414 2017-10-20  Antoine Quint  <graouts@apple.com>
3415
3416         [Web Animations] Provide basic timeline and animation interfaces
3417         https://bugs.webkit.org/show_bug.cgi?id=178526
3418
3419         Reviewed by Dean Jackson.
3420
3421         Remove the WEB_ANIMATIONS compile-time flag.
3422
3423         * Configurations/FeatureDefines.xcconfig:
3424         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3425         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3426         (WebKit::InjectedBundle::setWebAnimationsEnabled):
3427         * WebProcess/WebPage/WebPage.cpp:
3428         (WebKit::WebPage::updatePreferences):
3429
3430 2017-10-02  Brian Burg  <bburg@apple.com>
3431
3432         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
3433         https://bugs.webkit.org/show_bug.cgi?id=177661
3434         <rdar://problem/34740286>
3435
3436         Reviewed by Joseph Pecoraro.
3437
3438         Move setup and delegates of the inspector frontend page into implementations of
3439         WebInspectorProxy::platformCreateFrontendPage. The Mac implementation
3440         will be subsumed by WKInspectorViewController, while the GTK implementation
3441         is inherited from the cross-platform version that uses C API. Eventually the
3442         GTK version should use GTK API rather than the soon to be deprecated C API.
3443
3444         * UIProcess/WebInspectorProxy.cpp:
3445         (WebKit::WebInspectorProxy::createFrontendPage):
3446         (WebKit::webProcessDidCrash): Deleted.
3447         (WebKit::decidePolicyForNavigationAction): Deleted.
3448         (WebKit::getContextMenuFromProposedMenu): Deleted.
3449         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3450         (WebKit::exceededDatabaseQuota):
3451         (WebKit::webProcessDidCrash):
3452         (WebKit::decidePolicyForNavigationAction):
3453         (WebKit::getContextMenuFromProposedMenu):
3454         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
3455         * UIProcess/mac/WebInspectorProxyMac.mm:
3456         (WebKit::exceededDatabaseQuota):
3457         (WebKit::webProcessDidCrash):
3458         (WebKit::decidePolicyForNavigationAction):
3459         (WebKit::getContextMenuFromProposedMenu):
3460         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
3461
3462 2017-10-02  Brian Burg  <bburg@apple.com>
3463
3464         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
3465         https://bugs.webkit.org/show_bug.cgi?id=177661
3466         <rdar://problem/34740286>
3467
3468         Reviewed by Joseph Pecoraro.
3469
3470         Adopt WKInspectorViewController in WebInspectorProxyMac to set up the
3471         frontend's web view.
3472
3473         * UIProcess/WebInspectorProxy.cpp:
3474         (WebKit::WebInspectorProxy::invalidate):
3475         (WebKit::WebInspectorProxy::close):
3476         (WebKit::WebInspectorProxy::didClose):
3477         (WebKit::WebInspectorProxy::closeFrontendPageAndWindow):
3478         Make closeFrontendPageAndWindow into the method that does work.
3479         Only use didClose() as the IPC message entry point.
3480
3481         * UIProcess/WebInspectorProxy.h:
3482         (WebKit::WebInspectorProxy::isUnderTest const): Make public.
3483
3484         * UIProcess/mac/WKInspectorViewController.h:
3485         * UIProcess/mac/WKInspectorViewController.mm:
3486         (+[WKInspectorViewController viewIsInspectorWebView:]):
3487         Abstract away the -isInstanceOfClass: check for WKInspectorWKWebView.
3488         Clients shouldn't need to know whether we use a subclass or what its name is.
3489
3490         * UIProcess/mac/WebInspectorProxyMac.mm:
3491         (-[WKWebInspectorProxyObjCAdapter inspectorViewControllerInspectorDidCrash:]):
3492         (-[WKWebInspectorProxyObjCAdapter inspectorViewControllerInspectorIsUnderTest:]):
3493         Hook up view controller delegates.
3494
3495         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
3496         (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
3497         (WebKit::WebInspectorProxy::closeFrontendPage):
3498         New implementation based on the view controller.
3499
3500         (WebKit::WebInspectorProxy::platformBringToFront):
3501         (WebKit::WebInspectorProxy::platformIsFront):
3502         (WebKit::WebInspectorProxy::platformCanAttach):
3503         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
3504         (WebKit::WebInspectorProxy::platformAttach):
3505         (WebKit::WebInspectorProxy::platformDetach):
3506         (WebKit::WebInspectorProxy::platformStartWindowDrag):
3507         Adjust to get the WKWebView out of the view controller for code that needs
3508         to do something with the NSView, such as get/set the frame.
3509
3510         (WebKit::WebInspectorProxy::createFrontendConfiguration): Deleted.
3511         (WebKit::exceededDatabaseQuota): Deleted.
3512         (WebKit::webProcessDidCrash): Deleted.
3513         (WebKit::decidePolicyForNavigationAction): Deleted.
3514         (WebKit::getContextMenuFromProposedMenu): Deleted.
3515
3516 2017-10-02  Brian Burg  <bburg@apple.com>
3517
3518         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
3519         https://bugs.webkit.org/show_bug.cgi?id=177661
3520         <rdar://problem/34740286>
3521
3522         Reviewed by Joseph Pecoraro.
3523
3524         Introduce new platform methods to open and close the frontend page and window.
3525         This matches how RemoteWebInspectorProxy divides work up into platform methods.
3526         Move existing code from platformDidClose, platformOpen, and other methods into
3527         the new platform methods. Move some identical platform code into WebInspectorProxy.cpp.
3528
3529         * UIProcess/WebInspectorProxy.h:
3530         * UIProcess/WebInspectorProxy.cpp:
3531         (WebKit::WebInspectorProxy::connect):
3532         (WebKit::WebInspectorProxy::showConsole):
3533         (WebKit::WebInspectorProxy::showResources):
3534         (WebKit::WebInspectorProxy::showTimelines):
3535         (WebKit::WebInspectorProxy::showMainResourceForFrame):
3536         (WebKit::WebInspectorProxy::createFrontendPage):
3537         (WebKit::WebInspectorProxy::createInspectorPage):
3538         (WebKit::WebInspectorProxy::open):
3539         (WebKit::WebInspectorProxy::didClose):
3540         (WebKit::WebInspectorProxy::eagerlyCreateInspectorPage): Renamed.
3541
3542         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3543         (WebKit::WebInspectorProxy::updateInspectorWindowTitle const):
3544         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
3545         Do everything necessary to set up the frontend page WebView.
3546
3547         (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
3548         Do everything necessary to set up the detached NSWindow for the frontend.
3549
3550         (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
3551         (WebKit::WebInspectorProxy::platformDetach):
3552         (WebKit::WebInspectorProxy::platformCreateInspectorPage): Deleted.
3553         (WebKit::WebInspectorProxy::createInspectorWindow): Deleted.
3554         (WebKit::WebInspectorProxy::platformOpen): Deleted.
3555         (WebKit::WebInspectorProxy::platformDidClose): Deleted.
3556
3557         * UIProcess/mac/WebInspectorProxyMac.mm:
3558         (WebKit::WebInspectorProxy::updateInspectorWindowTitle const):
3559         (WebKit::WebInspectorProxy::platformCreateFrontendPage): Added.
3560         Do everything necessary to set up the frontend page WebView.
3561
3562         (WebKit::WebInspectorProxy::platformCreateFrontendWindow): Added.
3563         Do everything necessary to set up the detached NSWindow for the frontend.
3564
3565         (WebKit::WebInspectorProxy::closeFrontendPage):
3566         (WebKit::WebInspectorProxy::closeFrontendAfterInactivityTimerFired):
3567         (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
3568         (WebKit::WebInspectorProxy::platformDidCloseForCrash):
3569         (WebKit::WebInspectorProxy::platformInvalidate):
3570         (WebKit::WebInspectorProxy::platformBringToFront): Carry through renamings.
3571
3572         (WebKit::WebInspectorProxy::platformDetach):
3573         Defer to the general open() method to create a window if needed and bring it to front.
3574
3575         (WebKit::WebInspectorProxy::platformCanAttach): Move this below open/close code.
3576
3577         (WebKit::WebInspectorProxy::closeFrontend): Deleted.
3578         (WebKit::WebInspectorProxy::createInspectorWindow): Deleted.
3579         (WebKit::WebInspectorProxy::platformCreateInspectorPage): Deleted.
3580         (WebKit::WebInspectorProxy::platformOpen): Deleted.
3581         (WebKit::WebInspectorProxy::platformDidClose): Deleted.
3582         Defer to the general open() method to create a window if needed and bring it to front.
3583
3584         * UIProcess/wpe/WebInspectorProxyWPE.cpp:
3585         (WebKit::WebInspectorProxy::platformCreateFrontendPage):
3586         (WebKit::WebInspectorProxy::platformCreateFrontendWindow):
3587         (WebKit::WebInspectorProxy::platformCloseFrontendPageAndWindow):
3588         (WebKit::WebInspectorProxy::platformCreateInspectorPage): Deleted.
3589         (WebKit::WebInspectorProxy::createInspectorWindow): Deleted.
3590         (WebKit::WebInspectorProxy::platformOpen): Deleted.
3591         (WebKit::WebInspectorProxy::platformDidClose): Deleted.
3592         Update stubs.
3593
3594 2017-10-02  Brian Burg  <bburg@apple.com>
3595
3596         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
3597         https://bugs.webkit.org/show_bug.cgi?id=177661
3598         <rdar://problem/34740286>
3599
3600         Reviewed by Joseph Pecoraro.
3601
3602         This patch refactors some Cocoa code pathas.
3603         Rename the timer that closes the WebView so it's more obvious what it is for.
3604         Extract the common code to close the frontend window so its not implemented by
3605         the timer callback.
3606
3607         In later patches, this will be extracted further into platform methods to open/close
3608         the frontend and window, like how it is for RemoteWebInspectorProxy.
3609
3610         * UIProcess/WebInspectorProxy.cpp:
3611         (WebKit::WebInspectorProxy::WebInspectorProxy):
3612         * UIProcess/WebInspectorProxy.h:
3613         * UIProcess/mac/WebInspectorProxyMac.mm:
3614         (WebKit::WebInspectorProxy::closeFrontendAfterInactivityTimerFired):
3615         (WebKit::WebInspectorProxy::closeFrontend):
3616         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3617         (WebKit::WebInspectorProxy::platformDidClose):
3618         (WebKit::WebInspectorProxy::platformDidCloseForCrash):
3619         (WebKit::WebInspectorProxy::platformInvalidate):
3620         (WebKit::WebInspectorProxy::closeTimerFired): Deleted.
3621
3622 2017-09-30  Brian Burg  <bburg@apple.com>
3623
3624         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
3625         https://bugs.webkit.org/show_bug.cgi?id=177661
3626         <rdar://problem/34740286>
3627
3628         Reviewed by Joseph Pecoraro.
3629
3630         Modernize the ObjC adapter and related code a bit before it is hooked
3631         into WKInspectorViewController.
3632
3633         * UIProcess/API/C/mac/WKInspectorPrivateMac.h: No need for the
3634         ivar to be declared here, move to @implementation.
3635
3636         * UIProcess/WebInspectorProxy.h: Simplify the name to match modern convention.
3637
3638         * UIProcess/mac/WebInspectorProxyMac.mm:
3639         (-[WKWebInspectorProxyObjCAdapter inspectorRef]):
3640         (-[WKWebInspectorProxyObjCAdapter initWithWebInspectorProxy:]):
3641         (-[WKWebInspectorProxyObjCAdapter invalidate]):
3642         (-[WKWebInspectorProxyObjCAdapter windowDidMove:]):
3643         (-[WKWebInspectorProxyObjCAdapter windowDidResize:]):
3644         (-[WKWebInspectorProxyObjCAdapter windowWillClose:]):
3645         (-[WKWebInspectorProxyObjCAdapter windowDidEnterFullScreen:]):
3646         (-[WKWebInspectorProxyObjCAdapter windowDidExitFullScreen:]):
3647         (-[WKWebInspectorProxyObjCAdapter inspectedViewFrameDidChange:]):
3648         Remove unnecessary casts to and from void*.
3649
3650         (WebKit::WebInspectorProxy::attachmentViewDidChange):
3651         (WebKit::WebInspectorProxy::setInspectorWindowFrame):
3652         (WebKit::WebInspectorProxy::closeTimerFired):
3653         (WebKit::WebInspectorProxy::createInspectorWindow):
3654         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3655         Fix uses of member variable m_objCAdapter.
3656
3657         (-[WKWebInspectorProxyObjCAdapter close]): Deleted.
3658         Rename this to invalidate to match modern convention. In this context,
3659         'close' might trick someone into thinking that this closes a window/page.
3660
3661 2017-09-30  Brian Burg  <bburg@apple.com>
3662
3663         Web Inspector: consolidate code that hosts the Inspector page inside a WKWebView
3664         https://bugs.webkit.org/show_bug.cgi?id=177661
3665         <rdar://problem/34740286>
3666
3667         Reviewed by Joseph Pecoraro.
3668
3669         Move code that sets up and controls the inspector WebView into WKInspectorViewController.
3670         This will be shared between RemoteWebInspectorProxy and WebInspectorProxy eventually,
3671         but for now just pull out code from RemoteWebInspectorProxy. The next patch will move
3672         over WebInspectorProxy.
3673
3674         WKInspectorViewController uses the ObjC API for setting up the WKWebView's delegates.
3675         Previously, a WKWebView was used but the delegates were set up using the C API. In
3676         a few cases it uses delegate methods to ask the owning [Remote]WebInspectorProxy some
3677         things. In general, WKInspectorViewController doesn't dig into any internals of
3678         WebPageProxy or WebInspectorProxy; that is delegated to the client.
3679
3680         * UIProcess/RemoteWebInspectorProxy.h:
3681         (WebKit::RemoteWebInspectorProxy::isUnderTest const): Add a method stub for now.
3682         We might want to enable tests for a _WKRemoteWebInspectorViewController-based UI
3683         in the future, and WebInspectorProxy has the same method. Add this and connect it
3684         to the view controller delegate method.
3685
3686         (WebKit::RemoteWebInspectorProxy::webView const):
3687         This returns a plain WKWebView type now.
3688
3689         * UIProcess/mac/RemoteWebInspectorProxyMac.mm:
3690         (-[WKRemoteWebInspectorProxyObjCAdapter inspectorViewControllerInspectorDidCrash:]):
3691         (-[WKRemoteWebInspectorProxyObjCAdapter inspectorViewControllerInspectorIsUnderTest:]):
3692         (-[WKRemoteWebInspectorProxyObjCAdapter webViewWebContentProcessDidTerminate:]): Deleted.
3693         (-[WKRemoteWebInspectorProxyObjCAdapter webView:decidePolicyForNavigationAction:decisionHandler:]): Deleted.
3694         Make the ObjCAdapter forward view controller delegate calls to the C++ class.
3695         It no longer needs to be the delegate of the WebView, as the view controller handles that.
3696
3697         (WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
3698         Clean up and move WKWebView setup code into the view controller.
3699
3700         (WebKit::RemoteWebInspectorProxy::platformCloseFrontendPageAndWindow):
3701         The m_inspectorPage is closed by the caller before calling this method, so we don't need to do it here.
3702
3703         (WebKit::RemoteWebInspectorProxy::platformBringToFront):
3704         (WebKit::RemoteWebInspectorProxy::platformSave):
3705         (WebKit::RemoteWebInspectorProxy::platformAppend):
3706         (WebKit::RemoteWebInspectorProxy::platformStartWindowDrag):
3707         Use webView() instead of m_webView.
3708
3709         * UIProcess/mac/WKInspectorViewController.h: Added.
3710         * UIProcess/mac/WKInspectorViewController.mm: Added.
3711         (-[WKInspectorWKWebView tag]):
3712         (-[WKInspectorViewController initWithInspectedPage:]):
3713         (-[WKInspectorViewController dealloc]):
3714         (-[WKInspectorViewController delegate]):
3715         (-[WKInspectorViewController webView]):
3716         (-[WKInspectorViewController setDelegate:]):
3717         (-[WKInspectorViewController configuration]):
3718         (-[WKInspectorViewController _webView:getWindowFrameWithCompletionHandler:]):
3719         (-[WKInspectorViewController _webView:setWindowFrame:]):
3720         (-[WKInspectorViewController webView:runOpenPanelWithParameters:initiatedByFrame:completionHandler:]):
3721         (-[WKInspectorViewController _webView:decideDatabaseQuotaForSecurityOrigin:currentQuota:currentOriginUsage:currentDatabaseUsage:expectedUsage:decisionHandler:]):
3722         (-[WKInspectorViewController webViewWebContentProcessDidTerminate:]):
3723         (-[WKInspectorViewController webView:decidePolicyForNavigationAction:decisionHandler:]):
3724         Move code from RemoteWebInspectorProxyMac into here.
3725
3726         * UIProcess/mac/WebInspectorProxyMac.mm:
3727         (WebKit::WebInspectorProxy::createFrontendWindow):
3728         Remove commented out code left over from the last time that this method got moved around.
3729
3730         * WebKit.xcodeproj/project.pbxproj:
3731         Add new class.
3732
3733 2017-10-20  Zan Dobersek  <zdobersek@igalia.com>
3734
3735         [WK2] Drop 'CoordinatedGraphics' as a platform prefix from generate-forwarding-headers.pl
3736         https://bugs.webkit.org/show_bug.cgi?id=178575
3737
3738         Reviewed by Carlos Garcia Campos.
3739
3740         * Scripts/generate-forwarding-headers.pl: Remove CoordinatedGraphics as
3741         a supported platform prefix. No one invokes the script with this
3742         argument anymore.
3743
3744 2017-10-19  Alex Christensen  <achristensen@webkit.org>
3745
3746         Introduce completionHandler-based SPI for _WKDownloadDelegate.decideDestinationWithSuggestedFilename
3747         https://bugs.webkit.org/show_bug.cgi?id=178560
3748
3749         Reviewed by Tim Horton.
3750
3751         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
3752         * UIProcess/Cocoa/DownloadClient.h:
3753         * UIProcess/Cocoa/DownloadClient.mm:
3754         (WebKit::DownloadClient::DownloadClient):
3755         (WebKit::DownloadClient::didStart):
3756         (WebKit::DownloadClient::didReceiveResponse):
3757         (WebKit::DownloadClient::didReceiveData):
3758         (WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
3759         (WebKit::DownloadClient::didFinish):
3760         (WebKit::DownloadClient::didFail):
3761         (WebKit::DownloadClient::didCancel):
3762         (WebKit::DownloadClient::willSendRequest):
3763
3764 2017-10-19  Chris Dumez  <cdumez@apple.com>
3765
3766         ServiceWorkerContextManager should be an IPC::MessageReceiver
3767         https://bugs.webkit.org/show_bug.cgi?id=178552
3768
3769         Reviewed by Youenn Fablet.
3770
3771         ServiceWorkerContextManager should be an IPC::MessageReceiver, to avoid putting too many
3772         ServiceWorker related methods on WebProcess class.
3773
3774         * DerivedSources.make:
3775         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3776         (WebKit::WebSWServerConnection::startServiceWorkerContext):
3777         (WebKit::WebSWServerConnection::startFetch):
3778         * WebKit.xcodeproj/project.pbxproj:
3779         * WebProcess/Storage/ServiceWorkerContextManager.cpp:
3780         (WebKit::ServiceWorkerContextManager::startFetchInServiceWorker):
3781         (WebKit::ServiceWorkerContextManager::startFetch): Deleted.
3782         * WebProcess/Storage/ServiceWorkerContextManager.h:
3783         * WebProcess/Storage/ServiceWorkerContextManager.messages.in: Added.
3784         * WebProcess/WebProcess.cpp:
3785         (WebKit::WebProcess::didReceiveMessage):
3786         (WebKit::WebProcess::getWorkerContextConnection):
3787         (WebKit::WebProcess::startServiceWorkerContext): Deleted.
3788         (WebKit::WebProcess::startFetchInServiceWorker): Deleted.
3789         * WebProcess/WebProcess.h:
3790         * WebProcess/WebProcess.messages.in:
3791
3792 2017-10-19  Alex Christensen  <achristensen@webkit.org>
3793
3794         Modernize authentication challenge handling in WebKit
3795         https://bugs.webkit.org/show_bug.cgi?id=178555
3796
3797         Reviewed by Tim Horton.
3798
3799         * UIProcess/API/APILoaderClient.h:
3800         (API::LoaderClient::didReceiveAuthenticationChallengeInFrame):
3801         * UIProcess/API/APINavigationClient.h:
3802         (API::NavigationClient::didReceiveAuthenticationChallenge):
3803         * UIProcess/API/C/WKPage.cpp:
3804         (WKPageSetPageLoaderClient):
3805         (WKPageSetPageNavigationClient):
3806         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3807         * UIProcess/Cocoa/NavigationState.h:
3808         * UIProcess/Cocoa/NavigationState.mm:
3809         (WebKit::NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace):
3810         (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
3811         * UIProcess/WebPageProxy.cpp:
3812         (WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
3813
3814 2017-10-19  Alex Christensen  <achristensen@webkit.org>
3815
3816         Modernize API::DownloadClient
3817         https://bugs.webkit.org/show_bug.cgi?id=178547
3818
3819         Reviewed by Andy Estes.
3820
3821         Use more C++ references instead of pointers because they're never null.
3822
3823         Remove canAuthenticateAgainstProtectionSpace because there are no implementations
3824         except the default implementation which always returns true and we don't intend to
3825         add this to the SPI because that's just a legacy call anyways from when NSURLConnection
3826         hadn't fully evolved, and we're moving away from NSURLConnection, especially in our API design.
3827
3828         Separate the NetworkSession-only and pre-NetworkSession-only callbacks.  All the synchronous
3829         IPC messages are only used in the pre-NetworkSession code, so once we remove it we can remove them!
3830
3831         Make API::DownloadClient calls that NetworkSession uses use a completion handler so we will be able to
3832         design an asynchronous API.
3833
3834         * NetworkProcess/Downloads/DownloadManager.cpp:
3835         (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace): Deleted.
3836         * NetworkProcess/Downloads/DownloadManager.h:
3837         * NetworkProcess/Downloads/PendingDownload.cpp:
3838         (WebKit::PendingDownload::canAuthenticateAgainstProtectionSpaceAsync):
3839         (WebKit::PendingDownload::continueCanAuthenticateAgainstProtectionSpace): Deleted.
3840         * NetworkProcess/Downloads/PendingDownload.h:
3841         * NetworkProcess/NetworkProcess.cpp:
3842         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpaceDownload): Deleted.
3843         * NetworkProcess/NetworkProcess.h:
3844         * NetworkProcess/NetworkProcess.messages.in:
3845         * UIProcess/API/APIDownloadClient.h:
3846         (API::DownloadClient::didStart):
3847         (API::DownloadClient::didReceiveAuthenticationChallenge):
3848         (API::DownloadClient::didReceiveResponse):
3849         (API::DownloadClient::didReceiveData):
3850         (API::DownloadClient::shouldDecodeSourceDataOfMIMEType):
3851         (API::DownloadClient::decideDestinationWithSuggestedFilename):
3852         (API::DownloadClient::didCreateDestination):
3853         (API::DownloadClient::didFinish):
3854         (API::DownloadClient::didFail):
3855         (API::DownloadClient::didCancel):
3856         (API::DownloadClient::processDidCrash):
3857         (API::DownloadClient::willSendRequest):
3858         (API::DownloadClient::canAuthenticateAgainstProtectionSpace): Deleted.
3859         * UIProcess/API/C/WKContext.cpp:
3860         (WKContextSetDownloadClient):
3861         * UIProcess/API/glib/WebKitDownloadClient.cpp:
3862         * UIProcess/Cocoa/DownloadClient.h:
3863         * UIProcess/Cocoa/DownloadClient.mm:
3864         (WebKit::DownloadClient::didStart):
3865         (WebKit::DownloadClient::didReceiveResponse):
3866         (WebKit::DownloadClient::didReceiveData):
3867         (WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
3868         (WebKit::DownloadClient::didFinish):
3869         (WebKit::DownloadClient::didFail):
3870         (WebKit::DownloadClient::didCancel):
3871         (WebKit::DownloadClient::willSendRequest):
3872         * UIProcess/Downloads/DownloadProxy.cpp:
3873         (WebKit::DownloadProxy::processDidClose):
3874         (WebKit::DownloadProxy::didStart):
3875         (WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
3876         (WebKit::DownloadProxy::willSendRequest):
3877         (WebKit::DownloadProxy::didReceiveResponse):
3878         (WebKit::DownloadProxy::didReceiveData):
3879         (WebKit::DownloadProxy::shouldDecodeSourceDataOfMIMEType):
3880         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
3881         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
3882         (WebKit::DownloadProxy::didCreateDestination):
3883         (WebKit::DownloadProxy::didFinish):
3884         (WebKit::DownloadProxy::didFail):
3885         (WebKit::DownloadProxy::didCancel):
3886         (WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace): Deleted.
3887         * UIProcess/Downloads/DownloadProxy.h:
3888         * UIProcess/Downloads/DownloadProxy.messages.in:
3889
3890 2017-10-19  Nan Wang  <n_wang@apple.com>
3891
3892         AX: Provide a way for Accessibility to cache the selection while retrieving rects for speak selection
3893         https://bugs.webkit.org/show_bug.cgi?id=176247
3894         <rdar://problem/34217143>
3895
3896         Reviewed by Ryosuke Niwa.
3897
3898         When getting the rects for highlighting the spoken text within a selection range on iOS, we can get a
3899         list of totally wrong rects if the user changed the selection to some other text. This is because the
3900         calculation is based on the current selection range. Therefore, we need to provide a way for accessibility
3901         codepath to store the selection during a speaking session.
3902
3903         * UIProcess/API/Cocoa/WKWebView.mm:
3904         (-[WKWebView _accessibilityStoreSelection]):
3905         (-[WKWebView _accessibilityClearSelection]):
3906         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3907         * UIProcess/WebPageProxy.h:
3908         * UIProcess/ios/WKContentViewInteraction.h:
3909         * UIProcess/ios/WKContentViewInteraction.mm:
3910         (-[WKContentView _accessibilityStoreSelection]):
3911         (-[WKContentView _accessibilityClearSelection]):
3912         * UIProcess/ios/WebPageProxyIOS.mm:
3913         (WebKit::WebPageProxy::storeSelectionForAccessibility):
3914         * WebProcess/WebPage/WebPage.h:
3915         * WebProcess/WebPage/WebPage.messages.in:
3916         * WebProcess/WebPage/ios/WebPageIOS.mm:
3917         (WebKit::WebPage::getRectsForGranularityWithSelectionOffset):
3918         (WebKit::WebPage::storeSelectionForAccessibility):
3919         (WebKit::WebPage::getRectsAtSelectionOffsetWithText):
3920
3921 2017-10-19  Sam Weinig  <sam@webkit.org>
3922
3923         [Settings] Move global settings into their own file
3924         https://bugs.webkit.org/show_bug.cgi?id=178512
3925
3926         Reviewed by Darin Adler.
3927
3928         Moves all global settigns out of SettingsBase and into the new DeprecatedGlobalSettings.
3929
3930         * NetworkProcess/NetworkProcess.cpp:
3931         (WebKit::NetworkProcess::setAllowsAnySSLCertificateForWebSocket):
3932         * Shared/WebPreferencesDefinitions.h:
3933         * Shared/WebPreferencesStore.cpp:
3934         * WebProcess/WebPage/WebPage.cpp:
3935         (WebKit::m_cpuLimit):
3936         (WebKit::WebPage::updatePreferences):
3937         * WebProcess/WebProcess.cpp:
3938         (WebKit::WebProcess::setResourceLoadStatisticsEnabled):
3939         * WebProcess/cocoa/VideoFullscreenManager.mm:
3940         (WebKit::VideoFullscreenManager::supportsVideoFullscreen const):
3941
3942 2017-10-19  Andy Estes  <aestes@apple.com>
3943
3944         [iOS] Conditionally rename DatabaseProcess to StorageProcess when building for iOS devices
3945         https://bugs.webkit.org/show_bug.cgi?id=178181
3946         <rdar://problem/33660282>
3947
3948         Reviewed by Dan Bernstein.
3949
3950         * Configurations/BaseTarget.xcconfig:
3951         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3952         (WebKit::serviceName):
3953         * WebKit.xcodeproj/project.pbxproj:
3954
3955 2017-10-19  Youenn Fablet  <youenn@apple.com>
3956
3957         Add preliminary support for ServiceWorker Handle Fetch
3958         https://bugs.webkit.org/show_bug.cgi?id=178475
3959         <rdar://problem/35066424>
3960
3961         Reviewed by Chris Dumez.
3962
3963         Relanding now that underlying issue is fixed in https://bugs.webkit.org/show_bug.cgi?id=178527.
3964
3965         Preliminary support of Handle Fetch algorithm and integration with fetch spec.
3966         Adding ServiceWorkerClientFetch as the class responsible to do the load through ServiceWorker.
3967         It is similar to WebResourceLoader that do the load through NetworkProcess.
3968         In case ServiceWorkerClientFetch is not able to load through ServiceWorker,
3969         it will fallback to WebResourceLoader through a fallback callback.
3970
3971         Loading through Service Worker is done currently if:
3972         - There is a service worker registered for that origin
3973         - Request is a subresource
3974         - service workers mode is all
3975         There will be cases where the service worker will not do the loading, for instance when fetch event handler is not set.
3976         Future work should try to reduce the cases where the IPC dance is done unnecessarily.
3977
3978         ServiceWorkerClientFetch is responsible to adapt the ServiceWorker response to ResourceLoader.
3979         In particular, it is calling ResourceLoader error callback if response is of type error.
3980         It should call ResourceLoader redirection callback if response is a redirection response.
3981         This will be done as a follow-up.
3982
3983         Implementing the IPC communication dedicated to fetch between WebProcess and ServiceWorker through StorageProcess.
3984         In the future, WebProcess should create a direct IPC communication to the ServiceWorker process.
3985
3986         Moved SWContextManager from WebCore to WebKit and renamed it to ServiceWorkerContextManager.
3987         This class is moved to WebKit as it will have to handle IPC and having a separation will add some unnecessary boilerplate.
3988
3989         * CMakeLists.txt:
3990         * DerivedSources.make:
3991         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
3992         (WebKit::WebSWServerConnection::startFetch):
3993         (WebKit::WebSWServerConnection::didReceiveFetchResponse):
3994         (WebKit::WebSWServerConnection::didReceiveFetchData):
3995         (WebKit::WebSWServerConnection::didFinishFetch):
3996         (WebKit::WebSWServerConnection::didFailFetch):
3997         * StorageProcess/ServiceWorker/WebSWServerConnection.h:
3998         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
3999         * StorageProcess/StorageProcess.cpp:
4000         (WebKit::StorageProcess::didFailFetch):
4001         (WebKit::StorageProcess::didReceiveFetchResponse):
4002         (WebKit::StorageProcess::didReceiveFetchData):
4003         (WebKit::StorageProcess::didFinishFetch):
4004         * StorageProcess/StorageProcess.h:
4005         * StorageProcess/StorageProcess.messages.in:
4006         * WebKit.xcodeproj/project.pbxproj:
4007         * WebProcess/Network/WebLoaderStrategy.cpp:
4008         (WebKit::WebLoaderStrategy::scheduleLoad):
4009         (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
4010         (WebKit::WebLoaderStrategy::remove):