Correct nullptr dereference during shutdown
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2017-10-03  Brent Fulgham  <bfulgham@apple.com>
2
3         Correct nullptr dereference during shutdown
4         https://bugs.webkit.org/show_bug.cgi?id=177845
5         <rdar://problem/33651405>
6
7         Reviewed by Chris Dumez.
8
9         It looks like the ResourceLoadStatisticsPersistentStorage destructor is calling code that attempts
10         to use member variables in its owning class (WebResourceLoadStatisticsStore). Since these may have
11         already been destroyed, they are in an invalid state when accessed.
12
13         * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
14         (WebKit::ResourceLoadStatisticsPersistentStorage::~ResourceLoadStatisticsPersistentStorage): Do not call
15         finishAllPendingWorkSynchronously() in the destructor, since it relies on the m_memoryStore to be
16         a reference to completely valid object.
17         * UIProcess/WebResourceLoadStatisticsStore.cpp:
18         (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore): Instead, call
19         'finishAllPendingWorkSynchronously' here, when the object is still in a known valid state.
20
21 2017-10-03  Alex Christensen  <achristensen@webkit.org>
22
23         Moderize WebKit's back forward list code
24         https://bugs.webkit.org/show_bug.cgi?id=177843
25
26         Reviewed by Tim Horton.
27
28         Use Ref instead of RefPtr when possible.
29         Use references instead of pointers when possible.
30         Remove unnecessary null checks.
31         Reduce unnecessary Vector copying.
32
33         * Shared/SessionState.h:
34         * Shared/WebBackForwardListItem.h:
35         * UIProcess/API/APILoaderClient.h:
36         (API::LoaderClient::didChangeBackForwardList):
37         (API::LoaderClient::shouldKeepCurrentBackForwardListItemInList):
38         * UIProcess/API/C/WKPage.cpp:
39         (WKPageSetPageLoaderClient):
40         * UIProcess/WebBackForwardList.cpp:
41         (WebKit::WebBackForwardList::pageClosed):
42         (WebKit::WebBackForwardList::addItem):
43         (WebKit::WebBackForwardList::goToItem):
44         (WebKit::WebBackForwardList::currentItem const):
45         (WebKit::WebBackForwardList::backItem const):
46         (WebKit::WebBackForwardList::forwardItem const):
47         (WebKit::WebBackForwardList::itemAtIndex const):
48         (WebKit::WebBackForwardList::backListAsAPIArrayWithLimit const):
49         (WebKit::WebBackForwardList::forwardListAsAPIArrayWithLimit const):
50         (WebKit::WebBackForwardList::removeAllItems):
51         (WebKit::WebBackForwardList::clear):
52         (WebKit::WebBackForwardList::backForwardListState const):
53         (WebKit::WebBackForwardList::restoreFromState):
54         * UIProcess/WebBackForwardList.h:
55         * UIProcess/WebPageProxy.cpp:
56         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
57         (WebKit::WebPageProxy::initializeWebPage):
58         (WebKit::WebPageProxy::didChangeBackForwardList):
59         (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList):
60         (WebKit::WebPageProxy::backForwardGoToItem):
61         * UIProcess/WebPageProxy.h:
62         * UIProcess/WebProcessProxy.cpp:
63         (WebKit::WebProcessProxy::registerNewWebBackForwardListItem):
64         * UIProcess/WebProcessProxy.h:
65         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
66         (WebKit::WebBackForwardListProxy::itemAtIndex):
67
68 2017-10-03  Chris Dumez  <cdumez@apple.com>
69
70         SharedStringHashStore should support removing hashes
71         https://bugs.webkit.org/show_bug.cgi?id=177770
72
73         Reviewed by Alex Christensen.
74
75         SharedStringHashStore should support removing hashes. It currently only supports adding hashes or
76         clearing all of them, which is sufficient for the VisitedLinkStore but will not be for Service
77         Worker purposes.
78
79         * Shared/SharedStringHashStore.cpp:
80         (WebKit::SharedStringHashStore::SharedStringHashStore):
81         (WebKit::SharedStringHashStore::add):
82         (WebKit::SharedStringHashStore::remove):
83         (WebKit::SharedStringHashStore::contains):
84         (WebKit::SharedStringHashStore::clear):
85         (WebKit::SharedStringHashStore::resizeTable):
86         (WebKit::SharedStringHashStore::pendingOperationsTimerFired):
87         * Shared/SharedStringHashStore.h:
88         * Shared/SharedStringHashTable.cpp:
89         (WebKit::SharedStringHashTable::remove):
90         * Shared/SharedStringHashTable.h:
91         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
92         * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm:
93         (-[_WKVisitedLinkStore containsVisitedLinkWithURL:]):
94         (-[_WKVisitedLinkStore removeVisitedLinkWithURL:]):
95         * UIProcess/VisitedLinkStore.cpp:
96         (WebKit::VisitedLinkStore::containsVisitedLinkHash):
97         (WebKit::VisitedLinkStore::removeVisitedLinkHash):
98         (WebKit::VisitedLinkStore::didUpdateSharedStringHashes):
99         * UIProcess/VisitedLinkStore.h:
100
101 2017-10-03  Alex Christensen  <achristensen@webkit.org>
102
103         Fix API tests after r222794.
104         https://bugs.webkit.org/show_bug.cgi?id=177825
105
106         * UIProcess/WebPageProxy.cpp:
107         (WebKit::WebPageProxy::willGoToBackForwardListItem):
108         Sometimes there's no navigation client.
109
110 2017-10-03  Alex Christensen  <achristensen@webkit.org>
111
112         Add ObjC equivalent of WKPageLoaderClient.pluginDidFail
113         https://bugs.webkit.org/show_bug.cgi?id=177787
114         <rdar://problem/22387633>
115
116         Reviewed by Tim Horton.
117
118         * UIProcess/API/APILoaderClient.h:
119         (API::LoaderClient::didFailToInitializePlugin):
120         * UIProcess/API/APINavigationClient.h:
121         (API::NavigationClient::canHandleDidFailToInitializePlugIn const):
122         (API::NavigationClient::didFailToInitializePlugIn):
123         * UIProcess/API/C/WKPage.cpp:
124         (WKPageSetPageLoaderClient):
125         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
126         * UIProcess/Cocoa/NavigationState.h:
127         * UIProcess/Cocoa/NavigationState.mm:
128         (WebKit::NavigationState::setNavigationDelegate):
129         (WebKit::NavigationState::NavigationClient::canHandleDidFailToInitializePlugIn const):
130         (WebKit::NavigationState::NavigationClient::didFailToInitializePlugIn):
131         * UIProcess/WebPageProxy.cpp:
132         (WebKit::WebPageProxy::didFailToInitializePlugin):
133
134 2017-10-03  Adrian Perez de Castro  <aperez@igalia.com>
135
136         [GTK] Prefer -webkit-system-font
137         https://bugs.webkit.org/show_bug.cgi?id=177814
138
139         Reviewed by Carlos Garcia Campos.
140
141         Use "font-family: -webkit-system-font" instead of "font: menu".
142
143         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
144         (WebKit::RemoteInspectorProtocolHandler::handleRequest): Edited HTML snippet.
145
146 2017-10-03  Alex Christensen  <achristensen@webkit.org>
147
148         Add ObjC SPI equivalent to WKPageLoaderClient.willGoToBackForwardListItem
149         https://bugs.webkit.org/show_bug.cgi?id=177825
150         <rdar://problem/22387505>
151
152         Reviewed by Tim Horton.
153
154         * UIProcess/API/APILoaderClient.h:
155         (API::LoaderClient::willGoToBackForwardListItem):
156         * UIProcess/API/APINavigationClient.h:
157         (API::NavigationClient::canHandleWillGoToBackForwardListItem const):
158         (API::NavigationClient::willGoToBackForwardListItem):
159         * UIProcess/API/C/WKPage.cpp:
160         (WKPageSetPageLoaderClient):
161         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
162         * UIProcess/Cocoa/NavigationState.h:
163         * UIProcess/Cocoa/NavigationState.mm:
164         (WebKit::NavigationState::setNavigationDelegate):
165         (WebKit::NavigationState::NavigationClient::canHandleWillGoToBackForwardListItem const):
166         (WebKit::NavigationState::NavigationClient::willGoToBackForwardListItem):
167         * UIProcess/WebPageProxy.cpp:
168         (WebKit::WebPageProxy::willGoToBackForwardListItem):
169         * UIProcess/WebPageProxy.h:
170         * UIProcess/WebPageProxy.messages.in:
171         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
172         (WebKit::WebFrameLoaderClient::shouldGoToHistoryItem const):
173
174 2017-10-03  Michael Catanzaro  <mcatanzaro@igalia.com>
175
176         REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
177         https://bugs.webkit.org/show_bug.cgi?id=177449
178
179         Reviewed by Chris Dumez.
180
181         * Shared/gtk/WebEventFactory.cpp:
182         (WebKit::WebEventFactory::createWebMouseEvent):
183         (WebKit::WebEventFactory::createWebWheelEvent):
184         (WebKit::WebEventFactory::createWebKeyboardEvent):
185         (WebKit::WebEventFactory::createWebTouchEvent):
186         * Shared/wpe/WebEventFactory.cpp:
187         (WebKit::wallTimeForEventTime):
188         (WebKit::WebEventFactory::createWebKeyboardEvent):
189         (WebKit::WebEventFactory::createWebMouseEvent):
190         (WebKit::WebEventFactory::createWebWheelEvent):
191         (WebKit::WebEventFactory::createWebTouchEvent):
192
193 2017-10-03  Carlos Garcia Campos  <cgarcia@igalia.com>
194
195         [GTK][WPE] WebProcess should run cleanup on quit to release resources
196         https://bugs.webkit.org/show_bug.cgi?id=168126
197
198         Reviewed by Michael Catanzaro.
199
200         Do not call exit on sync message send failure for GTK and WPE ports.
201
202         * WebProcess/WebProcess.cpp:
203         (WebKit::WebProcess::initializeConnection):
204
205 2017-10-02  Ryosuke Niwa  <rniwa@webkit.org>
206
207         Move more code into PasteboardCustomData
208         https://bugs.webkit.org/show_bug.cgi?id=177795
209
210         Reviewed by Wenson Hsieh.
211
212         Added the support for encoding and decoding the origin string in PasteboardCustomData.
213
214         * Shared/WebCoreArgumentCoders.cpp:
215         (IPC::ArgumentCoder<PasteboardCustomData>::encode):
216         (IPC::ArgumentCoder<PasteboardCustomData>::decode):
217
218 2017-10-02  Adrian Perez de Castro  <aperez@igalia.com>
219
220         [GTK] Do not hardcode font family in served remote inspector HTML snippets
221         https://bugs.webkit.org/show_bug.cgi?id=177742
222
223         Reviewed by Carlos Garcia Campos.
224
225         Instead of hardcoding Cantarell as the font used for the HTML snippets served
226         by the remote inspector handler, use "font: menu" to obtain the system UI
227         font, plus a "font-size" rule for adjusting the size.
228
229         * UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
230         (WebKit::RemoteInspectorProtocolHandler::handleRequest): Change the
231         CSS rules in the served snippet.
232
233 2017-10-02  Joseph Pecoraro  <pecoraro@apple.com>
234
235         Web Inspector: Include Beacon and Ping requests in Network tab
236         https://bugs.webkit.org/show_bug.cgi?id=177641
237         <rdar://problem/33086839>
238
239         Reviewed by Chris Dumez.
240
241         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
242         (WebKit::NetworkConnectionToWebProcess::loadPing):
243         (WebKit::NetworkConnectionToWebProcess::didFinishPingLoad):
244         * NetworkProcess/NetworkConnectionToWebProcess.h:
245         * NetworkProcess/PingLoad.cpp:
246         (WebKit::PingLoad::PingLoad):
247         (WebKit::PingLoad::didFinish):
248         (WebKit::PingLoad::didReceiveResponseNetworkSession):
249         * NetworkProcess/PingLoad.h:
250         * WebProcess/Network/NetworkProcessConnection.cpp:
251         (WebKit::NetworkProcessConnection::didFinishPingLoad):
252         * WebProcess/Network/NetworkProcessConnection.h:
253         * WebProcess/Network/NetworkProcessConnection.messages.in:
254         * WebProcess/Network/WebLoaderStrategy.cpp:
255         (WebKit::WebLoaderStrategy::networkProcessCrashed):
256         (WebKit::WebLoaderStrategy::startPingLoad):
257         (WebKit::WebLoaderStrategy::didFinishPingLoad):
258         * WebProcess/Network/WebLoaderStrategy.h:
259         Pass an optional ResourceResponse back to the ping completion handler.
260
261 2017-10-02  Alex Christensen  <achristensen@webkit.org>
262
263         REGRESSION: API tests WebKit.ProcessDidTerminateRequestedByClient and WebKit.ProcessDidTerminateWithReasonCrash are timing out
264         https://bugs.webkit.org/show_bug.cgi?id=177764
265
266         Reviewed by Chris Dumez.
267
268         * UIProcess/API/C/WKPage.cpp:
269         (WKPageSetPageNavigationClient):
270         I shouldn't have reverted the A API telling the listener to continue if there's no client function.
271
272 2017-10-02  Carlos Garcia Campos  <cgarcia@igalia.com>
273
274         [WPE][GTK] Crash in webkit_web_resource_get_data_finish()
275         https://bugs.webkit.org/show_bug.cgi?id=177107
276
277         Reviewed by Michael Catanzaro.
278
279         Handle errors in webkit_web_resource_get_data() callback.
280
281         * UIProcess/API/glib/WebKitWebResource.cpp:
282         (resourceDataCallback):
283         (webkit_web_resource_get_data):
284
285 2017-10-02  Olivier Blin  <olivier.blin@softathome.com>
286
287         [WPE] Fix UIProcess build with GStreamer and without VIDEO
288         https://bugs.webkit.org/show_bug.cgi?id=177753
289
290         Reviewed by Michael Catanzaro.
291
292         GStreamer builds fail when WebAudio is enabled but VIDEO disabled.
293         This is the WPE counterpart of bug 153135.
294
295         * UIProcess/API/wpe/PageClientImpl.h:
296
297 2017-10-02  Alex Christensen  <achristensen@webkit.org>
298
299         Expose more WKPreferences SPI to match C SPI
300         https://bugs.webkit.org/show_bug.cgi?id=177697
301
302         * UIProcess/API/Cocoa/WKPreferences.mm:
303         (-[WKPreferences _javaEnabledForLocalFiles]):
304         (-[WKPreferences _setPlugInsEnabled:]): Deleted.
305         (-[WKPreferences _plugInsEnabled]): Deleted.
306         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
307         _javaEnabledForLocalFiles should return the correct value.
308         _plugInsEnabled has public API.  This SPI is not needed.
309
310 2017-10-02  Alex Christensen  <achristensen@webkit.org>
311
312         REGRESSION(r214201): WebProcess hangs during policy decisions
313         https://bugs.webkit.org/show_bug.cgi?id=177590
314         <rdar://problem/33362929>
315
316         Reviewed by Andy Estes.
317
318         This is like r222431 but for trunk instead of a branch.
319         It includes the same regression API test so I don't make the same mistake again.
320
321         * UIProcess/API/C/WKPage.cpp:
322         (WKPageSetPageNavigationClient):
323         * UIProcess/WebPageProxy.cpp:
324         (WebKit::WebPageProxy::receivedPolicyDecision):
325         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
326         (WebKit::WebPageProxy::decidePolicyForResponseSync):
327         * UIProcess/WebPageProxy.h:
328         * UIProcess/WebPageProxy.messages.in:
329         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
330         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
331         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
332         (WebKit::WebFrameLoaderClient::applyToDocumentLoader):
333         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
334         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
335         * WebProcess/WebPage/WebDocumentLoader.cpp:
336         (WebKit::WebDocumentLoader::setNavigationID):
337         * WebProcess/WebPage/WebFrame.cpp:
338         (WebKit::WebFrame::setUpPolicyListener):
339         (WebKit::WebFrame::invalidatePolicyListener):
340         (WebKit::WebFrame::didReceivePolicyDecision):
341         * WebProcess/WebPage/WebFrame.h:
342         * WebProcess/WebPage/WebPage.cpp:
343         (WebKit::WebPage::didReceivePolicyDecision):
344         * WebProcess/WebPage/WebPage.h:
345         * WebProcess/WebPage/WebPage.messages.in:
346
347 2017-10-02  Alex Christensen  <achristensen@webkit.org>
348
349         Remove unnecessary copy of SessionID in WebPageProxy
350         https://bugs.webkit.org/show_bug.cgi?id=177702
351
352         Reviewed by Darin Adler.
353
354         * UIProcess/WebPageProxy.cpp:
355         (WebKit::WebPageProxy::sessionID const):
356         (WebKit::WebPageProxy::creationParameters):
357         * UIProcess/WebPageProxy.h:
358         (WebKit::WebPageProxy::sessionID const): Deleted.
359
360 2017-10-02  Alex Christensen  <achristensen@webkit.org>
361
362         Expose more WKPreferences SPI to match C SPI
363         https://bugs.webkit.org/show_bug.cgi?id=177697
364         <rdar://problem/24110556>
365
366         Reviewed by Darin Adler.
367
368         * UIProcess/API/Cocoa/WKPreferences.mm:
369         (-[WKPreferences _setJavaEnabledForLocalFiles:]):
370         (-[WKPreferences _javaEnabledForLocalFiles]):
371         (-[WKPreferences _setCanvasUsesAcceleratedDrawing:]):
372         (-[WKPreferences _canvasUsesAcceleratedDrawing]):
373         (-[WKPreferences _setAcceleratedCompositingEnabled:]):
374         (-[WKPreferences _acceleratedCompositingEnabled]):
375         (-[WKPreferences _setDefaultTextEncodingName:]):
376         (-[WKPreferences _defaultTextEncodingName]):
377         (-[WKPreferences _setNeedsSiteSpecificQuirks:]):
378         (-[WKPreferences _needsSiteSpecificQuirks]):
379         (-[WKPreferences _setAuthorAndUserStylesEnabled:]):
380         (-[WKPreferences _authorAndUserStylesEnabled]):
381         (-[WKPreferences _setDOMTimersThrottlingEnabled:]):
382         (-[WKPreferences _domTimersThrottlingEnabled]):
383         (-[WKPreferences _setWebArchiveDebugModeEnabled:]):
384         (-[WKPreferences _webArchiveDebugModeEnabled]):
385         (-[WKPreferences _setLocalFileContentSniffingEnabled:]):
386         (-[WKPreferences _localFileContentSniffingEnabled]):
387         (-[WKPreferences _setUsesPageCache:]):
388         (-[WKPreferences _usesPageCache]):
389         (-[WKPreferences _setPageCacheSupportsPlugins:]):
390         (-[WKPreferences _pageCacheSupportsPlugins]):
391         (-[WKPreferences _setShouldPrintBackgrounds:]):
392         (-[WKPreferences _shouldPrintBackgrounds]):
393         (-[WKPreferences _setWebSecurityEnabled:]):
394         (-[WKPreferences _webSecurityEnabled]):
395         (-[WKPreferences _setUniversalAccessFromFileURLsAllowed:]):
396         (-[WKPreferences _universalAccessFromFileURLsAllowed]):
397         (-[WKPreferences _setAVFoundationEnabled:]):
398         (-[WKPreferences _avFoundationEnabled]):
399         (-[WKPreferences _setSuppressesIncrementalRendering:]):
400         (-[WKPreferences _suppressesIncrementalRendering]):
401         (-[WKPreferences _setAsynchronousPluginInitializationEnabled:]):
402         (-[WKPreferences _asynchronousPluginInitializationEnabled]):
403         (-[WKPreferences _setArtificialPluginInitializationDelayEnabled:]):
404         (-[WKPreferences _artificialPluginInitializationDelayEnabled]):
405         (-[WKPreferences _setCookieEnabled:]):
406         (-[WKPreferences _cookieEnabled]):
407         (-[WKPreferences _setPlugInSnapshottingEnabled:]):
408         (-[WKPreferences _plugInSnapshottingEnabled]):
409         (-[WKPreferences _setQTKitEnabled:]):
410         (-[WKPreferences _qtKitEnabled]):
411         (-[WKPreferences _setSubpixelCSSOMElementMetricsEnabled:]):
412         (-[WKPreferences _subpixelCSSOMElementMetricsEnabled]):
413         (-[WKPreferences _setMediaSourceEnabled:]):
414         (-[WKPreferences _mediaSourceEnabled]):
415         (-[WKPreferences _setViewGestureDebuggingEnabled:]):
416         (-[WKPreferences _viewGestureDebuggingEnabled]):
417         (-[WKPreferences _setCSSAnimationTriggersEnabled:]):
418         (-[WKPreferences _cssAnimationTriggersEnabled]):
419         (-[WKPreferences _setStandardFontFamily:]):
420         (-[WKPreferences _standardFontFamily]):
421         (-[WKPreferences _setNotificationsEnabled:]):
422         (-[WKPreferences _notificationsEnabled]):
423         (-[WKPreferences _setBackspaceKeyNavigationEnabled:]):
424         (-[WKPreferences _backspaceKeyNavigationEnabled]):
425         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
426
427 2017-10-02  Carlos Garcia Campos  <cgarcia@igalia.com>
428
429         [GTK][WPE] Enable interactive forms validation by default
430         https://bugs.webkit.org/show_bug.cgi?id=177737
431
432         Reviewed by Michael Catanzaro.
433
434         It's currently disabled for no reason.
435
436         * Shared/WebPreferencesDefinitions.h:
437
438 2017-10-02  Michael Catanzaro  <mcatanzaro@igalia.com>
439
440         Remove ENABLE_CSS_REGIONS
441         https://bugs.webkit.org/show_bug.cgi?id=177689
442
443         Reviewed by Darin Adler.
444
445         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
446         (webkit_dom_element_get_webkit_region_overset):
447         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.h:
448         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
449         (webkit_dom_element_get_webkit_region_overset): Deleted.
450         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
451
452 2017-09-30  Darin Adler  <darin@apple.com>
453
454         Have IPC::Connection::Client objects consistently invalidate the connection when destroyed
455         https://bugs.webkit.org/show_bug.cgi?id=177708
456
457         Reviewed by Anders Carlsson.
458
459         I ran into an intermittent crash when running regression tests. It looked like a connection
460         client was being called after it was destroyed. I did an audit of the all the connection
461         clients to make sure they all invalidate their connection before they are destroyed.
462
463         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
464         (WebKit::NetworkConnectionToWebProcess::~NetworkConnectionToWebProcess): Invalidate the
465         connection since this object opened the connection. There is no obvious
466         guarantee that the connection will already be invalid when this is destroyed.
467         * StorageProcess/StorageToWebProcessConnection.cpp:
468         (WebKit::StorageToWebProcessConnection::~StorageToWebProcessConnection): Ditto.
469         * UIProcess/Plugins/PluginProcessProxy.cpp:
470         (WebKit::PluginProcessProxy::~PluginProcessProxy): Ditto.
471         * WebProcess/Network/NetworkProcessConnection.cpp:
472         (WebKit::NetworkProcessConnection::~NetworkProcessConnection): Ditto.
473         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
474         (WebKit::WebToStorageProcessConnection::~WebToStorageProcessConnection): Ditto.
475
476         * StorageProcess/StorageToWebProcessConnection.h: Derive privately rather than publicly
477         from IPC::Connection::Client because we can, and this means we don't have to study quite
478         as much code to understand how this is used as a connection client.
479         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: Ditto.
480         * WebProcess/Storage/WebToStorageProcessConnection.h: Ditto.
481         * WebProcess/WebPage/WebInspector.h: Ditto.
482         * WebProcess/WebPage/WebInspectorUI.h: Ditto.
483
484         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
485         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer): Added a comment about a
486         reference cycle cycle leading to a leak that I believe exists here.
487
488 2017-09-29  Alex Christensen  <achristensen@webkit.org>
489
490         REGRESSION: ASSERTION FAILED: m_provisionalURL.isEmpty() in WebKit::FrameLoadState::didStartProvisionalLoad
491         https://bugs.webkit.org/show_bug.cgi?id=177491
492
493         Reviewed by Andy Estes.
494
495         * WebProcess/WebPage/WebFrame.cpp:
496         (WebKit::WebFrame::setUpWillSubmitFormListener):
497         (WebKit::WebFrame::continueWillSubmitForm):
498         (WebKit::WebFrame::invalidatePolicyListener):
499         Speculative fix for a flaky assertion.
500         Restore the clearing of the policy listeners we used to have when form submission was treated as a policy.
501
502 2017-09-29  Chris Dumez  <cdumez@apple.com>
503
504         http/tests/preconnect/link-rel-preconnect-https.html is flaky
505         https://bugs.webkit.org/show_bug.cgi?id=177673
506
507         Reviewed by Alex Christensen.
508
509         Update PreconnectTask to query the client when a certificate needs to be
510         validated. This allows WebKitTestRunner to ignore invalid certificates
511         and this causes http/tests/preconnect/link-rel-preconnect-https.html
512         to pass consistently.
513
514         To avoid duplicating code, PreconnectTask now uses NetworkLoad internally
515         instead of using a NetworkDataTask directly.
516
517         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
518         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
519         * NetworkProcess/NetworkConnectionToWebProcess.h:
520         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
521         * NetworkProcess/NetworkLoad.h:
522         * NetworkProcess/NetworkProcess.cpp:
523         (WebKit::generateCanAuthenticateIdentifier):
524         (WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace):
525         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace):
526         (WebKit::NetworkProcess::preconnectTo):
527         * NetworkProcess/NetworkProcess.h:
528         * NetworkProcess/NetworkResourceLoadParameters.cpp:
529         (WebKit::NetworkResourceLoadParameters::encode const):
530         (WebKit::NetworkResourceLoadParameters::decode):
531         * NetworkProcess/PreconnectTask.cpp:
532         (WebKit::PreconnectTask::PreconnectTask):
533         (WebKit::PreconnectTask::~PreconnectTask):
534         (WebKit::PreconnectTask::willSendRedirectedRequest):
535         (WebKit::PreconnectTask::didReceiveResponse):
536         (WebKit::PreconnectTask::didReceiveBuffer):
537         (WebKit::PreconnectTask::didFinishLoading):
538         (WebKit::PreconnectTask::didFailLoading):
539         (WebKit::PreconnectTask::didSendData):
540         (WebKit::PreconnectTask::canAuthenticateAgainstProtectionSpaceAsync):
541         (WebKit::PreconnectTask::continueCanAuthenticateAgainstProtectionSpace):
542         (WebKit::PreconnectTask::frameID const):
543         (WebKit::PreconnectTask::pageID const):
544         * NetworkProcess/PreconnectTask.h:
545         * WebProcess/Network/WebLoaderStrategy.cpp:
546         (WebKit::WebLoaderStrategy::preconnectTo):
547         * WebProcess/Network/WebLoaderStrategy.h:
548
549 2017-09-29  Alex Christensen  <achristensen@webkit.org>
550
551         Expose WebPreferences::webGLEnabled through WKPreferences
552         https://bugs.webkit.org/show_bug.cgi?id=177692
553         <rdar://problem/24110556>
554
555         Reviewed by Andy Estes.
556
557         * UIProcess/API/Cocoa/WKPreferences.mm:
558         (-[WKPreferences _setWebGLEnabled:]):
559         (-[WKPreferences _webGLEnabled]):
560         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
561
562 2017-09-29  Chris Dumez  <cdumez@apple.com>
563
564         [WK2][NETWORK_SESSION] Move some authentication-related code to avoid duplication
565         https://bugs.webkit.org/show_bug.cgi?id=177667
566
567         Reviewed by Alex Christensen.
568
569         Move some authentication-related code to avoid duplication.
570         This is a preparation code supporting Download authentication
571         as Download uses a NSURLSessionDownloadTask and not a
572         NetworkDataTask.
573
574         * NetworkProcess/NetworkDataTask.h:
575         (WebKit::NetworkDataTask::setSuggestedFilename):
576         * NetworkProcess/NetworkLoad.cpp:
577         (WebKit::NetworkLoad::didReceiveChallenge):
578         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
579         * NetworkProcess/NetworkSession.cpp:
580         (WebKit::NetworkSession::allowsSpecificHTTPSCertificateForHost):
581         * NetworkProcess/NetworkSession.h:
582         * NetworkProcess/PreconnectTask.cpp:
583         (WebKit::PreconnectTask::didReceiveChallenge):
584         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
585         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
586         (WebKit::NetworkDataTaskCocoa::didReceiveChallenge):
587         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
588         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
589         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
590         (WebKit::certificatesMatch):
591         (WebKit::NetworkSessionCocoa::allowsSpecificHTTPSCertificateForHost):
592
593 2017-09-29  Alex Christensen  <achristensen@webkit.org>
594
595         Fix WKWebViewConfigurationPrivate after r222663
596         https://bugs.webkit.org/show_bug.cgi?id=177644
597
598         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
599         (-[WKWebViewConfiguration init]):
600         (-[WKWebViewConfiguration copyWithZone:]):
601         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
602
603 2017-09-29  Chris Dumez  <cdumez@apple.com>
604
605         Split some logic out of VisitedLinkStore and make it reusable
606         https://bugs.webkit.org/show_bug.cgi?id=177575
607
608         Reviewed by Alex Christensen.
609
610         Split some logic out of VisitedLinkStore and make it reusable for other purposes than
611         visited links and from other processes than the UIProcess.
612
613         The plan is to reuse the new SharedStringHashStore for Service Worker registration
614         on StorageProcess side and querying on WebContent process side.
615
616         * CMakeLists.txt:
617         * Shared/SharedStringHashStore.cpp: Added.
618         (WebKit::nextPowerOf2):
619         (WebKit::tableSizeForKeyCount):
620         (WebKit::SharedStringHashStore::SharedStringHashStore):
621         (WebKit::SharedStringHashStore::createSharedMemoryHandle):
622         (WebKit::SharedStringHashStore::add):
623         (WebKit::SharedStringHashStore::clear):
624         (WebKit::SharedStringHashStore::resizeTable):
625         (WebKit::SharedStringHashStore::pendingSharedStringHashesTimerFired):
626         * Shared/SharedStringHashStore.h: Copied from Source/WebKit/WebProcess/WebPage/VisitedLinkTableController.h.
627         (WebKit::SharedStringHashStore::Client::~Client):
628         (WebKit::SharedStringHashStore::isEmpty const):
629         * Shared/SharedStringHashTable.cpp: Renamed from Source/WebKit/Shared/VisitedLinkTable.cpp.
630         (WebKit::SharedStringHashTable::SharedStringHashTable):
631         (WebKit::SharedStringHashTable::~SharedStringHashTable):
632         (WebKit::SharedStringHashTable::setSharedMemory):
633         (WebKit::SharedStringHashTable::add):
634         (WebKit::SharedStringHashTable::contains const):
635         (WebKit::SharedStringHashTable::clear):
636         * Shared/SharedStringHashTable.h: Renamed from Source/WebKit/Shared/VisitedLinkTable.h.
637         * UIProcess/API/C/WKContext.cpp:
638         (WKContextAddVisitedLink):
639         * UIProcess/API/Cocoa/_WKVisitedLinkStore.mm:
640         (-[_WKVisitedLinkStore addVisitedLinkWithURL:]):
641         * UIProcess/VisitedLinkStore.cpp:
642         (WebKit::VisitedLinkStore::VisitedLinkStore):
643         (WebKit::VisitedLinkStore::addProcess):
644         (WebKit::VisitedLinkStore::addVisitedLinkHash):
645         (WebKit::VisitedLinkStore::removeAll):
646         (WebKit::VisitedLinkStore::addVisitedLinkHashFromPage):
647         (WebKit::VisitedLinkStore::sendStoreHandleToProcess):
648         (WebKit::VisitedLinkStore::didInvalidateSharedMemory):
649         (WebKit::VisitedLinkStore::didAddSharedStringHashes):
650         * UIProcess/VisitedLinkStore.h:
651         * UIProcess/WebProcessPool.cpp:
652         * UIProcess/WebProcessPool.h:
653         * UIProcess/WebProcessProxy.h:
654         * WebKit.xcodeproj/project.pbxproj:
655         * WebProcess/WebPage/VisitedLinkTableController.cpp:
656         (WebKit::VisitedLinkTableController::isLinkVisited):
657         (WebKit::VisitedLinkTableController::addVisitedLink):
658         (WebKit::VisitedLinkTableController::visitedLinkStateChanged):
659         * WebProcess/WebPage/VisitedLinkTableController.h:
660         * WebProcess/WebPage/VisitedLinkTableController.messages.in:
661
662 2017-09-28  Alex Christensen  <achristensen@webkit.org>
663
664         Add WKWebViewConfiguration SPI equivalent to WKPageConfigurationSetBackgroundCPULimit
665         https://bugs.webkit.org/show_bug.cgi?id=177644
666         <rdar://problem/34338698>
667
668         Reviewed by Geoffrey Garen.
669
670         WKPageConfigurationSetBackgroundCPULimit is a setter of a std::optional<double> with no accessor.
671         It's never set to 0 in practice, so I guess the ObjC equivalent is a double that is zero or nonzero.
672
673         * UIProcess/API/Cocoa/WKWebView.mm:
674         (-[WKWebView _initializeWithConfiguration:]):
675         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
676         (-[WKWebViewConfiguration _setCPULimit:]):
677         (-[WKWebViewConfiguration _cpuLimit]):
678         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
679
680 2017-09-28  Ryosuke Niwa  <rniwa@webkit.org>
681
682         Image pasting is not working on tineye.com / gmail.com / GitHub.com due to lack of support for DataTransfer.items
683         https://bugs.webkit.org/show_bug.cgi?id=170449
684         <rdar://problem/31432525>
685
686         Reviewed by Wenson Hsieh.
687
688         Add sandbox extensions for files in the pasteboard to make copying & pasting image files work.
689         This is what we do for drag & drop but we should consider adding a mechanism to rekoke the extension in the future.
690
691         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
692         (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType): Add sandbox extensions to the pasted files.
693         * UIProcess/WebPasteboardProxy.h:
694         * UIProcess/WebPasteboardProxy.messages.in:
695         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
696         (WebKit::WebPlatformStrategies::getPathnamesForType): Consume the sandbox tokens sent by the UI process permanently
697         since WebCore will now create File objects for these pasted files.
698
699 2017-09-29  Wenson Hsieh  <wenson_hsieh@apple.com>
700
701         [iOS WK2] Implement -[WKContentView hasText] for compatibility with the UITextInput protocol
702         https://bugs.webkit.org/show_bug.cgi?id=177662
703         <rdar://problem/33410373>
704
705         Reviewed by Tim Horton.
706
707         Implements -[WKContentView hasText] by propagating a flag through post-layout editor state.
708
709         * Shared/EditorState.cpp:
710         (WebKit::EditorState::PostLayoutData::encode const):
711         (WebKit::EditorState::PostLayoutData::decode):
712         * Shared/EditorState.h:
713
714         Add a new flag to EditorState indicating whether or not the current editable root containing the selection has
715         any plain text. Add IPC support for this new flag.
716
717         * UIProcess/ios/WKContentViewInteraction.mm:
718         (-[WKContentView hasText]):
719         * WebProcess/WebPage/ios/WebPageIOS.mm:
720         (WebKit::computeEditableRootHasContentAndPlainText):
721
722         Add a new helper to compute whether or not the editable root has any content, and any plain text. This
723         is used as the last cached value for -hasText on WKContentView that we will deliver to UIKit. Some important
724         things to note here:
725         - If post layout data already indicates that we have selected some plain text, or that there is a plain text
726           character near the selection, just set the flags to true and bail, since the editable root necessarily has
727           content that is plain text.
728         - If hasContent is false, don't even bother computing hasPlainText, because it must also be false.
729         - Otherwise, use hasAnyPlainText to compute the value of hasPlainText, which is a faster variant of plainText.
730         These optimizations help us avoid doing extra work at all when running Speedometer, apart from checking the
731         values of a few PostLayoutData flags. This also fixes the value of hasContent, which was previously always false
732         if we had a range selection rather than a caret selection even when the editable root has content, because the
733         logic to compute the value of hasContent only existed in the branch where we have a caret selection.
734
735         (WebKit::WebPage::platformEditorState const):
736
737 2017-09-28  Timothy Horton  <timothy_horton@apple.com>
738
739         Fix the macOS CMake build
740
741         * CMakeLists.txt:
742
743 2017-09-28  Timothy Horton  <timothy_horton@apple.com>
744
745         Revise deployment target macros from r222620
746
747         Rubber-stamped by Wenson Hsieh.
748
749         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
750         * WebProcess/Plugins/PDF/PDFPlugin.mm:
751         (WebKit::PDFPlugin::pdfDocumentDidLoad):
752
753 2017-09-28  Aishwarya Nirmal  <anirmal@apple.com>
754
755         Request for PDF URL targets for specific pages, sections, etc.
756         https://bugs.webkit.org/show_bug.cgi?id=177582
757         <rdar://problem/5692679>
758
759         Reviewed by Tim Horton.
760         
761         This change sets the URL fragment for scroll anchoring in PDFs.
762
763         * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
764         * WebProcess/Plugins/PDF/PDFPlugin.mm:
765         (WebKit::PDFPlugin::pdfDocumentDidLoad):
766
767 2017-09-28  Ross Kirsling  <ross.kirsling@sony.com>
768
769         [PAL] Move HysteresisActivity into PAL
770         https://bugs.webkit.org/show_bug.cgi?id=177516
771
772         Reviewed by Alex Christensen.
773
774         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
775         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::PendingFrameLoad):
776         * Shared/WebSQLiteDatabaseTracker.cpp:
777         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
778         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
779         * Shared/WebSQLiteDatabaseTracker.h:
780         * WebProcess/WebPage/WebPage.cpp:
781         (WebKit::m_pageScrolledHysteresis):
782         (WebKit::m_userActivityHysteresis):
783         (WebKit::WebPage::updateUserActivity):
784         * WebProcess/WebPage/WebPage.h:
785         * WebProcess/WebProcess.cpp:
786         (WebKit::WebProcess::WebProcess):
787         * WebProcess/WebProcess.h:
788
789 2017-09-28  Chris Dumez  <cdumez@apple.com>
790
791         Add support for <link rel=preconnect>
792         https://bugs.webkit.org/show_bug.cgi?id=177474
793         <rdar://problem/33141380>
794
795         Reviewed by Alex Christensen.
796
797         Add support for <link rel=preconnect>:
798         - https://w3c.github.io/resource-hints/#preconnect
799
800         Also add corresponding native private API.
801
802         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
803         (WebKit::NetworkConnectionToWebProcess::preconnectTo):
804         (WebKit::NetworkConnectionToWebProcess::didFinishPreconnection):
805         * NetworkProcess/NetworkConnectionToWebProcess.h:
806         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
807         * NetworkProcess/NetworkDataTask.cpp:
808         (WebKit::NetworkDataTask::create):
809         * NetworkProcess/NetworkLoadParameters.h:
810         * NetworkProcess/NetworkProcess.cpp:
811         (WebKit::NetworkProcess::preconnectTo):
812         * NetworkProcess/NetworkProcess.h:
813         * NetworkProcess/NetworkProcess.messages.in:
814         * NetworkProcess/PreconnectTask.cpp: Added.
815         (WebKit::PreconnectTask::PreconnectTask):
816         (WebKit::PreconnectTask::~PreconnectTask):
817         (WebKit::PreconnectTask::willPerformHTTPRedirection):
818         (WebKit::PreconnectTask::didReceiveChallenge):
819         (WebKit::PreconnectTask::didReceiveResponseNetworkSession):
820         (WebKit::PreconnectTask::didReceiveData):
821         (WebKit::PreconnectTask::didCompleteWithError):
822         (WebKit::PreconnectTask::didSendData):
823         (WebKit::PreconnectTask::wasBlocked):
824         (WebKit::PreconnectTask::cannotShowURL):
825         (WebKit::PreconnectTask::didFinish):
826         * NetworkProcess/PreconnectTask.h: Copied from Source/WebKit/NetworkProcess/NetworkLoadParameters.h.
827         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
828         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
829         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
830         * Shared/WebCoreArgumentCoders.h:
831         * Shared/WebPreferencesDefinitions.h:
832         * UIProcess/API/C/WKContext.cpp:
833         (WKContextPreconnectToServer):
834         * UIProcess/API/C/WKContextPrivate.h:
835         * UIProcess/API/Cocoa/WKProcessPool.mm:
836         (-[WKProcessPool _preconnectToServer:]):
837         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
838         * UIProcess/WebProcessPool.cpp:
839         (WebKit::WebProcessPool::preconnectToServer):
840         * UIProcess/WebProcessPool.h:
841         * WebKit.xcodeproj/project.pbxproj:
842         * WebProcess/Network/NetworkProcessConnection.cpp:
843         (WebKit::NetworkProcessConnection::didFinishPreconnection):
844         * WebProcess/Network/NetworkProcessConnection.h:
845         * WebProcess/Network/NetworkProcessConnection.messages.in:
846         * WebProcess/Network/WebLoaderStrategy.cpp:
847         (WebKit::WebLoaderStrategy::networkProcessCrashed):
848         (WebKit::generateLoadIdentifier):
849         (WebKit::WebLoaderStrategy::startPingLoad):
850         (WebKit::WebLoaderStrategy::preconnectTo):
851         (WebKit::WebLoaderStrategy::didFinishPreconnection):
852         * WebProcess/Network/WebLoaderStrategy.h:
853         * WebProcess/WebPage/WebPage.cpp:
854         (WebKit::WebPage::updatePreferences):
855         * config.h:
856
857 2017-09-28  Zan Dobersek  <zdobersek@igalia.com>
858
859         [Cairo] Remove the cairo_glyph_t complexity from GlyphBuffer
860         https://bugs.webkit.org/show_bug.cgi?id=177598
861
862         Reviewed by Carlos Garcia Campos.
863
864         * Shared/API/c/cairo/WKImageCairo.cpp: Explicitly include the <cairo.h>
865         header here now that it's not included in GlyphBuffer.h.
866         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp: Ditto.
867
868 2017-09-27  Alex Christensen  <achristensen@webkit.org>
869
870         Add WKContentRuleList notify action type
871         https://bugs.webkit.org/show_bug.cgi?id=177013
872         <rdar://problem/31073936>
873
874         Reviewed by Darin Adler.
875
876         * NetworkProcess/PingLoad.cpp:
877         (WebKit::PingLoad::processContentExtensionRulesForLoad):
878         * UIProcess/API/APINavigationClient.h:
879         (API::NavigationClient::contentRuleListNotification):
880         * UIProcess/API/C/WKPage.cpp:
881         (WKPageSetPageNavigationClient):
882         * UIProcess/API/C/WKPageNavigationClient.h:
883         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
884         * UIProcess/Cocoa/NavigationState.h:
885         * UIProcess/Cocoa/NavigationState.mm:
886         (WebKit::NavigationState::setNavigationDelegate):
887         (WebKit::NavigationState::NavigationClient::contentRuleListNotification):
888         * UIProcess/WebPageProxy.cpp:
889         (WebKit::WebPageProxy::contentRuleListNotification):
890         * UIProcess/WebPageProxy.h:
891         * UIProcess/WebPageProxy.messages.in:
892         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
893         (WebKit::WebChromeClient::contentRuleListNotification):
894         * WebProcess/WebCoreSupport/WebChromeClient.h:
895
896 2017-09-27  Wenson Hsieh  <wenson_hsieh@apple.com>
897
898         Drag event DataTransfer has unexpected types "dyn.ah62d4..."
899         https://bugs.webkit.org/show_bug.cgi?id=172526
900         <rdar://problem/32396081>
901
902         Reviewed by Ryosuke Niwa.
903
904         Add boilerplate plumbing and encoder/decoder support for new pasteboard codepaths. See WebCore ChangeLog for
905         more details.
906
907         * Scripts/webkit/messages.py:
908         (headers_for_type):
909         * Shared/WebCoreArgumentCoders.cpp:
910         (IPC::ArgumentCoder<PasteboardCustomData>::encode):
911         (IPC::ArgumentCoder<PasteboardCustomData>::decode):
912
913         Add encoder/decoder support for PasteboardCustomData.
914
915         (IPC::ArgumentCoder<PasteboardWebContent>::encode):
916         (IPC::ArgumentCoder<PasteboardWebContent>::decode):
917
918         Encode and decode dataInHTMLFormat.
919
920         * Shared/WebCoreArgumentCoders.h:
921         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
922         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
923         (WebKit::WebPasteboardProxy::writeCustomData):
924         * UIProcess/WebPasteboardProxy.cpp:
925         (WebKit::WebPasteboardProxy::typesSafeForDOMToReadAndWrite):
926         (WebKit::WebPasteboardProxy::writeCustomData):
927         * UIProcess/WebPasteboardProxy.h:
928         * UIProcess/WebPasteboardProxy.messages.in:
929         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
930         (WebKit::WebPlatformStrategies::typesSafeForDOMToReadAndWrite):
931         (WebKit::WebPlatformStrategies::writeCustomData):
932         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
933
934 2017-09-27  Alex Christensen  <achristensen@webkit.org>
935
936         Allow modern decoding of std::optional<T>
937         https://bugs.webkit.org/show_bug.cgi?id=177519
938
939         Reviewed by Tim Horton.
940
941         * Platform/IPC/ArgumentCoders.h:
942         (IPC::ArgumentCoder<std::optional<T>>::decode):
943         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
944         (IPC::ArgumentCoder<WebCore::PaymentAuthorizationResult>::decode):
945         (IPC::ArgumentCoder<WebCore::PaymentError>::decode):
946         (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):
947         (IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::decode):
948         (IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::decode):
949         * Shared/WebCoreArgumentCoders.cpp:
950         (IPC::ArgumentCoder<IntPoint>::decode):
951         (IPC::ArgumentCoder<IntSize>::decode):
952         * Shared/WebCoreArgumentCoders.h:
953         * Shared/WebPageCreationParameters.cpp:
954         (WebKit::WebPageCreationParameters::decode):
955
956 2017-09-27  Commit Queue  <commit-queue@webkit.org>
957
958         Unreviewed, rolling out r222541.
959         https://bugs.webkit.org/show_bug.cgi?id=177580
960
961         WebCore isn't ready for the asynchronousness this was going to
962         enable (Requested by alexchristensen on #webkit).
963
964         Reverted changeset:
965
966         "Pass a completion handler instead of a
967         WebFramePolicyListenerProxy during policy decisions"
968         https://bugs.webkit.org/show_bug.cgi?id=177509
969         http://trac.webkit.org/changeset/222541
970
971 2017-09-27  Tina Liu  <iting_liu@apple.com>
972
973         Expose setShouldSuppressFirstResponderChanges() as WKView SPI
974         https://bugs.webkit.org/show_bug.cgi?id=177513
975         <rdar://problem/34669220>
976
977         Reviewed by Wenson Hsieh.
978
979         We already have setShouldSuppressFirstResponderChanges() SPI on WKWebView; Expose it on
980         WKView as well for clients using legacy WebKit.
981
982         * UIProcess/API/Cocoa/WKViewPrivate.h:
983         * UIProcess/API/mac/WKView.mm:
984         (-[WKView _setShouldSuppressFirstResponderChanges:]):
985
986 2017-09-27  Chris Dumez  <cdumez@apple.com>
987
988         Have PingLoad take a CompletionHandler
989         https://bugs.webkit.org/show_bug.cgi?id=177549
990
991         Reviewed by Youenn Fablet.
992
993         Have PingLoad take a CompletionHandler instead of relying on it calling on method on the
994         NetworkConnectionToWebProcess when it is done.
995
996         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
997         (WebKit::NetworkConnectionToWebProcess::loadPing):
998         * NetworkProcess/PingLoad.cpp:
999         (WebKit::PingLoad::PingLoad):
1000         (WebKit::PingLoad::didFinish):
1001         * NetworkProcess/PingLoad.h:
1002
1003 2017-09-26  Alex Christensen  <achristensen@webkit.org>
1004
1005         Pass a completion handler instead of a WebFramePolicyListenerProxy during policy decisions
1006         https://bugs.webkit.org/show_bug.cgi?id=177509
1007
1008         Reviewed by Tim Horton.
1009
1010         This makes WebFramePolicyListenerProxy just a wrapper around a WTF::Function which is only needed for the C and glib APIs.
1011         This is a step towards making WebPageProxy::DecidePolicyForResponseSync and WebPageProxy::DecidePolicyForNavigationAction asynchronous.
1012
1013         This patch has no change in behavior.
1014
1015         * CMakeLists.txt:
1016         * UIProcess/API/APINavigationClient.h:
1017         (API::NavigationClient::decidePolicyForNavigationAction):
1018         (API::NavigationClient::decidePolicyForNavigationResponse):
1019         * UIProcess/API/APIPolicyClient.h:
1020         (API::PolicyClient::decidePolicyForNavigationAction):
1021         (API::PolicyClient::decidePolicyForNewWindowAction):
1022         (API::PolicyClient::decidePolicyForResponse):
1023         * UIProcess/API/C/WKFramePolicyListener.cpp:
1024         (WKFramePolicyListenerUseWithPolicies):
1025         * UIProcess/API/C/WKPage.cpp:
1026         (WKPageSetPagePolicyClient):
1027         (WKPageSetPageNavigationClient):
1028         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
1029         * UIProcess/API/glib/WebKitPolicyClient.cpp:
1030         * UIProcess/Automation/WebAutomationSession.cpp:
1031         * UIProcess/Cocoa/NavigationState.h:
1032         * UIProcess/Cocoa/NavigationState.mm:
1033         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1034         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
1035         * UIProcess/Cocoa/WebViewImpl.mm:
1036         * UIProcess/RemoteWebInspectorProxy.cpp:
1037         * UIProcess/WebFormSubmissionListenerProxy.h:
1038         * UIProcess/WebFrameListenerProxy.cpp: Removed.
1039         * UIProcess/WebFrameListenerProxy.h: Removed.
1040         * UIProcess/WebFramePolicyListenerProxy.cpp:
1041         (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
1042         (WebKit::WebFramePolicyListenerProxy::~WebFramePolicyListenerProxy):
1043         (WebKit::WebFramePolicyListenerProxy::create):
1044         (WebKit::WebFramePolicyListenerProxy::use):
1045         (WebKit::WebFramePolicyListenerProxy::download):
1046         (WebKit::WebFramePolicyListenerProxy::ignore):
1047         * UIProcess/WebFramePolicyListenerProxy.h:
1048         (WebKit::WebFramePolicyListenerProxy::create): Deleted.
1049         (): Deleted.
1050         (WebKit::WebFramePolicyListenerProxy::operator new): Deleted.
1051         * UIProcess/WebFrameProxy.cpp:
1052         (WebKit::WebFrameProxy::webProcessWillShutDown):
1053         (WebKit::WebFrameProxy::receivedPolicyDecision): Deleted.
1054         (WebKit::WebFrameProxy::setUpPolicyListenerProxy): Deleted.
1055         * UIProcess/WebFrameProxy.h:
1056         * UIProcess/WebInspectorProxy.cpp:
1057         * UIProcess/WebPageProxy.cpp:
1058         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1059         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
1060         (WebKit::WebPageProxy::decidePolicyForResponseSync):
1061         (WebKit::WebPageProxy::receivedPolicyDecision): Deleted.
1062         (WebKit::WebPageProxy::decidePolicyForResponse): Deleted.
1063         * UIProcess/WebPageProxy.h:
1064         * UIProcess/mac/ViewGestureControllerMac.mm:
1065         * WebKit.xcodeproj/project.pbxproj:
1066
1067 2017-09-26  Brian Burg  <bburg@apple.com>
1068
1069         Web Automation: overflow:hidden elements with no children are mistakenly reported as not visible
1070         https://bugs.webkit.org/show_bug.cgi?id=177514
1071         <rdar://problem/31936291>
1072
1073         Reviewed by Joseph Pecoraro.
1074
1075         * UIProcess/Automation/atoms/ElementDisplayed.js:
1076         (isShown.isElementSubtreeHiddenByOverflow):
1077         Array.prototype.every returns true when passed an empty list, so we need
1078         to check for the case where the element has no children and return 'false'.
1079
1080 2017-09-26  Youenn Fablet  <youenn@apple.com>
1081
1082         [Cocoa] Add a modern WKPreferences switch to disable WebRTC
1083         https://bugs.webkit.org/show_bug.cgi?id=176638
1084         <rdar://problem/34335158>
1085
1086         Reviewed by Alex Christensen.
1087
1088         * UIProcess/API/Cocoa/WKPreferences.mm:
1089         (-[WKPreferences _peerConnectionEnabled]):
1090         (-[WKPreferences _setPeerConnectionEnabled:]):
1091         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1092
1093 2017-09-26  Brent Fulgham  <bfulgham@apple.com>
1094
1095         Harden our access to the vector of URL schemes.
1096         https://bugs.webkit.org/show_bug.cgi?id=177470
1097         <rdar://problem/33881522>
1098
1099         Reviewed by Chris Dumez.
1100
1101         Instead of asserting, use MESSAGE_CHECK so that we actually refuse to access an invalid iterator.
1102
1103         * UIProcess/WebPageProxy.cpp:
1104         (WebKit::WebPageProxy::startURLSchemeTask):
1105         (WebKit::WebPageProxy::stopURLSchemeTask):
1106
1107 2017-09-26  Jer Noble  <jer.noble@apple.com>
1108
1109         Thrown ObjC exception when right clicking on <img> containing mp4 link
1110         https://bugs.webkit.org/show_bug.cgi?id=177370
1111
1112         Reviewed by Darin Adler.
1113
1114         Creating a NSImage from mp4 data will fail and return nil; do a nil-check before attempting
1115         to put the results into a NSMutableArray.
1116
1117         * UIProcess/mac/WebContextMenuProxyMac.mm:
1118         (WebKit::WebContextMenuProxyMac::createShareMenuItem):
1119
1120 2017-09-26  Brian Burg  <bburg@apple.com>
1121
1122         Web Automation: add commands to get and set user permissions for pages in an automation session
1123         https://bugs.webkit.org/show_bug.cgi?id=177405
1124         <rdar://problem/34493846>
1125
1126         Reviewed by Joseph Pecoraro.
1127
1128         To test some Web APIs via WebDriver, it needs to be possible to simulate a user accepting or
1129         denying requests for elevated permissions, such as getUserMedia() or geolocation.
1130
1131         This patch adds a generic way for a test to configure the automation session's
1132         simulated user action that will happen every time a specific permission is requested.
1133         A test can set a "session permission", trigger the permission request via Web API,
1134         and then verify that the page behaves correctly when the user accepted or denied the request.
1135
1136         A proposal will follow shortly to expose this functionality via a new REST API endpoint.
1137
1138         * UIProcess/Automation/Automation.json: Add get/set commands.
1139
1140         * UIProcess/Automation/WebAutomationSession.cpp:
1141         (WebKit::WebAutomationSession::getSessionPermissions):
1142         (WebKit::WebAutomationSession::setSessionPermissions):
1143         For now, store the permission value in a member of the session. The getUserMedia
1144         permission only needs a bool, but there is no reason we couldn't use more complicated
1145         values for permissions (i.e., strings, numbers, arrays, objects) someday.
1146
1147         (WebKit::WebAutomationSession::shouldAllowGetUserMediaForPage const):
1148         Expose the specific decision to be taken based on whether the request is allowed or denied.
1149
1150         * UIProcess/Automation/WebAutomationSession.h:
1151         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1152         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
1153         If the page is under automation, then simulate the user action according to the
1154         current values of permissions set for the session.
1155
1156 2017-09-25  Alex Christensen  <achristensen@webkit.org>
1157
1158         Make PolicyAction an encodable enum class
1159         https://bugs.webkit.org/show_bug.cgi?id=177480
1160
1161         Reviewed by Antti Koivisto.
1162
1163         * NetworkProcess/Downloads/DownloadManager.cpp:
1164         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
1165         (WebKit::DownloadManager::cancelDownload):
1166         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
1167         (WebKit::NetworkCORSPreflightChecker::didReceiveResponseNetworkSession):
1168         * NetworkProcess/NetworkDataTask.cpp:
1169         (WebKit::NetworkDataTask::didReceiveResponse):
1170         * NetworkProcess/NetworkDataTaskBlob.cpp:
1171         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
1172         * NetworkProcess/NetworkLoad.cpp:
1173         (WebKit::NetworkLoad::~NetworkLoad):
1174         (WebKit::NetworkLoad::continueDidReceiveResponse):
1175         (WebKit::NetworkLoad::notifyDidReceiveResponse):
1176         * NetworkProcess/PingLoad.cpp:
1177         (WebKit::PingLoad::didReceiveResponseNetworkSession):
1178         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
1179         (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):
1180         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1181         (toNSURLSessionResponseDisposition):
1182         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1183         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
1184         * Scripts/webkit/messages.py:
1185         (headers_for_type):
1186         * UIProcess/WebFormSubmissionListenerProxy.h:
1187         * UIProcess/WebFrameListenerProxy.h:
1188         (WebKit::WebFrameListenerProxy::navigation): Deleted.
1189         * UIProcess/WebFramePolicyListenerProxy.cpp:
1190         (WebKit::WebFramePolicyListenerProxy::use):
1191         (WebKit::WebFramePolicyListenerProxy::download):
1192         (WebKit::WebFramePolicyListenerProxy::ignore):
1193         * UIProcess/WebPageProxy.cpp:
1194         (WebKit::WebPageProxy::receivedPolicyDecision):
1195         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1196         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1197         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1198         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
1199         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1200         * WebProcess/WebPage/WebFrame.cpp:
1201         (WebKit::WebFrame::invalidatePolicyListener):
1202         * WebProcess/WebPage/WebPage.cpp:
1203         (WebKit::WebPage::didReceivePolicyDecision):
1204         * WebProcess/WebPage/WebPage.h:
1205         * WebProcess/WebPage/WebPage.messages.in:
1206
1207 2017-09-25  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
1208
1209         [WinCairo] Share default value of font family preferences among non-cocoa builds
1210         https://bugs.webkit.org/show_bug.cgi?id=177479
1211
1212         Reviewed by Yusuke Suzuki.
1213
1214         * Shared/WebPreferencesDefinitions.h:
1215
1216 2017-09-25  Frederik Riedel  <riedel@apple.com>
1217
1218         Expose way to set values of classified form controls as {Legacy WebKit, WebKit} SPI
1219         https://bugs.webkit.org/show_bug.cgi?id=174394
1220         <rdar://problem/33183504>
1221
1222         Reviewed by Ryosuke Niwa.
1223
1224         * Platform/spi/ios/UIKitSPI.h:
1225         * Shared/AssistedNodeInformation.cpp:
1226         (WebKit::AssistedNodeInformation::encode const):
1227         Encodes additional node information, including if the node is part of a login screen.
1228         (WebKit::AssistedNodeInformation::decode):
1229         Decodes the additional assisted node information.
1230         * Shared/AssistedNodeInformation.h:
1231         * UIProcess/WebPageProxy.h:
1232         * UIProcess/ios/WKContentView.mm:
1233         (-[WKContentView acceptsAutofilledLoginCredentials]):
1234         Determines if the WKContentView shows a login screen.
1235         (-[WKContentView representingPageUrl]):
1236         Returns the URL of the currently displayed web page.
1237         * UIProcess/ios/WKContentViewInteraction.mm:
1238         (-[WKContentView insertTextSuggestion:]):
1239         Inserts the login credentials into the Web View.
1240         * UIProcess/ios/WebPageProxyIOS.mm:
1241         (WebKit::WebPageProxy::startAssistingNode):
1242         Transfer the additional assistednode information (acceptsAutofilledLoginCredentials and representingPageUrl).
1243         (WebKit::WebPageProxy::acceptsAutofilledLoginCredentials):
1244         Returns if the Web View shows a login screen.
1245         (WebKit::WebPageProxy::representingPageUrl):
1246         Returns the Web View's URL.
1247         (WebKit::WebPageProxy::autofillLoginCredentials):
1248         Insert the credentials into the Web View.
1249         * WebProcess/WebPage/WebPage.h:
1250         * WebProcess/WebPage/WebPage.messages.in:
1251         * WebProcess/WebPage/ios/WebPageIOS.mm:
1252         (WebKit::WebPage::getAssistedNodeInformation): Transports the information if the currently
1253         highlighted node accepts autofilled login credentials.
1254         (WebKit::WebPage::autofillLoginCredentials): Fills the login credentials into the
1255         WebPage.
1256
1257 2017-09-25  Youenn Fablet  <youenn@apple.com>
1258
1259         WebRTC video does not resume receiving when switching back to Safari 11 on iOS
1260         https://bugs.webkit.org/show_bug.cgi?id=175472
1261         <rdar://problem/33860863>
1262
1263         Reviewed by Darin Adler.
1264
1265         Notifying LibWebRTC of backgrounding/foregrouding.
1266
1267         * WebProcess/WebPage/ios/WebPageIOS.mm:
1268         (WebKit::WebPage::applicationDidEnterBackground):
1269         (WebKit::WebPage::applicationWillEnterForeground):
1270
1271 2017-09-25  Sam Weinig  <sam@webkit.org>
1272
1273         Remove unused EditorClient functions
1274         https://bugs.webkit.org/show_bug.cgi?id=177463
1275
1276         Reviewed by Alex Christensen.
1277
1278         Remove unused EditorClient functions.
1279
1280         * WebProcess/WebCoreSupport/WebEditorClient.h:
1281         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
1282         (WebKit::WebEditorClient::canonicalizeURL): Deleted.
1283         (WebKit::WebEditorClient::canonicalizeURLString): Deleted.
1284         (WebKit::WebEditorClient::writeDataToPasteboard): Deleted.
1285         (WebKit::WebEditorClient::supportedPasteboardTypesForCurrentSelection): Deleted.
1286         (WebKit::WebEditorClient::readDataFromPasteboard): Deleted.
1287         (WebKit::WebEditorClient::pasteboardChangeCount): Deleted.
1288         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
1289         (WebKit::WebEditorClient::canonicalizeURL): Deleted.
1290         (WebKit::WebEditorClient::canonicalizeURLString): Deleted.
1291
1292 2017-09-25  Alex Christensen  <achristensen@webkit.org>
1293
1294         Make Attribute an enum class
1295         https://bugs.webkit.org/show_bug.cgi?id=177414
1296
1297         Reviewed by Yusuke Suzuki.
1298
1299         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
1300         (WebKit::JSNPObject::getOwnPropertySlot):
1301
1302 2017-09-25  Alex Christensen  <achristensen@webkit.org>
1303
1304         Stop using PolicyCallback
1305         https://bugs.webkit.org/show_bug.cgi?id=176088
1306
1307         Reviewed by Andy Estes.
1308
1309         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1310         * WebProcess/WebPage/WebFrame.cpp:
1311         (WebKit::WebFrame::invalidatePolicyListener):
1312         * WebProcess/WebPage/WebFrame.h:
1313         * WebProcess/WebPage/WebInspector.cpp:
1314
1315 2017-09-25  Chris Dumez  <cdumez@apple.com>
1316
1317         [WK2] Add API to query if a download was user-initiated
1318         https://bugs.webkit.org/show_bug.cgi?id=177435
1319         <rdar://problem/34498422>
1320
1321         Reviewed by Alex Christensen.
1322
1323         Add C and Cocoa private API to query if a download was user-initiated.
1324
1325         For clarity, we now construct navigation object for subframe loads
1326         as well (we used to do so only for main frame loads). This allows us
1327         to store the user-intiated flag and the redirect chain on the navigation
1328         object instead of the WebFrameProxy.
1329
1330         * UIProcess/API/APINavigation.cpp:
1331         (API::Navigation::Navigation):
1332         (API::Navigation::appendRedirectionURL):
1333         * UIProcess/API/APINavigation.h:
1334         (API::Navigation::takeRedirectChain):
1335         (API::Navigation::setWasUserInitiated):
1336         (API::Navigation::wasUserInitiated const):
1337         * UIProcess/API/C/WKDownload.cpp:
1338         (WKDownloadGetWasUserInitiated):
1339         * UIProcess/API/C/WKDownload.h:
1340         * UIProcess/API/Cocoa/_WKDownload.h:
1341         * UIProcess/API/Cocoa/_WKDownload.mm:
1342         (-[_WKDownload wasUserInitiated]):
1343         * UIProcess/Downloads/DownloadProxy.h:
1344         (WebKit::DownloadProxy::setWasUserInitiated):
1345         (WebKit::DownloadProxy::wasUserInitiated const):
1346         * UIProcess/WebFrameProxy.cpp:
1347         (WebKit::WebFrameProxy::didStartProvisionalLoad):
1348         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad):
1349         (WebKit::WebFrameProxy::didFailProvisionalLoad):
1350         (WebKit::WebFrameProxy::didFinishLoad):
1351         (WebKit::WebFrameProxy::didFailLoad):
1352         * UIProcess/WebFrameProxy.h:
1353         (WebKit::WebFrameProxy::title const):
1354         * UIProcess/WebPageProxy.cpp:
1355         (WebKit::WebPageProxy::receivedPolicyDecision):
1356         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
1357         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1358         (WebKit::WebPageProxy::decidePolicyForResponse):
1359         (WebKit::WebPageProxy::decidePolicyForResponseSync):
1360         * UIProcess/WebPageProxy.h:
1361         * UIProcess/WebPageProxy.messages.in:
1362         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1363         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1364
1365 2017-09-25  Chris Dumez  <cdumez@apple.com>
1366
1367         Make StoredCredentials an enum class and rename its header
1368         https://bugs.webkit.org/show_bug.cgi?id=177455
1369
1370         Reviewed by Youenn Fablet.
1371
1372         Make StoredCredentials an enum class and rename its header for clarity. This was error-prone because 0 meant
1373         "allow" and and 1 meant "do not allow". It was trivial to convert it to a boolean by mistake and get the
1374         opposite behavior.
1375
1376         * NetworkProcess/Downloads/DownloadManager.cpp:
1377         (WebKit::DownloadManager::startDownload):
1378         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
1379         (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
1380         * NetworkProcess/NetworkCORSPreflightChecker.h:
1381         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1382         (WebKit::NetworkConnectionToWebProcess::loadPing):
1383         * NetworkProcess/NetworkDataTask.cpp:
1384         (WebKit::NetworkDataTask::create):
1385         (WebKit::NetworkDataTask::NetworkDataTask):
1386         * NetworkProcess/NetworkDataTask.h:
1387         * NetworkProcess/NetworkDataTaskBlob.cpp:
1388         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
1389         * NetworkProcess/NetworkLoad.cpp:
1390         (WebKit::NetworkLoad::shouldUseCredentialStorage):
1391         * NetworkProcess/NetworkLoadParameters.h:
1392         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1393         (WebKit::NetworkResourceLoadParameters::encode const):
1394         (WebKit::NetworkResourceLoadParameters::decode):
1395         * NetworkProcess/PingLoad.cpp:
1396         (WebKit::PingLoad::willPerformHTTPRedirection):
1397         (WebKit::PingLoad::makeCrossOriginAccessRequest):
1398         (WebKit::PingLoad::makeSimpleCrossOriginAccessRequest):
1399         (WebKit::PingLoad::makeCrossOriginAccessRequestWithPreflight):
1400         (WebKit::PingLoad::preflightSuccess):
1401         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1402         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
1403         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
1404         (WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay):
1405         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
1406         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1407         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
1408         (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
1409         (WebKit::NetworkDataTaskCocoa::tryPasswordBasedAuthentication):
1410         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1411         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1412         (-[WKNetworkSessionDelegate existingTask:]):
1413         (WebKit::NetworkSessionCocoa::dataTaskForIdentifier):
1414         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1415         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
1416         (WebKit::NetworkDataTaskSoup::createRequest):
1417         (WebKit::NetworkDataTaskSoup::authenticate):
1418         (WebKit::NetworkDataTaskSoup::continueAuthenticate):
1419         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
1420         * NetworkProcess/soup/NetworkDataTaskSoup.h:
1421         * WebProcess/Network/WebLoaderStrategy.cpp:
1422         (WebKit::WebLoaderStrategy::scheduleLoad):
1423         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
1424         (WebKit::WebLoaderStrategy::startPingLoad):
1425         * WebProcess/Network/WebLoaderStrategy.h:
1426
1427 2017-09-25  Sam Weinig  <sam@webkit.org>
1428
1429         Remove unnecessary userVisibleString EditorClient function
1430         https://bugs.webkit.org/show_bug.cgi?id=177456
1431
1432         Reviewed by Dan Bernstein.
1433
1434         * WebProcess/WebCoreSupport/WebEditorClient.h:
1435         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
1436         (WebKit::WebEditorClient::userVisibleString): Deleted.
1437         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
1438         (WebKit::WebEditorClient::userVisibleString): Deleted.
1439
1440             Remove userVisibleString client function.
1441
1442 2017-09-25  Commit Queue  <commit-queue@webkit.org>
1443
1444         Unreviewed, rolling out r222455.
1445         https://bugs.webkit.org/show_bug.cgi?id=177460
1446
1447         broke iOS build (Requested by alexchristensen on #webkit).
1448
1449         Reverted changeset:
1450
1451         "Add WKContentRuleList notify action type"
1452         https://bugs.webkit.org/show_bug.cgi?id=177013
1453         http://trac.webkit.org/changeset/222455
1454
1455 2017-09-25  Alex Christensen  <achristensen@webkit.org>
1456
1457         Separate form submission from PolicyChecker infrastructure
1458         https://bugs.webkit.org/show_bug.cgi?id=177396
1459
1460         Reviewed by Geoffrey Garen.
1461
1462         * UIProcess/API/APIFormClient.h:
1463         (API::FormClient::willSubmitForm):
1464         * UIProcess/API/Cocoa/WKWebView.mm:
1465         (-[WKWebView _setInputDelegate:]):
1466         * UIProcess/WebFormClient.cpp:
1467         (WebKit::WebFormClient::willSubmitForm):
1468         * UIProcess/WebFormClient.h:
1469         * UIProcess/WebFormSubmissionListenerProxy.cpp:
1470         (WebKit::WebFormSubmissionListenerProxy::continueSubmission):
1471         (WebKit::WebFormSubmissionListenerProxy::WebFormSubmissionListenerProxy): Deleted.
1472         * UIProcess/WebFormSubmissionListenerProxy.h:
1473         (WebKit::WebFormSubmissionListenerProxy::create):
1474         (WebKit::WebFormSubmissionListenerProxy::WebFormSubmissionListenerProxy):
1475         (): Deleted.
1476         (WebKit::WebFormSubmissionListenerProxy::operator new): Deleted.
1477         * UIProcess/WebFrameProxy.cpp:
1478         (WebKit::WebFrameProxy::setUpFormSubmissionListenerProxy): Deleted.
1479         * UIProcess/WebFrameProxy.h:
1480         * UIProcess/WebPageProxy.cpp:
1481         (WebKit::WebPageProxy::willSubmitForm):
1482         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1483         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
1484         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
1485         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1486         * WebProcess/WebPage/WebFrame.cpp:
1487         (WebKit::WebFrame::setUpWillSubmitFormListener):
1488         (WebKit::WebFrame::continueWillSubmitForm):
1489         * WebProcess/WebPage/WebFrame.h:
1490         * WebProcess/WebPage/WebPage.cpp:
1491         (WebKit::WebPage::continueWillSubmitForm):
1492         * WebProcess/WebPage/WebPage.h:
1493         * WebProcess/WebPage/WebPage.messages.in:
1494
1495 2017-09-25  Alex Christensen  <achristensen@webkit.org>
1496
1497         Add WKContentRuleList notify action type
1498         https://bugs.webkit.org/show_bug.cgi?id=177013
1499         <rdar://problem/31073936>
1500
1501         Reviewed by Darin Adler.
1502
1503         * NetworkProcess/PingLoad.cpp:
1504         (WebKit::PingLoad::processContentExtensionRulesForLoad):
1505         * UIProcess/API/APINavigationClient.h:
1506         (API::NavigationClient::contentRuleListNotification):
1507         * UIProcess/API/C/WKPage.cpp:
1508         (WKPageSetPageNavigationClient):
1509         * UIProcess/API/C/WKPageNavigationClient.h:
1510         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
1511         * UIProcess/Cocoa/NavigationState.h:
1512         * UIProcess/Cocoa/NavigationState.mm:
1513         (WebKit::NavigationState::setNavigationDelegate):
1514         (WebKit::NavigationState::NavigationClient::contentRuleListNotification):
1515         * UIProcess/WebPageProxy.cpp:
1516         (WebKit::WebPageProxy::contentRuleListNotification):
1517         * UIProcess/WebPageProxy.h:
1518         * UIProcess/WebPageProxy.messages.in:
1519         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1520         (WebKit::WebChromeClient::contentRuleListNotification):
1521         * WebProcess/WebCoreSupport/WebChromeClient.h:
1522
1523 2017-09-25  Timothy Horton  <timothy_horton@apple.com>
1524
1525         Make progress on getting Mac CMake building again
1526         https://bugs.webkit.org/show_bug.cgi?id=177443
1527
1528         Unreviewed, just "fixing" the build.
1529
1530         * PlatformMac.cmake:
1531         Add some missing files and include paths.
1532
1533 2017-09-24  Michael Catanzaro  <mcatanzaro@igalia.com>
1534
1535         Viewport fit is no longer experimental
1536         https://bugs.webkit.org/show_bug.cgi?id=177417
1537
1538         Reviewed by Darin Adler.
1539
1540         * Shared/WebPreferencesDefinitions.h:
1541
1542 2017-09-24  Michael Catanzaro  <mcatanzaro@igalia.com>
1543
1544         [GTK] Unreviewed, move webkit_hit_test_result_context_is_scrollbar in documentation
1545
1546         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1547
1548 2017-09-24  Michael Catanzaro  <mcatanzaro@igalia.com>
1549
1550         Alphabetize experimental features list
1551         https://bugs.webkit.org/show_bug.cgi?id=177374
1552
1553         Reviewed by Darin Adler.
1554
1555         * Shared/WebPreferencesDefinitions.h:
1556
1557 2017-09-24  Zan Dobersek  <zdobersek@igalia.com>
1558
1559         [WebKit] Changing EME setting through InjectedBundle should update WebPreferencesStore
1560         https://bugs.webkit.org/show_bug.cgi?id=177312
1561
1562         Reviewed by Carlos Garcia Campos.
1563
1564         When enabling EME through the InjectedBundle for testing purposes, it's
1565         only enabled in RuntimeEnabledFeatures, but not in WebPreferencesStore.
1566         This causes failures on imported W3C tests that cover EME persistent
1567         state licenses and perform parts of that test in a new window, where
1568         the original RuntimeEnabledFeatures state doesn't have any effect.
1569
1570         To avoid those failures, when enabling EME feature for testing purposes
1571         through InjectedBundle, the feature should also be enabled in the
1572         WebPreferencesStore.
1573
1574         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1575         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1576
1577 2017-09-22  Zalan Bujtas  <zalan@apple.com>
1578
1579         WeakPtrFactory should populate m_ref lazily.
1580         https://bugs.webkit.org/show_bug.cgi?id=177375
1581
1582         Reviewed by Geoffrey Garen.
1583
1584         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
1585         (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy):
1586         (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard):
1587         (WebKit::WebPaymentCoordinatorProxy::openPaymentSetup):
1588         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
1589         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
1590         * UIProcess/ApplicationStateTracker.mm:
1591         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
1592         * UIProcess/Cocoa/WebViewImpl.h:
1593         (WebKit::WebViewImpl::createWeakPtr):
1594         * UIProcess/Cocoa/WebViewImpl.mm:
1595         (WebKit::WebViewImpl::WebViewImpl):
1596         * UIProcess/Launcher/ProcessLauncher.cpp:
1597         (WebKit::ProcessLauncher::ProcessLauncher):
1598         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1599         (WebKit::ProcessLauncher::launchProcess):
1600         * UIProcess/ProcessAssertion.h:
1601         (WebKit::ProcessAssertion::createWeakPtr):
1602         * UIProcess/WebPageProxy.cpp:
1603         (WebKit::m_configurationPreferenceValues):
1604         (WebKit::m_weakPtrFactory): Deleted.
1605         * UIProcess/WebPageProxy.h:
1606         (WebKit::WebPageProxy::createWeakPtr const):
1607         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
1608         (WebKit::RemoteLayerTreeDrawingArea::createWeakPtr):
1609         * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
1610         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
1611
1612 2017-09-22  John Wilander  <wilander@apple.com>
1613
1614         Re-enable configuration.HTTPCookieStorage on session without credentials
1615         https://bugs.webkit.org/show_bug.cgi?id=177393
1616
1617         This patch rolls back the crucial change to the network session
1618         without credentials that landed in r221632:
1619         <http://trac.webkit.org/changeset/221632>
1620
1621         Reviewed by Brent Fulgham.
1622
1623         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1624         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1625             Commented out the disabled cookie jar and added a FIXME
1626             referring to https://bugs.webkit.org/show_bug.cgi?id=177394.
1627
1628 2017-09-22  Chris Dumez  <cdumez@apple.com>
1629
1630         Enable File and Directory Entries API at runtime
1631         https://bugs.webkit.org/show_bug.cgi?id=176616
1632         <rdar://problem/34330942>
1633
1634         Reviewed by Geoffrey Garen.
1635
1636         Enable File and Directory Entries API at runtime on Mac/WebKit2,
1637         now that DataTransfer.items is enabled there.
1638
1639         * Shared/WebPreferencesDefinitions.h:
1640
1641 2017-09-22  Matt Lewis  <jlewis3@apple.com>
1642
1643         Unreviewed, rolling out r222394.
1644
1645         This broke the Windows Debug Build.
1646
1647         Reverted changeset:
1648
1649         "Remove build-webkit's notion of feature flags having a
1650         default value"
1651         https://bugs.webkit.org/show_bug.cgi?id=177338
1652         http://trac.webkit.org/changeset/222394
1653
1654 2017-09-22  John Wilander  <wilander@apple.com>
1655
1656         Non-prevalent resources should be allowed access to existing cookies in a third-party context
1657         https://bugs.webkit.org/show_bug.cgi?id=177336
1658         <rdar://problem/34578257>
1659
1660         Reviewed by Brent Fulgham.
1661
1662         This patch restructures what is communicated to the network process,
1663         from two vectors - with user interaction and without user interaction -
1664         to three vectors - to partition, to block, to neither partition nor block.
1665         The previous two vectors did not allow proper categorization into which
1666         domains should be partitioned, blocked, or left alone. That was the cause
1667         of the regression where non-prevalent third-party domains erroneously had
1668         their cookies blocked when they should fall back to the old behavior of
1669         access but no new cookies allowed to be set.
1670
1671         * NetworkProcess/NetworkProcess.cpp:
1672         (WebKit::NetworkProcess::updatePrevalentDomainsToPartitionOrBlockCookies):
1673         (WebKit::NetworkProcess::updatePrevalentDomainsWithAndWithoutInteraction): Deleted.
1674         * NetworkProcess/NetworkProcess.h:
1675         * NetworkProcess/NetworkProcess.messages.in:
1676         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1677         (-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
1678         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1679         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1680         (WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
1681         (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
1682         (WebKit::WebResourceLoadStatisticsStore::clearInMemory):
1683         (WebKit::WebResourceLoadStatisticsStore::shouldPartitionCookies const):
1684         (WebKit::WebResourceLoadStatisticsStore::shouldBlockCookies const):
1685         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
1686         (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
1687         (WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains):
1688         (WebKit::WebResourceLoadStatisticsStore::resetCookiePartitioningState):
1689         * UIProcess/WebResourceLoadStatisticsStore.h:
1690         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1691         (WebKit::WebsiteDataStore::updatePrevalentDomainsToPartitionOrBlockCookies):
1692         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
1693         (WebKit::WebsiteDataStore::updatePrevalentDomainsWithAndWithoutInteraction): Deleted.
1694         * UIProcess/WebsiteData/WebsiteDataStore.h:
1695
1696 2017-09-22  Tim Horton <timothy_horton@apple.com> and Michael Catanzaro <mcatanzaro@igalia.com>
1697
1698         Remove build-webkit's notion of feature flags having a default value
1699         https://bugs.webkit.org/show_bug.cgi?id=177338
1700
1701         Reviewed by Alex Christensen.
1702
1703         Use ENABLE_EXPERIMENTAL_FEATURES instead of ENABLE_DEVELOPER_MODE to enable runtime
1704         experimental features.
1705
1706         * Shared/WebPreferencesDefinitions.h:
1707
1708 2017-09-22  Chris Dumez  <cdumez@apple.com>
1709
1710         Use high resolution timestamp for event time
1711         https://bugs.webkit.org/show_bug.cgi?id=154246
1712         <rdar://problem/34333304>
1713
1714         Reviewed by Ryosuke Niwa.
1715
1716         Use WallTime / MonotonicTime instead of double type for clarity.
1717
1718         * Shared/WebCoreArgumentCoders.cpp:
1719         (IPC::ArgumentCoder<WallTime>::encode):
1720         (IPC::ArgumentCoder<WallTime>::decode):
1721         * Shared/WebCoreArgumentCoders.h:
1722         * Shared/WebEvent.cpp:
1723         (WebKit::WebEvent::WebEvent):
1724         * Shared/WebEvent.h:
1725         (WebKit::WebEvent::timestamp const):
1726         (WebKit::WebTouchEvent::WebTouchEvent):
1727         * Shared/WebKeyboardEvent.cpp:
1728         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
1729         * Shared/WebMouseEvent.cpp:
1730         (WebKit::WebMouseEvent::WebMouseEvent):
1731         * Shared/WebTouchEvent.cpp:
1732         (WebKit::WebTouchEvent::WebTouchEvent):
1733         * Shared/WebWheelEvent.cpp:
1734         (WebKit::WebWheelEvent::WebWheelEvent):
1735         * Shared/gtk/WebEventFactory.cpp:
1736         (WebKit::WebEventFactory::createWebMouseEvent):
1737         (WebKit::WebEventFactory::createWebWheelEvent):
1738         (WebKit::WebEventFactory::createWebKeyboardEvent):
1739         (WebKit::WebEventFactory::createWebTouchEvent):
1740         * Shared/ios/NativeWebTouchEventIOS.mm:
1741         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
1742         * Shared/ios/WebIOSEventFactory.mm:
1743         (WebIOSEventFactory::createWebKeyboardEvent):
1744         * Shared/mac/NativeWebGestureEventMac.mm:
1745         (WebKit::NativeWebGestureEvent::NativeWebGestureEvent):
1746         * Shared/mac/WebEventFactory.mm:
1747         (WebKit::WebEventFactory::createWebMouseEvent):
1748         (WebKit::WebEventFactory::createWebWheelEvent):
1749         (WebKit::WebEventFactory::createWebKeyboardEvent):
1750         * Shared/mac/WebGestureEvent.h:
1751         (WebKit::WebGestureEvent::WebGestureEvent):
1752         * Shared/wpe/WebEventFactory.cpp:
1753         (WebKit::WebEventFactory::createWebKeyboardEvent):
1754         (WebKit::WebEventFactory::createWebMouseEvent):
1755         (WebKit::WebEventFactory::createWebWheelEvent):
1756         (WebKit::WebEventFactory::createWebTouchEvent):
1757         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1758         (WKBundlePageSimulateMouseDown):
1759         (WKBundlePageSimulateMouseUp):
1760         (WKBundlePageSimulateMouseMotion):
1761         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1762         (WebKit::PDFPlugin::showContextMenuAtPoint):
1763         * WebProcess/Plugins/PluginView.cpp:
1764         (WebKit::PluginView::createWebEvent const):
1765         * WebProcess/WebPage/WebPage.cpp:
1766         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
1767         (WebKit::WebPage::contextMenuAtPointInWindow):
1768         (WebKit::WebPage::dragEnded):
1769         (WebKit::WebPage::simulateMouseDown):
1770         (WebKit::WebPage::simulateMouseUp):
1771         (WebKit::WebPage::simulateMouseMotion):
1772         * WebProcess/WebPage/WebPage.h:
1773         * WebProcess/WebPage/ios/WebPageIOS.mm:
1774         (WebKit::WebPage::handleSyntheticClick):
1775         (WebKit::WebPage::completeSyntheticClick):
1776         (WebKit::WebPage::requestAdditionalItemsForDragSession):
1777         (WebKit::WebPage::inspectorNodeSearchMovedToPosition):
1778
1779 2017-09-22  Fujii Hironori  <Hironori.Fujii@sony.com>
1780
1781         [GTK] Web Inspector: Can't load three.js
1782         https://bugs.webkit.org/show_bug.cgi?id=177340
1783
1784         Reviewed by Carlos Garcia Campos.
1785
1786         * PlatformGTK.cmake: Add JS files of three.js to InspectorFiles variable.
1787         * PlatformWPE.cmake: Ditto.
1788
1789 2017-09-21  Ryosuke Niwa  <rniwa@webkit.org>
1790
1791         Enable dataTransfer.items on macOS and iOS
1792         https://bugs.webkit.org/show_bug.cgi?id=177335
1793
1794         Reviewed by Sam Weinig.
1795
1796         * Shared/WebPreferencesDefinitions.h:
1797
1798 2017-09-21  Dan Bernstein  <mitz@apple.com>
1799
1800         Try to fix Apple internal builds with the iOS 11.0 SDK.
1801
1802         * Configurations/WebKit.xcconfig: Disable framework header postprocessing for iOS 11.0.
1803
1804 2017-09-21  Chris Dumez  <cdumez@apple.com>
1805
1806         Regression(r222308): new API tests are failing for !NETWORK_SESSION
1807         https://bugs.webkit.org/show_bug.cgi?id=177321
1808
1809         Reviewed by Alex Christensen.
1810
1811         When a load is redirected and then converted into a download, CFNetwork
1812         seems to call [NSURLDownloadDelegate willSendRequest:] on the download
1813         with a non-nil redirectResponse, which was unexpected.
1814
1815         To address the issue, we now ignore the willSendRequest call if the
1816         new request's URL is the same as the redirectResponse one.
1817
1818         * NetworkProcess/Downloads/mac/DownloadMac.mm:
1819         (-[WKDownloadAsDelegate download:willSendRequest:redirectResponse:]):
1820
1821 2017-09-21  Chris Dumez  <cdumez@apple.com>
1822
1823         Unreviewed, drop assertion added in r222308.
1824
1825         The assertion is hit by a couple of tests still but there is no bad effect
1826         to the vector not being empty at this point since we clear it right after.
1827
1828         * UIProcess/WebFrameProxy.cpp:
1829         (WebKit::WebFrameProxy::didStartProvisionalLoad):
1830
1831 2017-09-21  Chris Dumez  <cdumez@apple.com>
1832
1833         [WK2] Add API to get the redirect chain of a WKDownload
1834         https://bugs.webkit.org/show_bug.cgi?id=176628
1835         <rdar://problem/34338279>
1836
1837         Reviewed by Alex Christensen.
1838
1839         Re-enable assertion initially added in r222308 and later disabled in
1840         r222320. The assertion was hit because we failed to clear the redirect
1841         chain in WebFrameProxy::didFailProvisionalLoad().
1842
1843         * UIProcess/WebFrameProxy.cpp:
1844         (WebKit::WebFrameProxy::didStartProvisionalLoad):
1845         (WebKit::WebFrameProxy::didFailProvisionalLoad):
1846
1847 2017-09-21  Alex Christensen  <achristensen@webkit.org>
1848
1849         REGRESSION(r221465) WKWebViews without WebGL delegate callbacks crash when WebGL contexts are created
1850         https://bugs.webkit.org/show_bug.cgi?id=177306
1851         <rdar://problem/34351988>
1852
1853         Reviewed by Chris Dumez.
1854
1855         * UIProcess/Cocoa/NavigationState.mm:
1856         (WebKit::NavigationState::NavigationClient::webGLLoadPolicy const):
1857         (WebKit::NavigationState::NavigationClient::resolveWebGLLoadPolicy const):
1858         I forgot to early return after calling the default completion handler if there's no delegate selector.
1859
1860 2017-09-21  Chris Dumez  <cdumez@apple.com>
1861
1862         Unreviewed, temporarily disable assertion added in r222308 while I investigate.
1863
1864         * UIProcess/WebFrameProxy.cpp:
1865         (WebKit::WebFrameProxy::didStartProvisionalLoad):
1866
1867 2017-09-20  Stephan Szabo  <stephan.szabo@sony.com>
1868
1869         [Win] WTF: Add alias for process id to use in place of direct uses of pid_t
1870         https://bugs.webkit.org/show_bug.cgi?id=177017
1871
1872         Reviewed by Alex Christensen.
1873
1874         * NetworkProcess/NetworkProcessCreationParameters.h:
1875         * Shared/WebProcessCreationParameters.h:
1876         * UIProcess/API/APIProcessPoolConfiguration.h:
1877         * UIProcess/API/C/WKContext.cpp:
1878         (WKContextGetNetworkProcessIdentifier):
1879         (WKContextGetDatabaseProcessIdentifier):
1880         * UIProcess/API/C/WKContextPrivate.h:
1881         * UIProcess/API/C/WKPage.cpp:
1882         (WKPageGetProcessIdentifier):
1883         * UIProcess/API/C/WKPagePrivate.h:
1884         * UIProcess/ChildProcessProxy.h:
1885         (WebKit::ChildProcessProxy::processIdentifier const):
1886         * UIProcess/Launcher/ProcessLauncher.cpp:
1887         (WebKit::ProcessLauncher::didFinishLaunchingProcess):
1888         * UIProcess/Launcher/ProcessLauncher.h:
1889         (WebKit::ProcessLauncher::processIdentifier const):
1890         * UIProcess/ProcessAssertion.cpp:
1891         (WebKit::ProcessAssertion::ProcessAssertion):
1892         (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
1893         * UIProcess/ProcessAssertion.h:
1894         (WebKit::ProcessAssertion::ProcessAssertion):
1895         * UIProcess/ProcessThrottler.cpp:
1896         (WebKit::ProcessThrottler::didConnectToProcess):
1897         * UIProcess/ProcessThrottler.h:
1898         * UIProcess/WebPageProxy.cpp:
1899         (WebKit::WebPageProxy::processIdentifier const):
1900         * UIProcess/WebPageProxy.h:
1901         * UIProcess/WebProcessPool.cpp:
1902         (WebKit::WebProcessPool::networkProcessIdentifier):
1903         (WebKit::WebProcessPool::storageProcessIdentifier):
1904         * UIProcess/WebProcessPool.h:
1905
1906 2017-09-20  Chris Dumez  <cdumez@apple.com>
1907
1908         [WK2] Add API to get the redirect chain of a WKDownload
1909         https://bugs.webkit.org/show_bug.cgi?id=176628
1910         <rdar://problem/34338279>
1911
1912         Reviewed by Alex Christensen.
1913
1914         Add API to get the redirect chain of a WKDwnload. The redirect chain includes redirects
1915         that happened during initial load, before the load was converted into a download.
1916
1917         * UIProcess/API/C/WKDownload.cpp:
1918         (WKDownloadCopyRedirectChain):
1919         * UIProcess/API/C/WKDownload.h:
1920         * UIProcess/API/Cocoa/_WKDownload.h:
1921         * UIProcess/API/Cocoa/_WKDownload.mm:
1922         (-[_WKDownload originatingWebView]):
1923         (-[_WKDownload redirectChain]):
1924         * UIProcess/Downloads/DownloadProxy.cpp:
1925         (WebKit::DownloadProxy::willSendRequest):
1926         * UIProcess/Downloads/DownloadProxy.h:
1927         (WebKit::DownloadProxy::setRedirectChain):
1928         (WebKit::DownloadProxy::redirectChain const):
1929         * UIProcess/WebFrameProxy.cpp:
1930         (WebKit::WebFrameProxy::didStartProvisionalLoad):
1931         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad):
1932         * UIProcess/WebFrameProxy.h:
1933         (WebKit::WebFrameProxy::redirectChain const):
1934         * UIProcess/WebPageProxy.cpp:
1935         (WebKit::WebPageProxy::receivedPolicyDecision):
1936
1937 2017-09-20  Alex Christensen  <achristensen@webkit.org>
1938
1939         Add infrastructure for adding custom headers to requests per website
1940         https://bugs.webkit.org/show_bug.cgi?id=177255
1941
1942         Reviewed by Geoffrey Garen.
1943
1944         * Shared/WebsitePolicies.cpp: Added.
1945         * Shared/WebsitePolicies.h:
1946         (WebKit::WebsitePolicies::encode const):
1947         (WebKit::WebsitePolicies::decode):
1948         * UIProcess/API/APIWebsitePolicies.h:
1949         * UIProcess/API/C/WKWebsitePolicies.cpp:
1950         (WKWebsitePoliciesCopyCustomHeaderFields):
1951         (WKWebsitePoliciesSetCustomHeaderFields):
1952         * UIProcess/API/C/WKWebsitePolicies.h:
1953         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1954         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
1955         (-[_WKWebsitePolicies customHeaderFields]):
1956         (-[_WKWebsitePolicies setCustomHeaderFields:]):
1957         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1958         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1959
1960 2017-09-20  Michael Catanzaro  <mcatanzaro@igalia.com>
1961
1962         REGRESSION(r222194) [WPE] Library and executable output names broken
1963         https://bugs.webkit.org/show_bug.cgi?id=177273
1964
1965         Reviewed by Carlos Alberto Lopez Perez.
1966
1967         Move the WebKit2 output name variables to here from Source/cmake, since this is a better
1968         place and where they are set on all other ports. Update them for the changes in r222194.
1969
1970         * PlatformWPE.cmake:
1971
1972 2017-09-20  Jonathan Bedard  <jbedard@apple.com>
1973
1974         Removed nullable from UIDragItem property
1975         https://bugs.webkit.org/show_bug.cgi?id=176264
1976         <rdar://problem/31144674>
1977
1978         Unreviewed build fix
1979
1980         When a nullable annotation is used in a header file,
1981         the Objective-C compiler forces annotations on the entire
1982         file. Remove an unneeded annotation in UIKitSPI.h so that
1983         we can build in iOS 11.
1984
1985         * Platform/spi/ios/UIKitSPI.h:
1986
1987 2017-09-20  Antti Koivisto  <antti@apple.com>
1988
1989         Remove DOM and styling support for CSS Regions
1990         https://bugs.webkit.org/show_bug.cgi?id=177221
1991
1992         Reviewed by Andreas Kling.
1993
1994         * Configurations/FeatureDefines.xcconfig:
1995
1996 2017-09-19  Simon Fraser  <simon.fraser@apple.com>
1997
1998         Do more math in terms of FloatSizes and FloatPoints
1999         https://bugs.webkit.org/show_bug.cgi?id=177217
2000
2001         Reviewed by Zalan Bujtas.
2002
2003         Add operator/(const FloatSize&, const FloatSize&), GraphicsContext::translate(const FloatPoint&),
2004         FloatRect.scale(FloatSize) and AffineTransform::translate(const FloatSize&)
2005         and use them in lots of places to do math in terms of points and sizes.
2006
2007         * UIProcess/API/Cocoa/WKWebView.mm:
2008         (-[WKWebView _didCommitLayerTree:]):
2009         * UIProcess/ios/DragDropInteractionState.mm:
2010         (WebKit::createTargetedDragPreview):
2011         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
2012         (WebKit::imageForRect):
2013         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
2014         (WebKit::InjectedBundleRangeHandle::renderedImage):
2015         * WebProcess/WebPage/WebPage.cpp:
2016         (WebKit::paintSnapshotAtSize):
2017         (WebKit::WebPage::snapshotNode):
2018
2019 2017-09-19  Simon Fraser  <simon.fraser@apple.com>
2020
2021         tiled-drawing/tiled-backing-in-window.html fails on Retina displays
2022         https://bugs.webkit.org/show_bug.cgi?id=177113
2023
2024         Reviewed by Tim Horton.
2025
2026         Make m_customDeviceScaleFactor a std::optional<> instead of having the weird "0 is unset"
2027         behavior.
2028
2029         * UIProcess/WebPageProxy.cpp:
2030         (WebKit::WebPageProxy::deviceScaleFactor const):
2031         (WebKit::WebPageProxy::setCustomDeviceScaleFactor):
2032         * UIProcess/WebPageProxy.h:
2033
2034 2017-09-19  Alex Christensen  <achristensen@webkit.org>
2035
2036         Allow modern decoding of Vectors
2037         https://bugs.webkit.org/show_bug.cgi?id=177102
2038
2039         Reviewed by Andy Estes.
2040
2041         Rather than allow modern decoding of Vectors of types that only allow legacy decoding,
2042         I just made modern decoders for all types that we need to decode in Vectors.
2043
2044         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2045         (WebKit::NetworkResourceLoadParameters::decode):
2046         * Platform/IPC/ArgumentCoders.cpp:
2047         (IPC::ArgumentCoder<std::chrono::system_clock::time_point>::decode):
2048         * Platform/IPC/ArgumentCoders.h:
2049         * Shared/AssistedNodeInformation.cpp:
2050         (WebKit::OptionItem::decode):
2051         * Shared/AssistedNodeInformation.h:
2052         * Shared/CallbackID.h:
2053         (WebKit::CallbackID::decode):
2054         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2055         (IPC::ArgumentCoder<WebCore::PaymentError>::decode):
2056         (IPC::ArgumentCoder<WebCore::PaymentMethodUpdate>::decode):
2057         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode):
2058         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::decode):
2059         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ShippingMethod>::decode):
2060         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::TotalAndLineItems>::decode):
2061         (IPC::ArgumentCoder<WebCore::ShippingContactUpdate>::decode):
2062         (IPC::ArgumentCoder<WebCore::ShippingMethodUpdate>::decode):
2063         * Shared/Databases/IndexedDB/WebIDBResult.cpp:
2064         (WebKit::WebIDBResult::decode):
2065         * Shared/FrameInfoData.cpp:
2066         (WebKit::FrameInfoData::decode):
2067         * Shared/Gamepad/GamepadData.cpp:
2068         (WebKit::GamepadData::decode):
2069         * Shared/Gamepad/GamepadData.h:
2070         * Shared/PlatformPopupMenuData.cpp:
2071         (WebKit::PlatformPopupMenuData::decode):
2072         * Shared/PlatformPopupMenuData.h:
2073         * Shared/Plugins/NPIdentifierData.cpp:
2074         (WebKit::NPIdentifierData::decode):
2075         * Shared/Plugins/NPIdentifierData.h:
2076         * Shared/Plugins/NPVariantData.cpp:
2077         (WebKit::NPVariantData::decode):
2078         * Shared/Plugins/NPVariantData.h:
2079         * Shared/RTCNetwork.cpp:
2080         (WebKit::RTCNetwork::IPAddress::decode):
2081         (WebKit::RTCNetwork::SocketAddress::decode):
2082         (WebKit::RTCNetwork::decode):
2083         * Shared/RTCNetwork.h:
2084         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
2085         * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
2086         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
2087         (WebKit::RemoteLayerTreeTransaction::decode):
2088         * Shared/SessionState.cpp:
2089         (WebKit::HTTPBody::Element::decode):
2090         (WebKit::FrameState::decode):
2091         (WebKit::PageState::decode):
2092         (WebKit::BackForwardListItemState::decode):
2093         (WebKit::BackForwardListState::decode):
2094         * Shared/SessionState.h:
2095         * Shared/WebCompiledContentRuleListData.cpp:
2096         (WebKit::WebCompiledContentRuleListData::decode):
2097         * Shared/WebCompiledContentRuleListData.h:
2098         * Shared/WebContextMenuItemData.cpp:
2099         (WebKit::WebContextMenuItemData::decode):
2100         * Shared/WebContextMenuItemData.h:
2101         * Shared/WebCoreArgumentCoders.cpp:
2102         (IPC::ArgumentCoder<DOMCacheEngine::CacheInfo>::decode):
2103         (IPC::ArgumentCoder<DOMCacheEngine::Record>::decode):
2104         (IPC::ArgumentCoder<FloatRect>::decode):
2105         (IPC::ArgumentCoder<FloatQuad>::decode):
2106         (IPC::ArgumentCoder<IntRect>::decode):
2107         (IPC::ArgumentCoder<RecentSearch>::decode):
2108         (IPC::ArgumentCoder<Region::Span>::decode):
2109         (IPC::ArgumentCoder<MimeClassInfo>::decode):
2110         (IPC::ArgumentCoder<PluginInfo>::decode):
2111         (IPC::ArgumentCoder<SelectionRect>::decode):
2112         (IPC::ArgumentCoder<CompositionUnderline>::decode):
2113         (IPC::ArgumentCoder<DictationAlternative>::decode):
2114         (IPC::ArgumentCoder<GrammarDetail>::decode):
2115         (IPC::ArgumentCoder<TextCheckingResult>::decode):
2116         (IPC::ArgumentCoder<BlobPart>::decode):
2117         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
2118         (IPC::ArgumentCoder<MediaConstraints>::decode):
2119         (IPC::ArgumentCoder<CaptureDevice>::decode):
2120         (IPC::ArgumentCoder<ScrollOffsetRange<float>>::decode):
2121         (IPC::ArgumentCoder<MediaSelectionOption>::decode):
2122         * Shared/WebCoreArgumentCoders.h:
2123         * Shared/WebEvent.h:
2124         * Shared/WebPageCreationParameters.cpp:
2125         (WebKit::WebPageCreationParameters::decode):
2126         * Shared/WebPlatformTouchPoint.cpp:
2127         (WebKit::WebPlatformTouchPoint::decode):
2128         * Shared/WebPopupItem.cpp:
2129         (WebKit::WebPopupItem::decode):
2130         * Shared/WebPopupItem.h:
2131         * Shared/WebUserContentControllerDataTypes.cpp:
2132         (WebKit::WebUserScriptData::decode):
2133         (WebKit::WebUserStyleSheetData::decode):
2134         (WebKit::WebScriptMessageHandlerData::decode):
2135         * Shared/WebUserContentControllerDataTypes.h:
2136         * Shared/WebsiteData/WebsiteData.cpp:
2137         (WebKit::WebsiteData::Entry::decode):
2138         * Shared/WebsiteData/WebsiteData.h:
2139         * Shared/WebsiteDataStoreParameters.cpp:
2140         (WebKit::WebsiteDataStoreParameters::decode):
2141         * Shared/ios/WebPlatformTouchPointIOS.cpp:
2142         (WebKit::WebPlatformTouchPoint::decode):
2143         * Shared/mac/WebCoreArgumentCodersMac.mm:
2144         (IPC::ArgumentCoder<KeypressCommand>::decode):
2145         * UIProcess/LegacySessionStateCodingNone.cpp:
2146         (WebKit::decodeLegacySessionState):
2147         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h:
2148         * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
2149         (WebKit::PlatformCAAnimationRemote::KeyframeValue::decode):
2150         (WebKit::PlatformCAAnimationRemote::Properties::decode):
2151
2152 2017-09-19  Ryosuke Niwa  <rniwa@webkit.org>
2153
2154         On iOS, getData can't get text set by setData during copy event
2155         https://bugs.webkit.org/show_bug.cgi?id=176980
2156         <rdar://problem/34453915>
2157
2158         Reviewed by Darin Adler.
2159
2160         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2161         (WebKit::WebPlatformStrategies::copy): Deleted.
2162         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2163
2164 2017-09-19  Alex Christensen  <achristensen@webkit.org>
2165
2166         Expose WKPageRef as a private property on WKWebView on Mac
2167         https://bugs.webkit.org/show_bug.cgi?id=177022
2168         <rdar://problem/34342762>
2169
2170         Reviewed by Andy Estes.
2171
2172         * UIProcess/API/Cocoa/WKWebView.mm:
2173         (-[WKWebView _pageRefForTransitionToWKWebView]):
2174         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2175
2176 2017-09-19  Alex Christensen  <achristensen@webkit.org>
2177
2178         Make _WKProcessPoolConfiguration.allowsCellularAccess actually work on iOS
2179         https://bugs.webkit.org/show_bug.cgi?id=177124
2180
2181         Reviewed by Andy Estes.
2182
2183         The boolean added in r213747 was getting lost in two places:
2184         1. The API::ProcessPoolConfiguration gets copied before it's used, so we need to set the bool on the copy.
2185         2. The bool was not getting copied from that ProcessPoolConfiguration to the NetworkProcessCreationParameters
2186         to be sent to the NetworkProcess to be given to the NSURLSessionConfiguration in NetworkSessionCocoa.mm.
2187
2188         These two problems were fixed and verified manually with a customized iOS app on my phone.
2189         Unfortunately, this cannot be tested well with our current test infrastructure.
2190
2191         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2192         (API::ProcessPoolConfiguration::copy):
2193         * UIProcess/WebProcessPool.cpp:
2194         (WebKit::WebProcessPool::ensureNetworkProcess):
2195
2196 2017-09-18  Michael Catanzaro  <mcatanzaro@igalia.com>
2197
2198         [CMake] Rename WebKit target to WebKitLegacy and rename WebKit2 target to WebKit
2199         https://bugs.webkit.org/show_bug.cgi?id=174558
2200
2201         Reviewed by Alex Christensen.
2202
2203         * CMakeLists.txt:
2204         * PlatformGTK.cmake:
2205         * PlatformMac.cmake:
2206         * PlatformWPE.cmake:
2207         * PlatformWin.cmake:
2208         * Shared/gtk/WebKitWaylandProtocol.xml: Renamed from Source/WebKit/Shared/gtk/WebKit2WaylandProtocol.xml.
2209         * UIProcess/gtk/WaylandCompositor.cpp:
2210         * WebProcess/gtk/WaylandCompositorDisplay.cpp:
2211
2212 2017-09-18  Andy Estes  <aestes@apple.com>
2213
2214         [Cocoa] Upstream sandbox-related WebKitSystemInterface functions
2215         https://bugs.webkit.org/show_bug.cgi?id=177047
2216
2217         Reviewed by Daniel Bates.
2218
2219         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2220         (WebKit::NetworkResourceLoadParameters::encode const):
2221         * Platform/spi/mac/QuarantineSPI.h: Added.
2222         * Shared/SandboxExtension.h:
2223         (): Deleted.
2224         * Shared/mac/ChildProcessMac.mm:
2225         (WebKit::enableSandboxStyleFileQuarantine):
2226         (WebKit::ChildProcess::initializeSandbox):
2227         * Shared/mac/SandboxExtensionMac.mm:
2228         (WebKit::SandboxExtensionImpl::create):
2229         (WebKit::SandboxExtensionImpl::SandboxExtensionImpl):
2230         (WebKit::SandboxExtensionImpl::~SandboxExtensionImpl):
2231         (WebKit::SandboxExtensionImpl::consume):
2232         (WebKit::SandboxExtensionImpl::invalidate):
2233         (WebKit::SandboxExtensionImpl::getSerializedFormat):
2234         (WebKit::SandboxExtension::Handle::Handle):
2235         (WebKit::SandboxExtension::Handle::~Handle):
2236         (WebKit::SandboxExtension::Handle::encode const):
2237         (WebKit::SandboxExtension::Handle::decode):
2238         (WebKit::SandboxExtension::createHandleWithoutResolvingPath):
2239         (WebKit::SandboxExtension::createHandleForReadWriteDirectory):
2240         (WebKit::SandboxExtension::createHandleForTemporaryFile):
2241         (WebKit::SandboxExtension::createHandleForGenericExtension):
2242         (WebKit::SandboxExtension::SandboxExtension):
2243         (WebKit::SandboxExtension::~SandboxExtension):
2244         (WebKit::SandboxExtension::revoke):
2245         (WebKit::SandboxExtension::consume):
2246         (WebKit::SandboxExtension::consumePermanently):
2247         (WebKit::wkSandboxExtensionType): Deleted.
2248         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2249         (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded):
2250         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2251         (WebKit::WebProcessPool::platformInitializeWebProcess):
2252         * UIProcess/Downloads/DownloadProxy.cpp:
2253         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
2254         * UIProcess/Network/NetworkProcessProxy.cpp:
2255         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToStorageProcessForBlobs):
2256         * UIProcess/Storage/StorageProcessProxy.cpp:
2257         (WebKit::StorageProcessProxy::getSandboxExtensionsForBlobFiles):
2258         * UIProcess/WebPageProxy.cpp:
2259         (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
2260         (WebKit::WebPageProxy::loadFile):
2261         (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
2262         * UIProcess/WebProcessPool.cpp:
2263         (WebKit::WebProcessPool::createNewWebProcess):
2264         (WebKit::WebProcessPool::processDidFinishLaunching):
2265         (WebKit::WebProcessPool::resumeDownload):
2266         (WebKit::WebProcessPool::startMemorySampler):
2267         * WebKit.xcodeproj/project.pbxproj:
2268         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
2269         (WebKit::BlobRegistryProxy::registerFileBlobURL):
2270
2271 2017-09-18  Andy Estes  <aestes@apple.com>
2272
2273         [Cocoa] Upstream WKSetCrashReportApplicationSpecificInformation() from WebKitSystemInterface
2274         https://bugs.webkit.org/show_bug.cgi?id=177048
2275
2276         Reviewed by Alex Christensen.
2277
2278         * Platform/IPC/mac/ConnectionMac.mm:
2279         (IPC::Connection::sendMessage):
2280         (IPC::readFromMachPort):
2281         * Platform/cocoa/CrashReporter.h: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
2282         * Platform/cocoa/CrashReporter.mm: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
2283         (WebKit::setCrashReportApplicationSpecificInformation):
2284         * Platform/spi/Cocoa/CrashReporterClientSPI.h: Copied from Source/WebKit/Shared/Cocoa/ChildProcessCocoa.mm.
2285         * Shared/Cocoa/ChildProcessCocoa.mm:
2286         (WebKit::ChildProcess::didReceiveInvalidMessage):
2287         * WebKit.xcodeproj/project.pbxproj:
2288         * WebProcess/cocoa/WebProcessCocoa.mm:
2289         (WebKit::_WKSetCrashReportApplicationSpecificInformation):
2290
2291 2017-09-18  Andy Estes  <aestes@apple.com>
2292
2293         [Mac] Upstream miscellaneous WebKitSystemInterface functions
2294         https://bugs.webkit.org/show_bug.cgi?id=177029
2295
2296         Reviewed by Alex Christensen.
2297
2298         * NetworkProcess/mac/NetworkProcessMac.mm:
2299         (WebKit::NetworkProcess::initializeProcessName):
2300         * PluginProcess/mac/PluginProcessMac.mm:
2301         (WebKit::PluginProcess::initializeProcessName):
2302         * StorageProcess/mac/StorageProcessMac.mm:
2303         (WebKit::StorageProcess::initializeProcessName):
2304         * UIProcess/Cocoa/WebViewImpl.mm:
2305         (WebKit::trackingAreaOptions):
2306         (WebKit::WebViewImpl::mightBeginScrollWhileInactive):
2307         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2308         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
2309         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2310         (WebKit::NetscapePlugin::popUpContextMenu):
2311         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2312         (WebKit::PDFPlugin::handleContextMenuEvent):
2313         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2314         (InitWebCoreSystemInterface):
2315         * WebProcess/cocoa/WebProcessCocoa.mm:
2316         (WebKit::WebProcess::initializeProcessName):
2317         (WebKit::WebProcess::updateActivePages):
2318
2319 2017-09-17  Michael Catanzaro  <mcatanzaro@igalia.com>
2320
2321         [WPE][GTK] Merge ProcessLauncher[WPE,GTK]
2322         https://bugs.webkit.org/show_bug.cgi?id=177041
2323
2324         Unreviewed fixup, I broke the size of the argv buffer when experimenting with how to respond
2325         to review comments. Not sure why this didn't blow up everything during testing.
2326
2327         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
2328         (WebKit::ProcessLauncher::launchProcess):
2329
2330 2017-09-17  Michael Catanzaro  <mcatanzaro@igalia.com>
2331
2332         [WPE][GTK] Merge ProcessLauncher[WPE,GTK]
2333         https://bugs.webkit.org/show_bug.cgi?id=177041
2334
2335         Reviewed by Carlos Garcia Campos.
2336
2337         * PlatformGTK.cmake:
2338         * PlatformWPE.cmake:
2339         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: Renamed from Source/WebKit/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp.
2340         (WebKit::childSetupFunction):
2341         (WebKit::ProcessLauncher::launchProcess):
2342         (WebKit::ProcessLauncher::terminateProcess):
2343         (WebKit::ProcessLauncher::platformInvalidate):
2344         * UIProcess/Launcher/wpe/ProcessLauncherWPE.cpp: Removed.
2345
2346 2017-09-16  Tim Horton  <timothy_horton@apple.com>
2347
2348         Fix the Tools build with CMake on macOS
2349         https://bugs.webkit.org/show_bug.cgi?id=177030
2350
2351         Reviewed by Geoffrey Garen.
2352
2353         * PlatformMac.cmake:
2354         Add some WebKitLegacy headers to forward (for use by the tools).
2355
2356 2017-09-15  JF Bastien  <jfbastien@apple.com>
2357
2358         WTF: use Forward.h when appropriate instead of Vector.h
2359         https://bugs.webkit.org/show_bug.cgi?id=176984
2360
2361         Reviewed by Saam Barati.
2362
2363         There's no need to include Vector.h when Forward.h will suffice. All we need is to move the template default parameters from Vector, and then the forward declaration can be used in so many new places: if a header only takes Vector by reference, rvalue reference, pointer, returns any of these, or has them as members then the header doesn't need to see the definition because the declaration will suffice.
2364
2365         * Scripts/webkit/LegacyMessages-expected.h:
2366         * Scripts/webkit/Messages-expected.h:
2367         * Shared/API/APIData.h:
2368         * UIProcess/API/APIContextMenuClient.h:
2369         * UIProcess/API/APIFormClient.h:
2370         * UIProcess/API/APIHTTPCookieStore.h:
2371         * UIProcess/API/APINotificationProvider.h:
2372         * UIProcess/API/glib/WebKitNotificationProvider.h:
2373         * UIProcess/Notifications/WebNotificationProvider.h:
2374         * UIProcess/TextCheckerCompletion.h:
2375         * UIProcess/WebCookieManagerProxy.h:
2376         * UIProcess/WebOpenPanelResultListenerProxy.h:
2377         * UIProcess/WebPasteboardProxy.h:
2378         * UIProcess/WebPopupMenuProxy.h:
2379         * UIProcess/WebTextCheckerClient.h:
2380         * WebProcess/Cookies/WebCookieManager.h:
2381         * WebProcess/Gamepad/WebGamepadProvider.h:
2382         * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
2383         * WebProcess/InjectedBundle/API/APIInjectedBundlePageContextMenuClient.h:
2384         * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h:
2385         * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
2386         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
2387         * WebProcess/Network/webrtc/WebRTCMonitor.h:
2388         * WebProcess/Network/webrtc/WebRTCResolver.h:
2389         * WebProcess/WebPage/DrawingArea.h:
2390         * WebProcess/WebPage/WebOpenPanelResultListener.h:
2391
2392 2017-09-15  Tim Horton  <timothy_horton@apple.com>
2393
2394         Fix the macOS CMake build
2395         https://bugs.webkit.org/show_bug.cgi?id=177015
2396
2397         Reviewed by Andy Estes.
2398
2399         * CMakeLists.txt:
2400         Add the new RemoteLayerTree directories to the header search path.
2401         Add CookieStorageUtilsCF.mm to Sources.
2402
2403         * PlatformMac.cmake:
2404         Add a few more files, and fix the generated forwarding headers include
2405         path to name "WebKit" instead of "WebKit2".
2406
2407 2017-09-15  Youenn Fablet  <youenn@apple.com>
2408
2409         Add an URL method to remove both query string and fragment identifier
2410         https://bugs.webkit.org/show_bug.cgi?id=176911
2411
2412         Reviewed by Alex Christensen.
2413
2414         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
2415         (WebKit::CacheStorage::computeKeyURL):
2416
2417 2017-09-15  Andy Estes  <aestes@apple.com>
2418
2419         [Cocoa] Upstream MediaRemote and VideoToolbox WebKitSystemInterface functions
2420         https://bugs.webkit.org/show_bug.cgi?id=176953
2421
2422         Reviewed by Eric Carlson.
2423
2424         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2425         (InitWebCoreSystemInterface):
2426
2427 2017-09-15  Ryosuke Niwa  <rniwa@webkit.org>
2428
2429         iOS: WebKitTestRunner hits an assertion in editing/pasteboard/datatransfer-items-copy-plaintext.html
2430         https://bugs.webkit.org/show_bug.cgi?id=176968
2431
2432         Reviewed by Wenson Hsieh.
2433
2434         Don't allocate a SharedMemory of size zero (content was empty) as this would result in a crash inside
2435         a WebContent process in release builds and an assertion failure in debug builds.
2436
2437         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2438         (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
2439
2440 2017-09-14  Youenn Fablet  <youenn@apple.com>
2441
2442         Add Cache API support of records persistency
2443         https://bugs.webkit.org/show_bug.cgi?id=176845
2444
2445         Reviewed by Alex Christensen.
2446
2447         Introducing asynchronous opening of Cache objects.
2448         When opening, Cache objects will read the list of records from the disk.
2449         They keep in memory the necessary information to make any match or remove request without reading further information from the disk.
2450         Cache objects thus keep during the opening time a list of callbacks to call when being opened.
2451         Persistent storage is implemented through NetworkCache::Storage.
2452
2453         A Cache object is added a unique name so that records from a Cache cannot be mixed with records from another Cache.
2454         This unique name is stored persistenly in addition to the Cache name.
2455         This unique name is used as the key type given to the storage.
2456
2457         Request, response and responsebody data are no longer kept by the Cache object.
2458         For regular sessions, this information is kept on the disk through NetworkCache::Storage.
2459         Insertion time is also stored persistently so as to keep the ordering of the records consistent.
2460         For private browsing sessions, this information is kept in a map owned by the Caches object.
2461         RecordData is renamed to RecordInformation as it now only contains the information used to handle the different Cache actions.
2462
2463         For every record retrieval action, a ReadRecordTaskCounter is used.
2464         Its purpose is to allow retrieving the record data on the disk in parallel,
2465         and then send back the information when everything is read.
2466         In case some records cannot be correctly read, they are removed automatically at that point.
2467         The current implementation loads all information in memory including response bodies.
2468         Further improvements might consider streaming the response bodies progressively.
2469
2470         For every stored record, an AsynchronousPutTaskCounter is used.
2471         Its purpose is also to wait for all put actions to be completed before executing the completion callback.
2472         In some cases, a record needs to be overriden.
2473         In that case, as per the specification, only the data related to the response is to be modified.
2474         This requires reading the record request data on disk before actually writing the whole record again.
2475         This is implemented in updateRecordToDisk.
2476
2477         The Cache object is delegating all record writing/reading tasks to its Caches object.
2478         The Caches object is responsible to handle persistent/private sessions.
2479
2480         * NetworkProcess/cache/CacheStorageEngine.cpp:
2481         (WebKit::CacheStorage::Engine::retrieveRecords): Making sure Cache object is opened.
2482         (WebKit::CacheStorage::Engine::readCache): Ditto.
2483         (WebKit::CacheStorage::Engine::unlock): Disposing the cache without going through initializing it.
2484         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
2485         (WebKit::CacheStorage::computeKeyURL):
2486         (WebKit::CacheStorage::queryCache):
2487         (WebKit::CacheStorage::updateVaryInformation):
2488         (WebKit::CacheStorage::Cache::toRecordInformation):
2489         (WebKit::CacheStorage::Cache::Cache):
2490         (WebKit::CacheStorage::Cache::open):
2491         (WebKit::CacheStorage::Cache::finishOpening):
2492         (WebKit::CacheStorage::ReadRecordTaskCounter::create):
2493         (WebKit::CacheStorage::ReadRecordTaskCounter::~ReadRecordTaskCounter):
2494         (WebKit::CacheStorage::ReadRecordTaskCounter::appendRecord):
2495         (WebKit::CacheStorage::ReadRecordTaskCounter::ReadRecordTaskCounter):
2496         (WebKit::CacheStorage::Cache::retrieveRecord):
2497         (WebKit::CacheStorage::Cache::retrieveRecords):
2498         (WebKit::CacheStorage::Cache::addRecord):
2499         (WebKit::CacheStorage::Cache::recordsFromURL):
2500         (WebKit::CacheStorage::Cache::recordsFromURL const):
2501         (WebKit::CacheStorage::AsynchronousPutTaskCounter::create):
2502         (WebKit::CacheStorage::AsynchronousPutTaskCounter::~AsynchronousPutTaskCounter):
2503         (WebKit::CacheStorage::AsynchronousPutTaskCounter::onCompletion):
2504         (WebKit::CacheStorage::AsynchronousPutTaskCounter::setError):
2505         (WebKit::CacheStorage::Cache::put):
2506         (WebKit::CacheStorage::Cache::remove):
2507         (WebKit::CacheStorage::Cache::removeFromRecordList):
2508         (WebKit::CacheStorage::Cache::writeRecordToDisk):
2509         (WebKit::CacheStorage::Cache::updateRecordToDisk):
2510         (WebKit::CacheStorage::Cache::readRecordFromDisk):
2511         (WebKit::CacheStorage::Cache::removeRecordFromDisk):
2512         (WebKit::CacheStorage::Cache::encode):
2513         (WebKit::CacheStorage::decodeRecordHeader):
2514         (WebKit::CacheStorage::Cache::decode):
2515         (WebKit::CacheStorage::Cache::keys const):
2516         * NetworkProcess/cache/CacheStorageEngineCache.h:
2517         (WebKit::CacheStorage::Cache::isOpened const):
2518         (WebKit::CacheStorage::Cache::uniqueName const):
2519         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2520         (WebKit::CacheStorage::Caches::initialize):
2521         (WebKit::CacheStorage::Caches::open):
2522         (WebKit::CacheStorage::Caches::remove):
2523         (WebKit::CacheStorage::Caches::dispose):
2524         (WebKit::CacheStorage::encodeCacheNames):
2525         (WebKit::CacheStorage::decodeCachesNames):
2526         (WebKit::CacheStorage::Caches::readCachesFromDisk):
2527         (WebKit::CacheStorage::Caches::readRecordsList):
2528         (WebKit::CacheStorage::Caches::writeRecord):
2529         (WebKit::CacheStorage::Caches::readRecord):
2530         (WebKit::CacheStorage::Caches::removeRecord):
2531         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
2532         (WebKit::CacheStorage::Caches::salt const):
2533         * NetworkProcess/cache/CacheStorageEngineCaches.h:
2534         (WebKit::CacheStorage::Caches::shouldPersist const):
2535         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2536         (WebKit::NetworkCache::Storage::store):
2537         * NetworkProcess/cache/NetworkCacheStorage.h:
2538         (WebKit::NetworkCache::Storage::writeWithoutWaiting):
2539
2540 2017-09-14  Alex Christensen  <achristensen@webkit.org>
2541
2542         Add WKUIDelegatePrivate equivalent of WKPageUIClient's drawHeader, drawFooter, headerHeight, and footerHeight
2543         https://bugs.webkit.org/show_bug.cgi?id=176889
2544         <rdar://problem/29270035>
2545
2546         Reviewed by Andy Estes.
2547
2548         * UIProcess/API/C/WKPage.cpp:
2549         (WKPageLoadAlternateHTMLString):
2550         (WKPageLoadAlternateHTMLStringWithUserData):
2551         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
2552         (-[WKBrowsingContextController loadAlternateHTMLString:baseURL:forUnreachableURL:]):
2553         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2554         * UIProcess/API/Cocoa/WKWebView.mm:
2555         (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]):
2556         * UIProcess/Cocoa/UIDelegate.h:
2557         * UIProcess/Cocoa/UIDelegate.mm:
2558         (WebKit::UIDelegate::setDelegate):
2559         (WebKit::UIDelegate::UIClient::headerHeight):
2560         (WebKit::UIDelegate::UIClient::footerHeight):
2561         (WebKit::UIDelegate::UIClient::drawHeader):
2562         (WebKit::UIDelegate::UIClient::drawFooter):
2563         * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm:
2564         (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]):
2565         * UIProcess/Cocoa/WebViewImpl.mm:
2566         (WebKit::WebViewImpl::printOperationWithPrintInfo):
2567         * UIProcess/FrameLoadState.cpp:
2568         (WebKit::FrameLoadState::didStartProvisionalLoad):
2569         (WebKit::FrameLoadState::didReceiveServerRedirectForProvisionalLoad):
2570         (WebKit::FrameLoadState::didFailProvisionalLoad):
2571         (WebKit::FrameLoadState::didCommitLoad):
2572         (WebKit::FrameLoadState::didSameDocumentNotification):
2573         (WebKit::FrameLoadState::setUnreachableURL):
2574         (WebKit::FrameLoadState::FrameLoadState): Deleted.
2575         * UIProcess/FrameLoadState.h:
2576         (WebKit::FrameLoadState::url const):
2577         (WebKit::FrameLoadState::provisionalURL const):
2578         (WebKit::FrameLoadState::unreachableURL const):
2579         * UIProcess/WebFrameProxy.cpp:
2580         (WebKit::WebFrameProxy::loadURL):
2581         (WebKit::WebFrameProxy::didStartProvisionalLoad):
2582         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad):
2583         (WebKit::WebFrameProxy::didSameDocumentNavigation):
2584         (WebKit::WebFrameProxy::setUnreachableURL):
2585         * UIProcess/WebFrameProxy.h:
2586         (WebKit::WebFrameProxy::url const):
2587         (WebKit::WebFrameProxy::provisionalURL const):
2588         (WebKit::WebFrameProxy::unreachableURL const):
2589         * UIProcess/WebPageProxy.cpp:
2590         (WebKit::WebPageProxy::loadAlternateHTMLString):
2591         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
2592         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
2593         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
2594         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
2595         * UIProcess/WebPageProxy.h:
2596         * UIProcess/WebPageProxy.messages.in:
2597         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2598         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
2599         (WebKit::WebFrameLoaderClient::dispatchDidChangeProvisionalURL):
2600         (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
2601         (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage):
2602         (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage):
2603         (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage):
2604         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
2605         * WebProcess/WebPage/WebPage.cpp:
2606         (WebKit::WebPage::loadURLInFrame):
2607         * WebProcess/WebPage/WebPage.h:
2608         * WebProcess/WebPage/WebPage.messages.in:
2609
2610 2017-09-14  Andy Estes  <aestes@apple.com>
2611
2612         [Mac] Upstream SpeechSynthesis-related WebKitSystemInterface functions
2613         https://bugs.webkit.org/show_bug.cgi?id=176931
2614
2615         Reviewed by Joseph Pecoraro.
2616
2617         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2618         (InitWebCoreSystemInterface):
2619
2620 2017-09-14  Ryan Haddad  <ryanhaddad@apple.com>
2621
2622         Unreviewed, rolling out r222033.
2623
2624         This change caused API test WebKit.PrintFrame to time out.
2625
2626         Reverted changeset:
2627
2628         "Add WKUIDelegatePrivate equivalent of WKPageUIClient's
2629         drawHeader, drawFooter, headerHeight, and footerHeight"
2630         https://bugs.webkit.org/show_bug.cgi?id=176889
2631         http://trac.webkit.org/changeset/222033
2632
2633 2017-09-14  Alex Christensen  <achristensen@webkit.org>
2634
2635         Add WKUIDelegatePrivate equivalent of WKPageUIClient's drawHeader, drawFooter, headerHeight, and footerHeight
2636         https://bugs.webkit.org/show_bug.cgi?id=176889
2637         <rdar://problem/29270035>
2638
2639         Reviewed by Andy Estes.
2640
2641         * UIProcess/API/C/WKPage.cpp:
2642         (WKPageLoadAlternateHTMLString):
2643         (WKPageLoadAlternateHTMLStringWithUserData):
2644         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
2645         (-[WKBrowsingContextController loadAlternateHTMLString:baseURL:forUnreachableURL:]):
2646         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2647         * UIProcess/API/Cocoa/WKWebView.mm:
2648         (-[WKWebView _loadAlternateHTMLString:baseURL:forUnreachableURL:]):
2649         * UIProcess/Cocoa/UIDelegate.h:
2650         * UIProcess/Cocoa/UIDelegate.mm:
2651         (WebKit::UIDelegate::setDelegate):
2652         (WebKit::UIDelegate::UIClient::headerHeight):
2653         (WebKit::UIDelegate::UIClient::footerHeight):
2654         (WebKit::UIDelegate::UIClient::drawHeader):
2655         (WebKit::UIDelegate::UIClient::drawFooter):
2656         * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm:
2657         (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]):
2658         * UIProcess/Cocoa/WebViewImpl.mm:
2659         (WebKit::WebViewImpl::printOperationWithPrintInfo):
2660         * UIProcess/FrameLoadState.cpp:
2661         (WebKit::FrameLoadState::didStartProvisionalLoad):
2662         (WebKit::FrameLoadState::didReceiveServerRedirectForProvisionalLoad):
2663         (WebKit::FrameLoadState::didFailProvisionalLoad):
2664         (WebKit::FrameLoadState::didCommitLoad):
2665         (WebKit::FrameLoadState::didSameDocumentNotification):
2666         (WebKit::FrameLoadState::setUnreachableURL):
2667         (WebKit::FrameLoadState::FrameLoadState): Deleted.
2668         * UIProcess/FrameLoadState.h:
2669         (WebKit::FrameLoadState::url const):
2670         (WebKit::FrameLoadState::provisionalURL const):
2671         (WebKit::FrameLoadState::unreachableURL const):
2672         * UIProcess/WebFrameProxy.cpp:
2673         (WebKit::WebFrameProxy::loadURL):
2674         (WebKit::WebFrameProxy::didStartProvisionalLoad):
2675         (WebKit::WebFrameProxy::didReceiveServerRedirectForProvisionalLoad):
2676         (WebKit::WebFrameProxy::didSameDocumentNavigation):
2677         (WebKit::WebFrameProxy::setUnreachableURL):
2678         * UIProcess/WebFrameProxy.h:
2679         (WebKit::WebFrameProxy::url const):
2680         (WebKit::WebFrameProxy::provisionalURL const):
2681         (WebKit::WebFrameProxy::unreachableURL const):
2682         * UIProcess/WebPageProxy.cpp:
2683         (WebKit::WebPageProxy::loadAlternateHTMLString):
2684         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
2685         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
2686         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
2687         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
2688         * UIProcess/WebPageProxy.h:
2689         * UIProcess/WebPageProxy.messages.in:
2690         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2691         (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
2692         (WebKit::WebFrameLoaderClient::dispatchDidChangeProvisionalURL):
2693         (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage):
2694         (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage):
2695         (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage):
2696         (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage):
2697         (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
2698         * WebProcess/WebPage/WebPage.cpp:
2699         (WebKit::WebPage::loadURLInFrame):
2700         * WebProcess/WebPage/WebPage.h:
2701         * WebProcess/WebPage/WebPage.messages.in:
2702
2703 2017-09-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2704
2705         [GTK][Wayland] Flickering when resizing the window
2706         https://bugs.webkit.org/show_bug.cgi?id=176774
2707
2708         Reviewed by Michael Catanzaro.
2709
2710         This regressed when we switched to always start the wayland compositor. In
2711         AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState() we check if the nested compositor is
2712         running, which is always true now (if EGL and the required extensions are available). We should check if we are
2713         in AC mode instead.
2714
2715         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
2716         (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState):
2717
2718 2017-09-14  Yusuke Suzuki  <utatane.tea@gmail.com>
2719
2720         [JSC] Add PrivateSymbolMode::{Include,Exclude} for PropertyNameArray
2721         https://bugs.webkit.org/show_bug.cgi?id=176867
2722
2723         Reviewed by Sam Weinig.
2724
2725         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
2726         (WebKit::NPJSObject::enumerate):
2727
2728 2017-09-14  Maureen Daum  <mdaum@apple.com>
2729
2730         Introduce the option to mark an HTML element as having AutoFill available.
2731         https://bugs.webkit.org/show_bug.cgi?id=176710
2732
2733         Reviewed by Alex Christensen.
2734
2735         Introduce the option to mark an HTML element as having AutoFill available. Accessibility
2736         can use this property when deciding whether to announce that the focused field offers
2737         AutoFill.
2738
2739         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
2740         (WKBundleNodeHandleGetHTMLInputElementAutoFillAvailable):
2741         (WKBundleNodeHandleSetHTMLInputElementAutoFillAvailable):
2742         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
2743         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
2744         (WebKit::InjectedBundleNodeHandle::isAutoFillAvailable const):
2745         (WebKit::InjectedBundleNodeHandle::setAutoFillAvailable):
2746         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
2747
2748 2017-09-13  John Wilander  <wilander@apple.com>
2749
2750         Introduce Storage Access API (document parts) as an experimental feature
2751         https://bugs.webkit.org/show_bug.cgi?id=175759
2752         <rdar://problem/34414107>
2753
2754         Reviewed by Alex Christensen.
2755
2756         Storage Access API is an experimental feature which allows cross-origin,
2757         sandboxed iframes to request access to their first-party storage (as
2758         opposed to partitioned storage). This might be restricted to cookies or
2759         might cover all stateful mechanisms.
2760
2761         It introduces the following three developer-facing things:
2762         - A new readonly attribute, document.hasStorageAccess.
2763         - A new function, document.requestStorageAccess().
2764         - A new iframe sandbox token, allow-storage-access-by-user-activation.
2765
2766         * Shared/WebCoreArgumentCoders.cpp:
2767         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
2768         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
2769             Storage handling of the new type of data.
2770         * Shared/WebPreferencesDefinitions.h:
2771         * UIProcess/API/C/WKPreferences.cpp:
2772         (WKPreferencesSetStorageAccessAPIEnabled):
2773         (WKPreferencesGetStorageAccessAPIEnabled):
2774         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2775         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2776             Bumped the model version from 9 to 10.
2777         * WebProcess/WebPage/WebPage.cpp:
2778         (WebKit::WebPage::updatePreferences):
2779
2780 2017-09-13  Andy Estes  <aestes@apple.com>
2781
2782         [Apple Pay] Consider phoneticName when encoding ContactFields
2783         https://bugs.webkit.org/show_bug.cgi?id=176885
2784         <rdar://problem/34176419>
2785
2786         Reviewed by Tim Horton.
2787
2788         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2789         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ContactFields>::encode):
2790         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ContactFields>::decode):
2791
2792 2017-09-13  Matt Lewis  <jlewis3@apple.com>
2793
2794         Unreviewed, rolling out r221976.
2795
2796         The test introduced was flaky from point of addition.
2797
2798         Reverted changeset:
2799
2800         "Introduce Storage Access API (document parts) as an
2801         experimental feature"
2802         https://bugs.webkit.org/show_bug.cgi?id=175759
2803         http://trac.webkit.org/changeset/221976
2804
2805 2017-09-13  Youenn Fablet  <youenn@apple.com>
2806
2807         Internals clearCacheStorageMemoryRepresentation should return a Promise
2808         https://bugs.webkit.org/show_bug.cgi?id=176818
2809
2810         Reviewed by Alex Christensen.
2811
2812         Adding a completion handler to clearMemoryRepresentation.
2813
2814         * NetworkProcess/cache/CacheStorageEngine.cpp:
2815         (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
2816         * NetworkProcess/cache/CacheStorageEngine.h:
2817         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
2818         (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
2819         * NetworkProcess/cache/CacheStorageEngineConnection.h:
2820         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
2821         * WebProcess/Cache/WebCacheStorageConnection.cpp:
2822         (WebKit::WebCacheStorageConnection::clearMemoryRepresentation):
2823         (WebKit::WebCacheStorageConnection::clearMemoryRepresentationCompleted):
2824         * WebProcess/Cache/WebCacheStorageConnection.h:
2825         * WebProcess/Cache/WebCacheStorageConnection.messages.in:
2826
2827 2017-09-13  Andy Estes  <aestes@apple.com>
2828
2829         [CF] Upstream CFNetwork-related WebKitSystemInterface functions
2830         https://bugs.webkit.org/show_bug.cgi?id=176729
2831
2832         Reviewed by Alex Christensen.
2833
2834         * Shared/mac/WebCoreArgumentCodersMac.mm:
2835         (IPC::createSerializableRepresentation):
2836         (IPC::dictionaryValueOfType):
2837         (IPC::createArchiveList):
2838         (IPC::createCFURLRequestFromSerializableRepresentation):
2839         (IPC::createNSURLRequestFromSerializableRepresentation):
2840         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
2841         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
2842         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2843         (WebKit::WebProcessPool::legacyPlatformDefaultCacheStorageDirectory):
2844         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
2845         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2846         (InitWebCoreSystemInterface):
2847
2848 2017-09-13  Alex Christensen  <achristensen@webkit.org>
2849
2850         Add WKUIDelegatePrivate equivalent of WKPageUIClient's setIsResizable, getWindowFrame, and setWindowFrame
2851         https://bugs.webkit.org/show_bug.cgi?id=176857
2852         <rdar://problem/29270035>
2853
2854         Reviewed by Tim Horton.
2855
2856         isResizable is unreachable code because nothing sends Messages::WebPageProxy::GetIsResizable, so I removed it.
2857
2858         * UIProcess/API/APIUIClient.h:
2859         (API::UIClient::setStatusBarIsVisible):
2860         (API::UIClient::isResizable): Deleted.
2861         * UIProcess/API/C/WKPage.cpp:
2862         (WKPageSetPageUIClient):
2863         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2864         * UIProcess/API/glib/WebKitUIClient.cpp:
2865         * UIProcess/Cocoa/UIDelegate.h:
2866         * UIProcess/Cocoa/UIDelegate.mm:
2867         (WebKit::UIDelegate::setDelegate):
2868         (WebKit::UIDelegate::UIClient::setIsResizable):
2869         (WebKit::UIDelegate::UIClient::setWindowFrame):
2870         (WebKit::UIDelegate::UIClient::windowFrame):
2871         * UIProcess/WebPageProxy.cpp:
2872         (WebKit::WebPageProxy::getIsResizable): Deleted.
2873         * UIProcess/WebPageProxy.h:
2874         * UIProcess/WebPageProxy.messages.in:
2875
2876 2017-09-13  Youenn Fablet  <youenn@apple.com>
2877
2878         Add a lambda-based map for Vectors
2879         https://bugs.webkit.org/show_bug.cgi?id=176487
2880
2881         Reviewed by Darin Adler.
2882
2883         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
2884         (WebKit::CacheStorage::Caches::readCachesFromDisk):
2885
2886 2017-09-13  John Wilander  <wilander@apple.com>
2887
2888         Introduce Storage Access API (document parts) as an experimental feature
2889         https://bugs.webkit.org/show_bug.cgi?id=175759
2890         <rdar://problem/33666847>
2891
2892         Reviewed by Alex Christensen.
2893
2894         Storage Access API is an experimental feature which allows cross-origin,
2895         sandboxed iframes to request access to their first-party storage (as
2896         opposed to partitioned storage). This might be restricted to cookies or
2897         might cover all stateful mechanisms.
2898
2899         It introduces the following three developer-facing things:
2900         - A new readonly attribute, document.hasStorageAccess.
2901         - A new function, document.requestStorageAccess().
2902         - A new iframe sandbox token, allow-storage-access-by-user-activation.
2903
2904         * Shared/WebCoreArgumentCoders.cpp:
2905         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
2906         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
2907             Storage handling of the new type of data.
2908         * Shared/WebPreferencesDefinitions.h:
2909         * UIProcess/API/C/WKPreferences.cpp:
2910         (WKPreferencesSetStorageAccessAPIEnabled):
2911         (WKPreferencesGetStorageAccessAPIEnabled):
2912         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2913         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2914             Bumped the model version from 9 to 10.
2915         * WebProcess/WebPage/WebPage.cpp:
2916         (WebKit::WebPage::updatePreferences):
2917
2918 2017-09-13  Sergio Villar Senin  <svillar@igalia.com>
2919
2920         [WebVR] Add IDLs and stubs
2921         https://bugs.webkit.org/show_bug.cgi?id=174202
2922
2923         Reviewed by Dean Jackson.
2924
2925         * Shared/WebPreferencesDefinitions.h:
2926         * WebProcess/WebPage/WebPage.cpp:
2927         (WebKit::WebPage::updatePreferences):
2928
2929 2017-09-12  Ryosuke Niwa  <rniwa@webkit.org>
2930
2931         Dragging & dropping a file creates an attachment element even when it's disabled
2932         https://bugs.webkit.org/show_bug.cgi?id=176769
2933
2934         Reviewed by Tim Horton.
2935
2936         * UIProcess/API/C/WKPreferences.cpp:
2937         (WKPreferencesSetAttachmentElementEnabled):
2938         (WKPreferencesGetAttachmentElementEnabled):
2939         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2940         * WebProcess/WebPage/WebPage.cpp:
2941         (WebKit::WebPage::updatePreferences):
2942
2943 2017-09-12  Youenn Fablet  <youenn@apple.com>
2944
2945         Introduce a RecordData for Cache to efficiently check whether it matches a corresponding request or not
2946         https://bugs.webkit.org/show_bug.cgi?id=176579
2947
2948         Reviewed by Alex Christensen.
2949
2950         Introducing RecordData that splits its stored data in mandatory data,
2951         used to check a record with a request and optional data that is
2952         necessary to build a CacheStorageEngine::Record used by WebProcess.
2953
2954         The mandatory data contains the URL, Vary header information and identifiers.
2955         Adding routines to go from a Record to RecordData and vice versa.
2956         Storing in CacheStorage::Cache RecordData instead of Record.
2957
2958         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
2959         (WebKit::CacheStorage::queryCache):
2960         (WebKit::CacheStorage::updateVaryInformation):
2961         (WebKit::CacheStorage::toRecord):
2962         (WebKit::CacheStorage::toRecordData):
2963         (WebKit::CacheStorage::Cache::retrieveRecords const):
2964         (WebKit::CacheStorage::Cache::addRecord):
2965         (WebKit::CacheStorage::Cache::recordsFromURL):
2966         (WebKit::CacheStorage::Cache::recordsFromURL const):
2967         (WebKit::CacheStorage::Cache::put):
2968         (WebKit::CacheStorage::Cache::writeRecordToDisk):
2969         (WebKit::CacheStorage::Cache::removeRecordFromDisk):
2970         * NetworkProcess/cache/CacheStorageEngineCache.h:
2971
2972 2017-09-12  Dan Bernstein  <mitz@apple.com>
2973
2974         Tried to fix the iOS 10 build after r221930.
2975
2976         * UIProcess/API/Cocoa/WKWebView.mm:
2977         (-[WKWebView _initializeWithConfiguration:]):
2978         (-[WKWebView _setDragInteractionPolicy:]):
2979
2980 2017-09-12  Dan Bernstein  <mitz@apple.com>
2981
2982         Update availability annotations to match the macOS 10.13 and iOS 11.0 GM seed SDKs
2983         https://bugs.webkit.org/show_bug.cgi?id=176793
2984
2985         Reviewed by Tim Horton.
2986
2987         Changed WK_MAC_TBA and WK_IOS_TBA to 10.13 and 11.0, respectively, in all declarations that
2988         appear in the GM seed SDKs. Additional changes and exceptions are noted below.
2989
2990         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Added missing availability annotation to
2991           -_webView:dataOwnerForDropSession: and -_webView:dataOwnerForDragSession:.
2992
2993         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Removed rednundant
2994           __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 guards.
2995
2996         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: Added missing availability annotation to
2997           -_setResourceLoadStatisticsTestingCallback:.
2998
2999         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h: Added missing availability annotation.
3000
3001         * UIProcess/API/Cocoa/_WKLinkIconParameters.h: Added availability annotation that had been
3002           missing since macOS 10.12.3 and iOS 10.3. Corrected annotation for _WKLinkIconParameters.
3003
3004         * UIProcess/API/Cocoa/_WKWebsiteDataStoreConfiguration.h: Added missing TBA annotation to
3005           _resourceLoadStatisticsDirectory.
3006
3007         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h: Removed iOS
3008           availability from macOS-only declaration and vice versa.
3009
3010         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm:
3011         (-[WKWebProcessPlugInRangeHandle detectDataWithTypes:context:]): Removed an availability
3012           annotation from this method implementation.
3013
3014         * Shared/API/Cocoa/WKDragDestinationAction.h:
3015         * UIProcess/API/Cocoa/WKContentRuleList.h:
3016         * UIProcess/API/Cocoa/WKContentRuleListStore.h:
3017         * UIProcess/API/Cocoa/WKError.h:
3018         * UIProcess/API/Cocoa/WKFrameInfo.h:
3019         * UIProcess/API/Cocoa/WKHTTPCookieStore.h:
3020         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
3021         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3022         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3023         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
3024         * UIProcess/API/Cocoa/WKSnapshotConfiguration.h:
3025         * UIProcess/API/Cocoa/WKURLSchemeHandler.h:
3026         * UIProcess/API/Cocoa/WKURLSchemeTask.h:
3027         * UIProcess/API/Cocoa/WKURLSchemeTaskPrivate.h:
3028         * UIProcess/API/Cocoa/WKUserContentController.h:
3029         * UIProcess/API/Cocoa/WKWebView.h:
3030         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
3031         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3032         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
3033         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
3034         * UIProcess/API/Cocoa/WKWindowFeaturesPrivate.h:
3035         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
3036         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
3037         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
3038         * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h:
3039         * UIProcess/API/Cocoa/_WKGeolocationPosition.h:
3040         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
3041         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
3042         * UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h:
3043         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
3044         * UIProcess/_WKWebViewPrintFormatter.h:
3045         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
3046         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h:
3047         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
3048
3049 2017-09-12  Alex Christensen  <achristensen@webkit.org>
3050
3051         Add WKUIDelegatePrivate equivalent of WKPageUIClient's runModal
3052         https://bugs.webkit.org/show_bug.cgi?id=176728
3053         <rdar://problem/29270035>
3054         
3055         Covered by a new API test.
3056
3057         Reviewed by Tim Horton.
3058
3059         * UIProcess/API/APIUIClient.h:
3060         (API::UIClient::runModal):
3061         * UIProcess/API/C/WKPage.cpp:
3062         (WKPageSetPageUIClient):
3063         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3064         * UIProcess/Cocoa/UIDelegate.h:
3065         * UIProcess/Cocoa/UIDelegate.mm:
3066         (WebKit::UIDelegate::setDelegate):
3067         (WebKit::UIDelegate::UIClient::canRunModal const):
3068         (WebKit::UIDelegate::UIClient::runModal):
3069         * UIProcess/WebPageProxy.cpp:
3070         (WebKit::WebPageProxy::runModal):
3071
3072 2017-09-12  Alex Christensen  <achristensen@webkit.org>
3073
3074         Add WKUIDelegatePrivate equivalent of WKPageUIClient's decidePolicyForNotificationPermissionRequest
3075         https://bugs.webkit.org/show_bug.cgi?id=176768
3076         <rdar://problem/29270035>
3077
3078         Reviewed by Tim Horton.
3079
3080         Covered by a new API test.
3081
3082         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3083         * UIProcess/Cocoa/UIDelegate.h:
3084         * UIProcess/Cocoa/UIDelegate.mm:
3085         (WebKit::UIDelegate::setDelegate):
3086         (WebKit::UIDelegate::UIClient::runBeforeUnloadConfirmPanel):
3087         (WebKit::UIDelegate::UIClient::exceededDatabaseQuota):
3088         (WebKit::UIDelegate::UIClient::decidePolicyForNotificationPermissionRequest):
3089         (WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota):
3090
3091 2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
3092
3093         [iOS DnD] Support DataTransfer.setDragImage when starting a drag on iOS
3094         https://bugs.webkit.org/show_bug.cgi?id=176721
3095         <rdar://problem/34373660>
3096
3097         Reviewed by Tim Horton.
3098
3099         Rename elementBounds => dragPreviewFrameInRootViewCoordinates.
3100
3101         * UIProcess/ios/DragDropInteractionState.h:
3102         * UIProcess/ios/DragDropInteractionState.mm:
3103         (WebKit::DragDropInteractionState::previewForDragItem const):
3104         (WebKit::DragDropInteractionState::stageDragItem):
3105
3106 2017-09-11  Tim Horton  <timothy_horton@apple.com>
3107
3108         REGRESSION (r221272): WKWebView gets stuck zoomed in if the web process crashes
3109         https://bugs.webkit.org/show_bug.cgi?id=176767
3110         <rdar://problem/34196874>
3111
3112         Reviewed by Dan Bernstein.
3113
3114         * UIProcess/API/Cocoa/WKWebView.mm:
3115         (-[WKWebView _processDidExit]):
3116         Reset the "last sent" layout parameters when the Web Content process exits.
3117         They're no longer "last sent", and if we short-circuit from sending them
3118         again (from under _didRelaunchProcess), we will never send the correct
3119         layout width (until it changes).
3120
3121 2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
3122
3123         [iOS WK2] Support tapping to add items to the current drag session in web content
3124         https://bugs.webkit.org/show_bug.cgi?id=176421
3125         <rdar://problem/31144674>
3126
3127         Reviewed by Tim Horton.
3128
3129         To request additional drag items, end the current drag in the web page and try to begin a drag at the new
3130         location. This process is transparent to the UI process, which still maintains the same UIDragSession with the
3131         old drag source.
3132
3133         As opposed to firing a new event (for instance: `adddragitem`), this approach is taken to ensure that if the
3134         page wants to preventDefault() on `dragstart`, it would also prevent the user from adding it as an additional
3135         drag item. Using the new event approach, dealing with this case would either require the page to listen for a
3136         new event and call preventDefault(), which would break compatibility with pages that only preventDefault() on
3137         `dragstart`, or it would require the default behavior of this new event to be _not_ adding a drag item, in which
3138         case this approach would require pages to adopt the new event in some form.
3139
3140         * WebProcess/WebPage/ios/WebPageIOS.mm:
3141         (WebKit::WebPage::requestAdditionalItemsForDragSession):
3142
3143 2017-09-11  Alex Christensen  <achristensen@webkit.org>
3144
3145         Clean up API::UIClient
3146         https://bugs.webkit.org/show_bug.cgi?id=176568
3147
3148         Reviewed by Brady Eidson.
3149
3150         We don't need createNewPage and createNewPageAsync.
3151         An async version can support synchronous delegate calls by just calling the completion handler synchronously.
3152
3153         * UIProcess/API/APIUIClient.h:
3154         (API::UIClient::createNewPage):
3155         (API::UIClient::createNewPageAsync): Deleted.
3156         (API::UIClient::canCreateNewPageAsync): Deleted.
3157         * UIProcess/API/C/WKPage.cpp:
3158         (WKPageSetPageUIClient):
3159         * UIProcess/API/glib/WebKitUIClient.cpp:
3160         * UIProcess/API/glib/WebKitUIClient.h:
3161         * UIProcess/Cocoa/UIDelegate.h:
3162         * UIProcess/Cocoa/UIDelegate.mm:
3163         (WebKit::UIDelegate::UIClient::createNewPage):
3164         (WebKit::UIDelegate::UIClient::createNewPageCommon): Deleted.
3165         (WebKit::UIDelegate::UIClient::canCreateNewPageAsync): Deleted.
3166         (WebKit::UIDelegate::UIClient::createNewPageAsync): Deleted.
3167         * UIProcess/WebPageProxy.cpp:
3168         (WebKit::WebPageProxy::createNewPage):
3169         * UIProcess/WebPageProxy.h:
3170
3171 2017-09-11  Alex Christensen  <achristensen@webkit.org>
3172
3173         Fix memory leak introduced in r221894.
3174         https://bugs.webkit.org/show_bug.cgi?id=176753
3175
3176         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
3177         (WebKit::NotificationPermissionRequestManagerProxy::createRequest):
3178         The NotificationPermissionRequestManagerProxy keeps track of pending requests
3179         so they can be denied when invalidating the page.  We add them to a HashMap and in
3180         r221894 I removed the code that removes them from that map once the request is complete.
3181         This code adds the completed task removal back.
3182         The NotificationPermissionRequestManagerProxy and WebPageProxy have the same lifetime,
3183         so protecting the WebPageProxy (m_page) makes sure there is no use-after-free when the
3184         completion handler is called.
3185
3186 2017-09-11  Alex Christensen  <achristensen@webkit.org>
3187
3188         Make NotificationPermissionRequest work with completion handlers
3189         https://bugs.webkit.org/show_bug.cgi?id=176753
3190
3191         Reviewed by Andy Estes.
3192
3193         API::UIClient::decidePolicyForNotificationPermissionRequest should take a completion handler
3194         which it will eventually call with a bool representing whether notifications are allowed.
3195         To do this, I make NotificationPermissionRequest just a wrapper for a lambda.
3196         One subtle change in behavior is when invalidating all outstanding requests, we deny them instead
3197         of just dropping them.  This results in a deny message sent where there wasn't one before,
3198         resulting in better cleanup in NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision.
3199
3200         * UIProcess/API/APIUIClient.h:
3201         (API::UIClient::decidePolicyForNotificationPermissionRequest):
3202         * UIProcess/API/C/WKPage.cpp:
3203         (WKPageSetPageUIClient):
3204         * UIProcess/Notifications/NotificationPermissionRequest.cpp: Removed.
3205         * UIProcess/Notifications/NotificationPermissionRequest.h:
3206         (WebKit::NotificationPermissionRequest::create):
3207         (WebKit::NotificationPermissionRequest::allow):
3208         (WebKit::NotificationPermissionRequest::deny):
3209         (WebKit::NotificationPermissionRequest::NotificationPermissionRequest):
3210         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
3211         (WebKit::NotificationPermissionRequestManagerProxy::invalidateRequests):
3212         (WebKit::NotificationPermissionRequestManagerProxy::createRequest):
3213         (WebKit::NotificationPermissionRequestManagerProxy::didReceiveNotificationPermissionDecision): Deleted.
3214         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.h:
3215         * UIProcess/WebPageProxy.cpp:
3216         (WebKit::WebPageProxy::requestNotificationPermission):
3217         * WebKit.xcodeproj/project.pbxproj:
3218
3219 2017-09-11  Alex Christensen  <achristensen@webkit.org>
3220
3221         Modernize and make API::UIClient more asynchronous
3222         https://bugs.webkit.org/show_bug.cgi?id=176583
3223
3224         Reviewed by Brian Burg.
3225
3226         API::UIClient calls that return values synchronously require synchronous APIs unnecessarily.
3227         Having them call completion handlers with the results instead allows us to make asynchronous
3228         APIs, and existing synchronous APIs can just call the completion handlers immediately.
3229         
3230         Unfortunately an assumption that API::UIClient::windowFrame returns synchronously had worked
3231         its way into the WebAutomationSession, which calls WebPageProxy::getWindowFrame.  Making it
3232         asynchronous required making some automation protocols asynchronous so they can send their
3233         result once they have the resulting frames from the UIClient.
3234         
3235         No change in behaviour.
3236
3237         * UIProcess/API/APIUIClient.h:
3238         (API::UIClient::setToolbarsAreVisible):
3239         (API::UIClient::menuBarIsVisible):
3240         (API::UIClient::setMenuBarIsVisible):
3241         (API::UIClient::statusBarIsVisible):
3242         (API::UIClient::setStatusBarIsVisible):
3243         (API::UIClient::isResizable):
3244         (API::UIClient::setIsResizable):
3245         (API::UIClient::setWindowFrame):
3246         (API::UIClient::windowFrame):
3247         (API::UIClient::headerHeight):
3248         (API::UIClient::footerHeight):
3249         (API::UIClient::drawHeader):
3250         (API::UIClient::drawFooter):
3251         (API::UIClient::printFrame):
3252         * UIProcess/API/C/WKPage.cpp:
3253         (WKPageSetPageUIClient):
3254         * UIProcess/Automation/Automation.json:
3255         * UIProcess/Automation/WebAutomationSession.cpp:
3256         (WebKit::WebAutomationSession::buildBrowsingContextForPage):
3257         (WebKit::WebAutomationSession::getNextContext):
3258         (WebKit::WebAutomationSession::getBrowsingContexts):
3259         (WebKit::WebAutomationSession::getBrowsingContext):
3260         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
3261         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
3262         (WebKit::WebAutomationSession::performMouseInteraction):
3263         * UIProcess/Automation/WebAutomationSession.h:
3264         * UIProcess/Cocoa/UIDelegate.h:
3265         * UIProcess/Cocoa/UIDelegate.mm:
3266         (WebKit::UIDelegate::UIClient::printFrame):
3267         * UIProcess/Cocoa/WebViewImpl.mm:
3268         (WebKit::WebViewImpl::printOperationWithPrintInfo):
3269         * UIProcess/WebPageProxy.cpp:
3270         (WebKit::WebPageProxy::runJavaScriptPrompt):
3271         (WebKit::WebPageProxy::setToolbarsAreVisible):
3272         (WebKit::WebPageProxy::setMenuBarIsVisible):
3273         (WebKit::WebPageProxy::getMenuBarIsVisible):
3274         (WebKit::WebPageProxy::setStatusBarIsVisible):
3275         (WebKit::WebPageProxy::getStatusBarIsVisible):
3276         (WebKit::WebPageProxy::setIsResizable):
3277         (WebKit::WebPageProxy::getIsResizable):
3278         (WebKit::WebPageProxy::setWindowFrame):
3279         (WebKit::WebPageProxy::getWindowFrame):
3280         (WebKit::WebPageProxy::getWindowFrameWithCompletionHandler):
3281         (WebKit::WebPageProxy::screenToRootView):
3282         (WebKit::WebPageProxy::rootViewToScreen):
3283         (WebKit::WebPageProxy::printFrame):
3284         (WebKit::WebPageProxy::headerHeight):
3285         (WebKit::WebPageProxy::footerHeight):
3286         (WebKit::WebPageProxy::drawHeader):
3287         (WebKit::WebPageProxy::drawFooter):
3288         * UIProcess/WebPageProxy.h:
3289         * UIProcess/WebPageProxy.messages.in:
3290         * UIProcess/mac/WKPrintingView.h:
3291         * UIProcess/mac/WKPrintingView.mm:
3292         (-[WKPrintingView initWithFrameProxy:view:]):
3293         (-[WKPrintingView _adjustPrintingMarginsForHeaderAndFooter]):
3294         (-[WKPrintingView drawPageBorderWithSize:]):
3295         * UIProcess/mac/WebPageProxyMac.mm:
3296         (WebKit::WebPageProxy::windowAndViewFramesChanged):
3297
3298 2017-09-11  Stephan Szabo  <stephan.szabo@sony.com>
3299
3300         [WinCairo] Add entry Web Process files for wincairo webkit
3301         https://bugs.webkit.org/show_bug.cgi?id=176570
3302
3303         Reviewed by Alex Christensen.
3304
3305         * PlatformWin.cmake:
3306         * WebProcess/EntryPoint/win/WebProcessMain.cpp: Added.
3307         * WebProcess/win/WebProcessMainWin.cpp: Added.
3308         * WebProcess/win/WebProcessMainWin.h: Added.
3309
3310 2017-09-11  Alex Christensen  <achristensen@webkit.org>
3311
3312         Add WKUIDelegatePrivate equivalent of WKPageUIClient's decidePolicyForGeolocationPermissionRequest
3313         https://bugs.webkit.org/show_bug.cgi?id=176642
3314         <rdar://problem/29270035>
3315
3316         Reviewed by Darin Adler.
3317
3318         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3319         * UIProcess/Cocoa/UIDelegate.h:
3320         * UIProcess/Cocoa/UIDelegate.mm:
3321         (WebKit::UIDelegate::setDelegate):
3322         (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
3323         (WebKit::Function<void):
3324
3325 2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
3326
3327         [iOS DnD] Elements in the DOM with the `draggable` attribute should be draggable
3328         https://bugs.webkit.org/show_bug.cgi?id=176664
3329         <rdar://problem/32596156>
3330
3331         Reviewed by Tim Horton.
3332
3333         Makes a simple adjustment in DragDropInteractionState::previewForDragItem to respect the drag image supplied to
3334         the UI process during a "DHTML"-defined drag (i.e. DragSourceActionDHTML).
3335
3336         Test: DataInteractionTests.CanStartDragOnDivWithDraggableAttribute
3337
3338         * UIProcess/API/Cocoa/WKWebView.mm:
3339         (-[WKWebView _simulateDataInteractionEntered:]): Deleted.
3340         (-[WKWebView _simulateDataInteractionUpdated:]): Deleted.
3341         (-[WKWebView _simulateDataInteractionPerformOperation:]): Deleted.
3342         (-[WKWebView _simulateDataInteractionEnded:]): Deleted.
3343         (-[WKWebView _simulateDataInteractionSessionDidEnd:]): Deleted.
3344         (-[WKWebView _simulateWillBeginDataInteractionWithSession:]): Deleted.
3345         (-[WKWebView _simulatedItemsForSession:]): Deleted.
3346         (-[WKWebView _simulateItemsForAddingToSession:atLocation:completion:]): Deleted.
3347         (-[WKWebView _simulatePrepareForDataInteractionSession:completion:]): Deleted.
3348
3349         Remove all -_simulate*: testing helpers on WKWebView.
3350
3351         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3352         * UIProcess/ios/DragDropInteractionState.mm:
3353         (WebKit::shouldUseDragImageToCreatePreviewForDragSource):
3354         (WebKit::shouldUseTextIndicatorToCreatePreviewForDragSource):
3355
3356         Add shouldUseDragImageToCreatePreviewForDragSource, which returns YES when dragging an image or DHTML-defined
3357         draggable element and the drag image exists. This is called from previewForDragItem when constructing the drag
3358         preview for a given UIDragItem.
3359
3360         (WebKit::DragDropInteractionState::previewForDragItem const):
3361         (WebKit::shouldUseTextIndicatorToCreatePreviewForDragAction): Deleted.
3362         * UIProcess/ios/WKContentViewInteraction.h:
3363         * UIProcess/ios/WKContentViewInteraction.mm:
3364         (-[WKContentView _simulateDataInteractionEntered:]): Deleted.
3365         (-[WKContentView _simulateDataInteractionUpdated:]): Deleted.
3366         (-[WKContentView _simulateDataInteractionEnded:]): Deleted.
3367         (-[WKContentView _simulateDataInteractionPerformOperation:]): Deleted.
3368         (-[WKContentView _simulateDataInteractionSessionDidEnd:]): Deleted.
3369         (-[WKContentView _simulateWillBeginDataInteractionWithSession:]): Deleted.
3370         (-[WKContentView _simulatedItemsForSession:]): Deleted.
3371         (-[WKContentView _simulatePrepareForDataInteractionSession:completion:]): Deleted.
3372         (-[WKContentView _simulateItemsForAddingToSession:atLocation:completion:]): Deleted.
3373
3374         Remove all -_simulate*: testing helpers on WKContentView.
3375
3376 2017-09-11  Alex Christensen  <achristensen@webkit.org>
3377
3378         Modernize BoxExtent into RectEdges
3379         https://bugs.webkit.org/show_bug.cgi?id=176437
3380
3381         Reviewed by Simon Fraser.
3382
3383         * Scripts/webkit/messages.py:
3384         (class_template_headers):
3385         * Shared/WebCoreArgumentCoders.h:
3386         * UIProcess/WebPageProxy.h:
3387         * UIProcess/WebPageProxy.messages.in:
3388         * WebProcess/WebPage/WebPage.messages.in:
3389
3390 2017-09-11  Andy Estes  <aestes@apple.com>
3391
3392         [Mac] Upstream QTKit-related WebKitSystemInterface functions
3393         https://bugs.webkit.org/show_bug.cgi?id=176472
3394
3395         Reviewed by Eric Carlson.
3396
3397         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3398         (InitWebCoreSystemInterface):
3399
3400 2017-09-11  JF Bastien  <jfbastien@apple.com>
3401
3402         cmake build fix
3403
3404         Unreviewed
3405
3406         * PlatformMac.cmake: one file was deleted, another renamed.
3407
3408 2017-09-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3409
3410         REGRESSION: [GTK] Generated HTML API documentation is missing descriptions
3411         https://bugs.webkit.org/show_bug.cgi?id=176667
3412
3413         Reviewed by Michael Catanzaro.
3414
3415         Fix several typos in API documentation.
3416
3417         * UIProcess/API/glib/WebKitSettings.cpp:
3418         (webkit_settings_class_init):
3419         * UIProcess/API/glib/WebKitWebView.cpp:
3420         (webkit_web_view_class_init):
3421         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
3422         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
3423
3424 2017-09-10  Brady Eidson  <beidson@apple.com>
3425
3426         Try to avoid creating the default WKWebsiteDataStore until its actually needed.
3427         <rdar://problem/33164453> and https://bugs.webkit.org/show_bug.cgi?id=176551
3428
3429         Reviewed by Tim Horton.
3430
3431         * UIProcess/API/APIHTTPCookieStore.cpp:
3432         (API::HTTPCookieStore::cookies):
3433         (API::HTTPCookieStore::setCookie):
3434         (API::HTTPCookieStore::deleteCookie):
3435
3436         * UIProcess/API/APIWebsiteDataStore.cpp:
3437         (API::WebsiteDataStore::defaultDataStore):
3438         (API::WebsiteDataStore::defaultDataStoreExists):
3439         * UIProcess/API/APIWebsiteDataStore.h:
3440
3441         * UIProcess/API/C/WKContext.cpp:
3442         (WKContextGetWebsiteDataStore):
3443
3444         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3445         (+[WKWebsiteDataStore _defaultDataStoreExists]):
3446         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
3447
3448         * UIProcess/WebProcessPool.cpp:
3449         (WebKit::WebProcessPool::WebProcessPool):
3450         (WebKit::m_hiddenPageThrottlingTimer):
3451         (WebKit::WebProcessPool::ensureNetworkProcess):
3452         (WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
3453         (WebKit::WebProcessPool::warmInitialProcess):
3454         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
3455         (WebKit::WebProcessPool::createWebPage):
3456         (WebKit::WebProcessPool::pageAddedToProcess):
3457         * UIProcess/WebProcessPool.h:
3458
3459         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3460         (WebKit::WebsiteDataStore::isAssociatedProcessPool const):
3461
3462 2017-09-09  Mark Lam  <mark.lam@apple.com>
3463
3464         Avoid duplicate computations of ExecState::vm().
3465         https://bugs.webkit.org/show_bug.cgi?id=176647
3466
3467         Reviewed by Saam Barati.
3468
3469         * WebProcess/Plugins/Netscape/JSNPMethod.h:
3470         (WebKit::JSNPMethod::create):
3471         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
3472         (WebKit::NPJSObject::setProperty):
3473         (WebKit::NPJSObject::removeProperty):
3474         (WebKit::NPJSObject::enumerate):
3475
3476 2017-09-08  Joseph Pecoraro  <pecoraro@apple.com>
3477
3478         Fetch's Response.statusText is unexpectedly the full http status line for HTTP/2 responses
3479         https://bugs.webkit.org/show_bug.cgi?id=176479
3480
3481         Reviewed by Alex Christensen.
3482
3483         * NetworkProcess/NetworkProcess.cpp:
3484         (WebKit::NetworkProcess::initializeNetworkProcess):
3485         Initialize AtomicString statics like emptyAtom().
3486
3487 2017-09-08  Commit Queue  <commit-queue@webkit.org>
3488
3489         Unreviewed, rolling out r221773.
3490         https://bugs.webkit.org/show_bug.cgi?id=176614
3491
3492         This caused build failures. (Requested by mlewis13 on
3493         #webkit).
3494
3495         Reverted changeset:
3496
3497         "[Mac] Upstream QTKit-related WebKitSystemInterface functions"
3498         https://bugs.webkit.org/show_bug.cgi?id=176472
3499         http://trac.webkit.org/changeset/221773
3500
3501 2017-09-08  Stephan Szabo  <stephan.szabo@am.sony.com>
3502
3503         [WinCairo] Add Storage Process files for wincairo webkit
3504         https://bugs.webkit.org/show_bug.cgi?id=176567
3505
3506         Reviewed by Alex Christensen.
3507
3508         * PlatformWin.cmake:
3509         * StorageProcess/EntryPoint/win/StorageProcessMain.cpp: Added.
3510         (main):
3511         * StorageProcess/win/StorageProcessMainWin.cpp: Added.
3512         (WebKit::StorageProcessMainWin):
3513         * StorageProcess/win/StorageProcessMainWin.h: Added.
3514
3515 2017-09-08  Ryan Haddad  <ryanhaddad@apple.com>
3516
3517         Unreviewed, rolling out r221771.
3518
3519         This change caused two API tests to crash.
3520
3521         Reverted changeset:
3522
3523         "Clean up API::UIClient"
3524         https://bugs.webkit.org/show_bug.cgi?id=176568
3525         http://trac.webkit.org/changeset/221771
3526
3527 2017-09-07  Carlos Garcia Campos  <cgarcia@igalia.com>
3528
3529         [GTK][WPE] UI process crash in WebBackForwardList::restoreFromState
3530         https://bugs.webkit.org/show_bug.cgi?id=176303
3531
3532         Reviewed by Michael Catanzaro.
3533
3534         Ensure the current index provided by the session state is not out of actual item list bounds. This is a bug in
3535         the session state decoder, but WebBackForwardList::backForwardListState() is already doing the check and using
3536         the last item index instead, so it's not easy to know where the actual problem is. In any case we should
3537         still protect the decoder.
3538
3539         * UIProcess/API/glib/WebKitWebViewSessionState.cpp:
3540         (decodeSessionState):
3541
3542 2017-09-07  Andy Estes  <aestes@apple.com>
3543
3544         [Mac] Upstream QTKit-related WebKitSystemInterface functions
3545         https://bugs.webkit.org/show_bug.cgi?id=176472
3546
3547         Reviewed by Eric Carlson.
3548
3549         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3550         (InitWebCoreSystemInterface):
3551
3552 2017-09-07  Alex Christensen  <achristensen@webkit.org>
3553
3554         Clean up API::UIClient
3555         https://bugs.webkit.org/show_bug.cgi?id=176568
3556
3557         Reviewed by Brady Eidson.
3558
3559         We don't need createNewPage and createNewPageAsync.
3560         An async version can support synchronous delegate calls by just calling the completion handler synchronously.
3561
3562         * UIProcess/API/APIUIClient.h:
3563         (API::UIClient::createNewPage):
3564         (API::UIClient::createNewPageAsync): Deleted.
3565         (API::UIClient::canCreateNewPageAsync): Deleted.
3566         * UIProcess/API/C/WKPage.cpp:
3567         (WKPageSetPageUIClient):
3568         * UIProcess/API/glib/WebKitUIClient.cpp:
3569         * UIProcess/API/glib/WebKitUIClient.h:
3570         * UIProcess/Cocoa/UIDelegate.h:
3571         * UIProcess/Cocoa/UIDelegate.mm:
3572         (WebKit::UIDelegate::UIClient::createNewPage):
3573         (WebKit::UIDelegate::UIClient::createNewPageCommon): Deleted.
3574         (WebKit::UIDelegate::UIClient::canCreateNewPageAsync): Deleted.
3575         (WebKit::UIDelegate::UIClient::createNewPageAsync): Deleted.
3576         * UIProcess/WebPageProxy.cpp:
3577         (WebKit::WebPageProxy::createNewPage):
3578         * UIProcess/WebPageProxy.h:
3579
3580 2017-09-07  Alex Christensen  <achristensen@webkit.org>
3581
3582         Make DragControllerAction an enum class
3583         https://bugs.webkit.org/show_bug.cgi?id=176565
3584
3585         Reviewed by Andy Estes.
3586
3587         * Shared/DragControllerAction.h:
3588         (): Deleted.
3589         * UIProcess/WebPageProxy.cpp:
3590         (WebKit::WebPageProxy::dragEntered):
3591         (WebKit::WebPageProxy::dragUpdated):
3592         (WebKit::WebPageProxy::dragExited):
3593         (WebKit::WebPageProxy::performDragOperation):
3594         * WebProcess/WebPage/WebPage.cpp:
3595         (WebKit::WebPage::performDragControllerAction):
3596         * WebProcess/WebPage/WebPage.h:
3597         * WebProcess/WebPage/WebPage.messages.in:
3598
3599 2017-09-07  Myles C. Maxfield  <mmaxfield@apple.com>
3600
3601         [PAL] Unify PlatformUserPreferredLanguages.h with Language.h
3602         https://bugs.webkit.org/show_bug.cgi?id=176561
3603
3604         Reviewed by Brent Fulgham.
3605
3606         * UIProcess/WebProcessPool.cpp:
3607         * WebProcess/WebProcess.cpp:
3608         (WebKit::WebProcess::userPreferredLanguagesChanged const):
3609
3610 2017-09-07  Youenn Fablet  <youenn@apple.com>
3611
3612         Remove entry from CacheStorageEngineConnection lock map when unlocking a Cache
3613         https://bugs.webkit.org/show_bug.cgi?id=176548
3614
3615         Reviewed by Alex Christensen.
3616
3617         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
3618         (WebKit::CacheStorageEngineConnection::dereference):
3619
3620 2017-09-07  Chris Dumez  <cdumez@apple.com>
3621
3622         [WK2] Add C API to retrieve the originating page of a WKDownload
3623         https://bugs.webkit.org/show_bug.cgi?id=176557
3624         <rdar://problem/34314776>
3625
3626         Reviewed by Alex Christensen.
3627
3628         Add C API to retrieve the original page of a WKDownload. This is the C API equivalent to
3629         _WKDownload.originatingWebView which already exists in ObjC. The pointer is weak so as
3630         to not keep alive the page for the duration of the download.
3631
3632         * UIProcess/API/C/WKDownload.cpp:
3633         (WKDownloadGetOriginatingPage):
3634         * UIProcess/API/C/WKDownload.h:
3635         * UIProcess/API/Cocoa/_WKDownload.mm:
3636         (-[_WKDownload originatingWebView]):
3637         * UIProcess/API/Cocoa/_WKDownloadInternal.h:
3638         * UIProcess/Downloads/DownloadProxy.cpp:
3639         (WebKit::DownloadProxy::originatingPage const):
3640         (WebKit::DownloadProxy::setOriginatingPage):
3641         * UIProcess/Downloads/DownloadProxy.h:
3642         * UIProcess/WebPageProxy.cpp:
3643         (WebKit::WebPageProxy::receivedPolicyDecision):
3644         * UIProcess/WebProcessPool.cpp:
3645         (WebKit::WebProcessPool::download):
3646         (WebKit::WebProcessPool::resumeDownload):
3647         (WebKit::WebProcessPool::createDownloadProxy):
3648         * UIProcess/WebProcessPool.h:
3649         * UIProcess/ios/PageClientImplIOS.mm:
3650         (WebKit::PageClientImpl::handleDownloadRequest):
3651         * UIProcess/mac/PageClientImplMac.mm:
3652         (WebKit::PageClientImpl::handleDownloadRequest):
3653
3654 2017-09-07  Alex Christensen  <achristensen@webkit.org>
3655
3656         Clean up Geolocation request handling
3657         https://bugs.webkit.org/show_bug.cgi?id=176562
3658
3659         Reviewed by Tim Horton.
3660
3661         Instead of passing a GeolocationPermissionRequestProxy& to each client and returning a bool if the request will be handled,
3662         pass a Function<void(bool)>&& completionHandler and return the function if it won't be handled.
3663         This allows to temporarily support our UIClient/PageClient hybrid design while moving towards a sane design.
3664
3665         * UIProcess/API/APIUIClient.h:
3666         (API::UIClient::Function<void):
3667         (API::UIClient::decidePolicyForGeolocationPermissionRequest): Deleted.
3668         * UIProcess/API/C/WKAPICast.h:
3669         * UIProcess/API/C/WKGeolocationPermissionRequest.cpp:
3670         (WKGeolocationPermissionRequestGetTypeID):
3671         * UIProcess/API/C/WKPage.cpp:
3672         (WKPageSetPageUIClient):
3673         * UIProcess/GeolocationPermissionRequestProxy.cpp:
3674         (WebKit::GeolocationPermissionRequestProxy::allow):
3675         (WebKit::GeolocationPermissionRequestProxy::deny):
3676         (WebKit::GeolocationPermissionRequestProxy::invalidate):
3677         * UIProcess/GeolocationPermissionRequestProxy.h:
3678         (WebKit::GeolocationPermissionRequest::create):
3679         (WebKit::GeolocationPermissionRequest::allow):
3680         (WebKit::GeolocationPermissionRequest::deny):
3681         (WebKit::GeolocationPermissionRequest::GeolocationPermissionRequest):
3682         * UIProcess/PageClient.h:
3683         (WebKit::PageClient::decidePolicyForGeolocationPermissionRequest): Deleted.
3684         * UIProcess/WebPageProxy.cpp:
3685         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
3686         * UIProcess/ios/PageClientImplIOS.h:
3687         * UIProcess/ios/PageClientImplIOS.mm:
3688         (WebKit::Function<void):
3689         (WebKit::PageClientImpl::decidePolicyForGeolocationPermissionRequest): Deleted.
3690         * UIProcess/ios/WKContentView.h:
3691         * UIProcess/ios/WKGeolocationProviderIOS.h:
3692         * UIProcess/ios/WKGeolocationProviderIOS.mm:
3693         (-[WKGeolocationProviderIOS decidePolicyForGeolocationRequestFromOrigin:frame:completionHandler:view:]):
3694         (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
3695         (-[WKGeolocationProviderIOS geolocationAuthorizationDenied]):
3696         (-[WKWebAllowDenyPolicyListener initWithCompletionHandler:]):
3697         (-[WKWebAllowDenyPolicyListener allow]):
3698         (-[WKWebAllowDenyPolicyListener deny]):
3699         (-[WKGeolocationProviderIOS decidePolicyForGeolocationRequestFromOrigin:frame:request:view:]): Deleted.
3700         (-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]): Deleted.
3701
3702 2017-09-07  Alex Christensen  <achristensen@webkit.org>
3703
3704         Allow modern decoding of enums and OptionSets
3705         https://bugs.webkit.org/show_bug.cgi?id=176480
3706
3707         Reviewed by Andy Estes.
3708
3709         * Platform/IPC/ArgumentCoders.h:
3710         (IPC::ArgumentCoder<OptionSet<T>>::decode):
3711         * Platform/IPC/Decoder.h:
3712         (IPC::Decoder::operator>>):
3713         * Platform/IPC/Encoder.h:
3714         * Shared/WebsitePolicies.h:
3715         (WebKit::WebsitePolicies::encode const):
3716         (WebKit::WebsitePolicies::decode):
3717
3718 2017-09-07  Frederic Wang  <fwang@igalia.com>
3719
3720          Move more code from ScrollingTreeScrollingNodeDelegateIOS to ScrollingTreeScrollingNodeDelegate
3721          https://bugs.webkit.org/show_bug.cgi?id=174130
3722
3723          Reviewed by Simon Fraser.
3724
3725          * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.h: Remove some members,
3726          headers and pre-declaration that are moved into the delegate.
3727          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollLayer): Deleted.
3728          * UIProcess/RemoteLayerTree/ios/ScrollingTreeOverflowScrollingNodeIOS.mm: Remove some headers and
3729          WKOverflowScrollViewDelegate since they are moved into the delegate file. Also fix the
3730          comment to closing the WebKit namespace.
3731          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::~ScrollingTreeOverflowScrollingNodeIOS):
3732          Remove some code moved into the delegate and call the corresponding helper function to
3733          preserve the current behavior.
3734          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren): Ditto.
3735          Note that it is only necessary to cast the parameter to a ScrollingStateTreeNode.
3736          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren): Ditto.
3737          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange): Ditto.
3738          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollPosition): Ditto.
3739          (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition): Ditto.
3740          (-[WKOverflowScrollViewDelegate initWithScrollingTreeNodeDelegate:]): Deleted.
3741          (-[WKOverflowScrollViewDelegate scrollViewDidScroll:]): Deleted.
3742          (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]): Deleted.
3743          (-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Deleted.
3744          (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): Deleted.
3745          (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]): Deleted.
3746          * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h: Import headers and members
3747          from ScrollingTreeOverflowScrollingNodeIOS. Define new helper functions for the code imported
3748          from ScrollingTreeOverflowScrollingNodeIOS. Remove the friendship with
3749          ScrollingTreeOverflowScrollingNodeIOS and only makes public the function used by that class.
3750          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollLayer): This function is moved from
3751          ScrollingTreeOverflowScrollingNodeIOS.
3752          * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm: Add headers,
3753          WKOverflowScrollViewDelegate (renamed WKScrollingNodeScrollViewDelegate) and some helper code
3754          imported from ScrollingTreeOverflowScrollingNodeIOS.
3755          (-[WKScrollingNodeScrollViewDelegate scrollViewDidScroll:]): Moved from
3756          ScrollingTreeOverflowScrollingNodeIOS.
3757          (-[WKScrollingNodeScrollViewDelegate scrollViewWillBeginDragging:]): Ditto.
3758          (-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Ditto.
3759          (-[WKScrollingNodeScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]): Ditto.
3760          (-[WKScrollingNodeScrollViewDelegate scrollViewDidEndDecelerating:]): Ditto.
3761          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::~ScrollingTreeScrollingNodeDelegateIOS):
3762          Import code from ScrollingTreeOverflowScrollingNodeIOS.
3763          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::resetScrollViewDelegate): New helper function
3764          importing code from ScrollingTreeOverflowScrollingNodeIOS.
3765          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateBeforeChildren): Ditto.
3766          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren): Ditto.
3767          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::updateLayersAfterAncestorChange): Ditto.
3768          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::scrollPosition): Ditto.
3769          (WebKit::ScrollingTreeScrollingNodeDelegateIOS::setScrollLayerPosition): Ditto.
3770
3771 2017-09-07  Chris Dumez  <cdumez@apple.com>
3772
3773         [WK2] Notify client when downloads are redirected
3774         https://bugs.webkit.org/show_bug.cgi?id=176481
3775         <rdar://problem/34309065>
3776
3777         Reviewed by Geoffrey Garen.
3778
3779         Notify client when downloads are redirected via both ObjC and C
3780         API.
3781
3782         * NetworkProcess/Downloads/Download.cpp:
3783         (WebKit::Download::willSendRedirectedRequest):
3784         * NetworkProcess/Downloads/Download.h:
3785         * NetworkProcess/Downloads/mac/DownloadMac.mm:
3786         (-[WKDownloadAsDelegate download:willSendRequest:redirectResponse:]):
3787         * UIProcess/API/APIDownloadClient.h:
3788         (API::DownloadClient::willSendRequest):
3789         * UIProcess/API/C/WKContext.cpp:
3790         (WKContextSetDownloadClient):
3791         * UIProcess/API/C/WKContextDownloadClient.h:
3792         * UIProcess/API/Cocoa/_WKDownloadDelegate.h:
3793         * UIProcess/Cocoa/DownloadClient.h:
3794         * UIProcess/Cocoa/DownloadClient.mm:
3795         (WebKit::DownloadClient::DownloadClient):
3796         (WebKit::DownloadClient::willSendRequest):
3797         * UIProcess/Downloads/DownloadProxy.cpp:
3798         (WebKit::DownloadProxy::willSendRequest):
3799         * UIProcess/Downloads/DownloadProxy.h:
3800         * UIProcess/Downloads/DownloadProxy.messages.in:
3801
3802         * UIProcess/mac/WebContextMenuProxyMac.mm:
3803         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
3804         Set menu proxy before calling menuFromProposedMenu() client delegate.
3805         This allows me to perform one of the menu item's action from the
3806         menuFromProposedMenu() client delegate in my API test.
3807
3808 2017-09-07  Alex Christensen  <achristensen@webkit.org>
3809
3810         Modernize Geolocation code
3811         https://bugs.webkit.org/show_bug.cgi?id=176496
3812
3813         Reviewed by Andy Estes.
3814
3815         Making the GeolocationPermissionRequestManager take a reference instead of a pointer
3816         spilled into making the other supplement constructors do the same.
3817
3818         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.cpp:
3819         (WebKit::LegacyCustomProtocolManager::LegacyCustomProtocolManager):
3820         (WebKit::LegacyCustomProtocolManager::startLoading):
3821         (WebKit::LegacyCustomProtocolManager::stopLoading):
3822         * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h:
3823         * NetworkProcess/NetworkProcess.h:
3824         (WebKit::NetworkProcess::addSupplement):
3825         * Shared/Authentication/AuthenticationManager.cpp:
3826         (WebKit::AuthenticationManager::AuthenticationManager):
3827         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
3828         * Shared/Authentication/AuthenticationManager.h:
3829         * UIProcess/API/APIUIClient.h:
3830         (API::UIClient::decidePolicyForGeolocationPermissionRequest):
3831         * UIProcess/API/C/WKPage.cpp:
3832         (WKPageSetPageUIClient):
3833         * UIProcess/WebPageProxy.cpp:
3834         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
3835         * WebProcess/Cookies/WebCookieManager.cpp:
3836         (WebKit::WebCookieManager::WebCookieManager):
3837         (WebKit::WebCookieManager::getHostnamesWithCookies):
3838         (WebKit::WebCookieManager::deleteCookie):
3839         (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
3840         (WebKit::WebCookieManager::getAllCookies):
3841         (WebKit::WebCookieManager::getCookies):
3842         (WebKit::WebCookieManager::setCookie):
3843         (WebKit::WebCookieManager::setCookies):
3844         (WebKit::WebCookieManager::notifyCookiesDidChange):
3845         (WebKit::WebCookieManager::setHTTPCookieAcceptPolicy):
3846         (WebKit::WebCookieManager::getHTTPCookieAcceptPolicy):
3847         * WebProcess/Cookies/WebCookieManager.h:
3848         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
3849         (WebKit::GeolocationPermissionRequestManager::GeolocationPermissionRequestManager):
3850         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
3851         (WebKit::GeolocationPermissionRequestManager::cancelRequestForGeolocation):
3852         * WebProcess/Geolocation/GeolocationPermissionRequestManager.h:
3853         * WebProcess/Geolocation/WebGeolocationManager.cpp:
3854         (WebKit::WebGeolocationManager::WebGeolocationManager):
3855         (WebKit::WebGeolocationManager::registerWebPage):
3856         (WebKit::WebGeolocationManager::unregisterWebPage):
3857         (WebKit::WebGeolocationManager::setEnableHighAccuracyForPage):
3858         (WebKit::WebGeolocationManager::didChangePosition):
3859         (WebKit::WebGeolocationManager::didFailToDeterminePosition):
3860         (WebKit::WebGeolocationManager::resetPermissions):
3861         * WebProcess/Geolocation/WebGeolocationManager.h:
3862         * WebProcess/MediaCache/WebMediaKeyStorageManager.h:
3863         (WebKit::WebMediaKeyStorageManager::WebMediaKeyStorageManager):
3864         * WebProcess/Notifications/WebNotificationManager.cpp:
3865         (WebKit::WebNotificationManager::WebNotificationManager):
3866         (WebKit::WebNotificationManager::show):
3867         (WebKit::WebNotificationManager::cancel):
3868         (WebKit::WebNotificationManager::clearNotifications):
3869         (WebKit::WebNotificationManager::didDestroyNotification):
3870         * WebProcess/Notifications/WebNotificationManager.h:
3871         * WebProcess/WebCoreSupport/WebGeolocationClient.cpp:
3872         (WebKit::WebGeolocationClient::requestPermission):
3873         (WebKit::WebGeolocationClient::cancelPermissionRequest):
3874         * WebProcess/WebCoreSupport/WebGeolocationClient.h:
3875         (WebKit::WebGeolocationClient::WebGeolocationClient):
3876         * WebProcess/WebPage/WebPage.cpp:
3877         (WebKit::m_cpuLimit):
3878         * WebProcess/WebProcess.h:
3879         (WebKit::WebProcess::addSupplement):
3880         * WebProcess/cocoa/UserMediaCaptureManager.cpp:
3881         (WebKit::UserMediaCaptureManager::UserMediaCaptureManager):
3882         * WebProcess/cocoa/UserMediaCaptureManager.h:
3883
3884 2017-09-06  Alex Christensen  <achristensen@webkit.org>
3885
3886         Add WKUIDelegatePrivate equivalent of WKPageUIClient's pageDidScroll
3887         https://bugs.webkit.org/show_bug.cgi?id=176482
3888         <rdar://problem/29270035>
3889
3890         Reviewed by Tim Horton.
3891         
3892         Covered by a new API test!
3893
3894         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3895         * UIProcess/Cocoa/UIDelegate.h:
3896         * UIProcess/Cocoa/UIDelegate.mm:
3897         (WebKit::UIDelegate::setDelegate):
3898         (WebKit::UIDelegate::UIClient::pageDidScroll):
3899
3900 2017-09-06  Youenn Fablet  <youenn@apple.com>
3901
3902         NetworkProcess Cache and Caches should be cleared when the last related WebProcess Cache or CacheStorage is destroyed
3903         https://bugs.webkit.org/show_bug.cgi?id=176249
3904
3905         Reviewed by Alex Christensen.
3906
3907         CacheStorageEngineConnection will store the number of Caches references for its related WebProcess.
3908         For a new reference, CacheStorageEngineConnection will notify its engine to lock the related Cache.
3909         When the last reference is gone, CacheStorageEngineConnection will ask the engine to release the lock.
3910
3911         CacheStorageEngine will keep locks as a counter for each Cache object.
3912         When the counter goes to zero, the engine asks the Cache to dispose itself.
3913         Disposal is done by its parent Caches as only Caches knows whether the Cache is persistent or has been removed.
3914
3915         The Caches will remove the Cache from memory.
3916         For removed caches, all information will be lost.
3917         For caches that are not removed, they will keep their identifiers but all in-memory record information will be discarded.
3918         If there is a need to reopen the Cache, it will need to read its information from the filesystem.
3919         If the Caches has no longer any active Cache object, it will ask the engine to release itself.
3920
3921         WebProcess crashing is handled correctly as the CacheStorageEngineConnection will release its locks at destruction
3922         time of the connection to the web process.
3923
3924         Adding the possiblity to grab an engine representation for test purposes.
3925
3926         * NetworkProcess/cache/CacheStorageEngine.cpp:
3927         (WebKit::CacheStorage::Engine::readCachesFromDisk):
3928         (WebKit::CacheStorage::Engine::removeCaches):
3929         (WebKit::CacheStorage::Engine::lock):
3930         (WebKit::CacheStorage::Engine::unlock):
3931         * NetworkProcess/cache/CacheStorageEngine.h:
3932         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
3933         (WebKit::CacheStorage::Cache::Cache):
3934         (WebKit::CacheStorage::Cache::dispose):
3935         (WebKit::CacheStorage::Cache::clearMemoryRepresentation):
3936         * NetworkProcess/cache/CacheStorageEngineCache.h:
3937         (WebKit::CacheStorage::Cache::isActive const):
3938         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
3939         (WebKit::CacheStorage::Caches::Caches):
3940         (WebKit::CacheStorage::Caches::open):
3941         (WebKit::CacheStorage::Caches::dispose):
3942         (WebKit::CacheStorage::Caches::readCachesFromDisk):
3943         (WebKit::CacheStorage::Caches::clearMemoryRepresentation):
3944         * NetworkProcess/cache/CacheStorageEngineCaches.h:
3945         (WebKit::CacheStorage::Caches::create):
3946         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
3947         (WebKit::CacheStorageEngineConnection::~CacheStorageEngineConnection):
3948         (WebKit::CacheStorageEngineConnection::reference):
3949         (WebKit::CacheStorageEngineConnection::dereference):
3950         * NetworkProcess/cache/CacheStorageEngineConnection.h:
3951         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
3952         * WebProcess/Cache/WebCacheStorageConnection.cpp:
3953         (WebKit::WebCacheStorageConnection::reference):
3954         (WebKit::WebCacheStorageConnection::dereference):
3955         * WebProcess/Cache/WebCacheStorageConnection.h:
3956
3957 2017-09-06  Alex Christensen  <achristensen@webkit.org>
3958
3959         Add WKUIDelegatePrivate equivalent of WKPageUIClient's pinnedStateDidChange
3960         https://bugs.webkit.org/show_bug.cgi?id=176474
3961         <rdar://problem/29270035>
3962
3963         Reviewed by Tim Horton.
3964
3965         Rather than telling the UIClient that the pinned state changed and having the application check 4 bools
3966         like we do with WKPage, I made a KVO property on the WKWebView.  I introduce _WKRectEdge for this purpose,
3967         which is like UIRectEdge but unfortunately NSRectEdge and CGRectEdge cannot be used as NS_OPTIONS/flags.
3968         This same structure is used for rubber band state.
3969         
3970         Covered by a new API test.
3971
3972         * UIProcess/API/Cocoa/WKWebView.mm:
3973         (-[WKWebView _pinnedState]):
3974         (-[WKWebView _rubberBandState]):
3975         (-[WKWebView _setRubberBandState:]):
3976         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3977         * UIProcess/Cocoa/WebViewImpl.h:
3978         * UIProcess/Cocoa/WebViewImpl.mm:
3979         (WebKit::WebViewImpl::pinnedState):
3980         (WebKit::WebViewImpl::rubberBandState):
3981         (WebKit::WebViewImpl::setRubberBandState):
3982         * UIProcess/PageClient.h:
3983         (WebKit::PageClient::pinnedStateWillChange):
3984         (WebKit::PageClient::pinnedStateDidChange):
3985         * UIProcess/WebPageProxy.cpp:
3986         (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
3987         * UIProcess/mac/PageClientImplMac.h:
3988         * UIProcess/mac/PageClientImplMac.mm:
3989         (WebKit::PageClientImpl::pinnedStateWillChange):
3990         (WebKit::PageClientImpl::pinnedStateDidChange):
3991
3992 2017-09-06  Youenn Fablet  <youenn@apple.com>
3993
3994         Introduce asynchronous opening of CacheStorageEngine cache
3995         https://bugs.webkit.org/show_bug.cgi?id=176425
3996
3997         Reviewed by Alex Christensen.
3998
3999         Introducing Cache::open to allow reading from the filesystem to fill the Cache.
4000         This is called by Caches when engine requests to open an existing Cache.
4001
4002         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
4003         (WebKit::CacheStorage::Cache::Cache):
4004         (WebKit::CacheStorage::Cache::open):
4005         (WebKit::CacheStorage::Cache::finishOpening):
4006         (WebKit::CacheStorage::Cache::readRecordsList):
4007         * NetworkProcess/cache/CacheStorageEngineCache.h:
4008         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
4009         (WebKit::CacheStorage::Caches::find):
4010         (WebKit::CacheStorage::Caches::open):
4011         (WebKit::CacheStorage::Caches::remove):
4012         (WebKit::CacheStorage::Caches::readCachesFromDisk):
4013         (WebKit::CacheStorage::Caches::find const): Deleted.
4014         * NetworkProcess/cache/CacheStorageEngineCaches.h:
4015
4016 2017-09-06  Alex Christensen  <achristensen@webkit.org>
4017
4018         Unreviewed, rolling out r221694.
4019
4020         broke build
4021
4022         Reverted changeset:
4023
4024         "Add WKUIDelegatePrivate equivalent of WKPageUIClient's
4025         pinnedStateDidChange"
4026         https://bugs.webkit.org/show_bug.cgi?id=176474
4027         http://trac.webkit.org/changeset/221694
4028
4029 2017-09-06  Ryan Haddad  <ryanhaddad@apple.com>
4030
4031         Unreviewed, rolling out r221461.
4032
4033         The LayoutTest added with this change crashes under
4034         GuardMalloc.
4035
4036         Reverted changeset:
4037
4038         "Add (entirely incorrect) fetching of ServiceWorker scripts."
4039         https://bugs.webkit.org/show_bug.cgi?id=176179
4040         http://trac.webkit.org/changeset/221461
4041
4042 2017-09-06  Alex Christensen  <achristensen@webkit.org>
4043
4044         Add modern decoders for POD types
4045         https://bugs.webkit.org/show_bug.cgi?id=176456
4046
4047         Reviewed by Geoffrey Garen.
4048
4049         * Platform/IPC/Decoder.cpp: