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